2003-07-22 00:10:14 +02:00
|
|
|
/* DirectMusicLoader Main
|
|
|
|
*
|
2004-01-20 01:21:40 +01:00
|
|
|
* Copyright (C) 2003-2004 Rok Mandeljc
|
2003-07-22 00:10:14 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "dmloader_private.h"
|
|
|
|
|
2003-08-23 01:53:27 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
|
2003-07-22 00:10:14 +02:00
|
|
|
|
2004-05-13 02:00:22 +02:00
|
|
|
DWORD dwDirectMusicContainer = 0;
|
|
|
|
DWORD dwDirectMusicLoader = 0;
|
2003-07-22 00:10:14 +02:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* DllMain
|
|
|
|
*/
|
2004-05-13 02:00:22 +02:00
|
|
|
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
|
2004-01-20 01:21:40 +01:00
|
|
|
if (fdwReason == DLL_PROCESS_ATTACH) {
|
2004-05-13 02:00:22 +02:00
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
2003-07-22 00:10:14 +02:00
|
|
|
/* FIXME: Initialisation */
|
2004-05-13 02:00:22 +02:00
|
|
|
} else if (fdwReason == DLL_PROCESS_DETACH) {
|
2003-07-22 00:10:14 +02:00
|
|
|
/* FIXME: Cleanup */
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* DllCanUnloadNow (DMLOADER.1)
|
|
|
|
*/
|
2004-05-13 02:00:22 +02:00
|
|
|
HRESULT WINAPI DMLOADER_DllCanUnloadNow (void) {
|
|
|
|
TRACE("(void)\n");
|
|
|
|
/* if there are no instances left, it's safe to release */
|
|
|
|
if (!dwDirectMusicContainer && !dwDirectMusicLoader)
|
|
|
|
return S_OK;
|
|
|
|
else
|
|
|
|
return S_FALSE;
|
2003-07-22 00:10:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* DllGetClassObject (DMLOADER.2)
|
|
|
|
*/
|
2004-05-13 02:00:22 +02:00
|
|
|
HRESULT WINAPI DMLOADER_DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
|
2004-02-25 02:30:03 +01:00
|
|
|
TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
|
2003-08-23 01:53:27 +02:00
|
|
|
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLoader) && IsEqualIID (riid, &IID_IClassFactory)) {
|
2004-05-13 02:00:22 +02:00
|
|
|
return DMUSIC_CreateDirectMusicLoaderCF (riid, ppv, NULL);
|
2003-08-23 01:53:27 +02:00
|
|
|
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicContainer) && IsEqualIID (riid, &IID_IClassFactory)) {
|
2004-05-13 02:00:22 +02:00
|
|
|
return DMUSIC_CreateDirectMusicContainerCF (riid, ppv, NULL);
|
2003-08-23 01:53:27 +02:00
|
|
|
}
|
|
|
|
|
2004-05-13 02:00:22 +02:00
|
|
|
WARN(": no class found\n");
|
2003-07-22 00:10:14 +02:00
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
}
|