From 555d8fe0534f16a66f5d7fb1a55a1ebdb236e812 Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Wed, 17 Mar 2010 22:46:57 +0200 Subject: [PATCH] ntoskrnl.exe: Implement IoIsWdmVersionAvailable. --- dlls/ntoskrnl.exe/ntoskrnl.c | 67 +++++++++++++++++++++++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 0131d2477f9..3513b014966 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2,6 +2,7 @@ * ntoskrnl.exe implementation * * Copyright (C) 2007 Alexandre Julliard + * Copyright (C) 2010 Damjan Jovanovic * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -677,6 +678,72 @@ PCONFIGURATION_INFORMATION WINAPI IoGetConfigurationInformation(void) } +/*********************************************************************** + * IoIsWdmVersionAvailable (NTOSKRNL.EXE.@) + */ +NTSTATUS WINAPI IoIsWdmVersionAvailable(UCHAR MajorVersion, UCHAR MinorVersion) +{ + DWORD version; + DWORD major; + DWORD minor; + + TRACE( "%d, 0x%X\n", MajorVersion, MinorVersion ); + + version = GetVersion(); + major = LOBYTE(version); + minor = HIBYTE(LOWORD(version)); + + if (MajorVersion == 6 && MinorVersion == 0) + { + /* Windows Vista, Windows Server 2008, Windows 7 */ + } + else if (MajorVersion == 1) + { + if (MinorVersion == 0x30) + { + /* Windows server 2003 */ + MajorVersion = 6; + MinorVersion = 0; + } + else if (MinorVersion == 0x20) + { + /* Windows XP */ + MajorVersion = 5; + MinorVersion = 1; + } + else if (MinorVersion == 0x10) + { + /* Windows 2000 */ + MajorVersion = 5; + MinorVersion = 0; + } + else if (MinorVersion == 0x05) + { + /* Windows ME */ + MajorVersion = 4; + MinorVersion = 0x5a; + } + else if (MinorVersion == 0x00) + { + /* Windows 98 */ + MajorVersion = 4; + MinorVersion = 0x0a; + } + else + { + FIXME( "unknown major %d minor 0x%X\n", MajorVersion, MinorVersion ); + return FALSE; + } + } + else + { + FIXME( "unknown major %d minor 0x%X\n", MajorVersion, MinorVersion ); + return FALSE; + } + return major > MajorVersion || (major == MajorVersion && minor >= MinorVersion); +} + + /*********************************************************************** * IoQueryDeviceDescription (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 5e11bf95709..0cbbbc66519 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -406,7 +406,7 @@ @ stub IoIsOperationSynchronous @ stub IoIsSystemThread @ stub IoIsValidNameGraftingBuffer -@ stub IoIsWdmVersionAvailable +@ stdcall IoIsWdmVersionAvailable(long long) @ stub IoMakeAssociatedIrp @ stub IoOpenDeviceInterfaceRegistryKey @ stub IoOpenDeviceRegistryKey