[LSASRV] Add start code for the netlogon service
authorEric Kohl <eric.kohl@reactos.org>
Fri, 19 Feb 2021 20:53:00 +0000 (21:53 +0100)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 19 Feb 2021 20:53:00 +0000 (21:53 +0100)
boot/bootdata/hivesys.inf
dll/win32/lsasrv/service.c

index 586b474..7dc2c11 100644 (file)
@@ -1677,12 +1677,12 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Start",0x00010001,0x00000000
 HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Type",0x00010001,0x00000001
 
 ; NetLogon
-;HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","DisplayName",0x00000000,%NETLOGON_SERVICE%
-;HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","Description",0x00000000,%NETLOGON_SERVICE_DESCRIPTION%
-;HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","ErrorControl",0x00010001,0x00000001
-;HKLM,"SYSTEM\CurrentControlSet\Services\Netlogon","ImagePath",0x00020000,"%SystemRoot%\system32\lsass.exe"
-;HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","Start",0x00010001,0x00000003
-;HKLM,"SYSTEM\CurrentControlSet\Services\Netlogon","Type",0x00010001,0x00000020
+HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","DisplayName",0x00000000,%NETLOGON_SERVICE%
+HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","Description",0x00000000,%NETLOGON_SERVICE_DESCRIPTION%
+HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\Netlogon","ImagePath",0x00020000,"%SystemRoot%\system32\lsass.exe"
+HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","Start",0x00010001,0x00000003
+HKLM,"SYSTEM\CurrentControlSet\Services\Netlogon","Type",0x00010001,0x00000020
 
 ; NTFS filesystem driver
 HKLM,"SYSTEM\CurrentControlSet\Services\Ntfs","ErrorControl",0x00010001,0x00000000
index 9c20781..95fe262 100644 (file)
 #include "lsasrv.h"
 #include <winsvc.h>
 
+typedef VOID (WINAPI *PNETLOGONMAIN)(INT ArgCount, PWSTR *ArgVector);
+
 VOID WINAPI I_ScIsSecurityProcess(VOID);
 
+static VOID WINAPI NetlogonServiceMain(DWORD dwArgc, PWSTR *pszArgv);
 static VOID WINAPI SamSsServiceMain(DWORD dwArgc, PWSTR *pszArgv);
 
 SERVICE_TABLE_ENTRYW ServiceTable[] =
 {
+    {L"NETLOGON", NetlogonServiceMain},
     {L"SAMSS", SamSsServiceMain},
     {NULL, NULL}
 };
@@ -24,6 +28,39 @@ SERVICE_TABLE_ENTRYW ServiceTable[] =
 
 /* FUNCTIONS ***************************************************************/
 
+static
+VOID
+WINAPI
+NetlogonServiceMain(
+    _In_ DWORD dwArgc,
+    _In_ PWSTR *pszArgv)
+{
+    HINSTANCE hNetlogon = NULL;
+    PNETLOGONMAIN pNetlogonMain = NULL;
+
+    TRACE("NetlogonServiceMain(%lu %p)\n", dwArgc, pszArgv);
+
+    hNetlogon = LoadLibraryW(L"Netlogon.dll");
+    if (hNetlogon == NULL)
+    {
+        ERR("LoadLibrary() failed!\n");
+        return;
+    }
+
+    pNetlogonMain = (PNETLOGONMAIN)GetProcAddress(hNetlogon, "NlNetlogonMain");
+    if (pNetlogonMain == NULL)
+    {
+        ERR("GetProcAddress(NlNetlogonMain) failed!\n");
+        FreeLibrary(hNetlogon);
+        return;
+    }
+
+    TRACE("NlNetlogonMain %p\n", pNetlogonMain);
+
+    pNetlogonMain(dwArgc, pszArgv);
+}
+
+
 static
 VOID
 WINAPI