forked from NightFyre/Palworld-Internal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdllmain.cpp
More file actions
28 lines (25 loc) · 683 Bytes
/
dllmain.cpp
File metadata and controls
28 lines (25 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include "pch.h"
#include "include/initialize.hpp"
extern DWORD WINAPI MainThread_Initialize(LPVOID dwModule);
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwCallReason, LPVOID lpReserved)
{
g_hModule = hModule;
switch (dwCallReason)
{
case (DLL_PROCESS_ATTACH):
{
DisableThreadLibraryCalls(hModule);
HANDLE hThread = CreateThread(nullptr, 0, MainThread_Initialize, hModule, 0, nullptr);
if (hThread)
CloseHandle(hThread);
break;
}
case (DLL_PROCESS_DETACH):
{
g_KillSwitch = true;
break;
}
}
return true;
}