> From: Quickling [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 22, 2001 11:53 AM
> >[re conflicting Win32 C runtimes]
> Not sure about Cory, but in my case this is not trouble: I built the SSL
> libraries with the same compiler and linker as I use for my project -
> everybody's using the same DLLs and libraries - multithreaded. Anyway, if
> I can guarantee that while an SSL function is in use another will not be
> called until the first has returned, it shouldn't really matter to SSL
> whether I'm using threads or not... right? The only thing important then
> is the order in which I am calling the functions.
You might think that, but in fact the various MS C runtimes are not
necessarily interoperable within a process. If you have a DLL that was
built against, say, the MT DLL runtime (MSVCRT), and an application that
calls it which was built against, say, the MT static runtime (LIBCMT), you
have various potential interaction problems. Memory allocated by the
application cannot be freed by the DLL and vice versa. FILE structures
cannot reliably be shared between them. And so on. While MSDN suggests
some rules for mixing runtimes, your best bet is to just use the same one
everywhere.
Further, if a DLL is ever to be called by a multi-threaded application, MS
recommends linking the DLL against one of the MT runtimes. If you can
guarantee that there will only be one call into the DLL in the entire
process at any time, you may be safe with a single-threaded runtime as far
as threading goes - but why take the chance, especially since you'll still
be vulnerable to runtime-mixing problems?
(On a side note, I'd like to point out how lame all of this is. MS needs to
make the MT DLL runtime the default, deprecate all the other versions, and
then practice decent DLL hygiene, like the grown-up operating systems do.)
Michael Wojcik [EMAIL PROTECTED]
MERANT
Department of English, Miami University
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]