PssCaptureSnapshot function (processsnapshot.h)

Captures a snapshot of a target process.


DWORD PssCaptureSnapshot(
  [in]           HANDLE            ProcessHandle,
  [in]           PSS_CAPTURE_FLAGS CaptureFlags,
  [in, optional] DWORD             ThreadContextFlags,
  [out]          HPSS              *SnapshotHandle


[in] ProcessHandle

A handle to the target process.

[in] CaptureFlags

Flags that specify what to capture. For more information, see PSS_CAPTURE_FLAGS.

[in, optional] ThreadContextFlags

The CONTEXT record flags to capture if CaptureFlags specifies thread contexts.

[out] SnapshotHandle

A handle to the snapshot that this function captures.

Return value

This function returns ERROR_SUCCESS on success.

All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for an error code.


Requirement Value
Minimum supported client Windows 8.1 [desktop apps only]
Minimum supported server Windows Server 2012 R2 [desktop apps only]
Target Platform Windows
Header processsnapshot.h
DLL Kernel32.dll