-
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
Advapi32Util.registryGetValues() returns no results if the key contains an empty REG_BINARY value #116
Comments
If you could augment the existing unit tests to reproduce this fault it would speed up getting a fix. On Sep 3, 2012, at 11:51 PM, phailwhale22 wrote:
|
I'm feeling a bit dumb now, I had a try..catch block around my call to registryGetValues(). Here is the exception that it was throwing: Exception in thread "main" java.lang.IllegalArgumentException: Allocation size must be greater than zero |
Oops, accidentally closed the issue... |
Looks like a bug, https://github.com/twall/jna/blob/master/contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java#L1265 is allocating memory when in fact there's none (empty binary value). Should be an easy fix, @phailwhale22 want to try a unit test that reproduces it (in https://github.com/twall/jna/blob/master/contrib/platform/test/com/sun/jna/platform/win32/Advapi32UtilTest.java) and maybe a fix? |
Motivation: How we constructed the path was incorrect. Modifications: Fix path. Result: Be able to re-use precompiled quiche
Not much else to say but this a bit serious for what I'm working on at the moment.
How to reproduce:
System.out.println(Advapi32Util.registryGetValues(WinReg.HKEY_CURRENT_USER, "your_key_here").size());
You will see that it returns 0 entries, even though there are several actually there. If you remove that binary value, registryGetValues() will magically work again.
The text was updated successfully, but these errors were encountered: