Skip to content

Commit

Permalink
Pin current module
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Sep 11, 2024
1 parent 8e9ebef commit bf1bcad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7136
#define BUILD_NUMBER 7137
4 changes: 4 additions & 0 deletions Dllmain/Dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID lpReserved)
// Get handle
hModule_dll = hModule;

// Pin current module
HMODULE dummy = nullptr;
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_PIN | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCSTR>(DllMain), &dummy);

// Initialize config
Config.Init();

Expand Down

0 comments on commit bf1bcad

Please sign in to comment.