dmloader: Return an error for an invalid directory.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2017-04-27 19:15:29 +02:00 committed by Alexandre Julliard
parent 879c428200
commit a69dbd41be
1 changed files with 6 additions and 0 deletions

View File

@ -518,8 +518,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory(IDirectMusicLoad
{
IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface);
WCHAR current_path[MAX_PATH];
DWORD attr;
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 (clear)
FIXME("clear flag ignored\n");