F Y
1e638101df
unix: stop counting trailing NUL for abstract addresses starting with NUL
...
Changes trailing-NUL-counting behavior for abstract addresses
starting with the NUL character to be the same as abstract
addresses starting with the @ character.
For golang/go#63579 .
Change-Id: I2f26de4bcf614c4635ad188b1afa3d14ebd9a95f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/535955
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-10-23 09:05:11 +00:00
Dmitri Shuralyov
1bfbee0e20
all: update go directive to 1.18
...
Done with:
go get go@1.18
go mod tidy
go fix ./...
Using go1.21.3.
Also update code generators to use only the new go:build lines,
not the old +build ones.
For golang/go#60268 .
Change-Id: I6aabc42efb6ab3329981100e1db2263aac5e92a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/534222
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-10-11 21:54:30 +00:00
AN Long
8ccaaf02a4
windows: add GetFileTime
...
Add a simple Windows API GetFileTime.
The document is https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfiletime
Fixes golang/go#21541
Change-Id: Ia7b8385d27348b2abc0ee560c5bd7e66cb6d13f2
GitHub-Last-Rev: 6700dccbad
GitHub-Pull-Request: golang/sys#174
Reviewed-on: https://go-review.googlesource.com/c/sys/+/528015
Reviewed-by: Michael Pratt <mpratt@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Auto-Submit: Michael Pratt <mpratt@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-10-06 20:50:44 +00:00
database64128
6ee6208a59
windows: add missing TCP and UDP socket options and control message types
...
Source: ws2ipdef.h
Change-Id: Ie9c6e2cec839a09b7e59239f1d5b50664a310f1d
GitHub-Last-Rev: 14b916938b
GitHub-Pull-Request: golang/sys#173
Reviewed-on: https://go-review.googlesource.com/c/sys/+/525256
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Michael Pratt <mpratt@google.com >
2023-10-06 20:48:55 +00:00
Bryan C. Mills
3186bae2c3
windows: remove the 8192-codepoint arg limit in FuzzComposeCommandLine
...
It just occurred to me that the observed limit was almost certainly a
side effect of the Go wrapper for CommandLineToArgv (golang/go#63236 )
rather than a behavior of the system call itself.
Updates golang/go#63236 .
Updates golang/go#58817 .
Change-Id: Icc9db01f201f54a78044d1c48e0883e098cfb5e5
Cq-Include-Trybots: luci.golang.try:x_sys-gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/sys/+/531176
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Bryan Mills <bcmills@google.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Than McIntosh <thanm@google.com >
2023-09-27 14:34:16 +00:00
Bryan C. Mills
01c413d3ff
windows: document the return type mismatch for CommandLineToArgv
...
For golang/go#63236 .
Change-Id: Id6c458e2ee2291e28685d24e86c05702d9fd132a
Cq-Include-Trybots: luci.golang.try:x_sys-gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/sys/+/531175
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Auto-Submit: Bryan Mills <bcmills@google.com >
Reviewed-by: Than McIntosh <thanm@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-09-26 17:41:44 +00:00
Bryan C. Mills
e6494535b9
windows: convert TestCommandLineRecomposition to a fuzz test and fix discrepancies
...
Notably, this fixes the escaping of the first argument when it
contains quoted spaces, and fixes a panic in DecomposeCommandLine
when it contains more than 8192 arguments.
Fixes golang/go#58817 .
For golang/go#17149 .
For golang/go#63236 .
Change-Id: Ib72913b8182998adc1420d73ee0f9dc017dfbf32
Reviewed-on: https://go-review.googlesource.com/c/sys/+/530275
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Than McIntosh <thanm@google.com >
Auto-Submit: Bryan Mills <bcmills@google.com >
2023-09-26 17:41:41 +00:00
Ayman Bagabas
71c9d8730f
windows: add console ConPTY API
...
Add Windows ConPTY API, specifically CreatePseudoConsole, ClosePseudoConsole, and ResizePseudoConsole.
See https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/
See https://learn.microsoft.com/en-us/windows/console/creating-a-pseudoconsole-session
Updates #62708
Change-Id: I433c4d9d8716dd75fa44291ab0cf6ef3c5f6a913
GitHub-Last-Rev: 21cda7e648
GitHub-Pull-Request: golang/sys#175
Reviewed-on: https://go-review.googlesource.com/c/sys/+/528915
Run-TryBot: Quim Muntal <quimmuntal@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Than McIntosh <thanm@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-09-26 16:33:30 +00:00
Kir Kolyshkin
fdc7ef4071
all: remove ioutil usage from tests
...
This removes the remaining (and trivial) use of deprecated ioutil
package from test files.
Replacements are easy:
ioutil.ReadAll -> io.ReadAll
ioutil.ReadDir -> os.ReadDir
ioutil.ReadFile -> os.ReadFile
ioutil.WriteFile -> os.WriteFile
While at it, simplify some error reporting.
Change-Id: I60a242fd3c08d8fe571a18f16716439a9acdd59d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526299
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
2023-09-12 16:41:27 +00:00
qmuntal
4848eb0479
windows,windows\svc,windows\svc\mgr: use unsafe.Slice instead of unsafeheader.Slice
...
unsafe.Slice is available since Go 1.17, which is already the minimum
version supported by this package.
This change removes the dependency on the internal unsafeheader package,
which can be removed from the module.
Change-Id: I6c34cb152f2336ea04c5f9c7e88797ed8914f9cc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526635
Run-TryBot: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Cherry Mui <cherryyz@google.com >
2023-09-08 18:06:11 +00:00
Kir Kolyshkin
0e97d69659
all: use t.TempDir in tests
...
This removes all usage of ioutil.TempDir in tests (and a few cases of
os.TempDir as well, while we're at it), which simplifies test cleanup a
lot.
Compile tested (go test -c) for most platforms (except zos).
Change-Id: I9178f5ec615c0a6cfef36e8de78c6b72e055b7cb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526297
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: qiulaidongfeng <2645477756@qq.com >
Auto-Submit: Ian Lance Taylor <iant@golang.org >
2023-09-08 15:25:11 +00:00
Dmitri Shuralyov
81cb935067
unix, windows: use ^TestName$ regular pattern for invoking a single test
...
For reasons motivated in the commit message of CL 524948.
Change-Id: I0085411f30a77634962239ee36d15e7b6ef893ef
Reviewed-on: https://go-review.googlesource.com/c/sys/+/525618
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-09-06 00:53:53 +00:00
Tobias Klauser
e8190d9965
windows: don't check non-existent return code in GetStartupInfo
...
Same as CL 520275 did in package syscall.
For golang/go#31316
Change-Id: Ie9d8fed7f40b9e562534d5e91488b4ba1ac44f34
Reviewed-on: https://go-review.googlesource.com/c/sys/+/520295
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
2023-08-17 16:34:40 +00:00
Mauri de Souza Meneguzzo
ad02017442
windows: use SyscallN in mkwinsyscall
...
The mkwinsyscall command has a hard limit of 15 on the
number of syscall arguments. Windows has several system
calls with more than 15 arguments, for example CreateFontPackage
has 18 arguments.
If the number of arguments is higher than 15 we use SyscallN.
Fixes golang/go#57914
Change-Id: I4205e779a960ae10c0778de7876154e0d7ec00a1
GitHub-Last-Rev: 1f1e96fab7
GitHub-Pull-Request: golang/sys#171
Reviewed-on: https://go-review.googlesource.com/c/sys/+/518995
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
2023-08-17 16:18:12 +00:00
qmuntal
60ecf13377
windows: add TimeBeginPeriod and TimeEndPeriod syscalls
...
Updates golang/go#44343
Fixes golang/go#61723
Change-Id: I920f2fad6b3a2a9ba67ff2fafea4319644a0bc8c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/515915
Reviewed-by: qiulaidongfeng <2645477756@qq.com >
Run-TryBot: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
2023-08-07 06:21:27 +00:00
cui fliter
c406141231
all: fix some typos
...
Change-Id: Id4bf4ce8aee8b98baa2f1a9c62a72a9554f7d557
Reviewed-on: https://go-review.googlesource.com/c/sys/+/510595
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: shuang cui <imcusg@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
2023-07-19 19:13:37 +00:00
cui fliter
706fa9866a
windows: remove repetitive words
...
Change-Id: I9c944eca6117b1039f0c5287706cb447b75c8cbd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/509835
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
2023-07-17 14:37:11 +00:00
Heschi Kreinick
0a92922092
windows: make TestSystemModuleVersions more tolerant
...
One file can't be read on LUCI's Windows image:
syscall_windows_test.go:892: CimFS.SYS: The specified resource type cannot be found in the image file.
That doesn't seem like a good enough reason to fail the test. Skip the
file if this error is encountered.
Change-Id: Id9a65b3ff748bbf7ef7fac37d3741c16e001a4b0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/505220
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Run-TryBot: Heschi Kreinick <heschi@google.com >
Auto-Submit: Heschi Kreinick <heschi@google.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
2023-06-27 15:54:37 +00:00
Craig Davison
2b751ddc66
windows/svc/mgr: add Service.RecoveryActionsOnNonCrashFailures
...
Fixes golang/go#59016
Change-Id: I5e16f61ea2fc384052565342c6517687562260a1
GitHub-Last-Rev: 3626b01fcf
GitHub-Pull-Request: golang/sys#157
Reviewed-on: https://go-review.googlesource.com/c/sys/+/484896
Run-TryBot: Bryan Mills <bcmills@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-06-24 00:31:25 +00:00
Roman Mazur
c8ea6b0cbc
windows: fix EnumProcesses to pass the correct array size
...
Implementation generated directly with mkwinsyscall has a wrong
assumption about the expected value for PIDs buffer size.
This change adds some small manual code that converts the input
slice length to the number of bytes of the array backing the slice.
A test is also added. It fails with the previous implementation.
Fixes golang/go#60223
Change-Id: I5e2414acb29c6c949e5e6acd328043f8a8883887
Reviewed-on: https://go-review.googlesource.com/c/sys/+/495995
Commit-Queue: Quim Muntal <quimmuntal@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Bryan Mills <bcmills@google.com >
Run-TryBot: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
2023-05-19 20:19:27 +00:00
Bryan C. Mills
1911637744
windows/svc: use separate (and more descriptive) service names in tests
...
Notably, the DisplayName field was set to the same thing in both
sys.TestExample and mrg.TestMyService, which may explain the collision
reported in golang/go#59298 .
Moreover, the adjective ”my” conveys no information whatsoever — we
shouldn't use it in tests or examples.
Also skip the tests that install services if GO_BUILDER_NAME is not
set, to reduce the likelihood of 'go test all' in a user's working
directory being mistaken for a malicious or compromised program.
Fixes golang/go#59298 .
Change-Id: Ib00bf7400bfaa34e1a1d49125c43b97019b53c82
Reviewed-on: https://go-review.googlesource.com/c/sys/+/481015
Reviewed-by: Carlos Amedee <carlos@golang.org >
Run-TryBot: Bryan Mills <bcmills@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Bryan Mills <bcmills@google.com >
2023-05-04 17:52:42 +00:00
Bryan C. Mills
ca59edaa5a
windows: use unsafe.Add instead of pointer arithmetic on a uintptr
...
The existing uintptr arithmetic is arguably valid because the
environment block is not located within the Go heap
(see golang/go#58625 ).
However, unsafe.Add (added in Go 1.17) expresses the same logic with
fewer conversions, and in addition avoids triggering the unsafeptr
vet check.
For golang/go#41205 .
Change-Id: Ifc509279a13fd707be570908ec779d8518b4f75b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/492415
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Bryan Mills <bcmills@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Bryan Mills <bcmills@google.com >
2023-05-03 21:21:24 +00:00
Alex Brainman
6c5289959c
windows: return error if DecomposeCommandLine parameter contains NUL
...
DecomposeCommandLine is documented to use CommandLineToArgv, and the
CommandLineToArgvW system call inherently does not support strings with
internal NUL bytes. This CL changes DecomposeCommandLine to reject those
strings with an error instead of panicking.
Fixes golang/go#58817
Change-Id: I22a026bf2e69344a21f04849c50ba19b6e7b2007
Reviewed-on: https://go-review.googlesource.com/c/sys/+/487695
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
2023-04-25 08:07:06 +00:00
Craig Davison
9524d496ef
windows/svc/mgr: Service.Control: populate Status when returning certain errors
...
Fixes golang/go#59015
Change-Id: I45f22049f3a05f807f78d20c9ed67c6c79e3d3c1
GitHub-Last-Rev: 929aeb4acb
GitHub-Pull-Request: golang/sys#156
Reviewed-on: https://go-review.googlesource.com/c/sys/+/484895
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-04-25 08:02:03 +00:00
Sebastian Soto
dbd8f99a5e
windows: add Service.ListDependentServices
...
This method allows a user to list all Windows services which are
dependent upon a given service.
This commit makes use of the EnumDependentServices Windows API call.
Without this, a user would have to iterate through each service on the
system, and check if the given service is listed in each service's
dependencies list.
The implementation of ListDependentServices is mostly the same as
Mgr.ListServices, as the API calls behave in the same way.
Fixes golang/go#56766
Change-Id: I9ec18c97afd02f48deef691ccdd5c26d6501add1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/451363
Reviewed-by: Than McIntosh <thanm@google.com >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
2023-04-14 09:16:30 +00:00
masshash
f25ff604a2
windows: add JobObjectInformationClass consts for QueryInformationJobObject
...
Reference:
https://learn.microsoft.com/en-us/windows/win32/api/jobapi2/nf-jobapi2-queryinformationjobobject#parameters
Change-Id: I0d10895ffc18b345f371cc7e0cbf8362fd67f71a
GitHub-Last-Rev: 28163917a0
GitHub-Pull-Request: golang/sys#154
Reviewed-on: https://go-review.googlesource.com/c/sys/+/481455
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: David Chase <drchase@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-04-10 20:17:12 +00:00
masshash
94933fc7d0
windows: fix constant values for JobObjectInformationClass
...
The constant values were incorrect and has been fixed in this CL.
Reference:
https://learn.microsoft.com/en-us/windows/win32/api/jobapi2/nf-jobapi2-setinformationjobobject#parameters
Change-Id: Id97e561b6838a18216617d86aa11c79b6b2f4095
GitHub-Last-Rev: cd1e32d2de
GitHub-Pull-Request: golang/sys#150
Reviewed-on: https://go-review.googlesource.com/c/sys/+/479375
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
2023-03-29 21:53:09 +00:00
Tobias Klauser
c10701f35e
windows: use unsafe.Slice in (*RawSockaddrAny).Sockaddr on windows
...
Same as CL 472035 did in package syscall.
Change-Id: I153dfaa19933a2707848e4183d6ca704c2800a0e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/472016
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-02-28 18:47:45 +00:00
PumpkinSeed
4fee21c923
windows: Add WSALookupService syscall wrappers
...
Create WSAQUERYSET struct, add LUP_XX constants,
implement wrappers around WSALookupService functions.
Fixes golang/go#54232
Change-Id: I26624df1b2b44cd8750350fe4526b806513913fe
Reviewed-on: https://go-review.googlesource.com/c/sys/+/461296
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Auto-Submit: Bryan Mills <bcmills@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Bryan Mills <bcmills@google.com >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Than McIntosh <thanm@google.com >
2023-02-08 14:13:08 +00:00
Bryan C. Mills
68f9dcb1f9
windows/debug/svc: buffer channel passed to signal.Notify
...
The os/signal package drops signal notifications if the channel is not
ready to receive immediately. To avoid dropping signals (for example,
while processing the other branch of a 'select'), the channel must be
buffered.
This fixes a mistake flagged by 'go vet ./...'.
Change-Id: I2a20dbe2aa27ae8ec009fff5e7be47e4409fdddd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/465595
Auto-Submit: Bryan Mills <bcmills@google.com >
Run-TryBot: Bryan Mills <bcmills@google.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: David Chase <drchase@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-02-06 18:23:23 +00:00
Davis Goodin
4112509618
windows/mkwinsyscall: write source to temp file if formatting fails
...
This change writes the unformatted Go source code to a temp file if
"format.Source" fails. Print the temp file path to the console to make
it easy to find. The source code is what causes formatting errors, and
it can be difficult to diagnose them without this context.
Fixes golang/go#57925
Change-Id: Ifa4d8a6e8bc5006357b0bc88afce5ba1d6fe0a48
Reviewed-on: https://go-review.googlesource.com/c/sys/+/463216
Reviewed-by: Michael Knyszek <mknyszek@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Auto-Submit: Bryan Mills <bcmills@google.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Bryan Mills <bcmills@google.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
2023-01-30 22:21:04 +00:00
Davis Goodin
71da690494
windows/mkwinsyscall: support "." and "-" in DLL name
...
This change adds "." and "-" support for DLL filenames in "//sys".
Supporting "." requires a change in how mkwinsyscall handles the
"= <filename>.<function>" syntax. Instead of assuming that only one "."
can appear in this string, now mkwinsyscall assumes that any additional
"." belongs to the filename.
Supporting "." also requires changing how Go identifiers are created for
each DLL. This change also allows mkwinsyscall to support "-". When
creating a Go identifier, "." and "-" in the DLL filename are replaced
with "_". Otherwise, mkwinsyscall would produce invalid Go code, causing
"format.Source" to fail.
Includes a test for the new behavior. There aren't yet any cases where
this code is executed while generating the x/sys/windows syscalls. The
syscalls "SetSocketMediaStreamingMode" from "windows.networking.dll" and
"WslRegisterDistribution" from "api-ms-win-wsl-api-l1-1-0.dll" can be
successfully called using this change, but these syscalls have no known
use in Go so they are not included in this change.
Fixes golang/go#57913
Change-Id: If64deeb8c7738d61520e7392fd2d81ef8920f08d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/463215
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
2023-01-30 19:10:05 +00:00
qmuntal
a6f4650873
windows: use UTF16FromString and UTF16ToString from syscall
...
This CL updates the windows.UTF16FromString and windows.UTF16ToString
implementation so they forward to their syscall counterparts.
The standard library uses these particular syscall functions across
the board as it can't depend on x/sys. This means that even if the
syscall API is frozen, the implementation still receives improvements
and bug fixes, such as CL 425054.
Porting CL 425054 to x/sys is possible, but for this particular case
I think it's better to just call the syscall package. This way both
repos will benefit from future improvements (which I plan to do soon).
Change-Id: I305c4409142d79a57008d7e6d0717fb8986fe906
Reviewed-on: https://go-review.googlesource.com/c/sys/+/462875
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
2023-01-20 18:56:19 +00:00
Johan Jansson
3ca3b18c8b
windows: add GetLargePageMinimum
...
https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-getlargepageminimum
Fixes golang/go#53900
Change-Id: If460e926af0cfa3fcf0d01422411abd01dae791c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/444975
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Jenny Rakoczy <jenny@golang.org >
Reviewed-by: Cherry Mui <cherryyz@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
2022-12-03 00:43:30 +00:00
Sebastiaan van Stijn
abe0a0adba
windows: replace uses of Close() with CloseHandle()
...
Since https://golang.org/cl/4600042 , Close is a straight wrapper of CloseHandle.
Change-Id: I45067e3cc649ea40deb88a8d9d223d7ca882ee7f
GitHub-Last-Rev: 076621a25c
GitHub-Pull-Request: golang/sys#139
Reviewed-on: https://go-review.googlesource.com/c/sys/+/441436
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
2022-10-10 16:03:19 +00:00
Tobias Klauser
6fa7a7ca2b
windows: allow calling WSASendto with nil Sockaddr
...
Same as CL 434535 did for the syscall package.
For golang/go#55845
Change-Id: I17f30152ae973b64ac65e08cefd5442e9bf19e2c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/435777
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Benny Siegert <bsiegert@gmail.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2022-09-28 14:00:15 +00:00
Michael Lelli
fb04ddd9f9
windows: add DWM window attribute related syscalls
...
https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmgetwindowattribute
https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute
Change-Id: I96a68f91f745601e93c0cc21cc4f1f4c5e7d8b9e
GitHub-Last-Rev: bdbe2ccb22
GitHub-Pull-Request: golang/sys#123
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399135
Reviewed-by: Bryan Mills <bcmills@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
Run-TryBot: Benny Siegert <bsiegert@gmail.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
2022-09-19 09:18:48 +00:00
Tobias Klauser
76c7481b51
all: simplify unsafe.Slice usage in {Byte,UTF16}PtrToString
...
On windows, use unsafe.Slice instead of unsafeheader as already the case
for unix and plan9.
The pointers are already *byte/*uint16, so the type conversion can be
omitted as well.
Change-Id: Ida7264cc0c1948bf563ed91d51e637edcdafb77a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/430515
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Bryan Mills <bcmills@google.com >
2022-09-13 15:31:01 +00:00
Michael Lelli
3275c407ce
windows: add window handle related system calls
...
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumwindows
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumchildwindows
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getclassnamew
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdesktopwindow
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getforegroundwindow
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindow
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindowunicode
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindowvisible
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getguithreadinfo
Change-Id: I21fbf47e1f459e86503e0e876b44cf47c98b2aa0
GitHub-Last-Rev: 242b79ffb8
GitHub-Pull-Request: golang/sys#122
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399134
Auto-Submit: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
Reviewed-by: Than McIntosh <thanm@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2022-09-13 12:03:20 +00:00
Abirdcfly
2296e01440
windows: remove duplicate words from comments
...
Change-Id: I94748559cc75c052ad3b70f7db4ec330b8a7226d
GitHub-Last-Rev: 43926d3c98
GitHub-Pull-Request: golang/sys#132
Reviewed-on: https://go-review.googlesource.com/c/sys/+/424474
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Run-TryBot: hopehook <hopehook@qq.com >
Reviewed-by: hopehook <hopehook@qq.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2022-08-18 16:13:05 +00:00
PumpkinSeed
66a0560e4e
windows: support Windows SOCKADDR_BTH structure
...
Implements the Windows SOCKADDR_BTH structure so
it can be used as a parameter in windows.Connect.
Fixes : golang/go#53929
Change-Id: Ibe54071897b60ecd91f44c7c0c894d831e56fe56
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419394
Reviewed-by: Than McIntosh <thanm@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
2022-07-31 17:38:59 +00:00
awaw fumin
1609e554cd
windows: add QueryWorkingSetEx
...
This change adds the QueryWorkingSetEx function for inspecting
the virtual memory details of pointers.
https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-queryworkingsetex
Change-Id: I2bc92bb0b65d34ed1caf88e4d368d64946dfcc5c
GitHub-Last-Rev: c5ac004352
GitHub-Pull-Request: golang/sys#124
Reviewed-on: https://go-review.googlesource.com/c/sys/+/402494
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Than McIntosh <thanm@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2022-07-30 10:01:32 +00:00
Dan Kortschak
31831981b6
windows: add remaining IpAdapterAddresses fields
...
Change-Id: I373baee2c82c376f4718d9296ae19ba8a28a2693
Reviewed-on: https://go-review.googlesource.com/c/sys/+/415814
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Than McIntosh <thanm@google.com >
Reviewed-by: David Chase <drchase@google.com >
Run-TryBot: Dan Kortschak <dan@kortschak.io >
TryBot-Result: Gopher Robot <gobot@golang.org >
2022-07-02 02:00:25 +00:00
Dan Kortschak
179beb0bd1
windows: add GetBestInterfaceEx
...
Change-Id: I56f9212420f96a0f275e79b4a9766b09b175254d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/413495
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Damien Neil <dneil@google.com >
Run-TryBot: Dan Kortschak <dan@kortschak.io >
Run-TryBot: Alex Brainman <alex.brainman@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
2022-07-01 22:57:01 +00:00
Russ Cox
b5fbb4746d
all: gofmt
...
Gofmt to update doc comments to the new formatting.
For golang/go#51082 .
Change-Id: I9a1c4b671c06820a1c383ee515f7884965fefa54
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399602
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Russ Cox <rsc@golang.org >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Russ Cox <rsc@golang.org >
2022-04-29 23:34:32 +00:00
Aayush Agrawal
84afa8d3f7
windows: do not change stdio handle inheritance
...
This CL stops changing inheritance flag of stdint, stdout and stderr handles.
Fixes golang/go#52498
Change-Id: Ic786f660b457af99a0a975b357c35c36bc7f2b48
Reviewed-on: https://go-review.googlesource.com/c/sys/+/402714
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Than McIntosh <thanm@google.com >
Reviewed-by: Peter Weinberger <pjw@google.com >
Run-TryBot: Than McIntosh <thanm@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2022-04-29 12:10:18 +00:00
Tobias Klauser
2edf467146
windows: optimize UTF16{,Ptr}FromString
...
Use strings.IndexByte in UTF16FromString instead of an open-coded loop.
Change-Id: Iac4374d9a58e40659147d35c9ab21bb89f5da629
Reviewed-on: https://go-review.googlesource.com/c/sys/+/393594
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2022-03-18 05:55:25 +00:00
Tobias Klauser
27bbf83dae
windows: add race annotations to Windows ReadFile and WriteFile
...
Follow CL 392774 which changed Windows ReadFile and WriteFile in package
syscall.
For golang/go#51618
Change-Id: I0f8046adb0f8145bd0775a3b5399647897cf19ce
Reviewed-on: https://go-review.googlesource.com/c/sys/+/392814
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2022-03-15 18:05:22 +00:00
Tobias Klauser
5a964db013
windows: add Get{Active,Maximum}ProcesorCount
...
Reference:
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getactiveprocessorcount
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getmaximumprocessorcount
Change-Id: Ifca711b82f112b395eac3b96266f63b5623881fc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/374435
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Patrik Nyblom <pnyb@google.com >
Trust: Patrik Nyblom <pnyb@google.com >
Run-TryBot: Patrik Nyblom <pnyb@google.com >
2022-01-11 09:28:08 +00:00
Jason A. Donenfeld
1d35b9e2eb
windows/svc: use NtQuerySystemInformation in IsWindowsService
...
This brings the algorithm more exactly in line with what .NET does for
the identically named function. Specifically, instead of using
OpenProcess, which requires rights that restricted services might not
have, we use NtQuerySystemInformation(SYSTEM_PROCESS_INFORMATION) to
find the parent process image name and session ID.
Fixes golang/go#44921 .
Change-Id: Ie2ad7521cf4c530037d086e61dbc2413e4e7777c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/372554
Trust: Jason Donenfeld <Jason@zx2c4.com >
Run-TryBot: Jason Donenfeld <Jason@zx2c4.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Patrik Nyblom <pnyb@google.com >
Trust: Patrik Nyblom <pnyb@google.com >
Run-TryBot: Patrik Nyblom <pnyb@google.com >
2021-12-16 02:10:12 +00:00