DEF_BOXEDAPPSDK_OPTION__ALL_CHANGES_ARE_VIRTUAL
Description
By default, this option is disabled. When enabled, all changes made to the file system or the registry are stored in the virtual environment rather than the actual system.
For example, when this option is active, creating a file using standard WinAPI or system calls will automatically create a virtual file instead of a physical one.
This behavior helps isolate applications from the host system, allowing them to run without modifying real files or registry entries.
Syntax Example
void main()
{
BoxedAppSDK_Init();
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__ALL_CHANGES_ARE_VIRTUAL, TRUE);
{
// File "virtual.txt" will be created as virtual
HANDLE hFile = CreateFile(
_T("virtual.txt"),
GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
CREATE_NEW,
0,
NULL);
}
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__ALL_CHANGES_ARE_VIRTUAL, FALSE);
}var
fs: TFileStream;
begin
BoxedAppSDK_Init();
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__ALL_CHANGES_ARE_VIRTUAL, true);
// File 'virtual.txt' will be created as virtual
fs := TFileStream.Create('virtual.txt', fmCreate or fmOpenWrite);
fs.Free();
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__ALL_CHANGES_ARE_VIRTUAL, false);
end;Remarks
When this option is active, all write operations — such as file creation, modification, or registry editing — occur entirely within the virtual file system and virtual registry.
To revert to standard system behavior, simply disable this option using BoxedAppSDK_EnableOption with bEnable set to FALSE.
This option is often used when testing or sandboxing applications to prevent unwanted system modifications.