Windows: Store OS version as a global
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 21 Oct 2013 15:26:16 +0000 (11:26 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 26 Oct 2013 22:14:13 +0000 (15:14 -0700)
In DriverEntry() RtlGetVersion() is used to obtain the OS version
information.  Store the result in a global structure that can be
used elsewhere to make run time decisions based upon the OS.

Change-Id: I194e7da6858d1dea755d8de82a9bee70e63ade4d
Reviewed-on: http://gerrit.openafs.org/10350
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSData.cpp
src/WINNT/afsrdr/kernel/lib/AFSInit.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSExtern.h

index c8098ca..9e5a291 100644 (file)
@@ -120,4 +120,10 @@ PAFSRtlSetGroupSecurityDescriptor AFSRtlSetGroupSecurityDescriptor = NULL;
 
 SID_IDENTIFIER_AUTHORITY SeWorldSidAuthority = {SECURITY_WORLD_SID_AUTHORITY};
 
+//
+// System State Information
+//
+
+RTL_OSVERSIONINFOW AFSRtlSysVersion;
+
 }
index 240afa1..f25f5d5 100644 (file)
@@ -63,7 +63,6 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
     UNICODE_STRING uniDeviceName;
     ULONG ulIndex = 0;
     UNICODE_STRING uniRoutine;
-    RTL_OSVERSIONINFOW sysVersion;
 
     BOOLEAN bExit = FALSE;
 
@@ -116,12 +115,12 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
                        RegistryPath->Buffer,
                        RegistryPath->Length);
 
-        RtlZeroMemory( &sysVersion,
+       RtlZeroMemory( &AFSRtlSysVersion,
                        sizeof( RTL_OSVERSIONINFOW));
 
-        sysVersion.dwOSVersionInfoSize = sizeof( RTL_OSVERSIONINFOW);
+       AFSRtlSysVersion.dwOSVersionInfoSize = sizeof( RTL_OSVERSIONINFOW);
 
-        RtlGetVersion( &sysVersion);
+       RtlGetVersion( &AFSRtlSysVersion);
 
 #if 0
         //
@@ -139,7 +138,7 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
         // Mandatory Labels only exist on those operating systems.
         //
 
-        if( sysVersion.dwMajorVersion >= 6)
+       if( AFSRtlSysVersion.dwMajorVersion >= 6)
         {
             RtlInitUnicodeString( &uniRoutine,
                                   L"RtlSetSaclSecurityDescriptor");
index 4832614..ab7c1a0 100644 (file)
@@ -103,6 +103,8 @@ extern PAFSRtlSetGroupSecurityDescriptor AFSRtlSetGroupSecurityDescriptor;
 
 extern SID_IDENTIFIER_AUTHORITY SeWorldSidAuthority;
 
+extern RTL_OSVERSIONINFOW AFSRtlSysVersion;
+
 }
 
 #endif /* _AFS_EXTERN_H */