From 3bcdd330d5e7f79331280536963b80454e35da31 Mon Sep 17 00:00:00 2001 From: DavidXanatos Date: Fri, 18 Feb 2022 20:09:35 +0100 Subject: [PATCH] 1.0.12 --- CHANGELOG.md | 14 +- Sandboxie/common/my_version.h | 4 +- .../MiscHelpers/Common/DebugHelpers.cpp | 22 ++- .../MiscHelpers/Common/DebugHelpers.h | 2 +- .../QSbieAPI/Sandboxie/BoxedProcess.cpp | 14 +- SandboxiePlus/QSbieAPI/SbieAPI.cpp | 8 +- SandboxiePlus/SandMan/Resources/IconBusy.png | Bin 0 -> 388 bytes SandboxiePlus/SandMan/Resources/IconBusyC.png | Bin 0 -> 642 bytes SandboxiePlus/SandMan/Resources/IconDFP.png | Bin 0 -> 322 bytes SandboxiePlus/SandMan/Resources/IconDFPC.png | Bin 0 -> 259 bytes .../SandMan/Resources/IconEmptyD.png | Bin 499 -> 0 bytes .../SandMan/Resources/IconEmptyDC.png | Bin 677 -> 0 bytes SandboxiePlus/SandMan/Resources/IconFullD.png | Bin 501 -> 0 bytes .../SandMan/Resources/IconFullDC.png | Bin 680 -> 0 bytes SandboxiePlus/SandMan/Resources/IconOff.png | Bin 669 -> 464 bytes SandboxiePlus/SandMan/Resources/IconOffC.png | Bin 775 -> 710 bytes SandboxiePlus/SandMan/Resources/IconOffCx.png | Bin 0 -> 669 bytes SandboxiePlus/SandMan/Resources/SandMan.qrc | 21 +-- SandboxiePlus/SandMan/SandMan.cpp | 146 +++++++++++++----- SandboxiePlus/SandMan/SandMan.h | 15 +- SandboxiePlus/SandMan/SbiePlusAPI.cpp | 4 + SandboxiePlus/SandMan/SbiePlusAPI.h | 5 + SandboxiePlus/SandMan/Views/SbieView.cpp | 45 ++---- .../SandMan/Windows/OptionsGeneral.cpp | 5 +- SandboxiePlus/SandMan/main.cpp | 4 + SandboxiePlus/version.h | 2 +- 26 files changed, 194 insertions(+), 117 deletions(-) create mode 100644 SandboxiePlus/SandMan/Resources/IconBusy.png create mode 100644 SandboxiePlus/SandMan/Resources/IconBusyC.png create mode 100644 SandboxiePlus/SandMan/Resources/IconDFP.png create mode 100644 SandboxiePlus/SandMan/Resources/IconDFPC.png delete mode 100644 SandboxiePlus/SandMan/Resources/IconEmptyD.png delete mode 100644 SandboxiePlus/SandMan/Resources/IconEmptyDC.png delete mode 100644 SandboxiePlus/SandMan/Resources/IconFullD.png delete mode 100644 SandboxiePlus/SandMan/Resources/IconFullDC.png create mode 100644 SandboxiePlus/SandMan/Resources/IconOffCx.png diff --git a/CHANGELOG.md b/CHANGELOG.md index b8415cf6..ad55e1e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,21 @@ This project adheres to [Semantic Versioning](http://semver.org/). -## [1.0.12 / 5.55.12] - 2022-02-xx (in development) -### Changed +## [1.0.12 / 5.55.12] - 2022-02-?? + +### Added +- added mini dump creation to sandman.exe in case it crashes + +### Changed - disabled Chrome and Firefox phishing entries in new sandboxes (by isaak654) [#1616](https://github.com/sandboxie-plus/Sandboxie/pull/1616) - updated Mozilla paths for the BlockSoftwareUpdaters template (by isaak654) [#1623](https://github.com/sandboxie-plus/Sandboxie/pull/1623) +- reworked tray icon generation now using overlays, added busy overlay + +### Fixed +- fixed issue with accessing network drives in privacy mode [#1617](https://github.com/sandboxie-plus/Sandboxie/issues/1617) +- fixed issue with ping in compartment mode [1608](https://github.com/sandboxie-plus/Sandboxie/issues/1608) +- fixed sandman zu freezing when a log of processes are created and closed in a box diff --git a/Sandboxie/common/my_version.h b/Sandboxie/common/my_version.h index f515279b..76e26601 100644 --- a/Sandboxie/common/my_version.h +++ b/Sandboxie/common/my_version.h @@ -21,8 +21,8 @@ #ifndef _MY_VERSION_H #define _MY_VERSION_H -#define MY_VERSION_BINARY 5,55,11 -#define MY_VERSION_STRING "5.55.11" +#define MY_VERSION_BINARY 5,55,12 +#define MY_VERSION_STRING "5.55.12" #define MY_VERSION_COMPAT "5.55.0" // this refers to the driver ABI compatibility // These #defines are used by either Resource Compiler or NSIS installer diff --git a/SandboxiePlus/MiscHelpers/Common/DebugHelpers.cpp b/SandboxiePlus/MiscHelpers/Common/DebugHelpers.cpp index 748e4ddf..619ea392 100644 --- a/SandboxiePlus/MiscHelpers/Common/DebugHelpers.cpp +++ b/SandboxiePlus/MiscHelpers/Common/DebugHelpers.cpp @@ -193,6 +193,7 @@ static tMDWD s_pMDWD; static HMODULE s_hDbgHelpMod; static MINIDUMP_TYPE s_dumpTyp = MiniDumpNormal; // MiniDumpWithDataSegs or MiniDumpWithFullMemory static wchar_t s_szMiniDumpName[64]; +static wchar_t s_szMiniDumpPath[MAX_PATH]; static LONG __stdcall MyCrashHandlerExceptionFilter(EXCEPTION_POINTERS* pEx) { @@ -214,7 +215,7 @@ static LONG __stdcall MyCrashHandlerExceptionFilter(EXCEPTION_POINTERS* pEx) wchar_t szMiniDumpFileName[128]; wsprintf(szMiniDumpFileName, L"%s %s.dmp", s_szMiniDumpName, QDateTime::currentDateTime().toString("dd.MM.yyyy hh-mm-ss,zzz").replace(QRegExp("[:*?<>|\"\\/]"), "_").toStdWString().c_str()); - wchar_t szMiniDumpPath[MAX_PATH] = { 0 }; + /*wchar_t szMiniDumpPath[MAX_PATH] = { 0 }; HANDLE hFile = CreateFile(szMiniDumpFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) @@ -226,7 +227,14 @@ static LONG __stdcall MyCrashHandlerExceptionFilter(EXCEPTION_POINTERS* pEx) wchar_t szMiniDumpFilePath[MAX_PATH] = { 0 }; wsprintf(szMiniDumpFilePath, L"%s\\%s.dmp", szMiniDumpPath, szMiniDumpFileName); hFile = CreateFile(szMiniDumpFilePath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - } + }*/ + + wchar_t szMiniDumpPath[MAX_PATH]; + wcscpy(szMiniDumpPath, s_szMiniDumpPath); + wcscat(szMiniDumpPath, L"\\"); + wcscat(szMiniDumpPath, szMiniDumpFileName); + + HANDLE hFile = CreateFile(szMiniDumpPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) { @@ -256,14 +264,16 @@ static LONG __stdcall MyCrashHandlerExceptionFilter(EXCEPTION_POINTERS* pEx) return EXCEPTION_CONTINUE_SEARCH; // this will trigger the "normal" OS error-dialog } -void InitMiniDumpWriter(const wchar_t* Name) +void InitMiniDumpWriter(const wchar_t* Name, const wchar_t* Path) { if (s_hDbgHelpMod != NULL) return; ASSERT(wcslen(Name) < ARRSIZE(s_szMiniDumpName)); wcscpy(s_szMiniDumpName, Name); - + ASSERT(wcslen(Path) < ARRSIZE(s_szMiniDumpPath)); + wcscpy(s_szMiniDumpPath, Path); + // Initialize the member, so we do not load the dll after the exception has occured // which might be not possible anymore... s_hDbgHelpMod = LoadLibrary(L"dbghelp.dll"); @@ -369,7 +379,7 @@ void InstallSigAction(int sig) } } -void InitMiniDumpWriter(const wchar_t* Name) +void InitMiniDumpWriter(const wchar_t* Name, const wchar_t* Path) { ASSERT(wcslen(Name) < ARRSIZE(s_szMiniDumpName)); wcscpy(s_szMiniDumpName, Name); @@ -384,7 +394,7 @@ quint64 GetCurCycle() } #else -void InitMiniDumpWriter(const wchar_t* Name) +void InitMiniDumpWriter(const wchar_t* Name, const wchar_t* Path) { } diff --git a/SandboxiePlus/MiscHelpers/Common/DebugHelpers.h b/SandboxiePlus/MiscHelpers/Common/DebugHelpers.h index 855a9b16..014ca759 100644 --- a/SandboxiePlus/MiscHelpers/Common/DebugHelpers.h +++ b/SandboxiePlus/MiscHelpers/Common/DebugHelpers.h @@ -169,5 +169,5 @@ private: #define TRACE_LOCKER(x) #endif -MISCHELPERS_EXPORT void InitMiniDumpWriter(const wchar_t* Name); +MISCHELPERS_EXPORT void InitMiniDumpWriter(const wchar_t* Name, const wchar_t* Path); MISCHELPERS_EXPORT quint64 GetCurCycle(); \ No newline at end of file diff --git a/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp b/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp index 0f0d37bf..c877c5d2 100644 --- a/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp +++ b/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp @@ -172,19 +172,11 @@ bool CBoxedProcess::InitProcessInfo() if (NT_SUCCESS(status)) { m_ParendPID = (quint32)BasicInformation.InheritedFromUniqueProcessId; } - - int iMaxRetry = 10; -retry: + TCHAR filename[MAX_PATH]; - if (DWORD size = GetModuleFileNameEx(ProcessHandle, NULL, filename, MAX_PATH)) + DWORD dwSize = MAX_PATH; + if(QueryFullProcessImageNameW(ProcessHandle, 0, filename, &dwSize)) m_ImagePath = QString::fromWCharArray(filename); - else if (iMaxRetry-- > 0) { - // on win 7 this sometimes fails with invalid handle despite the handle being valid, - // just wait a second and retry, this happend when comming from OnProcessBoxed - QThread::msleep(50); - goto retry; - } - BOOL isTargetWow64Process = FALSE; IsWow64Process(ProcessHandle, &isTargetWow64Process); diff --git a/SandboxiePlus/QSbieAPI/SbieAPI.cpp b/SandboxiePlus/QSbieAPI/SbieAPI.cpp index 5bc98182..a71ee358 100644 --- a/SandboxiePlus/QSbieAPI/SbieAPI.cpp +++ b/SandboxiePlus/QSbieAPI/SbieAPI.cpp @@ -2290,12 +2290,12 @@ CBoxedProcessPtr CSbieAPI::OnProcessBoxed(quint32 ProcessId, const QString& Path pProcess->InitProcessInfo(); } - if (pProcess->m_ParendPID == 0){ - pProcess->m_ParendPID = ParentId; - pProcess->m_ImagePath = Path; - } if(pProcess->m_ImageName.isEmpty()) pProcess->m_ImageName = Path.mid(Path.lastIndexOf("\\") + 1); + if (pProcess->m_ParendPID == 0) + pProcess->m_ParendPID = ParentId; + if (pProcess->m_ImagePath.isEmpty()) + pProcess->m_ImagePath = Path; return pProcess; } diff --git a/SandboxiePlus/SandMan/Resources/IconBusy.png b/SandboxiePlus/SandMan/Resources/IconBusy.png new file mode 100644 index 0000000000000000000000000000000000000000..e24582f5b7f3049f136b6bb4fdb700fc2e34b7a2 GIT binary patch literal 388 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt3(J;P+JIo=Emj7**` zjv*HQ$v4g)C=l-WFMQy=WI^Nq|NonL4ld*DbIkhC$F8b(F7xtD>ReVP!}C!3SHXXrB0A-Wb8PipQQo%Y^OG@Bguj z|Npzopr04oof2><{9 literal 0 HcmV?d00001 diff --git a/SandboxiePlus/SandMan/Resources/IconBusyC.png b/SandboxiePlus/SandMan/Resources/IconBusyC.png new file mode 100644 index 0000000000000000000000000000000000000000..edfebe5b3dce35d85f9cd3ac4a6eef9203015ef9 GIT binary patch literal 642 zcmV-|0)737P)Nkl^k7{;IfmaBDAUo30} zMHh|rVHy-su#pLCt#D$2lWfby4F57mtL+pUTEh{B&xgZ-_u;x$iKhz|N`}hE{XjI50I<`Slb5$l*zmL+ z#QGXk!Adwv4cK|b0{Ux!(iN+StwaQ7?_Jb!b!fQPLnXB^twNcYJX5g2ak`Nv&WBaL z9Uo#W=-=Cr7o9*WQ;6fXeri?*e@h|FCl88pkmayrkuVP|J{R9TZq!a?!sPVM@}~^y zT;m0Dnc;=6tpiIq3=ABo!j|@4{1}}B;ILLrECFC~NfWGdhkD zC@95A>@SRKXSo2?4xFkOF0}OmP+vERo_4Nz+8WpWV>GA)Dss1;RrS7rAZQ#Nf3?x c$zVSE1#+s;5wrZM0{{R307*qoM6N<$f;Mp|#sB~S literal 0 HcmV?d00001 diff --git a/SandboxiePlus/SandMan/Resources/IconDFP.png b/SandboxiePlus/SandMan/Resources/IconDFP.png new file mode 100644 index 0000000000000000000000000000000000000000..c9136e0ffb813ca8a7db6e0a3569407dcb0c2f10 GIT binary patch literal 322 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt3(J;P+JIo?1u2RvOI zLoEE?2JYl#G8Bj@5-Mq9&RWpPwTF zPIj>+vWqNBde^dB^KC;wkTma%mW`G(AN{NQA!lvI6;>1s;*b z3=DjSK$uZf!>a)(C{f}XQ4*Y=R#Ki=l*&+$n3-3imzP?iV4`QJXPB%t#~Y}o(bL5- z#KQk=|3Tgc1s>OG<2iSlGh>b%-C@v>Y|yYcqkI3dOfB|&wS7<6TfPgvc&@C{v)+R{ z@TrX54f(@K5!W^t?VHLdr%wsfrnS{kvqL_e0Xl}k)78&qol`;+05T?A AqyPW_ literal 0 HcmV?d00001 diff --git a/SandboxiePlus/SandMan/Resources/IconEmptyD.png b/SandboxiePlus/SandMan/Resources/IconEmptyD.png deleted file mode 100644 index 844c301e89ba51490c6140cea994df8f2954e529..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 499 zcmVN2bZe?^J zG%hhNF=Hy6O8@`?aY;l$R5(wSkxxqkQ541RqGgLV?IQXM**YC@X;L2{h-g+T@q8Z5UV?&Nzvucb_wF94*TWhne>{zjN<x!#0ZRWFUg$V|bw^uSDca2Md+|BzQ+f~0;3MeU zu~4Ges{a?*(}Y4A^t~u*iBss&_13U$qCgn5TL49Jpv_yQ!Eg$tP(Z@<$2_VeOCbT z{lLAWT6{N2bZe?^J zG%hhNF=Hy6O8@`@BS}O-R5(wKl0QrnaU8|3*Sl+#UMtsPawn3w7#MUBbk%C2Az>qu zFp}ut1cU(_>Y!mDad99qF^WSMCPT!5%|Tcl+QkqeF$aN`T>sy-g!ue^@7jYlYIw;f zz2D{D`@a0X75<|E;tR1(+$2QeT+)emhM{0#;VLF3qM-8$@siMpe=1HaClV4;sVH`K z!Z%}lA}VOa_?84a=61rB;e^a!ddn_F8NO;vnDu_&QZ z38GdDqFxWeaYWd*h~wjcd*0ks5sxbz@|qi@M@Q9;fO46Qo~hX+lNm;R?J}H?2As7% z6n^wzY)s~WUmVaM2ngots!C>=%uo;+dfuu7^!Pl%H*Bo0N!s}*9Dkn zjH*k1-9|?DOb_nBNzbAA;VqoGXMRxr?yVObz~W8h=I0})0knzgBbrR+lW$+a`duo* zelqC?RFfkO&+fID3WvEx)D3Xf``nLsa<`d(+f6*XCzZ&}%tYJ(d!^s~fNOV~`ONRT z16WTJ2?6{2D(ug#1~jSL%;IK$3y2cA#YGjLR%8_Jo!i~r+OnkIr) zi>2!W*>(Uoaks#e$=rJX+_QCxH?mB;Ck89YkrYpA2QjTPnFZkwVV1?KVVS$G00000 LNkvXXu0mjfHozy? diff --git a/SandboxiePlus/SandMan/Resources/IconFullD.png b/SandboxiePlus/SandMan/Resources/IconFullD.png deleted file mode 100644 index 14504bcdf836fe1a028ceec003a2d1b9d092d84d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 501 zcmV<{97<5HgbW?9;ba!ELWdLwtX>N2bZe?^J zG%hhNF=Hy6O8@`?b4f%&R5(wSk;_X0Q543{B3!j-(3UcoYS20QdLJ-leh*pwP z6xGspLKIX4Qc$@NS8hryT(rr5!nRS+!*CvnUvsW^uFV*h2R`nD@AsWEcc|aGqS^{e z9{Vc>FX<7EN2bZe?^J zG%hhNF=Hy6O8@`@CP_p=R5(wKl0QrnVHn2mj=O7>UMtsjxD$ykMh092U9p;&kgyR+ z7)fMs0zx7-)Iq~w;^IJJVw9x|lQHVR<{+#N?P3U#n1et|uK%wsAwItEUGIQK4NvmR zec#>pJnx(DJ>fqZAifZviJOE(oJ$7r)-+WtEnUInWE8YNCY}>I@lVBxl|({DIvvIK zb{PBnA?)s6#QM64!9j_Gz7s=)NCdh>yzc9hF*_T<)>a6Gf`Y?C1>|ty_0Eog`FWE= zO2k7#C0zZSn1~~n3*q2EMX~6aZCefk%4ONbwpC=aI%2U49Q10fhdY1<(VKJPN`901mYy z5QcJb1E|JR$QYz?DZ_*RFbq|S9ROuJfcQT$h8X~o2hn(40#wz4tob(^!~cD=8Q`|# zH2|dWaX6~&|HYa9|9`Laf7cX1pfcpg}{HUfuW9O>;)i(%kLHV57GnH3<4m|{{z54+KYs3m@y3a zznvQ*caR6ufPZUM{{LQ$z<t@9 delta 586 zcmV-Q0=50n1DyqsJPN@801m+cxRGn^kwzwe0vkz0K~y+Tl~Yeh6k!zq8t^96xokIW z)G%6Ur)}4nbwjg%+g1=n2lp6KdJz*P67eK-ku|}Ruudfeo`R^b2!aj~b?~sZvVYK> znYyfa@vx!4zV~Kk-NO?4;5Y9#?|tw0-Z$SjV!!rENAW@!#h$b5 zt+;`WsnZPNUe1(W3T(NhLd*@xG0Q%GY(5RZx}sz4To7xqAl73Vzt@V<7P)w`FT%yV zPa2iFUDi?PXh$IuaC{Y~+?QKAoDZ!JLX3TbxW5E3@{Xa5yhSS659?9{xicq`)7lt$ z$xRtc^$tK8{|<3`Mjk0Wp8SEB&R3wMvPktkfO#>DY6r_BC;1~(^L z7>%I3bO_}S67LV9G%P#ygt6MDV)aCm8k=$w^U$=q Ye@MZo=)?-p#Q*>R07*qoM6N<$f)ex}>;M1& diff --git a/SandboxiePlus/SandMan/Resources/IconOffC.png b/SandboxiePlus/SandMan/Resources/IconOffC.png index 54391729284fa83063c65431019efcd1581ed3f9..70802e5cce16662f2dd858cc45df50312216dcfc 100644 GIT binary patch delta 687 zcmV;g0#N;j2F3-DBYy&oNklNl- zoWb1O68vvE5DteiJw1K2v9U2x00;(yCv7&{TZ>VF*5jW*QRE|e(Dv{FGfxB@(BfhS z3qOD!uLwg!Lx1g7t2N3nOpa12mHAO?95jnY^T{Xz_%KQ?LXrjE$N}jz(Ca^fy1Kes zMAB_aBogH#cbCCXTe{Y>K+84We-{9evGvA+#iUiVB_qYdHeImaW-DPIL1JMcQ<*p`jr;>3><~=(B;pQb4AA4ygqxdlxksu@zelC^a!oWI5I}ixC>+9>kZ<_;_MP+5B z+1?r127kcTAiV}$90YVaos0bWo=T-kmJCuc3jss4X8C~GWDTx5k}wzy{T`3!acynw z?_EckWl>WtG7p@Kas%;jss+!+-ot1#_K`__DwE0n?70iYEbdRX;l)Ih+YOTZTq>2W z?6hN2bZe?^JG%hhNF=Hy6O8@`@g-Jv~R5(wKl3z$uaTLez zba#qwI{!p$nTu&IHK%x;({28#W`Cvl{l%l8pN`DzWMbV!p>!qlOJ(UDL z1eKuRpD|tYZgV=93E7ME?VNkp60+zEAI`bw-1GgN?RSNLsGN93yd>;I7V%#)5qHgI z9fpVZqrblZ^t?@6B8rK>s)V>xTB^m+Pys@rT&%3*AR5g>AYevybru_aBI*bYk&%(O zRaB(Kz>g25ollas}Cs!lmAahZm@ z-H7>I6g@~@t-|*$4Ys~%kh;M=Pp0>@MJduIKiHs5qY>osaRY52V(oSXVzgqUqY;tzMl82W%JXiu*Pey|8}R*(m`nm> zxe%LQvyr@JL+qpr;nsSDTkLAwk#ldNqw%eMuaM6MEWU}E!9hJXH?`{T9i^2|v|zER z7K>7i!haIwQL0UJN^c~Skf)BS;w{eR=JFN=8H4C?Cqnf$gzBmk7VS2r7U_0B#>GFs zOan3FKcBDs^HHx8!J0}04_Vc?Bj;Ycx9!1hCg(<*tn@-N77iZ3ytNz)l@`dy9J|)y zz3#E}oGOb^Fox-B=B*aYmYFeUDT92}fsfwi7irNR&qL0+#yx%~-s9Oyk7lF^v^Bho zbV!&j--qQR4or19pI_({w7f2_&9yo1(Up?H{q)>#dGz`{Pn@;0pM9?F4_?P39!|Fe i)xwP=4X!)sDAs-!e>_HqAUWHT5(zGc$%_Msx!rA|g`v@83VGA?ZJZne}Ui z$M;wnqAOV$w6wH3_w3nI&(F{Q6RQDbWo5oIX3W@>70SmD5&o2c5iAQ)^ydcyLqL`c z!;>dZ7oh3avyF$M@NT4U0vP&FmF+YlFX+NL7>Lvt`G%Ldl(o%R{a0R!0_!g z1A{{%8$)SnsaHco!%h|!mVb=G!ovUeFMrGM??1#wkY*6Q+y!9(BNM{Oe}Nuwj1pwf z)YNPOda0R_jg9U9=`Ftyni(J(mN`Lu5Osiofr*)c;ol!1%>tzV0u2Eww+|CwP*qj! zVAR#sooKE5EH5+hE!+T*hGmWrcJv{j^Z!CLg8(SVSb*M9cVJ-9*VmuGc;(6!5hEj` z*QdAs0^1BSgb7G51u6i!Jo*S~w6OvWP_bnI#R@QXr*(m2K~GO_;-BB&^Hxs112=$? z3E_8GO#l7Pz@Y2Kz@Vd}GkNyx*_{>^7Ei$jym|A6Q(9X3+kwTu75zvCqc=H0XD^eR&7_MHw1I`;j%}Yf@M80FobQqZlHelpingHand.png Actions/RegEdit.png Actions/Software.png - IconEmpty.png - IconEmptyD.png - IconFull.png - IconFullD.png Actions/Ampel.png Actions/Compatibility.png - IconOff.png Actions/Lock.png Actions/Shell.png - IconFullDC.png - IconEmptyDC.png - IconOffC.png - IconFullC.png - IconEmptyC.png Actions/Duplicate.png Actions/Up.png Actions/Down.png Actions/All.png Actions/Save.png Actions/Uninstall.png + IconBusy.png + IconBusyC.png + IconDFP.png + IconDFPC.png + IconEmpty.png + IconEmptyC.png + IconFull.png + IconFullC.png + IconOff.png + IconOffC.png + IconOffCx.png Boxes/sandbox-b-empty.png diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 2668e4c0..a5eedeca 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -226,11 +226,13 @@ CSandMan::CSandMan(QWidget *parent) } // Tray - m_pTrayIcon = new QSystemTrayIcon(GetTrayIconName(), this); - m_pTrayIcon->setToolTip("Sandboxie-Plus"); + m_pTrayIcon = new QSystemTrayIcon(GetTrayIcon(), this); + m_pTrayIcon->setToolTip(GetTrayText()); connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(OnSysTray(QSystemTrayIcon::ActivationReason))); m_bIconEmpty = true; m_bIconDisabled = false; + m_bIconBusy = false; + m_iDeletingContent = 0; m_pTrayMenu = new QMenu(); QAction* pShowHide = m_pTrayMenu->addAction(GetIcon("IconFull", false), tr("Show/Hide"), this, SLOT(OnShowHide())); @@ -278,7 +280,7 @@ CSandMan::CSandMan(QWidget *parent) m_pTraySeparator = m_pTrayMenu->addSeparator(); m_pTrayMenu->addAction(m_pEmptyAll); - m_pDisableForce2 = m_pTrayMenu->addAction(tr("Pause Forced Programs Rules"), this, SLOT(OnDisableForce2())); + m_pDisableForce2 = m_pTrayMenu->addAction(tr("Pause Forcing Programs"), this, SLOT(OnDisableForce2())); m_pDisableForce2->setCheckable(true); m_pTrayMenu->addSeparator(); @@ -417,7 +419,7 @@ void CSandMan::CreateMenus() m_pMenuFile->addSeparator(); m_pEmptyAll = m_pMenuFile->addAction(CSandMan::GetIcon("EmptyAll"), tr("Terminate All Processes"), this, SLOT(OnEmptyAll())); m_pWndFinder = m_pMenuFile->addAction(CSandMan::GetIcon("finder"), tr("Window Finder"), this, SLOT(OnWndFinder())); - m_pDisableForce = m_pMenuFile->addAction(tr("Pause Forced Programs Rules"), this, SLOT(OnDisableForce())); + m_pDisableForce = m_pMenuFile->addAction(tr("Pause Forcing Programs"), this, SLOT(OnDisableForce())); m_pDisableForce->setCheckable(true); m_pMenuFile->addSeparator(); m_pMaintenance = m_pMenuFile->addMenu(CSandMan::GetIcon("Maintenance"), tr("&Maintenance")); @@ -751,24 +753,60 @@ void CSandMan::dropEvent(QDropEvent* e) RunSandboxed(Commands, "DefaultBox"); } -QIcon CSandMan::GetTrayIconName(bool isConnected) +QIcon CSandMan::GetTrayIcon(bool isConnected) { + bool bClassic = (theConf->GetInt("Options/SysTrayIcon", 1) == 2); + QString IconFile; if (isConnected) { if (m_bIconEmpty) IconFile = "IconEmpty"; else IconFile = "IconFull"; - - if (m_bIconDisabled) - IconFile += "D"; } else IconFile = "IconOff"; + if (bClassic) IconFile += "C"; - if (theConf->GetInt("Options/SysTrayIcon", 1) == 2) - IconFile += "C"; + QSize size = QSize(16, 16); + QPixmap result(size); + result.fill(Qt::transparent); // force alpha channel + QPainter painter(&result); + QPixmap base = GetIcon(IconFile, false).pixmap(size); + QPixmap overlay; - return GetIcon(IconFile, false); + if (m_bIconBusy) { + IconFile = "IconBusy"; + if (bClassic) { // classic has a different icon instead of an overlay + IconFile += "C"; + base = GetIcon(IconFile, false).pixmap(size); + } + else + overlay = GetIcon(IconFile, false).pixmap(size); + } + + painter.drawPixmap(0, 0, base); + if(!overlay.isNull()) painter.drawPixmap(0, 0, overlay); + + if (m_bIconDisabled) { + IconFile = "IconDFP"; + if (bClassic) IconFile += "C"; + overlay = GetIcon(IconFile, false).pixmap(size); + painter.drawPixmap(0, 0, overlay); + } + + return QIcon(result); +} + +QString CSandMan::GetTrayText(bool isConnected) +{ + QString Text = "Sandboxie-Plus"; + + if(!isConnected) + Text += tr(" - Driver/Service NOT Running!"); + else if(m_iDeletingContent) + Text += tr(" - Deleting Sandbox Content"); + + return Text; } void CSandMan::timerEvent(QTimerEvent* pEvent) @@ -777,6 +815,7 @@ void CSandMan::timerEvent(QTimerEvent* pEvent) return; bool bForceProcessDisabled = false; + bool bIconBusy = false; bool bConnected = false; if (theAPI->IsConnected()) @@ -807,12 +846,17 @@ void CSandMan::timerEvent(QTimerEvent* pEvent) else ActiveProcesses = Processes.count(); - if (m_bIconEmpty != (ActiveProcesses == 0) || m_bIconDisabled != bForceProcessDisabled) + if (theAPI->IsBusy() || m_iDeletingContent > 0) + bIconBusy = true; + + if (m_bIconEmpty != (ActiveProcesses == 0) || m_bIconBusy != bIconBusy || m_bIconDisabled != bForceProcessDisabled) { m_bIconEmpty = (ActiveProcesses == 0); + m_bIconBusy = bIconBusy; m_bIconDisabled = bForceProcessDisabled; - m_pTrayIcon->setIcon(GetTrayIconName()); + m_pTrayIcon->setIcon(GetTrayIcon()); + m_pTrayIcon->setToolTip(GetTrayText()); } } @@ -900,18 +944,49 @@ void CSandMan::timerEvent(QTimerEvent* pEvent) } } -bool CSandMan::DoDeleteCmd(const CSandBoxPtr &pBox) +SB_STATUS CSandMan::DeleteBoxContent(const CSandBoxPtr& pBox, EDelMode Mode, bool DeleteShapshots) { - foreach(const QString& Value, pBox->GetTextList("OnBoxDelete", true, false, true)) { - QString Value2 = pBox->Expand(Value); - CSbieProgressPtr pProgress = CSbieUtils::RunCommand(Value2, true); - if (!pProgress.isNull()) { - AddAsyncOp(pProgress, true, tr("Executing OnBoxDelete: %1").arg(Value2)); - if (pProgress->IsCanceled()) - return false; + SB_STATUS Ret = SB_OK; + m_iDeletingContent++; + + if (Mode != eAuto) { + Ret = pBox->TerminateAll(); + if (Ret.IsError()) + goto finish; + } + + if (Mode != eForDelete) { + foreach(const QString & Value, pBox->GetTextList("OnBoxDelete", true, false, true)) { + QString Value2 = pBox->Expand(Value); + CSbieProgressPtr pProgress = CSbieUtils::RunCommand(Value2, true); + if (!pProgress.isNull()) { + AddAsyncOp(pProgress, true, tr("Executing OnBoxDelete: %1").arg(Value2)); + if (pProgress->IsCanceled()) { + Ret = CSbieStatus(SB_Canceled); + goto finish; + } + } } } - return true; + + { + SB_PROGRESS Status; + if (Mode != eForDelete && !DeleteShapshots && pBox->HasSnapshots()) { // in auto delete mdoe always return to last snapshot + QString Current; + QString Default = pBox->GetDefaultSnapshot(&Current); + Status = pBox->SelectSnapshot(Mode == eAuto ? Current : Default); + } + else // if there are no snapshots just use the normal cleaning procedure + Status = pBox->CleanBox(); + + Ret = Status; + if (Status.GetStatus() == OP_ASYNC) + Ret = AddAsyncOp(Status.GetValue(), true, tr("Auto Deleting %1 Content").arg(pBox->GetName())); + } + +finish: + m_iDeletingContent--; + return Ret; } void CSandMan::OnBoxClosed(const QString& BoxName) @@ -937,22 +1012,7 @@ void CSandMan::OnBoxClosed(const QString& BoxName) CheckResults(QList() << Status); } else - { - if (!DoDeleteCmd(pBox)) - return; - - SB_PROGRESS Status; - if (!DeleteShapshots && pBox->HasSnapshots()) { // in auto delete mdoe always return to last snapshot - QString Current; - pBox->GetDefaultSnapshot(&Current); - Status = pBox->SelectSnapshot(Current); - } - else // if there are no snapshots just use the normal cleaning procedure - Status = pBox->CleanBox(); - - if (Status.GetStatus() == OP_ASYNC) - AddAsyncOp(Status.GetValue(), true, tr("Auto Deleting %1 content").arg(BoxName)); - } + DeleteBoxContent(pBox, eAuto, DeleteShapshots); } } @@ -1080,9 +1140,11 @@ void CSandMan::OnStatusChanged() this->setWindowTitle(appTitle); - m_pTrayIcon->setIcon(GetTrayIconName(isConnected)); + m_pTrayIcon->setIcon(GetTrayIcon(isConnected)); + m_pTrayIcon->setToolTip(GetTrayText(isConnected)); m_bIconEmpty = true; m_bIconDisabled = false; + m_bIconBusy = false; m_pNewBox->setEnabled(isConnected); m_pNewGroup->setEnabled(isConnected); @@ -1900,7 +1962,7 @@ void CSandMan::OnSetMonitoring() //m_pTraceView->setEnabled(m_pEnableMonitoring->isChecked()); } -bool CSandMan::AddAsyncOp(const CSbieProgressPtr& pProgress, bool bWait, const QString& InitialMsg) +SB_STATUS CSandMan::AddAsyncOp(const CSbieProgressPtr& pProgress, bool bWait, const QString& InitialMsg) { m_pAsyncProgress.insert(pProgress.data(), pProgress); connect(pProgress.data(), SIGNAL(Message(const QString&)), this, SLOT(OnAsyncMessage(const QString&))); @@ -1919,7 +1981,9 @@ bool CSandMan::AddAsyncOp(const CSbieProgressPtr& pProgress, bool bWait, const Q if (pProgress->IsFinished()) // Note: since the operation runs asynchronously, it may have already finished, so we need to test for that OnAsyncFinished(pProgress.data()); - return !pProgress->IsCanceled(); + if (pProgress->IsCanceled()) + return CSbieStatus(SB_Canceled); + return SB_OK; } void CSandMan::OnAsyncFinished() diff --git a/SandboxiePlus/SandMan/SandMan.h b/SandboxiePlus/SandMan/SandMan.h index 1b2521dc..1c0cad36 100644 --- a/SandboxiePlus/SandMan/SandMan.h +++ b/SandboxiePlus/SandMan/SandMan.h @@ -38,9 +38,15 @@ public: SB_PROGRESS RecoverFiles(const QList>& FileList, int Action = 0); - bool DoDeleteCmd(const CSandBoxPtr &pBox); + enum EDelMode { + eDefault, + eAuto, + eForDelete + }; - bool AddAsyncOp(const CSbieProgressPtr& pProgress, bool bWait = false, const QString& InitialMsg = QString()); + SB_STATUS DeleteBoxContent(const CSandBoxPtr& pBox, EDelMode Mode, bool DeleteShapshots = true); + + SB_STATUS AddAsyncOp(const CSbieProgressPtr& pProgress, bool bWait = false, const QString& InitialMsg = QString()); static QString FormatError(const SB_STATUS& Error); static void CheckResults(QList Results); @@ -75,7 +81,8 @@ protected: static void RecoverFilesAsync(const CSbieProgressPtr& pProgress, const QList>& FileList, int Action = 0); - QIcon GetTrayIconName(bool isConnected = true); + QIcon GetTrayIcon(bool isConnected = true); + QString GetTrayText(bool isConnected = true); void closeEvent(QCloseEvent* e); @@ -285,6 +292,8 @@ private: //QMenu* m_pBoxMenu; bool m_bIconEmpty; bool m_bIconDisabled; + bool m_bIconBusy; + int m_iDeletingContent; bool m_bExit; diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.cpp b/SandboxiePlus/SandMan/SbiePlusAPI.cpp index b43b87dd..90c68444 100644 --- a/SandboxiePlus/SandMan/SbiePlusAPI.cpp +++ b/SandboxiePlus/SandMan/SbiePlusAPI.cpp @@ -7,6 +7,7 @@ CSbiePlusAPI::CSbiePlusAPI(QObject* parent) : CSbieAPI(parent) { + m_JobCount = 0; } CSbiePlusAPI::~CSbiePlusAPI() @@ -451,6 +452,7 @@ SB_STATUS CSandBoxPlus::DeleteContentAsync(bool DeleteShapshots, bool bOnAutoDel void CSandBoxPlus::AddJobToQueue(CBoxJob* pJob) { + theAPI->m_JobCount++; m_JobQueue.append(QSharedPointer(pJob)); if (m_JobQueue.count() == 1) StartNextJob(); @@ -476,6 +478,7 @@ next: else { m_JobQueue.removeFirst(); + theAPI->m_JobCount--; if (Status.IsError()) { m_JobQueue.clear(); theGUI->CheckResults(QList() << Status); @@ -494,6 +497,7 @@ void CSandBoxPlus::OnAsyncFinished() m_StatusStr.clear(); QSharedPointer pJob = m_JobQueue.takeFirst(); + theAPI->m_JobCount--; CSbieProgressPtr pProgress = pJob->GetProgress(); if (pProgress->IsCanceled()) { m_JobQueue.clear(); diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.h b/SandboxiePlus/SandMan/SbiePlusAPI.h index 373f8561..94aeea77 100644 --- a/SandboxiePlus/SandMan/SbiePlusAPI.h +++ b/SandboxiePlus/SandMan/SbiePlusAPI.h @@ -17,12 +17,17 @@ public: virtual bool IsRunningAsAdmin(); + virtual bool IsBusy() const { return m_JobCount > 0; } + protected: + friend class CSandBoxPlus; + virtual CSandBox* NewSandBox(const QString& BoxName, class CSbieAPI* pAPI); virtual CBoxedProcess* NewBoxedProcess(quint32 ProcessId, class CSandBox* pBox); virtual CBoxedProcessPtr OnProcessBoxed(quint32 ProcessId, const QString& Path, const QString& Box, quint32 ParentId); + int m_JobCount; QMultiMap m_WindowMap; }; diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index adcd77f1..efc41ef5 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -989,20 +989,12 @@ void CSbieView::OnSandBoxAction(QAction* Action) foreach(const CSandBoxPtr& pBox, SandBoxes) { - SB_STATUS Status1 = pBox->TerminateAll(); - if (Status1.IsError()) { - Results.append(Status1); - continue; - } - - SB_PROGRESS Status = pBox->CleanBox(); - if (Status.GetStatus() == OP_ASYNC) - theGUI->AddAsyncOp(Status.GetValue(), true, tr("Deleting %1 content").arg(pBox->GetName())); - else if (Status.IsError()) { - Results.append(Status); - continue; - } - Results.append(pBox->RemoveBox()); + SB_STATUS Status = theGUI->DeleteBoxContent(pBox, CSandMan::eForDelete); + if (Status.GetMsgCode() == SB_Canceled) + break; + if (!Status.IsError()) + Status = pBox->RemoveBox(); + Results.append(Status); } } else if (Action == m_pMenuCleanUp) @@ -1041,27 +1033,10 @@ void CSbieView::OnSandBoxAction(QAction* Action) } else { - SB_STATUS Status1 = pBox->TerminateAll(); - if (Status1.IsError()) { - Results.append(Status1); - continue; - } - - if (!theGUI->DoDeleteCmd(pBox)) - continue; - - SB_PROGRESS Status; - if (!DeleteShapshots && pBox->HasSnapshots()) { - QString Default = pBox->GetDefaultSnapshot(); - Status = pBox->SelectSnapshot(Default); - } - else // if there are no snapshots jut use the normal cleaning procedure - Status = pBox->CleanBox(); - - if (Status.GetStatus() == OP_ASYNC) - theGUI->AddAsyncOp(Status.GetValue()); - else if (Status.IsError()) - Results.append(Status); + SB_STATUS Status = theGUI->DeleteBoxContent(pBox, CSandMan::eDefault, DeleteShapshots); + if (Status.GetMsgCode() == SB_Canceled) + break; + Results.append(Status); } } } diff --git a/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp b/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp index e6aabb1c..51f1d585 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp @@ -325,7 +325,9 @@ void COptionsWindow::OnBoxTypChanged() //ui.chkRestrictServices->setChecked(true); ui.chkPrivacy->setChecked(BoxType == CSandBoxPlus::eHardenedPlus); //SetTemplate("NoUACProxy", false); - //SetTemplate("DeviceSecurity", true); + //if ((g_FeatureFlags & CSbieAPI::eSbieFeatureCert) == 0) + // SetTemplate("DeviceSecurity", true); // requirers rule specificity + SetTemplate("RpcPortBindingsExt", false); break; case CSandBoxPlus::eDefaultPlus: case CSandBoxPlus::eDefault: @@ -345,6 +347,7 @@ void COptionsWindow::OnBoxTypChanged() ui.chkPrivacy->setChecked(BoxType == CSandBoxPlus::eAppBoxPlus); //SetTemplate("NoUACProxy", true); //SetTemplate("DeviceSecurity", false); + SetTemplate("RpcPortBindingsExt", true); break; } diff --git a/SandboxiePlus/SandMan/main.cpp b/SandboxiePlus/SandMan/main.cpp index be664ad9..1f688ca6 100644 --- a/SandboxiePlus/SandMan/main.cpp +++ b/SandboxiePlus/SandMan/main.cpp @@ -97,6 +97,10 @@ int main(int argc, char *argv[]) // use a shared setting location when used in a business environment for easier administration theConf = new CSettings("Sandboxie-Plus", g_CertInfo.business); +#ifndef _DEBUG + InitMiniDumpWriter(L"SandMan", QString(theConf->GetConfigDir()).replace("/", "\\").toStdWString().c_str()); +#endif + //QThreadPool::globalInstance()->setMaxThreadCount(theConf->GetInt("Options/MaxThreadPool", 10)); diff --git a/SandboxiePlus/version.h b/SandboxiePlus/version.h index da8a412a..0d030cad 100644 --- a/SandboxiePlus/version.h +++ b/SandboxiePlus/version.h @@ -2,7 +2,7 @@ #define VERSION_MJR 1 #define VERSION_MIN 0 -#define VERSION_REV 11 +#define VERSION_REV 12 #define VERSION_UPD 0 #ifndef STR