Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8b933495
Commit
8b933495
authored
Sep 17, 2013
by
Aric Stewart
Committed by
Alexandre Julliard
Sep 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Fix ImmGetDescription behavior with a null HKL.
parent
b4b428ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
imm.c
dlls/imm32/imm.c
+3
-0
imm32.c
dlls/imm32/tests/imm32.c
+11
-4
No files found.
dlls/imm32/imm.c
View file @
8b933495
...
...
@@ -1523,6 +1523,8 @@ UINT WINAPI ImmGetDescriptionA(
/* find out how many characters in the unicode buffer */
len
=
ImmGetDescriptionW
(
hKL
,
NULL
,
0
);
if
(
!
len
)
return
0
;
/* allocate a buffer of that size */
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
...
...
@@ -1550,6 +1552,7 @@ UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
FIXME
(
"(%p, %p, %d): semi stub
\n
"
,
hKL
,
lpszDescription
,
uBufLen
);
if
(
!
hKL
)
return
0
;
if
(
!
uBufLen
)
return
lstrlenW
(
name
);
lstrcpynW
(
lpszDescription
,
name
,
uBufLen
);
return
lstrlenW
(
lpszDescription
);
...
...
dlls/imm32/tests/imm32.c
View file @
8b933495
...
...
@@ -629,18 +629,19 @@ static void test_ImmGetContext(void)
static
void
test_ImmGetDescription
(
void
)
{
HKL
hkl
;
WCHAR
japime
[]
=
{
'E'
,
'0'
,
'0'
,
'1'
,
'0'
,
'4'
,
'1'
,
'1'
,
0
};
WCHAR
descW
[
100
];
CHAR
descA
[
100
];
UINT
ret
,
lret
;
/* FIXME: invalid keyboard layouts should not pass */
ret
=
ImmGetDescriptionW
(
NULL
,
NULL
,
0
);
todo_wine
ok
(
!
ret
,
"ImmGetDescriptionW failed, expected 0 received %d.
\n
"
,
ret
);
ok
(
!
ret
,
"ImmGetDescriptionW failed, expected 0 received %d.
\n
"
,
ret
);
ret
=
ImmGetDescriptionA
(
NULL
,
NULL
,
0
);
ok
(
!
ret
,
"ImmGetDescriptionA failed, expected 0 received %d.
\n
"
,
ret
);
/* load a language with valid IMM descriptions */
hkl
=
LoadKeyboardLayoutW
(
japime
,
KLF_ACTIVATE
);
todo_wine
ok
(
hkl
!=
0
,
"LoadKeyboardLayoutW
failed, expected != 0.
\n
"
);
hkl
=
GetKeyboardLayout
(
0
);
ok
(
hkl
!=
0
,
"GetKeyboardLayout
failed, expected != 0.
\n
"
);
ret
=
ImmGetDescriptionW
(
hkl
,
NULL
,
0
);
if
(
!
ret
)
...
...
@@ -649,6 +650,12 @@ static void test_ImmGetDescription(void)
return
;
}
SetLastError
(
0xdeadcafe
);
ret
=
ImmGetDescriptionW
(
0
,
NULL
,
100
);
ok
(
ret
==
0
,
"ImmGetDescriptionW with 0 hkl should return 0
\n
"
);
ret
=
GetLastError
();
ok
(
ret
==
0xdeadcafe
,
"Last Error should remain unchanged
\n
"
);
ret
=
ImmGetDescriptionW
(
hkl
,
descW
,
0
);
ok
(
ret
,
"ImmGetDescriptionW failed, expected != 0 received 0.
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment