On Fri, May 10, 2019 at 1:43 PM Jason E. Aten <j.e.a...@gmail.com> wrote: > > I wondering if anyone can shed some light on > > a) how I might understand when the Go runtime inside a DLL is supposed to be > initialized;
In c-shared mode the function _rt0_amd64_windows_lib is supposed to be called when the DLL is initialized. That function, in runtime/rt0_windows_amd64.s, should start a new thread that will initialize the Go runtime. The Windows support for c-shared is very new, and perhaps there are some circumstances in which it does not arrange for rt0_amd64_windows_lib to be run when the DLL is loaded. I'm not sure but I think the code that sets this up is (*peFile).addInitArray in cmd/link/internal/ld/pe.go. So make sure that method is being called, and then make sure it is doing the right thing. Ian -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUtmOBPm8%3DVRncnzDDQmmm3CZAJ9U1wNbePX_%2B5D5d2Vg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.