Changeset 3567 for trunk/kStuff/kLdr/kLdrModLX.h
- Timestamp:
- Aug 27, 2007, 9:54:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kStuff/kLdr/kLdrModLX.h
r3537 r3567 20 20 struct e32_exe 21 21 { 22 uint8_te32_magic[2];23 uint8_te32_border;24 uint8_te32_worder;25 uint32_te32_level;26 uint16_te32_cpu;27 uint16_te32_os;28 uint32_te32_ver;29 uint32_te32_mflags;30 uint32_te32_mpages;31 uint32_te32_startobj;32 uint32_te32_eip;33 uint32_te32_stackobj;34 uint32_te32_esp;35 uint32_te32_pagesize;36 uint32_te32_pageshift;22 KU8 e32_magic[2]; 23 KU8 e32_border; 24 KU8 e32_worder; 25 KU32 e32_level; 26 KU16 e32_cpu; 27 KU16 e32_os; 28 KU32 e32_ver; 29 KU32 e32_mflags; 30 KU32 e32_mpages; 31 KU32 e32_startobj; 32 KU32 e32_eip; 33 KU32 e32_stackobj; 34 KU32 e32_esp; 35 KU32 e32_pagesize; 36 KU32 e32_pageshift; 37 37 /** The size of the fixup section. 38 38 * The fixup section consists of the fixup page table, the fixup record table, 39 39 * the import module table, and the import procedure name table. 40 40 */ 41 uint32_te32_fixupsize;42 uint32_te32_fixupsum;41 KU32 e32_fixupsize; 42 KU32 e32_fixupsum; 43 43 /** The size of the resident loader section. 44 44 * This includes the object table, the object page map table, the resource table, the resident name table, 45 45 * the entry table, the module format directives table, and the page checksum table (?). */ 46 uint32_te32_ldrsize;46 KU32 e32_ldrsize; 47 47 /** The checksum of the loader section. 0 if not calculated. */ 48 uint32_te32_ldrsum;48 KU32 e32_ldrsum; 49 49 /** The offset of the object table relative to this structure. */ 50 uint32_te32_objtab;50 KU32 e32_objtab; 51 51 /** Count of objects. */ 52 uint32_te32_objcnt;52 KU32 e32_objcnt; 53 53 /** The offset of the object page map table relative to this structure. */ 54 uint32_te32_objmap;54 KU32 e32_objmap; 55 55 /** The offset of the object iterated pages (whatever this is used for) relative to the start of the file. */ 56 uint32_te32_itermap;56 KU32 e32_itermap; 57 57 /** The offset of the resource table relative to this structure. */ 58 uint32_te32_rsrctab;58 KU32 e32_rsrctab; 59 59 /** The number of entries in the resource table. */ 60 uint32_te32_rsrccnt;60 KU32 e32_rsrccnt; 61 61 /** The offset of the resident name table relative to this structure. */ 62 uint32_te32_restab;62 KU32 e32_restab; 63 63 /** The offset of the entry (export) table relative to this structure. */ 64 uint32_te32_enttab;64 KU32 e32_enttab; 65 65 /** The offset of the module format directives table relative to this structure. */ 66 uint32_te32_dirtab;66 KU32 e32_dirtab; 67 67 /** The number of entries in the module format directives table. */ 68 uint32_te32_dircnt;68 KU32 e32_dircnt; 69 69 /** The offset of the fixup page table relative to this structure. */ 70 uint32_te32_fpagetab;70 KU32 e32_fpagetab; 71 71 /** The offset of the fixup record table relative to this structure. */ 72 uint32_te32_frectab;72 KU32 e32_frectab; 73 73 /** The offset of the import module name table relative to this structure. */ 74 uint32_te32_impmod;74 KU32 e32_impmod; 75 75 /** The number of entries in the import module name table. */ 76 uint32_te32_impmodcnt;76 KU32 e32_impmodcnt; 77 77 /** The offset of the import procedure name table relative to this structure. */ 78 uint32_te32_impproc;78 KU32 e32_impproc; 79 79 /** The offset of the page checksum table relative to this structure. */ 80 uint32_te32_pagesum;80 KU32 e32_pagesum; 81 81 /** The offset of the data pages relative to the start of the file. */ 82 uint32_te32_datapage;82 KU32 e32_datapage; 83 83 /** The number of preload pages (ignored). */ 84 uint32_te32_preload;84 KU32 e32_preload; 85 85 /** The offset of the non-resident name table relative to the start of the file. */ 86 uint32_te32_nrestab;86 KU32 e32_nrestab; 87 87 /** The size of the non-resident name table. */ 88 uint32_te32_cbnrestab;89 uint32_te32_nressum;90 uint32_te32_autodata;91 uint32_te32_debuginfo;92 uint32_te32_debuglen;93 uint32_te32_instpreload;94 uint32_te32_instdemand;95 uint32_te32_heapsize;96 uint32_te32_stacksize;97 uint8_te32_res3[20];88 KU32 e32_cbnrestab; 89 KU32 e32_nressum; 90 KU32 e32_autodata; 91 KU32 e32_debuginfo; 92 KU32 e32_debuglen; 93 KU32 e32_instpreload; 94 KU32 e32_instdemand; 95 KU32 e32_heapsize; 96 KU32 e32_stacksize; 97 KU8 e32_res3[20]; 98 98 }; 99 99 … … 113 113 #define E32BEWO 1 114 114 /** e32_level */ 115 #define E32LEVEL UINT32_C(0)115 #define E32LEVEL KU32_C(0) 116 116 /** e32_cpu - 80286 */ 117 117 #define E32CPU286 1 … … 121 121 #define E32CPU486 3 122 122 /** e32_pagesize */ 123 #define OBJPAGELEN UINT32_C(0x1000)123 #define OBJPAGELEN KU32_C(0x1000) 124 124 125 125 … … 127 127 * @{ */ 128 128 /** App Type: Fullscreen only. */ 129 #define E32NOPMW UINT32_C(0x00000100)129 #define E32NOPMW KU32_C(0x00000100) 130 130 /** App Type: PM API. */ 131 #define E32PMAPI UINT32_C(0x00000300)131 #define E32PMAPI KU32_C(0x00000300) 132 132 /** App Type: PM VIO compatible. */ 133 #define E32PMW UINT32_C(0x00000200)133 #define E32PMW KU32_C(0x00000200) 134 134 /** Application type mask. */ 135 #define E32APPMASK UINT32_C(0x00000300)135 #define E32APPMASK KU32_C(0x00000300) 136 136 /** Executable module. */ 137 #define E32MODEXE UINT32_C(0x00000000)137 #define E32MODEXE KU32_C(0x00000000) 138 138 /** Dynamic link library (DLL / library) module. */ 139 #define E32MODDLL UINT32_C(0x00008000)139 #define E32MODDLL KU32_C(0x00008000) 140 140 /** Protected memory DLL. */ 141 #define E32PROTDLL UINT32_C(0x00010000)141 #define E32PROTDLL KU32_C(0x00010000) 142 142 /** Physical Device Driver. */ 143 #define E32MODPDEV UINT32_C(0x00020000)143 #define E32MODPDEV KU32_C(0x00020000) 144 144 /** Virtual Device Driver. */ 145 #define E32MODVDEV UINT32_C(0x00028000)145 #define E32MODVDEV KU32_C(0x00028000) 146 146 /** Device driver */ 147 147 #define E32DEVICE E32MODPDEV … … 151 151 #define E32MODPROTDLL (E32MODDLL | E32PROTDLL) 152 152 /** Module Type mask. */ 153 #define E32MODMASK UINT32_C(0x00038000)153 #define E32MODMASK KU32_C(0x00038000) 154 154 /** Not loadable (linker error). */ 155 #define E32NOLOAD UINT32_C(0x00002000)155 #define E32NOLOAD KU32_C(0x00002000) 156 156 /** No internal fixups. */ 157 #define E32NOINTFIX UINT32_C(0x00000010)157 #define E32NOINTFIX KU32_C(0x00000010) 158 158 /** No external fixups (i.e. imports). */ 159 #define E32NOEXTFIX UINT32_C(0x00000020)159 #define E32NOEXTFIX KU32_C(0x00000020) 160 160 /** System DLL, no internal fixups. */ 161 #define E32SYSDLL UINT32_C(0x00000008)161 #define E32SYSDLL KU32_C(0x00000008) 162 162 /** Global (set) or per instance (cleared) library initialization. */ 163 #define E32LIBINIT UINT32_C(0x00000004)163 #define E32LIBINIT KU32_C(0x00000004) 164 164 /** Global (set) or per instance (cleared) library termination. */ 165 #define E32LIBTERM UINT32_C(0x40000000)165 #define E32LIBTERM KU32_C(0x40000000) 166 166 /** Indicates when set in an executable that the process isn't SMP safe. */ 167 #define E32NOTMPSAFE UINT32_C(0x00080000)167 #define E32NOTMPSAFE KU32_C(0x00080000) 168 168 /** @} */ 169 169 … … 172 172 typedef union _offset 173 173 { 174 uint16_toffset16;175 uint32_toffset32;174 KU16 offset16; 175 KU32 offset32; 176 176 } offset; 177 177 … … 181 181 struct r32_rlc 182 182 { 183 uint8_tnr_stype;184 uint8_tnr_flags;185 int16_tr32_soff;186 uint16_tr32_objmod;183 KU8 nr_stype; 184 KU8 nr_flags; 185 KI16 r32_soff; 186 KU16 r32_objmod; 187 187 188 188 union targetid … … 192 192 { 193 193 offset proc; 194 uint32_tord;194 KU32 ord; 195 195 } extref; 196 196 struct addfixup 197 197 { 198 uint16_tentry;198 KU16 entry; 199 199 offset addval; 200 200 } addfix; 201 201 } r32_target; 202 uint16_tr32_srccount;203 uint16_tr32_chain;202 KU16 r32_srccount; 203 KU16 r32_chain; 204 204 }; 205 205 … … 256 256 { 257 257 /** The size of the object. */ 258 uint32_to32_size;258 KU32 o32_size; 259 259 /** The base address of the object. */ 260 uint32_to32_base;260 KU32 o32_base; 261 261 /** Object flags. */ 262 uint32_to32_flags;262 KU32 o32_flags; 263 263 /** Page map index. */ 264 uint32_to32_pagemap;264 KU32 o32_pagemap; 265 265 /** Page map size. (doesn't need to be o32_size >> page shift). */ 266 uint32_to32_mapsize;266 KU32 o32_mapsize; 267 267 /** Reserved */ 268 uint32_to32_reserved;268 KU32 o32_reserved; 269 269 }; 270 270 … … 272 272 * @{ */ 273 273 /** Read access. */ 274 #define OBJREAD UINT32_C(0x00000001)274 #define OBJREAD KU32_C(0x00000001) 275 275 /** Write access. */ 276 #define OBJWRITE UINT32_C(0x00000002)276 #define OBJWRITE KU32_C(0x00000002) 277 277 /** Execute access. */ 278 #define OBJEXEC UINT32_C(0x00000004)278 #define OBJEXEC KU32_C(0x00000004) 279 279 /** Resource object. */ 280 #define OBJRSRC UINT32_C(0x00000008)280 #define OBJRSRC KU32_C(0x00000008) 281 281 /** The object is discarable (i.e. don't swap, just load in pages from the executable). 282 282 * This overlaps a bit with object type. */ 283 #define OBJDISCARD UINT32_C(0x00000010)283 #define OBJDISCARD KU32_C(0x00000010) 284 284 /** The object is shared. */ 285 #define OBJSHARED UINT32_C(0x00000020)285 #define OBJSHARED KU32_C(0x00000020) 286 286 /** The object has preload pages. */ 287 #define OBJPRELOAD UINT32_C(0x00000040)287 #define OBJPRELOAD KU32_C(0x00000040) 288 288 /** The object has invalid pages. */ 289 #define OBJINVALID UINT32_C(0x00000080)289 #define OBJINVALID KU32_C(0x00000080) 290 290 /** Non-permanent, link386 bug. */ 291 #define LNKNONPERM UINT32_C(0x00000600)291 #define LNKNONPERM KU32_C(0x00000600) 292 292 /** Non-permanent, correct 'value'. */ 293 #define OBJNONPERM UINT32_C(0x00000000)293 #define OBJNONPERM KU32_C(0x00000000) 294 294 /** Obj Type: The object is permanent and swappable. */ 295 #define OBJPERM UINT32_C(0x00000100)295 #define OBJPERM KU32_C(0x00000100) 296 296 /** Obj Type: The object is permanent and resident (i.e. not swappable). */ 297 #define OBJRESIDENT UINT32_C(0x00000200)297 #define OBJRESIDENT KU32_C(0x00000200) 298 298 /** Obj Type: The object is resident and contigious. */ 299 #define OBJCONTIG UINT32_C(0x00000300)299 #define OBJCONTIG KU32_C(0x00000300) 300 300 /** Obj Type: The object is permanent and long locable. */ 301 #define OBJDYNAMIC UINT32_C(0x00000400)301 #define OBJDYNAMIC KU32_C(0x00000400) 302 302 /** Object type mask. */ 303 #define OBJTYPEMASK UINT32_C(0x00000700)303 #define OBJTYPEMASK KU32_C(0x00000700) 304 304 /** x86: The object require an 16:16 alias. */ 305 #define OBJALIAS16 UINT32_C(0x00001000)305 #define OBJALIAS16 KU32_C(0x00001000) 306 306 /** x86: Big/Default selector setting, i.e. toggle 32-bit or 16-bit. */ 307 #define OBJBIGDEF UINT32_C(0x00002000)307 #define OBJBIGDEF KU32_C(0x00002000) 308 308 /** x86: conforming selector setting (weird stuff). */ 309 #define OBJCONFORM UINT32_C(0x00004000)309 #define OBJCONFORM KU32_C(0x00004000) 310 310 /** x86: IOPL. */ 311 #define OBJIOPL UINT32_C(0x00008000)311 #define OBJIOPL KU32_C(0x00008000) 312 312 /** @} */ 313 313 … … 316 316 { 317 317 /** The file offset of the page. */ 318 uint32_to32_pagedataoffset;318 KU32 o32_pagedataoffset; 319 319 /** The number of bytes of raw page data. */ 320 uint16_to32_pagesize;320 KU16 o32_pagesize; 321 321 /** Per page flags describing how the page is encoded in the file. */ 322 uint16_to32_pageflags;322 KU16 o32_pageflags; 323 323 }; 324 324 … … 327 327 */ 328 328 /** Raw page (uncompressed) in the file. */ 329 #define VALID UINT16_C(0x0000)329 #define VALID KU16_C(0x0000) 330 330 /** RLE encoded page in file. */ 331 #define ITERDATA UINT16_C(0x0001)331 #define ITERDATA KU16_C(0x0001) 332 332 /** Invalid page, nothing in the file. */ 333 #define INVALID UINT16_C(0x0002)333 #define INVALID KU16_C(0x0002) 334 334 /** Zero page, nothing in file. */ 335 #define ZEROED UINT16_C(0x0003)335 #define ZEROED KU16_C(0x0003) 336 336 /** range of pages (what is this?) */ 337 #define RANGE UINT16_C(0x0004)337 #define RANGE KU16_C(0x0004) 338 338 /** Compressed page in file. */ 339 #define ITERDATA2 UINT16_C(0x0005)339 #define ITERDATA2 KU16_C(0x0005) 340 340 /** @} */ 341 341 … … 345 345 { 346 346 /** Number of iterations. */ 347 uint16_tLX_nIter;347 KU16 LX_nIter; 348 348 /** The number of bytes that's being iterated. */ 349 uint16_tLX_nBytes;349 KU16 LX_nBytes; 350 350 /** The bytes. */ 351 uint8_tLX_Iterdata;351 KU8 LX_Iterdata; 352 352 }; 353 353 … … 359 359 { 360 360 /** Resource Type. */ 361 uint16_ttype;361 KU16 type; 362 362 /** Resource ID. */ 363 uint16_tname;363 KU16 name; 364 364 /** Resource size in bytes. */ 365 uint32_tcb;365 KU32 cb; 366 366 /** The index of the object containing the resource. */ 367 uint16_tobj;367 KU16 obj; 368 368 /** Offset of the resource that within the object. */ 369 uint32_toffset;369 KU32 offset; 370 370 }; 371 371 … … 379 379 { 380 380 /** The number of entries. */ 381 uint8_tb32_cnt;381 KU8 b32_cnt; 382 382 /** The type of bundle. */ 383 uint8_tb32_type;383 KU8 b32_type; 384 384 /** The index of the object containing these entry points. */ 385 uint16_tb32_obj;385 KU16 b32_obj; 386 386 }; 387 387 … … 407 407 { 408 408 /** Entry point flags */ 409 uint8_te32_flags; /* Entry point flags */409 KU8 e32_flags; /* Entry point flags */ 410 410 union entrykind 411 411 { … … 416 416 { 417 417 /** Offset into segment. */ 418 uint16_toffset;418 KU16 offset; 419 419 /** The callgate selector */ 420 uint16_tcallgate;420 KU16 callgate; 421 421 } e32_callgate; 422 422 /** ENTRYFWD */ … … 424 424 { 425 425 /** Module ordinal number (i.e. into the import module table). */ 426 uint16_tmodord;426 KU16 modord; 427 427 /** Procedure name or ordinal number. */ 428 uint32_tvalue;428 KU32 value; 429 429 } e32_fwd; 430 430 } e32_variant;
Note:
See TracChangeset
for help on using the changeset viewer.