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.

145 lines
4.6 KiB

  1. BREAK <Internal system file table format>
  2. ;** SF.INC - System File Table
  3. ;
  4. ; AN000 version 4.00 Jan. 1988
  5. ; AN003 PTM 3680 -- make NAME offset the same as before (<=3.30)
  6. ; AN009 PTM 3839 reorder SFT for MS WINDOWS
  7. ;** System File Table SuperStructure
  8. ;
  9. ; The system file table entries are allocated in contiguous groups.
  10. ; There may be more than one such groups; the SF "superstructure"
  11. ; tracks the groups.
  12. SF STRUC
  13. SFLink DD ?
  14. SFCount DW ? ; number of entries
  15. SFTable DW ? ; beginning of array of the following
  16. SF ENDS
  17. ;** System file table entry
  18. ;
  19. ; These are the structures which are at SFTABLE in the SF structure.
  20. sf_entry STRUC
  21. sf_ref_count DW ? ; number of processes sharing entry
  22. ; if FCB then ref count
  23. sf_mode DW ? ; mode of access or high bit on if FCB
  24. sf_attr DB ? ; attribute of file
  25. sf_flags DW ? ;Bits 8-15
  26. ; Bit 15 = 1 if remote file
  27. ; = 0 if local file or device
  28. ; Bit 14 = 1 if date/time is not to be
  29. ; set from clock at CLOSE. Set by
  30. ; FILETIMES and FCB_CLOSE. Reset by
  31. ; other reseters of the dirty bit
  32. ; (WRITE)
  33. ; Bit 13 = Pipe bit (reserved)
  34. ;
  35. ; Bits 0-7 (old FCB_devid bits)
  36. ; If remote file or local file, bit
  37. ; 6=0 if dirty Device ID number, bits
  38. ; 0-5 if local file.
  39. ; bit 7=0 for local file, bit 7
  40. ; =1 for local I/O device
  41. ; If local I/O device, bit 6=0 if EOF (input)
  42. ; Bit 5=1 if Raw mode
  43. ; Bit 0=1 if console input device
  44. ; Bit 1=1 if console output device
  45. ; Bit 2=1 if null device
  46. ; Bit 3=1 if clock device
  47. sf_devptr DD ? ; Points to device header
  48. sf_time DW ? ; Time associated with file
  49. sf_date DW ? ; Date associated with file
  50. sf_size DD ? ; Size associated with file
  51. sf_position DD ? ; LRU count for FCBs
  52. ; SHARING INFO
  53. sf_chain DD ? ; link to next SF
  54. sf_PID DW ?
  55. sf_NTHandle DD ? ; NT File Handle
  56. sf_entry ENDS
  57. sf_OpenAge EQU WORD PTR sf_position+2
  58. sf_LRU EQU WORD PTR sf_position
  59. sf_default_number EQU 5h
  60. ;
  61. ; Note that we need to mark an SFT as being busy for OPEN/CREATE. This is
  62. ; because an INT 24 may prevent us from 'freeing' it. We mark this as such
  63. ; by placing a -1 in the ref_count field.
  64. ;
  65. sf_busy EQU -1
  66. ; Flag word masks
  67. sf_isfcb EQU 1000000000000000B
  68. sf_isnet EQU 1000000000000000B
  69. sf_close_nodate EQU 0100000000000000B
  70. sf_pipe EQU 0010000000000000B
  71. sf_no_inherit EQU 0001000000000000B
  72. sf_net_spool EQU 0000100000000000B
  73. sf_scs_console EQU 0000010000000000B ; special for NT DOSEM
  74. sf_nt_seek EQU 0000001000000000B ; special for NT DOSEM
  75. sf_nt_pipe_in EQU 0000000100000000B ; for stdin redirection
  76. ; true if seek is needed
  77. ; with next read/write operation
  78. devid_file_clean EQU 40h ; true if file and not written
  79. devid_file_mask_drive EQU 3Fh ; mask for drive number
  80. devid_device EQU 80h ; true if a device
  81. devid_device_EOF EQU 40h ; true if end of file reached
  82. devid_device_raw EQU 20h ; true if in raw mode
  83. devid_device_special EQU 10h ; true if special device
  84. devid_device_clock EQU 08h ; true if clock device
  85. devid_device_null EQU 04h ; true if null device
  86. devid_device_con_out EQU 02h ; true if console output
  87. devid_device_con_in EQU 01h ; true if consle input
  88. ;
  89. ; structure of devid field as returned by IOCTL is:
  90. ;
  91. ; BIT 7 6 5 4 3 2 1 0
  92. ; |---|---|---|---|---|---|---|---|
  93. ; | I | E | R | S | I | I | I | I |
  94. ; | S | O | A | P | S | S | S | S |
  95. ; | D | F | W | E | C | N | C | C |
  96. ; | E | | | C | L | U | O | I |
  97. ; | V | | | L | K | L | T | N |
  98. ; |---|---|---|---|---|---|---|---|
  99. ; ISDEV = 1 if this channel is a device
  100. ; = 0 if this channel is a disk file
  101. ;
  102. ; If ISDEV = 1
  103. ;
  104. ; EOF = 0 if End Of File on input
  105. ; RAW = 1 if this device is in Raw mode
  106. ; = 0 if this device is cooked
  107. ; ISCLK = 1 if this device is the clock device
  108. ; ISNUL = 1 if this device is the null device
  109. ; ISCOT = 1 if this device is the console output
  110. ; ISCIN = 1 if this device is the console input
  111. ;
  112. ; If ISDEV = 0
  113. ; EOF = 0 if channel has been written
  114. ; Bits 0-5 are the block device number for
  115. ; the channel (0 = A, 1 = B, ...)
  116. ;
  117. devid_ISDEV EQU 80h
  118. devid_EOF EQU 40h
  119. devid_RAW EQU 20h
  120. devid_SPECIAL EQU 10H
  121. devid_ISCLK EQU 08h
  122. devid_ISNUL EQU 04h
  123. devid_ISCOT EQU 02h
  124. devid_ISCIN EQU 01h
  125. devid_block_dev EQU 1Fh ; mask for block device number
  126.