Executing MiniDumpWriteDump within the specific process provides healthy dump file.
Executing MiniDumpWriteDump from external process, where hProcess and processId point to the mentioned specific process, provides a zero length dump file
Same as #2 just pointing to FireFox for example provides healthy dump file
The specific process I am trying to dump is running with low privilege as far as I know, and my external process is being executed from Administrator CMD window.
[DllImport("dbghelp.dll",
EntryPoint = "MiniDumpWriteDump",
CallingConvention = CallingConvention.Winapi,
CharSet = CharSet.Unicode,
ExactSpelling = true,
SetLastError = true)]
private static extern bool MiniDumpWriteDump(IntPtr hProcess,
uint processId,
SafeHandle hFile,
uint dumpType,
IntPtr expParam,
IntPtr userStreamParam,
IntPtr callbackParam);
Notes:
- I am flushing, closing and disposing correctly the file stream
- MiniDumpWriteDump return false and GetLastWin32Error returns : -2147024597
- The mentioned specific process (a dot net server project) has the same Security options as FireFox (the dump works on Notepad++ process for example).