Added strlwr.
[wine.git] / include / pe_image.h
blob7ba71f5f4a0a3a2d821148c6a8984dfc6430f5df
1 #ifndef __WINE_PE_IMAGE_H
2 #define __WINE_PE_IMAGE_H
4 #include "windef.h"
5 #include "winbase.h"
6 #include "peexe.h"
7 /* modreference used for attached processes
8 * all section are calculated here, relocations etc.
9 */
10 typedef struct {
11 PIMAGE_IMPORT_DESCRIPTOR pe_import;
12 PIMAGE_EXPORT_DIRECTORY pe_export;
13 PIMAGE_RESOURCE_DIRECTORY pe_resource;
14 int flags;
15 #define PE_MODREF_PROCESS_ATTACHED 0x00000001
16 #define PE_MODREF_NO_DLL_CALLS 0x00000002
17 #define PE_MODREF_RELOCS_DONE 0x00000004
18 #define PE_MODREF_TLS_ALLOCED 0x00000008
19 #define PE_MODREF_INTERNAL 0x00000010
20 int tlsindex;
21 } PE_MODREF;
23 struct _wine_modref;
24 extern int PE_unloadImage(HMODULE hModule);
25 extern FARPROC PE_FindExportedFunction(struct _wine_modref *wm, LPCSTR funcName, BOOL snoop);
26 extern BOOL PE_EnumResourceTypesA(HMODULE,ENUMRESTYPEPROCA,LONG);
27 extern BOOL PE_EnumResourceTypesW(HMODULE,ENUMRESTYPEPROCW,LONG);
28 extern BOOL PE_EnumResourceNamesA(HMODULE,LPCSTR,ENUMRESNAMEPROCA,LONG);
29 extern BOOL PE_EnumResourceNamesW(HMODULE,LPCWSTR,ENUMRESNAMEPROCW,LONG);
30 extern BOOL PE_EnumResourceLanguagesA(HMODULE,LPCSTR,LPCSTR,ENUMRESLANGPROCA,LONG);
31 extern BOOL PE_EnumResourceLanguagesW(HMODULE,LPCWSTR,LPCWSTR,ENUMRESLANGPROCW,LONG);
32 extern HRSRC PE_FindResourceExW(struct _wine_modref*,LPCWSTR,LPCWSTR,WORD);
33 extern DWORD PE_SizeofResource(HMODULE,HRSRC);
34 extern HMODULE PE_LoadLibraryExA(LPCSTR,HFILE,DWORD);
35 extern HGLOBAL PE_LoadResource(struct _wine_modref *wm,HRSRC);
36 extern HMODULE PE_LoadImage( HFILE hFile, OFSTRUCT *ofs, LPCSTR *modName );
37 extern struct _wine_modref *PE_CreateModule( HMODULE hModule, OFSTRUCT *ofs,
38 DWORD flags, BOOL builtin );
39 extern BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, LPCSTR env,
40 LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
41 BOOL inherit, LPSTARTUPINFOA startup,
42 LPPROCESS_INFORMATION info );
44 struct _THDB; /* forward definition */
45 extern void PE_InitTls(struct _THDB*);
46 extern void PE_InitDLL(struct _wine_modref *wm, DWORD type, LPVOID lpReserved);
48 extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA(PIMAGE_RESOURCE_DIRECTORY,LPCSTR,DWORD,BOOL);
49 extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY,LPCWSTR,DWORD,BOOL);
51 typedef DWORD (CALLBACK*DLLENTRYPROC)(HMODULE,DWORD,LPVOID);
53 typedef struct {
54 WORD popl WINE_PACKED; /* 0x8f 0x05 */
55 DWORD addr_popped WINE_PACKED;/* ... */
56 BYTE pushl1 WINE_PACKED; /* 0x68 */
57 DWORD newret WINE_PACKED; /* ... */
58 BYTE pushl2 WINE_PACKED; /* 0x68 */
59 DWORD origfun WINE_PACKED; /* original function */
60 BYTE ret1 WINE_PACKED; /* 0xc3 */
61 WORD addesp WINE_PACKED; /* 0x83 0xc4 */
62 BYTE nrofargs WINE_PACKED; /* nr of arguments to add esp, */
63 BYTE pushl3 WINE_PACKED; /* 0x68 */
64 DWORD oldret WINE_PACKED; /* Filled out from popl above */
65 BYTE ret2 WINE_PACKED; /* 0xc3 */
66 } ELF_STDCALL_STUB;
68 typedef struct {
69 void* dlhandle;
70 ELF_STDCALL_STUB *stubs;
71 } ELF_MODREF;
73 extern struct _wine_modref *ELF_CreateDummyModule(LPCSTR,LPCSTR);
74 extern HMODULE ELF_LoadLibraryExA(LPCSTR,HFILE,DWORD);
75 extern FARPROC ELF_FindExportedFunction(struct _wine_modref *wm, LPCSTR funcName);
77 #endif /* __WINE_PE_IMAGE_H */