From: Dmitry Timoshkov dmitry@baikal.ru
dwControlsAccepted is initialized a few lines earlier.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/schedsvc/svc_main.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/schedsvc/svc_main.c b/dlls/schedsvc/svc_main.c index 349dae756fc..1e525c06506 100644 --- a/dlls/schedsvc/svc_main.c +++ b/dlls/schedsvc/svc_main.c @@ -281,7 +281,6 @@ static void schedsvc_update_status(DWORD state) status.dwServiceSpecificExitCode = 0; status.dwCheckPoint = 0; status.dwWaitHint = 0; - status.dwControlsAccepted = 0; status.dwCurrentState = state;
SetServiceStatus(schedsvc_handle, &status);
From: Dmitry Timoshkov dmitry@baikal.ru
dwControlsAccepted is initialized a few lines earlier.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/wevtsvc/wevtsvc.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/wevtsvc/wevtsvc.c b/dlls/wevtsvc/wevtsvc.c index 2e303045740..78c68bac69b 100644 --- a/dlls/wevtsvc/wevtsvc.c +++ b/dlls/wevtsvc/wevtsvc.c @@ -40,7 +40,6 @@ static void eventlog_update_status(DWORD state) status.dwServiceSpecificExitCode = 0; status.dwCheckPoint = 0; status.dwWaitHint = 0; - status.dwControlsAccepted = 0; status.dwCurrentState = state;
SetServiceStatus(svc_handle, &status);
From: Dmitry Timoshkov dmitry@baikal.ru
wine.inf already has an entry for it.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- configure.ac | 1 + dlls/srvsvc/Makefile.in | 5 +++ dlls/srvsvc/srvsvc.c | 87 +++++++++++++++++++++++++++++++++++++++++ dlls/srvsvc/srvsvc.spec | 1 + loader/wine.inf.in | 4 +- 5 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 dlls/srvsvc/Makefile.in create mode 100644 dlls/srvsvc/srvsvc.c create mode 100644 dlls/srvsvc/srvsvc.spec
diff --git a/configure.ac b/configure.ac index 8b1a92c6396..1ea45c3a75d 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/dlls/srvsvc/Makefile.in b/dlls/srvsvc/Makefile.in new file mode 100644 index 00000000000..f9c68fd12aa --- /dev/null +++ b/dlls/srvsvc/Makefile.in @@ -0,0 +1,5 @@ +MODULE = srvsvc.dll +IMPORTS = advapi32 + +C_SRCS = \ + srvsvc.c diff --git a/dlls/srvsvc/srvsvc.c b/dlls/srvsvc/srvsvc.c new file mode 100644 index 00000000000..3b2b563bc6c --- /dev/null +++ b/dlls/srvsvc/srvsvc.c @@ -0,0 +1,87 @@ +/* + * 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"); +} diff --git a/dlls/srvsvc/srvsvc.spec b/dlls/srvsvc/srvsvc.spec new file mode 100644 index 00000000000..daa88578f7f --- /dev/null +++ b/dlls/srvsvc/srvsvc.spec @@ -0,0 +1 @@ +@ stdcall -private ServiceMain(long ptr) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 347af35af6d..382808c4876 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -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
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=137160
Your paranoid android.
=== debian11b (64 bit WoW report) ===
advapi32: service.c:2934: Test succeeded inside todo block: got 0x5