/ Check-in [ec13544c]
Login

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

Overview
Comment:On WinCE, fill in the winFile structure after winceCreateLock has succeeded.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ec13544ce336e8a02b34d574ced5912b06c82c0e
User & Date: mistachkin 2013-02-13 22:54:03
Context
2013-02-14
16:16
Verify that the schema has not changed before running PRAGMA table_info, index_list, index_info, and foreign_key_list. check-in: 82952d08 user: drh tags: trunk
2013-02-13
22:54
On WinCE, fill in the winFile structure after winceCreateLock has succeeded. check-in: ec13544c user: mistachkin tags: trunk
14:04
Add recent API additions to the extension mechanism. check-in: 7e10a62d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  2072   2072     winFile *pFile = (winFile*)id;
  2073   2073   
  2074   2074     assert( id!=0 );
  2075   2075   #ifndef SQLITE_OMIT_WAL
  2076   2076     assert( pFile->pShm==0 );
  2077   2077   #endif
  2078   2078     OSTRACE(("CLOSE %d\n", pFile->h));
         2079  +  assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE );
  2079   2080     do{
  2080   2081       rc = osCloseHandle(pFile->h);
  2081   2082       /* SimulateIOError( rc=0; cnt=MX_CLOSE_ATTEMPT; ); */
  2082   2083     }while( rc==0 && ++cnt < MX_CLOSE_ATTEMPT && (sqlite3_win32_sleep(100), 1) );
  2083   2084   #if SQLITE_OS_WINCE
  2084   2085   #define WINCE_DELETION_ATTEMPTS 3
  2085   2086     winceDestroyLock(pFile);
................................................................................
  3683   3684     /* Assert that the upper layer has set one of the "file-type" flags. */
  3684   3685     assert( eType==SQLITE_OPEN_MAIN_DB      || eType==SQLITE_OPEN_TEMP_DB 
  3685   3686          || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL 
  3686   3687          || eType==SQLITE_OPEN_SUBJOURNAL   || eType==SQLITE_OPEN_MASTER_JOURNAL 
  3687   3688          || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL
  3688   3689     );
  3689   3690   
  3690         -  assert( id!=0 );
  3691         -  UNUSED_PARAMETER(pVfs);
         3691  +  assert( pFile!=0 );
         3692  +  memset(pFile, 0, sizeof(winFile));
         3693  +  pFile->h = INVALID_HANDLE_VALUE;
  3692   3694   
  3693   3695   #if SQLITE_OS_WINRT
  3694   3696     if( !sqlite3_temp_directory ){
  3695   3697       sqlite3_log(SQLITE_ERROR,
  3696   3698           "sqlite3_temp_directory variable should be set for WinRT");
  3697   3699     }
  3698   3700   #endif
  3699   3701   
  3700         -  pFile->h = INVALID_HANDLE_VALUE;
  3701         -
  3702   3702     /* If the second argument to this function is NULL, generate a 
  3703   3703     ** temporary file name to use 
  3704   3704     */
  3705   3705     if( !zUtf8Name ){
  3706   3706       assert(isDelete && !isOpenJournal);
  3707   3707       memset(zTmpname, 0, MAX_PATH+2);
  3708   3708       rc = getTempname(MAX_PATH+2, zTmpname);
................................................................................
  3837   3837       if( isReadWrite ){
  3838   3838         *pOutFlags = SQLITE_OPEN_READWRITE;
  3839   3839       }else{
  3840   3840         *pOutFlags = SQLITE_OPEN_READONLY;
  3841   3841       }
  3842   3842     }
  3843   3843   
  3844         -  memset(pFile, 0, sizeof(*pFile));
  3845         -  pFile->pMethod = &winIoMethod;
  3846         -  pFile->h = h;
  3847         -  pFile->lastErrno = NO_ERROR;
  3848         -  pFile->pVfs = pVfs;
  3849         -#ifndef SQLITE_OMIT_WAL
  3850         -  pFile->pShm = 0;
  3851         -#endif
  3852         -  pFile->zPath = zName;
  3853         -  if( sqlite3_uri_boolean(zName, "psow", SQLITE_POWERSAFE_OVERWRITE) ){
  3854         -    pFile->ctrlFlags |= WINFILE_PSOW;
  3855         -  }
  3856         -
  3857   3844   #if SQLITE_OS_WINCE
  3858   3845     if( isReadWrite && eType==SQLITE_OPEN_MAIN_DB
  3859   3846          && (rc = winceCreateLock(zName, pFile))!=SQLITE_OK
  3860   3847     ){
  3861   3848       osCloseHandle(h);
  3862   3849       sqlite3_free(zConverted);
  3863   3850       return rc;
................................................................................
  3865   3852     if( isTemp ){
  3866   3853       pFile->zDeleteOnClose = zConverted;
  3867   3854     }else
  3868   3855   #endif
  3869   3856     {
  3870   3857       sqlite3_free(zConverted);
  3871   3858     }
         3859  +
         3860  +  pFile->pMethod = &winIoMethod;
         3861  +  pFile->pVfs = pVfs;
         3862  +  pFile->h = h;
         3863  +  if( sqlite3_uri_boolean(zName, "psow", SQLITE_POWERSAFE_OVERWRITE) ){
         3864  +    pFile->ctrlFlags |= WINFILE_PSOW;
         3865  +  }
         3866  +  pFile->lastErrno = NO_ERROR;
         3867  +  pFile->zPath = zName;
  3872   3868   
  3873   3869     OpenCounter(+1);
  3874   3870     return rc;
  3875   3871   }
  3876   3872   
  3877   3873   /*
  3878   3874   ** Delete the named file.