-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add mapping for EnumProcesses to Psapi #1214
Add mapping for EnumProcesses to Psapi #1214
Conversation
Added arm64 support to .travis.yml file
Add structures and methods to enumerate sessions
Remove too-strict filestore available size test
Add mappings for Thread32First and Thread32Next to Kernel32
eadcb25
to
9c27512
Compare
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.
Thanks for your submission! I've left a few comments inline.
contrib/platform/test/com/sun/jna/platform/win32/PsapiTest.java
Outdated
Show resolved
Hide resolved
9c27512
to
104889d
Compare
Please review again @dbwiddis, I think I covered all your comments. |
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.
Looking good. A few more comments.
contrib/platform/test/com/sun/jna/platform/win32/PsapiTest.java
Outdated
Show resolved
Hide resolved
104889d
to
3c0dc33
Compare
Since there was no additional comment on my questions above, I've uploaded a new changeset that addresses the other topics. |
It looks generally good to me. I don't seem to have the powers (yet) to merge this so I'll let @matthiasblaesing take it from here, if he has any other changes. |
758a829
to
8895113
Compare
I decided to add 2 more functions to the utility to extract the name of the process. |
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.
Thanks for your patience. A few more comments.
contrib/platform/test/com/sun/jna/platform/win32/PsapiUtilTest.java
Outdated
Show resolved
Hide resolved
contrib/platform/test/com/sun/jna/platform/win32/PsapiTest.java
Outdated
Show resolved
Hide resolved
contrib/platform/test/com/sun/jna/platform/win32/PsapiUtilTest.java
Outdated
Show resolved
Hide resolved
8895113
to
49c276a
Compare
49c276a
to
3ccc9d1
Compare
Unless there are any obvious errors in the last push, I'll consider this PR ready for merge. |
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.
Just a few last changes.
int[] pids = PsapiUtil.enumProcesses(); | ||
|
||
assertNotNull("List should not be null", pids); | ||
assertTrue("List should contain my pid", Arrays.stream(pids).anyMatch(pid -> pid == myPid)); |
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.
We retain compatibility with Java 1.6, so as neat as streams and lambdas are, you have to do it the old fashioned way.
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.
If you aim to also have the test classes in Java6, I suggest that the Eclipse project is set to have Java6 as the target and the build.xml should also check ./test-classes, not just ./classes.
Anyway, I'll push a fix for this.
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.
There are one or two exceptions in the test classes that require Java 8, which is why the project includes a higher compatibility level in the config files, but we otherwise maintain the standard.
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 know this because I did the same thing not too long ago!)
int size = 0; | ||
IntByReference lpdwSize = new IntByReference(); | ||
do { | ||
size = size + 1024; |
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.
Since WinDef.MAX_PATH
should work in most cases, let's use that as the initial size. You can initialize on line 914 and increment (I'm ok with += 1024) after the query conditional.
Added utility method QueryFullProcessImageName that takes a PID. Fixed QueryFullProcessImageName to properly handle paths longer than 260 characters that can happen on Win10 / paths with UNC.
3ccc9d1
to
6579864
Compare
Thanks for the updates. I'll commit this later today. |
Merged in 22dc037 |
No description provided.