36 DWORD dwSubAuthorities;
56 dwSidSize=(15 + 12 + (12 * dwSubAuthorities) + 1) *
sizeof(
TCHAR);
61 if (*lpdwBufferLen < dwSidSize)
63 *lpdwBufferLen = dwSidSize;
70 dwSidSize=
wsprintf(TextualSid,
TEXT(
"S-%lu-"), dwSidRev );
74 if ( (psia->Value[0] != 0) || (psia->Value[1] != 0) )
77 TEXT(
"0x%02hx%02hx%02hx%02hx%02hx%02hx"),
89 (
ULONG)(psia->Value[5] ) +
90 (
ULONG)(psia->Value[4] << 8) +
91 (
ULONG)(psia->Value[3] << 16) +
92 (
ULONG)(psia->Value[2] << 24) );
99 dwSidSize+=
wsprintf(TextualSid + dwSidSize,
TEXT(
"-%lu"),
111 return _T(
"User SID");
113 return _T(
"Group SID");
115 return _T(
"Domain SID");
117 return _T(
"Alias SID");
119 return _T(
"SID for a well-known group");
121 return _T(
"SID for a deleted account");
123 return _T(
"Invalid SID");
125 return _T(
"Unknown SID type");
127 return _T(
"Error. Cannot recognize SID type.");
const TCHAR * GetSidTypeName(SID_NAME_USE Use)
BOOL GetTextualSid(PSID pSid, LPTSTR TextualSid, LPDWORD lpdwBufferLen)
void AssociateDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor)
ACEntryType GetDACLEntry(DWORD nIndex)
BOOL DescriptorContainsDACL()
DWORD BeginSACLInteration()
PSECURITY_DESCRIPTOR m_pSecurityDescriptor
BOOL DescriptorContainsSACL()
ACEntryType GetSACLEntry(DWORD nIndex, BOOL &blnFailedAccess, BOOL &blnSeccessfulAccess)
virtual ~CSecurityDescriptor()
DWORD BeginDACLInteration()
void GetCurrentACE_Flags(BYTE &bFlags)
ACE_HEADER * m_pCurrentACEHeader
DWORD GetDACLEntriesCount()
DWORD GetSACLEntriesCount()
void GetCurrentACE_AccessMask(DWORD &dwMask)
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI GetAclInformation(PACL pAcl, LPVOID pAclInformation, DWORD nAclInformationLength, ACL_INFORMATION_CLASS dwAclInformationClass)
PDWORD WINAPI GetSidSubAuthority(PSID pSid, DWORD nSubAuthority)
BOOL WINAPI IsValidSid(PSID pSid)
PUCHAR WINAPI GetSidSubAuthorityCount(PSID pSid)
PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID pSid)
BOOL WINAPI GetAce(PACL pAcl, DWORD dwAceIndex, LPVOID *pAce)
BOOL WINAPI IsValidAcl(PACL pAcl)
enum _SID_NAME_USE SID_NAME_USE
struct _ACE_HEADER * PACE_HEADER
BOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent, PACL *pSacl, LPBOOL lpbSaclDefaulted)
BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL *pDacl, LPBOOL lpbDaclDefaulted)
DWORD WINAPI GetLastError(void)
#define SYSTEM_AUDIT_ACE_TYPE
#define ACCESS_ALLOWED_ACE_TYPE
#define ACCESS_DENIED_ACE_TYPE
* PSID_IDENTIFIER_AUTHORITY
#define FAILED_ACCESS_ACE_FLAG
#define SUCCESSFUL_ACCESS_ACE_FLAG