/ Check-in [1602f6b5]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Change the xGetLastError() method on the windows VFS so that it continues to format an error message (if requested) but returns the system error code, rather than an SQLite status code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sqlite_system_errno
Files: files | file ages | folders
SHA1: 1602f6b53698bd3a1a4be218c2e3145dd895f1f1
User & Date: drh 2016-03-17 19:28:19
Context
2016-03-21
10:49
Merge updates from trunk. check-in: 86ab8643 user: drh tags: sqlite_system_errno
2016-03-17
19:28
Change the xGetLastError() method on the windows VFS so that it continues to format an error message (if requested) but returns the system error code, rather than an SQLite status code. check-in: 1602f6b5 user: drh tags: sqlite_system_errno
17:23
Simple test cases for sqlite3_system_errno() check-in: 185bc864 user: drh tags: sqlite_system_errno
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  5580   5580   **   }
  5581   5581   **
  5582   5582   ** However if an error message is supplied, it will be incorporated
  5583   5583   ** by sqlite into the error message available to the user using
  5584   5584   ** sqlite3_errmsg(), possibly making IO errors easier to debug.
  5585   5585   */
  5586   5586   static int winGetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
         5587  +  DWORD e = osGetLastError();
  5587   5588     UNUSED_PARAMETER(pVfs);
  5588         -  return winGetLastErrorMsg(osGetLastError(), nBuf, zBuf);
         5589  +  if( nBuf>0 ) winGetLastErrorMsg(e, nBuf, zBuf);
         5590  +  return e;
  5589   5591   }
  5590   5592   
  5591   5593   /*
  5592   5594   ** Initialize and deinitialize the operating system interface.
  5593   5595   */
  5594   5596   int sqlite3_os_init(void){
  5595   5597     static sqlite3_vfs winVfs = {