Click to Rate and Give Feedback
MSDN
MSDN Library
Diagnostics
Debug Help Library
DbgHelp Reference
DbgHelp Functions
 MiniDumpWriteDump Function

  Switch on low bandwidth view
MiniDumpWriteDump Function

Writes user-mode minidump information to the specified file.

Syntax

C++
BOOL WINAPI MiniDumpWriteDump(
  __in  HANDLE hProcess,
  __in  DWORD ProcessId,
  __in  HANDLE hFile,
  __in  MINIDUMP_TYPE DumpType,
  __in  PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
  __in  PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
  __in  PMINIDUMP_CALLBACK_INFORMATION CallbackParam
);

Parameters

hProcess [in]

A handle to the process for which the information is to be generated.

This handle must have PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access to the process. For more information, see Process Security and Access Rights. The caller must also be able to get THREAD_ALL_ACCESS access to the threads in the process. For more information, see Thread Security and Access Rights.

ProcessId [in]

The identifier of the process for which the information is to be generated.

hFile [in]

A handle to the file in which the information is to be written.

DumpType [in]

The type of information to be generated. This parameter can be one or more of the values from the MINIDUMP_TYPE enumeration.

ExceptionParam [in]

A pointer to a MINIDUMP_EXCEPTION_INFORMATION structure describing the client exception that caused the minidump to be generated. If the value of this parameter is NULL, no exception information is included in the minidump file.

UserStreamParam [in]

A pointer to a MINIDUMP_USER_STREAM_INFORMATION structure. If the value of this parameter is NULL, no user-defined information is included in the minidump file.

CallbackParam [in]

A pointer to a MINIDUMP_CALLBACK_INFORMATION structure that specifies a callback routine which is to receive extended minidump information. If the value of this parameter is NULL, no callbacks are performed.

Return Value

If the function succeeds, the return value is TRUE; otherwise, the return value is FALSE. To retrieve extended error information, call GetLastError. Note that the last error will be an HRESULT value.

If the operation is canceled, the last error code is HRESULT_FROM_WIN32(ERROR_CANCELLED).

Remarks

The MiniDumpCallback function receives extended minidump information from MiniDumpWriteDump. It also provides a way for the caller to determine the granularity of information written to the minidump file, as the callback function can filter the default information.

MiniDumpWriteDump may not produce a valid stack trace for the calling thread. To work around this problem, you must capture the state of the calling thread before calling MiniDumpWriteDump and use it as the ExceptionParam parameter. One way to do this is to force an exception inside a __try/__except block and use the EXCEPTION_POINTERS information provided by GetExceptionInformation. Alternatively, you can call the function from a new worker thread and filter this worker thread from the dump.

Requirements

RedistributableDbgHelp.dll 5.1 or later
HeaderDbghelp.h
LibraryDbghelp.lib
DLLDbghelp.dll

See Also

DbgHelp Functions
MINIDUMP_CALLBACK_INFORMATION
MINIDUMP_EXCEPTION_INFORMATION
MINIDUMP_USER_STREAM_INFORMATION
MiniDumpCallback
MiniDumpReadDumpStream

Send comments about this topic to Microsoft

Build date: 7/2/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker