/ Check-in [00b68a1e]
Login

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

Overview
Comment:In os_win.c, if SQLITE_TEST defined, winRandomness() should return all zeroes like os_unix.c. (CVS 5932)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 00b68a1e3164fbf04dabb480c2037be45612b4e4
User & Date: shane 2008-11-19 21:35:47
Context
2008-11-20
18:20
When a memory allocation fails on the %Q conversion in sqlite3_mprintf(), make sure the error is reported back up the call stack. (CVS 5933) check-in: eebacbc9 user: drh tags: trunk
2008-11-19
21:35
In os_win.c, if SQLITE_TEST defined, winRandomness() should return all zeroes like os_unix.c. (CVS 5932) check-in: 00b68a1e user: shane tags: trunk
21:03
Version 3.6.6 (CVS 5931) check-in: 01a6e282 user: drh tags: trunk, release
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.139 2008/11/18 19:18:52 drh Exp $
           15  +** $Id: os_win.c,v 1.140 2008/11/19 21:35:47 shane 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:
................................................................................
  1549   1549   
  1550   1550   
  1551   1551   /*
  1552   1552   ** Write up to nBuf bytes of randomness into zBuf.
  1553   1553   */
  1554   1554   static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
  1555   1555     int n = 0;
         1556  +  UNUSED_PARAMETER(pVfs);
         1557  +#if defined(SQLITE_TEST)
         1558  +  n = nBuf;
         1559  +  memset(zBuf, 0, nBuf);
         1560  +#else
  1556   1561     if( sizeof(SYSTEMTIME)<=nBuf-n ){
  1557   1562       SYSTEMTIME x;
  1558   1563       GetSystemTime(&x);
  1559   1564       memcpy(&zBuf[n], &x, sizeof(x));
  1560   1565       n += sizeof(x);
  1561   1566     }
  1562   1567     if( sizeof(DWORD)<=nBuf-n ){
................................................................................
  1571   1576     }
  1572   1577     if( sizeof(LARGE_INTEGER)<=nBuf-n ){
  1573   1578       LARGE_INTEGER i;
  1574   1579       QueryPerformanceCounter(&i);
  1575   1580       memcpy(&zBuf[n], &i, sizeof(i));
  1576   1581       n += sizeof(i);
  1577   1582     }
         1583  +#endif
  1578   1584     return n;
  1579   1585   }
  1580   1586   
  1581   1587   
  1582   1588   /*
  1583   1589   ** Sleep for a little while.  Return the amount of time slept.
  1584   1590   */