/// The <c>DsGetDcName</c> function returns the name of a domain controller in a specified domain. This function accepts additional
/// domain controller selection criteria to indicate preference for a domain controller with particular characteristics.
/// </summary>
/// <param name="Flags">
/// <para>
/// Contains a set of flags that provide additional data used to process the request. This parameter can be a combination of the
/// following values.
/// </para>
/// <para>DS_AVOID_SELF</para>
/// <para>
/// When called from a domain controller, specifies that the returned domain controller name should not be the current computer. If
/// the current computer is not a domain controller, this flag is ignored. This flag can be used to obtain the name of another domain
/// controller in the domain.
/// </para>
/// <para>DS_BACKGROUND_ONLY</para>
/// <para>
/// If the <c>DS_FORCE_REDISCOVERY</c> flag is not specified, this function uses cached domain controller data. If the cached data is
/// more than 15 minutes old, the cache is refreshed by pinging the domain controller. If this flag is specified, this refresh is
/// avoided even if the cached data is expired. This flag should be used if the <c>DsGetDcName</c> function is called periodically.
/// </para>
/// <para>DS_DIRECTORY_SERVICE_PREFERRED</para>
/// <para>
/// <c>DsGetDcName</c> attempts to find a domain controller that supports directory service functions. If a domain controller that
/// supports directory services is not available, <c>DsGetDcName</c> returns the name of a non-directory service domain controller.
/// However, <c>DsGetDcName</c> only returns a non-directory service domain controller after the attempt to find a directory service
/// domain controller times out.
/// </para>
/// <para>DS_DIRECTORY_SERVICE_REQUIRED</para>
/// <para>Requires that the returned domain controller support directory services.</para>
/// <para>DS_DIRECTORY_SERVICE_6_REQUIRED</para>
/// <para>Requires that the returned domain controller be running Windows Server 2008 or later.</para>
/// <para>DS_DIRECTORY_SERVICE_8_REQUIRED</para>
/// <para>Requires that the returned domain controller be running Windows Server 2012 or later.</para>
/// <para>DS_FORCE_REDISCOVERY</para>
/// <para>
/// Forces cached domain controller data to be ignored. When the <c>DS_FORCE_REDISCOVERY</c> flag is not specified,
/// <c>DsGetDcName</c> may return cached domain controller data. If this flag is specified, <c>DsGetDcName</c> will not use cached
/// information (if any exists) but will instead perform a fresh domain controller discovery.
/// </para>
/// <para>
/// This flag should not be used under normal conditions, as using the cached domain controller information has better performance
/// characteristics and helps to ensure that the same domain controller is used consistently by all applications. This flag should be
/// used only after the application determines that the domain controller returned by <c>DsGetDcName</c> (when called without this
/// flag) is not accessible. In that case, the application should repeat the <c>DsGetDcName</c> call with this flag to ensure that
/// the unuseful cached information (if any) is ignored and a reachable domain controller is discovered.
/// </para>
/// <para>DS_GC_SERVER_REQUIRED</para>
/// <para>
/// Requires that the returned domain controller be a global catalog server for the forest of domains with this domain as the root.
/// If this flag is set and the DomainName parameter is not <see langword="null"/>, DomainName must specify a forest name. This flag cannot be
/// combined with the <c>DS_PDC_REQUIRED</c> or <c>DS_KDC_REQUIRED</c> flags.
/// </para>
/// <para>DS_GOOD_TIMESERV_PREFERRED</para>
/// <para>
/// <c>DsGetDcName</c> attempts to find a domain controller that is a reliable time server. The Windows Time Service can be
/// configured to declare one or more domain controllers as a reliable time server. For more information, see the Windows Time
/// Service documentation. This flag is intended to be used only by the Windows Time Service.
/// </para>
/// <para>DS_IP_REQUIRED</para>
/// <para>
/// This parameter indicates that the domain controller must have an IP address. In that case, <c>DsGetDcName</c> will place the
/// Internet protocol address of the domain controller in the <c>DomainControllerAddress</c> member of DomainControllerInfo.
/// </para>
/// <para>DS_IS_DNS_NAME</para>
/// <para>Specifies that the DomainName parameter is a DNS name. This flag cannot be combined with the <c>DS_IS_FLAT_NAME</c> flag.</para>
/// <para>
/// Specify either <c>DS_IS_DNS_NAME</c> or <c>DS_IS_FLAT_NAME</c>. If neither flag is specified, <c>DsGetDcName</c> may take longer
/// to find a domain controller because it may have to search for both the DNS-style and flat name.
/// </para>
/// <para>DS_IS_FLAT_NAME</para>
/// <para>Specifies that the DomainName parameter is a flat name. This flag cannot be combined with the <c>DS_IS_DNS_NAME</c> flag.</para>
/// <para>DS_KDC_REQUIRED</para>
/// <para>
/// Requires that the returned domain controller be currently running the Kerberos Key Distribution Center service. This flag cannot
/// be combined with the <c>DS_PDC_REQUIRED</c> or <c>DS_GC_SERVER_REQUIRED</c> flags.
/// </para>
/// <para>DS_ONLY_LDAP_NEEDED</para>
/// <para>
/// Specifies that the server returned is an LDAP server. The server returned is not necessarily a domain controller. No other
/// services are implied to be present at the server. The server returned does not necessarily have a writable <c>config</c>
/// container nor a writable <c>schema</c> container. The server returned may not necessarily be used to create or modify security
/// principles. This flag may be used with the <c>DS_GC_SERVER_REQUIRED</c> flag to return an LDAP server that also hosts a global
/// catalog server. The returned global catalog server is not necessarily a domain controller. No other services are implied to be
/// present at the server. If this flag is specified, the <c>DS_PDC_REQUIRED</c>, <c>DS_TIMESERV_REQUIRED</c>,
/// <c>DS_GOOD_TIMESERV_PREFERRED</c>, <c>DS_DIRECTORY_SERVICES_PREFERED</c>, <c>DS_DIRECTORY_SERVICES_REQUIRED</c>, and
/// <c>DS_KDC_REQUIRED</c> flags are ignored.
/// </para>
/// <para>DS_PDC_REQUIRED</para>
/// <para>
/// Requires that the returned domain controller be the primary domain controller for the domain. This flag cannot be combined with
/// the <c>DS_KDC_REQUIRED</c> or <c>DS_GC_SERVER_REQUIRED</c> flags.
/// </para>
/// <para>DS_RETURN_DNS_NAME</para>
/// <para>
/// Specifies that the names returned in the <c>DomainControllerName</c> and <c>DomainName</c> members of DomainControllerInfo should
/// be DNS names. If a DNS name is not available, an error is returned. This flag cannot be specified with the
/// <c>DS_RETURN_FLAT_NAME</c> flag. This flag implies the <c>DS_IP_REQUIRED</c> flag.
/// </para>
/// <para>DS_RETURN_FLAT_NAME</para>
/// <para>
/// Specifies that the names returned in the <c>DomainControllerName</c> and <c>DomainName</c> members of DomainControllerInfo should
/// be flat names. If a flat name is not available, an error is returned. This flag cannot be specified with the
/// <c>DS_RETURN_DNS_NAME</c> flag.
/// </para>
/// <para>DS_TIMESERV_REQUIRED</para>
/// <para>Requires that the returned domain controller be currently running the Windows Time Service.</para>
/// <para>DS_TRY_NEXTCLOSEST_SITE</para>
/// <para>
/// When this flag is specified, <c>DsGetDcName</c> attempts to find a domain controller in the same site as the caller. If no such
/// domain controller is found, it will find a domain controller that can provide topology information and call DsBindToISTG to
/// obtain a bind handle, then call DsQuerySitesByCost over UDP to determine the "next closest site," and finally cache the name of
/// the site found. If no domain controller is found in that site, then <c>DsGetDcName</c> falls back on the default method of
/// locating a domain controller.
/// </para>
/// <para>
/// If this flag is used in conjunction with a non-NULL value in the input parameter SiteName, then <c>ERROR_INVALID_FLAGS</c> is thrown.
/// </para>
/// <para>
/// Also, the kind of search employed with <c>DS_TRY_NEXT_CLOSEST_SITE</c> is site-specific, so this flag is ignored if it is used in
/// conjunction with <c>DS_PDC_REQUIRED</c>. Finally, <c>DS_TRY_NEXTCLOSEST_SITE</c> is ignored when used in conjunction with
/// <c>DS_RETURN_FLAT_NAME</c> because that uses NetBIOS to resolve the name, but the domain of the domain controller found won't
/// necessarily match the domain to which the client is joined.
/// </para>
/// <para>
/// <c>Note</c> This flag is Group Policy enabled. If you enable the "Next Closest Site" policy setting, Next Closest Site DC
/// Location will be turned on for the machine across all available but un-configured network adapters. If you disable the policy
/// setting, Next Closest Site DC Location will not be used by default for the machine across all available but un-configured network
/// adapters. However, if a DC Locator call is made using the <c>DS_TRY_NEXTCLOSEST_SITE</c> flag explicitly, <c>DsGetDcName</c>
/// honors the Next Closest Site behavior. If you do not configure this policy setting, Next Closest Site DC Location will be not be
/// used by default for the machine across all available but un-configured network adapters. If the <c>DS_TRY_NEXTCLOSEST_SITE</c>
/// flag is used explicitly, the Next Closest Site behavior will be used.
/// </para>
/// <para>DS_WRITABLE_REQUIRED</para>
/// <para>Requires that the returned domain controller be writable; that is, host a writable copy of the directory service.</para>
/// <para>DS_WEB_SERVICE_REQUIRED</para>
/// <para>Requires that the returned domain controller be currently running the Active Directory web service.</para>
/// </param>
/// <param name="ComputerName">
/// A string that specifies the name of the server to process this function. Typically, this parameter is
/// <see langword="null"/>, which indicates that the local computer is used.
/// </param>
/// <param name="DomainName">
/// <para>
/// A string that specifies the name of the domain or application partition to query. This name can either
/// be a DNS style name, for example, fabrikam.com, or a flat-style name, for example, Fabrikam. If a DNS style name is specified,
/// the name may be specified with or without a trailing period.
/// </para>
/// <para>
/// If the Flags parameter contains the <c>DS_GC_SERVER_REQUIRED</c> flag, DomainName must be the name of the forest. In this case,
/// <c>DsGetDcName</c> fails if DomainName specifies a name that is not the forest root.
/// </para>
/// <para>
/// If the Flags parameter contains the <c>DS_GC_SERVER_REQUIRED</c> flag and DomainName is <see langword="null"/>, <c>DsGetDcName</c> attempts
/// to find a global catalog in the forest of the computer identified by ComputerName, which is the local computer if ComputerName is <see langword="null"/>.
/// </para>
/// <para>
/// If DomainName is <see langword="null"/> and the Flags parameter does not contain the <c>DS_GC_SERVER_REQUIRED</c> flag, ComputerName is set
/// to the default domain name of the primary domain of the computer identified by ComputerName.
/// </para>
/// </param>
/// <param name="DomainGuid">
/// An optional Guid value that specifies the <c>GUID</c> of the domain queried. If DomainGuid is not <see langword="null"/> and the domain
/// specified by DomainName or ComputerName cannot be found, <c>DsGetDcName</c> attempts to locate a domain controller in the domain
/// having the GUID specified by DomainGuid.
/// </param>
/// <param name="SiteName">
/// A string that specifies the name of the site where the returned domain controller should physically
/// exist. If this parameter is <see langword="null"/>, <c>DsGetDcName</c> attempts to return a domain controller in the site closest to the
/// site of the computer specified by ComputerName. This parameter should be <see langword="null"/>, by default.
/// </param>
/// <returns>A DOMAIN_CONTROLLER_INFO structure that contains data about the domain controller selected.</returns>
/// <remarks>
/// <para>
/// The <c>DsGetDcName</c> function is sent to the Netlogon service on the remote computer specified by ComputerName. If ComputerName
/// is <see langword="null"/>, the function is processed on the local computer.
/// </para>
/// <para>
/// <c>DsGetDcName</c> does not verify that the domain controller name returned is the name of an actual domain controller or global
/// catalog. If mutual authentication is required, the caller must perform the authentication.
/// </para>
/// <para>
/// <c>DsGetDcName</c> does not require any particular access to the specified domain. By default, this function does not ensure that
/// the returned domain controller is currently available. Instead, the caller should attempt to use the returned domain controller.
/// If the domain controller is not available, the caller should call the <c>DsGetDcName</c> function again, specifying the
/// <c>DS_FORCE_REDISCOVERY</c> flag.
/// </para>
/// <para>Response Time</para>
/// <para>When using <c>DsGetDcName</c> be aware of the following timing details:</para>
/// <list type="bullet">
/// <item>
/// <term>
/// <c>DsGetDcName</c> makes network calls and can take from a few seconds up to one minute, depending on network traffic, topology,
/// DC load, and so on.
/// </term>
/// </item>
/// <item>
/// <term>It is NOT recommended to call <c>DsGetDcName</c> from a UI or other timing critical thread.</term>
/// </item>
/// <item>
/// <term>
/// The DC Locator does use optimized logic to provide the DC information as quickly as possible. It also uses cached information at
/// the site to contact the closest DC.
/// </term>
/// </item>
/// </list>
/// <para>Notes on Domain Controller Stickiness</para>
/// <para>
/// In Active Directory Domain Services, the domain controller locator function is designed so that once a client finds a preferred
/// domain controller, the client will not look for another unless that domain controller stops responding or the client is
/// restarted. This is referred to as "Domain Controller Stickiness." Because workstations typically operate for months without a
/// problem or restart, one unintended consequence of this behavior is that if a particular domain controller goes down for
/// maintenance, all of the clients that were connected to it shift their connections to another domain controller. But when the
/// domain controller comes back up, no clients ever reconnect to it because the clients do not restart very often. This can cause
/// load-balancing problems.
/// </para>
/// <para>
/// Previously, the most common solution to this problem was to deploy a script on each client machine that periodically called
/// <c>DsGetDcName</c> using the flag. This was a somewhat cumbersome solution, so Windows Server 2008 and Windows Vista introduced a
/// new mechanism that caused issues with domain controller stickiness.
/// </para>
/// <para>
/// Whenever <c>DsGetDcName</c> retrieves a domain controller name from its cache, it checks to see if this cached entry is expired,
/// and if so, discards that domain controller name and tries to rediscover a domain controller name. The life span of a cached entry
/// is controlled by the value in the following registry keys
/// <summary>The <c>DsGetDcOpen</c> function opens a new domain controller enumeration operation.</summary>
/// <param name="DnsName">
/// A string that contains the domain naming system (DNS) name of the domain to enumerate the domain
/// controllers for. This parameter cannot be <see langword="null"/>.
/// </param>
/// <param name="OptionFlags">
/// <para>
/// Contains a set of flags that modify the behavior of the function. This can be zero or a combination of one or more of the
/// following values.
/// </para>
/// <para>DS_ONLY_DO_SITE_NAME</para>
/// <para>Only site-specific domain controllers are enumerated.</para>
/// <para>DS_NOTIFY_AFTER_SITE_RECORDS</para>
/// <para>
/// The DsGetDcNext function will return the <c>ERROR_FILEMARK_DETECTED</c> value after all of the site-specific domain controllers
/// are retrieved. <c>DsGetDcNext</c> will then enumerate the second group, which contains all domain controllers in the domain,
/// including the site-specific domain controllers contained in the first group.
/// </para>
/// </param>
/// <param name="SiteName">
/// A string that contains the name of site the client is in. This parameter is optional and may be <see langword="null"/>.
/// </param>
/// <param name="DomainGuid">
/// An optional <c>GUID</c> value that contains the identifier of the domain specified by DnsName. This identifier is used to handle
/// the case of a renamed domain. If this value is specified and the domain specified in DnsName is renamed, this function attempts
/// to enumerate domain controllers in the domain that contains the specified identifier. This parameter is optional and may be <see langword="null"/>.
/// </param>
/// <param name="DnsForestName">
/// A string that contains the name of the forest that contains the DnsName domain. This value is used in
/// conjunction with DomainGuidto enumerate the domain controllers if the domain has been renamed. This parameter is optional and may
/// be <see langword="null"/>.
/// </param>
/// <param name="DcFlags">
/// <para>
/// Contains a set of flags that identify the type of domain controllers to enumerate. This can be zero or a combination of one or
/// more of the following values.
/// </para>
/// <para>DS_FORCE_REDISCOVERY</para>
/// <para>
/// Forces cached domain controller data to be ignored. When this flag is not specified, <c>DsGetDcOpen</c> obtains the domain
/// controller enumeration from cached domain controller data.
/// </para>
/// <para>DS_GC_SERVER_REQUIRED</para>
/// <para>
/// Requires that the enumerated domain controllers be global catalog servers for the forest of domains with this domain as the root.
/// This flag cannot be combined with the <c>DS_PDC_REQUIRED</c> flag.
/// </para>
/// <para>DS_KDC_REQUIRED</para>
/// <para>
/// Requires that the enumerated domain controllers currently be running the Kerberos Key Distribution Center service. This flag
/// cannot be combined with the <c>DS_PDC_REQUIRED</c> or <c>DS_GC_SERVER_REQUIRED</c> flags.
/// </para>
/// <para>DS_ONLY_LDAP_NEEDED</para>
/// <para>
/// Specifies that the enumerated servers are LDAP servers. The servers are not necessarily domain controllers. No other services are
/// implied to be present at each enumerated server. The servers do not necessarily have a writable <c>config</c> container nor a
/// writable <c>schema</c> container. The servers may not necessarily be used to create or modify security principles. This flag may
/// be used with the <c>DS_GC_SERVER_REQUIRED</c> flag to enumerate LDAP servers that also host a global catalog server. In that
/// case, the enumerated global catalog servers are not necessarily domain controllers and other services are implied to be present
/// at each server. If this flag is specified, the <c>DS_PDC_REQUIRED</c>, <c>DS_TIMESERV_REQUIRED</c>,
/// <c>DS_GOOD_TIMESERV_PREFERRED</c>, <c>DS_DIRECTORY_SERVICES_PREFERED</c>, <c>DS_DIRECTORY_SERVICES_REQUIRED</c>, and
/// <c>DS_KDC_REQUIRED</c> flags are ignored.
/// </para>
/// <para>DS_PDC_REQUIRED</para>
/// <para>
/// Requires that the enumerated domain controllers be the primary domain controllers for the domain. This flag cannot be combined
/// with the <c>DS_GC_SERVER_REQUIRED</c> flag.
/// </para>
/// </param>
/// <returns>An enumeration of domain controllers paired with the socket address data for the domain controller.</returns>
// DSGETDCAPI DWORD DsGetDcOpenA( IN LPCSTR DnsName, IN ULONG OptionFlags, IN LPCSTR SiteName, IN GUID *DomainGuid, IN LPCSTR DnsForestName, IN ULONG DcFlags, OUT PHANDLE RetGetDcContext );
/// The <c>DsMergeForestTrustInformationW</c> function merges the changes from a new forest trust data structure with an old forest trust data structure.
/// </summary>
/// <param name="DomainName">A string that specifies the trusted domain to update.</param>
/// <param name="NewForestTrustInfo">A <c>LsaForestTrustInformation</c> instance that contains the new forest trust data to be merged. The <c>Flags</c> and <c>Time</c> members of the entries are ignored.</param>
/// <param name="OldForestTrustInfo">A <c>LsaForestTrustInformation</c> instance that contains the old forest trust data to be merged. This parameter may be <see langword="null"/> if no records exist.</param>
/// <param name="MergedForestTrustInfo">A <c>LsaForestTrustInformation</c> instance with the merged forest trust data.</param>
/// <returns>Returns <c>NO_ERROR</c> if successful or a Windows error code otherwise.</returns>
/// The <c>NetServerDiskEnum</c> function retrieves a list of disk drives on a server. The function returns an array of
/// three-character strings (a drive letter, a colon, and a terminating null character).
/// </summary>
/// <param name="servername">A pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <see langword="null"/>, the local computer is used.</param>
/// <param name="bufptr">An array of strings (a drive letter followed by a colon).</param>
/// <returns>
/// <para>If the function succeeds, the return value is NERR_Success.</para>
/// <para>If the function fails, the return value can be one of the following error codes.</para>
/// <list type="table">
/// <listheader>
/// <term>Return code</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>ERROR_ACCESS_DENIED</term>
/// <term>The user does not have access to the requested information.</term>
/// </item>
/// <item>
/// <term>ERROR_INVALID_LEVEL</term>
/// <term>The value specified for the level parameter is invalid.</term>
/// </item>
/// <item>
/// <term>ERROR_MORE_DATA</term>
/// <term>More entries are available. Specify a large enough buffer to receive all entries.</term>
/// </item>
/// <item>
/// <term>ERROR_NOT_ENOUGH_MEMORY</term>
/// <term>Insufficient memory is available.</term>
/// </item>
/// <item>
/// <term>ERROR_NOT_SUPPORTED</term>
/// <term>
/// The request is not supported. This error is returned if a remote server was specified in servername parameter, the remote server
/// only supports remote RPC calls using the legacy Remote Access Protocol mechanism, and this request is not supported.
/// </term>
/// </item>
/// </list>
/// </returns>
/// <remarks>
/// <para>
/// Only members of the Administrators or Server Operators local group can successfully execute the <c>NetServerDiskEnum</c> function
/// on a remote computer.
/// </para>
/// <para>
/// If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to
/// achieve the same results you can achieve by calling the network management server functions. For more information, see the
/// The <c>NetServerTransportEnum</c> function supplies information about transport protocols that are managed by the server.
/// </summary>
/// <param name="servername">A string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <see langword="null"/>, the local computer is used.</param>
/// <param name="level"><para>Specifies the information level of the data. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>0</term>
/// <term>
/// Return information about the transport protocol, including name, address, and location on the network. The bufptr parameter
/// points to an array of SERVER_TRANSPORT_INFO_0 structures.
/// </term>
/// </item>
/// <item>
/// <term>1</term>
/// <term>
/// Return information about the transport protocol, including name, address, network location, and domain. The bufptr parameter
/// points to an array of SERVER_TRANSPORT_INFO_1 structures.
/// </term>
/// </item>
/// </list></param>
/// <param name="bufptr">Pointer to the buffer that receives the data. The format of this data depends on the value of the level parameter. This buffer is
/// allocated by the system and must be freed using the NetApiBufferFree function. Note that you must free the buffer even if the
/// function fails with ERROR_MORE_DATA.</param>
/// <param name="prefmaxlen">Specifies the preferred maximum length of returned data, in bytes. If you specify MAX_PREFERRED_LENGTH, the function allocates
/// the amount of memory required for the data. If you specify another value in this parameter, it can restrict the number of bytes
/// that the function returns. If the buffer size is insufficient to hold all entries, the function returns ERROR_MORE_DATA. For more
/// information, see Network Management Function Buffers and Network Management Function Buffer Lengths.</param>
/// <param name="entriesread">Pointer to a value that receives the count of elements actually enumerated.</param>
/// <param name="totalentries">Pointer to a value that receives the total number of entries that could have been enumerated from the current resume position.
/// Note that applications should consider this value only as a hint.</param>
/// The <c>NetGetJoinableOUs</c> function retrieves a list of organizational units (OUs) in which a computer account can be created.
/// </summary>
/// <param name="lpDomain">A string that specifies the name of the domain for which to retrieve the list of OUs that can be joined.</param>
/// <param name="lpServer">A string that specifies the DNS or NetBIOS name of the computer on which to call the function. If this
/// parameter is <see langword="null"/>, the local computer is used.</param>
/// <param name="lpAccount">A string that specifies the account name to use when connecting to the domain controller. The string must
/// specify either a domain NetBIOS name and user account (for example, "REDMOND\user") or the user principal name (UPN) of the user
/// in the form of an Internet-style login name (for example, "someone@example.com"). If this parameter is <see langword="null"/>, the caller's
/// context is used.</param>
/// <param name="lpPassword">If the lpAccount parameter specifies an account name, this parameter must point to the password to use when connecting to the
/// domain controller. Otherwise, this parameter must be <see langword="null"/>.</param>
/// <returns>The list of joinable OUs.</returns>
/// <remarks>
/// <para>No special group membership is required to successfully execute the <c>NetGetJoinableOUs</c> function.</para>
/// <para>For more information about organizational units, see Managing Users in the Active Directory documentation.</para>
/// Lists all connections made to a shared resource on the server or all connections established from a particular computer. If there
/// is more than one user using this connection, then it is possible to get more than one structure for the same connection, but with
/// a different user name.
/// </summary>
/// <param name="servername"><para>
/// A string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <see langword="null"/>, the local computer is used.
/// </para>
/// <para>This string is Unicode if <c>_WIN32_WINNT</c> or <c>FORCE_UNICODE</c> is defined.</para></param>
/// <param name="qualifier"><para>
/// A string that specifies a share name or computer name for the connections of interest. If it is a share name, then all
/// the connections made to that share name are listed. If it is a computer name (for example, it starts with two backslash
/// characters), then <c>NetConnectionEnum</c> lists all connections made from that computer to the server specified.
/// </para>
/// <para>This string is Unicode if <c>_WIN32_WINNT</c> or <c>FORCE_UNICODE</c> is defined.</para></param>
/// <param name="level"><para>Specifies the information level of the data. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>0</term>
/// <term>Return connection identifiers. The bufptr parameter is a pointer to an array of CONNECTION_INFO_0 structures.</term>
/// </item>
/// <item>
/// <term>1</term>
/// <term>
/// Return connection identifiers and connection information. The bufptr parameter is a pointer to an array of CONNECTION_INFO_1 structures.
/// </term>
/// </item>
/// </list></param>
/// <param name="bufptr"><para>
/// Pointer to the address of the buffer that receives the information. The format of this data depends on the value of the level parameter.
/// </para>
/// <para>
/// This buffer is allocated by the system and must be freed using the NetApiBufferFree function. Note that you must free the buffer
/// even if the function fails with <c>ERROR_MORE_DATA</c>.
/// </para></param>
/// <param name="prefmaxlen">Specifies the preferred maximum length of returned data, in bytes. If you specify <c>MAX_PREFERRED_LENGTH</c>, the function
/// allocates the amount of memory required for the data. If you specify another value in this parameter, it can restrict the number
/// of bytes that the function returns. If the buffer size is insufficient to hold all entries, the function returns
/// <c>ERROR_MORE_DATA</c>. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths.</param>
/// <param name="entriesread">Pointer to a value that receives the count of elements actually enumerated.</param>
/// <param name="totalentries">Pointer to a value that receives the total number of entries that could have been enumerated from the current resume position.
/// Note that applications should consider this value only as a hint.</param>
/// <param name="resume_handle">Pointer to a value that contains a resume handle which is used to continue an existing connection search. The handle should be
/// zero on the first call and left unchanged for subsequent calls. If this parameter is <see langword="null"/>, then no resume handle is stored.</param>
/// <returns>
/// <para>If the function succeeds, the return value is <c>NERR_Success</c>.</para>
/// <para>If the function fails, the return value is a system error code. For a list of error codes, see System Error Codes.</para>
/// </returns>
/// <remarks>
/// <para>
/// Administrator, Server or Print Operator, or Power User group membership is required to successfully execute the
/// <c>NetConnectionEnum</c> function.
/// </para>
/// <para>Examples</para>
/// <para>
/// The following code sample demonstrates how to list the connections made to a shared resource with a call to the
/// <c>NetConnectionEnum</c> function. The sample calls <c>NetConnectionEnum</c>, specifying information level 1 (CONNECTION_INFO_1).
/// If there are entries to return, it prints the values of the <c>coni1_username</c> and <c>coni1_netname</c> members. If there are
/// no entries to return, the sample prints an appropriate message. Finally, the code sample frees the memory allocated for the
/// <summary>Returns information about some or all open files on a server, depending on the parameters specified.</summary>
/// <typeparam name="T">The expected return type of the enumerated element.</typeparam>
/// <param name="servername"><para>
/// A string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <see langword="null"/>, the local computer is used.
/// </para>
/// <para>This string is Unicode if <c>_WIN32_WINNT</c> or <c>FORCE_UNICODE</c> is defined.</para></param>
/// <param name="basepath"><para>
/// A string that specifies a qualifier for the returned information. If this parameter is <see langword="null"/>, all open resources
/// are enumerated. If this parameter is not <see langword="null"/>, the function enumerates only resources that have the value of the basepath
/// parameter as a prefix. (A prefix is the portion of a path that comes before a backslash.)
/// </para>
/// <para>This string is Unicode if <c>_WIN32_WINNT</c> or <c>FORCE_UNICODE</c> is defined.</para></param>
/// <param name="username"><para>
/// A string that specifies the name of the user or the name of the connection. If the string begins with two backslashes
/// ("\"), then it indicates the name of the connection, for example, "\127.0.0.1" or "\ClientName". The part of the connection name
/// after the backslashes is the same as the client name in the session information structure returned by the NetSessionEnum
/// function. If the string does not begin with two backslashes, then it indicates the name of the user. If this parameter is not
/// <see langword="null"/>, its value serves as a qualifier for the enumeration. The files returned are limited to those that have user names or
/// connection names that match the qualifier. If this parameter is <see langword="null"/>, no user-name qualifier is used.
/// </para>
/// <para>
/// <c>Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP:</c> This parameter is a pointer to a string that
/// specifies the name of the user. If this parameter is not <see langword="null"/>, its value serves as a qualifier for the enumeration. The
/// files returned are limited to those that have user names matching the qualifier. If this parameter is <see langword="null"/>, no user-name
/// qualifier is used.
/// </para>
/// <para>This string is Unicode if <c>_WIN32_WINNT</c> or <c>FORCE_UNICODE</c> is defined.</para></param>
/// <param name="level"><para>Specifies the information level of the data. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>2</term>
/// <term>Return the file identification number. The return value is an array of FILE_INFO_2 structures.</term>
/// </item>
/// <item>
/// <term>3</term>
/// <term>Return information about the file. The return value is an array of FILE_INFO_3 structures.</term>
/// </item>
/// </list></param>
/// <returns>An enumeration of files. The format of this data depends on the value of the level parameter.</returns>
/// <remarks>
/// <para>Only members of the Administrators or Server Operators local group can successfully execute the <c>NetFileEnum</c> function.</para>
/// <para>You can call the NetFileGetInfo function to retrieve information about a particular opening of a server resource.</para>
/// <para>
/// If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to
/// achieve the same functionality you can achieve by calling <c>NetFileEnum</c>. For more information, see IADsResource and IADsFileServiceOperations.
/// <summary>Retrieves information about a particular opening of a server resource.</summary>
/// <typeparam name="T">The expected return type associated with the <paramref name="level"/>.</typeparam>
/// <param name="servername">A string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <see langword="null" />, the local computer is used.</param>
/// <param name="fileid">Specifies the file identifier of the open resource for which to return information. The value of this parameter must have been
/// returned in a previous enumeration call. For more information, see the following Remarks section.</param>
/// <param name="level"><para>Specifies the information level of the data. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>2</term>
/// <term>Return the file identification number. The bufptr parameter is a pointer to a FILE_INFO_2 structure.</term>
/// </item>
/// <item>
/// <term>3</term>
/// <term>
/// Return the file identification number and other information about the file. The bufptr parameter is a pointer to a FILE_INFO_3 structure.
/// </term>
/// </item>
/// </list></param>
/// <returns>The format of this structure depends on the value of the <paramref name="level" /> parameter.</returns>
/// <remarks>
/// <para>
/// Only members of the Administrators or Server Operators local group can successfully execute the <c>NetFileGetInfo</c> function.
/// </para>
/// <para>You can call the NetFileEnum function to retrieve information about multiple files open on a server.</para>
/// <para>
/// If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to
/// achieve the same functionality you can achieve by calling <c>NetFileGetInfo</c>. For more information, see IADsResource and IADsFileServiceOperations.
/// <summary>Retrieves information about a session established between a particular server and workstation.</summary>
/// <typeparam name="T">The expected return type associated with the <paramref name="level"/>.</typeparam>
/// <param name="servername">A string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <see langword="null" />, the local computer is used.</param>
/// <param name="UncClientName">A string that specifies the name of the computer session for which information is to be returned. This parameter is
/// required and cannot be <see langword="null" />. For more information, see NetSessionEnum.</param>
/// <param name="username">A string that specifies the name of the user whose session information is to be returned. This parameter is required
/// and cannot be <see langword="null" />.</param>
/// <param name="level"><para>Specifies the information level of the data. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>0</term>
/// <term>Return the name of the computer that established the session. The return value is a SESSION_INFO_0 structure.</term>
/// </item>
/// <item>
/// <term>1</term>
/// <term>
/// Return the name of the computer, name of the user, and open files, pipes, and devices on the computer. The return value is a SESSION_INFO_1 structure.
/// </term>
/// </item>
/// <item>
/// <term>2</term>
/// <term>
/// In addition to the information indicated for level 1, return the type of client and how the user established the session. The return value is a SESSION_INFO_2 structure.
/// </term>
/// </item>
/// <item>
/// <term>10</term>
/// <term>
/// Return the name of the computer; name of the user; and active and idle times for the session. The return value is a
/// SESSION_INFO_10 structure.
/// </term>
/// </item>
/// </list></param>
/// <returns>The data. The format of this data depends on the value of the level parameter.</returns>
/// <remarks>
/// <para>
/// Only members of the Administrators or Server Operators local group can successfully execute the <c>NetSessionGetInfo</c> function
/// at level 1 or level 2. No special group membership is required for level 0 or level 10 calls.
/// </para>
/// <para>
/// If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to
/// achieve the same functionality you can achieve by calling the network management session functions. For more information, see
/// IADsSession and IADsFileServiceOperations.
/// </para>
/// <para>
/// If you call this function at information level 1 or 2 on a member server or workstation, all authenticated users can view the information.
/// </para>
/// <para>Examples</para>
/// <para>
/// The following code sample demonstrates how to retrieve information about a session using a call to the <c>NetSessionGetInfo</c>
/// function. The sample calls <c>NetSessionGetInfo</c>, specifying information level 10 ( SESSION_INFO_10). If the call succeeds,
/// the code prints information about the session. Finally, the sample frees the memory allocated for the information buffer.
/// <summary>The <c>NetWkstaGetInfo</c> function returns information about the configuration of a workstation.</summary>
/// <typeparam name="T">The type of structure to get.</typeparam>
/// <param name="servername">Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <c>NULL</c>, the local computer is used.</param>
/// <param name="level"><para>Specifies the information level of the data. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>100</term>
/// <term>
/// Return information about the workstation environment, including platform-specific information, the name of the domain and the
/// local computer, and information concerning the operating system. The bufptr parameter points to a WKSTA_INFO_100 structure.
/// </term>
/// </item>
/// <item>
/// <term>101</term>
/// <term>
/// In addition to level 100 information, return the path to the LANMAN directory. The bufptr parameter points to a WKSTA_INFO_101 structure.
/// </term>
/// </item>
/// <item>
/// <term>102</term>
/// <term>
/// In addition to level 101 information, return the number of users who are logged on to the local computer. The bufptr parameter
/// points to a WKSTA_INFO_102 structure.
/// </term>
/// </item>
/// </list></param>
/// <returns>The data. The format of this data depends on the value of the level parameter.</returns>
/// <remarks>
/// <para>
/// <c>Windows Server 2003 and Windows XP:</c> If you call this function on a domain controller that is running Active Directory,
/// access is allowed or denied based on the ACL for the securable object. To enable anonymous access, the user Anonymous must be a
/// member of the "Pre-Windows 2000 compatible access" group. This is because anonymous tokens do not include the Everyone group SID
/// by default. If you call this function on a member server or workstation, all authenticated users can view the information.
/// Anonymous access is also permitted if the EveryoneIncludesAnonymous policy setting allows anonymous access. Anonymous access is
/// always permitted for level 100. If you call this function at level 101, authenticated users can view the information. Members of
/// the Administrators, and the Server, System and Print Operator local groups can view information at levels 102 and 502. For more
/// information about restricting anonymous access, see Security Requirements for the Network Management Functions. For more
/// information on ACLs, ACEs, and access tokens, see Access Control Model.
/// </para>
/// <para>
/// <c>Windows 2000:</c> If you call this function on a domain controller that is running Active Directory, access is allowed or
/// denied based on the access control list (ACL) for the securable object. The default ACL permits all authenticated users and
/// members of the " Pre-Windows 2000 compatible access" group to view the information. By default, the "Pre-Windows 2000 compatible
/// access" group includes Everyone as a member. This enables anonymous access to the information if the system allows anonymous
/// access. If you call this function on a member server or workstation, all authenticated users can view the information. Anonymous
/// access is also permitted if the RestrictAnonymous policy setting allows anonymous access.
/// </para>
/// <para>
/// To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information,see
/// The <c>NetWkstaSetInfo</c> function configures a workstation with information that remains in effect after the system has been reinitialized.
/// </summary>
/// <typeparam name="T">The type of the data to set.</typeparam>
/// <param name="servername">A pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <c>NULL</c>, the local computer is used.</param>
/// <param name="buffer">The data. The format of this data depends on the value of the level parameter.</param>
/// <param name="level"><para>The information level of the data. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>100</term>
/// <term>
/// Windows NT: Specifies information about a workstation environment, including platform-specific information, the names of the
/// domain and the local computer, and information concerning the operating system. The buffer parameter points to a WKSTA_INFO_100
/// structure. The wk100_computername and wk100_langroup fields of this structure cannot be set by calling this function. To set
/// these values, call SetComputerName/SetComputerNameEx or NetJoinDomain, respectively.
/// </term>
/// </item>
/// <item>
/// <term>101</term>
/// <term>
/// Windows NT: In addition to level 100 information, specifies the path to the LANMAN directory. The buffer parameter points to a
/// WKSTA_INFO_101 structure. The wk101_computername and wk101_langroup fields of this structure cannot be set by calling this
/// function. To set these values, call SetComputerName/SetComputerNameEx or NetJoinDomain, respectively.
/// </term>
/// </item>
/// <item>
/// <term>102</term>
/// <term>
/// Windows NT: In addition to level 101 information, specifies the number of users who are logged on to the local computer. The
/// buffer parameter points to a WKSTA_INFO_102 structure. The wk102_computername and wk102_langroup fields of this structure cannot
/// be set by calling this function. To set these values, call SetComputerName/SetComputerNameEx or NetJoinDomain, respectively.
/// </term>
/// </item>
/// <item>
/// <term>502</term>
/// <term>
/// Windows NT: The buffer parameter points to a WKSTA_INFO_502 structure that contains information about the workstation environment.
/// </term>
/// </item>
/// </list>
/// <para>Do not set levels 1010-1013, 1018, 1023, 1027, 1028, 1032, 1033, 1035, or 1041-1062.</para></param>
/// <remarks>
/// <para>Only members of the Administrators group can successfully execute the <c>NetWkstaSetInfo</c> function on a remote server.</para>
/// <para>
/// The <c>NetWkstaSetInfo</c> function calls the workstation service on the local system or a remote system. Only a limited number
/// of members of the WKSTA_INFO_502 structure can actually be changed using the <c>NetWkstaSetInfo</c> function. No errors are
/// returned if a member is set that is ignored by the workstation service. The workstation service is primarily configured using
/// settings in the registry.
/// </para>
/// <para>
/// The NetWkstaUserSetInfo function can be used instead of the <c>NetWkstaSetInfo</c> function to set configuration information on
/// the local system. The <c>NetWkstaUserSetInfo</c> function calls the Local Security Authority (LSA).
/// </para>
/// <para>
/// If the <c>NetWkstaSetInfo</c> function returns ERROR_INVALID_PARAMETER, you can use the parm_err parameter to indicate the first
/// member of the workstation information structure that is invalid. (A workstation information structure begins with WKSTA_INFO_ and
/// its format is specified by the level parameter.) The following table lists the values that can be returned in the parm_err
/// parameter and the corresponding structure member that is in error. (The prefix wki*_ indicates that the member can begin with
/// multiple prefixes, for example, wki100_ or wki402_.)
/// </para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Member</term>
/// </listheader>
/// <item>
/// <term>WKSTA_PLATFORM_ID_PARMNUM</term>
/// <term>wki*_platform_id</term>
/// </item>
/// <item>
/// <term>WKSTA_COMPUTERNAME_PARMNUM</term>
/// <term>wki*_computername</term>
/// </item>
/// <item>
/// <term>WKSTA_LANGROUP_PARMNUM</term>
/// <term>wki*_langroup</term>
/// </item>
/// <item>
/// <term>WKSTA_VER_MAJOR_PARMNUM</term>
/// <term>wki*_ver_major</term>
/// </item>
/// <item>
/// <term>WKSTA_VER_MINOR_PARMNUM</term>
/// <term>wki*_ver_minor</term>
/// </item>
/// <item>
/// <term>WKSTA_LOGGED_ON_USERS_PARMNUM</term>
/// <term>wki*_logged_on_users</term>
/// </item>
/// <item>
/// <term>WKSTA_LANROOT_PARMNUM</term>
/// <term>wki*_lanroot</term>
/// </item>
/// <item>
/// <term>WKSTA_LOGON_DOMAIN_PARMNUM</term>
/// <term>wki*_logon_domain</term>
/// </item>
/// <item>
/// <term>WKSTA_LOGON_SERVER_PARMNUM</term>
/// <term>wki*_logon_server</term>
/// </item>
/// <item>
/// <term>WKSTA_CHARWAIT_PARMNUM</term>
/// <term>wki*_char_wait</term>
/// </item>
/// <item>
/// <term>WKSTA_CHARTIME_PARMNUM</term>
/// <term>wki*_collection_time</term>
/// </item>
/// <item>
/// <term>WKSTA_CHARCOUNT_PARMNUM</term>
/// <term>wki*_maximum_collection_count</term>
/// </item>
/// <item>
/// <term>WKSTA_KEEPCONN_PARMNUM</term>
/// <term>wki*_keep_conn</term>
/// </item>
/// <item>
/// <term>WKSTA_KEEPSEARCH_PARMNUM</term>
/// <term>wki*_keep_search</term>
/// </item>
/// <item>
/// <term>WKSTA_MAXCMDS_PARMNUM</term>
/// <term>wki*_max_cmds</term>
/// </item>
/// <item>
/// <term>WKSTA_NUMWORKBUF_PARMNUM</term>
/// <term>wki*_num_work_buf</term>
/// </item>
/// <item>
/// <term>WKSTA_MAXWRKCACHE_PARMNUM</term>
/// <term>wki*_max_wrk_cache</term>
/// </item>
/// <item>
/// <term>WKSTA_SESSTIMEOUT_PARMNUM</term>
/// <term>wki*_sess_timeout</term>
/// </item>
/// <item>
/// <term>WKSTA_SIZERROR_PARMNUM</term>
/// <term>wki*_siz_error</term>
/// </item>
/// <item>
/// <term>WKSTA_NUMALERTS_PARMNUM</term>
/// <term>wki*_num_alerts</term>
/// </item>
/// <item>
/// <term>WKSTA_NUMSERVICES_PARMNUM</term>
/// <term>wki*_num_services</term>
/// </item>
/// <item>
/// <term>WKSTA_ERRLOGSZ_PARMNUM</term>
/// <term>wki*_errlog_sz</term>
/// </item>
/// <item>
/// <term>WKSTA_PRINTBUFTIME_PARMNUM</term>
/// <term>wki*_print_buf_time</term>
/// </item>
/// <item>
/// <term>WKSTA_NUMCHARBUF_PARMNU</term>
/// <term>wki*_num_char_buf</term>
/// </item>
/// <item>
/// <term>WKSTA_SIZCHARBUF_PARMNUM</term>
/// <term>wki*_siz_char_buf</term>
/// </item>
/// <item>
/// <term>WKSTA_WRKHEURISTICS_PARMNUM</term>
/// <term>wki*_wrk_heuristics</term>
/// </item>
/// <item>
/// <term>WKSTA_MAILSLOTS_PARMNUM</term>
/// <term>wki*_mailslots</term>
/// </item>
/// <item>
/// <term>WKSTA_MAXTHREADS_PARMNUM</term>
/// <term>wki*_max_threads</term>
/// </item>
/// <item>
/// <term>WKSTA_SIZWORKBUF_PARMNUM</term>
/// <term>wki*_siz_work_buf</term>
/// </item>
/// <item>
/// <term>WKSTA_NUMDGRAMBUF_PARMNUM</term>
/// <term>wki*_num_dgram_buf</term>
/// </item>
/// </list>
/// <para>
/// The workstation service parameter settings are stored in the registry, not in the LanMan.ini file used prveiously by LAN Manager.
/// The <c>NetWkstaSetInfo</c> function does not change the values in the LanMan.ini file. When the workstation service is stopped
/// and restarted, workstation parameters are reset to the default values specified in the registry (unless they are overwritten by
/// command-line parameters). Values set by previous calls to <c>NetWkstaSetInfo</c> can be overwritten when workstation parameters
/// are reset.
/// </para>
/// <para>Examples</para>
/// <para>
/// The following code sample demonstrates how to set the session time-out value associated with a workstation using a call to the
/// <c>NetServerSetInfo</c> function. (The session time-out is the number of seconds the server waits before disconnecting an
/// inactive session.) The code specifies information level 502 (WKSTA_INFO_502).
/// The <c>NetWkstaUserEnum</c> function lists information about all users currently logged on to the workstation. This list includes
/// interactive, service and batch logons.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="servername">Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this
/// parameter is <c>NULL</c>, the local computer is used.</param>
/// <param name="level"><para>Specifies the information level of the data. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>0</term>
/// <term>
/// Return the names of users currently logged on to the workstation. The bufptr parameter points to an array of WKSTA_USER_INFO_0 structures.
/// </term>
/// </item>
/// <item>
/// <term>1</term>
/// <term>
/// Return the names of the current users and the domains accessed by the workstation. The bufptr parameter points to an array of
/// WKSTA_USER_INFO_1 structures.
/// </term>
/// </item>
/// </list></param>
/// <returns>The data enumeration. The format of this data depends on the value of the level parameter.</returns>
/// <remarks>
/// <para>
/// Note that since the <c>NetWkstaUserEnum</c> function lists entries for service and batch logons, as well as for interactive
/// logons, the function can return entries for users who have logged off a workstation. This can occur, for example, when a user
/// calls a service that impersonates the user. In this instance, <c>NetWkstaUserEnum</c> returns an entry for the user until the
/// service stops impersonating the user.
/// </para>
/// <para>
/// <c>Windows Server 2003 and Windows XP:</c> If you call this function on a domain controller that is running Active Directory,
/// access is allowed or denied based on the ACL for the securable object. To enable anonymous access, the user Anonymous must be a
/// member of the "Pre-Windows 2000 compatible access" group. This is because anonymous tokens do not include the Everyone group SID
/// by default. If you call this function on a member server or workstation, all authenticated users can view the information.
/// Anonymous access is also permitted if the RestrictAnonymous policy setting permits anonymous access. If the RestrictAnonymous
/// policy setting does not permit anonymous access, only an administrator can successfully execute the function. Members of the
/// Administrators, and the Server, System and Print Operator local groups can also view information. For more information about
/// restricting anonymous access, see Security Requirements for the Network Management Functions. For more information on ACLs, ACEs,
/// and access tokens, see Access Control Model.
/// </para>
/// <para>
/// <c>Windows 2000:</c> If you call this function on a domain controller that is running Active Directory, access is allowed or
/// denied based on the access control list (ACL) for the securable object. The default ACL permits all authenticated users and
/// members of the " Pre-Windows 2000 compatible access" group to view the information. By default, the "Pre-Windows 2000 compatible
/// access" group includes Everyone as a member. This enables anonymous access to the information if the system allows anonymous
/// access. If you call this function on a member server or workstation, all authenticated users can view the information. Anonymous
/// access is also permitted if the RestrictAnonymous policy setting allows anonymous access.
/// </para>
/// <para>
/// To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information,see