GetInheritanceSource function

The GetInheritanceSource function returns information about the source of inherited access control entries (ACEs) in an access control list (ACL).


DWORD WINAPI GetInheritanceSource(
  _In_     LPTSTR                pObjectName,
  _In_     SE_OBJECT_TYPE        ObjectType,
  _In_     SECURITY_INFORMATION  SecurityInfo,
  _In_     BOOL                  Container,
  _In_opt_ GUID                  **pObjectClassGuids,
  _In_     DWORD                 GuidCount,
  _In_     PACL                  pAcl,
  _In_opt_ PFN_OBJECT_MGR_FUNCTS pfnArray,
  _In_     PGENERIC_MAPPING      pGenericMapping,
  _Out_    PINHERITED_FROM       pInheritArray


pObjectName [in]

A pointer to the name of the object that uses the ACL to be checked.

ObjectType [in]

The type of object indicated by pObjectName. The possible values are SE_FILE_OBJECT, SE_REGISTRY_KEY, SE_DS_OBJECT, and SE_DS_OBJECT_ALL.

SecurityInfo [in]

The type of ACL used with the object. The possible values are DACL_SECURITY_INFORMATION or SACL_SECURITY_INFORMATION.

Container [in]

TRUE if the object is a container object or FALSE if the object is a leaf object. Note that the only leaf object is SE_FILE_OBJECT.

pObjectClassGuids [in, optional]

Optional list of GUIDs that identify the object types or names associated with pObjectName. This may be NULL if the object manager only supports one object class or has no GUID associated with the object class.

GuidCount [in]

Number of GUIDs pointed to by pObjectClassGuids.

pAcl [in]

The ACL for the object.

pfnArray [in, optional]

Reserved. Set this parameter to NULL.

pGenericMapping [in]

The mapping of generic rights to specific rights for the object.

pInheritArray [out]

A pointer to an array of INHERITED_FROM structures that the GetInheritanceSource function fills with the inheritance information. The caller must allocate enough memory for an entry for each ACE in the ACL.

Return value

If the function succeeds, the function returns ERROR_SUCCESS.

If the function fails, it returns a nonzero error code defined in WinError.h.


The GetInheritanceSource function allocates memory for the names returned in the INHERITED_FROM structure. When the function has finished using this memory, the calling program must free it by calling FreeInheritedFromArray. Note that the caller must provide memory for the array itself. If the caller allocated the memory, the caller must free that memory after calling FreeInheritedFromArray.

This function does not handle race conditions. If your thread calls this function at the approximate time that another thread changes the object's security descriptor, then this function could fail.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]







Unicode and ANSI names

GetInheritanceSourceW (Unicode) and GetInheritanceSourceA (ANSI)

See also