From c934bfdfc343fbb4d84e59a339cde57b30779581 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 4 Jun 2020 10:15:38 +0200 Subject: [PATCH] do not call GetHandleInformation() in Winstore apps The API is forbidden [1] and HANDLE_FLAG_INHERIT would never be set as exec() is not allowed either [2]. [1] https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation [2] https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps --- lib/fcntl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/srclib/fcntl.c b/srclib/fcntl.c index e220800845..c95322b2d4 100644 --- a/srclib/fcntl.c +++ b/srclib/fcntl.c @@ -45,6 +45,19 @@ # include # endif +# if defined WINAPI_FAMILY && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +/* GetHandleInformation is not available in UWP, the flags it would provide + are also not available, so we just return 0. + + */ +static inline BOOL GetHandleInformation(HANDLE h, DWORD *pf) +{ + *pf = 0; + return TRUE; +} +# define HANDLE_FLAG_INHERIT (1) +# endif /* WINAPI_PARTITION_DESKTOP */ + /* Upper bound on getdtablesize(). See lib/getdtablesize.c. */ # define OPEN_MAX_MAX 0x10000 -- 2.37.3.windows.1