mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:55:41 +00:00
Implement LogonUserA.
svn path=/trunk/; revision=17568
This commit is contained in:
parent
3c693f90bc
commit
1848960041
1 changed files with 62 additions and 10 deletions
|
@ -1,5 +1,4 @@
|
||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
* FILE: lib/advapi32/misc/logon.c
|
* FILE: lib/advapi32/misc/logon.c
|
||||||
|
@ -131,17 +130,70 @@ CreateProcessAsUserW (HANDLE hToken,
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
LogonUserA (LPSTR lpszUsername,
|
LogonUserA(LPSTR lpszUsername,
|
||||||
LPSTR lpszDomain,
|
LPSTR lpszDomain,
|
||||||
LPSTR lpszPassword,
|
LPSTR lpszPassword,
|
||||||
DWORD dwLogonType,
|
DWORD dwLogonType,
|
||||||
DWORD dwLogonProvider,
|
DWORD dwLogonProvider,
|
||||||
PHANDLE phToken)
|
PHANDLE phToken)
|
||||||
{
|
{
|
||||||
return FALSE;
|
UNICODE_STRING UserName;
|
||||||
|
UNICODE_STRING Domain;
|
||||||
|
UNICODE_STRING Password;
|
||||||
|
NTSTATUS Status;
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
|
UserName.Buffer = NULL;
|
||||||
|
Domain.Buffer = NULL;
|
||||||
|
Password.Buffer = NULL;
|
||||||
|
|
||||||
|
Status = RtlCreateUnicodeStringFromAsciiz(&UserName,
|
||||||
|
lpszUsername);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
|
goto UsernameDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = RtlCreateUnicodeStringFromAsciiz(&Domain,
|
||||||
|
lpszDomain);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
|
goto DomainDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = RtlCreateUnicodeStringFromAsciiz(&Password,
|
||||||
|
lpszPassword);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
|
goto PasswordDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = LogonUserW(UserName.Buffer,
|
||||||
|
Domain.Buffer,
|
||||||
|
Password.Buffer,
|
||||||
|
dwLogonType,
|
||||||
|
dwLogonProvider,
|
||||||
|
phToken);
|
||||||
|
|
||||||
|
if (Password.Buffer != NULL)
|
||||||
|
RtlFreeUnicodeString(&Password);
|
||||||
|
|
||||||
|
PasswordDone:
|
||||||
|
if (Domain.Buffer != NULL)
|
||||||
|
RtlFreeUnicodeString(&Domain);
|
||||||
|
|
||||||
|
DomainDone:
|
||||||
|
if (UserName.Buffer != NULL)
|
||||||
|
RtlFreeUnicodeString(&UserName);
|
||||||
|
|
||||||
|
UsernameDone:
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue