Commit 956005d3 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

krnl386: Avoid calling RtlInitUnicodeString on a static constant.

parent 72b86f96
...@@ -85,27 +85,23 @@ static const char **build_list( const WCHAR *buffer ) ...@@ -85,27 +85,23 @@ static const char **build_list( const WCHAR *buffer )
void RELAY16_InitDebugLists(void) void RELAY16_InitDebugLists(void)
{ {
OBJECT_ATTRIBUTES attr; OBJECT_ATTRIBUTES attr;
UNICODE_STRING name;
char buffer[1024]; char buffer[1024];
HANDLE root, hkey; HANDLE root, hkey;
DWORD count; DWORD count;
WCHAR *str; WCHAR *str;
static const WCHAR configW[] = {'S','o','f','t','w','a','r','e','\\', UNICODE_STRING config = RTL_CONSTANT_STRING( L"Software\\Wine\\Debug" );
'W','i','n','e','\\', UNICODE_STRING relay_include = RTL_CONSTANT_STRING( L"RelayInclude" );
'D','e','b','u','g',0}; UNICODE_STRING relay_exclude = RTL_CONSTANT_STRING( L"RelayExclude" );
static const WCHAR RelayIncludeW[] = {'R','e','l','a','y','I','n','c','l','u','d','e',0}; UNICODE_STRING snoop_include = RTL_CONSTANT_STRING( L"SnoopInclude" );
static const WCHAR RelayExcludeW[] = {'R','e','l','a','y','E','x','c','l','u','d','e',0}; UNICODE_STRING snoop_exclude = RTL_CONSTANT_STRING( L"SnoopExclude" );
static const WCHAR SnoopIncludeW[] = {'S','n','o','o','p','I','n','c','l','u','d','e',0};
static const WCHAR SnoopExcludeW[] = {'S','n','o','o','p','E','x','c','l','u','d','e',0};
RtlOpenCurrentUser( KEY_READ, &root ); RtlOpenCurrentUser( KEY_READ, &root );
attr.Length = sizeof(attr); attr.Length = sizeof(attr);
attr.RootDirectory = root; attr.RootDirectory = root;
attr.ObjectName = &name; attr.ObjectName = &config;
attr.Attributes = 0; attr.Attributes = 0;
attr.SecurityDescriptor = NULL; attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL; attr.SecurityQualityOfService = NULL;
RtlInitUnicodeString( &name, configW );
/* @@ Wine registry key: HKCU\Software\Wine\Debug */ /* @@ Wine registry key: HKCU\Software\Wine\Debug */
if (NtOpenKey( &hkey, KEY_READ, &attr )) hkey = 0; if (NtOpenKey( &hkey, KEY_READ, &attr )) hkey = 0;
...@@ -113,26 +109,22 @@ void RELAY16_InitDebugLists(void) ...@@ -113,26 +109,22 @@ void RELAY16_InitDebugLists(void)
if (!hkey) return; if (!hkey) return;
str = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)buffer)->Data; str = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)buffer)->Data;
RtlInitUnicodeString( &name, RelayIncludeW ); if (!NtQueryValueKey( hkey, &relay_include, KeyValuePartialInformation, buffer, sizeof(buffer), &count ))
if (!NtQueryValueKey( hkey, &name, KeyValuePartialInformation, buffer, sizeof(buffer), &count ))
{ {
debug_relay_includelist = build_list( str ); debug_relay_includelist = build_list( str );
} }
RtlInitUnicodeString( &name, RelayExcludeW ); if (!NtQueryValueKey( hkey, &relay_exclude, KeyValuePartialInformation, buffer, sizeof(buffer), &count ))
if (!NtQueryValueKey( hkey, &name, KeyValuePartialInformation, buffer, sizeof(buffer), &count ))
{ {
debug_relay_excludelist = build_list( str ); debug_relay_excludelist = build_list( str );
} }
RtlInitUnicodeString( &name, SnoopIncludeW ); if (!NtQueryValueKey( hkey, &snoop_include, KeyValuePartialInformation, buffer, sizeof(buffer), &count ))
if (!NtQueryValueKey( hkey, &name, KeyValuePartialInformation, buffer, sizeof(buffer), &count ))
{ {
debug_snoop_includelist = build_list( str ); debug_snoop_includelist = build_list( str );
} }
RtlInitUnicodeString( &name, SnoopExcludeW ); if (!NtQueryValueKey( hkey, &snoop_exclude, KeyValuePartialInformation, buffer, sizeof(buffer), &count ))
if (!NtQueryValueKey( hkey, &name, KeyValuePartialInformation, buffer, sizeof(buffer), &count ))
{ {
debug_snoop_excludelist = build_list( str ); debug_snoop_excludelist = build_list( str );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment