layer is an enum in the dll. Gets converted to uint32 inside the dll before it makes the windows api call. priority is exposed as int16 in the exported dll api
Regards Amit On Saturday, August 4, 2018 at 10:53:40 AM UTC-7, Oryan Moshe wrote: > > Seems to me like type issues as well, doesn't seem like it for winapi to > receive int16. > > On Sat, Aug 4, 2018, 07:18 <amit....@gmail.com <javascript:>> wrote: > >> I am trying to call a DLL from go and I get an error "The parameter is >> incorrect" error when I try to call this function >> >> HANDLE Myopen(const char *filter, LAYER layer, INT16 priority, UINT64 >> flags) >> >> is my signature in the C file >> >> I call from golang using this >> >> Open(lazyP*syscall.LazyProc, filter string, layer int16, priority uint16, >> flags uint64) error { >> r1, r2, lastError := >> lazyP.Call(uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(filter))), >> uintptr(layer), >> uintptr(priority), >> uintptr(flags), >> ) >> >> fmt.Println("LastError", lastError) >> >> fmt.Println("R1", r1) >> >> fmt.Println("R2", r2) >> >> return nil >> } >> >> What am I missing here. This is the first time I am trying to load >> windows dlls so a little confused about what am I missing here >> >> >> Regards >> Amit >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.