Fix OpenProcessToken pseudo-handle regression

This commit is contained in:
2025-10-05 18:16:15 -06:00
parent 0d76e541c1
commit ff04eb9f41
6 changed files with 31 additions and 25 deletions

View File

@@ -166,6 +166,16 @@ struct HeapObject : public ObjectBase {
inline constexpr uintptr_t kPseudoCurrentProcessHandleValue = static_cast<uintptr_t>(-1);
inline constexpr uintptr_t kPseudoCurrentThreadHandleValue = static_cast<uintptr_t>(-2);
inline bool isPseudoCurrentProcessHandle(HANDLE h) {
uintptr_t rawHandle = reinterpret_cast<uintptr_t>(h);
return rawHandle == kPseudoCurrentProcessHandleValue;
}
inline bool isPseudoCurrentThreadHandle(HANDLE h) {
uintptr_t rawHandle = reinterpret_cast<uintptr_t>(h);
return rawHandle == kPseudoCurrentThreadHandleValue;
}
void tryMarkExecutable(void *mem);
void setLastErrorFromErrno();