]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Disable program call with stdin/stdout usage on UWP builds
authorSteve Lhomme <robux4@ycbcr.xyz>
Wed, 24 May 2023 13:14:33 +0000 (15:14 +0200)
committerMartin Matuška <martin@matuska.de>
Thu, 13 Jul 2023 22:26:36 +0000 (00:26 +0200)
Some calls are not allowed:
* WaitForInputIdle [1]
* SetHandleInformation [2]
* STARTF_XXX flags for CreateProcess are not allowed

[1] https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-waitforinputidle#requirements
[2] https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-sethandleinformation#requirements

libarchive/filter_fork_windows.c

index 0b963975b90dff3838a9f3d1f39c27f0f6833365..9e49c5655f1d4883e5a1390852a18e4b6f03d2f1 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "filter_fork.h"
 
+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
 /* There are some editions of Windows ("nano server," for example) that
  * do not host user32.dll. If we want to keep running on those editions,
  * we need to delay-load WaitForInputIdle. */
@@ -224,6 +225,14 @@ fail:
        __archive_cmdline_free(acmd);
        return ARCHIVE_FAILED;
 }
+#else /* !WINAPI_PARTITION_DESKTOP */
+int
+__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout, HANDLE *out_child)
+{
+       (void)cmd; (void)child_stdin; (void) child_stdout; (void) out_child;
+       return ARCHIVE_FAILED;
+}
+#endif /* !WINAPI_PARTITION_DESKTOP */
 
 void
 __archive_check_child(int in, int out)