DEF_BOXEDAPPSDK_OPTION__EMBED_BOXEDAPP_IN_CHILD_PROCESSES
Description
By default, this option is disabled. When enabled, all child processes automatically inherit the virtual environment of their parent process.
This means that when a process initialized with BoxedAppSDK_Init creates a new process (for example, by using CreateProcess or launching an external application), the new child process will share the same virtual file system and virtual registry as the parent.
This behavior allows multiple processes to work within a unified isolated environment.
Example
void main()
{
BoxedAppSDK_Init();
// Enable inheritance of virtual environment by child processes
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__EMBED_BOXEDAPP_IN_CHILD_PROCESSES, TRUE);
// Launch a child process - it will share the same virtual environment
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi = {};
CreateProcess(
_T("child.exe"),
NULL,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi);
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}begin
BoxedAppSDK_Init();
// Enable inheritance of virtual environment by child processes
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__EMBED_BOXEDAPP_IN_CHILD_PROCESSES, true);
WinExec('child.exe', SW_SHOW);
end;Remarks
When this option is active, all processes created by the parent will automatically share:
- The same virtual file system, including all virtual files and directories;
- The same virtual registry, including virtual COM registrations.
This option is particularly useful when you need to run multiple helper processes or components within a single sandboxed environment.
To explicitly attach an existing process to the same environment, use BoxedAppSDK_AttachToProcess.