Browse Source

go.sys/windows: import syscall
Simple oversight.

LGTM=alex.brainman
R=alex.brainman
CC=golang-codereviews, rsc
https://golang.org/cl/121660043

Rob Pike 11 years ago
parent
commit
73a4d37962

+ 1 - 0
windows/mksyscall_windows.go

@@ -657,6 +657,7 @@ const srcTemplate = `
 
 package {{packagename}}
 
+import "syscall"
 import "unsafe"{{if windowsdot}}
 import "code.google.com/p/go.sys/windows"{{end}}
 

+ 2 - 1
windows/syscall_windows.go

@@ -9,6 +9,7 @@ package windows
 import (
 	errorspkg "errors"
 	"sync"
+	"syscall"
 	"unicode/utf16"
 	"unsafe"
 )
@@ -762,7 +763,7 @@ func LoadConnectEx() error {
 }
 
 func connectEx(s Handle, name unsafe.Pointer, namelen int32, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *Overlapped) (err error) {
-	r1, _, e1 := Syscall9(connectExFunc.addr, 7, uintptr(s), uintptr(name), uintptr(namelen), uintptr(unsafe.Pointer(sendBuf)), uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), 0, 0)
+	r1, _, e1 := syscall.Syscall9(connectExFunc.addr, 7, uintptr(s), uintptr(name), uintptr(namelen), uintptr(unsafe.Pointer(sendBuf)), uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), 0, 0)
 	if r1 == 0 {
 		if e1 != 0 {
 			err = error(e1)

+ 2 - 1
windows/syscall_windows_test.go

@@ -8,6 +8,7 @@ import (
 	"io/ioutil"
 	"os"
 	"path/filepath"
+	"syscall"
 	"testing"
 
 	"code.google.com/p/go.sys/windows"
@@ -65,7 +66,7 @@ func ExampleLoadLibrary() {
 	if err != nil {
 		abort("GetProcAddress", err)
 	}
-	r, _, _ := windows.Syscall(uintptr(proc), 0, 0, 0, 0)
+	r, _, _ := syscall.Syscall(uintptr(proc), 0, 0, 0, 0)
 	major := byte(r)
 	minor := uint8(r >> 8)
 	build := uint16(r >> 16)

+ 1 - 0
windows/zsyscall_windows_386.go

@@ -3,6 +3,7 @@
 
 package windows
 
+import "syscall"
 import "unsafe"
 
 var (

+ 1 - 0
windows/zsyscall_windows_amd64.go

@@ -3,6 +3,7 @@
 
 package windows
 
+import "syscall"
 import "unsafe"
 
 var (