windows: cleanup mkwinsyscall argument list

CL 258038 improperly added a weird custom type to mkwinsyscall, rather
than doing the norm with wrapper functions. So, we revert the change to
mkwinsyscall and add the proper wrapper function to do the type
conversion.

Change-Id: I98134e4ce6bf4b52e1384fe84bddeedb00e18c0b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/268777
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This commit is contained in:
Jason A. Donenfeld
2020-11-10 21:10:18 +00:00
parent 215b40eba5
commit 35f3e6cf4a
3 changed files with 7 additions and 8 deletions
-5
View File
@@ -196,11 +196,6 @@ func (p *Param) SyscallArgList() []string {
s = fmt.Sprintf("unsafe.Pointer(%s)", p.Name)
case t == "bool":
s = p.tmpVar()
case t == "Coord":
// Convert a COORD into a uintptr (by fooling the type system). This code
// assumes the two SHORTs are correctly laid out; the "cast" to uint32 is
// just to get a pointer to pass.
s = fmt.Sprintf("*((*uint32)(unsafe.Pointer(&%s)))", p.Name)
case strings.HasPrefix(t, "[]"):
return []string{
fmt.Sprintf("uintptr(unsafe.Pointer(%s))", p.tmpVar()),