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.

260 lines
8.8 KiB

  1. ; mdequ.inc -- MagicDrv general equate file
  2. ;/*
  3. ; * Microsoft Confidential
  4. ; * Copyright (C) Microsoft Corporation 1992
  5. ; * All Rights Reserved.
  6. ; */
  7. ; History:
  8. ;
  9. ; 20-Jul-1992 chuckst initial version
  10. ;
  11. ;CODE_CSUM_SNAP equ 0ffffh ; defined: save image of code on csum err
  12. ; Now that CSUM is the default, the build won't work without
  13. ; POPUP being true. However, I'm leaving the POPUP conditionals
  14. ; in to help identify that code, just in case we ever want to
  15. ; remove it and let CSUM faults simply hang.
  16. POPUP = 0ffffh
  17. ifdef DEBUG
  18. POPUP = 0ffffh ; POPUPs mandatory for DEBUG build
  19. endif
  20. ; Define the following variable to generate the standalone
  21. ; version of DBLSPACE.BIN, which loads as a device driver under
  22. ; MS-DOS 5.0 or greater.
  23. ;
  24. ;STANDALONE equ 0ffffh
  25. switch_n equ 0001h
  26. switch_f equ 0002h
  27. fatal_error_0 equ 0 ; re-entered at strat
  28. fatal_error_1 equ 1 ; irpt without 1 strat
  29. fatal_error_2 equ 2 ; 2 irpts per strat
  30. fatal_error_3 equ 3 ; get_sqztor, number too low
  31. fatal_error_4 equ 4 ; put_sqztor, number too low
  32. fatal_error_5 equ 5 ; get_sqztor, number too high
  33. fatal_error_6 equ 6 ; put_sqztor, number too high
  34. fatal_error_7 equ 7 ; DOS system I/O too high
  35. fatal_error_8 equ 8 ; DOS system I/O too low
  36. fatal_error_9 equ 9 ; HEAP I/O too high
  37. fatal_error_10 equ 10 ; HEAP I/O too low
  38. fatal_error_11 equ 11 ; BITFAT I/O too high
  39. fatal_error_12 equ 12 ; BITFAT I/O too low
  40. fatal_error_13 equ 13 ; MDFAT I/O too high
  41. fatal_error_14 equ 14 ; MDFAT I/O too low
  42. fatal_error_15 equ 15 ; Bad signature check on CVF fragment list
  43. fatal_error_16 equ 16 ; Invalid int2f subfn (for forcing popup)
  44. fatal_error_17 equ 17 ; free to free sqztor
  45. fatal_error_18 equ 18 ; unfree to used sqztor
  46. fatal_error_19 equ 19 ; bitfat memory corrupt
  47. fatal_error_20 equ 20 ; mdfat memory corrupt
  48. fatal_error_21 equ 21 ; file fragment list corrupt
  49. fatal_error_22 equ 22 ; code block corrupt
  50. fatal_error_23 equ 23 ; write to invalid BitFAT page (0f0h)
  51. fatal_error_24 equ 24 ; DBLSPACE.BIN stack overrun
  52. CSUM_CODE equ 1
  53. CSUM_FFLIST equ 2
  54. CSUM_BFAT_USE equ 4
  55. CSUM_BFAT_WRITE equ 8
  56. CSUM_BFAT equ CSUM_BFAT_USE+CSUM_BFAT_WRITE
  57. CSUM_MDFAT_USE equ 16
  58. CSUM_MDFAT_WRITE equ 32
  59. CSUM_MDFAT equ CSUM_MDFAT_USE+CSUM_MDFAT_WRITE
  60. CSUM_STACK_CHK equ 64 ; Set => check for stack overrun
  61. CSUM_ALL equ CSUM_CODE+CSUM_FFLIST+CSUM_BFAT+CSUM_MDFAT+CSUM_STACK_CHK
  62. CSUM_XOR equ 4fd0h ; this value is XOR'd with all internal
  63. ; ; data structure words before the checksum
  64. ; ; is performed. This is because of the
  65. ; ; fact that 0ffffh is minus 0 in one's
  66. ; ; complement, and thus the checksum would
  67. ; ; not detect 0s changing to 0ffffhs, and
  68. ; ; vice versa. By doing this XOR, we map
  69. ; ; the two 'identical' values to 4fd0h and
  70. ; ; 0b02fh, which are much less likely to
  71. ; ; occur. Only a trashing bug which did
  72. ; ; a properly aligned NOT function on one
  73. ; ; of these two words would not be detected.
  74. CODE_CSUM_INTERVAL equ 10 ; checksum code one out of this many
  75. ; ; times driver is entered.
  76. ;;
  77. ;; Equates
  78. ;;
  79. multMagicdrv equ 4a11h ; Int2f multiplex number
  80. DRVMAP_CPR_BIT equ 80h ; bit indicating mounted CVF in drv_map array
  81. cr = 13
  82. lf = 10
  83. tab = 9
  84. ctrlz = 1ah
  85. CVF_SEQ_SWAP equ 0 ; Sequence number which implies SWAP
  86. CVF_SEQ_MAX equ 255 ; Maximum allowable sequence number
  87. MAX_ACTIVATES equ 24 ; 26 drive letters, less two floppies
  88. BIG_CLUSTER equ 8192 ;Size of BIG cluster (8K)
  89. SMALL_CLUSTER equ 4096 ;Size of SMALL cluster (4K)
  90. BPTR equ BYTE PTR
  91. MAX_FULL equ 32 ;;64;Minimum of free sectors b4 we declare this disk as full
  92. MAX_WARN equ 256 ;Minimum free sectors to generate an 'almost full' warning
  93. ;; temp_buf_list values
  94. ORIGINAL_DATA equ 1 ;This sector has an original data
  95. NEW_DATA equ 2 ;This sector contains new data
  96. MAX_DEMO_HIWORD_SIZE equ 48 ;Maximum high word for demo file
  97. MAX_SECTOR_SIZE equ 2048 ;Maximum host sector size (2K)
  98. IO_PART_SPACE equ 2048 ;Page size for sqztor table
  99. PART_CLUSTER_SIZE_POW2 equ 9 ;How many clusters per one page (DWORD per cluster)
  100. BIT_FAT_SPACE equ 2048 ;Page size of sec_list table (free space)
  101. SECTORS_PER_BIT_FAT_POW2 equ 14 ;In power 2 if sectors
  102. SECTORS_PER_BIT_FAT equ 16384 ;Number of bits (sectors) in one page
  103. DBL_SIGN equ 0 ;Where the 'DBL' signature can be located
  104. VOL_STAMP equ 6 ;Where unique vol stamp is found
  105. RETRACT_SIGNATURE equ 1 ; signature is last full sector, ie:
  106. ; ; end of file (rounded down to sector)
  107. ; ; minus 1
  108. RH equ ds:[bx] ;Addressability to Request Header structure
  109. MAX_DISK_UNITS equ 15 ;Maximumm of extended disk we can handle
  110. cMINFILEFRAGMENTS equ 50 ;Minimum file fragment heap size
  111. cDEFFILEFRAGMENTS equ 700 ;Default " " " "
  112. cMAXFILEFRAGMENTS equ 10000 ;Maximum " " " "
  113. ; cluster_to_Sqztor equates. See globals definition
  114. NO_FLAGS_MASK equ 001FH ;Just the entry, without flags
  115. RESERVED1_MASK equ 0020H ;Reserved bit just after 21-bit sector#
  116. PHYSICAL_SIZE_MASK equ 03C0H ;Only the physical size bits
  117. PHYSICAL_SIZE_OFFSET equ 6 ;THe physical size bits offset
  118. PLAINTEXT_MASK equ 3C00H ;Only the plaintext size bits
  119. PLAINTEXT_OFFSET equ 10 ;Plaintext size bits offset
  120. UNCODED_CLUSTER_MASK equ 4000H ;Uncompress cluster bit
  121. USED_CLUSTER_MASK equ 8000H ;Used cluster bit
  122. PARA_SIZE_POW2 equ 4 ;Number of bytes in one 8088 paragraph
  123. STACK_SIZE equ 768 ;Size of our stack
  124. ; Device driver equates
  125. READ_DISK_CMD equ 4
  126. WRITE_DISK_CMD equ 8
  127. WRITE_VERIFY_CMD equ 9
  128. STAT_WRITP equ 8000H ;Write protect violation
  129. STAT_DFULL equ 8027h ;Disk full error
  130. STAT_NRDY equ 8002H ;Device not ready
  131. STAT_NOCOM equ 8003H ;Unkown command
  132. STAT_CRC equ 8004H ;CRC error
  133. STAT_SNF equ 8008H ;sector not found error
  134. STAT_SEEK equ 8006H ;Seek error
  135. STAT_WRITE equ 800AH ;Write FAULT
  136. STAT_READ equ 800BH ;Read fault
  137. STAT_GEN equ 800CH ;General failore
  138. DOS EQU 21H ;DOS request INT
  139. DOS_PCHR EQU 02H ;print character function
  140. ;Constants for compression/Decompression alg.
  141. MAX_BITS equ 12 ;Maximum bits (2048 entries)
  142. TABLESIZE equ 2048 ;Hash table size
  143. SPECIAL_EOS equ 4415 ;End of Sector code
  144. ;Generic IOCTL return codes
  145. NO_ERROR equ 0 ;No error
  146. LETTER_BOUNDRY_ERROR equ 1 ;Letter out of bounds
  147. UNIT_USED_ERROR equ 2 ;Unit already used
  148. NO_FREE_SLOT_ERROR equ 3 ;No reserved slot available
  149. STAMP_ERROR equ 4 ;Stamp error on extended disk
  150. ;Cluster signature
  151. ;Compressed clusters has the signature:
  152. ; 44 53 00 00 - Cluster compressed real time
  153. ; 44 53 00 01 - Cluster SuperCompressed offline
  154. ; 44 53 00 02 - Cluster XCompressed real time
  155. ;
  156. ; NOTE: If you load these signature as words, they look like:
  157. ;
  158. ; low word = 5344h
  159. ; high word = 0000h or 0100h
  160. ; XCMP defines a different REAL_TIME_COMPRESSED signature so a XCMP and
  161. ; non XCMP driver can be used on the same CVF and not get confused trying
  162. ; to UpdateCompress a XCMP block (XCMP does not support UpdateCompress).
  163. SIG_SIZE equ 4 ; 4 byte signature
  164. STANDARD_COMPRESSED equ 0000h ; High word of stamp
  165. SUPER_COMPRESSED equ 0100h ; High word of stamp
  166. X_COMPRESSED equ 0200h ; High word of stamp
  167. REAL_TIME_COMPRESSED equ X_COMPRESSED ; Stamp used for real-time compress
  168. ;;
  169. ;; We always keep at least 64k of extra sqztors around so a
  170. ;; file overwrite won't expand to more sqztors that are available.
  171. ;; Of course this is a raw heuristic since these should also
  172. ;; be contingous. For more info, see dospatch.asm and
  173. ;; low_dlb.asm referenece to FUDGESTOR
  174. FUDGESTOR equ 128
  175. ; eXperimental compression code uses a lookup table to find past
  176. ; occurances of individual characters. The table is currently
  177. ; 256 rows (1 for each possible byte value) X N (tracks N occurances
  178. ; of each character).
  179. cltROWS EQU 256 ; lookup table 256 rows x
  180. cltCOLS EQU 8 ; N columns
  181. ifdef POPUP
  182. PUP_FILE_SIZE equ 20*1024
  183. MAX_PUP_FRAGLIST equ 6*(1+PUP_FILE_SIZE/1024) ; support >=1K clusters
  184. PUP_QUEUE_SIZE equ 4096
  185. endif
  186. ; mcsNONE indicates there is no saved Media Check status. This value
  187. ; must not be equated to a valid media check result (-1, 0, 1).
  188. mcsNONE equ 80h
  189. ; cAM_HOOKS is the number of block device drivers that can be hooked
  190. ; by the automount code. Each hook adds approx 30 bytes, so keeping
  191. ; this value low is significant. A MS-DOS 6 system that does not
  192. ; load additional block device driver in config.sys uses 1 hook (A:,
  193. ; B:, C:, ... are all serviced by one device driver).
  194. cAM_HOOKS equ 5
  195. para_adjust equ -16 ; we'll add this to certain vars
  196. ; ; in the automount device headers
  197. ; ; and related variables when we
  198. ; ; access them with low_stub_seg+1,
  199. ; ; to work around a Norton SpeeDrv bug.
  200. STACK_GUARD_VALUE equ 1234h ; unlikely value to use when checking
  201. ; for stack overrun