diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index 0163f8a5ccc..02bf0162f51 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -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; }