mirror of
https://github.com/golang/sys.git
synced 2026-02-08 03:36:03 +03:00
windows: fix NewCallback function
It has been suggested to migrate from syscall to golang.org/x/sys The NewCallback function works in syscall. But the golang.org/x/sys/windows NewCallback function did not work. Since golang.org/x/sys/windows already imports syscall, the NewCallback function now calls syscall.NewCallback. Fixes golang/go#21831 Change-Id: I5cabd8540777b398a288308a66ae20896ed4a1db Reviewed-on: https://go-review.googlesource.com/63250 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This commit is contained in:
committed by
Alex Brainman
parent
033028a6b4
commit
062cd7e4e6
@@ -71,12 +71,17 @@ func UTF16PtrFromString(s string) (*uint16, error) {
|
||||
|
||||
func Getpagesize() int { return 4096 }
|
||||
|
||||
// Converts a Go function to a function pointer conforming
|
||||
// to the stdcall or cdecl calling convention. This is useful when
|
||||
// interoperating with Windows code requiring callbacks.
|
||||
// Implemented in runtime/syscall_windows.goc
|
||||
func NewCallback(fn interface{}) uintptr
|
||||
func NewCallbackCDecl(fn interface{}) uintptr
|
||||
// NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention.
|
||||
// This is useful when interoperating with Windows code requiring callbacks.
|
||||
func NewCallback(fn interface{}) uintptr {
|
||||
return syscall.NewCallback(fn)
|
||||
}
|
||||
|
||||
// NewCallbackCDecl converts a Go function to a function pointer conforming to the cdecl calling convention.
|
||||
// This is useful when interoperating with Windows code requiring callbacks.
|
||||
func NewCallbackCDecl(fn interface{}) uintptr {
|
||||
return syscall.NewCallbackCDecl(fn)
|
||||
}
|
||||
|
||||
// windows api calls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user