From 0cdb2308ab63ab5fab290cb7f9c1f1c61e2365fa Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 24 Feb 2009 22:25:45 +0000 Subject: [PATCH] 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 --- Source/Core/DiscIO/Src/DriveBlob.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/DiscIO/Src/DriveBlob.cpp b/Source/Core/DiscIO/Src/DriveBlob.cpp index 0dfd85af00..c4dcc85faf 100644 --- a/Source/Core/DiscIO/Src/DriveBlob.cpp +++ b/Source/Core/DiscIO/Src/DriveBlob.cpp @@ -35,13 +35,16 @@ namespace DiscIO // Do a test read to make sure everything is OK, since it seems you can get // handles to empty drives. DWORD not_used; - if (!ReadFile(hDisc, 0, m_blocksize, (LPDWORD)¬_used, NULL)) + u8 *buffer = new u8[m_blocksize]; + if (!ReadFile(hDisc, buffer, m_blocksize, (LPDWORD)¬_used, NULL)) { + delete [] buffer; // OK, something is wrong. CloseHandle(hDisc); hDisc = INVALID_HANDLE_VALUE; return; } + delete [] buffer; #ifdef _LOCKDRIVE // Do we want to lock the drive? // Lock the compact disc in the CD-ROM drive to prevent accidental