Click here to Skip to main content
15,513,571 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am current trying to figure out how to read a mini dump file with code, I have an option to read the output of kd.exe and output in a form but i would rather try and figure out how to use the function MiniDumpReadDumpStream() contained within dbghelp.dll. I have search google to try and find something about it and c# but all i get is c++ examples and i honestly have no idea how to read c++. What is the best way to go about finding the info i need?
Posted
Comments
Zach.Saunders 15-Dec-11 17:00pm    
Ultimately, I just want to open and read a minidump file with as little effort as possible.

1 solution

Hi,

Try using this from your c# app:

[DllImport("dbghelp.dll", SetLastError = true)]
public static extern bool MiniDumpReadDumpStream(IntPtr BaseOfDump,
   int StreamNumber,
   ref MINIDUMP_DIRECTORY Dir,
   ref IntPtr StreamPointer,
   ref UInt32 StreamSize);


Cheers, AT
 
Share this answer
 
v2
Comments
Zach.Saunders 15-Dec-11 14:10pm    
I am pretty new to importing dlls, where would a good place to go for something like using that?
Addy Tas 15-Dec-11 14:28pm    
Really easy; the proper way to do it would be to make a seperate class with some static methods wrapping the imports but... I sugest that you just put this above the method that is going to use it, then you can call it normally.
You will need to add the using of System.Runtime.InteropServices
Cheers, AT
Zach.Saunders 15-Dec-11 14:50pm    
I am sorry, but i am super new to this, is there is an example I could see that would be of use? I googled more about interop and how to use the dllimport but I am not sure where to start
Addy Tas 18-Dec-11 15:00pm    
Hi,

I could make a rather elaborate example here but... two min of googling (is that a verb) and i found something you which might be close to what you are trying to accomplish. see http://www.java2s.com/Open-Source/CSharp/Plugin/walkmeil/Microsoft/Samples/Debugging/Native/DumpReader.cs.htm
for refrence

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900