8000 Do not use VirtualLock/Unlock on WinRT or Windows Phone · githubzhaoliang/sqlcipher@c7986f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c7986f2

Browse files
Do not use VirtualLock/Unlock on WinRT or Windows Phone
1 parent 8338f32 commit c7986f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/crypto_impl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ void sqlcipher_free(void *ptr, int sz) {
219219
#if defined(__unix__) || defined(__APPLE__)
220220
munlock(ptr, sz);
221221
#elif defined(_WIN32)
222-
VirtualUnlock(ptr, sz);
222+
#if !(defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP))
223+
VirtualUnlock(ptr, sz);
224+
#endif
223225
#endif
224226
#endif
225227
}
@@ -240,7 +242,9 @@ void* sqlcipher_malloc(int sz) {
240242
#if defined(__unix__) || defined(__APPLE__)
241243
mlock(ptr, sz);
242244
#elif defined(_WIN32)
245+
#if !(defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP))
243246
VirtualLock(ptr, sz);
247+
#endif
244248
#endif
245249
}
246250
#endif

0 commit comments

Comments
 (0)
0