[LSASRV] Add start code for the netlogon service

This commit is contained in:
Eric Kohl 2021-02-19 21:53:00 +01:00
parent 2a962eaf8c
commit ea26bef01d
2 changed files with 43 additions and 6 deletions

View 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

View file

@ -11,12 +11,16 @@
#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