summaryrefslogtreecommitdiff
path: root/psutil/_psutil_common.c
diff options
context:
space:
mode:
authorJulien Lebot <julien.ar.lebot@gmail.com>2020-07-05 04:02:03 +0200
committerGitHub <noreply@github.com>2020-07-05 04:02:03 +0200
commit54de8823918fc0484223a077eafc917755334b5b (patch)
tree662af625b081fdb6d6b3f8fe2cb271faf9974a59 /psutil/_psutil_common.c
parent04b40609276c15b59df065659a0a8ce41b316cef (diff)
downloadpsutil-54de8823918fc0484223a077eafc917755334b5b.tar.gz
Add support for Windows Nano Server (#1768)
Diffstat (limited to 'psutil/_psutil_common.c')
-rw-r--r--psutil/_psutil_common.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/psutil/_psutil_common.c b/psutil/_psutil_common.c
index d63b4d9c..7a87c3c1 100644
--- a/psutil/_psutil_common.c
+++ b/psutil/_psutil_common.c
@@ -264,10 +264,6 @@ psutil_loadlibs() {
"ntdll.dll", "NtSetInformationProcess");
if (! NtSetInformationProcess)
return 1;
- WinStationQueryInformationW = psutil_GetProcAddressFromLib(
- "winsta.dll", "WinStationQueryInformationW");
- if (! WinStationQueryInformationW)
- return 1;
NtQueryObject = psutil_GetProcAddressFromLib(
"ntdll.dll", "NtQueryObject");
if (! NtQueryObject)
@@ -320,6 +316,13 @@ psutil_loadlibs() {
// minumum requirement: Win 7
GetLogicalProcessorInformationEx = psutil_GetProcAddressFromLib(
"kernel32", "GetLogicalProcessorInformationEx");
+ // minimum requirements: Windows Server Core
+ WTSEnumerateSessionsW = psutil_GetProcAddressFromLib(
+ "wtsapi32.dll", "WTSEnumerateSessionsW");
+ WTSQuerySessionInformationW = psutil_GetProcAddressFromLib(
+ "wtsapi32.dll", "WTSQuerySessionInformationW");
+ WTSFreeMemory = psutil_GetProcAddressFromLib(
+ "wtsapi32.dll", "WTSFreeMemory");
PyErr_Clear();
return 0;