IsBadReadPtr() is an attempt to actually implement some subset of correct behaviour, and it looks very wrong.
GetHandleInformation() seems to be a more correct function (and it works on Windows too: https://testbot.winehq.org/JobDetails.pl?Key=143336)
I'll update the MR to use that instead I guess
Despite the type, I'd be surprised if a QOS handle is an NT handle. And if it were, you'd want to just forward to CloseHandle() anyway.