bitflags::bitflags! { /// <https://learn.microsoft.com/en-us/windows/win32/api/minidumpapiset/ne-minidumpapiset-minidump_type> #[derive(Copy, Clone, Debug)] #[repr(transparent)] pubstruct MinidumpType: u32 { /// Include just the information necessary to capture stack traces for all /// existing threads in a process. const Normal = 0; /// Include the data sections from all loaded modules. /// /// This results in the inclusion of global variables, which can make /// the minidump file significantly larger. const WithDataSegs = 1 << 0; /// Include all accessible memory in the process. /// /// The raw memory data is included at the end, so that the initial /// structures can be mapped directly without the raw memory information. /// This option can result in a very large file. const WithFullMemory = 1 << 1; /// Include high-level information about the operating system handles that /// are active when the minidump is made. const WithHandleData = 1 << 2; /// Stack and backing store memory written to the minidump file should be /// filtered to remove all but the pointer values necessary to reconstruct a /// stack trace. const FilterMemory = 1 << 3; /// Stack and backing store memory should be scanned for pointer references /// to modules in the module list. /// /// If a module is referenced by stack or backing store memory, the /// [`MINIDUMP_CALLBACK_OUTPUT_0::ModuleWriteFlags`] field is set to /// [`ModuleWriteFlags::ModuleReferencedByMemory`]. const ScanMemory = 1 << 4; /// Include information from the list of modules that were recently /// unloaded, if this information is maintained by the operating system. const WithUnloadedModules = 1 << 5; /// Include pages with data referenced by locals or other stack memory. /// This option can increase the size of the minidump file significantly. const WithIndirectlyReferencedMemory = 1 << 6; /// Filter module paths for information such as user names or important /// directories. /// /// This option may prevent the system from locating the image file and /// should be used only in special situations. const FilterModulePaths = 1 << 7; /// Include complete per-process and per-thread information from the /// operating system. const WithProcessThreadData = 1 << 8; /// Scan the virtual address space for [`PAGE_READWRITE`](https://learn.microsoft.com/en-us/windows/win32/memory/memory-protection-constants) /// memory to be included. const WithPrivateReadWriteMemory = 1 << 9; /// Reduce the data that is dumped by eliminating memory regions that /// are not essential to meet criteria specified for the dump. /// /// This can avoid dumping memory that may contain data that is private /// to the user. However, it is not a guarantee that no private information /// will be present. const WithoutOptionalData = 1 << 10; /// Include memory region information. /// /// See [MINIDUMP_MEMORY_INFO_LIST](https://learn.microsoft.com/en-us/windows/win32/api/minidumpapiset/ns-minidumpapiset-minidump_memory_info_list) const WithFullMemoryInfo = 1 << 11; /// Include thread state information. /// /// See [MINIDUMP_THREAD_INFO_LIST](https://learn.microsoft.com/en-us/windows/win32/api/minidumpapiset/ns-minidumpapiset-minidump_thread_info_list) const WithThreadInfo = 1 << 12; /// Include all code and code-related sections from loaded modules to /// capture executable content. /// /// For per-module control, use the [`ModuleWriteFlags::ModuleWriteCodeSegs`] const WithCodeSegs = 1 << 13; /// Turns off secondary auxiliary-supported memory gathering. const WithoutAuxiliaryState = 1 << 14; /// Requests that auxiliary data providers include their state in the /// dump image; the state data that is included is provider dependent. /// /// This option can result in a large dump image. const WithFullAuxiliaryState = 1 << 15; /// Scans the virtual address space for [`PAGE_WRITECOPY`](https://learn.microsoft.com/en-us/windows/win32/memory/memory-protection-constants) memory to be included. const WithPrivateWriteCopyMemory = 1 << 16; /// If you specify [`MinidumpType::MiniDumpWithFullMemory`], the /// `MiniDumpWriteDump` function will fail if the function cannot read /// the memory regions; however, if you include /// [`IgnoreInaccessibleMemory`], the `MiniDumpWriteDump` function will /// ignore the memory read failures and continue to generate the dump. /// /// Note that the inaccessible memory regions are not included in the dump. const IgnoreInaccessibleMemory = 1 << 17; /// Adds security token related data. /// /// This will make the "!token" extension work when processing a user-mode dump. const WithTokenInformation = 1 << 18; /// Adds module header related data. const WithModuleHeaders = 1 << 19; /// Adds filter triage related data. const FilterTriage = 1 << 20; /// Adds AVX crash state context registers. const WithAvxXStateContext = 1 << 21; /// Adds Intel Processor Trace related data. const WithIptTrace = 1 << 22; /// Scans inaccessible partial memory pages. const ScanInaccessiblePartialPages = 1 << 23; /// Exclude all memory with the virtual protection attribute of [`PAGE_WRITECOMBINE`](https://learn.microsoft.com/en-us/windows/win32/memory/memory-protection-constants). const FilterWriteCombinedMemory = 1 << 24;
}
}
/// Oof, so we have a problem with these structs, they are all packed(4), but /// `CONTEXT` is aligned by either 4 (x86) or 16 (x86_64/aarch64)...which Rust /// doesn't currently allow https://github.com/rust-lang/rust/issues/59154, so /// we need to basically cheat with a big byte array until that issue is fixed (possibly never) #[repr(C)] pubstruct CALLBACK_CONTEXT([u8; std::mem::size_of::<CONTEXT>()]);
bitflags::bitflags! { /// Identifies the type of module information that will be written to the /// minidump file by the MiniDumpWriteDump function. #[derive(Copy, Clone)] #[repr(transparent)] pubstruct ModuleWriteFlags: u32 { /// Only module information will be written to the minidump file. const ModuleWriteModule = 0x0001; const ModuleWriteDataSeg = 0x0002; const ModuleWriteMiscRecord = 0x0004; const ModuleWriteCvRecord = 0x0008; const ModuleReferencedByMemory = 0x0010; const ModuleWriteTlsData = 0x0020; const ModuleWriteCodeSegs = 0x0040;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.