Directory Services |
The DsRoleGetPrimaryDomainInformation function retrieves state data for the computer. This data includes the state of the directory service installation and domain data.
DWORD DsRoleGetPrimaryDomainInformation( LPCWSTR lpServer, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, PBYTE* Buffer );
If this parameter refers to a Windows NT® 4.0 computer, state data can be retrieved only if the InfoLevel parameter contains DsRolePrimaryDomainInfoBasic.
Value | Meaning |
---|---|
DsRolePrimaryDomainInfoBasic | Buffer will receive a pointer to a DSROLE_PRIMARY_DOMAIN_INFO_BASIC structure. |
DsRoleUpgradeStatus | Buffer will receive a pointer to a DSROLE_UPGRADE_STATUS_INFO structure. |
DsRoleOperationState | Buffer will receive a pointer to a DSROLE_OPERATION_STATE_INFO structure. |
The caller must free this memory when it is no longer required by calling DsRoleFreeMemory.
If the function fails, the return value can be one of the following values.
Return Code | Description |
---|---|
ERROR_INVALID_PARAMETER | One or more parameters are invalid. |
ERROR_NOT_ENOUGH_MEMORY | A memory allocation failure occurred. |
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Header: Declared in Dsrole.h.
Library: Use Netapi32.lib.
DSROLE_PRIMARY_DOMAIN_INFO_BASIC, DSROLE_UPGRADE_STATUS_INFO, DSROLE_OPERATION_STATE_INFO, DsRoleFreeMemory, Directory Service Functions