[NTOSKRNL] Implement ObIsLUIDDeviceMapsEnabled and call it in NtQueryInformationProcess
authorPierre Schweitzer <pierre@reactos.org>
Sat, 1 Jun 2019 12:56:28 +0000 (14:56 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 1 Jun 2019 12:56:28 +0000 (14:56 +0200)
ntoskrnl/include/internal/ob.h
ntoskrnl/ob/devicemap.c
ntoskrnl/ob/obdir.c
ntoskrnl/ob/obname.c
ntoskrnl/ps/query.c

index ddbfeb4..132b47f 100644 (file)
@@ -429,6 +429,12 @@ ObpCreateDosDevicesDirectory(
     VOID
 );
 
+ULONG
+NTAPI
+ObIsLUIDDeviceMapsEnabled(
+    VOID
+);
+
 //
 // Security descriptor cache functions
 //
@@ -621,6 +627,7 @@ extern ULONG ObpUnsecureGlobalNamesLength;
 extern ULONG ObpObjectSecurityMode;
 extern ULONG ObpProtectionMode;
 extern ULONG ObpLUIDDeviceMapsDisabled;
+extern ULONG ObpLUIDDeviceMapsEnabled;
 
 //
 // Inlined Functions
index dd501f1..a4cd5af 100644 (file)
@@ -13,6 +13,9 @@
 #define NDEBUG
 #include <debug.h>
 
+ULONG ObpLUIDDeviceMapsDisabled;
+ULONG ObpLUIDDeviceMapsEnabled;
+
 /* PRIVATE FUNCTIONS ******************************************************/
 
 NTSTATUS
@@ -249,6 +252,14 @@ ObQueryDeviceMapInformation(IN PEPROCESS Process,
 }
 
 
+ULONG
+NTAPI
+ObIsLUIDDeviceMapsEnabled(VOID)
+{
+    return ObpLUIDDeviceMapsEnabled;
+}
+
+
 #if 0
 NTSTATUS
 NTAPI
index 3c62411..f8e3a36 100644 (file)
@@ -17,7 +17,6 @@
 #define NDEBUG
 #include <debug.h>
 
-BOOLEAN ObpLUIDDeviceMapsEnabled;
 POBJECT_TYPE ObpDirectoryObjectType = NULL;
 
 /* PRIVATE FUNCTIONS ******************************************************/
@@ -141,7 +140,7 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
     PAGED_CODE();
 
     /* Check if we should search the shadow directory */
-    if (!ObpLUIDDeviceMapsEnabled) SearchShadow = FALSE;
+    if (ObpLUIDDeviceMapsEnabled == 0) SearchShadow = FALSE;
 
     /* Fail if we don't have a directory or name */
     if (!(Directory) || !(Name)) goto Quickie;
index f05a068..5700d43 100644 (file)
@@ -32,9 +32,6 @@ UNICODE_STRING ObpDosDevicesShortName =
 WCHAR ObpUnsecureGlobalNamesBuffer[128] = {0};
 ULONG ObpUnsecureGlobalNamesLength = sizeof(ObpUnsecureGlobalNamesBuffer);
 
-ULONG ObpLUIDDeviceMapsDisabled;
-ULONG ObpLUIDDeviceMapsEnabled;
-
 /* PRIVATE FUNCTIONS *********************************************************/
 
 INIT_FUNCTION
index 1f605be..12036fb 100644 (file)
@@ -911,8 +911,8 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
             /* Protect write in SEH */
             _SEH2_TRY
             {
-                /* Return FALSE -- we don't support this */
-                *(PULONG)ProcessInformation = FALSE;
+                /* Query Ob */
+                *(PULONG)ProcessInformation = ObIsLUIDDeviceMapsEnabled();
             }
             _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
             {