cdvdgigaherz: Use null for event/thread handle init

CreateEvent and CreateThread return NULL on failure, not
INVALID_HANDLE_VALUE. This should have been done in
0477e03965, I didn't check thoroughly
enough.
This commit is contained in:
Jonathan Li 2016-08-08 22:18:36 +01:00
parent 5a75906ce7
commit 5d6f9a316a
3 changed files with 6 additions and 5 deletions

View File

@ -25,8 +25,8 @@
void (*newDiscCB)();
HANDLE hThread_keepAlive = INVALID_HANDLE_VALUE;
HANDLE hNotify_keepAlive = INVALID_HANDLE_VALUE;
HANDLE hThread_keepAlive = nullptr;
HANDLE hNotify_keepAlive = nullptr;
DWORD pidThreadKeepAlive = 0;
#define STRFY(x) #x

View File

@ -21,9 +21,9 @@ s32 prefetch_last_lba=0;
s32 prefetch_last_mode=0;
s32 prefetch_left=0;
HANDLE hNotify = INVALID_HANDLE_VALUE;
HANDLE hThread = INVALID_HANDLE_VALUE;
HANDLE hRequestComplete = INVALID_HANDLE_VALUE;
HANDLE hNotify = nullptr;
HANDLE hThread = nullptr;
HANDLE hRequestComplete = nullptr;
CRITICAL_SECTION CacheMutex;

View File

@ -295,6 +295,7 @@ s32 IOCtlSrc::Reopen()
// Dual layer DVDs cannot read from layer 1 without this ioctl
DeviceIoControl(device, FSCTL_ALLOW_EXTENDED_DASD_IO, nullptr, 0, nullptr, 0, &size, nullptr);
// FIXME: 0 is a valid session id, but the code assumes that it isn't.
sessID=0;
DeviceIoControl(device,IOCTL_DVD_START_SESSION,NULL,0,&sessID,sizeof(DVD_SESSION_ID), &size, NULL);