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.

141 lines
3.5 KiB

  1. /* dosdef.h - This file duplicates few important dos defines of use to
  2. * DEM.
  3. *
  4. * As these defines are not going to change at all, its better to give
  5. * DEM a separate copy and not share h and inc files between DOSKRNL and
  6. * DEM.
  7. *
  8. * Sudeepb 05-Apr-1991 Created
  9. */
  10. #include <doswow.h>
  11. #include <curdir.h>
  12. /** DEFINES **/
  13. /** File Attributes **/
  14. #define ATTR_NORMAL 0x0
  15. #define ATTR_READ_ONLY 0x1
  16. #define ATTR_HIDDEN 0x2
  17. #define ATTR_SYSTEM 0x4
  18. #define ATTR_VOLUME_ID 0x8
  19. #define ATTR_DIRECTORY 0x10
  20. #define ATTR_ARCHIVE 0x20
  21. #define ATTR_DEVICE 0x40
  22. #define ATTR_ALL (ATTR_HIDDEN | ATTR_SYSTEM | ATTR_DIRECTORY)
  23. #define ATTR_IGNORE (ATTR_READ_ONLY | ATTR_ARCHIVE | ATTR_DEVICE)
  24. #define DOS_ATTR_MASK 0x0037 // ATTR_DEVICE isn't used on 32 bit side.
  25. // ATTR_VOL maps to FILE_ATTRIBUTES_NORMAL.
  26. /** File Modes **/
  27. #define ACCESS_MASK 0x0F
  28. #define OPEN_FOR_READ 0x00
  29. #define OPEN_FOR_WRITE 0x01
  30. #define OPEN_FOR_BOTH 0x02
  31. #define EXEC_OPEN 0x03 /* access code of 3 indicates that
  32. open was made from exec */
  33. #define SHARING_MASK 0x70
  34. #define SHARING_COMPAT 0x00
  35. #define SHARING_DENY_BOTH 0x10
  36. #define SHARING_DENY_WRITE 0x20
  37. #define SHARING_DENY_READ 0x30
  38. #define SHARING_DENY_NONE 0x40
  39. #define SHARING_NET_FCB 0x70
  40. #define SHARING_NO_INHERIT 0x80
  41. /* Volume Info **/
  42. #define DOS_VOLUME_NAME_SIZE 11
  43. #define NT_VOLUME_NAME_SIZE 255
  44. #define FILESYS_NAME_SIZE 8
  45. /* IOCTLs **/
  46. #define IOCTL_CHANGEABLE 8
  47. #define IOCTL_DeviceLocOrRem 9
  48. #define IOCTL_GET_DRIVE_MAP 0xE
  49. /** TYPEDEFS **/
  50. /** SRCHDTA defines the DTA format for FIND_FIRST/NEXT operations **/
  51. #pragma pack(1)
  52. typedef struct _SRCHDTA { /* DTA */
  53. PVOID pFFindEntry; // 21 bytes reserved area begins
  54. ULONG FFindId;
  55. BYTE bReserved[13]; // 21 bytes reserved area ends
  56. UCHAR uchFileAttr;
  57. USHORT usTimeLastWrite;
  58. USHORT usDateLastWrite;
  59. USHORT usLowSize;
  60. USHORT usHighSize;
  61. CHAR achFileName[13];
  62. } SRCHDTA;
  63. #pragma pack()
  64. typedef SRCHDTA UNALIGNED *PSRCHDTA;
  65. /** SRCHBUF - defines DOS SEARCHBUF data structure which is used in
  66. * FCBFINDFIRST/NEXT operations.
  67. */
  68. #pragma pack(1)
  69. typedef struct _DIRENT {
  70. CHAR FileName[8];
  71. CHAR FileExt[3];
  72. UCHAR uchAttributes;
  73. PVOID pFFindEntry; // DOS Reserved Area
  74. ULONG FFindId; // DOS Reserved Area
  75. USHORT usDummy; // DOS Reserved Area
  76. USHORT usTime;
  77. USHORT usDate;
  78. USHORT usReserved2; // Cluster Number in actual DOS
  79. ULONG ulFileSize;
  80. } DIRENT;
  81. #pragma pack()
  82. typedef DIRENT *PDIRENT;
  83. #pragma pack(1)
  84. typedef struct _SRCHBUF {
  85. UCHAR uchDriveNumber;
  86. CHAR FileName[8];
  87. CHAR FileExt[3];
  88. USHORT usCurBlkNumber;
  89. USHORT usRecordSize;
  90. ULONG ulFileSize;
  91. DIRENT DirEnt;
  92. } SRCHBUF;
  93. #pragma pack()
  94. typedef SRCHBUF *PSRCHBUF;
  95. /** VOLINFO - GetSetMediaID data structure */
  96. #pragma pack(1)
  97. typedef struct _VOLINFO {
  98. USHORT usInfoLevel;
  99. ULONG ulSerialNumber;
  100. CHAR VolumeID[DOS_VOLUME_NAME_SIZE];
  101. CHAR FileSystemType[FILESYS_NAME_SIZE];
  102. } VOLINFO;
  103. #pragma pack()
  104. typedef VOLINFO *PVOLINFO;
  105. /** CDS LIST - CurrDirStructure (Moved to DOSWOW.H) */