Commit 78561f3e authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

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

parent 2aff85c9
......@@ -766,13 +766,9 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetCaps(
ICOM_THIS(IDirectSoundBufferImpl,iface);
TRACE("(%p)->(%p)\n",This,caps);
if (caps == NULL)
if (caps == NULL || caps->dwSize!=sizeof(*caps))
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;
if (This->hwbuf) caps->dwFlags |= DSBCAPS_LOCHARDWARE;
else caps->dwFlags |= DSBCAPS_LOCSOFTWARE;
......
......@@ -754,13 +754,9 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCaps(
ICOM_THIS(PrimaryBufferImpl,iface);
TRACE("(%p)->(%p)\n",This,caps);
if (caps == NULL)
if (caps == NULL || caps->dwSize!=sizeof(*caps))
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;
if (This->dsound->hwbuf) caps->dwFlags |= DSBCAPS_LOCHARDWARE;
else caps->dwFlags |= DSBCAPS_LOCSOFTWARE;
......
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