Platform SDK: Active Directory, ADSI, and Directory Services

DsRoleGetPrimaryDomainInformation

The DsRoleGetPrimaryDomainInformation function retrieves state information of the computer. This information includes the state of the directory service installation and domain information.

DWORD DsRoleGetPrimaryDomainInformation(
  LPCWSTR lpServer,
  DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
  PBYTE *Buffer 
);
 

Parameters

lpServer
[in] Pointer to the name of the computer on which to call the function. If this parameter is NULL, the local computer is used.

If this parameter refers to a Windows NTŪ 4.0 computer, you can retrieve valid information only if the InfoLevel parameter is DsRolePrimaryDomainInfoBasic.

InfoLevel
[in] Specifies the information level of the data. This parameter can be one of the following values.
Value Meaning
DsRolePrimaryDomainInfoBasic The Buffer parameter is a pointer to a DSROLE_PRIMARY_DOMAIN_INFO_BASIC structure.
DsRoleUpgradeStatus The Buffer parameter is a pointer to a DSROLE_UPGRADE_STATUS_INFO structure.

Buffer
[out] Pointer to the address of the buffer that receives the information. The format of this data depends on the value of the InfoLevel parameter. You must free this buffer using the DsRoleFreeMemory function.

Return Values

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value can be one of the following error codes.

ERROR_INVALID_PARAMETER
A parameter is incorrect.
ERROR_NOT_ENOUGH_MEMORY
Not enough storage is available to process this command.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Dsrole.h.
  Library: Included as a resource in Netapi32.dll.

See Also

Directory Service Functions, DsRoleFreeMemory, DSROLE_PRIMARY_DOMAIN_INFO_BASIC, DSROLE_UPGRADE_STATUS_INFO