Renamed all LPIMAGE_* types to PIMAGE_*.

This commit is contained in:
Uwe Bonnes 1998-10-16 09:30:33 +00:00 committed by Alexandre Julliard
parent bbf2efe38e
commit 73d6c134c2
13 changed files with 126 additions and 126 deletions

View File

@ -159,9 +159,9 @@ struct deferred_debug_info
char * module_name;
char * dbg_info;
int dbg_size;
LPIMAGE_DEBUG_DIRECTORY dbgdir;
PIMAGE_DEBUG_DIRECTORY dbgdir;
struct pe_data * pe;
LPIMAGE_SECTION_HEADER sectp;
PIMAGE_SECTION_HEADER sectp;
int nsect;
short int dbg_index;
char loaded;

View File

@ -510,8 +510,8 @@ struct deferred_debug_info
char * dbg_info;
int dbg_size;
HMODULE32 module;
LPIMAGE_DEBUG_DIRECTORY dbgdir;
LPIMAGE_SECTION_HEADER sectp;
PIMAGE_DEBUG_DIRECTORY dbgdir;
PIMAGE_SECTION_HEADER sectp;
int nsect;
short int dbg_index;
char loaded;
@ -887,11 +887,11 @@ DEBUG_RegisterDebugInfo( HMODULE32 hModule, const char *module_name,
int has_codeview = FALSE;
int rtn = FALSE;
int orig_size;
LPIMAGE_DEBUG_DIRECTORY dbgptr;
PIMAGE_DEBUG_DIRECTORY dbgptr;
struct deferred_debug_info * deefer;
orig_size = size;
dbgptr = (LPIMAGE_DEBUG_DIRECTORY) (hModule + v_addr);
dbgptr = (PIMAGE_DEBUG_DIRECTORY) (hModule + v_addr);
for(; size >= sizeof(*dbgptr); size -= sizeof(*dbgptr), dbgptr++ )
{
switch(dbgptr->Type)
@ -904,7 +904,7 @@ DEBUG_RegisterDebugInfo( HMODULE32 hModule, const char *module_name,
}
size = orig_size;
dbgptr = (LPIMAGE_DEBUG_DIRECTORY) (hModule + v_addr);
dbgptr = (PIMAGE_DEBUG_DIRECTORY) (hModule + v_addr);
for(; size >= sizeof(*dbgptr); size -= sizeof(*dbgptr), dbgptr++ )
{
switch(dbgptr->Type)
@ -2126,14 +2126,14 @@ DEBUG_ProcessDBGFile(struct deferred_debug_info * deefer, char * filename)
char * codeview;
struct CV4_DirHead * codeview_dir;
struct CV4_DirEnt * codeview_dent;
LPIMAGE_DEBUG_DIRECTORY dbghdr;
PIMAGE_DEBUG_DIRECTORY dbghdr;
struct deferred_debug_info deefer2;
int fd = -1;
int i;
int j;
struct codeview_linetab_hdr * linetab;
int nsect;
LPIMAGE_SEPARATE_DEBUG_HEADER pdbg = NULL;
PIMAGE_SEPARATE_DEBUG_HEADER pdbg = NULL;
IMAGE_SECTION_HEADER * sectp;
struct stat statbuf;
int status;
@ -2167,7 +2167,7 @@ DEBUG_ProcessDBGFile(struct deferred_debug_info * deefer, char * filename)
goto leave;
}
pdbg = (LPIMAGE_SEPARATE_DEBUG_HEADER) addr;
pdbg = (PIMAGE_SEPARATE_DEBUG_HEADER) addr;
if( pdbg->TimeDateStamp != deefer->dbgdir->TimeDateStamp )
{
@ -2178,11 +2178,11 @@ DEBUG_ProcessDBGFile(struct deferred_debug_info * deefer, char * filename)
fprintf(stderr, "Processing symbols from %s...\n", filename);
dbghdr = (LPIMAGE_DEBUG_DIRECTORY) ( addr + sizeof(*pdbg)
dbghdr = (PIMAGE_DEBUG_DIRECTORY) ( addr + sizeof(*pdbg)
+ pdbg->NumberOfSections * sizeof(IMAGE_SECTION_HEADER)
+ pdbg->ExportedNamesSize);
sectp = (LPIMAGE_SECTION_HEADER) ((char *) pdbg + sizeof(*pdbg));
sectp = (PIMAGE_SECTION_HEADER) ((char *) pdbg + sizeof(*pdbg));
nsect = pdbg->NumberOfSections;
for( i=0; i < pdbg->DebugDirectorySize / sizeof(*pdbg); i++, dbghdr++ )

View File

@ -32,7 +32,7 @@ typedef struct
WORD e_oeminfo; /* 26: OEM information; e_oemid specific */
WORD e_res2[10]; /* 28: Reserved words */
DWORD e_lfanew; /* 3c: Offset to extended header */
} IMAGE_DOS_HEADER,*LPIMAGE_DOS_HEADER;
} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER;
#define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */
#define IMAGE_OS2_SIGNATURE 0x454E /* NE */
@ -79,7 +79,7 @@ typedef struct
WORD fastload_length; /* 3a Length of fast load area */
WORD reserved2; /* 3c Reserved by Microsoft */
WORD expect_version; /* 3e Expected Windows version number */
} IMAGE_OS2_HEADER,*LPIMAGE_OS2_HEADER;
} IMAGE_OS2_HEADER,*PIMAGE_OS2_HEADER;
/*
* NE Header FORMAT FLAGS

View File

@ -10,10 +10,10 @@
* all section are calculated here, relocations etc.
*/
typedef struct {
LPIMAGE_IMPORT_DESCRIPTOR pe_import;
LPIMAGE_EXPORT_DIRECTORY pe_export;
LPIMAGE_RESOURCE_DIRECTORY pe_resource;
LPIMAGE_BASE_RELOCATION pe_reloc;
PIMAGE_IMPORT_DESCRIPTOR pe_import;
PIMAGE_EXPORT_DIRECTORY pe_export;
PIMAGE_RESOURCE_DIRECTORY pe_resource;
PIMAGE_BASE_RELOCATION pe_reloc;
int flags;
#define PE_MODREF_PROCESS_ATTACHED 0x00000001
#define PE_MODREF_NO_DLL_CALLS 0x00000002
@ -48,7 +48,7 @@ struct _THDB; /* forward definition */
extern void PE_InitTls(struct _THDB*);
extern void PE_InitDLL(struct _wine_modref *wm, DWORD type, LPVOID lpReserved);
extern LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(LPIMAGE_RESOURCE_DIRECTORY,LPCWSTR,DWORD,BOOL32);
extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY,LPCWSTR,DWORD,BOOL32);
typedef DWORD (CALLBACK*DLLENTRYPROC32)(HMODULE32,DWORD,LPVOID);

