Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
87e0c10b
Commit
87e0c10b
authored
Feb 21, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Reorder control flow in ImmGetImeMenuItemsW.
parent
d07cec30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
48 deletions
+38
-48
imm.c
dlls/imm32/imm.c
+38
-48
No files found.
dlls/imm32/imm.c
View file @
87e0c10b
...
...
@@ -2729,70 +2729,60 @@ DWORD WINAPI ImmGetImeMenuItemsA( HIMC himc, DWORD flags, DWORD type, IMEMENUITE
/***********************************************************************
* ImmGetImeMenuItemsW (IMM32.@)
*/
DWORD
WINAPI
ImmGetImeMenuItemsW
(
HIMC
hIMC
,
DWORD
dwFlags
,
DWORD
dwType
,
LPIMEMENUITEMINFOW
lpImeParentMenu
,
LPIMEMENUITEMINFOW
lpImeMenu
,
DWORD
dwSize
)
DWORD
WINAPI
ImmGetImeMenuItemsW
(
HIMC
himc
,
DWORD
flags
,
DWORD
type
,
IMEMENUITEMINFOW
*
parentW
,
IMEMENUITEMINFOW
*
menuW
,
DWORD
size
)
{
InputContextData
*
data
=
get_imc_data
(
hIMC
);
TRACE
(
"(%p, %li, %li, %p, %p, %li):
\n
"
,
hIMC
,
dwFlags
,
dwType
,
lpImeParentMenu
,
lpImeMenu
,
dwSize
);
InputContextData
*
data
=
get_imc_data
(
himc
);
DWORD
ret
;
TRACE
(
"himc %p, flags %#lx, type %lu, parentW %p, menuW %p, size %lu.
\n
"
,
himc
,
flags
,
type
,
parentW
,
menuW
,
size
);
if
(
!
data
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
SetLastError
(
ERROR_INVALID_HANDLE
);
return
0
;
}
if
(
data
->
immKbd
->
hIME
&&
data
->
immKbd
->
pImeGetImeMenuItems
)
if
(
!
data
->
immKbd
->
hIME
||
!
data
->
immKbd
->
pImeGetImeMenuItems
)
return
0
;
if
(
is_himc_ime_unicode
(
data
)
||
(
!
parentW
&&
!
menuW
))
ret
=
data
->
immKbd
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentW
,
menuW
,
size
);
else
{
if
(
is_himc_ime_unicode
(
data
)
||
(
!
lpImeParentMenu
&&
!
lpImeMenu
))
return
data
->
immKbd
->
pImeGetImeMenuItems
(
hIMC
,
dwFlags
,
dwType
,
lpImeParentMenu
,
lpImeMenu
,
dwSize
)
;
IMEMENUITEMINFOA
tmpA
,
*
menuA
,
*
parentA
=
parentW
?
&
tmpA
:
NULL
;
if
(
!
menuW
)
menuA
=
NULL
;
else
{
IMEMENUITEMINFOA
lpImeParentMenuA
;
IMEMENUITEMINFOA
*
lpImeMenuA
,
*
parent
=
NULL
;
DWORD
rc
;
if
(
lpImeParentMenu
)
parent
=
&
lpImeParentMenuA
;
if
(
lpImeMenu
)
{
int
count
=
dwSize
/
sizeof
(
LPIMEMENUITEMINFOW
);
dwSize
=
count
*
sizeof
(
IMEMENUITEMINFOA
);
lpImeMenuA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwSize
);
}
else
lpImeMenuA
=
NULL
;
int
count
=
size
/
sizeof
(
LPIMEMENUITEMINFOW
);
size
=
count
*
sizeof
(
IMEMENUITEMINFOA
);
menuA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
}
rc
=
data
->
immKbd
->
pImeGetImeMenuItems
(
hIMC
,
dwFlags
,
dwType
,
(
IMEMENUITEMINFOW
*
)
parent
,
(
IMEMENUITEMINFOW
*
)
lpImeMenuA
,
dwSize
);
ret
=
data
->
immKbd
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
(
IMEMENUITEMINFOW
*
)
parentA
,
(
IMEMENUITEMINFOW
*
)
menuA
,
size
);
if
(
lpImeParentMenu
)
{
memcpy
(
lpImeParentMenu
,
&
lpImeParentMenuA
,
sizeof
(
IMEMENUITEMINFOA
));
lpImeParentMenu
->
hbmpItem
=
lpImeParentMenuA
.
hbmpItem
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpImeParentMenuA
.
szString
,
-
1
,
lpImeParentMenu
->
szString
,
IMEMENUITEM_STRING_SIZE
);
}
if
(
lpImeMenu
&&
rc
)
if
(
parentW
)
{
memcpy
(
parentW
,
parentA
,
sizeof
(
IMEMENUITEMINFOA
)
);
parentW
->
hbmpItem
=
parentA
->
hbmpItem
;
MultiByteToWideChar
(
CP_ACP
,
0
,
parentA
->
szString
,
-
1
,
parentW
->
szString
,
IMEMENUITEM_STRING_SIZE
);
}
if
(
menuW
&&
ret
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
rc
;
i
++
)
{
memcpy
(
&
lpImeMenu
[
i
],
&
lpImeMenuA
[
1
],
sizeof
(
IMEMENUITEMINFOA
));
lpImeMenu
[
i
].
hbmpItem
=
lpImeMenuA
[
i
].
hbmpItem
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpImeMenuA
[
i
].
szString
,
-
1
,
lpImeMenu
[
i
].
szString
,
IMEMENUITEM_STRING_SIZE
);
}
memcpy
(
&
menuW
[
i
],
&
menuA
[
1
],
sizeof
(
IMEMENUITEMINFOA
)
);
menuW
[
i
].
hbmpItem
=
menuA
[
i
].
hbmpItem
;
MultiByteToWideChar
(
CP_ACP
,
0
,
menuA
[
i
].
szString
,
-
1
,
menuW
[
i
].
szString
,
IMEMENUITEM_STRING_SIZE
);
}
HeapFree
(
GetProcessHeap
(),
0
,
lpImeMenuA
);
return
rc
;
}
HeapFree
(
GetProcessHeap
(),
0
,
menuA
);
}
else
return
0
;
return
ret
;
}
/***********************************************************************
...
...
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