diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb16425..4e9ebbb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - fixed issues with pinned shortcuts - fixed Process Suspend/Resume context menu [#3156](https://github.com/sandboxie-plus/Sandboxie/issues/3156) - +- fixed issues with Installers created with Qt [#2493](https://github.com/sandboxie-plus/Sandboxie/issues/2493) [#3153](https://github.com/sandboxie-plus/Sandboxie/issues/3153) diff --git a/Sandboxie/core/dll/guicon.c b/Sandboxie/core/dll/guicon.c index 574b748d..b5c24481 100644 --- a/Sandboxie/core/dll/guicon.c +++ b/Sandboxie/core/dll/guicon.c @@ -220,6 +220,25 @@ _FX BOOL Gui_ConnectConsole(ULONG ShowFlag) if (! AttachConsole(rpl->process_id)) status = STATUS_NOT_SAME_DEVICE; + + // + // wait for the count to inidcate the service has quit + // + + typedef DWORD (*P_GetConsoleProcessList)(LPDWORD lpdwProcessList, DWORD dwProcessCount); + P_GetConsoleProcessList GetConsoleProcessList = (P_GetConsoleProcessList) + GetProcAddress(Dll_Kernel32, "GetConsoleProcessList"); + + DWORD pids[10]; // 2 should be enough but lets go with 10 + + while (1) { + + Sleep(50); + + ULONG num_pids = GetConsoleProcessList(pids, ARRAYSIZE(pids)); + if (num_pids < 2) + break; + } } Dll_Free(rpl); @@ -264,6 +283,7 @@ _FX void Gui_InitConsole2(void) HANDLE *Handles; HMODULE User32; + // $Workaround$ - 3rd party fix // // hack: the Kaspersky process klwtblfs.exe is protected from // termination through TerminateProcess, so make sure we terminate diff --git a/Sandboxie/core/svc/GuiServer.cpp b/Sandboxie/core/svc/GuiServer.cpp index ab0a6b61..9f80aef8 100644 --- a/Sandboxie/core/svc/GuiServer.cpp +++ b/Sandboxie/core/svc/GuiServer.cpp @@ -4306,9 +4306,7 @@ void GuiServer::RunConsoleSlave(const WCHAR *evtname) HANDLE hEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, evtname); - const ULONG max_pids = 16000; - ULONG pids_len = max_pids * sizeof(ULONG); - ULONG *pids = (ULONG *)HeapAlloc(GetProcessHeap(), 0, pids_len); + DWORD pids[10]; // 2 should be enough but lets go with 10 if (hEvent && pids) { @@ -4329,18 +4327,13 @@ void GuiServer::RunConsoleSlave(const WCHAR *evtname) while (1) { - Sleep(2000); + Sleep(50); - ULONG num_pids = GetConsoleProcessList(pids, max_pids); - if (num_pids > 1 && num_pids < max_pids) { - - Sleep(2000); + ULONG num_pids = GetConsoleProcessList(pids, ARRAYSIZE(pids)); + if (num_pids > 1) break; - } } } - - //HeapFree(GetProcessHeap(), 0, pids); // don't bother we ExitProcess aynways } ExitProcess(0);