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
4893b157
Commit
4893b157
authored
Mar 18, 2007
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Mar 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: tests: Using DefWindowProcA with RegisterClassW works under Windows.
parent
92a375bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
class.c
dlls/user32/tests/class.c
+70
-0
No files found.
dlls/user32/tests/class.c
View file @
4893b157
...
...
@@ -556,6 +556,75 @@ static void test_instances(void)
check_thread_instance
(
"EDIT"
,
(
HINSTANCE
)
0x12345678
,
(
HINSTANCE
)
0x12345678
,
(
HINSTANCE
)
0xdeadbeef
);
}
static
void
test_defwndproc
()
{
char
classA
[]
=
"deftest"
;
WCHAR
classW
[]
=
{
'd'
,
'e'
,
'f'
,
't'
,
'e'
,
's'
,
't'
,
0
};
int
i
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
WNDCLASSEXA
cls
;
/* the memory layout of WNDCLASSEXA and WNDCLASSEXW is the same */
ATOM
atom
;
HWND
hwnd
;
ZeroMemory
(
&
cls
,
sizeof
(
cls
));
cls
.
cbSize
=
sizeof
(
cls
);
cls
.
hInstance
=
GetModuleHandle
(
NULL
);
cls
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
if
(
i
&
1
)
cls
.
lpfnWndProc
=
DefWindowProcA
;
else
cls
.
lpfnWndProc
=
DefWindowProcW
;
if
(
i
&
2
)
{
cls
.
lpszClassName
=
classA
;
atom
=
RegisterClassExA
(
&
cls
);
}
else
{
cls
.
lpszClassName
=
(
LPSTR
)
classW
;
atom
=
RegisterClassExW
((
WNDCLASSEXW
*
)
&
cls
);
}
ok
(
atom
!=
0
,
"Couldn't register class, i=%d, %d
\n
"
,
i
,
GetLastError
());
hwnd
=
CreateWindowA
(
classA
,
NULL
,
0
,
0
,
0
,
100
,
100
,
NULL
,
NULL
,
GetModuleHandle
(
NULL
),
NULL
);
ok
(
hwnd
!=
NULL
,
"Couldn't create window i=%d
\n
"
,
i
);
if
((
i
&
1
)
&&
(
i
&
2
))
{
ok
(
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
)
==
(
LONG_PTR
)
DefWindowProcA
,
"Wrong ANSI wndproc: %p vs %p
\n
"
,
(
void
*
)
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
),
DefWindowProcA
);
ok
(
GetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
)
==
(
LONG_PTR
)
DefWindowProcA
,
"Wrong ANSI wndproc: %p vs %p
\n
"
,
(
void
*
)
GetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
),
DefWindowProcA
);
}
else
todo_wine
{
ok
(
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
)
==
(
LONG_PTR
)
DefWindowProcA
,
"Wrong ANSI wndproc: %p vs %p
\n
"
,
(
void
*
)
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
),
DefWindowProcA
);
ok
(
GetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
)
==
(
LONG_PTR
)
DefWindowProcA
,
"Wrong ANSI wndproc: %p vs %p
\n
"
,
(
void
*
)
GetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
),
DefWindowProcA
);
}
if
(
!
(
i
&
1
)
&&
!
(
i
&
2
))
{
ok
(
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
)
==
(
LONG_PTR
)
DefWindowProcW
,
"Wrong Unicode wndproc: %p vs %p
\n
"
,
(
void
*
)
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
),
DefWindowProcW
);
ok
(
GetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
)
==
(
LONG_PTR
)
DefWindowProcW
,
"Wrong Unicode wndproc: %p vs %p
\n
"
,
(
void
*
)
GetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
),
DefWindowProcW
);
}
else
todo_wine
{
ok
(
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
)
==
(
LONG_PTR
)
DefWindowProcW
,
"Wrong Unicode wndproc: %p vs %p
\n
"
,
(
void
*
)
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
),
DefWindowProcW
);
ok
(
GetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
)
==
(
LONG_PTR
)
DefWindowProcW
,
"Wrong Unicode wndproc: %p vs %p
\n
"
,
(
void
*
)
GetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
),
DefWindowProcW
);
}
DestroyWindow
(
hwnd
);
UnregisterClass
((
LPSTR
)(
DWORD_PTR
)
atom
,
GetModuleHandle
(
NULL
));
}
}
static
LRESULT
WINAPI
TestDlgProc
(
HWND
hWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
return
DefWindowProc
(
hWnd
,
uMsg
,
wParam
,
lParam
);
...
...
@@ -619,4 +688,5 @@ START_TEST(class)
CreateDialogParamTest
(
hInstance
);
test_styles
();
test_instances
();
test_defwndproc
();
}
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