Skip to content

Commit c4bbd0b

Browse files
committed
Print human-readable WinDivert error messages
1 parent d9bf7c3 commit c4bbd0b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/goodbyedpi.c

+19-2
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,25 @@ static HANDLE init(char *filter, UINT64 flags) {
296296
(LPTSTR)&errormessage, 0, NULL);
297297
printf("Error opening filter: %s", errormessage);
298298
LocalFree(errormessage);
299-
if (errorcode == 577)
300-
printf("Windows Server 2016 systems must have secure boot disabled to be "
299+
if (errorcode == 2)
300+
printf("The driver files WinDivert32.sys or WinDivert64.sys were not found.\n");
301+
else if (errorcode == 654)
302+
printf("An incompatible version of the WinDivert driver is currently loaded.\n"
303+
"Please unload it with the following commands ran as administrator:\n\n"
304+
"sc stop windivert\n"
305+
"sc delete windivert\n"
306+
"sc stop windivert14"
307+
"sc delete windivert14\n");
308+
else if (errorcode == 1275)
309+
printf("This error occurs for various reasons, including:\n"
310+
"the WinDivert driver is blocked by security software; or\n"
311+
"you are using a virtualization environment that does not support drivers.\n");
312+
else if (errorcode == 1753)
313+
printf("This error occurs when the Base Filtering Engine service has been disabled.\n"
314+
"Enable Base Filtering Engine service.\n");
315+
else if (errorcode == 577)
316+
printf("Could not load driver due to invalid digital signature.\n"
317+
"Windows Server 2016 systems must have secure boot disabled to be \n"
301318
"able to load WinDivert driver.\n"
302319
"Windows 7 systems must be up-to-date or at least have KB3033929 installed.\n"
303320
"https://www.microsoft.com/en-us/download/details.aspx?id=46078\n\n"

0 commit comments

Comments
 (0)