I_NetLogonControl2 function (lmaccess.h)
The I_NetLogonControl2 function controls various aspects of the Netlogon service.
Syntax
NET_API_STATUS NET_API_FUNCTION I_NetLogonControl2(
[in, optional] LPCWSTR ServerName,
[in] DWORD FunctionCode,
[in] DWORD QueryLevel,
[in] LPBYTE Data,
[out] LPBYTE *Buffer
);
Parameters
[in, optional] ServerName
The name of the remote server.
[in] FunctionCode
The operation to be performed. This value can be one of the following.
[in] QueryLevel
Indicates what information should be returned from the Netlogon service. This value can be any of the following structures.
NETLOGON_INFO_1 (1)
NETLOGON_INFO_2 (2)
NETLOGON_INFO_3 (3)
NETLOGON_INFO_4 (4)
[in] Data
Carries input data that depends on the value specified in the FunctionCode parameter. The NETLOGON_CONTROL_REDISCOVER and NETLOGON_CONTROL_TC_QUERY function codes specify the trusted domain name (the data type is LPWSTR *).
[out] Buffer
Returns a pointer to a buffer that contains the requested information in the structure passed in the QueryLevel parameter.
The buffer must be freed using NetApiBufferFree.
Return value
The method returns 0x00000000 (NERR_Success) on success; otherwise, it returns a nonzero error code defined in Lmerr.h or Winerror.h. NET_API_STATUS error codes begin with the value 0x00000834. For more information about network management error codes, see Network_Management_Error_Codes. The following table describes possible return values.
Return code/value | Description |
---|---|
|
The method call completed without errors. |
|
Access validation on the caller returns false. Access is denied. |
|
Not enough storage is available to process this command. |
|
A function code is not valid on the specified server. For example, NETLOGON_CONTROL_REPLICATE might have been passed to a primary domain controller (PDC). |
|
A parameter is incorrect. |
|
The query call level is not correct. |
|
The service has not been started. |
|
The format of the specified computer name is invalid. |
|
There are currently no logon servers available to service the logon request. |
|
Password change for an interdomain trust account was attempted on a backup domain controller (BDC). This operation is only allowed for the PDC of the domain. |
|
The specified domain either does not exist or could not be contacted. |
|
The user name could not be found. |
Remarks
This function can be used to request that a BDC ensure that its copy of the SAM database is brought up-to-date. It can also be used to determine if a BDC currently has a secure channel open to the PDC.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | lmaccess.h |
Library | Netapi32.lib |
DLL | Netapi32.dll |