prevent HANDLE_INVALID_VALUE being handled as an EmuHandle

This commit is contained in:
Luke Usher 2016-09-15 08:46:01 +01:00
parent ce3ab7e945
commit a5e350b0d1
1 changed files with 6 additions and 0 deletions

View File

@ -136,6 +136,12 @@ EmuNtObject* EmuNtObject::NtDuplicateObject(DWORD Options)
bool IsEmuHandle(HANDLE Handle)
{
// HACK: Return false for invalid handles (HANDLE INVALID VALUE)
// TODO: Find out where invalid handles are coming from!
if (Handle == (HANDLE)-1) {
return false;
}
return (uint32_t)Handle > 0x80000000;
}