mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
go.sys/windows: import syscall
Simple oversight. LGTM=alex.brainman R=alex.brainman CC=golang-codereviews, rsc https://golang.org/cl/121660043
This commit is contained in:
@@ -657,6 +657,7 @@ const srcTemplate = `
|
||||
|
||||
package {{packagename}}
|
||||
|
||||
import "syscall"
|
||||
import "unsafe"{{if windowsdot}}
|
||||
import "code.google.com/p/go.sys/windows"{{end}}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
package windows
|
||||
|
||||
import "syscall"
|
||||
import "unsafe"
|
||||
|
||||
var (
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
package windows
|
||||
|
||||
import "syscall"
|
||||
import "unsafe"
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user