/ Check-in [5350a658]
Login

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

Overview
Comment:Provide dummy DWORD arguments to output parameters of GetDiskFreeSpace(A|W), NULL causes access violations on Windows NT 4.0 (CVS 6477)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5350a6586cd6504a0724631e4ef46245832435f9
User & Date: chw 2009-04-09 14:27:07
Context
2009-04-09
21:02
Increase the version number to 3.6.13 in preparation for the next release. (CVS 6478) check-in: 9a09a474 user: drh tags: trunk
14:27
Provide dummy DWORD arguments to output parameters of GetDiskFreeSpace(A|W), NULL causes access violations on Windows NT 4.0 (CVS 6477) check-in: 5350a658 user: chw tags: trunk
14:02
Remove misuse detection from the deprecated sqlite3_transfer_bindings() interface. The code was hard to test and was simply taking up space. (CVS 6476) check-in: 4cd82910 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   ******************************************************************************
    12     12   **
    13     13   ** This file contains code that is specific to windows.
    14     14   **
    15         -** $Id: os_win.c,v 1.153 2009/03/31 03:41:57 shane Exp $
           15  +** $Id: os_win.c,v 1.154 2009/04/09 14:27:07 chw Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #if SQLITE_OS_WIN               /* This file is used for windows only */
    19     19   
    20     20   
    21     21   /*
    22     22   ** A Note About Memory Allocation:
................................................................................
  1583   1583   static int getSectorSize(
  1584   1584       sqlite3_vfs *pVfs,
  1585   1585       const char *zRelative     /* UTF-8 file name */
  1586   1586   ){
  1587   1587     DWORD bytesPerSector = SQLITE_DEFAULT_SECTOR_SIZE;
  1588   1588     char zFullpath[MAX_PATH+1];
  1589   1589     int rc;
  1590         -  DWORD dwRet = 0;
         1590  +  DWORD dwRet = 0, dwDummy;
  1591   1591   
  1592   1592     /*
  1593   1593     ** We need to get the full path name of the file
  1594   1594     ** to get the drive letter to look up the sector
  1595   1595     ** size.
  1596   1596     */
  1597   1597     rc = winFullPathname(pVfs, zRelative, MAX_PATH, zFullpath);
................................................................................
  1607   1607             if( p[i] == '\\' ){
  1608   1608               i++;
  1609   1609               p[i] = '\0';
  1610   1610               break;
  1611   1611             }
  1612   1612           }
  1613   1613           dwRet = GetDiskFreeSpaceW((WCHAR*)zConverted,
  1614         -                                  NULL,
         1614  +                                  &dwDummy,
  1615   1615                                     &bytesPerSector,
  1616         -                                  NULL,
  1617         -                                  NULL);
         1616  +                                  &dwDummy,
         1617  +                                  &dwDummy);
  1618   1618   #if SQLITE_OS_WINCE==0
  1619   1619         }else{
  1620   1620           int i;
  1621   1621           /* trim path to just drive reference */
  1622   1622           CHAR *p = (CHAR *)zConverted;
  1623   1623           for(i=0;i<MAX_PATH;i++){
  1624   1624             if( p[i] == '\\' ){
  1625   1625               i++;
  1626   1626               p[i] = '\0';
  1627   1627               break;
  1628   1628             }
  1629   1629           }
  1630   1630           dwRet = GetDiskFreeSpaceA((CHAR*)zConverted,
  1631         -                                  NULL,
         1631  +                                  &dwDummy,
  1632   1632                                     &bytesPerSector,
  1633         -                                  NULL,
  1634         -                                  NULL);
         1633  +                                  &dwDummy,
         1634  +                                  &dwDummy);
  1635   1635   #endif
  1636   1636         }
  1637   1637         free(zConverted);
  1638   1638       }
  1639   1639       if( !dwRet ){
  1640   1640         bytesPerSector = SQLITE_DEFAULT_SECTOR_SIZE;
  1641   1641       }