View File

@ -15,7 +15,7 @@ typedef struct _IMAGE_FILE_HEADER {
DWORD NumberOfSymbols; /* 0c */
WORD SizeOfOptionalHeader; /* 10 */
WORD Characteristics; /* 12 */
} IMAGE_FILE_HEADER,*LPIMAGE_FILE_HEADER;
} IMAGE_FILE_HEADER,*PIMAGE_FILE_HEADER;
#define IMAGE_SIZEOF_FILE_HEADER 20
@ -48,7 +48,7 @@ typedef struct _IMAGE_DATA_DIRECTORY
{
DWORD VirtualAddress;
DWORD Size;
} IMAGE_DATA_DIRECTORY,*LPIMAGE_DATA_DIRECTORY;
} IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY;
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
@ -96,7 +96,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER
DWORD NumberOfRvaAndSizes; /* 5C */
/* 60: */
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
} IMAGE_OPTIONAL_HEADER,*LPIMAGE_OPTIONAL_HEADER;
} IMAGE_OPTIONAL_HEADER,*PIMAGE_OPTIONAL_HEADER;
/* Possible Magic values */
#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
@ -145,7 +145,7 @@ typedef struct _IMAGE_NT_HEADERS {
DWORD Signature; /* 00: PE\0\0 */
IMAGE_FILE_HEADER FileHeader; /* 04: Fileheader */
IMAGE_OPTIONAL_HEADER OptionalHeader; /* 18: Optional Header */
} IMAGE_NT_HEADERS,*LPIMAGE_NT_HEADERS;
} IMAGE_NT_HEADERS,*PIMAGE_NT_HEADERS;
#define PE_HEADER(module) \
@ -177,7 +177,7 @@ typedef struct _IMAGE_SECTION_HEADER {
WORD NumberOfLinenumbers; /* 1E: */
DWORD Characteristics; /* 20: */
/* 24: */
} IMAGE_SECTION_HEADER,*LPIMAGE_SECTION_HEADER;
} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER;
#define IMAGE_SIZEOF_SECTION_HEADER 40
@ -234,7 +234,7 @@ typedef struct _IMAGE_SECTION_HEADER {
typedef struct _IMAGE_IMPORT_BY_NAME {
WORD Hint;
BYTE Name[1];
} IMAGE_IMPORT_BY_NAME,*LPIMAGE_IMPORT_BY_NAME;
} IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME;
/* Import thunk */
typedef struct _IMAGE_THUNK_DATA {
@ -242,16 +242,16 @@ typedef struct _IMAGE_THUNK_DATA {
LPBYTE ForwarderString;
FARPROC32 Function;
DWORD Ordinal;
LPIMAGE_IMPORT_BY_NAME AddressOfData;
PIMAGE_IMPORT_BY_NAME AddressOfData;
} u1;
} IMAGE_THUNK_DATA,*LPIMAGE_THUNK_DATA;
} IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA;
/* Import module directory */
typedef struct _IMAGE_IMPORT_DESCRIPTOR {
union {
DWORD Characteristics; /* 0 for terminating null import descriptor */
LPIMAGE_THUNK_DATA OriginalFirstThunk; /* RVA to original unbound IAT */
PIMAGE_THUNK_DATA OriginalFirstThunk; /* RVA to original unbound IAT */
} u;
DWORD TimeDateStamp; /* 0 if not bound,
* -1 if bound, and real date\time stamp
@ -263,8 +263,8 @@ typedef struct _IMAGE_IMPORT_DESCRIPTOR {
DWORD ForwarderChain; /* -1 if no forwarders */
DWORD Name;
/* RVA to IAT (if bound this IAT has actual addresses) */
LPIMAGE_THUNK_DATA FirstThunk;
} IMAGE_IMPORT_DESCRIPTOR,*LPIMAGE_IMPORT_DESCRIPTOR;
PIMAGE_THUNK_DATA FirstThunk;
} IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR;
#define IMAGE_ORDINAL_FLAG 0x80000000
#define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
@ -285,7 +285,7 @@ typedef struct _IMAGE_EXPORT_DIRECTORY {
LPDWORD *AddressOfNames;
LPWORD *AddressOfNameOrdinals;
/* u_char ModuleName[1]; */
} IMAGE_EXPORT_DIRECTORY,*LPIMAGE_EXPORT_DIRECTORY;
} IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY;
/*
@ -299,7 +299,7 @@ typedef struct _IMAGE_RESOURCE_DIRECTORY {
WORD NumberOfNamedEntries;
WORD NumberOfIdEntries;
/* IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; */
} IMAGE_RESOURCE_DIRECTORY,*LPIMAGE_RESOURCE_DIRECTORY;
} IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
#define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
#define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
@ -320,32 +320,32 @@ typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
DWORD DataIsDirectory:1;
} s;
} u2;
} IMAGE_RESOURCE_DIRECTORY_ENTRY,*LPIMAGE_RESOURCE_DIRECTORY_ENTRY;
} IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY;
typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
WORD Length;
CHAR NameString[ 1 ];
} IMAGE_RESOURCE_DIRECTORY_STRING,*LPIMAGE_RESOURCE_DIRECTORY_STRING;
} IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING;
typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
WORD Length;
WCHAR NameString[ 1 ];
} IMAGE_RESOURCE_DIR_STRING_U,*LPIMAGE_RESOURCE_DIR_STRING_U;
} IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U;
typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
DWORD OffsetToData;
DWORD Size;
DWORD CodePage;
DWORD ResourceHandle;
} IMAGE_RESOURCE_DATA_ENTRY,*LPIMAGE_RESOURCE_DATA_ENTRY;
} IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY;
typedef struct _IMAGE_BASE_RELOCATION
{
DWORD VirtualAddress;
DWORD SizeOfBlock;
WORD TypeOffset[1];
} IMAGE_BASE_RELOCATION,*LPIMAGE_BASE_RELOCATION;
} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
DWORD Characteristics;
@ -362,9 +362,9 @@ typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
DWORD VirtualMemoryThreshold;
DWORD ProcessHeapFlags;
DWORD Reserved[ 4 ];
} IMAGE_LOAD_CONFIG_DIRECTORY,*LPIMAGE_LOAD_CONFIG_DIRECTORY;
} IMAGE_LOAD_CONFIG_DIRECTORY,*PIMAGE_LOAD_CONFIG_DIRECTORY;
typedef VOID (CALLBACK *LPIMAGE_TLS_CALLBACK)(
typedef VOID (CALLBACK *PIMAGE_TLS_CALLBACK)(
LPVOID DllHandle,DWORD Reason,LPVOID Reserved
);
@ -372,10 +372,10 @@ typedef struct _IMAGE_TLS_DIRECTORY {
DWORD StartAddressOfRawData;
DWORD EndAddressOfRawData;
LPDWORD AddressOfIndex;
LPIMAGE_TLS_CALLBACK *AddressOfCallBacks;
PIMAGE_TLS_CALLBACK *AddressOfCallBacks;
DWORD SizeOfZeroFill;
DWORD Characteristics;
} IMAGE_TLS_DIRECTORY,*LPIMAGE_TLS_DIRECTORY;
} IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY;
/*
* The IMAGE_DEBUG_DIRECTORY data directory points to an array of
@ -390,7 +390,7 @@ typedef struct _IMAGE_DEBUG_DIRECTORY {
DWORD SizeOfData;
DWORD AddressOfRawData;
DWORD PointerToRawData;
} IMAGE_DEBUG_DIRECTORY,*LPIMAGE_DEBUG_DIRECTORY;
} IMAGE_DEBUG_DIRECTORY,*PIMAGE_DEBUG_DIRECTORY;
/*
* The type field above can take these (plus a few other
@ -430,7 +430,7 @@ typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
DWORD ExportedNamesSize;
DWORD DebugDirectorySize;
DWORD Reserved[ 3 ];
} IMAGE_SEPARATE_DEBUG_HEADER,*LPIMAGE_SEPARATE_DEBUG_HEADER;
} IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER;
#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944

View File

@ -38,9 +38,9 @@ ELF_LoadLibraryEx32A(LPCSTR libname,PDB32 *process,HANDLE32 hf,DWORD flags) {
WINE_MODREF *wm;
char *modname,*s,*t,*x;
LPVOID *dlhandle;
LPIMAGE_DOS_HEADER dh;
LPIMAGE_NT_HEADERS nth;
LPIMAGE_SECTION_HEADER sh;
PIMAGE_DOS_HEADER dh;
PIMAGE_NT_HEADERS nth;
PIMAGE_SECTION_HEADER sh;
HMODULE32 hmod;
t = HeapAlloc(process->heap,HEAP_ZERO_MEMORY,strlen(libname)+strlen("lib.so")+1);
@ -88,7 +88,7 @@ ELF_LoadLibraryEx32A(LPCSTR libname,PDB32 *process,HANDLE32 hf,DWORD flags) {
wm->longname = HEAP_strdupA(process->heap,0,t);
hmod = (HMODULE32)HeapAlloc(process->heap,HEAP_ZERO_MEMORY,sizeof(IMAGE_DOS_HEADER)+sizeof(IMAGE_NT_HEADERS)+sizeof(IMAGE_SECTION_HEADER)+100);
dh = (LPIMAGE_DOS_HEADER)hmod;
dh = (PIMAGE_DOS_HEADER)hmod;
dh->e_magic = IMAGE_DOS_SIGNATURE;
dh->e_lfanew = sizeof(IMAGE_DOS_HEADER);
nth = PE_HEADER(hmod);
@ -117,7 +117,7 @@ ELF_LoadLibraryEx32A(LPCSTR libname,PDB32 *process,HANDLE32 hf,DWORD flags) {
/* allocate one code section that crosses the whole process range
* (we could find out from internal tables ... hmm )
*/
sh=(LPIMAGE_SECTION_HEADER)(nth+1);
sh=(PIMAGE_SECTION_HEADER)(nth+1);
strcpy(sh->Name,".text");
sh->Misc.VirtualSize = 0x7fffffff;
sh->VirtualAddress = 0x42; /* so snoop can use it ... */

