11typedef unsigned long DWORD;
2- typedef unsigned long ULONG;
2+ typedef unsigned long ULONG;
33typedef unsigned char BYTE;
44typedef unsigned short WORD;
55typedef int BOOL;
6- typedef void *PVOID;
6+ typedef void *PVOID;
77#define TRUE 1
8- #define FALSE 0
8+ #define FALSE 0
99#define ERROR_SUCCESS 0L
10- #define NULL 0
10+ #define NULL 0
1111
1212typedef PVOID PSECURITY_DESCRIPTOR;
1313
1414typedef struct _ACL {
15- BYTE AclRevision;
16- BYTE Sbz1;
17- WORD AclSize;
18- WORD AceCount;
19- WORD Sbz2;
15+ BYTE AclRevision;
16+ BYTE Sbz1;
17+ WORD AclSize;
18+ WORD AceCount;
19+ WORD Sbz2;
2020} ACL;
2121typedef ACL *PACL;
2222
2323typedef enum _ACCESS_MODE
2424{
25- NOT_USED_ACCESS = 0 ,
26- GRANT_ACCESS,
27- SET_ACCESS,
28- DENY_ACCESS,
29- REVOKE_ACCESS,
30- SET_AUDIT_SUCCESS,
31- SET_AUDIT_FAILURE
25+ NOT_USED_ACCESS = 0 ,
26+ GRANT_ACCESS,
27+ SET_ACCESS,
28+ DENY_ACCESS,
29+ REVOKE_ACCESS,
30+ SET_AUDIT_SUCCESS,
31+ SET_AUDIT_FAILURE
3232} ACCESS_MODE;
3333
3434typedef int TRUSTEE_W;
3535
3636typedef struct _EXPLICIT_ACCESS_W
3737{
38- DWORD grfAccessPermissions;
39- ACCESS_MODE grfAccessMode;
40- DWORD grfInheritance;
41- TRUSTEE_W Trustee;
38+ DWORD grfAccessPermissions;
39+ ACCESS_MODE grfAccessMode;
40+ DWORD grfInheritance;
41+ TRUSTEE_W Trustee;
4242} EXPLICIT_ACCESS_W, *PEXPLICIT_ACCESS_W, EXPLICIT_ACCESSW, *PEXPLICIT_ACCESSW;
4343
4444BOOL
4545SetSecurityDescriptorDacl (
46- PSECURITY_DESCRIPTOR pSecurityDescriptor,
47- BOOL bDaclPresent,
48- PACL pDacl,
49- BOOL bDaclDefaulted
46+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
47+ BOOL bDaclPresent,
48+ PACL pDacl,
49+ BOOL bDaclDefaulted
5050) {
51- return TRUE ;
51+ return TRUE ;
5252}
5353
5454DWORD SetEntriesInAcl (
55- ULONG cCountOfExplicitEntries,
56- PEXPLICIT_ACCESS_W pListOfExplicitEntries,
57- PACL OldAcl,
58- PACL *NewAcl
55+ ULONG cCountOfExplicitEntries,
56+ PEXPLICIT_ACCESS_W pListOfExplicitEntries,
57+ PACL OldAcl,
58+ PACL *NewAcl
5959)
6060{
61- *NewAcl = (PACL)0xFFFFFF ;
62- return ERROR_SUCCESS;
61+ *NewAcl = (PACL)0xFFFFFF ;
62+ return ERROR_SUCCESS;
6363}
6464
6565void Test ()
6666{
67- PSECURITY_DESCRIPTOR pSecurityDescriptor;
68- BOOL b;
69- b = SetSecurityDescriptorDacl (pSecurityDescriptor,
70- TRUE , // Dacl Present
71- NULL , // NULL pointer to DACL == BUG
72- FALSE );
67+ PSECURITY_DESCRIPTOR pSecurityDescriptor;
68+ BOOL b;
69+ b = SetSecurityDescriptorDacl (pSecurityDescriptor,
70+ TRUE , // Dacl Present
71+ NULL , // NULL pointer to DACL == BUG
72+ FALSE );
7373
74- PACL pDacl = NULL ;
75- b = SetSecurityDescriptorDacl (pSecurityDescriptor,
76- TRUE , // Dacl Present
77- pDacl, // NULL pointer to DACL == BUG
78- FALSE );
74+ PACL pDacl = NULL ;
75+ b = SetSecurityDescriptorDacl (pSecurityDescriptor,
76+ TRUE , // Dacl Present
77+ pDacl, // NULL pointer to DACL == BUG
78+ FALSE );
7979
80- SetEntriesInAcl (0 , NULL , NULL , &pDacl);
81- b = SetSecurityDescriptorDacl (pSecurityDescriptor,
82- TRUE , // Dacl Present
83- pDacl, // Should have been set by SetEntriesInAcl ==> should not be flagged
84- FALSE );
80+ SetEntriesInAcl (0 , NULL , NULL , &pDacl);
81+ b = SetSecurityDescriptorDacl (pSecurityDescriptor,
82+ TRUE , // Dacl Present
83+ pDacl, // Should have been set by SetEntriesInAcl ==> should not be flagged
84+ FALSE );
8585
86- b = SetSecurityDescriptorDacl (pSecurityDescriptor,
87- FALSE , // Dacl is not Present
88- NULL , // DACL is going to be removed from security descriptor. Default/inherited access ==> should not be flagged
89- FALSE );
86+ b = SetSecurityDescriptorDacl (pSecurityDescriptor,
87+ FALSE , // Dacl is not Present
88+ NULL , // DACL is going to be removed from security descriptor. Default/inherited access ==> should not be flagged
89+ FALSE );
9090
9191}
0 commit comments