http://bugs.winehq.org/show_bug.cgi?id=16195
Summary: GetKeyNameTextW returns a wrong length Product: Wine Version: 1.1.9 Platform: PC-x86-64 OS/Version: Windows Vista Status: UNCONFIRMED Severity: enhancement Priority: P4 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: winehq.5.tahtu@spamgourmet.com
int Len; LPTSTR lpString[64];
Len = GetKeyNameTextW(22151168, lpString, 32);
After this call lpString has the correct "Insert" string - bug Len has the wrong value 1 - I expect the value 6.
PS Please note: It's the unicode version of GetKeyNameText.
http://bugs.winehq.org/show_bug.cgi?id=16195
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase
--- Comment #1 from Austin English austinenglish@gmail.com 2008-11-24 13:35:38 --- Please add a testcase to dlls/user32/input.c.
http://bugs.winehq.org/show_bug.cgi?id=16195
--- Comment #2 from Tahtu winehq.5.tahtu@spamgourmet.com 2008-11-24 13:44:08 --- I'm sorry, I don't understand what you expect from me.
I wrote a test Win32 API call in my initial bug report which can be used for you for testing.
GetKeyNameTextW is function of the Windows API: http://msdn.microsoft.com/en-us/library/ms646300(VS.85).aspx
GetKeyNameTextW is the Unicode variante of it.
http://bugs.winehq.org/show_bug.cgi?id=16195
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 OS/Version|Windows Vista |Linux
--- Comment #3 from Vitaliy Margolen vitaliy@kievinfo.com 2008-11-24 15:47:12 --- Confirming. X11DRV_GetKeyNameText indeed returns only 0 or 1. Not the string length in bytes as it should.
http://bugs.winehq.org/show_bug.cgi?id=16195
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Component|user32 |winex11.drv
--- Comment #4 from Vitaliy Margolen vitaliy@kievinfo.com 2008-11-24 15:47:37 --- This is x11drv
http://bugs.winehq.org/show_bug.cgi?id=16195
--- Comment #5 from Tahtu winehq.5.tahtu@spamgourmet.com 2008-11-24 15:59:05 --- (In reply to comment #3)
Confirming. X11DRV_GetKeyNameText indeed returns only 0 or 1. Not the string length in bytes as it should.
I expect the lenth in characters - not in byte.
Sorry about the wrong component - I set it to the name of the Windows API dll - that is user32.dll.
http://bugs.winehq.org/show_bug.cgi?id=16195
--- Comment #6 from Tahtu winehq.5.tahtu@spamgourmet.com 2008-11-25 15:11:12 --- I think the fix of this problem based here: http://source.winehq.org/git/wine.git/?a=blob;f=dlls/winex11.drv/keyboard.c#...
Afaik the solution could be a change from
MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize); lpBuffer[nSize - 1] = 0; return 1;
to this one:
int len;
len = MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize); lpBuffer[len - 1] = 0; return len;
http://bugs.winehq.org/show_bug.cgi?id=16195
--- Comment #7 from Dmitry Timoshkov dmitry@codeweavers.com 2008-11-26 23:02:29 --- (In reply to comment #6)
int len; len = MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize); lpBuffer[len - 1] = 0; return len;
Looks good, please send to wine-patches. You even can eliminate introducing 'len' by reusing 'nSize'.
http://bugs.winehq.org/show_bug.cgi?id=16195
--- Comment #8 from Tahtu winehq.5.tahtu@spamgourmet.com 2008-11-27 01:26:19 --- (In reply to comment #7)
(In reply to comment #6)
int len; len = MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize); lpBuffer[len - 1] = 0; return len;
I think this single line should work too:
return MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize) - 1;
But it fails on "Control" (result: 9) and "Alt" (result: 5).
Looks good, please send to wine-patches. You even can eliminate introducing 'len' by reusing 'nSize'.
I'm sorry, since you closed an other valid bug reported by my I will not longer assist the Wine Project: http://bugs.winehq.org/show_bug.cgi?id=16204#c3
http://bugs.winehq.org/show_bug.cgi?id=16195
Tahtu winehq.5.tahtu@spamgourmet.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.9 |1.1.10
http://bugs.winehq.org/show_bug.cgi?id=16195
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.10 |1.1.8
--- Comment #9 from Vitaliy Margolen vitaliy@kievinfo.com 2008-12-06 12:41:15 --- Please don't change original reported Wine version.
http://bugs.winehq.org/show_bug.cgi?id=16195
Tahtu winehq.5.tahtu@spamgourmet.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.8 |1.1.10
--- Comment #10 from Tahtu winehq.5.tahtu@spamgourmet.com 2008-12-06 12:43:27 --- If you fix this bug I would not have a reason to change it. ;-)
Since the bug is still presten there is a reason to change it.
http://bugs.winehq.org/show_bug.cgi?id=16195
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.10 |1.1.8
--- Comment #11 from Vitaliy Margolen vitaliy@kievinfo.com 2008-12-06 13:11:11 --- DO NOT change original reported Wine version!!!
http://bugs.winehq.org/show_bug.cgi?id=16195
Tahtu winehq.5.tahtu@spamgourmet.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.8 |1.1.10
http://bugs.winehq.org/show_bug.cgi?id=16195
James Hawkins truiken@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.10 |1.1.8
--- Comment #12 from James Hawkins truiken@gmail.com 2008-12-06 13:15:39 --- Tahtu, stop changing the version. As a part of *our* development process, which means fixing this bug, the version field is the earliest known broken version. If a new release is still broken, a comment stating that is all that is needed.
http://bugs.winehq.org/show_bug.cgi?id=16195
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID Version|1.1.8 |1.1.10
--- Comment #13 from Vitaliy Margolen vitaliy@kievinfo.com 2008-12-06 13:15:51 --- If you do not play by rules do not bother reporting bugs to bugzilla in the future.
Closing invalid.
http://bugs.winehq.org/show_bug.cgi?id=16195
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #14 from Vitaliy Margolen vitaliy@kievinfo.com 2008-12-06 13:15:58 --- Closing invalid.
http://bugs.winehq.org/show_bug.cgi?id=16195
Tahtu winehq.5.tahtu@spamgourmet.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED Resolution|INVALID |
--- Comment #15 from Tahtu winehq.5.tahtu@spamgourmet.com 2008-12-06 13:17:31 --- Bug is still present.
http://bugs.winehq.org/show_bug.cgi?id=16195
--- Comment #16 from Austin English austinenglish@gmail.com 2008-12-06 15:03:08 --- How does changing the Wine version make the bug invalid?
Tahtu, we know it's still a bug, but pissing off developers won't fix the bug any faster.
http://bugs.winehq.org/show_bug.cgi?id=16195
Lei Zhang thestig@google.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.10 |1.1.9
--- Comment #17 from Lei Zhang thestig@google.com 2008-12-07 03:19:07 --- FWIW, original reported version was 1.1.9.
For future references, a simple message saying "problem still exists in version x.y.z" is a sufficient reminder.
http://bugs.winehq.org/show_bug.cgi?id=16195
--- Comment #18 from Austin English austinenglish@gmail.com 2009-06-08 12:04:08 --- I've sent the patch: http://www.winehq.org/pipermail/wine-patches/2009-June/073975.html
http://bugs.winehq.org/show_bug.cgi?id=16195
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED
--- Comment #19 from Austin English austinenglish@gmail.com 2009-06-09 11:04:04 --- Patch committed:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=99069ab61f6b2f2a0b1745...
http://bugs.winehq.org/show_bug.cgi?id=16195
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #20 from Alexandre Julliard julliard@winehq.org 2009-06-19 11:02:42 --- Closing bugs fixed in 1.1.24.