WerRegisterFile function (werapi.h)
Registers a file to be collected when WER creates an error report.
Syntax
HRESULT WerRegisterFile(
[in] PCWSTR pwzFile,
[in] WER_REGISTER_FILE_TYPE regFileType,
[in] DWORD dwFlags
);
Parameters
[in] pwzFile
The full path to the file. The maximum length of this path is MAX_PATH characters.
[in] regFileType
The file type. This parameter can be one of the following values from the WER_REGISTER_FILE_TYPE enumeration type.
[in] dwFlags
This parameter can be one or more of the following values.
Return value
This function returns S_OK on success or an error code on failure, including the following error codes.
Return code | Description |
---|---|
|
The process state is not valid. For example, the process is in application recovery mode. |
|
The number of registered memory blocks and files exceeds the limit. |
Remarks
The registered file is added to the report only when additional data is requested by the server.
For crashes and non-responses, the operating system automatically provides error reporting (you do not need to provide any error reporting code in your application). If you use this function to register a file, the operating system will add the file to the error report created at the time of a crash or non-response (this file is added in addition to the files the operating system already collects).
For generic event reporting, the application has to use the WerReportAddFile function instead. Alternatively, calling the WerReportSubmit function with the WER_SUBMIT_ADD_REGISTERED_DATA flag will include the files that the WerRegisterFile function added.
To remove the file from the list, call the WerUnregisterFile function.
Requirements
Minimum supported client | Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | werapi.h |
Library | Kernel32.lib |
DLL | Kernel32.dll |