Commit 73a4d379 authored by Rob Pike's avatar Rob Pike

go.sys/windows: import syscall

Simple oversight.

LGTM=alex.brainman
R=alex.brainman
CC=golang-codereviews, rsc
https://golang.org/cl/121660043
parent 9828c4df
...@@ -657,6 +657,7 @@ const srcTemplate = ` ...@@ -657,6 +657,7 @@ const srcTemplate = `
package {{packagename}} package {{packagename}}
import "syscall"
import "unsafe"{{if windowsdot}} import "unsafe"{{if windowsdot}}
import "code.google.com/p/go.sys/windows"{{end}} import "code.google.com/p/go.sys/windows"{{end}}
......
...@@ -9,6 +9,7 @@ package windows ...@@ -9,6 +9,7 @@ package windows
import ( import (
errorspkg "errors" errorspkg "errors"
"sync" "sync"
"syscall"
"unicode/utf16" "unicode/utf16"
"unsafe" "unsafe"
) )
...@@ -762,7 +763,7 @@ func LoadConnectEx() error { ...@@ -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) { 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 r1 == 0 {
if e1 != 0 { if e1 != 0 {
err = error(e1) err = error(e1)
......
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"syscall"
"testing" "testing"
"code.google.com/p/go.sys/windows" "code.google.com/p/go.sys/windows"
...@@ -65,7 +66,7 @@ func ExampleLoadLibrary() { ...@@ -65,7 +66,7 @@ func ExampleLoadLibrary() {
if err != nil { if err != nil {
abort("GetProcAddress", err) abort("GetProcAddress", err)
} }
r, _, _ := windows.Syscall(uintptr(proc), 0, 0, 0, 0) r, _, _ := syscall.Syscall(uintptr(proc), 0, 0, 0, 0)
major := byte(r) major := byte(r)
minor := uint8(r >> 8) minor := uint8(r >> 8)
build := uint16(r >> 16) build := uint16(r >> 16)
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package windows package windows
import "syscall"
import "unsafe" import "unsafe"
var ( var (
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package windows package windows
import "syscall"
import "unsafe" import "unsafe"
var ( var (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment