From 5c00192e8ce6429d705e1e4d83b4b22e79482964 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 21 Sep 2019 21:18:49 +0200 Subject: [PATCH] windows: use correct type for security attributes' descriptor member The SECURITY_ATTRIBUTES struct always takes a SECURITY_DESCRIPTOR pointer. Now that we've defined SECURITY_DESCRIPTOR, make SECURITY_ATTRIBUTES properly specify the type. This eliminates the need for terrible uintptr(unsafe.Pointer(...)) casts everywhere. Change-Id: Ibbc85524cfe33589d43f963e10aa19d7f47686f2 Reviewed-on: https://go-review.googlesource.com/c/sys/+/196797 Run-TryBot: Jason A. Donenfeld TryBot-Result: Gobot Gobot Reviewed-by: Alex Brainman --- windows/security_windows.go | 6 ++++++ windows/types_windows.go | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/windows/security_windows.go b/windows/security_windows.go index 22dd83e2..5b2f6ba1 100644 --- a/windows/security_windows.go +++ b/windows/security_windows.go @@ -901,6 +901,12 @@ type SECURITY_DESCRIPTOR struct { dacl *ACL } +type SecurityAttributes struct { + Length uint32 + SecurityDescriptor *SECURITY_DESCRIPTOR + InheritHandle uint32 +} + type SE_OBJECT_TYPE uint32 // Constants for type SE_OBJECT_TYPE diff --git a/windows/types_windows.go b/windows/types_windows.go index 8d34bf1e..a5482341 100644 --- a/windows/types_windows.go +++ b/windows/types_windows.go @@ -471,12 +471,6 @@ func NsecToTimeval(nsec int64) (tv Timeval) { return } -type SecurityAttributes struct { - Length uint32 - SecurityDescriptor uintptr - InheritHandle uint32 -} - type Overlapped struct { Internal uintptr InternalHigh uintptr