diff --git a/src/main/windows/windows-process-table.ts b/src/main/windows/windows-process-table.ts index d64dd7ce100..3810de9bcd5 100644 --- a/src/main/windows/windows-process-table.ts +++ b/src/main/windows/windows-process-table.ts @@ -24,11 +24,6 @@ import { createProcessTableSnapshotReader } from '../../shared/process-table-sna * PowerShell CIM 706 / 723 ms */ -/** Which of the per-process lookups a caller actually needs. */ -export type WindowsProcessFields = { memory?: boolean; commandLine?: boolean } - -const ALL_FIELDS: WindowsProcessFields = { memory: true, commandLine: true } - export type WindowsProcessRow = { pid: number ppid: number @@ -109,7 +104,7 @@ const WINDOWS_PROCESS_QUERY_COOLDOWN_MS = 30_000 let wedgedUntilMs = 0 -function readNativeRows(fields: WindowsProcessFields): Promise { +function readNativeRows(): Promise { const native = moduleLoader() if (!native) { // Reject rather than resolve empty: an empty table is a claim that nothing @@ -117,16 +112,16 @@ function readNativeRows(fields: WindowsProcessFields): Promise { try { const deadline = setTimeout(() => { @@ -172,12 +167,8 @@ function readNativeRows(fields: WindowsProcessFields): Promise({ - runPs: () => readNativeRows(ALL_FIELDS), + runPs: readNativeRows, now: () => Date.now() }) @@ -196,16 +187,6 @@ export function readWindowsProcessTableFresh(): Promise { return snapshotReader.getFreshSnapshot() } -/** - * An uncached snapshot carrying only pid, ppid and name. - * - * For teardown identity, which needs ancestry and nothing else: skipping the - * two per-process OpenProcess lookups roughly halves the scan. - */ -export function readWindowsProcessAncestry(): Promise { - return readNativeRows({}) -} - /** Whether the native table can be read at all on this host. */ export function isWindowsProcessTableAvailable(): boolean { return moduleLoader() !== null