From c6a9217c744cc0141f13b2a1c30721e45ce2e40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 25 Nov 2022 23:13:57 +0800 Subject: [PATCH] Windows: silense compiler warnings --- src/detection/os/os_windows.cpp | 3 +-- src/detection/terminalshell/terminalshell_windows.cpp | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detection/os/os_windows.cpp b/src/detection/os/os_windows.cpp index 9f8c2570c..287063449 100644 --- a/src/detection/os/os_windows.cpp +++ b/src/detection/os/os_windows.cpp @@ -31,8 +31,7 @@ static const char* getOsNameByWinbrand(FFstrbuf* osName) //https://dennisbabkin.com/blog/?t=how-to-tell-the-real-version-of-windows-your-app-is-running-on#ver_string if(HMODULE __attribute__((__cleanup__(wrapFreeLibrary))) hWinbrand = LoadLibraryW(L"winbrand.dll")) { - PWSTR(WINAPI* BrandingFormatString)(PCWSTR); - (FARPROC&)BrandingFormatString = GetProcAddress(hWinbrand, "BrandingFormatString"); + auto BrandingFormatString = (PWSTR(WINAPI*)(PCWSTR))GetProcAddress(hWinbrand, "BrandingFormatString"); if(!BrandingFormatString) return "GetProcAddress(BrandingFormatString) failed"; diff --git a/src/detection/terminalshell/terminalshell_windows.cpp b/src/detection/terminalshell/terminalshell_windows.cpp index 135388650..a475643df 100644 --- a/src/detection/terminalshell/terminalshell_windows.cpp +++ b/src/detection/terminalshell/terminalshell_windows.cpp @@ -147,7 +147,8 @@ static uint32_t getShellInfo(FFTerminalShellResult* result, uint32_t pid) if(snapshot) { - MODULEENTRY32W module = { .dwSize = sizeof(module) }; + MODULEENTRY32W module; + module.dwSize = sizeof(module); for(BOOL success = Module32FirstW(snapshot, &module); success; success = Module32NextW(snapshot, &module)) { if(wcsncmp(module.szModule, L"clink_dll_", wcslen(L"clink_dll_")) == 0)