Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

332 lines
9.7 KiB

  1. savedCS = 4
  2. savedIP = 2
  3. savedBP = 0
  4. savedDS = -2
  5. EMAGIC = 05A4Dh
  6. ERESWDS = 0010h
  7. ENEWHDR = 003Eh
  8. ENEWEXE = 0040h
  9. EXE_HDR STRUC
  10. e_magic DW ? ; magic in same location
  11. e_cblp DW ?
  12. e_cp DW ?
  13. e_crlc DW ?
  14. e_cparhdr DW ?
  15. e_minalloc DW ?
  16. e_maxalloc DW ?
  17. e_ss DW ?
  18. e_sp DW ?
  19. e_csum DW ?
  20. e_cs DW ?
  21. e_ip DW ?
  22. e_lfarlc DW ?
  23. e_ovno DW ?
  24. e_res DW ERESWDS DUP (?)
  25. e_lfanew DD ?
  26. EXE_HDR ENDS
  27. NEMAGIC = 454Eh
  28. NERESBYTES = 0
  29. NEW_EXE STRUC
  30. ne_magic DW ? ; Magic value 'NE'
  31. ne_ver DB ? ; version number
  32. ne_rev DB ? ; revision number
  33. ne_enttab DW ? ; offset to entry table
  34. ne_cbenttab DW ? ; number of bytes in entry table
  35. ne_crc DD ? ; CRC of file
  36. ne_flags DW ? ; flag word
  37. ne_autodata DW ? ; segment number of auto data segment
  38. ne_heap DW ? ; initial size of local heap
  39. ne_stack DW ? ; initial size of stack
  40. ne_csip DD ? ; CS:IP start address
  41. ne_sssp DD ? ; SS:SP initial stack pointer. 0 if
  42. ; stack size word non-zero
  43. ne_cseg DW ? ; number of segment in segment table
  44. ne_cmod DW ? ; number of entries in module reference table
  45. ne_cbnrestab DW ? ; number of bytes in non-resident name table
  46. ne_segtab DW ? ; NE relative offset to segment table
  47. ne_rsrctab DW ? ; NE relative offset to resource table
  48. ne_restab DW ? ; NE relative offset to resident name table
  49. ne_modtab DW ? ; NE relative offset to module reference table
  50. ne_imptab DW ? ; NE relative offset to imported name table
  51. ne_nrestab DD ? ; file offset to non-resident name table
  52. ne_cmovent DW ? ; Count of movable entries
  53. ne_align DW ? ; Alignment shift count for segment data
  54. ne_cres DW ? ; Count of resource segments
  55. ne_exetyp DB ? ; Target operating system
  56. ne_flagsothers DB ? ; Other .EXE flags
  57. ne_pretthunks DW ? ; offset to return thunks
  58. ne_psegrefbytes DW ? ; offset to segment ref. bytes
  59. ne_swaparea DW ? ; Minimum code swap area size
  60. ne_expver DW ? ; Expected Windows version number
  61. NEW_EXE ENDS
  62. ; Chksum not supported unless ne_psegcsum defined in NEW_EXE structure
  63. ne_psegcsum = word ptr ne_exetyp
  64. ne_onextexe = word ptr ne_crc
  65. ; New 3.0 Gang Load area description
  66. ne_gang_start = ne_pretthunks
  67. ne_gang_length = ne_psegrefbytes
  68. NEW_EXE1 STRUC
  69. DW ?
  70. ne_usage DW ?
  71. DW ?
  72. ne_pnextexe DW ?
  73. ne_pautodata DW ?
  74. ne_pfileinfo DW ?
  75. NEW_EXE1 ENDS
  76. NENOTP = 8000h ; Not a process (i.e. a library module)
  77. NEPRIVLIB = 4000h ; A library which lives above the line
  78. NEIERR = 2000h ; Errors in image
  79. NEAPPTYP = 0700h ; Application type mask
  80. NENOTWINCOMPAT = 0100h ; Not compatible with P.M. Windowing
  81. NEWINCOMPAT = 0200h ; Compatible with P.M. Windowing
  82. NEWINAPI = 0300h ; Uses P.M. Windowing API
  83. NEFLTP = 0080h ; Floating-point instructions
  84. NEI386 = 0040h ; 386 instructions
  85. NEI286 = 0020h ; 286 instructions
  86. NEI086 = 0010h ; 8086 instructions
  87. NEPROT = 0008h ; Runs in protected mode only
  88. NEPPLI = 0004h ; Per-Process Library Initialization
  89. NEINST = 0002h ; Instance data
  90. NESOLO = 0001h ; Solo data
  91. ; Below are the private bits used by the Windows 2.0 loader. All are
  92. ; in the file, with the exception of NENONRES and NEWINPROT which are
  93. ; runtime only flags.
  94. ;
  95. NEWINPROT = NEIERR
  96. NENONRES = NEFLTP ; Contains non-resident code segments
  97. NEALLOCHIGH = NEI386 ; Private allocs above the line okay
  98. NEEMSSEPINST = NEI286 ; Want each instance in separate
  99. NELIM32 = NEI086 ; Uses LIM 3.2 API (Intel Above board)
  100. ; Following private bit is a runtime only flag used only ROM Windows.
  101. NEMODINROM = NEEMSSEPINST ; Module loaded from ROM
  102. ;
  103. ; Format of NE_FLAGSOTHERS(x):
  104. ;
  105. ; 7 6 5 4 3 2 1 0 - bit no
  106. ; | | | |
  107. ; | | | +---------------- Support for long file names
  108. ; | | +------------------ 2.x app runs in protect mode
  109. ; | +-------------------- 2.x app gets prop. font
  110. ; +---------------------- Contains gangload area
  111. ;
  112. NELONGNAMES = 1h
  113. NEINFONT = 2h ; WIN30 - 2.x app runs in 3.x prot mode
  114. NEINPROT = 4h ; WIN30 - 2.x app gets proportional font
  115. NEGANGLOAD = 8h ; WIN30 - Contains gangload area
  116. NEASSUMENODEP = 10h ; WIN40 - DllEntryPoint known not to exit
  117. NEINTLAPP = 40h ; WIN31 - intl versions use this.
  118. NEHASPATCH = 80h ; WIN40 - Some segs of this module get patched
  119. ; Target operating systems
  120. NE_UNKNOWN = 0 ; Unknown (any "new-format" OS)
  121. NE_OS2 = 1 ; Microsoft/IBM OS/2 (default)
  122. NE_WINDOWS = 2 ; Microsoft Windows
  123. NE_DOS4 = 3 ; Microsoft MS-DOS 4.x
  124. NE_DEV386 = 4 ; Microsoft Windows 386
  125. ifndef NO_APPLOADER
  126. NEAPPLOADER = 0800h ; set if application has its own loader
  127. endif ;!NO_APPLOADER
  128. NEW_SEG STRUC
  129. ns_sector DW ? ; logical sector number in file of start of segment
  130. ns_cbseg DW ? ; number bytes in file
  131. ns_flags DW ? ; segment flags
  132. ns_minalloc DW ? ; minimum number bytes to allocate for segment
  133. NEW_SEG ENDS
  134. NEW_SEG1 STRUC
  135. DB SIZE NEW_SEG DUP (?)
  136. ns_handle DW ? ; Handle to segment (0 if not loaded)
  137. NEW_SEG1 ENDS
  138. NSTYPE = 0007h ; Segment type mask
  139. NSCODE = 0000h ; Code segment
  140. NSDATA = 0001h ; Data segment
  141. NSITER = 0008h ; Iterated segment data
  142. NSMOVE = 0010h ; Moveable segment
  143. NSSHARE = 0020h ; Shareable segment
  144. NSPRELOAD = 0040h ; Preload this segment
  145. NSERONLY = 0080h ; EXECUTE ONLY code/READ ONLY data segment
  146. NSRELOC = 0100h ; Relocation information following segment data
  147. NSDPL = 0C00h ; 286 DPL bits
  148. NSDISCARD = 1000h ; Discard priority bits
  149. NS286DOS = 0EE06h ; These bits only used by 286DOS
  150. NSALIGN = 9 ; Default alignment shift count for seg. data
  151. NSALLOCED = 0002h ; set if ns_handle points to uninitialized mem.
  152. NSLOADED = 0004h ; set if ns_handle points to initialized mem.
  153. NSUSESDATA = 0400h ; set if an entry point in this segment uses
  154. ; the automatic data segment of a SOLO library
  155. NSGETHIGH = 0200h
  156. NSINDIRECT = 2000h
  157. NSWINCODE = 4000h ; flag for code
  158. NSKCACHED = 0800h ; cached by kernel
  159. NSPRIVLIB = NSITER
  160. NSNOTP = 8000h
  161. NSINROM = NSINDIRECT ; segment is loaded in ROM
  162. NSCOMPR = NSGETHIGH ; segment is compressed in ROM
  163. ifndef NO_APPLOADER
  164. NSCACHED = 8000h ;* in AppLoader Cache
  165. endif ;!NO_APPLOADER
  166. NEW_RSRC STRUC
  167. rs_align DW ?
  168. NEW_RSRC ENDS
  169. RSORDID = 08000h ; If high bit of rt_id or rn_id set then integer id
  170. RSRC_TYPEINFO STRUC
  171. rt_id DW ?
  172. rt_nres DW ?
  173. rt_proc DD ?
  174. RSRC_TYPEINFO ENDS
  175. RSRC_NAMEINFO STRUC
  176. rn_offset DW ?
  177. rn_length DW ?
  178. rn_flags DW ?
  179. rn_id DW ?
  180. rn_handle DW ?
  181. rn_usage DW ?
  182. RSRC_NAMEINFO ENDS
  183. RNMOVE = 00010h ; Moveable resource
  184. RNPURE = 00020h ; Pure resource (read only)
  185. RNPRELOAD = 00040h ; Preload this resource
  186. RNDISCARD = 01000h ; Discard bit
  187. RNLOADED = 00004h ; True if handler proc return handle
  188. RNCOMPR = 00200h ; Resource is compressed in ROM
  189. RNINROM = 02000h ; Resource is loaded in ROM (run time flag)
  190. RNUNUSED = 0CD8Bh ; Unused resource flags
  191. ENTFIXED STRUC
  192. entflags DB ?
  193. entoffset DW ?
  194. ENTFIXED ENDS
  195. if SWAPPRO
  196. ENTMOVEABLE STRUC
  197. DB ? ; Entry flags
  198. entsar DB 5 DUP (?) ; sar cs:[xxxx] instruction
  199. DW ? ; INT 0F0H for swap profiler
  200. entjmpfarop DB ?
  201. entjmpfaroff DW ?
  202. entjmpfarseg DW ?
  203. ENTMOVEABLE ENDS
  204. ENTSWAPPED STRUC
  205. DB ? ; Entry flags
  206. DB 5 DUP (?) ; sar cs:[xxxx] instruction
  207. DW ? ; INT 0F0H for swap profiler
  208. entintop DB ?
  209. entintvec DB ?
  210. entintsegno DB ?
  211. entintoff DW ?
  212. ENTSWAPPED ENDS
  213. else ; no swap profiler
  214. ENTMOVEABLE STRUC
  215. DB ? ; Entry flags
  216. entsar DB 5 DUP (?) ; sar cs:[xxxx] instruction
  217. entjmpfarop DB ?
  218. entjmpfaroff DW ?
  219. entjmpfarseg DW ?
  220. ENTMOVEABLE ENDS
  221. ENTSWAPPED STRUC
  222. DB ? ; Entry flags
  223. DB 5 DUP (?) ; sar cs:[xxxx] instruction
  224. entintop DB ?
  225. entintvec DB ?
  226. entintsegno DB ?
  227. entintoff DW ?
  228. ENTSWAPPED ENDS
  229. endif ; if swap profiler
  230. errnz <SIZE ENTMOVEABLE - SIZE ENTSWAPPED>
  231. PENT STRUC
  232. penttype DB ?
  233. pentflags DB ?
  234. pentsegno DB ?
  235. pentoffset DW ?
  236. PENT ENDS
  237. PM_EntStruc STRUC
  238. PM_EntStart dw ?
  239. PM_EntEnd dw ?
  240. PM_EntNext dw ?
  241. PM_EntStruc ENDS
  242. ENT_UNUSED = 000h
  243. ENT_ABSSEG = 0FEh
  244. ENT_MOVEABLE = 0FFh
  245. ENT_PUBLIC = 001h
  246. ENT_DATA = 002h
  247. INTOPCODE = 0CDh
  248. if SWAPPRO
  249. SWAPVECTOR = 0F0h
  250. endif
  251. NEW_RLCINFO STRUC
  252. nr_nreloc DW ?
  253. NEW_RLCINFO ENDS
  254. NEW_RLC STRUC
  255. nr_stype DB ?
  256. nr_flags DB ?
  257. nr_soff DW ?
  258. nr_mod DW ?
  259. nr_proc DW ?
  260. NEW_RLC ENDS
  261. nr_segno EQU nr_flags+3
  262. nr_entry EQU nr_proc
  263. NRSTYP = 07h
  264. NRSBYTE = 00h
  265. NRSSEG = 02h
  266. NRSPTR = 03h
  267. NRSOFF = 05h
  268. NRADD = 04h
  269. NRRTYP = 03h
  270. NRRINT = 00h
  271. NRRORD = 01h
  272. NRRNAM = 02h
  273. OSFIXUP = 03h