2

I'm calling MiniDumpWriteDump API from a top level exception handler from a local service app running on Windows XP SP3 like so:

_MINIDUMP_EXCEPTION_INFORMATION ExInfo;
DWORD dwProcID = ::GetCurrentProcessId();
DWORD dwThreadID = ::GetCurrentThreadId();

ExInfo.ThreadId = dwThreadID;
ExInfo.ExceptionPointers = pExceptionInfo;   //Receive it from the exception handler
ExInfo.ClientPointers = NULL;

if(!pfnMiniDumpWriteDump(GetCurrentProcess(), dwProcID, hFile, MiniDumpNormal, &ExInfo, NULL, NULL))
{
    int nOSError = ::GetLastError();    //I receive 0x80070057
}

The above fails with the error code 0x80070057, but if I change the dump type to MiniDumpWithFullMemory it works just fine. Any idea why?

ahmd0
  • 16,633
  • 33
  • 137
  • 233
  • 3
    That error is E_INVALIDARG, which implies to me that passing 0 as the type is not supported for whichever version of dbghelp.dll you are using. It's generally a good idea to supply a known good version of dbghelp.dll as part of your installation to make sure all of the functionality you need is there. – Retired Ninja Jul 16 '12 at 02:17
  • Very much appreciated. This seems to be the answer. – ahmd0 Jul 16 '12 at 04:04

0 Answers0