wineoss mixer DevCaps patch
Robert Reif
reif at earthlink.net
Tue Aug 10 23:04:14 CDT 2004
Only copy number of bytes specified up to size of structure.
-------------- next part --------------
Index: dlls/winmm/wineoss/mixer.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/wineoss/mixer.c,v
retrieving revision 1.22
diff -u -r1.22 mixer.c
--- dlls/winmm/wineoss/mixer.c 7 Oct 2003 22:54:17 -0000 1.22
+++ dlls/winmm/wineoss/mixer.c 11 Aug 2004 04:01:29 -0000
@@ -395,19 +395,22 @@
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;
}
More information about the wine-patches
mailing list