summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-03-09 12:04:19 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2019-03-09 12:04:19 -0800
commitff3318f3bddf9fa7d37a71179550e286b341450b (patch)
tree549e1879e978cd90f479d43ae9f7e1d9acb8966d
parent0b490b18346b780c51297cdc3888c30a468adb56 (diff)
downloadpsutil-ff3318f3bddf9fa7d37a71179550e286b341450b.tar.gz
expose RtlCreateHeap
-rw-r--r--psutil/arch/windows/global.c5
-rw-r--r--psutil/arch/windows/global.h3
-rw-r--r--psutil/arch/windows/ntextapi.h9
3 files changed, 17 insertions, 0 deletions
diff --git a/psutil/arch/windows/global.c b/psutil/arch/windows/global.c
index 755a4436..0ed02938 100644
--- a/psutil/arch/windows/global.c
+++ b/psutil/arch/windows/global.c
@@ -127,6 +127,11 @@ psutil_loadlibs() {
if (! psutil_RtlAllocateHeap)
return 1;
+ psutil_RtlCreateHeap = psutil_GetProcAddressFromLib(
+ "ntdll", "RtlCreateHeap");
+ if (! psutil_RtlCreateHeap)
+ return 1;
+
/*
* Optional.
*/
diff --git a/psutil/arch/windows/global.h b/psutil/arch/windows/global.h
index d1eb5d4e..f7ff4e2f 100644
--- a/psutil/arch/windows/global.h
+++ b/psutil/arch/windows/global.h
@@ -71,3 +71,6 @@ _NtResumeProcess \
_RtlAllocateHeap \
psutil_RtlAllocateHeap;
+
+_RtlCreateHeap \
+ psutil_RtlCreateHeap;
diff --git a/psutil/arch/windows/ntextapi.h b/psutil/arch/windows/ntextapi.h
index 96574de7..16408f41 100644
--- a/psutil/arch/windows/ntextapi.h
+++ b/psutil/arch/windows/ntextapi.h
@@ -471,4 +471,13 @@ typedef NTSTATUS (WINAPI *_RtlAllocateHeap) (
SIZE_T size
);
+typedef NTSYSAPI HANDLE (NTAPI *_RtlCreateHeap) (
+ ULONG Flags,
+ PVOID Base,
+ ULONG Reserve,
+ ULONG Commit,
+ ULONG Lock,
+ PVOID RtlHeapParams
+);
+
#endif // __NTEXTAPI_H__