Commit 1d368b37 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Move the Wine-specific flags out of the image_flags field.

parent 8f9c0c82
...@@ -732,7 +732,7 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_i ...@@ -732,7 +732,7 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_i
ULONGLONG res_end = pe_info->base + pe_info->map_size; ULONGLONG res_end = pe_info->base + pe_info->map_size;
char preloader_reserve[64], socket_env[64]; char preloader_reserve[64], socket_env[64];
if (pe_info->image_flags & IMAGE_FLAGS_WineFakeDll) res_start = res_end = 0; if (pe_info->wine_fakedll) res_start = res_end = 0;
if (pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) machine = native_machine; if (pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) machine = native_machine;
signal( SIGPIPE, SIG_DFL ); signal( SIGPIPE, SIG_DFL );
...@@ -1131,12 +1131,12 @@ static void fill_builtin_image_info( void *module, pe_image_info_t *info ) ...@@ -1131,12 +1131,12 @@ static void fill_builtin_image_info( void *module, pe_image_info_t *info )
const IMAGE_DOS_HEADER *dos = (const IMAGE_DOS_HEADER *)module; const IMAGE_DOS_HEADER *dos = (const IMAGE_DOS_HEADER *)module;
const IMAGE_NT_HEADERS *nt = (IMAGE_NT_HEADERS *)((const BYTE *)dos + dos->e_lfanew); const IMAGE_NT_HEADERS *nt = (IMAGE_NT_HEADERS *)((const BYTE *)dos + dos->e_lfanew);
memset( info, 0, sizeof(*info) );
info->base = nt->OptionalHeader.ImageBase; info->base = nt->OptionalHeader.ImageBase;
info->entry_point = nt->OptionalHeader.AddressOfEntryPoint; info->entry_point = nt->OptionalHeader.AddressOfEntryPoint;
info->map_size = nt->OptionalHeader.SizeOfImage; info->map_size = nt->OptionalHeader.SizeOfImage;
info->stack_size = nt->OptionalHeader.SizeOfStackReserve; info->stack_size = nt->OptionalHeader.SizeOfStackReserve;
info->stack_commit = nt->OptionalHeader.SizeOfStackCommit; info->stack_commit = nt->OptionalHeader.SizeOfStackCommit;
info->zerobits = 0;
info->subsystem = nt->OptionalHeader.Subsystem; info->subsystem = nt->OptionalHeader.Subsystem;
info->subsystem_minor = nt->OptionalHeader.MinorSubsystemVersion; info->subsystem_minor = nt->OptionalHeader.MinorSubsystemVersion;
info->subsystem_major = nt->OptionalHeader.MajorSubsystemVersion; info->subsystem_major = nt->OptionalHeader.MajorSubsystemVersion;
...@@ -1146,13 +1146,10 @@ static void fill_builtin_image_info( void *module, pe_image_info_t *info ) ...@@ -1146,13 +1146,10 @@ static void fill_builtin_image_info( void *module, pe_image_info_t *info )
info->dll_charact = nt->OptionalHeader.DllCharacteristics; info->dll_charact = nt->OptionalHeader.DllCharacteristics;
info->machine = nt->FileHeader.Machine; info->machine = nt->FileHeader.Machine;
info->contains_code = TRUE; info->contains_code = TRUE;
info->image_flags = IMAGE_FLAGS_WineBuiltin; info->wine_builtin = TRUE;
info->loader_flags = 0;
info->header_size = nt->OptionalHeader.SizeOfHeaders; info->header_size = nt->OptionalHeader.SizeOfHeaders;
info->file_size = nt->OptionalHeader.SizeOfImage; info->file_size = nt->OptionalHeader.SizeOfImage;
info->checksum = nt->OptionalHeader.CheckSum; info->checksum = nt->OptionalHeader.CheckSum;
info->dbg_offset = 0;
info->dbg_size = 0;
} }
...@@ -1573,12 +1570,12 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename, ...@@ -1573,12 +1570,12 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename,
if (loadorder == LO_DISABLED) return STATUS_DLL_NOT_FOUND; if (loadorder == LO_DISABLED) return STATUS_DLL_NOT_FOUND;
if (image_info->image_flags & IMAGE_FLAGS_WineBuiltin) if (image_info->wine_builtin)
{ {
if (loadorder == LO_NATIVE) return STATUS_DLL_NOT_FOUND; if (loadorder == LO_NATIVE) return STATUS_DLL_NOT_FOUND;
loadorder = LO_BUILTIN_NATIVE; /* load builtin, then fallback to the file we found */ loadorder = LO_BUILTIN_NATIVE; /* load builtin, then fallback to the file we found */
} }
else if (image_info->image_flags & IMAGE_FLAGS_WineFakeDll) else if (image_info->wine_fakedll)
{ {
TRACE( "%s is a fake Wine dll\n", debugstr_w(filename) ); TRACE( "%s is a fake Wine dll\n", debugstr_w(filename) );
if (loadorder == LO_NATIVE) return STATUS_DLL_NOT_FOUND; if (loadorder == LO_NATIVE) return STATUS_DLL_NOT_FOUND;
......
...@@ -3042,7 +3042,7 @@ NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size ...@@ -3042,7 +3042,7 @@ NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size
*size = 0; *size = 0;
filename = (WCHAR *)(image_info + 1); filename = (WCHAR *)(image_info + 1);
if (!(image_info->image_flags & IMAGE_FLAGS_WineBuiltin)) /* ignore non-builtins */ if (!image_info->wine_builtin) /* ignore non-builtins */
{ {
WARN( "%s found in WINEDLLPATH but not a builtin, ignoring\n", debugstr_w(filename) ); WARN( "%s found in WINEDLLPATH but not a builtin, ignoring\n", debugstr_w(filename) );
status = STATUS_DLL_NOT_FOUND; status = STATUS_DLL_NOT_FOUND;
......
...@@ -834,7 +834,9 @@ typedef struct ...@@ -834,7 +834,9 @@ typedef struct
unsigned short image_charact; unsigned short image_charact;
unsigned short dll_charact; unsigned short dll_charact;
unsigned short machine; unsigned short machine;
unsigned char contains_code; unsigned char contains_code : 1;
unsigned char wine_builtin : 1;
unsigned char wine_fakedll : 1;
unsigned char image_flags; unsigned char image_flags;
unsigned int loader_flags; unsigned int loader_flags;
unsigned int header_size; unsigned int header_size;
...@@ -849,8 +851,6 @@ typedef struct ...@@ -849,8 +851,6 @@ typedef struct
#define IMAGE_FLAGS_ImageMappedFlat 0x08 #define IMAGE_FLAGS_ImageMappedFlat 0x08
#define IMAGE_FLAGS_BaseBelow4gb 0x10 #define IMAGE_FLAGS_BaseBelow4gb 0x10
#define IMAGE_FLAGS_ComPlusPrefer32bit 0x20 #define IMAGE_FLAGS_ComPlusPrefer32bit 0x20
#define IMAGE_FLAGS_WineBuiltin 0x40
#define IMAGE_FLAGS_WineFakeDll 0x80
struct rawinput_device struct rawinput_device
{ {
...@@ -6393,7 +6393,7 @@ union generic_reply ...@@ -6393,7 +6393,7 @@ union generic_reply
/* ### protocol_version begin ### */ /* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 765 #define SERVER_PROTOCOL_VERSION 766
/* ### protocol_version end ### */ /* ### protocol_version end ### */
......
...@@ -3251,12 +3251,7 @@ typedef struct _SECTION_IMAGE_INFORMATION { ...@@ -3251,12 +3251,7 @@ 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;
......
...@@ -803,10 +803,10 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s ...@@ -803,10 +803,10 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
mapping->image.zerobits = 0; /* FIXME */ mapping->image.zerobits = 0; /* FIXME */
mapping->image.file_size = file_size; mapping->image.file_size = file_size;
mapping->image.loader_flags = clr_va && clr_size; mapping->image.loader_flags = clr_va && clr_size;
if (mz_size == sizeof(mz) && !memcmp( mz.buffer, builtin_signature, sizeof(builtin_signature) )) mapping->image.wine_builtin = (mz_size == sizeof(mz) &&
mapping->image.image_flags |= IMAGE_FLAGS_WineBuiltin; !memcmp( mz.buffer, builtin_signature, sizeof(builtin_signature) ));
else if (mz_size == sizeof(mz) && !memcmp( mz.buffer, fakedll_signature, sizeof(fakedll_signature) )) mapping->image.wine_fakedll = (mz_size == sizeof(mz) &&
mapping->image.image_flags |= IMAGE_FLAGS_WineFakeDll; !memcmp( mz.buffer, fakedll_signature, sizeof(fakedll_signature) ));
/* load the section headers */ /* load the section headers */
......
...@@ -850,7 +850,9 @@ typedef struct ...@@ -850,7 +850,9 @@ typedef struct
unsigned short image_charact; unsigned short image_charact;
unsigned short dll_charact; unsigned short dll_charact;
unsigned short machine; unsigned short machine;
unsigned char contains_code; unsigned char contains_code : 1;
unsigned char wine_builtin : 1;
unsigned char wine_fakedll : 1;
unsigned char image_flags; unsigned char image_flags;
unsigned int loader_flags; unsigned int loader_flags;
unsigned int header_size; unsigned int header_size;
...@@ -865,8 +867,6 @@ typedef struct ...@@ -865,8 +867,6 @@ typedef struct
#define IMAGE_FLAGS_ImageMappedFlat 0x08 #define IMAGE_FLAGS_ImageMappedFlat 0x08
#define IMAGE_FLAGS_BaseBelow4gb 0x10 #define IMAGE_FLAGS_BaseBelow4gb 0x10
#define IMAGE_FLAGS_ComPlusPrefer32bit 0x20 #define IMAGE_FLAGS_ComPlusPrefer32bit 0x20
#define IMAGE_FLAGS_WineBuiltin 0x40
#define IMAGE_FLAGS_WineFakeDll 0x80
struct rawinput_device struct rawinput_device
{ {
......
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