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.

164 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 1991 - 1993 Microsoft Corporation
  3. Module Name:
  4. sffdisk.h
  5. Abstract:
  6. Author:
  7. Neil Sandlin (neilsa) 26-Apr-99
  8. Environment:
  9. Kernel mode only.
  10. Notes:
  11. --*/
  12. #ifndef _SFFDISK_H_
  13. #define _SFFDISK_H_
  14. #ifdef POOL_TAGGING
  15. #ifdef ExAllocatePool
  16. #undef ExAllocatePool
  17. #endif
  18. #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,'cmeM')
  19. #endif
  20. //
  21. // The byte in the boot sector that specifies the type of media, and
  22. // the values that it can assume. We can often tell what type of media
  23. // is in the drive by seeing which controller parameters allow us to read
  24. // the diskette, but some different densities are readable with the same
  25. // parameters so we use this byte to decide the media type.
  26. //
  27. #pragma pack(1)
  28. typedef struct _BOOT_SECTOR_INFO {
  29. UCHAR JumpByte;
  30. UCHAR Ignore1[2];
  31. UCHAR OemData[8];
  32. USHORT BytesPerSector;
  33. UCHAR SectorsPerCluster;
  34. USHORT ReservedSectors;
  35. UCHAR NumberOfFATs;
  36. USHORT RootEntries;
  37. USHORT TotalSectors;
  38. UCHAR MediaDescriptor;
  39. USHORT SectorsPerFAT;
  40. USHORT SectorsPerTrack;
  41. USHORT Heads;
  42. ULONG BigHiddenSectors;
  43. ULONG BigTotalSectors;
  44. } BOOT_SECTOR_INFO, *PBOOT_SECTOR_INFO;
  45. #pragma pack()
  46. //
  47. // Runtime device structures
  48. //
  49. //
  50. struct _SFFDISK_EXTENSION;
  51. //
  52. // function block to support different technologies
  53. //
  54. typedef struct _SFFDISK_FUNCTION_BLOCK {
  55. NTSTATUS
  56. (*Initialize)(
  57. IN struct _SFFDISK_EXTENSION *sffdiskExtension
  58. );
  59. NTSTATUS
  60. (*DeleteDevice)(
  61. IN struct _SFFDISK_EXTENSION *sffdiskExtension
  62. );
  63. NTSTATUS
  64. (*GetDiskParameters)(
  65. IN struct _SFFDISK_EXTENSION *sffdiskExtension
  66. );
  67. BOOLEAN
  68. (*IsWriteProtected)(
  69. IN struct _SFFDISK_EXTENSION *sffdiskExtension
  70. );
  71. NTSTATUS
  72. (*ReadProc)(
  73. IN struct _SFFDISK_EXTENSION *sffdiskExtension,
  74. IN PIRP Irp
  75. );
  76. NTSTATUS
  77. (*WriteProc)(
  78. IN struct _SFFDISK_EXTENSION *sffdiskExtension,
  79. IN PIRP Irp
  80. );
  81. } SFFDISK_FUNCTION_BLOCK, *PSFFDISK_FUNCTION_BLOCK;
  82. //
  83. // There is one SFFDISK_EXTENSION attached to the device object of each
  84. // SFFDISKpy drive. Only data directly related to that drive (and the media
  85. // in it) is stored here; common data is in CONTROLLER_DATA. So the
  86. // SFFDISK_EXTENSION has a pointer to the CONTROLLER_DATA.
  87. //
  88. typedef struct _SFFDISK_EXTENSION {
  89. PDEVICE_OBJECT UnderlyingPDO;
  90. PDEVICE_OBJECT TargetObject;
  91. PDEVICE_OBJECT DeviceObject;
  92. PSFFDISK_FUNCTION_BLOCK FunctionBlock;
  93. UNICODE_STRING DeviceName;
  94. // UNICODE_STRING LinkName;
  95. UNICODE_STRING InterfaceString;
  96. ULONGLONG ByteCapacity;
  97. ULONGLONG Cylinders;
  98. ULONG TracksPerCylinder;
  99. ULONG SectorsPerTrack;
  100. ULONG BytesPerSector;
  101. BOOLEAN IsStarted;
  102. BOOLEAN IsRemoved;
  103. BOOLEAN IsMemoryMapped;
  104. BOOLEAN NoDrive;
  105. ULONGLONG RelativeOffset;
  106. UCHAR SystemId;
  107. //
  108. // Type of bus we are on
  109. //
  110. INTERFACE_TYPE InterfaceType;
  111. //
  112. // PcCard specific
  113. //
  114. ULONGLONG HostBase;
  115. PCHAR MemoryWindowBase;
  116. ULONG MemoryWindowSize;
  117. PCMCIA_INTERFACE_STANDARD PcmciaInterface;
  118. BUS_INTERFACE_STANDARD PcmciaBusInterface;
  119. //
  120. // SdCard specific
  121. //
  122. PVOID SdbusInterfaceContext;
  123. } SFFDISK_EXTENSION, *PSFFDISK_EXTENSION;
  124. #endif // _SFFDISK_H_