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
,
30 return(STATUS_NOT_IMPLEMENTED
);
38 ObGetObjectSecurity(IN PVOID Object
,
39 OUT PSECURITY_DESCRIPTOR
*SecurityDescriptor
,
40 OUT PBOOLEAN MemoryAllocated
)
43 return(STATUS_NOT_IMPLEMENTED
);
51 ObReleaseObjectSecurity(IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
52 IN BOOLEAN MemoryAllocated
)
62 NtQuerySecurityObject(IN HANDLE Handle
,
63 IN SECURITY_INFORMATION SecurityInformation
,
64 OUT PSECURITY_DESCRIPTOR SecurityDescriptor
,
66 OUT PULONG ResultLength
)
68 POBJECT_HEADER Header
;
72 Status
= ObReferenceObjectByHandle(Handle
,
78 if (!NT_SUCCESS(Status
))
83 Header
= BODY_TO_HEADER(Object
);
84 if (Header
->ObjectType
== NULL
&&
85 Header
->ObjectType
->Security
!= NULL
)
87 Status
= Header
->ObjectType
->Security(Object
,
88 QuerySecurityDescriptor
,
92 *ResultLength
= Length
;
96 if (Header
->SecurityDescriptor
!= NULL
)
98 /* FIXME: Use SecurityInformation */
99 *ResultLength
= RtlLengthSecurityDescriptor(Header
->SecurityDescriptor
);
100 if (Length
>= *ResultLength
)
102 RtlCopyMemory(SecurityDescriptor
,
103 Header
->SecurityDescriptor
,
106 Status
= STATUS_SUCCESS
;
110 Status
= STATUS_BUFFER_TOO_SMALL
;
116 Status
= STATUS_UNSUCCESSFUL
;
120 ObDereferenceObject(Object
);
130 NtSetSecurityObject(IN HANDLE Handle
,
131 IN SECURITY_INFORMATION SecurityInformation
,
132 IN PSECURITY_DESCRIPTOR SecurityDescriptor
)
134 POBJECT_HEADER Header
;
138 Status
= ObReferenceObjectByHandle(Handle
,
144 if (!NT_SUCCESS(Status
))
149 Header
= BODY_TO_HEADER(Object
);
150 if (Header
->ObjectType
!= NULL
&&
151 Header
->ObjectType
->Security
!= NULL
)
153 Status
= Header
->ObjectType
->Security(Object
,
154 SetSecurityDescriptor
,
161 Status
= STATUS_NOT_IMPLEMENTED
;
164 ObDereferenceObject(Object
);