-
Notifications
You must be signed in to change notification settings - Fork 10
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
Some experiments with HString wrapper and ComPtr #3
Conversation
Thanks! I probably won't get a chance to seriously look/work on this until Tuesday or Wednesday. |
Oh, one more comment: Another reason that we probably can't rely on winapi's RIDL macro, is that we sometimes need generic definitions, e.g. |
This might also be helpful: retep998/winapi-rs#145 (comment). It's about how to implement a COM interface from Rust. |
487ea5f
to
1000edb
Compare
Also replaced tabs with spaces.
Also please note that my test code still requires a change in winapi: Add |
... this last commit renders my previous comment obsolete. |
Also renamed some stuff and made the completion handler generic
This is now in a state where it actually starts looking like more than a proof-of-concept. I'd like to have some feedback and then we should get started with the automatic code-generation. I wonder if we can get rid of this out-pointer-passing in the low-level-bindings already? I think we should generate the impl for the function definitions (which forward to the vtbl) already in such a way that they
This is not possible with macros, but should easy with custom codegen, as long as we're careful with possible |
Now faster and safer.
84e08dc
to
70bc235
Compare
This is not meant to be merged!
It shows my progress so far and allows me to share it with you more easily. Note that it requires a local override of winapi-rs with the necessary changes (either my or your PR).
What is currently definitely wrong in my implementation is:
asyncOp.query_interface::<IUnknown>(&IID_IUnknown);
and be able to writeasyncOp.query_interface::<IUnknown>();
instead (UPDATE: I've added a commit which does extend the macro accordingly. We have to see whether we are able to upstream this to winapi-rs.)(By the way, I probably won't have much time to work on this during the next weeks.)