Leaked source code of windows server 2003
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.

118 lines
4.4 KiB

  1. /* SCCSID = @(#)bndrel.h 4.3 86/07/21 */
  2. /*
  3. * Copyright Microsoft Corporation, 1983, 1984, 1985
  4. *
  5. * This Module contains Proprietary Information of Microsoft
  6. * Corporation and should be treated as Confidential.
  7. *
  8. * bndrel.h
  9. * Relocation record definitions
  10. */
  11. #if OEXE
  12. // DOS run-time relocation record
  13. #pragma pack(1)
  14. typedef struct _DOSRLC
  15. {
  16. WORD ra; // Relocation offset
  17. SATYPE sa; // Relocation segment
  18. }
  19. DOSRLC;
  20. #pragma pack()
  21. #define CBRLE sizeof(DOSRLC)
  22. #if FEXEPACK
  23. // EXEPACKed DOS run-time relocation storage
  24. typedef struct _FRAMERLC
  25. {
  26. WORD count; // Number of relocation for this frame
  27. WORD size; // Size of rgRlc
  28. WORD FAR *rgRlc; // Array of packed relocation offsets
  29. }
  30. FRAMERLC;
  31. #define DEF_FRAMERLC 64
  32. #endif
  33. // Not EXEPACKed DOS run-time relocation storage
  34. typedef struct _RUNRLC
  35. {
  36. WORD count; // Number of relocation for this overlay
  37. WORD size; // Size of rgRlc
  38. DOSRLC FAR *rgRlc; // Array of relocation addresses
  39. }
  40. RUNRLC;
  41. #define DEF_RUNRLC 128
  42. #endif
  43. #define LOCLOBYTE 0 /* Lo-byte (8-bit) fixup */
  44. #define LOCOFFSET 1 /* Offset (16-bit) fixup */
  45. #define LOCSEGMENT 2 /* Segment (16-bit) fixup */
  46. #define LOCPTR 3 /* "Pointer" (32-bit) fixup */
  47. #define LOCHIBYTE 4 /* Hi-byte fixup (unimplemented) */
  48. #define LOCLOADOFFSET 5 /* Loader-resolved offset fixup */
  49. #define LOCOFFSET32 9 /* 32-bit offset */
  50. #define LOCPTR48 11 /* 48-bit pointer */
  51. #define LOCLOADOFFSET32 13 /* 32-bit loader-resolved offset */
  52. #define T0 0 /* Target method T0 (segment index) */
  53. #define T1 1 /* Target method T1 (group index) */
  54. #define T2 2 /* Target method T2 (extern index) */
  55. #define F0 0 /* Frame method F0 (segment index) */
  56. #define F1 1 /* Frame method F1 (group index) */
  57. #define F2 2 /* Frame method F2 (extern index) */
  58. #define F3 3 /* Frame method F3 (frame number) */
  59. #define F4 4 /* Frame method F4 (location) */
  60. #define F5 5 /* Frame method F5 (target) */
  61. /*
  62. * Fixup record bits
  63. */
  64. #define F_BIT 0x80
  65. #define T_BIT 0x08
  66. #define P_BIT 0x04
  67. #define M_BIT 0x40
  68. #define S_BIT 0x20
  69. #define THREAD_BIT 0x80
  70. #define D_BIT 0x40
  71. #define FCODETOCODE 0
  72. #define FCODETODATA 1
  73. #define FDATATOCODE 2
  74. #define FDATATODATA 3
  75. #define BREAKPOINT 0xCC /* Op code for interrupt 3 (brkpt) */
  76. #define CALLFARDIRECT 0x9A /* Op code for long call */
  77. #define CALLNEARDIRECT 0xE8 /* Op code for short call */
  78. #define JUMPFAR 0xEA /* Op code for long jump */
  79. #define JUMPNEAR 0xE9 /* Op code for short (3-byte) jump */
  80. #define KINDSEG 0
  81. #define KINDGROUP 1
  82. #define KINDEXT 2
  83. #define KINDLOCAT 4
  84. #define KINDTARGET 5
  85. #define NOP 0x90 /* Op code for no-op */
  86. #define PUSHCS 0x0E /* Op code for push CS */
  87. #define INTERRUPT 0xCD /* Op code for interrupt */
  88. typedef struct _FIXINFO
  89. {
  90. WORD f_dri; /* Data record index */
  91. WORD f_loc; /* Fixup location type */
  92. KINDTYPE f_mtd; /* Target specification method */
  93. WORD f_idx; /* Target specification index */
  94. DWORD f_disp; /* Target displacement */
  95. KINDTYPE f_fmtd; /* Frame specification method */
  96. WORD f_fidx; /* Frame specification index */
  97. FTYPE f_self; /* Self-relative boolean */
  98. FTYPE f_add; /* Additive fixup boolean */
  99. }
  100. FIXINFO; /* Fixup information record */