View File

@ -1105,7 +1105,7 @@ FARPROC32 MODULE_GetProcAddress32(
/***********************************************************************
* RtlImageNtHeaders (NTDLL)
*/
LPIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE32 hModule)
PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE32 hModule)
{
/* basically:
* return hModule+(((IMAGE_DOS_HEADER*)hModule)->e_lfanew);
@ -1113,7 +1113,7 @@ LPIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE32 hModule)
*/
WINE_MODREF *wm = MODULE32_LookupHMODULE( PROCESS_Current(), hModule );
if (!wm || (wm->type != MODULE32_PE)) return (LPIMAGE_NT_HEADERS)0;
if (!wm || (wm->type != MODULE32_PE)) return (PIMAGE_NT_HEADERS)0;
return PE_HEADER(wm->module);
}

View File

@ -254,7 +254,7 @@ DWORD fixup_imports (PDB32 *process,WINE_MODREF *wm)
for (i = 0, pe_imp = pem->pe_import; pe_imp->Name; pe_imp++) {
HMODULE32 hImpModule;
IMAGE_IMPORT_BY_NAME *pe_name;
LPIMAGE_THUNK_DATA import_list,thunk_list;
PIMAGE_THUNK_DATA import_list,thunk_list;
char *name = (char *) RVA(pe_imp->Name);
/* don't use MODULE_Load, Win32 creates new task differently */
@ -281,8 +281,8 @@ DWORD fixup_imports (PDB32 *process,WINE_MODREF *wm)
if (pe_imp->u.OriginalFirstThunk != 0) { /* original MS style */
TRACE(win32, "Microsoft style imports used\n");
import_list =(LPIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk);
thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
import_list =(PIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk);
thunk_list = (PIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
while (import_list->u1.Ordinal) {
if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) {
@ -298,7 +298,7 @@ DWORD fixup_imports (PDB32 *process,WINE_MODREF *wm)
thunk_list->u1.Function = (FARPROC32)0xdeadbeef;
}
} else { /* import by name */
pe_name = (LPIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData);
pe_name = (PIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData);
TRACE(win32, "--- %s %s.%d\n", pe_name->Name, name, pe_name->Hint);
thunk_list->u1.Function=MODULE_GetProcAddress32(
process, hImpModule, pe_name->Name, TRUE
@ -314,7 +314,7 @@ DWORD fixup_imports (PDB32 *process,WINE_MODREF *wm)
}
} else { /* Borland style */
TRACE(win32, "Borland style imports used\n");
thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
thunk_list = (PIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
while (thunk_list->u1.Ordinal) {
if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) {
/* not sure about this branch, but it seems to work */
@ -330,7 +330,7 @@ DWORD fixup_imports (PDB32 *process,WINE_MODREF *wm)
thunk_list->u1.Function = (FARPROC32)0xdeadbeef;
}
} else {
pe_name=(LPIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData);
pe_name=(PIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData);
TRACE(win32,"--- %s %s.%d\n",
pe_name->Name,name,pe_name->Hint);
thunk_list->u1.Function=MODULE_GetProcAddress32(
@ -613,16 +613,16 @@ static BOOL32 PE_MapImage( PDB32 *process,WINE_MODREF *wm, OFSTRUCT *ofs, DWORD
#endif
if(strcmp(pe_seg->Name, ".idata") == 0)
pem->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) result;
pem->pe_import = (PIMAGE_IMPORT_DESCRIPTOR) result;
if(strcmp(pe_seg->Name, ".edata") == 0)
pem->pe_export = (LPIMAGE_EXPORT_DIRECTORY) result;
pem->pe_export = (PIMAGE_EXPORT_DIRECTORY) result;
if(strcmp(pe_seg->Name, ".rsrc") == 0)
pem->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) result;
pem->pe_resource = (PIMAGE_RESOURCE_DIRECTORY) result;
if(strcmp(pe_seg->Name, ".reloc") == 0)
pem->pe_reloc = (LPIMAGE_BASE_RELOCATION) result;
pem->pe_reloc = (PIMAGE_BASE_RELOCATION) result;
}
/* There is word that the actual loader does not care about the
@ -633,7 +633,7 @@ static BOOL32 PE_MapImage( PDB32 *process,WINE_MODREF *wm, OFSTRUCT *ofs, DWORD
if(pem->pe_export && (int)pem->pe_export!=RVA(dir.VirtualAddress))
WARN(win32,"wrong export directory??\n");
/* always trust the directory */
pem->pe_export = (LPIMAGE_EXPORT_DIRECTORY) RVA(dir.VirtualAddress);
pem->pe_export = (PIMAGE_EXPORT_DIRECTORY) RVA(dir.VirtualAddress);
}
dir=nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
@ -643,7 +643,7 @@ static BOOL32 PE_MapImage( PDB32 *process,WINE_MODREF *wm, OFSTRUCT *ofs, DWORD
if(pem->pe_import && (int)pem->pe_import!=RVA(dir.VirtualAddress))
WARN(win32,"wrong import directory??\n");
*/
pem->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) RVA(dir.VirtualAddress);
pem->pe_import = (PIMAGE_IMPORT_DESCRIPTOR) RVA(dir.VirtualAddress);
}
dir=nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];
@ -651,7 +651,7 @@ static BOOL32 PE_MapImage( PDB32 *process,WINE_MODREF *wm, OFSTRUCT *ofs, DWORD
{
if(pem->pe_resource && (int)pem->pe_resource!=RVA(dir.VirtualAddress))
WARN(win32,"wrong resource directory??\n");
pem->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) RVA(dir.VirtualAddress);
pem->pe_resource = (PIMAGE_RESOURCE_DIRECTORY) RVA(dir.VirtualAddress);
}
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size)
@ -934,7 +934,7 @@ void PE_InitTls(THDB *thdb)
IMAGE_NT_HEADERS *peh;
DWORD size,datasize;
LPVOID mem;
LPIMAGE_TLS_DIRECTORY pdir;
PIMAGE_TLS_DIRECTORY pdir;
PDB32 *pdb = thdb->process;
int delta;
@ -965,8 +965,8 @@ void PE_InitTls(THDB *thdb)
/* don't use TlsSetValue, we are in the wrong thread */
if (pdir->AddressOfCallBacks) {
LPIMAGE_TLS_CALLBACK *cbs =
(LPIMAGE_TLS_CALLBACK *)
PIMAGE_TLS_CALLBACK *cbs =
(PIMAGE_TLS_CALLBACK *)
AdjustPtr(pdir->AddressOfCallBacks, delta);
if (*cbs) {

View File

@ -46,12 +46,12 @@ HMODULE32toPE_MODREF(HMODULE32 hmod) {
* Helper function - goes down one level of PE resource tree
*
*/
LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(LPIMAGE_RESOURCE_DIRECTORY resdirptr,
PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY resdirptr,
LPCWSTR name,DWORD root,
BOOL32 allowdefault)
{
int entrynum;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY entryTable;
PIMAGE_RESOURCE_DIRECTORY_ENTRY entryTable;
int namelen;
if (HIWORD(name)) {
@ -61,36 +61,36 @@ LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(LPIMAGE_RESOURCE_DIRECTORY resdirptr,
lstrcpynWtoA(buf,name+1,10);
return GetResDirEntryW(resdirptr,(LPCWSTR)atoi(buf),root,allowdefault);
}
entryTable = (LPIMAGE_RESOURCE_DIRECTORY_ENTRY) (
entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) (
(BYTE *) resdirptr +
sizeof(IMAGE_RESOURCE_DIRECTORY));
namelen = lstrlen32W(name);
for (entrynum = 0; entrynum < resdirptr->NumberOfNamedEntries; entrynum++)
{
LPIMAGE_RESOURCE_DIR_STRING_U str =
(LPIMAGE_RESOURCE_DIR_STRING_U) (root +
PIMAGE_RESOURCE_DIR_STRING_U str =
(PIMAGE_RESOURCE_DIR_STRING_U) (root +
entryTable[entrynum].u1.s.NameOffset);
if(namelen != str->Length)
continue;
if(lstrncmpi32W(name,str->NameString,str->Length)==0)
return (LPIMAGE_RESOURCE_DIRECTORY) (
return (PIMAGE_RESOURCE_DIRECTORY) (
root +
entryTable[entrynum].u2.s.OffsetToDirectory);
}
return NULL;
} else {
entryTable = (LPIMAGE_RESOURCE_DIRECTORY_ENTRY) (
entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) (
(BYTE *) resdirptr +
sizeof(IMAGE_RESOURCE_DIRECTORY) +
resdirptr->NumberOfNamedEntries * sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
for (entrynum = 0; entrynum < resdirptr->NumberOfIdEntries; entrynum++)
if ((DWORD)entryTable[entrynum].u1.Name == (DWORD)name)
return (LPIMAGE_RESOURCE_DIRECTORY) (
return (PIMAGE_RESOURCE_DIRECTORY) (
root +
entryTable[entrynum].u2.s.OffsetToDirectory);
/* just use first entry if no default can be found */
if (allowdefault && !name && resdirptr->NumberOfIdEntries)
return (LPIMAGE_RESOURCE_DIRECTORY) (
return (PIMAGE_RESOURCE_DIRECTORY) (
root +
entryTable[0].u2.s.OffsetToDirectory);
return NULL;
@ -103,7 +103,7 @@ LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(LPIMAGE_RESOURCE_DIRECTORY resdirptr,
HANDLE32 PE_FindResourceEx32W(
WINE_MODREF *wm,LPCWSTR name,LPCWSTR type,WORD lang
) {
LPIMAGE_RESOURCE_DIRECTORY resdirptr;
PIMAGE_RESOURCE_DIRECTORY resdirptr;
DWORD root;
HANDLE32 result;
PE_MODREF *pem = &(wm->binfmt.pe);
@ -132,7 +132,7 @@ HANDLE32 PE_LoadResource32( WINE_MODREF *wm, HANDLE32 hRsrc )
{
if (!hRsrc || !wm || wm->type!=MODULE32_PE)
return 0;
return (HANDLE32) (wm->module + ((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
return (HANDLE32) (wm->module + ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
}
@ -144,7 +144,7 @@ DWORD PE_SizeofResource32( HINSTANCE32 hModule, HANDLE32 hRsrc )
/* we don't need hModule */
if (!hRsrc)
return 0;
return ((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->Size;
return ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->Size;
}
/**********************************************************************
@ -154,16 +154,16 @@ BOOL32
PE_EnumResourceTypes32A(HMODULE32 hmod,ENUMRESTYPEPROC32A lpfun,LONG lparam) {
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
PIMAGE_RESOURCE_DIRECTORY resdir;
PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
HANDLE32 heap = GetProcessHeap();
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPSTR name;
@ -188,15 +188,15 @@ BOOL32
PE_EnumResourceTypes32W(HMODULE32 hmod,ENUMRESTYPEPROC32W lpfun,LONG lparam) {
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
PIMAGE_RESOURCE_DIRECTORY resdir;
PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPWSTR type;
@ -221,15 +221,15 @@ PE_EnumResourceNames32A(
) {
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
PIMAGE_RESOURCE_DIRECTORY resdir;
PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
HANDLE32 heap = GetProcessHeap();
LPWSTR typeW;
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
if (HIWORD(type))
typeW = HEAP_strdupAtoW(heap,0,type);
else
@ -239,7 +239,7 @@ PE_EnumResourceNames32A(
HeapFree(heap,0,typeW);
if (!resdir)
return FALSE;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPSTR name;
@ -265,18 +265,18 @@ PE_EnumResourceNames32W(
) {
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
PIMAGE_RESOURCE_DIRECTORY resdir;
PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
resdir = GetResDirEntryW(resdir,type,(DWORD)pem->pe_resource,FALSE);
if (!resdir)
return FALSE;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPWSTR name;
@ -301,8 +301,8 @@ PE_EnumResourceLanguages32A(
) {
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
PIMAGE_RESOURCE_DIRECTORY resdir;
PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
HANDLE32 heap = GetProcessHeap();
LPWSTR nameW,typeW;
@ -310,7 +310,7 @@ PE_EnumResourceLanguages32A(
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
if (HIWORD(name))
nameW = HEAP_strdupAtoW(heap,0,name);
else
@ -329,7 +329,7 @@ PE_EnumResourceLanguages32A(
HeapFree(heap,0,typeW);
if (!resdir)
return FALSE;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
/* languages are just ids... I hopem */
@ -350,21 +350,21 @@ PE_EnumResourceLanguages32W(
) {
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
PIMAGE_RESOURCE_DIRECTORY resdir;
PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
resdir = GetResDirEntryW(resdir,name,(DWORD)pem->pe_resource,FALSE);
if (!resdir)
return FALSE;
resdir = GetResDirEntryW(resdir,type,(DWORD)pem->pe_resource,FALSE);
if (!resdir)
return FALSE;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
ret = lpfun(hmod,name,type,et[i].u1.Id,lparam);

View File

@ -602,14 +602,14 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
if( sig == IMAGE_NT_SIGNATURE)
{
LPBYTE peimage,idata,igdata;
LPIMAGE_DOS_HEADER dheader;
LPIMAGE_NT_HEADERS pe_header;
LPIMAGE_SECTION_HEADER pe_sections;
LPIMAGE_RESOURCE_DIRECTORY rootresdir,iconresdir,icongroupresdir;
LPIMAGE_RESOURCE_DATA_ENTRY idataent,igdataent;
PIMAGE_DOS_HEADER dheader;
PIMAGE_NT_HEADERS pe_header;
PIMAGE_SECTION_HEADER pe_sections;
PIMAGE_RESOURCE_DIRECTORY rootresdir,iconresdir,icongroupresdir;
PIMAGE_RESOURCE_DATA_ENTRY idataent,igdataent;
HANDLE32 fmapping;
int i,j;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY xresent;
PIMAGE_RESOURCE_DIRECTORY_ENTRY xresent;
CURSORICONDIR **cids;
fmapping = CreateFileMapping32A(hFile,NULL,PAGE_READONLY|SEC_COMMIT,0,0,NULL);
@ -625,20 +625,20 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
_lclose32( hFile);
return 0;
}
dheader = (LPIMAGE_DOS_HEADER)peimage;
dheader = (PIMAGE_DOS_HEADER)peimage;
/* it is a pe header, SHELL_GetResourceTable checked that */
pe_header = (LPIMAGE_NT_HEADERS)(peimage+dheader->e_lfanew);
pe_header = (PIMAGE_NT_HEADERS)(peimage+dheader->e_lfanew);
/* probably makes problems with short PE headers... but I haven't seen
* one yet...
*/
pe_sections = (LPIMAGE_SECTION_HEADER)(((char*)pe_header)+sizeof(*pe_header));
pe_sections = (PIMAGE_SECTION_HEADER)(((char*)pe_header)+sizeof(*pe_header));
rootresdir = NULL;
for (i=0;i<pe_header->FileHeader.NumberOfSections;i++) {
if (pe_sections[i].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
continue;
/* FIXME: doesn't work when the resources are not in a seperate section */
if (pe_sections[i].VirtualAddress == pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress) {
rootresdir = (LPIMAGE_RESOURCE_DIRECTORY)((char*)peimage+pe_sections[i].PointerToRawData);
rootresdir = (PIMAGE_RESOURCE_DIRECTORY)((char*)peimage+pe_sections[i].PointerToRawData);
break;
}
}
@ -682,7 +682,7 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
/* caller just wanted the number of entries */
xresent = (LPIMAGE_RESOURCE_DIRECTORY_ENTRY)(icongroupresdir+1);
xresent = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)(icongroupresdir+1);
/* assure we don't get too much ... */
if( n > iconDirCount - nIconIndex ) n = iconDirCount - nIconIndex;
@ -691,13 +691,13 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
for (i=0;i<n;i++,xresent++) {
CURSORICONDIR *cid;
LPIMAGE_RESOURCE_DIRECTORY resdir;
PIMAGE_RESOURCE_DIRECTORY resdir;
/* go down this resource entry, name */
resdir = (LPIMAGE_RESOURCE_DIRECTORY)((DWORD)rootresdir+(xresent->u2.s.OffsetToDirectory));
resdir = (PIMAGE_RESOURCE_DIRECTORY)((DWORD)rootresdir+(xresent->u2.s.OffsetToDirectory));
/* default language (0) */
resdir = GetResDirEntryW(resdir,(LPWSTR)0,(DWORD)rootresdir,TRUE);
igdataent = (LPIMAGE_RESOURCE_DATA_ENTRY)resdir;
igdataent = (PIMAGE_RESOURCE_DATA_ENTRY)resdir;
/* lookup address in mapped image for virtual address */
igdata = NULL;
@ -730,12 +730,12 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
return 0;
}
for (i=0;i<n;i++) {
LPIMAGE_RESOURCE_DIRECTORY xresdir;
PIMAGE_RESOURCE_DIRECTORY xresdir;
xresdir = GetResDirEntryW(iconresdir,(LPWSTR)RetPtr[i],(DWORD)rootresdir,FALSE);
xresdir = GetResDirEntryW(xresdir,(LPWSTR)0,(DWORD)rootresdir,TRUE);
idataent = (LPIMAGE_RESOURCE_DATA_ENTRY)xresdir;
idataent = (PIMAGE_RESOURCE_DATA_ENTRY)xresdir;
idata = NULL;
/* map virtual to address in image */

View File

@ -439,9 +439,9 @@ find_pe_resource(
DWORD imagesize,pehdoffset;
BYTE *image;
IMAGE_DATA_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY resourcedir,xresdir;
LPIMAGE_RESOURCE_DATA_ENTRY xresdata;
LPIMAGE_SECTION_HEADER sections;
PIMAGE_RESOURCE_DIRECTORY resourcedir,xresdir;
PIMAGE_RESOURCE_DATA_ENTRY xresdata;
PIMAGE_SECTION_HEADER sections;
pehdoffset = LZTELL(lzfd);
LZREAD(&pehd);
@ -455,7 +455,7 @@ find_pe_resource(
image = HeapAlloc(GetProcessHeap(),0,imagesize);
nrofsections = pehd.FileHeader.NumberOfSections;
sections = (LPIMAGE_SECTION_HEADER)HeapAlloc(GetProcessHeap(),0,pehd.FileHeader.NumberOfSections*sizeof(IMAGE_SECTION_HEADER));
sections = (PIMAGE_SECTION_HEADER)HeapAlloc(GetProcessHeap(),0,pehd.FileHeader.NumberOfSections*sizeof(IMAGE_SECTION_HEADER));
LZSeek32(lzfd,
pehdoffset+
sizeof(DWORD)+ /* Signature */
@ -480,7 +480,7 @@ find_pe_resource(
return 0;
}
}
resourcedir = (LPIMAGE_RESOURCE_DIRECTORY)(image+resdir.VirtualAddress);
resourcedir = (PIMAGE_RESOURCE_DIRECTORY)(image+resdir.VirtualAddress);
xresdir = GetResDirEntryW(resourcedir,typeid,(DWORD)resourcedir,FALSE);
if (!xresdir) {
TRACE(ver,"...no typeid entry found for %p\n",typeid);
@ -500,7 +500,7 @@ find_pe_resource(
HeapFree(GetProcessHeap(),0,image);
return 0;
}
xresdata = (LPIMAGE_RESOURCE_DATA_ENTRY)xresdir;
xresdata = (PIMAGE_RESOURCE_DATA_ENTRY)xresdir;
*reslen = xresdata->Size;
*resdata= (LPBYTE)xmalloc(*reslen);
memcpy(*resdata,image+xresdata->OffsetToData,*reslen);

View File

@ -105,7 +105,7 @@ void VERSION_ParseVersion( char *arg )
*/
WINDOWS_VERSION VERSION_GetVersion(void)
{
LPIMAGE_NT_HEADERS peheader;
PIMAGE_NT_HEADERS peheader;
if (versionForced) /* user has overridden any sensible checks */
return defaultVersion;

View File

@ -567,7 +567,7 @@ static HGLOBAL32 CURSORICON_Load32( HINSTANCE32 hInstance, LPCWSTR name,
/* Hack to keep LoadCursor/Icon32() from spawning multiple
* copies of the same object.
*/
#define pRsrcEntry ((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)
#define pRsrcEntry ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)
if( !pRsrcEntry->ResourceHandle )
{
LPBYTE bits = (LPBYTE)LockResource32( handle );