Visitar URL original
Fix #60: W32FileMonitor. by dblock · Pull Request #100 · java-native-access/jna · GitHub
Skip to content

Fix #60: W32FileMonitor. - #100

Closed
dblock wants to merge 4 commits into
java-native-access:masterfrom
dblock:w32-filemonitor-attempt2
Closed

dblock wants to merge 4 commits into
java-native-access:masterfrom
dblock:w32-filemonitor-attempt2

Conversation

@dblock

@dblock dblock commented Jul 13, 2012

Copy link
Copy Markdown
Member

Doh.

The small change in ULONG_PTR makes it unsigned, threw it in there for good measure, it's not substantial for this fix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can see how this would affect the 32-bit version. In addition, I think all of the _PTR variants should add a .toPointer() method, which further makes clear that their value can be either integer or pointer. rkey.getValue().toPointer() would make this particular expression more clear, and avoid new Pointer(), which implies something different.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added toPointer to ULONG_PTR, which does make this much cleaner.

This affects both the 32 and the 64 bit versions. The problem is that the map has HANDLE and the result of GetQueuedCompletionStatus is a ULONG_PTR. So you cannot lookup one by the other. We could add a way to compare a HANDLE to a Pointer transparently, but that's something that seems like an overkill and a possible source of confusion elsewhere.

@twall twall closed this in 3f38729 Jul 13, 2012
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