Aside: all 4 pairs of .lib's in lib\VC (and one in lib) are
exportlibs for the one pair of DLL's, which are actually /MD
but use the applink mechanism, as mentioned in the FAQ, to get
the right CRT -- assuming the EXE correctly compiles applink.c,
and the code you referenced does.
So this "should" work. And using the corresponding files from
my (DLL) build of 0.9.8m it sort of does (see below), but using
the SL distro I also get a crash. Stepping in the debugger I see
code in SL that is similar but not identical. It appears to be
built with VC++08 or possibly later, in particular for MSVCR90,
while I use (elderly but still functional) VC++6.0 and MSVCRT[d],
and the exit 0xC0000417 occurs in MSVCR90 appparently below _setmode.
You didn't say what version of VC++ (and CRT) you are using.
I believe this is a bug:
bss_file.c file_ctrl() case for SET_FILE_PTR uses UP_fsetmode
not UP_fsetmod so it doesn't uplink when it apparently should;
Correct, this is a bug. Being fixed.
instead uses direct _fileno and _setmode which faults in MSVCR90.
Correct, it's totally plausible. Well, it's basically the original
reason for introducing applink.
Also looking in the same area:
bss_file.c BIO_new_file() calls *ctrl BIO_C_SET_FILE_PTR with
flags not including BIO_FP_TEXT, which sets binary even if the
call said e.g. "w" or "wt"; on Windows this gives poor results
if the output actually is text and needs \n=CRLF translation.
Similarly BIO_{read,rw,write,append}_filename do SET_FILENAME
with flags not containing TEXT. Explicitly calling BIO_ctrl
SET_FILENAME with e.g. BIO_FP_WRITE|BIO_FP_TEXT does work.
And BIO_new_fp() although prototyped as 'close_flag' actually
honors TEXT as well, as documented.
Well, this one is a bitch. But it has nothing to do with applink. It was
like that from "day one." I mean the code appears in the first version
at http://cvs.openssl.org/rlog?f=openssl/crypto/bio/bss_file.c. Meaning
that I won't do anything about it at this point. A.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org