diff options
author | Andy Polyakov <appro@openssl.org> | 2005-08-02 10:55:43 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2005-08-02 10:55:43 +0000 |
commit | b37fb16dcb004e3c5fbade80bc8b82e676235cad (patch) | |
tree | 0c3568228044f7f14d95035f75a8e58eab5f707c /crypto/dso/dso_win32.c | |
parent | 1e1c5047f278418c0553fd14d3bcd33620684324 (diff) |
Implement complementary LoadLibraryA shim under WCE.
Diffstat (limited to 'crypto/dso/dso_win32.c')
-rw-r--r-- | crypto/dso/dso_win32.c | 24 |
1 files changed, 24 insertions, 0 deletions
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<len_0;i++) fnamw[i]=(WCHAR)lpLibFileName[i]; + + return LoadLibraryW(fnamw); + } #endif /* Part of the hack in "win32_load" ... */ |