Print errorcode in WinDivert error message

This commit is contained in:
ValdikSS 2024-08-02 17:45:49 +03:00
parent 74822fca16
commit abcca5ea84

View File

@ -294,7 +294,7 @@ static HANDLE init(char *filter, UINT64 flags) {
FORMAT_MESSAGE_IGNORE_INSERTS, FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errorcode, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), NULL, errorcode, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
(LPTSTR)&errormessage, 0, NULL); (LPTSTR)&errormessage, 0, NULL);
printf("Error opening filter: %s", errormessage); printf("Error opening filter: %d %s\n", errorcode, errormessage);
LocalFree(errormessage); LocalFree(errormessage);
if (errorcode == 2) if (errorcode == 2)
printf("The driver files WinDivert32.sys or WinDivert64.sys were not found.\n"); printf("The driver files WinDivert32.sys or WinDivert64.sys were not found.\n");