示例#1
0
        /// <summary>
        /// Get a DumpPointer for the given stream. That can then be used to further decode the stream.
        /// </summary>
        /// <param name="type">type of stream to lookup</param>
        /// <param name="stream">DumpPointer refering into the stream. </param>
        /// <returns>True if stream was succesfully retrived</returns>
        private bool TryGetStream(MINIDUMP_STREAM_TYPE type, out DumpPointer stream)
        {
            EnsureValid();

            bool fOk = DumpNative.MiniDumpReadDumpStream(_view.BaseAddress, type, out IntPtr pStream, out uint cbStreamSize);

            if (!fOk || IntPtr.Zero == pStream || cbStreamSize < 1)
            {
                stream = default;
                return(false);
            }

            stream = DumpPointer.DangerousMakeDumpPointer(pStream, cbStreamSize);
            return(true);
        }