This commit is contained in:
DavidXanatos 2024-06-27 15:11:41 +02:00
parent db70bbfb38
commit 1b0bda4e40
2 changed files with 18 additions and 3 deletions

View File

@ -11,7 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed Applications cannot be launched as admin in a sandbox with "UseCreateToken/SandboxieAllGroup" enabled when using an MSFT account [#4022](https://github.com/sandboxie-plus/Sandboxie/issues/4022)
- fixed Firefox issue with Sbie 1.14.1 and 1.14.2 [#4012](https://github.com/sandboxie-plus/Sandboxie/issues/4012)
- rolled back the driver verifier fix added in 1.14.1
- fixed CustomChromiumFlags and --single-argument issue [#4033](https://github.com/sandboxie-plus/Sandboxie/issues/4033)

View File

@ -112,12 +112,27 @@ _FX BOOLEAN Kernel_Init()
status = SbieApi_QueryConfAsIs(NULL, L"CustomChromiumFlags", 0, CustomChromiumFlags, ARRAYSIZE(CustomChromiumFlags));
if (NT_SUCCESS(status)) {
const WCHAR* lpCommandLine = ProcessParms->CommandLine.Buffer;
const WCHAR* lpArguments = SbieDll_FindArgumentEnd(lpCommandLine);
if (lpArguments == NULL)
lpArguments = wcsrchr(lpCommandLine, L'\0');
Kernel_CommandLineW.MaximumLength = ProcessParms->CommandLine.MaximumLength + (CONF_LINE_LEN + 8) * sizeof(WCHAR);
Kernel_CommandLineW.Buffer = LocalAlloc(LMEM_FIXED,Kernel_CommandLineW.MaximumLength);
wcscpy(Kernel_CommandLineW.Buffer, ProcessParms->CommandLine.Buffer);
if(Kernel_CommandLineW.Buffer[ProcessParms->CommandLine.Length/sizeof(WCHAR) - 1] != L' ')
// copy argument 0
wmemcpy(Kernel_CommandLineW.Buffer, lpCommandLine, lpArguments - lpCommandLine);
Kernel_CommandLineW.Buffer[lpArguments - lpCommandLine] = 0;
// add custom arguments
if(Kernel_CommandLineW.Buffer[lpArguments - lpCommandLine - 1] != L' ')
wcscat(Kernel_CommandLineW.Buffer, L" ");
wcscat(Kernel_CommandLineW.Buffer, CustomChromiumFlags);
// add remaining arguments
wcscat(Kernel_CommandLineW.Buffer, lpArguments);
Kernel_CommandLineW.Length = wcslen(Kernel_CommandLineW.Buffer) * sizeof(WCHAR);
RtlUnicodeStringToAnsiString(&Kernel_CommandLineA, &Kernel_CommandLineW, TRUE);