Lomanic

Results 96 comments of Lomanic

Error is raised there [ https://github.com/shirou/gopsutil/blob/e0ec1b9cda4470db704a862282a396986d7e930c/cpu/cpu_windows.go#L175](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`](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55), _The specified information record length does not match the length that is required for the specified...

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](https://github.com/shirou/gopsutil/blob/c4a0f4689f12914053ab0a62ab6f37dfb36a6807/cpu/cpu_windows.go#L152-L155), [but...

`IOCountersStat.IopsInProgress` is only set on linux (for the moment at least): ``` rg 'IopsInProgress' disk/disk_linux.go 432: IopsInProgress: iopsInProgress, disk/disk.go 40: IopsInProgress uint64 `json:"iopsInProgress"` ``` Implementing the same thing on windows...

This reply doesn't answer the question :/

> Is there any reason this hasn't been implemented yet? Nobody asked for this before probably, and it's not as easy as reading a file as utmp on Linux for...

Thanks for finding this library https://github.com/iamacarpet/go-win64api/blob/8cbc936e1a5a3a6018420f4f8cc7d698779c18d3/sessions.go#L51_L122 interestingly it uses [LsaEnumerateLogonSessions](https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-lsaenumeratelogonsessions) instead of WTSEnumerateSessions

Thanks for setting this. We will see next time a PR is created. We could have both Gitlab and Circle CIs by the way. I'm leaving this issue open for...

I confirm CircleCI ran tests in #735, excellent! :clap:. For the GitlabCI part, I now remember I won't be able to add it if I'm not Owner of the repo...

I think these checks are sufficient for now, it already checks that it compiles on all platforms. I will probably implement a go-fmt check though and will close this afterwards.

Test https://staticcheck.io/docs/ also maybe