Commit 3acdfe31 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

srvsvc: Add LanmanServer stub service.

parent d7c5797b
......@@ -1403,6 +1403,7 @@ enable_spoolss
enable_sppc
enable_srclient
enable_srvcli
enable_srvsvc
enable_sspicli
enable_stdole2_tlb
enable_stdole32_tlb
......@@ -21664,6 +21665,7 @@ wine_fn_config_makefile dlls/spoolss/tests enable_tests
wine_fn_config_makefile dlls/sppc enable_sppc
wine_fn_config_makefile dlls/srclient enable_srclient
wine_fn_config_makefile dlls/srvcli enable_srvcli
wine_fn_config_makefile dlls/srvsvc enable_srvsvc
wine_fn_config_makefile dlls/sspicli enable_sspicli
wine_fn_config_makefile dlls/stdole2.tlb enable_stdole2_tlb
wine_fn_config_makefile dlls/stdole32.tlb enable_stdole32_tlb
......
......@@ -3031,6 +3031,7 @@ WINE_CONFIG_MAKEFILE(dlls/spoolss/tests)
WINE_CONFIG_MAKEFILE(dlls/sppc)
WINE_CONFIG_MAKEFILE(dlls/srclient)
WINE_CONFIG_MAKEFILE(dlls/srvcli)
WINE_CONFIG_MAKEFILE(dlls/srvsvc)
WINE_CONFIG_MAKEFILE(dlls/sspicli)
WINE_CONFIG_MAKEFILE(dlls/stdole2.tlb)
WINE_CONFIG_MAKEFILE(dlls/stdole32.tlb)
......
MODULE = srvsvc.dll
IMPORTS = advapi32
C_SRCS = \
srvsvc.c
/*
* LanmanServer Service
*
* Copyright 2022 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winsvc.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(lanman);
static SERVICE_STATUS_HANDLE svc_handle;
static HANDLE done_event;
static void svc_update_status(DWORD state)
{
SERVICE_STATUS status;
status.dwServiceType = SERVICE_WIN32;
status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
status.dwWin32ExitCode = 0;
status.dwServiceSpecificExitCode = 0;
status.dwCheckPoint = 0;
status.dwWaitHint = 0;
status.dwCurrentState = state;
SetServiceStatus(svc_handle, &status);
}
static void WINAPI svc_handler(DWORD control)
{
TRACE("%#lx\n", control);
switch (control)
{
case SERVICE_CONTROL_STOP:
case SERVICE_CONTROL_SHUTDOWN:
svc_update_status(SERVICE_STOP_PENDING);
SetEvent(done_event);
break;
default:
svc_update_status(SERVICE_RUNNING);
break;
}
}
void WINAPI ServiceMain(DWORD argc, LPWSTR *argv)
{
TRACE("Starting LanmanServer\n");
svc_handle = RegisterServiceCtrlHandlerW(L"LanmanServer", svc_handler);
if (!svc_handle)
{
ERR("RegisterServiceCtrlHandler error %ld\n", GetLastError());
return;
}
svc_update_status(SERVICE_START_PENDING);
done_event = CreateEventW(NULL, TRUE, FALSE, NULL);
svc_update_status(SERVICE_RUNNING);
WaitForSingleObject(done_event, INFINITE);
CloseHandle(done_event);
svc_update_status(SERVICE_STOPPED);
TRACE("Exiting LanmanServer\n");
}
@ stdcall -private ServiceMain(long ptr)
......@@ -2448,12 +2448,12 @@ Description="Lanman Server"
DisplayName="Lanman Server"
ServiceBinary="%11%\svchost.exe -k netsvcs"
ServiceType=32
StartType=4
StartType=3
ErrorControl=1
[LanmanServerServiceKeys]
HKR,Parameters,"ServiceDll",,"%11%\srvsvc.dll"
;; HKLM,%CurrentVersionNT%\SvcHost,"netsvcs",0x00010008,"lanmanserver"
HKLM,%CurrentVersionNT%\SvcHost,"netsvcs",0x00010008,"lanmanserver"
[FontCacheService]
AddReg=FontCacheServiceKeys
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment