cdvdgigaherz: Don't use GetFileSizeEx to get disk size

It doesn't seem to work for disks, and IOCTL_DISK_GET_LENGTH_INFO
usually succeeds instead.
This commit is contained in:
Jonathan Li 2016-09-20 09:08:48 +01:00
parent 9c643ae9ca
commit 9f6c6d9917
1 changed files with 1 additions and 10 deletions

View File

@ -104,19 +104,10 @@ CDROM_READ_TOC_EX tocrq = {0};
s32 IOCtlSrc::GetSectorCount() s32 IOCtlSrc::GetSectorCount()
{ {
DWORD size;
LARGE_INTEGER li;
if (discSizeCached) if (discSizeCached)
return discSize; return discSize;
if (GetFileSizeEx(device, &li)) { DWORD size;
discSizeCached = true;
discSize = (s32)(li.QuadPart / 2048);
return discSize;
}
GET_LENGTH_INFORMATION info; GET_LENGTH_INFORMATION info;
if (DeviceIoControl(device, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &info, sizeof(info), &size, NULL)) { if (DeviceIoControl(device, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &info, sizeof(info), &size, NULL)) {
discSizeCached = true; discSizeCached = true;