IIsolatedProcessLauncher2::LaunchProcess2 method (isolatedapplauncher.h)
Launches a process in an isolated environment.
Syntax
HRESULT LaunchProcess2(
LPCWSTR process,
LPCWSTR arguments,
LPCWSTR workingDirectory,
REFGUID correlationGuid
);
Parameters
process
The process to launch.
arguments
workingDirectory
The working directory of the process.
correlationGuid
The correlation GUID to associate with the process.
Return value
Returns an HRESULT success or error code.
Remarks
Warning
This is a deprecated API.
Examples
This example assumes c:\hostfolder1
is already shared into the container by following the ShareDirectory example.
wil::com_ptr<IIsolatedProcessLauncher2> isolatedProcessLauncher;
THROW_IF_FAILED(CoCreateInstance(
CLSID_IsolatedAppLauncher,
NULL,
CLSCTX_LOCAL_SERVER,
IID_PPV_ARGS(&isolatedProcessLauncher)));
THROW_IF_FAILED(isolatedProcessLauncher->LaunchProcess(
L"c:\\hostfolder1\\sampleprocess.exe",
L"",
L""));
GUID correlationGuid;
THROW_IF_FAILED(CoCreateGuid(&correlationGuid));
THROW_IF_FAILED(isolatedProcessLauncher->LaunchProcess2(
L"c:\\hostfolder1\\sampleprocess.exe",
L"",
L"",
correlationGuid));
Requirements
Requirement | Value |
---|---|
Header | isolatedapplauncher.h |