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
5aa45d9c
Commit
5aa45d9c
authored
Aug 03, 2010
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add a test for GetClassInfo, make it pass under Wine.
parent
e7b9bf3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
0 deletions
+73
-0
class.c
dlls/user32/class.c
+12
-0
class.c
dlls/user32/tests/class.c
+61
-0
No files found.
dlls/user32/class.c
View file @
5aa45d9c
...
...
@@ -1070,6 +1070,12 @@ BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name, WNDCLASSEXA *wc )
TRACE
(
"%p %s %p
\n
"
,
hInstance
,
debugstr_a
(
name
),
wc
);
if
(
!
wc
)
{
SetLastError
(
ERROR_NOACCESS
);
return
FALSE
;
}
if
(
!
hInstance
)
hInstance
=
user32_module
;
if
(
!
IS_INTRESOURCE
(
name
))
...
...
@@ -1115,6 +1121,12 @@ BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name, WNDCLASSEXW *wc
TRACE
(
"%p %s %p
\n
"
,
hInstance
,
debugstr_w
(
name
),
wc
);
if
(
!
wc
)
{
SetLastError
(
ERROR_NOACCESS
);
return
FALSE
;
}
if
(
!
hInstance
)
hInstance
=
user32_module
;
if
(
!
(
classPtr
=
CLASS_FindClass
(
name
,
hInstance
)))
...
...
dlls/user32/tests/class.c
View file @
5aa45d9c
...
...
@@ -900,10 +900,71 @@ static void test_extra_values(void)
}
}
static
void
test_GetClassInfo
(
void
)
{
static
const
WCHAR
staticW
[]
=
{
's'
,
't'
,
'a'
,
't'
,
'i'
,
'c'
,
0
};
WNDCLASSA
wc
;
WNDCLASSEXA
wcx
;
BOOL
ret
;
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoA
(
0
,
"static"
,
&
wc
);
ok
(
ret
,
"GetClassInfoA() error %d
\n
"
,
GetLastError
());
if
(
0
)
{
/* crashes under XP */
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoA
(
0
,
"static"
,
NULL
);
ok
(
ret
,
"GetClassInfoA() error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoW
(
0
,
staticW
,
NULL
);
ok
(
ret
,
"GetClassInfoW() error %d
\n
"
,
GetLastError
());
}
wcx
.
cbSize
=
sizeof
(
wcx
);
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoExA
(
0
,
"static"
,
&
wcx
);
ok
(
ret
,
"GetClassInfoExA() error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoExA
(
0
,
"static"
,
NULL
);
ok
(
!
ret
,
"GetClassInfoExA() should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOACCESS
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* win9x */
"expected ERROR_NOACCESS, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoExW
(
0
,
staticW
,
NULL
);
ok
(
!
ret
,
"GetClassInfoExW() should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOACCESS
||
broken
(
GetLastError
()
==
0xdeadbeef
)
/* NT4 */
||
broken
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
),
/* win9x */
"expected ERROR_NOACCESS, got %d
\n
"
,
GetLastError
());
wcx
.
cbSize
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoExA
(
0
,
"static"
,
&
wcx
);
ok
(
ret
,
"GetClassInfoExA() error %d
\n
"
,
GetLastError
());
ok
(
wcx
.
cbSize
==
0
,
"expected 0, got %u
\n
"
,
wcx
.
cbSize
);
wcx
.
cbSize
=
sizeof
(
wcx
)
-
1
;
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoExA
(
0
,
"static"
,
&
wcx
);
ok
(
ret
,
"GetClassInfoExA() error %d
\n
"
,
GetLastError
());
ok
(
wcx
.
cbSize
==
sizeof
(
wcx
)
-
1
,
"expected sizeof(wcx)-1, got %u
\n
"
,
wcx
.
cbSize
);
wcx
.
cbSize
=
sizeof
(
wcx
)
+
1
;
SetLastError
(
0xdeadbeef
);
ret
=
GetClassInfoExA
(
0
,
"static"
,
&
wcx
);
ok
(
ret
,
"GetClassInfoExA() error %d
\n
"
,
GetLastError
());
ok
(
wcx
.
cbSize
==
sizeof
(
wcx
)
+
1
,
"expected sizeof(wcx)+1, got %u
\n
"
,
wcx
.
cbSize
);
}
START_TEST
(
class
)
{
HANDLE
hInstance
=
GetModuleHandleA
(
NULL
);
test_GetClassInfo
();
test_extra_values
();
if
(
!
GetModuleHandleW
(
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