NtCompareObjects - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#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
    );

#endif
#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCompareObjects(
    _In_ HANDLE FirstObjectHandle,
    _In_ HANDLE SecondObjectHandle
    );

#endif

View code on GitHub

Determines whether two handles point to the same kernel object.

Parameters

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).

Notable return values

Related Win32 API

Required OS version

This function was introduced in Windows 10 TH1 (1507).

See also