1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Move the shared-library loading routines into the OS portability layer,

thus enabling the os_win.c code to handle the character encoding
confusion of win95/nt/ce.  Ticket #2023. (CVS 3541)

FossilOrigin-Name: a1bcc6de578992b28924c1cf974ea58251454e2d
This commit is contained in:
drh
2006-12-21 01:29:22 +00:00
parent ec4d88fab5
commit 761df87ea5
8 changed files with 115 additions and 65 deletions

View File

@@ -1498,6 +1498,38 @@ static int allocateWinFile(winFile *pInit, OsFile **pId){
** with other miscellanous aspects of the operating system interface
****************************************************************************/
#if !defined(SQLITE_OMIT_LOAD_EXTENSION)
/*
** Interfaces for opening a shared library, finding entry points
** within the shared library, and closing the shared library.
*/
void *sqlite3WinDlopen(const char *zFilename){
HANDLE h;
void *zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
return 0;
}
if( isNT() ){
h = LoadLibraryW(zConverted);
}else{
#if OS_WINCE
return SQLITE_NOMEM;
#else
h = LoadLibraryA(zConverted);
#endif
}
sqliteFree(zConverted);
return (void*)h;
}
void *sqlite3WinDlsym(void *pHandle, const char *zSymbol){
return GetProcAddress((HANDLE)pHandle, zSymbol);
}
int sqlite3WinDlclose(void *pHandle){
return FreeLibrary((HANDLE)pHandle);
}
#endif /* !SQLITE_OMIT_LOAD_EXTENSION */
/*
** Get information to seed the random number generator. The seed
** is written into the buffer zBuf[256]. The calling function must