Commit 2e3a8a6f authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent 400cfb0f
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment