Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bf7596fd
Commit
bf7596fd
authored
Jun 24, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Jun 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement RtlAddAuditAccessAce.
parent
4e1ec201
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
4 deletions
+66
-4
sec.c
dlls/ntdll/sec.c
+66
-4
No files found.
dlls/ntdll/sec.c
View file @
bf7596fd
...
...
@@ -67,6 +67,59 @@ static BOOLEAN copy_acl(DWORD nDestinationAclLength, PACL pDestinationAcl, PACL
return
TRUE
;
}
/* generically adds an ACE to an ACL */
static
NTSTATUS
add_access_ace
(
PACL
pAcl
,
DWORD
dwAceRevision
,
DWORD
dwAceFlags
,
DWORD
dwAccessMask
,
PSID
pSid
,
DWORD
dwAceType
)
{
SID
*
sid
=
(
SID
*
)
pSid
;
ACE_HEADER
*
pAceHeader
;
DWORD
dwAceSize
;
DWORD
dwSidStart
;
DWORD
sidLength
;
PDWORD
pAccessMask
;
if
(
!
RtlValidSid
(
sid
))
return
STATUS_INVALID_SID
;
if
(
pAcl
->
AclRevision
>
MAX_ACL_REVISION
||
dwAceRevision
>
MAX_ACL_REVISION
)
return
STATUS_REVISION_MISMATCH
;
/* choose the higher of the two revisions */
sid
->
IdentifierAuthority
.
Value
[
1
]
=
pAcl
->
AclRevision
;
if
(
dwAceRevision
>
pAcl
->
AclRevision
)
sid
->
IdentifierAuthority
.
Value
[
1
]
=
dwAceRevision
;
if
(
!
RtlValidAcl
(
pAcl
))
return
STATUS_INVALID_ACL
;
if
(
!
RtlFirstFreeAce
(
pAcl
,
&
pAceHeader
))
return
STATUS_INVALID_ACL
;
if
(
!
pAceHeader
)
return
STATUS_ALLOTTED_SPACE_EXCEEDED
;
/* calculate generic size of the ACE */
sidLength
=
RtlLengthSid
(
sid
);
dwAceSize
=
sizeof
(
ACE_HEADER
)
+
sizeof
(
DWORD
)
+
sidLength
;
if
((
DWORD
)(
pAceHeader
+
dwAceSize
)
>
(
DWORD
)(
pAcl
+
pAcl
->
AclSize
))
return
STATUS_ALLOTTED_SPACE_EXCEEDED
;
/* fill the new Ace */
pAceHeader
->
AceType
=
dwAceType
;
pAceHeader
->
AceFlags
=
dwAceFlags
;
pAceHeader
->
AceSize
=
dwAceSize
;
pAccessMask
=
(
DWORD
*
)(
pAceHeader
+
sizeof
(
ACE_HEADER
));
*
pAccessMask
=
dwAccessMask
;
dwSidStart
=
(
DWORD
)(
pAceHeader
+
sizeof
(
ACE_HEADER
)
+
sizeof
(
DWORD
));
RtlCopySid
(
sidLength
,
(
PSID
)
dwSidStart
,
sid
);
pAcl
->
AclRevision
=
sid
->
IdentifierAuthority
.
Value
[
1
];
pAcl
->
AceCount
++
;
return
STATUS_SUCCESS
;
}
/*
* SID FUNCTIONS
*/
...
...
@@ -1222,10 +1275,19 @@ NTSTATUS WINAPI RtlAddAuditAccessAce(
IN
BOOL
bAuditSuccess
,
IN
BOOL
bAuditFailure
)
{
FIXME
(
"(%p,%ld,%ld,%p,%u,%u) stub
\n
"
,
pAcl
,
dwAceRevision
,
dwAccessMask
,
pSid
,
bAuditSuccess
,
bAuditFailure
);
return
STATUS_NOT_IMPLEMENTED
;
DWORD
dwAceFlags
=
0
;
TRACE
(
"(%p,%ld,%ld,%p,%u,%u)
\n
"
,
pAcl
,
dwAceRevision
,
dwAccessMask
,
pSid
,
bAuditSuccess
,
bAuditFailure
);
if
(
bAuditSuccess
)
dwAceFlags
|=
SUCCESSFUL_ACCESS_ACE_FLAG
;
if
(
bAuditFailure
)
dwAceFlags
|=
FAILED_ACCESS_ACE_FLAG
;
return
add_access_ace
(
pAcl
,
dwAceRevision
,
dwAceFlags
,
dwAccessMask
,
pSid
,
SYSTEM_AUDIT_ACE_TYPE
);
}
/******************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment