Release 20030408.
[wine/gsoc-2012-control.git] / dlls / dplayx / dplayx_main.c
blobd2227fe91cf35b958e8904eade1cfa155052ec61
1 /*
2 * DPLAYX.DLL LibMain
4 * Copyright 1999,2000 - Peter Hunnisett
6 * contact <hunnise@nortelnetworks.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "winerror.h"
23 #include "winbase.h"
24 #include "wine/debug.h"
25 #include "dplayx_global.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(dplay);
29 /* This is a globally exported variable at ordinal 6 of DPLAYX.DLL */
30 DWORD gdwDPlaySPRefCount = 0; /* FIXME: Should it be initialized here? */
33 BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
36 TRACE( "(%p,0x%08lx,%p)\n", hinstDLL, fdwReason, lpvReserved );
38 switch ( fdwReason )
40 case DLL_PROCESS_ATTACH:
41 /* First instance perform construction of global processor data */
42 return DPLAYX_ConstructData();
44 case DLL_PROCESS_DETACH:
45 /* Last instance performs destruction of global processor data */
46 return DPLAYX_DestructData();
48 case DLL_THREAD_ATTACH: /* Do nothing */
49 case DLL_THREAD_DETACH: /* Do nothing */
50 break;
51 default:
52 break;
56 return TRUE;
59 /***********************************************************************
60 * DllCanUnloadNow (DPLAYX.10)
62 HRESULT WINAPI DPLAYX_DllCanUnloadNow(void)
64 HRESULT hr = ( gdwDPlaySPRefCount > 0 ) ? S_FALSE : S_OK;
66 /* FIXME: Should I be putting a check in for class factory objects
67 * as well
70 TRACE( ": returning 0x%08lx\n", hr );
72 return hr;