Skip to content
Snippets Groups Projects
Commit 78561f3e authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard
Browse files

IDirectSoundBuffer.GetCaps should fail if caps.dwSize is not set.

parent 2aff85c9
No related branches found
No related tags found
No related merge requests found
...@@ -766,13 +766,9 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetCaps( ...@@ -766,13 +766,9 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetCaps(
ICOM_THIS(IDirectSoundBufferImpl,iface); ICOM_THIS(IDirectSoundBufferImpl,iface);
TRACE("(%p)->(%p)\n",This,caps); TRACE("(%p)->(%p)\n",This,caps);
if (caps == NULL) if (caps == NULL || caps->dwSize!=sizeof(*caps))
return DSERR_INVALIDPARAM; return DSERR_INVALIDPARAM;
/* I think we should check this value, not set it. See */
/* Inside DirectX, p215. That should apply here, too. */
caps->dwSize = sizeof(*caps);
caps->dwFlags = This->dsbd.dwFlags; caps->dwFlags = This->dsbd.dwFlags;
if (This->hwbuf) caps->dwFlags |= DSBCAPS_LOCHARDWARE; if (This->hwbuf) caps->dwFlags |= DSBCAPS_LOCHARDWARE;
else caps->dwFlags |= DSBCAPS_LOCSOFTWARE; else caps->dwFlags |= DSBCAPS_LOCSOFTWARE;
......
...@@ -754,13 +754,9 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCaps( ...@@ -754,13 +754,9 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCaps(
ICOM_THIS(PrimaryBufferImpl,iface); ICOM_THIS(PrimaryBufferImpl,iface);
TRACE("(%p)->(%p)\n",This,caps); TRACE("(%p)->(%p)\n",This,caps);
if (caps == NULL) if (caps == NULL || caps->dwSize!=sizeof(*caps))
return DSERR_INVALIDPARAM; return DSERR_INVALIDPARAM;
/* I think we should check this value, not set it. See */
/* Inside DirectX, p215. That should apply here, too. */
caps->dwSize = sizeof(*caps);
caps->dwFlags = This->dsbd.dwFlags; caps->dwFlags = This->dsbd.dwFlags;
if (This->dsound->hwbuf) caps->dwFlags |= DSBCAPS_LOCHARDWARE; if (This->dsound->hwbuf) caps->dwFlags |= DSBCAPS_LOCHARDWARE;
else caps->dwFlags |= DSBCAPS_LOCSOFTWARE; else caps->dwFlags |= DSBCAPS_LOCSOFTWARE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment