#ifndef _NTSAM_H
//
// Functions
//
/**
* The SamConnect method returns a handle to a server.
*
* \param ServerName The NETBIOS name of the server; this parameter MAY be ignored on receipt.
* \param ServerHandle A handle representing a server.
* \param DesiredAccess The access requested for ServerHandle upon output.
* \param ObjectAttributes The OBJECT_ATTRIBUTES structure that specifies the properties of the server handle to be opened.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/47492d59-e095-4398-b03e-8a062b989123
*/
NTSYSAPI
NTSTATUS
NTAPI
SamConnect(
_In_opt_ PCUNICODE_STRING ServerName,
_Out_ PSAM_HANDLE ServerHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ PCOBJECT_ATTRIBUTES ObjectAttributes
);
View code on GitHubThis function is a wrapper over an RPC method documented in the [MS-SAMR] specification.