Skip to content
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

Added EnumResourceTypes and EnumResourceNames to Kernel32 #545

Merged
merged 1 commit into from
Dec 1, 2015
Merged

Added EnumResourceTypes and EnumResourceNames to Kernel32 #545

merged 1 commit into from
Dec 1, 2015

Conversation

mlfreeman2
Copy link
Contributor

This also fixes an embarassing mistake I made in Kernel32Util.getResource().

Like an idiot, I committed it to the branch on my fork, wandered off for a few days, came back, and created the last PR without realizing I'd never run the unit test.

@@ -741,6 +744,8 @@ public static final String extractVolumeGUID(String volumeGUIDPath) {
if (start == null) {
throw new IllegalStateException("LockResource returned null.");
}
// have to capture it into a byte array before you free the library, otherwise bad things happen.
results = start.getByteArray(0, length);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the mistake. If you don't get the resource into a byte array before calling FreeLibrary() you're doomed.

@dblock
Copy link
Member

dblock commented Nov 30, 2015

Please try to write at least minimal tests for the individual EnumResourceTypes and EnumResourceNames. I'll merge without, but we don't want to rely on the Util tests, it's not obvious when someone is adding/fixing mappings.

This PR needs to be rebased against master, too, please.

@mlfreeman2
Copy link
Contributor Author

Added unit tests for the two functions to Kernel32Test.java and rebased against master.

dblock added a commit that referenced this pull request Dec 1, 2015
Added EnumResourceTypes and EnumResourceNames to Kernel32
@dblock dblock merged commit e4e0968 into java-native-access:master Dec 1, 2015
@dblock
Copy link
Member

dblock commented Dec 1, 2015

Merged, thank you.

@dblock
Copy link
Member

dblock commented Dec 1, 2015

Btw, if anyone is into the whole win32 resources game, a similar project to https://github.com/dblock/resourcelib could probably be useful in Java.

mstyura pushed a commit to mstyura/jna that referenced this pull request Sep 9, 2024
…e-access#545)

Motivation:

There is a bug when doing 0RTT and task offloading. Let's disable the
test for now until I have time to investigate

Modifications:

Disable test when offloading is done.

Result:

Stabilize build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants