-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove COM initialization from object and enforce correct handling vi…
…a asserts The custom thread instantiated in the c.s.j.p.w.C.util.ProxyObject and then used as a dispatch for COM calls is a bootleneck and not following COM convention. If COM is initialized for a thread as COINIT_MULTITHREADED there is no reason to force dispatch through a central thread and if it is COINIT_APARTMENTTHREADED a message queue is needed: https://msdn.microsoft.com/de-de/library/windows/desktop/ms695279%28v=vs.85%29.aspx The change introduced here removes the dispatcher thread and the initialization routines from COMBindingBaseObject. In their place asserts are placed, that enforce correct COM initialization. The tests were adjusted accordingly.
- Loading branch information
1 parent
bf32054
commit d80730b
Showing
24 changed files
with
349 additions
and
567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
157 changes: 0 additions & 157 deletions
157
contrib/platform/src/com/sun/jna/platform/win32/COM/util/ComThread.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
d80730b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of the purpose of the ...COM.util classes (ProxyObject etc) is (was) to create a 'nicer' java like interface over the COM interactions.
For example, so that the user of the classes does not need to know anything about COM threading issues,
and doesn't have to make calls such as "Ole32.INSTANCE.CoInitializeEx(Pointer.NULL, Ole32.COINIT_MULTITHREADED);"
If the client codes wants to have that level of control it should use the ...COM classes directly.
Your recent modifications of the COM.util classes have changed the use case significantly,
and consequently I cannot move my client code to using the latest version of JNA.
Would you be happy for a discussion about this?
thanks
d80730b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, my email is part of the commits, so feel free to write there or open a bug, I'll follow up there. Or use the google group.
d80730b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep this all public, open issues please and discuss there.
d80730b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the request into issue #651.