[dmusic-01] some stubs implementation

Raphaël Junqueira fenix at club-internet.fr
Sat May 31 04:57:33 CDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi folks,

I'm trying to get Unreal2 working, with no sound it continue to access some 
dmusic stubs and crash. With this it crash later than befor (in dmusic too).
If anyone can help to really improve dmusic support as we need a real 
implementation of IDirectMusicPerformance8

Else, anyone know how to force an application to not use dmusic (saying that 
it's not supported) ?

Changelog:
 - some implementation of dmusic stubs

Regards,
Raphael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+2HyRp7NA3AmQTU4RAphSAJ4k6JEXzMWTk2YkgZe64x24AcNOAwCdHC1g
EbX3xX1cR1a7fnTzDteoI0Q=
=z3AZ
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: dmusic.c
===================================================================
RCS file: /home/wine/wine/dlls/dmusic/dmusic.c,v
retrieving revision 1.7
diff -u -r1.7 dmusic.c
--- dmusic.c	6 May 2003 00:14:31 -0000	1.7
+++ dmusic.c	31 May 2003 09:38:23 -0000
@@ -46,7 +46,6 @@
 HRESULT WINAPI IDirectMusicImpl_QueryInterface (LPDIRECTMUSIC iface, REFIID riid, LPVOID *ppobj)
 {
 	ICOM_THIS(IDirectMusicImpl,iface);
-
 	if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusic))
 	{
 		IDirectMusicImpl_AddRef(iface);
Index: dmusic_loader.c
===================================================================
RCS file: /home/wine/wine/dlls/dmusic/dmusic_loader.c,v
retrieving revision 1.2
diff -u -r1.2 dmusic_loader.c
--- dmusic_loader.c	4 May 2003 02:26:03 -0000	1.2
+++ dmusic_loader.c	31 May 2003 09:38:54 -0000
@@ -64,9 +64,10 @@
 }
 
 /* IDirectMusicLoader Interface follow: */
-HRESULT WINAPI IDirectMusicLoaderImpl_GetObject (LPDIRECTMUSICLOADER iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID*ppv)
+HRESULT WINAPI IDirectMusicLoaderImpl_GetObject (LPDIRECTMUSICLOADER iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID* ppv)
 {
 	FIXME("stub\n");
+	*ppv = NULL;
 	return DS_OK;
 }
 
@@ -78,7 +79,12 @@
 
 HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory (LPDIRECTMUSICLOADER iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear)
 {
-	FIXME("stub\n");
+	ICOM_THIS(IDirectMusicLoaderImpl,iface);
+	FIXME("verify\n");
+        if (0 == wcsncmp(This->searchPath, pwzPath, MAX_PATH)) {
+	  return S_FALSE;
+	} 
+	wcscpy(This, This->searchPath, pwzPath);
 	return DS_OK;
 }
 
@@ -185,8 +191,8 @@
 
 HRESULT WINAPI IDirectMusicLoader8Impl_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear)
 {
-	FIXME("stub\n");
-	return DS_OK;
+	FIXME("forward to IDirectMusicLoaderImpl::SetSearchDirectory\n");
+        return IDirectMusicLoaderImpl_SetSearchDirectory((LPDIRECTMUSICLOADER) iface, rguidClass, pwzPath, fClear);
 }
 
 HRESULT WINAPI IDirectMusicLoader8Impl_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName)
@@ -265,7 +271,7 @@
 
 HRESULT WINAPI DMUSIC_CreateDirectMusicLoader8 (LPCGUID lpcGUID, LPDIRECTMUSICLOADER8 *ppDMLoad8, LPUNKNOWN pUnkOuter)
 {
-	IDirectMusicLoader8Impl *dmloader8;
+	IDirectMusicLoader8Impl* dmloader8;
 
 	TRACE("(%p,%p,%p)\n",lpcGUID, ppDMLoad8, pUnkOuter);
 	if (IsEqualGUID(lpcGUID, &IID_IDirectMusicLoader8))
Index: dmusic_misc.c
===================================================================
RCS file: /home/wine/wine/dlls/dmusic/dmusic_misc.c,v
retrieving revision 1.1
diff -u -r1.1 dmusic_misc.c
--- dmusic_misc.c	8 Apr 2003 21:42:00 -0000	1.1
+++ dmusic_misc.c	31 May 2003 09:38:59 -0000
@@ -197,7 +197,8 @@
 HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, WORD dwIndex, REFGUID iidInterface, void** ppObject)
 {
 	FIXME("stub\n");
-	return DS_OK;
+	*ppObject = NULL;
+	return DSERR_INVALIDCALL;
 }
 
 HRESULT WINAPI IDirectMusicAudioPathImpl_Activate (LPDIRECTMUSICAUDIOPATH iface, BOOL fActivate)
@@ -220,11 +221,14 @@
 
 ICOM_VTABLE(IDirectMusicAudioPath) DirectMusicAudioPath_Vtbl =
 {
-    ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
-	IDirectMusicAudioPathImpl_QueryInterface,
-	IDirectMusicAudioPathImpl_AddRef,
-	IDirectMusicAudioPathImpl_Release,
-
+  ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+  IDirectMusicAudioPathImpl_QueryInterface,
+  IDirectMusicAudioPathImpl_AddRef,
+  IDirectMusicAudioPathImpl_Release,
+  IDirectMusicAudioPathImpl_GetObjectInPath,
+  IDirectMusicAudioPathImpl_Activate,
+  IDirectMusicAudioPathImpl_SetVolume,
+  IDirectMusicAudioPathImpl_ConvertPChannel
 };
 
 
