/ Check-in [027251a6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Implement the platform specific part of the shared library interface on OS/2 (CVS 3618)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:027251a6fc9971b337172436137fabdafec1d264
User & Date: pweilbacher 2007-01-28 21:42:08
Context
2007-01-29
15:50
Add the randomhex() function as a built-in. (CVS 3619) check-in: a6001589 user: drh tags: trunk
2007-01-28
21:42
Implement the platform specific part of the shared library interface on OS/2 (CVS 3618) check-in: 027251a6 user: pweilbacher tags: trunk
21:12
Adapt returns of the os2Read() function to those of other platforms using checkin (3549) to prevent possible corruption (CVS 3617) check-in: ba76107c user: pweilbacher tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_os2.c.

   783    783   
   784    784   #ifndef SQLITE_OMIT_LOAD_EXTENSION
   785    785   /*
   786    786   ** Interfaces for opening a shared library, finding entry points
   787    787   ** within the shared library, and closing the shared library.
   788    788   */
   789    789   void *sqlite3Os2Dlopen(const char *zFilename){
   790         -  return 0;
          790  +  UCHAR loadErr[256];
          791  +  HMODULE hmod;
          792  +  APIRET rc;
          793  +  rc = DosLoadModule(loadErr, sizeof(loadErr), zFilename, &hmod);
          794  +  if (rc != NO_ERROR) return 0;
          795  +  return (void*)hmod;
   791    796   }
   792    797   void *sqlite3Os2Dlsym(void *pHandle, const char *zSymbol){
   793         -  return 0;
          798  +  PFN pfn;
          799  +  APIRET rc;
          800  +  rc = DosQueryProcAddr((HMODULE)pHandle, 0L, zSymbol, &pfn);
          801  +  if (rc != NO_ERROR) {
          802  +    /* if the symbol itself was not found, search again for the same
          803  +     * symbol with an extra underscore, that might be needed depending
          804  +     * on the calling convention */
          805  +    char _zSymbol[256] = "_";
          806  +    strncat(_zSymbol, zSymbol, 255);
          807  +    rc = DosQueryProcAddr((HMODULE)pHandle, 0L, _zSymbol, &pfn);
          808  +  }
          809  +  if (rc != NO_ERROR) return 0;
          810  +  return pfn;
   794    811   }
   795    812   int sqlite3Os2Dlclose(void *pHandle){
   796         -  return 0;
          813  +  return DosFreeModule((HMODULE)pHandle);
   797    814   }
   798    815   #endif /* SQLITE_OMIT_LOAD_EXTENSION */
   799    816   
   800    817   
   801    818   /*
   802    819   ** Get information to seed the random number generator.  The seed
   803    820   ** is written into the buffer zBuf[256].  The calling function must