xref: /reactos/dll/win32/advapi32/misc/dllmain.c (revision ba3f0743)
1 /*
2  * COPYRIGHT:       See COPYING in the top level directory
3  * PROJECT:         ReactOS system libraries
4  * FILE:            lib/advapi32/misc/dllmain.c
5  * PURPOSE:         Library main function
6  * PROGRAMMER:      ???
7  * UPDATE HISTORY:
8  *                  Created ???
9  */
10 
11 #include <advapi32.h>
12 
13 extern BOOL RegInitialize(VOID);
14 extern BOOL RegCleanup(VOID);
15 extern VOID UnloadNtMarta(VOID);
16 extern VOID CloseKsecDdHandle(VOID);
17 
18 BOOL
19 WINAPI
20 DllMain(
21     HINSTANCE hinstDll,
22     DWORD dwReason,
23     LPVOID reserved)
24 {
25     switch (dwReason)
26     {
27         case DLL_PROCESS_ATTACH:
28             DisableThreadLibraryCalls(hinstDll);
29             RegInitialize();
30             break;
31 
32         case DLL_PROCESS_DETACH:
33             CloseLogonLsaHandle();
34             RegCleanup();
35             UnloadNtMarta();
36             CloseKsecDdHandle();
37             break;
38     }
39 
40     return TRUE;
41 }
42 
43 /* EOF */
44