4 * Copyright 1999 - Peter Hunnisett
6 * contact <hunnise@nortelnetworks.com>
10 #include "debugtools.h"
11 #include "dplayx_global.h"
13 DEFAULT_DEBUG_CHANNEL(dplay)
15 static DWORD DPLAYX_dwProcessesAttached = 0;
17 BOOL WINAPI DPLAYX_LibMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
21 case DLL_PROCESS_ATTACH:
24 if ( DPLAYX_dwProcessesAttached == 0 )
26 /* First instance perform construction of global processor data */
27 DPLAYX_ConstructData();
30 DPLAYX_dwProcessesAttached++;
35 case DLL_PROCESS_DETACH:
38 DPLAYX_dwProcessesAttached--;
40 if ( DPLAYX_dwProcessesAttached == 0 )
42 /* Last instance perform destruction of global processor data */
43 DPLAYX_DestructData();
49 case DLL_THREAD_ATTACH: /* Do nothing */
50 case DLL_THREAD_DETACH: /* Do nothing */