Yes, simple casting isn't going to result in much other that emergency foot surgery. It's been some time since I did any WinCE work, but I seem to recall that there is only the W variant of most functions on Windows CE. Windows CE, if my memory is correct, is Unicode-only. The original patches that I did for 0.9.7 for CE converted a number of strings from ASCII to Unicode before calling Win32 API functions. I believe I used a for-loop to convert the strings since at the time I didn't know of the MultiByteToWideChar Win32 API function.
Regards, Steven -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Polyakov Sent: Tuesday, 28 June 2005 1:21 AM To: [email protected] Subject: Re: windows ce port patches > another patch which i create this one: > http://www.lfarkas.org/pocket-pc/openssl/openssl-ce.patch > which are mainly bugfix in the current openssl code and only win ce > specific so it could be apply without hurt other part of the openssl > code. As for crtypto/dso/dso_win32.c. - h = LoadLibrary(filename); + h = LoadLibrary((LPCTSTR)filename); Just casting to LPCTSTR doesn't make everything right. TCHAR is always WCHAR under CE, while filename is *always* char*. You either have to explicitly call LoadLibraryA or detect when conversion to WCHAR is due and convert. In HEAD branch it's suggested to fix with explicit call to LoadLibraryA. +#ifndef OPENSSL_SYS_WINCE sym = GetProcAddress(*ptr, symname); +#else + sym = GetProcAddress(*ptr, (LPCWSTR)symname); #endif Same applies to GetProcAddress. symnane is *always* char* and casting to LPCWSTR doesn't make it Unicode. See end of http://cvs.openssl.org/getfile/openssl/crypto/dso/dso_win32.c?v=1.22 for proper solution. Idea is to explicitly call GetProcAddressA when available [should be implemented in WCE>=3.0] or implement own GetProcAddressA shim, which would interface to "native" GetProcAddressW. As for crypto/rand/rand_win.c. Why? Then why buf[64]? Its usage below is controlled by more complicated #if statement, meaning that suggested patch will break something. As for crypto/rc2/rc2_skey.c. Would it be enough to initialize ki with NULL? Does it really have to be &c? A. ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [email protected] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [email protected] Automated List Manager [EMAIL PROTECTED]
