summaryrefslogtreecommitdiffhomepage
path: root/tun
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-30 09:59:25 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-08-30 09:59:36 -0600
commitdf2bf34373467cadab4f37b1a3c67eee45e677b4 (patch)
tree914f15dc3171d544df8262b71d8d346808fa2321 /tun
parenta12b76578443b8f3f237d1a3730d829c9906a010 (diff)
namespaceapi: fix mistake
Diffstat (limited to 'tun')
-rw-r--r--tun/wintun/namespaceapi/namespaceapi_windows.go4
-rw-r--r--tun/wintun/namespaceapi/zsyscall_windows.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/tun/wintun/namespaceapi/namespaceapi_windows.go b/tun/wintun/namespaceapi/namespaceapi_windows.go
index a7637ae..ad73df2 100644
--- a/tun/wintun/namespaceapi/namespaceapi_windows.go
+++ b/tun/wintun/namespaceapi/namespaceapi_windows.go
@@ -9,7 +9,7 @@ import "golang.org/x/sys/windows"
//sys createBoundaryDescriptor(name *uint16, flags uint32) (handle windows.Handle, err error) = kernel32.CreateBoundaryDescriptorW
//sys deleteBoundaryDescriptor(boundaryDescriptor windows.Handle) = kernel32.DeleteBoundaryDescriptor
-//sys addSIDToBoundaryDescriptor(boundaryDescriptor windows.Handle, requiredSid *windows.SID) (err error) = kernel32.AddSIDToBoundaryDescriptor
+//sys addSIDToBoundaryDescriptor(boundaryDescriptor *windows.Handle, requiredSid *windows.SID) (err error) = kernel32.AddSIDToBoundaryDescriptor
//sys createPrivateNamespace(privateNamespaceAttributes *windows.SecurityAttributes, boundaryDescriptor windows.Handle, aliasPrefix *uint16) (handle windows.Handle, err error) = kernel32.CreatePrivateNamespaceW
//sys openPrivateNamespace(boundaryDescriptor windows.Handle, aliasPrefix *uint16) (handle windows.Handle, err error) = kernel32.OpenPrivateNamespaceW
//sys closePrivateNamespace(handle windows.Handle, flags uint32) (err error) = kernel32.ClosePrivateNamespace
@@ -37,7 +37,7 @@ func (bd BoundaryDescriptor) Delete() {
// AddSid adds a security identifier (SID) to the specified boundary descriptor.
func (bd BoundaryDescriptor) AddSid(requiredSid *windows.SID) error {
- return addSIDToBoundaryDescriptor(windows.Handle(bd), requiredSid)
+ return addSIDToBoundaryDescriptor((*windows.Handle)(&bd), requiredSid)
}
// PrivateNamespace represents a private namespace. Duh?!
diff --git a/tun/wintun/namespaceapi/zsyscall_windows.go b/tun/wintun/namespaceapi/zsyscall_windows.go
index 83295e1..508c223 100644
--- a/tun/wintun/namespaceapi/zsyscall_windows.go
+++ b/tun/wintun/namespaceapi/zsyscall_windows.go
@@ -65,8 +65,8 @@ func deleteBoundaryDescriptor(boundaryDescriptor windows.Handle) {
return
}
-func addSIDToBoundaryDescriptor(boundaryDescriptor windows.Handle, requiredSid *windows.SID) (err error) {
- r1, _, e1 := syscall.Syscall(procAddSIDToBoundaryDescriptor.Addr(), 2, uintptr(boundaryDescriptor), uintptr(unsafe.Pointer(requiredSid)), 0)
+func addSIDToBoundaryDescriptor(boundaryDescriptor *windows.Handle, requiredSid *windows.SID) (err error) {
+ r1, _, e1 := syscall.Syscall(procAddSIDToBoundaryDescriptor.Addr(), 2, uintptr(unsafe.Pointer(boundaryDescriptor)), uintptr(unsafe.Pointer(requiredSid)), 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)