looks like we may be missing a header file change here? The build bots aren't too happy.
/srv/buildbot/worker_data/Build_GCCLin_x86/build/base/services/seclogon/rpcserver.c: In function 'StartRpcServer':
/srv/buildbot/worker_data/Build_GCCLin_x86/build/base/services/seclogon/rpcserver.c:36:16: error: 'LPSTART_RPC_SERVER' undeclared (first use in this function); did you mean 'XLAT_SERVER'?
Status = ((LPSTART_RPC_SERVER)lpServiceGlobals->RpcpStartRpcServer)(L"seclogon", ISeclogon_v1_0_s_ifspec);
/srv/buildbot/worker_data/Build_GCCLin_x86/build/base/services/seclogon/rpcserver.c:36:16: note: each undeclared identifier is reported only once for each function it appears in
/srv/buildbot/worker_data/Build_GCCLin_x86/build/base/services/seclogon/rpcserver.c:36:35: error: expected ')' before 'lpServiceGlobals'
Status = ((LPSTART_RPC_SERVER)lpServiceGlobals->RpcpStartRpcServer)(L"seclogon", ISeclogon_v1_0_s_ifspec);
/srv/buildbot/worker_data/Build_GCCLin_x86/build/base/services/seclogon/rpcserver.c: In function 'StopRpcServer':
/srv/buildbot/worker_data/Build_GCCLin_x86/build/base/services/seclogon/rpcserver.c:48:16: error: 'LPSTOP_RPC_SERVER' undeclared (first use in this function); did you mean 'STUB_CALL_SERVER'?
Status = ((LPSTOP_RPC_SERVER)lpServiceGlobals->RpcpStopRpcServer)(ISeclogon_v1_0_s_ifspec);
/srv/buildbot/worker_data/Build_GCCLin_x86/build/base/services/seclogon/rpcserver.c:48:34: error: expected ')' before 'lpServiceGlobals'
Status = ((LPSTOP_RPC_SERVER)lpServiceGlobals->RpcpStopRpcServer)(ISeclogon_v1_0_s_ifspec);
>
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=43fa9548d32a10967f9d53c73c1d4484c8927ee8>
> commit 43fa9548d32a10967f9d53c73c1d4484c8927ee8
> Author: Eric Kohl <
eric.kohl@reactos.org>
> AuthorDate: Sun Jan 16 17:02:01 2022 +0100
> Commit: Eric Kohl <
eric.kohl@reactos.org>
> CommitDate: Sun Jan 16 17:02:01 2022 +0100
>
> [services] Add the secondary logon service
> ---
> base/services/CMakeLists.txt | 1 +
> base/services/seclogon/CMakeLists.txt | 22 +++++
> base/services/seclogon/precomp.h | 36 +++++++
> base/services/seclogon/rpcserver.c | 80 +++++++++++++++
> base/services/seclogon/seclogon.c | 181 ++++++++++++++++++++++++++++++++++
> base/services/seclogon/seclogon.rc | 5 +
> base/services/seclogon/seclogon.spec | 2 +
> boot/bootdata/hivesft.inf | 2 +-
> boot/bootdata/hivesys.inf | 13 +++
> 9 files changed, 341 insertions(+), 1 deletion(-)
>
> diff --git a/base/services/CMakeLists.txt b/base/services/CMakeLists.txt
> index 98bae238acc..2a6f1fee768 100644
> --- a/base/services/CMakeLists.txt
> +++ b/base/services/CMakeLists.txt
> @@ -9,6 +9,7 @@ add_subdirectory(netlogon)
> add_subdirectory(nfsd)
> add_subdirectory(rpcss)
> add_subdirectory(schedsvc)
> +add_subdirectory(seclogon)
> add_subdirectory(shsvcs)
> add_subdirectory(srvsvc)
> add_subdirectory(svchost)
> diff --git a/base/services/seclogon/CMakeLists.txt b/base/services/seclogon/CMakeLists.txt
> new file mode 100644
> index 00000000000..8ab9611b965
> --- /dev/null
> +++ b/base/services/seclogon/CMakeLists.txt
> @@ -0,0 +1,22 @@
> +
> +include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl)
> +add_rpc_files(server ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/seclogon.idl)
> +spec2def(seclogon.dll seclogon.spec ADD_IMPORTLIB)
> +
> +list(APPEND SOURCE
> + rpcserver.c
> + seclogon.c
> + precomp.h)
> +
> +add_library(seclogon MODULE
> + ${SOURCE}
> + seclogon.rc
> + ${CMAKE_CURRENT_BINARY_DIR}/seclogon_s.c
> + ${CMAKE_CURRENT_BINARY_DIR}/seclogon_stubs.c
> + ${CMAKE_CURRENT_BINARY_DIR}/seclogon.def)
> +
> +set_module_type(seclogon win32dll UNICODE)
> +target_link_libraries(seclogon wine ${PSEH_LIB})
> +add_importlibs(seclogon advapi32 rpcrt4 msvcrt kernel32 ntdll)
> +add_pch(seclogon precomp.h SOURCE)
> +add_cd_file(TARGET seclogon DESTINATION reactos/system32 FOR all)
> diff --git a/base/services/seclogon/precomp.h b/base/services/seclogon/precomp.h
> new file mode 100644
> index 00000000000..b1475ec2ead
> --- /dev/null
> +++ b/base/services/seclogon/precomp.h
> @@ -0,0 +1,36 @@
> +/*
> + * PROJECT: ReactOS Secondary Logon Service
> + * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
> + * PURPOSE: Secondary Logon service RPC server
> + * COPYRIGHT: Eric Kohl 2022 <
eric.kohl@reactos.org>
> + */
> +
> +#ifndef _SECLOGON_PCH_
> +#define _SECLOGON_PCH_
> +
> +#define WIN32_NO_STATUS
> +#define _INC_WINDOWS
> +#define COM_NO_WINDOWS_H
> +#include <limits.h>
> +#include <stdarg.h>
> +#include <stdio.h>
> +#include <windef.h>
> +#include <winbase.h>
> +#include <winreg.h>
> +#include <winsvc.h>
> +#include <svc.h>
> +
> +#include <ndk/rtlfuncs.h>
> +
> +#include <wine/debug.h>
> +
> +extern HINSTANCE hDllInstance;
> +extern SVCHOST_GLOBALS *lpServiceGlobals;
> +
> +DWORD
> +StartRpcServer(VOID);
> +
> +DWORD
> +StopRpcServer(VOID);
> +
> +#endif /* _SECLOGON_PCH_ */
> diff --git a/base/services/seclogon/rpcserver.c b/base/services/seclogon/rpcserver.c
> new file mode 100644
> index 00000000000..991ea703f4a
> --- /dev/null
> +++ b/base/services/seclogon/rpcserver.c
> @@ -0,0 +1,80 @@
> +/*
> + * PROJECT: ReactOS Secondary Logon Service
> + * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
> + * PURPOSE: Secondary Logon service RPC server
> + * COPYRIGHT: Eric Kohl 2022 <
eric.kohl@reactos.org>
> + */
> +
> +/* INCLUDES *****************************************************************/
> +
> +#include "precomp.h"
> +
> +#include <seclogon_s.h>
> +
> +WINE_DEFAULT_DEBUG_CHANNEL(seclogon);
> +
> +/* FUNCTIONS *****************************************************************/
> +
> +
> +void __RPC_FAR * __RPC_USER midl_user_allocate(SIZE_T len)
> +{
> + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
> +}
> +
> +
> +void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
> +{
> + HeapFree(GetProcessHeap(), 0, ptr);
> +}
> +
> +
> +DWORD
> +StartRpcServer(VOID)
> +{
> + ULONG Status;
> +
> + Status = ((LPSTART_RPC_SERVER)lpServiceGlobals->RpcpStartRpcServer)(L"seclogon", ISeclogon_v1_0_s_ifspec);
> + TRACE("RpcpStartRpcServer returned 0x%08lx\n", Status);
> +
> + return RtlNtStatusToDosError(Status);
> +}
> +
> +
> +DWORD
> +StopRpcServer(VOID)
> +{
> + ULONG Status;
> +
> + Status = ((LPSTOP_RPC_SERVER)lpServiceGlobals->RpcpStopRpcServer)(ISeclogon_v1_0_s_ifspec);
> + TRACE("RpcpStopRpcServer returned 0x%08lx\n", Status);
> +
> + return RtlNtStatusToDosError(Status);
> +}
> +
> +
> +VOID
> +__stdcall
> +SeclCreateProcessWithLogonW(
> + _In_ handle_t hBinding,
> + _In_ SECL_REQUEST *pRequest,
> + _Out_ SECL_RESPONSE *pResponse)
> +{
> + TRACE("SeclCreateProcessWithLogonW(%p %p %p)\n", hBinding, pRequest, pResponse);
> +
> + if (pRequest != NULL)
> + {
> + TRACE("Username: '%S'\n", pRequest->Username);
> + TRACE("Domain: '%S'\n", pRequest->Domain);
> + TRACE("Password: '%S'\n", pRequest->Password);
> + TRACE("ApplicationName: '%S'\n", pRequest->ApplicationName);
> + TRACE("CommandLine: '%S'\n", pRequest->CommandLine);
> + TRACE("CurrentDirectory: '%S'\n", pRequest->CurrentDirectory);
> + }
> +
> + /* FIXME: Logon */
> +
> + /* FIXME: Create Process */
> +
> + if (pResponse != NULL)
> + pResponse->ulError = 4;
> +}
> diff --git a/base/services/seclogon/seclogon.c b/base/services/seclogon/seclogon.c
> new file mode 100644
> index 00000000000..afe90befb0e
> --- /dev/null
> +++ b/base/services/seclogon/seclogon.c
> @@ -0,0 +1,181 @@
> +/*
> + * PROJECT: ReactOS Secondary Logon Service
> + * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
> + * PURPOSE: Secondary Logon service RPC server
> + * COPYRIGHT: Eric Kohl 2022 <
eric.kohl@reactos.org>
> + */
> +
> +/* INCLUDES *****************************************************************/
> +
> +#include "precomp.h"
> +
> +WINE_DEFAULT_DEBUG_CHANNEL(seclogon);
> +
> +
> +/* GLOBALS ******************************************************************/
> +
> +HINSTANCE hDllInstance;
> +SVCHOST_GLOBALS *lpServiceGlobals;
> +
> +static WCHAR ServiceName[] = L"seclogon";
> +
> +static SERVICE_STATUS_HANDLE ServiceStatusHandle;
> +static SERVICE_STATUS ServiceStatus;
> +
> +
> +/* FUNCTIONS *****************************************************************/
> +
> +static
> +VOID
> +UpdateServiceStatus(
> + _In_ DWORD dwState)
> +{
> + ServiceStatus.dwServiceType = SERVICE_WIN32_SHARE_PROCESS;
> + ServiceStatus.dwCurrentState = dwState;
> +
> + if (dwState == SERVICE_PAUSED || dwState == SERVICE_RUNNING)
> + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP |
> + SERVICE_ACCEPT_SHUTDOWN |
> + SERVICE_ACCEPT_PAUSE_CONTINUE;
> + else
> + ServiceStatus.dwControlsAccepted = 0;
> +
> + ServiceStatus.dwWin32ExitCode = 0;
> + ServiceStatus.dwServiceSpecificExitCode = 0;
> + ServiceStatus.dwCheckPoint = 0;
> +
> + if (dwState == SERVICE_START_PENDING ||
> + dwState == SERVICE_STOP_PENDING ||
> + dwState == SERVICE_PAUSE_PENDING ||
> + dwState == SERVICE_CONTINUE_PENDING)
> + ServiceStatus.dwWaitHint = 10000;
> + else
> + ServiceStatus.dwWaitHint = 0;
> +
> + SetServiceStatus(ServiceStatusHandle,
> + &ServiceStatus);
> +}
> +
> +
> +static
> +DWORD
> +WINAPI
> +ServiceControlHandlerEx(
> + _In_ DWORD dwControl,
> + _In_ DWORD dwEventType,
> + _In_ LPVOID lpEventData,
> + _In_ LPVOID lpContext)
> +{
> + TRACE("ServiceControlHandlerEx()\n");
> +
> + switch (dwControl)
> + {
> + case SERVICE_CONTROL_STOP:
> + TRACE(" SERVICE_CONTROL_STOP received\n");
> + UpdateServiceStatus(SERVICE_STOP_PENDING);
> + StopRpcServer();
> + return ERROR_SUCCESS;
> +
> + case SERVICE_CONTROL_PAUSE:
> + TRACE(" SERVICE_CONTROL_PAUSE received\n");
> + UpdateServiceStatus(SERVICE_PAUSE_PENDING);
> + StopRpcServer();
> + UpdateServiceStatus(SERVICE_PAUSED);
> + return ERROR_SUCCESS;
> +
> + case SERVICE_CONTROL_CONTINUE:
> + TRACE(" SERVICE_CONTROL_CONTINUE received\n");
> + UpdateServiceStatus(SERVICE_CONTINUE_PENDING);
> + StartRpcServer();
> + UpdateServiceStatus(SERVICE_RUNNING);
> + return ERROR_SUCCESS;
> +
> + case SERVICE_CONTROL_INTERROGATE:
> + TRACE(" SERVICE_CONTROL_INTERROGATE received\n");
> + SetServiceStatus(ServiceStatusHandle,
> + &ServiceStatus);
> + return ERROR_SUCCESS;
> +
> + case SERVICE_CONTROL_SHUTDOWN:
> + TRACE(" SERVICE_CONTROL_SHUTDOWN received\n");
> + UpdateServiceStatus(SERVICE_STOP_PENDING);
> + StopRpcServer();
> + return ERROR_SUCCESS;
> +
> + default :
> + TRACE(" Control %lu received\n", dwControl);
> + return ERROR_CALL_NOT_IMPLEMENTED;
> + }
> +}
> +
> +
> +VOID
> +WINAPI
> +SvchostPushServiceGlobals(
> + _In_ SVCHOST_GLOBALS *lpGlobals)
> +{
> + TRACE("SvchostPushServiceGlobals(%p)\n", lpGlobals);
> + lpServiceGlobals = lpGlobals;
> +}
> +
> +
> +VOID
> +WINAPI
> +SvcEntry_Seclogon(
> + _In_ INT ArgCount,
> + _In_ PWSTR *ArgVector)
> +{
> + DWORD dwError;
> +
> + UNREFERENCED_PARAMETER(ArgCount);
> + UNREFERENCED_PARAMETER(ArgVector);
> +
> + TRACE("ServiceMain(%d %p)\n", ArgCount, ArgVector);
> +
> + ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName,
> + ServiceControlHandlerEx,
> + NULL);
> + if (!ServiceStatusHandle)
> + {
> + ERR("RegisterServiceCtrlHandlerExW() failed! (Error %lu)\n", GetLastError());
> + return;
> + }
> +
> + UpdateServiceStatus(SERVICE_START_PENDING);
> +
> + dwError = StartRpcServer();
> + if (dwError != ERROR_SUCCESS)
> + {
> + ERR("Service stopped (dwError: %lu\n", dwError);
> + UpdateServiceStatus(SERVICE_STOPPED);
> + return;
> + }
> +
> + UpdateServiceStatus(SERVICE_RUNNING);
> +}
> +
> +
> +BOOL
> +WINAPI
> +DllMain(
> + _In_ HINSTANCE hinstDLL,
> + _In_ DWORD fdwReason,
> + _In_ PVOID pvReserved)
> +{
> + UNREFERENCED_PARAMETER(pvReserved);
> +
> + switch (fdwReason)
> + {
> + case DLL_PROCESS_ATTACH:
> + DisableThreadLibraryCalls(hinstDLL);
> + hDllInstance = hinstDLL;
> + break;
> +
> + case DLL_PROCESS_DETACH:
> + break;
> + }
> +
> + return TRUE;
> +}
> +
> +/* EOF */
> diff --git a/base/services/seclogon/seclogon.rc b/base/services/seclogon/seclogon.rc
> new file mode 100644
> index 00000000000..d00d082ce61
> --- /dev/null
> +++ b/base/services/seclogon/seclogon.rc
> @@ -0,0 +1,5 @@
> +#define REACTOS_VERSION_DLL
> +#define REACTOS_STR_FILE_DESCRIPTION "Secondary Logon Service Dll"
> +#define REACTOS_STR_INTERNAL_NAME "seclogon"
> +#define REACTOS_STR_ORIGINAL_FILENAME "seclogon.dll"
> +#include <reactos/version.rc>
> diff --git a/base/services/seclogon/seclogon.spec b/base/services/seclogon/seclogon.spec
> new file mode 100644
> index 00000000000..738004676e2
> --- /dev/null
> +++ b/base/services/seclogon/seclogon.spec
> @@ -0,0 +1,2 @@
> +@ stdcall SvcEntry_Seclogon(long ptr)
> +@ stdcall SvchostPushServiceGlobals(ptr)
> diff --git a/boot/bootdata/hivesft.inf b/boot/bootdata/hivesft.inf
> index aa4cdcf4f29..0d718f8984b 100644
> --- a/boot/bootdata/hivesft.inf
> +++ b/boot/bootdata/hivesft.inf
> @@ -1818,7 +1818,7 @@ HKLM,"SOFTWARE\Microsoft\Ole","EnableRemoteConnect",0x00000000,"N"
> ; SvcHost services
> HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
> HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost","DcomLaunch",0x00010000,"DcomLaunch","PlugPlay"
> -HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"DHCP","BITS","lanmanserver","lanmanworkstation","Schedule","Themes","W32Time","winmgmt","wuauserv"
> +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"BITS","DHCP","lanmanserver","lanmanworkstation","Schedule","seclogon","Themes","W32Time","winmgmt","wuauserv"
> HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost","NetworkService",0x00010000,"DnsCache"
>
> ; Win32 config
> diff --git a/boot/bootdata/hivesys.inf b/boot/bootdata/hivesys.inf
> index 20838a451a4..bc10f421afd 100644
> --- a/boot/bootdata/hivesys.inf
> +++ b/boot/bootdata/hivesys.inf
> @@ -2055,6 +2055,19 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","Type",0x00010001,0x00000020
> HKLM,"SYSTEM\CurrentControlSet\Services\Schedule\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\schedsvc.dll"
> HKLM,"SYSTEM\CurrentControlSet\Services\Schedule\Parameters","ServiceMain",0x00000000,"SchedServiceMain"
>
> +; Secondary Logon service
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","DependOnService",0x00010000,"RPCSS"
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","Description",0x00000000,"Secondary Logon service"
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","DisplayName",0x00000000,"Secondary Logon"
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","ErrorControl",0x00010001,0x00000001
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","Group",0x00000000,"SchedulerGroup"
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","ImagePath",0x00020000,"%SystemRoot%\system32\svchost.exe -k netsvcs"
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","ObjectName",0x00000000,"LocalSystem"
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","Start",0x00010001,0x00000002
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon","Type",0x00010001,0x00000020
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\seclogon.dll"
> +HKLM,"SYSTEM\CurrentControlSet\Services\Seclogon\Parameters","ServiceMain",0x00000000,"SvcEntry_Seclogon"
> +
> ; Spooler service
> HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","DependOnService",0x00010000,"RPCSS"
> HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","Description",0x00000000,%SPOOLER_SERVICE_DESCRIPTION%
>