#ifndef _NTOBAPI_H
// Objects, handles
#if (PHNT_MODE != PHNT_MODE_KERNEL)
#if (PHNT_VERSION >= PHNT_THRESHOLD)
NTSYSCALLAPI
NTSTATUS
NTAPI
NtCompareObjects(
_In_ HANDLE FirstObjectHandle,
_In_ HANDLE SecondObjectHandle
);
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCompareObjects(
_In_ HANDLE FirstObjectHandle,
_In_ HANDLE SecondObjectHandle
);
View code on GitHubDetermines whether two handles point to the same kernel object.
FirstObjectHandle - a handle to the first object.SecondObjectHandle - a handle to the second object.The handles do not need to grant any specific access. Any of the handles can be a pseudo-handle to the current thread (NtCurrentThread) or the current process (NtCurrentProcess).
STATUS_SUCCESS - the two handles point to the same underlying kernel object.STATUS_NOT_SAME_OBJECT - the handles point toward different objects.This function was introduced in Windows 10 TH1 (1507).