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
10f5a733
Commit
10f5a733
authored
Oct 19, 2013
by
Saulius Krasuckas
Committed by
Alexandre Julliard
Nov 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Make subclass.c compile with -D__WINESRC__.
parent
ce91a287
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
32 deletions
+32
-32
subclass.c
dlls/comctl32/tests/subclass.c
+32
-32
No files found.
dlls/comctl32/tests/subclass.c
View file @
10f5a733
...
...
@@ -166,7 +166,7 @@ static void ok_sequence(const struct message *expected, const char *context)
flush_sequence
();
}
static
LRESULT
WINAPI
WndProc
1
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
static
LRESULT
WINAPI
wnd_proc_
1
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
struct
message
msg
;
...
...
@@ -175,12 +175,12 @@ static LRESULT WINAPI WndProc1(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
msg
.
procnum
=
1
;
add_message
(
&
msg
);
}
return
DefWindowProc
(
hwnd
,
message
,
wParam
,
lParam
);
return
DefWindowProc
A
(
hwnd
,
message
,
wParam
,
lParam
);
}
static
WNDPROC
orig
Proc
3
;
static
LRESULT
WINAPI
WndProc
3
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
static
WNDPROC
orig
_proc_
3
;
static
LRESULT
WINAPI
wnd_proc_
3
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
struct
message
msg
;
...
...
@@ -189,10 +189,10 @@ static LRESULT WINAPI WndProc3(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
msg
.
procnum
=
3
;
add_message
(
&
msg
);
}
return
CallWindowProc
(
origProc
3
,
hwnd
,
message
,
wParam
,
lParam
);
return
CallWindowProc
A
(
orig_proc_
3
,
hwnd
,
message
,
wParam
,
lParam
);
}
static
LRESULT
WINAPI
WndProcS
ub
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
,
UINT_PTR
uldSubclass
,
DWORD_PTR
dwRefData
)
static
LRESULT
WINAPI
wnd_proc_s
ub
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
,
UINT_PTR
uldSubclass
,
DWORD_PTR
dwRefData
)
{
struct
message
msg
;
...
...
@@ -203,13 +203,13 @@ static LRESULT WINAPI WndProcSub(HWND hwnd, UINT message, WPARAM wParam, LPARAM
if
(
lParam
)
{
if
(
dwRefData
&
DELETE_SELF
)
{
pRemoveWindowSubclass
(
hwnd
,
WndProcS
ub
,
uldSubclass
);
pRemoveWindowSubclass
(
hwnd
,
WndProcS
ub
,
uldSubclass
);
pRemoveWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
uldSubclass
);
pRemoveWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
uldSubclass
);
}
if
(
dwRefData
&
DELETE_PREV
)
pRemoveWindowSubclass
(
hwnd
,
WndProcS
ub
,
uldSubclass
-
1
);
pRemoveWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
uldSubclass
-
1
);
if
(
dwRefData
&
SEND_NEST
)
SendMessage
(
hwnd
,
WM_USER
,
wParam
+
1
,
0
);
SendMessage
A
(
hwnd
,
WM_USER
,
wParam
+
1
,
0
);
}
}
return
pDefSubclassProc
(
hwnd
,
message
,
wParam
,
lParam
);
...
...
@@ -221,51 +221,51 @@ static void test_subclass(void)
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
assert
(
hwnd
);
pSetWindowSubclass
(
hwnd
,
WndProcS
ub
,
2
,
0
);
SendMessage
(
hwnd
,
WM_USER
,
1
,
0
);
SendMessage
(
hwnd
,
WM_USER
,
2
,
0
);
pSetWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
2
,
0
);
SendMessage
A
(
hwnd
,
WM_USER
,
1
,
0
);
SendMessage
A
(
hwnd
,
WM_USER
,
2
,
0
);
ok_sequence
(
Sub_BasicTest
,
"Basic"
);
pSetWindowSubclass
(
hwnd
,
WndProcS
ub
,
2
,
DELETE_SELF
);
SendMessage
(
hwnd
,
WM_USER
,
1
,
1
);
pSetWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
2
,
DELETE_SELF
);
SendMessage
A
(
hwnd
,
WM_USER
,
1
,
1
);
ok_sequence
(
Sub_DeletedTest
,
"Deleted"
);
SendMessage
(
hwnd
,
WM_USER
,
1
,
0
);
SendMessage
A
(
hwnd
,
WM_USER
,
1
,
0
);
ok_sequence
(
Sub_AfterDeletedTest
,
"After Deleted"
);
pSetWindowSubclass
(
hwnd
,
WndProcS
ub
,
2
,
0
);
orig
Proc3
=
(
WNDPROC
)
SetWindowLongPtr
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
WndProc
3
);
SendMessage
(
hwnd
,
WM_USER
,
1
,
0
);
SendMessage
(
hwnd
,
WM_USER
,
2
,
0
);
pSetWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
2
,
0
);
orig
_proc_3
=
(
WNDPROC
)
SetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
wnd_proc_
3
);
SendMessage
A
(
hwnd
,
WM_USER
,
1
,
0
);
SendMessage
A
(
hwnd
,
WM_USER
,
2
,
0
);
ok_sequence
(
Sub_OldAfterNewTest
,
"Old after New"
);
pSetWindowSubclass
(
hwnd
,
WndProcS
ub
,
4
,
0
);
SendMessage
(
hwnd
,
WM_USER
,
1
,
0
);
pSetWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
4
,
0
);
SendMessage
A
(
hwnd
,
WM_USER
,
1
,
0
);
ok_sequence
(
Sub_MixTest
,
"Mix"
);
/* Now the fun starts */
pSetWindowSubclass
(
hwnd
,
WndProcS
ub
,
4
,
SEND_NEST
);
SendMessage
(
hwnd
,
WM_USER
,
1
,
1
);
pSetWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
4
,
SEND_NEST
);
SendMessage
A
(
hwnd
,
WM_USER
,
1
,
1
);
ok_sequence
(
Sub_MixAndNestTest
,
"Mix and nest"
);
pSetWindowSubclass
(
hwnd
,
WndProcS
ub
,
4
,
SEND_NEST
|
DELETE_SELF
);
SendMessage
(
hwnd
,
WM_USER
,
1
,
1
);
pSetWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
4
,
SEND_NEST
|
DELETE_SELF
);
SendMessage
A
(
hwnd
,
WM_USER
,
1
,
1
);
ok_sequence
(
Sub_MixNestDelTest
,
"Mix, nest, del"
);
pSetWindowSubclass
(
hwnd
,
WndProcS
ub
,
4
,
0
);
pSetWindowSubclass
(
hwnd
,
WndProcS
ub
,
5
,
DELETE_PREV
);
SendMessage
(
hwnd
,
WM_USER
,
1
,
1
);
pSetWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
4
,
0
);
pSetWindowSubclass
(
hwnd
,
wnd_proc_s
ub
,
5
,
DELETE_PREV
);
SendMessage
A
(
hwnd
,
WM_USER
,
1
,
1
);
ok_sequence
(
Sub_MixDelPrevTest
,
"Mix and del prev"
);
DestroyWindow
(
hwnd
);
}
static
BOOL
RegisterWindowC
lasses
(
void
)
static
BOOL
register_window_c
lasses
(
void
)
{
WNDCLASSA
cls
;
cls
.
style
=
0
;
cls
.
lpfnWndProc
=
WndProc
1
;
cls
.
lpfnWndProc
=
wnd_proc_
1
;
cls
.
cbClsExtra
=
0
;
cls
.
cbWndExtra
=
0
;
cls
.
hInstance
=
GetModuleHandleA
(
0
);
...
...
@@ -323,7 +323,7 @@ START_TEST(subclass)
{
if
(
!
init_function_pointers
())
return
;
if
(
!
RegisterWindowC
lasses
())
assert
(
0
);
if
(
!
register_window_c
lasses
())
assert
(
0
);
test_subclass
();
}
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