SnapshotOnDemand

Takes one time snapshot for the given SnapshotType for the specified processes then exports to the trace buffers. The snapshot has to be configured before calling this API.

Syntax

HRESULT SnapshotOnDemand
([in] SnapshotType snapshotType,
[in] ULONG* pids,
[in] ULONG cPids);

Parameters

snapshotType
[in] SnapshotType.
Note: Currently only available SnapshotType is SnapshotType_Heap.
pids
[in] The pointer to an array of process ids. Up to 8 process ids can be specified.
cPids
[in] The number of process ids in the array. Maximum number is 8.

Return Value

The following table describes possible return values.

Return Value Description
S_OK The snapshot is successfully taken for the specified processes.
E_WPRC_EXCEEDED_HEAP_SNAPSHOT_PIDS The number of PIDs exceeded the maximum allowable limit. Up to 8 pids may be specified.