commit
27bee43e80
116
CHANGELOG.md
116
CHANGELOG.md
|
@ -3,8 +3,15 @@ All notable changes to this project will be documented in this file.
|
|||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.5.2a / 5.45.1] - 2020-12-23
|
||||
|
||||
## [0.5.2 / 5.45.1] - 2020-12-22
|
||||
### Fixed
|
||||
- fixed translation support in the sandman ui
|
||||
- fixed sandboxed explorer issue
|
||||
|
||||
|
||||
|
||||
## [0.5.2 / 5.45.1] - 2020-12-23
|
||||
|
||||
### Added
|
||||
- added advanced new box creation dialog to sandman ui
|
||||
|
@ -19,27 +26,28 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- reorganized the advanced box options a bit
|
||||
- changed icons (thanks Valinwolf for picking the new once)
|
||||
- updated Template.ini (thanks isaak654)
|
||||
- increates max value for disable forced process time in sandman ui
|
||||
|
||||
### Fixed
|
||||
- fixed BSOD introduced in 5.45.0 when using windows 10 "Core isolation"
|
||||
- fixed minor issue with lingering/leader processes
|
||||
- fixed menu issue in sandman ui
|
||||
- fixed issue with stop behavioure page in sandman ui
|
||||
- fixed issue with stop behaviour page in sandman ui
|
||||
- fixed issue with Plus installer not displaying kmdutil window
|
||||
- fixed sandman UI saving ui settings on windows shutdown
|
||||
- fixed issue with Plus installer autorun
|
||||
- fixed issue with legacy installer not removing all files
|
||||
- fixed a driver compatybility issue with windows 20H1 and later
|
||||
- fixed a driver compatibility issue with windows 20H1 and later
|
||||
-- this solves "stop pending", line messager hanging and other issues...
|
||||
- fixed quick recovery issue in SbieCtrl.exe introduced in 5.45.0
|
||||
- fixed issue advanced hide process settings, not saving
|
||||
- fixed some typos in the UI (thanks isaak654)
|
||||
- fixed issue with GetRawInputDeviceInfo failing when boxed processes are put in a job object
|
||||
-- this fix resolves isses with CP2077 andother PC Games not getting keyboard input (thanks Rostok)
|
||||
- fixed failing ClipCursor wont longer span the message log
|
||||
-- this fix resolves issues with CP2077 and other PC Games not getting keyboard input (thanks Rostok)
|
||||
- fixed failing ClipCursor won't longer span the message log
|
||||
- fixed issue with adding recovery folders in sandman ui
|
||||
- fixed issue with office 2019 template when using a non default sbie install location
|
||||
- fixed issue settign last access atribute on sandboxed folders
|
||||
- fixed issue with office 2019 template when using a non-default sbie install location
|
||||
- fixed issue setting last access attribute on sandboxed folders
|
||||
- fixed issue with process start signal
|
||||
|
||||
|
||||
|
@ -54,10 +62,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Fixed
|
||||
- fixed crash issue with progress dialog
|
||||
- fixed progress dialog cancel button not wokong for update checker
|
||||
- fixed progress dialog cancel button not working for update checker
|
||||
- fixed issue around NtQueryDirectoryFile when deleting sandbox content
|
||||
- fixed dark theme in the notification window
|
||||
- fixed issue with disable force pograms tray menu
|
||||
- fixed issue with disable force programs tray menu
|
||||
|
||||
|
||||
|
||||
|
@ -66,19 +74,19 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
### Added
|
||||
- added new notification window
|
||||
- added user interactive control mechanism when using the new SandMan UI
|
||||
-- when a file exeeds the copy limit instead of failing, the user is prompted if the file should be copied or not
|
||||
-- when a file exceeds the copy limit instead of failing, the user is prompted if the file should be copied or not
|
||||
-- when internet access is blocked it now can be exempted in real time by the user
|
||||
- added missing file recovery and auto/quick recovery functionality
|
||||
- added silent MSG_1399 boxed process start notification to keep track of short lived boxed processes
|
||||
- added ability to prvent system wide process starts, sandboxie can now instead of just alerting also block processed on the alert list
|
||||
-- set "StartRunAlertDenied=y" to enable prcess blocking
|
||||
- added ability to prevent system wide process starts, sandboxie can now instead of just alerting also block processed on the alert list
|
||||
-- set "StartRunAlertDenied=y" to enable process blocking
|
||||
- the process start alert/block mechanism can now also handle folders use "AlertFolder=..."
|
||||
- added ability to merge snapshots
|
||||
- added icons to the sandbox context menu in the new UI
|
||||
- added more advanced options to the sandbox options window
|
||||
- added file migration progress indicator
|
||||
- added more run commands and custom run commands per sandbox
|
||||
-- the the box settings users can now speficy programs to be available from the box run menu
|
||||
-- the box settings users can now specify programs to be available from the box run menu
|
||||
-- also processes can be pinned to that list from the presets menu
|
||||
- added more windows 10 specific template presets
|
||||
- added ability to create desktop shortcuts to sandboxed items
|
||||
|
@ -90,24 +98,24 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Changed
|
||||
- File migration limit can now be disabled by specifying "CopyLimitKb=-1"
|
||||
- improved and refactored mesage logging mechanism, reducing memory usage by factor of 2
|
||||
- terminated boxed processes are now kept listed for a coupel of seconds
|
||||
- reworked sandbox dletion mechaism ofthe new UI
|
||||
- improved and refactored message logging mechanism, reducing memory usage by factor of 2
|
||||
- terminated boxed processes are now kept listed for a couple of seconds
|
||||
- reworked sandbox deletion mechanism of the new UI
|
||||
- restructured sandbox options window
|
||||
- SbieDLL.dll can now be compiled with an up to date ntdll.lib (Thanks to TechLord from Team-IRA for help)
|
||||
- improved automated driver self repair
|
||||
|
||||
### Fixed
|
||||
- fixed issues migrating files > 4GB
|
||||
- fixed a issue that would allow a maliciosue application to bypass the internet blockade
|
||||
- fixed issue when logging messages from a non sandboxed process, added process_id parameter to API_LOG_MESSAGE_ARGS
|
||||
- fixed an issue that would allow a malicious application to bypass the internet blockade
|
||||
- fixed issue when logging messages from a non-sandboxed process, added process_id parameter to API_LOG_MESSAGE_ARGS
|
||||
- fixed issues with localization
|
||||
- fixed issue using file recovery in legacy ui SbieCtrl.exe when "SeparateUserFolders=n" is set
|
||||
- when a program is blocked from starting due to restrictions no redundant messages are issues anymore
|
||||
- fixed UI not properly displaying async errors
|
||||
- fixed issues when a snapshot operation failed
|
||||
- fixed some special cases of IpcPath and WinClass in the new UI
|
||||
- fixed driver issues with WHQL passing compatybility testing
|
||||
- fixed driver issues with WHQL passing compatibility testing
|
||||
- fixed issues with classical installer
|
||||
|
||||
|
||||
|
@ -116,36 +124,36 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Added
|
||||
- added "Terminate all processes" and "disable forced programs" commands to tray menu in SandMan ui
|
||||
- program start restrictions settings now can be switsched between a white list and a black list
|
||||
- program start restrictions settings now can be switched between a white list and a black list
|
||||
-- programs can be terminated and blacklisted from the context menu
|
||||
- added additional process context menu options, lingering and leader process can be now set from menu
|
||||
- added option to view template presets for any given box
|
||||
- added text filter to template view
|
||||
- added new compatybility templates:
|
||||
- added new compatibility templates:
|
||||
-- Windows 10 core UI component: OpenIpcPath=\BaseNamedObjects\[CoreUI]-* solving issues with Chinese Input and Emojis
|
||||
-- FireFox Quantum, access to windows FontCachePort for compatybility with windows 7
|
||||
-- FireFox Quantum, access to windows FontCachePort for compatibility with Windows 7
|
||||
- added experimental debug option "OriginalToken=y" which lets sandboxed processes retain their original unrestricted token
|
||||
-- This option is comparable with "OpenToken=y" and is intended only for testing and debugging, it BREAKS most SECURITY guarantees (!)
|
||||
- added debug option "NoSandboxieDesktop=y" it disables the desktop proxy mechanism
|
||||
-- Note: without an unrestricted token with this option applications wont be able to start
|
||||
-- Note: without an unrestricted token with this option applications won't be able to start
|
||||
- added debug option "NoSysCallHooks=y" it disables the sys call processing by the driver
|
||||
-- Note: without an unrestricted token with this option applications wont be able to start
|
||||
- added ability to record verbost access tracess to the resource monitor
|
||||
-- Note: without an unrestricted token with this option applications won't be able to start
|
||||
- added ability to record verbose access traces to the resource monitor
|
||||
-- use ini options "FileTrace=*", "PipeTrace=*", "KeyTrace=*", "IpcTrace=*", "GuiTrace=*" to record all events
|
||||
-- replace "*" to log only: "A" - allowed, "D" - denided, or "I" - ignore events
|
||||
-- replace "*" to log only: "A" - allowed, "D" - denied, or "I" - ignore events
|
||||
- added ability to record debug output strings to the resource monitor,
|
||||
-- use ini option DebugTrace=y to enable
|
||||
|
||||
### Changed
|
||||
- AppUserModelID sting no longer contains sandboxie version string
|
||||
- now by default sbie's application manifest hack is disabled, as it causes problems with version checking on windows 10
|
||||
-- to enable old behavioure add "PreferExternalManifest=y" to the global or the box specific ini section
|
||||
-- to enable old behaviour add "PreferExternalManifest=y" to the global or the box specific ini section
|
||||
- the resource log mechanism can now handle multiple strings to reduce on string copy operations
|
||||
|
||||
### Fixed
|
||||
- fixed issue with disabling some restriction settings failed
|
||||
- fixed disabling of internet block from the presets menu sometimes failed
|
||||
- the software compatybility list in the sandman UI now shows the proper template names
|
||||
- the software compatibility list in the sandman UI now shows the proper template names
|
||||
- fixed use of freed memory in the driver
|
||||
- replaced swprintf with snwprintf to prevent potential buffer overflow in SbieDll.dll
|
||||
- fixed bad list performance with resource log and api log in SandMan UI
|
||||
|
@ -176,7 +184,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- fixed file rename bug introduced with an earlier driver verifier fix
|
||||
- fixed issue saving access lists
|
||||
- fixed issue with program groups parsing in the SandMan UI
|
||||
- fixed issue with intrnet access restriction options
|
||||
- fixed issue with internet access restriction options
|
||||
- fixed issue deleting sandbox when located on a drive directly
|
||||
|
||||
|
||||
|
@ -188,24 +196,24 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
### Fixed
|
||||
- fixed thread handle leak in SbieSvc and other components
|
||||
- msedge.exe is now categorized as a chromium derivate
|
||||
- fixed chrome 86+ compatybility bug with chroms own sandbox
|
||||
- fixed chrome 86+ compatibility bug with chrome's own sandbox
|
||||
|
||||
|
||||
## [0.4.1 / 5.43.5] - 2020-09-12
|
||||
|
||||
### Added
|
||||
- added core version compatybility check to sandman UI
|
||||
- added core version compatibility check to sandman UI
|
||||
- added shell integration options to SbiePlus
|
||||
|
||||
### Changed
|
||||
- SbieCtrl does not longer auto show the tutorian on first start
|
||||
- when hooking, the to the trampoline migrated section of the original function is not longer noped out
|
||||
- SbieCtrl does not longer auto show the tutorial on first start
|
||||
- when hooking, the to the trampoline migrated section of the original function is no longer noped out
|
||||
-- it caused issues with unity games, will be investigated and re enabled later
|
||||
|
||||
### Fixed
|
||||
- fixed color issue with vertical tabs in dark mode
|
||||
- fixed wrong path separators when adding new forced folders
|
||||
- fixed directroy listing bug intriduced in 5.43
|
||||
- fixed directory listing bug introduced in 5.43
|
||||
- fixed issues with settings window when not being connected to driver
|
||||
- fixed issue when starting sandman ui as admin
|
||||
- fixed auto content delete not working with sandman ui
|
||||
|
@ -215,7 +223,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
## [0.4.0 / 5.43] - 2020-09-05
|
||||
|
||||
### Added
|
||||
- added a proper custom installer to the the Plus release
|
||||
- added a proper custom installer to the Plus release
|
||||
- added sandbox snapshot functionality to sbie core
|
||||
-- filesystem is saved incrementally, the snapshots built upon each other
|
||||
-- each snapshot gets a full copy of the box registry for now
|
||||
|
@ -224,12 +232,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- added setting to change border width
|
||||
- added snapshot manager UI to SandMan
|
||||
- added template to enable authentication with an Yubikey or comparable 2FA device
|
||||
- added ui for program allert
|
||||
- added software compatybility options to teh UI
|
||||
- added ui for program alert
|
||||
- added software compatibility options to the UI
|
||||
|
||||
### Changed
|
||||
- SandMan UI now handles deletion of sandboxe content on its own
|
||||
- no longer adding redundnat resource accesses as new events
|
||||
- SandMan UI now handles deletion of sandbox content on its own
|
||||
- no longer adding redundant resource accesses as new events
|
||||
|
||||
### Fixed
|
||||
- fixed issues when hooking functions from delay loaded libraries
|
||||
|
@ -245,7 +253,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Added
|
||||
- Added settings window
|
||||
- added translationsupport
|
||||
- added translation support
|
||||
- added dark theme
|
||||
- added auto start option
|
||||
- added sandbox options
|
||||
|
@ -259,7 +267,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
### Fixed
|
||||
- fixed ini issue with sandman.exe when renaming sandboxes
|
||||
- fixed ini auto reload bug introduced in the last build
|
||||
- fixed issue when hooking delayd loaded libraries
|
||||
- fixed issue when hooking delayed loaded libraries
|
||||
|
||||
|
||||
|
||||
|
@ -269,19 +277,19 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- API_QUERY_PROCESS_INFO can be now used to get the original process token of sandboxed processes
|
||||
-- Note: this capability is used by TaskExplorer to allow inspecting sandbox internal tokens
|
||||
- Added option "KeepTokenIntegrity=y" to make the sbie token keep its initial integrity level (debug option)
|
||||
-- Note: Do NOT USE Debug Options if you dont know their security implications (!)
|
||||
- Added process id to log messages very usefull for debugging
|
||||
-- Note: Do NOT USE Debug Options if you don't know their security implications (!)
|
||||
- Added process id to log messages very useful for debugging
|
||||
- Added finder to resource log
|
||||
- Added option to hide host processes "HideHostProcess=[name]"
|
||||
-- Note: Sbie hides by default processes from other boxes, this behavioure can now be controlled with "HideOtherBoxes=n"
|
||||
- Sandboxed RpcSs and DcomLaunch can now be run as system with the option "ProtectRpcSs=y" howeever tht breaks sandboxed explorer and other
|
||||
- BuiltIn Clsid whitelist can now be disabled with "OpenDefaultClsid=n"
|
||||
-- Note: Sbie hides by default processes from other boxes, this behaviour can now be controlled with "HideOtherBoxes=n"
|
||||
- Sandboxed RpcSs and DcomLaunch can now be run as system with the option "ProtectRpcSs=y" however this breaks sandboxed explorer and other
|
||||
- Built In Clsid whitelist can now be disabled with "OpenDefaultClsid=n"
|
||||
- Processes can be now terminated with the del key, and require a confirmation
|
||||
- Added sandboxed window border display to SandMan.exe
|
||||
- Added notification for sbie log messages
|
||||
- Added Sandbox Presets sub menu allowing to quickly change some settings
|
||||
-- Enable/Disable API logging, logapi_dll's are now distributed with SbiePlus
|
||||
-- And other: Drop admin rights; Block/Allow internet access; Block/Allow access to files on te network
|
||||
-- And other: Drop admin rights; Block/Allow internet access; Block/Allow access to files on the network
|
||||
- Added more info to the sandbox status column
|
||||
- Added path column to SbieModel
|
||||
- Added info tooltips in SbieView
|
||||
|
@ -289,7 +297,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
### Changed
|
||||
- Reworked ApiLog, added pid and pid filter
|
||||
- Auto config reload on in change is now delayed by 500ms to not reload multiple times on incremental changes
|
||||
- Sandbox names now replace "_" witn " " for display allowing to use names that are build of separated words
|
||||
- Sandbox names now replace "_" with " " for display allowing to use names that are made of separated words
|
||||
|
||||
### Fixed
|
||||
- added mising PreferExternalManifest itialization to portable mode
|
||||
|
@ -297,7 +305,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
-- Note: you can use "ExposeBoxedSystem=y" for the old behaviour (debug option)
|
||||
- fixed missing SCM access check for sandboxed services
|
||||
-- Note: to disable the access check use "UnrestrictedSCM=y" (debug option)
|
||||
- fixed missing initialization in serviceserver that caused sandboxed programs to crash when querying service status
|
||||
- fixed missing initialization in service server that caused sandboxed programs to crash when querying service status
|
||||
- fixed many bugs that caused the SbieDrv.sys to BSOD when run with MSFT Driver Verifier active
|
||||
-- 0xF6 in GetThreadTokenOwnerPid and File_Api_Rename
|
||||
-- missing non optional parameter for FltGetFileNameInformation in File_PreOperation
|
||||
|
@ -329,15 +337,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- added DPI awareness
|
||||
- the driver file is now obfuscated to avoid false positives
|
||||
- additional debug options to sandboxie.ini OpenToken=y that combines UnrestrictedToken=y and UnfilteredToken=y
|
||||
-- Note: using these options weekens the sandboxing, they are intended for debugging and may be used for better application virtualization later
|
||||
-- Note: using these options weakens the sandboxing, they are intended for debugging and may be used for better application virtualization later
|
||||
|
||||
### Changed
|
||||
- SbieDll.dll when processinh InjectDll now looks in the SbieHome folder for the Dll's if the entered path starts with a backslash
|
||||
- SbieDll.dll when processing InjectDll now looks in the SbieHome folder for the Dll's if the entered path starts with a backslash
|
||||
-- i.e. "InjectDll=\LogAPI\i386\logapi32v.dll" or "InjectDll64=\LogAPI\amd64\logapi64v.dll"
|
||||
|
||||
### Fixed
|
||||
- IniWatcher did not work in portable mode
|
||||
- service path fix broke other services, now properly fixed, may be
|
||||
- service path fix broke other services, now properly fixed, maybe
|
||||
- found workaround for the msi installer issue
|
||||
|
||||
|
||||
|
@ -346,8 +354,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Added
|
||||
- IniWatcher, no more clicking reload, the ini is now reloaded automatically every time it changes
|
||||
- Added Mainanance menu to the Sandbox menu, allowing to install/uninstall and start/stop sandboxie driver, service
|
||||
- SandMan.exe now is packed with Sbie files and when no sbie is installed acts as a portable instalation
|
||||
- Added Maintenance menu to the Sandbox menu, allowing to install/uninstall and start/stop sandboxie driver, service
|
||||
- SandMan.exe now is packed with Sbie files and when no sbie is installed acts as a portable installation
|
||||
- Added option to clean up logs
|
||||
|
||||
### Changed
|
||||
|
|
31
README.md
31
README.md
|
@ -1,20 +1,35 @@
|
|||
# Sandboxie
|
||||
|
||||
Sandboxie is sandbox-based isolation software for 32- and 64-bit Windows NT-based operating systems. It was developed by Sophos (which acquired it from Invincea, which acquired it earlier from the original author Ronen Tzur). It creates a sandbox-like isolated operating environment in which applications can be run or installed without permanently modifying the local or mapped drive. An isolated virtual environment allows controlled testing of untrusted programs and web surfing.
|
||||
Sandboxie is a sandbox-based isolation software for 32- and 64-bit Windows NT-based operating systems. It creates a sandbox-like isolated operating environment in which applications can be run or installed without permanently modifying local & mapped drives or the windows registry. An isolated virtual environment allows controlled testing of untrusted programs and web surfing.
|
||||
|
||||
|
||||
## History
|
||||
## Project maintenance
|
||||
2004 - 2013 Ronen Tzur
|
||||
|
||||
Sandboxie was initially released in 2004 as a tool for sandboxing Internet Explorer. Over time, the program was expanded to support other browsers and arbitrary Win32 applications.
|
||||
2013 - 2017 Invincea Inc.
|
||||
|
||||
In December 2013, Invincea announced the acquisition of Sandboxie.
|
||||
2017 - 2020 Sophos Group plc
|
||||
|
||||
In February 2017, Sophos announced the acquisition of Invincea. Invincea posted an assurance in Sandboxie's website that for the time being Sandboxie's development and support would continue as normal.
|
||||
Open Source release
|
||||
|
||||
In September 2019, Sophos switched to a new license.
|
||||
2020 onwards David Xanatos
|
||||
|
||||
In 2020 Sophos has released Sandboxie as Open Source under the GPLv3 licence to the community for further developement and maintanance.
|
||||
|
||||
## Support
|
||||
## Helpful Contributors
|
||||
- diversenok - Security analysis & PoC's
|
||||
- stephtr - CI and Certification
|
||||
- TechLord / Team-IRA - Reversing
|
||||
- isaak654 - UI fixes and Templates
|
||||
- cricri-pingouin - UI fixes
|
||||
- Valinwolf - UI / Icons
|
||||
|
||||
### Translators
|
||||
- nkh0472
|
||||
- bastik-1001
|
||||
|
||||
More volunteers welcome ;)
|
||||
|
||||
## Support the project
|
||||
If you like the tool please consider supporting it on Patreon: https://www.patreon.com/DavidXanatos
|
||||
|
||||
Or Donating directly via the PayPal button on my website: https://xanasoft.com
|
||||
|
|
|
@ -2365,7 +2365,7 @@ void CBoxPage::FileMigrate_OnOK(CBox &box)
|
|||
|
||||
int size;
|
||||
if (size64 < 1)
|
||||
size = 1;
|
||||
size = -1;
|
||||
else if (size64 > 999999999)
|
||||
size = 999999999;
|
||||
else
|
||||
|
|
Binary file not shown.
|
@ -23,7 +23,7 @@
|
|||
|
||||
#define MY_VERSION_BINARY 5,45,1
|
||||
#define MY_VERSION_STRING "5.45.1"
|
||||
#define MY_VERSION_COMPAT "5.45.0" // this reffers to the driver ABI compatybility
|
||||
#define MY_VERSION_COMPAT "5.45.0" // this refers to the driver ABI compatibility
|
||||
|
||||
// These #defines are used by either Resource Compiler, or by NSIC installer
|
||||
#define SBIE_INSTALLER_PATH "..\\Bin\\"
|
||||
|
@ -32,8 +32,8 @@
|
|||
|
||||
#define MY_PRODUCT_NAME_STRING "Sandboxie"
|
||||
#define MY_COMPANY_NAME_STRING "xanasoft.com"
|
||||
#define MY_COPYRIGHT_STRING "Copyright © 2020-2021 by David Xanatos (xanasoft.com)"
|
||||
#define MY_COPYRIGHT_STRING_OLD "Copyright © 2004-2020 by Sandboxie Holdings, LLC"
|
||||
#define MY_COPYRIGHT_STRING "Copyright © 2020-2021 by David Xanatos (xanasoft.com)"
|
||||
#define MY_COPYRIGHT_STRING_OLD "Copyright © 2004-2020 by Sandboxie Holdings, LLC"
|
||||
|
||||
#define SANDBOXIE L"Sandboxie"
|
||||
#define SBIE L"SBIE"
|
||||
|
|
|
@ -750,7 +750,7 @@ _FX NTSTATUS Session_Api_MonitorPut2(PROCESS *proc, ULONG64 *parms)
|
|||
log_data = args->log_ptr.val;
|
||||
ProbeForRead(log_data, log_len * sizeof(WCHAR), sizeof(WCHAR));
|
||||
|
||||
name = Mem_Alloc(proc->pool, 260 * sizeof(WCHAR)); // todo: should we increate this ?
|
||||
name = Mem_Alloc(proc->pool, 260 * sizeof(WCHAR)); // todo: should we increase this ?
|
||||
if (! name)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
||||
|
@ -972,7 +972,7 @@ _FX NTSTATUS Session_Api_MonitorGetEx(PROCESS *proc, ULONG64 *parms)
|
|||
CHAR* read_ptr = NULL;
|
||||
if (seq_num != NULL)
|
||||
read_ptr = log_buffer_get_next(*seq_num, session->monitor_log);
|
||||
else if (session->monitor_log->buffer_size > 0) // for compatybility with older versions we return the oldest entry
|
||||
else if (session->monitor_log->buffer_size > 0) // for compatibility with older versions we return the oldest entry
|
||||
read_ptr = session->monitor_log->buffer_start_ptr;
|
||||
|
||||
if (!read_ptr) {
|
||||
|
@ -999,17 +999,17 @@ _FX NTSTATUS Session_Api_MonitorGetEx(PROCESS *proc, ULONG64 *parms)
|
|||
if (log_pid != NULL)
|
||||
*log_pid = pid64;
|
||||
|
||||
log_len -= sizeof(WCHAR); // reserve room for the termination charakter
|
||||
log_len -= sizeof(WCHAR); // reserve room for the termination character
|
||||
if (log_len > entry_size - (2 + 8))
|
||||
log_len = entry_size - (2 + 8);
|
||||
log_buffer_get_bytes((CHAR*)log_data, log_len, &read_ptr, session->monitor_log);
|
||||
|
||||
// add required termination charakter
|
||||
// add required termination character
|
||||
*(WCHAR*)(((CHAR*)log_data) + log_len) = L'\0';
|
||||
|
||||
if (seq_num != NULL)
|
||||
*seq_num = seq_number;
|
||||
else // for compatybility with older versions we fall back to clearing the returned entry
|
||||
else // for compatibility with older versions we fall back to clearing the returned entry
|
||||
log_buffer_pop_entry(session->monitor_log);
|
||||
|
||||
|
||||
|
|
Binary file not shown.
|
@ -142,6 +142,9 @@
|
|||
<ClInclude Include="rc4.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="resource1.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
//---------------------------------------------------------------------------
|
||||
// Command utility
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
|
||||
#include "common/my_version.h"
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Version
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION MY_VERSION_BINARY
|
||||
PRODUCTVERSION MY_VERSION_BINARY
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", MY_COMPANY_NAME_STRING "\0"
|
||||
VALUE "FileDescription", MY_PRODUCT_NAME_STRING " configuration file utility\0"
|
||||
VALUE "FileVersion", MY_VERSION_STRING "\0"
|
||||
OPTIONAL_VALUE("InternalName", "kmdutil\0")
|
||||
VALUE "LegalCopyright", MY_COPYRIGHT_STRING "\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
OPTIONAL_VALUE("OriginalFilename", "kmdutil.exe\0")
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", MY_PRODUCT_NAME_STRING "\0"
|
||||
VALUE "ProductVersion", MY_VERSION_STRING "\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
|
@ -215,9 +215,6 @@
|
|||
<ClInclude Include="SbieUtils.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="qsbieapi_de.ts" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
|
|
|
@ -28,11 +28,6 @@
|
|||
<Filter Include="Helpers">
|
||||
<UniqueIdentifier>{de0b69a3-8110-4776-abb6-e1930c0f8385}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
@ -108,9 +103,4 @@
|
|||
<Filter>Sandboxie</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="qsbieapi_de.ts">
|
||||
<Filter>Translation Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -72,15 +72,6 @@ bool CBoxedProcess::InitProcessInfo()
|
|||
return true;
|
||||
}
|
||||
|
||||
QString CBoxedProcess::GetStatusStr() const
|
||||
{
|
||||
if (m_uTerminated != 0)
|
||||
return tr("Terminated");
|
||||
if (m_bSuspended)
|
||||
return tr("Suspended");
|
||||
return tr("Running");
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
NTSYSCALLAPI NTSTATUS NTAPI NtTerminateProcess(_In_opt_ HANDLE ProcessHandle, _In_ NTSTATUS ExitStatus);
|
||||
|
|
|
@ -36,7 +36,6 @@ public:
|
|||
virtual QString GetProcessName() const { return m_ImageName; }
|
||||
virtual QString GetFileName() const { return m_ImagePath; }
|
||||
virtual QDateTime GetTimeStamp() const { return m_StartTime; }
|
||||
virtual QString GetStatusStr() const;
|
||||
|
||||
virtual SB_STATUS Terminate();
|
||||
virtual bool IsTerminated(quint64 forMs = 0) const;
|
||||
|
|
|
@ -94,7 +94,7 @@ SB_STATUS CSandBox::TerminateAll()
|
|||
SB_PROGRESS CSandBox::CleanBox()
|
||||
{
|
||||
if (GetBool("NeverDelete", false))
|
||||
return SB_ERR(tr("Delete protection is enabled for the sandbox"));
|
||||
return SB_ERR(SB_DeleteProtect);
|
||||
|
||||
SB_STATUS Status = TerminateAll();
|
||||
if (Status.IsError())
|
||||
|
@ -128,7 +128,7 @@ SB_STATUS CSandBox__DeleteFolder(const CSbieProgressPtr& pProgress, const QStrin
|
|||
|
||||
NTSTATUS status = NtIo_DeleteFolderRecursively(&ntObject.attr);
|
||||
if (!NT_SUCCESS(status))
|
||||
return SB_ERR(CSandBox::tr("Error deleting sandbox folder: %1").arg(Folder), status);
|
||||
return SB_ERR(SB_DeleteError, QVariantList() << Folder, status);
|
||||
return SB_OK;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ void CSandBox::CleanBoxAsync(const CSbieProgressPtr& pProgress, const QStringLis
|
|||
SB_STATUS CSandBox::RenameBox(const QString& NewName)
|
||||
{
|
||||
if (QDir(m_FilePath).exists())
|
||||
return SB_ERR(tr("A sandbox must be emptied before it can be renamed."));
|
||||
return SB_ERR(SB_RemNotEmpty);
|
||||
|
||||
|
||||
SB_STATUS Status = CSbieAPI::ValidateName(NewName);
|
||||
|
@ -162,7 +162,7 @@ SB_STATUS CSandBox::RenameBox(const QString& NewName)
|
|||
SB_STATUS CSandBox::RemoveBox()
|
||||
{
|
||||
if (QDir(m_FilePath).exists())
|
||||
return SB_ERR(tr("A sandbox must be emptied before it can be deleted."));
|
||||
return SB_ERR(SB_DelNotEmpty);
|
||||
|
||||
return RemoveSection();
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ SB_STATUS CSandBox__MoveFolder(const QString& SourcePath, const QString& ParentF
|
|||
SNtObject dest_dir(L"\\??\\" + ParentFolder.toStdWString());
|
||||
NTSTATUS status = NtIo_RenameFolder(&src_dir.attr, &dest_dir.attr, TargetName.toStdWString().c_str());
|
||||
if (!NT_SUCCESS(status) && status != STATUS_OBJECT_NAME_NOT_FOUND && status != STATUS_OBJECT_PATH_NOT_FOUND)
|
||||
return SB_ERR(CSandBox::tr("Failed to move directory '%1' to '%2'").arg(SourcePath).arg(ParentFolder + "\\" + TargetName), status);
|
||||
return SB_ERR(SB_FailedMoveDir, QVariantList() <<SourcePath << (ParentFolder + "\\" + TargetName), status);
|
||||
return SB_OK;
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ SB_PROGRESS CSandBox::TakeSnapshot(const QString& Name)
|
|||
QSettings ini(m_FilePath + "\\Snapshots.ini", QSettings::IniFormat);
|
||||
|
||||
if (m_pAPI->HasProcesses(m_Name))
|
||||
return SB_ERR(tr("Can't take a snapshot while processes are running in the box."), OP_CONFIRM);
|
||||
return SB_ERR(SB_SnapIsRunning, OP_CONFIRM);
|
||||
|
||||
QStringList Snapshots = ini.childGroups();
|
||||
|
||||
|
@ -225,9 +225,9 @@ SB_PROGRESS CSandBox::TakeSnapshot(const QString& Name)
|
|||
}
|
||||
|
||||
if (!QDir().mkdir(m_FilePath + "\\snapshot-" + ID))
|
||||
return SB_ERR(tr("Failed to create directory for new snapshot"));
|
||||
return SB_ERR(SB_SnapMkDirFail);
|
||||
if (!QFile::copy(m_FilePath + "\\RegHive", m_FilePath + "\\snapshot-" + ID + "\\RegHive"))
|
||||
return SB_ERR(tr("Failed to copy RegHive to snapshot"));
|
||||
return SB_ERR(SB_SnapCopyRegFail);
|
||||
|
||||
ini.setValue("Snapshot_" + ID + "/Name", Name);
|
||||
ini.setValue("Snapshot_" + ID + "/SnapshotDate", QDateTime::currentDateTime().toTime_t());
|
||||
|
@ -252,10 +252,10 @@ SB_PROGRESS CSandBox::RemoveSnapshot(const QString& ID)
|
|||
QSettings ini(m_FilePath + "\\Snapshots.ini", QSettings::IniFormat);
|
||||
|
||||
if (!ini.childGroups().contains("Snapshot_" + ID))
|
||||
return SB_ERR(tr("Snapshot not found"));
|
||||
return SB_ERR(SB_SnapNotFound);
|
||||
|
||||
if (m_pAPI->HasProcesses(m_Name))
|
||||
return SB_ERR(tr("Can't remove a snapshots while processes are running in the box."), OP_CONFIRM);
|
||||
return SB_ERR(SB_SnapIsRunning, OP_CONFIRM);
|
||||
|
||||
QStringList ChildIDs;
|
||||
foreach(const QString& Snapshot, ini.childGroups())
|
||||
|
@ -271,7 +271,7 @@ SB_PROGRESS CSandBox::RemoveSnapshot(const QString& ID)
|
|||
bool IsCurrent = Current == ID;
|
||||
|
||||
if (ChildIDs.count() >= 2 || (ChildIDs.count() == 1 && IsCurrent))
|
||||
return SB_ERR(tr("Can't remove a snapshots that is shared by multiple later snapshots"));
|
||||
return SB_ERR(SB_SnapIsShared);
|
||||
|
||||
CSbieProgressPtr pProgress = CSbieProgressPtr(new CSbieProgress());
|
||||
if (ChildIDs.count() == 1 || IsCurrent)
|
||||
|
@ -323,7 +323,7 @@ SB_STATUS CSandBox__MergeFolders(const CSbieProgressPtr& pProgress, const QStrin
|
|||
|
||||
NTSTATUS status = NtIo_MergeFolder(&ntSource.attr, &ntTarget.attr);
|
||||
if (!NT_SUCCESS(status))
|
||||
return SB_ERR(CSandBox::tr("Error merging snapshot directories '%1' with '%2', the snapshot has not been fully merged.").arg(TargetFolder).arg(SourceFolder), status);
|
||||
return SB_ERR(SB_SnapMergeFail, QVariantList() << TargetFolder << SourceFolder, status);
|
||||
return SB_OK;
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ SB_STATUS CSandBox__CleanupSnapshot(const QString& Folder)
|
|||
status = NtDeleteFile(&ntSnapshotFile.attr);
|
||||
}
|
||||
if (!NT_SUCCESS(status))
|
||||
return SB_ERR(CSandBox::tr("Failed to remove old snapshot directory '%1'").arg(Folder), status);
|
||||
return SB_ERR(SB_SnapRmDirFail, QVariantList() << Folder, status);
|
||||
return SB_OK;
|
||||
}
|
||||
|
||||
|
@ -415,15 +415,15 @@ SB_PROGRESS CSandBox::SelectSnapshot(const QString& ID)
|
|||
QSettings ini(m_FilePath + "\\Snapshots.ini", QSettings::IniFormat);
|
||||
|
||||
if (!ini.childGroups().contains("Snapshot_" + ID))
|
||||
return SB_ERR(tr("Snapshot not found"));
|
||||
return SB_ERR(SB_SnapNotFound);
|
||||
|
||||
if (m_pAPI->HasProcesses(m_Name))
|
||||
return SB_ERR(tr("Can't switch snapshots while processes are running in the box."), OP_CONFIRM);
|
||||
return SB_ERR(SB_SnapIsRunning, OP_CONFIRM);
|
||||
|
||||
if (!QFile::remove(m_FilePath + "\\RegHive"))
|
||||
return SB_ERR(tr("Failed to remove old RegHive"));
|
||||
return SB_ERR(SB_SnapDelRegFail);
|
||||
if (!QFile::copy(m_FilePath + "\\snapshot-" + ID + "\\RegHive", m_FilePath + "\\RegHive"))
|
||||
return SB_ERR(tr("Failed to copy RegHive from snapshot"));
|
||||
return SB_ERR(SB_SnapCopyRegFail);
|
||||
|
||||
ini.setValue("Current/Snapshot", ID);
|
||||
ini.sync();
|
||||
|
@ -439,7 +439,7 @@ SB_STATUS CSandBox::SetSnapshotInfo(const QString& ID, const QString& Name, cons
|
|||
QSettings ini(m_FilePath + "\\Snapshots.ini", QSettings::IniFormat);
|
||||
|
||||
if (!ini.childGroups().contains("Snapshot_" + ID))
|
||||
return SB_ERR(tr("Snapshot not found"));
|
||||
return SB_ERR(SB_SnapNotFound);
|
||||
|
||||
if (!Name.isNull())
|
||||
ini.setValue("Snapshot_" + ID + "/Name", Name);
|
||||
|
|
|
@ -227,14 +227,14 @@ SB_STATUS CSbieIni::RenameSection( const QString& NewName, bool deleteOld) // No
|
|||
// Get all Settigns
|
||||
QList<QPair<QString, QString>> Settings = GetIniSection(&status);
|
||||
if (status != STATUS_SUCCESS)
|
||||
return SB_ERR(CSbieAPI::tr("Failed to copy configuration from sandbox %1: %2").arg(m_Name).arg(status, 8, 16), status);
|
||||
return SB_ERR(SB_FailedCopyConf, QVariantList() << m_Name << (quint32)status, status);
|
||||
|
||||
// check if such a box already exists
|
||||
if (!SameName)
|
||||
{
|
||||
m_pAPI->SbieIniGet(NewName, "", CONF_GET_NO_EXPAND, &status);
|
||||
if (status != STATUS_RESOURCE_NAME_NOT_FOUND)
|
||||
return SB_ERR(CSbieAPI::tr("A sandbox of the name %1 already exists").arg(NewName));
|
||||
return SB_ERR(SB_AlreadyExists, QVariantList() << NewName);
|
||||
}
|
||||
|
||||
// if the name is the same we first delete than write,
|
||||
|
@ -257,7 +257,7 @@ do_delete:
|
|||
{
|
||||
SB_STATUS Status = m_pAPI->SbieIniSet(m_Name, "*", "");
|
||||
if (Status.IsError())
|
||||
return SB_ERR(CSbieAPI::tr("Failed to delete sandbox %1: %2").arg(m_Name).arg(Status.GetStatus(), 8, 16), Status.GetStatus());
|
||||
return SB_ERR(SB_DeleteFailed, QVariantList() << m_Name << (quint32)Status.GetStatus(), Status.GetStatus());
|
||||
deleteOld = false;
|
||||
|
||||
if (SameName)
|
||||
|
|
|
@ -269,7 +269,7 @@ SB_STATUS CSbieAPI::Connect(bool withQueue)
|
|||
|
||||
if (status != STATUS_SUCCESS) {
|
||||
m->SbieApiHandle = INVALID_HANDLE_VALUE;
|
||||
return SB_ERR(tr("Failed to connect to driver"), status);
|
||||
return SB_ERR(SB_DriverFail, status);
|
||||
}
|
||||
|
||||
UpdateDriveLetters();
|
||||
|
@ -287,7 +287,7 @@ SB_STATUS CSbieAPI::Connect(bool withQueue)
|
|||
{
|
||||
NtClose(m->SbieApiHandle);
|
||||
m->SbieApiHandle = INVALID_HANDLE_VALUE;
|
||||
return SB_ERR(tr("Incompatible Version, found Sandboxie %1, compatible versions: %2").arg(CurVersion).arg(CompatVersions.join(", ")));
|
||||
return SB_ERR(SB_Incompatible, QVariantList() << CurVersion << CompatVersions.join(", "));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -441,18 +441,18 @@ SB_STATUS CSbieAPI__CallServer(SSbieAPI* m, MSG_HEADER* req, MSG_HEADER** prpl)
|
|||
{
|
||||
NtClose(m->PortHandle);
|
||||
m->PortHandle = NULL;
|
||||
return SB_ERR(CSbieAPI::tr("request %1").arg(status, 8, 16), status); // 2203
|
||||
return SB_ERR(SB_ServiceFail, QVariantList() << QString("request %1").arg(status, 8, 16), status); // 2203
|
||||
}
|
||||
|
||||
if (BuffLen && ResHeader->u1.s1.DataLength)
|
||||
return SB_ERR(CSbieAPI::tr("early reply")); // 2203
|
||||
return SB_ERR(SB_ServiceFail, QVariantList() << QString("early reply")); // 2203
|
||||
}
|
||||
|
||||
// the last call to NtRequestWaitReplyPort should return the first chunk of the reply
|
||||
if (ResHeader->u1.s1.DataLength >= sizeof(MSG_HEADER))
|
||||
{
|
||||
if (ResData[3] != CurSeqNumber)
|
||||
return SB_ERR(CSbieAPI::tr("mismatched reply")); // 2203
|
||||
return SB_ERR(SB_ServiceFail, QVariantList() << QString("mismatched reply")); // 2203
|
||||
|
||||
// clear highest byte of the size filed
|
||||
ResData[3] = 0;
|
||||
|
@ -461,7 +461,7 @@ SB_STATUS CSbieAPI__CallServer(SSbieAPI* m, MSG_HEADER* req, MSG_HEADER** prpl)
|
|||
else
|
||||
BuffLen = 0;
|
||||
if (BuffLen == 0)
|
||||
return SB_ERR(CSbieAPI::tr("null reply (msg %1 len %2)").arg(req->msgid, 8, 16).arg(req->length)); // 2203
|
||||
return SB_ERR(SB_ServiceFail, QVariantList() << QString("null reply (msg %1 len %2)").arg(req->msgid, 8, 16).arg(req->length)); // 2203
|
||||
|
||||
// read remining chunks
|
||||
MSG_HEADER*& rpl = *prpl;
|
||||
|
@ -499,7 +499,7 @@ SB_STATUS CSbieAPI__CallServer(SSbieAPI* m, MSG_HEADER* req, MSG_HEADER** prpl)
|
|||
|
||||
NtClose(m->PortHandle);
|
||||
m->PortHandle = NULL;
|
||||
return SB_ERR(CSbieAPI::tr("reply %1").arg(status, 8, 16), status); // 2203
|
||||
return SB_ERR(SB_ServiceFail, QVariantList() << QString("reply %1").arg(status, 8, 16), status); // 2203
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -903,15 +903,13 @@ QString CSbieAPI::GetUserSection() const
|
|||
SB_STATUS CSbieAPI::RunStart(const QString& BoxName, const QString& Command, QProcess* pProcess)
|
||||
{
|
||||
if (m_SbiePath.isEmpty())
|
||||
return SB_ERR(tr("Can't find Sandboxie instal path."));
|
||||
return SB_ERR(SB_PathFail);
|
||||
|
||||
QStringList Arguments;
|
||||
Arguments.append("/box:" + BoxName);
|
||||
Arguments.append(Command);
|
||||
QString StartCmd = "\"" + GetStartPath() + "\" /box:" + BoxName + " " + Command;
|
||||
if (pProcess)
|
||||
pProcess->start(GetStartPath(), Arguments);
|
||||
pProcess->start(StartCmd);
|
||||
else
|
||||
QProcess::startDetached(GetStartPath(), Arguments);
|
||||
QProcess::startDetached(StartCmd);
|
||||
return SB_OK;
|
||||
}
|
||||
|
||||
|
@ -974,9 +972,9 @@ retry:
|
|||
if (bRetry)
|
||||
goto retry;
|
||||
}
|
||||
return SB_ERR(CSbieAPI::tr("You are not authorized to update configuration in section '%1'").arg(SectionName), status);
|
||||
return SB_ERR(SB_NotAuthorized, QVariantList() << SectionName, status);
|
||||
}
|
||||
return SB_ERR(CSbieAPI::tr("Failed to set configuration setting %1 in section %2: %3").arg(SettingName).arg(SectionName).arg(status, 8, 16), status);
|
||||
return SB_ERR(SB_ConfigFailed, QVariantList() << SettingName << SectionName << (quint32)status, status);
|
||||
}
|
||||
|
||||
SB_STATUS CSbieAPI::SbieIniSet(const QString& Section, const QString& Setting, const QString& Value, ESetMode Mode)
|
||||
|
@ -1008,8 +1006,8 @@ SB_STATUS CSbieAPI::SbieIniSet(const QString& Section, const QString& Setting, c
|
|||
req->h.length = sizeof(SBIE_INI_SETTING_REQ) + req->value_len * sizeof(WCHAR);
|
||||
|
||||
SB_STATUS Status = SbieIniSet(req, req->password, Section, Setting);
|
||||
if (!Status)
|
||||
emit LogSbieMessage(2203, QStringList() << "" << Status.GetText() << "", GetCurrentProcessId());
|
||||
//if (!Status)
|
||||
// emit LogSbieMessage(2203, QStringList() << "" << Status.GetText() << "", GetCurrentProcessId());
|
||||
free(req);
|
||||
return Status;
|
||||
}
|
||||
|
@ -1042,17 +1040,17 @@ QString CSbieAPI::SbieIniGet(const QString& Section, const QString& Setting, qui
|
|||
SB_STATUS CSbieAPI::ValidateName(const QString& BoxName)
|
||||
{
|
||||
if (BoxName.length() > 32)
|
||||
return SB_ERR(tr("The sandbox name can not be longer than 32 charakters."));
|
||||
return SB_ERR(SB_NameLenLimit);
|
||||
|
||||
QStringList DeviceNames = QStringList() <<
|
||||
"aux" << "clock$" << "con" << "nul" << "prn" <<
|
||||
"com1" << "com2" << "com3" << "com4" << "com5" << "com6" << "com7" << "com8" << "com9" << "com0" <<
|
||||
"lpt1" << "lpt2" << "lpt3" << "lpt4" << "lpt5" << "lpt6" << "lpt7" << "lpt8" << "lpt9" << "lpt0";
|
||||
if (DeviceNames.contains(BoxName, Qt::CaseInsensitive))
|
||||
return SB_ERR(tr("The sandbox name can not be a device name."));
|
||||
return SB_ERR(SB_BadNameDev);
|
||||
|
||||
if (BoxName.contains(QRegExp("[^A-Za-z0-9_]")))
|
||||
return SB_ERR(tr("The sandbox name can contain only letters, digits and underscores which are displayed as spaces."));
|
||||
return SB_ERR(SB_BadNameChar);
|
||||
|
||||
return SB_OK;
|
||||
}
|
||||
|
@ -1264,8 +1262,6 @@ SB_STATUS CSbieAPI::TerminateAll(const QString& BoxName)
|
|||
|
||||
MSG_HEADER *rpl = NULL;
|
||||
SB_STATUS Status = CSbieAPI::CallServer(&req.h, &rpl);
|
||||
if (!Status)
|
||||
emit LogSbieMessage(2203, QStringList() << "" << Status.GetText() << "", GetCurrentProcessId());
|
||||
if (!Status || !rpl)
|
||||
return Status;
|
||||
if(rpl->status != 0)
|
||||
|
@ -1279,7 +1275,7 @@ SB_STATUS CSbieAPI::TerminateAll()
|
|||
SB_STATUS Status = SB_OK;
|
||||
foreach(const CSandBoxPtr& pBox, m_SandBoxes) {
|
||||
if (!pBox->TerminateAll())
|
||||
Status = SB_ERR(tr("Failed to terminate all processes"));
|
||||
Status = SB_ERR(SB_FailedKillAll);
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
|
@ -1293,8 +1289,6 @@ SB_STATUS CSbieAPI::Terminate(quint32 ProcessId)
|
|||
|
||||
MSG_HEADER *rpl = NULL;
|
||||
SB_STATUS Status = CSbieAPI::CallServer(&req.h, &rpl);
|
||||
if (!Status)
|
||||
emit LogSbieMessage(2203, QStringList() << "" << Status.GetText() << "", GetCurrentProcessId());
|
||||
if (!Status || !rpl)
|
||||
return Status;
|
||||
if (rpl->status != 0)
|
||||
|
@ -1459,8 +1453,6 @@ SB_STATUS CSbieAPI::RunSandboxed(const QString& BoxName, const QString& Command,
|
|||
PROCESS_RUN_SANDBOXED_RPL *rpl;
|
||||
SB_STATUS Status = CSbieAPI::CallServer(&req->h, &rpl);
|
||||
free(req);
|
||||
if (!Status)
|
||||
emit LogSbieMessage(2203, QStringList() << "" << Status.GetText() << "", GetCurrentProcessId());
|
||||
if (!Status)
|
||||
return Status;
|
||||
if (!rpl)
|
||||
|
|
|
@ -5,6 +5,41 @@
|
|||
#define OP_CONFIRM (3)
|
||||
#define OP_CANCELED (4)
|
||||
|
||||
enum ESbieMsgCodes
|
||||
{
|
||||
SB_Generic = 0,
|
||||
SB_Message,
|
||||
SB_NeedAdmin,
|
||||
SB_ExecFail,
|
||||
SB_DriverFail,
|
||||
SB_ServiceFail,
|
||||
SB_Incompatible,
|
||||
SB_PathFail,
|
||||
SB_FailedCopyConf,
|
||||
SB_AlreadyExists,
|
||||
SB_DeleteFailed,
|
||||
SB_NameLenLimit,
|
||||
SB_BadNameDev,
|
||||
SB_BadNameChar,
|
||||
SB_FailedKillAll,
|
||||
SB_DeleteProtect,
|
||||
SB_DeleteError,
|
||||
SB_RemNotEmpty,
|
||||
SB_DelNotEmpty,
|
||||
SB_FailedMoveDir,
|
||||
SB_SnapMkDirFail,
|
||||
SB_SnapCopyRegFail,
|
||||
SB_SnapNotFound,
|
||||
SB_SnapMergeFail,
|
||||
SB_SnapRmDirFail,
|
||||
SB_SnapIsShared,
|
||||
SB_SnapIsRunning,
|
||||
SB_SnapDelRegFail,
|
||||
SB_NotAuthorized,
|
||||
SB_ConfigFailed,
|
||||
|
||||
};
|
||||
|
||||
class CSbieStatus
|
||||
{
|
||||
public:
|
||||
|
@ -12,14 +47,18 @@ public:
|
|||
{
|
||||
m = NULL;
|
||||
}
|
||||
CSbieStatus(const QString& Error, long Status = 0xC0000001 /*STATUS_UNSUCCESSFUL*/) : CSbieStatus()
|
||||
CSbieStatus(ESbieMsgCodes MsgCode, const QVariantList& Args = QVariantList(), long Status = 0xC0000001 /*STATUS_UNSUCCESSFUL*/) : CSbieStatus()
|
||||
{
|
||||
SFlexError* p = new SFlexError();
|
||||
p->Error = Error;
|
||||
p->MsgCode = MsgCode;
|
||||
p->Args = Args;
|
||||
p->Status = Status;
|
||||
Attach(p);
|
||||
}
|
||||
CSbieStatus(long Status) : CSbieStatus(QObject::tr("Error Code: %1").arg(Status), Status)
|
||||
CSbieStatus(ESbieMsgCodes MsgCode, long Status) : CSbieStatus(MsgCode, QVariantList(), Status)
|
||||
{
|
||||
}
|
||||
CSbieStatus(long Status) : CSbieStatus(SB_Generic, QVariantList(), Status)
|
||||
{
|
||||
}
|
||||
CSbieStatus(const CSbieStatus& other) : CSbieStatus()
|
||||
|
@ -40,14 +79,17 @@ public:
|
|||
|
||||
__inline bool IsError() const { return m != NULL; }
|
||||
__inline long GetStatus() const { return m ? m->Status : 0; }
|
||||
__inline QString GetText() const { return m ? m->Error: ""; }
|
||||
__inline long GetMsgCode() const { return m ? m->MsgCode : 0; }
|
||||
__inline QVariantList GetArgs() const { return m ? m->Args : QVariantList(); }
|
||||
//__inline QString GetText() const { return m ? m->Text: ""; }
|
||||
|
||||
operator bool() const {return !IsError();}
|
||||
|
||||
protected:
|
||||
struct SFlexError
|
||||
{
|
||||
QString Error;
|
||||
ESbieMsgCodes MsgCode;
|
||||
QVariantList Args;
|
||||
long Status;
|
||||
|
||||
mutable atomic<int> aRefCnt;
|
||||
|
@ -80,6 +122,7 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
typedef CSbieStatus SB_STATUS;
|
||||
#define SB_OK SB_STATUS()
|
||||
#define SB_ERR SB_STATUS
|
||||
|
|
|
@ -58,7 +58,7 @@ SB_STATUS CSbieUtils::DoAssist()
|
|||
SB_STATUS Status = ExecOps(Args.mid(AssistPos + 1));
|
||||
if (Status.IsError())
|
||||
return Status;
|
||||
return SB_ERR("OK", ERROR_OK);
|
||||
return SB_ERR(ERROR_OK);
|
||||
}
|
||||
|
||||
SB_STATUS CSbieUtils::Start(EComponent Component)
|
||||
|
@ -168,7 +168,7 @@ SB_STATUS CSbieUtils::ElevateOps(const QStringList& Ops)
|
|||
shex.lpVerb = L"runas";
|
||||
|
||||
if (!ShellExecuteEx(&shex))
|
||||
return SB_ERR("Admin rights required");
|
||||
return SB_ERR(SB_NeedAdmin);
|
||||
return SB_ERR(OP_ASYNC);
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ SB_STATUS CSbieUtils::ExecOps(const QStringList& Ops)
|
|||
Proc.waitForFinished();
|
||||
int ret = Proc.exitCode();
|
||||
if (ret != 0)
|
||||
return SB_ERR("Failed to execute: " + Args.join(" "));
|
||||
return SB_ERR(SB_ExecFail, QVariantList() << Args.join(" "));
|
||||
}
|
||||
return SB_OK;
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ bool CSbieUtils::CreateShortcut(CSbieAPI* pApi, const QString &LinkPath, const Q
|
|||
if (!workdir.isEmpty())
|
||||
pShellLink->SetWorkingDirectory(workdir.toStdWString().c_str());
|
||||
if (!LinkName.isEmpty()) {
|
||||
QString desc = QObject::tr("Open %1 in sandbox %2").arg(LinkName).arg(boxname);
|
||||
QString desc = QString("%1 [%2]").arg(LinkName).arg(boxname);
|
||||
pShellLink->SetDescription(desc.toStdWString().c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -1,230 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>CBoxedProcess</name>
|
||||
<message>
|
||||
<location filename="Sandboxie/BoxedProcess.cpp" line="78"/>
|
||||
<source>Terminated</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/BoxedProcess.cpp" line="80"/>
|
||||
<source>Suspended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/BoxedProcess.cpp" line="81"/>
|
||||
<source>Running</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>CSandBox</name>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="97"/>
|
||||
<source>Delete protection is enabled for the sandbox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="118"/>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="304"/>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="313"/>
|
||||
<source>Waiting for folder: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="127"/>
|
||||
<source>Deleting folder: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="131"/>
|
||||
<source>Error deleting sandbox folder: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="152"/>
|
||||
<source>A sandbox must be emptied before it can be renamed.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="165"/>
|
||||
<source>A sandbox must be emptied before it can be deleted.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="206"/>
|
||||
<source>Failed to move directory '%1' to '%2'</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="215"/>
|
||||
<source>Can't take a snapshot while processes are running in the box.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="228"/>
|
||||
<source>Failed to create directory for new snapshot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="230"/>
|
||||
<source>Failed to copy RegHive to snapshot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="255"/>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="418"/>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="442"/>
|
||||
<source>Snapshot not found</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="258"/>
|
||||
<source>Can't remove a snapshots while processes are running in the box.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="274"/>
|
||||
<source>Can't remove a snapshots that is shared by multiple later snapshots</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="322"/>
|
||||
<source>Merging folders: %1 >> %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="326"/>
|
||||
<source>Error merging snapshot directories '%1' with '%2', the snapshot has not been fully merged.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="339"/>
|
||||
<source>Failed to remove old snapshot directory '%1'</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="366"/>
|
||||
<source>Finishing Snapshot Merge...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="421"/>
|
||||
<source>Can't switch snapshots while processes are running in the box.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="424"/>
|
||||
<source>Failed to remove old RegHive</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SandBox.cpp" line="426"/>
|
||||
<source>Failed to copy RegHive from snapshot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>CSbieAPI</name>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="272"/>
|
||||
<source>Failed to connect to driver</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="290"/>
|
||||
<source>Incompatible Version, found Sandboxie %1, compatible versions: %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="444"/>
|
||||
<source>request %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="448"/>
|
||||
<source>early reply</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="455"/>
|
||||
<source>mismatched reply</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="464"/>
|
||||
<source>null reply (msg %1 len %2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="502"/>
|
||||
<source>reply %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="906"/>
|
||||
<source>Can't find Sandboxie instal path.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="977"/>
|
||||
<source>You are not authorized to update configuration in section '%1'</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="979"/>
|
||||
<source>Failed to set configuration setting %1 in section %2: %3</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="1045"/>
|
||||
<source>The sandbox name can not be longer than 32 charakters.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="1052"/>
|
||||
<source>The sandbox name can not be a device name.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="1055"/>
|
||||
<source>The sandbox name can contain only letters, digits and underscores which are displayed as spaces.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieAPI.cpp" line="1282"/>
|
||||
<source>Failed to terminate all processes</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SbieIni.cpp" line="230"/>
|
||||
<source>Failed to copy configuration from sandbox %1: %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SbieIni.cpp" line="237"/>
|
||||
<source>A sandbox of the name %1 already exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Sandboxie/SbieIni.cpp" line="260"/>
|
||||
<source>Failed to delete sandbox %1: %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="SbieStatus.h" line="22"/>
|
||||
<source>Error Code: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="SbieUtils.cpp" line="313"/>
|
||||
<source>Open %1 in sandbox %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
|
@ -3,7 +3,7 @@
|
|||
#include "MultiErrorDialog.h"
|
||||
|
||||
|
||||
CMultiErrorDialog::CMultiErrorDialog(const QString& Message, QList<SB_STATUS> Errors, QWidget* parent)
|
||||
CMultiErrorDialog::CMultiErrorDialog(const QString& Message, const QStringList& Errors, QWidget* parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
this->setWindowTitle(tr("Sandboxie-Plus - Error"));
|
||||
|
@ -14,7 +14,6 @@ CMultiErrorDialog::CMultiErrorDialog(const QString& Message, QList<SB_STATUS> Er
|
|||
|
||||
m_pErrors = new CPanelWidgetEx();
|
||||
|
||||
//m_pErrors->GetTree()->setHeaderLabels(tr("Message|Status|Error").split("|"));
|
||||
m_pErrors->GetTree()->setHeaderLabels(tr("Message").split("|"));
|
||||
|
||||
m_pErrors->GetView()->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
|
@ -33,11 +32,10 @@ CMultiErrorDialog::CMultiErrorDialog(const QString& Message, QList<SB_STATUS> Er
|
|||
restoreGeometry(theConf->GetBlob("ErrorWindow/Window_Geometry"));
|
||||
|
||||
|
||||
foreach(const SB_STATUS& Error, Errors)
|
||||
foreach(const QString& Error, Errors)
|
||||
{
|
||||
QTreeWidgetItem* pItem = new QTreeWidgetItem();
|
||||
pItem->setText(eMessage, Error.GetText());
|
||||
//pItem->setText(eErrorCode, tr("0x%1").arg((quint32)Error.GetStatus(), 8, 16, QChar('0')));
|
||||
pItem->setText(eMessage, Error);
|
||||
m_pErrors->GetTree()->addTopLevelItem(pItem);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class CMultiErrorDialog : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CMultiErrorDialog(const QString& Message, QList<SB_STATUS> Errors, QWidget* parent = 0);
|
||||
CMultiErrorDialog(const QString& Message, const QStringList& Errors, QWidget* parent = 0);
|
||||
virtual ~CMultiErrorDialog();
|
||||
|
||||
private:
|
||||
|
|
|
@ -1110,7 +1110,7 @@ For files access you can use 'Direct All' instead to make it apply to all progra
|
|||
<item row="6" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="chkProtectRpcSs">
|
||||
<property name="text">
|
||||
<string>Start the sandboxed RpcSs as a SYSTEM process (breaks some compatybility)</string>
|
||||
<string>Start the sandboxed RpcSs as a SYSTEM process (breaks some compatibility)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -227,8 +227,9 @@ bool CSbieModel::Sync(const CSandBoxPtr& pBox, const QList<QVariant>& Path, cons
|
|||
|
||||
int ActiveCount = 0;
|
||||
|
||||
foreach(const CBoxedProcessPtr& pProcess, ProcessList)
|
||||
foreach(const CBoxedProcessPtr& pProc, ProcessList)
|
||||
{
|
||||
QSharedPointer<CSbieProcess> pProcess = pProc.objectCast<CSbieProcess>();
|
||||
QVariant ID = pProcess->GetProcessId();
|
||||
|
||||
QModelIndex Index;
|
||||
|
|
|
@ -209,7 +209,7 @@ CSandMan::CSandMan(QWidget *parent)
|
|||
|
||||
bool bAutoRun = QApplication::arguments().contains("-autorun");
|
||||
|
||||
m_pTrayIcon->show(); // Note: qt bug; without a first show hide does not work :/
|
||||
m_pTrayIcon->show(); // Note: qt bug; hide does not work if not showing first :/
|
||||
if(!bAutoRun && !theConf->GetBool("Options/ShowSysTray", true))
|
||||
m_pTrayIcon->hide();
|
||||
//
|
||||
|
@ -467,7 +467,7 @@ void CSandMan::closeEvent(QCloseEvent *e)
|
|||
if (PortableStop == -1)
|
||||
{
|
||||
bool State = false;
|
||||
PortableStop = CCheckableMessageBox::question(this, "Sandboxie-Plus", tr("Sandboxie-Plus was running in portable mode, now it has to clean up the created services, this will prompt for administrative privileges.")
|
||||
PortableStop = CCheckableMessageBox::question(this, "Sandboxie-Plus", tr("Sandboxie-Plus was running in portable mode, now it has to clean up the created services. This will prompt for administrative privileges.")
|
||||
, tr("Don't show this message again."), &State, QDialogButtonBox::Ok | QDialogButtonBox::Cancel, QDialogButtonBox::Ok, QMessageBox::Information) == QDialogButtonBox::Ok ? 1 : 0;
|
||||
|
||||
if (!PortableStop)
|
||||
|
@ -513,7 +513,7 @@ void CSandMan::OnMessage(const QString& Message)
|
|||
QMessageBox::warning(NULL, tr("Sandboxie-Plus - Error"), tr("Failed to start required sandboxie components"));
|
||||
|
||||
OnLogMessage(tr("Maintenance operation %1").arg(Status));
|
||||
CheckResults(QList<SB_STATUS>() << SB_ERR(Status));
|
||||
CheckResults(QList<SB_STATUS>() << SB_ERR(SB_Message, QVariantList() << Status));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -744,7 +744,7 @@ void CSandMan::OnLogSbieMessage(quint32 MsgCode, const QStringList& MsgData, qui
|
|||
for (int i = 1; i < MsgData.size(); i++)
|
||||
Message = Message.arg(MsgData[i]);
|
||||
|
||||
if (ProcessId != 4) // if its not from the driver add the pid
|
||||
if (ProcessId != 4) // if it's not from the driver, add the pid
|
||||
{
|
||||
CBoxedProcessPtr pProcess = theAPI->GetProcessById(ProcessId);
|
||||
if(pProcess.isNull())
|
||||
|
@ -807,7 +807,7 @@ void CSandMan::RecoverFilesAsync(const CSbieProgressPtr& pProgress, const QList<
|
|||
}
|
||||
|
||||
if (!Unrecovered.isEmpty())
|
||||
Status = SB_ERR(tr("Failed to recovery some files: \n") + Unrecovered.join("\n"));
|
||||
Status = SB_ERR(SB_Message, QVariantList () << (tr("Failed to recover some files: \n") + Unrecovered.join("\n")));
|
||||
|
||||
pProgress->Finish(Status);
|
||||
}
|
||||
|
@ -834,7 +834,7 @@ void CSandMan::OnNotAuthorized(bool bLoginRequired, bool& bRetry)
|
|||
bRetry = true;
|
||||
break;
|
||||
}
|
||||
QMessageBox::warning(this, "Sandboxie-Plus", tr("Login Failed: %1").arg(Status.GetText()));
|
||||
QMessageBox::warning(this, "Sandboxie-Plus", tr("Login Failed: %1").arg(FormatError(Status)));
|
||||
}
|
||||
LoginOpen = false;
|
||||
}
|
||||
|
@ -857,7 +857,7 @@ void CSandMan::OnDisableForce()
|
|||
if (Status)
|
||||
{
|
||||
bool bOK = false;
|
||||
Seconds = QInputDialog::getInt(this, "Sandboxie-Plus", tr("Please enter the duration for which disable forced programs."), 10, 0, 3600, 1, &bOK);
|
||||
Seconds = QInputDialog::getInt(this, "Sandboxie-Plus", tr("Please enter the duration for disabling forced programs."), 10, 0, INT_MAX, 1, &bOK);
|
||||
if (!bOK)
|
||||
return;
|
||||
}
|
||||
|
@ -882,7 +882,7 @@ SB_STATUS CSandMan::ConnectSbie()
|
|||
if (PortableStart == -1)
|
||||
{
|
||||
bool State = false;
|
||||
PortableStart = CCheckableMessageBox::question(this, "Sandboxie-Plus", tr("Sandboxie-Plus was started in portable mode and it needs to create nececery services, this will prompt for administrative privileges.")
|
||||
PortableStart = CCheckableMessageBox::question(this, "Sandboxie-Plus", tr("Sandboxie-Plus was started in portable mode and it needs to create necessary services. This will prompt for administrative privileges.")
|
||||
, tr("Don't show this message again."), &State, QDialogButtonBox::Ok | QDialogButtonBox::Cancel, QDialogButtonBox::Ok, QMessageBox::Information) == QDialogButtonBox::Ok ? 1 : 0;
|
||||
|
||||
if (State)
|
||||
|
@ -944,7 +944,7 @@ SB_STATUS CSandMan::StopSbie(bool andRemove)
|
|||
}
|
||||
if (!Status.IsError()) {
|
||||
if(andRemove)
|
||||
Status = CSbieUtils::Uninstall(CSbieUtils::eAll); // it stops it first ofcause
|
||||
Status = CSbieUtils::Uninstall(CSbieUtils::eAll); // it stops it first of course
|
||||
else
|
||||
Status = CSbieUtils::Stop(CSbieUtils::eAll);
|
||||
if (Status.GetStatus() == OP_ASYNC)
|
||||
|
@ -1082,7 +1082,7 @@ void CSandMan::OnEditIni()
|
|||
if (theConf->GetBool("Options/NoEditInfo", true))
|
||||
{
|
||||
bool State = false;
|
||||
CCheckableMessageBox::question(this, "Sandboxie-Plus", tr("The changes will be applyed automatically as soon as the editor is closed.")
|
||||
CCheckableMessageBox::question(this, "Sandboxie-Plus", tr("The changes will be applied automatically as soon as the editor is closed.")
|
||||
, tr("Don't show this message again."), &State, QDialogButtonBox::Ok, QDialogButtonBox::Ok, QMessageBox::Information);
|
||||
|
||||
if (State)
|
||||
|
@ -1106,7 +1106,7 @@ void CSandMan::OnEditIni()
|
|||
//CloseHandle(si.hProcess);
|
||||
|
||||
if (theConf->GetBool("Options/WatchIni", true))
|
||||
return; // if the ini s watched dont double reload
|
||||
return; // if the ini is watched don't double reload
|
||||
|
||||
QWinEventNotifier* processFinishedNotifier = new QWinEventNotifier(si.hProcess);
|
||||
processFinishedNotifier->setEnabled(true);
|
||||
|
@ -1184,7 +1184,7 @@ void CSandMan::AddAsyncOp(const CSbieProgressPtr& pProgress)
|
|||
m_pProgressDialog->OnStatusMessage("");
|
||||
m_pProgressDialog->show();
|
||||
|
||||
if (pProgress->IsFinished()) // Note: the operation runs asynchroniusly it may have already finished so we need to test for that
|
||||
if (pProgress->IsFinished()) // Note: since the operation runs asynchronously, it may have already finished, so we need to test for that
|
||||
OnAsyncFinished(pProgress.data());
|
||||
}
|
||||
|
||||
|
@ -1224,21 +1224,67 @@ void CSandMan::OnCancelAsync()
|
|||
pProgress->Cancel();
|
||||
}
|
||||
|
||||
void CSandMan::CheckResults(QList<SB_STATUS> Results)
|
||||
QString CSandMan::FormatError(const SB_STATUS& Error)
|
||||
{
|
||||
for (QList<SB_STATUS>::iterator I = Results.begin(); I != Results.end(); )
|
||||
//QString Text = Error.GetText();
|
||||
//if (!Text.isEmpty())
|
||||
// return Text;
|
||||
|
||||
QString Message;
|
||||
switch (Error.GetMsgCode())
|
||||
{
|
||||
if (!I->IsError() || I->GetStatus() == OP_CANCELED)
|
||||
I = Results.erase(I);
|
||||
else
|
||||
I++;
|
||||
case SB_Generic: return tr("Error Status: %1").arg(Error.GetStatus());
|
||||
case SB_Message: Message = "%1"; break;
|
||||
case SB_NeedAdmin: Message = tr("Admin rights required."); break;
|
||||
case SB_ExecFail: Message = tr("Failed to execute: %1"); break;
|
||||
case SB_DriverFail: Message = tr("Failed to connect to driver"); break;
|
||||
case SB_ServiceFail: Message = tr("Failed to communicate with Sandboxie Service: %1"); break;
|
||||
case SB_Incompatible: Message = tr("Can't find Sandboxie instal path."); break;
|
||||
case SB_PathFail: Message = tr("Incompatible Version, found Sandboxie %1, compatible versions: %2"); break;
|
||||
case SB_FailedCopyConf: Message = tr("Failed to copy configuration from sandbox %1: %2"); break;
|
||||
case SB_AlreadyExists: Message = tr("A sandbox of the name %1 already exists"); break;
|
||||
case SB_DeleteFailed: Message = tr("Failed to delete sandbox %1: %2"); break;
|
||||
case SB_NameLenLimit: Message = tr("The sandbox name can not be longer than 32 charakters."); break;
|
||||
case SB_BadNameDev: Message = tr("The sandbox name can not be a device name."); break;
|
||||
case SB_BadNameChar: Message = tr("The sandbox name can contain only letters, digits and underscores which are displayed as spaces."); break;
|
||||
case SB_FailedKillAll: Message = tr("Failed to terminate all processes"); break;
|
||||
case SB_DeleteProtect: Message = tr("Delete protection is enabled for the sandbox"); break;
|
||||
case SB_DeleteError: Message = tr("Error deleting sandbox folder: %1"); break;
|
||||
case SB_RemNotEmpty: Message = tr("A sandbox must be emptied before it can be renamed."); break;
|
||||
case SB_DelNotEmpty: Message = tr("A sandbox must be emptied before it can be deleted."); break;
|
||||
case SB_FailedMoveDir: Message = tr("Failed to move directory '%1' to '%2'"); break;
|
||||
case SB_SnapIsRunning: Message = tr("This Snapshot operation can not be performed while processes are still running in the box."); break;
|
||||
case SB_SnapMkDirFail: Message = tr("Failed to create directory for new snapshot"); break;
|
||||
case SB_SnapCopyRegFail:Message = tr("Failed to copy RegHive"); break;
|
||||
case SB_SnapNotFound: Message = tr("Snapshot not found"); break;
|
||||
case SB_SnapMergeFail: Message = tr("Error merging snapshot directories '%1' with '%2', the snapshot has not been fully merged."); break;
|
||||
case SB_SnapRmDirFail: Message = tr("Failed to remove old snapshot directory '%1'"); break;
|
||||
case SB_SnapIsShared: Message = tr("Can't remove a snapshots that is shared by multiple later snapshots"); break;
|
||||
case SB_SnapDelRegFail: Message = tr("Failed to remove old RegHive"); break;
|
||||
case SB_NotAuthorized: Message = tr("You are not authorized to update configuration in section '%1'"); break;
|
||||
case SB_ConfigFailed: Message = tr("Failed to set configuration setting %1 in section %2: %3"); break;
|
||||
|
||||
default: return tr("Unknown Error Status: %1").arg(Error.GetStatus());
|
||||
}
|
||||
|
||||
if (Results.count() == 1)
|
||||
QMessageBox::warning(NULL, tr("Sandboxie-Plus - Error"), Results[0].GetText());
|
||||
else if (Results.count() > 1)
|
||||
{
|
||||
CMultiErrorDialog Dialog(tr("Operation failed for %1 item(s).").arg(Results.size()), Results);
|
||||
foreach(const QVariant& Arg, Error.GetArgs())
|
||||
Message.arg(Arg.toString()); // todo: make quint32 hex and so on
|
||||
|
||||
return Message;
|
||||
}
|
||||
|
||||
void CSandMan::CheckResults(QList<SB_STATUS> Results)
|
||||
{
|
||||
QStringList Errors;
|
||||
for (QList<SB_STATUS>::iterator I = Results.begin(); I != Results.end(); ++I) {
|
||||
if (I->IsError() && I->GetStatus() != OP_CANCELED)
|
||||
Errors.append(FormatError(*I));
|
||||
}
|
||||
|
||||
if (Errors.count() == 1)
|
||||
QMessageBox::warning(NULL, tr("Sandboxie-Plus - Error"), Errors.first());
|
||||
else if (Errors.count() > 1) {
|
||||
CMultiErrorDialog Dialog(tr("Operation failed for %1 item(s).").arg(Errors.size()), Errors);
|
||||
Dialog.exec();
|
||||
}
|
||||
}
|
||||
|
@ -1381,13 +1427,13 @@ void CSandMan::OnUpdateCheck()
|
|||
QString MsgHash = QCryptographicHash::hash(Data["userMsg"].toByteArray(), QCryptographicHash::Md5).toHex().left(8);
|
||||
if (!IgnoredUpdates.contains(MsgHash))
|
||||
{
|
||||
CCheckableMessageBox mb(this);
|
||||
mb.setWindowTitle("Sandboxie-Plus");
|
||||
CCheckableMessageBox mb(this);
|
||||
mb.setWindowTitle("Sandboxie-Plus");
|
||||
QIcon ico(QLatin1String(":/SandMan.png"));
|
||||
mb.setIconPixmap(ico.pixmap(64, 64));
|
||||
mb.setText(UserMsg);
|
||||
mb.setCheckBoxText(tr("Don't show this announcement in future."));
|
||||
mb.setStandardButtons(QDialogButtonBox::Close);
|
||||
mb.setIconPixmap(ico.pixmap(64, 64));
|
||||
mb.setText(UserMsg);
|
||||
mb.setCheckBoxText(tr("Don't show this announcement in the future."));
|
||||
mb.setStandardButtons(QDialogButtonBox::Close);
|
||||
mb.exec();
|
||||
|
||||
if (mb.isChecked())
|
||||
|
@ -1418,27 +1464,27 @@ void CSandMan::OnUpdateCheck()
|
|||
else if (!UpdateUrl.isEmpty())
|
||||
FullMessage += tr("<p>Do you want to go to the <a href=\"%1\">download page</a>?</p>").arg(UpdateUrl);
|
||||
|
||||
CCheckableMessageBox mb(this);
|
||||
mb.setWindowTitle("Sandboxie-Plus");
|
||||
CCheckableMessageBox mb(this);
|
||||
mb.setWindowTitle("Sandboxie-Plus");
|
||||
QIcon ico(QLatin1String(":/SandMan.png"));
|
||||
mb.setIconPixmap(ico.pixmap(64, 64));
|
||||
//mb.setTextFormat(Qt::RichText);
|
||||
mb.setText(FullMessage);
|
||||
mb.setCheckBoxText(tr("Ignore this update, notify me anout the next one."));
|
||||
mb.setCheckBoxVisible(!bManual);
|
||||
|
||||
if (!UpdateUrl.isEmpty() || !DownloadUrl.isEmpty()) {
|
||||
mb.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No);
|
||||
mb.setDefaultButton(QDialogButtonBox::Yes);
|
||||
}
|
||||
else
|
||||
mb.setStandardButtons(QDialogButtonBox::Ok);
|
||||
|
||||
mb.exec();
|
||||
|
||||
mb.setIconPixmap(ico.pixmap(64, 64));
|
||||
//mb.setTextFormat(Qt::RichText);
|
||||
mb.setText(FullMessage);
|
||||
mb.setCheckBoxText(tr("Ignore this update, notify me about the next one."));
|
||||
mb.setCheckBoxVisible(!bManual);
|
||||
|
||||
if (!UpdateUrl.isEmpty() || !DownloadUrl.isEmpty()) {
|
||||
mb.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No);
|
||||
mb.setDefaultButton(QDialogButtonBox::Yes);
|
||||
}
|
||||
else
|
||||
mb.setStandardButtons(QDialogButtonBox::Ok);
|
||||
|
||||
mb.exec();
|
||||
|
||||
if (mb.isChecked())
|
||||
theConf->SetValue("Options/IgnoredUpdates", IgnoredUpdates << Version);
|
||||
|
||||
theConf->SetValue("Options/IgnoredUpdates", IgnoredUpdates << Version);
|
||||
|
||||
if (mb.clickedStandardButton() == QDialogButtonBox::Yes)
|
||||
{
|
||||
if (!DownloadUrl.isEmpty())
|
||||
|
@ -1511,7 +1557,7 @@ void CSandMan::OnUpdateDownload()
|
|||
return;
|
||||
}
|
||||
|
||||
QString Message = tr("<p>New Sandboxie-Plus has been downloaded to the following location:</p><p><a href=\"%2\">%1</a></p><p>Do you want to begin the installation. If any programs are running sandboxed, they will be terminated.</p>")
|
||||
QString Message = tr("<p>New Sandboxie-Plus has been downloaded to the following location:</p><p><a href=\"%2\">%1</a></p><p>Do you want to begin the installation? If any programs are running sandboxed, they will be terminated.</p>")
|
||||
.arg(FilePath).arg("File:///" + TempDir);
|
||||
if (QMessageBox("Sandboxie-Plus", Message, QMessageBox::Information, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape, QMessageBox::NoButton).exec() == QMessageBox::Yes)
|
||||
QProcess::startDetached(FilePath);
|
||||
|
@ -1704,4 +1750,4 @@ QString ShowRunDialog(const QString& BoxName)
|
|||
ShowRunFileDialog(MainWndHandle, NULL, NULL, boxName.c_str(), L"Enter the path of a program that will be created in a sandbox.", 0); // RFF_OPTRUNAS);
|
||||
return g_RunDialogCommand;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
|
|
@ -41,6 +41,7 @@ public:
|
|||
SB_PROGRESS RecoverFiles(const QList<QPair<QString, QString>>& FileList);
|
||||
|
||||
void AddAsyncOp(const CSbieProgressPtr& pProgress);
|
||||
static QString FormatError(const SB_STATUS& Error);
|
||||
static void CheckResults(QList<SB_STATUS> Results);
|
||||
|
||||
static QIcon GetIcon(const QString& Name);
|
||||
|
|
|
@ -32,7 +32,7 @@ CBoxedProcessPtr CSbiePlusAPI::OnProcessBoxed(quint32 ProcessId, const QString&
|
|||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// CSandBox
|
||||
// CSandBoxPlus
|
||||
//
|
||||
|
||||
CSandBoxPlus::CSandBoxPlus(const QString& BoxName, class CSbieAPI* pAPI) : CSandBox(BoxName, pAPI)
|
||||
|
@ -273,3 +273,15 @@ int CSandBoxPlus::IsLeaderProgram(const QString& ProgName)
|
|||
return FindInStrList(Programs, ProgName) != Programs.end() ? 1 : 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// CSbieProcess
|
||||
//
|
||||
|
||||
QString CSbieProcess::GetStatusStr() const
|
||||
{
|
||||
if (m_uTerminated != 0)
|
||||
return tr("Terminated");
|
||||
if (m_bSuspended)
|
||||
return tr("Suspended");
|
||||
return tr("Running");
|
||||
}
|
||||
|
|
|
@ -88,6 +88,8 @@ class CSbieProcess : public CBoxedProcess
|
|||
public:
|
||||
CSbieProcess(quint32 ProcessId, class CSandBox* pBox) : CBoxedProcess(ProcessId, pBox) {}
|
||||
|
||||
virtual QString GetStatusStr() const;
|
||||
|
||||
virtual void BlockProgram() { GetBox()->BlockProgram(m_ImageName); }
|
||||
virtual void SetLingeringProgram(bool bSet) { GetBox()->SetLingeringProgram(m_ImageName, bSet); }
|
||||
virtual int IsLingeringProgram() { return GetBox()->IsLingeringProgram(m_ImageName); }
|
||||
|
|
|
@ -343,7 +343,7 @@ void CSbieView::OnGroupAction()
|
|||
}
|
||||
else if (Action == m_pDelGroupe)
|
||||
{
|
||||
if (QMessageBox("Sandboxie-Plus", tr("Do you really want remove the selected group(s)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes)
|
||||
if (QMessageBox("Sandboxie-Plus", tr("Do you really want to remove the selected group(s)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
foreach(const QModelIndex& Index, m_pSbieTree->selectedRows())
|
||||
|
@ -451,7 +451,7 @@ void CSbieView::OnSandBoxAction()
|
|||
}
|
||||
else if (Action == m_pMenuRemove)
|
||||
{
|
||||
if (QMessageBox("Sandboxie-Plus", tr("Do you really want remove the selected sandbox(es)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes)
|
||||
if (QMessageBox("Sandboxie-Plus", tr("Do you really want to remove the selected sandbox(es)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
foreach(const CSandBoxPtr& pBox, SandBoxes)
|
||||
|
@ -463,7 +463,7 @@ void CSbieView::OnSandBoxAction()
|
|||
}
|
||||
else if (Action == m_pMenuCleanUp)
|
||||
{
|
||||
if (QMessageBox("Sandboxie-Plus", tr("Do you really want delete the content of the selected sandbox(es)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes)
|
||||
if (QMessageBox("Sandboxie-Plus", tr("Do you really want to delete the content of the selected sandbox(es)?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
foreach(const CSandBoxPtr& pBox, SandBoxes)
|
||||
|
@ -701,4 +701,4 @@ void CSbieView::UpdateRunMenu(const CSandBoxPtr& pBox)
|
|||
|
||||
pAction->setData(NameCmd.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ CNewBoxWindow::CNewBoxWindow(QWidget *parent)
|
|||
ui.cmbTemplates->addItem(tr("Hardened"));
|
||||
ui.cmbTemplates->addItem(tr("Default"));
|
||||
ui.cmbTemplates->setCurrentIndex(eDefault);
|
||||
ui.cmbTemplates->addItem(tr("Legacy (old sbie behavioure)"));
|
||||
ui.cmbTemplates->addItem(tr("Legacy (old sbie behaviour)"));
|
||||
|
||||
ui.cmbBoxes->addItems(theAPI->GetAllBoxes().keys());
|
||||
|
||||
|
@ -54,9 +54,10 @@ void CNewBoxWindow::CreateBox()
|
|||
{
|
||||
QList<QPair<QString, QString>> Settings;
|
||||
CSandBoxPtr pSrcBox = theAPI->GetBoxByName(ui.cmbBoxes->currentText());
|
||||
if(!pSrcBox.isNull()) Settings = pSrcBox->GetIniSection();
|
||||
qint32 status = 0;
|
||||
if(!pSrcBox.isNull()) Settings = pSrcBox->GetIniSection(&status);
|
||||
if (Settings.isEmpty())
|
||||
Status = SB_ERR(CSbieAPI::tr("Failed to copy configuration from sandbox %1").arg(ui.cmbBoxes->currentText()));
|
||||
Status = SB_ERR(SB_FailedCopyConf, QVariantList() << ui.cmbBoxes->currentText() << (quint32)status);
|
||||
else
|
||||
{
|
||||
for (QList<QPair<QString, QString>>::iterator I = Settings.begin(); I != Settings.end(); ++I)
|
||||
|
@ -84,4 +85,4 @@ void CNewBoxWindow::CreateBox()
|
|||
CSandMan::CheckResults(QList<SB_STATUS>() << Status);
|
||||
else
|
||||
accept();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -842,7 +842,7 @@ void COptionsWindow::OnAddProg()
|
|||
|
||||
if (!pItem)
|
||||
{
|
||||
QMessageBox::warning(this, "SandboxiePlus", tr("Please sellect group first."));
|
||||
QMessageBox::warning(this, "SandboxiePlus", tr("Please select group first."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1054,14 +1054,14 @@ void COptionsWindow::OnDelStopProg()
|
|||
|
||||
void COptionsWindow::OnRestrictStart()
|
||||
{
|
||||
// only sellected
|
||||
// only selected
|
||||
bool Enable = ui.radStartSelected->isChecked();
|
||||
if (Enable)
|
||||
SetAccessEntry(eIPC, "!<StartRunAccess>", eClosed, "*");
|
||||
else
|
||||
DelAccessEntry(eIPC, "!<StartRunAccess>", eClosed, "*");
|
||||
|
||||
// all except sellected
|
||||
// all except selected
|
||||
Enable = ui.radStartExcept->isChecked();
|
||||
if (Enable)
|
||||
SetAccessEntry(eIPC, "<StartRunAccess>", eClosed, "*");
|
||||
|
@ -1291,7 +1291,7 @@ void COptionsWindow::ParseAndAddAccessEntry(EAccessEntry EntryType, const QStrin
|
|||
// Mind this special cases
|
||||
// OpenIpcPath=$:program.exe <- full access into the address space of a target process running outside the sandbox.
|
||||
// OpenWinClass=$:program.exe <- permits to use the PostThreadMessage API to send a message directly to a thread running outside the sandbox.
|
||||
// This forms of the setting does not support wildcards.
|
||||
// This form of the setting does not support wildcards.
|
||||
//
|
||||
|
||||
QStringList Values = Value.split(",");
|
||||
|
@ -1904,7 +1904,7 @@ void COptionsWindow::OnTemplateClicked(QTreeWidgetItem* pItem, int Column)
|
|||
{
|
||||
QString Name = pItem->data(1, Qt::UserRole).toString().mid(9);
|
||||
if (m_GlobalTemplates.contains(Name)) {
|
||||
QMessageBox::warning(this, "SandboxiePlus", tr("This template is enabled globally to configure it use the global options."));
|
||||
QMessageBox::warning(this, "SandboxiePlus", tr("This template is enabled globally. To configure it, use the global options."));
|
||||
pItem->setCheckState(1, Qt::PartiallyChecked);
|
||||
return;
|
||||
}
|
||||
|
@ -2026,8 +2026,8 @@ void COptionsWindow::SaveIniSection()
|
|||
{
|
||||
m_ConfigDirty = true;
|
||||
|
||||
// Note: an incremental update would be more elegat but it would change the entry order in the ini,
|
||||
// hence its better for the user to fully rebuild the section each time.
|
||||
// Note: an incremental update would be more elegant but it would change the entry order in the ini,
|
||||
// hence it's better for the user to fully rebuild the section each time.
|
||||
//
|
||||
for (QList<QPair<QString, QString>>::const_iterator I = m_Settings.begin(); I != m_Settings.end(); ++I)
|
||||
m_pBox->DelValue(I->first, I->second);
|
||||
|
@ -2055,4 +2055,4 @@ void COptionsWindow::SaveIniSection()
|
|||
// m_pBox->InsertText(I->first, I->second);
|
||||
|
||||
LoadIniSection();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,11 +135,11 @@ void CPopUpWindow::AddLogMessage(const QString& Message, quint32 MsgCode, const
|
|||
AddEntry(pEntry);
|
||||
}
|
||||
|
||||
// 2219 // elvation is disabled
|
||||
// 2219 // elevation is disabled
|
||||
|
||||
// 1307 // internet denided
|
||||
// 1307 // internet denied
|
||||
|
||||
// 1308 // start/run denided
|
||||
// 1308 // start/run denied
|
||||
}
|
||||
|
||||
void CPopUpWindow::ReloadHiddenMessages()
|
||||
|
@ -271,13 +271,13 @@ void CPopUpWindow::SendPromptResult(CPopUpPrompt* pEntry, int retval)
|
|||
|
||||
void CPopUpWindow::AddFileToRecover(const QString& FilePath, const QString& BoxName, quint32 ProcessId)
|
||||
{
|
||||
CSandBoxPtr pBox = theAPI->GetBoxByName(BoxName);
|
||||
if (!pBox.isNull() && pBox.objectCast<CSandBoxPlus>()->IsRecoverySuspended())
|
||||
return;
|
||||
CSandBoxPtr pBox = theAPI->GetBoxByName(BoxName);
|
||||
if (!pBox.isNull() && pBox.objectCast<CSandBoxPlus>()->IsRecoverySuspended())
|
||||
return;
|
||||
|
||||
CBoxedProcessPtr pProcess = theAPI->GetProcessById(ProcessId);
|
||||
|
||||
QString Message = tr("The file %1 is eligible for quick recovery from %2.\r\nFull path: %3\r\nWriten by: %4")
|
||||
QString Message = tr("The file %1 is eligible for quick recovery from %2.\r\nFull path: %3\r\nWritten by: %4")
|
||||
.arg(FilePath.mid(FilePath.lastIndexOf("\\") + 1)).arg(QString(BoxName).replace("_", " ")).arg(FilePath)
|
||||
.arg(pProcess.isNull() ? tr("an UNKNOWN process.") : tr("%1 (%2)").arg(pProcess->GetProcessName()).arg(pProcess->GetProcessId()));
|
||||
|
||||
|
@ -288,84 +288,84 @@ void CPopUpWindow::AddFileToRecover(const QString& FilePath, const QString& BoxN
|
|||
AddEntry(pEntry);
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnDismiss(int iFlag)
|
||||
{
|
||||
CPopUpRecovery* pEntry = qobject_cast<CPopUpRecovery*>(sender());
|
||||
|
||||
if (iFlag == 0)
|
||||
RemoveEntry(pEntry);
|
||||
|
||||
if ((iFlag & 0x02) != 0) // disable for this box
|
||||
{
|
||||
CSandBoxPtr pBox = theAPI->GetBoxByName(pEntry->m_BoxName);
|
||||
if (!pBox.isNull())
|
||||
pBox.objectCast<CSandBoxPlus>()->SetSuspendRecovery();
|
||||
}
|
||||
|
||||
if ((iFlag & 0x01) != 0) // dismiss all fromt his box
|
||||
void CPopUpWindow::OnDismiss(int iFlag)
|
||||
{
|
||||
CPopUpRecovery* pEntry = qobject_cast<CPopUpRecovery*>(sender());
|
||||
|
||||
if (iFlag == 0)
|
||||
RemoveEntry(pEntry);
|
||||
|
||||
if ((iFlag & 0x02) != 0) // disable for this box
|
||||
{
|
||||
CSandBoxPtr pBox = theAPI->GetBoxByName(pEntry->m_BoxName);
|
||||
if (!pBox.isNull())
|
||||
pBox.objectCast<CSandBoxPlus>()->SetSuspendRecovery();
|
||||
}
|
||||
|
||||
if ((iFlag & 0x01) != 0) // dismiss all from this box
|
||||
{
|
||||
for (int i = 0; i < ui.table->rowCount(); i++)
|
||||
{
|
||||
CPopUpRecovery* pCurEntry = qobject_cast<CPopUpRecovery*>(ui.table->cellWidget(i, 0));
|
||||
if (pCurEntry && pCurEntry->m_BoxName == pEntry->m_BoxName)
|
||||
ui.table->removeRow(i--);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ui.table->rowCount() == 0)
|
||||
this->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnRecoverFile(bool bBrowse)
|
||||
{
|
||||
CPopUpRecovery* pEntry = qobject_cast<CPopUpRecovery*>(sender());
|
||||
|
||||
QString RecoveryFolder;
|
||||
if (bBrowse)
|
||||
RecoveryFolder = QFileDialog::getExistingDirectory(this, tr("Select Directory")).replace("/", "\\");
|
||||
else
|
||||
RecoveryFolder = pEntry->m_FilePath.left(pEntry->m_FilePath.lastIndexOf("\\"));
|
||||
|
||||
this->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnRecoverFile(bool bBrowse)
|
||||
{
|
||||
CPopUpRecovery* pEntry = qobject_cast<CPopUpRecovery*>(sender());
|
||||
|
||||
QString RecoveryFolder;
|
||||
if (bBrowse)
|
||||
RecoveryFolder = QFileDialog::getExistingDirectory(this, tr("Select Directory")).replace("/", "\\");
|
||||
else
|
||||
RecoveryFolder = pEntry->m_FilePath.left(pEntry->m_FilePath.lastIndexOf("\\"));
|
||||
|
||||
if (RecoveryFolder.isEmpty())
|
||||
return;
|
||||
|
||||
QString FileName = pEntry->m_FilePath.mid(pEntry->m_FilePath.lastIndexOf("\\") + 1);
|
||||
QString BoxedFilePath = theAPI->GetBoxedPath(pEntry->m_BoxName, pEntry->m_FilePath);
|
||||
|
||||
QList<QPair<QString, QString>> FileList;
|
||||
FileList.append(qMakePair(BoxedFilePath, RecoveryFolder + "\\" + FileName));
|
||||
|
||||
return;
|
||||
|
||||
QString FileName = pEntry->m_FilePath.mid(pEntry->m_FilePath.lastIndexOf("\\") + 1);
|
||||
QString BoxedFilePath = theAPI->GetBoxedPath(pEntry->m_BoxName, pEntry->m_FilePath);
|
||||
|
||||
QList<QPair<QString, QString>> FileList;
|
||||
FileList.append(qMakePair(BoxedFilePath, RecoveryFolder + "\\" + FileName));
|
||||
|
||||
SB_PROGRESS Status = theGUI->RecoverFiles(FileList);
|
||||
if (Status.GetStatus() == OP_ASYNC)
|
||||
theGUI->AddAsyncOp(Status.GetValue());
|
||||
|
||||
RemoveEntry(pEntry);
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnOpenRecovery()
|
||||
{
|
||||
CPopUpRecovery* pEntry = qobject_cast<CPopUpRecovery*>(sender());
|
||||
|
||||
emit RecoveryRequested(pEntry->m_BoxName);
|
||||
|
||||
// since we opened the recvery dialog we can dismiss all the notification for this box
|
||||
OnDismiss(0x01);
|
||||
}
|
||||
|
||||
void CPopUpWindow::ShowProgress(quint32 MsgCode, const QStringList& MsgData, quint32 ProcessId)
|
||||
{
|
||||
QString BoxName = MsgData.size() >= 2 ? MsgData[1] : tr("UNKNOWN");
|
||||
QString FilePath = MsgData.size() >= 3 ? theAPI->Nt2DosPath(MsgData[2]) : tr("UNKNOWN");
|
||||
quint64 SizeLeft = MsgData.size() >= 4 ? MsgData[3].toULongLong() : 0;
|
||||
|
||||
if (m_HiddenMessages.contains(0, FilePath))
|
||||
return;
|
||||
|
||||
QString Message = tr("Migrating a large file %1 into the sandbox %2, %3 left.\r\nFull path: %4")
|
||||
.arg(FilePath.mid(FilePath.lastIndexOf("\\") + 1)).arg(BoxName).arg(FormatSize(SizeLeft))
|
||||
.arg(FilePath);
|
||||
|
||||
CPopUpProgress* pEntry = NULL;
|
||||
theGUI->AddAsyncOp(Status.GetValue());
|
||||
|
||||
RemoveEntry(pEntry);
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnOpenRecovery()
|
||||
{
|
||||
CPopUpRecovery* pEntry = qobject_cast<CPopUpRecovery*>(sender());
|
||||
|
||||
emit RecoveryRequested(pEntry->m_BoxName);
|
||||
|
||||
// since we opened the recovery dialog, we can dismiss all the notifications for this box
|
||||
OnDismiss(0x01);
|
||||
}
|
||||
|
||||
void CPopUpWindow::ShowProgress(quint32 MsgCode, const QStringList& MsgData, quint32 ProcessId)
|
||||
{
|
||||
QString BoxName = MsgData.size() >= 2 ? MsgData[1] : tr("UNKNOWN");
|
||||
QString FilePath = MsgData.size() >= 3 ? theAPI->Nt2DosPath(MsgData[2]) : tr("UNKNOWN");
|
||||
quint64 SizeLeft = MsgData.size() >= 4 ? MsgData[3].toULongLong() : 0;
|
||||
|
||||
if (m_HiddenMessages.contains(0, FilePath))
|
||||
return;
|
||||
|
||||
QString Message = tr("Migrating a large file %1 into the sandbox %2, %3 left.\r\nFull path: %4")
|
||||
.arg(FilePath.mid(FilePath.lastIndexOf("\\") + 1)).arg(BoxName).arg(FormatSize(SizeLeft))
|
||||
.arg(FilePath);
|
||||
|
||||
CPopUpProgress* pEntry = NULL;
|
||||
for (int i = 0; i < ui.table->rowCount(); i++)
|
||||
{
|
||||
CPopUpProgress* pCurEntry = qobject_cast<CPopUpProgress*>(ui.table->cellWidget(i, 0));
|
||||
|
@ -373,35 +373,35 @@ void CPopUpWindow::ShowProgress(quint32 MsgCode, const QStringList& MsgData, qui
|
|||
pEntry = pCurEntry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pEntry)
|
||||
{
|
||||
}
|
||||
|
||||
if (!pEntry)
|
||||
{
|
||||
pEntry = new CPopUpProgress(Message, FilePath, SizeLeft, this);
|
||||
QObject::connect(pEntry, SIGNAL(Dismiss(bool)), this, SLOT(OnDismissProgress(bool)));
|
||||
AddEntry(pEntry);
|
||||
}
|
||||
else
|
||||
pEntry->UpdateProgress(Message, SizeLeft);
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnDismissProgress(bool bHide)
|
||||
{
|
||||
CPopUpProgress* pEntry = qobject_cast<CPopUpProgress*>(sender());
|
||||
|
||||
if (bHide)
|
||||
m_HiddenMessages.insert(0, pEntry->m_ID);
|
||||
|
||||
RemoveEntry(pEntry);
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnCopy()
|
||||
{
|
||||
QStringList Messages;
|
||||
foreach(const QModelIndex& Index, ui.table->selectionModel()->selectedIndexes())
|
||||
{
|
||||
CPopUpEntry* pCurEntry = qobject_cast<CPopUpEntry*>(ui.table->cellWidget(Index.row(), 0));
|
||||
Messages.append(pCurEntry->GetMessageText());
|
||||
}
|
||||
QApplication::clipboard()->setText(Messages.join("\n"));
|
||||
}
|
||||
AddEntry(pEntry);
|
||||
}
|
||||
else
|
||||
pEntry->UpdateProgress(Message, SizeLeft);
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnDismissProgress(bool bHide)
|
||||
{
|
||||
CPopUpProgress* pEntry = qobject_cast<CPopUpProgress*>(sender());
|
||||
|
||||
if (bHide)
|
||||
m_HiddenMessages.insert(0, pEntry->m_ID);
|
||||
|
||||
RemoveEntry(pEntry);
|
||||
}
|
||||
|
||||
void CPopUpWindow::OnCopy()
|
||||
{
|
||||
QStringList Messages;
|
||||
foreach(const QModelIndex& Index, ui.table->selectionModel()->selectedIndexes())
|
||||
{
|
||||
CPopUpEntry* pCurEntry = qobject_cast<CPopUpEntry*>(ui.table->cellWidget(Index.row(), 0));
|
||||
Messages.append(pCurEntry->GetMessageText());
|
||||
}
|
||||
QApplication::clipboard()->setText(Messages.join("\n"));
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
#include <QtWidgets/QMainWindow>
|
||||
#include "ui_PopUpWindow.h"
|
||||
#include "../SbiePlusAPI.h"
|
||||
|
||||
class CPopUpEntry: public QWidget
|
||||
{
|
||||
|
||||
class CPopUpEntry: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CPopUpEntry(const QString& Message, QWidget* parent = 0) : QWidget(parent)
|
||||
|
@ -19,15 +19,15 @@ public:
|
|||
virtual ~CPopUpEntry() {}
|
||||
|
||||
virtual QString GetMessageText() { return m_Message; }
|
||||
|
||||
protected:
|
||||
|
||||
QGridLayout* m_pMainLayout;
|
||||
QString m_Message;
|
||||
};
|
||||
|
||||
class CPopUpMessage : public CPopUpEntry
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
QGridLayout* m_pMainLayout;
|
||||
QString m_Message;
|
||||
};
|
||||
|
||||
class CPopUpMessage : public CPopUpEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CPopUpMessage(const QString& Message, quint32 MsgCode, const QStringList& MsgData, QWidget* parent = 0) : CPopUpEntry(Message, parent)
|
||||
|
@ -44,7 +44,7 @@ public:
|
|||
{
|
||||
QToolButton* pHelp = new QToolButton();
|
||||
pHelp->setText(tr("?"));
|
||||
pHelp->setToolTip(tr("Visit %1 for a detailes explenation.").arg(QString("https://xanasoft.com/sandboxie/sbie%1/").arg(GetMsgId())));
|
||||
pHelp->setToolTip(tr("Visit %1 for a detailed explanation.").arg(QString("https://xanasoft.com/sandboxie/sbie%1/").arg(GetMsgId())));
|
||||
pHelp->setMaximumWidth(16);
|
||||
QObject::connect(pHelp, SIGNAL(pressed()), this, SLOT(OnHelp()));
|
||||
m_pMainLayout->addWidget(pHelp, 0, 1);
|
||||
|
@ -67,21 +67,21 @@ public:
|
|||
quint32 GetMsgId() { return m_MsgCode & 0xFFFF; }
|
||||
QStringList GetMsgData() { return m_MsgData; }
|
||||
QString GetMsgData(int Index) { return m_MsgData.size() <= Index ? QString() : m_MsgData[Index]; }
|
||||
|
||||
signals:
|
||||
void Dismiss();
|
||||
void Hide();
|
||||
|
||||
private slots:
|
||||
void OnHelp() { QDesktopServices::openUrl(QUrl(QString("https://xanasoft.com/sandboxie/sbie%1/").arg(GetMsgId()))); }
|
||||
|
||||
protected:
|
||||
quint32 m_MsgCode;
|
||||
QStringList m_MsgData;
|
||||
};
|
||||
|
||||
class CPopUpPrompt : public CPopUpEntry
|
||||
{
|
||||
|
||||
signals:
|
||||
void Dismiss();
|
||||
void Hide();
|
||||
|
||||
private slots:
|
||||
void OnHelp() { QDesktopServices::openUrl(QUrl(QString("https://xanasoft.com/sandboxie/sbie%1/").arg(GetMsgId()))); }
|
||||
|
||||
protected:
|
||||
quint32 m_MsgCode;
|
||||
QStringList m_MsgData;
|
||||
};
|
||||
|
||||
class CPopUpPrompt : public CPopUpEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CPopUpPrompt(const QString& Message, quint32 RequestId, QVariantMap Result, const CBoxedProcessPtr& pProcess, QWidget* parent = 0) : CPopUpEntry(Message, parent)
|
||||
|
@ -104,16 +104,16 @@ public:
|
|||
m_pMainLayout->addWidget(m_pTimeOut, 1, 1);
|
||||
|
||||
|
||||
m_pYes = new QToolButton();
|
||||
m_pYes->setText(tr("Yes"));
|
||||
connect(m_pYes, SIGNAL(pressed()), this, SLOT(OnAccepted()));
|
||||
m_pMainLayout->addWidget(m_pYes, 1, 2);
|
||||
|
||||
m_pNo = new QToolButton();
|
||||
m_pNo->setText(tr("No"));
|
||||
m_pYes = new QToolButton();
|
||||
m_pYes->setText(tr("Yes"));
|
||||
connect(m_pYes, SIGNAL(pressed()), this, SLOT(OnAccepted()));
|
||||
m_pMainLayout->addWidget(m_pYes, 1, 2);
|
||||
|
||||
m_pNo = new QToolButton();
|
||||
m_pNo->setText(tr("No"));
|
||||
connect(m_pNo, SIGNAL(pressed()), this, SLOT(OnRejected()));
|
||||
m_pMainLayout->addWidget(m_pNo, 1, 3);
|
||||
|
||||
m_pMainLayout->addWidget(m_pNo, 1, 3);
|
||||
|
||||
m_pTerminate = new QToolButton();
|
||||
m_pTerminate->setText(tr("Terminate"));
|
||||
connect(m_pTerminate, SIGNAL(pressed()), this, SLOT(OnTerminate()));
|
||||
|
@ -126,23 +126,23 @@ public:
|
|||
m_uTimerID = -1;
|
||||
else
|
||||
m_uTimerID = startTimer(1000);
|
||||
}
|
||||
~CPopUpPrompt() {
|
||||
if(m_uTimerID != -1)
|
||||
killTimer(m_uTimerID);
|
||||
}
|
||||
|
||||
signals:
|
||||
void PromptResult(int retval);
|
||||
|
||||
private slots:
|
||||
void OnAccepted() { emit PromptResult(1); }
|
||||
void OnRejected() { emit PromptResult(0); }
|
||||
void OnTerminate() { emit PromptResult(-1); }
|
||||
|
||||
protected:
|
||||
friend class CPopUpWindow;
|
||||
|
||||
}
|
||||
~CPopUpPrompt() {
|
||||
if(m_uTimerID != -1)
|
||||
killTimer(m_uTimerID);
|
||||
}
|
||||
|
||||
signals:
|
||||
void PromptResult(int retval);
|
||||
|
||||
private slots:
|
||||
void OnAccepted() { emit PromptResult(1); }
|
||||
void OnRejected() { emit PromptResult(0); }
|
||||
void OnTerminate() { emit PromptResult(-1); }
|
||||
|
||||
protected:
|
||||
friend class CPopUpWindow;
|
||||
|
||||
void timerEvent(QTimerEvent* pEvent)
|
||||
{
|
||||
if (pEvent->timerId() != m_uTimerID)
|
||||
|
@ -173,35 +173,35 @@ protected:
|
|||
m_pYes->setEnabled(false);
|
||||
}
|
||||
}
|
||||
int m_uTimerID;
|
||||
|
||||
virtual void paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
int m_uTimerID;
|
||||
|
||||
virtual void paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
extern bool CPopUpWindow__DarkMode;
|
||||
if (!CPopUpWindow__DarkMode && (m_iTimeOutSec % 2) != 0)
|
||||
{
|
||||
QPainter p(this);
|
||||
p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xFF, 0xCC, 0xCC));
|
||||
}
|
||||
}
|
||||
|
||||
quint32 m_RequestId;
|
||||
QVariantMap m_Result;
|
||||
CBoxedProcessPtr m_pProcess;
|
||||
|
||||
QLabel* m_pLabel;
|
||||
QCheckBox* m_pRemember;
|
||||
qint32 m_iTimeOutSec;
|
||||
QLabel* m_pTimeOut;
|
||||
QToolButton* m_pYes;
|
||||
QToolButton* m_pNo;
|
||||
QToolButton* m_pTerminate;
|
||||
};
|
||||
|
||||
class CPopUpRecovery : public CPopUpEntry
|
||||
{
|
||||
if (!CPopUpWindow__DarkMode && (m_iTimeOutSec % 2) != 0)
|
||||
{
|
||||
QPainter p(this);
|
||||
p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xFF, 0xCC, 0xCC));
|
||||
}
|
||||
}
|
||||
|
||||
quint32 m_RequestId;
|
||||
QVariantMap m_Result;
|
||||
CBoxedProcessPtr m_pProcess;
|
||||
|
||||
QLabel* m_pLabel;
|
||||
QCheckBox* m_pRemember;
|
||||
qint32 m_iTimeOutSec;
|
||||
QLabel* m_pTimeOut;
|
||||
QToolButton* m_pYes;
|
||||
QToolButton* m_pNo;
|
||||
QToolButton* m_pTerminate;
|
||||
};
|
||||
|
||||
class CPopUpRecovery : public CPopUpEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CPopUpRecovery(const QString& Message, const QString& FilePath, const QString& BoxName, QWidget* parent = 0) : CPopUpEntry(Message, parent)
|
||||
|
@ -225,7 +225,7 @@ public:
|
|||
pRecover->setToolTip(tr("Recover the file to original location"));
|
||||
pRecover->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
QMenu* pRecMenu = new QMenu();
|
||||
pRecMenu->addAction(tr("Recover file to sellected folder"), this, SLOT(OnRecoverTo()));
|
||||
pRecMenu->addAction(tr("Recover file to selected folder"), this, SLOT(OnRecoverTo()));
|
||||
pRecMenu->addAction(tr("Open file recovery for this box"), this, SIGNAL(OpenRecovery()));
|
||||
pRecover->setMenu(pRecMenu);
|
||||
//QObject::connect(pRecover, SIGNAL(triggered(QAction*)), , SLOT());
|
||||
|
@ -244,39 +244,39 @@ public:
|
|||
//QObject::connect(pDismiss, SIGNAL(triggered(QAction*)), , SLOT());
|
||||
QObject::connect(pDismiss, SIGNAL(pressed()), this, SIGNAL(Dismiss()));
|
||||
m_pMainLayout->addWidget(pDismiss, 1, 2);
|
||||
}
|
||||
|
||||
signals:
|
||||
void Dismiss(int iFlag = 0);
|
||||
void RecoverFile(bool bBrowse);
|
||||
void OpenRecovery();
|
||||
|
||||
private slots:
|
||||
void OnDisable() { emit Dismiss(0x03); }
|
||||
void OnDismissAll() { emit Dismiss(0x01); }
|
||||
void OnRecover() { emit RecoverFile(false); }
|
||||
void OnRecoverTo() { emit RecoverFile(true); }
|
||||
|
||||
protected:
|
||||
friend class CPopUpWindow;
|
||||
|
||||
virtual void paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
}
|
||||
|
||||
signals:
|
||||
void Dismiss(int iFlag = 0);
|
||||
void RecoverFile(bool bBrowse);
|
||||
void OpenRecovery();
|
||||
|
||||
private slots:
|
||||
void OnDisable() { emit Dismiss(0x03); }
|
||||
void OnDismissAll() { emit Dismiss(0x01); }
|
||||
void OnRecover() { emit RecoverFile(false); }
|
||||
void OnRecoverTo() { emit RecoverFile(true); }
|
||||
|
||||
protected:
|
||||
friend class CPopUpWindow;
|
||||
|
||||
virtual void paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
extern bool CPopUpWindow__DarkMode;
|
||||
if (!CPopUpWindow__DarkMode) {
|
||||
QPainter p(this);
|
||||
p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xCC, 0xFF, 0xCC));
|
||||
}
|
||||
}
|
||||
|
||||
QString m_FilePath;
|
||||
QString m_BoxName;
|
||||
};
|
||||
|
||||
class CPopUpProgress : public CPopUpEntry
|
||||
{
|
||||
if (!CPopUpWindow__DarkMode) {
|
||||
QPainter p(this);
|
||||
p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xCC, 0xFF, 0xCC));
|
||||
}
|
||||
}
|
||||
|
||||
QString m_FilePath;
|
||||
QString m_BoxName;
|
||||
};
|
||||
|
||||
class CPopUpProgress : public CPopUpEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CPopUpProgress(const QString& Message, const QString& ID, quint64 Total, QWidget* parent = 0) : CPopUpEntry(Message, parent)
|
||||
|
@ -311,27 +311,27 @@ public:
|
|||
m_iTimeOutSec = 5;
|
||||
|
||||
m_uTimerID = startTimer(1000);
|
||||
}
|
||||
~CPopUpProgress() {
|
||||
if (m_uTimerID != -1)
|
||||
killTimer(m_uTimerID);
|
||||
}
|
||||
|
||||
void UpdateProgress(const QString& Message, quint64 Value)
|
||||
{
|
||||
if(m_Total != 0)
|
||||
m_pProgressBar->setValue(100 - (100 * Value / m_Total));
|
||||
m_pLabel->setText(Message);
|
||||
m_iTimeOutSec = 5;
|
||||
}
|
||||
|
||||
signals:
|
||||
void Dismiss(bool bHide = true);
|
||||
//void Hide();
|
||||
|
||||
protected:
|
||||
friend class CPopUpWindow;
|
||||
|
||||
}
|
||||
~CPopUpProgress() {
|
||||
if (m_uTimerID != -1)
|
||||
killTimer(m_uTimerID);
|
||||
}
|
||||
|
||||
void UpdateProgress(const QString& Message, quint64 Value)
|
||||
{
|
||||
if(m_Total != 0)
|
||||
m_pProgressBar->setValue(100 - (100 * Value / m_Total));
|
||||
m_pLabel->setText(Message);
|
||||
m_iTimeOutSec = 5;
|
||||
}
|
||||
|
||||
signals:
|
||||
void Dismiss(bool bHide = true);
|
||||
//void Hide();
|
||||
|
||||
protected:
|
||||
friend class CPopUpWindow;
|
||||
|
||||
void timerEvent(QTimerEvent* pEvent)
|
||||
{
|
||||
if (pEvent->timerId() != m_uTimerID)
|
||||
|
@ -342,17 +342,17 @@ protected:
|
|||
emit Dismiss(false);
|
||||
}
|
||||
}
|
||||
int m_uTimerID;
|
||||
|
||||
QString m_ID;
|
||||
quint64 m_Total;
|
||||
|
||||
QLabel* m_pLabel;
|
||||
QProgressBar* m_pProgressBar;
|
||||
qint32 m_iTimeOutSec;
|
||||
};
|
||||
|
||||
|
||||
int m_uTimerID;
|
||||
|
||||
QString m_ID;
|
||||
quint64 m_Total;
|
||||
|
||||
QLabel* m_pLabel;
|
||||
QProgressBar* m_pProgressBar;
|
||||
qint32 m_iTimeOutSec;
|
||||
};
|
||||
|
||||
|
||||
class CPopUpWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -380,8 +380,8 @@ private slots:
|
|||
|
||||
virtual void OnPromptResult(int retval);
|
||||
|
||||
virtual void OnDismiss(int iFlag);
|
||||
virtual void OnRecoverFile(bool bBrowse);
|
||||
virtual void OnDismiss(int iFlag);
|
||||
virtual void OnRecoverFile(bool bBrowse);
|
||||
virtual void OnOpenRecovery();
|
||||
|
||||
virtual void OnDismissProgress(bool bHide);
|
||||
|
|
|
@ -17,9 +17,9 @@ CSettingsWindow::CSettingsWindow(QWidget *parent)
|
|||
|
||||
ui.uiLang->addItem("International English", "");
|
||||
QDir langDir(QApplication::applicationDirPath() + "/translations/");
|
||||
foreach(const QString& langFile, langDir.entryList(QStringList("taskexplorer_*.qm"), QDir::Files))
|
||||
foreach(const QString& langFile, langDir.entryList(QStringList("sandman_*.qm"), QDir::Files))
|
||||
{
|
||||
QString Code = langFile.mid(13, langFile.length() - 13 - 3);
|
||||
QString Code = langFile.mid(8, langFile.length() - 8 - 3);
|
||||
QLocale Locale(Code);
|
||||
QString Lang = Locale.nativeLanguageName();
|
||||
ui.uiLang->addItem(Lang, Code);
|
||||
|
@ -192,7 +192,7 @@ void CSettingsWindow::apply()
|
|||
if (ui.chkPassRequired->isChecked())
|
||||
{
|
||||
if (!isPassSet && m_NewPassword.isEmpty())
|
||||
OnSetPassword(); // request password entry if it wasn't already
|
||||
OnSetPassword(); // request password entry if it wasn't entered already
|
||||
if (!m_NewPassword.isEmpty()) {
|
||||
theAPI->LockConfig(m_NewPassword); // set new/changed password
|
||||
m_NewPassword.clear();
|
||||
|
@ -309,7 +309,7 @@ retry:
|
|||
if (Value1.isEmpty())
|
||||
return;
|
||||
|
||||
QString Value2 = QInputDialog::getText(this, "Sandboxie-Plus", tr("Please re enter the new configuration password."), QLineEdit::Password);
|
||||
QString Value2 = QInputDialog::getText(this, "Sandboxie-Plus", tr("Please re-enter the new configuration password."), QLineEdit::Password);
|
||||
if (Value2.isEmpty())
|
||||
return;
|
||||
|
||||
|
@ -384,4 +384,4 @@ void CSettingsWindow::OnDelCompat()
|
|||
|
||||
pItem->setCheckState(0, Qt::Unchecked);
|
||||
m_CompatChanged = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ void CSnapshotsWindow::OnRemoveSnapshot()
|
|||
//QVariant ID = m_pSnapshotModel->GetItemID(ModelIndex);
|
||||
QVariant ID = m_pSnapshotModel->GetItemID(Index);
|
||||
|
||||
if (QMessageBox("Sandboxie-Plus", tr("Do you really want delete the sellected snapshot?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes)
|
||||
if (QMessageBox("Sandboxie-Plus", tr("Do you really want to delete the selected snapshot?"), QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton).exec() != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
HandleResult(m_pBox->RemoveSnapshot(ID.toString()));
|
||||
|
@ -172,4 +172,4 @@ void CSnapshotsWindow::HandleResult(SB_PROGRESS Status)
|
|||
else if (Status.IsError())
|
||||
CSandMan::CheckResults(QList<SB_STATUS>() << Status);
|
||||
UpdateSnapshots();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
SB_STATUS Status = CSbieUtils::DoAssist();
|
||||
if (Status.GetStatus()) {
|
||||
app.sendMessage("Status:" + Status.GetText());
|
||||
if(Status.GetStatus() == ERROR_OK) app.sendMessage("Status:OK");
|
||||
else app.sendMessage("Status:" + CSandMan::FormatError(Status)); // todo: localization
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue