dsound: Handle failing of obtaining IDsDriverNotify.

This commit is contained in:
Maarten Lankhorst 2007-08-15 16:43:41 +02:00 committed by Alexandre Julliard
parent 0dcebea44d
commit b42287ca66
1 changed files with 3 additions and 2 deletions

View File

@ -765,17 +765,18 @@ IDirectSoundCaptureBufferImpl_QueryInterface(
if (!This->notify) if (!This->notify)
hres = IDirectSoundCaptureNotifyImpl_Create(This, &This->notify); hres = IDirectSoundCaptureNotifyImpl_Create(This, &This->notify);
if (This->notify) { if (This->notify) {
if (This->device->hwbuf) { IDirectSoundNotify_AddRef((LPDIRECTSOUNDNOTIFY)This->notify);
if (This->device->hwbuf && !This->hwnotify) {
hres = IDsCaptureDriverBuffer_QueryInterface(This->device->hwbuf, hres = IDsCaptureDriverBuffer_QueryInterface(This->device->hwbuf,
&IID_IDsDriverNotify, (LPVOID*)&(This->hwnotify)); &IID_IDsDriverNotify, (LPVOID*)&(This->hwnotify));
if (hres != DS_OK) { if (hres != DS_OK) {
WARN("IDsCaptureDriverBuffer_QueryInterface failed\n"); WARN("IDsCaptureDriverBuffer_QueryInterface failed\n");
IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify);
*ppobj = 0; *ppobj = 0;
return hres; return hres;
} }
} }
IDirectSoundNotify_AddRef((LPDIRECTSOUNDNOTIFY)This->notify);
*ppobj = (LPVOID)This->notify; *ppobj = (LPVOID)This->notify;
return DS_OK; return DS_OK;
} }