]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vendor: update vendored golang.org/x/sys/windows
authorTobias Klauser <tklauser@distanz.ch>
Thu, 20 Dec 2018 09:56:47 +0000 (10:56 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 20 Dec 2018 15:53:10 +0000 (15:53 +0000)
Update to x/sys git revision 074acd46bca67915925527c07849494d115e7c43

This fixes TestFormatMessage and TestExample on windows/arm by pulling
in CL 154560 and CL 154817.

Change-Id: Ic6495fe3072b5bcc7ea68efb3f0be5fc1fe4c238
Reviewed-on: https://go-review.googlesource.com/c/155297
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/vendor/golang.org/x/sys/windows/svc/svc_test.go
src/cmd/vendor/golang.org/x/sys/windows/syscall_windows_test.go
src/cmd/vendor/vendor.json

index 60eb4478e4093cb2765dae5d4c0d45d3d8e82752..feed8fabde676a685efdf2f97e266e38b7953a21 100644 (file)
@@ -121,13 +121,9 @@ func TestExample(t *testing.T) {
                t.Fatalf("Delete failed: %s", err)
        }
 
-       cmd := `Get-Eventlog -LogName Application -Newest 100` +
-               ` | Where Source -eq "myservice"` +
-               ` | Select -first 10` +
-               ` | Format-table -HideTableHeaders -property ReplacementStrings`
-       out, err := exec.Command("powershell", "-Command", cmd).CombinedOutput()
+       out, err := exec.Command("wevtutil.exe", "qe", "Application", "/q:*[System[Provider[@Name='myservice']]]", "/rd:true", "/c:10").CombinedOutput()
        if err != nil {
-               t.Fatalf("powershell failed: %v\n%v", err, string(out))
+               t.Fatalf("wevtutil failed: %v\n%v", err, string(out))
        }
        if want := strings.Join(append([]string{name}, args...), "-"); !strings.Contains(string(out), want) {
                t.Errorf("%q string does not contain %q", string(out), want)
index 0e27464e8c4c10af08517d39c3dc46624a606ef6..539dda2413ec25891ef9d2708855d87f85065f98 100644 (file)
@@ -10,7 +10,6 @@ import (
        "path/filepath"
        "syscall"
        "testing"
-       "unsafe"
 
        "golang.org/x/sys/windows"
 )
@@ -54,34 +53,14 @@ func TestWin32finddata(t *testing.T) {
 }
 
 func TestFormatMessage(t *testing.T) {
-       dll := windows.MustLoadDLL("pdh.dll")
-
-       pdhOpenQuery := func(datasrc *uint16, userdata uint32, query *windows.Handle) (errno uintptr) {
-               r0, _, _ := syscall.Syscall(dll.MustFindProc("PdhOpenQueryW").Addr(), 3, uintptr(unsafe.Pointer(datasrc)), uintptr(userdata), uintptr(unsafe.Pointer(query)))
-               return r0
-       }
-
-       pdhCloseQuery := func(query windows.Handle) (errno uintptr) {
-               r0, _, _ := syscall.Syscall(dll.MustFindProc("PdhCloseQuery").Addr(), 1, uintptr(query), 0, 0)
-               return r0
-       }
-
-       var q windows.Handle
-       name, err := windows.UTF16PtrFromString("no_such_source")
-       if err != nil {
-               t.Fatal(err)
-       }
-       errno := pdhOpenQuery(name, 0, &q)
-       if errno == 0 {
-               pdhCloseQuery(q)
-               t.Fatal("PdhOpenQuery succeeded, but expected to fail.")
-       }
+       dll := windows.MustLoadDLL("netevent.dll")
 
+       const TITLE_SC_MESSAGE_BOX uint32 = 0xC0001B75
        const flags uint32 = syscall.FORMAT_MESSAGE_FROM_HMODULE | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS
        buf := make([]uint16, 300)
-       _, err = windows.FormatMessage(flags, uintptr(dll.Handle), uint32(errno), 0, buf, nil)
+       _, err := windows.FormatMessage(flags, uintptr(dll.Handle), TITLE_SC_MESSAGE_BOX, 0, buf, nil)
        if err != nil {
-               t.Fatalf("FormatMessage for handle=%x and errno=%x failed: %v", dll.Handle, errno, err)
+               t.Fatalf("FormatMessage for handle=%x and errno=%x failed: %v", dll.Handle, TITLE_SC_MESSAGE_BOX, err)
        }
 }
 
index 1dcf16d5a957958d0c2408b26130b6a3701ebae9..b44f022457098d8939a419e909fb18ab0fc28831 100644 (file)
                        "revisionTime": "2018-12-13T07:38:38Z"
                },
                {
-                       "checksumSHA1": "s+lofQ+SCdhmy0cQp9FpdQncuuI=",
+                       "checksumSHA1": "WoSat9PbqZFXREek5bkUBr256/Q=",
                        "path": "golang.org/x/sys/windows",
-                       "revision": "90868a75fefd03942536221d7c0e2f84ec62a668",
-                       "revisionTime": "2018-08-01T20:46:00Z"
+                       "revision": "074acd46bca67915925527c07849494d115e7c43",
+                       "revisionTime": "2018-12-18T18:24:21Z"
                },
                {
                        "checksumSHA1": "yEg3f1MGwuyDh5NrNEGkWKlTyqY=",
                        "revisionTime": "2018-08-01T20:46:00Z"
                },
                {
-                       "checksumSHA1": "ZDwqsuoZqQq/XMQ0R0dJ4oK41lU=",
+                       "checksumSHA1": "sL1Y17u+ri3uepsUZOZ4uopiPEg=",
                        "path": "golang.org/x/sys/windows/svc",
-                       "revision": "90868a75fefd03942536221d7c0e2f84ec62a668",
-                       "revisionTime": "2018-08-01T20:46:00Z"
+                       "revision": "074acd46bca67915925527c07849494d115e7c43",
+                       "revisionTime": "2018-12-18T18:24:21Z"
                },
                {
                        "checksumSHA1": "e9KJPWrdqg5PMkbE2w60Io8rY4M=",