mirror of
https://github.com/ValdikSS/GoodbyeDPI.git
synced 2024-12-22 14:26:08 +00:00
Print error message if filter initialization fails
This commit is contained in:
parent
96fb5f9516
commit
b74c974235
@ -62,9 +62,15 @@ static char* dumb_memmem(const char* haystack, int hlen, const char* needle, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
static HANDLE init(char *filter, UINT64 flags) {
|
static HANDLE init(char *filter, UINT64 flags) {
|
||||||
|
LPTSTR errormessage = NULL;
|
||||||
filter = WinDivertOpen(filter, WINDIVERT_LAYER_NETWORK, 0, flags);
|
filter = WinDivertOpen(filter, WINDIVERT_LAYER_NETWORK, 0, flags);
|
||||||
if (filter != INVALID_HANDLE_VALUE)
|
if (filter != INVALID_HANDLE_VALUE)
|
||||||
return filter;
|
return filter;
|
||||||
|
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
|
||||||
|
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
|
NULL, GetLastError(), MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
|
||||||
|
(LPTSTR)&errormessage, 0, NULL);
|
||||||
|
printf("%s", errormessage);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user