/ Check-in [be0a0372]
Login

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

Overview
Comment:For sqlite3_win32_is_nt(), assume WinRT is NT-based and revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: be0a037244762cc0f5ff4a6d7822902f862767bd
User & Date: mistachkin 2014-09-01 19:29:19
Context
2014-09-01
22:34
Avoid a confusing (though correct) argument to the sqlite3_result_blob() function in the implementation of ANALYZE. check-in: 4cae93f8 user: drh tags: trunk
19:29
For sqlite3_win32_is_nt(), assume WinRT is NT-based and revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available. check-in: be0a0372 user: mistachkin tags: trunk
18:21
Tweak the documentation for SQLITE_LIMIT_WORKER_THREADS. No changes to executable code. check-in: 672e7387 user: drh tags: trunk
2014-08-22
19:12
Revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available. Closed-Leaf check-in: 9fe0f075 user: mistachkin tags: winrt
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  1316   1316   #endif
  1317   1317   
  1318   1318   /*
  1319   1319   ** This function determines if the machine is running a version of Windows
  1320   1320   ** based on the NT kernel.
  1321   1321   */
  1322   1322   int sqlite3_win32_is_nt(void){
  1323         -#if defined(SQLITE_WIN32_GETVERSIONEX) && SQLITE_WIN32_GETVERSIONEX
         1323  +#if SQLITE_OS_WINRT
         1324  +  /*
         1325  +  ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
         1326  +  **       kernel.
         1327  +  */
         1328  +  return 1;
         1329  +#elif defined(SQLITE_WIN32_GETVERSIONEX) && SQLITE_WIN32_GETVERSIONEX
  1324   1330     if( osInterlockedCompareExchange(&sqlite3_os_type, 0, 0)==0 ){
  1325         -#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE) && \
  1326         -        defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WIN8
  1327         -    OSVERSIONINFOW sInfo;
  1328         -    sInfo.dwOSVersionInfoSize = sizeof(sInfo);
  1329         -    osGetVersionExW(&sInfo);
  1330         -    osInterlockedCompareExchange(&sqlite3_os_type,
  1331         -        (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
  1332         -#elif defined(SQLITE_WIN32_HAS_ANSI)
         1331  +#if defined(SQLITE_WIN32_HAS_ANSI)
  1333   1332       OSVERSIONINFOA sInfo;
  1334   1333       sInfo.dwOSVersionInfoSize = sizeof(sInfo);
  1335   1334       osGetVersionExA(&sInfo);
         1335  +    osInterlockedCompareExchange(&sqlite3_os_type,
         1336  +        (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
         1337  +#elif defined(SQLITE_WIN32_HAS_WIDE)
         1338  +    OSVERSIONINFOW sInfo;
         1339  +    sInfo.dwOSVersionInfoSize = sizeof(sInfo);
         1340  +    osGetVersionExW(&sInfo);
  1336   1341       osInterlockedCompareExchange(&sqlite3_os_type,
  1337   1342           (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
  1338   1343   #endif
  1339   1344     }
  1340   1345     return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
  1341   1346   #elif SQLITE_TEST
  1342   1347     return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
  1343   1348   #else
         1349  +  /*
         1350  +  ** NOTE: All sub-platforms where the GetVersionEx[AW] functions are
         1351  +  **       deprecated are always assumed to be based on the NT kernel.
         1352  +  */
  1344   1353     return 1;
  1345   1354   #endif
  1346   1355   }
  1347   1356   
  1348   1357   #ifdef SQLITE_WIN32_MALLOC
  1349   1358   /*
  1350   1359   ** Allocate nBytes of memory.