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

Return an error if dwSize is not valid.

No need to dump dwFlags before it is initialized.
parent 6ae2a1f1
No related branches found
No related tags found
No related merge requests found
......@@ -401,15 +401,12 @@ static HRESULT WINAPI IDirectSoundImpl_DuplicateSoundBuffer(
static HRESULT WINAPI IDirectSoundImpl_GetCaps(LPDIRECTSOUND8 iface,LPDSCAPS caps) {
ICOM_THIS(IDirectSoundImpl,iface);
TRACE("(%p,%p)\n",This,caps);
TRACE("(flags=0x%08lx)\n",caps->dwFlags);
if (caps == NULL)
if (caps == NULL || caps->dwSize!=sizeof(*caps))
return DSERR_INVALIDPARAM;
/* We should check this value, not set it. See Inside DirectX, p215. */
caps->dwSize = sizeof(*caps);
caps->dwFlags = This->drvcaps.dwFlags;
TRACE("(flags=0x%08lx)\n",caps->dwFlags);
/* FIXME: copy caps from This->drvcaps */
caps->dwMinSecondarySampleRate = DSBFREQUENCY_MIN;
......
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