diff --git a/go.mod b/go.mod index 618f5daf..2867e6ca 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( code.cloudfoundry.org/bbs/models v1.26.0 code.cloudfoundry.org/clock v1.94.0 code.cloudfoundry.org/debugserver v0.122.0 - code.cloudfoundry.org/diego-logging-client v0.131.0 + code.cloudfoundry.org/diego-logging-client v0.133.0 code.cloudfoundry.org/lager/v3 v3.94.0 code.cloudfoundry.org/localip v0.96.0 code.cloudfoundry.org/locket v1.19.0 @@ -25,9 +25,9 @@ require ( code.cloudfoundry.org/bbs/format v1.18.0 // indirect code.cloudfoundry.org/cfhttp/v2 v2.99.0 // indirect code.cloudfoundry.org/durationjson v0.95.0 // indirect - code.cloudfoundry.org/go-diodes v0.0.0-20261019063924-5f5277928191 // indirect + code.cloudfoundry.org/go-diodes v0.0.0-20261109092731-97a033397c51 // indirect code.cloudfoundry.org/go-loggregator/v9 v9.2.1 // indirect - code.cloudfoundry.org/tlsconfig v0.69.0 // indirect + code.cloudfoundry.org/tlsconfig v0.71.0 // indirect filippo.io/edwards25519 v1.2.0 // indirect github.com/Masterminds/semver/v3 v3.5.0 // indirect github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect @@ -36,7 +36,7 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/pprof v0.0.0-20261102214848-0031fcd306b0 // indirect + github.com/google/pprof v0.0.0-20261105003125-4bf881d7fb0b // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect @@ -45,17 +45,17 @@ require ( github.com/square/certstrap v1.4.1 // indirect github.com/tedsuo/rata v1.0.0 // indirect github.com/vito/go-sse v1.1.3 // indirect - go.step.sm/crypto v0.91.0 // indirect + go.step.sm/crypto v0.91.1 // indirect go.yaml.in/yaml/v3 v3.0.6 // indirect golang.org/x/crypto v0.58.0 // indirect - golang.org/x/mod v0.42.0 // indirect + golang.org/x/mod v0.43.0 // indirect golang.org/x/net v0.62.0 // indirect - golang.org/x/sync v0.24.0 // indirect - golang.org/x/sys v0.49.0 // indirect - golang.org/x/text v0.43.0 // indirect + golang.org/x/sync v0.25.0 // indirect + golang.org/x/sys v0.50.0 // indirect + golang.org/x/text v0.44.0 // indirect golang.org/x/tools v0.52.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20261026165753-2ffab32bce7e // indirect - google.golang.org/grpc v1.84.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20261104224025-d1e00e9f33ab // indirect + google.golang.org/grpc v1.85.0 // indirect google.golang.org/protobuf v1.36.12 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect ) diff --git a/go.sum b/go.sum index 82b866d5..f9f63e5e 100644 --- a/go.sum +++ b/go.sum @@ -12,12 +12,12 @@ code.cloudfoundry.org/clock v1.94.0 h1:qHnb1uZvNQHqTDnU1ctErzlITmed871o9mgaAj8Q4 code.cloudfoundry.org/clock v1.94.0/go.mod h1:MAbIIPq9VO3O+EMcv8+CSyvvCBNCLKS5zmLLrF25gfw= code.cloudfoundry.org/debugserver v0.122.0 h1:lyTadQ2mIi/pQDVtfTpc1tX3uJ/pBQ2lzLygxApNisw= code.cloudfoundry.org/debugserver v0.122.0/go.mod h1:otx2R/AqGfMPA5FekNa34zBjOT7GRcn4NAlEJ3IwOTc= -code.cloudfoundry.org/diego-logging-client v0.131.0 h1:QGdhoac0zCCuJFaI7oncFDah8kkT8hs3dynjEp6kXf8= -code.cloudfoundry.org/diego-logging-client v0.131.0/go.mod h1:+32e7u6TB2lgkVKieFsJrp9s/BrAz+FacyQDKBZ2NF8= +code.cloudfoundry.org/diego-logging-client v0.133.0 h1:ixYiH16DK2pAFdEUQUywisVCWveIyUjj0/6EhT5bZPQ= +code.cloudfoundry.org/diego-logging-client v0.133.0/go.mod h1:py4vzmL7SiVMFVWZLfFJkotnK3ID0dtnBwUT421GyaU= code.cloudfoundry.org/durationjson v0.95.0 h1:En9qEM9ujfvJLZ7x24wTN83Xn1Fdc//Y+veqFl0a2eY= code.cloudfoundry.org/durationjson v0.95.0/go.mod h1:0pK3+vIes/AYB4fhFWPPlVBF2zVVrxUEPGpih1jGdP4= -code.cloudfoundry.org/go-diodes v0.0.0-20261019063924-5f5277928191 h1:T6Sp1juzJ1vpnuic4FAE1OVP3wu7fG1QVx4kHSEjKvc= -code.cloudfoundry.org/go-diodes v0.0.0-20261019063924-5f5277928191/go.mod h1:qH2G/RvB2jSKlXO3p5l8T9Qv9EAHnEz6o3rr/XgkE2Y= +code.cloudfoundry.org/go-diodes v0.0.0-20261109092731-97a033397c51 h1:JfVFmefALWMnZouLZ7FSHM2GINvCg4AFDvM6LKkXHps= +code.cloudfoundry.org/go-diodes v0.0.0-20261109092731-97a033397c51/go.mod h1:ER/twtJ+rSjkyCDAA6m+UQzD1oUSAKIYWC6BkbxfgA0= code.cloudfoundry.org/go-loggregator/v9 v9.2.1 h1:S6Lgg5UJbhh2bt2TGQxs6R00CF8PrUA3GFPYDxy56Fk= code.cloudfoundry.org/go-loggregator/v9 v9.2.1/go.mod h1:FTFFruqGeOhVCDFvyLgl8EV8YW63NNwRzLhxJcporu8= code.cloudfoundry.org/lager/v3 v3.94.0 h1:Q98+qcnG/JQjCNmzwjHpt7zB8g7RaMZU2gaQBYyHVv0= @@ -28,8 +28,8 @@ code.cloudfoundry.org/locket v1.19.0 h1:VTsQ3IYIyYhLUt5z0Zma/CQWv1d1HRHU9xu+w+9+ code.cloudfoundry.org/locket v1.19.0/go.mod h1:fDZFtm/h69HRk1zzWC7pCVqLmPrEDVzPWiFSYoXvOos= code.cloudfoundry.org/runtimeschema v0.0.0-20240514235758-31be7684c5bf h1:sTpfHaU+tgDeRO/fRnyr91gvf1FaJk3ZNiJHiHq4nko= code.cloudfoundry.org/runtimeschema v0.0.0-20240514235758-31be7684c5bf/go.mod h1:Cbw66uMLAXkeK8ZpcTUIJ9nhXNxaN742q1xS/ONrWiQ= -code.cloudfoundry.org/tlsconfig v0.69.0 h1:bvlvdU2BKiSEcgeiv0Csomzmq7Gn8vGU4yeNXy5FN2M= -code.cloudfoundry.org/tlsconfig v0.69.0/go.mod h1:gKv5uSKC6EUgBllA7qDmXPYRz8sJaV3BWpCMsg24R8I= +code.cloudfoundry.org/tlsconfig v0.71.0 h1:C13M8uCj2WyhxD1LA/QqL9m2yvog/fQ9OPUCFsBi/0s= +code.cloudfoundry.org/tlsconfig v0.71.0/go.mod h1:MDWwozKCN5+p/Vn2ShDcnNdNaQvUYjTMNk+HjFe9mKE= code.cloudfoundry.org/workpool v0.0.0-20250911194158-1489753f182e h1:NsULHptleEmqtoC8j6A8J636L9APnGn8YC0c7vocLww= code.cloudfoundry.org/workpool v0.0.0-20250911194158-1489753f182e/go.mod h1:O9HdfntfyDvYRH9nh03XdpnGMbjyZVi8nb2Kh+6hDho= filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= @@ -66,8 +66,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20261102214848-0031fcd306b0 h1:86rNkgYeJezkpuaJQidi1uAb467frc71yU2PIRDf2FA= -github.com/google/pprof v0.0.0-20261102214848-0031fcd306b0/go.mod h1:yUo1AMMpsPIDFGuwDK8nLcf8+vvAd5l2O6JDZ6hpwrM= +github.com/google/pprof v0.0.0-20261105003125-4bf881d7fb0b h1:5NKFt6kcAJNVt3XBOf8jwp8TnWZVOZFmmGkK0XextI4= +github.com/google/pprof v0.0.0-20261105003125-4bf881d7fb0b/go.mod h1:yUo1AMMpsPIDFGuwDK8nLcf8+vvAd5l2O6JDZ6hpwrM= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE= @@ -122,8 +122,8 @@ github.com/vito/go-sse v1.1.3 h1:tZOiC+xKmuRPoySTupO6liK7ciSX0B2NKXha5hEtUAE= github.com/vito/go-sse v1.1.3/go.mod h1:kMjgO+XCwBS0se2X/aS5T4aLBvHWAKOUqZOqXKdyrAg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.step.sm/crypto v0.91.0 h1:0mN0DwVOvUuh7VbyTnxABZuAkxwak/Grp8Y/b4YaZDU= -go.step.sm/crypto v0.91.0/go.mod h1:NxxObRBymdbyXLoTCW5Ea6sLxuy5yI/xr9+hSBlbU/Q= +go.step.sm/crypto v0.91.1 h1:ZMMdj/A2rQ+Zr8hyCo4BHJd++c5T8VQIXJ8Sljg57p0= +go.step.sm/crypto v0.91.1/go.mod h1:Sin2AcA+BgYfx1Ulku2Rt0NwS1ky22joBoETFTG1fD4= go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM= go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -133,8 +133,8 @@ 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/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.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= -golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= +golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg= +golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY= 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= @@ -144,19 +144,19 @@ golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= 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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.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/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/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= @@ -169,10 +169,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20261026165753-2ffab32bce7e h1:w3fy/G8OrJHYexn+u5y7hFyc8YRRIr7DCevtIOwAcGY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20261026165753-2ffab32bce7e/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= -google.golang.org/grpc v1.84.0 h1:soMyaPJ8pAak5PIQ0DGBUir0XRo2fRoMqhNWMLlLxO0= -google.golang.org/grpc v1.84.0/go.mod h1:ljCht0DrxQrXBDRTZp52Qxh3Ffk8CdYm2sj4O2QN2C0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20261104224025-d1e00e9f33ab h1:8sYjjefPfQ+FZEh1ZwBAqK/NifJVhOxut8nRh3SJzZM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20261104224025-d1e00e9f33ab/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw= +google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ= google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/vendor/github.com/google/pprof/profile/encode.go b/vendor/github.com/google/pprof/profile/encode.go index 8ce9d3cf..3af74d44 100644 --- a/vendor/github.com/google/pprof/profile/encode.go +++ b/vendor/github.com/google/pprof/profile/encode.go @@ -321,9 +321,29 @@ func (p *Profile) postDecode() error { for _, s := range p.Sample { if len(s.labelX) > 0 { - labels := make(map[string][]string, len(s.labelX)) - numLabels := make(map[string][]int64, len(s.labelX)) - numUnits := make(map[string][]string, len(s.labelX)) + var numStr, numNum, numUnit int + for _, l := range s.labelX { + if l.strX != 0 { + numStr++ + } else if l.numX != 0 || l.unitX != 0 { + numNum++ + if l.unitX != 0 { + numUnit++ + } + } + } + var labels map[string][]string + if numStr > 0 { + labels = make(map[string][]string, numStr) + } + var numLabels map[string][]int64 + if numNum > 0 { + numLabels = make(map[string][]int64, numNum) + } + var numUnits map[string][]string + if numUnit > 0 { + numUnits = make(map[string][]string, numUnit) + } for _, l := range s.labelX { var key, value string key, err = getString(p.stringTable, &l.keyX, err) @@ -332,10 +352,10 @@ func (p *Profile) postDecode() error { labels[key] = append(labels[key], value) } else if l.numX != 0 || l.unitX != 0 { numValues := numLabels[key] - units := numUnits[key] if l.unitX != 0 { var unit string unit, err = getString(p.stringTable, &l.unitX, err) + units := numUnits[key] units = padStringArray(units, len(numValues)) numUnits[key] = append(units, unit) } @@ -347,14 +367,17 @@ func (p *Profile) postDecode() error { } if len(numLabels) > 0 { s.NumLabel = numLabels - for key, units := range numUnits { - if len(units) > 0 { - numUnits[key] = padStringArray(units, len(numLabels[key])) + if len(numUnits) > 0 { + for key, units := range numUnits { + if len(units) > 0 { + numUnits[key] = padStringArray(units, len(numLabels[key])) + } } + s.NumUnit = numUnits } - s.NumUnit = numUnits } } + s.labelX = nil s.Location = locBuffer[:len(s.locationIDX)] locBuffer = locBuffer[len(s.locationIDX):] diff --git a/vendor/go.step.sm/crypto/x25519/x25519.go b/vendor/go.step.sm/crypto/x25519/x25519.go index c6d239bf..01e7e40c 100644 --- a/vendor/go.step.sm/crypto/x25519/x25519.go +++ b/vendor/go.step.sm/crypto/x25519/x25519.go @@ -114,9 +114,9 @@ func (p PrivateKey) SharedKey(peerPublicKey []byte) ([]byte, error) { // XEdDSA performs two passes over messages to be signed and therefore cannot // handle pre-hashed messages. Thus opts.HashFunc() must return zero to indicate // the message hasn't been hashed. This can be achieved by passing -// crypto.Hash(0) as the value for opts. +// crypto.Hash(0) or nil as the value for opts. func (p PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) { - if opts.HashFunc() != crypto.Hash(0) { + if opts != nil && opts.HashFunc() != crypto.Hash(0) { return nil, errors.New("x25519: cannot sign hashed message") } 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 00000000..2d093dd7 --- /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 48eccc4c..af38b797 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 6411a7a7..949b8f48 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 2e1f4c3e..daa85713 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 1ebf1178..182181ec 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 5589d4f6..b1d769a3 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 5f63147e..b09bd17b 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 3967bca7..6721ca98 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 6dc0920a..1adb6073 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/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index e6966b4c..bf0ae9ca 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 8bce3e2f..b445f07e 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 fdddc0c7..1c2be24d 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 fdddc0c7..1c2be24d 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 192d1930..347ab612 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 053336e2..65b53b91 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/google.golang.org/grpc/CONTRIBUTING.md b/vendor/google.golang.org/grpc/CONTRIBUTING.md index 2079de7b..bd80b1f9 100644 --- a/vendor/google.golang.org/grpc/CONTRIBUTING.md +++ b/vendor/google.golang.org/grpc/CONTRIBUTING.md @@ -23,6 +23,29 @@ wanted"](https://github.com/grpc/grpc-go/issues?q=sort%3Aupdated-desc%20is%3Aiss are especially nice for first-time contributors, as they should be well-defined problems that already have agreed-upon solutions. +## Generative AI Policy + +AI tools have the ability to produce more code than is possible for the gRPC +team to read, understand, review, and accept into the repository. For this +reason, we request that all contributions adhere to the following rules: + +1. **No AI-Generated Interactions:** All communication in the repo must be + authored by a human. _Exception: AIs may be used for directed writing + assistance or translation._ Absolutely no automated agents are allowed to + directly publish to GitHub. + +2. **Author Ownership and Accountability:** Code contributions are expected to + be fully owned and understood by the human contributor. If the code was + produced by generative AI, the author is expected to have reviewed and + understood it in its entirety before submitting it for review. This includes + all content: production code, tests, examples, tools, etc. + +In addition to the above requirements, any AI-assisted contributions must also +comply with the [Linux Foundation Generative AI +Policy](https://www.linuxfoundation.org/legal/generative-ai). This includes +confirming that all contributions are legally allowed to be contributed to the +gRPC project under the applicable license terms. + ## Code Style We follow [Google's published Go style diff --git a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go index 6c249fda..d22d1c3f 100644 --- a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go +++ b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go @@ -18,7 +18,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc v5.27.1 // source: grpc/binlog/v1/binarylog.proto diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go index 2079bf4e..788c89c1 100644 --- a/vendor/google.golang.org/grpc/call.go +++ b/vendor/google.golang.org/grpc/call.go @@ -20,10 +20,6 @@ package grpc import ( "context" - "io" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) // Invoke sends the RPC request on the wire and returns after response is @@ -71,27 +67,8 @@ func invoke(ctx context.Context, method string, req, reply any, cc *ClientConn, if err != nil { return err } - // In case of nil or io.EOF error, call RecvMsg. - if err := cs.SendMsg(req); err != nil && err != io.EOF { - return err - } - // CloseSend is needed because in some scenarios (e.g., xDS), the same - // interceptors are used to process both unary and streaming RPCs. Calling - // CloseSend signals to those interceptors that no more messages are on the - // way. - if err := cs.CloseSend(); err != nil && err != io.EOF { + if err := cs.SendMsg(req); err != nil { return err } - if err := cs.RecvMsg(reply); err != nil { - return err - } - // Call RecvMsg again to get the trailers. - err = cs.RecvMsg(reply) - if err == io.EOF { - return nil - } - if err == nil { - return status.Error(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") - } - return err + return cs.RecvMsg(reply) } diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index f5ce0719..7a25d251 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -553,7 +553,6 @@ func chainStreamClientInterceptors(cc *ClientConn) { if cc.dopts.streamInt != nil { interceptors = append([]StreamClientInterceptor{cc.dopts.streamInt}, interceptors...) } - interceptors = append(interceptors, defaultStreamInterceptor) var chainedInt StreamClientInterceptor if len(interceptors) == 0 { chainedInt = nil @@ -1212,6 +1211,12 @@ func (cc *ClientConn) Close() error { cc.mu.Unlock() cc.resolverWrapper.close() + // Swap in a default ConfigSelector so the resolver-provided one (which may + // transitively retain resolver-owned state such as parsed service configs + // and cluster maps) is released once in-flight RPCs finish selecting on + // it. Done after the resolver has closed so no further UpdateState calls + // race with this swap. + cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil}) // The order of closing matters here since the balancer wrapper assumes the // picker is closed before it is closed. cc.pickerWrapper.close() diff --git a/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go b/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go index 96693289..ca0e586d 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go @@ -395,7 +395,7 @@ func (c *Cancel) toProto() *binlogpb.GrpcLogEntry { // omitted. func metadataKeyOmit(key string) bool { switch key { - case "lb-token", ":path", ":authority", "content-encoding", "content-type", "user-agent", "te": + case "lb-token", ":path", ":authority", "content-encoding", "content-type", "user-agent", "te", "authorization": return true case "grpc-trace-bin": // grpc-trace-bin is special because it's visible to users. return false diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index dc6fc0c4..2f4ae2fa 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -144,14 +144,14 @@ var ( // ControlBufferThrottleLimit is the maximum number of control frames that can // be queued in the control buffer before throttling is applied. The value - // must be between 1 and 10,000, and is set to 100 by default. + // must be between 1 and 100,000, and is set to 10,000 by default. // // This environment variable serves as an escape hatch to increase the // throttling limit if unforeseen issues arise, and it will be removed in a // future release. // - // TODO: Remove this env var once v1.83.0 is released. - ControlBufferThrottleLimit = uint64FromEnv("GRPC_GO_EXPERIMENTAL_CONTROL_BUFFER_THROTTLE_LIMIT", 100, 1, 10000) + // TODO: Remove this env var once v1.86.0 is released. + ControlBufferThrottleLimit = uint64FromEnv("GRPC_GO_EXPERIMENTAL_CONTROL_BUFFER_THROTTLE_LIMIT", 10000, 1, 100000) // ALTSMaxFrameSize is the maximum frame size for ALTS in bytes. // This can be overridden by setting the environment variable diff --git a/vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go b/vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go index 070680ed..4718576e 100644 --- a/vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go +++ b/vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go @@ -47,10 +47,9 @@ const ( var bdpPing = &ping{data: [8]byte{2, 4, 16, 16, 9, 14, 7, 7}} type bdpEstimator struct { + mu sync.Mutex // sentAt is the time when the ping was sent. sentAt time.Time - - mu sync.Mutex // bdp is the current bdp estimate. bdp uint32 // sample is the number of bytes received in one measurement cycle. @@ -75,7 +74,9 @@ func (b *bdpEstimator) timesnap(d [8]byte) { if bdpPing.data != d { return } + b.mu.Lock() b.sentAt = time.Now() + b.mu.Unlock() } // add adds bytes to the current sample for calculating bdp. diff --git a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index 89c938fd..e33ac3a5 100644 --- a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -26,6 +26,7 @@ import ( "runtime" "sync" "sync/atomic" + "time" "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" @@ -97,22 +98,35 @@ func (il *itemList) isEmpty() bool { return il.head == nil } -// maxQueuedControlBufferItems is the maximum number of frames (other than -// HEADERS and DATA) that we will buffer before preventing new reads from -// occurring on the transport. These are control frames sent in response to -// client requests, or frames that result in work being scheduled, such as -// RST_STREAM due to bad headers or settings acks. -var maxQueuedControlBufferItems = int(envconfig.ControlBufferThrottleLimit) +// maxQueuedTransportResponseFrames is the maximum number of "transport +// response" frames that we will buffer before preventing new reads from +// occurring on the transport. See cbItem.isTransportResponseFrame for the +// items that count towards this limit. +var maxQueuedTransportResponseFrames = int(envconfig.ControlBufferThrottleLimit) type cbItem interface { - isThrottled() bool + // isTransportResponseFrame reports whether the item counts against the + // maxQueuedTransportResponseFrames limit, when queued in the + // controlBuffer of a transport on the given side. + // + // Items that the peer can make the transport queue in unbounded + // numbers, for example by sending PING or SETTINGS frames, must be + // counted, so that the transport stops reading from a peer that sends + // such frames without reading what the transport writes. Items whose + // number grows with the local application's load (for example, one + // per stream it creates) must not be counted. Otherwise, under high + // concurrency, both peers could stop reading at the same time and + // deadlock (see https://github.com/grpc/grpc-go/issues/9330). + isTransportResponseFrame(s side) bool } -// throttledItem represents every item in the controlBuffer to which the overall -// throttling limit applies, other than outgoing HEADERS and DATA frames. -type throttledItem struct{} +// nonTransportResponseFrame represents items in the controlBuffer that are not +// queued in response to peer control/reset frames (for example, +// locally-initiated or flow-controlled items). These items are not counted +// against the maxQueuedTransportResponseFrames limit. +type nonTransportResponseFrame struct{} -func (throttledItem) isThrottled() bool { return true } +func (nonTransportResponseFrame) isTransportResponseFrame(side) bool { return false } // The following defines various control items which could flow through // the control buffer of transport. They represent different aspects of @@ -120,12 +134,13 @@ func (throttledItem) isThrottled() bool { return true } // registerStream is used to register an incoming stream with loopy writer. type registerStream struct { - throttledItem + nonTransportResponseFrame streamID uint32 wq *writeQuota } type clientHeaders struct { + nonTransportResponseFrame streamID uint32 hf []hpack.HeaderField initStream func(uint32) error @@ -134,9 +149,8 @@ type clientHeaders struct { onOrphaned func(error) } -func (*clientHeaders) isThrottled() bool { return false } - type serverHeaders struct { + nonTransportResponseFrame streamID uint32 hf []hpack.HeaderField endStream bool @@ -144,24 +158,37 @@ type serverHeaders struct { cleanup *cleanupStream } -func (h *serverHeaders) isThrottled() bool { return false } - type cleanupStream struct { - throttledItem streamID uint32 rst bool rstCode http2.ErrCode onWrite func() } +// isTransportResponseFrame returns true on the server since cleanupStream +// either results in a RST_STREAM frame being sent on the wire or in +// non-trivial work being performed when under a Rapid Reset attack. +// +// It returns false on the client, where a cleanupStream is queued at most once +// per stream, and the number of streams is controlled by the client and not by +// the server. Counting them on the client makes the client stop reading under +// high concurrency, which deadlocks with a server that has also stopped +// reading (see https://github.com/grpc/grpc-go/issues/9330). +func (*cleanupStream) isTransportResponseFrame(s side) bool { return s == serverSide } + type earlyAbortStream struct { - throttledItem streamID uint32 rst bool hf []hpack.HeaderField // Pre-built header fields } +// isTransportResponseFrame returns true on the server since earlyAbortStream +// results in a HEADERS frame being sent on the wire, and possibly a RST_STREAM +// frame. It is never queued on the client. +func (*earlyAbortStream) isTransportResponseFrame(s side) bool { return s == serverSide } + type dataFrame struct { + nonTransportResponseFrame streamID uint32 endStream bool h []byte @@ -172,36 +199,40 @@ type dataFrame struct { onEachWrite func() } -func (*dataFrame) isThrottled() bool { return false } - type incomingWindowUpdate struct { - throttledItem streamID uint32 increment uint32 } +// isTransportResponseFrame returns true to protect against a WINDOW_UPDATE +// flood attack from the peer. +func (*incomingWindowUpdate) isTransportResponseFrame(side) bool { return true } + type outgoingWindowUpdate struct { - throttledItem + nonTransportResponseFrame streamID uint32 increment uint32 } type incomingSettings struct { - throttledItem ss []http2.Setting } +// isTransportResponseFrame returns true since incomingSettings results in a +// SETTINGS ACK frame being sent on the wire. +func (*incomingSettings) isTransportResponseFrame(side) bool { return true } + type outgoingSettings struct { - throttledItem + nonTransportResponseFrame ss []http2.Setting } type incomingGoAway struct { - throttledItem + nonTransportResponseFrame } type goAway struct { - throttledItem + nonTransportResponseFrame code http2.ErrCode debugData []byte headsUp bool @@ -209,13 +240,23 @@ type goAway struct { } type ping struct { - throttledItem ack bool data [8]byte } +// isTransportResponseFrame returns true for all pings, and not only for ping +// acks sent in response to pings from the peer. This is because a BDP ping is +// queued in response to a DATA frame (of any size) from the peer, whenever +// there is no BDP ping outstanding. And since the BDP ping's payload is fixed, +// the peer can make it look like the BDP ping was acked at any time, by +// sending a ping ack with that payload. A peer alternating between empty DATA +// frames and such ping acks would otherwise be able to queue an unbounded +// number of BDP pings. Pings initiated locally (keepalive and BDP) are rare +// enough to not cause throttling of well-behaved peers. +func (*ping) isTransportResponseFrame(side) bool { return true } + type outFlowControlSizeRequest struct { - throttledItem + nonTransportResponseFrame resp chan uint32 } @@ -225,7 +266,7 @@ type outFlowControlSizeRequest struct { // can inspect settled accounting values (such as bytesOutStanding) after loopyWriter // has run to completion without any data races. type outStreamRequestForTesting struct { - throttledItem + nonTransportResponseFrame streamID uint32 resp chan *outStream } @@ -235,7 +276,7 @@ type outStreamRequestForTesting struct { // (by the client or server). The transport itself will close after the reader // encounters the EOF caused by the connection closure. type closeConnection struct { - throttledItem + nonTransportResponseFrame } type outStreamState int @@ -316,8 +357,9 @@ func (l *outStreamList) dequeue() *outStream { // shouldn't be confused with an HTTP2 frame, although some of the control // frames like dataFrame and headerFrame do go out on wire as HTTP2 frames. type controlBuffer struct { - wakeupCh chan struct{} // Unblocks readers waiting for something to read. + wakeupCh chan struct{} // Unblocks readers waiting for new items. done <-chan struct{} // Closed when the transport is done. + side side // Side of the transport owning this buffer. // Mutex guards all the fields below, except trfChan which can be read // atomically without holding mu. @@ -326,26 +368,30 @@ type controlBuffer struct { closed bool // True when the controlbuf is finished. list *itemList // List of queued control frames. - // transportResponseFrames counts the number of queued items that represent - // the response of an action initiated by the peer. trfChan is created - // when transportResponseFrames >= maxQueuedTransportResponseFrames and is - // closed and nilled when transportResponseFrames drops below the - // threshold. Both fields are protected by mu. + // transportResponseFrames counts the number of queued items that + // represent the response of an action initiated by the peer (as + // determined by cbItem.isTransportResponseFrame for this side). + // trfChan is created when transportResponseFrames >= + // maxQueuedTransportResponseFrames and is closed and nilled when + // transportResponseFrames drops below the threshold. Both fields are + // protected by mu. transportResponseFrames int trfChan atomic.Pointer[chan struct{}] } -func newControlBuffer(done <-chan struct{}) *controlBuffer { +func newControlBuffer(done <-chan struct{}, s side) *controlBuffer { return &controlBuffer{ wakeupCh: make(chan struct{}, 1), list: &itemList{}, done: done, + side: s, } } -// throttle blocks if there are too many frames in the control buf that -// represent the response of an action initiated by the peer, like -// incomingSettings cleanupStreams etc. +// throttle blocks if there are too many items in the control buffer that count +// towards the maxQueuedTransportResponseFrames limit (see +// cbItem.isTransportResponseFrame), until their number drops below the limit, +// the control buffer is finished, or the transport is done. func (c *controlBuffer) throttle() { if ch := c.trfChan.Load(); ch != nil { select { @@ -355,6 +401,25 @@ func (c *controlBuffer) throttle() { } } +// throttleWithTimeout is like throttle, but it stops waiting and returns an +// error if the control buffer is still throttled after the given duration. +func (c *controlBuffer) throttleWithTimeout(timeout time.Duration) error { + ch := c.trfChan.Load() + if ch == nil { + return nil + } + timer := time.NewTimer(timeout) + defer timer.Stop() + select { + case <-(*ch): + return nil + case <-c.done: + return nil + case <-timer.C: + return fmt.Errorf("still throttled after %v, with at least %d queued frames", timeout, maxQueuedTransportResponseFrames) + } +} + // put adds an item to the controlbuf. func (c *controlBuffer) put(it cbItem) error { _, err := c.executeAndPut(nil, it) @@ -390,9 +455,9 @@ func (c *controlBuffer) executeAndPut(f func() bool, it cbItem) (bool, error) { c.consumerWaiting = false } c.list.enqueue(it) - if it.isThrottled() { + if it.isTransportResponseFrame(c.side) { c.transportResponseFrames++ - if c.transportResponseFrames == maxQueuedControlBufferItems { + if c.transportResponseFrames == maxQueuedTransportResponseFrames { // We are adding the frame that puts us over the threshold; create // a throttling channel. ch := make(chan struct{}) @@ -447,8 +512,8 @@ func (c *controlBuffer) getOnceLocked() (any, error) { return nil, nil } h := c.list.dequeue().(cbItem) - if h.isThrottled() { - if c.transportResponseFrames == maxQueuedControlBufferItems { + if h.isTransportResponseFrame(c.side) { + if c.transportResponseFrames == maxQueuedTransportResponseFrames { // We are removing the frame that put us over the // threshold; close and clear the throttling channel. ch := c.trfChan.Swap(nil) @@ -484,9 +549,10 @@ func (c *controlBuffer) finish() { } } - // In case throttle() is currently in flight, it needs to be unblocked. - // Otherwise, the transport may not close, since the transport is closed by - // the reader encountering the connection error. + // In case throttle() or throttleWithTimeout() is currently in flight, + // it needs to be unblocked. Otherwise, the transport may not close, + // since the transport is closed by the reader encountering the + // connection error. ch := c.trfChan.Swap(nil) if ch != nil { close(*ch) diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go index 9cd8d28d..a701522b 100644 --- a/vendor/google.golang.org/grpc/internal/transport/handler_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -268,7 +268,7 @@ func (ht *serverHandlerTransport) writeStatus(s *ServerStream, st *status.Status for _, v := range vv { // http2 ResponseWriter mechanism to send undeclared Trailers after // the headers have possibly been written. - h.Add(http2.TrailerPrefix+k, encodeMetadataHeader(k, v)) + h.Add(http.TrailerPrefix+k, encodeMetadataHeader(k, v)) } } } @@ -494,7 +494,8 @@ func mapRecvMsgError(err error) error { if err == io.EOF || err == io.ErrUnexpectedEOF { return err } - if se, ok := err.(http2.StreamError); ok { + var se http2.StreamError + if errors.As(err, &se) { if code, ok := http2ErrConvTab[se.Code]; ok { return status.Error(code, se.Error()) } diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 720fc4e5..a198bafb 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -65,6 +65,13 @@ var clientConnectionCounter uint64 var goAwayLoopyWriterTimeout = 5 * time.Second +// clientThrottleTimeout is the maximum amount of time for which the client +// stops reading from the connection because too many frames queued in +// response to the server (see maxQueuedTransportResponseFrames) are waiting +// to be written. After that, the client closes the connection instead of +// waiting forever, since the server is most likely not reading. +var clientThrottleTimeout = 10 * time.Second + var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) // http2Client implements the ClientTransport interface with HTTP2. @@ -107,6 +114,12 @@ type http2Client struct { kp keepalive.ClientParameters keepaliveEnabled bool + // throttleTimeout is the maximum amount of time for which reads can + // stay throttled before the connection is closed. It is copied from + // clientThrottleTimeout on creation, so that tests can override the + // latter without racing with the readers of other transports. + throttleTimeout time.Duration + statsHandler stats.Handler initialWindowSize int32 @@ -359,6 +372,7 @@ func NewHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts streamQuota: defaultMaxStreamsClient, streamsQuotaAvailable: make(chan struct{}, 1), keepaliveEnabled: keepaliveEnabled, + throttleTimeout: clientThrottleTimeout, bufferPool: opts.BufferPool, onClose: onClose, } @@ -386,7 +400,7 @@ func NewHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts } else if md := imetadata.Get(addr); md != nil { t.md = md } - t.controlBuf = newControlBuffer(t.ctxDone) + t.controlBuf = newControlBuffer(t.ctxDone, clientSide) if opts.InitialWindowSize >= defaultWindowSize { t.initialWindowSize = opts.InitialWindowSize } @@ -952,6 +966,7 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr, handler s LocalAddr: t.localAddr, Compression: callHdr.SendCompress, Header: header, + Authority: callHdr.Host, }) } if transportDrainRequired { @@ -1726,9 +1741,19 @@ func (t *http2Client) reader(errCh chan<- error) { atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) } - // loop to keep reading incoming messages on this transport. + // Loop to keep reading incoming messages on this transport. for { - t.controlBuf.throttle() + // Stop reading while too many items that the server can make + // the client queue (see cbItem.isTransportResponseFrame) are + // waiting to be written, to bound the memory that a server + // can make the client use by flooding it without reading. If + // reads stay throttled for t.throttleTimeout, close the + // connection instead of waiting forever. + if err := t.controlBuf.throttleWithTimeout(t.throttleTimeout); err != nil { + t.logger.Warningf("Closing connection since the server is not reading: %v", err) + errClose = connectionErrorf(true, err, "closing connection since the server is not reading: %v", err) + return + } frame, err := t.framer.readFrame() if t.keepaliveEnabled { atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index f11e88cc..5c3fc765 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -297,7 +297,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, ) t.logger = prefixLoggerForServerTransport(t) - t.controlBuf = newControlBuffer(t.done) + t.controlBuf = newControlBuffer(t.done, serverSide) if !config.StaticWindowSize { t.bdpEst = &bdpEstimator{ bdp: initialWindowSize, @@ -380,6 +380,11 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade defer t.maxStreamMu.Unlock() streamID := frame.Header().StreamID + if streamID%2 != 1 || streamID <= t.maxStreamID { + // illegal gRPC stream id. + return fmt.Errorf("received an illegal stream id: %v. headers frame: %+v", streamID, frame) + } + t.maxStreamID = streamID // frame.Truncated is set to true when framer detects that the current header // list size hits MaxHeaderListSize limit. @@ -393,12 +398,6 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade return nil } - if streamID%2 != 1 || streamID <= t.maxStreamID { - // illegal gRPC stream id. - return fmt.Errorf("received an illegal stream id: %v. headers frame: %+v", streamID, frame) - } - t.maxStreamID = streamID - s := &ServerStream{ Stream: Stream{ id: streamID, @@ -1014,7 +1013,17 @@ func (t *http2Server) streamContextErr(s *ServerStream) error { return ErrConnClosing default: } - return ContextErr(s.ctx.Err()) + err := s.ctx.Err() + if err == nil { + // In closeStream and finishStream, the stream state is transitioned to + // streamDone before s.cancel() is invoked so that concurrent operations + // immediately observe the terminal state. A concurrent caller (such as + // write or writeHeader) can see streamDone and invoke streamContextErr + // before s.cancel() runs or propagates to s.ctx. Default to + // context.Canceled rather than passing nil to ContextErr. + err = context.Canceled + } + return ContextErr(err) } // WriteHeader sends the header metadata md back to the client. @@ -1336,10 +1345,6 @@ func (t *http2Server) deleteStream(s *ServerStream, eosReceived bool) { // finishStream closes the stream and puts the trailing headerFrame into controlbuf. func (t *http2Server) finishStream(s *ServerStream, rst bool, rstCode http2.ErrCode, hdr *serverHeaders, eosReceived bool) { - // In case stream sending and receiving are invoked in separate - // goroutines (e.g., bi-directional streaming), cancel needs to be - // called to interrupt the potential blocking on other goroutines. - s.cancel() oldState := s.swapState(streamDone) if oldState == streamDone { @@ -1347,6 +1352,11 @@ func (t *http2Server) finishStream(s *ServerStream, rst bool, rstCode http2.ErrC return } + // In case stream sending and receiving are invoked in separate + // goroutines (e.g., bi-directional streaming), cancel needs to be + // called to interrupt the potential blocking on other goroutines. + s.cancel() + hdr.cleanup = &cleanupStream{ streamID: s.id, rst: rst, @@ -1360,15 +1370,16 @@ func (t *http2Server) finishStream(s *ServerStream, rst bool, rstCode http2.ErrC // closeStream clears the footprint of a stream when the stream is not needed any more. func (t *http2Server) closeStream(s *ServerStream, rst bool, rstCode http2.ErrCode, eosReceived bool) { + // We can't return early even if the stream's state is "done" as the state + // might have been set by the `finishStream` method. Deleting the stream via + // `finishStream` can get blocked on flow control. + s.swapState(streamDone) + // In case stream sending and receiving are invoked in separate // goroutines (e.g., bi-directional streaming), cancel needs to be // called to interrupt the potential blocking on other goroutines. s.cancel() - // We can't return early even if the stream's state is "done" as the state - // might have been set by the `finishStream` method. Deleting the stream via - // `finishStream` can get blocked on flow control. - s.swapState(streamDone) t.deleteStream(s, eosReceived) t.controlBuf.put(&cleanupStream{ diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index fc656b36..f627adf6 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -121,7 +121,9 @@ func (b *recvBuffer) put(r recvMsg) { if b.err != nil { // drop the buffer on the floor. Since b.err is not nil, any subsequent reads // will always return an error, making this buffer inaccessible. - r.buffer.Free() + if r.buffer != nil { + r.buffer.Free() + } // An error had occurred earlier, don't accept more // data or errors. return diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go index 2b79204b..a3090ff3 100644 --- a/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -360,6 +360,66 @@ func FromOutgoingContext(ctx context.Context) (MD, bool) { return out, ok } +// ValueFromOutgoingContext returns the metadata value corresponding to the +// metadata key from the outgoing metadata if it exists. Keys are matched in a +// case-insensitive manner. +// +// Unlike FromOutgoingContext, this does not copy the entire outgoing metadata. +func ValueFromOutgoingContext(ctx context.Context, key string) []string { + raw, ok := ctx.Value(mdOutgoingKey{}).(rawMD) + if !ok { + return nil + } + + key = strings.ToLower(key) + // Unlike ValueFromIncomingContext, this can't return as soon as raw.md is + // checked: raw.added still needs to be walked and accumulated regardless. + // The else below prevents that from overwriting an exact match with an + // unrelated case-insensitive one. + var matchedMD []string + if v, ok := raw.md[key]; ok { + matchedMD = v + } else { + for k, v := range raw.md { + // Case insensitive comparison: MD is a map, and there's no + // guarantee that the MD attached to the context is created using + // our helper functions. + if strings.EqualFold(k, key) { + matchedMD = v + break + } + } + } + + // Defer allocating vals until raw.added actually has a match, so a match + // found only in raw.md doesn't pay for both a copyOf and a growing + // append. + var vals []string + for _, added := range raw.added { + if len(added)%2 == 1 { + panic(fmt.Sprintf("metadata: ValueFromOutgoingContext got an odd number of input pairs for metadata: %d", len(added))) + } + + // Case insensitive, like FromOutgoingContext: added isn't guaranteed + // lowercase, though AppendToOutgoingContext already lowercases it in + // practice, so try the cheap exact match first. + for i := 0; i < len(added); i += 2 { + if added[i] == key || strings.EqualFold(added[i], key) { + if vals == nil { + vals = make([]string, 0, len(matchedMD)+1) + vals = append(vals, matchedMD...) + } + vals = append(vals, added[i+1]) + } + } + } + + if vals == nil && matchedMD != nil { + return copyOf(matchedMD) + } + return vals +} + type rawMD struct { md MD added [][]string diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index 52f4ea51..6f1bb2ea 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -179,7 +179,6 @@ type callInfo struct { contentSubtype string codec baseCodec maxRetryRPCBufferSize int - onFinish []func(err error) authority string acceptedResponseCompressors []string } @@ -394,8 +393,7 @@ type OnFinishCallOption struct { OnFinish func(error) } -func (o OnFinishCallOption) before(c *callInfo) error { - c.onFinish = append(c.onFinish, o.OnFinish) +func (o OnFinishCallOption) before(*callInfo) error { return nil } diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 4ab54115..5c165972 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -1400,7 +1400,7 @@ func (s *Server) processRPC(ctx context.Context, stream *transport.ServerStream, ss.decompressorV1 = encoding.GetCompressor(rc) if ss.decompressorV1 == nil { st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) - ss.writeStatus(st) + ss.s.WriteStatus(st) return st.Err() } } @@ -1491,7 +1491,7 @@ func (s *Server) processRPC(ctx context.Context, stream *transport.ServerStream, binlog.Log(ctx, st) } } - if err := ss.writeStatus(appStatus); err != nil { + if err := ss.s.WriteStatus(appStatus); err != nil { channelz.Warningf(logger, s.channelz, "grpc: Server.processRPC failed to write status: %v", err) } return appErr @@ -1510,7 +1510,7 @@ func (s *Server) processRPC(ctx context.Context, stream *transport.ServerStream, binlog.Log(ctx, st) } } - if err := ss.writeStatus(statusOK); err != nil { + if err := ss.s.WriteStatus(statusOK); err != nil { channelz.Warningf(logger, s.channelz, "grpc: Server.processRPC failed to write status: %v", err) } return err @@ -1719,7 +1719,13 @@ func (s *Server) stop(graceful bool) { } if graceful || s.opts.waitForHandlers { + // Release the lock while waiting for handlers to finish. Holding it + // here would deadlock a concurrent Stop() (the recommended way to abort + // a GracefulStop that is taking too long), because Stop() must acquire + // s.mu before it can force the server to shut down. + s.mu.Unlock() s.handlersWG.Wait() + s.mu.Lock() } if s.events != nil { diff --git a/vendor/google.golang.org/grpc/stats/stats.go b/vendor/google.golang.org/grpc/stats/stats.go index 10bf998a..c6996724 100644 --- a/vendor/google.golang.org/grpc/stats/stats.go +++ b/vendor/google.golang.org/grpc/stats/stats.go @@ -190,6 +190,9 @@ type OutHeader struct { Compression string // Header contains the header metadata sent. Header metadata.MD + // Authority is the :authority pseudo-header sent for the RPC. + // It is valid only if Client is true. + Authority string // The following fields are valid only if Client is true. // FullMethod is the full RPC method string, i.e., /package.service/method. diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 52e59f2c..9fd628b8 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -201,9 +201,9 @@ func (w *clientStreamWrapper) SendMsg(m any) error { } -// RecvMsg receives message m from the stream. For RPCs that call RecvMsg only -// once i.e. only client streaming RPCs, it calls the underlying RecvMsg a -// second time after receiving the first message to get the trailers. +// RecvMsg receives message m from the stream. For non-server-streaming RPCs +// (unary and client-streaming), it calls the underlying RecvMsg a second time +// after receiving the first message to get the trailers. func (w *clientStreamWrapper) RecvMsg(m any) error { err := w.ClientStream.RecvMsg(m) if err != nil { @@ -224,19 +224,6 @@ func (w *clientStreamWrapper) RecvMsg(m any) error { return err } -// defaultStreamInterceptor is a StreamClientInterceptor which wraps the -// ClientStream and is always invoked as the first interceptor. It consolidates -// behavior for different RPC types at the level closest to the application, -// which simplifies the underlying stream implementation and other interceptors -// by avoiding duplicate or scattered handling. -func defaultStreamInterceptor(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error) { - cs, err := streamer(ctx, desc, cc, method, opts...) - if err != nil { - return nil, err - } - return &clientStreamWrapper{ClientStream: cs, desc: desc}, nil -} - // NewStream creates a new Stream for the client side. This is typically // called by generated code. ctx is used for the lifetime of the stream. // @@ -392,7 +379,11 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth } } - return newStream(ctx, opts...) + cs, err := newStream(ctx, opts...) + if err != nil { + return nil, err + } + return &clientStreamWrapper{ClientStream: cs, desc: desc}, nil } func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, mc *serviceconfig.MethodConfig, onCommit func(), nameResolutionDelayed bool, opts ...CallOption) (_ ClientStream, err error) { @@ -632,7 +623,12 @@ func (a *csAttempt) getTransport() error { func (a *csAttempt) newStream() error { cs := a.cs - cs.callHdr.PreviousAttempts = cs.numRetries + // The header is copied because the fields set below, notably the authority + // override taken from the pick result, describe the endpoint picked for + // this attempt only. Mutating the clientStream's header would carry them + // into a later attempt. + callHdr := *cs.callHdr + callHdr.PreviousAttempts = cs.numRetries // Merge metadata stored in PickResult, if any, with existing call metadata. // It is safe to overwrite the csAttempt's context here, since all state @@ -659,11 +655,11 @@ func (a *csAttempt) newStream() error { // apply it, as specified in gRFC A81. if cs.callInfo.authority == "" { if authMD := a.pickResult.Metadata.Get(":authority"); len(authMD) > 0 { - cs.callHdr.Authority = authMD[0] + callHdr.Authority = authMD[0] } } } - s, err := a.transport.NewStream(a.ctx, cs.callHdr, a.statsHandler) + s, err := a.transport.NewStream(a.ctx, &callHdr, a.statsHandler) if err != nil { nse, ok := err.(*transport.NewStreamError) if !ok { @@ -698,10 +694,6 @@ type clientStream struct { cancel context.CancelFunc // cancels all attempts - sentLast bool // sent an end stream - - receivedFirstMsg bool // set after the first message is received - methodConfig *MethodConfig ctx context.Context // the application's context, wrapped by stats/tracing @@ -709,19 +701,10 @@ type clientStream struct { retryThrottler *retryThrottler // The throttler active when the RPC began. binlogs []binarylog.MethodLogger - // serverHeaderBinlogged is a boolean for whether server header has been - // logged. Server header will be logged when the first time one of those - // happens: stream.Header(), stream.Recv(). - // - // It's only read and used by Recv() and Header(), so it doesn't need to be - // synchronized. - serverHeaderBinlogged bool mu sync.Mutex - firstAttempt bool // if true, transparent retry is valid - numRetries int // exclusive of transparent retry attempt(s) - numRetriesSincePushback int // retries since pushback; to reset backoff - finished bool // TODO: replace with atomic cmpxchg or sync.Once? + numRetries int // exclusive of transparent retry attempt(s) + numRetriesSincePushback int // retries since pushback; to reset backoff // attempt is the active client stream attempt. // The only place where it is written is the newAttemptLocked method and this method never writes nil. // So, attempt can be nil only inside newClientStream function when clientStream is first created. @@ -731,13 +714,33 @@ type clientStream struct { // place where we need to check if the attempt is nil. attempt *csAttempt // TODO(hedging): hedging will have multiple attempts simultaneously. - committed bool // active attempt committed for retry? onCommit func() replayBuffer []replayOp // operations to replay on retry replayBufferSize int // current size of replayBuffer + + // Bool fields are grouped at the tail to eliminate the alignment padding + // that would otherwise follow each bool when the next field is pointer- or + // int-sized. See https://github.com/grpc/grpc-go/issues/9280 for benchmarks. + // Add new bool fields here, not inline above. + + // Not guarded by mu. + sentLast bool // sent an end stream + receivedFirstMsg bool // set after the first message is received + // serverHeaderBinlogged is a boolean for whether server header has been + // logged. Server header will be logged when the first time one of those + // happens: stream.Header(), stream.Recv(). + // + // It's only read and used by Recv() and Header(), so it doesn't need to be + // synchronized. + serverHeaderBinlogged bool // nameResolutionDelay indicates if there was a delay in the name resolution. // This field is only valid on client side, it's always false on server side. nameResolutionDelay bool + + // Guarded by mu. + firstAttempt bool // if true, transparent retry is valid + finished bool // TODO: replace with atomic cmpxchg or sync.Once? + committed bool // active attempt committed for retry? } type replayOp struct { @@ -755,10 +758,8 @@ type csAttempt struct { parser parser pickResult balancer.PickResult - finished bool - decompressorV0 Decompressor - decompressorV1 encoding.Compressor - decompressorSet bool + decompressorV0 Decompressor + decompressorV1 encoding.Compressor mu sync.Mutex // guards trInfo.tr // trInfo may be nil (if EnableTracing is false). @@ -769,10 +770,18 @@ type csAttempt struct { statsHandler stats.Handler beginTime time.Time - // set for newStream errors that may be transparently retried - allowTransparentRetry bool - // set for pick errors that are returned as a status - drop bool + // Bool fields are grouped at the tail to eliminate the alignment padding + // that would otherwise follow each bool when the next field is pointer- or + // int-sized. See https://github.com/grpc/grpc-go/issues/9347 for benchmarks. + // Add new bool fields here, not inline above. + + // Not guarded by mu. + decompressorSet bool + allowTransparentRetry bool // set for newStream errors that may be transparently retried + drop bool // set for pick errors that are returned as a status + + // Guarded by mu. + finished bool } func (cs *clientStream) commitAttemptLocked() { @@ -1500,20 +1509,28 @@ type addrConnStream struct { callInfo *callInfo transport transport.ClientTransport ctx context.Context - sentLast bool - receivedFirstMsg bool desc *StreamDesc codec baseCodec sendCompressorV0 Compressor sendCompressorV1 encoding.Compressor - decompressorSet bool decompressorV0 Decompressor decompressorV1 encoding.Compressor - parser parser // mu guards finished and is held for the entire finish method. - mu sync.Mutex - finished bool + mu sync.Mutex + parser parser + + // Bool fields are grouped at the tail to eliminate the alignment padding + // that would otherwise follow each bool when the next field is pointer- or + // int-sized. See https://github.com/grpc/grpc-go/issues/9348 for benchmarks. + // Add new bool fields here, not inline above. + + // Not guarded by mu. + sentLast bool + receivedFirstMsg bool + decompressorSet bool + + finished bool // guarded by mu } func (as *addrConnStream) Header() (metadata.MD, error) { @@ -1728,15 +1745,23 @@ type serverStream struct { sendCompressorName string - recvFirstMsg bool // set after the first message is received - maxReceiveMessageSize int maxSendMessageSize int - trInfo *traceInfo + + // mu guards trInfo.tr after the service handler runs. + mu sync.Mutex + trInfo *traceInfo statsHandler stats.Handler binlogs []binarylog.MethodLogger + + // Bool fields are grouped at the tail to eliminate the alignment padding + // that would otherwise follow each bool when the next field is pointer- or + // int-sized. See https://github.com/grpc/grpc-go/issues/9349 for benchmarks. + // Add new bool fields here, not inline above. + + recvFirstMsg bool // set after the first message is received // serverHeaderBinlogged indicates whether server header has been logged. It // will happen when one of the following two happens: stream.SendHeader(), // stream.Send(). @@ -1744,10 +1769,6 @@ type serverStream struct { // It's only checked in send and sendHeader, doesn't need to be // synchronized. serverHeaderBinlogged bool - - statusWritten atomic.Bool // True if status has been written to the transport. - - mu sync.Mutex // protects trInfo.tr after the service handler runs. } func (ss *serverStream) Context() context.Context { @@ -1795,16 +1816,6 @@ func (ss *serverStream) SetTrailer(md metadata.MD) { ss.s.SetTrailer(md) } -// writeStatus sends the status of a stream to the client. It uses an atomic -// CAS to guarantee that the status is written to the transport exactly once, -// even if called concurrently. -func (ss *serverStream) writeStatus(st *status.Status) error { - if !ss.statusWritten.CompareAndSwap(false, true) { - return nil - } - return ss.s.WriteStatus(st) -} - func (ss *serverStream) SendMsg(m any) (err error) { defer func() { if ss.trInfo != nil { @@ -1821,7 +1832,7 @@ func (ss *serverStream) SendMsg(m any) (err error) { } if err != nil && err != io.EOF { st, _ := status.FromError(toRPCErr(err)) - ss.writeStatus(st) + ss.s.WriteStatus(st) // Non-user specified status was sent out. This should be an error // case (as a server side Cancel maybe). // @@ -1904,7 +1915,7 @@ func (ss *serverStream) RecvMsg(m any) (err error) { } if err != nil && err != io.EOF { st, _ := status.FromError(toRPCErr(err)) - ss.writeStatus(st) + ss.s.WriteStatus(st) // Non-user specified status was sent out. This should be an error // case (as a server side Cancel maybe). // diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 75f8ef50..d41341bc 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.84.0" +const Version = "1.85.0" diff --git a/vendor/modules.txt b/vendor/modules.txt index 7c04fc26..e7afc72b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -24,14 +24,14 @@ code.cloudfoundry.org/clock # code.cloudfoundry.org/debugserver v0.122.0 ## explicit; go 1.26.0 code.cloudfoundry.org/debugserver -# code.cloudfoundry.org/diego-logging-client v0.131.0 -## explicit; go 1.26.0 +# code.cloudfoundry.org/diego-logging-client v0.133.0 +## explicit; go 1.27.3 code.cloudfoundry.org/diego-logging-client code.cloudfoundry.org/diego-logging-client/testhelpers # code.cloudfoundry.org/durationjson v0.95.0 ## explicit; go 1.26.0 code.cloudfoundry.org/durationjson -# code.cloudfoundry.org/go-diodes v0.0.0-20261019063924-5f5277928191 +# code.cloudfoundry.org/go-diodes v0.0.0-20261109092731-97a033397c51 ## explicit; go 1.25.0 code.cloudfoundry.org/go-diodes # code.cloudfoundry.org/go-loggregator/v9 v9.2.1 @@ -59,8 +59,8 @@ code.cloudfoundry.org/locket/models # code.cloudfoundry.org/runtimeschema v0.0.0-20240514235758-31be7684c5bf ## explicit; go 1.20 code.cloudfoundry.org/runtimeschema/cc_messages -# code.cloudfoundry.org/tlsconfig v0.69.0 -## explicit; go 1.26.0 +# code.cloudfoundry.org/tlsconfig v0.71.0 +## explicit; go 1.27.3 code.cloudfoundry.org/tlsconfig # code.cloudfoundry.org/workpool v0.0.0-20250911194158-1489753f182e ## explicit @@ -113,7 +113,7 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/pprof v0.0.0-20261102214848-0031fcd306b0 +# github.com/google/pprof v0.0.0-20261105003125-4bf881d7fb0b ## explicit; go 1.26.0 github.com/google/pprof/profile # github.com/josharian/intern v1.0.0 @@ -203,7 +203,7 @@ github.com/tedsuo/rata # github.com/vito/go-sse v1.1.3 ## explicit; go 1.24 github.com/vito/go-sse/sse -# go.step.sm/crypto v0.91.0 +# go.step.sm/crypto v0.91.1 ## explicit; go 1.26.0 go.step.sm/crypto/fingerprint go.step.sm/crypto/internal/bcrypt_pbkdf @@ -234,7 +234,7 @@ golang.org/x/crypto/salsa20/salsa golang.org/x/crypto/scrypt golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -# golang.org/x/mod v0.42.0 +# golang.org/x/mod v0.43.0 ## explicit; go 1.26.0 golang.org/x/mod/semver # golang.org/x/net v0.62.0 @@ -251,15 +251,15 @@ golang.org/x/net/internal/httpcommon golang.org/x/net/internal/httpsfv golang.org/x/net/internal/timeseries golang.org/x/net/trace -# 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/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/unix golang.org/x/sys/windows -# golang.org/x/text v0.43.0 +# golang.org/x/text v0.44.0 ## explicit; go 1.26.0 golang.org/x/text/encoding golang.org/x/text/encoding/charmap @@ -301,11 +301,11 @@ golang.org/x/tools/internal/pkgbits golang.org/x/tools/internal/stdlib golang.org/x/tools/internal/typesinternal golang.org/x/tools/internal/versions -# google.golang.org/genproto/googleapis/rpc v0.0.0-20261026165753-2ffab32bce7e +# google.golang.org/genproto/googleapis/rpc v0.0.0-20261104224025-d1e00e9f33ab ## explicit; go 1.26.0 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.84.0 -## explicit; go 1.25.0 +# google.golang.org/grpc v1.85.0 +## explicit; go 1.26.0 google.golang.org/grpc google.golang.org/grpc/attributes google.golang.org/grpc/backoff