[kernel] IoIsWdmVersionAvailable함수
IoIsWdmVersionAvailableThe IoIsWdmVersionAvailable routine checks whether a given WDM version is supported by the operating system. BOOLEAN
ParametersReturn ValueIoIsWdmVersionAvailable returns TRUE if the version of WDM that the operating system provides is greater than or equal to the version number of WDM being requested. CommentsDrivers should use the RtlIsNtDdiVersionAvailable function instead of the IoIsWdmVersionAvailable function. Cross-platform drivers should use this routine to check the WDM version before performing any operations that vary by platform or are not supported in all versions of WDM. The constants WDM_MAJORVERSION and WDM_MINORVERSION are defined in wdm.h. The following lists the WDM version provided with each operating system.
Note that the minor version number is defined as a hexadecimal value. Later versions of WDM support all the features available in earlier versions of WDM; that is, each version of WDM is a superset of the previous WDM version. The following call returns TRUE on any of the listed operating systems, because all these systems support all the features of WDM 1.0:
The following example shows how a driver can dynamically detect the current operating system:
As the example shows, calling IoIsWdmVersionAvailable(1, 5) returns TRUE on Windows Me, Windows 2000, and any succeeding operating systems, but FALSE on Windows 98 and Windows 98 SE. RequirementsIRQL: PASSIVE_LEVEL Headers: Declared in wdm.h. Include wdm.h, ntddk.h, or ntifs.h. |
위의 DDK의 설명과 같이 윈도우즈의 버전을 구하기 위해 사용된다..
예로 만들 자면..
// define 선언 부분.. #define OSVER_WIN98 10 #define OSVER_WINME 11 #define OSVER_WIN2K 12 #define OSVER_WINXP 13 #define OSVER_WIN2K3 14 #define OSVER_VISTA 15 ULONG GetWindowsVersion() { if( IoIsWdmVersionAvailable( 6, 0x00 ) ) return OSVER_VISTA; if( IoIsWdmVersionAvailable( 1, 0x30 ) ) return OSVER_WIN2K3; if( IoIsWdmVersionAvailable( 1, 0x20 ) ) return OSVER_WINXP; if( IoIsWdmVersionAvailable( 1, 0x10 ) ) return OSVER_WIN2K; if( IoIsWdmVersionAvailable( 1, 0x05 ) ) return OSVER_WINME; if( IoIsWdmVersionAvailable( 1, 0x00 ) ) return OSVER_WIN98; return FALSE; } |
호완성을 위해.. 혹은 Os별.. .DDK 함수들이 다르니 꼭 Entry에서 확인 후 실행하는 것이 좋을듯...