http://bugs.winehq.com/show_bug.cgi?id=1845
Summary: Return values of CharUpperA and CharLowerA Product: Wine Version: unspecified Platform: Other URL: http://www.apis.de OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-user AssignedTo: wine-bugs@winehq.com ReportedBy: andy@rosen-berg.de
The return values for CharUpperA and CharUpperB should return 32-bit ints with the upper 16 bits being 0 if the operand is a single character. Passing single characters with the 8th-bit being set, may result in 32bit results with the upper 16 bits set. This may confuse apps taking the whole 32bit value. We detected this bug, while testing our software with WINE.
The problem seems to lie in dlls/user/lstr.c (sign extension problem?).
Looking at the code in lstr.c I saw a SetLastError. This may destroy a SetLastError of another call. Here is an excerpt from the Microsoft documentation for this call: ------------ The CharUpper function converts a character string or a single character to uppercase. If the operand is a character string, the function converts the characters in place. .... There is no indication of success or failure. Failure is rare. There is no extended error information for this function; do not call GetLastError. ------------