/ Check-in [139081be]
Login

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

Overview
Comment:On windows systems when rand_s() is available, use it to obtain additional seed material in winRandomness().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 139081bef9f63c3ebbe9e992408597b1349bdf37
User & Date: drh 2016-02-15 21:31:51
References
2017-09-12
23:58
Remove use of the rand_s() function (added by [139081bef9f63c3e]) as it appears to cause issues with some third-party DLLs. check-in: 3a2793aa user: mistachkin tags: trunk
Context
2016-02-15
22:01
Revise compiler checks for the rand_s() function. check-in: 287f508d user: mistachkin tags: trunk
21:31
On windows systems when rand_s() is available, use it to obtain additional seed material in winRandomness(). check-in: 139081be user: drh tags: trunk
20:41
Improved entropy gathering for the implementation of winRandomness(). check-in: fea3705e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/msvc.h.

12
13
14
15
16
17
18

19
20
21
22
23
24
25
**
** This file contains code that is specific to MSVC.
*/
#ifndef _MSVC_H_
#define _MSVC_H_

#if defined(_MSC_VER)

#pragma warning(disable : 4054)
#pragma warning(disable : 4055)
#pragma warning(disable : 4100)
#pragma warning(disable : 4127)
#pragma warning(disable : 4130)
#pragma warning(disable : 4152)
#pragma warning(disable : 4189)







>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
**
** This file contains code that is specific to MSVC.
*/
#ifndef _MSVC_H_
#define _MSVC_H_

#if defined(_MSC_VER)
#define _CRT_RAND_S  /* Make rand_s() available on windows systems */
#pragma warning(disable : 4054)
#pragma warning(disable : 4055)
#pragma warning(disable : 4100)
#pragma warning(disable : 4127)
#pragma warning(disable : 4130)
#pragma warning(disable : 4152)
#pragma warning(disable : 4189)

Changes to src/os_win.c.

5420
5421
5422
5423
5424
5425
5426



5427
5428
5429
5430
5431
5432
5433
  UNUSED_PARAMETER(pVfs);
  memset(zBuf, 0, nBuf);
  return nBuf;
#else
  EntropyGatherer e;
  UNUSED_PARAMETER(pVfs);
  memset(zBuf, 0, nBuf);



  e.a = (unsigned char*)zBuf;
  e.na = nBuf;
  e.nXor = 0;
  e.i = 0;
  {
    SYSTEMTIME x;
    osGetSystemTime(&x);







>
>
>







5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
  UNUSED_PARAMETER(pVfs);
  memset(zBuf, 0, nBuf);
  return nBuf;
#else
  EntropyGatherer e;
  UNUSED_PARAMETER(pVfs);
  memset(zBuf, 0, nBuf);
#ifdef _MSC_VER
  rand_s((int*)zBuf);  /* rand_s() is not available with MinGW */
#endif
  e.a = (unsigned char*)zBuf;
  e.na = nBuf;
  e.nXor = 0;
  e.i = 0;
  {
    SYSTEMTIME x;
    osGetSystemTime(&x);