Commit Graph

75 Commits

Author SHA1 Message Date
Alex Brainman
78d5f264b4 windows/svc: correct MOVL instruction in sys_amd64.s
Second argument of servicemain is a pointer. See

https://msdn.microsoft.com/en-us/library/windows/desktop/ms685138(v=vs.85).aspx

So amd64 assembler code should use MOVQ to read that value.
I probably copied 386 assembler code into amd64 and did not
adjust the code.

Broken code was used to pass parameters to the service, so
add some tests to verify that parameter passing works.

Fixes golang/go#24575

Change-Id: I89f8cad026ea13f8a5d78ff3e24b7236e27fc91f
Reviewed-on: https://go-review.googlesource.com/110160
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-01 09:27:40 +00:00
Kevin Burke
01acb38716 plan9, unix, windows: add paragraph breaks in docs
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>
2018-03-18 19:08:47 +00:00
Shamil Garatuev
f6cff0780e windows/registry: improve ReadSubKeyNames permissions
The existing implementation requires QUERY_VALUE and ENUMERATE_SUB_KEYS permissions to enumerate
subkeys, so, using registry key name limits, Stat function could be excluded
from methods body and improved method requires only ENUMERATE_SUB_KEYS permission

Registry elements size limits described there:
https://msdn.microsoft.com/library/windows/desktop/ms724872.aspx

Fixes golang/go#23869

Change-Id: Id96beb9b0b294f01cc6eb1bb53bee5f50d02ea7e
Reviewed-on: https://go-review.googlesource.com/95655
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-02-24 23:21:35 +00:00
Tobias Klauser
3ca7571cef windows: move Unsetenv into env_windows.go
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>
2018-01-08 22:11:41 +00:00
Brad Fitzpatrick
0131e684e8 windows: make GetDriveType use GetDriveTypeW
Fixes golang/go#23121

Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
Reviewed-on: https://go-review.googlesource.com/83855
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-13 21:08:10 +00:00
Scott Crunkleton
1006bb3484 windows: add DOMAIN_ALIAS_RID* values and Token.IsMember(*SID) (bool, error)
Change-Id: Ib5eead82c8571a4becd4ddf6b1b87f8dcb2eb23e
Reviewed-on: https://go-review.googlesource.com/80155
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-28 21:08:31 +00:00
Awn
0ac51a24ef windows: add process creation flags
Fixes golang/go#22801

Change-Id: I1f466e26bcdf52bdd0df09bd81e31dde10347862
Reviewed-on: https://go-review.googlesource.com/78618
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-11-19 03:26:26 +00:00
Scott Crunkleton
0dd5e194bb windows: add Volume Management functions
Change-Id: I6e587cf1b7e8532f45df03bf94e209aafe8f81fd
Reviewed-on: https://go-review.googlesource.com/78235
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-11-17 07:10:00 +00:00
Aman Gupta
4b45465282 windows: add WSA{Send,Recv}Msg
Change-Id: Id71df85e55e586b33fac66c5494291e11db8ed14
Reviewed-on: https://go-review.googlesource.com/76471
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-09 00:15:38 +00:00
Tobias Klauser
8eb05f94d4 windows: fix go vet warning
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>
2017-11-04 19:33:50 +00:00
Alex Brainman
176de74134 windows: change 'more then' to 'more than'
Copy CL 17488 into golang.org/x/sys/windows.

Change-Id: I4c6bf14982dd1fc2b8aa70ec16ad7b7c18e76bae
Reviewed-on: https://go-review.googlesource.com/73353
Reviewed-by: Tim Cooper <tim.cooper@layeh.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-26 00:44:44 +00:00
Kieran Colford
5d0dd06d1c windows: document panics in LazyProc
Some of LazyProc's methods will panic if the procedure cannot be
found. This patch documents that fact.

