Skip to content

Commit e83c0fb

Browse files
author
Jeremy Humble
committed
Fixed Issue 863. Added to HISTORY/CREDITS
1 parent d539e58 commit e83c0fb

3 files changed

Lines changed: 24 additions & 7 deletions

File tree

CREDITS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,7 @@ I: 823
390390
N: Jake Omann
391391
E: https://github.com/jhomann
392392
I: 816
393+
394+
N: Jeremy Humble
395+
W: https://github.com/jhumble
396+
I: 863

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Bug tracker at https://github.com/giampaolo/psutil/issues
88
- #854: Process.as_dict() raises ValueError if passed an erroneous attrs name.
99
- #858: Process.as_dict() should not return memory_info_ex() because it's
1010
deprecated.
11+
- #863: [Windows] memory_map truncates addresses above 32 bits
1112

1213

1314
4.3.0 - 2016-06-18

psutil/_psutil_windows.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,9 +2782,13 @@ static char *get_region_protection_string(ULONG protection) {
27822782
*/
27832783
static PyObject *
27842784
psutil_proc_memory_maps(PyObject *self, PyObject *args) {
2785+
#ifdef _WIN64
2786+
MEMORY_BASIC_INFORMATION64 basicInfo;
2787+
#else
2788+
MEMORY_BASIC_INFORMATION basicInfo;
2789+
#endif
27852790
DWORD pid;
27862791
HANDLE hProcess = NULL;
2787-
MEMORY_BASIC_INFORMATION basicInfo;
27882792
PVOID baseAddress;
27892793
PVOID previousAllocationBase;
27902794
CHAR mappedFileName[MAX_PATH];
@@ -2815,12 +2819,20 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) {
28152819
if (GetMappedFileNameA(hProcess, baseAddress, mappedFileName,
28162820
sizeof(mappedFileName)))
28172821
{
2818-
py_tuple = Py_BuildValue(
2819-
"(kssI)",
2820-
(unsigned long)baseAddress,
2821-
get_region_protection_string(basicInfo.Protect),
2822-
mappedFileName,
2823-
basicInfo.RegionSize);
2822+
#ifdef _WIN64
2823+
py_tuple = Py_BuildValue(
2824+
"(KssI)",
2825+
(unsigned long long)baseAddress,
2826+
2827+
#else
2828+
py_tuple = Py_BuildValue(
2829+
"(kssI)",
2830+
(unsigned long)baseAddress,
2831+
#endif
2832+
get_region_protection_string(basicInfo.Protect),
2833+
mappedFileName,
2834+
basicInfo.RegionSize);
2835+
28242836
if (!py_tuple)
28252837
goto error;
28262838
if (PyList_Append(py_retlist, py_tuple))

0 commit comments

Comments
 (0)