MSACM: preserve value of cbStruct in acmDriverDetails (with tests)
- patch 2 of 2
Alex Villacís Lasso
a_villacis at palosanto.com
Mon Dec 19 11:45:55 CST 2005
I have been playing with a sample application from MSDN called ACMAPP,
which is an example of the msacm32 API, and which exposes a number of
bugs in the wine version of msacm32. The first bug is that
acmDriverDetails[AW] is supposed to preserve the value of cbStruct
member of the ACMDRIVERDETAILS[AW] struct, if at all possible. The
example MSDN app displays a bogus value as the returned size of the data
for acmDriverDetails otherwise.
This patch fixes the cbStruct value before returning from
acmDriverDetails[AW], and also fixes a second bug. In addition to
builtin codecs provided by wine, it seems possible to install native
codecs designed for Windows. However, a call to acmDriverDetails[AW]
might fail to provide details for the native codec, because the
stack-based ACMDRIVERDETAILSW struct is completely uninitialized at
message-send time. Native codecs check the value of the cbStruct member,
and refuse to fill the struct if the value is invalid, in pretty much
the same way acmDriverDetails[AW] refuses if the value is invalid. So
this patch also adds an initialization of this member before sending the
message. BTW, should wine-provided codecs duplicate this behavior?
* Ensure that the cbStruct member of the ACMDRIVERDETAILS[AW] struct is
filled with a valid value before returning.
* Fill the cbStruct member of the ACMDRIVERDETAILS[AW] before sending a
ACMDM_DRIVER_DETAILS message to an installed codec that might be a
native library: native ACM codecs expect cbStruct to be valid before
filling the rest of the struct with any data.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 989 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20051219/6b89ec59/wine-msacm-driver-cbStruct.patch
More information about the wine-patches