Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

module.h

00001 /*
00002  * Module definitions
00003  *
00004  * Copyright 1995 Alexandre Julliard
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; /* ordinal */
00023     WORD last; /* ordinal */
00024     WORD next; /* bundle */
00025 } ET_BUNDLE;
00026 
00027 
00028   /* In-memory segment table */
00029 typedef struct
00030 {
00031     WORD      filepos;   /* Position in file, in sectors */
00032     WORD      size;      /* Segment size on disk */
00033     WORD      flags;     /* Segment flags */
00034     WORD      minsize;   /* Min. size of segment in memory */
00035     HANDLE16  hSeg;      /* Selector or handle (selector - 1) */
00036                          /* of segment in memory */
00037 } SEGTABLEENTRY;
00038 
00039 
00040   /* Self-loading modules contain this structure in their first segment */
00041 
00042 #include "pshpack1.h"
00043 
00044 typedef struct
00045 {
00046     WORD      version;       /* Must be "A0" (0x3041) */
00047     WORD      reserved;
00048     FARPROC16 BootApp;       /* startup procedure */
00049     FARPROC16 LoadAppSeg;    /* procedure to load a segment */
00050     FARPROC16 reserved2;
00051     FARPROC16 MyAlloc;       /* memory allocation procedure, 
00052                               * wine must write this field */
00053     FARPROC16 EntryAddrProc;
00054     FARPROC16 ExitProc;      /* exit procedure */
00055     WORD      reserved3[4];
00056     FARPROC16 SetOwner;      /* Set Owner procedure, exported by wine */
00057 } SELFLOADHEADER;
00058 
00059   /* Parameters for LoadModule() */
00060 typedef struct
00061 {
00062     HGLOBAL16 hEnvironment;         /* Environment segment */
00063     SEGPTR    cmdLine WINE_PACKED;  /* Command-line */
00064     SEGPTR    showCmd WINE_PACKED;  /* Code for ShowWindow() */
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 /* internal representation of 32bit modules. per process. */
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 /* Resource types */
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 /* module.c */
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 /* resource.c */
00147 extern INT       WINAPI AccessResource(HMODULE,HRSRC); 
00148 
00149 #endif  /* __WINE_MODULE_H */

Generated on Tue Dec 20 10:14:22 2005 for vlc-0.8.4a by  doxygen 1.4.2