From 02d3a70574566e78ae840913e555eeb50ed2f226 Mon Sep 17 00:00:00 2001 From: otavepto <153766569+otavepto@users.noreply.github.com> Date: Fri, 24 May 2024 07:06:15 +0300 Subject: [PATCH] fix compilation of steamclient_extra on msys2 --- premake5.lua | 4 ++-- .../win/extra_protection/stubdrm.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/premake5.lua b/premake5.lua index 1e1c84a5..05c18e9b 100644 --- a/premake5.lua +++ b/premake5.lua @@ -348,10 +348,10 @@ filter { "action:vs*", } -- GNU make common compiler/linker options filter { "action:gmake*", } buildoptions { - "-fvisibility=hidden", "-fexceptions", "-fno-jump-tables" , "-Wno-switch" + "-fvisibility=hidden", "-fexceptions", "-fno-jump-tables" , "-Wno-switch", } linkoptions { - "-Wl,--exclude-libs,ALL" + "-Wl,--exclude-libs,ALL", } -- this is made separate because GCC complains but not CLANG filter { "action:gmake*" , "files:*.cpp or *.cc or *.hpp", } diff --git a/tools/steamclient_loader/win/extra_protection/stubdrm.cpp b/tools/steamclient_loader/win/extra_protection/stubdrm.cpp index d6f6bcf0..74dfb45c 100644 --- a/tools/steamclient_loader/win/extra_protection/stubdrm.cpp +++ b/tools/steamclient_loader/win/extra_protection/stubdrm.cpp @@ -129,7 +129,7 @@ static uint8_t *exe_addr_base = (uint8_t *)GetModuleHandleW(NULL); static uint8_t *bind_addr_base = nullptr; static uint8_t *bind_addr_end = nullptr; -bool restore_win32_apis(); +static bool restore_win32_apis(); // stub v2 needs manual change for .text, section must have write access static void change_mem_pages_access() @@ -256,9 +256,9 @@ static bool redirect_win32_apis() if (DetourTransactionBegin() != NO_ERROR) return false; if (DetourUpdateThread(GetCurrentThread()) != NO_ERROR) return false; - if (DetourAttach((PVOID *)&actual_GetTickCount, GetTickCount_hook) != NO_ERROR) return false; - if (DetourAttach((PVOID *)&actual_GetModuleHandleA, GetModuleHandleA_hook) != NO_ERROR) return false; - if (DetourAttach((PVOID *)&actual_GetModuleHandleExA, GetModuleHandleExA_hook) != NO_ERROR) return false; + if (DetourAttach((PVOID *)&actual_GetTickCount, (PVOID)GetTickCount_hook) != NO_ERROR) return false; + if (DetourAttach((PVOID *)&actual_GetModuleHandleA, (PVOID)GetModuleHandleA_hook) != NO_ERROR) return false; + if (DetourAttach((PVOID *)&actual_GetModuleHandleExA, (PVOID)GetModuleHandleExA_hook) != NO_ERROR) return false; bool ret = DetourTransactionCommit() == NO_ERROR; if (ret) { GetTickCount_hooked = true; @@ -277,9 +277,9 @@ static bool restore_win32_apis() if (DetourTransactionBegin() != NO_ERROR) return false; if (DetourUpdateThread(GetCurrentThread()) != NO_ERROR) return false; - DetourDetach((PVOID *)&actual_GetTickCount, GetTickCount_hook); - DetourDetach((PVOID *)&actual_GetModuleHandleA, GetModuleHandleA_hook); - DetourDetach((PVOID *)&actual_GetModuleHandleExA, GetModuleHandleExA_hook); + DetourDetach((PVOID *)&actual_GetTickCount, (PVOID)GetTickCount_hook); + DetourDetach((PVOID *)&actual_GetModuleHandleA, (PVOID)GetModuleHandleA_hook); + DetourDetach((PVOID *)&actual_GetModuleHandleExA, (PVOID)GetModuleHandleExA_hook); return DetourTransactionCommit() == NO_ERROR; }