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

This commit is contained in:
Francois Gouget 2002-12-13 20:26:23 +00:00 committed by Alexandre Julliard
parent 2aff85c9c8
commit 78561f3eb3
2 changed files with 2 additions and 10 deletions

View file

@ -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;

View file

@ -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;