Change-Id: If446a61e001ae04eaba0ff08b512df4def8a00b7
Reviewed-on: https://go-review.googlesource.com/73450
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-10-25 22:41:41 +00:00
Tobias Klauser
9e4fff1f4d all: single space after period
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>
2017-10-25 20:39:07 +00:00
Hilko Bengen
8dbc5d05d6 windows: add GetProcAddressByOrdinal
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.

Fixes golang/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>
2017-10-17 06:39:10 +00:00
Jeet Parekh
062cd7e4e6 windows: fix NewCallback function
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.

Fixes golang/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>
2017-09-12 23:54:04 +00:00
Tobias Klauser
07c182904d windows: add missing event functions
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>
2017-08-21 09:33:53 +00:00
Tobias Klauser
d8f5ea21b9 windows: rename ztypes_* to types_*
The ztypes_* file names indicate that these are auto-generated while in
fact they aren't. Rename them to types_* to avoid this confusion.

Noticed by Brad Fitzpatrick in https://golang.org/cl/52670.

Change-Id: I75c8d0f4116dfb3a24ae9444509daf31524c35d6
Reviewed-on: https://go-review.googlesource.com/52950
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-03 14:03:59 +00:00
Tobias Klauser
d6c3f2be45 windows: add SetConsoleMode and GetConsoleScreenBufferInfo
Add the SetConsoleMode and GetConsoleScreenBufferInfo functions, as well
as the corresponding types and constants. For details see:

  https://docs.microsoft.com/en-us/windows/console/setconsolemode
  https://docs.microsoft.com/en-us/windows/console/getconsolescreenbufferinfo
  https://docs.microsoft.com/en-us/windows/console/console-screen-buffer-info-str

Change-Id: I17dcd62ffde12b5c94e1245b6836d067aea3dc6e
Reviewed-on: https://go-review.googlesource.com/52670
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-08-03 08:12:02 +00:00
Francesc Campoy
6faef541c7 golang.org/x/sys: fix typo in test
Change-Id: I5709137db7308934e627d866da1cc8aa5abca7db
Reviewed-on: https://go-review.googlesource.com/47310
Reviewed-by: Rob Pike <r@golang.org>
2017-07-05 19:55:40 +00:00
Awn
94b76065f2 windows: remove unreachable return statement in Proc.Call
Change-Id: I5bb10469bab144f5e42c7bcf6ee8717d3fd0d4e4
Reviewed-on: https://go-review.googlesource.com/47337
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-03 21:01:55 +00:00
Awn
0e01648653 windows: move memory protection constants so that they are all together
Change-Id: I0dee287567bdbf882e804bcd5ed7dcd6f748b30c
Reviewed-on: https://go-review.googlesource.com/47340
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-07-02 23:23:31 +00:00
Awn
d18155cb60 windows: add memory-related VirtualX calls and associated constants
Fixes golang/go#20086

Change-Id: Ifdc2561fe6cc125fa45a57bad9750f3f3f055e66
Reviewed-on: https://go-review.googlesource.com/47335
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-07-02 07:53:53 +00:00
Tyler Treat
f7928cfef4 windows/svc: add missing Accept commands
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>
2017-06-27 01:25:38 +00:00
Alex Brainman
fb4cac33e3 windows/svc/mgr: add Mgr.ListServices
Add API to list services installed on the system.

Fixes golang/go#20596

Change-Id: Ifa2f20ef15ccb962bd21d03788ce931dd45f2630
Reviewed-on: https://go-review.googlesource.com/45711
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-15 05:32:24 +00:00
helloPiers
dbc2be9168 windows/svc/mgr: correct documentation for args parameter of Mgr.CreateService
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.

Fixes golang/go#20440

