Documentation on W32
eliz at gnu.org
Sat Sep 15 11:48:33 CEST 2012
> Date: Sat, 15 Sep 2012 13:11:31 +0400
> From: LRN <lrn1986 at gmail.com>
> MinGW Win32API package does not have CertEnumCRLsInStore() prototype
> in its headers (easily fixable by declaring the prototype yourself)
> AND it doesn't export CertEnumCRLsInStore() in its import library for
> crypt32. THAT is the real problem. The only way to fix that is to
> patch mingw w32api package and rebuild it. I can't tell users to
> recompile one of the most basic packages in their system, obviously.
> Submitting a patch to mingw.org takes efforts, it will be in the queue
> for some unknown amount of time, and then one will have to wait for
> the next win32api release.
> Very little fun in that.
> So instead i load crypt32.dll manually and get CertEnumCRLsInStore()
> from it via GetProcAddress(), and put that address into
> Loaded_CertEnumCRLsInStore static global variable, so that it can be
> called later.
> I'm not insisting that this is the right way (though it certainly
> looks well enough; should even be thread-safe, unless someone does
> concurrent gnutls initialization)
This _is_ the right way, if we want to let users of existing MinGW
installation compile GnuTLS out of the box.
> The __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20
> check is there in case mingw.org fixes this after all (in that case
> increase the numbers to the release that adds CertEnumCRLsInStore() to
> the import library).
I would suggest to remove that condition. Loading the library
manually will always work, and has no downsides (except some
#ifdef's), whereas assuming that the MinGW w32api headers and import
libraries will be fixed in v3.21 is a gamble.
More information about the Gnutls-devel