ReactOS  0.4.14-dev-358-gbef841c
pe_module.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "dbghelp_private.h"
#include "image_private.h"
#include "winternl.h"
#include "wine/debug.h"
Include dependency graph for pe_module.c:

Go to the source code of this file.

Classes

struct  pe_module_info
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dbghelp)
 
static voidpe_map_full (struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
 
static void pe_unmap_full (struct image_file_map *fmap)
 
const charpe_map_section (struct image_section_map *ism)
 
BOOL pe_find_section (struct image_file_map *fmap, const char *name, struct image_section_map *ism)
 
void pe_unmap_section (struct image_section_map *ism)
 
DWORD_PTR pe_get_map_rva (const struct image_section_map *ism)
 
unsigned pe_get_map_size (const struct image_section_map *ism)
 
static BOOL pe_is_valid_pointer_table (const IMAGE_NT_HEADERS *nthdr, const void *mapping, DWORD64 sz)
 
static BOOL pe_map_file (HANDLE file, struct image_file_map *fmap, enum module_type mt)
 
static void pe_unmap_file (struct image_file_map *fmap)
 
const charpe_map_directory (struct module *module, int dirno, DWORD *size)
 
static void pe_module_remove (struct process *pcs, struct module_format *modfmt)
 
static BOOL pe_locate_with_coff_symbol_table (struct module *module)
 
static BOOL pe_load_coff_symbol_table (struct module *module)
 
static BOOL pe_load_stabs (const struct process *pcs, struct module *module)
 
static BOOL pe_load_dwarf (struct module *module)
 
static BOOL pe_load_rsym (struct module *module)
 
static BOOL pe_load_dbg_file (const struct process *pcs, struct module *module, const char *dbg_name, DWORD timestamp)
 
static BOOL pe_load_msc_debug_info (const struct process *pcs, struct module *module)
 
static BOOL pe_load_export_debug_info (const struct process *pcs, struct module *module)
 
BOOL pe_load_debug_info (const struct process *pcs, struct module *module)
 
struct modulepe_load_native_module (struct process *pcs, const WCHAR *name, HANDLE hFile, DWORD64 base, DWORD size)
 
BOOL pe_load_nt_header (HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS *nth)
 
struct modulepe_load_builtin_module (struct process *pcs, const WCHAR *name, DWORD64 base, DWORD64 size)
 
PVOID WINAPI ImageDirectoryEntryToDataEx (PVOID base, BOOLEAN image, USHORT dir, PULONG size, PIMAGE_SECTION_HEADER *section)
 
PVOID WINAPI ImageDirectoryEntryToData (PVOID base, BOOLEAN image, USHORT dir, PULONG size)
 

Function Documentation

◆ ImageDirectoryEntryToData()

PVOID WINAPI ImageDirectoryEntryToData ( PVOID  base,
BOOLEAN  image,
USHORT  dir,
PULONG  size 
)

Definition at line 914 of file pe_module.c.

915 {
917 }
PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID base, BOOLEAN image, USHORT dir, PULONG size, PIMAGE_SECTION_HEADER *section)
Definition: pe_module.c:890
smooth NULL
Definition: ftsmooth.c:416
unsigned int dir
Definition: maze.c:112
GLsizeiptr size
Definition: glext.h:5919

Referenced by GetExportsFromFile().

◆ ImageDirectoryEntryToDataEx()

PVOID WINAPI ImageDirectoryEntryToDataEx ( PVOID  base,
BOOLEAN  image,
USHORT  dir,
PULONG  size,
PIMAGE_SECTION_HEADER section 
)

Definition at line 890 of file pe_module.c.

891 {
892  const IMAGE_NT_HEADERS *nt;
893  DWORD addr;
894 
895  *size = 0;
896  if (section) *section = NULL;
897 
898  if (!(nt = RtlImageNtHeader( base ))) return NULL;
899  if (dir >= nt->OptionalHeader.NumberOfRvaAndSizes) return NULL;
901 
903  if (image || addr < nt->OptionalHeader.SizeOfHeaders) return (char *)base + addr;
904 
905  return RtlImageRvaToVa( nt, base, addr, section );
906 }
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]
Definition: ntddk_ex.h:178
#define RtlImageRvaToVa
Definition: compat.h:466
Definition: parser.c:55
IMAGE_NT_HEADERS nt
Definition: module.c:50
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
smooth NULL
Definition: ftsmooth.c:416
unsigned int dir
Definition: maze.c:112
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum const GLvoid * addr
Definition: glext.h:9621
#define RtlImageNtHeader
Definition: compat.h:465

Referenced by ImageDirectoryEntryToData().

◆ pe_find_section()

BOOL pe_find_section ( struct image_file_map fmap,
const char name,
struct image_section_map ism 
)

Definition at line 113 of file pe_module.c.

115 {
116  const char* sectname;
117  unsigned i;
118  char tmp[IMAGE_SIZEOF_SHORT_NAME + 1];
119 
120  for (i = 0; i < fmap->u.pe.ntheader.FileHeader.NumberOfSections; i++)
121  {
122  sectname = (const char*)fmap->u.pe.sect[i].shdr.Name;
123  /* long section names start with a '/' (at least on MinGW32) */
124  if (sectname[0] == '/' && fmap->u.pe.strtable)
125  sectname = fmap->u.pe.strtable + atoi(sectname + 1);
126  else
127  {
128  /* the section name may not be null terminated */
129  sectname = memcpy(tmp, sectname, IMAGE_SIZEOF_SHORT_NAME);
130  tmp[IMAGE_SIZEOF_SHORT_NAME] = '\0';
131  }
132  if (!strcasecmp(sectname, name))
133  {
134  ism->fmap = fmap;
135  ism->sidx = i;
136  return TRUE;
137  }
138  }
139  ism->fmap = NULL;
140  ism->sidx = -1;
141 
142  return FALSE;
143 }
#define TRUE
Definition: types.h:120
#define strcasecmp
Definition: fake.h:9
struct image_file_map * fmap
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
union image_file_map::@370 u
smooth NULL
Definition: ftsmooth.c:416
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IMAGE_SIZEOF_SHORT_NAME
Definition: pedump.c:277
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
Definition: name.c:36
struct image_file_map::@370::pe_file_map pe

Referenced by image_find_section(), pe_load_rsym(), and pe_load_stabs().

◆ pe_get_map_rva()

DWORD_PTR pe_get_map_rva ( const struct image_section_map ism)

Definition at line 165 of file pe_module.c.

