Why some funcs in dll_windows.go can be declared without a function body

Why some funcs in dll_windows.go can be declared without a function body?
The code: https://golang.org/src/syscall/dll_windows.go

// Implemented in ../runtime/syscall_windows.go.
func Syscall(trap, nargs, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)

I used to be a windows C++ programmer, I can guess such functions are for invoking windows native library methods.
I realy want to know how to make it happen that the code

r0, _, e1 := Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)

[CreateFile, 294, zsyscall_windows.go]

invokes

func syscall_Syscall9(fn, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr) {
	c := &getg().m.syscall
	c.fn = fn
	c.n = nargs
	c.args = uintptr(noescape(unsafe.Pointer(&a1)))
	cgocall(asmstdcallAddr, unsafe.Pointer(c))
	return c.r1, c.r2, c.err
}

[syscall_Syscall9, 180, runtime\syscall_windows.go]

From my point of view, the signatures (invoking and invoked) are different, really interesting…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.