{"record":{"id":"49f34b84ed519137","repo":"shadow1ng/fscan","slug":"s-lasterror-d-minidump-first-process-failed","errorCode":null,"errorMessage":"%s (LastError: %d) [minidump_first_process_failed]","messagePattern":"(.+?) \\(LastError: (.+?)\\) \\[minidump_first_process_failed\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/local/minidump.go","lineNumber":323,"sourceCode":"\tproc32First, err := pm.kernel32.FindProc(\"Process32FirstW\")\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"%s: %w\", i18n.Tr(\"minidump_find_proc_failed\", \"Process32FirstW\"), err)\n\t}\n\n\tproc32Next, err := pm.kernel32.FindProc(\"Process32NextW\")\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"%s: %w\", i18n.Tr(\"minidump_find_proc_failed\", \"Process32NextW\"), err)\n\t}\n\n\tlstrcmpi, err := pm.kernel32.FindProc(\"lstrcmpiW\")\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"%s: %w\", i18n.Tr(\"minidump_find_proc_failed\", \"lstrcmpiW\"), err)\n\t}\n\n\tret, _, _ := proc32First.Call(snapshot, uintptr(unsafe.Pointer(&pe32)))\n\tif ret == 0 {\n\t\t//nolint:errorlint // Windows LastError不应该wrapped\n\t\treturn 0, fmt.Errorf(i18n.GetText(\"minidump_first_process_failed\")+\" (LastError: %d)\", windows.GetLastError())\n\t}\n\n\tfor {\n\t\tnamePtr, err := syscall.UTF16PtrFromString(name)\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"%s: %w\", i18n.GetText(\"minidump_process_name_convert_failed\"), err)\n\t\t}\n\n\t\tret, _, _ = lstrcmpi.Call(\n\t\t\tuintptr(unsafe.Pointer(namePtr)),\n\t\t\tuintptr(unsafe.Pointer(&pe32.szExeFile[0])),\n\t\t)\n\n\t\tif ret == 0 {\n\t\t\treturn pe32.th32ProcessID, nil\n\t\t}\n\n\t\tret, _, _ = proc32Next.Call(snapshot, uintptr(unsafe.Pointer(&pe32)))","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/local/minidump.go#L305-L341","documentation":"Raised in findProcessInSnapshot when the first Process32FirstW call fails, i.e. the snapshot handle exists but iterating it returned zero — corrupted or already-invalid snapshot; includes GetLastError.","triggerScenarios":"Thrown at plugins/local/minidump.go:323 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Recreate the snapshot and retry enumeration","Check privileges and handle limits on the target","Skip the target process if enumeration keeps failing"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}