Implement complementary LoadLibraryA shim under WCE.
This commit is contained in:
parent
1e1c5047f2
commit
b37fb16dcb
@ -85,6 +85,30 @@ static FARPROC GetProcAddressA(HMODULE hModule,LPCSTR lpProcName)
|
|||||||
# endif
|
# endif
|
||||||
# undef GetProcAddress
|
# undef GetProcAddress
|
||||||
# define GetProcAddress GetProcAddressA
|
# 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
|
#endif
|
||||||
|
|
||||||
/* Part of the hack in "win32_load" ... */
|
/* Part of the hack in "win32_load" ... */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user