NtQueryMutant - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)

/**
 * The NtQueryMutant routine retrieves information about a mutant object.
 *
 * @param MutantHandle A handle to the mutant object.
 * @param MutantInformationClass The type of information to be retrieved.
 * @param MutantInformation A pointer to a buffer that receives the requested information.
 * @param MutantInformationLength The size of the buffer pointed to by MutantInformation.
 * @param ReturnLength A pointer to a variable that receives the size of the data returned in the buffer.
 * @return NTSTATUS Successful or errant status.
 */
NTSYSCALLAPI
NTSTATUS
NTAPI
NtQueryMutant(
    _In_ HANDLE MutantHandle,
    _In_ MUTANT_INFORMATION_CLASS MutantInformationClass,
    _Out_writes_bytes_(MutantInformationLength) PVOID MutantInformation,
    _In_ ULONG MutantInformationLength,
    _Out_opt_ PULONG ReturnLength
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQueryMutant(
    _In_ HANDLE MutantHandle,
    _In_ MUTANT_INFORMATION_CLASS MutantInformationClass,
    _Out_writes_bytes_(MutantInformationLength) PVOID MutantInformation,
    _In_ ULONG MutantInformationLength,
    _Out_opt_ PULONG ReturnLength
    );

#endif

View code on GitHub

MutantHandle

Handle to Mutant object.

MutantInformationClass

Is defined as enum:

typedef enum _MUTANT_INFORMATION_CLASS
{
    MutantBasicInformation

} MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;

MutantInformation

Buffer for result. As long as only one information type is defined, set MutantInformation as a pointer to MUTANT_BASIC_INFORMATION structure.

MutantInformationLength

Size of buffer.

ResultLength

Number of bytes written to buffer.

Documented by

See also