Commit af01944a authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use STATUS_NOT_SUPPORTED for internal machine mismatch errors.

It corresponds to what NtMapViewOfSectionEx() returns with an explicitly specified machine.
parent 685f1b6b
...@@ -2580,7 +2580,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, HANDL ...@@ -2580,7 +2580,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, HANDL
if (!is_valid_binary( handle, image_info )) if (!is_valid_binary( handle, image_info ))
{ {
TRACE( "%s is for arch %x, continuing search\n", debugstr_us(nt_name), image_info->Machine ); TRACE( "%s is for arch %x, continuing search\n", debugstr_us(nt_name), image_info->Machine );
status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; status = STATUS_NOT_SUPPORTED;
NtClose( *mapping ); NtClose( *mapping );
*mapping = NULL; *mapping = NULL;
} }
...@@ -3004,11 +3004,11 @@ static NTSTATUS find_builtin_without_file( const WCHAR *name, UNICODE_STRING *ne ...@@ -3004,11 +3004,11 @@ static NTSTATUS find_builtin_without_file( const WCHAR *name, UNICODE_STRING *ne
RtlAppendUnicodeToString( new_name, L"\\" ); RtlAppendUnicodeToString( new_name, L"\\" );
RtlAppendUnicodeToString( new_name, name ); RtlAppendUnicodeToString( new_name, name );
status = open_dll_file( new_name, pwm, mapping, image_info, id ); status = open_dll_file( new_name, pwm, mapping, image_info, id );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) found_image = TRUE; if (status == STATUS_NOT_SUPPORTED) found_image = TRUE;
else if (status != STATUS_DLL_NOT_FOUND) goto done; else if (status != STATUS_DLL_NOT_FOUND) goto done;
RtlFreeUnicodeString( new_name ); RtlFreeUnicodeString( new_name );
} }
if (found_image) status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; if (found_image) status = STATUS_NOT_SUPPORTED;
done: done:
RtlFreeUnicodeString( new_name ); RtlFreeUnicodeString( new_name );
...@@ -3062,13 +3062,13 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * ...@@ -3062,13 +3062,13 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING *
if ((status = RtlDosPathNameToNtPathName_U_WithStatus( name, nt_name, NULL, NULL ))) goto done; if ((status = RtlDosPathNameToNtPathName_U_WithStatus( name, nt_name, NULL, NULL ))) goto done;
status = open_dll_file( nt_name, pwm, mapping, image_info, id ); status = open_dll_file( nt_name, pwm, mapping, image_info, id );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) found_image = TRUE; if (status == STATUS_NOT_SUPPORTED) found_image = TRUE;
else if (status != STATUS_DLL_NOT_FOUND) goto done; else if (status != STATUS_DLL_NOT_FOUND) goto done;
RtlFreeUnicodeString( nt_name ); RtlFreeUnicodeString( nt_name );
paths = ptr; paths = ptr;
} }
if (found_image) status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; if (found_image) status = STATUS_NOT_SUPPORTED;
done: done:
RtlFreeHeap( GetProcessHeap(), 0, name ); RtlFreeHeap( GetProcessHeap(), 0, name );
...@@ -3127,7 +3127,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI ...@@ -3127,7 +3127,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI
else if (!(status = RtlDosPathNameToNtPathName_U_WithStatus( libname, nt_name, NULL, NULL ))) else if (!(status = RtlDosPathNameToNtPathName_U_WithStatus( libname, nt_name, NULL, NULL )))
status = open_dll_file( nt_name, pwm, mapping, image_info, id ); status = open_dll_file( nt_name, pwm, mapping, image_info, id );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) status = STATUS_INVALID_IMAGE_FORMAT; if (status == STATUS_NOT_SUPPORTED) status = STATUS_INVALID_IMAGE_FORMAT;
done: done:
RtlFreeHeap( GetProcessHeap(), 0, fullname ); RtlFreeHeap( GetProcessHeap(), 0, fullname );
......
...@@ -1440,7 +1440,7 @@ static NTSTATUS open_builtin_so_file( const char *name, OBJECT_ATTRIBUTES *attr, ...@@ -1440,7 +1440,7 @@ static NTSTATUS open_builtin_so_file( const char *name, OBJECT_ATTRIBUTES *attr,
status = STATUS_PROCEDURE_NOT_FOUND; status = STATUS_PROCEDURE_NOT_FOUND;
} }
} }
else status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; else status = STATUS_NOT_SUPPORTED;
close( fd ); close( fd );
return status; return status;
...@@ -1525,7 +1525,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T ...@@ -1525,7 +1525,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
file[pos + len + 1] = 0; file[pos + len + 1] = 0;
ptr = prepend( file + pos, dll_paths[i], strlen(dll_paths[i]) ); ptr = prepend( file + pos, dll_paths[i], strlen(dll_paths[i]) );
status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, limit, machine, prefer_native ); status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, limit, machine, prefer_native );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) if (status == STATUS_NOT_SUPPORTED)
{ {
found_image = TRUE; found_image = TRUE;
continue; continue;
...@@ -1533,11 +1533,11 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T ...@@ -1533,11 +1533,11 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
if (status != STATUS_DLL_NOT_FOUND) goto done; if (status != STATUS_DLL_NOT_FOUND) goto done;
strcpy( file + pos + len + 1, ".so" ); strcpy( file + pos + len + 1, ".so" );
status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native ); status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) found_image = TRUE; if (status == STATUS_NOT_SUPPORTED) found_image = TRUE;
else if (status != STATUS_DLL_NOT_FOUND) goto done; else if (status != STATUS_DLL_NOT_FOUND) goto done;
} }
if (found_image) status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; if (found_image) status = STATUS_NOT_SUPPORTED;
WARN( "cannot find builtin library for %s\n", debugstr_us(nt_name) ); WARN( "cannot find builtin library for %s\n", debugstr_us(nt_name) );
done: done:
if (status >= 0 && ext) if (status >= 0 && ext)
...@@ -1591,7 +1591,7 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename, ...@@ -1591,7 +1591,7 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename,
return find_builtin_dll( &nt_name, module, size, &info, limit, machine, FALSE ); return find_builtin_dll( &nt_name, module, size, &info, limit, machine, FALSE );
default: default:
status = find_builtin_dll( &nt_name, module, size, &info, limit, machine, (loadorder == LO_DEFAULT) ); status = find_builtin_dll( &nt_name, module, size, &info, limit, machine, (loadorder == LO_DEFAULT) );
if (status == STATUS_DLL_NOT_FOUND || status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) if (status == STATUS_DLL_NOT_FOUND || status == STATUS_NOT_SUPPORTED)
return STATUS_IMAGE_ALREADY_LOADED; return STATUS_IMAGE_ALREADY_LOADED;
return status; return status;
} }
......
...@@ -3050,7 +3050,7 @@ NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size ...@@ -3050,7 +3050,7 @@ NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size
else if (machine && image_info->machine != machine) else if (machine && image_info->machine != machine)
{ {
TRACE( "%s is for arch %04x, continuing search\n", debugstr_w(filename), image_info->machine ); TRACE( "%s is for arch %04x, continuing search\n", debugstr_w(filename), image_info->machine );
status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; status = STATUS_NOT_SUPPORTED;
} }
else if (prefer_native && (image_info->dll_charact & IMAGE_DLLCHARACTERISTICS_PREFER_NATIVE)) else if (prefer_native && (image_info->dll_charact & IMAGE_DLLCHARACTERISTICS_PREFER_NATIVE))
{ {
......
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