[MSGINA]
[reactos.git] / reactos / dll / win32 / msgina / lsa.c
1 /*
2 * PROJECT: ReactOS msgina.dll
3 * FILE: dll/win32/msgina/gui.c
4 * PURPOSE: ReactOS Logon GINA DLL
5 * PROGRAMMER: Eric Kohl
6 */
7
8 #include "msgina.h"
9
10 BOOL
11 ConnectToLsa(
12 PGINA_CONTEXT pgContext)
13 {
14 LSA_STRING LogonProcessName;
15 LSA_STRING PackageName;
16 LSA_OPERATIONAL_MODE SecurityMode = 0;
17 NTSTATUS Status;
18
19 /* We are already connected to the LSA */
20 if (pgContext->LsaHandle != NULL)
21 return TRUE;
22
23 /* Connect to the LSA server */
24 RtlInitAnsiString((PANSI_STRING)&LogonProcessName,
25 "MSGINA");
26
27 Status = LsaRegisterLogonProcess(&LogonProcessName,
28 &pgContext->LsaHandle,
29 &SecurityMode);
30 if (!NT_SUCCESS(Status))
31 {
32 ERR("LsaRegisterLogonProcess failed (Status 0x%08lx)\n", Status);
33 return FALSE;
34 }
35
36 /* Get the authentication package */
37 RtlInitAnsiString((PANSI_STRING)&PackageName,
38 MSV1_0_PACKAGE_NAME);
39
40 Status = LsaLookupAuthenticationPackage(pgContext->LsaHandle,
41 &PackageName,
42 &pgContext->AuthenticationPackage);
43 if (!NT_SUCCESS(Status))
44 {
45 ERR("LsaLookupAuthenticationPackage failed (Status 0x%08lx)\n", Status);
46 return FALSE;
47 }
48
49 return TRUE;
50 }
51
52 /* EOF */