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.

112 lines
2.7 KiB

  1. BREAK <EXEC and EXE file structures>
  2. ;
  3. ;----------------------------------------------------------------------------
  4. ;
  5. ; M00x : 4b04 implementation
  6. ;
  7. ;----------------------------------------------------------------------------
  8. ;
  9. ;** EXE.INC - Definitions for the EXEC command and EXE files
  10. ;
  11. ; The following get used as arguments to the EXEC system call. They indicate
  12. ; whether or not the program is executed or whether or not a program header
  13. ; gets created.
  14. EXEC_FUNC_NO_EXECUTE EQU 1 ; no execute bit
  15. EXEC_FUNC_OVERLAY EQU 2 ; overlay bit
  16. EXEC0 STRUC
  17. EXEC0_ENVIRON dw ? ; seg addr of environment
  18. EXEC0_COM_LINE dd ? ; pointer to asciz command line
  19. EXEC0_5C_FCB dd ? ; default fcb at 5C
  20. EXEC0_6C_FCB dd ? ; default fcb at 6C
  21. EXEC0 ENDS
  22. EXEC1 STRUC
  23. EXEC1_ENVIRON dw ? ; seg addr of environment
  24. EXEC1_COM_LINE dd ? ; pointer to asciz command line
  25. EXEC1_5C_FCB dd ? ; default fcb at 5C
  26. EXEC1_6C_FCB dd ? ; default fcb at 6C
  27. EXEC1_SP dw ? ; stack pointer of program
  28. EXEC1_SS dw ? ; stack seg register of program
  29. EXEC1_IP dw ? ; entry point IP
  30. EXEC1_CS dw ? ; entry point CS
  31. EXEC1 ENDS
  32. EXEC3 STRUC
  33. EXEC3_LOAD_ADDR DW ? ; seg address of load point
  34. EXEC3_RELOC_FAC DW ? ; relocation factor
  35. EXEC3 ENDS
  36. ;** Exit codes (in upper byte) for terminating programs
  37. EXIT_TERMINATE EQU 0
  38. EXIT_ABORT EQU 0
  39. EXIT_CTRL_C EQU 1
  40. EXIT_HARD_ERROR EQU 2
  41. EXIT_KEEP_PROCESS EQU 3
  42. ;** EXE File Header Description
  43. ;
  44. EXE_FILE STRUC
  45. EXE_SIGNATURE dw ? ; must contain 4D5A (yay zibo!)
  46. EXE_LEN_MOD_512 dw ? ; low 9 bits of length
  47. EXE_PAGES dw ? ; number of 512b pages in file
  48. EXE_RLE_COUNT dw ? ; count of reloc entries
  49. EXE_PAR_DIR dw ? ; number of paragraphs before image
  50. EXE_MIN_BSS dw ? ; minimum number of para of BSS
  51. EXE_MAX_BSS dw ? ; max number of para of BSS
  52. EXE_SS dw ? ; stack of image
  53. EXE_SP dw ? ; SP of image
  54. EXE_CHKSUM dw ? ; checksum of file (ignored)
  55. EXE_IP dw ? ; IP of entry
  56. EXE_CS dw ? ; CS of entry
  57. EXE_RLE_TABLE dw ? ; byte offset of reloc table
  58. EXE_IOV dw ? ; overlay number (0 for root)
  59. EXE_SYM_TAB dd ? ; offset of symbol table in file
  60. EXE_FILE ENDS
  61. EXE_VALID_SIGNATURE EQU 5A4Dh
  62. EXE_VALID_OLD_SIGNATURE EQU 4D5Ah
  63. ;** EXE file symbol info definitions
  64. SYMBOL_ENTRY STRUC
  65. SYM_VALUE dd ?
  66. SYM_TYPE dw ?
  67. SYM_LEN db ?
  68. SYM_NAME db 255 dup (?)
  69. SYMBOL_ENTRY ENDS
  70. ;
  71. ; M00x - BEGIN
  72. ;
  73. ;** Data structure passed for ExecReady call
  74. ERStruc STRUC
  75. ER_Reserved dw ? ; reserved, should be zero
  76. ER_Flags dw ?
  77. ER_ProgName dd ? ; ptr to ASCIIZ str of prog name
  78. ER_PSP dw ? ; PSP of the program
  79. ER_StartAddr dd ? ; Start CS:IP of the program
  80. ER_ProgSize dd ? ; Program size including PSP
  81. ERStruc ENDS
  82. ;** bit fields in ER_Flags
  83. ER_EXE equ 0001h
  84. ER_OVERLAY equ 0002h
  85. ;
  86. ; M00x - END
  87. ;
  88.