Skip to content

Commit 5c00192

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alex Brainman <[email protected]>
1 parent 14da1ac commit 5c00192

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

windows/security_windows.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,12 @@ type SECURITY_DESCRIPTOR struct {
901901
dacl *ACL
902902
}
903903

904+
type SecurityAttributes struct {
905+
Length uint32
906+
SecurityDescriptor *SECURITY_DESCRIPTOR
907+
InheritHandle uint32
908+
}
909+
904910
type SE_OBJECT_TYPE uint32
905911

906912
// Constants for type SE_OBJECT_TYPE

windows/types_windows.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,6 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
471471
return
472472
}
473473

474-
type SecurityAttributes struct {
475-
Length uint32
476-
SecurityDescriptor uintptr
477-
InheritHandle uint32
478-
}
479-
480474
type Overlapped struct {
481475
Internal uintptr
482476
InternalHigh uintptr

0 commit comments

Comments
 (0)