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
ecca543f
Commit
ecca543f
authored
Dec 23, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Don't store the 16-bit hook info in the 32-bit thread queue structure.
parent
1bee9f4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
hook16.c
dlls/user32/hook16.c
+18
-11
user_private.h
dlls/user32/user_private.h
+0
-2
No files found.
dlls/user32/hook16.c
View file @
ecca543f
...
...
@@ -63,7 +63,6 @@ static const HOOKPROC hook_procs[NB_HOOKS16] =
};
/* this structure is stored in the thread queue */
struct
hook16_queue_info
{
INT
id
;
/* id of current hook */
...
...
@@ -71,6 +70,19 @@ struct hook16_queue_info
HOOKPROC16
proc
[
NB_HOOKS16
];
/* 16-bit hook procedures */
};
static
struct
hook16_queue_info
*
get_hook_info
(
BOOL
create
)
{
static
DWORD
hook_tls
=
TLS_OUT_OF_INDEXES
;
struct
hook16_queue_info
*
info
=
TlsGetValue
(
hook_tls
);
if
(
!
info
&&
create
)
{
if
(
hook_tls
==
TLS_OUT_OF_INDEXES
)
hook_tls
=
TlsAlloc
();
info
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
info
)
);
TlsSetValue
(
hook_tls
,
info
);
}
return
info
;
}
/***********************************************************************
...
...
@@ -108,7 +120,7 @@ static inline void map_msg_32_to_16( const MSG *msg32, MSG16 *msg16 )
*/
static
LRESULT
call_hook_16
(
INT
id
,
INT
code
,
WPARAM
wp
,
LPARAM
lp
)
{
struct
hook16_queue_info
*
info
=
get_
user_thread_info
()
->
hook16_info
;
struct
hook16_queue_info
*
info
=
get_
hook_info
(
FALSE
)
;
WORD
args
[
4
];
DWORD
ret
;
INT
prev_id
=
info
->
id
;
...
...
@@ -378,7 +390,6 @@ FARPROC16 WINAPI SetWindowsHook16( INT16 id, HOOKPROC16 proc )
*/
HHOOK
WINAPI
SetWindowsHookEx16
(
INT16
id
,
HOOKPROC16
proc
,
HINSTANCE16
hInst
,
HTASK16
hTask
)
{
struct
user_thread_info
*
thread_info
=
get_user_thread_info
();
struct
hook16_queue_info
*
info
;
HHOOK
hook
;
int
index
=
id
-
WH_MINHOOK
;
...
...
@@ -396,11 +407,7 @@ HHOOK WINAPI SetWindowsHookEx16( INT16 id, HOOKPROC16 proc, HINSTANCE16 hInst, H
return
0
;
}
if
(
!
(
info
=
thread_info
->
hook16_info
))
{
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
info
)
)))
return
0
;
thread_info
->
hook16_info
=
info
;
}
if
(
!
(
info
=
get_hook_info
(
TRUE
)))
return
0
;
if
(
info
->
hook
[
index
])
{
FIXME
(
"Multiple hooks (%d) for the same task not supported yet
\n
"
,
id
);
...
...
@@ -422,7 +429,7 @@ BOOL16 WINAPI UnhookWindowsHook16( INT16 id, HOOKPROC16 proc )
int
index
=
id
-
WH_MINHOOK
;
if
(
id
<
WH_MINHOOK
||
id
>
WH_MAXHOOK16
)
return
FALSE
;
if
(
!
(
info
=
get_
user_thread_info
()
->
hook16_info
))
return
FALSE
;
if
(
!
(
info
=
get_
hook_info
(
FALSE
)
))
return
FALSE
;
if
(
info
->
proc
[
index
]
!=
proc
)
return
FALSE
;
if
(
!
UnhookWindowsHookEx
(
info
->
hook
[
index
]
))
return
FALSE
;
info
->
hook
[
index
]
=
0
;
...
...
@@ -439,7 +446,7 @@ BOOL16 WINAPI UnhookWindowsHookEx16( HHOOK hhook )
struct
hook16_queue_info
*
info
;
int
index
;
if
(
!
(
info
=
get_
user_thread_info
()
->
hook16_info
))
return
FALSE
;
if
(
!
(
info
=
get_
hook_info
(
FALSE
)
))
return
FALSE
;
for
(
index
=
0
;
index
<
NB_HOOKS16
;
index
++
)
{
if
(
info
->
hook
[
index
]
==
hhook
)
...
...
@@ -502,7 +509,7 @@ LRESULT WINAPI CallNextHookEx16( HHOOK hhook, INT16 code, WPARAM16 wparam, LPARA
struct
hook16_queue_info
*
info
;
LRESULT
ret
=
0
;
if
(
!
(
info
=
get_
user_thread_info
()
->
hook16_info
))
return
0
;
if
(
!
(
info
=
get_
hook_info
(
FALSE
)
))
return
0
;
switch
(
info
->
id
)
{
...
...
dlls/user32/user_private.h
View file @
ecca543f
...
...
@@ -122,7 +122,6 @@ extern const USER_DRIVER *USER_Driver DECLSPEC_HIDDEN;
extern
void
USER_unload_driver
(
void
)
DECLSPEC_HIDDEN
;
struct
received_message_info
;
struct
hook16_queue_info
;
enum
user_obj_type
{
...
...
@@ -175,7 +174,6 @@ struct user_thread_info
BOOL
hook_unicode
;
/* Is current hook unicode? */
HHOOK
hook
;
/* Current hook */
struct
received_message_info
*
receive_info
;
/* Message being currently received */
struct
hook16_queue_info
*
hook16_info
;
/* Opaque pointer for 16-bit hook support */
struct
wm_char_mapping_data
*
wmchar_data
;
/* Data for WM_CHAR mappings */
DWORD
GetMessageTimeVal
;
/* Value for GetMessageTime */
DWORD
GetMessagePosVal
;
/* Value for GetMessagePos */
...
...
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