[Bug 36842] Can't set a static crontrol's text to empty by passing NULL pointer

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Dec 15 03:29:17 CST 2014


https://bugs.winehq.org/show_bug.cgi?id=36842

--- Comment #4 from Henrik Haftmann <heha at hrz.tu-chemnitz.de> ---
Created attachment 50220
  --> https://bugs.winehq.org/attachment.cgi?id=50220
Simple Win32 program that shows the effect

When the user presses "Click me", a SetWindowText() / SetDlgItemText() call
with NULL string parameter is generated with different target windows, also for
the main window. While main window's WM_SETTEXT message processing, a
MessageBox() shows the actual lParam value, which is indeed 0.
The different child windows are STATIC, BUTTON, EDIT, and COMBOBOX.

The Windows behaviour is that all controls are cleared out, even the top-left
static control. The windows screenshot shows the controls before the button is
clicked.

The wine behaviour is similar, but the static control remains untouched.
Therefore, I can confirm the bug.

Furthermore, the behaviour of shlwapi.dll's wnsprintf() is different (i.e. a
second bug):
While Windows substitutes nothing for "%s" format specifier, wine substitutes
the null pointer with "<null>".

Some software may rely on the fact that string null pointers are handled like
zero-length strings in many (or possibly all) places of the Win32 API.

By the way, the second button "GetClassName" works the same way in Windows and
wine, therefore, it shows correct operation for integer WNDCLASS class names,
i.e. excellent emulation of a very basic but rarely used feature.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list