-
Notifications
You must be signed in to change notification settings - Fork 946
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for IFileOpenDialog (#5319)
* Add support for IFileOpenDialog CCW Wrapper in the PR was autogenerated using source generator and tailored based on my previous experience. As such I have strange local variables sometimes. Also, I do not implement anything yet for following interfaces - `Shell32.IFileDialogEvents` (CCW needed) - `Shell32.IShellItem` (RCW from built-in COM) - `Shell32.IShellItemArray` (RCW from built-in COM) I plan to implement them when collect all feedback on quality of this PR so all improvements would be passed to next work. What to do with code which maybe never called. How to detect that code? or should I bother with that and provide implementations for all methods? For example, I do not see errors in tests from `Shell32.IFileDialogEvents`, even if this interface used by `VistaDialogEvents` and passed to `IFileOpenDialog.Advise` method. So, removing code and look where it fails in tests would be not practical. Would like to ask question about `IShellItem` and `IShellItemArray` relationships. I will look up on MSDN, but maybe collective conscionesness maybe help me better. So, question: Does these completely unrelated interfaces, or there some `IShellItem` implementation which implement `IShellItemArray` as well. Answer affects how I implement RCW for these interfaces. * Hello global usings! * Add missing COM Wrapper instantiation * Handle empty array marshalling I implement almost same way as DllImportGenerator handle that https://github.com/dotnet/runtime/blob/8d5f5267d33f7703c014cc89670f1f7aa47544f9/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ArrayMarshaller.cs#L91-L99 * Perform unwrapping of CCW to IntPtr inside ComWrapper That, and introducing `SHCreateShellItemViaComWrappers` make Folder browser dialog works. `SHCreateShellItemViaComWrappers` is temporary means until I walk through all paths and replace usages of old function which rely on built-in COM one by one. That's should be easier for me tot test, and for you to review. Co-authored-by: Igor Velikorossov <RussKie@users.noreply.github.com>
- Loading branch information
Showing
12 changed files
with
679 additions
and
40 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
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
Oops, something went wrong.