mirror of https://github.com/PCSX2/pcsx2.git
cdvdgigaherz: Fix CreateEvent/CreateThread return value checks
CreateEvent and CreateThread return NULL on failure, not INVALID_HANDLE_VALUE. Spotted using Visual Studio Code Analysis Tools (Warning C6387)
This commit is contained in:
parent
a8286e7458
commit
0477e03965
|
@ -172,13 +172,13 @@ DWORD CALLBACK keepAliveThread(PVOID param)
|
|||
|
||||
s32 StartKeepAliveThread()
|
||||
{
|
||||
hNotify_keepAlive = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
if (hNotify_keepAlive == INVALID_HANDLE_VALUE)
|
||||
return -1;
|
||||
hNotify_keepAlive = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
if (hNotify_keepAlive == nullptr)
|
||||
return -1;
|
||||
|
||||
cdvdKeepAlive_is_open = true;
|
||||
hThread_keepAlive = CreateThread(NULL, 0, keepAliveThread, NULL, 0, &pidThreadKeepAlive);
|
||||
if (hThread_keepAlive == INVALID_HANDLE_VALUE) {
|
||||
if (hThread_keepAlive == nullptr) {
|
||||
cdvdKeepAlive_is_open = false;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -257,17 +257,17 @@ s32 cdvdStartThread()
|
|||
InitializeCriticalSection( &CacheMutex );
|
||||
|
||||
hNotify = CreateEvent(NULL,FALSE,FALSE,NULL);
|
||||
if(hNotify==INVALID_HANDLE_VALUE)
|
||||
if(hNotify == nullptr)
|
||||
return -1;
|
||||
|
||||
hRequestComplete = CreateEvent(NULL,FALSE,FALSE,NULL);
|
||||
if(hRequestComplete==INVALID_HANDLE_VALUE)
|
||||
if(hRequestComplete == nullptr)
|
||||
return -1;
|
||||
|
||||
cdvd_is_open=true;
|
||||
hThread = CreateThread(NULL,0,cdvdThread,NULL,0,&pidThread);
|
||||
|
||||
if(hThread==INVALID_HANDLE_VALUE)
|
||||
if(hThread == nullptr)
|
||||
return -1;
|
||||
|
||||
SetThreadPriority(hThread,THREAD_PRIORITY_NORMAL);
|
||||
|
|
Loading…
Reference in New Issue