I want to do click subscribe to the Windows event log in the Golang
How exactly to transfer the callback function?
EVT_SUBSCRIBE_CALLBACK is a function pointer, e.g.
typedef DWORD ( WINAPI *EVT_SUBSCRIBE_CALLBACK)(
EVT_SUBSCRIBE_NOTIFY_ACTION Action,
PVOID UserContext,
EVT_HANDLE Event
);
So my version looks like this:
func logCallback() syscall.Handle {
cb := func(_ uintptr, _ uintptr, _ uintptr) uint64 {
fmt.Printf("callback called %v", data)
return 0
}
ptr := syscall.NewCallback(cb)
return syscall.Handle(ptr)
}
I get a successfully signed handler without errors, but it still doesn't work. Any ideas why? Where should I look first?
source
share