很有兴趣地问问这个函数:SetEntriesInAclThe SetEntriesInAcl function creates a new access control list (ACL) by merging new access-control or audit-control information into an existing ACL. DWORD SetEntriesInAcl( ULONG cCountOfExplicitEntries, PEXPLICIT_ACCESS pListOfExplicitEntries, PACL OldAcl, PACL* NewAcl );Parameters cCountOfExplicitEntries [in] Specifies the number of EXPLICIT_ACCESS structures in the pListOfExplicitEntries array. pListOfExplicitEntries [in] Pointer to an array of EXPLICIT_ACCESS structures that describe the access control information to merge into the existing ACL. OldAcl [in] Pointer to the existing ACL. This parameter can be NULL, in which case, the function creates a new ACL based on the EXPLICIT_ACCESS entries. NewAcl [out] Pointer to a variable that receives a pointer to the new ACL. If the function succeeds, you must call the LocalFree function to free the returned buffer. Return Values If the function succeeds, the return value is ERROR_SUCCESS.If the function fails, the return value is a nonzero error code defined in Winerror.h.
DWORD SetEntriesInAcl(
ULONG cCountOfExplicitEntries,
PEXPLICIT_ACCESS pListOfExplicitEntries,
PACL OldAcl,
PACL* NewAcl
);Parameters
cCountOfExplicitEntries
[in] Specifies the number of EXPLICIT_ACCESS structures in the pListOfExplicitEntries array.
pListOfExplicitEntries
[in] Pointer to an array of EXPLICIT_ACCESS structures that describe the access control information to merge into the existing ACL.
OldAcl
[in] Pointer to the existing ACL. This parameter can be NULL, in which case, the function creates a new ACL based on the EXPLICIT_ACCESS entries.
NewAcl
[out] Pointer to a variable that receives a pointer to the new ACL. If the function succeeds, you must call the LocalFree function to free the returned buffer.
Return Values
If the function succeeds, the return value is ERROR_SUCCESS.If the function fails, the return value is a nonzero error code defined in Winerror.h.