/ Changes On Branch av-defense
Login

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

Changes In Branch av-defense Excluding Merge-Ins

This is equivalent to a diff from 8ce2b74a82 to a6b85c7340

2011-07-23
13:54
Merge the winAccess retry logic from the anti-antivirus branch into the trunk. (check-in: 08d0e8799e user: drh tags: trunk)
13:11
In the multiplexor, close auxiliary files before deleting them when doing a truncate. (check-in: 6fb7cfc2ef user: drh tags: trunk)
2011-07-22
21:25
Add retry logic for AV defense to winAccess(). Also allow OS tracing to be enabled by a compile-time option. (Closed-Leaf check-in: a6b85c7340 user: drh tags: av-defense)
12:49
Merge the latest trunk changes into the sessions branch. (check-in: 110cfd6920 user: drh tags: sessions)
11:23
Also add the sqlite3-all.c target to the MSVC makefile. (check-in: 8ce2b74a82 user: drh tags: trunk)
11:16
Add makefile targets sqlite3-all.c. (check-in: 71f7be586f user: drh tags: trunk)

Changes to src/os_common.h.

26
27
28
29
30
31
32



33
34
35
36
37
38
39
40
41
42
43
** switch.  The following code should catch this problem at compile-time.
*/
#ifdef MEMORY_DEBUG
# error "The MEMORY_DEBUG macro is obsolete.  Use SQLITE_DEBUG instead."
#endif

#ifdef SQLITE_DEBUG



int sqlite3OSTrace = 0;
#define OSTRACE(X)          if( sqlite3OSTrace ) sqlite3DebugPrintf X
#else
#define OSTRACE(X)
#endif

/*
** Macros for performance tracing.  Normally turned off.  Only works
** on i486 hardware.
*/
#ifdef SQLITE_PERFORMANCE_TRACE







>
>
>
|
|

|







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
** switch.  The following code should catch this problem at compile-time.
*/
#ifdef MEMORY_DEBUG
# error "The MEMORY_DEBUG macro is obsolete.  Use SQLITE_DEBUG instead."
#endif

#ifdef SQLITE_DEBUG
# ifndef SQLITE_DEBUG_OS_TRACE
#   define SQLITE_DEBUG_OS_TRACE 0
# endif
  int sqlite3OSTrace = SQLITE_DEBUG_OS_TRACE;
# define OSTRACE(X)          if( sqlite3OSTrace ) sqlite3DebugPrintf X
#else
# define OSTRACE(X)
#endif

/*
** Macros for performance tracing.  Normally turned off.  Only works
** on i486 hardware.
*/
#ifdef SQLITE_PERFORMANCE_TRACE

Changes to src/os_win.c.

2448
2449
2450
2451
2452
2453
2454

2455
2456
2457
2458
2459

2460
2461
2462
2463
2464
2465
2466

  SimulateIOError( return SQLITE_IOERR_ACCESS; );
  zConverted = convertUtf8Filename(zFilename);
  if( zConverted==0 ){
    return SQLITE_NOMEM;
  }
  if( isNT() ){

    WIN32_FILE_ATTRIBUTE_DATA sAttrData;
    memset(&sAttrData, 0, sizeof(sAttrData));
    if( GetFileAttributesExW((WCHAR*)zConverted,
                             GetFileExInfoStandard, 
                             &sAttrData) ){

      /* For an SQLITE_ACCESS_EXISTS query, treat a zero-length file
      ** as if it does not exist.
      */
      if(    flags==SQLITE_ACCESS_EXISTS
          && sAttrData.nFileSizeHigh==0 
          && sAttrData.nFileSizeLow==0 ){
        attr = INVALID_FILE_ATTRIBUTES;







>


|

|
>







2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468

  SimulateIOError( return SQLITE_IOERR_ACCESS; );
  zConverted = convertUtf8Filename(zFilename);
  if( zConverted==0 ){
    return SQLITE_NOMEM;
  }
  if( isNT() ){
    int cnt = 0;
    WIN32_FILE_ATTRIBUTE_DATA sAttrData;
    memset(&sAttrData, 0, sizeof(sAttrData));
    while( (rc = GetFileAttributesExW((WCHAR*)zConverted,
                             GetFileExInfoStandard, 
                             &sAttrData)) && rc==0 && retryIoerr(&cnt) ){}
    if( rc ){
      /* For an SQLITE_ACCESS_EXISTS query, treat a zero-length file
      ** as if it does not exist.
      */
      if(    flags==SQLITE_ACCESS_EXISTS
          && sAttrData.nFileSizeHigh==0 
          && sAttrData.nFileSizeLow==0 ){
        attr = INVALID_FILE_ATTRIBUTES;