From: Andy Moreton <andrewjmoreton@gmail.com>
Date: Mon, 26 Aug 2019 23:56:06 +0100
> Looks like something is wrong with how I'm using gnutls_free when it
> comes from the DLL. I need to look into that.
Found it I think. gnutls_free is a pointer of type gnutls_free_function,
so the value returned from GetProcAddress is a data pointer, not a
function address. Something like the following patch appears to work
i.e. no longer crashes with the recipe above.
Yes, thanks. I was struggling with the same thing, but evidently
there's a limit to what I can do after 11PM at my age ;-)
If this is the right fix then we will need to add e.g. DEF_DLL_DATA and
LOAD_DLL_DATA macros for runtime import of data (and an equivalent to
get_proc_addr to use the right types for runtime data imports).
I think there's no need to invent harness for a single user, we can
simply do that by hand. Please try the patch below, it's against the
current master (it also removes the unnecessary intermediate buffer
allocation while at that).