From b37fb16dcb004e3c5fbade80bc8b82e676235cad Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 2 Aug 2005 10:55:43 +0000 Subject: [PATCH] Implement complementary LoadLibraryA shim under WCE. --- crypto/dso/dso_win32.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crypto/dso/dso_win32.c b/crypto/dso/dso_win32.c index 59ff10a15d..9c94123105 100644 --- a/crypto/dso/dso_win32.c +++ b/crypto/dso/dso_win32.c @@ -85,6 +85,30 @@ static FARPROC GetProcAddressA(HMODULE hModule,LPCSTR lpProcName) # endif # undef GetProcAddress # define GetProcAddress GetProcAddressA + +static HINSTANCE LoadLibraryA(LPCSTR *lpLibFileName) + { + WCHAR *fnamw; + size_t len_0=strlen(lpLibFileName)+1,i; + +#ifdef _MSC_VER + fname = (WCHAR *)_alloca (len_0*sizeof(WCHAR)); +#else + fnamw = (WCHAR *)alloca (len_0*sizeof(WCHAR)); +#endif + if (fnamw == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return NULL; + } + +#if defined(_WIN32_WCE) && _WIN32_WCE>=101 + if (!MultiByteToWideChar(CP_ACP,0,lpLibFileName,len_0,fnamw,len_0)) +#endif + for (i=0;i