00001
00002
00003
00004
00005
00006
00007 #ifndef __WINE_MODULE_H
00008 #define __WINE_MODULE_H
00009
00010 #include "windef.h"
00011 #include "pe_image.h"
00012
00013
00014 typedef struct {
00015 BYTE type;
00016 BYTE flags;
00017 BYTE segnum;
00018 WORD offs WINE_PACKED;
00019 } ET_ENTRY;
00020
00021 typedef struct {
00022 WORD first;
00023 WORD last;
00024 WORD next;
00025 } ET_BUNDLE;
00026
00027
00028
00029 typedef struct
00030 {
00031 WORD filepos;
00032 WORD size;
00033 WORD flags;
00034 WORD minsize;
00035 HANDLE16 hSeg;
00036
00037 } SEGTABLEENTRY;
00038
00039
00040
00041
00042 #include "pshpack1.h"
00043
00044 typedef struct
00045 {
00046 WORD version;
00047 WORD reserved;
00048 FARPROC16 BootApp;
00049 FARPROC16 LoadAppSeg;
00050 FARPROC16 reserved2;
00051 FARPROC16 MyAlloc;
00052
00053 FARPROC16 EntryAddrProc;
00054 FARPROC16 ExitProc;
00055 WORD reserved3[4];
00056 FARPROC16 SetOwner;
00057 } SELFLOADHEADER;
00058
00059
00060 typedef struct
00061 {
00062 HGLOBAL16 hEnvironment;
00063 SEGPTR cmdLine WINE_PACKED;
00064 SEGPTR showCmd WINE_PACKED;
00065 SEGPTR reserved WINE_PACKED;
00066 } LOADPARAMS16;
00067
00068 typedef struct
00069 {
00070 LPSTR lpEnvAddress;
00071 LPSTR lpCmdLine;
00072 UINT16 *lpCmdShow;
00073 DWORD dwReserved;
00074 } LOADPARAMS;
00075
00076 #include "poppack.h"
00077
00078
00079 typedef enum {
00080 MODULE32_PE = 1,
00081 MODULE32_ELF,
00082 MODULE32_ELFDLL
00083 } MODULE32_TYPE;
00084
00085 typedef struct _wine_modref
00086 {
00087 struct _wine_modref *next;
00088 struct _wine_modref *prev;
00089 MODULE32_TYPE type;
00090 union {
00091 PE_MODREF pe;
00092 ELF_MODREF elf;
00093 } binfmt;
00094
00095 HMODULE module;
00096
00097 int nDeps;
00098 struct _wine_modref **deps;
00099
00100 int flags;
00101 int refCount;
00102
00103 char *filename;
00104 char *modname;
00105 char *short_filename;
00106 char *short_modname;
00107 } WINE_MODREF;
00108
00109 #define WINE_MODREF_INTERNAL 0x00000001
00110 #define WINE_MODREF_NO_DLL_CALLS 0x00000002
00111 #define WINE_MODREF_PROCESS_ATTACHED 0x00000004
00112 #define WINE_MODREF_LOAD_AS_DATAFILE 0x00000010
00113 #define WINE_MODREF_DONT_RESOLVE_REFS 0x00000020
00114 #define WINE_MODREF_MARKER 0x80000000
00115
00116
00117
00118
00119 typedef struct resource_typeinfo_s NE_TYPEINFO;
00120 typedef struct resource_nameinfo_s NE_NAMEINFO;
00121
00122 #define NE_SEG_TABLE(pModule) \
00123 ((SEGTABLEENTRY *)((char *)(pModule) + (pModule)->seg_table))
00124
00125 #define NE_MODULE_TABLE(pModule) \
00126 ((WORD *)((char *)(pModule) + (pModule)->modref_table))
00127
00128 #define NE_MODULE_NAME(pModule) \
00129 (((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
00130
00131 struct modref_list_t;
00132
00133 typedef struct modref_list_t
00134 {
00135 WINE_MODREF* wm;
00136 struct modref_list_t *next;
00137 struct modref_list_t *prev;
00138 } modref_list;
00139
00140
00141
00142 extern FARPROC MODULE_GetProcAddress( HMODULE hModule, LPCSTR function, WIN_BOOL snoop );
00143 extern WINE_MODREF *MODULE32_LookupHMODULE( HMODULE hModule );
00144 extern WINE_MODREF *MODULE_FindModule( LPCSTR path );
00145
00146
00147 extern INT WINAPI AccessResource(HMODULE,HRSRC);
00148
00149 #endif