shadow1ng/fscan · error
%s: %v (LastError: %d) [minidump_snapshot_create_failed]
Error message
%s: %v (LastError: %d) [minidump_snapshot_create_failed]
What it means
Raised when CreateToolhelp32Snapshot returns INVALID_HANDLE_VALUE: the Windows API refused to build the process list (often insufficient privileges or non-interactive session); the raw error and GetLastError code are included un-wrapped.
Source
Thrown at plugins/local/minidump.go:295
return 0, err
}
defer pm.closeHandle(snapshot)
return pm.findProcessInSnapshot(snapshot, name)
}
// createProcessSnapshot 创建进程快照
func (pm *ProcessManager) createProcessSnapshot() (uintptr, error) {
proc, err := pm.kernel32.FindProc("CreateToolhelp32Snapshot")
if err != nil {
return 0, fmt.Errorf("%s: %w", i18n.Tr("minidump_find_proc_failed", "CreateToolhelp32Snapshot"), err)
}
handle, _, err := proc.Call(uintptr(TH32CS_SNAPPROCESS), 0)
if handle == uintptr(INVALID_HANDLE_VALUE) {
lastError := windows.GetLastError()
//nolint:errorlint // Windows LastError不应该wrapped
return 0, fmt.Errorf(i18n.GetText("minidump_snapshot_create_failed")+": %v (LastError: %d)", err, lastError)
}
return handle, nil
}
// findProcessInSnapshot 在快照中查找进程
func (pm *ProcessManager) findProcessInSnapshot(snapshot uintptr, name string) (uint32, error) {
var pe32 PROCESSENTRY32
pe32.dwSize = uint32(unsafe.Sizeof(pe32))
proc32First, err := pm.kernel32.FindProc("Process32FirstW")
if err != nil {
return 0, fmt.Errorf("%s: %w", i18n.Tr("minidump_find_proc_failed", "Process32FirstW"), err)
}
proc32Next, err := pm.kernel32.FindProc("Process32NextW")
if err != nil {
return 0, fmt.Errorf("%s: %w", i18n.Tr("minidump_find_proc_failed", "Process32NextW"), err)
}View on GitHub (pinned to 95cc12e753)
Solutions
- Run the scan process with elevated (admin) privileges
- Check the LastError code to identify the specific API failure
- Retry once — transient snapshot failures occur under heavy load
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at plugins/local/minidump.go:295 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06).
Data as JSON: /api/errors/9245db69dcde6382.
Report an issue: GitHub.