From 5ce821a67d7fa7c6f6563b544393b1ff4b0b6637 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 21:34:33 +0000 Subject: [PATCH] chore(deps): update module golang.org/x/crypto to v0.59.0 [security] --- go.mod | 10 +- go.sum | 28 +- vendor/golang.org/x/crypto/ssh/certs.go | 60 +- vendor/golang.org/x/crypto/ssh/channel.go | 46 +- vendor/golang.org/x/crypto/ssh/client.go | 27 +- vendor/golang.org/x/crypto/ssh/common.go | 17 +- vendor/golang.org/x/crypto/ssh/connection.go | 11 +- vendor/golang.org/x/crypto/ssh/handshake.go | 41 +- vendor/golang.org/x/crypto/ssh/keys.go | 278 +------ vendor/golang.org/x/crypto/ssh/messages.go | 13 +- vendor/golang.org/x/crypto/ssh/mldsa.go | 2 +- vendor/golang.org/x/crypto/ssh/mux.go | 36 +- vendor/golang.org/x/crypto/ssh/server.go | 27 +- vendor/golang.org/x/crypto/ssh/session.go | 5 +- vendor/golang.org/x/sys/cpu/cpu_wasm32.go | 17 + vendor/golang.org/x/sys/cpu/endian_little.go | 2 +- vendor/golang.org/x/sys/cpu/zcpu_windows.go | 2 +- .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 16 +- vendor/golang.org/x/sys/unix/dirent.go | 10 +- vendor/golang.org/x/sys/unix/ioctl_linux.go | 6 + .../golang.org/x/sys/unix/sockcmsg_linux.go | 3 + .../x/sys/unix/syscall_freebsd_386.go | 8 +- .../x/sys/windows/memory_windows.go | 11 - .../sys/windows/registry/zsyscall_windows.go | 28 +- .../x/sys/windows/syscall_windows.go | 18 +- .../x/sys/windows/types_windows_386.go | 10 + .../x/sys/windows/types_windows_amd64.go | 11 + .../x/sys/windows/types_windows_arm64.go | 11 + .../x/sys/windows/zsyscall_windows.go | 776 +++++++++--------- vendor/golang.org/x/text/language/parse.go | 4 +- vendor/modules.txt | 10 +- 31 files changed, 716 insertions(+), 828 deletions(-) create mode 100644 vendor/golang.org/x/sys/cpu/cpu_wasm32.go diff --git a/go.mod b/go.mod index 8b492ff86..fb3e358cf 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/sirupsen/logrus v1.10.2 github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.12.1 - golang.org/x/sys v0.49.0 + golang.org/x/sys v0.50.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.37.1 k8s.io/apimachinery v0.37.1 @@ -112,13 +112,13 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/crypto v0.58.0 // indirect + golang.org/x/crypto v0.59.0 // indirect golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a // indirect golang.org/x/net v0.62.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sync v0.24.0 // indirect - golang.org/x/term v0.47.0 // indirect - golang.org/x/text v0.43.0 // indirect + golang.org/x/sync v0.25.0 // indirect + golang.org/x/term v0.48.0 // indirect + golang.org/x/text v0.44.0 // indirect golang.org/x/time v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260904194346-d0f1323225a4 // indirect google.golang.org/grpc v1.83.2 // indirect diff --git a/go.sum b/go.sum index 50c125afb..56f4c829f 100644 --- a/go.sum +++ b/go.sum @@ -265,14 +265,14 @@ go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54= -golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w= +golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c= +golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U= golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a h1:+3jdDGGB8NGb1Zktc737jlt3/A5f6UlwSzmvqUuufxw= golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a/go.mod h1:d2fgXJLVs4dYDHUk5lwMIfzRzSrWCfGZb0ZqeLa/Vcw= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= -golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= +golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= +golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -284,8 +284,8 @@ golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= -golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs= +golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -293,22 +293,22 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= -golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= -golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM= -golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk= +golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= -golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= +golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= +golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI= -golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA= +golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= +golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go index 8788a94b0..1df719e37 100644 --- a/vendor/golang.org/x/crypto/ssh/certs.go +++ b/vendor/golang.org/x/crypto/ssh/certs.go @@ -22,11 +22,9 @@ import ( // field. const ( CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com" - // Deprecated: DSA is only supported at insecure key sizes, and was removed - // from major implementations. + // Deprecated: DSA is no longer supported. CertAlgoDSAv01 = InsecureCertAlgoDSAv01 - // Deprecated: DSA is only supported at insecure key sizes, and was removed - // from major implementations. + // Deprecated: DSA is no longer supported. InsecureCertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com" CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com" CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com" @@ -416,7 +414,8 @@ func (c *CertChecker) Authenticate(conn ConnMetadata, pubKey PublicKey) (*Permis // CheckCert checks CriticalOptions, ValidPrincipals, revocation, timestamp and // the signature of the certificate. Critical options that are not listed in -// SupportedCriticalOptions are rejected. +// SupportedCriticalOptions are rejected, as are an empty principal and a +// certificate with an empty ValidPrincipals. func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { if c.IsRevoked != nil && c.IsRevoked(cert) { return fmt.Errorf("ssh: certificate serial %d revoked", cert.Serial) @@ -428,18 +427,11 @@ func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { } } - if len(cert.ValidPrincipals) > 0 { - // By default, certs are valid for all users/hosts. - found := false - for _, p := range cert.ValidPrincipals { - if p == principal { - found = true - break - } - } - if !found { - return fmt.Errorf("ssh: principal %q not in the set of valid principals for given certificate: %q", principal, cert.ValidPrincipals) - } + if principal == "" { + return errors.New("ssh: empty principal") + } + if !slices.Contains(cert.ValidPrincipals, principal) { + return fmt.Errorf("ssh: principal %q not in the set of valid principals for given certificate: %q", principal, cert.ValidPrincipals) } clock := c.Clock @@ -475,8 +467,15 @@ func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { // SignatureKey, and Signature fields. If the authority implements the // MultiAlgorithmSigner interface the first algorithm in the list is used. This // is useful if you want to sign with a specific algorithm. As specified in -// [SSH-CERTS], Section 2.1.1, authority can't be a [Certificate]. +// [SSH-CERTS], Section 2.1.1, authority can't be a [Certificate]. An empty +// ValidPrincipals, or an empty entry in it, is rejected. func (c *Certificate) SignCert(rand io.Reader, authority Signer) error { + if len(c.ValidPrincipals) == 0 { + return errors.New("ssh: certificate has no principals") + } + if slices.Contains(c.ValidPrincipals, "") { + return errors.New("ssh: empty principal in certificate") + } c.Nonce = make([]byte, 32) if _, err := io.ReadFull(rand, c.Nonce); err != nil { return err @@ -524,19 +523,18 @@ func (c *Certificate) SignCert(rand io.Reader, authority Signer) error { // // This map must be kept in sync with the one in agent/client.go. var certKeyAlgoNames = map[string]string{ - CertAlgoRSAv01: KeyAlgoRSA, - CertAlgoRSASHA256v01: KeyAlgoRSASHA256, - CertAlgoRSASHA512v01: KeyAlgoRSASHA512, - InsecureCertAlgoDSAv01: InsecureKeyAlgoDSA, - CertAlgoECDSA256v01: KeyAlgoECDSA256, - CertAlgoECDSA384v01: KeyAlgoECDSA384, - CertAlgoECDSA521v01: KeyAlgoECDSA521, - CertAlgoSKECDSA256v01: KeyAlgoSKECDSA256, - CertAlgoED25519v01: KeyAlgoED25519, - CertAlgoSKED25519v01: KeyAlgoSKED25519, - CertAlgoMLDSA44v01Go: KeyAlgoMLDSA44, - CertAlgoMLDSA65v01Go: KeyAlgoMLDSA65, - CertAlgoMLDSA87v01Go: KeyAlgoMLDSA87, + CertAlgoRSAv01: KeyAlgoRSA, + CertAlgoRSASHA256v01: KeyAlgoRSASHA256, + CertAlgoRSASHA512v01: KeyAlgoRSASHA512, + CertAlgoECDSA256v01: KeyAlgoECDSA256, + CertAlgoECDSA384v01: KeyAlgoECDSA384, + CertAlgoECDSA521v01: KeyAlgoECDSA521, + CertAlgoSKECDSA256v01: KeyAlgoSKECDSA256, + CertAlgoED25519v01: KeyAlgoED25519, + CertAlgoSKED25519v01: KeyAlgoSKED25519, + CertAlgoMLDSA44v01Go: KeyAlgoMLDSA44, + CertAlgoMLDSA65v01Go: KeyAlgoMLDSA65, + CertAlgoMLDSA87v01Go: KeyAlgoMLDSA87, } // underlyingAlgo returns the signature algorithm associated with algo (which is diff --git a/vendor/golang.org/x/crypto/ssh/channel.go b/vendor/golang.org/x/crypto/ssh/channel.go index d6010fd77..76d308194 100644 --- a/vendor/golang.org/x/crypto/ssh/channel.go +++ b/vendor/golang.org/x/crypto/ssh/channel.go @@ -160,12 +160,10 @@ type channel struct { extraData []byte localId, remoteId uint32 - // maxIncomingPayload and maxRemotePayload are the maximum - // payload sizes of normal and extended data packets for - // receiving and sending, respectively. The wire packet will - // be 9 or 13 bytes larger (excluding encryption overhead). - maxIncomingPayload uint32 - maxRemotePayload uint32 + // maxRemotePayload is the maximum payload size of normal and extended data + // packets that we can send to the peer. The wire packet will be 9 or 13 + // bytes larger (excluding encryption overhead). + maxRemotePayload uint32 mux *mux @@ -328,7 +326,7 @@ func (ch *channel) handleData(packet []byte) error { if length == 0 { return nil } - if length > ch.maxIncomingPayload { + if length > channelMaxPacket { // TODO(hanwen): should send Disconnect? return errors.New("ssh: incoming packet exceeds maximum payload size") } @@ -374,7 +372,7 @@ func (c *channel) adjustWindow(adj uint32) error { // exceed the initial window setting, we don't worry about overflow. c.myConsumed += adj var sendAdj uint32 - if (channelWindowSize-c.myWindow > 3*c.maxIncomingPayload) || + if (channelWindowSize-c.myWindow > 3*channelMaxPacket) || (c.myWindow < channelWindowSize/2) { sendAdj = c.myConsumed c.myConsumed = 0 @@ -527,20 +525,22 @@ func (ch *channel) handlePacket(packet []byte) error { func (m *mux) newChannel(chanType string, direction channelDirection, extraData []byte) *channel { ch := &channel{ - remoteWin: window{Cond: newCond()}, - myWindow: channelWindowSize, - maxIncomingPayload: channelMaxPacket, - pending: newBuffer(), - extPending: newBuffer(), - direction: direction, - incomingRequests: make(chan *Request, chanSize), - msg: make(chan interface{}, chanSize), - chanType: chanType, - extraData: extraData, - mux: m, - packetPool: make(map[uint32][]byte), - } - m.chanList.add(ch) + remoteWin: window{Cond: newCond()}, + myWindow: channelWindowSize, + pending: newBuffer(), + extPending: newBuffer(), + direction: direction, + incomingRequests: make(chan *Request, chanSize), + msg: make(chan interface{}, chanSize), + chanType: chanType, + extraData: extraData, + mux: m, + packetPool: make(map[uint32][]byte), + } + if !m.chanList.add(ch) { + // The mux has shut down and will not close the channel. + ch.close() + } return ch } @@ -568,7 +568,7 @@ func (ch *channel) Accept() (Channel, <-chan *Request, error) { PeersID: ch.remoteId, MyID: ch.localId, MyWindow: ch.myWindow, - MaxPacketSize: ch.maxIncomingPayload, + MaxPacketSize: channelMaxPacket, } ch.decided = true ch.established.Store(true) diff --git a/vendor/golang.org/x/crypto/ssh/client.go b/vendor/golang.org/x/crypto/ssh/client.go index 89f0def9f..16de0e3c9 100644 --- a/vendor/golang.org/x/crypto/ssh/client.go +++ b/vendor/golang.org/x/crypto/ssh/client.go @@ -10,8 +10,11 @@ import ( "fmt" "net" "os" + "strings" "sync" "time" + "unicode" + "unicode/utf8" ) // Client implements a traditional SSH client that supports shells, @@ -136,7 +139,6 @@ func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) e } c.sessionID = c.transport.getSessionID() - c.algorithms = c.transport.getAlgorithms() return c.clientAuthenticate(config) } @@ -359,10 +361,31 @@ func FixedHostKey(key PublicKey) HostKeyCallback { // BannerDisplayStderr returns a function that can be used for // ClientConfig.BannerCallback to display banners on os.Stderr. +// Non-printable characters, other than newline, carriage return and +// tab, and invalid UTF-8 sequences are replaced with U+FFFD. func BannerDisplayStderr() BannerCallback { return func(banner string) error { - _, err := os.Stderr.WriteString(banner) + _, err := os.Stderr.WriteString(escapeBanner(banner)) return err } } + +// escapeBanner replaces each non-printable character, and each byte of +// an invalid UTF-8 sequence, with utf8.RuneError. +func escapeBanner(s string) string { + return strings.Map(func(r rune) rune { + if isBannerPrintable(r) { + return r + } + return utf8.RuneError + }, s) +} + +func isBannerPrintable(r rune) bool { + switch r { + case '\n', '\r', '\t': + return true + } + return unicode.IsGraphic(r) || unicode.In(r, unicode.Cf, unicode.Co) +} diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go index 544eb93d7..530837690 100644 --- a/vendor/golang.org/x/crypto/ssh/common.go +++ b/vendor/golang.org/x/crypto/ssh/common.go @@ -180,7 +180,6 @@ var ( CertAlgoRSASHA256v01, CertAlgoRSASHA512v01, CertAlgoRSAv01, - InsecureCertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, @@ -191,16 +190,13 @@ var ( KeyAlgoRSASHA256, KeyAlgoRSASHA512, KeyAlgoRSA, - InsecureKeyAlgoDSA, KeyAlgoED25519, } // insecureHostKeyAlgos specifies host-key algorithms implemented by this // package and which have security issues. insecureHostKeyAlgos = []string{ KeyAlgoRSA, - InsecureKeyAlgoDSA, CertAlgoRSAv01, - InsecureCertAlgoDSAv01, } // supportedPubKeyAuthAlgos specifies the supported client public key // authentication algorithms. Note that this doesn't include certificate @@ -229,13 +225,11 @@ var ( KeyAlgoRSASHA256, KeyAlgoRSASHA512, KeyAlgoRSA, - InsecureKeyAlgoDSA, } // insecurePubKeyAuthAlgos specifies client public key authentication // algorithms implemented by this package and which have security issues. insecurePubKeyAuthAlgos = []string{ KeyAlgoRSA, - InsecureKeyAlgoDSA, } ) @@ -290,7 +284,7 @@ func hashFunc(format string) (crypto.Hash, error) { // ML-DSA doesn't pre-hash. This case is not build tagged, availability // is decided by mldsaKeyAlgos. return 0, nil - case KeyAlgoRSA, InsecureKeyAlgoDSA: + case KeyAlgoRSA: if fips140.Enabled() { return 0, fmt.Errorf("ssh: hash algorithm for format %q not allowed in FIPS 140 mode", format) } @@ -356,8 +350,6 @@ func keyFormatForAlgorithm(sigAlgo string) string { KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, - InsecureKeyAlgoDSA, - InsecureCertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, @@ -406,7 +398,12 @@ func findCommon(what string, client []string, server []string, isClient bool) (s for _, c := range client { for _, s := range server { if c == s { - return c, nil + // Return the name from the local list, not the peer's, which + // would keep the peer's whole name list alive (see parseNameList). + if isClient { + return c, nil + } + return s, nil } } } diff --git a/vendor/golang.org/x/crypto/ssh/connection.go b/vendor/golang.org/x/crypto/ssh/connection.go index 9e0ed089c..5f8a84664 100644 --- a/vendor/golang.org/x/crypto/ssh/connection.go +++ b/vendor/golang.org/x/crypto/ssh/connection.go @@ -75,7 +75,11 @@ type Conn interface { } // AlgorithmsConnMetadata is a ConnMetadata that can return the algorithms -// negotiated between client and server. +// negotiated between client and server in the last completed key exchange. +// The ConnMetadata passed to the ServerConfig callbacks implements it, as do +// the Conn returned by NewClientConn and the Conn embedded in Client and +// ServerConn. For a Conn returned by NewControlClientConn, Algorithms returns +// the zero value. type AlgorithmsConnMetadata interface { ConnMetadata Algorithms() NegotiatedAlgorithms @@ -121,7 +125,6 @@ type sshConn struct { sessionID []byte clientVersion []byte serverVersion []byte - algorithms NegotiatedAlgorithms } func dup(src []byte) []byte { @@ -158,6 +161,6 @@ func (c *sshConn) ServerVersion() []byte { return dup(c.serverVersion) } -func (c *sshConn) Algorithms() NegotiatedAlgorithms { - return c.algorithms +func (c *connection) Algorithms() NegotiatedAlgorithms { + return c.transport.getAlgorithms() } diff --git a/vendor/golang.org/x/crypto/ssh/handshake.go b/vendor/golang.org/x/crypto/ssh/handshake.go index 711a7f7c4..61aaeae93 100644 --- a/vendor/golang.org/x/crypto/ssh/handshake.go +++ b/vendor/golang.org/x/crypto/ssh/handshake.go @@ -13,6 +13,7 @@ import ( "slices" "strings" "sync" + "sync/atomic" ) // debugHandshake, if set, prints messages sent and received. Key @@ -115,8 +116,8 @@ type handshakeTransport struct { // dance to handle a custom server's message. bannerCallback BannerCallback - // Algorithms agreed in the last key exchange. - algorithms *NegotiatedAlgorithms + // Algorithms agreed in the last completed key exchange. + algorithms atomic.Pointer[NegotiatedAlgorithms] // Counters exclusively owned by readLoop. readPacketsLeft uint32 @@ -186,7 +187,7 @@ func (t *handshakeTransport) getSessionID() []byte { } func (t *handshakeTransport) getAlgorithms() NegotiatedAlgorithms { - return *t.algorithms + return *t.algorithms.Load() } // waitSession waits for the session to be established. This should be @@ -294,8 +295,8 @@ func (t *handshakeTransport) resetWriteThresholds() { t.writePacketsLeft = packetRekeyThreshold if t.config.RekeyThreshold > 0 { t.writeBytesLeft = int64(t.config.RekeyThreshold) - } else if t.algorithms != nil { - t.writeBytesLeft = t.algorithms.Write.rekeyBytes() + } else if algs := t.algorithms.Load(); algs != nil { + t.writeBytesLeft = algs.Write.rekeyBytes() } else { t.writeBytesLeft = 1 << 30 } @@ -411,8 +412,8 @@ func (t *handshakeTransport) resetReadThresholds() { t.readPacketsLeft = packetRekeyThreshold if t.config.RekeyThreshold > 0 { t.readBytesLeft = int64(t.config.RekeyThreshold) - } else if t.algorithms != nil { - t.readBytesLeft = t.algorithms.Read.rekeyBytes() + } else if algs := t.algorithms.Load(); algs != nil { + t.readBytesLeft = algs.Read.rekeyBytes() } else { t.readBytesLeft = 1 << 30 } @@ -629,6 +630,7 @@ func (t *handshakeTransport) writePacket(p []byte) error { if err := t.pushPacket(p); err != nil { t.writeError = err t.writeCond.Broadcast() + return err } return nil @@ -674,8 +676,7 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { magics.serverKexInit = otherInitPacket } - var err error - t.algorithms, err = findAgreedAlgorithms(isClient, clientInit, serverInit) + algs, err := findAgreedAlgorithms(isClient, clientInit, serverInit) if err != nil { return err } @@ -705,16 +706,16 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { } } - kex, ok := kexAlgoMap[t.algorithms.KeyExchange] + kex, ok := kexAlgoMap[algs.KeyExchange] if !ok { - return fmt.Errorf("ssh: unexpected key exchange algorithm %v", t.algorithms.KeyExchange) + return fmt.Errorf("ssh: unexpected key exchange algorithm %v", algs.KeyExchange) } var result *kexResult if len(t.hostKeys) > 0 { - result, err = t.server(kex, &magics) + result, err = t.server(kex, algs.HostKey, &magics) } else { - result, err = t.client(kex, &magics) + result, err = t.client(kex, algs.HostKey, &magics) } if err != nil { @@ -727,7 +728,7 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { } result.SessionID = t.sessionID - if err := t.conn.prepareKeyChange(t.algorithms, result); err != nil { + if err := t.conn.prepareKeyChange(algs, result); err != nil { return err } if err = t.conn.writePacket([]byte{msgNewKeys}); err != nil { @@ -768,6 +769,8 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { t.conn.setInitialKEXDone() } + t.algorithms.Store(algs) + return nil } @@ -813,17 +816,17 @@ func pickHostKey(hostKeys []Signer, algo string) AlgorithmSigner { return nil } -func (t *handshakeTransport) server(kex kexAlgorithm, magics *handshakeMagics) (*kexResult, error) { - hostKey := pickHostKey(t.hostKeys, t.algorithms.HostKey) +func (t *handshakeTransport) server(kex kexAlgorithm, hostKeyAlgo string, magics *handshakeMagics) (*kexResult, error) { + hostKey := pickHostKey(t.hostKeys, hostKeyAlgo) if hostKey == nil { return nil, errors.New("ssh: internal error: negotiated unsupported signature type") } - r, err := kex.Server(t.conn, t.config.Rand, magics, hostKey, t.algorithms.HostKey) + r, err := kex.Server(t.conn, t.config.Rand, magics, hostKey, hostKeyAlgo) return r, err } -func (t *handshakeTransport) client(kex kexAlgorithm, magics *handshakeMagics) (*kexResult, error) { +func (t *handshakeTransport) client(kex kexAlgorithm, hostKeyAlgo string, magics *handshakeMagics) (*kexResult, error) { result, err := kex.Client(t.conn, t.config.Rand, magics) if err != nil { return nil, err @@ -834,7 +837,7 @@ func (t *handshakeTransport) client(kex kexAlgorithm, magics *handshakeMagics) ( return nil, err } - if err := verifyHostKeySignature(hostKey, t.algorithms.HostKey, result); err != nil { + if err := verifyHostKeySignature(hostKey, hostKeyAlgo, result); err != nil { return nil, err } diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go index eb052381c..bfcba7ecd 100644 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ b/vendor/golang.org/x/crypto/ssh/keys.go @@ -38,11 +38,9 @@ import ( // arguments. const ( KeyAlgoRSA = "ssh-rsa" - // Deprecated: DSA is only supported at insecure key sizes, and was removed - // from major implementations. + // Deprecated: DSA is no longer supported. KeyAlgoDSA = InsecureKeyAlgoDSA - // Deprecated: DSA is only supported at insecure key sizes, and was removed - // from major implementations. + // Deprecated: DSA is no longer supported. InsecureKeyAlgoDSA = "ssh-dss" KeyAlgoECDSA256 = "ecdsa-sha2-nistp256" KeyAlgoSKECDSA256 = "sk-ecdsa-sha2-nistp256@openssh.com" @@ -79,8 +77,6 @@ func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err err switch algo { case KeyAlgoRSA: return parseRSA(in) - case InsecureKeyAlgoDSA: - return parseDSA(in) case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521: return parseECDSA(in, algo) case KeyAlgoSKECDSA256: @@ -91,7 +87,7 @@ func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err err return parseSKEd25519(in) case KeyAlgoMLDSA44, KeyAlgoMLDSA65, KeyAlgoMLDSA87: return parseMLDSA(in, algo) - case CertAlgoRSAv01, InsecureCertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01, + case CertAlgoRSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01, CertAlgoMLDSA44v01Go, CertAlgoMLDSA65v01Go, CertAlgoMLDSA87v01Go: cert, err := parseCert(in, certKeyAlgoNames[algo]) if err != nil { @@ -104,7 +100,7 @@ func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err err algo, keyFormat) } - return nil, nil, fmt.Errorf("ssh: unknown key algorithm: %v", algo) + return nil, nil, fmt.Errorf("ssh: unknown key algorithm: %q", algo) } // trimSpace removes leading and trailing ASCII space and tab. @@ -166,7 +162,8 @@ func parseAuthorizedKey(in []byte) (out PublicKey, comment string, err error) { // can be called repeatedly to parse multiple entries. // // If no entries were found in the input then err will be io.EOF. Otherwise a -// non-nil err value indicates a parse error. +// non-nil err value indicates a parse error, and rest contains the input +// following the invalid entry. func ParseKnownHosts(in []byte) (marker string, hosts []string, pubKey PublicKey, comment string, rest []byte, err error) { for len(in) > 0 { end := bytes.IndexByte(in, '\n') @@ -197,7 +194,7 @@ func ParseKnownHosts(in []byte) (marker string, hosts []string, pubKey PublicKey // number of fields. keyFields := asciiFields(in) if len(keyFields) < 3 { - return "", nil, nil, "", nil, errors.New("ssh: invalid entry in known_hosts data") + return "", nil, nil, "", rest, errors.New("ssh: invalid entry in known_hosts data") } // keyFields[0] is either "@cert-authority", "@revoked" or a comma separated @@ -217,10 +214,10 @@ func ParseKnownHosts(in []byte) (marker string, hosts []string, pubKey PublicKey key := bytes.Join(keyFields[2:], []byte(" ")) if pubKey, comment, err = parseAuthorizedKey(key); err != nil { - return "", nil, nil, "", nil, err + return "", nil, nil, "", rest, err } if pubKey.Type() != wantType { - return "", nil, nil, "", nil, fmt.Errorf("ssh: known hosts key type mismatch: human-readable type %q, encoded type %q", wantType, pubKey.Type()) + return "", nil, nil, "", rest, fmt.Errorf("ssh: known hosts key type mismatch: human-readable type %q, encoded type %q", wantType, pubKey.Type()) } return marker, strings.Split(hosts, ","), pubKey, comment, rest, nil @@ -550,7 +547,7 @@ func (r *rsaPublicKey) Marshal() []byte { func (r *rsaPublicKey) Verify(data []byte, sig *Signature) error { supportedAlgos := algorithmsForKeyFormat(r.Type()) if !slices.Contains(supportedAlgos, sig.Format) { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, r.Type()) + return fmt.Errorf("ssh: signature type %q for key type %q", sig.Format, r.Type()) } hash, err := hashFunc(sig.Format) if err != nil { @@ -608,170 +605,6 @@ func (r *rsaPublicKey) CryptoPublicKey() crypto.PublicKey { return (*rsa.PublicKey)(r) } -type dsaPublicKey dsa.PublicKey - -func (k *dsaPublicKey) Type() string { - return "ssh-dss" -} - -func checkDSAParams(param *dsa.Parameters) error { - // SSH specifies FIPS 186-2, which only provided a single size - // (1024 bits) DSA key. FIPS 186-3 allows for larger key - // sizes, which would confuse SSH. - if l := param.P.BitLen(); l != 1024 { - return fmt.Errorf("ssh: unsupported DSA key size %d", l) - } - - // FIPS 186-2 specifies that Q must be exactly 160 bits. We must enforce - // this to prevent DoS attacks where an attacker sends a huge Q which makes - // verification slow. - if l := param.Q.BitLen(); l != 160 { - return fmt.Errorf("ssh: unsupported DSA sub-prime size %d", l) - } - - // The generator G is an element of the group, so it must be strictly less - // than the modulus P. - if param.G.Cmp(param.P) >= 0 { - return errors.New("ssh: DSA generator larger than modulus") - } - - // G must be positive. - if param.G.Sign() <= 0 { - return errors.New("ssh: DSA generator must be positive") - } - - return nil -} - -// parseDSA parses an DSA key according to RFC 4253, section 6.6. -func parseDSA(in []byte) (out PublicKey, rest []byte, err error) { - var w struct { - P, Q, G, Y *big.Int - Rest []byte `ssh:"rest"` - } - if err := Unmarshal(in, &w); err != nil { - return nil, nil, err - } - - param := dsa.Parameters{ - P: w.P, - Q: w.Q, - G: w.G, - } - if err := checkDSAParams(¶m); err != nil { - return nil, nil, err - } - - // The public value Y must be a non-zero element of the group, i.e. - // strictly between 0 and P. crypto/dsa.Verify does not range-check Y, - // so we reject out-of-range values here to prevent a maliciously - // oversized Y from slowing verification. - if w.Y.Sign() <= 0 || w.Y.Cmp(w.P) >= 0 { - return nil, nil, errors.New("ssh: DSA public value Y out of range") - } - - key := &dsaPublicKey{ - Parameters: param, - Y: w.Y, - } - return key, w.Rest, nil -} - -func (k *dsaPublicKey) Marshal() []byte { - // DSA publickey struct layout should match the struct used by - // parseDSACert in the x/crypto/ssh/agent package. - w := struct { - Name string - P, Q, G, Y *big.Int - }{ - k.Type(), - k.P, - k.Q, - k.G, - k.Y, - } - - return Marshal(&w) -} - -func (k *dsaPublicKey) Verify(data []byte, sig *Signature) error { - if sig.Format != k.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) - } - hash, err := hashFunc(sig.Format) - if err != nil { - return err - } - h := hash.New() - h.Write(data) - digest := h.Sum(nil) - - // Per RFC 4253, section 6.6, - // The value for 'dss_signature_blob' is encoded as a string containing - // r, followed by s (which are 160-bit integers, without lengths or - // padding, unsigned, and in network byte order). - // For DSS purposes, sig.Blob should be exactly 40 bytes in length. - if len(sig.Blob) != 40 { - return errors.New("ssh: DSA signature parse error") - } - r := new(big.Int).SetBytes(sig.Blob[:20]) - s := new(big.Int).SetBytes(sig.Blob[20:]) - if dsa.Verify((*dsa.PublicKey)(k), digest, r, s) { - return nil - } - return errors.New("ssh: signature did not verify") -} - -func (k *dsaPublicKey) CryptoPublicKey() crypto.PublicKey { - return (*dsa.PublicKey)(k) -} - -type dsaPrivateKey struct { - *dsa.PrivateKey -} - -func (k *dsaPrivateKey) PublicKey() PublicKey { - return (*dsaPublicKey)(&k.PrivateKey.PublicKey) -} - -func (k *dsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) { - return k.SignWithAlgorithm(rand, data, k.PublicKey().Type()) -} - -func (k *dsaPrivateKey) Algorithms() []string { - return []string{k.PublicKey().Type()} -} - -func (k *dsaPrivateKey) SignWithAlgorithm(rand io.Reader, data []byte, algorithm string) (*Signature, error) { - if algorithm != "" && algorithm != k.PublicKey().Type() { - return nil, fmt.Errorf("ssh: unsupported signature algorithm %s", algorithm) - } - - hash, err := hashFunc(k.PublicKey().Type()) - if err != nil { - return nil, err - } - h := hash.New() - h.Write(data) - digest := h.Sum(nil) - r, s, err := dsa.Sign(rand, k.PrivateKey, digest) - if err != nil { - return nil, err - } - - sig := make([]byte, 40) - rb := r.Bytes() - sb := s.Bytes() - - copy(sig[20-len(rb):20], rb) - copy(sig[40-len(sb):], sb) - - return &Signature{ - Format: k.PublicKey().Type(), - Blob: sig, - }, nil -} - type ecdsaPublicKey ecdsa.PublicKey func (k *ecdsaPublicKey) Type() string { @@ -826,7 +659,7 @@ func (k ed25519PublicKey) Marshal() []byte { func (k ed25519PublicKey) Verify(b []byte, sig *Signature) error { if sig.Format != k.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) + return fmt.Errorf("ssh: signature type %q for key type %q", sig.Format, k.Type()) } if l := len(k); l != ed25519.PublicKeySize { return fmt.Errorf("ssh: invalid size %d for Ed25519 public key", l) @@ -905,7 +738,7 @@ func (k *ecdsaPublicKey) Marshal() []byte { func (k *ecdsaPublicKey) Verify(data []byte, sig *Signature) error { if sig.Format != k.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) + return fmt.Errorf("ssh: signature type %q for key type %q", sig.Format, k.Type()) } hash, err := hashFunc(sig.Format) if err != nil { @@ -1026,7 +859,7 @@ func (k *skECDSAPublicKey) Marshal() []byte { func (k *skECDSAPublicKey) Verify(data []byte, sig *Signature) error { if sig.Format != k.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) + return fmt.Errorf("ssh: signature type %q for key type %q", sig.Format, k.Type()) } hash, err := hashFunc(sig.Format) if err != nil { @@ -1137,7 +970,7 @@ func (k *skEd25519PublicKey) Marshal() []byte { func (k *skEd25519PublicKey) Verify(data []byte, sig *Signature) error { if sig.Format != k.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) + return fmt.Errorf("ssh: signature type %q for key type %q", sig.Format, k.Type()) } if l := len(k.PublicKey); l != ed25519.PublicKeySize { return fmt.Errorf("invalid size %d for Ed25519 public key", l) @@ -1197,29 +1030,18 @@ func (k *skEd25519PublicKey) CryptoPublicKey() crypto.PublicKey { return k.PublicKey } -// NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey, -// *ecdsa.PrivateKey, *mldsa.PrivateKey, or any other crypto.Signer and returns -// a corresponding Signer instance. ECDSA keys must use P-256, P-384 or P-521. -// DSA keys must use parameter size L1024N160. +// NewSignerFromKey takes an *rsa.PrivateKey, *ecdsa.PrivateKey, +// *mldsa.PrivateKey, or any other crypto.Signer and returns a corresponding +// Signer instance. ECDSA keys must use P-256, P-384 or P-521. func NewSignerFromKey(key interface{}) (Signer, error) { switch key := key.(type) { case crypto.Signer: return NewSignerFromSigner(key) - case *dsa.PrivateKey: - return newDSAPrivateKey(key) default: return nil, fmt.Errorf("ssh: unsupported key type %T", key) } } -func newDSAPrivateKey(key *dsa.PrivateKey) (Signer, error) { - if err := checkDSAParams(&key.PublicKey.Parameters); err != nil { - return nil, err - } - - return &dsaPrivateKey{key}, nil -} - type wrappedSigner struct { signer crypto.Signer pubKey PublicKey @@ -1277,10 +1099,8 @@ func (s *wrappedSigner) SignWithAlgorithm(rand io.Reader, data []byte, algorithm } // crypto.Signer.Sign is expected to return an ASN.1-encoded signature - // for ECDSA and DSA, but that's not the encoding expected by SSH, so - // re-encode. - switch s.pubKey.(type) { - case *ecdsaPublicKey, *dsaPublicKey: + // for ECDSA, but that's not the encoding expected by SSH, so re-encode. + if _, ok := s.pubKey.(*ecdsaPublicKey); ok { type asn1Signature struct { R, S *big.Int } @@ -1289,18 +1109,7 @@ func (s *wrappedSigner) SignWithAlgorithm(rand io.Reader, data []byte, algorithm if err != nil { return nil, err } - - switch s.pubKey.(type) { - case *ecdsaPublicKey: - signature = Marshal(asn1Sig) - - case *dsaPublicKey: - signature = make([]byte, 40) - r := asn1Sig.R.Bytes() - s := asn1Sig.S.Bytes() - copy(signature[20-len(r):20], r) - copy(signature[40-len(s):40], s) - } + signature = Marshal(asn1Sig) } return &Signature{ @@ -1309,9 +1118,9 @@ func (s *wrappedSigner) SignWithAlgorithm(rand io.Reader, data []byte, algorithm }, nil } -// NewPublicKey takes an *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey, -// ed25519.PublicKey, or an *mldsa.PublicKey, and returns a corresponding -// PublicKey instance. ECDSA keys must use P-256, P-384 or P-521. +// NewPublicKey takes an *rsa.PublicKey, *ecdsa.PublicKey, ed25519.PublicKey, +// or an *mldsa.PublicKey, and returns a corresponding PublicKey instance. ECDSA +// keys must use P-256, P-384 or P-521. func NewPublicKey(key interface{}) (PublicKey, error) { switch key := key.(type) { case *rsa.PublicKey: @@ -1321,8 +1130,6 @@ func NewPublicKey(key interface{}) (PublicKey, error) { return nil, errors.New("ssh: only P-256, P-384 and P-521 EC keys are supported") } return (*ecdsaPublicKey)(key), nil - case *dsa.PublicKey: - return (*dsaPublicKey)(key), nil case ed25519.PublicKey: if l := len(key); l != ed25519.PublicKeySize { return nil, fmt.Errorf("ssh: invalid size %d for Ed25519 public key", l) @@ -1384,7 +1191,7 @@ func (*PassphraseMissingError) Error() string { } // ParseRawPrivateKey returns a private key from a PEM encoded private key. It supports -// RSA, DSA, ECDSA, and Ed25519 private keys in PKCS#1, PKCS#8, OpenSSL, and OpenSSH +// RSA, ECDSA, and Ed25519 private keys in PKCS#1, PKCS#8, OpenSSL, and OpenSSH // formats. If the private key is encrypted, it will return a PassphraseMissingError. func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { block, _ := pem.Decode(pemBytes) @@ -1404,8 +1211,6 @@ func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { return x509.ParsePKCS8PrivateKey(block.Bytes) case "EC PRIVATE KEY": return x509.ParseECPrivateKey(block.Bytes) - case "DSA PRIVATE KEY": - return ParseDSAPrivateKey(block.Bytes) case "OPENSSH PRIVATE KEY": return parseOpenSSHPrivateKey(block.Bytes, unencryptedOpenSSHKey) default: @@ -1445,8 +1250,6 @@ func ParseRawPrivateKeyWithPassphrase(pemBytes, passphrase []byte) (interface{}, result, err = x509.ParsePKCS1PrivateKey(buf) case "EC PRIVATE KEY": result, err = x509.ParseECPrivateKey(buf) - case "DSA PRIVATE KEY": - result, err = ParseDSAPrivateKey(buf) default: err = fmt.Errorf("ssh: unsupported key type %q", block.Type) } @@ -1461,36 +1264,11 @@ func ParseRawPrivateKeyWithPassphrase(pemBytes, passphrase []byte) (interface{}, return result, err } -// ParseDSAPrivateKey returns a DSA private key from its ASN.1 DER encoding, as -// specified by the OpenSSL DSA man page. +// ParseDSAPrivateKey always returns an error. +// +// Deprecated: DSA is no longer supported. func ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) { - var k struct { - Version int - P *big.Int - Q *big.Int - G *big.Int - Pub *big.Int - Priv *big.Int - } - rest, err := asn1.Unmarshal(der, &k) - if err != nil { - return nil, errors.New("ssh: failed to parse DSA key: " + err.Error()) - } - if len(rest) > 0 { - return nil, errors.New("ssh: garbage after DSA key") - } - - return &dsa.PrivateKey{ - PublicKey: dsa.PublicKey{ - Parameters: dsa.Parameters{ - P: k.P, - Q: k.Q, - G: k.G, - }, - Y: k.Pub, - }, - X: k.Priv, - }, nil + return nil, errors.New("ssh: DSA keys are not supported") } func unencryptedOpenSSHKey(cipherName, kdfName, kdfOpts string, privKeyBlock []byte) ([]byte, error) { diff --git a/vendor/golang.org/x/crypto/ssh/messages.go b/vendor/golang.org/x/crypto/ssh/messages.go index 1d23dde25..8c753be2d 100644 --- a/vendor/golang.org/x/crypto/ssh/messages.go +++ b/vendor/golang.org/x/crypto/ssh/messages.go @@ -5,7 +5,6 @@ package ssh import ( - "bytes" "encoding/binary" "errors" "fmt" @@ -181,6 +180,7 @@ type userAuthBannerMsg struct { Message string `sshtype:"53"` // unused, but required to allow message parsing Language string + Rest []byte `ssh:"rest"` } // See RFC 4256, section 3.2 @@ -619,10 +619,7 @@ func parseString(in []byte) (out, rest []byte, ok bool) { return } -var ( - comma = []byte{','} - emptyNameList = []string{} -) +var emptyNameList = []string{} func parseNameList(in []byte) (out []string, rest []byte, ok bool) { contents, rest, ok := parseString(in) @@ -633,11 +630,7 @@ func parseNameList(in []byte) (out []string, rest []byte, ok bool) { out = emptyNameList return } - parts := bytes.Split(contents, comma) - out = make([]string, len(parts)) - for i, part := range parts { - out[i] = string(part) - } + out = strings.Split(string(contents), ",") return } diff --git a/vendor/golang.org/x/crypto/ssh/mldsa.go b/vendor/golang.org/x/crypto/ssh/mldsa.go index 09176b652..7acb07fe3 100644 --- a/vendor/golang.org/x/crypto/ssh/mldsa.go +++ b/vendor/golang.org/x/crypto/ssh/mldsa.go @@ -105,7 +105,7 @@ func (k *mldsaPublicKey) Marshal() []byte { func (k *mldsaPublicKey) Verify(b []byte, sig *Signature) error { if sig.Format != k.Type() { - return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) + return fmt.Errorf("ssh: signature type %q for key type %q", sig.Format, k.Type()) } // nil options select pure ML-DSA with an empty context, as required by // [SSH-MLDSA], Sections 6 and 8. diff --git a/vendor/golang.org/x/crypto/ssh/mux.go b/vendor/golang.org/x/crypto/ssh/mux.go index 955560bda..81d65f581 100644 --- a/vendor/golang.org/x/crypto/ssh/mux.go +++ b/vendor/golang.org/x/crypto/ssh/mux.go @@ -30,23 +30,31 @@ type chanList struct { // amount. This helps distinguish otherwise identical // server/client muxes offset uint32 + + // closed is set by dropAll. + closed bool } // add stores the given channel and assigns its localId while holding the // lock, so that getChan can never return a channel whose localId is not yet -// initialized. -func (c *chanList) add(ch *channel) { +// initialized. Once dropAll has been called, add leaves the channel +// unregistered and returns false. +func (c *chanList) add(ch *channel) bool { c.Lock() defer c.Unlock() + if c.closed { + return false + } for i := range c.chans { if c.chans[i] == nil { c.chans[i] = ch ch.localId = uint32(i) + c.offset - return + return true } } c.chans = append(c.chans, ch) ch.localId = uint32(len(c.chans)-1) + c.offset + return true } // getChan returns the channel for the given ID. @@ -70,7 +78,8 @@ func (c *chanList) remove(id uint32) { c.Unlock() } -// dropAll forgets all channels it knows, returning them in a slice. +// dropAll forgets all channels it knows, returning them in a slice. No +// channel can be added afterwards. func (c *chanList) dropAll() []*channel { c.Lock() defer c.Unlock() @@ -83,9 +92,17 @@ func (c *chanList) dropAll() []*channel { r = append(r, ch) } c.chans = nil + c.closed = true return r } +// isClosed reports whether dropAll has been called. +func (c *chanList) isClosed() bool { + c.Lock() + defer c.Unlock() + return c.closed +} + // mux represents the state for the SSH connection protocol, which // multiplexes many channels onto a single packet transport. type mux struct { @@ -345,11 +362,14 @@ func (m *mux) OpenChannel(chanType string, extra []byte) (Channel, <-chan *Reque func (m *mux) openChannel(chanType string, extra []byte) (*channel, error) { ch := m.newChannel(chanType, channelOutbound, extra) + if m.chanList.isClosed() { + return nil, io.EOF + } open := channelOpenMsg{ ChanType: chanType, PeersWindow: ch.myWindow, - MaxPacketSize: ch.maxIncomingPayload, + MaxPacketSize: channelMaxPacket, TypeSpecificData: extra, PeersID: ch.localId, } @@ -357,7 +377,11 @@ func (m *mux) openChannel(chanType string, extra []byte) (*channel, error) { return nil, err } - switch msg := (<-ch.msg).(type) { + msg, ok := <-ch.msg + if !ok { + return nil, io.EOF + } + switch msg := msg.(type) { case *channelOpenConfirmMsg: return ch, nil case *channelOpenFailureMsg: diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go index e09026268..3eced0e75 100644 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ b/vendor/golang.org/x/crypto/ssh/server.go @@ -184,7 +184,8 @@ type ServerConfig struct { // authentication algorithms. Note that this should not include certificate // types since those use the underlying algorithm. This list is sent to the // client if it supports the server-sig-algs extension. Order is irrelevant. - // If unspecified then a default set of algorithms is used. + // If unspecified then a default set of algorithms is used. Unsupported + // algorithms are ignored. PublicKeyAuthAlgorithms []string hostKeys []Signer @@ -204,7 +205,9 @@ type ServerConfig struct { // MaxAuthTries specifies the maximum number of authentication attempts // permitted per connection. If set to a negative number, the number of // attempts are unlimited. If set to zero, the number of attempts are limited - // to 6. + // to 6. Rejected public key queries count towards this limit only after + // exceeding a dedicated budget (also controlled by this option). This helps + // legitimate clients with multiple keys not hit the limit. MaxAuthTries int // PasswordCallback, if non-nil, is called when a user @@ -359,12 +362,14 @@ func NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewCha if len(fullConf.PublicKeyAuthAlgorithms) == 0 { fullConf.PublicKeyAuthAlgorithms = defaultPubKeyAuthAlgos } else { - for _, algo := range fullConf.PublicKeyAuthAlgorithms { - if !slices.Contains(SupportedAlgorithms().PublicKeyAuths, algo) && !slices.Contains(InsecureAlgorithms().PublicKeyAuths, algo) { - c.Close() - return nil, nil, nil, fmt.Errorf("ssh: unsupported public key authentication algorithm %s", algo) - } + algos := slices.DeleteFunc(slices.Clone(fullConf.PublicKeyAuthAlgorithms), func(algo string) bool { + return !slices.Contains(supportedPubKeyAuthAlgos, algo) && !slices.Contains(insecurePubKeyAuthAlgos, algo) + }) + if len(algos) == 0 { + c.Close() + return nil, nil, nil, errors.New("ssh: no supported public key authentication algorithms") } + fullConf.PublicKeyAuthAlgorithms = algos } s := &connection{ @@ -421,7 +426,6 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) // We just did the key change, so the session ID is established. s.sessionID = s.transport.getSessionID() - s.algorithms = s.transport.getAlgorithms() var packet []byte if packet, err = s.transport.readPacket(); err != nil { @@ -433,7 +437,7 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) return nil, err } if serviceRequest.Service != serviceUserAuth { - return nil, errors.New("ssh: requested service '" + serviceRequest.Service + "' before authenticating") + return nil, fmt.Errorf("ssh: requested service %q before authenticating", serviceRequest.Service) } serviceAccept := serviceAcceptMsg{ Service: serviceUserAuth, @@ -660,6 +664,7 @@ func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, err authFailures := 0 authAttempts := 0 + pubKeyQueryFailures := 0 noneAuthCount := 0 var authErrs []error var calledBannerCallback bool @@ -845,6 +850,10 @@ userAuthLoop: continue userAuthLoop } authErr = candidate.result + pubKeyQueryFailures++ + if pubKeyQueryFailures <= config.MaxAuthTries { + authFailures-- + } } else { sig, payload, ok := parseSignature(payload) if !ok || len(payload) > 0 { diff --git a/vendor/golang.org/x/crypto/ssh/session.go b/vendor/golang.org/x/crypto/ssh/session.go index ac6295578..8670e28be 100644 --- a/vendor/golang.org/x/crypto/ssh/session.go +++ b/vendor/golang.org/x/crypto/ssh/session.go @@ -438,7 +438,6 @@ func (s *Session) wait(reqs <-chan *Request) error { return err } - // Must sanitize strings? wm.signal = sigval.Signal wm.msg = sigval.Error wm.lang = sigval.Lang @@ -641,10 +640,10 @@ func (w Waitmsg) Lang() string { func (w Waitmsg) String() string { str := fmt.Sprintf("Process exited with status %v", w.status) if w.signal != "" { - str += fmt.Sprintf(" from signal %v", w.signal) + str += fmt.Sprintf(" from signal %q", w.signal) } if w.msg != "" { - str += fmt.Sprintf(". Reason was: %v", w.msg) + str += fmt.Sprintf(". Reason was: %q", w.msg) } return str } diff --git a/vendor/golang.org/x/sys/cpu/cpu_wasm32.go b/vendor/golang.org/x/sys/cpu/cpu_wasm32.go new file mode 100644 index 000000000..2d093dd7d --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_wasm32.go @@ -0,0 +1,17 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build wasm32 + +package cpu + +// We're compiling the cpu package for an unknown (software-abstracted) CPU. +// Make CacheLinePad an empty struct and hope that the usual struct alignment +// rules are good enough. + +const cacheLineSize = 0 + +func initOptions() {} + +func archInit() {} diff --git a/vendor/golang.org/x/sys/cpu/endian_little.go b/vendor/golang.org/x/sys/cpu/endian_little.go index 48eccc4c7..af38b7971 100644 --- a/vendor/golang.org/x/sys/cpu/endian_little.go +++ b/vendor/golang.org/x/sys/cpu/endian_little.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm +//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm || wasm32 package cpu diff --git a/vendor/golang.org/x/sys/cpu/zcpu_windows.go b/vendor/golang.org/x/sys/cpu/zcpu_windows.go index 6411a7a71..949b8f488 100644 --- a/vendor/golang.org/x/sys/cpu/zcpu_windows.go +++ b/vendor/golang.org/x/sys/cpu/zcpu_windows.go @@ -43,6 +43,6 @@ var ( func isProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) { r0, _, _ := syscall.SyscallN(procIsProcessorFeaturePresent.Addr(), uintptr(ProcessorFeature)) - ret = r0 != 0 + ret = uint32(r0) != 0 return } diff --git a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s index 2e1f4c3e7..daa857131 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s @@ -14,13 +14,13 @@ // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 - MOVD $syscall·Syscall(SB), R31 - MOVD R31, CTR + MOVD $syscall·Syscall(SB), R12 + MOVD R12, CTR JMP (CTR) TEXT ·Syscall6(SB),NOSPLIT,$0-80 - MOVD $syscall·Syscall6(SB), R31 - MOVD R31, CTR + MOVD $syscall·Syscall6(SB), R12 + MOVD R12, CTR JMP (CTR) TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 @@ -39,13 +39,13 @@ TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - MOVD $syscall·RawSyscall(SB), R31 - MOVD R31, CTR + MOVD $syscall·RawSyscall(SB), R12 + MOVD R12, CTR JMP (CTR) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - MOVD $syscall·RawSyscall6(SB), R31 - MOVD R31, CTR + MOVD $syscall·RawSyscall6(SB), R12 + MOVD R12, CTR JMP (CTR) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 diff --git a/vendor/golang.org/x/sys/unix/dirent.go b/vendor/golang.org/x/sys/unix/dirent.go index 1ebf11782..182181ecb 100644 --- a/vendor/golang.org/x/sys/unix/dirent.go +++ b/vendor/golang.org/x/sys/unix/dirent.go @@ -6,7 +6,10 @@ package unix -import "unsafe" +import ( + "runtime" + "unsafe" +) // readInt returns the size-bytes unsigned integer in native byte order at offset off. func readInt(b []byte, off, size uintptr) (u uint64, ok bool) { @@ -75,7 +78,10 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, if !ok { break } - if ino == 0 { // File absent in directory. + // Some filesystems on Linux (old XFS, FUSE) can return valid + // files with zero inodes. On other platforms, a zero inode + // indicates a file absent from the directory. + if ino == 0 && runtime.GOOS != "linux" { continue } const namoff = uint64(unsafe.Offsetof(Dirent{}.Name)) diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/vendor/golang.org/x/sys/unix/ioctl_linux.go index 5589d4f66..b1d769a3e 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_linux.go +++ b/vendor/golang.org/x/sys/unix/ioctl_linux.go @@ -23,6 +23,12 @@ func IoctlGetUint32(fd int, req uint) (uint32, error) { return value, err } +func IoctlGetUint64(fd int, req uint) (uint64, error) { + var value uint64 + err := ioctlPtr(fd, req, unsafe.Pointer(&value)) + return value, err +} + func IoctlGetRTCTime(fd int) (*RTCTime, error) { var value RTCTime err := ioctlPtr(fd, RTC_RD_TIME, unsafe.Pointer(&value)) diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go b/vendor/golang.org/x/sys/unix/sockcmsg_linux.go index 5f63147e0..b09bd17b0 100644 --- a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go +++ b/vendor/golang.org/x/sys/unix/sockcmsg_linux.go @@ -31,6 +31,9 @@ func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { if m.Header.Type != SCM_CREDENTIALS { return nil, EINVAL } + if len(m.Data) < SizeofUcred { + return nil, EINVAL + } ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) return &ucred, nil } diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go index 3967bca77..6721ca981 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go @@ -49,7 +49,13 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e var writtenOut uint64 = 0 _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) - written = int(writtenOut) + // For some reason on the freebsd-386 builder writtenOut + // is modified when the system call returns EINVAL. + // The man page says that the value is only written for + // success, EINTR, or EAGAIN, so only use those cases. + if e1 == 0 || e1 == EINTR || e1 == EAGAIN { + written = int(writtenOut) + } if e1 != 0 { err = e1 diff --git a/vendor/golang.org/x/sys/windows/memory_windows.go b/vendor/golang.org/x/sys/windows/memory_windows.go index 6dc0920a8..1adb60739 100644 --- a/vendor/golang.org/x/sys/windows/memory_windows.go +++ b/vendor/golang.org/x/sys/windows/memory_windows.go @@ -35,14 +35,3 @@ const ( QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008 QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004 ) - -type MemoryBasicInformation struct { - BaseAddress uintptr - AllocationBase uintptr - AllocationProtect uint32 - PartitionId uint16 - RegionSize uintptr - State uint32 - Protect uint32 - Type uint32 -} diff --git a/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go index bc1ce4360..59a6eb1fc 100644 --- a/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go @@ -53,56 +53,56 @@ var ( func regConnectRegistry(machinename *uint16, key syscall.Handle, result *syscall.Handle) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegConnectRegistryW.Addr(), uintptr(unsafe.Pointer(machinename)), uintptr(key), uintptr(unsafe.Pointer(result))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegCreateKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegDeleteKeyW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegDeleteValueW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegEnumValueW.Addr(), uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegLoadMUIStringW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(unsafe.Pointer(buflenCopied)), uintptr(flags), uintptr(unsafe.Pointer(dir))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegSetValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(valueName)), uintptr(reserved), uintptr(vtype), uintptr(unsafe.Pointer(buf)), uintptr(bufsize)) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index e6966b4c3..bf0ae9ca0 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -507,7 +507,7 @@ func CurrentThread() Handle { return Handle(^uintptr(2 - 1)) } // GetProcAddressByOrdinal retrieves the address of the exported // function from module by ordinal. func GetProcAddressByOrdinal(module Handle, ordinal uintptr) (proc uintptr, err error) { - r0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), ordinal, 0) + r0, _, e1 := syscall.SyscallN(procGetProcAddress.Addr(), uintptr(module), ordinal) proc = uintptr(r0) if proc == 0 { err = errnoErr(e1) @@ -1206,7 +1206,7 @@ func LoadConnectEx() error { } func connectEx(s Handle, name unsafe.Pointer, namelen int32, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall9(connectExFunc.addr, 7, uintptr(s), uintptr(name), uintptr(namelen), uintptr(unsafe.Pointer(sendBuf)), uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), 0, 0) + r1, _, e1 := syscall.SyscallN(connectExFunc.addr, uintptr(s), uintptr(name), uintptr(namelen), uintptr(unsafe.Pointer(sendBuf)), uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { if e1 != 0 { err = error(e1) @@ -1271,7 +1271,7 @@ func WSASendMsg(fd Handle, msg *WSAMsg, flags uint32, bytesSent *uint32, overlap if err != nil { return err } - r1, _, e1 := syscall.Syscall6(sendRecvMsgFunc.sendAddr, 6, uintptr(fd), uintptr(unsafe.Pointer(msg)), uintptr(flags), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) + r1, _, e1 := syscall.SyscallN(sendRecvMsgFunc.sendAddr, uintptr(fd), uintptr(unsafe.Pointer(msg)), uintptr(flags), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -1283,7 +1283,7 @@ func WSARecvMsg(fd Handle, msg *WSAMsg, bytesReceived *uint32, overlapped *Overl if err != nil { return err } - r1, _, e1 := syscall.Syscall6(sendRecvMsgFunc.recvAddr, 5, uintptr(fd), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(bytesReceived)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0) + r1, _, e1 := syscall.SyscallN(sendRecvMsgFunc.recvAddr, uintptr(fd), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(bytesReceived)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -1805,7 +1805,7 @@ type PSAPI_WORKING_SET_EX_BLOCK uint64 // Valid returns the validity of this page. // If this bit is 1, the subsequent members are valid; otherwise they should be ignored. func (b PSAPI_WORKING_SET_EX_BLOCK) Valid() bool { - return (b & 1) == 1 + return (b & 1) != 0 } // ShareCount is the number of processes that share this page. The maximum value of this member is 7. @@ -1822,7 +1822,7 @@ func (b PSAPI_WORKING_SET_EX_BLOCK) Win32Protection() uint64 { // Shared returns the shared status of this page. // If this bit is 1, the page can be shared. func (b PSAPI_WORKING_SET_EX_BLOCK) Shared() bool { - return (b & (1 << 15)) == 1 + return (b & (1 << 15)) != 0 } // Node is the NUMA node. The maximum value of this member is 63. @@ -1833,19 +1833,19 @@ func (b PSAPI_WORKING_SET_EX_BLOCK) Node() uint64 { // Locked returns the locked status of this page. // If this bit is 1, the virtual page is locked in physical memory. func (b PSAPI_WORKING_SET_EX_BLOCK) Locked() bool { - return (b & (1 << 22)) == 1 + return (b & (1 << 22)) != 0 } // LargePage returns the large page status of this page. // If this bit is 1, the page is a large page. func (b PSAPI_WORKING_SET_EX_BLOCK) LargePage() bool { - return (b & (1 << 23)) == 1 + return (b & (1 << 23)) != 0 } // Bad returns the bad status of this page. // If this bit is 1, the page is has been reported as bad. func (b PSAPI_WORKING_SET_EX_BLOCK) Bad() bool { - return (b & (1 << 31)) == 1 + return (b & (1 << 31)) != 0 } // intField extracts an integer field in the PSAPI_WORKING_SET_EX_BLOCK union. diff --git a/vendor/golang.org/x/sys/windows/types_windows_386.go b/vendor/golang.org/x/sys/windows/types_windows_386.go index 8bce3e2fc..b445f07e3 100644 --- a/vendor/golang.org/x/sys/windows/types_windows_386.go +++ b/vendor/golang.org/x/sys/windows/types_windows_386.go @@ -33,3 +33,13 @@ type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { SchedulingClass uint32 _ uint32 // pad to 8 byte boundary } + +type MemoryBasicInformation struct { + BaseAddress uintptr + AllocationBase uintptr + AllocationProtect uint32 + RegionSize uintptr + State uint32 + Protect uint32 + Type uint32 +} diff --git a/vendor/golang.org/x/sys/windows/types_windows_amd64.go b/vendor/golang.org/x/sys/windows/types_windows_amd64.go index fdddc0c70..1c2be24d2 100644 --- a/vendor/golang.org/x/sys/windows/types_windows_amd64.go +++ b/vendor/golang.org/x/sys/windows/types_windows_amd64.go @@ -32,3 +32,14 @@ type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { PriorityClass uint32 SchedulingClass uint32 } + +type MemoryBasicInformation struct { + BaseAddress uintptr + AllocationBase uintptr + AllocationProtect uint32 + PartitionId uint16 + RegionSize uintptr + State uint32 + Protect uint32 + Type uint32 +} diff --git a/vendor/golang.org/x/sys/windows/types_windows_arm64.go b/vendor/golang.org/x/sys/windows/types_windows_arm64.go index fdddc0c70..1c2be24d2 100644 --- a/vendor/golang.org/x/sys/windows/types_windows_arm64.go +++ b/vendor/golang.org/x/sys/windows/types_windows_arm64.go @@ -32,3 +32,14 @@ type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { PriorityClass uint32 SchedulingClass uint32 } + +type MemoryBasicInformation struct { + BaseAddress uintptr + AllocationBase uintptr + AllocationProtect uint32 + PartitionId uint16 + RegionSize uintptr + State uint32 + Protect uint32 + Type uint32 +} diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 192d19300..347ab612f 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -589,7 +589,7 @@ func AdjustTokenGroups(token Token, resetToDefault bool, newstate *Tokengroups, _p0 = 1 } r1, _, e1 := syscall.SyscallN(procAdjustTokenGroups.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -601,7 +601,7 @@ func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tok _p0 = 1 } r1, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -609,7 +609,7 @@ func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tok func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) { r1, _, e1 := syscall.SyscallN(procAllocateAndInitializeSid.Addr(), uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -617,15 +617,15 @@ func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, s func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries uint32, accessEntries *EXPLICIT_ACCESS, countAuditEntries uint32, auditEntries *EXPLICIT_ACCESS, oldSecurityDescriptor *SECURITY_DESCRIPTOR, sizeNewSecurityDescriptor *uint32, newSecurityDescriptor **SECURITY_DESCRIPTOR) (ret error) { r0, _, _ := syscall.SyscallN(procBuildSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) { r1, _, e1 := syscall.SyscallN(procChangeServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -633,7 +633,7 @@ func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err err func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procChangeServiceConfigW.Addr(), uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -641,7 +641,7 @@ func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, e func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) { r1, _, e1 := syscall.SyscallN(procCheckTokenMembership.Addr(), uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -649,7 +649,7 @@ func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) ( func CloseServiceHandle(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procCloseServiceHandle.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -657,7 +657,7 @@ func CloseServiceHandle(handle Handle) (err error) { func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) { r1, _, e1 := syscall.SyscallN(procControlService.Addr(), uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -665,7 +665,7 @@ func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR, revision uint32, securityInformation SECURITY_INFORMATION, str **uint16, strLen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -673,7 +673,7 @@ func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) { r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -690,7 +690,7 @@ func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision ui func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -698,7 +698,7 @@ func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -706,7 +706,7 @@ func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) { r1, _, e1 := syscall.SyscallN(procCopySid.Addr(), uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -718,7 +718,7 @@ func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, proc _p0 = 1 } r1, _, e1 := syscall.SyscallN(procCreateProcessAsUserW.Addr(), uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -735,7 +735,7 @@ func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, sizeSid *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCreateWellKnownSid.Addr(), uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -743,7 +743,7 @@ func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, s func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCryptAcquireContextW.Addr(), uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -751,7 +751,7 @@ func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16 func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { r1, _, e1 := syscall.SyscallN(procCryptGenRandom.Addr(), uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -759,7 +759,7 @@ func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCryptReleaseContext.Addr(), uintptr(provhandle), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -767,7 +767,7 @@ func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { func DeleteService(service Handle) (err error) { r1, _, e1 := syscall.SyscallN(procDeleteService.Addr(), uintptr(service)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -775,7 +775,7 @@ func DeleteService(service Handle) (err error) { func DeregisterEventSource(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procDeregisterEventSource.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -783,7 +783,7 @@ func DeregisterEventSource(handle Handle) (err error) { func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes *SecurityAttributes, impersonationLevel uint32, tokenType uint32, newToken *Token) (err error) { r1, _, e1 := syscall.SyscallN(procDuplicateTokenEx.Addr(), uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -791,7 +791,7 @@ func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes func EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEnumDependentServicesW.Addr(), uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -799,7 +799,7 @@ func EnumDependentServices(service Handle, activityState uint32, services *ENUM_ func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procEnumServicesStatusExW.Addr(), uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -807,7 +807,7 @@ func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serv func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) { r0, _, _ := syscall.SyscallN(procEqualSid.Addr(), uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2))) - isEqual = r0 != 0 + isEqual = uint32(r0) != 0 return } @@ -821,7 +821,7 @@ func FreeSid(sid *SID) (err error) { func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { r1, _, e1 := syscall.SyscallN(procGetAce.Addr(), uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -844,15 +844,15 @@ func getNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, security func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { r0, _, _ := syscall.SyscallN(procGetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func getSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, control *SECURITY_DESCRIPTOR_CONTROL, revision *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -870,7 +870,7 @@ func getSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent *bool, dacl r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1))) *daclPresent = _p0 != 0 *daclDefaulted = _p1 != 0 - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -883,7 +883,7 @@ func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefau } r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0))) *groupDefaulted = _p0 != 0 - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -902,7 +902,7 @@ func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefau } r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0))) *ownerDefaulted = _p0 != 0 - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -910,8 +910,8 @@ func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefau func getSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) (ret error) { r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } @@ -928,7 +928,7 @@ func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1))) *saclPresent = _p0 != 0 *saclDefaulted = _p1 != 0 - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -936,8 +936,8 @@ func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { r0, _, _ := syscall.SyscallN(procGetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } @@ -962,7 +962,7 @@ func getSidSubAuthorityCount(sid *SID) (count *uint8) { func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -970,7 +970,7 @@ func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint func ImpersonateSelf(impersonationlevel uint32) (err error) { r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(impersonationlevel)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -978,7 +978,7 @@ func ImpersonateSelf(impersonationlevel uint32) (err error) { func initializeSecurityDescriptor(absoluteSD *SECURITY_DESCRIPTOR, revision uint32) (err error) { r1, _, e1 := syscall.SyscallN(procInitializeSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -994,7 +994,7 @@ func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint _p1 = 1 } r1, _, e1 := syscall.SyscallN(procInitiateSystemShutdownExW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1002,7 +1002,7 @@ func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint func isTokenRestricted(tokenHandle Token) (ret bool, err error) { r0, _, e1 := syscall.SyscallN(procIsTokenRestricted.Addr(), uintptr(tokenHandle)) - ret = r0 != 0 + ret = uint32(r0) != 0 if !ret { err = errnoErr(e1) } @@ -1011,25 +1011,25 @@ func isTokenRestricted(tokenHandle Token) (ret bool, err error) { func isValidSecurityDescriptor(sd *SECURITY_DESCRIPTOR) (isValid bool) { r0, _, _ := syscall.SyscallN(procIsValidSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(sd))) - isValid = r0 != 0 + isValid = uint32(r0) != 0 return } func isValidSid(sid *SID) (isValid bool) { r0, _, _ := syscall.SyscallN(procIsValidSid.Addr(), uintptr(unsafe.Pointer(sid))) - isValid = r0 != 0 + isValid = uint32(r0) != 0 return } func isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) { r0, _, _ := syscall.SyscallN(procIsWellKnownSid.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(sidType)) - isWellKnown = r0 != 0 + isWellKnown = uint32(r0) != 0 return } func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1037,7 +1037,7 @@ func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1045,7 +1045,7 @@ func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint3 func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error) { r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1053,7 +1053,7 @@ func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err err func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DESCRIPTOR, absoluteSDSize *uint32, dacl *ACL, daclSize *uint32, sacl *ACL, saclSize *uint32, owner *SID, ownerSize *uint32, group *SID, groupSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procMakeAbsoluteSD.Addr(), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1061,7 +1061,7 @@ func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DE func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procMakeSelfRelativeSD.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1069,15 +1069,15 @@ func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURIT func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) { r0, _, _ := syscall.SyscallN(procNotifyServiceStatusChangeW.Addr(), uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func OpenProcessToken(process Handle, access uint32, token *Token) (err error) { r1, _, e1 := syscall.SyscallN(procOpenProcessToken.Addr(), uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1107,7 +1107,7 @@ func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token _p0 = 1 } r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1115,7 +1115,7 @@ func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1123,7 +1123,7 @@ func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceConfigW.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1135,7 +1135,7 @@ func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInf return } r1, _, e1 := syscall.SyscallN(procQueryServiceDynamicInformation.Addr(), uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1143,7 +1143,7 @@ func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInf func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceLockStatusW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1151,7 +1151,7 @@ func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, b func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(status))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1159,7 +1159,7 @@ func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceStatusEx.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1167,16 +1167,16 @@ func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize func RegCloseKey(key Handle) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegCloseKey.Addr(), uintptr(key)) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegEnumKeyExW.Addr(), uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } @@ -1191,32 +1191,32 @@ func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, _p1 = 1 } r0, _, _ := syscall.SyscallN(procRegNotifyChangeKeyValue.Addr(), uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1)) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegOpenKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegQueryInfoKeyW.Addr(), uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegQueryValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) - if r0 != 0 { - regerrno = syscall.Errno(r0) + if uint32(r0) != 0 { + regerrno = syscall.Errno(uint32(r0)) } return } @@ -1241,7 +1241,7 @@ func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, cont func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) { r1, _, e1 := syscall.SyscallN(procReportEventW.Addr(), uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1249,7 +1249,7 @@ func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrS func RevertToSelf() (err error) { r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr()) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1257,15 +1257,15 @@ func RevertToSelf() (err error) { func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) { r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) { r1, _, e1 := syscall.SyscallN(procSetKernelObjectSecurity.Addr(), uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1282,15 +1282,15 @@ func SetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, security func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func setSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) (err error) { r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1306,7 +1306,7 @@ func setSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent bool, dacl * _p1 = 1 } r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1318,7 +1318,7 @@ func setSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group *SID, groupDefaul _p0 = 1 } r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1330,7 +1330,7 @@ func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaul _p0 = 1 } r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1351,7 +1351,7 @@ func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl * _p1 = 1 } r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1359,15 +1359,15 @@ func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl * func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { r0, _, _ := syscall.SyscallN(procSetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) { r1, _, e1 := syscall.SyscallN(procSetServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceStatus))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1375,7 +1375,7 @@ func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) func SetThreadToken(thread *Handle, token Token) (err error) { r1, _, e1 := syscall.SyscallN(procSetThreadToken.Addr(), uintptr(unsafe.Pointer(thread)), uintptr(token)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1383,7 +1383,7 @@ func SetThreadToken(thread *Handle, token Token) (err error) { func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1391,7 +1391,7 @@ func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { r1, _, e1 := syscall.SyscallN(procStartServiceCtrlDispatcherW.Addr(), uintptr(unsafe.Pointer(serviceTable))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1399,7 +1399,7 @@ func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) { r1, _, e1 := syscall.SyscallN(procStartServiceW.Addr(), uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1407,7 +1407,7 @@ func StartService(service Handle, numArgs uint32, argVectors **uint16) (err erro func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) { r1, _, e1 := syscall.SyscallN(procCertAddCertificateContextToStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1415,7 +1415,7 @@ func CertAddCertificateContextToStore(store Handle, certContext *CertContext, ad func CertCloseStore(store Handle, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCertCloseStore.Addr(), uintptr(store), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1432,7 +1432,7 @@ func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, en func CertDeleteCertificateFromStore(certContext *CertContext) (err error) { r1, _, e1 := syscall.SyscallN(procCertDeleteCertificateFromStore.Addr(), uintptr(unsafe.Pointer(certContext))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1484,7 +1484,7 @@ func CertFreeCertificateChain(ctx *CertChainContext) { func CertFreeCertificateContext(ctx *CertContext) (err error) { r1, _, e1 := syscall.SyscallN(procCertFreeCertificateContext.Addr(), uintptr(unsafe.Pointer(ctx))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1492,7 +1492,7 @@ func CertFreeCertificateContext(ctx *CertContext) (err error) { func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) { r1, _, e1 := syscall.SyscallN(procCertGetCertificateChain.Addr(), uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1524,7 +1524,7 @@ func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) { func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) { r1, _, e1 := syscall.SyscallN(procCertVerifyCertificateChainPolicy.Addr(), uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1537,7 +1537,7 @@ func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, paramete } r1, _, e1 := syscall.SyscallN(procCryptAcquireCertificatePrivateKey.Addr(), uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0))) *callerFreeProvOrNCryptKey = _p0 != 0 - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1545,7 +1545,7 @@ func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, paramete func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCryptDecodeObject.Addr(), uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1553,7 +1553,7 @@ func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { r1, _, e1 := syscall.SyscallN(procCryptProtectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1561,7 +1561,7 @@ func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error) { r1, _, e1 := syscall.SyscallN(procCryptQueryObject.Addr(), uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1569,7 +1569,7 @@ func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentT func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { r1, _, e1 := syscall.SyscallN(procCryptUnprotectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1586,7 +1586,7 @@ func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (sto func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) { r0, _, _ := syscall.SyscallN(procDnsNameCompare_W.Addr(), uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2))) - same = r0 != 0 + same = uint32(r0) != 0 return } @@ -1601,8 +1601,8 @@ func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSR func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { r0, _, _ := syscall.SyscallN(procDnsQuery_W.Addr(), uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr))) - if r0 != 0 { - status = syscall.Errno(r0) + if uint32(r0) != 0 { + status = syscall.Errno(uint32(r0)) } return } @@ -1614,24 +1614,24 @@ func DnsRecordListFree(rl *DNSRecord, freetype uint32) { func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { r0, _, _ := syscall.SyscallN(procDwmGetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { r0, _, _ := syscall.SyscallN(procDwmSetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) { r0, _, _ := syscall.SyscallN(procCancelMibChangeNotify2.Addr(), uintptr(notificationHandle)) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } @@ -1643,96 +1643,96 @@ func FreeMibTable(memory unsafe.Pointer) { func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { r0, _, _ := syscall.SyscallN(procGetAdaptersAddresses.Addr(), uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) { r0, _, _ := syscall.SyscallN(procGetAdaptersInfo.Addr(), uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) { r0, _, _ := syscall.SyscallN(procGetBestInterfaceEx.Addr(), uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetIfEntry(pIfRow *MibIfRow) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIfEntry.Addr(), uintptr(unsafe.Pointer(pIfRow))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIfEntry2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(row))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetIfTable2Ex(level uint32, table **MibIfTable2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIfTable2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(table))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIpForwardEntry2.Addr(), uintptr(unsafe.Pointer(row))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIpForwardTable2.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetIpInterfaceEntry(row *MibIpInterfaceRow) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIpInterfaceEntry.Addr(), uintptr(unsafe.Pointer(row))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetIpInterfaceTable(family uint16, table **MibIpInterfaceTable) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIpInterfaceTable.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } func GetUnicastIpAddressTable(family uint16, table **MibUnicastIpAddressTable) (errcode error) { r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressTable.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } @@ -1743,8 +1743,8 @@ func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsa _p0 = 1 } r0, _, _ := syscall.SyscallN(procNotifyIpInterfaceChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } @@ -1755,8 +1755,8 @@ func NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Po _p0 = 1 } r0, _, _ := syscall.SyscallN(procNotifyRouteChange2.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } @@ -1767,8 +1767,8 @@ func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext _p0 = 1 } r0, _, _ := syscall.SyscallN(procNotifyUnicastIpAddressChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) - if r0 != 0 { - errcode = syscall.Errno(r0) + if uint32(r0) != 0 { + errcode = syscall.Errno(uint32(r0)) } return } @@ -1784,7 +1784,7 @@ func AddDllDirectory(path *uint16) (cookie uintptr, err error) { func AssignProcessToJobObject(job Handle, process Handle) (err error) { r1, _, e1 := syscall.SyscallN(procAssignProcessToJobObject.Addr(), uintptr(job), uintptr(process)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1792,7 +1792,7 @@ func AssignProcessToJobObject(job Handle, process Handle) (err error) { func CancelIo(s Handle) (err error) { r1, _, e1 := syscall.SyscallN(procCancelIo.Addr(), uintptr(s)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1800,7 +1800,7 @@ func CancelIo(s Handle) (err error) { func CancelIoEx(s Handle, o *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(s), uintptr(unsafe.Pointer(o))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1808,7 +1808,7 @@ func CancelIoEx(s Handle, o *Overlapped) (err error) { func ClearCommBreak(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procClearCommBreak.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1816,7 +1816,7 @@ func ClearCommBreak(handle Handle) (err error) { func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) { r1, _, e1 := syscall.SyscallN(procClearCommError.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1824,7 +1824,7 @@ func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error func CloseHandle(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procCloseHandle.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1837,7 +1837,7 @@ func ClosePseudoConsole(console Handle) { func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(overlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1845,7 +1845,7 @@ func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { r1, _, e1 := syscall.SyscallN(procCreateDirectoryW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1946,7 +1946,7 @@ func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances u func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCreatePipe.Addr(), uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1958,7 +1958,7 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA _p0 = 1 } r1, _, e1 := syscall.SyscallN(procCreateProcessW.Addr(), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1966,8 +1966,8 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pconsole *Handle) (hr error) { r0, _, _ := syscall.SyscallN(procCreatePseudoConsole.Addr(), uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole))) - if r0 != 0 { - hr = syscall.Errno(r0) + if uint32(r0) != 0 { + hr = syscall.Errno(uint32(r0)) } return } @@ -1991,7 +1991,7 @@ func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, er func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procDefineDosDeviceW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -1999,7 +1999,7 @@ func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err func DeleteFile(path *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procDeleteFileW.Addr(), uintptr(unsafe.Pointer(path))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2012,7 +2012,7 @@ func deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) { func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procDeleteVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2020,7 +2020,7 @@ func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procDeviceIoControl.Addr(), uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2028,7 +2028,7 @@ func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBuff func DisconnectNamedPipe(pipe Handle) (err error) { r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2040,7 +2040,7 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP _p0 = 1 } r1, _, e1 := syscall.SyscallN(procDuplicateHandle.Addr(), uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2048,7 +2048,7 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEscapeCommFunction.Addr(), uintptr(handle), uintptr(dwFunc)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2070,7 +2070,7 @@ func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, func FindClose(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindClose.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2078,7 +2078,7 @@ func FindClose(handle Handle) (err error) { func FindCloseChangeNotification(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindCloseChangeNotification.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2135,7 +2135,7 @@ func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, er func FindNextChangeNotification(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindNextChangeNotification.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2143,7 +2143,7 @@ func FindNextChangeNotification(handle Handle) (err error) { func findNextFile1(handle Handle, data *win32finddata1) (err error) { r1, _, e1 := syscall.SyscallN(procFindNextFileW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2151,7 +2151,7 @@ func findNextFile1(handle Handle, data *win32finddata1) (err error) { func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) { r1, _, e1 := syscall.SyscallN(procFindNextVolumeMountPointW.Addr(), uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2159,7 +2159,7 @@ func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uin func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) (err error) { r1, _, e1 := syscall.SyscallN(procFindNextVolumeW.Addr(), uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2176,7 +2176,7 @@ func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, func FindVolumeClose(findVolume Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindVolumeClose.Addr(), uintptr(findVolume)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2184,7 +2184,7 @@ func FindVolumeClose(findVolume Handle) (err error) { func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindVolumeMountPointClose.Addr(), uintptr(findVolumeMountPoint)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2192,7 +2192,7 @@ func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) { func FlushConsoleInputBuffer(console Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFlushConsoleInputBuffer.Addr(), uintptr(console)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2200,7 +2200,7 @@ func FlushConsoleInputBuffer(console Handle) (err error) { func FlushFileBuffers(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFlushFileBuffers.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2208,7 +2208,7 @@ func FlushFileBuffers(handle Handle) (err error) { func FlushViewOfFile(addr uintptr, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procFlushViewOfFile.Addr(), uintptr(addr), uintptr(length)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2229,7 +2229,7 @@ func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, bu func FreeEnvironmentStrings(envs *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procFreeEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(envs))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2237,7 +2237,7 @@ func FreeEnvironmentStrings(envs *uint16) (err error) { func FreeLibrary(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFreeLibrary.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2245,7 +2245,7 @@ func FreeLibrary(handle Handle) (err error) { func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGenerateConsoleCtrlEvent.Addr(), uintptr(ctrlEvent), uintptr(processGroupID)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2265,7 +2265,7 @@ func GetActiveProcessorCount(groupNumber uint16) (ret uint32) { func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetCommModemStatus.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpModemStat))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2273,7 +2273,7 @@ func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { func GetCommState(handle Handle, lpDCB *DCB) (err error) { r1, _, e1 := syscall.SyscallN(procGetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2281,7 +2281,7 @@ func GetCommState(handle Handle, lpDCB *DCB) (err error) { func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { r1, _, e1 := syscall.SyscallN(procGetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2295,7 +2295,7 @@ func GetCommandLine() (cmd *uint16) { func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetComputerNameExW.Addr(), uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2303,7 +2303,7 @@ func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { func GetComputerName(buf *uint16, n *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetComputerNameW.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2320,7 +2320,7 @@ func GetConsoleCP() (cp uint32, err error) { func GetConsoleMode(console Handle, mode *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetConsoleMode.Addr(), uintptr(console), uintptr(unsafe.Pointer(mode))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2337,7 +2337,7 @@ func GetConsoleOutputCP() (cp uint32, err error) { func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) { r1, _, e1 := syscall.SyscallN(procGetConsoleScreenBufferInfo.Addr(), uintptr(console), uintptr(unsafe.Pointer(info))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2366,7 +2366,7 @@ func GetCurrentThreadId() (id uint32) { func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint64, totalNumberOfBytes *uint64, totalNumberOfFreeBytes *uint64) (err error) { r1, _, e1 := syscall.SyscallN(procGetDiskFreeSpaceExW.Addr(), uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2398,7 +2398,7 @@ func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32 func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetExitCodeProcess.Addr(), uintptr(handle), uintptr(unsafe.Pointer(exitcode))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2406,7 +2406,7 @@ func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileAttributesExW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2423,7 +2423,7 @@ func GetFileAttributes(name *uint16) (attrs uint32, err error) { func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandle.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2431,7 +2431,7 @@ func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (e func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandleEx.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2439,7 +2439,7 @@ func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2480,8 +2480,8 @@ func GetLargePageMinimum() (size uintptr) { func GetLastError() (lasterr error) { r0, _, _ := syscall.SyscallN(procGetLastError.Addr()) - if r0 != 0 { - lasterr = syscall.Errno(r0) + if uint32(r0) != 0 { + lasterr = syscall.Errno(uint32(r0)) } return } @@ -2530,7 +2530,7 @@ func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error) { r1, _, e1 := syscall.SyscallN(procGetModuleHandleExW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2538,7 +2538,7 @@ func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err er func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeClientProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2546,7 +2546,7 @@ func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err erro func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2554,7 +2554,7 @@ func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, m func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2562,7 +2562,7 @@ func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint3 func GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeServerProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2570,7 +2570,7 @@ func GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err erro func GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNumberOfConsoleInputEvents.Addr(), uintptr(console), uintptr(unsafe.Pointer(numevents))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2582,7 +2582,7 @@ func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wa _p0 = 1 } r1, _, e1 := syscall.SyscallN(procGetOverlappedResult.Addr(), uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2626,7 +2626,7 @@ func GetProcessId(process Handle) (id uint32, err error) { func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetProcessPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2634,7 +2634,7 @@ func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uin func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetProcessShutdownParameters.Addr(), uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2642,7 +2642,7 @@ func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) { func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) { r1, _, e1 := syscall.SyscallN(procGetProcessTimes.Addr(), uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2655,7 +2655,7 @@ func GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintpt func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2695,7 +2695,7 @@ func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetSystemPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2731,7 +2731,7 @@ func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetThreadPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2754,7 +2754,7 @@ func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) { func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetUserPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2771,7 +2771,7 @@ func GetVersion() (ver uint32, err error) { func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumeInformationByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2779,7 +2779,7 @@ func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeN func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumeInformationW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2787,7 +2787,7 @@ func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volume func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumeNameForVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2795,7 +2795,7 @@ func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumePathNameW.Addr(), uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2803,7 +2803,7 @@ func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength ui func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16, bufferLength uint32, returnLength *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumePathNamesForVolumeNameW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2820,7 +2820,7 @@ func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procInitializeProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2828,7 +2828,7 @@ func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrco func IsProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) { r0, _, _ := syscall.SyscallN(procIsProcessorFeaturePresent.Addr(), uintptr(ProcessorFeature)) - ret = r0 != 0 + ret = uint32(r0) != 0 return } @@ -2839,7 +2839,7 @@ func IsWow64Process(handle Handle, isWow64 *bool) (err error) { } r1, _, e1 := syscall.SyscallN(procIsWow64Process.Addr(), uintptr(handle), uintptr(unsafe.Pointer(&_p0))) *isWow64 = _p0 != 0 - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2851,7 +2851,7 @@ func IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint1 return } r1, _, e1 := syscall.SyscallN(procIsWow64Process2.Addr(), uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2922,7 +2922,7 @@ func LocalFree(hmem Handle) (handle Handle, err error) { func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procLockFileEx.Addr(), uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2948,7 +2948,7 @@ func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow ui func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procModule32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2956,7 +2956,7 @@ func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procModule32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2964,7 +2964,7 @@ func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procMoveFileExW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -2972,7 +2972,7 @@ func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { func MoveFile(from *uint16, to *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procMoveFileW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3041,7 +3041,7 @@ func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (hand func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procPostQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3049,7 +3049,7 @@ func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overla func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procProcess32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3057,7 +3057,7 @@ func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procProcess32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3065,7 +3065,7 @@ func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procProcessIdToSessionId.Addr(), uintptr(pid), uintptr(unsafe.Pointer(sessionid))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3073,7 +3073,7 @@ func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) { func PulseEvent(event Handle) (err error) { r1, _, e1 := syscall.SyscallN(procPulseEvent.Addr(), uintptr(event)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3081,7 +3081,7 @@ func PulseEvent(event Handle) (err error) { func PurgeComm(handle Handle, dwFlags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procPurgeComm.Addr(), uintptr(handle), uintptr(dwFlags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3098,7 +3098,7 @@ func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint3 func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryFullProcessImageNameW.Addr(), uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3106,7 +3106,7 @@ func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3114,7 +3114,7 @@ func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobO func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) { r1, _, e1 := syscall.SyscallN(procReadConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3126,7 +3126,7 @@ func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree _p0 = 1 } r1, _, e1 := syscall.SyscallN(procReadDirectoryChangesW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3138,7 +3138,7 @@ func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) ( _p0 = &buf[0] } r1, _, e1 := syscall.SyscallN(procReadFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3146,7 +3146,7 @@ func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) ( func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesRead *uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procReadProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3154,7 +3154,7 @@ func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size u func ReleaseMutex(mutex Handle) (err error) { r1, _, e1 := syscall.SyscallN(procReleaseMutex.Addr(), uintptr(mutex)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3162,7 +3162,7 @@ func ReleaseMutex(mutex Handle) (err error) { func RemoveDirectory(path *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procRemoveDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3170,7 +3170,7 @@ func RemoveDirectory(path *uint16) (err error) { func RemoveDllDirectory(cookie uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procRemoveDllDirectory.Addr(), uintptr(cookie)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3178,7 +3178,7 @@ func RemoveDllDirectory(cookie uintptr) (err error) { func ResetEvent(event Handle) (err error) { r1, _, e1 := syscall.SyscallN(procResetEvent.Addr(), uintptr(event)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3186,8 +3186,8 @@ func ResetEvent(event Handle) (err error) { func resizePseudoConsole(pconsole Handle, size uint32) (hr error) { r0, _, _ := syscall.SyscallN(procResizePseudoConsole.Addr(), uintptr(pconsole), uintptr(size)) - if r0 != 0 { - hr = syscall.Errno(r0) + if uint32(r0) != 0 { + hr = syscall.Errno(uint32(r0)) } return } @@ -3203,7 +3203,7 @@ func ResumeThread(thread Handle) (ret uint32, err error) { func SetCommBreak(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procSetCommBreak.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3211,7 +3211,7 @@ func SetCommBreak(handle Handle) (err error) { func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetCommMask.Addr(), uintptr(handle), uintptr(dwEvtMask)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3219,7 +3219,7 @@ func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { func SetCommState(handle Handle, lpDCB *DCB) (err error) { r1, _, e1 := syscall.SyscallN(procSetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3227,7 +3227,7 @@ func SetCommState(handle Handle, lpDCB *DCB) (err error) { func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { r1, _, e1 := syscall.SyscallN(procSetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3235,7 +3235,7 @@ func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { func SetConsoleCP(cp uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetConsoleCP.Addr(), uintptr(cp)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3243,7 +3243,7 @@ func SetConsoleCP(cp uint32) (err error) { func setConsoleCursorPosition(console Handle, position uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetConsoleCursorPosition.Addr(), uintptr(console), uintptr(position)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3251,7 +3251,7 @@ func setConsoleCursorPosition(console Handle, position uint32) (err error) { func SetConsoleMode(console Handle, mode uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetConsoleMode.Addr(), uintptr(console), uintptr(mode)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3259,7 +3259,7 @@ func SetConsoleMode(console Handle, mode uint32) (err error) { func SetConsoleOutputCP(cp uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetConsoleOutputCP.Addr(), uintptr(cp)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3267,7 +3267,7 @@ func SetConsoleOutputCP(cp uint32) (err error) { func SetCurrentDirectory(path *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetCurrentDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3275,7 +3275,7 @@ func SetCurrentDirectory(path *uint16) (err error) { func SetDefaultDllDirectories(directoryFlags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetDefaultDllDirectories.Addr(), uintptr(directoryFlags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3292,7 +3292,7 @@ func SetDllDirectory(path string) (err error) { func _SetDllDirectory(path *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetDllDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3300,7 +3300,7 @@ func _SetDllDirectory(path *uint16) (err error) { func SetEndOfFile(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procSetEndOfFile.Addr(), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3308,7 +3308,7 @@ func SetEndOfFile(handle Handle) (err error) { func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3322,7 +3322,7 @@ func SetErrorMode(mode uint32) (ret uint32) { func SetEvent(event Handle) (err error) { r1, _, e1 := syscall.SyscallN(procSetEvent.Addr(), uintptr(event)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3330,7 +3330,7 @@ func SetEvent(event Handle) (err error) { func SetFileAttributes(name *uint16, attrs uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(attrs)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3338,7 +3338,7 @@ func SetFileAttributes(name *uint16, attrs uint32) (err error) { func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(handle), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3346,7 +3346,7 @@ func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inBufferLen uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileInformationByHandle.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3363,7 +3363,7 @@ func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3371,7 +3371,7 @@ func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim func SetFileValidData(handle Handle, validDataLength int64) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileValidData.Addr(), uintptr(handle), uintptr(validDataLength)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3379,7 +3379,7 @@ func SetFileValidData(handle Handle, validDataLength int64) (err error) { func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetHandleInformation.Addr(), uintptr(handle), uintptr(mask), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3396,7 +3396,7 @@ func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobOb func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetNamedPipeHandleState.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3404,7 +3404,7 @@ func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uin func SetPriorityClass(process Handle, priorityClass uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetPriorityClass.Addr(), uintptr(process), uintptr(priorityClass)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3416,7 +3416,7 @@ func SetProcessPriorityBoost(process Handle, disable bool) (err error) { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procSetProcessPriorityBoost.Addr(), uintptr(process), uintptr(_p0)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3424,7 +3424,7 @@ func SetProcessPriorityBoost(process Handle, disable bool) (err error) { func SetProcessShutdownParameters(level uint32, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetProcessShutdownParameters.Addr(), uintptr(level), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3432,7 +3432,7 @@ func SetProcessShutdownParameters(level uint32, flags uint32) (err error) { func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3440,7 +3440,7 @@ func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr func SetStdHandle(stdhandle uint32, handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procSetStdHandle.Addr(), uintptr(stdhandle), uintptr(handle)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3448,7 +3448,7 @@ func SetStdHandle(stdhandle uint32, handle Handle) (err error) { func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetVolumeLabelW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3456,7 +3456,7 @@ func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) { func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3464,7 +3464,7 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupComm.Addr(), uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3491,7 +3491,7 @@ func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { func TerminateJobObject(job Handle, exitCode uint32) (err error) { r1, _, e1 := syscall.SyscallN(procTerminateJobObject.Addr(), uintptr(job), uintptr(exitCode)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3499,7 +3499,7 @@ func TerminateJobObject(job Handle, exitCode uint32) (err error) { func TerminateProcess(handle Handle, exitcode uint32) (err error) { r1, _, e1 := syscall.SyscallN(procTerminateProcess.Addr(), uintptr(handle), uintptr(exitcode)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3507,7 +3507,7 @@ func TerminateProcess(handle Handle, exitcode uint32) (err error) { func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procThread32First.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3515,7 +3515,7 @@ func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procThread32Next.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3523,7 +3523,7 @@ func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procUnlockFileEx.Addr(), uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3531,7 +3531,7 @@ func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint3 func UnmapViewOfFile(addr uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procUnmapViewOfFile.Addr(), uintptr(addr)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3539,7 +3539,7 @@ func UnmapViewOfFile(addr uintptr) (err error) { func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procUpdateProcThreadAttribute.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3556,7 +3556,7 @@ func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint3 func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualFree.Addr(), uintptr(address), uintptr(size), uintptr(freetype)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3564,7 +3564,7 @@ func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) { func VirtualLock(addr uintptr, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualLock.Addr(), uintptr(addr), uintptr(length)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3572,7 +3572,7 @@ func VirtualLock(addr uintptr, length uintptr) (err error) { func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualProtect.Addr(), uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3580,7 +3580,7 @@ func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect uint32, oldProtect *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualProtectEx.Addr(), uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3588,7 +3588,7 @@ func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualQuery.Addr(), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3596,7 +3596,7 @@ func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintpt func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualQueryEx.Addr(), uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3604,7 +3604,7 @@ func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformat func VirtualUnlock(addr uintptr, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualUnlock.Addr(), uintptr(addr), uintptr(length)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3618,7 +3618,7 @@ func WTSGetActiveConsoleSessionId() (sessionID uint32) { func WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procWaitCommEvent.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3648,7 +3648,7 @@ func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) { r1, _, e1 := syscall.SyscallN(procWriteConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3660,7 +3660,7 @@ func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) _p0 = &buf[0] } r1, _, e1 := syscall.SyscallN(procWriteFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3668,7 +3668,7 @@ func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesWritten *uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procWriteProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3676,7 +3676,7 @@ func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procAcceptEx.Addr(), uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3689,7 +3689,7 @@ func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procTransmitFile.Addr(), uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3697,48 +3697,48 @@ func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint func NetApiBufferFree(buf *byte) (neterr error) { r0, _, _ := syscall.SyscallN(procNetApiBufferFree.Addr(), uintptr(unsafe.Pointer(buf))) - if r0 != 0 { - neterr = syscall.Errno(r0) + if uint32(r0) != 0 { + neterr = syscall.Errno(uint32(r0)) } return } func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) { r0, _, _ := syscall.SyscallN(procNetGetJoinInformation.Addr(), uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType))) - if r0 != 0 { - neterr = syscall.Errno(r0) + if uint32(r0) != 0 { + neterr = syscall.Errno(uint32(r0)) } return } func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { r0, _, _ := syscall.SyscallN(procNetUserEnum.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle))) - if r0 != 0 { - neterr = syscall.Errno(r0) + if uint32(r0) != 0 { + neterr = syscall.Errno(uint32(r0)) } return } func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { r0, _, _ := syscall.SyscallN(procNetUserGetInfo.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf))) - if r0 != 0 { - neterr = syscall.Errno(r0) + if uint32(r0) != 0 { + neterr = syscall.Errno(uint32(r0)) } return } func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtCreateFile.Addr(), uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength)) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout))) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } @@ -3753,100 +3753,100 @@ func NtQueryEaFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBuf _p1 = 1 } r0, _, _ := syscall.SyscallN(procNtQueryEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), uintptr(_p0), uintptr(unsafe.Pointer(eaList)), uintptr(eaListLen), uintptr(unsafe.Pointer(eaIndex)), uintptr(_p1)) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func NtQueryInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, class uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtQueryInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), uintptr(class)) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtQueryInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen))) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtQuerySystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen))) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func NtSetEaFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen)) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class)) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen)) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetSystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen)) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) { r0, _, _ := syscall.SyscallN(procRtlAddFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress)) - ret = r0 != 0 + ret = uint32(r0) != 0 return } func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(acl))) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) { r0, _, _ := syscall.SyscallN(procRtlDeleteFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable))) - ret = r0 != 0 + ret = uint32(r0) != 0 return } func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { r0, _, _ := syscall.SyscallN(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } @@ -3864,8 +3864,8 @@ func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNum func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) { r0, _, _ := syscall.SyscallN(procRtlGetVersion.Addr(), uintptr(unsafe.Pointer(info))) - if r0 != 0 { - ntstatus = NTStatus(r0) + if uint32(r0) != 0 { + ntstatus = NTStatus(uint32(r0)) } return } @@ -3888,32 +3888,32 @@ func rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) { func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { r0, _, _ := syscall.SyscallN(procCLSIDFromString.Addr(), uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func coCreateGuid(pguid *GUID) (ret error) { r0, _, _ := syscall.SyscallN(procCoCreateGuid.Addr(), uintptr(unsafe.Pointer(pguid))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) { r0, _, _ := syscall.SyscallN(procCoGetObject.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { r0, _, _ := syscall.SyscallN(procCoInitializeEx.Addr(), uintptr(reserved), uintptr(coInit)) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } @@ -3936,7 +3936,7 @@ func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) { func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEnumProcessModules.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3944,7 +3944,7 @@ func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uin func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEnumProcessModulesEx.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3952,7 +3952,7 @@ func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *u func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEnumProcesses.Addr(), uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3960,7 +3960,7 @@ func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetModuleBaseNameW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3968,7 +3968,7 @@ func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uin func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetModuleFileNameExW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3976,7 +3976,7 @@ func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size u func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetModuleInformation.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3984,7 +3984,7 @@ func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb func QueryWorkingSetEx(process Handle, pv uintptr, cb uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryWorkingSetEx.Addr(), uintptr(process), uintptr(pv), uintptr(cb)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -3996,8 +3996,8 @@ func SubscribeServiceChangeNotifications(service Handle, eventType uint32, callb return } r0, _, _ := syscall.SyscallN(procSubscribeServiceChangeNotifications.Addr(), uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } @@ -4029,7 +4029,7 @@ func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiBuildDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4037,7 +4037,7 @@ func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiCallClassInstaller.Addr(), uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4045,7 +4045,7 @@ func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInf func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiCancelDriverInfoSearch.Addr(), uintptr(deviceInfoSet)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4053,7 +4053,7 @@ func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) { func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGuidListSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiClassGuidsFromNameExW.Addr(), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4061,7 +4061,7 @@ func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGu func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiClassNameFromGuidExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4078,7 +4078,7 @@ func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineN func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUID *GUID, DeviceDescription *uint16, hwndParent uintptr, CreationFlags DICD, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4086,7 +4086,7 @@ func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUI func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDeviceInfoList.Addr(), uintptr(deviceInfoSet)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4094,7 +4094,7 @@ func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) { func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4102,7 +4102,7 @@ func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfo func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiEnumDeviceInfo.Addr(), uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4110,7 +4110,7 @@ func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfo func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT, memberIndex uint32, driverInfoData *DrvInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiEnumDriverInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4127,7 +4127,7 @@ func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintp func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4135,7 +4135,7 @@ func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfo func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *DevInfoListDetailData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInfoListDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4143,7 +4143,7 @@ func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailDa func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4151,7 +4151,7 @@ func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInf func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, instanceId *uint16, instanceIdSize uint32, instanceIdRequiredSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstanceIdW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4159,7 +4159,7 @@ func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DEVPROPKEY, propertyType *DEVPROPTYPE, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDevicePropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4167,7 +4167,7 @@ func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyRegDataType *uint32, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4175,7 +4175,7 @@ func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData, driverInfoDetailData *DrvInfoDetailData, driverInfoDetailDataSize uint32, requiredSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDriverInfoDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4183,7 +4183,7 @@ func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4191,7 +4191,7 @@ func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4208,7 +4208,7 @@ func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Sc func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4216,7 +4216,7 @@ func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfo func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4224,7 +4224,7 @@ func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInf func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyBuffer *byte, propertyBufferSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4232,7 +4232,7 @@ func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4240,7 +4240,7 @@ func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4248,7 +4248,7 @@ func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procSetupUninstallOEMInfW.Addr(), uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4265,8 +4265,8 @@ func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) { func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) { r0, _, _ := syscall.SyscallN(procSHGetKnownFolderPath.Addr(), uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } @@ -4286,7 +4286,7 @@ func EnumChildWindows(hwnd HWND, enumFunc uintptr, param unsafe.Pointer) { func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) { r1, _, e1 := syscall.SyscallN(procEnumWindows.Addr(), uintptr(enumFunc), uintptr(param)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4294,7 +4294,7 @@ func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) { func ExitWindowsEx(flags uint32, reason uint32) (err error) { r1, _, e1 := syscall.SyscallN(procExitWindowsEx.Addr(), uintptr(flags), uintptr(reason)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4323,7 +4323,7 @@ func GetForegroundWindow() (hwnd HWND) { func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { r1, _, e1 := syscall.SyscallN(procGetGUIThreadInfo.Addr(), uintptr(thread), uintptr(unsafe.Pointer(info))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4352,19 +4352,19 @@ func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) { func IsWindow(hwnd HWND) (isWindow bool) { r0, _, _ := syscall.SyscallN(procIsWindow.Addr(), uintptr(hwnd)) - isWindow = r0 != 0 + isWindow = uint32(r0) != 0 return } func IsWindowUnicode(hwnd HWND) (isUnicode bool) { r0, _, _ := syscall.SyscallN(procIsWindowUnicode.Addr(), uintptr(hwnd)) - isUnicode = r0 != 0 + isUnicode = uint32(r0) != 0 return } func IsWindowVisible(hwnd HWND) (isVisible bool) { r0, _, _ := syscall.SyscallN(procIsWindowVisible.Addr(), uintptr(hwnd)) - isVisible = r0 != 0 + isVisible = uint32(r0) != 0 return } @@ -4394,7 +4394,7 @@ func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, func UnloadKeyboardLayout(hkl Handle) (err error) { r1, _, e1 := syscall.SyscallN(procUnloadKeyboardLayout.Addr(), uintptr(hkl)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4406,7 +4406,7 @@ func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) ( _p0 = 1 } r1, _, e1 := syscall.SyscallN(procCreateEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4414,7 +4414,7 @@ func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) ( func DestroyEnvironmentBlock(block *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procDestroyEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4422,7 +4422,7 @@ func DestroyEnvironmentBlock(block *uint16) (err error) { func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetUserProfileDirectoryW.Addr(), uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4457,7 +4457,7 @@ func GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer u func _GetFileVersionInfo(filename *uint16, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileVersionInfoW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer)) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4474,7 +4474,7 @@ func VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procVerQueryValueW.Addr(), uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4498,8 +4498,8 @@ func TimeEndPeriod(period uint32) (err error) { func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) { r0, _, _ := syscall.SyscallN(procWinVerifyTrustEx.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data))) - if r0 != 0 { - ret = syscall.Errno(r0) + if uint32(r0) != 0 { + ret = syscall.Errno(uint32(r0)) } return } @@ -4511,8 +4511,8 @@ func FreeAddrInfoW(addrinfo *AddrinfoW) { func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) { r0, _, _ := syscall.SyscallN(procGetAddrInfoW.Addr(), uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result))) - if r0 != 0 { - sockerr = syscall.Errno(r0) + if uint32(r0) != 0 { + sockerr = syscall.Errno(uint32(r0)) } return } @@ -4548,7 +4548,7 @@ func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, f _p0 = 1 } r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4629,8 +4629,8 @@ func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { r0, _, _ := syscall.SyscallN(procWSAStartup.Addr(), uintptr(verreq), uintptr(unsafe.Pointer(data))) - if r0 != 0 { - sockerr = syscall.Errno(r0) + if uint32(r0) != 0 { + sockerr = syscall.Errno(uint32(r0)) } return } @@ -4808,7 +4808,7 @@ func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procWTSEnumerateSessionsW.Addr(), uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return @@ -4821,7 +4821,7 @@ func WTSFreeMemory(ptr uintptr) { func WTSQueryUserToken(session uint32, token *Token) (err error) { r1, _, e1 := syscall.SyscallN(procWTSQueryUserToken.Addr(), uintptr(session), uintptr(unsafe.Pointer(token))) - if r1 == 0 { + if uint32(r1) == 0 { err = errnoErr(e1) } return diff --git a/vendor/golang.org/x/text/language/parse.go b/vendor/golang.org/x/text/language/parse.go index 053336e28..65b53b915 100644 --- a/vendor/golang.org/x/text/language/parse.go +++ b/vendor/golang.org/x/text/language/parse.go @@ -166,7 +166,9 @@ func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) { } }() - if strings.Count(s, "-") > 1000 { + // The BCP 47 scanner aliases '_' to '-' in scanner.init + // (internal/language/parse.go); the guard must count both. + if strings.Count(s, "-")+strings.Count(s, "_") > 1000 { return nil, nil, errTagListTooLarge } diff --git a/vendor/modules.txt b/vendor/modules.txt index df4d99cb9..80259c2e1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -408,7 +408,7 @@ go.yaml.in/yaml/v2 # go.yaml.in/yaml/v3 v3.0.5 ## explicit; go 1.16 go.yaml.in/yaml/v3 -# golang.org/x/crypto v0.58.0 +# golang.org/x/crypto v0.59.0 ## explicit; go 1.26.0 golang.org/x/crypto/blowfish golang.org/x/crypto/chacha20 @@ -443,11 +443,11 @@ golang.org/x/net/websocket ## explicit; go 1.25.0 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sync v0.24.0 +# golang.org/x/sync v0.25.0 ## explicit; go 1.26.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore -# golang.org/x/sys v0.49.0 +# golang.org/x/sys v0.50.0 ## explicit; go 1.26.0 golang.org/x/sys/cpu golang.org/x/sys/execabs @@ -455,10 +455,10 @@ golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.47.0 +# golang.org/x/term v0.48.0 ## explicit; go 1.26.0 golang.org/x/term -# golang.org/x/text v0.43.0 +# golang.org/x/text v0.44.0 ## explicit; go 1.26.0 golang.org/x/text/cases golang.org/x/text/encoding