@@ -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_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
@@ -15227,6 +15230,7 @@ os_abort_impl(PyObject *module)
1522715230}
1522815231
1522915232#ifdef MS_WINDOWS
15233+ #ifdef MS_WINDOWS_DESKTOP
1523015234/* Grab ShellExecute dynamically from shell32 */
1523115235static int has_ShellExecute = -1;
1523215236static HINSTANCE (CALLBACK *Py_ShellExecuteW)(HWND, LPCWSTR, LPCWSTR, LPCWSTR,
@@ -15255,6 +15259,7 @@ check_ShellExecute(void)
1525515259 }
1525615260 return has_ShellExecute;
1525715261}
15262+ #endif // MS_WINDOWS_DESKTOP
1525815263
1525915264
1526015265/*[clinic input]
@@ -15299,6 +15304,9 @@ os_startfile_impl(PyObject *module, path_t *filepath,
1529915304 path_t *cwd, int show_cmd)
1530015305/*[clinic end generated code: output=1c6f2f3340e31ffa input=8248997b80669622]*/
1530115306{
15307+ #if defined(MS_WINDOWS_APP) && !defined(MS_WINDOWS_DESKTOP)
15308+ return PyErr_Format(PyExc_NotImplementedError, "startfile not available on UWP");
15309+ #else
1530215310 HINSTANCE rc;
1530315311
1530415312 if(!check_ShellExecute()) {
@@ -15327,6 +15335,7 @@ os_startfile_impl(PyObject *module, path_t *filepath,
1532715335 return NULL;
1532815336 }
1532915337 Py_RETURN_NONE;
15338+ #endif
1533015339}
1533115340#endif /* MS_WINDOWS */
1533215341
0 commit comments