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)
This commit is contained in:
Charles Milette 2022-05-13 21:42:29 -04:00 committed by Hugo Landau
parent 9c90a0737b
commit ff1efe6e26

View File

@ -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>