Skip to content

Commit

Permalink
ntdll: Make all registry lookups case-insensitive.
Browse files Browse the repository at this point in the history
Following recent Windows versions.

Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
julliard committed Jul 7, 2022
1 parent 87bdc64 commit 0cb350f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dlls/ntdll/unix/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ NTSTATUS WINAPI NtCreateKey( HANDLE *key, ACCESS_MASK access, const OBJECT_ATTRI
if (attr->Length != sizeof(OBJECT_ATTRIBUTES)) return STATUS_INVALID_PARAMETER;
if (!attr->ObjectName->Length && !attr->RootDirectory) return STATUS_OBJECT_PATH_SYNTAX_BAD;
if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;
objattr->attributes |= OBJ_OPENIF | OBJ_CASE_INSENSITIVE;

TRACE( "(%p,%s,%s,%x,%x,%p)\n", attr->RootDirectory, debugstr_us(attr->ObjectName),
debugstr_us(class), options, access, key );
Expand Down Expand Up @@ -133,6 +134,7 @@ NTSTATUS WINAPI NtCreateKeyTransacted( HANDLE *key, ACCESS_MASK access, const OB
NTSTATUS WINAPI NtOpenKeyEx( HANDLE *key, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, ULONG options )
{
NTSTATUS ret;
ULONG attributes;

*key = 0;
if (attr->Length != sizeof(*attr)) return STATUS_INVALID_PARAMETER;
Expand All @@ -142,11 +144,13 @@ NTSTATUS WINAPI NtOpenKeyEx( HANDLE *key, ACCESS_MASK access, const OBJECT_ATTRI

if (options & ~REG_OPTION_OPEN_LINK) FIXME( "options %x not implemented\n", options );

attributes = attr->Attributes | OBJ_CASE_INSENSITIVE;

SERVER_START_REQ( open_key )
{
req->parent = wine_server_obj_handle( attr->RootDirectory );
req->access = access;
req->attributes = attr->Attributes;
req->attributes = attributes;
wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length );
ret = wine_server_call( req );
*key = wine_server_ptr_handle( reply->hkey );
Expand Down Expand Up @@ -699,6 +703,7 @@ NTSTATUS WINAPI NtLoadKey( const OBJECT_ATTRIBUTES *attr, OBJECT_ATTRIBUTES *fil
if (ret) return ret;

if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;
objattr->attributes |= OBJ_OPENIF | OBJ_CASE_INSENSITIVE;

SERVER_START_REQ( load_registry )
{
Expand Down

0 comments on commit 0cb350f

Please sign in to comment.