source: trunk/src/win32k/include/OS2Krnl.h@ 2593

Last change on this file since 2593 was 2593, checked in by bird, 26 years ago

H2INC fixes.

File size: 10.2 KB
Line 
1/* $Id: OS2Krnl.h,v 1.5 2000-02-01 12:55:28 bird Exp $
2 *
3 * OS/2 kernel structures, typedefs and macros.
4 *
5 * Project Odin Software License can be found in LICENSE.TXT
6 *
7 */
8
9#ifndef _OS2Krnl_h_
10#define _OS2Krnl_h_
11
12#if !defined(OS2_INCLUDED)
13 /* when used with h2inc.exe */
14 #define UCHAR unsigned char
15 #define CHAR char
16 #define USHORT unsigned short
17 #define ULONG unsigned long
18 #define PCHAR char *
19#endif
20
21
22#pragma pack(1)
23
24#ifdef RING0
25 typedef USHORT SFN, *PSFN; /* system file number */
26#else
27 #define SFN HFILE
28 #define PSFN PHFILE
29#endif
30
31typedef struct OTE
32{
33 ULONG ote_size; /* Object virtual size */
34 ULONG ote_base; /* Object base virtual address */
35 ULONG ote_flags; /* Attribute flags */
36 ULONG ote_pagemap; /* Object page map index */
37 ULONG ote_mapsize; /* Num of entries in obj page map */
38 /*ULONG ote_reserved;*/
39 USHORT ote_hob; /* Object Handle */
40 USHORT ote_sel; /* Object Selector */
41} OTE, *POTE;
42
43
44/* ote_flags */
45#ifndef __EXE386__
46 #define OBJREAD 0x00000001L /* Readable Object */
47 #define OBJWRITE 0x00000002L /* Writeable Object */
48 #define OBJEXEC 0x00000004L /* Executable Object */
49 #define OBJRSRC 0x00000008L /* Resource Object */
50 #define OBJDISCARD 0x00000010L /* Object is Discardable */
51 #define OBJSHARED 0x00000020L /* Object is Shared */
52 #define OBJPRELOAD 0x00000040L /* Object has preload pages */
53 #define OBJINVALID 0x00000080L /* Object has invalid pages */
54#endif
55#define OBJZEROFIL 0x00000100L /* Object has zero-filled pages */
56#ifndef __EXE386__
57 #define OBJRESIDENT 0x00000200L /* Object is resident */
58 #define OBJCONTIG 0x00000300L /* Object is resident and contiguous */
59 #define OBJDYNAMIC 0x00000400L /* Object is permanent and long locable */
60 #define OBJTYPEMASK 0x00000700L /* Object type mask */
61 #define OBJALIAS16 0x00001000L /* 16:16 alias required */
62 #define OBJBIGDEF 0x00002000L /* Big/Default bit setting */
63 #define OBJCONFORM 0x00004000L /* Object is conforming for code */
64 #define OBJIOPL 0x00008000L /* Object I/O privilege level */
65#endif
66#define OBJMADEPRIV 0x40000000L /* Object is made private for debug (now obsolete) */
67#define OBJALLOC 0x80000000L /* Object is allocated used by loader */
68
69
70
71
72
73
74/*************************/
75/* warp 3.0 AS SMTEs */
76/* Swap ModuleTableEntry */
77/*************************/
78typedef struct SMTE
79{
80 /* lxheader fields */
81 /*- magic,border,worder,level,cpu,os,ver,mflags */
82 ULONG smte_mpages; /* 00 Module # pages */
83 ULONG smte_startobj; /* 04 Object # for instruction */
84 ULONG smte_eip; /* 08 Extended instruction pointer */
85 ULONG smte_stackobj; /* 0c Object # for stack pointer */
86 ULONG smte_esp; /* 10 Extended stack pointer */
87 /*- pagesize*/
88 ULONG smte_pageshift; /* 14 Page alignment shift in .EXE */
89 ULONG smte_fixupsize; /* 18 Fixup section size */
90 /*- fixupsum,ldrsize,ldrsum*/
91 POTE smte_objtab; /* 1c Object table offset - POINTER */
92 ULONG smte_objcnt; /* 20 Number of objects in module */
93 ULONG smte_objmap; /* 24 Object page map offset - POINTER */
94 ULONG smte_itermap; /* 28 Object iterated data map offset */
95 ULONG smte_rsrctab; /* 2c Offset of Resource Table */
96 ULONG smte_rsrccnt; /* 30 Number of resource entries */
97 ULONG smte_restab; /* 34 Offset of resident name table - POINTER */
98 ULONG smte_enttab; /* 38 Offset of Entry Table - POINTER */
99 ULONG smte_fpagetab; /* 3c Offset of Fixup Page Table - POINTER */
100 ULONG smte_frectab; /* 40 Offset of Fixup Record Table - POINTER */
101 ULONG smte_impmod; /* 44 Offset of Import Module Name Table - POINTER */
102 /*- impmodcnt*/
103 ULONG smte_impproc; /* 48 Offset of Imp Procedure Name Tab - POINTER */
104 /*- pagesum*/
105 ULONG smte_datapage; /* 4c Offset of Enumerated Data Pages */
106 /*- preload*/
107 ULONG smte_nrestab; /* 50 Offset of Non-resident Names Table */
108 ULONG smte_cbnrestab; /* 54 Size of Non-resident Name Table */
109 /*- nressum*/
110 ULONG smte_autods; /* 58 Object # for automatic data object */
111 ULONG smte_debuginfo; /* 5c Offset of the debugging info */
112 ULONG smte_debuglen; /* 60 The len of the debug info in */
113 /*- instpreload,instdemand*/
114 ULONG smte_heapsize; /* 64 use for converted 16-bit modules */
115 /*- res3*/
116 /* extra */
117 PCHAR smte_path; /* 68 full pathname - POINTER */
118 USHORT smte_semcount; /* 6c Count of threads waiting on MTE semaphore. 0 => semaphore is free */
119 USHORT smte_semowner; /* 6e Slot number of the owner of MTE semahore */
120 ULONG smte_pfilecache; /* 70 Pointer to file cache for Dos32CacheModule */
121 ULONG smte_stacksize; /* 74 Thread 1 Stack size from the exe header */
122 USHORT smte_alignshift; /* 78 use for converted 16-bit modules */
123 USHORT smte_NEexpver; /* 7a expver from NE header */
124 USHORT smte_pathlen; /* 7c length of full pathname */
125 USHORT smte_NEexetype; /* 7e exetype from NE header */
126 USHORT smte_csegpack; /* 80 count of segs to pack */
127} SMTE, *PSMTE;
128
129
130
131
132
133
134
135
136/********************/
137/* warp 3.0 GA MTEs */
138/* ModuleTableEntry */
139/********************/
140typedef struct MTE
141{
142 USHORT mte_flags2;
143 USHORT mte_handle;
144 PSMTE mte_swapmte; /* handle for swapmte */
145 struct MTE * mte_link;
146 ULONG mte_flags1;
147 ULONG mte_impmodcnt; /* number of entries in Import Module Name Table*/
148 SFN mte_sfn; /*"filehandle"*/
149 USHORT mte_usecnt; /* (.EXE only) - use count */
150 CHAR mte_modname[8];
151}MTE,*PMTE,**PPMTE;
152
153
154
155/***********/
156/* flags 1 */
157/***********/
158 #define NOAUTODS 0x00000000 /* No Auto DS exists */
159 #define SOLO 0x00000001 /* Auto DS is shared */
160 #define INSTANCEDS 0x00000002 /* Auto DS is not shared */
161 #define INSTLIBINIT 0x00000004 /* Perinstance Libinit */
162 #define GINISETUP 0x00000008 /* Global Init has been setup */
163 #define NOINTERNFIXUPS 0x00000010 /* internal fixups in .EXE.DLL applied */
164 #define NOEXTERNFIXUPS 0x00000020 /* external fixups in .EXE.DLL applied */
165 #define CLASS_PROGRAM 0x00000040 /* Program class */
166 #define CLASS_GLOBAL 0x00000080 /* Global class */
167 #define CLASS_SPECIFIC 0x000000C0 /* Specific class, as against global */
168 #define CLASS_ALL 0x00000000 /* nonspecific class all modules */
169 #define CLASS_MASK 0x000000C0 /* */
170 #define MTEPROCESSED 0x00000100 /* MTE being loaded */
171 #define USED 0x00000200 /* MTE is referenced see ldrgc.c */
172 #define DOSLIB 0x00000400 /* set if DOSCALL1 */
173 #define DOSMOD 0x00000800 /* set if DOSCALLS */
174 #define MTE_MEDIAFIXED 0x00001000 /* File Media permits discarding */
175 #define LDRINVALID 0x00002000 /* module not loadable */
176 #define PROGRAMMOD 0x00000000 /* program module */
177 #define DEVDRVMOD 0x00004000 /* device driver module */
178 #define LIBRARYMOD 0x00008000 /* DLL module */
179 #define VDDMOD 0x00010000 /* VDD module */
180 #define MVDMMOD 0x00020000 /* Set if VDD Helper MTE (MVDM.DLL) */
181 #define INGRAPH 0x00040000 /* In Module Graph see ldrgc.c */
182 #define GINIDONE 0x00080000 /* Global Init has finished */
183 #define MTEADDRALLOCED 0x00100000 /* Allocate specific or not */
184 #define FSDMOD 0x00200000 /* FSD MTE */
185 #define FSHMOD 0x00400000 /* FS helper MTE */
186 #define MTELONGNAMES 0x00800000 /* Module supports longnames */
187 #define MTE_MEDIACONTIG 0x01000000 /* File Media contiguous memory req */
188 #define MTE_MEDIA16M 0x02000000 /* File Media requires mem below 16M */
189 #define MTESWAPONLOAD 0x04000000 /* make code pages swap on load */
190 #define MTEPORTHOLE 0x08000000 /* porthole module */
191 #define MTEMODPROT 0x10000000 /* Module has shared memory protected */
192 #define MTENEWMOD 0x20000000 /* Newly added module */
193 #define MTEDLLTERM 0x40000000 /* Gets instance termination */
194 #define MTESYMLOADED 0x80000000 /* Set if debugger symbols loaded */
195
196
197/***********/
198/* flags 2 */
199/***********/
200 #define MTEFORMATMASK 0x0003 /* Module format mask */
201 #define MTEFORMATR1 0x0000 /* Module format reserved */
202 #define MTEFORMATNE 0x0001 /* Module format NE */
203 #define MTEFORMATLX 0x0002 /* Module format LX */
204 #define MTEFORMATR2 0x0003 /* Module format reserved */
205 #define MTESYSTEMDLL 0x0004 /* DLL exists in system list */
206 #define MTELOADORATTACH 0x0008 /* Module under load or attach for init */
207 #define MTECIRCLEREF 0x0010 /* Module circular reference detection */
208 #define MTEFREEFIXUPS 0x0020 /* Free system mte's fixup flag d#98488 */
209 #define MTEPRELOADED 0x0040 /* MTE Preload completed */
210 #define MTEGETMTEDONE 0x0080 /* GetMTE already resolved */
211 #define MTEPACKSEGDONE 0x0100 /* Segment packed memory allocated */
212 #define MTE20LIELIST 0x0200 /* Name present in version20 lie list */
213 #define MTESYSPROCESSED 0x0400 /* System DLL already processed */
214 #define MTEDLLONEXTLST 0x1000 /* DLL has term routine on exit list #74177 */
215
216
217
218
219
220#pragma pack()
221
222/*
223 * Calling convention for 32-bit OS/2 Kernel functions.
224 */
225#define KRNLCALL __stdcall
226
227/*
228 *
229 * Other Kernel Parts
230 *
231 */
232#ifdef INCL_OS2KRNL_ALL
233 #define INCL_OS2KRNL_IO
234#endif
235
236#ifdef INCL_OS2KRNL_IO
237 #include <OS2KIO.h>
238#endif
239
240#endif
Note: See TracBrowser for help on using the repository browser.