WerReportAddDump function (werapi.h)

Adds a dump of the specified type to the specified Windows Error Reporting (WER) report.

Syntax

HRESULT WerReportAddDump(
  [in]           HREPORT                    hReportHandle,
  [in]           HANDLE                     hProcess,
  [in, optional] HANDLE                     hThread,
  [in]           WER_DUMP_TYPE              dumpType,
  [in, optional] PWER_EXCEPTION_INFORMATION pExceptionParam,
  [in, optional] PWER_DUMP_CUSTOM_OPTIONS   pDumpCustomOptions,
  [in]           DWORD                      dwFlags
);

Parameters

[in] hReportHandle

A handle to the report. This handle is returned by the WerReportCreate function.

[in] hProcess

A handle to the process for which the report is being generated. This handle must have the STANDARD_RIGHTS_READ and PROCESS_QUERY_INFORMATION access rights.

[in, optional] hThread

A handle to the thread of hProcess for which the report is being generated. If dumpType is WerDumpTypeMicro, this parameter is required. For other dump types, this parameter may be NULL.

[in] dumpType

The type of minidump. This parameter can be one of the following values from the WER_DUMP_TYPE enumeration type.

Value Meaning
WerDumpTypeHeapDump
An extended minidump that contains additional data such as the process memory.

This type is equivalent to creating a minidump with the following options:

  • MiniDumpWithDataSegs
  • MiniDumpWithProcessThreadData
  • MiniDumpWithHandleData
  • MiniDumpWithPrivateReadWriteMemory
  • MiniDumpWithUnloadedModules
  • MiniDumpWithFullMemoryInfo
  • MiniDumpWithThreadInfo (Windows 7 and later)
  • MiniDumpWithTokenInformation (Windows 7 and later)
  • MiniDumpWithPrivateWriteCopyMemory (Windows 7 and later)
WerDumpTypeMicroDump
A limited minidump that contains only a stack trace.

This type is equivalent to creating a minidump with the following options:

  • MiniDumpWithDataSegs
  • MiniDumpWithUnloadedModules
  • MiniDumpWithProcessThreadData
  • MiniDumpWithoutOptionalData
WerDumpTypeMiniDump
A minidump.

This type is equivalent to creating a minidump with the following options:

  • MiniDumpWithDataSegs
  • MiniDumpWithUnloadedModules
  • MiniDumpWithProcessThreadData
  • MiniDumpWithTokenInformation (Windows 7 and later)

[in, optional] pExceptionParam

A pointer to a WER_EXCEPTION_INFORMATION structure that specifies exception information.

[in, optional] pDumpCustomOptions

A pointer to a WER_DUMP_CUSTOM_OPTIONS structure that specifies custom minidump options. If this parameter is NULL, the standard minidump information is collected.

[in] dwFlags

This parameter can be 0 or the following value.

Value Meaning
WER_DUMP_NOHEAP_ONQUEUE
If the report is being queued, do not include a heap dump. Using this flag saves disk space.

Return value

This function returns S_OK on success or an error code on failure.

Remarks

Use this function only for generic reporting—it has no effect on operating system crash or no-response reporting.

If the server asks for a mini dump and you specify WerDumpTypeHeapDump for the dumpType parameter, WER will not send the heap dump to the Watson server. However, if the server asks for a heap dump and the dumpType is WerDumpTypeMiniDump, WER will send the mini dump to the server. Thus, it is recommended that you set dumpType to WerDumpTypeMiniDump.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header werapi.h
Library Wer.lib
DLL Wer.dll

See also

Minidump Files, WER_DUMP_CUSTOM_OPTIONS, WER_EXCEPTION_INFORMATION, WerReportCreate, Windows Error Reporting