ntdll: Avoid using RtlInitUnicodeString() in the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9ac3f24f74
commit
0357d2ca75
|
@ -1993,7 +1993,8 @@ static NTSTATUS get_mountmgr_fs_info( HANDLE handle, int fd, struct mountmgr_uni
|
|||
else
|
||||
drive->letter = 'a' + letter;
|
||||
|
||||
RtlInitUnicodeString( &string, MOUNTMGR_DEVICE_NAME );
|
||||
string.Buffer = (WCHAR *)MOUNTMGR_DEVICE_NAME;
|
||||
string.Length = sizeof(MOUNTMGR_DEVICE_NAME) - sizeof(WCHAR);
|
||||
InitializeObjectAttributes( &attr, &string, 0, NULL, NULL );
|
||||
status = NtOpenFile( &mountmgr, GENERIC_READ | SYNCHRONIZE, &attr, &io,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SYNCHRONOUS_IO_NONALERT );
|
||||
|
|
|
@ -1729,7 +1729,8 @@ static BOOL reg_query_value( HKEY key, LPCWSTR name, DWORD type, void *data, DWO
|
|||
|
||||
if (count > sizeof(buf) - sizeof(KEY_VALUE_PARTIAL_INFORMATION)) return FALSE;
|
||||
|
||||
RtlInitUnicodeString( &nameW, name );
|
||||
nameW.Buffer = (WCHAR *)name;
|
||||
nameW.Length = wcslen( name ) * sizeof(WCHAR);
|
||||
if (NtQueryValueKey( key, &nameW, KeyValuePartialInformation, buf, sizeof(buf), &count ))
|
||||
return FALSE;
|
||||
|
||||
|
@ -1756,7 +1757,7 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, const char*
|
|||
HANDLE key, subkey, subkey_dyn = 0;
|
||||
ULONG idx, len;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
UNICODE_STRING nameW, nameDynamicW;
|
||||
UNICODE_STRING nameW;
|
||||
WCHAR yearW[16];
|
||||
char buffer[128];
|
||||
KEY_BASIC_INFORMATION *info = (KEY_BASIC_INFORMATION *)buffer;
|
||||
|
@ -1764,9 +1765,8 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, const char*
|
|||
sprintf( buffer, "%u", year );
|
||||
ascii_to_unicode( yearW, buffer, strlen(buffer) + 1 );
|
||||
|
||||
RtlInitUnicodeString( &nameW, Time_ZonesW );
|
||||
RtlInitUnicodeString( &nameDynamicW, Dynamic_DstW );
|
||||
|
||||
nameW.Buffer = (WCHAR *)Time_ZonesW;
|
||||
nameW.Length = sizeof(Time_ZonesW) - sizeof(WCHAR);
|
||||
InitializeObjectAttributes( &attr, &nameW, 0, 0, NULL );
|
||||
if (NtOpenKey( &key, KEY_READ, &attr )) return;
|
||||
|
||||
|
@ -1785,7 +1785,7 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, const char*
|
|||
|
||||
nameW.Buffer = info->Name;
|
||||
nameW.Length = info->NameLength;
|
||||
InitializeObjectAttributes( &attr, &nameW, 0, key, NULL );
|
||||
attr.RootDirectory = key;
|
||||
if (NtOpenKey( &subkey, KEY_READ, &attr )) continue;
|
||||
|
||||
memset( ®_tzi, 0, sizeof(reg_tzi) );
|
||||
|
@ -1801,7 +1801,9 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, const char*
|
|||
goto next;
|
||||
|
||||
/* Check for Dynamic DST entry first */
|
||||
InitializeObjectAttributes( &attr, &nameDynamicW, 0, subkey, NULL );
|
||||
nameW.Buffer = (WCHAR *)Dynamic_DstW;
|
||||
nameW.Length = sizeof(Dynamic_DstW) - sizeof(WCHAR);
|
||||
attr.RootDirectory = subkey;
|
||||
if (!NtOpenKey( &subkey_dyn, KEY_READ, &attr ))
|
||||
{
|
||||
is_dynamic = reg_query_value( subkey_dyn, yearW, REG_BINARY, &tz_data, sizeof(tz_data) );
|
||||
|
|
|
@ -2804,16 +2804,14 @@ void virtual_clear_thread_stack( void *stack_end )
|
|||
*/
|
||||
void virtual_map_user_shared_data(void)
|
||||
{
|
||||
static const WCHAR wine_usdW[] = {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s',
|
||||
static const WCHAR nameW[] = {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s',
|
||||
'\\','_','_','w','i','n','e','_','u','s','e','r','_','s','h','a','r','e','d','_','d','a','t','a',0};
|
||||
OBJECT_ATTRIBUTES attr = {sizeof(attr)};
|
||||
UNICODE_STRING wine_usd_str;
|
||||
UNICODE_STRING name_str = { sizeof(nameW) - sizeof(WCHAR), sizeof(nameW), (WCHAR *)nameW };
|
||||
OBJECT_ATTRIBUTES attr = { sizeof(attr), 0, &name_str };
|
||||
NTSTATUS status;
|
||||
HANDLE section;
|
||||
int res, fd, needs_close;
|
||||
|
||||
RtlInitUnicodeString( &wine_usd_str, wine_usdW );
|
||||
InitializeObjectAttributes( &attr, &wine_usd_str, OBJ_OPENIF, NULL, NULL );
|
||||
if ((status = NtOpenSection( §ion, SECTION_ALL_ACCESS, &attr )))
|
||||
{
|
||||
ERR( "failed to open the USD section: %08x\n", status );
|
||||
|
|
Loading…
Reference in New Issue