网站首页  词典首页

请输入您要查询的函数:

 

术语 verifyversioninfo
释义 VerifyVersionInfo
语法:
C++
BOOL WINAPI VerifyVersionInfo(
__in LPOSVERSIONINFOEX lpVersionInfo,
__in DWORD dwTypeMask,
__in DWORDLONG dwlConditionMask
);
VerifyVersionInfo功能
比较的操作系统版本要求,为系统的当前运行版本相应的值。
参数
lpVersionInfo [in]
A pointer to an OSVERSIONINFOEX structure containing the operating system version requirements to compare.在dwTypeMask参数表明该结构包含的信息进行比较的成员。
您必须设置这个结构dwOSVersionInfoSize成员为sizeof(OSVERSIONINFOEX)。您还必须指定为会员的有效数据dwTypeMask说明。该函数忽略结构的相应dwTypeMask位未设置的成员。
dwTypeMask [in]
阿面具,表明了OSVERSIONINFOEX结构的成员进行测试。此参数可以是一个或多个下列值。
ValueMeaning
VER_BUILDNUMBER
0x0000004dwBuildNumber
VER_MAJORVERSION
0x0000002dwMajorVersion
如果您正在测试的主要版本,您还必须测试次要版本和服务包主要和次要版本。
VER_MINORVERSION
0x0000001dwMinorVersion
VER_PLATFORMID
0x0000008dwPlatformId
VER_SERVICEPACKMAJOR
0x0000020wServicePackMajor
VER_SERVICEPACKMINOR
0x0000010wServicePackMinor
VER_SUITENAME
0x0000040wSuiteMask
VER_PRODUCT_TYPE
0x0000080wProductType
dwlConditionMask [in]
比较类型为每个成员使用lpVersionInfo进行比较。为了建立这个值,要求每个OSVERSIONINFOEX成员VerSetConditionMask功能或VER_SET_CONDITION宏曾经进行比较。
返回值
如果当前运行的操作系统符合规定的要求,返回值是一个非零值。
如果当前的系统不符合要求,则返回值为0,GetLastError返回ERROR_OLD_WIN_VERSION。
如果函数失败,返回值为零,GetLastError返回一个错误代码比ERROR_OLD_WIN_VERSION等。
备注
该VerifyVersionInfo函数检索有关当前运行的操作系统的版本信息和比较它的lpVersionInfo结构的有效成员。这使您可以轻松地确定一个规定的操作系统版本的条件存在。这是最好使用VerifyVersionInfo,而不是调用GetVersionEx函数来执行自己的比较。
通常情况下,VerifyVersionInfo返回一个非零值只有在所有指定的测试成功。但是,主,次,和Service Pack版本进行测试在等级制的方式,因为该操作系统版本是这些值的组合。如果条件为主要版本存在,它取代了次要版本和Service Pack版本规定的条件。 (您不能测试的主要版本比5和次要版本小于或等于1。如果您指定这样一个更大的考验,该函数将修改请求,以测试次要版本大于1,因为它是大于操作表演在主要版本。)
函数测试这些顺序值:主要版本,次要版本和Service Pack版本。函数值,而将继续测试它们是相等的,并停止在其中一个值不符合规定的条件。例如,如果您的系统大于或等于5.1版Service Pack 1的测试,测试成功,如果当前的版本是6.0。 (主要版本大于指定版本,所以测试站。以同样的方式),如果您的系统大于或等于5.1版Service Pack 1的测试,测试成功,如果当前的版本是5.2。 (次要版本大于指定的版本,所以测试站。)但是,如果您的系统大于或等于5.1版Service Pack 1的测试,测试失败,如果目前的版本为5.0的Service Pack 2。 (次要版本不大于指定版本,所以测试站。)
要验证的系统版本范围,您必须调用VerifyVersionInfo两次。例如,要验证系统版本大于5.0,但低于或等于5.1,先请VerifyVersionInfo测试,主要的版本是5和次要版本大于0,然后调用VerifyVersionInfo再次测试,主要的版本5和次要版本小于或等于1。
确定当前的操作系统通常是不是最好的方法,以确定是否一个特定的操作系统功能存在。这是因为操作系统可能有新功能,可再发行的DLL中添加。而不是使用GetVersionEx,以确定操作系统平台或版本号,测试的功能本身的存在。有关更多信息,请参阅操作系统版本。
要验证是否当前操作系统要么是Media Center或Tablet的Windows,请GetSystemMetrics PC版。
实例
为例见验证系统版本。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesVerifyVersionInfoW(Unicode)和VerifyVersionInfoA(ANSI)的
参见
GetVersionEx
操作系统版本
OSVERSIONINFOEX
系统信息功能
VER_SET_CONDITION
VerSetConditionMask
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==VerifyVersionInfo Function
Compares a set of operating system version requirements to the corresponding values for the currently running version of the system.
Syntax
C++
BOOL WINAPI VerifyVersionInfo(
__in LPOSVERSIONINFOEX lpVersionInfo,
__in DWORD dwTypeMask,
__in DWORDLONG dwlConditionMask
);
Parameters
lpVersionInfo [in]
A pointer to an OSVERSIONINFOEX structure containing the operating system version requirements to compare. The dwTypeMask parameter indicates the members of this structure that contain information to compare.
You must set the dwOSVersionInfoSize member of this structure to sizeof(OSVERSIONINFOEX). You must also specify valid data for the members indicated by dwTypeMask. The function ignores structure members for which the corresponding dwTypeMask bit is not set.
dwTypeMask [in]
A mask that indicates the members of the OSVERSIONINFOEX structure to be tested. This parameter can be one or more of the following values.
ValueMeaning
VER_BUILDNUMBER
0x0000004dwBuildNumber
VER_MAJORVERSION
0x0000002dwMajorVersion
If you are testing the major version, you must also test the minor version and the service pack major and minor versions.
VER_MINORVERSION
0x0000001dwMinorVersion
VER_PLATFORMID
0x0000008dwPlatformId
VER_SERVICEPACKMAJOR
0x0000020wServicePackMajor
VER_SERVICEPACKMINOR
0x0000010wServicePackMinor
VER_SUITENAME
0x0000040wSuiteMask
VER_PRODUCT_TYPE
0x0000080wProductType

