Skip to content

Commit

Permalink
Do not use VirtualLock/Unlock on WinRT or Windows Phone
Browse files Browse the repository at this point in the history
  • Loading branch information
developernotes committed Nov 4, 2013
1 parent 8338f32 commit c7986f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/crypto_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit c7986f2

Please sign in to comment.