WerRegisterFile function (werapi.h)
Registers a file to be collected when WER creates an error report.
HRESULT WerRegisterFile( [in] PCWSTR pwzFile, [in] WER_REGISTER_FILE_TYPE regFileType, [in] DWORD dwFlags );
The full path to the file. The maximum length of this path is MAX_PATH characters.
The file type. This parameter can be one of the following values from the WER_REGISTER_FILE_TYPE enumeration type.
This parameter can be one or more of the following values.
||The file does not contain personal information that could be used to identify or contact the user.|
||Automatically deletes the file after it is added to the report.|
This function returns S_OK on success or an error code on failure, including the following error codes.
||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.|
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.
|Minimum supported client||Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 [desktop apps | UWP apps]|