Commit c2c57e8d authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use the SECTION_IMAGE_INFORMATION bitfields where possible.

parent 584427fc
...@@ -1877,12 +1877,12 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, ...@@ -1877,12 +1877,12 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
/* create the MODREF */ /* create the MODREF */
if (!(wm = alloc_module( *module, nt_name, (image_info->u.ImageFlags & IMAGE_FLAGS_WineBuiltin) ))) if (!(wm = alloc_module( *module, nt_name, (image_info->u.s.WineBuiltin) )))
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
if (id) wm->id = *id; if (id) wm->id = *id;
if (image_info->LoaderFlags) wm->ldr.Flags |= LDR_COR_IMAGE; if (image_info->LoaderFlags) wm->ldr.Flags |= LDR_COR_IMAGE;
if (image_info->u.ImageFlags & IMAGE_FLAGS_ComPlusILOnly) wm->ldr.Flags |= LDR_COR_ILONLY; if (image_info->u.s.ComPlusILOnly) wm->ldr.Flags |= LDR_COR_ILONLY;
set_security_cookie( *module, map_size ); set_security_cookie( *module, map_size );
...@@ -1916,7 +1916,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, ...@@ -1916,7 +1916,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
TRACE( "loaded %s %p %p\n", debugstr_us(nt_name), wm, *module ); TRACE( "loaded %s %p %p\n", debugstr_us(nt_name), wm, *module );
if (image_info->u.ImageFlags & IMAGE_FLAGS_WineBuiltin) if (image_info->u.s.WineBuiltin)
{ {
if (TRACE_ON(relay)) RELAY_SetupDLL( *module ); if (TRACE_ON(relay)) RELAY_SetupDLL( *module );
} }
...@@ -1926,7 +1926,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, ...@@ -1926,7 +1926,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
} }
TRACE_(loaddll)( "Loaded %s at %p: %s\n", debugstr_w(wm->ldr.FullDllName.Buffer), *module, TRACE_(loaddll)( "Loaded %s at %p: %s\n", debugstr_w(wm->ldr.FullDllName.Buffer), *module,
(image_info->u.ImageFlags & IMAGE_FLAGS_WineBuiltin) ? "builtin" : "native" ); (image_info->u.s.WineBuiltin) ? "builtin" : "native" );
wm->ldr.LoadCount = 1; wm->ldr.LoadCount = 1;
*pwm = wm; *pwm = wm;
...@@ -1946,7 +1946,7 @@ static NTSTATUS build_builtin_module( const WCHAR *load_path, const UNICODE_STRI ...@@ -1946,7 +1946,7 @@ static NTSTATUS build_builtin_module( const WCHAR *load_path, const UNICODE_STRI
NTSTATUS status; NTSTATUS status;
SECTION_IMAGE_INFORMATION image_info = { 0 }; SECTION_IMAGE_INFORMATION image_info = { 0 };
image_info.u.ImageFlags = IMAGE_FLAGS_WineBuiltin; image_info.u.s.WineBuiltin = 1;
status = build_module( load_path, nt_name, &module, &image_info, NULL, flags, pwm ); status = build_module( load_path, nt_name, &module, &image_info, NULL, flags, pwm );
if (status && module) unix_funcs->unload_builtin_dll( module ); if (status && module) unix_funcs->unload_builtin_dll( module );
return status; return status;
...@@ -2062,7 +2062,7 @@ static BOOL is_valid_binary( HANDLE file, const SECTION_IMAGE_INFORMATION *info ...@@ -2062,7 +2062,7 @@ static BOOL is_valid_binary( HANDLE file, const SECTION_IMAGE_INFORMATION *info
if (info->Machine == IMAGE_FILE_MACHINE_ARM64) return TRUE; if (info->Machine == IMAGE_FILE_MACHINE_ARM64) return TRUE;
#endif #endif
if (!info->ImageContainsCode) return TRUE; if (!info->ImageContainsCode) return TRUE;
if (!(info->u.ImageFlags & IMAGE_FLAGS_ComPlusNativeReady)) if (!(info->u.s.ComPlusNativeReady))
{ {
IMAGE_COR20_HEADER cor_header; IMAGE_COR20_HEADER cor_header;
if (!get_cor_header( file, info, &cor_header )) return FALSE; if (!get_cor_header( file, info, &cor_header )) return FALSE;
...@@ -2673,7 +2673,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC ...@@ -2673,7 +2673,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
break; break;
case STATUS_SUCCESS: /* valid PE file */ case STATUS_SUCCESS: /* valid PE file */
if (image_info.u.ImageFlags & IMAGE_FLAGS_WineBuiltin) if (image_info.u.s.WineBuiltin)
{ {
switch (loadorder) switch (loadorder)
{ {
...@@ -2691,7 +2691,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC ...@@ -2691,7 +2691,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
} }
break; break;
} }
if (!(image_info.u.ImageFlags & IMAGE_FLAGS_WineFakeDll)) if (!(image_info.u.s.WineFakeDll))
{ {
switch (loadorder) switch (loadorder)
{ {
......
...@@ -1225,7 +1225,7 @@ static NTSTATUS open_dll_file( const char *name, OBJECT_ATTRIBUTES *attr, HANDLE ...@@ -1225,7 +1225,7 @@ static NTSTATUS open_dll_file( const char *name, OBJECT_ATTRIBUTES *attr, HANDLE
NtQuerySection( *mapping, SectionImageInformation, image_info, sizeof(*image_info), NULL ); NtQuerySection( *mapping, SectionImageInformation, image_info, sizeof(*image_info), NULL );
/* ignore non-builtins */ /* ignore non-builtins */
if (!(image_info->u.ImageFlags & IMAGE_FLAGS_WineBuiltin)) if (!(image_info->u.s.WineBuiltin))
{ {
WARN( "%s found in WINEDLLPATH but not a builtin, ignoring\n", debugstr_a(name) ); WARN( "%s found in WINEDLLPATH but not a builtin, ignoring\n", debugstr_a(name) );
status = STATUS_DLL_NOT_FOUND; status = STATUS_DLL_NOT_FOUND;
......
...@@ -2490,7 +2490,12 @@ typedef struct _SECTION_IMAGE_INFORMATION { ...@@ -2490,7 +2490,12 @@ typedef struct _SECTION_IMAGE_INFORMATION {
UCHAR ImageMappedFlat : 1; UCHAR ImageMappedFlat : 1;
UCHAR BaseBelow4gb : 1; UCHAR BaseBelow4gb : 1;
UCHAR ComPlusPrefer32bit : 1; UCHAR ComPlusPrefer32bit : 1;
#ifdef __WINESRC__ /* Wine extensions */
UCHAR WineBuiltin : 1;
UCHAR WineFakeDll : 1;
#else
UCHAR Reserved : 2; UCHAR Reserved : 2;
#endif
} DUMMYSTRUCTNAME; } DUMMYSTRUCTNAME;
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
ULONG LoaderFlags; ULONG LoaderFlags;
......
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