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
7521a42e
Commit
7521a42e
authored
Oct 19, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the USER_HEAP_* macros to use HANDLEs instead of HANDLE16s.
parent
61d92562
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
user.h
include/user.h
+4
-4
hook.c
windows/hook.c
+8
-8
No files found.
include/user.h
View file @
7521a42e
...
...
@@ -30,13 +30,13 @@
extern
WORD
USER_HeapSel
;
#define USER_HEAP_ALLOC(size) \
LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size)
)
((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) )
)
#define USER_HEAP_REALLOC(handle,size) \
LOCAL_ReAlloc( USER_HeapSel, (handle), (size), LMEM_FIXED
)
((HANDLE)(ULONG_PTR)LOCAL_ReAlloc( USER_HeapSel, LOWORD(handle), (size), LMEM_FIXED )
)
#define USER_HEAP_FREE(handle) \
LOCAL_Free( USER_HeapSel, (handle) )
LOCAL_Free( USER_HeapSel,
LOWORD
(handle) )
#define USER_HEAP_LIN_ADDR(handle) \
((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, (handle))) : NULL)
((handle) ? MapSL(MAKESEGPTR(USER_HeapSel,
LOWORD
(handle))) : NULL)
#define GET_WORD(ptr) (*(WORD *)(ptr))
#define GET_DWORD(ptr) (*(DWORD *)(ptr))
...
...
windows/hook.c
View file @
7521a42e
...
...
@@ -595,7 +595,7 @@ inline static LRESULT call_hook( HOOKDATA *data, INT fromtype, INT code,
*/
static
HHOOK
HOOK_GetNextHook
(
HHOOK
hook
)
{
HOOKDATA
*
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
HHOOK_16
(
hook
)
);
HOOKDATA
*
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
hook
);
if
(
!
data
||
!
hook
)
return
0
;
if
(
data
->
next
)
return
HHOOK_32
(
data
->
next
);
...
...
@@ -696,7 +696,7 @@ static BOOL HOOK_RemoveHook( HHOOK hook )
TRACE
(
"Removing hook %04x
\n
"
,
hook
);
if
(
!
(
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
HHOOK_16
(
hook
)
)))
return
FALSE
;
if
(
!
(
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
hook
)))
return
FALSE
;
if
(
data
->
flags
&
HOOK_INUSE
)
{
/* Mark it for deletion later on */
...
...
@@ -724,7 +724,7 @@ static BOOL HOOK_RemoveHook( HHOOK hook )
if
(
!*
prevHandle
)
return
FALSE
;
*
prevHandle
=
data
->
next
;
USER_HEAP_FREE
(
HHOOK_16
(
hook
)
);
USER_HEAP_FREE
(
hook
);
return
TRUE
;
}
...
...
@@ -738,7 +738,7 @@ static HHOOK HOOK_FindValidHook( HHOOK hook )
for
(;;)
{
if
(
!
(
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
HHOOK_16
(
hook
)
)))
return
0
;
if
(
!
(
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
hook
)))
return
0
;
if
(
data
->
proc
)
return
hook
;
hook
=
HHOOK_32
(
data
->
next
);
}
...
...
@@ -754,7 +754,7 @@ static LRESULT HOOK_CallHook( HHOOK hook, INT fromtype, INT code,
{
MESSAGEQUEUE
*
queue
;
HANDLE16
prevHandle
;
HOOKDATA
*
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
HHOOK_16
(
hook
)
);
HOOKDATA
*
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
hook
);
LRESULT
ret
;
if
(
!
(
queue
=
QUEUE_Current
()))
return
0
;
...
...
@@ -883,7 +883,7 @@ void HOOK_FreeQueueHooks(void)
{
next
=
HOOK_GetNextHook
(
hook
);
hptr
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
HHOOK_16
(
hook
)
);
hptr
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
hook
);
if
(
hptr
&&
hptr
->
ownerQueue
)
{
hptr
->
flags
&=
HOOK_MAPTYPE
;
...
...
@@ -977,7 +977,7 @@ BOOL WINAPI UnhookWindowsHook( INT id, HOOKPROC proc )
while
(
hook
)
{
HOOKDATA
*
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
HHOOK_16
(
hook
)
);
HOOKDATA
*
data
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
hook
);
if
(
data
->
proc
==
proc
)
break
;
hook
=
HOOK_GetNextHook
(
hook
);
}
...
...
@@ -1034,7 +1034,7 @@ LRESULT WINAPI CallNextHookEx( HHOOK hhook, INT code, WPARAM wParam,
if
(
!
(
next
=
HOOK_GetNextHook
(
hhook
)))
return
0
;
oldhook
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
HHOOK_16
(
hhook
)
);
oldhook
=
(
HOOKDATA
*
)
USER_HEAP_LIN_ADDR
(
hhook
);
fromtype
=
oldhook
->
flags
&
HOOK_MAPTYPE
;
if
(
fromtype
==
HOOK_WIN16
)
...
...
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