ntdll: Make the windows directory a global variable.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Alexandre Julliard 2020-05-21 12:40:08 +02:00
parent db88a3ec5a
commit ca13f489e1
5 changed files with 9 additions and 9 deletions

View File

@ -3189,11 +3189,11 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit
if (!ai->arch || !ai->name || !ai->public_key) return STATUS_NO_SUCH_FILE;
if (!(path = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(manifest_dirW) +
wcslen(user_shared_data->NtSystemRoot) * sizeof(WCHAR) )))
wcslen(windows_dir) * sizeof(WCHAR) )))
return STATUS_NO_MEMORY;
wcscpy( path, user_shared_data->NtSystemRoot );
memcpy( path + wcslen(path), manifest_dirW, sizeof(manifest_dirW) );
wcscpy( path, windows_dir );
wcscat( path, manifest_dirW );
if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL ))
{

View File

@ -50,8 +50,6 @@ static const UNICODE_STRING null_str = { 0, 0, NULL };
static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
static const WCHAR windows_dir[] = {'C',':','\\','w','i','n','d','o','w','s',0};
static BOOL first_prefix_start; /* first ever process start in this prefix? */
static inline SIZE_T get_env_length( const WCHAR *env )

View File

@ -69,6 +69,8 @@ typedef void (CALLBACK *LDRENUMPROC)(LDR_DATA_TABLE_ENTRY *, void *, BOOLEAN *)
const struct unix_funcs *unix_funcs = NULL;
/* windows directory */
const WCHAR windows_dir[] = {'C',':','\\','w','i','n','d','o','w','s',0};
/* system directory with trailing backslash */
const WCHAR system_dir[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
's','y','s','t','e','m','3','2','\\',0};
@ -2870,7 +2872,7 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
goto done;
}
needed = (wcslen(user_shared_data->NtSystemRoot) * sizeof(WCHAR) +
needed = (wcslen(windows_dir) * sizeof(WCHAR) +
sizeof(winsxsW) + info->ulAssemblyDirectoryNameLength + nameW.Length + 2*sizeof(WCHAR));
if (!(*fullname = p = RtlAllocateHeap( GetProcessHeap(), 0, needed )))
@ -2878,7 +2880,7 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
status = STATUS_NO_MEMORY;
goto done;
}
wcscpy( p, user_shared_data->NtSystemRoot );
wcscpy( p, windows_dir );
p += wcslen(p);
memcpy( p, winsxsW, sizeof(winsxsW) );
p += ARRAY_SIZE( winsxsW );

View File

@ -144,6 +144,7 @@ extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, const IMAGE_EXPORT_DIRECTORY
FARPROC origfun, DWORD ordinal, const WCHAR *user ) DECLSPEC_HIDDEN;
extern void RELAY_SetupDLL( HMODULE hmod ) DECLSPEC_HIDDEN;
extern void SNOOP_SetupDLL( HMODULE hmod ) DECLSPEC_HIDDEN;
extern const WCHAR windows_dir[] DECLSPEC_HIDDEN;
extern const WCHAR system_dir[] DECLSPEC_HIDDEN;
extern const WCHAR syswow64_dir[] DECLSPEC_HIDDEN;

View File

@ -54,7 +54,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(thread);
struct _KUSER_SHARED_DATA *user_shared_data = NULL;
static size_t user_shared_data_size;
static const WCHAR default_windirW[] = {'C',':','\\','w','i','n','d','o','w','s',0};
void (WINAPI *kernel32_start_process)(LPTHREAD_START_ROUTINE,void*) = NULL;
@ -275,7 +274,7 @@ TEB *thread_init(void)
}
user_shared_data = addr;
user_shared_data_size = size;
memcpy( user_shared_data->NtSystemRoot, default_windirW, sizeof(default_windirW) );
wcscpy( user_shared_data->NtSystemRoot, windows_dir );
/* allocate and initialize the PEB and initial TEB */