WerReportSetParameter function (werapi.h)

Sets the parameters that uniquely identify an event for the specified Windows Error Reporting (WER) report.


HRESULT WerReportSetParameter(
  [in]           HREPORT hReportHandle,
  [in]           DWORD   dwparamID,
  [in, optional] PCWSTR  pwzName,
  [in]           PCWSTR  pwzValue


[in] hReportHandle

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

[in] dwparamID

The identifier of the parameter to be set. This parameter can be one of the following values.

  • WER_P0
  • WER_P1
  • WER_P2
  • WER_P3
  • WER_P4
  • WER_P5
  • WER_P6
  • WER_P7
  • WER_P8
  • WER_P9

[in, optional] pwzName

A pointer to a Unicode string that contains the name of the parameter. If this parameter is NULL, the default name is Px, where x matches the integer portion of the value specified in dwparamID.

[in] pwzValue

The parameter value.

Return value

This function returns S_OK on success or an error code on failure, including the following error code.

Return code Description
E_HANDLE The specified handle is not valid.
WER_E_LENGTH_EXCEEDED The length of one or more string arguments has exceeded its limit.


Each report supports parameters P0 through P9. This function sets one parameter at a time. If parameter Px is set, then all parameters from P0 and Px must be set.


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

WerReportCreate, Windows Error Reporting