Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
31d9341e
Commit
31d9341e
authored
Jul 17, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jul 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use a common condition value for the major, minor and service pack version numbers.
parent
644e079d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
31 deletions
+44
-31
version.c
dlls/kernel/tests/version.c
+7
-9
version.c
dlls/ntdll/version.c
+37
-22
No files found.
dlls/kernel/tests/version.c
View file @
31d9341e
...
...
@@ -53,7 +53,7 @@ START_TEST(version)
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
());
ok
(
ret
,
"VerifyVersionInfoA failed with error %ld
\n
"
,
GetLastError
());
ret
=
pVerifyVersionInfoA
(
&
info
,
VER_BUILDNUMBER
|
VER_MAJORVERSION
|
VER_MINORVERSION
/* | VER_PLATFORMID | VER_SERVICEPACKMAJOR |
...
...
@@ -101,7 +101,7 @@ START_TEST(version)
info
.
wServicePackMinor
++
;
ret
=
pVerifyVersionInfoA
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
pVerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
/* test the failure hierarchy for the four version fields */
...
...
@@ -110,7 +110,7 @@ START_TEST(version)
info
.
wServicePackMajor
++
;
ret
=
pVerifyVersionInfoA
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
pVerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
GetVersionEx
((
OSVERSIONINFO
*
)
&
info
);
...
...
@@ -129,10 +129,9 @@ START_TEST(version)
ret
=
pVerifyVersionInfoA
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
pVerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfoA failed with error %ld
\n
"
,
GetLastError
());
ok
(
ret
,
"VerifyVersionInfoA 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
=
pVerifyVersionInfoA
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
...
...
@@ -142,13 +141,12 @@ START_TEST(version)
ret
=
pVerifyVersionInfoA
(
&
info
,
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
pVerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
ret
,
"VerifyVersionInfoA failed with error %ld
\n
"
,
GetLastError
());
ok
(
ret
,
"VerifyVersionInfoA failed with error %ld
\n
"
,
GetLastError
());
/* test bad dwOSVersionInfoSize */
GetVersionEx
((
OSVERSIONINFO
*
)
&
info
);
info
.
dwOSVersionInfoSize
=
0
;
ret
=
pVerifyVersionInfoA
(
&
info
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
,
pVerSetConditionMask
(
0
,
VER_MINORVERSION
,
VER_GREATER_EQUAL
));
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_OLD_WIN_VERSION
),
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %ld
\n
"
,
GetLastError
());
pVerSetConditionMask
(
0
,
VER_MAJORVERSION
,
VER_GREATER_EQUAL
));
ok
(
ret
,
"VerifyVersionInfoA failed with error %ld
\n
"
,
GetLastError
());
}
dlls/ntdll/version.c
View file @
31d9341e
...
...
@@ -642,29 +642,44 @@ NTSTATUS WINAPI RtlVerifyVersionInfo( const RTL_OSVERSIONINFOEXW *info,
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
}
if
(
dwTypeMask
&
VER_MAJORVERSION
)
{
status
=
version_compare_values
(
ver
.
dwMajorVersion
,
info
->
dwMajorVersion
,
dwlConditionMask
>>
1
*
3
&
0x07
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
}
if
(
dwTypeMask
&
VER_MINORVERSION
)
{
status
=
version_compare_values
(
ver
.
dwMinorVersion
,
info
->
dwMinorVersion
,
dwlConditionMask
>>
0
*
3
&
0x07
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
}
if
(
dwTypeMask
&
VER_SERVICEPACKMAJOR
)
{
status
=
version_compare_values
(
ver
.
wServicePackMajor
,
info
->
wServicePackMajor
,
dwlConditionMask
>>
5
*
3
&
0x07
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
}
if
(
dwTypeMask
&
VER_SERVICEPACKMINOR
)
if
(
dwTypeMask
&
(
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
|
VER_SERVICEPACKMINOR
))
{
status
=
version_compare_values
(
ver
.
wServicePackMinor
,
info
->
wServicePackMinor
,
dwlConditionMask
>>
4
*
3
&
0x07
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
unsigned
char
condition
=
0
;
if
(
dwTypeMask
&
VER_MAJORVERSION
)
condition
=
dwlConditionMask
>>
1
*
3
&
0x07
;
else
if
(
dwTypeMask
&
VER_MINORVERSION
)
condition
=
dwlConditionMask
>>
0
*
3
&
0x07
;
else
if
(
dwTypeMask
&
VER_SERVICEPACKMAJOR
)
condition
=
dwlConditionMask
>>
5
*
3
&
0x07
;
else
if
(
dwTypeMask
&
VER_SERVICEPACKMINOR
)
condition
=
dwlConditionMask
>>
4
*
3
&
0x07
;
if
(
dwTypeMask
&
VER_MAJORVERSION
)
{
status
=
version_compare_values
(
ver
.
dwMajorVersion
,
info
->
dwMajorVersion
,
condition
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
}
if
(
dwTypeMask
&
VER_MINORVERSION
)
{
status
=
version_compare_values
(
ver
.
dwMinorVersion
,
info
->
dwMinorVersion
,
condition
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
}
if
(
dwTypeMask
&
VER_SERVICEPACKMAJOR
)
{
status
=
version_compare_values
(
ver
.
wServicePackMajor
,
info
->
wServicePackMajor
,
condition
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
}
if
(
dwTypeMask
&
VER_SERVICEPACKMINOR
)
{
status
=
version_compare_values
(
ver
.
wServicePackMinor
,
info
->
wServicePackMinor
,
condition
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
}
}
return
STATUS_SUCCESS
;
...
...
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