DsListRolesW function (ntdsapi.h)
The DsListRoles function lists roles recognized by the server.
NTDSAPI DWORD DsListRolesW(
[in] HANDLE hDs,
[out] PDS_NAME_RESULTW *ppRoles
);
[in] hDs
Contains a directory service handle obtained from either the DSBind or DSBindWithCred function.
[out] ppRoles
Pointer to a variable that receives a pointer to a DS_NAME_RESULT structure containing the roles the server recognizes. The returned structure must be deallocated using DsFreeNameResult.
The indexes of the array in the DS_NAME_RESULT structure indicate what data are contained by each array element. The following constants may be used to specify the desired index for a particular piece of data.
Server owns the domain.
Server owns the infrastructure.
Server owns the PDC.
Server owns the RID.
Server owns the schema.
If the function returns a list of roles, the return value is NO_ERROR.
If the function fails, the return value can be one of the following error codes.
Individual name conversion errors are reported in the returned DS_NAME_RESULT structure.
Anteckning
The ntdsapi.h header defines DsListRoles as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | ntdsapi.h |
Library | Ntdsapi.lib |
DLL | Ntdsapi.dll |