This commit is contained in:
DavidXanatos 2023-10-23 22:17:29 +02:00
parent b7cb6bf4c3
commit 29fb8adca1
4 changed files with 40 additions and 30 deletions

View File

@ -30,6 +30,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- fixed issue with auto updater not offering version updates
- fixed issue with new symlink handling code [#3340](https://github.com/sandboxie-plus/Sandboxie/issues/3340)
- fixed issue with Scm_StartServiceCtrlDispatcherX not behaving correctly when nor tun as service [#1246](https://github.com/sandboxie-plus/Sandboxie/issues/1246)
### Removed
- removed obsolete /nosbiectrl switch [#3391](https://github.com/sandboxie-plus/Sandboxie/issues/3391)

View File

@ -1,5 +1,6 @@
/*
* Copyright 2004-2020 Sandboxie Holdings, LLC
* Copyright 2021-2023 David Xanatos, xanasoft.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -755,6 +756,8 @@ BOOL Hook_Service_Control_Manager(void)
BOOL Service_Start_ServiceMain(WCHAR *SvcName, const WCHAR *SvcDllName, const UCHAR *SvcProcName, BOOL UseMyStartServiceCtrlDispatcher)
{
static const WCHAR *ServiceName_EnvVar =
L"00000000_" SBIE L"_SERVICE_NAME";
HMODULE dll;
LPSERVICE_MAIN_FUNCTION ServiceMain;
ULONG table_len;
@ -785,7 +788,7 @@ BOOL Service_Start_ServiceMain(WCHAR *SvcName, const WCHAR *SvcDllName, const UC
table[0].lpServiceName = SvcName;
table[0].lpServiceProc = ServiceMain;
SetEnvironmentVariable(ServiceName_EnvVar, SvcName);
if (UseMyStartServiceCtrlDispatcher) {
PROCESS_DATA *myData;

View File

@ -1,6 +1,6 @@
/*
* Copyright 2004-2020 Sandboxie Holdings, LLC
* Copyright 2020-2021 David Xanatos, xanasoft.com
* Copyright 2020-2023 David Xanatos, xanasoft.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -1212,7 +1212,7 @@ _FX BOOL Scm_StartServiceCtrlDispatcherX(
// run is not necessarily the first entry in the table.
//
} else {
if (wcscmp(ServiceName, L"*") == 0) {
BOOLEAN TooMany;
@ -1242,6 +1242,12 @@ _FX BOOL Scm_StartServiceCtrlDispatcherX(
}
}
} else {
SetLastError(ERROR_FAILED_SERVICE_CONTROLLER_CONNECT);
return FALSE;
}
WCHAR text[130];
Sbie_snwprintf(text, 130, L"StartServiceCtrlDispatcher; name: '%s'", ServiceName);
SbieApi_MonitorPutMsg(MONITOR_SCM, text);

View File

@ -1,6 +1,6 @@
/*
* Copyright 2004-2020 Sandboxie Holdings, LLC
* Copyright 2020-2021 David Xanatos, xanasoft.com
* Copyright 2020-2023 David Xanatos, xanasoft.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -334,7 +334,7 @@ ULONG ServiceServer::RunHandler2(
if (ok) {
errlvl = 0x21;
ExePath = BuildPathForStartExe(idProcess, devmap,
(type & SERVICE_WIN32_OWN_PROCESS) ? svcname : NULL,
svcname ? (type & SERVICE_WIN32_OWN_PROCESS) ? svcname : L"*" : NULL,
path, NULL);
if (! ExePath) {
ok = FALSE;