Skip to content

Commit

Permalink
Invoke DisableThreadLibraryCalls in DllMain
Browse files Browse the repository at this point in the history
  • Loading branch information
cathyjf committed Apr 4, 2022
1 parent 6706d60 commit 2b995aa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/dllmain.cpp
Expand Up @@ -244,6 +244,7 @@ DWORD WINAPI ThreadProc(LPVOID lpParameter) {
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID) {
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH: {
DisableThreadLibraryCalls(hModule);
ThreadData *const pData = new ThreadData{ hModule };
const HANDLE hThread = CreateThread(
NULL, 0, ThreadProc, pData, 0, NULL /*lpThreadId*/);
Expand Down

0 comments on commit 2b995aa

Please sign in to comment.