WerStoreQueryReportMetadataV2 function (werapi.h)

Retrieves metadata about a Windows Error Reporting (WER) report in the store.

Syntax

HRESULT WerStoreQueryReportMetadataV2(
  HREPORTSTORE            hReportStore,
  PCWSTR                  pszReportKey,
  PWER_REPORT_METADATA_V2 pReportMetadata
);

Parameters

hReportStore

The error report store (previously retrieved with WerStoreOpen).

pszReportKey

The string identifying which report is being queried (previously retrieved with WerStoreGetFirstReportKey or WerStoreGetNextReportKey).

pReportMetadata

A pointer to the report store metadata in the form of a WER_REPORT_METADATA_V2 structure. The field SizeOfFileNames should be set to 0 during the first call. The function updates this field with the required size to hold the file names associated with the report. The field FileNames should then be allocated with SizeOfFileNames bytes and the function should be called again to get all of the file names.

Return value

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

Return code Description
E_INVALID_ARG One of the arguments is not a valid value.
ERROR_INSUFFICIENT_BUFFER There is not enough memory available to retrieve the metadata. In this case, the caller should allocate memory of size SizeOfFileNames for the FileNames field, found in the WER_REPORT_METADATA_V2 structure, and call the function again.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1703 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header werapi.h
Library Wer.lib
DLL Wer.dll

See also

WER_REPORT_METADATA_V2, WerStoreGetFirstReportKey, WerStoreGetNextReportKey, Windows Error Reporting