Author: ekohl
Date: Sun Jan 10 13:01:29 2016
New Revision: 70568
URL:
http://svn.reactos.org/svn/reactos?rev=70568&view=rev
Log:
[LSASRV]
Add credential function stubs to the lsa dispatch table.
Modified:
trunk/reactos/dll/win32/lsasrv/authpackage.c
trunk/reactos/dll/win32/lsasrv/lsasrv.h
trunk/reactos/dll/win32/lsasrv/session.c
Modified: trunk/reactos/dll/win32/lsasrv/authpackage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/authpacka…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] Sun Jan 10 13:01:29 2016
@@ -32,7 +32,9 @@
typedef NTSTATUS (NTAPI *PLSA_CREATE_LOGON_SESSION)(PLUID);
typedef NTSTATUS (NTAPI *PLSA_DELETE_LOGON_SESSION)(PLUID);
-
+typedef NTSTATUS (NTAPI *PLSA_ADD_CREDENTIAL)(PLUID, ULONG, PLSA_STRING, PLSA_STRING);
+typedef NTSTATUS (NTAPI *PLSA_GET_CREDENTIALS)(PLUID, ULONG, PULONG, BOOLEAN,
PLSA_STRING, PULONG, PLSA_STRING);
+typedef NTSTATUS (NTAPI *PLSA_DELETE_CREDENTIAL)(PLUID, ULONG, PLSA_STRING);
typedef PVOID (NTAPI *PLSA_ALLOCATE_LSA_HEAP)(ULONG);
typedef VOID (NTAPI *PLSA_FREE_LSA_HEAP)(PVOID);
typedef NTSTATUS (NTAPI *PLSA_ALLOCATE_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST, ULONG,
PVOID*);
@@ -46,9 +48,9 @@
{
PLSA_CREATE_LOGON_SESSION CreateLogonSession;
PLSA_DELETE_LOGON_SESSION DeleteLogonSession;
- PVOID /*PLSA_ADD_CREDENTIAL */ AddCredential;
- PVOID /*PLSA_GET_CREDENTIALS */ GetCredentials;
- PVOID /*PLSA_DELETE_CREDENTIAL */ DeleteCredential;
+ PLSA_ADD_CREDENTIAL AddCredential;
+ PLSA_GET_CREDENTIALS GetCredentials;
+ PLSA_DELETE_CREDENTIAL DeleteCredential;
PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap;
PLSA_FREE_LSA_HEAP FreeLsaHeap;
PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer;
@@ -481,9 +483,9 @@
/* Initialize the dispatch table */
DispatchTable.CreateLogonSession = &LsapCreateLogonSession;
DispatchTable.DeleteLogonSession = &LsapDeleteLogonSession;
- DispatchTable.AddCredential = NULL;
- DispatchTable.GetCredentials = NULL;
- DispatchTable.DeleteCredential = NULL;
+ DispatchTable.AddCredential = &LsapAddCredential;
+ DispatchTable.GetCredentials = &LsapGetCredentials;
+ DispatchTable.DeleteCredential = &LsapDeleteCredential;
DispatchTable.AllocateLsaHeap = &LsapAllocateHeap;
DispatchTable.FreeLsaHeap = &LsapFreeHeap;
DispatchTable.AllocateClientBuffer = &LsapAllocateClientBuffer;
@@ -1602,7 +1604,7 @@
goto done;
}
- TokenHandle = NULL;
+// TokenHandle = NULL;
Status = LsapSetLogonSessionData(&RequestMsg->LogonUser.Reply.LogonId);
if (!NT_SUCCESS(Status))
@@ -1612,11 +1614,11 @@
}
done:
- if (!NT_SUCCESS(Status))
- {
+// if (!NT_SUCCESS(Status))
+// {
if (TokenHandle != NULL)
NtClose(TokenHandle);
- }
+// }
/* Free the local groups */
if (LocalGroups != NULL)
Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.h?…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] Sun Jan 10 13:01:29 2016
@@ -415,6 +415,32 @@
LsapDeleteLogonSession(IN PLUID LogonId);
NTSTATUS
+NTAPI
+LsapAddCredential(
+ _In_ PLUID LogonId,
+ _In_ ULONG AuthenticationPackage,
+ _In_ PLSA_STRING PrimaryKeyValue,
+ _In_ PLSA_STRING Credential);
+
+NTSTATUS
+NTAPI
+LsapGetCredentials(
+ _In_ PLUID LogonId,
+ _In_ ULONG AuthenticationPackage,
+ _Inout_ PULONG QueryContext,
+ _In_ BOOLEAN RetrieveAllCredentials,
+ _Inout_ PLSA_STRING PrimaryKeyValue,
+ _Out_ PULONG PrimaryKeyLength,
+ _Out_ PLSA_STRING Credentials);
+
+NTSTATUS
+NTAPI
+LsapDeleteCredential(
+ _In_ PLUID LogonId,
+ _In_ ULONG AuthenticationPackage,
+ _In_ PLSA_STRING PrimaryKeyValue);
+
+NTSTATUS
LsapSetLogonSessionData(IN PLUID LogonId);
NTSTATUS
Modified: trunk/reactos/dll/win32/lsasrv/session.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/session.c…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/session.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/session.c [iso-8859-1] Sun Jan 10 13:01:29 2016
@@ -177,6 +177,47 @@
NTSTATUS
+NTAPI
+LsapAddCredential(
+ _In_ PLUID LogonId,
+ _In_ ULONG AuthenticationPackage,
+ _In_ PLSA_STRING PrimaryKeyValue,
+ _In_ PLSA_STRING Credential)
+{
+
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
+LsapGetCredentials(
+ _In_ PLUID LogonId,
+ _In_ ULONG AuthenticationPackage,
+ _Inout_ PULONG QueryContext,
+ _In_ BOOLEAN RetrieveAllCredentials,
+ _Inout_ PLSA_STRING PrimaryKeyValue,
+ _Out_ PULONG PrimaryKeyLength,
+ _Out_ PLSA_STRING Credentials)
+{
+
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
+LsapDeleteCredential(
+ _In_ PLUID LogonId,
+ _In_ ULONG AuthenticationPackage,
+ _In_ PLSA_STRING PrimaryKeyValue)
+{
+
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg)
{
OBJECT_ATTRIBUTES ObjectAttributes;
@@ -290,9 +331,10 @@
if (Session == NULL)
return STATUS_NO_SUCH_LOGON_SESSION;
- Length = sizeof(SECURITY_LOGON_SESSION_DATA);
+ /* Calculate the required buffer size */
+ Length = sizeof(SECURITY_LOGON_SESSION_DATA) +
+ Session->UserName.MaximumLength;
/*
- Session->UserName.MaximumLength +
Session->LogonDomain.MaximumLength +
Session->AuthenticationPackage.MaximumLength +
Session->LogonServer.MaximumLength +
@@ -305,6 +347,7 @@
TRACE("Length: %lu\n", Length);
+ /* Allocate the buffer */
LocalSessionData = RtlAllocateHeap(RtlGetProcessHeap(),
HEAP_ZERO_MEMORY,
Length);
@@ -318,6 +361,19 @@
RtlCopyLuid(&LocalSessionData->LogonId,
&RequestMsg->GetLogonSessionData.Request.LogonId);
+
+ LocalSessionData->UserName.Length = Session->UserName.Length;
+ LocalSessionData->UserName.MaximumLength = Session->UserName.MaximumLength;
+ LocalSessionData->UserName.Buffer = Ptr;
+
+// RtlCopyMemory(Ptr)
+
+
+ LocalSessionData->LogonType = Session->LogonType;
+ LocalSessionData->Session = 0;
+
+
+
InitializeObjectAttributes(&ObjectAttributes,
NULL,