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
b3a85a3f
Commit
b3a85a3f
authored
Nov 30, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Dec 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add some simple tests for GetVersionExA.
parent
29d66b48
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
version.c
dlls/kernel32/tests/version.c
+52
-0
version.c
dlls/kernel32/version.c
+1
-0
No files found.
dlls/kernel32/tests/version.c
View file @
b3a85a3f
...
...
@@ -43,12 +43,64 @@ static void init_function_pointers(void)
KERNEL32_GET_PROC
(
VerSetConditionMask
);
}
static
void
test_GetVersionEx
(
void
)
{
OSVERSIONINFOA
infoA
;
OSVERSIONINFOEXA
infoExA
;
BOOL
ret
;
if
(
0
)
{
/* Silently crashes on XP */
ret
=
GetVersionExA
(
NULL
);
}
SetLastError
(
0xdeadbeef
);
memset
(
&
infoA
,
0
,
sizeof
infoA
);
ret
=
GetVersionExA
(
&
infoA
);
ok
(
!
ret
,
"Expected GetVersionExA to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
infoA
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOA
)
/
2
;
ret
=
GetVersionExA
(
&
infoA
);
ok
(
!
ret
,
"Expected GetVersionExA to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
infoA
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOA
)
*
2
;
ret
=
GetVersionExA
(
&
infoA
);
ok
(
!
ret
,
"Expected GetVersionExA to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
infoA
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOA
);
ret
=
GetVersionExA
(
&
infoA
);
ok
(
ret
,
"Expected GetVersionExA to succeed
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
infoExA
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOEXA
);
ret
=
GetVersionExA
((
OSVERSIONINFOA
*
)
&
infoExA
);
ok
(
ret
,
"Expected GetVersionExA to succeed
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
}
START_TEST
(
version
)
{
OSVERSIONINFOEX
info
=
{
sizeof
(
info
)
};
BOOL
ret
;
init_function_pointers
();
test_GetVersionEx
();
if
(
!
pVerifyVersionInfoA
||
!
pVerSetConditionMask
)
{
skip
(
"Needed functions not available
\n
"
);
...
...
dlls/kernel32/version.c
View file @
b3a85a3f
...
...
@@ -154,6 +154,7 @@ BOOL WINAPI GetVersionExA(OSVERSIONINFOA *v)
{
WARN
(
"wrong OSVERSIONINFO size from app (got: %d)
\n
"
,
v
->
dwOSVersionInfoSize
);
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
...
...
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