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
027afb49
Commit
027afb49
authored
Jun 21, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Only do the GetProcAddress once.
parent
dddbd3cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
13 deletions
+23
-13
msg.c
dlls/user32/tests/msg.c
+23
-13
No files found.
dlls/user32/tests/msg.c
View file @
027afb49
...
...
@@ -55,6 +55,9 @@ static BOOL test_DestroyWindow_flag;
static
HWINEVENTHOOK
hEvent_hook
;
static
HWND
(
WINAPI
*
pGetAncestor
)(
HWND
,
UINT
);
static
void
(
WINAPI
*
pNotifyWinEvent
)(
DWORD
,
HWND
,
LONG
,
LONG
);
static
HWINEVENTHOOK
(
WINAPI
*
pSetWinEventHook
)(
DWORD
,
DWORD
,
HMODULE
,
WINEVENTPROC
,
DWORD
,
DWORD
,
DWORD
);
static
BOOL
(
WINAPI
*
pUnhookWinEvent
)(
HWINEVENTHOOK
);
static
void
dump_winpos_flags
(
UINT
flags
);
...
...
@@ -1392,6 +1395,24 @@ static int sequence_cnt, sequence_size;
static
struct
message
*
sequence
;
static
int
log_all_parent_messages
;
static
void
init_procs
(
void
)
{
HMODULE
user32
=
GetModuleHandleA
(
"user32.dll"
);
#define USER32_GET_PROC(func) \
p ## func = (void*)GetProcAddress(user32, #func); \
if(!p ## func) { \
trace("GetProcAddress(%s) failed\n", #func); \
}
USER32_GET_PROC
(
GetAncestor
)
USER32_GET_PROC
(
NotifyWinEvent
)
USER32_GET_PROC
(
SetWinEventHook
)
USER32_GET_PROC
(
UnhookWinEvent
)
#undef USER32_GET_PROC
}
static
void
add_message
(
const
struct
message
*
msg
)
{
if
(
!
sequence
)
...
...
@@ -6896,8 +6917,6 @@ static DWORD WINAPI win_event_global_thread_proc(void *param)
HWND
hwnd
;
MSG
msg
;
HANDLE
hevent
=
*
(
HANDLE
*
)
param
;
HMODULE
user32
=
GetModuleHandleA
(
"user32.dll"
);
FARPROC
pNotifyWinEvent
=
GetProcAddress
(
user32
,
"NotifyWinEvent"
);
assert
(
pNotifyWinEvent
);
...
...
@@ -6999,10 +7018,6 @@ static void test_winevents(void)
DWORD
tid
;
HWINEVENTHOOK
hhook
;
const
struct
message
*
events
=
WmWinEventsSeq
;
HMODULE
user32
=
GetModuleHandleA
(
"user32.dll"
);
FARPROC
pSetWinEventHook
=
GetProcAddress
(
user32
,
"SetWinEventHook"
);
FARPROC
pUnhookWinEvent
=
GetProcAddress
(
user32
,
"UnhookWinEvent"
);
FARPROC
pNotifyWinEvent
=
GetProcAddress
(
user32
,
"NotifyWinEvent"
);
hwnd
=
CreateWindowExA
(
0
,
"TestWindowClass"
,
NULL
,
WS_OVERLAPPEDWINDOW
,
...
...
@@ -7200,9 +7215,6 @@ static void test_set_hook(void)
BOOL
ret
;
HHOOK
hhook
;
HWINEVENTHOOK
hwinevent_hook
;
HMODULE
user32
=
GetModuleHandleA
(
"user32.dll"
);
FARPROC
pSetWinEventHook
=
GetProcAddress
(
user32
,
"SetWinEventHook"
);
FARPROC
pUnhookWinEvent
=
GetProcAddress
(
user32
,
"UnhookWinEvent"
);
hhook
=
SetWindowsHookExA
(
WH_CBT
,
cbt_hook_proc
,
GetModuleHandleA
(
0
),
GetCurrentThreadId
());
ok
(
hhook
!=
0
,
"local hook does not require hModule set to 0
\n
"
);
...
...
@@ -9242,11 +9254,9 @@ static void test_SetForegroundWindow(void)
START_TEST
(
msg
)
{
BOOL
ret
;
HMODULE
user32
=
GetModuleHandleA
(
"user32.dll"
);
FARPROC
pSetWinEventHook
=
GetProcAddress
(
user32
,
"SetWinEventHook"
);
FARPROC
pUnhookWinEvent
=
GetProcAddress
(
user32
,
"UnhookWinEvent"
);
FARPROC
pIsWinEventHookInstalled
=
0
;
/*GetProcAddress(user32, "IsWinEventHookInstalled");*/
pGetAncestor
=
(
void
*
)
GetProcAddress
(
user32
,
"GetAncestor"
);
init_procs
();
if
(
!
RegisterWindowClasses
())
assert
(
0
);
...
...
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