MSACM: preserve value of cbStruct in acmDriverDetails (with tests) - patch 2 of 2

Eric Pouech eric.pouech at wanadoo.fr
Mon Dec 19 14:00:49 CST 2005


Alex Villací­s Lasso wrote:
> BTW, should wine-provided codecs duplicate this behavior?
likely yes

a couple of remarks
> ------------------------------------------------------------------------
> 
> --- wine-0.9.3-cvs/dlls/msacm/driver.c	2005-09-12 10:35:53.000000000 -0500
> +++ wine-0.9.3-cvs-patch/dlls/msacm/driver.c	2005-12-18 22:28:21.000000000 -0500
> @@ -184,6 +184,7 @@
>                               sizeof(padda.szLicensing), NULL, NULL );
>          WideCharToMultiByte( CP_ACP, 0, addw.szFeatures, -1, padda.szFeatures,
>                               sizeof(padda.szFeatures), NULL, NULL );
> +        padda.cbStruct = min(padd->cbStruct, sizeof(*padd));
>          memcpy(padd, &padda, min(padd->cbStruct, sizeof(*padd)));
why don't use reuse padda.cbStruct you've just computed ?
>      }
>      return mmr;
> @@ -217,9 +218,11 @@
>      mmr = acmDriverOpen(&acmDrvr, hadid, 0);
>      if (mmr == MMSYSERR_NOERROR) {
>          ACMDRIVERDETAILSW paddw;
> +        paddw.cbStruct = sizeof(paddw);
>          mmr = (MMRESULT)MSACM_Message(acmDrvr, ACMDM_DRIVER_DETAILS, (LPARAM)&paddw,  0);
>  
>  	acmDriverClose(acmDrvr, 0);
> +        paddw.cbStruct = min(padd->cbStruct, sizeof(*padd));
>          memcpy(padd, &paddw, min(padd->cbStruct, sizeof(*padd)));
ditto
A+
-- 
Eric Pouech




More information about the wine-patches mailing list