IIsolatedProcessLauncher::ShareDirectory method (isolatedapplauncher.h)

Shares a host directory into the container, either as read-only or supporting modification.

Syntax

HRESULT ShareDirectory(
  LPCWSTR hostPath,
  LPCWSTR containerPath,
  BOOL    readOnly
);

Parameters

hostPath

The path to the directory on the host to share.

containerPath

The path to the directory in the container to map to the host path.

readOnly

Determines if the directory is shared as read-only or read-write.

Remarks

Warning

This is a deprecated API.

This is actually more of a deferred share, actual sharing of the folder doesn’t happen until LaunchProcess is invoked. This allows the caller to share multiple folders and then launch the process, which is more efficient than sharing one folder, launching the process, sharing another folder, launching the process, etc.

Examples

The following example shows how to use the ShareDirectory method.

wil::com_ptr<IIsolatedProcessLauncher> isolatedProcessLauncher;

THROW_IF_FAILED(CoCreateInstance(
    CLSID_IsolatedAppLauncher,
    NULL,
    CLSCTX_LOCAL_SERVER,
    IID_PPV_ARGS(&isolatedProcessLauncher)));

THROW_IF_FAILED(isolatedProcessLauncher->ShareDirectory(
    L"c:\\hostfolder1",
    L"c:\\hostfolder1",
    TRUE /*Read only*/));

Requirements

Requirement Value
Header isolatedapplauncher.h

See also

LaunchProcess