166 {
167  if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.pe.ntheader.FileHeader.NumberOfSections)
168  return 0;
169  return ism->fmap->u.pe.sect[ism->sidx].shdr.VirtualAddress;
170 }
struct image_file_map * fmap

Referenced by image_get_map_rva().

◆ pe_get_map_size()

unsigned pe_get_map_size ( const struct image_section_map ism)

Definition at line 177 of file pe_module.c.

178 {
179  if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.pe.ntheader.FileHeader.NumberOfSections)
180  return 0;
181  return ism->fmap->u.pe.sect[ism->sidx].shdr.Misc.VirtualSize;
182 }
struct image_file_map * fmap

Referenced by image_get_map_size().

◆ pe_is_valid_pointer_table()

static BOOL pe_is_valid_pointer_table ( const IMAGE_NT_HEADERS nthdr,
const void mapping,
DWORD64  sz 
)
static

Definition at line 190 of file pe_module.c.

191 {
192  DWORD64 offset;
193 
194  /* is the iSym table inside file size ? (including first DWORD of string table, which is its size) */
197  if (offset + sizeof(DWORD) > sz) return FALSE;
198  /* is string table (following iSym table) inside file size ? */
199  offset += *(DWORD*)((const char*)mapping + offset);
200  return offset <= sz;
201 }
GLintptr offset
Definition: glext.h:5920
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
struct _IMAGE_SYMBOL IMAGE_SYMBOL
DWORD NumberOfSymbols
Definition: ntddk_ex.h:126
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
uint64_t DWORD64
Definition: typedefs.h:65
DWORD PointerToSymbolTable
Definition: ntddk_ex.h:125

Referenced by pe_map_file().

◆ pe_load_builtin_module()

struct module* pe_load_builtin_module ( struct process pcs,
const WCHAR name,
DWORD64  base,
DWORD64  size 
)

Definition at line 852 of file pe_module.c.

854 {
855  struct module* module = NULL;
856 
857  if (base && pcs->dbg_hdr_addr)
858  {
859  IMAGE_NT_HEADERS nth;
860 
861  if (pe_load_nt_header(pcs->handle, base, &nth))
862  {
863  if (!size) size = nth.OptionalHeader.SizeOfImage;
867  }
868  }
869  return module;
870 }
struct module * module_new(struct process *pcs, const WCHAR *name, enum module_type type, BOOL virtual, DWORD64 addr, DWORD64 size, unsigned long stamp, unsigned long checksum) DECLSPEC_HIDDEN
Definition: module.c:163
HMODULE module
Definition: main.cpp:47
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
smooth NULL
Definition: ftsmooth.c:416
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
BOOL pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS *nth)
Definition: pe_module.c:837
GLsizeiptr size
Definition: glext.h:5919
unsigned long dbg_hdr_addr
Definition: name.c:36
HANDLE handle

Referenced by SymLoadModuleExW().

◆ pe_load_coff_symbol_table()

static BOOL pe_load_coff_symbol_table ( struct module module)
static

Definition at line 402 of file pe_module.c.

403 {
404  struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
405  const IMAGE_SYMBOL* isym;
406  int i, numsym, naux;
407  const char* strtable;
408  char tmp[9];
409  const char* name;
410  const char* lastfilename = NULL;
411  struct symt_compiland* compiland = NULL;
412  const IMAGE_SECTION_HEADER* sect;
413  const char* mapping;
414 
415  numsym = fmap->u.pe.ntheader.FileHeader.NumberOfSymbols;
416  if (!fmap->u.pe.ntheader.FileHeader.PointerToSymbolTable || !numsym)
417  return TRUE;
418  if (!(mapping = pe_map_full(fmap, NULL))) return FALSE;
419  isym = (const IMAGE_SYMBOL*)((const char*)mapping + fmap->u.pe.ntheader.FileHeader.PointerToSymbolTable);
420  /* FIXME: no way to get strtable size */
421  strtable = (const char*)&isym[numsym];
423 
424  for (i = 0; i < numsym; i+= naux, isym += naux)
425  {
426  if (isym->StorageClass == IMAGE_SYM_CLASS_FILE)
427  {
428  lastfilename = (const char*)(isym + 1);
429  compiland = NULL;
430  }
431  if (isym->StorageClass == IMAGE_SYM_CLASS_EXTERNAL &&
432  isym->SectionNumber > 0 && isym->SectionNumber <= fmap->u.pe.ntheader.FileHeader.NumberOfSections)
433  {
434  if (isym->N.Name.Short)
435  {
436  name = memcpy(tmp, isym->N.ShortName, 8);
437  tmp[8] = '\0';
438  }
439  else name = strtable + isym->N.Name.Long;
440  if (name[0] == '_') name++;
441 
442  if (!compiland && lastfilename)
443  compiland = symt_new_compiland(module, 0,
444  source_new(module, NULL, lastfilename));
445 
447  symt_new_public(module, compiland, name, FALSE,
448  module->module.BaseOfImage + sect[isym->SectionNumber - 1].VirtualAddress +
449  isym->Value,
450  1);
451  }
452  naux = isym->NumberOfAuxSymbols + 1;
453  }
460  pe_unmap_full(fmap);
461 
462  return TRUE;
463 }
#define TRUE
Definition: types.h:120
DWORD64 BaseOfImage
Definition: compat.h:727
static void * pe_map_full(struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
Definition: pe_module.c:46
struct symt_compiland * symt_new_compiland(struct module *module, unsigned long address, unsigned src_idx) DECLSPEC_HIDDEN
Definition: symbol.c:209
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define IMAGE_FIRST_SECTION(NtHeader)
Definition: ntimage.h:427
union image_file_map::@370 u
struct symt_public * symt_new_public(struct module *module, struct symt_compiland *parent, const char *typename, BOOL is_function, unsigned long address, unsigned size) DECLSPEC_HIDDEN
Definition: symbol.c:226
smooth NULL
Definition: ftsmooth.c:416
static void pe_unmap_full(struct image_file_map *fmap)
Definition: pe_module.c:61
unsigned dbghelp_options
Definition: dbghelp.c:72
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
#define IMAGE_SYM_CLASS_FILE
Definition: compat.h:139
SYM_TYPE SymType
Definition: compat.h:732
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define RtlImageNtHeader
Definition: compat.h:465
unsigned source_new(struct module *module, const char *basedir, const char *source) DECLSPEC_HIDDEN
Definition: source.c:67
Definition: name.c:36
struct image_file_map::@370::pe_file_map pe
#define SYMOPT_NO_PUBLICS
Definition: compat.h:650
const char * strtable
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]
#define IMAGE_SYM_CLASS_EXTERNAL
Definition: compat.h:138
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by pe_load_debug_info().

