Added error checking to IDirectSound_Compact.

Fixed IDirectSoundImpl_Create to return DSERR_NODRIVER for a bad
device IID.
This commit is contained in:
Robert Reif 2004-07-30 18:42:23 +00:00 committed by Alexandre Julliard
parent b0da80eda1
commit b6ab40e977
1 changed files with 12 additions and 2 deletions

View File

@ -612,6 +612,16 @@ static HRESULT WINAPI IDirectSoundImpl_Compact(
ICOM_THIS(IDirectSoundImpl,iface);
TRACE("(%p)\n",This);
if (This->initialized == FALSE) {
WARN("not initialized\n");
return DSERR_UNINITIALIZED;
}
if (This->priolevel != DSSCL_PRIORITY) {
WARN("incorrect priority level\n");
return DSERR_PRIOLEVELNEEDED;
}
return DS_OK;
}
@ -746,8 +756,8 @@ HRESULT WINAPI IDirectSoundImpl_Create(
}
if (found == FALSE) {
WARN("No device found matching given ID - trying with default one !\n");
wod = ds_default_playback;
WARN("No device found matching given ID!\n");
return DSERR_NODRIVER;
}
/* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */