gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

cpu information not available on windows7 32bit

Open sunyunzhang opened this issue 3 years ago • 4 comments

error: call to NtquerySystemInformation returned 3221225476. err: The operation completed successfully

sunyunzhang avatar Jan 24 '22 10:01 sunyunzhang

Error is raised there https://github.com/shirou/gopsutil/blob/e0ec1b9cda4470db704a862282a396986d7e930c/cpu/cpu_windows.go#L175, with cpu.Times(true)

3221225476 is 0xC0000004 which is STATUS_INFO_LENGTH_MISMATCH, The specified information record length does not match the length that is required for the specified information class..

I will try to reproduce on Tiny7 which is a stripped down 32bit win7, but I'm surprised.

Lomanic avatar Jan 31 '22 18:01 Lomanic

i reproduce it on win32, does anyone know how to handle?

Howie59 avatar Apr 15 '22 05:04 Howie59

@Lomanic

Howie59 avatar Apr 15 '22 08:04 Howie59

I could indeed reproduce on Tiny7.

I tried to port https://github.com/spiffe/spire/blob/c2057a4906c5b4bc9796e236e905002183021e50/pkg/agent/plugin/workloadattestor/docker/process/winapi.go#L117 as it (re-)allocates buffer size dynamically instead of setting a really huge one and hope for the best, but this part from that code I don't get for the moment.

Lomanic avatar May 24 '22 22:05 Lomanic