Fix macOS checkptr errors and replace Windows WMI with Win32 API #78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
unix.SysctlUint64()for reading sysctl values (ported from Fix checkptr in Mem.Get() on darwin #77)ErrNotImplemented(ported from Replace wmi queries with win32 api calls elastic/gosigar#116)Changes
macOS Fix
sigar_darwin.gosysctlbyname()function to usegolang.org/x/sys/unix.SysctlUint64()for uint64 valuesWindows Fix
File:
sigar_windows.goProcArgs.Get()using Win32 API calls instead of returningErrNotImplementedNtQueryProcessBasicInformation()andReadProcessMemory()to read process command-line argumentsFile:
sys/windows/syscall_windows.goUnicodeString,RtlUserProcessParameters,ProcessBasicInformationNtQueryProcessBasicInformation()- queries process basic informationGetUserProcessParams()- retrieves user process parameters from PEBReadProcessUnicodeString()- reads Unicode strings from process memoryByteSliceToStringSlice()- converts byte slices to string arraysReadProcessMemory()- wraps Win32 ReadProcessMemory APIGetTickCount64()- wraps Win32 GetTickCount64 APIReadProcessMemoryandGetTickCount64File:
sys/windows/zsyscall_windows.goReadProcessMemoryandGetTickCount64Motivation
This PR addresses issue rkoster/rubionic-workspace#38 which requested combining these two important fixes from upstream PRs.
Testing
These changes have been tested in the original upstream PRs:
Fixes rkoster/rubionic-workspace#38