SamCloseHandle - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTSAM_H

/**
 * The SamCloseHandle function closes a SAM client context, not a kernel handle. The client frees its
 * wrapper during teardown even if remote close fails; do not retry with the old handle.
 *
 * \param SamHandle The object handle.
 * \return NTSTATUS Successful or errant status.
 * \sa https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/55d134df-e257-48ad-8afa-cb2ca45cd3cc
 */
NTSYSAPI
NTSTATUS
NTAPI
SamCloseHandle(
    _In_ SAM_HANDLE SamHandle
    );

#endif

View code on GitHub

NtDoc

This function is a wrapper over an RPC method documented in the [MS-SAMR] specification.