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
f7443102
Commit
f7443102
authored
Aug 16, 2022
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Aug 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add GetWindowSubclass() tests.
parent
26c95858
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
1 deletion
+51
-1
subclass.c
dlls/comctl32/tests/subclass.c
+51
-1
No files found.
dlls/comctl32/tests/subclass.c
View file @
f7443102
...
...
@@ -29,6 +29,7 @@
#include "wine/heap.h"
#include "wine/test.h"
static
BOOL
(
WINAPI
*
pGetWindowSubclass
)(
HWND
,
SUBCLASSPROC
,
UINT_PTR
,
DWORD_PTR
*
);
static
BOOL
(
WINAPI
*
pSetWindowSubclass
)(
HWND
,
SUBCLASSPROC
,
UINT_PTR
,
DWORD_PTR
);
static
BOOL
(
WINAPI
*
pRemoveWindowSubclass
)(
HWND
,
SUBCLASSPROC
,
UINT_PTR
);
static
LRESULT
(
WINAPI
*
pDefSubclassProc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
...
...
@@ -311,11 +312,12 @@ static BOOL init_function_pointers(void)
*/
#define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
MAKEFUNC_ORD
(
SetWindowSubclass
,
410
);
MAKEFUNC_ORD
(
GetWindowSubclass
,
411
);
MAKEFUNC_ORD
(
RemoveWindowSubclass
,
412
);
MAKEFUNC_ORD
(
DefSubclassProc
,
413
);
#undef MAKEFUNC_ORD
if
(
!
pSetWindowSubclass
||
!
pRemoveWindowSubclass
||
!
pDefSubclassProc
)
if
(
!
pSetWindowSubclass
||
!
p
GetWindowSubclass
||
!
p
RemoveWindowSubclass
||
!
pDefSubclassProc
)
{
win_skip
(
"SetWindowSubclass and friends are not available
\n
"
);
return
FALSE
;
...
...
@@ -338,6 +340,53 @@ static BOOL init_function_pointers(void)
return
TRUE
;
}
static
void
test_GetWindowSubclass
(
void
)
{
DWORD_PTR
data
;
HWND
hwnd
;
BOOL
ret
;
hwnd
=
CreateWindowA
(
"TestSubclass"
,
"Test subclass"
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
NULL
,
"CreateWindowA failed, error %ld.
\n
"
,
GetLastError
());
ret
=
pSetWindowSubclass
(
hwnd
,
wnd_proc_sub
,
2
,
7
);
ok
(
ret
,
"SetWindowSubclass failed.
\n
"
);
data
=
0xdeadbeef
;
ret
=
pGetWindowSubclass
(
NULL
,
wnd_proc_sub
,
2
,
&
data
);
ok
(
!
ret
,
"GetWindowSubclass succeeded.
\n
"
);
todo_wine
ok
(
data
==
0
,
"Got unexpected data %#Ix.
\n
"
,
data
);
data
=
0xdeadbeef
;
ret
=
pGetWindowSubclass
(
hwnd
,
NULL
,
2
,
&
data
);
ok
(
!
ret
,
"GetWindowSubclass succeeded.
\n
"
);
todo_wine
ok
(
data
==
0
,
"Got unexpected data %#Ix.
\n
"
,
data
);
data
=
0xdeadbeef
;
ret
=
pGetWindowSubclass
(
hwnd
,
wnd_proc_sub
,
0
,
&
data
);
ok
(
!
ret
,
"GetWindowSubclass succeeded.
\n
"
);
todo_wine
ok
(
data
==
0
,
"Got unexpected data %#Ix.
\n
"
,
data
);
/* Crash on Wine */
if
(
strcmp
(
winetest_platform
,
"wine"
))
{
ret
=
pGetWindowSubclass
(
hwnd
,
wnd_proc_sub
,
2
,
NULL
);
ok
(
ret
,
"GetWindowSubclass failed.
\n
"
);
}
data
=
0xdeadbeef
;
ret
=
pGetWindowSubclass
(
hwnd
,
wnd_proc_sub
,
2
,
&
data
);
ok
(
ret
,
"GetWindowSubclass failed.
\n
"
);
ok
(
data
==
7
,
"Got unexpected data %#Ix.
\n
"
,
data
);
pRemoveWindowSubclass
(
hwnd
,
wnd_proc_sub
,
2
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
subclass
)
{
if
(
!
init_function_pointers
())
return
;
...
...
@@ -345,4 +394,5 @@ START_TEST(subclass)
if
(
!
register_window_classes
())
return
;
test_subclass
();
test_GetWindowSubclass
();
}
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