Do not use VirtualLock/Unlock on WinRT or Windows Phone

This commit is contained in:
Nick Parker 2013-11-04 16:42:32 -06:00
parent 8338f32f04
commit c7986f2905
1 changed files with 5 additions and 1 deletions

View File

@ -219,7 +219,9 @@ void sqlcipher_free(void *ptr, int sz) {
#if defined(__unix__) || defined(__APPLE__)
munlock(ptr, sz);
#elif defined(_WIN32)
VirtualUnlock(ptr, sz);
#if !(defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP))
VirtualUnlock(ptr, sz);
#endif
#endif
#endif
}
@ -240,7 +242,9 @@ void* sqlcipher_malloc(int sz) {
#if defined(__unix__) || defined(__APPLE__)
mlock(ptr, sz);
#elif defined(_WIN32)
#if !(defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP))
VirtualLock(ptr, sz);
#endif
#endif
}
#endif