[DSOUND] add uninitialized check
Robert Reif
reif at earthlink.net
Mon Jan 2 21:40:28 CST 2006
Add uninitialized check.
-------------- next part --------------
Index: dlls/dsound/dsound.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/dsound.c,v
retrieving revision 1.42
diff -p -u -r1.42 dsound.c
--- dlls/dsound/dsound.c 19 Oct 2005 19:21:38 -0000 1.42
+++ dlls/dsound/dsound.c 3 Jan 2006 03:39:54 -0000
@@ -584,10 +584,16 @@ static HRESULT WINAPI IDirectSoundImpl_S
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;
}
More information about the wine-patches
mailing list