◆ pe_load_dbg_file()

static BOOL pe_load_dbg_file ( const struct process pcs,
struct module module,
const char dbg_name,
DWORD  timestamp 
)
static

Definition at line 553 of file pe_module.c.

555 {
556  char tmp[MAX_PATH];
557  HANDLE hFile = INVALID_HANDLE_VALUE, hMap = 0;
558  const BYTE* dbg_mapping = NULL;
559  BOOL ret = FALSE;
560 
561  TRACE("Processing DBG file %s\n", debugstr_a(dbg_name));
562 
563  if (path_find_symbol_file(pcs, module, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) &&
566  ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) &&
567  ((dbg_mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL))
568  {
570  const IMAGE_SECTION_HEADER* sectp;
571  const IMAGE_DEBUG_DIRECTORY* dbg;
572 
573  hdr = (const IMAGE_SEPARATE_DEBUG_HEADER*)dbg_mapping;
574  /* section headers come immediately after debug header */
575  sectp = (const IMAGE_SECTION_HEADER*)(hdr + 1);
576  /* and after that and the exported names comes the debug directory */
577  dbg = (const IMAGE_DEBUG_DIRECTORY*)
578  (dbg_mapping + sizeof(*hdr) +
579  hdr->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) +
580  hdr->ExportedNamesSize);
581 
582  ret = pe_load_debug_directory(pcs, module, dbg_mapping, sectp,
583  hdr->NumberOfSections, dbg,
584  hdr->DebugDirectorySize / sizeof(*dbg));
585  }
586  else
587  ERR("Couldn't find .DBG file %s (%s)\n", debugstr_a(dbg_name), debugstr_a(tmp));
588 
589  if (dbg_mapping) UnmapViewOfFile(dbg_mapping);
590  if (hMap) CloseHandle(hMap);
592  return ret;
593 }
BOOL pe_load_debug_directory(const struct process *pcs, struct module *module, const BYTE *mapping, const IMAGE_SECTION_HEADER *sectp, DWORD nsect, const IMAGE_DEBUG_DIRECTORY *dbg, int nDbg) DECLSPEC_HIDDEN
Definition: msc.c:3393
#define CloseHandle
Definition: compat.h:406
char hdr[14]
Definition: iptest.cpp:33
#define MapViewOfFile
Definition: compat.h:410
struct _IMAGE_SECTION_HEADER IMAGE_SECTION_HEADER
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define FILE_SHARE_READ
Definition: compat.h:125
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define FILE_MAP_READ
Definition: compat.h:435
#define OPEN_EXISTING
Definition: compat.h:434
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:409
#define MAX_PATH
Definition: compat.h:26
int ret
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
unsigned char BYTE
Definition: mem.h:68
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
BOOL path_find_symbol_file(const struct process *pcs, const struct module *module, PCSTR full_path, const GUID *guid, DWORD dw1, DWORD dw2, PSTR buffer, BOOL *is_unmatched) DECLSPEC_HIDDEN
Definition: path.c:626
#define ERR(fmt,...)
Definition: debug.h:109
#define PAGE_READONLY
Definition: compat.h:127
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
#define UnmapViewOfFile
Definition: compat.h:411
IMAGEHLP_MODULEW64 module

Referenced by pe_load_msc_debug_info().

◆ pe_load_debug_info()

BOOL pe_load_debug_info ( const struct process pcs,
struct module module 
)

Definition at line 746 of file pe_module.c.

747 {
748  BOOL ret = FALSE;
749 
751  {
752  ret = pe_load_stabs(pcs, module);
753  ret = pe_load_dwarf(module) || ret;
754  #ifndef DBGHELP_STATIC_LIB
756  ret = pe_load_rsym(module) || ret;
757  #endif
758 
759  ret = ret || pe_load_coff_symbol_table(module); /* FIXME */
760  /* if we still have no debug info (we could only get SymExport at this
761  * point), then do the SymExport except if we have an ELF container,
762  * in which case we'll rely on the export's on the ELF side
763  */
764  }
765  /* FIXME shouldn't we check that? if (!module_get_debug(pcs, module)) */
766  if (pe_load_export_debug_info(pcs, module) && !ret)
767  ret = TRUE;
768 
769  return ret;
770 }
#define TRUE
Definition: types.h:120
static BOOL pe_load_dwarf(struct module *module)
Definition: pe_module.c:507
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL pe_load_export_debug_info(const struct process *pcs, struct module *module)
Definition: pe_module.c:661
unsigned dbghelp_options
Definition: dbghelp.c:72
int ret
static BOOL pe_load_rsym(struct module *module)
Definition: pe_module.c:527
static BOOL pe_load_msc_debug_info(const struct process *pcs, struct module *module)
Definition: pe_module.c:600
static BOOL pe_load_coff_symbol_table(struct module *module)
Definition: pe_module.c:402
#define SYMOPT_PUBLICS_ONLY
Definition: compat.h:649
static BOOL pe_load_stabs(const struct process *pcs, struct module *module)
Definition: pe_module.c:471

Referenced by module_get_debug(), and pe_load_native_module().

◆ pe_load_dwarf()

static BOOL pe_load_dwarf ( struct module module)
static

Definition at line 507 of file pe_module.c.

508 {
509  struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
510  BOOL ret;
511 
513  module->module.BaseOfImage - fmap->u.pe.ntheader.OptionalHeader.ImageBase,
514  NULL, /* FIXME: some thunks to deal with ? */
515  fmap);
516  TRACE("%s the DWARF debug info\n", ret ? "successfully loaded" : "failed to load");
517 
518  return ret;
519 }
DWORD64 BaseOfImage
Definition: compat.h:727
union image_file_map::@370 u
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
int ret
BOOL dwarf2_parse(struct module *module, unsigned long load_offset, const struct elf_thunk_area *thunks, struct image_file_map *fmap) DECLSPEC_HIDDEN
Definition: dwarf.c:3522
struct image_file_map::@370::pe_file_map pe
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]

Referenced by pe_load_debug_info().

◆ pe_load_export_debug_info()

static BOOL pe_load_export_debug_info ( const struct process pcs,
struct module module 
)
static

Definition at line 661 of file pe_module.c.

