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.

224 lines
8.8 KiB

  1. ;----------------------------------------------------------------------------
  2. ; MDEQU.INC - General equate file
  3. ;
  4. ; Microsoft Confidential
  5. ; Copyright (C) Microsoft Corporation 1992-1993
  6. ; All Rights Reserved.
  7. ;
  8. ; History:
  9. ; 20-Jul-92 chuckst Initial version.
  10. ;
  11. ; VxD History:
  12. ; 21-Apr-93 jeffpar Adapted for MRCI.386
  13. ;----------------------------------------------------------------------------
  14. ; Define the following variable to generate the standalone
  15. ; version of DBLSPACE.BIN, which loads as a device driver under
  16. ; MS-DOS 5.0 or greater.
  17. ;
  18. ;STANDALONE equ 0ffffh
  19. ; Note that the final version of DblSpace switched to 6-8-12 encoding
  20. ; which assumes the following scheme:
  21. ;
  22. ; ccccccc10 raw char ( < 128)
  23. ; ccccccc01 raw char ( >=128)
  24. ; oooooo00 6-bit offset
  25. ; oooooooo011 8-bit offset
  26. ; oooooooooooo111 12-bit offset
  27. ;
  28. MAX_6BIT_OFFSET equ 63
  29. MAX_8BIT_OFFSET equ (MAX_6BIT_OFFSET+256)
  30. MAX_12BIT_OFFSET equ ((MAX_8BIT_OFFSET+4096)-1)
  31. SPECIAL_EOS equ 4415 ;End of Sector code
  32. .errnz MAX_12BIT_OFFSET+1 ne SPECIAL_EOS
  33. MAX_LENGTH_BITS equ 17
  34. MAX_TRUE_LENGTH equ 512
  35. MAX_RAW_LENGTH equ (MAX_TRUE_LENGTH-2) ; lengths are stored 2 less than true length
  36. fatal_error_0 equ 0 ; re-entered at strat
  37. fatal_error_1 equ 1 ; irpt without 1 strat
  38. fatal_error_2 equ 2 ; 2 irpts per strat
  39. fatal_error_3 equ 3 ; get_sqztor, number too low
  40. fatal_error_4 equ 4 ; put_sqztor, number too low
  41. fatal_error_5 equ 5 ; get_sqztor, number too high
  42. fatal_error_6 equ 6 ; put_sqztor, number too high
  43. fatal_error_7 equ 7 ; DOS system I/O too high
  44. fatal_error_8 equ 8 ; DOS system I/O too low
  45. fatal_error_9 equ 9 ; HEAP I/O too high
  46. fatal_error_10 equ 10 ; HEAP I/O too low
  47. fatal_error_11 equ 11 ; BITFAT I/O too high
  48. fatal_error_12 equ 12 ; BITFAT I/O too low
  49. fatal_error_13 equ 13 ; MDFAT I/O too high
  50. fatal_error_14 equ 14 ; MDFAT I/O too low
  51. fatal_error_15 equ 15 ; Bad signature check on CVF fragment list
  52. fatal_error_16 equ 16 ; Invalid int2f subfn (for forcing popup)
  53. fatal_error_17 equ 17 ; free to free sqztor
  54. fatal_error_18 equ 18 ; unfree to used sqztor
  55. ;;
  56. ;; Equates
  57. ;;
  58. multMagicdrv equ 4a11h ; Int2f multiplex number
  59. DRVMAP_CPR_BIT equ 80h ; bit indicating mounted CVF in drv_map array
  60. cr = 13
  61. lf = 10
  62. tab = 9
  63. ctrlz = 1ah
  64. CVF_SEQ_SWAP equ 0 ; Sequence number which implies SWAP
  65. CVF_SEQ_MAX equ 255 ; Maximum allowable sequence number
  66. MAX_ACTIVATES equ 24 ; 26 drive letters, less two floppies
  67. BIG_CLUSTER equ 8192 ;Size of BIG cluster (8K)
  68. SMALL_CLUSTER equ 4096 ;Size of SMALL cluster (4K)
  69. BPTR equ BYTE PTR
  70. MAX_FULL equ 32 ;;64;Minimum of free sectors b4 we declare this disk as full
  71. MAX_WARN equ 256 ;Minimum free sectors to generate an 'almost full' warning
  72. ;; temp_buf_list values
  73. ORIGINAL_DATA equ 1 ;This sector has an original data
  74. NEW_DATA equ 2 ;This sector contains new data
  75. MAX_DEMO_HIWORD_SIZE equ 48 ;Maximum high word for demo file
  76. MAX_SECTOR_SIZE equ 2048 ;Maximum host sector size (2K)
  77. IO_PART_SPACE equ 2048 ;Page size for sqztor table
  78. PART_CLUSTER_SIZE_POW2 equ 9 ;How many clusters per one page (DWORD per cluster)
  79. BIT_FAT_SPACE equ 2048 ;Page size of sec_list table (free space)
  80. SECTORS_PER_BIT_FAT_POW2 equ 14 ;In power 2 if sectors
  81. SECTORS_PER_BIT_FAT equ 16384 ;Number of bits (sectors) in one page
  82. ;BPB equates
  83. DBL_SIGN equ 512 ;Where the 'DBL' signature can be located
  84. RETRACT_SIGNATURE equ 1 ; signature is last full sector, ie:
  85. ; ; end of file (rounded down to sector)
  86. ; ; minus 1
  87. RH equ ds:[bx] ;Addressability to Request Header structure
  88. MAX_DISK_UNITS equ 15 ;Maximumm of extended disk we can handle
  89. cMINFILEFRAGMENTS equ 50 ;Minimum file fragment heap size
  90. cDEFFILEFRAGMENTS equ 700 ;Default " " " "
  91. cMAXFILEFRAGMENTS equ 10000 ;Maximum " " " "
  92. ; cluster_to_Sqztor equates. See globals definition
  93. NO_FLAGS_MASK equ 001FH ;Just the entry, without flags
  94. RESERVED1_MASK equ 0020H ;Reserved bit just after 21-bit sector#
  95. PHYSICAL_SIZE_MASK equ 03C0H ;Only the physical size bits
  96. PHYSICAL_SIZE_OFFSET equ 6 ;THe physical size bits offset
  97. PLAINTEXT_MASK equ 3C00H ;Only the plaintext size bits
  98. PLAINTEXT_OFFSET equ 10 ;Plaintext size bits offset
  99. UNCODED_CLUSTER_MASK equ 4000H ;Uncompress cluster bit
  100. USED_CLUSTER_MASK equ 8000H ;Used cluster bit
  101. PARA_SIZE_POW2 equ 4 ;Number of bytes in one 8088 paragraph
  102. STACK_SIZE equ 768 ;Size of our stack
  103. ; Device driver equates
  104. READ_DISK_CMD equ 4
  105. WRITE_DISK_CMD equ 8
  106. STAT_WRITP equ 8000H ;Write protect violation
  107. STAT_DFULL equ 8027h ;Disk full error
  108. STAT_NRDY equ 8002H ;Device not ready
  109. STAT_NOCOM equ 8003H ;Unkown command
  110. STAT_CRC equ 8004H ;CRC error
  111. STAT_SNF equ 8008H ;sector not found error
  112. STAT_SEEK equ 8006H ;Seek error
  113. STAT_WRITE equ 800AH ;Write FAULT
  114. STAT_READ equ 800BH ;Read fault
  115. STAT_GEN equ 800CH ;General failore
  116. DOS EQU 21H ;DOS request INT
  117. DOS_PCHR EQU 02H ;print character function
  118. ;Constants for compression/Decompression alg.
  119. MAX_BITS equ 12 ;Maximum bits (2048 entries)
  120. TABLESIZE equ 2048 ;Hash table size
  121. shCHUNK equ 9
  122. cbCHUNK equ (1 shl shCHUNK) ; size of a 'chunk'
  123. .errnz cbCHUNK ne 512
  124. cbLONGCOPY equ 32 ; do extra checking for string copies >= this
  125. ;Generic IOCTL return codes
  126. NO_ERROR equ 0 ;No error
  127. LETTER_BOUNDRY_ERROR equ 1 ;Letter out of bounds
  128. UNIT_USED_ERROR equ 2 ;Unit already used
  129. NO_FREE_SLOT_ERROR equ 3 ;No reserved slot available
  130. STAMP_ERROR equ 4 ;Stamp error on extended disk
  131. ;Cluster signature
  132. ;Compressed clusters has the signature:
  133. ; 44 53 00 00 - Cluster compressed real time
  134. ; 44 53 00 01 - Cluster SuperCompressed offline
  135. ; 44 53 00 02 - Cluster XCompressed real time
  136. ;
  137. ; NOTE: If you load these signature as words, they look like:
  138. ;
  139. ; low word = 5344h
  140. ; high word = 0000h or 0100h
  141. ; XCMP defines a different REAL_TIME_COMPRESSED signature so a XCMP and
  142. ; non XCMP driver can be used on the same CVF and not get confused trying
  143. ; to UpdateCompress a XCMP block (XCMP does not support UpdateCompress).
  144. SIG_SIZE equ 4 ; 4 byte signature
  145. STANDARD_COMPRESSED equ 0000h ; High word of stamp
  146. SUPER_COMPRESSED equ 0100h ; High word of stamp
  147. X_COMPRESSED equ 0200h ; High word of stamp
  148. REAL_TIME_COMPRESSED equ X_COMPRESSED ; Stamp used for real-time compress
  149. ;;
  150. ;; We always keep at least 64k of extra sqztors around so a
  151. ;; file overwrite won't expand to more sqztors that are available.
  152. ;; Of course this is a raw heuristic since these should also
  153. ;; be contingous. For more info, see dospatch.asm and
  154. ;; low_dlb.asm referenece to FUDGESTOR
  155. FUDGESTOR equ 128
  156. ; eXperimental compression code uses a lookup table to find past
  157. ; occurances of individual characters. The table is currently
  158. ; 256 rows (1 for each possible byte value) X N (tracks N occurances
  159. ; of each character).
  160. cltROWS EQU 256 ; lookup table 256 rows x
  161. cltCOLS EQU 8 ; N columns
  162. ;
  163. ; The following basic structures were moved from MDSTRUC.INC to
  164. ; eliminate the need to include MDSTRUC.INC except where necessary;
  165. ; MDSTRUC.INC is primarily disk-management structures that are of no
  166. ; interest to MRCI.
  167. ;
  168. ;*** offst_segmt -- struc allows easy access to parts of dword pointer
  169. ;
  170. offst_segmt struc
  171. offst dw 0
  172. segmt dw 0
  173. offst_segmt ends
  174. ;*** loword_hiword -- struct allows easy access to words of dword
  175. ;
  176. loword_hiword struc
  177. loword dw 0
  178. hiword dw 0
  179. loword_hiword ends