WerRegisterMemoryBlock function

Registers a memory block to be collected when WER creates an error report.

Syntax


HRESULT WINAPI WerRegisterMemoryBlock(
  _In_  PVOID pvAddress,
  _In_  DWORD dwSize
);

Parameters

pvAddress [in]

The starting address of the memory block.

dwSize [in]

The size of the memory block, in bytes. The maximum value for this parameter is WER_MAX_MEM_BLOCK_SIZE bytes.

Return value

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

Return codeDescription
WER_E_INVALID_STATE

The process state is not valid. For example, the process is in application recovery mode.

HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)

The number of registered memory blocks and files exceeds the limit.

 

Remarks

The memory block is added to the dump file for the report only when additional data is requested by the server.

For crashes and no response, 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 memory block, the operating system will add the memory block information to the dump file at the time of the crash or non-response.

For generic event reporting, the application has to call the WER generic event reporting functions directly. To add the memory block to a generic report, call the WerReportAddDump function and then call the WerReportSubmit function and specify the WER_SUBMIT_ADD_REGISTERED_DATA flag.

To remove the block from this list, call the WerUnregisterMemoryBlock function.

Requirements

Minimum supported client

Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Werapi.h

Library

Kernel32.lib

DLL

Kernel32.dll

See also

WER Functions
WerUnregisterMemoryBlock
Windows Error Reporting

 

 

Community Additions

ADD
Show:
© 2014 Microsoft