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
6e5b36d4
Commit
6e5b36d4
authored
Mar 19, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Avoid compiler specific code in the DefWindowProc test.
parent
ce6a7595
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
class.c
dlls/user32/tests/class.c
+25
-21
No files found.
dlls/user32/tests/class.c
View file @
6e5b36d4
...
...
@@ -558,10 +558,14 @@ static void test_instances(void)
static
void
test_defwndproc
()
{
char
classA
[]
=
"deftest"
;
WCHAR
classW
[]
=
{
'd'
,
'e'
,
'f'
,
't'
,
'e'
,
's'
,
't'
,
0
};
static
const
char
classA
[]
=
"deftest"
;
static
const
WCHAR
classW
[]
=
{
'd'
,
'e'
,
'f'
,
't'
,
'e'
,
's'
,
't'
,
0
};
WNDPROC
pDefWindowProcA
,
pDefWindowProcW
;
int
i
;
pDefWindowProcA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"user32.dll"
),
"DefWindowProcA"
);
pDefWindowProcW
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"user32.dll"
),
"DefWindowProcW"
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
WNDCLASSEXA
cls
;
/* the memory layout of WNDCLASSEXA and WNDCLASSEXW is the same */
...
...
@@ -572,9 +576,9 @@ static void test_defwndproc()
cls
.
hInstance
=
GetModuleHandle
(
NULL
);
cls
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
if
(
i
&
1
)
cls
.
lpfnWndProc
=
DefWindowProcA
;
cls
.
lpfnWndProc
=
p
DefWindowProcA
;
else
cls
.
lpfnWndProc
=
DefWindowProcW
;
cls
.
lpfnWndProc
=
p
DefWindowProcW
;
if
(
i
&
2
)
{
...
...
@@ -583,7 +587,7 @@ static void test_defwndproc()
}
else
{
cls
.
lpszClassName
=
(
LPSTR
)
classW
;
cls
.
lpszClassName
=
(
LP
C
STR
)
classW
;
atom
=
RegisterClassExW
((
WNDCLASSEXW
*
)
&
cls
);
}
ok
(
atom
!=
0
,
"Couldn't register class, i=%d, %d
\n
"
,
i
,
GetLastError
());
...
...
@@ -592,32 +596,32 @@ static void test_defwndproc()
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
);
ok
(
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
)
==
(
LONG_PTR
)
p
DefWindowProcA
,
"Wrong ANSI wndproc: %p vs %p
\n
"
,
(
void
*
)
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
),
p
DefWindowProcA
);
ok
(
GetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
)
==
(
ULONG_PTR
)
p
DefWindowProcA
,
"Wrong ANSI wndproc: %p vs %p
\n
"
,
(
void
*
)
GetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
),
p
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
);
ok
(
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
)
==
(
LONG_PTR
)
p
DefWindowProcA
,
"Wrong ANSI wndproc: %p vs %p
\n
"
,
(
void
*
)
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
),
p
DefWindowProcA
);
ok
(
GetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
)
==
(
ULONG_PTR
)
p
DefWindowProcA
,
"Wrong ANSI wndproc: %p vs %p
\n
"
,
(
void
*
)
GetClassLongPtrA
(
hwnd
,
GCLP_WNDPROC
),
p
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
);
ok
(
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
)
==
(
LONG_PTR
)
p
DefWindowProcW
,
"Wrong Unicode wndproc: %p vs %p
\n
"
,
(
void
*
)
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
),
p
DefWindowProcW
);
ok
(
GetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
)
==
(
ULONG_PTR
)
p
DefWindowProcW
,
"Wrong Unicode wndproc: %p vs %p
\n
"
,
(
void
*
)
GetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
),
p
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
);
ok
(
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
)
==
(
LONG_PTR
)
p
DefWindowProcW
,
"Wrong Unicode wndproc: %p vs %p
\n
"
,
(
void
*
)
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
),
p
DefWindowProcW
);
ok
(
GetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
)
==
(
ULONG_PTR
)
p
DefWindowProcW
,
"Wrong Unicode wndproc: %p vs %p
\n
"
,
(
void
*
)
GetClassLongPtrW
(
hwnd
,
GCLP_WNDPROC
),
p
DefWindowProcW
);
}
DestroyWindow
(
hwnd
);
...
...
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