dsound Add uninitialized check.

This commit is contained in:
Robert Reif 2006-01-03 12:11:27 +01:00 committed by Alexandre Julliard
parent a8e59b1c52
commit 88ff432164
1 changed files with 6 additions and 0 deletions

View File

@ -584,10 +584,16 @@ static HRESULT WINAPI IDirectSoundImpl_SetCooperativeLevel(
IDirectSoundImpl *This = (IDirectSoundImpl *)iface;
TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level));
if (This->device == NULL) {
WARN("not initialized\n");
return DSERR_UNINITIALIZED;
}
if (level==DSSCL_PRIORITY || level==DSSCL_EXCLUSIVE) {
WARN("level=%s not fully supported\n",
level==DSSCL_PRIORITY ? "DSSCL_PRIORITY" : "DSSCL_EXCLUSIVE");
}
This->device->priolevel = level;
return DS_OK;
}