WerReportAddDump function

Adds a dump of the specified type to the specified report.

Syntax

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

Parameters

hReportHandle

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

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.

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.

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)

pExceptionParam

A pointer to a WER_EXCEPTION_INFORMATION structure that specifies exception information.

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.

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

   
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 Functions

WER_DUMP_CUSTOM_OPTIONS

WER_EXCEPTION_INFORMATION

WerReportCreate

Windows Error Reporting