Index: dmusic_performance.c
===================================================================
RCS file: /home/wine/wine/dlls/dmusic/dmusic_performance.c,v
retrieving revision 1.4
diff -u -r1.4 dmusic_performance.c
--- dmusic_performance.c	6 May 2003 00:14:31 -0000	1.4
+++ dmusic_performance.c	31 May 2003 09:39:03 -0000
@@ -455,8 +455,8 @@
 /* IDirectMusicPerformance Interface part follow: */
 HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusic** ppDirectMusic, LPDIRECTSOUND pDirectSound, HWND hWnd)
 {
-	FIXME("stub\n");
-	return DS_OK;
+	FIXME("forward to IDirectMusicPerformanceImpl::Init\n");
+        return IDirectMusicPerformanceImpl_Init((LPDIRECTMUSICPERFORMANCE) iface, ppDirectMusic, pDirectSound, hWnd);
 }
 
 HRESULT WINAPI IDirectMusicPerformance8Impl_PlaySegment (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState)
@@ -726,30 +726,49 @@
 
 HRESULT WINAPI IDirectMusicPerformance8ImplCreateAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSourceConfig, BOOL fActivate, IDirectMusicAudioPath** ppNewPath)
 {
+	ICOM_THIS(IDirectMusicPerformance8Impl,iface);
 	FIXME("stub\n");
 	return DS_OK;
 }
 
 HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwType, DWORD dwPChannelCount, BOOL fActivate, IDirectMusicAudioPath** ppNewPath)
 {
+	ICOM_THIS(IDirectMusicPerformance8Impl,iface);
 	FIXME("stub\n");
-	return DS_OK;
+	return DSERR_INVALIDCALL;
 }
 
 HRESULT WINAPI IDirectMusicPerformance8ImplSetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath* pAudioPath)
 {
+	ICOM_THIS(IDirectMusicPerformance8Impl,iface);
 	FIXME("stub\n");
+	if (NULL != This->default_path) {
+	  IDirectMusicAudioPathImpl_Release((LPDIRECTMUSICAUDIOPATH) This->default_path);
+	  This->default_path = NULL;
+	}
+	This->default_path = (IDirectMusicAudioPathImpl*) pAudioPath;
+	if (NULL != This->default_path) {
+	  IDirectMusicAudioPathImpl_AddRef((LPDIRECTMUSICAUDIOPATH) This->default_path);
+	}
 	return DS_OK;
 }
 
 HRESULT WINAPI IDirectMusicPerformance8ImplGetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath** ppAudioPath)
 {
+	ICOM_THIS(IDirectMusicPerformance8Impl,iface);
 	FIXME("stub\n");
+	if (NULL != This->default_path) {
+	  *ppAudioPath = (LPDIRECTMUSICAUDIOPATH) This->default_path;
+	  IDirectMusicAudioPathImpl_AddRef(*ppAudioPath);
+	} else {
+	  This->default_path = NULL;
+	}
 	return DS_OK;
 }
 
 HRESULT WINAPI IDirectMusicPerformance8ImplGetParamEx (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwTrackID, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
 {
+	ICOM_THIS(IDirectMusicPerformance8Impl,iface);
 	FIXME("stub\n");
 	return DS_OK;
 }
@@ -828,6 +847,12 @@
 		}
 		pPerf8->lpVtbl = &DirectMusicPerformance8_Vtbl;
 		pPerf8->ref = 1;
+
+		IDirectMusicAudioPathImpl* default_path = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAudioPathImpl));
+		default_path->lpVtbl = &DirectMusicAudioPath_Vtbl;
+		default_path->ref = 1;
+		pPerf8->default_path = default_path;
+
 		*ppDMPerf8 = (LPDIRECTMUSICPERFORMANCE8)pPerf8;
 		return S_OK;
 	}
Index: dmusic_private.h
===================================================================
RCS file: /home/wine/wine/dlls/dmusic/dmusic_private.h,v
retrieving revision 1.6
diff -u -r1.6 dmusic_private.h
--- dmusic_private.h	6 May 2003 00:14:31 -0000	1.6
+++ dmusic_private.h	31 May 2003 09:39:17 -0000
@@ -662,6 +662,7 @@
   DWORD          ref;
 
   /* IDirectMusicLoaderImpl fields */
+  WCHAR          searchPath[MAX_PATH];
 };
 
 /* IUnknown: */
@@ -688,7 +689,9 @@
   ICOM_VFIELD(IDirectMusicLoader8);
   DWORD          ref;
 
-  /* IDirectMusicLoader8Impl fields */
+  /* IDirectMusicLoaderImpl fields */ 
+  WCHAR          searchPath[MAX_PATH];
+  /* IDirectMusicLoader8Impl fields */ 
 };
 
 /* IUnknown: */
@@ -962,7 +965,11 @@
   ICOM_VFIELD(IDirectMusicPerformance8);
   DWORD          ref;
 
+  /* IDirectMusicPerformanceImpl fields */
+  IDirectMusicImpl *dmusic;
+  IDirectSound *dsound;
   /* IDirectMusicPerformance8Impl fields */
+  IDirectMusicAudioPath* default_path;
 };
 
 /* IUnknown: */


More information about the wine-patches mailing list