more preset bsod
This commit is contained in:
@@ -1,19 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "system-doctor"
|
name = "system-doctor"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "A Tauri App"
|
description = "System diagnosis"
|
||||||
authors = ["you"]
|
authors = ["Julian"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[lib]
|
|
||||||
# The `_lib` suffix may seem redundant but it is necessary
|
|
||||||
# to make the lib name unique and wouldn't conflict with the bin name.
|
|
||||||
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
|
||||||
name = "system_doctor_lib"
|
|
||||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "2", features = [] }
|
tauri-build = { version = "2", features = [] }
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// src-tauri/src/main.rs
|
|
||||||
|
|
||||||
// 全局允许非标准命名风格
|
// 全局允许非标准命名风格
|
||||||
#![allow(non_camel_case_types, non_snake_case)]
|
#![allow(non_camel_case_types, non_snake_case)]
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
@@ -132,61 +130,112 @@ fn format_wmi_time(wmi_str: &str) -> String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [扩展] 翻译 BugCheck Code (u32) - 增加了更多常见代码
|
||||||
fn translate_bugcheck_u32(code: u32) -> (String, String) {
|
fn translate_bugcheck_u32(code: u32) -> (String, String) {
|
||||||
match code {
|
match code {
|
||||||
|
// 驱动与内存相关
|
||||||
|
0x0000000A => (
|
||||||
|
"IRQL_NOT_LESS_OR_EQUAL (0x0A)".to_string(),
|
||||||
|
"驱动程序使用了不正确的内存地址。通常由有缺陷的驱动程序(如杀毒软件、虚拟光驱驱动)或硬件兼容性问题引起。建议更新所有驱动程序。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
0x000000D1 => (
|
0x000000D1 => (
|
||||||
"DRIVER_IRQL_NOT_LESS_OR_EQUAL (0xD1)".to_string(),
|
"DRIVER_IRQL_NOT_LESS_OR_EQUAL (0xD1)".to_string(),
|
||||||
"驱动程序使用了不正确的内存地址。通常是驱动程序冲突或损坏。请检查最近安装的硬件驱动(显卡、网卡等),尝试回滚或更新驱动。"
|
"驱动程序尝试访问未分页内存。这是最常见的蓝屏之一,通常是驱动程序冲突或损坏。请检查最近安装的硬件驱动(显卡、网卡等)。"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
),
|
),
|
||||||
0x0000007E | 0x1000007E => (
|
0x0000007E | 0x1000007E => (
|
||||||
"SYSTEM_THREAD_EXCEPTION_NOT_HANDLED (0x7E)".to_string(),
|
"SYSTEM_THREAD_EXCEPTION_NOT_HANDLED (0x7E)".to_string(),
|
||||||
"系统线程抛出了未捕获的异常。可能是显卡驱动不兼容,或者BIOS设置问题。建议重装显卡驱动,或恢复BIOS默认设置。"
|
"系统线程抛出了未捕获的异常。可能是显卡驱动不兼容,或者BIOS设置问题。建议重装显卡驱动,或更新 BIOS。"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
),
|
),
|
||||||
0x0000001A => (
|
0x0000001E => (
|
||||||
"MEMORY_MANAGEMENT (0x1A)".to_string(),
|
"KMODE_EXCEPTION_NOT_HANDLED (0x1E)".to_string(),
|
||||||
"严重的内存管理错误。高度怀疑内存条物理故障。建议立即运行 Windows 内存诊断工具,或者尝试拔插内存条。"
|
"内核模式程序生成了处理器无法捕获的异常。通常是硬件兼容性问题或驱动程序错误。建议检查是否有新安装的硬件。"
|
||||||
.to_string(),
|
|
||||||
),
|
|
||||||
0x000000EF => (
|
|
||||||
"CRITICAL_PROCESS_DIED (0xEF)".to_string(),
|
|
||||||
"Windows 核心进程意外终止。通常是系统文件损坏或硬盘故障。建议运行 'sfc /scannow' 修复系统,并检查硬盘健康度。"
|
|
||||||
.to_string(),
|
|
||||||
),
|
|
||||||
0x00000124 => (
|
|
||||||
"WHEA_UNCORRECTABLE_ERROR (0x124)".to_string(),
|
|
||||||
"硬件发生无法纠正的物理错误。这是纯硬件故障。通常是 CPU 电压不足、超频失败、过热,或者主板/PCIe设备故障。"
|
|
||||||
.to_string(),
|
|
||||||
),
|
|
||||||
0x00000116 => (
|
|
||||||
"VIDEO_TDR_FAILURE (0x116)".to_string(),
|
|
||||||
"显卡响应超时。显卡驱动崩溃或显卡过热。如果你在玩游戏,可能是显卡超频不稳定或散热硅脂干了。"
|
|
||||||
.to_string(),
|
.to_string(),
|
||||||
),
|
),
|
||||||
0x00000050 => (
|
0x00000050 => (
|
||||||
"PAGE_FAULT_IN_NONPAGED_AREA (0x50)".to_string(),
|
"PAGE_FAULT_IN_NONPAGED_AREA (0x50)".to_string(),
|
||||||
"试图访问无效的内存地址。可能是内存条故障,或者是防病毒软件/驱动程序冲突。建议检查内存。"
|
"试图访问无效的内存地址。极大概率是内存条故障(接触不良或损坏),或者是防病毒软件/驱动程序冲突。建议运行内存诊断。"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
),
|
),
|
||||||
0x0000000A => (
|
0x0000001A => (
|
||||||
"IRQL_NOT_LESS_OR_EQUAL (0x0A)".to_string(),
|
"MEMORY_MANAGEMENT (0x1A)".to_string(),
|
||||||
"驱动程序使用了不正确的内存地址。通常由有缺陷的驱动程序或硬件兼容性问题引起。"
|
"严重的内存管理错误。高度怀疑内存条物理故障。建议立即运行 Windows 内存诊断工具,或者尝试拔插/更换内存条。"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
),
|
),
|
||||||
0x0000003B => (
|
|
||||||
"SYSTEM_SERVICE_EXCEPTION (0x3B)".to_string(),
|
// 硬件与系统核心相关
|
||||||
"系统服务执行异常。通常与图形驱动程序或过时的系统文件有关。"
|
0x00000124 => (
|
||||||
|
"WHEA_UNCORRECTABLE_ERROR (0x124)".to_string(),
|
||||||
|
"硬件发生无法纠正的物理错误。这是纯硬件故障。通常是 CPU 电压不足(缩缸)、超频失败、过热,或者主板/PCIe设备故障。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
0x00000101 => (
|
||||||
|
"CLOCK_WATCHDOG_TIMEOUT (0x101)".to_string(),
|
||||||
|
"CPU 核心死锁。系统检测到某个 CPU 核心在规定时间内没有响应。通常是因为 CPU 超频不稳定、电压不足或过热。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
0x000000EF => (
|
||||||
|
"CRITICAL_PROCESS_DIED (0xEF)".to_string(),
|
||||||
|
"Windows 核心进程意外终止。通常是系统文件严重损坏或硬盘出现坏道导致无法读取系统文件。建议运行 'sfc /scannow'。"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
),
|
),
|
||||||
0x00000133 => (
|
0x00000133 => (
|
||||||
"DPC_WATCHDOG_VIOLATION (0x133)".to_string(),
|
"DPC_WATCHDOG_VIOLATION (0x133)".to_string(),
|
||||||
"DPC 看门狗超时。通常是 SSD 固件过旧或无线网卡驱动冲突导致系统卡死时间过长。"
|
"DPC 看门狗超时。系统被某个驱动程序(通常是 SSD 固件、SATA 驱动或无线网卡驱动)卡死太久。建议更新 SSD 固件和主板芯片组驱动。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
0x00000139 => (
|
||||||
|
"KERNEL_SECURITY_CHECK_FAILURE (0x139)".to_string(),
|
||||||
|
"内核检测到关键数据结构损坏。通常由内存错误、驱动程序 Bug 或病毒导致。建议检查内存和更新驱动。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
|
||||||
|
// 显卡与电源相关
|
||||||
|
0x00000116 => (
|
||||||
|
"VIDEO_TDR_FAILURE (0x116)".to_string(),
|
||||||
|
"显卡响应超时。显卡驱动崩溃且无法恢复。如果你在玩游戏,可能是显卡超频不稳定、电源功率不足或散热硅脂干了。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
0x00000119 => (
|
||||||
|
"VIDEO_SCHEDULER_INTERNAL_ERROR (0x119)".to_string(),
|
||||||
|
"显卡调度器内部错误。这表明显卡驱动发送了无效数据,或者是显卡显存(VRAM)出现故障。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
0x0000009F => (
|
||||||
|
"DRIVER_POWER_STATE_FAILURE (0x9F)".to_string(),
|
||||||
|
"驱动程序电源状态故障。通常发生在电脑休眠、睡眠或唤醒时。某个设备的驱动程序没有正确响应电源指令。建议检查电源管理设置。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
|
||||||
|
// 存储与启动相关
|
||||||
|
0x0000007B => (
|
||||||
|
"INACCESSIBLE_BOOT_DEVICE (0x7B)".to_string(),
|
||||||
|
"无法访问启动设备。通常是 BIOS 中的硬盘模式设置错误(如 AHCI/RAID 切换)或引导扇区损坏。也可能是硬盘物理连接松动。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
0x00000024 => (
|
||||||
|
"NTFS_FILE_SYSTEM (0x24)".to_string(),
|
||||||
|
"NTFS 文件系统损坏。这通常意味着硬盘出现坏道或文件系统逻辑错误。建议立即运行 'chkdsk /f /r' 修复磁盘。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
0x00000154 => (
|
||||||
|
"UNEXPECTED_STORE_EXCEPTION (0x154)".to_string(),
|
||||||
|
"系统存储组件检测到意外异常。通常指向系统盘(SSD/HDD)出现故障或连接线松动,导致系统无法读取关键数据。"
|
||||||
|
.to_string(),
|
||||||
|
),
|
||||||
|
|
||||||
|
// 系统服务异常
|
||||||
|
0x0000003B => (
|
||||||
|
"SYSTEM_SERVICE_EXCEPTION (0x3B)".to_string(),
|
||||||
|
"系统服务执行异常。通常与图形驱动程序、系统文件损坏或过时的驱动有关。"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
),
|
),
|
||||||
_ => (
|
_ => (
|
||||||
format!("未知错误代码: 0x{:X}", code),
|
format!("未知错误代码: 0x{:X}", code),
|
||||||
"建议手动搜索此错误代码。通用建议:更新驱动、检查内存、扫描病毒。".to_string(),
|
"此代码较为罕见,建议手动在搜索引擎中搜索此错误代码。通用排查步骤:1. 更新所有驱动;2. 运行内存诊断;3. 检查系统文件完整性。"
|
||||||
|
.to_string(),
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,7 +484,7 @@ async fn analyze_minidump_bytes(file_content: Vec<u8>) -> Result<BsodAnalysisRep
|
|||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
async fn run_diagnosis(window: tauri::Window) -> Result<(), String> {
|
async fn run_diagnosis(window: tauri::Window) -> Result<(), String> {
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
// ... (保持原有逻辑不变) ...
|
// ... (保持原有逻辑不变,占位符) ...
|
||||||
{
|
{
|
||||||
let mut sys = System::new();
|
let mut sys = System::new();
|
||||||
sys.refresh_memory();
|
sys.refresh_memory();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"app": {
|
"app": {
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
"title": "system-doctor",
|
"title": "系统检查 v0.1",
|
||||||
"width": 1200,
|
"width": 1200,
|
||||||
"height": 800
|
"height": 800
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
:class="{ active: currentTab === 'overview' }"
|
:class="{ active: currentTab === 'overview' }"
|
||||||
@click="currentTab = 'overview'"
|
@click="currentTab = 'overview'"
|
||||||
>
|
>
|
||||||
<span class="nav-icon">📊</span> 静态概览
|
<span class="nav-icon">📊</span> 健康概览
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="nav-item"
|
class="nav-item"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="sidebar-footer">
|
<div class="sidebar-footer">
|
||||||
<span class="version">Pro v1.2</span>
|
<span class="version">Generated by AI</span>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user