4 * Copyright 1999,2000 - Peter Hunnisett
6 * contact <hunnise@nortelnetworks.com>
10 #include "debugtools.h"
11 #include "dplayx_global.h"
13 DEFAULT_DEBUG_CHANNEL(dplay);
15 /* This is a globally exported variable at ordinal 6 of DPLAYX.DLL */
16 DWORD gdwDPlaySPRefCount = 0; /* FIXME: Should it be initialized here? */
19 BOOL WINAPI DPLAYX_LibMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
22 TRACE( "(%u,0x%08lx,%p)\n", hinstDLL, fdwReason, lpvReserved );
26 case DLL_PROCESS_ATTACH:
27 /* First instance perform construction of global processor data */
28 return DPLAYX_ConstructData();
30 case DLL_PROCESS_DETACH:
31 /* Last instance performs destruction of global processor data */
32 return DPLAYX_DestructData();
34 case DLL_THREAD_ATTACH: /* Do nothing */
35 case DLL_THREAD_DETACH: /* Do nothing */
45 /***********************************************************************
46 * DllCanUnloadNow (DPLAYX.10)
48 HRESULT WINAPI DPLAYX_DllCanUnloadNow(void)
50 HRESULT hr = ( gdwDPlaySPRefCount > 0 ) ? S_FALSE : S_OK;
52 /* FIXME: Should I be putting a check in for class factory objects
56 TRACE( ": returning 0x%08lx\n", hr );