mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 02:23:37 +00:00
wow64: Avoid calling RtlInitUnicodeString on a static constant.
This commit is contained in:
parent
956005d338
commit
1798bcd540
|
@ -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(), ¤t_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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue