Update dependencies
This commit is contained in:
30
vendor/golang.org/x/sys/windows/security_windows.go
generated
vendored
30
vendor/golang.org/x/sys/windows/security_windows.go
generated
vendored
@ -889,6 +889,7 @@ type WTS_SESSION_INFO struct {
|
||||
//sys WTSQueryUserToken(session uint32, token *Token) (err error) = wtsapi32.WTSQueryUserToken
|
||||
//sys WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) = wtsapi32.WTSEnumerateSessionsW
|
||||
//sys WTSFreeMemory(ptr uintptr) = wtsapi32.WTSFreeMemory
|
||||
//sys WTSGetActiveConsoleSessionId() (sessionID uint32)
|
||||
|
||||
type ACL struct {
|
||||
aclRevision byte
|
||||
@ -908,6 +909,19 @@ type SECURITY_DESCRIPTOR struct {
|
||||
dacl *ACL
|
||||
}
|
||||
|
||||
type SECURITY_QUALITY_OF_SERVICE struct {
|
||||
Length uint32
|
||||
ImpersonationLevel uint32
|
||||
ContextTrackingMode byte
|
||||
EffectiveOnly byte
|
||||
}
|
||||
|
||||
// Constants for the ContextTrackingMode field of SECURITY_QUALITY_OF_SERVICE.
|
||||
const (
|
||||
SECURITY_STATIC_TRACKING = 0
|
||||
SECURITY_DYNAMIC_TRACKING = 1
|
||||
)
|
||||
|
||||
type SecurityAttributes struct {
|
||||
Length uint32
|
||||
SecurityDescriptor *SECURITY_DESCRIPTOR
|
||||
@ -1321,7 +1335,11 @@ func (absoluteSD *SECURITY_DESCRIPTOR) ToSelfRelative() (selfRelativeSD *SECURIT
|
||||
}
|
||||
|
||||
func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR {
|
||||
sdLen := (int)(selfRelativeSD.Length())
|
||||
sdLen := int(selfRelativeSD.Length())
|
||||
const min = int(unsafe.Sizeof(SECURITY_DESCRIPTOR{}))
|
||||
if sdLen < min {
|
||||
sdLen = min
|
||||
}
|
||||
|
||||
var src []byte
|
||||
h := (*unsafeheader.Slice)(unsafe.Pointer(&src))
|
||||
@ -1329,7 +1347,15 @@ func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor()
|
||||
h.Len = sdLen
|
||||
h.Cap = sdLen
|
||||
|
||||
dst := make([]byte, sdLen)
|
||||
const psize = int(unsafe.Sizeof(uintptr(0)))
|
||||
|
||||
var dst []byte
|
||||
h = (*unsafeheader.Slice)(unsafe.Pointer(&dst))
|
||||
alloc := make([]uintptr, (sdLen+psize-1)/psize)
|
||||
h.Data = (*unsafeheader.Slice)(unsafe.Pointer(&alloc)).Data
|
||||
h.Len = sdLen
|
||||
h.Cap = sdLen
|
||||
|
||||
copy(dst, src)
|
||||
return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&dst[0]))
|
||||
}
|
||||
|
Reference in New Issue
Block a user