1 #ifndef __WINE_PE_IMAGE_H
2 #define __WINE_PE_IMAGE_H
7 /* modreference used for attached processes
8 * all section are calculated here, relocations etc.
11 PIMAGE_IMPORT_DESCRIPTOR pe_import
;
12 PIMAGE_EXPORT_DIRECTORY pe_export
;
13 PIMAGE_RESOURCE_DIRECTORY pe_resource
;
18 extern int PE_unloadImage(HMODULE hModule
);
19 extern FARPROC
PE_FindExportedFunction(struct _wine_modref
*wm
, LPCSTR funcName
, BOOL snoop
);
20 extern BOOL
PE_EnumResourceTypesA(HMODULE
,ENUMRESTYPEPROCA
,LONG
);
21 extern BOOL
PE_EnumResourceTypesW(HMODULE
,ENUMRESTYPEPROCW
,LONG
);
22 extern BOOL
PE_EnumResourceNamesA(HMODULE
,LPCSTR
,ENUMRESNAMEPROCA
,LONG
);
23 extern BOOL
PE_EnumResourceNamesW(HMODULE
,LPCWSTR
,ENUMRESNAMEPROCW
,LONG
);
24 extern BOOL
PE_EnumResourceLanguagesA(HMODULE
,LPCSTR
,LPCSTR
,ENUMRESLANGPROCA
,LONG
);
25 extern BOOL
PE_EnumResourceLanguagesW(HMODULE
,LPCWSTR
,LPCWSTR
,ENUMRESLANGPROCW
,LONG
);
26 extern HRSRC
PE_FindResourceExW(struct _wine_modref
*,LPCWSTR
,LPCWSTR
,WORD
);
27 extern DWORD
PE_SizeofResource(HMODULE
,HRSRC
);
28 extern struct _wine_modref
*PE_LoadLibraryExA(LPCSTR
, DWORD
, DWORD
*);
29 extern void PE_UnloadLibrary(struct _wine_modref
*);
30 extern HGLOBAL
PE_LoadResource(struct _wine_modref
*wm
,HRSRC
);
31 extern HMODULE
PE_LoadImage( HANDLE hFile
, LPCSTR filename
, WORD
*version
);
32 extern struct _wine_modref
*PE_CreateModule( HMODULE hModule
, LPCSTR filename
,
33 DWORD flags
, BOOL builtin
);
34 extern BOOL
PE_CreateProcess( HANDLE hFile
, LPCSTR filename
, LPCSTR cmd_line
, LPCSTR env
,
35 LPSECURITY_ATTRIBUTES psa
, LPSECURITY_ATTRIBUTES tsa
,
36 BOOL inherit
, DWORD flags
, LPSTARTUPINFOA startup
,
37 LPPROCESS_INFORMATION info
);
39 extern void PE_InitTls(void);
40 extern BOOL
PE_InitDLL(struct _wine_modref
*wm
, DWORD type
, LPVOID lpReserved
);
42 extern PIMAGE_RESOURCE_DIRECTORY
GetResDirEntryA(PIMAGE_RESOURCE_DIRECTORY
,LPCSTR
,DWORD
,BOOL
);
43 extern PIMAGE_RESOURCE_DIRECTORY
GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY
,LPCWSTR
,DWORD
,BOOL
);
45 typedef DWORD (CALLBACK
*DLLENTRYPROC
)(HMODULE
,DWORD
,LPVOID
);
48 WORD popl WINE_PACKED
; /* 0x8f 0x05 */
49 DWORD addr_popped WINE_PACKED
;/* ... */
50 BYTE pushl1 WINE_PACKED
; /* 0x68 */
51 DWORD newret WINE_PACKED
; /* ... */
52 BYTE pushl2 WINE_PACKED
; /* 0x68 */
53 DWORD origfun WINE_PACKED
; /* original function */
54 BYTE ret1 WINE_PACKED
; /* 0xc3 */
55 WORD addesp WINE_PACKED
; /* 0x83 0xc4 */
56 BYTE nrofargs WINE_PACKED
; /* nr of arguments to add esp, */
57 BYTE pushl3 WINE_PACKED
; /* 0x68 */
58 DWORD oldret WINE_PACKED
; /* Filled out from popl above */
59 BYTE ret2 WINE_PACKED
; /* 0xc3 */
64 ELF_STDCALL_STUB
*stubs
;
67 extern struct _wine_modref
*ELF_LoadLibraryExA( LPCSTR libname
, DWORD flags
, DWORD
*err
);
68 extern void ELF_UnloadLibrary(struct _wine_modref
*);
69 extern FARPROC
ELF_FindExportedFunction(struct _wine_modref
*wm
, LPCSTR funcName
);
71 #endif /* __WINE_PE_IMAGE_H */