Author: pschweitzer
Date: Sun Jan 1 16:44:40 2017
New Revision: 73496
URL:
http://svn.reactos.org/svn/reactos?rev=73496&view=rev
Log:
[SDK]
Implement the rtlver library with RtlIsNtDdiVersionAvailable(). Will be used later on by
BtrFS driver.
Reference:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff561954(v=vs.85)…
CORE-12617
Added:
trunk/reactos/sdk/lib/drivers/rtlver/
trunk/reactos/sdk/lib/drivers/rtlver/CMakeLists.txt (with props)
trunk/reactos/sdk/lib/drivers/rtlver/rtl.c (with props)
Modified:
trunk/reactos/sdk/lib/drivers/CMakeLists.txt
Modified: trunk/reactos/sdk/lib/drivers/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/drivers/CMakeLists…
==============================================================================
--- trunk/reactos/sdk/lib/drivers/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/drivers/CMakeLists.txt [iso-8859-1] Sun Jan 1 16:44:40 2017
@@ -6,4 +6,5 @@
add_subdirectory(libusb)
add_subdirectory(lwip)
add_subdirectory(ntoskrnl_vista)
+add_subdirectory(rtlver)
add_subdirectory(sound)
Added: trunk/reactos/sdk/lib/drivers/rtlver/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/drivers/rtlver/CMa…
==============================================================================
--- trunk/reactos/sdk/lib/drivers/rtlver/CMakeLists.txt (added)
+++ trunk/reactos/sdk/lib/drivers/rtlver/CMakeLists.txt [iso-8859-1] Sun Jan 1 16:44:40
2017
@@ -0,0 +1,7 @@
+add_definitions(-DUNICODE -D_UNICODE -D__NTOSKRNL__ -D_NTOSKRNL_ -D_NTSYSTEM_)
+
+list(APPEND SOURCE
+ rtl.c)
+
+add_library(rtlver ${SOURCE})
+add_dependencies(rtlver xdk)
Propchange: trunk/reactos/sdk/lib/drivers/rtlver/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/sdk/lib/drivers/rtlver/rtl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/drivers/rtlver/rtl…
==============================================================================
--- trunk/reactos/sdk/lib/drivers/rtlver/rtl.c (added)
+++ trunk/reactos/sdk/lib/drivers/rtlver/rtl.c [iso-8859-1] Sun Jan 1 16:44:40 2017
@@ -0,0 +1,41 @@
+/*
+ * PROJECT: ReactOS Kernel - Vista+ APIs
+ * LICENSE: GPL v2 - See COPYING in the top level directory
+ * FILE: lib/drivers/ntoskrnl_vista/rtl.c
+ * PURPOSE: Implementation of RtlIsNtDdiVersionAvailable and
RtlIsServicePackVersionInstalled
+ * PROGRAMMERS: Pierre Schweitzer <pierre(a)reactos.org>
+ */
+
+#include <ntdef.h>
+#include <ntifs.h>
+
+BOOLEAN
+WdmlibRtlIsNtDdiVersionAvailable(
+ _In_ ULONG Version)
+{
+ UNICODE_STRING ImportName;
+ ULONG Major, Minor, Current;
+ BOOLEAN (NTAPI *pRtlIsNtDdiVersionAvailable)(ULONG Version);
+
+ /* Try to use ntoskrnl version if available */
+ RtlInitUnicodeString(&ImportName, L"RtlIsNtDdiVersionAvailable");
+ pRtlIsNtDdiVersionAvailable = MmGetSystemRoutineAddress(&ImportName);
+ if (pRtlIsNtDdiVersionAvailable)
+ {
+ return pRtlIsNtDdiVersionAvailable(Version);
+ }
+
+ /* Only provide OS version. No SP */
+ if (SPVER(Version) || SUBVER(Version))
+ {
+ return FALSE;
+ }
+
+ /* Compute the version and compare */
+ Major = 0;
+ Minor = 0;
+ PsGetVersion(&Major, &Minor, NULL, NULL);
+ Current = (Minor + (Major << 8)) << 16;
+
+ return (Current >= Version);
+}
Propchange: trunk/reactos/sdk/lib/drivers/rtlver/rtl.c
------------------------------------------------------------------------------
svn:eol-style = native