Enable SDK Reentry

This commit is contained in:
Changhua
2022-08-13 23:33:37 +08:00
parent 30853e5c25
commit ab93568598
8 changed files with 72 additions and 45 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
{
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH: {
// MessageBox(NULL, L"InitSpy", L"DllMain", 0);
//MessageBox(NULL, L"InitSpy", L"DllMain", 0);
InitSpy(hModule);
break;
}
@@ -14,7 +14,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH: {
// MessageBox(NULL, L"DestroySpy", L"DllMain", 0);
//MessageBox(NULL, L"DestroySpy", L"DllMain", 0);
DestroySpy();
break;
}
+5 -1
View File
@@ -35,6 +35,10 @@ void InitSpy(HMODULE hModule)
}
}
void DestroySpy() { RpcStopServer(); }
void DestroySpy()
{
RpcStopServer();
FreeLibrary((HMODULE)g_WeChatWinDllAddr);
}
int IsLogin(void) { return (int)GET_DWORD(g_WeChatWinDllAddr + g_WxCalls.login); }