[GDIPLUS] Sync with Wine Staging 3.9. CORE-14656
[reactos.git] / dll / opengl / opengl32 / dllmain.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS
4 * FILE: dll/opengl/opengl32/dllmain.c
5 * PURPOSE: OpenGL32 DLL
6 */
7
8 #include "opengl32.h"
9
10 BOOL WINAPI
11 DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
12 {
13 switch ( Reason )
14 {
15 case DLL_PROCESS_ATTACH:
16 /* Initialize Context list */
17 InitializeListHead(&ContextListHead);
18 /* no break */
19 case DLL_THREAD_ATTACH:
20 break;
21
22 case DLL_THREAD_DETACH:
23 /* Set NULL context for this thread */
24 wglMakeCurrent(NULL, NULL);
25 break;
26 case DLL_PROCESS_DETACH:
27 /* Clean up */
28 if (!Reserved)
29 {
30 /* The process is not shutting down: release everything */
31 wglMakeCurrent(NULL, NULL);
32 IntDeleteAllContexts();
33 IntDeleteAllICDs();
34 }
35 break;
36 }
37
38 return TRUE;
39 }