4 * Copyright 1996-1998 Marcus Meissner
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "wine/port.h"
35 #include "wine/exception.h"
38 #include "wine/debug.h"
40 #include "stackframe.h"
44 #include "ntdll_misc.h"
47 WINE_DEFAULT_DEBUG_CHANNEL(ntdll
);
49 #define NT_SUCCESS(status) (status == STATUS_SUCCESS)
51 /* filter for page-fault exceptions */
52 static WINE_EXCEPTION_FILTER(page_fault
)
54 if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION
)
55 return EXCEPTION_EXECUTE_HANDLER
;
56 return EXCEPTION_CONTINUE_SEARCH
;
63 /******************************************************************************
64 * RtlAllocateAndInitializeSid [NTDLL.@]
67 BOOLEAN WINAPI
RtlAllocateAndInitializeSid (
68 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
,
69 BYTE nSubAuthorityCount
,
70 DWORD nSubAuthority0
, DWORD nSubAuthority1
,
71 DWORD nSubAuthority2
, DWORD nSubAuthority3
,
72 DWORD nSubAuthority4
, DWORD nSubAuthority5
,
73 DWORD nSubAuthority6
, DWORD nSubAuthority7
,
76 TRACE("(%p, 0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,%p)\n",
77 pIdentifierAuthority
,nSubAuthorityCount
,
78 nSubAuthority0
, nSubAuthority1
, nSubAuthority2
, nSubAuthority3
,
79 nSubAuthority4
, nSubAuthority5
, nSubAuthority6
, nSubAuthority7
, pSid
);
81 if (!(*pSid
= RtlAllocateHeap( ntdll_get_process_heap(), 0,
82 RtlLengthRequiredSid(nSubAuthorityCount
))))
85 (*pSid
)->Revision
= SID_REVISION
;
87 if (pIdentifierAuthority
)
88 memcpy(&(*pSid
)->IdentifierAuthority
, pIdentifierAuthority
, sizeof (SID_IDENTIFIER_AUTHORITY
));
89 *RtlSubAuthorityCountSid(*pSid
) = nSubAuthorityCount
;
91 if (nSubAuthorityCount
> 0)
92 *RtlSubAuthoritySid(*pSid
, 0) = nSubAuthority0
;
93 if (nSubAuthorityCount
> 1)
94 *RtlSubAuthoritySid(*pSid
, 1) = nSubAuthority1
;
95 if (nSubAuthorityCount
> 2)
96 *RtlSubAuthoritySid(*pSid
, 2) = nSubAuthority2
;
97 if (nSubAuthorityCount
> 3)
98 *RtlSubAuthoritySid(*pSid
, 3) = nSubAuthority3
;
99 if (nSubAuthorityCount
> 4)
100 *RtlSubAuthoritySid(*pSid
, 4) = nSubAuthority4
;
101 if (nSubAuthorityCount
> 5)
102 *RtlSubAuthoritySid(*pSid
, 5) = nSubAuthority5
;
103 if (nSubAuthorityCount
> 6)
104 *RtlSubAuthoritySid(*pSid
, 6) = nSubAuthority6
;
105 if (nSubAuthorityCount
> 7)
106 *RtlSubAuthoritySid(*pSid
, 7) = nSubAuthority7
;
108 return STATUS_SUCCESS
;
110 /******************************************************************************
111 * RtlEqualSid [NTDLL.@]
113 * Determine if two SIDs are equal.
116 * pSid1 [I] Source SID
117 * pSid2 [I] SID to compare with
120 * TRUE, if pSid1 is equal to pSid2,
123 BOOL WINAPI
RtlEqualSid( PSID pSid1
, PSID pSid2
)
125 if (!RtlValidSid(pSid1
) || !RtlValidSid(pSid2
))
128 if (*RtlSubAuthorityCountSid(pSid1
) != *RtlSubAuthorityCountSid(pSid2
))
131 if (memcmp(pSid1
, pSid2
, RtlLengthSid(pSid1
)) != 0)
137 /******************************************************************************
138 * RtlEqualPrefixSid [NTDLL.@]
140 BOOL WINAPI
RtlEqualPrefixSid (PSID pSid1
, PSID pSid2
)
142 if (!RtlValidSid(pSid1
) || !RtlValidSid(pSid2
))
145 if (*RtlSubAuthorityCountSid(pSid1
) != *RtlSubAuthorityCountSid(pSid2
))
148 if (memcmp(pSid1
, pSid2
, RtlLengthRequiredSid(pSid1
->SubAuthorityCount
- 1)) != 0)
155 /******************************************************************************
156 * RtlFreeSid [NTDLL.@]
158 * Free the resources used by a SID.
161 * pSid [I] SID to Free.
166 DWORD WINAPI
RtlFreeSid(PSID pSid
)
168 TRACE("(%p)\n", pSid
);
169 RtlFreeHeap( ntdll_get_process_heap(), 0, pSid
);
170 return STATUS_SUCCESS
;
173 /**************************************************************************
174 * RtlLengthRequiredSid [NTDLL.@]
176 * Determine the amount of memory a SID will use
179 * nrofsubauths [I] Number of Sub Authorities in the SID.
182 * The size, in bytes, of a SID with nrofsubauths Sub Authorities.
184 DWORD WINAPI
RtlLengthRequiredSid(DWORD nrofsubauths
)
186 return (nrofsubauths
-1)*sizeof(DWORD
) + sizeof(SID
);
189 /**************************************************************************
190 * RtlLengthSid [NTDLL.@]
192 * Determine the amount of memory a SID is using
195 * pSid [I] SID to ge the size of.
198 * The size, in bytes, of pSid.
200 DWORD WINAPI
RtlLengthSid(PSID pSid
)
202 TRACE("sid=%p\n",pSid
);
204 return RtlLengthRequiredSid(*RtlSubAuthorityCountSid(pSid
));
207 /**************************************************************************
208 * RtlInitializeSid [NTDLL.@]
213 * pSid [I] SID to initialise
214 * pIdentifierAuthority [I] Identifier Authority
215 * nSubAuthorityCount [I] Number of Sub Authorities
218 * Success: TRUE. pSid is initialised withe the details given.
219 * Failure: FALSE, if nSubAuthorityCount is >= SID_MAX_SUB_AUTHORITIES.
221 BOOL WINAPI
RtlInitializeSid(
223 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
,
224 BYTE nSubAuthorityCount
)
227 if (nSubAuthorityCount
>= SID_MAX_SUB_AUTHORITIES
)
230 pSid
->Revision
= SID_REVISION
;
231 pSid
->SubAuthorityCount
= nSubAuthorityCount
;
232 if (pIdentifierAuthority
)
233 memcpy(&pSid
->IdentifierAuthority
, pIdentifierAuthority
, sizeof (SID_IDENTIFIER_AUTHORITY
));
235 for (i
= 0; i
< nSubAuthorityCount
; i
++)
236 *RtlSubAuthoritySid(pSid
, i
) = 0;
241 /**************************************************************************
242 * RtlSubAuthoritySid [NTDLL.@]
244 * Return the Sub Authority of a SID
247 * pSid [I] SID to get the Sub Authority from.
248 * nSubAuthority [I] Sub Authority number.
251 * A pointer to The Sub Authority value of pSid.
253 LPDWORD WINAPI
RtlSubAuthoritySid( PSID pSid
, DWORD nSubAuthority
)
255 return &(pSid
->SubAuthority
[nSubAuthority
]);
258 /**************************************************************************
259 * RtlIdentifierAuthoritySid [NTDLL.@]
261 * Return the Identifier Authority of a SID.
264 * pSid [I] SID to get the Identifier Authority from.
267 * A pointer to the Identifier Authority value of pSid.
269 PSID_IDENTIFIER_AUTHORITY WINAPI
RtlIdentifierAuthoritySid( PSID pSid
)
271 return &(pSid
->IdentifierAuthority
);
274 /**************************************************************************
275 * RtlSubAuthorityCountSid [NTDLL.@]
277 * Get the number of Sub Authorities in a SID.
280 * pSid [I] SID to get the count from.
283 * A pointer to the Sub Authority count of pSid.
285 LPBYTE WINAPI
RtlSubAuthorityCountSid(PSID pSid
)
287 return &(pSid
->SubAuthorityCount
);
290 /**************************************************************************
291 * RtlCopySid [NTDLL.@]
293 DWORD WINAPI
RtlCopySid( DWORD nDestinationSidLength
, PSID pDestinationSid
, PSID pSourceSid
)
295 if (!pSourceSid
|| !RtlValidSid(pSourceSid
) ||
296 (nDestinationSidLength
< RtlLengthSid(pSourceSid
)))
299 if (nDestinationSidLength
< (pSourceSid
->SubAuthorityCount
*4+8))
302 memmove(pDestinationSid
, pSourceSid
, pSourceSid
->SubAuthorityCount
*4+8);
305 /******************************************************************************
306 * RtlValidSid [NTDLL.@]
308 * Determine if a SID is valid.
311 * pSid [I] SID to check
314 * TRUE if pSid is valid,
318 RtlValidSid( PSID pSid
)
324 if (!pSid
|| pSid
->Revision
!= SID_REVISION
||
325 pSid
->SubAuthorityCount
> SID_MAX_SUB_AUTHORITIES
)
332 WARN("(%p): invalid pointer!\n", pSid
);
341 * security descriptor functions
344 /**************************************************************************
345 * RtlCreateSecurityDescriptor [NTDLL.@]
347 * Initialise a SECURITY_DESCRIPTOR.
350 * lpsd [O] Descriptor to initialise.
351 * rev [I] Revision, must be set to SECURITY_DESCRIPTOR_REVISION.
354 * Success: STATUS_SUCCESS.
355 * Failure: STATUS_UNKNOWN_REVISION if rev is incorrect.
357 NTSTATUS WINAPI
RtlCreateSecurityDescriptor(
358 PSECURITY_DESCRIPTOR lpsd
,
361 if (rev
!=SECURITY_DESCRIPTOR_REVISION
)
362 return STATUS_UNKNOWN_REVISION
;
363 memset(lpsd
,'\0',sizeof(*lpsd
));
364 lpsd
->Revision
= SECURITY_DESCRIPTOR_REVISION
;
365 return STATUS_SUCCESS
;
367 /**************************************************************************
368 * RtlValidSecurityDescriptor [NTDLL.@]
370 * Determine if a SECURITY_DESCRIPTOR is valid.
373 * SecurityDescriptor [I] Descriptor to check.
376 * Success: STATUS_SUCCESS.
377 * Failure: STATUS_INVALID_SECURITY_DESCR or STATUS_UNKNOWN_REVISION.
379 NTSTATUS WINAPI
RtlValidSecurityDescriptor(
380 PSECURITY_DESCRIPTOR SecurityDescriptor
)
382 if ( ! SecurityDescriptor
)
383 return STATUS_INVALID_SECURITY_DESCR
;
384 if ( SecurityDescriptor
->Revision
!= SECURITY_DESCRIPTOR_REVISION
)
385 return STATUS_UNKNOWN_REVISION
;
387 return STATUS_SUCCESS
;
390 /**************************************************************************
391 * RtlLengthSecurityDescriptor [NTDLL.@]
393 ULONG WINAPI
RtlLengthSecurityDescriptor(
394 PSECURITY_DESCRIPTOR SecurityDescriptor
)
397 Size
= SECURITY_DESCRIPTOR_MIN_LENGTH
;
398 if ( SecurityDescriptor
== NULL
)
401 if ( SecurityDescriptor
->Owner
!= NULL
)
402 Size
+= SecurityDescriptor
->Owner
->SubAuthorityCount
;
403 if ( SecurityDescriptor
->Group
!= NULL
)
404 Size
+= SecurityDescriptor
->Group
->SubAuthorityCount
;
407 if ( SecurityDescriptor
->Sacl
!= NULL
)
408 Size
+= SecurityDescriptor
->Sacl
->AclSize
;
409 if ( SecurityDescriptor
->Dacl
!= NULL
)
410 Size
+= SecurityDescriptor
->Dacl
->AclSize
;
415 /******************************************************************************
416 * RtlGetDaclSecurityDescriptor [NTDLL.@]
419 NTSTATUS WINAPI
RtlGetDaclSecurityDescriptor(
420 IN PSECURITY_DESCRIPTOR pSecurityDescriptor
,
421 OUT PBOOLEAN lpbDaclPresent
,
423 OUT PBOOLEAN lpbDaclDefaulted
)
425 TRACE("(%p,%p,%p,%p)\n",
426 pSecurityDescriptor
, lpbDaclPresent
, *pDacl
, lpbDaclDefaulted
);
428 if (pSecurityDescriptor
->Revision
!= SECURITY_DESCRIPTOR_REVISION
)
429 return STATUS_UNKNOWN_REVISION
;
431 if ( (*lpbDaclPresent
= (SE_DACL_PRESENT
& pSecurityDescriptor
->Control
) ? 1 : 0) )
433 if ( SE_SELF_RELATIVE
& pSecurityDescriptor
->Control
)
434 { *pDacl
= (PACL
) ((LPBYTE
)pSecurityDescriptor
+ (DWORD
)pSecurityDescriptor
->Dacl
);
437 { *pDacl
= pSecurityDescriptor
->Dacl
;
441 *lpbDaclDefaulted
= (( SE_DACL_DEFAULTED
& pSecurityDescriptor
->Control
) ? 1 : 0);
443 return STATUS_SUCCESS
;
446 /**************************************************************************
447 * RtlSetDaclSecurityDescriptor [NTDLL.@]
449 NTSTATUS WINAPI
RtlSetDaclSecurityDescriptor (
450 PSECURITY_DESCRIPTOR lpsd
,
453 BOOLEAN dacldefaulted
)
455 if (lpsd
->Revision
!=SECURITY_DESCRIPTOR_REVISION
)
456 return STATUS_UNKNOWN_REVISION
;
457 if (lpsd
->Control
& SE_SELF_RELATIVE
)
458 return STATUS_INVALID_SECURITY_DESCR
;
461 { lpsd
->Control
&= ~SE_DACL_PRESENT
;
465 lpsd
->Control
|= SE_DACL_PRESENT
;
469 lpsd
->Control
|= SE_DACL_DEFAULTED
;
471 lpsd
->Control
&= ~SE_DACL_DEFAULTED
;
473 return STATUS_SUCCESS
;
476 /******************************************************************************
477 * RtlGetSaclSecurityDescriptor [NTDLL.@]
480 NTSTATUS WINAPI
RtlGetSaclSecurityDescriptor(
481 IN PSECURITY_DESCRIPTOR pSecurityDescriptor
,
482 OUT PBOOLEAN lpbSaclPresent
,
484 OUT PBOOLEAN lpbSaclDefaulted
)
486 TRACE("(%p,%p,%p,%p)\n",
487 pSecurityDescriptor
, lpbSaclPresent
, *pSacl
, lpbSaclDefaulted
);
489 if (pSecurityDescriptor
->Revision
!= SECURITY_DESCRIPTOR_REVISION
)
490 return STATUS_UNKNOWN_REVISION
;
492 if ( (*lpbSaclPresent
= (SE_SACL_PRESENT
& pSecurityDescriptor
->Control
) ? 1 : 0) )
494 if ( SE_SELF_RELATIVE
& pSecurityDescriptor
->Control
)
495 { *pSacl
= (PACL
) ((LPBYTE
)pSecurityDescriptor
+ (DWORD
)pSecurityDescriptor
->Sacl
);
498 { *pSacl
= pSecurityDescriptor
->Sacl
;
502 *lpbSaclDefaulted
= (( SE_SACL_DEFAULTED
& pSecurityDescriptor
->Control
) ? 1 : 0);
504 return STATUS_SUCCESS
;
507 /**************************************************************************
508 * RtlSetSaclSecurityDescriptor [NTDLL.@]
510 NTSTATUS WINAPI
RtlSetSaclSecurityDescriptor (
511 PSECURITY_DESCRIPTOR lpsd
,
514 BOOLEAN sacldefaulted
)
516 if (lpsd
->Revision
!=SECURITY_DESCRIPTOR_REVISION
)
517 return STATUS_UNKNOWN_REVISION
;
518 if (lpsd
->Control
& SE_SELF_RELATIVE
)
519 return STATUS_INVALID_SECURITY_DESCR
;
521 lpsd
->Control
&= ~SE_SACL_PRESENT
;
524 lpsd
->Control
|= SE_SACL_PRESENT
;
527 lpsd
->Control
|= SE_SACL_DEFAULTED
;
529 lpsd
->Control
&= ~SE_SACL_DEFAULTED
;
530 return STATUS_SUCCESS
;
533 /**************************************************************************
534 * RtlGetOwnerSecurityDescriptor [NTDLL.@]
536 NTSTATUS WINAPI
RtlGetOwnerSecurityDescriptor(
537 PSECURITY_DESCRIPTOR SecurityDescriptor
,
539 PBOOLEAN OwnerDefaulted
)
541 if ( !SecurityDescriptor
|| !Owner
|| !OwnerDefaulted
)
542 return STATUS_INVALID_PARAMETER
;
544 *Owner
= SecurityDescriptor
->Owner
;
545 if ( *Owner
!= NULL
) {
546 if ( SecurityDescriptor
->Control
& SE_OWNER_DEFAULTED
)
547 *OwnerDefaulted
= TRUE
;
549 *OwnerDefaulted
= FALSE
;
551 return STATUS_SUCCESS
;
554 /**************************************************************************
555 * RtlSetOwnerSecurityDescriptor [NTDLL.@]
557 NTSTATUS WINAPI
RtlSetOwnerSecurityDescriptor(
558 PSECURITY_DESCRIPTOR lpsd
,
560 BOOLEAN ownerdefaulted
)
562 if (lpsd
->Revision
!=SECURITY_DESCRIPTOR_REVISION
)
563 return STATUS_UNKNOWN_REVISION
;
564 if (lpsd
->Control
& SE_SELF_RELATIVE
)
565 return STATUS_INVALID_SECURITY_DESCR
;
569 lpsd
->Control
|= SE_OWNER_DEFAULTED
;
571 lpsd
->Control
&= ~SE_OWNER_DEFAULTED
;
572 return STATUS_SUCCESS
;
575 /**************************************************************************
576 * RtlSetGroupSecurityDescriptor [NTDLL.@]
578 NTSTATUS WINAPI
RtlSetGroupSecurityDescriptor (
579 PSECURITY_DESCRIPTOR lpsd
,
581 BOOLEAN groupdefaulted
)
583 if (lpsd
->Revision
!=SECURITY_DESCRIPTOR_REVISION
)
584 return STATUS_UNKNOWN_REVISION
;
585 if (lpsd
->Control
& SE_SELF_RELATIVE
)
586 return STATUS_INVALID_SECURITY_DESCR
;
590 lpsd
->Control
|= SE_GROUP_DEFAULTED
;
592 lpsd
->Control
&= ~SE_GROUP_DEFAULTED
;
593 return STATUS_SUCCESS
;
595 /**************************************************************************
596 * RtlGetGroupSecurityDescriptor [NTDLL.@]
598 NTSTATUS WINAPI
RtlGetGroupSecurityDescriptor(
599 PSECURITY_DESCRIPTOR SecurityDescriptor
,
601 PBOOLEAN GroupDefaulted
)
603 if ( !SecurityDescriptor
|| !Group
|| !GroupDefaulted
)
604 return STATUS_INVALID_PARAMETER
;
606 *Group
= SecurityDescriptor
->Group
;
607 if ( *Group
!= NULL
) {
608 if ( SecurityDescriptor
->Control
& SE_GROUP_DEFAULTED
)
609 *GroupDefaulted
= TRUE
;
611 *GroupDefaulted
= FALSE
;
613 return STATUS_SUCCESS
;
616 /**************************************************************************
617 * RtlMakeSelfRelativeSD [NTDLL.@]
619 NTSTATUS WINAPI
RtlMakeSelfRelativeSD(
620 IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor
,
621 IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor
,
622 IN OUT LPDWORD lpdwBufferLength
)
624 FIXME("(%p,%p,%p(%lu))\n", pAbsoluteSecurityDescriptor
,
625 pSelfRelativeSecurityDescriptor
, lpdwBufferLength
,*lpdwBufferLength
);
626 return STATUS_SUCCESS
;
630 * access control list's
633 /**************************************************************************
634 * RtlCreateAcl [NTDLL.@]
637 * This should return NTSTATUS
639 NTSTATUS WINAPI
RtlCreateAcl(PACL acl
,DWORD size
,DWORD rev
)
641 TRACE("%p 0x%08lx 0x%08lx\n", acl
, size
, rev
);
643 if (rev
!=ACL_REVISION
)
644 return STATUS_INVALID_PARAMETER
;
645 if (size
<sizeof(ACL
))
646 return STATUS_BUFFER_TOO_SMALL
;
648 return STATUS_INVALID_PARAMETER
;
650 memset(acl
,'\0',sizeof(ACL
));
651 acl
->AclRevision
= rev
;
654 return STATUS_SUCCESS
;
657 /**************************************************************************
658 * RtlFirstFreeAce [NTDLL.@]
659 * looks for the AceCount+1 ACE, and if it is still within the alloced
660 * ACL, return a pointer to it
662 BOOLEAN WINAPI
RtlFirstFreeAce(
670 ace
= (PACE_HEADER
)(acl
+1);
671 for (i
=0;i
<acl
->AceCount
;i
++) {
672 if ((DWORD
)ace
>=(((DWORD
)acl
)+acl
->AclSize
))
674 ace
= (PACE_HEADER
)(((BYTE
*)ace
)+ace
->AceSize
);
676 if ((DWORD
)ace
>=(((DWORD
)acl
)+acl
->AclSize
))
682 /**************************************************************************
683 * RtlAddAce [NTDLL.@]
685 NTSTATUS WINAPI
RtlAddAce(
689 PACE_HEADER acestart
,
692 PACE_HEADER ace
,targetace
;
695 if (acl
->AclRevision
!= ACL_REVISION
)
696 return STATUS_INVALID_PARAMETER
;
697 if (!RtlFirstFreeAce(acl
,&targetace
))
698 return STATUS_INVALID_PARAMETER
;
699 nrofaces
=0;ace
=acestart
;
700 while (((DWORD
)ace
-(DWORD
)acestart
)<acelen
) {
702 ace
= (PACE_HEADER
)(((BYTE
*)ace
)+ace
->AceSize
);
704 if ((DWORD
)targetace
+acelen
>(DWORD
)acl
+acl
->AclSize
) /* too much aces */
705 return STATUS_INVALID_PARAMETER
;
706 memcpy((LPBYTE
)targetace
,acestart
,acelen
);
707 acl
->AceCount
+=nrofaces
;
708 return STATUS_SUCCESS
;
711 /******************************************************************************
712 * RtlAddAccessAllowedAce [NTDLL.@]
714 BOOL WINAPI
RtlAddAccessAllowedAce(
716 IN DWORD dwAceRevision
,
720 FIXME("(%p,0x%08lx,0x%08lx,%p),stub!\n",
721 pAcl
, dwAceRevision
, AccessMask
, pSid
);
725 /******************************************************************************
726 * RtlGetAce [NTDLL.@]
728 DWORD WINAPI
RtlGetAce(PACL pAcl
,DWORD dwAceIndex
,LPVOID
*pAce
)
730 FIXME("(%p,%ld,%p),stub!\n",pAcl
,dwAceIndex
,pAce
);
738 /******************************************************************************
739 * RtlAdjustPrivilege [NTDLL.@]
741 DWORD WINAPI
RtlAdjustPrivilege(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
)
743 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1
,x2
,x3
,x4
);
747 /******************************************************************************
748 * RtlImpersonateSelf [NTDLL.@]
751 RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
)
753 FIXME("(%08x), stub\n", ImpersonationLevel
);
757 /******************************************************************************
758 * NtAccessCheck [NTDLL.@]
759 * ZwAccessCheck [NTDLL.@]
763 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
764 IN HANDLE ClientToken
,
765 IN ACCESS_MASK DesiredAccess
,
766 IN PGENERIC_MAPPING GenericMapping
,
767 OUT PPRIVILEGE_SET PrivilegeSet
,
768 OUT PULONG ReturnLength
,
769 OUT PULONG GrantedAccess
,
770 OUT PBOOLEAN AccessStatus
)
772 FIXME("(%p, %p, %08lx, %p, %p, %p, %p, %p), stub\n",
773 SecurityDescriptor
, ClientToken
, DesiredAccess
, GenericMapping
,
774 PrivilegeSet
, ReturnLength
, GrantedAccess
, AccessStatus
);
775 *AccessStatus
= TRUE
;
776 return STATUS_SUCCESS
;
779 /******************************************************************************
780 * NtSetSecurityObject [NTDLL.@]
785 IN SECURITY_INFORMATION SecurityInformation
,
786 IN PSECURITY_DESCRIPTOR SecurityDescriptor
)
788 FIXME("%p 0x%08lx %p\n", Handle
, SecurityInformation
, SecurityDescriptor
);
789 return STATUS_SUCCESS
;
792 /******************************************************************************
793 * RtlGetControlSecurityDescriptor (NTDLL.@)
796 NTSTATUS WINAPI
RtlGetControlSecurityDescriptor(
797 PSECURITY_DESCRIPTOR pSecurityDescriptor
,
798 PSECURITY_DESCRIPTOR_CONTROL pControl
,
799 LPDWORD lpdwRevision
)
801 FIXME("(%p,%p,%p),stub!\n",pSecurityDescriptor
,pControl
,lpdwRevision
);
802 return STATUS_SUCCESS
;
805 /******************************************************************************
806 * RtlConvertSidToUnicodeString (NTDLL.@)
808 * The returned SID is used to access the USER registry hive usually
810 * the native function returns something like
811 * "S-1-5-21-0000000000-000000000-0000000000-500";
813 NTSTATUS WINAPI
RtlConvertSidToUnicodeString(
814 PUNICODE_STRING String
,
816 BOOLEAN AllocateString
)
818 const char *p
= wine_get_user_name();
822 FIXME("(%p %p %u)\n", String
, Sid
, AllocateString
);
824 RtlInitAnsiString(&AnsiStr
, p
);
825 status
= RtlAnsiStringToUnicodeString(String
, &AnsiStr
, AllocateString
);
827 TRACE("%s (%u %u)\n",debugstr_w(String
->Buffer
),String
->Length
,String
->MaximumLength
);