aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/driver/configuration_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-12-16 02:54:11 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-12-16 03:14:14 +0100
commitddb87f397d74a89f71877ecb02c18ffa79931ad7 (patch)
treedc58d0f7fed192365905c7bc797713de1f66feaa /driver/configuration_windows.go
parentringlogger: have caller cleanup inherited handle on failure (diff)
downloadwireguard-windows-ddb87f397d74a89f71877ecb02c18ffa79931ad7.tar.xz
wireguard-windows-ddb87f397d74a89f71877ecb02c18ffa79931ad7.zip
global: use syscall.SyscallN
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'driver/configuration_windows.go')
-rw-r--r--driver/configuration_windows.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/driver/configuration_windows.go b/driver/configuration_windows.go
index 5a12be63..43a8af66 100644
--- a/driver/configuration_windows.go
+++ b/driver/configuration_windows.go
@@ -81,7 +81,7 @@ var (
// SetAdapterState sets the adapter either Up or Down.
func (wireguard *Adapter) SetAdapterState(adapterState AdapterState) (err error) {
- r0, _, e1 := syscall.Syscall(procWireGuardSetAdapterState.Addr(), 2, wireguard.handle, uintptr(adapterState), 0)
+ r0, _, e1 := syscall.SyscallN(procWireGuardSetAdapterState.Addr(), wireguard.handle, uintptr(adapterState))
if r0 == 0 {
err = e1
}
@@ -90,7 +90,7 @@ func (wireguard *Adapter) SetAdapterState(adapterState AdapterState) (err error)
// AdapterState returns the current state of the adapter.
func (wireguard *Adapter) AdapterState() (adapterState AdapterState, err error) {
- r0, _, e1 := syscall.Syscall(procWireGuardGetAdapterState.Addr(), 2, wireguard.handle, uintptr(unsafe.Pointer(&adapterState)), 0)
+ r0, _, e1 := syscall.SyscallN(procWireGuardGetAdapterState.Addr(), wireguard.handle, uintptr(unsafe.Pointer(&adapterState)))
if r0 == 0 {
err = e1
}
@@ -99,7 +99,7 @@ func (wireguard *Adapter) AdapterState() (adapterState AdapterState, err error)
// SetConfiguration sets the adapter configuration.
func (wireguard *Adapter) SetConfiguration(interfaze *Interface, size uint32) (err error) {
- r0, _, e1 := syscall.Syscall(procWireGuardSetConfiguration.Addr(), 3, wireguard.handle, uintptr(unsafe.Pointer(interfaze)), uintptr(size))
+ r0, _, e1 := syscall.SyscallN(procWireGuardSetConfiguration.Addr(), wireguard.handle, uintptr(unsafe.Pointer(interfaze)), uintptr(size))
if r0 == 0 {
err = e1
}
@@ -114,7 +114,7 @@ func (wireguard *Adapter) Configuration() (interfaze *Interface, err error) {
}
for {
buf := make([]byte, size)
- r0, _, e1 := syscall.Syscall(procWireGuardGetConfiguration.Addr(), 3, wireguard.handle, uintptr(unsafe.Pointer(&buf[0])), uintptr(unsafe.Pointer(&size)))
+ r0, _, e1 := syscall.SyscallN(procWireGuardGetConfiguration.Addr(), wireguard.handle, uintptr(unsafe.Pointer(&buf[0])), uintptr(unsafe.Pointer(&size)))
if r0 != 0 {
wireguard.lastGetGuessSize = size
return (*Interface)(unsafe.Pointer(&buf[0])), nil