662 {
663  struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
664  unsigned int i;
665  const IMAGE_EXPORT_DIRECTORY* exports;
667  DWORD size;
668  IMAGE_NT_HEADERS* nth;
669  void* mapping;
670 
671  if (dbghelp_options & SYMOPT_NO_PUBLICS) return TRUE;
672 
673  if (!(mapping = pe_map_full(fmap, &nth))) return FALSE;
674 #if 0
675  /* Add start of DLL (better use the (yet unimplemented) Exe SymTag for this) */
676  /* FIXME: module.ModuleName isn't correctly set yet if it's passed in SymLoadModule */
678 #endif
679 
680  /* Add entry point */
681  symt_new_public(module, NULL, "EntryPoint", FALSE,
683 #if 0
684  /* FIXME: we'd better store addresses linked to sections rather than
685  absolute values */
687  /* Add start of sections */
689  ((char*)&nth->OptionalHeader + nth->FileHeader.SizeOfOptionalHeader);
690  for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++)
691  {
693  RtlImageRvaToVa(nth, mapping, section->VirtualAddress, NULL), 1);
694  }
695 #endif
696 
697  /* Add exported functions */
700  {
701  const WORD* ordinals = NULL;
702  const DWORD_PTR* functions = NULL;
703  const DWORD* names = NULL;
704  unsigned int j;
705  char buffer[16];
706 
707  functions = RtlImageRvaToVa(nth, mapping, exports->AddressOfFunctions, NULL);
708  ordinals = RtlImageRvaToVa(nth, mapping, exports->AddressOfNameOrdinals, NULL);
709  names = RtlImageRvaToVa(nth, mapping, exports->AddressOfNames, NULL);
710 
711  if (functions && ordinals && names)
712  {
713  for (i = 0; i < exports->NumberOfNames; i++)
714  {
715  if (!names[i]) continue;
718  FALSE,
719  base + functions[ordinals[i]], 1);
720  }
721 
722  for (i = 0; i < exports->NumberOfFunctions; i++)
723  {
724  if (!functions[i]) continue;
725  /* Check if we already added it with a name */
726  for (j = 0; j < exports->NumberOfNames; j++)
727  if ((ordinals[j] == i) && names[j]) break;
728  if (j < exports->NumberOfNames) continue;
729  snprintf(buffer, sizeof(buffer), "%d", i + exports->Base);
730  symt_new_public(module, NULL, buffer, FALSE, base + (DWORD)functions[i], 1);
731  }
732  }
733  }
734  /* no real debug info, only entry points */
737  pe_unmap_full(fmap);
738 
739  return TRUE;
740 }
#define TRUE
Definition: types.h:120
WCHAR ModuleName[32]
Definition: compat.h:733
DWORD64 BaseOfImage
Definition: compat.h:727
#define RtlImageRvaToVa
Definition: compat.h:466
#define snprintf
Definition: wintirpc.h:48
GLuint buffer
Definition: glext.h:5915
static void * pe_map_full(struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
Definition: pe_module.c:46
Definition: parser.c:55
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
static IMAGE_SECTION_HEADER section
Definition: loader.c:152
DWORD AddressOfNameOrdinals
Definition: compat.h:155
GLuint GLuint * names
Definition: glext.h:11545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
struct symt_public * symt_new_public(struct module *module, struct symt_compiland *parent, const char *typename, BOOL is_function, unsigned long address, unsigned size) DECLSPEC_HIDDEN
Definition: symbol.c:226
smooth NULL
Definition: ftsmooth.c:416
WORD SizeOfOptionalHeader
Definition: ntddk_ex.h:127
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLsizeiptr size
Definition: glext.h:5919
static void pe_unmap_full(struct image_file_map *fmap)
Definition: pe_module.c:61
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned dbghelp_options
Definition: dbghelp.c:72
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
SYM_TYPE SymType
Definition: compat.h:732
#define RtlImageDirectoryEntryToData
Definition: compat.h:468
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define IMAGE_DIRECTORY_ENTRY_EXPORT
Definition: compat.h:140
#define SYMOPT_NO_PUBLICS
Definition: compat.h:650
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]

Referenced by pe_load_debug_info().

◆ pe_load_msc_debug_info()

static BOOL pe_load_msc_debug_info ( const struct process pcs,
struct module module 
)
static

Definition at line 600 of file pe_module.c.

