@@ -5197,7 +5197,7 @@ os_listdrives_impl(PyObject *module)
51975197
51985198#endif /* MS_WINDOWS_DESKTOP || MS_WINDOWS_SYSTEM */
51995199
5200- #if defined(MS_WINDOWS_APP ) || defined(MS_WINDOWS_SYSTEM )
5200+ #if defined(MS_WINDOWS_DESKTOP ) || defined(MS_WINDOWS_SYSTEM)
52015201
52025202/*[clinic input]
52035203os.listvolumes
@@ -5260,7 +5260,7 @@ os_listvolumes_impl(PyObject *module)
52605260 return result;
52615261}
52625262
5263- #endif /* MS_WINDOWS_APP || MS_WINDOWS_SYSTEM */
5263+ #endif /* MS_WINDOWS_DESKTOP || MS_WINDOWS_SYSTEM */
52645264
52655265#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
52665266
@@ -9933,6 +9933,7 @@ os_setpgrp_impl(PyObject *module)
99339933#include <winternl.h>
99349934#include <ProcessSnapshot.h>
99359935
9936+ #ifdef MS_WINDOWS_DESKTOP
99369937// The structure definition in winternl.h may be incomplete.
99379938// This structure is the full version from the MSDN documentation.
99389939typedef struct _PROCESS_BASIC_INFORMATION_FULL {
@@ -10005,6 +10006,7 @@ win32_getppid_fast(void)
1000510006 cached_ppid = (ULONG) basic_information.InheritedFromUniqueProcessId;
1000610007 return cached_ppid;
1000710008}
10009+ #endif // MS_WINDOWS_DESKTOP
1000810010
1000910011static PyObject*
1001010012win32_getppid(void)
@@ -10013,12 +10015,13 @@ win32_getppid(void)
1001310015 PyObject* result = NULL;
1001410016 HANDLE process = GetCurrentProcess();
1001510017 HPSS snapshot = NULL;
10016- ULONG pid ;
1001710018
10018- pid = win32_getppid_fast ();
10019+ #ifdef MS_WINDOWS_DESKTOP
10020+ ULONG pid = win32_getppid_fast();
1001910021 if (pid != 0) {
1002010022 return PyLong_FromUnsignedLong(pid);
1002110023 }
10024+ #endif
1002210025
1002310026 // If failure occurs in win32_getppid_fast(), fall back to using the PSS API.
1002410027
0 commit comments