Add lsasrv.dll stub.
Modified: trunk/reactos/Makefile
Added: trunk/reactos/include/lsass/lsasrv.h
Added: trunk/reactos/lib/lsasrv/
Added: trunk/reactos/lib/lsasrv/lsaport.c
Added: trunk/reactos/lib/lsasrv/lsasrv.c
Added: trunk/reactos/lib/lsasrv/lsasrv.def
Added: trunk/reactos/lib/lsasrv/lsasrv.rc
Added: trunk/reactos/lib/lsasrv/makefile

Modified: trunk/reactos/Makefile
--- trunk/reactos/Makefile	2005-02-16 21:07:55 UTC (rev 13604)
+++ trunk/reactos/Makefile	2005-02-16 21:59:00 UTC (rev 13605)
@@ -63,7 +63,7 @@
 	msgina msi msimg32 msvcrt20 msvideo mswsock netapi32 ntdll ole32 oleaut32 oledlg olepro32 opengl32 \
 	packet psapi riched20 richedit rpcrt4 samlib secur32 setupapi shell32 shlwapi smdll snmpapi syssetup \
 	twain user32 userenv version wininet winmm winspool ws2help ws2_32 wsock32 wshirda dnsapi \
-	urlmon shdocvw dinput dinput8 dxdiagn devenum dsound $(DLLS_KBD) $(DLLS_CPL) $(DLLS_SHELLEXT)
+	urlmon shdocvw dinput dinput8 dxdiagn devenum dsound lsasrv $(DLLS_KBD) $(DLLS_CPL) $(DLLS_SHELLEXT)
 
 SUBSYS = smss win32k csrss ntvdm
 

Added: trunk/reactos/include/lsass/lsasrv.h
--- trunk/reactos/include/lsass/lsasrv.h	2005-02-16 21:07:55 UTC (rev 13604)
+++ trunk/reactos/include/lsass/lsasrv.h	2005-02-16 21:59:00 UTC (rev 13605)
@@ -0,0 +1,8 @@
+
+#ifndef __LSASRV_H
+#define __LSASRV_H
+
+NTSTATUS STDCALL
+LsapInitLsa(VOID);
+
+#endif /* __LSASRV_H */

