Skip to content

Added some more Win32 platform calls.#2

Merged
dblock merged 20 commits intojava-native-access:masterfrom
tmyroadctfig:master
Jul 11, 2011
Merged

Added some more Win32 platform calls.#2
dblock merged 20 commits intojava-native-access:masterfrom
tmyroadctfig:master

Conversation

@tmyroadctfig
Copy link
Copy Markdown
Contributor

Here are some extra win32 platform calls.

There are only about two changes to Advapi32Util.java but for some reason its not merging cleanly. In that class I just changed registryGetStringValue() to accept REG_EXPAND_SZ. (I've seen some registry values that can switch between REG_SZ and REG_EXPAND_SZ so this simplifies the calling code).

Initially I put the additional structures into their own package but I'm happy to move them where ever.

Please let me know if you need any other changes.

Thanks,

Luke

@dblock
Copy link
Copy Markdown
Member

dblock commented Jun 20, 2011

This is great, but to merge this into JNA you need to do a few things.

  • write tests that exercise each new API in some way - Win32 has almost full test coverage that was added over the last couple of years
  • for your question on structures - the rule of thumb is that the function goes into a file called the same as the DLL name and the defines go into the same as the header file. In the case of setupapi it's the same, but in the case of Kernel32 functions it's not (there's no kernel32.h in the SDK), so defines like RDW_INVALIDATE are in the wrong place, they should be in WinUser.java (as in WinUser.h) while the function IsWindowVisible in User32.java (as in User32.dll) - you have to move quite a bit of things around, sorry
  • edit CHANGES.md
  • try to fix the merge diff, the problem is tabs vs. spaces i think, it should be 2 spaces or something like that

@tmyroadctfig
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback. I'll look in to making those changes in the next few weeks.

Cheers,

Luke

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are defined in WinNT.h, move to WinNT.java please.

@dblock
Copy link
Copy Markdown
Member

dblock commented Jul 11, 2011

I am merging the changes, thank you. Please see my comments for a future pull and update Changes.md in the root.

dblock added a commit that referenced this pull request Jul 11, 2011
Added some more Win32 platform calls.
@dblock dblock merged commit 8e919e7 into java-native-access:master Jul 11, 2011
@tmyroadctfig
Copy link
Copy Markdown
Contributor Author

Thanks for merging in this pull request and for the feedback.

Updating Changes.md is still on my to-do list. Also I think next time I'll make my pull request smaller!

Cheers, Luke

@dblock
Copy link
Copy Markdown
Member

dblock commented Jul 11, 2011

Cool, thanks Luke. My comments are minor, it takes some time to get used to this stuff. You're doing great. Congrats for your first commit to JNA! Billions of people use it :)

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