https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b16a07fa6913184abe2d2…
commit b16a07fa6913184abe2d2bee321f8f7aef919808
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Jun 1 14:56:28 2019 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Jun 1 14:56:28 2019 +0200
[NTOSKRNL] Implement ObIsLUIDDeviceMapsEnabled and call it in
NtQueryInformationProcess
---
ntoskrnl/include/internal/ob.h | 7 +++++++
ntoskrnl/ob/devicemap.c | 11 +++++++++++
ntoskrnl/ob/obdir.c | 3 +--
ntoskrnl/ob/obname.c | 3 ---
ntoskrnl/ps/query.c | 4 ++--
5 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/ntoskrnl/include/internal/ob.h b/ntoskrnl/include/internal/ob.h
index ddbfeb42d92..132b47f5a6b 100644
--- a/ntoskrnl/include/internal/ob.h
+++ b/ntoskrnl/include/internal/ob.h
@@ -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
diff --git a/ntoskrnl/ob/devicemap.c b/ntoskrnl/ob/devicemap.c
index dd501f134f8..a4cd5afbfae 100644
--- a/ntoskrnl/ob/devicemap.c
+++ b/ntoskrnl/ob/devicemap.c
@@ -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
diff --git a/ntoskrnl/ob/obdir.c b/ntoskrnl/ob/obdir.c
index 3c62411fed5..f8e3a36a06a 100644
--- a/ntoskrnl/ob/obdir.c
+++ b/ntoskrnl/ob/obdir.c
@@ -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;
diff --git a/ntoskrnl/ob/obname.c b/ntoskrnl/ob/obname.c
index f05a06805d0..5700d43d5ca 100644
--- a/ntoskrnl/ob/obname.c
+++ b/ntoskrnl/ob/obname.c
@@ -32,9 +32,6 @@ UNICODE_STRING ObpDosDevicesShortName =
WCHAR ObpUnsecureGlobalNamesBuffer[128] = {0};
ULONG ObpUnsecureGlobalNamesLength = sizeof(ObpUnsecureGlobalNamesBuffer);
-ULONG ObpLUIDDeviceMapsDisabled;
-ULONG ObpLUIDDeviceMapsEnabled;
-
/* PRIVATE FUNCTIONS *********************************************************/
INIT_FUNCTION
diff --git a/ntoskrnl/ps/query.c b/ntoskrnl/ps/query.c
index 1f605be3349..12036fb01a1 100644
--- a/ntoskrnl/ps/query.c
+++ b/ntoskrnl/ps/query.c
@@ -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)
{