Commit Graph

42 Commits

Author SHA1 Message Date
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
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
Yasuhiro Matsumoto
61f8ff32f5 windows: change Readlink to handle junction
Related issue golang/go#10150

Change-Id: I38e3e13238624655bb828d501bc865ff8a4312e9
Reviewed-on: https://go-review.googlesource.com/7493
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-04-10 22:14:33 +00:00
Pawel Knap
d008cdcf32 go.sys/windows: Add missing FILE_NOTIFY_CHANGE_SECURITY filter
According to ReadDirectoryChangesW documentation, this parameter is
perfectly valid and its absence in current enumeration makes it incomplete.

Internal flags like FILE_NOTIFY_CHANGE_EA were not added.

Change-Id: I9d4182dcfa67e67289c0cc35155a64bf5e5152db
Reviewed-on: https://go-review.googlesource.com/6560
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-04-09 09:14:14 +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
Carlos Castillo
5b683257ff x/sys/windows: Add GetComputerNameEx
Provides access to the GetComputerNameEx syscall.

This mirrors the change golang.org/cl/5852 in the standard library, but
provides public access to all name types provided by windows.

Change-Id: I5fbad5abe721de70e9d2b5dda2fafb7a9c419220
Reviewed-on: https://go-review.googlesource.com/6320
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-03-04 23:29:43 +00:00
David Symonds
1da8e6ee6d sys: add import comments.
Change-Id: I0ebbb4f2da41bea7871f893332f2e4847b1bfefa
Reviewed-on: https://go-review.googlesource.com/1241
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:46:33 +00:00
Andrew Gerrand
dea3d764c2 go.sys: use golang.org/x/... import paths
LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/171050043
2014-11-10 08:56:17 +11: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
Brad Fitzpatrick
c65f27ffe6 go.sys: add Unsetenv
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/153810043
2014-10-01 12:10:37 -07:00
Rob Pike
c1f6f8bcc5 go.sys/unix: use "use" in syscall interface
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/144980043
2014-09-16 13:36:53 -07:00
Rob Pike
9782d98bb0 go.sys/windows: delete StartProcess and Exec
These are being deleted from go.sys because in general they can
only be implemented in close coordination with the runtime.

LGTM=alex.brainman
R=alex.brainman
CC=golang-codereviews
https://golang.org/cl/132010043
2014-08-21 16:07:11 -07: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
Rob Pike
4faa336c56 go.sys/windows: use syscall.Errno for windows errors
If we use a local type, it won't compare properly with errors from
the rest of the standard library. Errors are the one type from syscall
that propagates through the system, so it's important to have only
one type for them.

mkerrors_windows.sh is gone, so:
 - rename zerrors_windows.go and delete its DO NOT EDIT mark
 - delete the contentless zerrors_windows_*.go files

LGTM=rsc
R=rsc
CC=alex.brainman, golang-codereviews
https://golang.org/cl/122600043
2014-08-14 10:28:19 -07:00
Rob Pike
73a4d37962 go.sys/windows: import syscall
Simple oversight.

LGTM=alex.brainman
R=alex.brainman
CC=golang-codereviews, rsc
https://golang.org/cl/121660043
2014-08-13 17:45:19 -07:00
Rob Pike
7118195da3 go.sys/windows: grab Syscall interface from the standard syscall package
Also provide stubs to call loadlibrary and getprocaddress, which are implemented
for package syscall by runtime/syscall_windows.goc.
Should get the windows go.sys build closer to green.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/126170043
2014-08-13 14:08:39 -07:00
Rob Pike
279b3782ad go.sys: fix imports to cgc/p/go.sys, add build tags
Approach but probably not achieve a green build.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/126120043
2014-08-12 22:59:00 -07:00
Rob Pike
8442dd2c63 go.sys: update package names
Semi-automatic migration from package syscall to package {plan9,windows,unix}.
No builds attempted yet, but this gets a lot of noise behind us so subsequent
CLs will be more concise and easier to follow.
Subsequent CLs will have semantic content.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/121520043
2014-08-11 15:58:26 -07:00
Rob Pike
20acc5cf31 go.sys: copy files from syscall package to go.sys/{plan9,windows,unix}
This CL copies to each package of go.sys the files from syscall it will need.
Different directories have different files, but these:
        mkall.sh
        str.go
        syscall.go
        mksyscall.pl
        race.go
        race0.go
        syscall_test.go
are copied to all three.
No changes yet, these are just copies. They are not ready to use yet:
package names are wrong, for starters. But this clean copy will make
it easier to follow the changes as the packages are enabled.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/126960043
2014-08-11 14:48:46 -07:00