-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Windows] Fix for net_io_counters wrapping after 4.3GB due to MIB_IFROW #835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… using DWORD. Updated to use MIB_IF_ROW2 which gives ULONG values instead. This causes more breaking changes for Windows XP and all Windows versions less than Vista / Server 2008 meaning that it should have no problems working on Vista / Server 2008 and beyond.
Mmm have you tested this on Win XP? I don't see the |
Oh, sorry, I gave some findings on XP in #816 , psutils 4.0.0+ already does not work with Windows XP so I put this PR in. Something between 3.4.2 and 4.0.0 is causing it to not work in Win XP. If you'd like me to try making psutil 4.3.0 compatible with XP I can. |
Interesting, it seems like although the pip installs didn't work ... manually compiling it on Win XP does still work. I will need to find out a good way to do this... |
I am so sorry for all those pushes in a row! It was the easiest way to test it across multiple systems that I had set up to test compiling with. Compiling is working in both Win XP and Win 7 (my normal workstation) though so hopefully the final tests will show it building OK. |
Changes Unknown when pulling 7a8c268 on jhomann:master into * on giampaolo:master*. |
Well that's crap. I fixed the tests but it looks like the final test in AppVeyor gave an error:
Which is interesting since the last few commits worked just fine and that was never edited by me. |
Changes Unknown when pulling c105688 on jhomann:master into * on giampaolo:master*. |
For the record I am done with my commits, I believe everything is in order. The tests that are failing now seem like random false positives. Please take a look at let me know if you would like anything else one for it. |
#include <ws2tcpip.h> | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand: you include the same module no matter what the windows version is so why using ifdef in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually doesn't need to be included. The issue was that it matters where it's located in the list of includes, but after further testing, this header is not required for Win XP.
I added some inline comments. If you reintroduced Win XP support which was broken please specify this in HISTORY. ALso please update CREDITS including your name and contribution. Thanks. |
Updated HISTORY to explain better that Win XP still uses 32bit values Reverted test code, will add in a different PR
I've updated with the proper changes! I definitely should have looked up the else, that was stupid of me. Again, sorry for making so many commits for this change. As for re-introducing Win XP support, it seems that building 4.0.0-4.2.0 works however installing it from pip does not. That being said, it still had support for XP if you built it manually, which I tried and it worked, so we are definitely good there. |
You can do as many pushes as you want: AppVeyor tests are for free and are designed exactly for that (make our life easier). =) Patch looks great, I'm merging it. Thanks a lot for working on this. It was a long standing issue and the solution you came up with is perfect. If you will ever feel about taking some other Windows issue from the bug tracker you're more than welcome. |
I am updating this with a new pull request. The other one was very old and didn't quite work with the current version of psutil. See more #816