From 17a8372302f70b1344e3dc6a1a576006cb2715a6 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Wed, 11 Aug 2004 18:48:46 +0000 Subject: [PATCH] Only copy number of bytes specified up to size of DevCaps structure. --- dlls/winmm/wineoss/mixer.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/winmm/wineoss/mixer.c b/dlls/winmm/wineoss/mixer.c index 321542af126..47a08415e2b 100644 --- a/dlls/winmm/wineoss/mixer.c +++ b/dlls/winmm/wineoss/mixer.c @@ -395,19 +395,22 @@ static BOOL MIX_SetRecSrc(struct mixer* mix, unsigned mask) static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPSA lpCaps, DWORD dwSize) { struct mixer* mix; + MIXERCAPSA capsA; TRACE("(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize); if (lpCaps == NULL) return MMSYSERR_INVALPARAM; if (!(mix = MIX_Get(wDevID))) return MMSYSERR_BADDEVICEID; - lpCaps->wMid = WINE_MIXER_MANUF_ID; - lpCaps->wPid = WINE_MIXER_PRODUCT_ID; - lpCaps->vDriverVersion = WINE_MIXER_VERSION; - strcpy(lpCaps->szPname, WINE_MIXER_NAME); + capsA.wMid = WINE_MIXER_MANUF_ID; + capsA.wPid = WINE_MIXER_PRODUCT_ID; + capsA.vDriverVersion = WINE_MIXER_VERSION; + strcpy(capsA.szPname, WINE_MIXER_NAME); - lpCaps->cDestinations = 2; /* speakers & record */ - lpCaps->fdwSupport = 0; /* No bits defined yet */ + capsA.cDestinations = 2; /* speakers & record */ + capsA.fdwSupport = 0; /* No bits defined yet */ + + memcpy(lpCaps, &capsA, min(dwSize, sizeof(capsA))); return MMSYSERR_NOERROR; }