Commit 14266328 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Check the return value of IDirectSoundImpl_Create() to detect errors.

Always set *ppDS to NULL in case of error.
parent 0bbe9121
......@@ -757,6 +757,7 @@ HRESULT WINAPI IDirectSoundImpl_Create(
if (found == FALSE) {
WARN("No device found matching given ID!\n");
*ppDS = NULL;
return DSERR_NODRIVER;
}
......@@ -1641,7 +1642,7 @@ HRESULT WINAPI DSOUND_Create(
} else {
LPDIRECTSOUND8 pDS;
hr = IDirectSoundImpl_Create(&devGuid, &pDS);
if (pDS) {
if (hr == DS_OK) {
hr = DSOUND_PrimaryCreate((IDirectSoundImpl*)pDS);
if (hr == DS_OK) {
hr = IDirectSound_IDirectSound_Create(pDS, ppDS);
......@@ -1746,7 +1747,7 @@ HRESULT WINAPI DSOUND_Create8(
} else {
LPDIRECTSOUND8 pDS;
hr = IDirectSoundImpl_Create(&devGuid, &pDS);
if (pDS) {
if (hr == DS_OK) {
hr = DSOUND_PrimaryCreate((IDirectSoundImpl*)pDS);
if (hr == DS_OK) {
hr = IDirectSound8_IDirectSound8_Create(pDS, ppDS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment