Author: ekohl
Date: Tue Dec 31 09:05:31 2013
New Revision: 61467
URL:
http://svn.reactos.org/svn/reactos?rev=61467&view=rev
Log:
[ADVAPI32]
LogonUserW: Convert the logon type and pass it to LsaLogonUser.
Modified:
trunk/reactos/dll/win32/advapi32/misc/logon.c
Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Tue Dec 31 09:05:31 2013
@@ -316,20 +316,45 @@
LUID LogonId = {0, 0};
HANDLE TokenHandle = NULL;
QUOTA_LIMITS QuotaLimits;
+ SECURITY_LOGON_TYPE LogonType;
NTSTATUS SubStatus = STATUS_SUCCESS;
NTSTATUS Status;
*phToken = NULL;
+ switch (dwLogonType)
+ {
+ case LOGON32_LOGON_INTERACTIVE:
+ LogonType = Interactive;
+ break;
+
+ case LOGON32_LOGON_NETWORK:
+ LogonType = Network;
+ break;
+
+ case LOGON32_LOGON_BATCH:
+ LogonType = Batch;
+ break;
+
+ case LOGON32_LOGON_SERVICE:
+ LogonType = Service;
+ break;
+
+ default:
+ ERR("Invalid logon type: %ul\n", dwLogonType);
+ Status = STATUS_INVALID_PARAMETER;
+ goto done;
+ }
+
if (LsaHandle == NULL)
{
Status = OpenLogonLsaHandle();
if (!NT_SUCCESS(Status))
- return Status;
+ goto done;
}
RtlInitAnsiString((PANSI_STRING)&OriginName,
- "Testapp");
+ "Advapi32 Logon");
RtlInitUnicodeString(&DomainName,
lpszDomain);
@@ -443,7 +468,7 @@
Status = LsaLogonUser(LsaHandle,
&OriginName,
- Interactive,
+ LogonType,
AuthenticationPackage,
(PVOID)AuthInfo,
AuthInfoLength,
@@ -457,7 +482,7 @@
&SubStatus);
if (!NT_SUCCESS(Status))
{
- TRACE("LsaLogonUser failed (Status 0x%08lx)\n", Status);
+ ERR("LsaLogonUser failed (Status 0x%08lx)\n", Status);
goto done;
}