try hammering the loader search directory

This commit is contained in:
Cary Sandvig 2001-04-02 22:38:17 +00:00
parent f1eb80a49a
commit 0fa04c0e21
1 changed files with 12 additions and 0 deletions

View File

@ -629,6 +629,18 @@ WinMusic* WinMusic::load_midi(Filename filename) {
if (filename.is_local()) {
fdesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME;
audio_cat->debug() << "is local" << endl;
char szDir[2] = ".";
WCHAR wszDir[2];
MULTI_TO_WIDE(wszDir, szdir);
result = loader->SetSearchDirectory(GUID_DirectMusicAllTypes, wszDir,
FALSE);
if (FAILED(result)) {
audio_cat->error() << "could not set search directory to '.'" << endl;
loader->Release();
delete ret;
ret = (WinMusic*)0L;
return ret;
}
} else {
fdesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH;
audio_cat->debug() << "is not local" << endl;