Skip to content

Commit

Permalink
[Windows] Reset mp_flag after each drive on `psutil.disk_partitions…
Browse files Browse the repository at this point in the history
…()` (#1961)
  • Loading branch information
mx-psi authored Aug 5, 2021
1 parent 12994a7 commit 5a76cfa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -754,3 +754,7 @@ C: Russia
E: [email protected]
W: https://gorbunov-dmitry.github.io
D: fix typos in documentation

N: Pablo Baeyens
W: https://github.com/mx-psi
I: 1598
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ XXXX-XX-XX
- 1921_: [Windows] psutil.swap_memory() shows committed memory instead of swap
- 1953_: [Windows] disk_partitions() crashes due to insufficient buffer len.
(patch by MaWe2019)
- 1598_: [Windows] psutil.disk_partitions() only returns mountpoints on drives
where it first finds one

5.8.0
=====
Expand Down
1 change: 1 addition & 0 deletions psutil/arch/windows/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
mp_h = FindFirstVolumeMountPoint(
drive_letter, mp_buf, MAX_PATH);
if (mp_h != INVALID_HANDLE_VALUE) {
mp_flag = TRUE;
while (mp_flag) {
// Append full mount path with drive letter
strcpy_s(mp_path, _countof(mp_path), drive_letter);
Expand Down

0 comments on commit 5a76cfa

Please sign in to comment.