get_ShareVirtualEnvironmentWithChildProcesses
Description
Retrieves a value that indicates whether child processes of the packed executable share the same virtual environment as the parent process. If the function returns VARIANT_TRUE, all child processes automatically operate within the same virtual file system and virtual registry as the parent.
Syntax
HRESULT get_ShareVirtualEnvironmentWithChildProcesses([out, retval] VARIANT_BOOL* pbValue);Parameters
pbValue
Type: VARIANT_BOOL*
[out, retval] Receives VARIANT_TRUE if child processes share the same virtual environment as the parent process, or VARIANT_FALSE otherwise.
Return Value
Returns an HRESULT.
S_OKif the value was successfully retrieved.E_POINTERifpbValueis null.- Other standard COM error codes on failure.
Example
CComPtr<IBxProject> project;
if (SUCCEEDED(BxPackerApi_CreateProject(&project))) {
VARIANT_BOOL bShared = VARIANT_FALSE;
if (SUCCEEDED(project->get_ShareVirtualEnvironmentWithChildProcesses(&bShared))) {
wprintf(L"Sharing with child processes: %s\n", bShared == VARIANT_TRUE ? L"Enabled" : L"Disabled");
}
}Remarks
- This property determines whether child processes inherit the parent process virtual environment automatically.
- Use this method to verify the current sharing configuration before or after calling
put_ShareVirtualEnvironmentWithChildProcesses. - When enabled, all child processes have access to the same virtual files and virtual registry entries as the main process.