Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: remove dependencies on golang.org/x/sys #271

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions internal/load/load_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

package load

import "golang.org/x/sys/windows"
import (
"syscall"
)

func OpenLibrary(name string) (uintptr, error) {
handle, err := windows.LoadLibrary(name)
handle, err := syscall.LoadLibrary(name)
return uintptr(handle), err
}

func OpenSymbol(lib uintptr, name string) (uintptr, error) {
return windows.GetProcAddress(windows.Handle(lib), name)
return syscall.GetProcAddress(syscall.Handle(lib), name)
}
4 changes: 1 addition & 3 deletions syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ package purego
import (
"reflect"
"syscall"

"golang.org/x/sys/windows"
)

var syscall15XABI0 uintptr
Expand Down Expand Up @@ -44,5 +42,5 @@ func NewCallback(fn interface{}) uintptr {
}

func loadSymbol(handle uintptr, name string) (uintptr, error) {
return windows.GetProcAddress(windows.Handle(handle), name)
return syscall.GetProcAddress(syscall.Handle(handle), name)
}