diff options
author | Charles Milette <charles.milette@gmail.com> | 2022-05-13 21:42:29 -0400 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2022-07-26 12:36:18 +0100 |
commit | bac5b7405b085d3926fdca80f221fa462dbe27e5 (patch) | |
tree | 1cbb24d70923c005a91a51ea97c2f578d5742d6a | |
parent | c04b8819161de007cee831dd9e58dde52268da18 (diff) |
Fix UWP builds by defining VirtualLock
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18311)
(cherry picked from commit ff1efe6e261598c3f71727b796767a8e716bcbe2)
-rw-r--r-- | crypto/mem_sec.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c index c2cc2cbf32..9458135572 100644 --- a/crypto/mem_sec.c +++ b/crypto/mem_sec.c @@ -23,6 +23,20 @@ #ifndef OPENSSL_NO_SECURE_MEMORY # if defined(_WIN32) # include <windows.h> +# if defined(WINAPI_FAMILY_PARTITION) \ + && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) +/* + * While VirtualLock is available under the app partition (e.g. UWP), + * the headers do not define the API. Define it ourselves instead. + */ +WINBASEAPI +BOOL +WINAPI +VirtualLock( + _In_ LPVOID lpAddress, + _In_ SIZE_T dwSize + ); +# endif # endif # include <stdlib.h> # include <assert.h> |