Source code of Windows XP (NT5)
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.

113 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1991 - 1993 Microsoft Corporation
  3. Module Name:
  4. memcard.h
  5. Abstract:
  6. Author:
  7. Neil Sandlin (neilsa) 26-Apr-99
  8. Environment:
  9. Kernel mode only.
  10. Notes:
  11. --*/
  12. #ifndef _MEMCARD_H_
  13. #define _MEMCARD_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. // There is one MEMCARD_EXTENSION attached to the device object of each
  51. // MEMCARDpy drive. Only data directly related to that drive (and the media
  52. // in it) is stored here; common data is in CONTROLLER_DATA. So the
  53. // MEMCARD_EXTENSION has a pointer to the CONTROLLER_DATA.
  54. //
  55. typedef struct _MEMCARD_EXTENSION {
  56. PDEVICE_OBJECT UnderlyingPDO;
  57. PDEVICE_OBJECT TargetObject;
  58. PDEVICE_OBJECT DeviceObject;
  59. UNICODE_STRING DeviceName;
  60. UNICODE_STRING LinkName;
  61. UNICODE_STRING InterfaceString;
  62. ULONG MediaIndex;
  63. ULONG ByteCapacity;
  64. BOOLEAN IsStarted;
  65. BOOLEAN IsRemoved;
  66. BOOLEAN IsMemoryMapped;
  67. BOOLEAN NoDrive;
  68. ULONGLONG HostBase;
  69. PCHAR MemoryWindowBase;
  70. ULONG MemoryWindowSize;
  71. ULONG TechnologyIndex;
  72. PCMCIA_INTERFACE_STANDARD PcmciaInterface;
  73. PCMCIA_BUS_INTERFACE_STANDARD PcmciaBusInterface;
  74. } MEMCARD_EXTENSION, *PMEMCARD_EXTENSION;
  75. //
  76. // macros for ReadWriteMemory
  77. //
  78. #define MEMCARD_READ(Extension, Offset, Buffer, Size) \
  79. MemCardReadWrite(Extension, Offset, Buffer, Size, FALSE)
  80. #define MEMCARD_WRITE(Extension, Offset, Buffer, Size) \
  81. MemCardReadWrite(Extension, Offset, Buffer, Size, TRUE)
  82. #endif // _MEMCARD_H_