Change-Id: I55a1ec3432b377082c018fe960114c96350e8978
Reviewed-on: https://go-review.googlesource.com/43714
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-21 16:21:43 +00:00
Julian Pastarmov
e62c3de784 windows: use RegisterServiceCtrlHandlerEx to allow for advanced notifications
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>
2017-05-18 05:52:01 +00:00
Mikio Hara
98b5b1e7e8 windows/svc/mgr: gofmt -w -s
Change-Id: I4ef179aacaf0694cd7661b4d9972ce85abeee8df
Reviewed-on: https://go-review.googlesource.com/43470
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-17 08:38:02 +00:00
Tamir Duberstein
1e4778a9a1 windows: add LoadGetSystemTimePreciseAsFileTime
Useful since GetSystemTimePreciseAsFileTime is Windows 8+.

Change-Id: I736bd0668aaf6ad086f6465b8b9a17f1943f0570
Reviewed-on: https://go-review.googlesource.com/43312
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-12 16:22:00 +00:00
Tamir Duberstein
f3918c30c5 windows: add SetStdHandle
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686244(v=vs.85).aspx

Change-Id: If7d460a9fb43767c0a3ee55e86faf3356162c81d
Reviewed-on: https://go-review.googlesource.com/39609
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-07 05:08:50 +00:00
Tamir Duberstein
ff24cb3cd8 windows: correct GetStdHandle definition
GetStdHandle: https://msdn.microsoft.com/en-us/library/windows/desktop/ms683231(v=vs.85).aspx
DWORD: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

Change-Id: I2fb794f85418e7846687911c4513886eb1803770
Reviewed-on: https://go-review.googlesource.com/39608
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-07 04:52:13 +00:00
Tamir Duberstein
39e3dc2744 windows: add GetSystemTimePreciseAsFileTime
https://msdn.microsoft.com/en-us/library/windows/desktop/hh706895(v=vs.85).aspx

Change-Id: I6e6a6642c041fad046ae7db725a27e7e94bfbfba
Reviewed-on: https://go-review.googlesource.com/39610
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 18:25:37 +00:00
Alex Brainman
f5a6bd4305 windows/registry: add code to access remote pc registry
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>
2016-12-04 22:43:27 +00:00
Alex Brainman
ca83bd2cb9 windows: run "go generate"
Change-Id: Ide01e409af85a5e2615ba647b44eda67bc14c07f
Reviewed-on: https://go-review.googlesource.com/33812
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-12-02 08:03:26 +00:00
Alex Brainman
a646d33e2e windows: make "go generate" command work on any OS
See issue golang/go#16368 for details.

Updates golang/go#16368

Change-Id: Ic3294385a350aee41887f59cbcf5b0af7742ff3b
Reviewed-on: https://go-review.googlesource.com/24952
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-17 07:19:31 +00:00
Alex Brainman
b518c298ac windows: use //go:uintptrescapes comment
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>
2016-07-12 23:56:41 +00:00
Alex Brainman
e82cb4d7df windows: remove non-existing now mksyscall_windows.go -xsys flag
Updates golang/go#15167

Change-Id: I58bd7e4e6ba88a2ffba11506e5ac0495de303b5b
Reviewed-on: https://go-review.googlesource.com/23023
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
2016-05-12 03:25:10 +00:00
Alex Brainman
042a8f53ce windows: add NewLazySystemDLL and use it in zsyscall_windows.go
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>
2016-04-06 06:33:47 +00:00
Alex Brainman
b323466d0b windows: remove unused asm.s
Change-Id: I1a2b96f71c9f39a46827e9414e1058894fd2a5e1
Reviewed-on: https://go-review.googlesource.com/21523
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-05 06:12:01 +00:00
Brad Fitzpatrick
a60af9cbbc windows: make all files in the package require windows
env_unset.go didn't have a the windows build tag (or filename), so it
was compiling for all operating systems and as a result had weird docs
at https://godoc.org/golang.org/x/sys/windows showing only Unsetenv.

Updates golang/gddo#188

Change-Id: I58f2c27c3d267660c97fce5a1b28da24988c62c8
Reviewed-on: https://go-review.googlesource.com/21460
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2016-04-02 02:39:15 +00:00
Brad Fitzpatrick
3dff6e19a5 windows: add LoadLibraryEx, add LazyDLL.System
Updates golang/go#14959

Change-Id: Ib91c359c3df919df0b30e584d38e56f79f3e3dc9
Reviewed-on: https://go-review.googlesource.com/21388
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-02 00:33:28 +00:00
Michael Matloob
320cb01ddb windows: Add windows build tag to asm.s
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>
2016-03-25 02:06:15 +00:00
Nick Petroni
20457ee8ea x/sys/windows/svc/mgr: allow other ServiceType values in CreateService
Preserves SERVICE_WIN32_OWN_PROCESS as the default.

Fixes golang/go#14019

Change-Id: I764016c1b5ec5e1fe88ed39b9803754af966b2f3
Reviewed-on: https://go-review.googlesource.com/18760
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
2016-01-21 06:23:56 +00:00
Alex Brainman
442cd60086 windows: copy latest changes from internal/syscall/windows
Copy of CL 4310, 6140, 17412, 17997 and 17998.

Change-Id: I7db8722a1c37f033d5ce6644859ef15c58289a46
Reviewed-on: https://go-review.googlesource.com/18552
Reviewed-by: Rob Pike <r@golang.org>
2016-01-13 01:14:10 +00:00
Alex Brainman
16e60ce682 windows/registry: do not panic when data is large
Allow registry blobs to be as large as 500MB

Copy of CL 14287.

Fixes golang/go#12493

Change-Id: I37b82fcf90ff2acef83c66016375fcae15e6eefc
Reviewed-on: https://go-review.googlesource.com/14288
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-09-09 02:29:49 +00:00
Daniel Johansson
98fc11432b windows/registry: copy latest changes from internal/syscall/registry
This CL includes changes from:

https://golang.org/cl/13929
https://golang.org/cl/13854

Part of fixing https://golang.org/issue/12015

Change-Id: I62e00e165d97d2349c89a783aed7fcbe9e0abd34
Reviewed-on: https://go-review.googlesource.com/14016
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-08-30 10:08:33 +00:00
Alex Brainman
0879c8a4d6 windows/registry: remove debugging dreg
copy of CL 13828 change

Change-Id: I48ea36171281eed8e59b92e130c762142fb94604
Reviewed-on: https://go-review.googlesource.com/13829
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-08-24 23:40:35 +00:00
Alex Brainman
2019c8d05e x/sys/windows: correct FormatMessage parameter
Second FormatMessage parameter lpSource is uintptr not uint32.

Update golang/go#11147.

Change-Id: Icaa67abaed93efdad41564b21f8e511e8f9694b1
Reviewed-on: https://go-review.googlesource.com/11165
Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-21 01:27:57 +00:00
Alex Brainman
b4e2899615 x/sys/windows/svc/mgr: skip tests when we are not authorised to manage services
It seems some Windows versions requires you to be
an Administrator to manage services. Just google for
"openscmanager access denied windows 2008" or similar.

Fixes golang/go#11156.

Change-Id: I4b09d244a61179ece7a1319234e5c3199423cbe9
Reviewed-on: https://go-review.googlesource.com/10933
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-12 01:44:55 +00:00
Alex Brainman
87f732a730 windows/registry: copy latest changes from internal/syscall/registry
This CL includes changes from:

http://golang.org/cl/9805
http://golang.org/cl/9806
http://golang.org/cl/9901

Change-Id: I1f41a8215f9f760c0d3b84596e37bf48bf4c9bc2
Reviewed-on: https://go-review.googlesource.com/10132
Reviewed-by: Rob Pike <r@golang.org>
2015-05-15 05:08:24 +00:00
Alex Brainman
8c234b998c windows: implement the environment functions by wrapping syscall
Make windows implementation similar to unix.

Updates golang/go#10803 (0intro will close the issue)

Change-Id: I6f6a7b1c84f54b1ec92f0346a9998df34235c71a
Reviewed-on: https://go-review.googlesource.com/10077
Reviewed-by: Rob Pike <r@golang.org>
2015-05-15 02:45:33 +00:00