* Chandan Kumar <
cks...@gmail.com> [220901 07:29]:
> Hi,
>
> I am trying to implement a program in which I need the function *LogonUserA
> function (winbase.h) *from windows API and this function is not available
> in the package *
golang.org/x/sys/windows* so any advice would be helpful.
First, you need to determine in which DLL the function is. Suppose it
is in kernel32.dll:
import (
"
golang.org/x/sys/windows"
"syscall"
"unsafe"
)
var (
modKernel32 = windows.NewLazySystemDLL("kernel32.dll")
procLogonUser = modKernel32.NewProc("LogonUserA")
)
func LogonUser(«arguments») («results», err error) {
var r1, ..., e1 = syscall.Syscall(procLogonUser.Addr(), «converted arguments», «fill with 0»)
// Convert results and error and return them.
}
I didn't bother to look up what the real arguments are to LogonUser, but
hopefully this gives you enough info to figure it out. Pointers will
need to be converted like this: uintptr(unsafe.Pointer(userName)) when
passing them to Syscall.
If you need more help, post the function signature for LogonUser.
...Marvin