1 /* 2 * PROJECT: ReactOS Kernel - Vista+ APIs 3 * LICENSE: GPL v2 - See COPYING in the top level directory 4 * FILE: lib/drivers/ntoskrnl_vista/rtl.c 5 * PURPOSE: Implementation of RtlIsNtDdiVersionAvailable and RtlIsServicePackVersionInstalled 6 * PROGRAMMERS: Pierre Schweitzer <pierre@reactos.org> 7 */ 8 9 #include <ntdef.h> 10 #include <ntifs.h> 11 12 BOOLEAN 13 WdmlibRtlIsNtDdiVersionAvailable( 14 _In_ ULONG Version) 15 { 16 UNICODE_STRING ImportName; 17 ULONG Major, Minor, Current; 18 BOOLEAN (NTAPI *pRtlIsNtDdiVersionAvailable)(ULONG Version); 19 20 /* Try to use ntoskrnl version if available */ 21 RtlInitUnicodeString(&ImportName, L"RtlIsNtDdiVersionAvailable"); 22 pRtlIsNtDdiVersionAvailable = MmGetSystemRoutineAddress(&ImportName); 23 if (pRtlIsNtDdiVersionAvailable) 24 { 25 return pRtlIsNtDdiVersionAvailable(Version); 26 } 27 28 /* Only provide OS version. No SP */ 29 if (SPVER(Version) || SUBVER(Version)) 30 { 31 return FALSE; 32 } 33 34 /* Compute the version and compare */ 35 Major = 0; 36 Minor = 0; 37 PsGetVersion(&Major, &Minor, NULL, NULL); 38 Current = (Minor + (Major << 8)) << 16; 39 40 return (Current >= Version); 41 } 42