Avoid writing out of bounds.
Signed-off-by: YeshunYe <yeyeshun(a)uniontech.com>
--
v3: dsound/tests: Add test for DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1
dsound: Check if 'cbPropData' for DSPROPERTY_Description1 is large enough
https://gitlab.winehq.org/wine/wine/-/merge_requests/8596
On Mon Jul 21 08:00:41 2025 +0000, Zhiyi Zhang wrote:
> \--prefer-native works. However, we need to mark comctl32 v5 as
> --perfer-native because comctl32.dll in the build dir is comctl32 v5.
> Then we still need to update the wine prefix every time after making
> changes to comctl32 v6 and rebuilding, because otherwise the comctl32 v6
> DLL in the wine prefix won't be updated, now that the DLL in the wine
> prefix is preferred. This would make the comctl32 development experience
> worse and bisecting comctl32 terrible. Comparing it to a special case in
> find_builtin_dll(), I prefer the latter. The changes to
> find_builtin_dll() are quite minimal.
Another way would be to extend this builtin signature check to optionally include installed module name instead of assuming it's the same as a filename, so that we can specify comctl32_v6.dll there and build everything as builtin. I don't know if it's easy, because it requires variable length data.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8595#note_110484
On Mon Jul 21 07:46:07 2025 +0000, Nikolay Sivov wrote:
> Having this check in ntdll looks too dirty to me. Will it work if we
> build v6 variant as --prefer-native?
\--prefer-native works. However, we need to mark comctl32 v5 as --perfer-native because comctl32.dll in the build dir is comctl32 v5. Then we still need to update the wine prefix every time after making changes to comctl32 v6 and rebuilding, because otherwise the comctl32 v6 DLL in the wine prefix won't be updated, now that the DLL in the wine prefix is preferred. This would make the comctl32 development worse. Comparing it to a special case in find_builtin_dll(), I prefer the latter. The changes to find_builtin_dll() are quite minimal.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8595#note_110483
On Mon Jul 21 02:14:39 2025 +0000, Zhiyi Zhang wrote:
> As mentioned above. There is a manifest for comctl32 v5 on Windows. So I
> think it's better to rename it now.
Is there an embedded manifest in comctl32.dll from system32?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8595#note_110482
On Mon Jul 21 02:14:37 2025 +0000, Zhiyi Zhang wrote:
> The issue happens because comctl32 v6 and v5 were both trying to
> register "SysDateTimePick32" due to the "if (is_comctl32_class(
> name->Buffer )) ... else (!RtlFindActivationContextSectionString(...))".
> Because "SysDateTimePick32" is a comctl32 class, the version is not
> appended to the window class. So, comctl32 v6 still tries to register
> "SysDateTimePick32". Removing the else allows comtl32 v6 to get the
> version from its manifest and uses "6.00.xx!SysDateTimePick32". Comctl32
> v5 has no manifest on Wine, so its behavior is the same. On Windows,
> comctl32 v5 also has a manifest, but the `versioned` property is set to
> `no`. You can find it on Windows 10 at
> C:\Windows\WinSxS\Manifests\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.5915_none_793527b5243cb406.manifest
>
> ```
> ...
> <windowClass versioned="no">SysDateTimePick32</windowClass>
> ...
> ```
Wouldn't you need to reference sxs 5.82 version explicitly using application manifest? So unless application requests specific 5.x version (if that's really the purpose of having this manifest) it doesn't matter if our v5 has manifest or not. I think we don't have to care about that at this point.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8595#note_110481
On Mon Jul 21 02:14:38 2025 +0000, Zhiyi Zhang wrote:
> This is because Wine has a mechanism to load built-in DLLs (related to
> WINEDLLOVERRIDES). For example, all Wine built-in DLLs in the wine
> prefix have a built-in DLL signature. When loading such a DLL from the
> prefix, Wine will redirect it to the one in the build dir or the
> installed DLL dir. Please see find_builtin_dll(). This allows developers
> not to update the wine prefix after every rebuild because the ones in
> the build dir are loaded. This mechanism is also responsible for
> selecting native DLLs in the wine prefix or Wine's builtin DLLs in the
> build dir or installed DLL dir, depending on WINEDLLOVERRIDES or
> EXTRADLLFLAGS = -Wb,--prefer-native.
> Then, a problem with comctl32 is that both comctl32 v6 and v5 have the
> same name, "comctl32.dll". So when loading comctl32 from
> C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef\comctl32.dll,
> it gets redirected to "comctl32.dll" in the build dir, which is comctl32
> v5. So for comctl32 v6 to work, we need to add a special case for
> comctl32 v6 and redirect it to "comctl32_v6.dll". Note that
> "comctl32_v6.dll" only exists in the build dir or installed DLL dir, not
> in the wine prefix.
Having this check in ntdll looks too dirty to me. Will it work if we build v6 variant as --prefer-native?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8595#note_110480