Commit 20abf39d authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

ntdll: Add zero_bits parameter to find_builtin_dll.

parent 6d22775b
......@@ -1530,7 +1530,8 @@ static NTSTATUS open_builtin_so_file( const char *name, OBJECT_ATTRIBUTES *attr,
* find_builtin_dll
*/
static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T *size_ptr,
SECTION_IMAGE_INFORMATION *image_info, WORD machine, BOOL prefer_native )
SECTION_IMAGE_INFORMATION *image_info,
ULONG_PTR zero_bits, WORD machine, BOOL prefer_native )
{
unsigned int i, pos, namepos, namelen, maxlen = 0;
unsigned int len = nt_name->Length / sizeof(WCHAR);
......@@ -1572,7 +1573,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
ptr = prepend( ptr, ptr, namelen );
ptr = prepend( ptr, "/dlls", sizeof("/dlls") - 1 );
ptr = prepend( ptr, build_dir, strlen(build_dir) );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, zero_bits, machine, prefer_native );
if (status != STATUS_DLL_NOT_FOUND) goto done;
strcpy( file + pos + len + 1, ".so" );
status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
......@@ -1586,7 +1587,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
ptr = prepend( ptr, ptr, namelen );
ptr = prepend( ptr, "/programs", sizeof("/programs") - 1 );
ptr = prepend( ptr, build_dir, strlen(build_dir) );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, zero_bits, machine, prefer_native );
if (status != STATUS_DLL_NOT_FOUND) goto done;
strcpy( file + pos + len + 1, ".so" );
status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
......@@ -1599,7 +1600,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
file[pos + len + 1] = 0;
ptr = prepend( ptr, pe_dir, strlen(pe_dir) );
ptr = prepend( ptr, dll_paths[i], strlen(dll_paths[i]) );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, zero_bits, machine, prefer_native );
/* use so dir for unix lib */
ptr = file + pos;
ptr = prepend( ptr, so_dir, strlen(so_dir) );
......@@ -1610,7 +1611,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
if (status != STATUS_DLL_NOT_FOUND) goto done;
file[pos + len + 1] = 0;
ptr = prepend( file + pos, dll_paths[i], strlen(dll_paths[i]) );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, zero_bits, machine, prefer_native );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH)
{
found_image = TRUE;
......@@ -1674,9 +1675,9 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename,
case LO_NATIVE_BUILTIN:
return STATUS_IMAGE_ALREADY_LOADED;
case LO_BUILTIN:
return find_builtin_dll( &nt_name, module, size, &info, machine, FALSE );
return find_builtin_dll( &nt_name, module, size, &info, 0, machine, FALSE );
default:
status = find_builtin_dll( &nt_name, module, size, &info, machine, (loadorder == LO_DEFAULT) );
status = find_builtin_dll( &nt_name, module, size, &info, 0, machine, (loadorder == LO_DEFAULT) );
if (status == STATUS_DLL_NOT_FOUND || status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH)
return STATUS_IMAGE_ALREADY_LOADED;
return status;
......@@ -1839,7 +1840,7 @@ NTSTATUS load_main_exe( const WCHAR *dos_name, const char *unix_name, const WCHA
/* if path is in system dir, we can load the builtin even if the file itself doesn't exist */
if (loadorder != LO_NATIVE && is_builtin_path( &nt_name, &machine ))
{
status = find_builtin_dll( &nt_name, module, &size, &main_image_info, machine, FALSE );
status = find_builtin_dll( &nt_name, module, &size, &main_image_info, 0, machine, FALSE );
if (status != STATUS_DLL_NOT_FOUND) return status;
}
if (!contains_path) return STATUS_DLL_NOT_FOUND;
......@@ -1868,7 +1869,7 @@ NTSTATUS load_start_exe( WCHAR **image, void **module )
wcscpy( *image, get_machine_wow64_dir( current_machine ));
wcscat( *image, startW );
init_unicode_string( &nt_name, *image );
status = find_builtin_dll( &nt_name, module, &size, &main_image_info, current_machine, FALSE );
status = find_builtin_dll( &nt_name, module, &size, &main_image_info, 0, current_machine, FALSE );
if (status)
{
MESSAGE( "wine: failed to load start.exe: %x\n", status );
......@@ -2082,7 +2083,7 @@ static void load_wow64_ntdll( USHORT machine )
wcscpy( path, get_machine_wow64_dir( machine ));
wcscat( path, ntdllW );
init_unicode_string( &nt_name, path );
status = find_builtin_dll( &nt_name, &module, &size, &info, machine, FALSE );
status = find_builtin_dll( &nt_name, &module, &size, &info, 0, machine, FALSE );
switch (status)
{
case STATUS_IMAGE_NOT_AT_BASE:
......
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