msvfw32: Use window name to determine if window is created using MCIWndCreate.
commit97e018f9a5f0ba360920747362f2e1270c0406b4
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>
Tue, 30 Aug 2022 07:20:42 +0000 (30 10:20 +0300)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 5 Sep 2022 16:53:06 +0000 (5 18:53 +0200)
tree917c65e7d7d348a8782160980c8a7aec529727f6
parente9de4ae05cd2ce56302f117cd9755f453ae0a6eb
msvfw32: Use window name to determine if window is created using MCIWndCreate.

The current version of the code incorrectly assumes that the lpszClass
member of CREATESTRUCT passed with WM_CREATE will point to the same
memory used for the CreateWindowEx class name parameter. MCIWND_Create
uses this assumption to perform a pointer comparison on the class name
to determine whether the MCI window is being created using
MCIWndCreateA/W and should therefore expect a unicode path parameter.

As a side effect of commit e41c255be6ba66d1eec7affe674b8cc7699226b8
"win32u: Use send_message_timeout for WM_CREATE and WM_NCCREATE" the
CREATESTRUCT lpszClass member started pointing to different memory,
breaking the current implementation of MCIWND_Create().

This commit fixes the problem by changing MCIWndCreateA/W to use an
internal window name, unlikely to be used by normal applications, which
can then be checked in MCIWND_Create to determine if the MCI window is
being created using MCIWndCreateA/W.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53578
dlls/msvfw32/mciwnd.c
dlls/msvfw32/tests/mciwnd.c