Windows: silense compiler warnings

This commit is contained in:
李通洲
2022-11-25 23:13:57 +08:00
parent 34d3021b80
commit c6a9217c74
2 changed files with 3 additions and 3 deletions
+1 -2
View File
@@ -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";
@@ -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)