Commit Graph

6 Commits (80b3769ea3218aac2688437757d5599485666933)

Author SHA1 Message Date
Lomanic ef54649286 [windows] Use windows.NewLazySystemDLL to (possibly) prevent DLL hijacking
Might be useless because of https://docs.microsoft.com/en-us/windows/desktop/dlls/dynamic-link-library-search-order#search-order-for-desktop-applications
but better be safe than sorry.

Ref: https://github.com/shirou/gopsutil/issues/570#issuecomment-413951653
sada 8dd42707e2 windows: fix WithContext functions
set timeout only if parent context doesn't set.
leaf 65598d98cc To prevent hang if wmi.Query hangs, add a context-aware wrapper for it.
Derek Brown 7c807c86e4 Add implementation of SwapMemory() for windows
Sean Chittenden 635b971c0e
Move from the `syscall` package to the `golang.org/x/sys/{unix,windows}`
Daniel Theophanes 0af895258e common: rename package common to internal/common. Add ENV helper funcs.
Package common wasn't used for public functions. Place it in an
internal directory to prevent other packages from using.

Remove the distributed references to "HOST_PROC" and "HOST_SYS"
consts and combine into a common function. This also helps so that
if a env var is defined with a trailing slash all will continue to
work as expected.

Fixes #100