Added: trunk/reactos/lib/lsasrv/lsaport.c
--- trunk/reactos/lib/lsasrv/lsaport.c	2005-02-16 21:07:55 UTC (rev 13604)
+++ trunk/reactos/lib/lsasrv/lsaport.c	2005-02-16 21:59:00 UTC (rev 13605)
@@ -0,0 +1,178 @@
+/*
+ */
+
+#define NTOS_MODE_USER
+#include <ntos.h>
+#include <windows.h>
+
+//#define NDEBUG
+#include <debug.h>
+
+
+HANDLE PortThreadHandle = NULL;
+HANDLE ConnectPortHandle = NULL;
+HANDLE MessagePortHandle = NULL;
+
+
+static NTSTATUS
+InitializeLsaPort(VOID)
+{
+  OBJECT_ATTRIBUTES ObjectAttributes;
+  UNICODE_STRING PortName;
+  LPC_MAX_MESSAGE Request;
+  NTSTATUS Status;
+
+  ConnectPortHandle = NULL;
+  MessagePortHandle = NULL;
+
+  RtlInitUnicodeString(&PortName,
+                       L"\\SeLsaCommandPort");
+
+  InitializeObjectAttributes(&ObjectAttributes,
+			     &PortName,
+			     0,
+			     NULL,
+			     NULL);
+
+  Status = NtCreatePort(&ConnectPortHandle,
+			&ObjectAttributes,
+			0,
+			0x100,
+			0x2000);
+  if (!NT_SUCCESS(Status))
+    {
+      DPRINT1("NtCreatePort() failed (Status %lx)\n", Status);
+      goto ByeBye;
+    }
+
+  Status = NtListenPort(ConnectPortHandle,
+			&Request.Header);
+  if (!NT_SUCCESS(Status))
+    {
+      DPRINT1("NtListenPort() failed (Status %lx)\n", Status);
+      goto ByeBye;
+    }
+
+  Status = NtAcceptConnectPort(&MessagePortHandle,
+			       ConnectPortHandle,
+			       NULL,
+			       TRUE,
+			       NULL,
+			       NULL);
+  if (!NT_SUCCESS (Status))
+    {
+      DPRINT1("NtAcceptConnectPort() failed (Status %lx)\n", Status);
+      goto ByeBye;
+    }
+
+  Status = NtCompleteConnectPort (MessagePortHandle);
+  if (!NT_SUCCESS (Status))
+    {
+      DPRINT1("NtCompleteConnectPort() failed (Status %lx)\n", Status);
+      goto ByeBye;
+    }
+
+ByeBye:
+  if (!NT_SUCCESS (Status))
+    {
+      if (ConnectPortHandle != NULL)
+	NtClose (ConnectPortHandle);
+
+      if (MessagePortHandle != NULL)
+	NtClose (MessagePortHandle);
+    }
+
+  return Status;
+}
+
+
+static NTSTATUS
+ProcessPortMessage(VOID)
+{
+  LPC_MAX_MESSAGE Request;
+//  LPC_MAX_MESSAGE Reply;
+  NTSTATUS Status;
+
+
+  DPRINT1("ProcessPortMessage() called\n");
+
+  Status = STATUS_SUCCESS;
+
+  for (;;)
+    {
+      Status = NtReplyWaitReceivePort(MessagePortHandle,
+				      0,
+				      NULL,
+				      &Request.Header);
+      if (!NT_SUCCESS(Status))
+	{
+	  DPRINT1("NtReplyWaitReceivePort() failed (Status %lx)\n", Status);
+	  break;
+	}
+
+      DPRINT("Received message\n");
+
+      if (Request.Header.MessageType == LPC_PORT_CLOSED)
+	{
+	  DPRINT("Port closed\n");
+
+//	  return STATUS_UNSUCCESSFUL;
+	}
+      if (Request.Header.MessageType == LPC_REQUEST)
+	{
+	  DPRINT("Received request\n");
+
+	}
+      else if (Request.Header.MessageType == LPC_DATAGRAM)
+	{
+	  DPRINT("Received datagram\n");
+
+//	  Message = (PIO_ERROR_LOG_MESSAGE)&Request.Data;
+
+	}
+    }
+
+  return Status;
+}
+
+
+static NTSTATUS STDCALL
+PortThreadRoutine(PVOID Param)
+{
+  NTSTATUS Status = STATUS_SUCCESS;
+
+  Status = InitializeLsaPort();
+  if (!NT_SUCCESS(Status))
+    return Status;
+
+  while (NT_SUCCESS(Status))
+    {
+      Status = ProcessPortMessage();
+    }
+
+  if (ConnectPortHandle != NULL)
+    NtClose (ConnectPortHandle);
+
+  if (MessagePortHandle != NULL)
+    NtClose (MessagePortHandle);
+
+  return Status;
+}
+
+
+BOOLEAN
+StartLsaPortThread(VOID)
+{
+  DWORD ThreadId;
+
+  PortThreadHandle = CreateThread(NULL,
+				  0x1000,
+				  (LPTHREAD_START_ROUTINE)PortThreadRoutine,
+				  NULL,
+				  0,
+				  &ThreadId);
+
+  return (PortThreadHandle != NULL);
+}
+
+/* EOF */

Added: trunk/reactos/lib/lsasrv/lsasrv.c
--- trunk/reactos/lib/lsasrv/lsasrv.c	2005-02-16 21:07:55 UTC (rev 13604)
+++ trunk/reactos/lib/lsasrv/lsasrv.c	2005-02-16 21:59:00 UTC (rev 13605)
@@ -0,0 +1,24 @@
+
+#define NTOS_MODE_USER
+#include <ntos.h>
+#include <windows.h>
+
+#include <lsass/lsasrv.h>
+
+#define NDEBUG
+#include <debug.h>
+
+VOID StartLsaPortThread(VOID);
+
+
+NTSTATUS STDCALL
+LsapInitLsa(VOID)
+{
+  DPRINT1("LsapInitLsa() called\n");
+
+  StartLsaPortThread();
+
+  return STATUS_SUCCESS;
+}
+
+/* EOF */