601 {
602  struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
603  BOOL ret = FALSE;
604  const IMAGE_DATA_DIRECTORY* dir;
605  const IMAGE_DEBUG_DIRECTORY*dbg = NULL;
606  int nDbg;
607  void* mapping;
608  IMAGE_NT_HEADERS* nth;
609 
610  if (!(mapping = pe_map_full(fmap, &nth))) return FALSE;
611  /* Read in debug directory */
613  nDbg = dir->Size / sizeof(IMAGE_DEBUG_DIRECTORY);
614  if (!nDbg) goto done;
615 
616  dbg = RtlImageRvaToVa(nth, mapping, dir->VirtualAddress, NULL);
617 
618 #ifdef __REACTOS__
619  if (!dbg)
620  {
621  ERR("Debug directory not found in module %s\n",
623  goto done;
624  }
625 #endif
626 
627  /* Parse debug directory */
629  {
630  /* Debug info is stripped to .DBG file */
631  const IMAGE_DEBUG_MISC* misc = (const IMAGE_DEBUG_MISC*)
632  ((const char*)mapping + dbg->PointerToRawData);
633 
634  if (nDbg != 1 || dbg->Type != IMAGE_DEBUG_TYPE_MISC ||
636  {
637  ERR("-Debug info stripped, but no .DBG file in module %s\n",
639  }
640  else
641  {
642  ret = pe_load_dbg_file(pcs, module, (const char*)misc->Data, nth->FileHeader.TimeDateStamp);
643  }
644  }
645  else
646  {
647  const IMAGE_SECTION_HEADER *sectp = (const IMAGE_SECTION_HEADER*)((const char*)&nth->OptionalHeader + nth->FileHeader.SizeOfOptionalHeader);
648  /* Debug info is embedded into PE module */
649  ret = pe_load_debug_directory(pcs, module, mapping, sectp,
650  nth->FileHeader.NumberOfSections, dbg, nDbg);
651  }
652 done:
653  pe_unmap_full(fmap);
654  return ret;
655 }
BOOL pe_load_debug_directory(const struct process *pcs, struct module *module, const BYTE *mapping, const IMAGE_SECTION_HEADER *sectp, DWORD nsect, const IMAGE_DEBUG_DIRECTORY *dbg, int nDbg) DECLSPEC_HIDDEN
Definition: msc.c:3393
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]
Definition: ntddk_ex.h:178
WCHAR ModuleName[32]
Definition: compat.h:733
struct _IMAGE_DEBUG_DIRECTORY IMAGE_DEBUG_DIRECTORY
#define RtlImageRvaToVa
Definition: compat.h:466
static void * pe_map_full(struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
Definition: pe_module.c:46
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
DWORD DataType
Definition: compat.h:158
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
WORD SizeOfOptionalHeader
Definition: ntddk_ex.h:127
#define IMAGE_DEBUG_MISC_EXENAME
Definition: compat.h:142
unsigned int dir
Definition: maze.c:112
#define IMAGE_FILE_DEBUG_STRIPPED
Definition: pedump.c:165
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
static void pe_unmap_full(struct image_file_map *fmap)
Definition: pe_module.c:61
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
static BOOL pe_load_dbg_file(const struct process *pcs, struct module *module, const char *dbg_name, DWORD timestamp)
Definition: pe_module.c:553
int ret
#define ERR(fmt,...)
Definition: debug.h:109
#define IMAGE_DIRECTORY_ENTRY_DEBUG
Definition: compat.h:141
#define IMAGE_DEBUG_TYPE_MISC
Definition: compat.h:133
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]
BYTE Data[1]
Definition: compat.h:162

Referenced by pe_load_debug_info().

◆ pe_load_native_module()

struct module* pe_load_native_module ( struct process pcs,
const WCHAR name,
HANDLE  hFile,
DWORD64  base,
DWORD  size 
)

Definition at line 776 of file pe_module.c.

778 {
779  struct module* module = NULL;
780  BOOL opened = FALSE;
781  struct module_format* modfmt;
782  WCHAR loaded_name[MAX_PATH];
783 
784  loaded_name[0] = '\0';
785  if (!hFile)
786  {
787  assert(name);
788 
789  if ((hFile = FindExecutableImageExW(name, pcs->search_path, loaded_name, NULL, NULL)) == NULL)
790  return NULL;
791  opened = TRUE;
792  }
793  else if (name) strcpyW(loaded_name, name);
795  FIXME("Trouble ahead (no module name passed in deferred mode)\n");
796  if (!(modfmt = HeapAlloc(GetProcessHeap(), 0, sizeof(struct module_format) + sizeof(struct pe_module_info))))
797  return NULL;
798  modfmt->u.pe_info = (struct pe_module_info*)(modfmt + 1);
799  if (pe_map_file(hFile, &modfmt->u.pe_info->fmap, DMT_PE))
800  {
801  if (!base) base = modfmt->u.pe_info->fmap.u.pe.ntheader.OptionalHeader.ImageBase;
802  if (!size) size = modfmt->u.pe_info->fmap.u.pe.ntheader.OptionalHeader.SizeOfImage;
803 
804  module = module_new(pcs, loaded_name, DMT_PE, FALSE, base, size,
805  modfmt->u.pe_info->fmap.u.pe.ntheader.FileHeader.TimeDateStamp,
806  modfmt->u.pe_info->fmap.u.pe.ntheader.OptionalHeader.CheckSum);
807  if (module)
808  {
809  modfmt->module = module;
810  modfmt->remove = pe_module_remove;
811  modfmt->loc_compute = NULL;
812 
813  module->format_info[DFI_PE] = modfmt;
816  else
818  module->reloc_delta = base - modfmt->u.pe_info->fmap.u.pe.ntheader.OptionalHeader.ImageBase;
819  }
820  else
821  {
822  ERR("could not load the module '%s'\n", debugstr_w(loaded_name));
823  pe_unmap_file(&modfmt->u.pe_info->fmap);
824  }
825  }
826  if (!module) HeapFree(GetProcessHeap(), 0, modfmt);
827 
828  if (opened) CloseHandle(hFile);
829 
830  return module;
831 }
void(* remove)(struct process *pcs, struct module_format *modfmt)
struct module * module_new(struct process *pcs, const WCHAR *name, enum module_type type, BOOL virtual, DWORD64 addr, DWORD64 size, unsigned long stamp, unsigned long checksum) DECLSPEC_HIDDEN
Definition: module.c:163
WCHAR * search_path
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
HMODULE module
Definition: main.cpp:47
union module_format::@363 u
#define assert(x)
Definition: debug.h:53
static void pe_unmap_file(struct image_file_map *fmap)
Definition: pe_module.c:290
#define SYMOPT_DEFERRED_LOADS
Definition: compat.h:646
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
BOOL pe_load_debug_info(const struct process *pcs, struct module *module)
Definition: pe_module.c:746
GLsizeiptr size
Definition: glext.h:5919
DWORD64 reloc_delta
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void(* loc_compute)(struct process *pcs, const struct module_format *modfmt, const struct symt_function *func, struct location *loc)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static BOOL pe_map_file(HANDLE file, struct image_file_map *fmap, enum module_type mt)
Definition: pe_module.c:208
#define FindExecutableImageExW
Definition: compat.h:790
#define MAX_PATH
Definition: compat.h:26
unsigned dbghelp_options
Definition: dbghelp.c:72
static void pe_module_remove(struct process *pcs, struct module_format *modfmt)
Definition: pe_module.c:327
SYM_TYPE SymType
Definition: compat.h:732
_In_ HANDLE hFile
Definition: mswsock.h:90
#define ERR(fmt,...)
Definition: debug.h:109
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
struct module * module
Definition: name.c:36
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]
#define HeapFree(x, y, z)
Definition: compat.h:402
struct pe_module_info * pe_info

Referenced by SymLoadModuleExW().

◆ pe_load_nt_header()

BOOL pe_load_nt_header ( HANDLE  hProc,
DWORD64  base,
IMAGE_NT_HEADERS nth 
)

Definition at line 837 of file pe_module.c.

838 {
840 
841  return ReadProcessMemory(hProc, (char*)(DWORD_PTR)base, &dos, sizeof(dos), NULL) &&
843  ReadProcessMemory(hProc, (char*)(DWORD_PTR)(base + dos.e_lfanew),
844  nth, sizeof(*nth), NULL) &&
846 }
#define ReadProcessMemory(a, b, c, d, e)
Definition: compat.h:423
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89
smooth NULL
Definition: ftsmooth.c:416
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
IMAGE_DOS_HEADER dos
Definition: module.c:49
uint32_t DWORD_PTR
Definition: typedefs.h:63

Referenced by fetch_pe_module_info_cb(), and pe_load_builtin_module().

◆ pe_load_rsym()

static BOOL pe_load_rsym ( struct module module)
static

Definition at line 527 of file pe_module.c.

528 {
529  struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
530  struct image_section_map sect_rsym;
531  BOOL ret = FALSE;
532 
533  if (pe_find_section(fmap, ".rossym", &sect_rsym))
534  {
535  const char* rsym = image_map_section(&sect_rsym);
536  if (rsym != IMAGE_NO_MAP)
537  {
539  rsym, image_get_map_size(&sect_rsym));
540  }
541  image_unmap_section(&sect_rsym);
542  }
543  TRACE("%s the RSYM debug info\n", ret ? "successfully loaded" : "failed to load");
544 
545  return ret;
546 }
DWORD64 BaseOfImage
Definition: compat.h:727
struct image_file_map * fmap
#define IMAGE_NO_MAP
Definition: image_private.h:59
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL rsym_parse(struct module *module, unsigned long load_offset, const void *rsym, int rsymlen) DECLSPEC_HIDDEN
Definition: rsym.c:79
#define TRACE(s)
Definition: solgame.cpp:4
static unsigned image_get_map_size(const struct image_section_map *ism)
int ret
static void image_unmap_section(struct image_section_map *ism)
static const char * image_map_section(struct image_section_map *ism)
BOOL pe_find_section(struct image_file_map *fmap, const char *name, struct image_section_map *ism)
Definition: pe_module.c:113
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]

