[NTOSKRNL] Implement ObIsLUIDDeviceMapsEnabled and call it in NtQueryInformationProcess

This commit is contained in:
Pierre Schweitzer 2019-06-01 14:56:28 +02:00
parent 7898b2eaa3
commit b16a07fa69
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
5 changed files with 21 additions and 7 deletions

View file

@ -429,6 +429,12 @@ ObpCreateDosDevicesDirectory(
VOID VOID
); );
ULONG
NTAPI
ObIsLUIDDeviceMapsEnabled(
VOID
);
// //
// Security descriptor cache functions // Security descriptor cache functions
// //
@ -621,6 +627,7 @@ extern ULONG ObpUnsecureGlobalNamesLength;
extern ULONG ObpObjectSecurityMode; extern ULONG ObpObjectSecurityMode;
extern ULONG ObpProtectionMode; extern ULONG ObpProtectionMode;
extern ULONG ObpLUIDDeviceMapsDisabled; extern ULONG ObpLUIDDeviceMapsDisabled;
extern ULONG ObpLUIDDeviceMapsEnabled;
// //
// Inlined Functions // Inlined Functions

View file

@ -13,6 +13,9 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
ULONG ObpLUIDDeviceMapsDisabled;
ULONG ObpLUIDDeviceMapsEnabled;
/* PRIVATE FUNCTIONS ******************************************************/ /* PRIVATE FUNCTIONS ******************************************************/
NTSTATUS NTSTATUS
@ -249,6 +252,14 @@ ObQueryDeviceMapInformation(IN PEPROCESS Process,
} }
ULONG
NTAPI
ObIsLUIDDeviceMapsEnabled(VOID)
{
return ObpLUIDDeviceMapsEnabled;
}
#if 0 #if 0
NTSTATUS NTSTATUS
NTAPI NTAPI

View file

@ -17,7 +17,6 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
BOOLEAN ObpLUIDDeviceMapsEnabled;
POBJECT_TYPE ObpDirectoryObjectType = NULL; POBJECT_TYPE ObpDirectoryObjectType = NULL;
/* PRIVATE FUNCTIONS ******************************************************/ /* PRIVATE FUNCTIONS ******************************************************/
@ -141,7 +140,7 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
PAGED_CODE(); PAGED_CODE();
/* Check if we should search the shadow directory */ /* 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 */ /* Fail if we don't have a directory or name */
if (!(Directory) || !(Name)) goto Quickie; if (!(Directory) || !(Name)) goto Quickie;

View file

@ -32,9 +32,6 @@ UNICODE_STRING ObpDosDevicesShortName =
WCHAR ObpUnsecureGlobalNamesBuffer[128] = {0}; WCHAR ObpUnsecureGlobalNamesBuffer[128] = {0};
ULONG ObpUnsecureGlobalNamesLength = sizeof(ObpUnsecureGlobalNamesBuffer); ULONG ObpUnsecureGlobalNamesLength = sizeof(ObpUnsecureGlobalNamesBuffer);
ULONG ObpLUIDDeviceMapsDisabled;
ULONG ObpLUIDDeviceMapsEnabled;
/* PRIVATE FUNCTIONS *********************************************************/ /* PRIVATE FUNCTIONS *********************************************************/
INIT_FUNCTION INIT_FUNCTION

View file

@ -911,8 +911,8 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
/* Protect write in SEH */ /* Protect write in SEH */
_SEH2_TRY _SEH2_TRY
{ {
/* Return FALSE -- we don't support this */ /* Query Ob */
*(PULONG)ProcessInformation = FALSE; *(PULONG)ProcessInformation = ObIsLUIDDeviceMapsEnabled();
} }
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{ {