Oops, looks like I broke raw disc reading under Win32 with a bad call to ReadFile. Now works again.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2428 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-02-24 22:25:45 +00:00
parent a65517af16
commit 0cdb2308ab
1 changed files with 4 additions and 1 deletions

View File

@ -35,13 +35,16 @@ namespace DiscIO
// Do a test read to make sure everything is OK, since it seems you can get // Do a test read to make sure everything is OK, since it seems you can get
// handles to empty drives. // handles to empty drives.
DWORD not_used; DWORD not_used;
if (!ReadFile(hDisc, 0, m_blocksize, (LPDWORD)&not_used, NULL)) u8 *buffer = new u8[m_blocksize];
if (!ReadFile(hDisc, buffer, m_blocksize, (LPDWORD)&not_used, NULL))
{ {
delete [] buffer;
// OK, something is wrong. // OK, something is wrong.
CloseHandle(hDisc); CloseHandle(hDisc);
hDisc = INVALID_HANDLE_VALUE; hDisc = INVALID_HANDLE_VALUE;
return; return;
} }
delete [] buffer;
#ifdef _LOCKDRIVE // Do we want to lock the drive? #ifdef _LOCKDRIVE // Do we want to lock the drive?
// Lock the compact disc in the CD-ROM drive to prevent accidental // Lock the compact disc in the CD-ROM drive to prevent accidental