diff --git a/reactos/ntoskrnl/se/sd.c b/reactos/ntoskrnl/se/sd.c index a4700154eac..01afd45deff 100644 --- a/reactos/ntoskrnl/se/sd.c +++ b/reactos/ntoskrnl/se/sd.c @@ -154,18 +154,22 @@ SeCaptureSecurityDescriptor( return Status; } } + else if(!CaptureIfKernel) + { + if(OriginalSecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1) + { + return STATUS_UNKNOWN_REVISION; + } + + *CapturedSecurityDescriptor = OriginalSecurityDescriptor; + return STATUS_SUCCESS; + } else { /* make a copy on the stack */ DescriptorCopy = *OriginalSecurityDescriptor; } - if(CurrentMode == KernelMode && !CaptureIfKernel) - { - *CapturedSecurityDescriptor = OriginalSecurityDescriptor; - return STATUS_SUCCESS; - } - if(DescriptorCopy.Revision != SECURITY_DESCRIPTOR_REVISION1) { return STATUS_UNKNOWN_REVISION;