1 /* $Id: misc.c,v 1.30 2004/12/13 19:06:28 weiden Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/advapi32/sec/misc.c
6 * PURPOSE: Miscellaneous security functions
21 AreAllAccessesGranted(DWORD GrantedAccess
,
24 return((BOOL
)RtlAreAllAccessesGranted(GrantedAccess
,
33 AreAnyAccessesGranted(DWORD GrantedAccess
,
36 return((BOOL
)RtlAreAnyAccessesGranted(GrantedAccess
,
41 /******************************************************************************
42 * GetFileSecurityA [ADVAPI32.@]
44 * Obtains Specified information about the security of a file or directory.
47 * lpFileName [I] Name of the file to get info for
48 * RequestedInformation [I] SE_ flags from "winnt.h"
49 * pSecurityDescriptor [O] Destination for security information
50 * nLength [I] Length of pSecurityDescriptor
51 * lpnLengthNeeded [O] Destination for length of returned security information
54 * Success: TRUE. pSecurityDescriptor contains the requested information.
55 * Failure: FALSE. lpnLengthNeeded contains the required space to return the info.
58 * The information returned is constrained by the callers access rights and
64 GetFileSecurityA(LPCSTR lpFileName
,
65 SECURITY_INFORMATION RequestedInformation
,
66 PSECURITY_DESCRIPTOR pSecurityDescriptor
,
68 LPDWORD lpnLengthNeeded
)
70 UNICODE_STRING FileName
;
74 Status
= RtlCreateUnicodeStringFromAsciiz(&FileName
,
76 if (!NT_SUCCESS(Status
))
78 SetLastError(RtlNtStatusToDosError(Status
));
82 bResult
= GetFileSecurityW(FileName
.Buffer
,
88 RtlFreeUnicodeString(&FileName
);
98 GetFileSecurityW(LPCWSTR lpFileName
,
99 SECURITY_INFORMATION RequestedInformation
,
100 PSECURITY_DESCRIPTOR pSecurityDescriptor
,
102 LPDWORD lpnLengthNeeded
)
104 OBJECT_ATTRIBUTES ObjectAttributes
;
105 IO_STATUS_BLOCK StatusBlock
;
106 UNICODE_STRING FileName
;
107 ULONG AccessMask
= 0;
111 DPRINT("GetFileSecurityW() called\n");
113 if (RequestedInformation
&
114 (OWNER_SECURITY_INFORMATION
| GROUP_SECURITY_INFORMATION
| DACL_SECURITY_INFORMATION
))
116 AccessMask
|= STANDARD_RIGHTS_READ
;
119 if (RequestedInformation
& SACL_SECURITY_INFORMATION
)
121 AccessMask
|= ACCESS_SYSTEM_SECURITY
;
124 if (!RtlDosPathNameToNtPathName_U((LPWSTR
)lpFileName
,
129 DPRINT("Invalid path\n");
130 SetLastError(ERROR_INVALID_NAME
);
134 InitializeObjectAttributes(&ObjectAttributes
,
136 OBJ_CASE_INSENSITIVE
,
140 Status
= NtOpenFile(&FileHandle
,
144 FILE_SHARE_READ
| FILE_SHARE_WRITE
| FILE_SHARE_DELETE
,
146 if (!NT_SUCCESS(Status
))
148 DPRINT("NtOpenFile() failed (Status %lx)\n", Status
);
149 SetLastError(RtlNtStatusToDosError(Status
));
153 RtlFreeUnicodeString(&FileName
);
155 Status
= NtQuerySecurityObject(FileHandle
,
156 RequestedInformation
,
162 if (!NT_SUCCESS(Status
))
164 DPRINT("NtQuerySecurityObject() failed (Status %lx)\n", Status
);
165 SetLastError(RtlNtStatusToDosError(Status
));
177 GetKernelObjectSecurity(HANDLE Handle
,
178 SECURITY_INFORMATION RequestedInformation
,
179 PSECURITY_DESCRIPTOR pSecurityDescriptor
,
181 LPDWORD lpnLengthNeeded
)
185 Status
= NtQuerySecurityObject(Handle
,
186 RequestedInformation
,
190 if (!NT_SUCCESS(Status
))
192 SetLastError(RtlNtStatusToDosError(Status
));
199 /******************************************************************************
200 * SetFileSecurityA [ADVAPI32.@]
201 * Sets the security of a file or directory
206 SetFileSecurityA (LPCSTR lpFileName
,
207 SECURITY_INFORMATION SecurityInformation
,
208 PSECURITY_DESCRIPTOR pSecurityDescriptor
)
210 UNICODE_STRING FileName
;
214 Status
= RtlCreateUnicodeStringFromAsciiz(&FileName
,
216 if (!NT_SUCCESS(Status
))
218 SetLastError(RtlNtStatusToDosError(Status
));
222 bResult
= SetFileSecurityW(FileName
.Buffer
,
224 pSecurityDescriptor
);
226 RtlFreeUnicodeString(&FileName
);
232 /******************************************************************************
233 * SetFileSecurityW [ADVAPI32.@]
234 * Sets the security of a file or directory
239 SetFileSecurityW (LPCWSTR lpFileName
,
240 SECURITY_INFORMATION SecurityInformation
,
241 PSECURITY_DESCRIPTOR pSecurityDescriptor
)
243 OBJECT_ATTRIBUTES ObjectAttributes
;
244 IO_STATUS_BLOCK StatusBlock
;
245 UNICODE_STRING FileName
;
246 ULONG AccessMask
= 0;
250 DPRINT("SetFileSecurityW() called\n");
252 if (SecurityInformation
&
253 (OWNER_SECURITY_INFORMATION
| GROUP_SECURITY_INFORMATION
))
255 AccessMask
|= WRITE_OWNER
;
258 if (SecurityInformation
& DACL_SECURITY_INFORMATION
)
260 AccessMask
|= WRITE_DAC
;
263 if (SecurityInformation
& SACL_SECURITY_INFORMATION
)
265 AccessMask
|= ACCESS_SYSTEM_SECURITY
;
268 if (!RtlDosPathNameToNtPathName_U((LPWSTR
)lpFileName
,
273 DPRINT("Invalid path\n");
274 SetLastError(ERROR_INVALID_NAME
);
278 InitializeObjectAttributes(&ObjectAttributes
,
280 OBJ_CASE_INSENSITIVE
,
284 Status
= NtOpenFile(&FileHandle
,
288 FILE_SHARE_READ
| FILE_SHARE_WRITE
| FILE_SHARE_DELETE
,
290 if (!NT_SUCCESS(Status
))
292 DPRINT("NtOpenFile() failed (Status %lx)\n", Status
);
293 SetLastError(RtlNtStatusToDosError(Status
));
297 RtlFreeUnicodeString(&FileName
);
299 Status
= NtSetSecurityObject(FileHandle
,
301 pSecurityDescriptor
);
304 if (!NT_SUCCESS(Status
))
306 DPRINT("NtSetSecurityObject() failed (Status %lx)\n", Status
);
307 SetLastError(RtlNtStatusToDosError(Status
));
319 SetKernelObjectSecurity(HANDLE Handle
,
320 SECURITY_INFORMATION SecurityInformation
,
321 PSECURITY_DESCRIPTOR SecurityDescriptor
)
325 Status
= NtSetSecurityObject(Handle
,
328 if (!NT_SUCCESS(Status
))
330 SetLastError(RtlNtStatusToDosError(Status
));
341 MapGenericMask(PDWORD AccessMask
,
342 PGENERIC_MAPPING GenericMapping
)
344 RtlMapGenericMask(AccessMask
,
353 ImpersonateLoggedOnUser(HANDLE hToken
)
355 SECURITY_QUALITY_OF_SERVICE Qos
;
356 OBJECT_ATTRIBUTES ObjectAttributes
;
363 /* Get the token type */
364 Status
= NtQueryInformationToken (hToken
,
369 if (!NT_SUCCESS(Status
))
371 SetLastError (RtlNtStatusToDosError (Status
));
375 if (Type
== TokenPrimary
)
377 /* Create a duplicate impersonation token */
378 Qos
.Length
= sizeof(SECURITY_QUALITY_OF_SERVICE
);
379 Qos
.ImpersonationLevel
= SecurityImpersonation
;
380 Qos
.ContextTrackingMode
= SECURITY_DYNAMIC_TRACKING
;
381 Qos
.EffectiveOnly
= FALSE
;
383 ObjectAttributes
.Length
= sizeof(OBJECT_ATTRIBUTES
);
384 ObjectAttributes
.RootDirectory
= NULL
;
385 ObjectAttributes
.ObjectName
= NULL
;
386 ObjectAttributes
.Attributes
= 0;
387 ObjectAttributes
.SecurityDescriptor
= NULL
;
388 ObjectAttributes
.SecurityQualityOfService
= &Qos
;
390 Status
= NtDuplicateToken (hToken
,
391 TOKEN_IMPERSONATE
| TOKEN_QUERY
,
396 if (!NT_SUCCESS(Status
))
398 SetLastError (RtlNtStatusToDosError (Status
));
406 /* User the original impersonation token */
411 /* Impersonate the the current thread */
412 Status
= NtSetInformationThread (NtCurrentThread (),
413 ThreadImpersonationToken
,
417 if (Duplicated
== TRUE
)
422 if (!NT_SUCCESS(Status
))
424 SetLastError (RtlNtStatusToDosError (Status
));
436 ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
)
440 Status
= RtlImpersonateSelf(ImpersonationLevel
);
441 if (!NT_SUCCESS(Status
))
443 SetLastError(RtlNtStatusToDosError(Status
));
459 Status
= NtSetInformationThread(NtCurrentThread(),
460 ThreadImpersonationToken
,
463 if (!NT_SUCCESS(Status
))
465 SetLastError(RtlNtStatusToDosError(Status
));
472 /******************************************************************************
473 * GetUserNameA [ADVAPI32.@]
475 * Get the current user name.
478 * lpszName [O] Destination for the user name.
479 * lpSize [I/O] Size of lpszName.
485 GetUserNameA( LPSTR lpszName
, LPDWORD lpSize
)
487 WCHAR
* lpszNameW
= NULL
;
492 SetLastError(ERROR_INVALID_PARAMETER
);
497 lpszNameW
= LocalAlloc ( LMEM_FIXED
, len
* sizeof(WCHAR
) );
499 if ( !GetUserNameW ( lpszNameW
, &len
) )
501 LocalFree ( lpszNameW
);
505 len
= wcstombs ( lpszName
, lpszNameW
, len
);
507 LocalFree ( lpszNameW
);
511 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
519 /******************************************************************************
520 * GetUserNameW [ADVAPI32.@]
527 GetUserNameW ( LPWSTR lpszName
, LPDWORD lpSize
)
529 HANDLE hToken
= INVALID_HANDLE_VALUE
;
532 TOKEN_USER
* token_user
= NULL
;
534 SID_NAME_USE snu
= SidTypeUser
;
535 WCHAR
* domain_name
= NULL
;
538 if ( !OpenThreadToken ( GetCurrentThread(), TOKEN_QUERY
, FALSE
, &hToken
) )
540 DWORD dwLastError
= GetLastError();
541 if ( dwLastError
!= ERROR_NO_TOKEN
542 && dwLastError
!= ERROR_NO_IMPERSONATION_TOKEN
)
544 /* don't call SetLastError(),
545 as OpenThreadToken() ought to have set one */
548 if ( !OpenProcessToken ( GetCurrentProcess(), TOKEN_QUERY
, &hToken
) )
550 /* don't call SetLastError(),
551 as OpenProcessToken() ought to have set one */
555 tu_buf
= LocalAlloc ( LMEM_FIXED
, 36 );
558 SetLastError ( ERROR_NOT_ENOUGH_MEMORY
);
561 if ( !GetTokenInformation ( hToken
, TokenUser
, tu_buf
, 36, &tu_len
) || tu_len
> 36 )
563 LocalFree ( tu_buf
);
564 tu_buf
= LocalAlloc ( LMEM_FIXED
, tu_len
);
567 SetLastError ( ERROR_NOT_ENOUGH_MEMORY
);
570 if ( !GetTokenInformation ( hToken
, TokenUser
, tu_buf
, tu_len
, &tu_len
) )
572 /* don't call SetLastError(),
573 as GetTokenInformation() ought to have set one */
574 LocalFree ( tu_buf
);
575 CloseHandle ( hToken
);
579 token_user
= (TOKEN_USER
*)tu_buf
;
583 domain_name
= LocalAlloc ( LMEM_FIXED
, dn_len
* sizeof(WCHAR
) );
586 LocalFree ( tu_buf
);
587 SetLastError ( ERROR_NOT_ENOUGH_MEMORY
);
590 if ( !LookupAccountSidW ( NULL
, token_user
->User
.Sid
, lpszName
, &an_len
, domain_name
, &dn_len
, &snu
)
595 LocalFree ( domain_name
);
596 domain_name
= LocalAlloc ( LMEM_FIXED
, dn_len
* sizeof(WCHAR
) );
599 LocalFree ( tu_buf
);
600 SetLastError ( ERROR_NOT_ENOUGH_MEMORY
);
604 if ( !LookupAccountSidW ( NULL
, token_user
->User
.Sid
, lpszName
, &an_len
, domain_name
, &dn_len
, &snu
) )
606 /* don't call SetLastError(),
607 as LookupAccountSid() ought to have set one */
608 LocalFree ( domain_name
);
609 CloseHandle ( hToken
);
614 LocalFree ( domain_name
);
615 LocalFree ( tu_buf
);
616 CloseHandle ( hToken
);
618 if ( an_len
> *lpSize
)
621 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
629 /******************************************************************************
630 * LookupAccountSidA [ADVAPI32.@]
635 LookupAccountSidA (LPCSTR lpSystemName
,
639 LPSTR lpReferencedDomainName
,
640 LPDWORD cchReferencedDomainName
,
646 DPRINT1("LookupAccountSidA is unimplemented, but returns success\n");
648 /* Calculate length needed */
649 NameLength
= strlen("Administrator") + 1;
650 DomainLength
= strlen("BUILTIN") + 1;
652 if (*cchName
< NameLength
|| *cchReferencedDomainName
< DomainLength
)
654 *cchName
= NameLength
;
655 *cchReferencedDomainName
= DomainLength
;
656 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
660 if (lpName
) lstrcpynA(lpName
, "Administrator", *cchName
);
661 if (lpReferencedDomainName
) lstrcpynA(lpReferencedDomainName
, "BUILTIN", *cchReferencedDomainName
);
666 /******************************************************************************
667 * LookupAccountSidW [ADVAPI32.@]
672 LookupAccountSidW (LPCWSTR lpSystemName
,
676 LPWSTR lpReferencedDomainName
,
677 LPDWORD cchReferencedDomainName
,
683 DPRINT1("LookupAccountSidW is unimplemented, but returns success\n");
685 /* Calculate length needed */
686 NameLength
= wcslen(L
"Administrator") + sizeof(WCHAR
);
687 DomainLength
= wcslen(L
"BUILTIN") + sizeof(WCHAR
);
689 if (*cchName
< NameLength
|| *cchReferencedDomainName
< DomainLength
)
691 *cchName
= NameLength
;
692 *cchReferencedDomainName
= DomainLength
;
693 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
697 if (lpName
) lstrcpynW(lpName
, L
"Administrator", *cchName
);
698 if (lpReferencedDomainName
) lstrcpynW(lpReferencedDomainName
, L
"BUILTIN", *cchReferencedDomainName
);
703 /******************************************************************************
704 * LookupAccountNameA [ADVAPI32.@]
709 LookupAccountNameA (LPCSTR SystemName
,
713 LPSTR ReferencedDomainName
,
714 LPDWORD hReferencedDomainNameLength
,
715 PSID_NAME_USE SidNameUse
)
717 DPRINT1("LookupAccountNameA is unimplemented\n");
718 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
723 /******************************************************************************
724 * LookupAccountNameW [ADVAPI32.@]
729 LookupAccountNameW (LPCWSTR SystemName
,
733 LPWSTR ReferencedDomainName
,
734 LPDWORD hReferencedDomainNameLength
,
735 PSID_NAME_USE SidNameUse
)
737 DPRINT1("LookupAccountNameW is unimplemented\n");
738 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
743 /**********************************************************************
744 * LookupPrivilegeValueA EXPORTED
749 LookupPrivilegeValueA (LPCSTR lpSystemName
,
753 UNICODE_STRING SystemName
;
758 if (lpSystemName
!= NULL
)
760 RtlCreateUnicodeStringFromAsciiz (&SystemName
,
761 (LPSTR
)lpSystemName
);
764 /* Check the privilege name is not NULL */
767 SetLastError (ERROR_INVALID_PARAMETER
);
771 RtlCreateUnicodeStringFromAsciiz (&Name
,
774 Result
= LookupPrivilegeValueW ((lpSystemName
!= NULL
) ? SystemName
.Buffer
: NULL
,
778 RtlFreeUnicodeString (&Name
);
781 if (lpSystemName
!= NULL
)
783 RtlFreeUnicodeString (&SystemName
);
790 /**********************************************************************
791 * LookupPrivilegeValueW EXPORTED
796 LookupPrivilegeValueW (LPCWSTR SystemName
,
800 static const WCHAR
* const DefaultPrivNames
[] =
802 L
"SeCreateTokenPrivilege",
803 L
"SeAssignPrimaryTokenPrivilege",
804 L
"SeLockMemoryPrivilege",
805 L
"SeIncreaseQuotaPrivilege",
806 L
"SeUnsolicitedInputPrivilege",
807 L
"SeMachineAccountPrivilege",
809 L
"SeSecurityPrivilege",
810 L
"SeTakeOwnershipPrivilege",
811 L
"SeLoadDriverPrivilege",
812 L
"SeSystemProfilePrivilege",
813 L
"SeSystemtimePrivilege",
814 L
"SeProfileSingleProcessPrivilege",
815 L
"SeIncreaseBasePriorityPrivilege",
816 L
"SeCreatePagefilePrivilege",
817 L
"SeCreatePermanentPrivilege",
818 L
"SeBackupPrivilege",
819 L
"SeRestorePrivilege",
820 L
"SeShutdownPrivilege",
823 L
"SeSystemEnvironmentPrivilege",
824 L
"SeChangeNotifyPrivilege",
825 L
"SeRemoteShutdownPrivilege",
826 L
"SeUndockPrivilege",
827 L
"SeSyncAgentPrivilege",
828 L
"SeEnableDelegationPrivilege",
829 L
"SeManageVolumePrivilege",
830 L
"SeImpersonatePrivilege",
831 L
"SeCreateGlobalPrivilege"
835 if (NULL
!= SystemName
&& L
'\0' != *SystemName
)
837 DPRINT1("LookupPrivilegeValueW: not implemented for remote system\n");
838 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
842 for (Priv
= 0; Priv
< sizeof(DefaultPrivNames
) / sizeof(DefaultPrivNames
[0]); Priv
++)
844 if (0 == wcscmp(PrivName
, DefaultPrivNames
[Priv
]))
846 Luid
->LowPart
= Priv
+ 1;
852 DPRINT1("LookupPrivilegeValueW: no such privilege %S\n", PrivName
);
853 SetLastError(ERROR_NO_SUCH_PRIVILEGE
);
858 /**********************************************************************
859 * LookupPrivilegeDisplayNameA EXPORTED
864 LookupPrivilegeDisplayNameA (LPCSTR lpSystemName
,
867 LPDWORD cbDisplayName
,
868 LPDWORD lpLanguageId
)
870 DPRINT1("LookupPrivilegeDisplayNameA: stub\n");
871 SetLastError (ERROR_CALL_NOT_IMPLEMENTED
);
876 /**********************************************************************
877 * LookupPrivilegeDisplayNameW EXPORTED
882 LookupPrivilegeDisplayNameW (LPCWSTR lpSystemName
,
884 LPWSTR lpDisplayName
,
885 LPDWORD cbDisplayName
,
886 LPDWORD lpLanguageId
)
888 DPRINT1("LookupPrivilegeDisplayNameW: stub\n");
889 SetLastError (ERROR_CALL_NOT_IMPLEMENTED
);
894 /**********************************************************************
895 * LookupPrivilegeNameA EXPORTED
900 LookupPrivilegeNameA (LPCSTR lpSystemName
,
905 DPRINT1("LookupPrivilegeNameA: stub\n");
906 SetLastError (ERROR_CALL_NOT_IMPLEMENTED
);
911 /**********************************************************************
912 * LookupPrivilegeNameW EXPORTED
917 LookupPrivilegeNameW (LPCWSTR lpSystemName
,
922 DPRINT1("LookupPrivilegeNameW: stub\n");
923 SetLastError (ERROR_CALL_NOT_IMPLEMENTED
);
928 /**********************************************************************
929 * GetNamedSecurityInfoW EXPORTED
934 GetNamedSecurityInfoW(LPWSTR pObjectName
,
935 SE_OBJECT_TYPE ObjectType
,
936 SECURITY_INFORMATION SecurityInfo
,
941 PSECURITY_DESCRIPTOR
*ppSecurityDescriptor
)
943 DPRINT1("GetNamedSecurityInfoW: stub\n");
944 return ERROR_CALL_NOT_IMPLEMENTED
;
948 /**********************************************************************
949 * GetNamedSecurityInfoA EXPORTED
954 GetNamedSecurityInfoA(LPSTR pObjectName
,
955 SE_OBJECT_TYPE ObjectType
,
956 SECURITY_INFORMATION SecurityInfo
,
961 PSECURITY_DESCRIPTOR
*ppSecurityDescriptor
)
963 DPRINT1("GetNamedSecurityInfoA: stub\n");
964 return ERROR_CALL_NOT_IMPLEMENTED
;
968 /**********************************************************************
969 * SetNamedSecurityInfoW EXPORTED
974 SetNamedSecurityInfoW(LPWSTR pObjectName
,
975 SE_OBJECT_TYPE ObjectType
,
976 SECURITY_INFORMATION SecurityInfo
,
982 DPRINT1("SetNamedSecurityInfoW: stub\n");
983 return ERROR_CALL_NOT_IMPLEMENTED
;
987 /**********************************************************************
988 * SetNamedSecurityInfoA EXPORTED
993 SetNamedSecurityInfoA(LPSTR pObjectName
,
994 SE_OBJECT_TYPE ObjectType
,
995 SECURITY_INFORMATION SecurityInfo
,
1001 DPRINT1("SetNamedSecurityInfoA: stub\n");
1002 return ERROR_CALL_NOT_IMPLEMENTED
;
1006 /**********************************************************************
1007 * GetSecurityInfo EXPORTED
1012 GetSecurityInfo(HANDLE handle
,
1013 SE_OBJECT_TYPE ObjectType
,
1014 SECURITY_INFORMATION SecurityInfo
,
1019 PSECURITY_DESCRIPTOR
* ppSecurityDescriptor
)
1021 DPRINT1("GetSecurityInfo: stub\n");
1022 return ERROR_CALL_NOT_IMPLEMENTED
;
1026 /**********************************************************************
1027 * SetSecurityInfo EXPORTED
1033 SetSecurityInfo(HANDLE handle
,
1034 SE_OBJECT_TYPE ObjectType
,
1035 SECURITY_INFORMATION SecurityInfo
,
1041 DPRINT1("SetSecurityInfo: stub\n");
1042 return ERROR_CALL_NOT_IMPLEMENTED
;
1046 /******************************************************************************
1047 * GetSecurityInfoExW EXPORTED
1049 DWORD WINAPI
GetSecurityInfoExA(
1051 SE_OBJECT_TYPE ObjectType
,
1052 SECURITY_INFORMATION SecurityInfo
,
1055 PACTRL_ACCESSA
*ppAccessList
,
1056 PACTRL_AUDITA
*ppAuditList
,
1061 DPRINT1("GetSecurityInfoExA stub!\n");
1062 return ERROR_BAD_PROVIDER
;
1066 /******************************************************************************
1067 * GetSecurityInfoExW EXPORTED
1069 DWORD WINAPI
GetSecurityInfoExW(
1071 SE_OBJECT_TYPE ObjectType
,
1072 SECURITY_INFORMATION SecurityInfo
,
1075 PACTRL_ACCESSW
*ppAccessList
,
1076 PACTRL_AUDITW
*ppAuditList
,
1081 DPRINT1("GetSecurityInfoExW stub!\n");
1082 return ERROR_BAD_PROVIDER
;
1086 /**********************************************************************
1087 * ImpersonateNamedPipeClient EXPORTED
1092 ImpersonateNamedPipeClient(HANDLE hNamedPipe
)
1094 IO_STATUS_BLOCK StatusBlock
;
1097 DPRINT("ImpersonateNamedPipeClient() called\n");
1099 Status
= NtFsControlFile(hNamedPipe
,
1104 FSCTL_PIPE_IMPERSONATE
,
1109 if (!NT_SUCCESS(Status
))
1111 SetLastError(RtlNtStatusToDosError(Status
));