From 60eadc9002b4562d1e3645e782cf6ba60093ac0d Mon Sep 17 00:00:00 2001 From: bol-van Date: Mon, 6 May 2024 16:08:03 +0300 Subject: [PATCH] winws: FormatMessageA --- nfq/darkmagic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nfq/darkmagic.c b/nfq/darkmagic.c index cb6115b..cab4ccc 100644 --- a/nfq/darkmagic.c +++ b/nfq/darkmagic.c @@ -963,7 +963,7 @@ uint32_t w_win32_error=0; static HANDLE windivert_init_filter(const char *filter, UINT64 flags) { - LPTSTR errormessage = NULL; + LPSTR errormessage = NULL; DWORD errorcode = 0; HANDLE h, hMutex; const char *mutex_name = "Global\\winws_windivert_mutex"; @@ -984,8 +984,8 @@ static HANDLE windivert_init_filter(const char *filter, UINT64 flags) if (h != INVALID_HANDLE_VALUE) return h; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, w_win32_error, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), (LPTSTR)&errormessage, 0, NULL); + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, w_win32_error, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), (LPSTR)&errormessage, 0, NULL); fprintf(stderr, "windivert: error opening filter: %s", errormessage); LocalFree(errormessage); if (w_win32_error == ERROR_INVALID_IMAGE_HASH)