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?