Michael Stefaniuc : dmloader: Cleanup IDirectMusicLoaderImpl_SetSearchDirectory().

Alexandre Julliard julliard at winehq.org
Thu Apr 27 15:49:11 CDT 2017


Module: wine
Branch: master
Commit: 879c428200bdc0ca16a751dea8fc833032fa7de6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=879c428200bdc0ca16a751dea8fc833032fa7de6

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Thu Apr 27 19:15:28 2017 +0200

dmloader: Cleanup IDirectMusicLoaderImpl_SetSearchDirectory().

and emit a FIXME only if the clear flag is set.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dmloader/loader.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index d644abb..b51c8ad 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -513,18 +513,21 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetObject(IDirectMusicLoader8 *ifac
 	return S_OK;
 }
 
-static HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory(IDirectMusicLoader8 *iface, REFGUID rguidClass, WCHAR *pwzPath, BOOL fClear)
+static HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory(IDirectMusicLoader8 *iface,
+        REFGUID class, WCHAR *path, BOOL clear)
 {
-	IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface);
-	WCHAR wszCurrentPath[MAX_PATH];
-	TRACE("(%p, %s, %s, %d)\n", This, debugstr_dmguid(rguidClass), debugstr_w(pwzPath), fClear);
-	FIXME(": fClear ignored\n");
-	DMUSIC_GetLoaderSettings (iface, rguidClass, wszCurrentPath, NULL);
-	if (!strncmpW(wszCurrentPath, pwzPath, MAX_PATH)) {
-	  return S_FALSE;
-	}
-	/* FIXME: check if path is valid; else return DMUS_E_LOADER_BADPATH */
-	return DMUSIC_SetLoaderSettings (iface, rguidClass, pwzPath, NULL);
+    IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface);
+    WCHAR current_path[MAX_PATH];
+
+    TRACE("(%p, %s, %s, %d)\n", This, debugstr_dmguid(class), debugstr_w(path), clear);
+    if (clear)
+        FIXME("clear flag ignored\n");
+
+    DMUSIC_GetLoaderSettings(iface, class, current_path, NULL);
+    if (!strncmpW(current_path, path, MAX_PATH))
+        return S_FALSE;
+
+    return DMUSIC_SetLoaderSettings(iface, class, path, NULL);
 }
 
 static HRESULT WINAPI IDirectMusicLoaderImpl_ScanDirectory(IDirectMusicLoader8 *iface, REFGUID rguidClass, WCHAR *pwzFileExtension, WCHAR *pwzScanFileName)




More information about the wine-cvs mailing list