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
a7adbf78
Commit
a7adbf78
authored
Oct 15, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Reimplement accelerator functions to use 32-bit user handles instead of 16-bit functions.
parent
a187b43d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
58 deletions
+26
-58
menu.c
dlls/user32/menu.c
+25
-58
resource.c
dlls/user32/resource.c
+0
-0
user_private.h
dlls/user32/user_private.h
+1
-0
No files found.
dlls/user32/menu.c
View file @
a7adbf78
...
...
@@ -5344,52 +5344,26 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
*/
INT
WINAPI
TranslateAcceleratorA
(
HWND
hWnd
,
HACCEL
hAccel
,
LPMSG
msg
)
{
/* YES, Accel16! */
LPACCEL16
lpAccelTbl
;
int
i
;
WPARAM
wParam
;
if
(
!
hWnd
||
!
msg
)
return
0
;
if
(
!
hAccel
||
!
(
lpAccelTbl
=
(
LPACCEL16
)
LockResource16
(
HACCEL_16
(
hAccel
))))
{
WARN_
(
accel
)(
"invalid accel handle=%p
\n
"
,
hAccel
);
return
0
;
}
wParam
=
msg
->
wParam
;
switch
(
msg
->
message
)
{
case
WM_KEYDOWN
:
case
WM_SYSKEYDOWN
:
break
;
return
TranslateAcceleratorW
(
hWnd
,
hAccel
,
msg
)
;
case
WM_CHAR
:
case
WM_SYSCHAR
:
{
char
ch
=
LOWORD
(
wParam
);
MSG
msgW
=
*
msg
;
char
ch
=
LOWORD
(
msg
->
wParam
);
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
ch
,
1
,
&
wch
,
1
);
wParam
=
MAKEWPARAM
(
wch
,
HIWORD
(
wParam
));
msgW
.
wParam
=
MAKEWPARAM
(
wch
,
HIWORD
(
msg
->
wParam
));
return
TranslateAcceleratorW
(
hWnd
,
hAccel
,
&
msgW
);
}
break
;
default:
return
0
;
}
TRACE_
(
accel
)(
"hAccel %p, hWnd %p, msg->hwnd %p, msg->message %04x, wParam %08lx, lParam %08lx
\n
"
,
hAccel
,
hWnd
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
i
=
0
;
do
{
if
(
translate_accelerator
(
hWnd
,
msg
->
message
,
wParam
,
msg
->
lParam
,
lpAccelTbl
[
i
].
fVirt
,
lpAccelTbl
[
i
].
key
,
lpAccelTbl
[
i
].
cmd
))
return
1
;
}
while
((
lpAccelTbl
[
i
++
].
fVirt
&
0x80
)
==
0
);
return
0
;
}
/**********************************************************************
...
...
@@ -5397,39 +5371,32 @@ INT WINAPI TranslateAcceleratorA( HWND hWnd, HACCEL hAccel, LPMSG msg )
*/
INT
WINAPI
TranslateAcceleratorW
(
HWND
hWnd
,
HACCEL
hAccel
,
LPMSG
msg
)
{
/* YES, Accel16! */
LPACCEL16
lpAccelTbl
;
int
i
;
if
(
!
hWnd
||
!
msg
)
return
0
;
if
(
!
hAccel
||
!
(
lpAccelTbl
=
(
LPACCEL16
)
LockResource16
(
HACCEL_16
(
hAccel
))))
{
WARN_
(
accel
)(
"invalid accel handle=%p
\n
"
,
hAccel
);
return
0
;
}
ACCEL
data
[
32
],
*
ptr
=
data
;
int
i
,
count
;
switch
(
msg
->
message
)
{
case
WM_KEYDOWN
:
case
WM_SYSKEYDOWN
:
case
WM_CHAR
:
case
WM_SYSCHAR
:
break
;
if
(
!
hWnd
)
return
0
;
default:
if
(
msg
->
message
!=
WM_KEYDOWN
&&
msg
->
message
!=
WM_SYSKEYDOWN
&&
msg
->
message
!=
WM_CHAR
&&
msg
->
message
!=
WM_SYSCHAR
)
return
0
;
}
TRACE_
(
accel
)(
"hAccel %p, hWnd %p, msg->hwnd %p, msg->message %04x, wParam %08lx, lParam %08lx
\n
"
,
hAccel
,
hWnd
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
i
=
0
;
do
if
(
!
(
count
=
CopyAcceleratorTableW
(
hAccel
,
NULL
,
0
)))
return
0
;
if
(
count
>
sizeof
(
data
)
/
sizeof
(
data
[
0
]))
{
if
(
!
(
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
*
ptr
)
)))
return
0
;
}
count
=
CopyAcceleratorTableW
(
hAccel
,
ptr
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
translate_accelerator
(
hWnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
,
lpAccelTbl
[
i
].
fVirt
,
lpAccelTbl
[
i
].
key
,
lpAccelTbl
[
i
].
cmd
))
return
1
;
}
while
((
lpAccelTbl
[
i
++
].
fVirt
&
0x80
)
==
0
);
return
0
;
ptr
[
i
].
fVirt
,
ptr
[
i
].
key
,
ptr
[
i
].
cmd
))
break
;
}
if
(
ptr
!=
data
)
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
return
(
i
<
count
)
;
}
dlls/user32/resource.c
View file @
a7adbf78
This diff is collapsed.
Click to expand it.
dlls/user32/user_private.h
View file @
a7adbf78
...
...
@@ -128,6 +128,7 @@ enum user_obj_type
{
USER_WINDOW
=
1
,
/* window */
USER_MENU
,
/* menu */
USER_ACCEL
,
/* accelerator */
USER_DWP
/* DeferWindowPos structure */
};
...
...
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