add memcard blacklist by OsMountDir and UI to disable specific drives

This commit is contained in:
Chris Danford
2005-11-27 01:50:10 +00:00
parent 4408439fa5
commit 299e1f7d68
6 changed files with 45 additions and 46 deletions
@@ -19,7 +19,7 @@ MemoryCardDriverThreaded_Windows::~MemoryCardDriverThreaded_Windows()
{
}
static bool TestReady( const CString &sDrive )
static bool TestReady( const CString &sDrive, CString &sVolumeLabelOut )
{
TCHAR szVolumeNameBuffer[MAX_PATH];
DWORD dwVolumeSerialNumber;
@@ -27,7 +27,7 @@ static bool TestReady( const CString &sDrive )
DWORD lpFileSystemFlags;
TCHAR szFileSystemNameBuffer[MAX_PATH];
return !!GetVolumeInformation(
bool bRet = !!GetVolumeInformation(
sDrive,
szVolumeNameBuffer,
sizeof(szVolumeNameBuffer),
@@ -36,6 +36,8 @@ static bool TestReady( const CString &sDrive )
&lpFileSystemFlags,
szFileSystemNameBuffer,
sizeof(szFileSystemNameBuffer) );
sVolumeLabelOut = szVolumeNameBuffer;
return bRet;
}
static bool TestWrite( const CString &sDrive )
@@ -87,11 +89,13 @@ bool MemoryCardDriverThreaded_Windows::DoOneUpdate( bool bMount, vector<UsbStora
if( GetDriveType(sDrive) != DRIVE_REMOVABLE ) // is a removable drive
continue;
if( !TestReady(sDrive) )
CString sVolumeLabel;
if( !TestReady(sDrive, sVolumeLabel) )
continue;
UsbStorageDevice usbd;
usbd.SetOsMountDir( sDrive );
usbd.sVolumeLabel = sVolumeLabel;
if( TestWrite(sDrive) )
usbd.m_State = UsbStorageDevice::STATE_READY;
else