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

Modify the API in Advapi32Util for support registryGetKey() in WOW64 flag #253

Merged
merged 2 commits into from
Sep 25, 2013

Conversation

Falldog
Copy link
Contributor

@Falldog Falldog commented Jul 31, 2013

For Advapi32Util support the WOW64 flag
reuse the current API registryGetKey() to open the WOW64 flag

Ex:
HKEYByReference phkKey = registryGetKey(WinReg.HKEY_CURRENT_USER, "Software\JNA", WinNT.KEY_READ | WinNT.KEY_WOW64_32KEY);
String value = registryGetKeys(phkKey.getValue(), 'StringKey');
registryCloseKey(phkKey.getValue());

On UnitTest,
I think original testcase would include the new API testing

BTW, I think this may fit the feature request #101

@dblock
Copy link
Member

dblock commented Jul 31, 2013

I think this is worth fixing/implementing, but I am not sure this is the best way.

My first reaction was whether those new methods that take an HKEY should be private? The util library tries to help you with management of handles, you should in theory not have to worry about those. The new method violates that principle.

If that's the case, you could expose a registryGetValue64?

What do you think?

Please also update CHANGELOG. Thank you.

@Falldog
Copy link
Contributor Author

Falldog commented Jul 31, 2013

I think this way would be more general, and expose less API
first,
for x86 application call registryGetXXXValue() default would get x86 value,
and it should set the flag as KEY_WOW64_64KEY to read x64 key path
for x64 application call registryGetXXXValue() default would get x64 value
and it should set the flag as KEY_WOW64_32KEY to read x86 key path
I think add registryGetValue86(), registryGetValue64() is not a good idea

Unfortunately, check that registryGetValue() would use the windows API RegGetValue()
reference : http://msdn.microsoft.com/en-us/library/windows/desktop/ms724868(v=vs.85).aspx
this API could not specific to read/write on KEY_WOW64_32KEY or KEY_WOW64_64KEY

So, maybe this way would like registrySetXXXValue() to access opened HKEY directly.

What do you think?
If these is better way, I would like to modify it
Thank you.

@dblock
Copy link
Member

dblock commented Aug 2, 2013

Thought about this a bit, and I think I agree that what you wrote is the best of the solutions. Can you please update CHANGELOG and I'll merge this? Thx.

dblock added a commit that referenced this pull request Sep 25, 2013
@dblock dblock merged commit f1903d9 into java-native-access:master Sep 25, 2013
@dblock
Copy link
Member

dblock commented Sep 25, 2013

Merged, sorry for the delay.

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

Motivation:

It is useful to know which QUIC versions are supported. Let's expose a method for the user to check.

Modifications:

- Add method that allows the user to query if a QUIC version is supported
- Add unit tests

Result:

Be able to test if a version is supported
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