MDAC 2.5 SDK - Technical Articles


 

ITrusteeGroupAdmin::GetMembers

Gets the members of a membership trustee.

This function is not applicable to trustees with the TRUSTEE_TYPE element set to TRUSTEE_IS_USER, because a user cannot have members.

HRESULT GetMembers ( 
   TRUSTEE *      pMembershipTrustee,
   ULONG *        pcMembers,
   TRUSTEE **     prgMembers
);

Parameters

pMembershipTrustee

[in]
Address of the TRUSTEE structure that identifies the membership trustee whose members will be returned.

pcMembers

[out]
Address of a ULONG variable that receives the number of TRUSTEE structures in prgMembers.

prgMembers

[out]
Address of a TRUSTEE pointer variable that receives the address of an array of TRUSTEE structures representing the trustees that are members of pMembershipTrustee.

Return Code

S_OK

The members of the membership trustee were successfully retrieved.

SEC_E_PERMISSIONDENIED

Requester does not have permissions for the operation.

SEC_E_BADTRUSTEEID

pMembershipTrustee did not point to a valid TRUSTEE structure.

SEC_E_NOMEMBERSHIPSUPPORT

The trustee pointed to by pMembershipTrustee does not support memberships.

SEC_E_NOTRUSTEEID

pMembershipTrustee was not a trustee for the current data source object.

E_INVALIDARG

pMembershipTrustee, pcMembers, or prgMembers was a null pointer.

E_FAIL

A provider-specific error occurred.

Comments

The provider calls CoTaskMemAlloc to allocate memory for the array of TRUSTEE structures that represent the members of pMembershipTrustee.

The consumer releases *prgMembers when it no longer needs the TRUSTEE structures. Before freeing this memory, the consumer should free any memory allocated in the pMultipleTrustee or ptstrName elements of each structure. The consumer should call CoTaskMemFree for all these tasks.

If pMembershipTrustee does not contain any members or is not a membership trustee, the provider sets *pcMembers to zero, *prgMembers to NULL, and does not allocate any memory for *prgMembers.

See Also

ITrusteeGroupAdmin, ITrusteeGroupAdmin::GetMemberships, ITrusteeGroupAdmin::IsMember, TRUSTEE