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@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-11-28 09:51:35 +01:00
parent 7bb286ad9d
commit 1902ab4d85
1 changed files with 11 additions and 9 deletions

View File

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