Platform SDK: Access Control

ISecurityInformation2::LookupSids

The LookupSids method returns the common names corresponding to each of the elements in the specified list of SIDs.

HRESULT LookupSids(
  ULONG cSids,
  PSID *rgpSids,
  LPDATAOBJECT *pSidNames
);

Parameters

cSids
[in] The number of SID structures pointed to by rgpSids.
rgpSids
[in] Pointer to a linked list of SID structures.
pSidNames
[out] Pointer to a returned data transfer object that contains the common names of the SIDs and, optionally, the user principal name (UPN) of the SIDs, in rgpSids. The data transfer object is a SID_INFO structure.

Return Values

Returns S_OK if successful.

Returns a nonzero error code if an error occurs.

Remarks

Your implementation of LookupSids can return E_NOTIMPL if the access control editor is to determine the common names corresponding to the specified SIDs. However, if the access control editor receives any return code other than S_OK, the editor determines this information.

The client must return the common names through the data object using the following format.

// HGLOBAL containing SID_INFO_LIST returned by ISecurityInformation2::LookupSids
#define CFSTR_ACLUI_SID_INFO_LIST   TEXT("CFSTR_ACLUI_SID_INFO_LIST")

// Data structures corresponding to CFSTR_ACLUI_SID_INFO_LIST
typedef struct _SID_INFO
{
    PSID    pSid;
    PWSTR   pwzCommonName;
    PWSTR   pwzClass;       // Used for selecting icon, e.g. "User" or "Group"
    PWSTR   pwzUPN;         // Optional pointer to a user principal
                            // name
} SID_INFO, *PSID_INFO;

typedef struct _SID_INFO_LIST
{
    ULONG       cItems;
    SID_INFO    aSidInfo[ANYSIZE_ARRAY];
} SID_INFO_LIST, *PSID_INFO_LIST;

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Aclui.h.

See Also

Access Control Editor Overview, Access Control Editor Interfaces, SID_INFO, SID_INFO_LIST, SID