I am using the following function to read a .dmp file which contains user-defined streams. Now my problem is that in my dumps, there exist multiple streams with equal stream types.
BOOL WINAPI MiniDumpReadDumpStream(
__in PVOID BaseOfDump,
__in ULONG StreamNumber,
__out PMINIDUMP_DIRECTORY *Dir,
__out PVOID *StreamPointer,
__out ULONG *StreamSize
);
As far as I see in my tests, the above function will only return to me the very first occurance of such stream, ignoring all others, because it retrieves the streams by their type, and not the index of occurance.
If I analyze my dump file with the dumpchk.exe utility, it correctly displays all other streams being present. Also I was able to read out the streams correctly with my own reader code which is quite ugly, so I do not really want to use it.
So just for clarification. Is this an issue with the MiniDumpReadDumpStream function or is there a rule that forbits multiple streams with identical types? I could not locate such instructions in the documentation (msdn)…
Or is there a way to make the function return the other streams?
Looking forward to your answers…
Best regards,
Fabian
As a matter of fact, the stream types enumerated in MINIDUMP_STREAM_TYPE are unique, these types occur 0 or 1 time in the same dump. Custom Streams (MINIDUMP_USER_STREAM) can exist 0 or several times in the same dump. There is no way to index the custom streams using MiniDumpReadDumpStream. Since the size of custom streams is well known – by you, the one who puts these programmatically in the dump – you can address all of them by moving the cursor in memory once you retrieved the first custom stream using MiniDumpReadDumpStream.