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 ***************************************************************/
21 ObAssignSecurity(IN PACCESS_STATE AccessState,
22 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
31 ObGetObjectSecurity(IN PVOID Object,
32 OUT PSECURITY_DESCRIPTOR *SecurityDescriptor,
33 OUT PBOOLEAN MemoryAllocated)
40 ObReleaseObjectSecurity(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
41 IN BOOLEAN MemoryAllocated)
48 NtQuerySecurityObject(IN HANDLE Handle,
49 IN SECURITY_INFORMATION SecurityInformation,
50 OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
52 OUT PULONG ResultLength)
54 POBJECT_HEADER Header;
58 Status = ObReferenceObjectByHandle(Handle,
64 if (!NT_SUCCESS(Status))
69 Header = BODY_TO_HEADER(Object);
70 if (Header->ObjectType != NULL &&
71 Header->ObjectType->Security != NULL)
73 Status = Header->ObjectType->Security(Object,
74 QuerySecurityDescriptor,
78 *ResultLength = Length;
82 Status = STATUS_NOT_IMPLEMENTED;
85 ObDereferenceObject(Object);
92 NtSetSecurityObject(IN HANDLE Handle,
93 IN SECURITY_INFORMATION SecurityInformation,
94 IN PSECURITY_DESCRIPTOR SecurityDescriptor)
96 POBJECT_HEADER Header;
100 Status = ObReferenceObjectByHandle(Handle,
106 if (!NT_SUCCESS(Status))
111 Header = BODY_TO_HEADER(Object);
112 if (Header->ObjectType != NULL &&
113 Header->ObjectType->Security != NULL)
115 Status = Header->ObjectType->Security(Object,
116 SetSecurityDescriptor,
123 Status = STATUS_NOT_IMPLEMENTED;
126 ObDereferenceObject(Object);