-BOOLEAN FatGetFatEntry(ULONG Cluster, ULONG* ClusterPointer);
-ULONG FatCountClustersInChain(ULONG StartCluster);
-ULONG* FatGetClusterChainArray(ULONG StartCluster);
-BOOLEAN FatReadCluster(ULONG ClusterNumber, PVOID Buffer);
-BOOLEAN FatReadClusterChain(ULONG StartClusterNumber, ULONG NumberOfClusters, PVOID Buffer);
-BOOLEAN FatReadPartialCluster(ULONG ClusterNumber, ULONG StartingOffset, ULONG Length, PVOID Buffer);
-BOOLEAN FatReadFile(PFAT_FILE_INFO FatFileInfo, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer);
-BOOLEAN FatReadVolumeSectors(ULONG DriveNumber, ULONG SectorNumber, ULONG SectorCount, PVOID Buffer);
-
-ULONG BytesPerSector; /* Number of bytes per sector */
-ULONG SectorsPerCluster; /* Number of sectors per cluster */
-ULONG FatVolumeStartSector; /* Absolute starting sector of the partition */
-ULONG FatSectorStart; /* Starting sector of 1st FAT table */
-ULONG ActiveFatSectorStart; /* Starting sector of active FAT table */
-ULONG NumberOfFats; /* Number of FAT tables */
-ULONG SectorsPerFat; /* Sectors per FAT table */
-ULONG RootDirSectorStart; /* Starting sector of the root directory (non-fat32) */
-ULONG RootDirSectors; /* Number of sectors of the root directory (non-fat32) */
-ULONG RootDirStartCluster; /* Starting cluster number of the root directory (fat32 only) */
-ULONG DataSectorStart; /* Starting sector of the data area */
-
-ULONG FatType = 0; /* FAT12, FAT16, FAT32, FATX16 or FATX32 */
-ULONG FatDriveNumber = 0;
+BOOLEAN FatGetFatEntry(PFAT_VOLUME_INFO Volume, ULONG Cluster, ULONG* ClusterPointer);
+ULONG FatCountClustersInChain(PFAT_VOLUME_INFO Volume, ULONG StartCluster);
+ULONG* FatGetClusterChainArray(PFAT_VOLUME_INFO Volume, ULONG StartCluster);
+BOOLEAN FatReadClusterChain(PFAT_VOLUME_INFO Volume, ULONG StartClusterNumber, ULONG NumberOfClusters, PVOID Buffer);
+BOOLEAN FatReadPartialCluster(PFAT_VOLUME_INFO Volume, ULONG ClusterNumber, ULONG StartingOffset, ULONG Length, PVOID Buffer);
+BOOLEAN FatReadVolumeSectors(PFAT_VOLUME_INFO Volume, ULONG SectorNumber, ULONG SectorCount, PVOID Buffer);
+
+typedef struct _FAT_VOLUME_INFO
+{
+ ULONG BytesPerSector; /* Number of bytes per sector */
+ ULONG SectorsPerCluster; /* Number of sectors per cluster */
+ ULONG FatSectorStart; /* Starting sector of 1st FAT table */
+ ULONG ActiveFatSectorStart; /* Starting sector of active FAT table */
+ ULONG NumberOfFats; /* Number of FAT tables */
+ ULONG SectorsPerFat; /* Sectors per FAT table */
+ ULONG RootDirSectorStart; /* Starting sector of the root directory (non-fat32) */
+ ULONG RootDirSectors; /* Number of sectors of the root directory (non-fat32) */
+ ULONG RootDirStartCluster; /* Starting cluster number of the root directory (fat32 only) */
+ ULONG DataSectorStart; /* Starting sector of the data area */
+ ULONG FatType; /* FAT12, FAT16, FAT32, FATX16 or FATX32 */
+ ULONG DeviceId;
+} FAT_VOLUME_INFO;
+
+PFAT_VOLUME_INFO FatVolumes[MAX_FDS];