Alexandre Julliard : ntdll: Don't fail to load data file when the registry key is missing.

Alexandre Julliard julliard at winehq.org
Thu Nov 28 16:02:20 CST 2019


Module: wine
Branch: master
Commit: 1902ab4d85049d39a439c49a16fc4a5c2bceba3b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1902ab4d85049d39a439c49a16fc4a5c2bceba3b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Nov 28 09:51:35 2019 +0100

ntdll: Don't fail to load data file when the registry key is missing.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48188
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/locale.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c
index 26b2f4203c..16287c83a1 100644
--- a/dlls/ntdll/locale.c
+++ b/dlls/ntdll/locale.c
@@ -160,17 +160,19 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
     RtlInitUnicodeString( &nameW, buffer );
     RtlInitUnicodeString( &valueW, value );
     InitializeObjectAttributes( &attr, &nameW, 0, 0, NULL );
-    if ((status = NtOpenKey( &handle, KEY_READ, &attr ))) return status;
-    info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer;
-    size = sizeof(buffer) - sizeof(WCHAR);
-    status = NtQueryValueKey( handle, &valueW, KeyValuePartialInformation, info, size, &size );
-    NtClose( handle );
-    if (!status)
+    if (!(status = NtOpenKey( &handle, KEY_READ, &attr )))
     {
-        ((WCHAR *)info->Data)[info->DataLength / sizeof(WCHAR)] = 0;
-        name = (WCHAR *)info->Data;
+        info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer;
+        size = sizeof(buffer) - sizeof(WCHAR);
+        if (!(status = NtQueryValueKey( handle, &valueW, KeyValuePartialInformation, info, size, &size )))
+        {
+            ((WCHAR *)info->Data)[info->DataLength / sizeof(WCHAR)] = 0;
+            name = (WCHAR *)info->Data;
+        }
+        NtClose( handle );
     }
-    else  /* otherwise some hardcoded defaults */
+
+    if (!name)  /* otherwise some hardcoded defaults */
     {
         switch (type)
         {




More information about the wine-cvs mailing list