winpthreads: do not call GetHandleInformation in winstore build

The call is forbidden on non-desktop apps.

The check on INVALID_HANDLE_VALUE should be good enough.

Signed-off-by: Liu Hao <lh_mouse@126.com>
This commit is contained in:
Steve Lhomme 2020-04-08 17:14:02 +02:00 committed by Liu Hao
parent 13c9e28c0e
commit 7cb7071978

View File

@ -62,6 +62,11 @@ typedef long long LONGBAG;
typedef long LONGBAG;
#endif
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#undef GetHandleInformation
#define GetHandleInformation(h,f) (1)
#endif
#define CHECK_HANDLE(h) { DWORD dwFlags; \
if (!(h) || ((h) == INVALID_HANDLE_VALUE) || !GetHandleInformation((h), &dwFlags)) \
return EINVAL; }