Richard Levitte - VMS Whacker wrote:
> 
> From: Dr S N Henson <[EMAIL PROTECTED]>
> 
> drh> An issue has arisen with Windows DLLs and the new ASN1 code...
> [...]
> drh> AFAICS this needs a "DATA" declaration in the DEF file *and* a custom
> drh> header declaration otherwise it doesn't work (linker errors or invalid
> drh> data).
> drh>
> drh> The header declaration is where things get more interesting. When
> drh> compiling code that is going to be linked into the DLL you need to
> drh> precede the variable with:
> drh>
> drh> _declspec( dllexport )
> drh>
> drh> however when linking to these variables you need:
> drh>
> drh> _declspec( dllimport )
> drh>
> drh> So the declaration needs to be different according to whether the DLL
> drh> code is being compiled or linked to.
> 
> drh> Any thoughts?
> 
> >From a VMS point of view, this is partly an issue as well.  For
> starters, you should probably use the macros OPENSSL_EXTERN and
> OPENSSL_GLOBAL which are defined in e_os2.h (and will need extra
> definitions for the Win32 case.  Of course, what you say above means
> that OPENSSL_EXTERN will have different values depending on if you're
> building the DLL or using it.  That's pretty easy to do if we use a
> macro BUILD_SHLIB as a flag.  Of course, if any other DLL needs to
> reexport OpenSSL symbols (is that what you meant?), it wll have to
> defined BUILD_SHLIB as well...
> 

Well the issue with additional DLLs is that they may need to import some
variables defined in OpenSSL and export some of their own which the new
ASN1 macros create. So the stuff in the OpenSSL headers needs to be the
import declaration whereas stuff in the additional DLLs headers needs to
be the export declaration when the DLL is being built.

You can extend this so an additional application/DLL may for example
need to import things from OpenSSL and the first DLL and export its own
stuff.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to