Added: trunk/reactos/lib/lsasrv/lsasrv.def
--- trunk/reactos/lib/lsasrv/lsasrv.def	2005-02-16 21:07:55 UTC (rev 13604)
+++ trunk/reactos/lib/lsasrv/lsasrv.def	2005-02-16 21:59:00 UTC (rev 13605)
@@ -0,0 +1,68 @@
+; $Id: lsasrv.def 12852 2005-01-06 13:58:04Z mf $
+LIBRARY lsasrv
+EXPORTS
+;LsaIAuditNotifyPackageLoad
+;LsaIAuditSamEvent
+;LsaIEnumerateSecrets
+;LsaIFree_LSAI_PRIVATE_DATA
+;LsaIFree_LSAI_SECRET_ENUM_BUFFER
+;LsaIFree_LSAPR_ACCOUNT_ENUM_BUFFER
+;LsaIFree_LSAPR_CR_CIPHER_VALUE
+;LsaIFree_LSAPR_POLICY_INFORMATION
+;LsaIFree_LSAPR_PRIVILEGE_ENUM_BUFFER
+;LsaIFree_LSAPR_PRIVILEGE_SET
+;LsaIFree_LSAPR_REFERENCED_DOMAIN_LIST
+;LsaIFree_LSAPR_SR_SECURITY_DESCRIPTOR
+;LsaIFree_LSAPR_TRANSLATED_NAMES
+;LsaIFree_LSAPR_TRANSLATED_SIDS
+;LsaIFree_LSAPR_TRUSTED_DOMAIN_INFO
+;LsaIFree_LSAPR_TRUSTED_ENUM_BUFFER
+;LsaIFree_LSAPR_TRUST_INFORMATION
+;LsaIFree_LSAPR_UNICODE_STRING
+;LsaIGetPrivateData
+;LsaIGetSerialNumberPolicy
+;LsaIGetSerialNumberPolicy2
+;LsaIHealthCheck
+;LsaIInitializeWellKnownSids
+;LsaIOpenPolicyTrusted
+;LsaIQueryInformationPolicyTrusted
+;LsaISetPrivateData
+;LsaISetSerialNumberPolicy
+;LsaISetTimesSecret
+;LsaISetupWasRun
+;LsapAuOpenSam
+LsapInitLsa@0
+;LsarAddPrivilegesToAccount
+;LsarClose
+;LsarCreateAccount
+;LsarCreateSecret
+;LsarCreateTrustedDomain
+;LsarDelete
+;LsarEnumerateAccounts
+;LsarEnumeratePrivileges
+;LsarEnumeratePrivilegesAccount
+;LsarEnumerateTrustedDomains
+;LsarGetQuotasForAccount
+;LsarGetSystemAccessAccount
+;LsarLookupNames
+;LsarLookupPrivilegeDisplayName
+;LsarLookupPrivilegeName
+;LsarLookupPrivilegeValue
+;LsarLookupSids
+;LsarOpenAccount
+;LsarOpenPolicy
+;LsarOpenSecret
+;LsarOpenTrustedDomain
+;LsarQueryInfoTrustedDomain
+;LsarQueryInformationPolicy
+;LsarQuerySecret
+;LsarQuerySecurityObject
+;LsarRemovePrivilegesFromAccount
+;LsarSetInformationPolicy
+;LsarSetInformationTrustedDomain
+;LsarSetQuotasForAccount
+;LsarSetSecret
+;LsarSetSecurityObject
+;LsarSetSystemAccessAccount
+;ServiceInit
+; EOF
\ No newline at end of file

Added: trunk/reactos/lib/lsasrv/lsasrv.rc
--- trunk/reactos/lib/lsasrv/lsasrv.rc	2005-02-16 21:07:55 UTC (rev 13604)
+++ trunk/reactos/lib/lsasrv/lsasrv.rc	2005-02-16 21:59:00 UTC (rev 13605)
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION	"LSA server DLL\0"
+#define REACTOS_STR_INTERNAL_NAME	"lsasrv\0"
+#define REACTOS_STR_ORIGINAL_FILENAME	"lsasrv.dll\0"
+#include <reactos/version.rc>

Added: trunk/reactos/lib/lsasrv/makefile
--- trunk/reactos/lib/lsasrv/makefile	2005-02-16 21:07:55 UTC (rev 13604)
+++ trunk/reactos/lib/lsasrv/makefile	2005-02-16 21:59:00 UTC (rev 13605)
@@ -0,0 +1,28 @@
+# $Id$
+
+PATH_TO_TOP = ../..
+
+TARGET_TYPE = dynlink
+
+TARGET_NAME = lsasrv
+
+TARGET_BASE = $(TARGET_BASE_LIB_LSASRV)
+
+TARGET_ENTRY = 0x0
+
+TARGET_CFLAGS += -Wall -Werror
+
+TARGET_LFLAGS = -nostartfiles -nostdlib
+
+TARGET_SDKLIBS = ntdll.a kernel32.a
+
+TARGET_OBJECTS = lsasrv.o lsaport.o
+
+DEP_OBJECTS = $(TARGET_OBJECTS)
+
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk
+
+include $(TOOLS_PATH)/depend.mk