Referenced by pe_load_debug_info().

◆ pe_load_stabs()

static BOOL pe_load_stabs ( const struct process pcs,
struct module module 
)
static

Definition at line 471 of file pe_module.c.

472 {
473  struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
474  struct image_section_map sect_stabs, sect_stabstr;
475  BOOL ret = FALSE;
476 
477  if (pe_find_section(fmap, ".stab", &sect_stabs) && pe_find_section(fmap, ".stabstr", &sect_stabstr))
478  {
479  const char* stab;
480  const char* stabstr;
481 
482  stab = image_map_section(&sect_stabs);
483  stabstr = image_map_section(&sect_stabstr);
484  if (stab != IMAGE_NO_MAP && stabstr != IMAGE_NO_MAP)
485  {
487  module->module.BaseOfImage - fmap->u.pe.ntheader.OptionalHeader.ImageBase,
488  stab, image_get_map_size(&sect_stabs),
489  stabstr, image_get_map_size(&sect_stabstr),
490  NULL, NULL);
491  }
492  image_unmap_section(&sect_stabs);
493  image_unmap_section(&sect_stabstr);
495  }
496  TRACE("%s the STABS debug info\n", ret ? "successfully loaded" : "failed to load");
497 
498  return ret;
499 }
DWORD64 BaseOfImage
Definition: compat.h:727
struct image_file_map * fmap
#define IMAGE_NO_MAP
Definition: image_private.h:59
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL stabs_parse(struct module *module, unsigned long load_offset, const void *stabs, int stablen, const char *strs, int strtablen, stabs_def_cb callback, void *user) DECLSPEC_HIDDEN
Definition: stabs.c:1275
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL pe_locate_with_coff_symbol_table(struct module *module)
Definition: pe_module.c:341
static unsigned image_get_map_size(const struct image_section_map *ism)
int ret
static void image_unmap_section(struct image_section_map *ism)
static const char * image_map_section(struct image_section_map *ism)
BOOL pe_find_section(struct image_file_map *fmap, const char *name, struct image_section_map *ism)
Definition: pe_module.c:113
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]

Referenced by pe_load_debug_info().

◆ pe_locate_with_coff_symbol_table()

static BOOL pe_locate_with_coff_symbol_table ( struct module module)
static

Definition at line 341 of file pe_module.c.

342 {
343  struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
344  const IMAGE_SYMBOL* isym;
345  int i, numsym, naux;
346  char tmp[9];
347  const char* name;
348  struct hash_table_iter hti;
349  void* ptr;
350  struct symt_data* sym;
351  const char* mapping;
352 
353  numsym = fmap->u.pe.ntheader.FileHeader.NumberOfSymbols;
354  if (!fmap->u.pe.ntheader.FileHeader.PointerToSymbolTable || !numsym)
355  return TRUE;
356  if (!(mapping = pe_map_full(fmap, NULL))) return FALSE;
357  isym = (const IMAGE_SYMBOL*)(mapping + fmap->u.pe.ntheader.FileHeader.PointerToSymbolTable);
358 
359  for (i = 0; i < numsym; i+= naux, isym += naux)
360  {
361  if (isym->StorageClass == IMAGE_SYM_CLASS_EXTERNAL &&
362  isym->SectionNumber > 0 && isym->SectionNumber <= fmap->u.pe.ntheader.FileHeader.NumberOfSections)
363  {
364  if (isym->N.Name.Short)
365  {
366  name = memcpy(tmp, isym->N.ShortName, 8);
367  tmp[8] = '\0';
368  }
369  else name = fmap->u.pe.strtable + isym->N.Name.Long;
370  if (name[0] == '_') name++;
372  while ((ptr = hash_table_iter_up(&hti)))
373  {
374  sym = CONTAINING_RECORD(ptr, struct symt_data, hash_elt);
375  if (sym->symt.tag == SymTagData &&
376  (sym->kind == DataIsGlobal || sym->kind == DataIsFileStatic) &&
377  sym->u.var.kind == loc_absolute &&
378  !strcmp(sym->hash_elt.name, name))
379  {
380  TRACE("Changing absolute address for %d.%s: %lx -> %s\n",
381  isym->SectionNumber, name, sym->u.var.offset,
383  fmap->u.pe.sect[isym->SectionNumber - 1].shdr.VirtualAddress +
384  isym->Value));
385  sym->u.var.offset = module->module.BaseOfImage +
386  fmap->u.pe.sect[isym->SectionNumber - 1].shdr.VirtualAddress + isym->Value;
387  break;
388  }
389  }
390  }
391  naux = isym->NumberOfAuxSymbols + 1;
392  }
393  pe_unmap_full(fmap);
394  return TRUE;
395 }
#define TRUE
Definition: types.h:120
DWORD64 BaseOfImage
Definition: compat.h:727
struct hash_table ht_symbols
static void * pe_map_full(struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
Definition: pe_module.c:46
enum DataKind kind
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
union image_file_map::@370 u
union symt_data::@361 u
static PVOID ptr
Definition: dispmode.c:27
void hash_table_iter_init(const struct hash_table *ht, struct hash_table_iter *hti, const char *name) DECLSPEC_HIDDEN
Definition: storage.c:406
smooth NULL
Definition: ftsmooth.c:416
struct symt symt
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
static void pe_unmap_full(struct image_file_map *fmap)
Definition: pe_module.c:61
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
struct location var
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
void * hash_table_iter_up(struct hash_table_iter *hti) DECLSPEC_HIDDEN
Definition: storage.c:423
struct hash_table_elt hash_elt
Definition: name.c:36
struct image_file_map::@370::pe_file_map pe
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]
#define IMAGE_SYM_CLASS_EXTERNAL
Definition: compat.h:138
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by pe_load_stabs().

