dsound Add uninitialized check.
This commit is contained in:
parent
a8e59b1c52
commit
88ff432164
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue