Author: ekohl
Date: Sun Feb 2 12:12:59 2014
New Revision: 61919
URL:
http://svn.reactos.org/svn/reactos?rev=61919&view=rev
Log:
[MSGINA]
Move the LSA connection code into a separate file. This connection code will later be used
by the logon code too.
Added:
trunk/reactos/dll/win32/msgina/lsa.c (with props)
Modified:
trunk/reactos/dll/win32/msgina/CMakeLists.txt
trunk/reactos/dll/win32/msgina/gui.c
trunk/reactos/dll/win32/msgina/msgina.h
Modified: trunk/reactos/dll/win32/msgina/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/CMakeList…
==============================================================================
--- trunk/reactos/dll/win32/msgina/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/CMakeLists.txt [iso-8859-1] Sun Feb 2 12:12:59 2014
@@ -7,6 +7,7 @@
list(APPEND SOURCE
gui.c
+ lsa.c
msgina.c
stubs.c
tui.c
Modified: trunk/reactos/dll/win32/msgina/gui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/gui.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] Sun Feb 2 12:12:59 2014
@@ -259,9 +259,6 @@
ULONG RequestBufferSize;
ULONG ResponseBufferSize = 0;
LPWSTR Ptr;
- LSA_STRING PackageName;
- HANDLE LsaHandle = NULL;
- ULONG AuthenticationPackage = 0;
BOOL res = FALSE;
NTSTATUS ProtocolStatus;
NTSTATUS Status;
@@ -349,29 +346,15 @@
RequestBuffer->NewPassword.MaximumLength);
/* Connect to the LSA server */
- Status = LsaConnectUntrusted(&LsaHandle);
- if (!NT_SUCCESS(Status))
- {
- ERR("LsaConnectUntrusted failed (Status 0x%08lx)\n", Status);
- goto done;
- }
-
- /* Get the authentication package */
- RtlInitAnsiString((PANSI_STRING)&PackageName,
- MSV1_0_PACKAGE_NAME);
-
- Status = LsaLookupAuthenticationPackage(LsaHandle,
- &PackageName,
- &AuthenticationPackage);
- if (!NT_SUCCESS(Status))
- {
- ERR("LsaLookupAuthenticationPackage failed (Status 0x%08lx)\n",
Status);
- goto done;
+ if (!ConnectToLsa(pgContext))
+ {
+ ERR("ConnectToLsa() failed\n");
+ return FALSE;
}
/* Call the authentication package */
- Status = LsaCallAuthenticationPackage(LsaHandle,
- AuthenticationPackage,
+ Status = LsaCallAuthenticationPackage(pgContext->LsaHandle,
+ pgContext->AuthenticationPackage,
RequestBuffer,
RequestBufferSize,
(PVOID*)&ResponseBuffer,
@@ -403,9 +386,6 @@
if (ResponseBuffer != NULL)
LsaFreeReturnBuffer(ResponseBuffer);
-
- if (LsaHandle != NULL)
- NtClose(LsaHandle);
return res;
}
Added: trunk/reactos/dll/win32/msgina/lsa.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/lsa.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/msgina/lsa.c (added)
+++ trunk/reactos/dll/win32/msgina/lsa.c [iso-8859-1] Sun Feb 2 12:12:59 2014
@@ -0,0 +1,52 @@
+/*
+ * PROJECT: ReactOS msgina.dll
+ * FILE: dll/win32/msgina/gui.c
+ * PURPOSE: ReactOS Logon GINA DLL
+ * PROGRAMMER: Eric Kohl
+ */
+
+#include "msgina.h"
+
+BOOL
+ConnectToLsa(
+ PGINA_CONTEXT pgContext)
+{
+ LSA_STRING LogonProcessName;
+ LSA_STRING PackageName;
+ LSA_OPERATIONAL_MODE SecurityMode = 0;
+ NTSTATUS Status;
+
+ /* We are already connected to the LSA */
+ if (pgContext->LsaHandle != NULL)
+ return TRUE;
+
+ /* Connect to the LSA server */
+ RtlInitAnsiString((PANSI_STRING)&LogonProcessName,
+ "MSGINA");
+
+ Status = LsaRegisterLogonProcess(&LogonProcessName,
+ &pgContext->LsaHandle,
+ &SecurityMode);
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("LsaRegisterLogonProcess failed (Status 0x%08lx)\n", Status);
+ return FALSE;
+ }
+
+ /* Get the authentication package */
+ RtlInitAnsiString((PANSI_STRING)&PackageName,
+ MSV1_0_PACKAGE_NAME);
+
+ Status = LsaLookupAuthenticationPackage(pgContext->LsaHandle,
+ &PackageName,
+ &pgContext->AuthenticationPackage);
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("LsaLookupAuthenticationPackage failed (Status 0x%08lx)\n",
Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* EOF */
Propchange: trunk/reactos/dll/win32/msgina/lsa.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/msgina/msgina.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.h?…
==============================================================================
--- trunk/reactos/dll/win32/msgina/msgina.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/msgina.h [iso-8859-1] Sun Feb 2 12:12:59 2014
@@ -38,6 +38,8 @@
PWLX_DISPATCH_VERSION_1_3 pWlxFuncs;
HANDLE hDllInstance;
HWND hStatusWindow;
+ HANDLE LsaHandle;
+ ULONG AuthenticationPackage;
DWORD AutoLogonState;
BOOL bDisableCAD;
BOOL bAutoAdminLogon;
@@ -82,6 +84,12 @@
PFGINA_DISPLAYLOCKEDNOTICE DisplayLockedNotice;
} GINA_UI, *PGINA_UI;
+/* lsa.c */
+
+BOOL
+ConnectToLsa(
+ PGINA_CONTEXT pgContext);
+
/* msgina.c */
BOOL