Windows NT 4.0 source code leak
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.

105 lines
4.7 KiB

4 years ago
  1. /* SCCSID = @(#)newexe.h 4.6 86/09/10 */
  2. /*
  3. * Title
  4. *
  5. * newexe.h
  6. * Pete Stewart
  7. * (C) Copyright Microsoft Corp 1984-1987
  8. * 17 August 1984
  9. *
  10. * Description
  11. *
  12. * Data structure definitions for the DOS 4.0/Windows 2.0
  13. * executable file format.
  14. *
  15. * Modification History
  16. *
  17. * 84/08/17 Pete Stewart Initial version
  18. * 84/10/17 Pete Stewart Changed some constants to match OMF
  19. * 84/10/23 Pete Stewart Updates to match .EXE format revision
  20. * 84/11/20 Pete Stewart Substantial .EXE format revision
  21. * 85/01/09 Pete Stewart Added constants ENEWEXE and ENEWHDR
  22. * 85/01/10 Steve Wood Added resource definitions
  23. * 85/03/04 Vic Heller Reconciled Windows and DOS 4.0 versions
  24. * 85/03/07 Pete Stewart Added movable entry count
  25. * 85/04/01 Pete Stewart Segment alignment field, error bit
  26. * 85/10/03 Reuben Borman Removed segment discard priority
  27. * 85/10/11 Vic Heller Added PIF header fields
  28. * 86/03/10 Reuben Borman Changes for DOS 5.0
  29. * 86/09/02 Reuben Borman NSPURE ==> NSSHARED
  30. * 87/05/04 Reuben Borman Added ne_cres and NSCONFORM
  31. * 87/07/08 Reuben Borman Added NEAPPTYPE definitions
  32. * 87/10/28 Wieslaw Kalkus Added ne_exetyp
  33. * 89/03/23 Wieslaw Kalkus Added ne_flagsothers for OS/2 1.2
  34. */
  35. /*_________________________________________________________________*
  36. | |
  37. | |
  38. | DOS3 .EXE FILE HEADER DEFINITION |
  39. | |
  40. |_________________________________________________________________|
  41. * */
  42. #define EMAGIC 0x5A4D /* Old magic number */
  43. #define ENEWEXE sizeof(struct exe_hdr)
  44. /* Value of E_LFARLC for new .EXEs */
  45. #define ENEWHDR 0x003C /* Offset in old hdr. of ptr. to new */
  46. #define ERESWDS 0x000d /* No. of reserved words (OLD) */
  47. #define ERES2WDS 0x000A /* No. of reserved words in e_res2 */
  48. #define ECP 0x0004 /* Offset in struct of E_CP */
  49. #define ECBLP 0x0002 /* Offset in struct of E_CBLP */
  50. #define EMINALLOC 0x000A /* Offset in struct of E_MINALLOC */
  51. #define EKNOWEAS 0x0001 /* e_flags - program understands EAs */
  52. #define EDOSEXTENDED 0x0002 /* e_flags - program runs under DOS extender */
  53. struct exe_hdr /* DOS 1, 2, 3 .EXE header */
  54. {
  55. unsigned short e_magic; /* Magic number */
  56. unsigned short e_cblp; /* Bytes on last page of file */
  57. unsigned short e_cp; /* Pages in file */
  58. unsigned short e_crlc; /* Relocations */
  59. unsigned short e_cparhdr; /* Size of header in paragraphs */
  60. unsigned short e_minalloc; /* Minimum extra paragraphs needed */
  61. unsigned short e_maxalloc; /* Maximum extra paragraphs needed */
  62. unsigned short e_ss; /* Initial (relative) SS value */
  63. unsigned short e_sp; /* Initial SP value */
  64. unsigned short e_csum; /* Checksum */
  65. unsigned short e_ip; /* Initial IP value */
  66. unsigned short e_cs; /* Initial (relative) CS value */
  67. unsigned short e_lfarlc; /* File address of relocation table */
  68. unsigned short e_ovno; /* Overlay number */
  69. unsigned long e_sym_tab; /* offset of symbol table file */
  70. unsigned short e_flags; /* old exe header flags */
  71. unsigned short e_res; /* Reserved words */
  72. unsigned short e_oemid; /* OEM identifier (for e_oeminfo) */
  73. unsigned short e_oeminfo; /* OEM information; e_oemid specific */
  74. unsigned short e_res2[ERES2WDS];/* Reserved words */
  75. long e_lfanew; /* File address of new exe header */
  76. };
  77. #define E_MAGIC(x) (x).e_magic
  78. #define E_CBLP(x) (x).e_cblp
  79. #define E_CP(x) (x).e_cp
  80. #define E_CRLC(x) (x).e_crlc
  81. #define E_CPARHDR(x) (x).e_cparhdr
  82. #define E_MINALLOC(x) (x).e_minalloc
  83. #define E_MAXALLOC(x) (x).e_maxalloc
  84. #define E_SS(x) (x).e_ss
  85. #define E_SP(x) (x).e_sp
  86. #define E_CSUM(x) (x).e_csum
  87. #define E_IP(x) (x).e_ip
  88. #define E_CS(x) (x).e_cs
  89. #define E_LFARLC(x) (x).e_lfarlc
  90. #define E_OVNO(x) (x).e_ovno
  91. #define E_SYM_TAB(x) (x).e_sym_tab
  92. #define E_FLAGS(x) (x).e_flags
  93. #define E_RES(x) (x).e_res
  94. #define E_OEMID(x) (x).e_oemid
  95. #define E_OEMINFO(x) (x).e_oeminfo
  96. #define E_RES2(x) (x).e_res2
  97. #define E_LFANEW(x) (x).e_lfanew