static int GetFileInformationByName_init = -1;
if (GetFileInformationByName_init < 0) {
+#ifdef MS_WINDOWS_DESKTOP
HMODULE hMod = LoadLibraryW(L"api-ms-win-core-file-l2-1-4");
+#else
+ HMODULE hMod = LoadPackagedLibrary(L"api-ms-win-core-file-l2-1-4", 0);
+#endif
GetFileInformationByName_init = 0;
if (hMod) {
GetFileInformationByName = (PGetFileInformationByName)GetProcAddress(
#endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)) */
-#if (defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM))
+#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM))
PyDoc_STRVAR(os_listvolumes__doc__,
"listvolumes($module, /)\n"
return os_listvolumes_impl(module);
}
-#endif /* (defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)) */
+#endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)) */
#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM))
#ifndef OS__EMSCRIPTEN_LOG_METHODDEF
#define OS__EMSCRIPTEN_LOG_METHODDEF
#endif /* !defined(OS__EMSCRIPTEN_LOG_METHODDEF) */
-/*[clinic end generated code: output=250ea2e34fdd133f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d81494ceb6ce44ed input=a9049054013a1b77]*/
#endif /* MS_WINDOWS_DESKTOP || MS_WINDOWS_SYSTEM */
-#if defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)
+#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
/*[clinic input]
os.listvolumes
return result;
}
-#endif /* MS_WINDOWS_APP || MS_WINDOWS_SYSTEM */
+#endif /* MS_WINDOWS_DESKTOP || MS_WINDOWS_SYSTEM */
#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
#include <winternl.h>
#include <ProcessSnapshot.h>
+#ifdef MS_WINDOWS_DESKTOP
// The structure definition in winternl.h may be incomplete.
// This structure is the full version from the MSDN documentation.
typedef struct _PROCESS_BASIC_INFORMATION_FULL {
cached_ppid = (ULONG) basic_information.InheritedFromUniqueProcessId;
return cached_ppid;
}
+#endif // MS_WINDOWS_DESKTOP
static PyObject*
win32_getppid(void)
PyObject* result = NULL;
HANDLE process = GetCurrentProcess();
HPSS snapshot = NULL;
- ULONG pid;
- pid = win32_getppid_fast();
+#ifdef MS_WINDOWS_DESKTOP
+ ULONG pid = win32_getppid_fast();
if (pid != 0) {
return PyLong_FromUnsignedLong(pid);
}
+#endif
// If failure occurs in win32_getppid_fast(), fall back to using the PSS API.