summaryrefslogtreecommitdiff
path: root/psutil/arch
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-02-19 17:30:38 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2019-02-19 17:30:38 -0800
commit30675b05d55bb409a8da32a1706ed1034d8e9cf1 (patch)
treef142dea259b39ddac91e0f74e0305a9365953708 /psutil/arch
parentb7441d513f71298b458958a687b107b4296535b6 (diff)
downloadpsutil-win-loadlib-refact.tar.gz
port GetExtendedUpdTablewin-loadlib-refact
Diffstat (limited to 'psutil/arch')
-rw-r--r--psutil/arch/windows/global.c5
-rw-r--r--psutil/arch/windows/global.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/psutil/arch/windows/global.c b/psutil/arch/windows/global.c
index 9ead780a..b8bf8162 100644
--- a/psutil/arch/windows/global.c
+++ b/psutil/arch/windows/global.c
@@ -88,6 +88,11 @@ psutil_load_globals() {
if (! psutil_GetExtendedTcpTable)
return 1;
+ psutil_GetExtendedUdpTable = ps_GetProcAddressFromLib(
+ "iphlpapi.dll", "GetExtendedUdpTable");
+ if (! psutil_GetExtendedUdpTable)
+ return 1;
+
// Optionals.
psutil_GetActiveProcessorCount = ps_GetProcAddress(
diff --git a/psutil/arch/windows/global.h b/psutil/arch/windows/global.h
index 323d2c6d..69a1fd6c 100644
--- a/psutil/arch/windows/global.h
+++ b/psutil/arch/windows/global.h
@@ -19,6 +19,8 @@ typedef DWORD (CALLBACK *_GetActiveProcessorCount)(WORD);
typedef ULONGLONG (CALLBACK *_GetTickCount64)(void);
typedef DWORD (WINAPI * _GetExtendedTcpTable)(PVOID, PDWORD, BOOL, ULONG,
TCP_TABLE_CLASS, ULONG);
+typedef DWORD (WINAPI * _GetExtendedUdpTable)(PVOID, PDWORD, BOOL, ULONG,
+ UDP_TABLE_CLASS, ULONG);
_RtlIpv4AddressToStringA \
@@ -48,4 +50,8 @@ _GetTickCount64 \
_GetExtendedTcpTable \
psutil_GetExtendedTcpTable;
+_GetExtendedUdpTable \
+ psutil_GetExtendedUdpTable;
+
+
int psutil_load_globals();