2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Security manager
5 * FILE: ntoskrnl/ob/security.c
8 * 26/07/98: Added stubs for security functions
11 /* INCLUDES *****************************************************************/
13 #include <ddk/ntddk.h>
14 #include <internal/ob.h>
16 #include <internal/debug.h>
18 /* FUNCTIONS ***************************************************************/
24 ObAssignSecurity(IN PACCESS_STATE AccessState,
25 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
37 ObGetObjectSecurity(IN PVOID Object,
38 OUT PSECURITY_DESCRIPTOR *SecurityDescriptor,
39 OUT PBOOLEAN MemoryAllocated)
49 ObReleaseObjectSecurity(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
50 IN BOOLEAN MemoryAllocated)
60 NtQuerySecurityObject(IN HANDLE Handle,
61 IN SECURITY_INFORMATION SecurityInformation,
62 OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
64 OUT PULONG ResultLength)
66 POBJECT_HEADER Header;
70 Status = ObReferenceObjectByHandle(Handle,
76 if (!NT_SUCCESS(Status))
81 Header = BODY_TO_HEADER(Object);
82 if (Header->ObjectType != NULL &&
83 Header->ObjectType->Security != NULL)
85 Status = Header->ObjectType->Security(Object,
86 QuerySecurityDescriptor,
90 *ResultLength = Length;
94 Status = STATUS_NOT_IMPLEMENTED;
97 ObDereferenceObject(Object);
107 NtSetSecurityObject(IN HANDLE Handle,
108 IN SECURITY_INFORMATION SecurityInformation,
109 IN PSECURITY_DESCRIPTOR SecurityDescriptor)
111 POBJECT_HEADER Header;
115 Status = ObReferenceObjectByHandle(Handle,
121 if (!NT_SUCCESS(Status))
126 Header = BODY_TO_HEADER(Object);
127 if (Header->ObjectType != NULL &&
128 Header->ObjectType->Security != NULL)
130 Status = Header->ObjectType->Security(Object,
131 SetSecurityDescriptor,
138 Status = STATUS_NOT_IMPLEMENTED;
141 ObDereferenceObject(Object);