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
)
57 NtQuerySecurityObject(IN HANDLE Handle
,
58 IN SECURITY_INFORMATION SecurityInformation
,
59 OUT PSECURITY_DESCRIPTOR SecurityDescriptor
,
61 OUT PULONG ResultLength
)
63 POBJECT_HEADER Header
;
67 Status
= ObReferenceObjectByHandle(Handle
,
73 if (!NT_SUCCESS(Status
))
78 Header
= BODY_TO_HEADER(Object
);
79 if (Header
->ObjectType
!= NULL
&&
80 Header
->ObjectType
->Security
!= NULL
)
82 Status
= Header
->ObjectType
->Security(Object
,
83 QuerySecurityDescriptor
,
87 *ResultLength
= Length
;
91 Status
= STATUS_NOT_IMPLEMENTED
;
94 ObDereferenceObject(Object
);
101 NtSetSecurityObject(IN HANDLE Handle
,
102 IN SECURITY_INFORMATION SecurityInformation
,
103 IN PSECURITY_DESCRIPTOR SecurityDescriptor
)
105 POBJECT_HEADER Header
;
109 Status
= ObReferenceObjectByHandle(Handle
,
115 if (!NT_SUCCESS(Status
))
120 Header
= BODY_TO_HEADER(Object
);
121 if (Header
->ObjectType
!= NULL
&&
122 Header
->ObjectType
->Security
!= NULL
)
124 Status
= Header
->ObjectType
->Security(Object
,
125 SetSecurityDescriptor
,
132 Status
= STATUS_NOT_IMPLEMENTED
;
135 ObDereferenceObject(Object
);