-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdllmain.c
More file actions
27 lines (25 loc) · 835 Bytes
/
dllmain.c
File metadata and controls
27 lines (25 loc) · 835 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
/*
* dllmain.c
* This file has no copyright assigned and is placed in the Public Domain.
* This file is a part of the mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within the package.
*
* A stub DllMain function which will be called by DLLs which do not
* have a user supplied DllMain.
*
*/
#include <windows.h>
BOOL WINAPI
DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
/* Since the user didn't supply a DllMain, we might as well
suppress calls to it on thread creation and destruction
(DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications).
Besides the speed optimization, this avoids paging
in DllMain, thus reducing its working code set. */
DisableThreadLibraryCalls (hDll);
}
return TRUE;
}