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

Fix #60: W32FileMonitor. #100

Closed

Conversation

dblock
Copy link
Member

@dblock dblock commented Jul 13, 2012

Doh.

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


synchronized (this) {
return handleMap.get(rkey.getValue());
}
return handleMap.get(new HANDLE(new Pointer(rkey.getValue().longValue())));
Copy link
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
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