https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f37138ce91973d3bc906ea3dab4e89d77a9dae71

commit f37138ce91973d3bc906ea3dab4e89d77a9dae71
Author:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
AuthorDate: Tue Mar 4 21:55:47 2025 +0100
Commit:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
CommitDate: Tue Mar 11 19:15:02 2025 +0100

    [NTOS:OB] Allow ObpCaseInsensitive to be configured via registry (#7751)
    
    This feature can be controlled by the system policy:
    "System objects: Require case insensitivity for non-Windows subsystems"
    
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/jj852277(v=ws.11)
    
    It is also used in conjunction with NTFS to get system-wide filesystem 
case-sensitivity:
    https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/929110
    
    This is controlled with a REG_DWORD value named `ObCaseInsensitive`
    inside the registry key
    `HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel` .
    
    Object case (in)sensitivity check is done in the ObpLookupObjectName() 
helper.
    The `ObpCaseInsensitive` variable is used to retrieve the data,
    hence it needs to be a ULONG.
---
 ntoskrnl/config/cmdata.c       | 7 +++++++
 ntoskrnl/include/internal/ob.h | 1 +
 ntoskrnl/ob/obname.c           | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ntoskrnl/config/cmdata.c b/ntoskrnl/config/cmdata.c
index 47f166f56c2..f53ac05a7cd 100644
--- a/ntoskrnl/config/cmdata.c
+++ b/ntoskrnl/config/cmdata.c
@@ -542,6 +542,13 @@ DATA_SEG("INITDATA") CM_SYSTEM_CONTROL_VECTOR 
CmControlVector[] =
         &ObpUnsecureGlobalNamesLength,
         NULL
     },
+    {
+        L"Session Manager\\Kernel",
+        L"ObCaseInsensitive",
+        &ObpCaseInsensitive,
+        NULL,
+        NULL
+    },
     {
         L"Session Manager\\I/O System",
         L"CountOperations",
diff --git a/ntoskrnl/include/internal/ob.h b/ntoskrnl/include/internal/ob.h
index 9e4497bbff5..9b897392f03 100644
--- a/ntoskrnl/include/internal/ob.h
+++ b/ntoskrnl/include/internal/ob.h
@@ -648,6 +648,7 @@ extern ALIGNEDNAME ObpDosDevicesShortNameRoot;
 extern UNICODE_STRING ObpDosDevicesShortName;
 extern WCHAR ObpUnsecureGlobalNamesBuffer[128];
 extern ULONG ObpUnsecureGlobalNamesLength;
+extern ULONG ObpCaseInsensitive;
 extern ULONG ObpObjectSecurityMode;
 extern ULONG ObpProtectionMode;
 extern ULONG ObpLUIDDeviceMapsDisabled;
diff --git a/ntoskrnl/ob/obname.c b/ntoskrnl/ob/obname.c
index 5c829327c14..de0ac79053e 100644
--- a/ntoskrnl/ob/obname.c
+++ b/ntoskrnl/ob/obname.c
@@ -15,7 +15,7 @@
 #define NDEBUG
 #include <debug.h>
 
-BOOLEAN ObpCaseInsensitive = TRUE;
+ULONG ObpCaseInsensitive = TRUE;
 POBJECT_DIRECTORY ObpRootDirectoryObject;
 POBJECT_DIRECTORY ObpTypeDirectoryObject;
 

Reply via email to