ReactOS 0.4.16-dev-736-g28b802b
appcrt_dllmain.cpp File Reference
#include <corecrt_internal.h>
Include dependency graph for appcrt_dllmain.cpp:

Go to the source code of this file.

Functions

static BOOL DllMainProcessAttach ()
 
static BOOL DllMainProcessDetach (bool const terminating)
 
 __declspec (noinline) void __acrt_end_boot()
 
 switch (fdwReason)
 
 __acrt_end_boot ()
 
BOOL WINAPI __acrt_DllMain (HINSTANCE const hInstance, DWORD const fdwReason, LPVOID const lpReserved)
 

Variables

static int __acrt_process_attached = 0
 
static DWORD const fdwReason
 
static DWORD const LPVOID const lpReserved
 
return result
 

Function Documentation

◆ __acrt_DllMain()

BOOL WINAPI __acrt_DllMain ( HINSTANCE const  hInstance,
DWORD const  fdwReason,
LPVOID const  lpReserved 
)

Definition at line 83 of file appcrt_dllmain.cpp.

84{
86 {
87 // The /GS security cookie must be initialized before any exception
88 // handling targeting the current image is registered. No function
89 // using exception handling can be called in the current image until
90 // after __security_init_cookie has been called.
92 }
93
94 // The remainder of the DllMain implementation is in a separate, noinline
95 // function to ensure that no code that might touch the security cookie
96 // runs before the __security_init_cookie function is called. (If code
97 // that uses EH or array-type local variables were to be inlined into
98 // this function, that would cause the compiler to introduce use of the
99 // cookie into this function, before the call to __security_init_cookie.
100 // The separate, noinline function ensures that this does not occur.)
101 return DllMainDispatch(hInstance, fdwReason, lpReserved);
102}
static DWORD const fdwReason
static DWORD const LPVOID const lpReserved
HINSTANCE hInstance
Definition: charmap.c:19
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
void __cdecl __security_init_cookie(void)
Definition: gs_support.c:55

◆ __acrt_end_boot()

__acrt_end_boot ( )

◆ __declspec()

__declspec ( noinline  )

Definition at line 52 of file appcrt_dllmain.cpp.

53{
54 // Do nothing. This function is used to mark the end of the init process.
55}

◆ DllMainProcessAttach()

static BOOL DllMainProcessAttach ( )
static

Definition at line 19 of file appcrt_dllmain.cpp.

20{
21 if (!__vcrt_initialize())
22 return FALSE;
23
24 if (!__acrt_initialize())
25 {
27 return FALSE;
28 }
29
30 // Increment flag indicating the process attach completed successfully:
32 return TRUE;
33}
static int __acrt_process_attached
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
__crt_bool __cdecl __acrt_initialize()
__vcrt_bool __cdecl __vcrt_uninitialize(_In_ __vcrt_bool _Terminating)
Definition: __vcrt_init.c:28
__vcrt_bool __cdecl __vcrt_initialize(void)
Definition: __vcrt_init.c:18

Referenced by switch().

◆ DllMainProcessDetach()

static BOOL DllMainProcessDetach ( bool const  terminating)
static

Definition at line 35 of file appcrt_dllmain.cpp.

36{
37 // If there was no prior process attach or if it failed, return immediately:
39 return FALSE;
40
42 if (!__acrt_uninitialize(terminating))
43 return FALSE;
44
45 // The VCRuntime is uninitialized during the AppCRT uninitialization; we do
46 // not need to uninitialize it here.
47 return TRUE;
48}
__crt_bool __cdecl __acrt_uninitialize(__crt_bool const terminating)

Referenced by switch().

◆ switch()

switch ( fdwReason  )

Definition at line 60 of file appcrt_dllmain.cpp.

61 {
64 break;
65
68 break;
69
72 break;
73
76 break;
77 }
static BOOL DllMainProcessDetach(bool const terminating)
static BOOL DllMainProcessAttach()
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define DLL_THREAD_ATTACH
Definition: compat.h:132
GLuint64EXT * result
Definition: glext.h:11304
__crt_bool __cdecl __acrt_thread_detach()
__crt_bool __cdecl __acrt_thread_attach()

Variable Documentation

◆ __acrt_process_attached

int __acrt_process_attached = 0
static

Definition at line 17 of file appcrt_dllmain.cpp.

Referenced by DllMainProcessAttach(), and DllMainProcessDetach().

◆ fdwReason

◆ lpReserved

◆ result

Definition at line 80 of file appcrt_dllmain.cpp.