mirror of
https://github.com/reactos/reactos.git
synced 2025-04-12 00:29:04 +00:00
[USER32] GetUserObjectSecurity/SetUserObjectSecurity: Just use UserSetLastNTError() in failure path.
This commit is contained in:
parent
acde1e0e7b
commit
31c4c2efe9
1 changed files with 16 additions and 26 deletions
|
@ -80,21 +80,16 @@ GetUserObjectSecurity(
|
|||
OUT PDWORD pdwLengthNeeded
|
||||
)
|
||||
{
|
||||
DWORD dwWin32Error;
|
||||
NTSTATUS Status;
|
||||
NTSTATUS Status;
|
||||
|
||||
|
||||
Status = NtQuerySecurityObject(
|
||||
hObject, // Object Handle
|
||||
*pSecurityInfo, // Security Information
|
||||
pSecurityDescriptor,// Security Descriptor
|
||||
dwLength, // Buffer Length
|
||||
pdwLengthNeeded // Actual Length
|
||||
);
|
||||
|
||||
if ( ! NT_SUCCESS( Status ) ) {
|
||||
dwWin32Error = RtlNtStatusToDosError( Status );
|
||||
NtCurrentTeb()->LastErrorValue = dwWin32Error;
|
||||
Status = NtQuerySecurityObject(hObject,
|
||||
*pSecurityInfo,
|
||||
pSecurityDescriptor,
|
||||
dwLength,
|
||||
pdwLengthNeeded);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
UserSetLastNTError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -128,19 +123,14 @@ SetUserObjectSecurity(
|
|||
IN PSECURITY_DESCRIPTOR pSecurityDescriptor
|
||||
)
|
||||
{
|
||||
DWORD dwWin32Error;
|
||||
NTSTATUS Status;
|
||||
NTSTATUS Status;
|
||||
|
||||
|
||||
Status = NtSetSecurityObject(
|
||||
hObject, // Object Handle
|
||||
*pSecurityInfo, // Security Information
|
||||
pSecurityDescriptor // Security Descriptor
|
||||
);
|
||||
|
||||
if ( ! NT_SUCCESS( Status ) ) {
|
||||
dwWin32Error = RtlNtStatusToDosError( Status );
|
||||
NtCurrentTeb()->LastErrorValue = dwWin32Error;
|
||||
Status = NtSetSecurityObject(hObject,
|
||||
*pSecurityInfo,
|
||||
pSecurityDescriptor);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
UserSetLastNTError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue