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
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
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
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
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
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
fd399679d2
plan9: skip pwd_plan9_go15.go unless on plan9
...
Fixes build.
Change-Id: Ib090c951b192ec5d4e145aa2d302d140f99b1417
Reviewed-on: https://go-review.googlesource.com/10099
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2015-05-15 03:08:47 +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
Alex Brainman
76b6ca6286
unix: include export_test.go only during unix build
...
Fixes plan9 and windows build.
Change-Id: I3d913441a4f3f3f3da82ab74ef165b91d05eb8d3
Reviewed-on: https://go-review.googlesource.com/10078
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2015-05-14 06:54:30 +00:00
Alex Brainman
1caf55eba1
windows: use FILE_FLAG_BACKUP_SEMANTICS in Utimes/UtimesNano
...
This is a copy of https://golang.org/cl/154020043 in the syscall package.
Fixes golang/go#10804
Change-Id: I6f6177e30c105c8065fdc8cc351e899090e160a9
Reviewed-on: https://go-review.googlesource.com/10076
Reviewed-by: Minux Ma <minux@golang.org >
2015-05-14 05:04:03 +00:00
Alex Brainman
65705ef9e9
windows/svc: add new package to help create and manage Windows services
...
Change-Id: I58bb446aaa387b31d8a9ff4217793a170b96a7e2
Reviewed-on: https://go-review.googlesource.com/9104
Reviewed-by: Rob Pike <r@golang.org >
2015-05-01 05:26:56 +00:00
Alex Brainman
bbc47fbbc8
windows/registry: mark string end with 0 before calling Windows ExpandEnvironmentStrings
...
Change-Id: I02bfcdeac44167d1dbeb15bcd5c82111fba3f527
Reviewed-on: https://go-review.googlesource.com/9234
Reviewed-by: Rob Pike <r@golang.org >
2015-04-23 02:52:27 +00:00
Alex Brainman
e961698092
windows/registry: add new package to manipulate Windows registry
...
Change-Id: Ia7c3d6250c041b95aa43ca5ca2a92251c480ef77
Reviewed-on: https://go-review.googlesource.com/8843
Reviewed-by: Rob Pike <r@golang.org >
2015-04-15 07:18:44 +00:00
Alex Brainman
ddd1cdae39
windows: fix race when allocating buffer for some windows syscalls
...
From main repo: https://go-review.googlesource.com/#/c/4940
Change-Id: I56fe7f6aedc0fd350abb94299ad500fcb80c049a
Reviewed-on: https://go-review.googlesource.com/8604
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2015-04-09 00:47:30 +00:00
Alex Brainman
40756181e9
windows: use go generate to build zsyscall_windows.go
...
Also remove some empty source files while we are at it.
Change-Id: Ia3a35b274a0428196aee63ee2daacc533285d0ea
Reviewed-on: https://go-review.googlesource.com/2530
Reviewed-by: Rob Pike <r@golang.org >
2015-03-15 23:59:38 +00:00
Alex Brainman
c2a8d2745f
sys: copying .gitattributes to all subrepositories
...
Fixes #9281
Change-Id: Ia4bb2e9af9f660f42202bb1d07920578cd0f9c3e
Reviewed-on: https://go-review.googlesource.com/2076
Reviewed-by: Minux Ma <minux@golang.org >
2014-12-23 09:43:20 +00:00
Alex Brainman
7c39a4f50c
go.sys/windows: add SIO_UDP_CONNRESET const
...
It was part of recently submitted CL 149510043.
LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/155320044
2014-11-06 11:00:43 +11:00
Alex Brainman
c17938b803
go.sys/windows: keep windows syscall pointers live
...
apply latest changes made to syscall/mksyscall_windows.go
LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/152200043
2014-10-06 10:48:58 +11:00
Alex Brainman
d1ee94ce83
go.sys/windows: apply latest syscall changes
...
71db3dc120af os: make SameFile handle paths like c:a.txt properly
ff34a3e84dc0 net: fix CNAME resolving on Windows
LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/130250043
2014-08-20 12:25:19 +10:00
Alex Brainman
7d091bfd99
go.sys/windows: use $GOROOT/src/pkg/syscall/mksyscall_windows.go to generate syscalls
...
Also zsyscall_windows_386.go and zsyscall_windows_amd64.go
have same contents, so merge them into single file.
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/124430043
2014-08-19 15:20:17 +10:00
Alex Brainman
70c4b52aa0
go.sys/windows: delete errors_windows.go (except APPLICATION_ERROR) and Errno
...
All consts in errors_windows.go (except APPLICATION_ERROR) were
"invented" at the start of windows port to have minimal impact on
existing Go packages. No point keeping them around.
Also remove Errno, since we will be using syscall.Errno everywhere anyway.
LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/128290044
2014-08-15 13:37:15 +10:00