Implement complementary LoadLibraryA shim under WCE. [from HEAD]
authorAndy Polyakov <appro@openssl.org>
Tue, 2 Aug 2005 11:03:42 +0000 (11:03 +0000)
committerAndy Polyakov <appro@openssl.org>
Tue, 2 Aug 2005 11:03:42 +0000 (11:03 +0000)
crypto/dso/dso_win32.c

index f019376b0f8bc7232bb7f281473d3859abe5c5cc..6f12d8c84143ad17a0b77ab6593a69bb18bce4e0 100644 (file)
@@ -85,6 +85,26 @@ 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) 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" ... */