◆ pe_map_directory()

const char* pe_map_directory ( struct module module,
int  dirno,
DWORD size 
)

Definition at line 313 of file pe_module.c.

314 {
315  IMAGE_NT_HEADERS* nth;
316  void* mapping;
317 
318  if (module->type != DMT_PE || !module->format_info[DFI_PE]) return NULL;
319  if (dirno >= IMAGE_NUMBEROF_DIRECTORY_ENTRIES ||
320  !(mapping = pe_map_full(&module->format_info[DFI_PE]->u.pe_info->fmap, &nth)))
321  return NULL;
322  if (size) *size = nth->OptionalHeader.DataDirectory[dirno].Size;
323  return RtlImageRvaToVa(nth, mapping,
325 }
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]
Definition: ntddk_ex.h:178
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES
Definition: ntddk_ex.h:135
#define RtlImageRvaToVa
Definition: compat.h:466
static void * pe_map_full(struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
Definition: pe_module.c:46
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
enum module_type type
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
struct module_format * format_info[DFI_LAST]

Referenced by x86_64_fetch_minidump_module(), and x86_64_find_runtime_function().

◆ pe_map_file()

static BOOL pe_map_file ( HANDLE  file,
struct image_file_map fmap,
enum module_type  mt 
)
static

Definition at line 208 of file pe_module.c.

209 {
210  void* mapping;
211 
212  fmap->modtype = mt;
213  fmap->u.pe.hMap = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL);
214  if (fmap->u.pe.hMap == 0) return FALSE;
215  fmap->u.pe.full_count = 0;
216  fmap->u.pe.full_map = NULL;
217  if (!(mapping = pe_map_full(fmap, NULL))) goto error;
218 
219  switch (mt)
220  {
221  case DMT_PE:
222  {
223  IMAGE_NT_HEADERS* nthdr;
225  unsigned i;
226 
227  if (!(nthdr = RtlImageNtHeader(mapping))) goto error;
228  memcpy(&fmap->u.pe.ntheader, nthdr, sizeof(fmap->u.pe.ntheader));
229  switch (nthdr->OptionalHeader.Magic)
230  {
231  case 0x10b: fmap->addr_size = 32; break;
232  case 0x20b: fmap->addr_size = 64; break;
233  default: return FALSE;
234  }
236  ((char*)&nthdr->OptionalHeader + nthdr->FileHeader.SizeOfOptionalHeader);
237  fmap->u.pe.sect = HeapAlloc(GetProcessHeap(), 0,
238  nthdr->FileHeader.NumberOfSections * sizeof(fmap->u.pe.sect[0]));
239  if (!fmap->u.pe.sect) goto error;
240  for (i = 0; i < nthdr->FileHeader.NumberOfSections; i++)
241  {
242  memcpy(&fmap->u.pe.sect[i].shdr, section + i, sizeof(IMAGE_SECTION_HEADER));
243  fmap->u.pe.sect[i].mapped = IMAGE_NO_MAP;
244  }
246  {
247  LARGE_INTEGER li;
248 
250  {
251  /* FIXME ugly: should rather map the relevant content instead of copying it */
252  const char* src = (const char*)mapping +
254  nthdr->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL);
255  char* dst;
256  DWORD sz = *(DWORD*)src;
257 
258  if ((dst = HeapAlloc(GetProcessHeap(), 0, sz)))
259  memcpy(dst, src, sz);
260  fmap->u.pe.strtable = dst;
261  }
262  else
263  {
264  WARN("Bad coff table... wipping out\n");
265  /* we have bad information here, wipe it out */
266  fmap->u.pe.ntheader.FileHeader.PointerToSymbolTable = 0;
267  fmap->u.pe.ntheader.FileHeader.NumberOfSymbols = 0;
268  fmap->u.pe.strtable = NULL;
269  }
270  }
271  else fmap->u.pe.strtable = NULL;
272  }
273  break;
274  default: assert(0); goto error;
275  }
276  pe_unmap_full(fmap);
277 
278  return TRUE;
279 error:
280  pe_unmap_full(fmap);
281  CloseHandle(fmap->u.pe.hMap);
282  return FALSE;
283 }
unsigned addr_size
Definition: image_private.h:90
static BOOL pe_is_valid_pointer_table(const IMAGE_NT_HEADERS *nthdr, const void *mapping, DWORD64 sz)
Definition: pe_module.c:190
enum module_type modtype
Definition: image_private.h:89
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
#define error(str)
Definition: mkdosfs.c:1605
#define WARN(fmt,...)
Definition: debug.h:111
#define assert(x)
Definition: debug.h:53
static void * pe_map_full(struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
Definition: pe_module.c:46
Definition: parser.c:55
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
static IMAGE_SECTION_HEADER section
Definition: loader.c:152
#define IMAGE_NO_MAP
Definition: image_private.h:59
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
union image_file_map::@370 u
smooth NULL
Definition: ftsmooth.c:416
WORD SizeOfOptionalHeader
Definition: ntddk_ex.h:127
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD NumberOfSymbols
Definition: ntddk_ex.h:126
static void pe_unmap_full(struct image_file_map *fmap)
Definition: pe_module.c:61
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:409
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
#define GetFileSizeEx
Definition: compat.h:422
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
DWORD PointerToSymbolTable
Definition: ntddk_ex.h:125
#define PAGE_READONLY
Definition: compat.h:127
#define RtlImageNtHeader
Definition: compat.h:465
struct image_file_map::@370::pe_file_map pe
LONGLONG QuadPart
Definition: typedefs.h:112
Definition: fci.c:126

Referenced by pe_load_native_module().

◆ pe_map_full()

static void* pe_map_full ( struct image_file_map fmap,
IMAGE_NT_HEADERS **  nth 
)
static

Definition at line 46 of file pe_module.c.

47 {
48  if (!fmap->u.pe.full_map)
49  {
50  fmap->u.pe.full_map = MapViewOfFile(fmap->u.pe.hMap, FILE_MAP_READ, 0, 0, 0);
51  }
52  if (fmap->u.pe.full_map)
53  {
54  if (nth) *nth = RtlImageNtHeader(fmap->u.pe.full_map);
55  fmap->u.pe.full_count++;
56  return fmap->u.pe.full_map;
57  }
58  return IMAGE_NO_MAP;
59 }
#define MapViewOfFile
Definition: compat.h:410
#define IMAGE_NO_MAP
Definition: image_private.h:59
union image_file_map::@370 u
#define FILE_MAP_READ
Definition: compat.h:435
#define RtlImageNtHeader
Definition: compat.h:465
struct image_file_map::@370::pe_file_map pe

Referenced by pe_load_coff_symbol_table(), pe_load_export_debug_info(), pe_load_msc_debug_info(), pe_locate_with_coff_symbol_table(), pe_map_directory(), pe_map_file(), and pe_map_section().

◆ pe_map_section()

const char* pe_map_section ( struct image_section_map ism)

Definition at line 75 of file pe_module.c.

76 {
77  void* mapping;
78  struct pe_file_map* fmap = &ism->fmap->u.pe;
79 
80  if (ism->sidx >= 0 && ism->sidx < fmap->ntheader.FileHeader.NumberOfSections &&
81  fmap->sect[ism->sidx].mapped == IMAGE_NO_MAP)
82  {
83  IMAGE_NT_HEADERS* nth;
84 
85  if (fmap->sect[ism->sidx].shdr.Misc.VirtualSize > fmap->sect[ism->sidx].shdr.SizeOfRawData)
86  {
87  FIXME("Section %ld: virtual (0x%x) > raw (0x%x) size - not supported\n",
88  ism->sidx, fmap->sect[ism->sidx].shdr.Misc.VirtualSize,
89  fmap->sect[ism->sidx].shdr.SizeOfRawData);
90  return IMAGE_NO_MAP;
91  }
92  /* FIXME: that's rather drastic, but that will do for now
93  * that's ok if the full file map exists, but we could be less aggressive otherwise and
94  * only map the relevant section
95  */
96  if ((mapping = pe_map_full(ism->fmap, &nth)))
97  {
98  fmap->sect[ism->sidx].mapped = RtlImageRvaToVa(nth, mapping,
99  fmap->sect[ism->sidx].shdr.VirtualAddress,
100  NULL);
101  return fmap->sect[ism->sidx].mapped;
102  }
103  }
104  return IMAGE_NO_MAP;
105 }
#define RtlImageRvaToVa
Definition: compat.h:466
struct image_file_map * fmap
static void * pe_map_full(struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
Definition: pe_module.c:46
#define IMAGE_NO_MAP
Definition: image_private.h:59
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031

Referenced by image_map_section().

◆ pe_module_remove()

static void pe_module_remove ( struct process pcs,
struct module_format modfmt 
)
static

Definition at line 327 of file pe_module.c.

328 {
329  pe_unmap_file(&modfmt->u.pe_info->fmap);
330  HeapFree(GetProcessHeap(), 0, modfmt);
331 }
union module_format::@363 u
static void pe_unmap_file(struct image_file_map *fmap)
Definition: pe_module.c:290
#define GetProcessHeap()
Definition: compat.h:403
#define HeapFree(x, y, z)
Definition: compat.h:402
struct pe_module_info * pe_info

Referenced by pe_load_native_module().

◆ pe_unmap_file()

static void pe_unmap_file ( struct image_file_map fmap)
static

Definition at line 290 of file pe_module.c.

291 {
292  if (fmap->u.pe.hMap != 0)
293  {
294  struct image_section_map ism;
295  ism.fmap = fmap;
296  for (ism.sidx = 0; ism.sidx < fmap->u.pe.ntheader.FileHeader.NumberOfSections; ism.sidx++)
297  {
298  pe_unmap_section(&ism);
299  }
300  while (fmap->u.pe.full_count) pe_unmap_full(fmap);
301  HeapFree(GetProcessHeap(), 0, fmap->u.pe.sect);
302  HeapFree(GetProcessHeap(), 0, (void*)fmap->u.pe.strtable); /* FIXME ugly (see pe_map_file) */
303  CloseHandle(fmap->u.pe.hMap);
304  fmap->u.pe.hMap = NULL;
305  }
306 }
#define CloseHandle
Definition: compat.h:406
struct image_file_map * fmap
void pe_unmap_section(struct image_section_map *ism)
Definition: pe_module.c:150
union image_file_map::@370 u
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
static void pe_unmap_full(struct image_file_map *fmap)
Definition: pe_module.c:61
struct image_file_map::@370::pe_file_map pe
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by pe_load_native_module(), and pe_module_remove().

◆ pe_unmap_full()

static void pe_unmap_full ( struct image_file_map fmap)
static

Definition at line 61 of file pe_module.c.

62 {
63  if (fmap->u.pe.full_count && !--fmap->u.pe.full_count)
64  {
65  UnmapViewOfFile(fmap->u.pe.full_map);
66  fmap->u.pe.full_map = NULL;
67  }
68 }
struct image_file_map * fmap
smooth NULL
Definition: ftsmooth.c:416
#define UnmapViewOfFile
Definition: compat.h:411

Referenced by pe_load_coff_symbol_table(), pe_load_export_debug_info(), pe_load_msc_debug_info(), pe_locate_with_coff_symbol_table(), pe_map_file(), pe_unmap_file(), and pe_unmap_section().

◆ pe_unmap_section()

void pe_unmap_section ( struct image_section_map ism)

Definition at line 150 of file pe_module.c.

151 {
152  if (ism->sidx >= 0 && ism->sidx < ism->fmap->u.pe.ntheader.FileHeader.NumberOfSections &&
153  ism->fmap->u.pe.sect[ism->sidx].mapped != IMAGE_NO_MAP)
154  {
155  pe_unmap_full(ism->fmap);
156  ism->fmap->u.pe.sect[ism->sidx].mapped = IMAGE_NO_MAP;
157  }
158 }
struct image_file_map * fmap
#define IMAGE_NO_MAP
Definition: image_private.h:59
static void pe_unmap_full(struct image_file_map *fmap)
Definition: pe_module.c:61

Referenced by image_unmap_section(), and pe_unmap_file().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dbghelp  )