Added support for special treatments (use 2 or more fonts, codepage
[wine.git] / dlls / ntdll / sec.c
blob7ff4bb16bff6478ca8c9ae12af25ffcd5918a6b8
1 /*
2 * Security functions
4 * Copyright 1996-1998 Marcus Meissner
5 */
7 #include <stdlib.h>
8 #include <string.h>
9 #include <time.h>
10 #include <ctype.h>
11 #include <math.h>
12 #include "windef.h"
13 #include "winbase.h"
14 #include "wine/winestring.h"
15 #include "file.h"
16 #include "heap.h"
17 #include "winnls.h"
18 #include "debugtools.h"
19 #include "winerror.h"
20 #include "stackframe.h"
22 #include "ntddk.h"
23 #include "winreg.h"
24 #include "ntdll_misc.h"
26 DEFAULT_DEBUG_CHANNEL(ntdll);
28 #define NT_SUCCESS(status) (status == STATUS_SUCCESS)
31 * SID FUNCTIONS
34 /******************************************************************************
35 * RtlAllocateAndInitializeSid [NTDLL.265]
38 BOOLEAN WINAPI RtlAllocateAndInitializeSid (
39 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
40 BYTE nSubAuthorityCount,
41 DWORD nSubAuthority0, DWORD nSubAuthority1,
42 DWORD nSubAuthority2, DWORD nSubAuthority3,
43 DWORD nSubAuthority4, DWORD nSubAuthority5,
44 DWORD nSubAuthority6, DWORD nSubAuthority7,
45 PSID *pSid )
47 TRACE("(%p, 0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,%p)\n",
48 pIdentifierAuthority,nSubAuthorityCount,
49 nSubAuthority0, nSubAuthority1, nSubAuthority2, nSubAuthority3,
50 nSubAuthority4, nSubAuthority5, nSubAuthority6, nSubAuthority7, pSid);
52 if (!(*pSid = HeapAlloc( GetProcessHeap(), 0, RtlLengthRequiredSid(nSubAuthorityCount))))
53 return FALSE;
55 (*pSid)->Revision = SID_REVISION;
57 if (pIdentifierAuthority)
58 memcpy(&(*pSid)->IdentifierAuthority, pIdentifierAuthority, sizeof (SID_IDENTIFIER_AUTHORITY));
59 *RtlSubAuthorityCountSid(*pSid) = nSubAuthorityCount;
61 if (nSubAuthorityCount > 0)
62 *RtlSubAuthoritySid(*pSid, 0) = nSubAuthority0;
63 if (nSubAuthorityCount > 1)
64 *RtlSubAuthoritySid(*pSid, 1) = nSubAuthority1;
65 if (nSubAuthorityCount > 2)
66 *RtlSubAuthoritySid(*pSid, 2) = nSubAuthority2;
67 if (nSubAuthorityCount > 3)
68 *RtlSubAuthoritySid(*pSid, 3) = nSubAuthority3;
69 if (nSubAuthorityCount > 4)
70 *RtlSubAuthoritySid(*pSid, 4) = nSubAuthority4;
71 if (nSubAuthorityCount > 5)
72 *RtlSubAuthoritySid(*pSid, 5) = nSubAuthority5;
73 if (nSubAuthorityCount > 6)
74 *RtlSubAuthoritySid(*pSid, 6) = nSubAuthority6;
75 if (nSubAuthorityCount > 7)
76 *RtlSubAuthoritySid(*pSid, 7) = nSubAuthority7;
78 return STATUS_SUCCESS;
80 /******************************************************************************
81 * RtlEqualSid [NTDLL.352]
84 BOOL WINAPI RtlEqualSid( PSID pSid1, PSID pSid2 )
86 if (!RtlValidSid(pSid1) || !RtlValidSid(pSid2))
87 return FALSE;
89 if (*RtlSubAuthorityCountSid(pSid1) != *RtlSubAuthorityCountSid(pSid2))
90 return FALSE;
92 if (memcmp(pSid1, pSid2, RtlLengthSid(pSid1)) != 0)
93 return FALSE;
95 return TRUE;
98 /******************************************************************************
99 * RtlEqualPrefixSid [ntdll.]
101 BOOL WINAPI RtlEqualPrefixSid (PSID pSid1, PSID pSid2)
103 if (!RtlValidSid(pSid1) || !RtlValidSid(pSid2))
104 return FALSE;
106 if (*RtlSubAuthorityCountSid(pSid1) != *RtlSubAuthorityCountSid(pSid2))
107 return FALSE;
109 if (memcmp(pSid1, pSid2, RtlLengthRequiredSid(pSid1->SubAuthorityCount - 1)) != 0)
110 return FALSE;
112 return TRUE;
116 /******************************************************************************
117 * RtlFreeSid [NTDLL.376]
119 DWORD WINAPI RtlFreeSid(PSID pSid)
121 TRACE("(%p)\n", pSid);
122 HeapFree( GetProcessHeap(), 0, pSid );
123 return STATUS_SUCCESS;
126 /**************************************************************************
127 * RtlLengthRequiredSid [NTDLL.427]
129 * PARAMS
130 * nSubAuthorityCount []
132 DWORD WINAPI RtlLengthRequiredSid(DWORD nrofsubauths)
134 return (nrofsubauths-1)*sizeof(DWORD) + sizeof(SID);
137 /**************************************************************************
138 * RtlLengthSid [NTDLL.429]
140 DWORD WINAPI RtlLengthSid(PSID pSid)
142 TRACE("sid=%p\n",pSid);
143 if (!pSid) return 0;
144 return RtlLengthRequiredSid(*RtlSubAuthorityCountSid(pSid));
147 /**************************************************************************
148 * RtlInitializeSid [NTDLL.410]
150 BOOL WINAPI RtlInitializeSid(
151 PSID pSid,
152 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
153 BYTE nSubAuthorityCount)
155 int i;
156 if (nSubAuthorityCount >= SID_MAX_SUB_AUTHORITIES)
157 return FALSE;
159 pSid->Revision = SID_REVISION;
160 pSid->SubAuthorityCount = nSubAuthorityCount;
161 if (pIdentifierAuthority)
162 memcpy(&pSid->IdentifierAuthority, pIdentifierAuthority, sizeof (SID_IDENTIFIER_AUTHORITY));
164 for (i = 0; i < nSubAuthorityCount; i++)
165 *RtlSubAuthoritySid(pSid, i) = 0;
167 return TRUE;
170 /**************************************************************************
171 * RtlSubAuthoritySid [NTDLL.497]
173 * PARAMS
174 * pSid []
175 * nSubAuthority []
177 LPDWORD WINAPI RtlSubAuthoritySid( PSID pSid, DWORD nSubAuthority )
179 return &(pSid->SubAuthority[nSubAuthority]);
182 /**************************************************************************
183 * RtlIdentifierAuthoritySid [NTDLL.395]
185 * PARAMS
186 * pSid []
188 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid( PSID pSid )
190 return &(pSid->IdentifierAuthority);
193 /**************************************************************************
194 * RtlSubAuthorityCountSid [NTDLL.496]
196 * PARAMS
197 * pSid []
198 * nSubAuthority []
200 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID pSid)
202 return &(pSid->SubAuthorityCount);
205 /**************************************************************************
206 * RtlCopySid [NTDLL.302]
208 DWORD WINAPI RtlCopySid( DWORD nDestinationSidLength, PSID pDestinationSid, PSID pSourceSid )
210 if (!pSourceSid || !RtlValidSid(pSourceSid) ||
211 (nDestinationSidLength < RtlLengthSid(pSourceSid)))
212 return FALSE;
214 if (nDestinationSidLength < (pSourceSid->SubAuthorityCount*4+8))
215 return FALSE;
217 memmove(pDestinationSid, pSourceSid, pSourceSid->SubAuthorityCount*4+8);
218 return TRUE;
220 /******************************************************************************
221 * RtlValidSid [NTDLL.532]
223 * PARAMS
224 * pSid []
226 BOOL WINAPI
227 RtlValidSid( PSID pSid )
229 if (IsBadReadPtr(pSid, 4))
231 WARN("(%p): invalid pointer!\n", pSid);
232 return FALSE;
235 if (pSid->SubAuthorityCount > SID_MAX_SUB_AUTHORITIES)
236 return FALSE;
238 if (!pSid || pSid->Revision != SID_REVISION)
239 return FALSE;
241 return TRUE;
246 * security descriptor functions
249 /**************************************************************************
250 * RtlCreateSecurityDescriptor [NTDLL.313]
252 * RETURNS:
253 * 0 success,
254 * STATUS_INVALID_OWNER, STATUS_PRIVILEGE_NOT_HELD, STATUS_NO_INHERITANCE,
255 * STATUS_NO_MEMORY
257 NTSTATUS WINAPI RtlCreateSecurityDescriptor(
258 PSECURITY_DESCRIPTOR lpsd,
259 DWORD rev)
261 if (rev!=SECURITY_DESCRIPTOR_REVISION)
262 return STATUS_UNKNOWN_REVISION;
263 memset(lpsd,'\0',sizeof(*lpsd));
264 lpsd->Revision = SECURITY_DESCRIPTOR_REVISION;
265 return STATUS_SUCCESS;
267 /**************************************************************************
268 * RtlValidSecurityDescriptor [NTDLL.313]
271 NTSTATUS WINAPI RtlValidSecurityDescriptor(
272 PSECURITY_DESCRIPTOR SecurityDescriptor)
274 if ( ! SecurityDescriptor )
275 return STATUS_INVALID_SECURITY_DESCR;
276 if ( SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION )
277 return STATUS_UNKNOWN_REVISION;
279 return STATUS_SUCCESS;
282 /**************************************************************************
283 * RtlLengthSecurityDescriptor [NTDLL]
285 ULONG WINAPI RtlLengthSecurityDescriptor(
286 PSECURITY_DESCRIPTOR SecurityDescriptor)
288 ULONG Size;
289 Size = SECURITY_DESCRIPTOR_MIN_LENGTH;
290 if ( SecurityDescriptor == NULL )
291 return 0;
293 if ( SecurityDescriptor->Owner != NULL )
294 Size += SecurityDescriptor->Owner->SubAuthorityCount;
295 if ( SecurityDescriptor->Group != NULL )
296 Size += SecurityDescriptor->Group->SubAuthorityCount;
299 if ( SecurityDescriptor->Sacl != NULL )
300 Size += SecurityDescriptor->Sacl->AclSize;
301 if ( SecurityDescriptor->Dacl != NULL )
302 Size += SecurityDescriptor->Dacl->AclSize;
304 return Size;
307 /******************************************************************************
308 * RtlGetDaclSecurityDescriptor [NTDLL]
311 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(
312 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
313 OUT PBOOLEAN lpbDaclPresent,
314 OUT PACL *pDacl,
315 OUT PBOOLEAN lpbDaclDefaulted)
317 TRACE("(%p,%p,%p,%p)\n",
318 pSecurityDescriptor, lpbDaclPresent, *pDacl, lpbDaclDefaulted);
320 if (pSecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION)
321 return STATUS_UNKNOWN_REVISION ;
323 if ( (*lpbDaclPresent = (SE_DACL_PRESENT & pSecurityDescriptor->Control) ? 1 : 0) )
325 if ( SE_SELF_RELATIVE & pSecurityDescriptor->Control)
326 { *pDacl = (PACL) ((LPBYTE)pSecurityDescriptor + (DWORD)pSecurityDescriptor->Dacl);
328 else
329 { *pDacl = pSecurityDescriptor->Dacl;
333 *lpbDaclDefaulted = (( SE_DACL_DEFAULTED & pSecurityDescriptor->Control ) ? 1 : 0);
335 return STATUS_SUCCESS;
338 /**************************************************************************
339 * RtlSetDaclSecurityDescriptor [NTDLL.483]
341 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor (
342 PSECURITY_DESCRIPTOR lpsd,
343 BOOLEAN daclpresent,
344 PACL dacl,
345 BOOLEAN dacldefaulted )
347 if (lpsd->Revision!=SECURITY_DESCRIPTOR_REVISION)
348 return STATUS_UNKNOWN_REVISION;
349 if (lpsd->Control & SE_SELF_RELATIVE)
350 return STATUS_INVALID_SECURITY_DESCR;
352 if (!daclpresent)
353 { lpsd->Control &= ~SE_DACL_PRESENT;
354 return TRUE;
357 lpsd->Control |= SE_DACL_PRESENT;
358 lpsd->Dacl = dacl;
360 if (dacldefaulted)
361 lpsd->Control |= SE_DACL_DEFAULTED;
362 else
363 lpsd->Control &= ~SE_DACL_DEFAULTED;
365 return STATUS_SUCCESS;
368 /******************************************************************************
369 * RtlGetSaclSecurityDescriptor [NTDLL]
372 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(
373 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
374 OUT PBOOLEAN lpbSaclPresent,
375 OUT PACL *pSacl,
376 OUT PBOOLEAN lpbSaclDefaulted)
378 TRACE("(%p,%p,%p,%p)\n",
379 pSecurityDescriptor, lpbSaclPresent, *pSacl, lpbSaclDefaulted);
381 if (pSecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION)
382 return STATUS_UNKNOWN_REVISION ;
384 if ( (*lpbSaclPresent = (SE_SACL_PRESENT & pSecurityDescriptor->Control) ? 1 : 0) )
386 if ( SE_SELF_RELATIVE & pSecurityDescriptor->Control)
387 { *pSacl = (PACL) ((LPBYTE)pSecurityDescriptor + (DWORD)pSecurityDescriptor->Sacl);
389 else
390 { *pSacl = pSecurityDescriptor->Sacl;
394 *lpbSaclDefaulted = (( SE_SACL_DEFAULTED & pSecurityDescriptor->Control ) ? 1 : 0);
396 return STATUS_SUCCESS;
399 /**************************************************************************
400 * RtlSetSaclSecurityDescriptor [NTDLL.488]
402 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor (
403 PSECURITY_DESCRIPTOR lpsd,
404 BOOLEAN saclpresent,
405 PACL sacl,
406 BOOLEAN sacldefaulted)
408 if (lpsd->Revision!=SECURITY_DESCRIPTOR_REVISION)
409 return STATUS_UNKNOWN_REVISION;
410 if (lpsd->Control & SE_SELF_RELATIVE)
411 return STATUS_INVALID_SECURITY_DESCR;
412 if (!saclpresent) {
413 lpsd->Control &= ~SE_SACL_PRESENT;
414 return 0;
416 lpsd->Control |= SE_SACL_PRESENT;
417 lpsd->Sacl = sacl;
418 if (sacldefaulted)
419 lpsd->Control |= SE_SACL_DEFAULTED;
420 else
421 lpsd->Control &= ~SE_SACL_DEFAULTED;
422 return STATUS_SUCCESS;
425 /**************************************************************************
426 * RtlGetOwnerSecurityDescriptor [NTDLL.488]
428 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
429 PSECURITY_DESCRIPTOR SecurityDescriptor,
430 PSID *Owner,
431 PBOOLEAN OwnerDefaulted)
433 if ( !SecurityDescriptor || !Owner || !OwnerDefaulted )
434 return STATUS_INVALID_PARAMETER;
436 *Owner = SecurityDescriptor->Owner;
437 if ( *Owner != NULL ) {
438 if ( SecurityDescriptor->Control & SE_OWNER_DEFAULTED )
439 *OwnerDefaulted = TRUE;
440 else
441 *OwnerDefaulted = FALSE;
443 return STATUS_SUCCESS;
446 /**************************************************************************
447 * RtlSetOwnerSecurityDescriptor [NTDLL.487]
449 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(
450 PSECURITY_DESCRIPTOR lpsd,
451 PSID owner,
452 BOOLEAN ownerdefaulted)
454 if (lpsd->Revision!=SECURITY_DESCRIPTOR_REVISION)
455 return STATUS_UNKNOWN_REVISION;
456 if (lpsd->Control & SE_SELF_RELATIVE)
457 return STATUS_INVALID_SECURITY_DESCR;
459 lpsd->Owner = owner;
460 if (ownerdefaulted)
461 lpsd->Control |= SE_OWNER_DEFAULTED;
462 else
463 lpsd->Control &= ~SE_OWNER_DEFAULTED;
464 return STATUS_SUCCESS;
467 /**************************************************************************
468 * RtlSetGroupSecurityDescriptor [NTDLL.485]
470 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor (
471 PSECURITY_DESCRIPTOR lpsd,
472 PSID group,
473 BOOLEAN groupdefaulted)
475 if (lpsd->Revision!=SECURITY_DESCRIPTOR_REVISION)
476 return STATUS_UNKNOWN_REVISION;
477 if (lpsd->Control & SE_SELF_RELATIVE)
478 return STATUS_INVALID_SECURITY_DESCR;
480 lpsd->Group = group;
481 if (groupdefaulted)
482 lpsd->Control |= SE_GROUP_DEFAULTED;
483 else
484 lpsd->Control &= ~SE_GROUP_DEFAULTED;
485 return STATUS_SUCCESS;
487 /**************************************************************************
488 * RtlGetGroupSecurityDescriptor [NTDLL]
490 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
491 PSECURITY_DESCRIPTOR SecurityDescriptor,
492 PSID *Group,
493 PBOOLEAN GroupDefaulted)
495 if ( !SecurityDescriptor || !Group || !GroupDefaulted )
496 return STATUS_INVALID_PARAMETER;
498 *Group = SecurityDescriptor->Group;
499 if ( *Group != NULL ) {
500 if ( SecurityDescriptor->Control & SE_GROUP_DEFAULTED )
501 *GroupDefaulted = TRUE;
502 else
503 *GroupDefaulted = FALSE;
505 return STATUS_SUCCESS;
508 /**************************************************************************
509 * RtlMakeSelfRelativeSD [NTDLL]
511 NTSTATUS WINAPI RtlMakeSelfRelativeSD(
512 IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
513 IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
514 IN OUT LPDWORD lpdwBufferLength)
516 FIXME("(%p,%p,%p(%lu))\n", pAbsoluteSecurityDescriptor,
517 pSelfRelativeSecurityDescriptor, lpdwBufferLength,*lpdwBufferLength);
518 return STATUS_SUCCESS;
522 * access control list's
525 /**************************************************************************
526 * RtlCreateAcl [NTDLL.306]
528 * NOTES
529 * This should return NTSTATUS
531 NTSTATUS WINAPI RtlCreateAcl(PACL acl,DWORD size,DWORD rev)
533 TRACE("%p 0x%08lx 0x%08lx\n", acl, size, rev);
535 if (rev!=ACL_REVISION)
536 return STATUS_INVALID_PARAMETER;
537 if (size<sizeof(ACL))
538 return STATUS_BUFFER_TOO_SMALL;
539 if (size>0xFFFF)
540 return STATUS_INVALID_PARAMETER;
542 memset(acl,'\0',sizeof(ACL));
543 acl->AclRevision = rev;
544 acl->AclSize = size;
545 acl->AceCount = 0;
546 return 0;
549 /**************************************************************************
550 * RtlFirstFreeAce [NTDLL.370]
551 * looks for the AceCount+1 ACE, and if it is still within the alloced
552 * ACL, return a pointer to it
554 BOOLEAN WINAPI RtlFirstFreeAce(
555 PACL acl,
556 PACE_HEADER *x)
558 PACE_HEADER ace;
559 int i;
561 *x = 0;
562 ace = (PACE_HEADER)(acl+1);
563 for (i=0;i<acl->AceCount;i++) {
564 if ((DWORD)ace>=(((DWORD)acl)+acl->AclSize))
565 return 0;
566 ace = (PACE_HEADER)(((BYTE*)ace)+ace->AceSize);
568 if ((DWORD)ace>=(((DWORD)acl)+acl->AclSize))
569 return 0;
570 *x = ace;
571 return 1;
574 /**************************************************************************
575 * RtlAddAce [NTDLL.260]
577 NTSTATUS WINAPI RtlAddAce(
578 PACL acl,
579 DWORD rev,
580 DWORD xnrofaces,
581 PACE_HEADER acestart,
582 DWORD acelen)
584 PACE_HEADER ace,targetace;
585 int nrofaces;
587 if (acl->AclRevision != ACL_REVISION)
588 return STATUS_INVALID_PARAMETER;
589 if (!RtlFirstFreeAce(acl,&targetace))
590 return STATUS_INVALID_PARAMETER;
591 nrofaces=0;ace=acestart;
592 while (((DWORD)ace-(DWORD)acestart)<acelen) {
593 nrofaces++;
594 ace = (PACE_HEADER)(((BYTE*)ace)+ace->AceSize);
596 if ((DWORD)targetace+acelen>(DWORD)acl+acl->AclSize) /* too much aces */
597 return STATUS_INVALID_PARAMETER;
598 memcpy((LPBYTE)targetace,acestart,acelen);
599 acl->AceCount+=nrofaces;
600 return STATUS_SUCCESS;
603 /******************************************************************************
604 * RtlAddAccessAllowedAce [NTDLL]
606 BOOL WINAPI RtlAddAccessAllowedAce(
607 IN OUT PACL pAcl,
608 IN DWORD dwAceRevision,
609 IN DWORD AccessMask,
610 IN PSID pSid)
612 FIXME("(%p,0x%08lx,0x%08lx,%p),stub!\n",
613 pAcl, dwAceRevision, AccessMask, pSid);
614 return 0;
617 /******************************************************************************
618 * RtlGetAce [NTDLL]
620 DWORD WINAPI RtlGetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce )
622 FIXME("(%p,%ld,%p),stub!\n",pAcl,dwAceIndex,pAce);
623 return 0;
627 * misc
630 /******************************************************************************
631 * RtlAdjustPrivilege [NTDLL]
633 DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4)
635 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4);
636 return 0;
639 /******************************************************************************
640 * RtlImpersonateSelf [NTDLL]
642 BOOL WINAPI
643 RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
645 FIXME("(%08x), stub\n", ImpersonationLevel);
646 return TRUE;
649 /******************************************************************************
650 * NtAccessCheck [NTDLL]
652 NTSTATUS WINAPI
653 NtAccessCheck(
654 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
655 IN HANDLE ClientToken,
656 IN ACCESS_MASK DesiredAccess,
657 IN PGENERIC_MAPPING GenericMapping,
658 OUT PPRIVILEGE_SET PrivilegeSet,
659 OUT PULONG ReturnLength,
660 OUT PULONG GrantedAccess,
661 OUT PBOOLEAN AccessStatus)
663 FIXME("(%p, %04x, %08lx, %p, %p, %p, %p, %p), stub\n",
664 SecurityDescriptor, ClientToken, DesiredAccess, GenericMapping,
665 PrivilegeSet, ReturnLength, GrantedAccess, AccessStatus);
666 *AccessStatus = TRUE;
667 return STATUS_SUCCESS;
670 /******************************************************************************
671 * NtSetSecurityObject [NTDLL]
673 NTSTATUS WINAPI
674 NtSetSecurityObject(
675 IN HANDLE Handle,
676 IN SECURITY_INFORMATION SecurityInformation,
677 IN PSECURITY_DESCRIPTOR SecurityDescriptor)
679 FIXME("0x%08x 0x%08lx %p\n", Handle, SecurityInformation, SecurityDescriptor);
680 return STATUS_SUCCESS;
683 /******************************************************************************
684 * RtlGetControlSecurityDescriptor
687 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(
688 PSECURITY_DESCRIPTOR pSecurityDescriptor,
689 PSECURITY_DESCRIPTOR_CONTROL pControl,
690 LPDWORD lpdwRevision)
692 FIXME("(%p,%p,%p),stub!\n",pSecurityDescriptor,pControl,lpdwRevision);
693 return STATUS_SUCCESS;
696 /******************************************************************************
697 * RtlConvertSidToUnicodeString
699 NTSTATUS WINAPI RtlConvertSidToUnicodeString(
700 PUNICODE_STRING UnicodeSID,
701 PSID *pSid)
703 /* LPSTR GenSID = "S-1-5-21-0000000000-000000000-0000000000-500"; */
705 LPSTR GenSID = ".Default"; /* usually the returned SID is used to */
706 /* access "\\REGISTRY\\USER\\.DEFAULT" */
708 ANSI_STRING AnsiStr;
710 FIXME("(%p %p)\n", UnicodeSID, pSid);
711 dump_UnicodeString(UnicodeSID, FALSE);
713 RtlInitAnsiString(&AnsiStr, GenSID);
714 return RtlAnsiStringToUnicodeString(UnicodeSID, &AnsiStr, TRUE);