Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
fcc68659
Commit
fcc68659
authored
18 years ago
by
Saulius Krasuckas
Committed by
Alexandre Julliard
18 years ago
Browse files
Options
Downloads
Patches
Plain Diff
kernel: Version test was using imports missing on WinME.
parent
cc6bb93b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/kernel/tests/version.c
+70
-45
70 additions, 45 deletions
dlls/kernel/tests/version.c
with
70 additions
and
45 deletions
dlls/kernel/tests/version.c
+
70
−
45
View file @
fcc68659
...
...
@@ -18,34 +18,59 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include
<assert.h>
#include
"wine/test.h"
#include
"winbase.h"
static
BOOL
(
WINAPI
*
pVerifyVersionInfoA
)(
LPOSVERSIONINFOEXA
,
DWORD
,
DWORDLONG
);
static
ULONGLONG
(
WINAPI
*
pVerSetConditionMask
)(
ULONGLONG
,
DWORD
,
BYTE
);
#define KERNEL32_GET_PROC(func) \
p##func = (void *)GetProcAddress(hKernel32, #func); \
if(!p##func) trace("GetProcAddress(hKernel32, '%s') failed\n", #func);
static
void
init_function_pointers
(
void
)
{
HMODULE
hKernel32
;
pVerifyVersionInfoA
=
NULL
;
pVerSetConditionMask
=
NULL
;
hKernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
assert
(
hKernel32
);
KERNEL32_GET_PROC
(
VerifyVersionInfoA
);
KERNEL32_GET_PROC
(
VerSetConditionMask
);
}
START_TEST
(
version
)
{
OSVERSIONINFOEX
info
=
{
sizeof
(
info
)
};
BOOL
ret
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
,
VerSetConditionMask
(
0
,
VER_MAJORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfo failed with error %ld
\n
"
,
GetLastError
());
init_function_pointers
();
if
(
!
pVerifyVersionInfoA
||
!
pVerSetConditionMask
)
return
;
ret
=
pVerifyVersionInfoA
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
,
pVerSetConditionMask
(
0
,
VER_MAJORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfoA failed with error %ld
\n
"
,
GetLastError
());
ret
=
VerifyVersionInfo
(
&
info
,
VER_BUILDNUMBER
|
VER_MAJORVERSION
|
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_BUILDNUMBER
|
VER_MAJORVERSION
|
VER_MINORVERSION
/* | VER_PLATFORMID | VER_SERVICEPACKMAJOR |
VER_SERVICEPACKMINOR | VER_SUITENAME | VER_PRODUCT_TYPE */
,
VerSetConditionMask
(
0
,
VER_MAJORVERSION
,
VER_GREATER_EQUAL
));
p
VerSetConditionMask
(
0
,
VER_MAJORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfo should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
"VerifyVersionInfo
A
should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
/* tests special handling of VER_SUITENAME */
ret
=
VerifyVersionInfo
(
&
info
,
VER_SUITENAME
,
VerSetConditionMask
(
0
,
VER_SUITENAME
,
VER_AND
));
ok
(
ret
,
"VerifyVersionInfo failed with error %ld
\n
"
,
GetLastError
());
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_SUITENAME
,
p
VerSetConditionMask
(
0
,
VER_SUITENAME
,
VER_AND
));
ok
(
ret
,
"VerifyVersionInfo
A
failed with error %ld
\n
"
,
GetLastError
());
ret
=
VerifyVersionInfo
(
&
info
,
VER_SUITENAME
,
VerSetConditionMask
(
0
,
VER_SUITENAME
,
VER_OR
));
ok
(
ret
,
"VerifyVersionInfo failed with error %ld
\n
"
,
GetLastError
());
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_SUITENAME
,
p
VerSetConditionMask
(
0
,
VER_SUITENAME
,
VER_OR
));
ok
(
ret
,
"VerifyVersionInfo
A
failed with error %ld
\n
"
,
GetLastError
());
/* test handling of version numbers */
...
...
@@ -53,77 +78,77 @@ START_TEST(version)
* if the minor version is tested */
info
.
dwMajorVersion
=
3
;
info
.
dwMinorVersion
=
10
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
),
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
),
VER_MAJORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfo failed with error %ld
\n
"
,
GetLastError
());
todo_wine
ok
(
ret
,
"VerifyVersionInfo
A
failed with error %ld
\n
"
,
GetLastError
());
info
.
dwMinorVersion
=
0
;
info
.
wServicePackMajor
=
10
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
),
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
),
VER_MAJORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfo failed with error %ld
\n
"
,
GetLastError
());
todo_wine
ok
(
ret
,
"VerifyVersionInfo
A
failed with error %ld
\n
"
,
GetLastError
());
info
.
wServicePackMajor
=
0
;
info
.
wServicePackMinor
=
10
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
),
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
),
VER_MAJORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfo failed with error %ld
\n
"
,
GetLastError
());
todo_wine
ok
(
ret
,
"VerifyVersionInfo
A
failed with error %ld
\n
"
,
GetLastError
());
GetVersionEx
((
OSVERSIONINFO
*
)
&
info
);
info
.
wServicePackMinor
++
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfo should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
"VerifyVersionInfo
A
should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
/* test the failure hierarchy for the four version fields */
GetVersionEx
((
OSVERSIONINFO
*
)
&
info
);
info
.
wServicePackMajor
++
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfo should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
"VerifyVersionInfo
A
should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
GetVersionEx
((
OSVERSIONINFO
*
)
&
info
);
info
.
dwMinorVersion
++
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfo should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
"VerifyVersionInfo
A
should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
GetVersionEx
((
OSVERSIONINFO
*
)
&
info
);
info
.
dwMajorVersion
++
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfo should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
"VerifyVersionInfo
A
should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
ret
=
VerifyVersionInfo
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfo failed with error %ld
\n
"
,
GetLastError
());
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfo
A
failed with error %ld
\n
"
,
GetLastError
());
/* shows that build number fits into the hierarchy after major version, but before minor version */
GetVersionEx
((
OSVERSIONINFO
*
)
&
info
);
info
.
dwBuildNumber
++
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfo should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
"VerifyVersionInfo
A
should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
ret
=
VerifyVersionInfo
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfo failed with error %ld
\n
"
,
GetLastError
());
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfo
A
failed with error %ld
\n
"
,
GetLastError
());
/* test bad dwOSVersionInfoSize */
GetVersionEx
((
OSVERSIONINFO
*
)
&
info
);
info
.
dwOSVersionInfoSize
=
0
;
ret
=
VerifyVersionInfo
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
ret
=
p
VerifyVersionInfo
A
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
p
VerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfo should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
"VerifyVersionInfo
A
should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment