4 * Copyright 1995 Alexandre Julliard
16 /* In-memory module structure. See 'Windows Internals' p. 219 */
19 WORD magic
; /* 'NE' signature */
20 WORD count
; /* Usage count */
21 WORD entry_table
; /* Near ptr to entry table */
22 HMODULE next
; /* Selector to next module */
23 WORD dgroup_entry
; /* Near ptr to segment entry for DGROUP */
24 WORD fileinfo
; /* Near ptr to file info (OFSTRUCT) */
25 WORD flags
; /* Module flags */
26 WORD dgroup
; /* Logical segment for DGROUP */
27 WORD heap_size
; /* Initial heap size */
28 WORD stack_size
; /* Initial stack size */
29 WORD ip
; /* Initial ip */
30 WORD cs
; /* Initial cs (logical segment) */
31 WORD sp
; /* Initial stack pointer */
32 WORD ss
; /* Initial ss (logical segment) */
33 WORD seg_count
; /* Number of segments in segment table */
34 WORD modref_count
; /* Number of module references */
35 WORD nrname_size
; /* Size of non-resident names table */
36 WORD seg_table
; /* Near ptr to segment table */
37 WORD res_table
; /* Near ptr to resource table */
38 WORD name_table
; /* Near ptr to resident names table */
39 WORD modref_table
; /* Near ptr to module reference table */
40 WORD import_table
; /* Near ptr to imported names table */
41 DWORD nrname_fpos
; /* File offset of non-resident names table */
42 WORD moveable_entries
; /* Number of moveable entries in entry table */
43 WORD alignment
; /* Alignment shift count */
44 WORD truetype
; /* Set to 2 if TrueType font */
45 BYTE os_flags
; /* Operating system flags */
46 BYTE misc_flags
; /* Misc. flags */
47 HANDLE dlls_to_init
; /* List of DLLs to initialize */
48 HANDLE nrname_handle
; /* Handle to non-resident name table in memory */
49 WORD min_swap_area
; /* Min. swap area size */
50 WORD expected_version
; /* Expected Windows version */
51 WORD self_loading_sel
; /* Selector used for self-loading apps. procs */
54 /* In-memory segment table */
57 WORD filepos
; /* Position in file, in sectors */
58 WORD size
; /* Segment size on disk */
59 WORD flags
; /* Segment flags */
60 WORD minsize
; /* Min. size of segment in memory */
61 HANDLE selector
; /* Selector of segment in memory */
64 /* Self-loading modules contain this structure in their first segment */
68 WORD version
; /* Must be 0xA0 */
70 FARPROC BootApp
; /* startup procedure */
71 FARPROC LoadAppSeg
; /* procedure to load a segment */
73 FARPROC MyAlloc
; /* memory allocation procedure,
74 * wine must write this field */
75 FARPROC EntryAddrProc
;
76 FARPROC ExitProc
; /* exit procedure */
78 FARPROC SetOwner
; /* Set Owner procedure, exported by wine */
81 /* Parameters for LoadModule() */
85 HANDLE hEnvironment
; /* Environment segment */
86 SEGPTR cmdLine
; /* Command-line */
87 SEGPTR showCmd
; /* Code for ShowWindow() */
91 #define NE_SEG_TABLE(pModule) \
92 ((SEGTABLEENTRY *)((char *)(pModule) + (pModule)->seg_table))
94 #define NE_MODULE_TABLE(pModule) \
95 ((WORD *)((char *)(pModule) + (pModule)->modref_table))
97 #define NE_MODULE_NAME(pModule) \
98 (((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
104 extern BOOL
MODULE_Init(void);
105 extern int MODULE_OpenFile( HMODULE hModule
);
106 extern LPSTR
MODULE_GetModuleName( HMODULE hModule
);
107 extern void MODULE_RegisterModule( HMODULE hModule
);
108 extern WORD
MODULE_GetOrdinal( HMODULE hModule
, char *name
);
109 extern SEGPTR
MODULE_GetEntryPoint( HMODULE hModule
, WORD ordinal
);
110 extern BOOL
MODULE_SetEntryPoint( HMODULE hModule
, WORD ordinal
, WORD offset
);
111 extern LPSTR
MODULE_GetEntryPointName( HMODULE hModule
, WORD ordinal
);
113 extern BOOL
NE_LoadSegment( HMODULE hModule
, WORD segnum
);
114 extern void NE_FixupPrologs( HMODULE hModule
);
115 extern void NE_InitializeDLLs( HMODULE hModule
);
117 #endif /* _WINE_MODULE_H */