diff options
author | mistachkin <mistachkin@noemail.net> | 2015-02-27 19:40:08 +0000 |
---|---|---|
committer | mistachkin <mistachkin@noemail.net> | 2015-02-27 19:40:08 +0000 |
commit | 0404e74caa95a4cde7bdba71ad95d6eb8f924c01 (patch) | |
tree | c0bcde754c3ce16edbf06bfda8d4f0b058054fb5 /src/os_win.c | |
parent | bfefa4c27b42b74e6b1685a3c93585fd0fa7d666 (diff) | |
parent | 22ec13466cbc6ce4f3cc642e5c23c5d52dcace27 (diff) | |
download | sqlite-0404e74caa95a4cde7bdba71ad95d6eb8f924c01.tar.gz sqlite-0404e74caa95a4cde7bdba71ad95d6eb8f924c01.zip |
Merge updates from trunk.
FossilOrigin-Name: acf7684323da4dc3aaf9746bd13b0f56054a17dd
Diffstat (limited to 'src/os_win.c')
-rw-r--r-- | src/os_win.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/os_win.c b/src/os_win.c index c938a4d7d..7463778a2 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -1066,6 +1066,23 @@ static struct win_syscall { SQLITE_WIN32_VOLATILE*, LONG,LONG))aSyscall[76].pCurrent) #endif /* defined(InterlockedCompareExchange) */ +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID + { "UuidCreate", (SYSCALL)UuidCreate, 0 }, +#else + { "UuidCreate", (SYSCALL)0, 0 }, +#endif + +#define osUuidCreate ((RPC_STATUS(RPC_ENTRY*)(UUID*))aSyscall[77].pCurrent) + +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID + { "UuidCreateSequential", (SYSCALL)UuidCreateSequential, 0 }, +#else + { "UuidCreateSequential", (SYSCALL)0, 0 }, +#endif + +#define osUuidCreateSequential \ + ((RPC_STATUS(RPC_ENTRY*)(UUID*))aSyscall[78].pCurrent) + }; /* End of the overrideable system calls */ /* @@ -5345,6 +5362,22 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ n += sizeof(i); } #endif +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID + if( sizeof(UUID)<=nBuf-n ){ + UUID id; + memset(&id, 0, sizeof(UUID)); + osUuidCreate(&id); + memcpy(zBuf, &id, sizeof(UUID)); + n += sizeof(UUID); + } + if( sizeof(UUID)<=nBuf-n ){ + UUID id; + memset(&id, 0, sizeof(UUID)); + osUuidCreateSequential(&id); + memcpy(zBuf, &id, sizeof(UUID)); + n += sizeof(UUID); + } +#endif return n; } @@ -5522,7 +5555,7 @@ int sqlite3_os_init(void){ /* Double-check that the aSyscall[] array has been constructed ** correctly. See ticket [bb3a86e890c8e96ab] */ - assert( ArraySize(aSyscall)==77 ); + assert( ArraySize(aSyscall)==79 ); /* get memory map allocation granularity */ memset(&winSysInfo, 0, sizeof(SYSTEM_INFO)); |