Export (0) Print
Expand All

WerReportAddFile function

Adds a file to the specified report.

Syntax


HRESULT WINAPI WerReportAddFile(
  _In_  HREPORT hReportHandle,
  _In_  PCWSTR pwzPath,
  _In_  WER_FILE_TYPE repFileType,
  _In_  DWORD dwFileFlags
);

Parameters

hReportHandle [in]

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

pwzPath [in]

A pointer to a Unicode string that contains the full path to the file to be added. This path can use environment variables. The maximum length of this path is MAX_PATH characters.

repFileType [in]

The type of file. This parameter can be one of the following values from the WER_FILE_TYPE enumeration type.

ValueMeaning
WerFileTypeHeapdump

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

WerFileTypeMicrodump

A limited minidump that contains only a stack trace.

WerFileTypeMinidump

A minidump file.

WerFileTypeOther

Any other type of file. This file will always get added to the cab (but only if the server asks for a cab).

WerFileTypeUserDocument

The document in use by the application at the time of the event. The document is added only if the server is asks for this type of document.

 

dwFileFlags [in]

This parameter can be one or more of the following values.

ValueMeaning
WER_FILE_ANONYMOUS_DATA

The file does not contain personal information that could be used to identify or contact the user.

WER_FILE_DELETE_WHEN_DONE

Automatically delete the file after the report is submitted.

 

Return value

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

Return codeDescription
HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)

The specified file does not exist.

HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)

The specified file is a user-document and is stored on an encrypted file-system; this combination is not supported.

 

Remarks

Although this function can also be used to add memory dumps (using specific flags) to the error report, the preferred function to use for adding memory dumps is WerReportAddDump. You should use this function only if you want to collect the dump yourself and then add it to the report.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Werapi.h

Library

Wer.lib

DLL

Wer.dll

See also

WER Functions
WerReportCreate
Windows Error Reporting

 

 

Community Additions

ADD
Show:
© 2014 Microsoft