#ifndef _NTSAM_H
/**
* The SamEnumerateDomainsInSamServer method obtains a listing of all domains hosted by the server side of this protocol.
*
* \param ServerHandle A handle representing a server.
* \param EnumerationContext An opaque value that the server can use to continue an enumeration on a subsequent call.
* \param Buffer A listing of domain information.
* \param PreferedMaximumLength The requested maximum number of bytes to return in Buffer.
* \param CountReturned The count of domain elements returned in Buffer.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/2142fd2d-0854-42c1-a9fb-2fe964e381ce
*/
NTSYSAPI
NTSTATUS
NTAPI
SamEnumerateDomainsInSamServer(
_In_ SAM_HANDLE ServerHandle,
_Inout_ PSAM_ENUMERATE_HANDLE EnumerationContext,
_Outptr_ PVOID *Buffer, // PSAM_SID_ENUMERATION *Buffer
_In_ ULONG PreferedMaximumLength,
_Out_ PULONG CountReturned
);
View code on GitHubThis function is a wrapper over an RPC method documented in the [MS-SAMR] specification.