Commit 1798bcd5 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

wow64: Avoid calling RtlInitUnicodeString on a static constant.

parent 956005d3
......@@ -59,12 +59,12 @@ static inline ULONG starts_with_path( const WCHAR *name, ULONG name_len, const W
void init_file_redirects(void)
{
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
UNICODE_STRING windows = RTL_CONSTANT_STRING( L"\\??\\C:\\windows" );
UNICODE_STRING system32 = RTL_CONSTANT_STRING( L"\\??\\C:\\windows\\system32" );
IO_STATUS_BLOCK io;
HANDLE handle;
InitializeObjectAttributes( &attr, &nameW, OBJ_CASE_INSENSITIVE, 0, NULL );
RtlInitUnicodeString( &nameW, L"\\??\\C:\\windows" );
InitializeObjectAttributes( &attr, &windows, OBJ_CASE_INSENSITIVE, 0, NULL );
if (!NtOpenFile( &handle, SYNCHRONIZE | FILE_LIST_DIRECTORY, &attr, &io,
FILE_SHARE_READ, FILE_SYNCHRONOUS_IO_NONALERT |
FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE ))
......@@ -72,7 +72,7 @@ void init_file_redirects(void)
get_file_id( handle, &windir_id );
NtClose( handle );
}
RtlInitUnicodeString( &nameW, L"\\??\\C:\\windows\\system32" );
attr.ObjectName = &system32;
if (!NtOpenFile( &handle, SYNCHRONIZE | FILE_LIST_DIRECTORY, &attr, &io,
FILE_SHARE_READ, FILE_SYNCHRONOUS_IO_NONALERT |
FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE ))
......
......@@ -696,7 +696,7 @@ static const WCHAR *get_cpu_dll_name(void)
static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **context )
{
HMODULE module;
UNICODE_STRING str;
UNICODE_STRING str = RTL_CONSTANT_STRING( L"ntdll.dll" );
SYSTEM_BASIC_INFORMATION info;
RtlWow64GetProcessMachines( GetCurrentProcess(), &current_machine, &native_machine );
......@@ -708,7 +708,6 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex
#define GET_PTR(name) p ## name = RtlFindExportedRoutineByName( module, #name )
RtlInitUnicodeString( &str, L"ntdll.dll" );
LdrGetDllHandle( NULL, 0, &str, &module );
GET_PTR( LdrSystemDllInitBlock );
......
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