This CL is a copy of CL 106275 (see CL 106275 for details).
It introduces CertInfo, CertTrustListInfo and CertRevocationCrlInfo
types. It uses pointers to new types instead of uintptr in CertContext,
CertSimpleChain and CertRevocationInfo.
CertRevocationInfo, CertChainPolicyPara and CertChainPolicyStatus types
have uintptr field that can be pointer to many different things
(according to Windows API). So this CL introduces Pointer type to be
used for those cases.
Fixesgolang/go#25797
Change-Id: I7797ddc6daf3e67b7eab69ab9fbf4d51650f8b6a
Reviewed-on: https://go-review.googlesource.com/118797
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Currently the doc string forms one run-on sentence when viewed in
a browser. Add an additional newline so the text is presented in
a browser the same way it is in the source code.
Change-Id: If93e45c5aec9edd195c6bf36cb757c5146368507
Reviewed-on: https://go-review.googlesource.com/101284
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Unsetenv was in its own file for Go 1.4 compatibility. This version is
no longer supported, so move Unsetenv with the other environment
specific functions.
Change-Id: I63d67e2a9e4d7651be79c2e72a7f27fe0fac68c4
Reviewed-on: https://go-review.googlesource.com/86539
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Now that go tip runs vet during go test (CL 74356), the x/sys/windows
test fails due to the following vet error:
syscall_windows_test.go:84: Fatal call has possible formatting directive %x
Fix it by using Fatalf instead.
Change-Id: I02536312c00bc9002400b29b5b5acef879a0e51a
Reviewed-on: https://go-review.googlesource.com/75973
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Follow CL 20022 and consistently use single space after a period in
documentation.
Generated with:
$ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])')
Change-Id: Ia29ad823668f060e81293e848a79fc4b4857d94b
Reviewed-on: https://go-review.googlesource.com/73530
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The current GetProcAddress implementation only resolves functions in
DLLs by name. Add GetProcAddressByOrdinal that allows resolving
functions by ordinal number, using the same GetProcAddress call from
kernel32.dll in the background.
This is particularly useful for some functions (e.g. IsOS from
shlwapi.dll in some older versions of Windows) that cannot be found by
name.
Fixesgolang/go#16507
Change-Id: Ib5fba7568c365a0aa2491c1261876b3a3929ec3d
Reviewed-on: https://go-review.googlesource.com/70690
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
It has been suggested to migrate from syscall to golang.org/x/sys
The NewCallback function works in syscall. But the golang.org/x/sys/windows NewCallback function did not work.
Since golang.org/x/sys/windows already imports syscall, the NewCallback function now calls syscall.NewCallback.
Fixesgolang/go#21831
Change-Id: I5cabd8540777b398a288308a66ae20896ed4a1db
Reviewed-on: https://go-review.googlesource.com/63250
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Add CreateEventEx, OpenEvent, ResetEvent and PulseEvent.
Also change eventAttrs to use the local definition of the
SecurityAttributes type, not the one from syscall.
GetConsoleScreenBufferInfo is also changed by re-running 'go generate'
to pass a pointer to ConsoleScreenBufferInfo (instead of a pointer to
pointer).
Change-Id: I08dff4360186b04c55fd0362e31920f38206157b
Reviewed-on: https://go-review.googlesource.com/56110
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add the remaining AcceptX commands (AcceptParamChange,
AcceptNetBindChange, AcceptHardwareProfileChange, AcceptPowerEvent, and
AcceptSessionChange) to the windows/svc package. Also add support for
these to updateStatus such that a service can actually accept these
commands.
Change-Id: I11191e7798489b3222a3e76ba55129f10fd202ab
Reviewed-on: https://go-review.googlesource.com/46722
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The args passed to Mgr.CreateService end up as the command-line
arguments (available via os.Args), not as the args passed to
Svc.Handler.Execute.
Fixesgolang/go#20440
Change-Id: I55a1ec3432b377082c018fe960114c96350e8978
Reviewed-on: https://go-review.googlesource.com/43714
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This allows services written with this library to register for more
advanced notifications like SERVICE_CONTROL_DEVICEEVENT for example.
Also the code now exposes the service status handle through a new
api call, because the handle is needed to register for such
notifications and can not be obtained by any other means.
Change-Id: I80796e1dd9d94ec9d6c236d0413b17288c67fe1f
Reviewed-on: https://go-review.googlesource.com/42812
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Introduce OpenRemoteKey function that opens some
root registry keys on remote computer.
Also add PERFORMANCE_DATA key, since it is one of
root keys accessible via OpenRemoteKey.
Change-Id: I738fdfee52a34acd4dc09ddb91fcf0e4c707bd83
Reviewed-on: https://go-review.googlesource.com/33814
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
CL 24551 introduced //go:uintptrescapes comment to make
syscall.Proc.Call and syscall.LazyProc.Call parameters escape.
Use new comment in this package too.
Updates golang/go#16035.
Change-Id: I57ec3b4778195ca4a1ce9a8eec331f0f69285926
Reviewed-on: https://go-review.googlesource.com/24870
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
If we want new secure DLL approach to be adopted, we should make
conversion as simple as possible to explain and implement.
I think that replacing
syscall.NewLazyDLL(...) -> windows.NewLazySystemDLL(...)
is easier than
syscall.NewLazyDLL(...) -> &windows.LazyDLL{Name: ..., System: true}
So I propose we introduce convenience function NewLazySystemDLL.
$GOROOT/src/mksyscall_windows.go changes in the following CL.
Change-Id: If3432aff301c347cb355e4e837834696191b2219
Reviewed-on: https://go-review.googlesource.com/21592
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This allows linux binaries to have bazel-style dependencies on x/sys/windows.
Change-Id: I248fe62e045705f409e5d96842ed52d0764ae68f
Reviewed-on: https://go-review.googlesource.com/21081
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>