unmount drive on memory card disconnect

This commit is contained in:
Chris Danford
2004-03-20 22:16:57 +00:00
parent 8d435c2b4d
commit f978af080d
5 changed files with 10 additions and 1 deletions
+2
View File
@@ -99,6 +99,8 @@ void MemoryCardManager::Update( float fDelta )
if( PROFILEMAN->ProfileWasLoadedFromMemoryCard((PlayerNumber)p) )
PROFILEMAN->UnloadProfile( (PlayerNumber)p );
m_pDriver->Unmount(&m_Device[p], MEM_CARD_MOUNT_POINT[p]);
}
}
}
@@ -44,6 +44,7 @@ public:
virtual bool StorageDevicesChanged() = 0;
virtual void GetStorageDevices( vector<UsbStorageDevice>& vStorageDevicesOut ) = 0;
virtual bool MountAndTestWrite( UsbStorageDevice* pDevice, CString sMountPoint ) = 0; // return false if mount or write fails
virtual void Unmount( UsbStorageDevice* pDevice, CString sMountPoint ) = 0;
virtual void Flush( UsbStorageDevice* pDevice ) {}
virtual void ResetUsbStorage() {};
};
@@ -10,7 +10,7 @@ public:
virtual bool StorageDevicesChanged() { return false; };
virtual void GetStorageDevices( vector<UsbStorageDevice>& vStorageDevicesOut ) {};
virtual bool MountAndTestWrite( UsbStorageDevice* pDevice, CString sMountPoint ) { return false; };
virtual void Flush( UsbStorageDevice* pDevice ) {};
virtual void Unmount( UsbStorageDevice* pDevice, CString sMountPoint ) {};
};
#endif
@@ -101,6 +101,11 @@ bool MemoryCardDriver_Windows::MountAndTestWrite( UsbStorageDevice* pDevice, CSt
return true;
}
void MemoryCardDriver_Windows::Unmount( UsbStorageDevice* pDevice, CString sMountPoint )
{
}
void MemoryCardDriver_Windows::Flush( UsbStorageDevice* pDevice )
{
// Do we need anything here? I don't lose data if ejecting
@@ -12,6 +12,7 @@ public:
virtual bool StorageDevicesChanged();
virtual void GetStorageDevices( vector<UsbStorageDevice>& vStorageDevicesOut );
virtual bool MountAndTestWrite( UsbStorageDevice* pDevice, CString sMountPoint );
virtual void Unmount( UsbStorageDevice* pDevice, CString sMountPoint );
virtual void Flush( UsbStorageDevice* pDevice );
protected:
DWORD m_dwLastLogicalDrives;