dmloader: Handle NULL and empty path strings in SetSearchDirectory().

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2017-07-25 20:57:18 +02:00 committed by Alexandre Julliard
parent 400cfb0fd9
commit 2e3a8a6fb8
1 changed files with 8 additions and 3 deletions

View File

@ -522,9 +522,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory(IDirectMusicLoad
TRACE("(%p, %s, %s, %d)\n", This, debugstr_dmguid(class), debugstr_w(path), clear);
attr = GetFileAttributesW(path);
if (attr == INVALID_FILE_ATTRIBUTES || !(attr & FILE_ATTRIBUTE_DIRECTORY))
return DMUS_E_LOADER_BADPATH;
if (!path)
return E_POINTER;
if (path[0]) {
attr = GetFileAttributesW(path);
if (attr == INVALID_FILE_ATTRIBUTES || !(attr & FILE_ATTRIBUTE_DIRECTORY))
return DMUS_E_LOADER_BADPATH;
}
if (clear)
FIXME("clear flag ignored\n");