dwlConditionMask [in]
The type of comparison to be used for each lpVersionInfo member being compared. To build this value, call the VerSetConditionMask function or the VER_SET_CONDITION macro once for each OSVERSIONINFOEX member being compared.
Return Value
If the currently running operating system satisfies the specified requirements, the return value is a nonzero value.
If the current system does not satisfy the requirements, the return value is zero and GetLastError returns ERROR_OLD_WIN_VERSION.
If the function fails, the return value is zero and GetLastError returns an error code other than ERROR_OLD_WIN_VERSION.
Remarks
The VerifyVersionInfo function retrieves version information about the currently running operating system and compares it to the valid members of the lpVersionInfo structure. This enables you to easily determine the presence of a required set of operating system version conditions. It is preferable to use VerifyVersionInfo rather than calling the GetVersionEx function to perform your own comparisons.
Typically, VerifyVersionInfo returns a nonzero value only if all specified tests succeed. However, major, minor, and service pack versions are tested in a hierarchical manner because the operating system version is a combination of these values. If a condition exists for the major version, it supersedes the conditions specified for minor version and service pack version. (You cannot test for major version greater than 5 and minor version less than or equal to 1. If you specify such a test, the function will change the request to test for a minor version greater than 1 because it is performing a greater than operation on the major version.)
The function tests these values in this order: major version, minor version, and service pack version. The function continues testing values while they are equal, and stops when one of the values does not meet the specified condition. For example, if you test for a system greater than or equal to version 5.1 service pack 1, the test succeeds if the current version is 6.0. (The major version is greater than the specified version, so the testing stops.) In the same way, if you test for a system greater than or equal to version 5.1 service pack 1, the test succeeds if the current version is 5.2. (The minor version is greater than the specified versions, so the testing stops.) However, if you test for a system greater than or equal to version 5.1 service pack 1, the test fails if the current version is 5.0 service pack 2. (The minor version is not greater than the specified version, so the testing stops.)
To verify a range of system versions, you must call VerifyVersionInfo twice. For example, to verify that the system version is greater than 5.0 but less than or equal to 5.1, first call VerifyVersionInfo to test that the major version is 5 and the minor version is greater than 0, then call VerifyVersionInfo again to test that the major version is 5 and the minor version is less than or equal to 1.
Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using GetVersionEx to determine the operating system platform or version number, test for the presence of the feature itself. For more information, see Operating System Version .
To verify whether the current operating system is either the Media Center or Tablet PC version of Windows, call GetSystemMetrics .
Examples
For an example, see Verifying the System Version .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesVerifyVersionInfoW (Unicode) and VerifyVersionInfoA (ANSI)
See Also
GetVersionEx
Operating System Version
OSVERSIONINFOEX
System Information Functions
VER_SET_CONDITION
VerSetConditionMask
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms725492(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:26:39