Repository navigation
fix: WinRT projection gaps behind core storage, settings and picker APIs - #37
Merged
Merged
Conversation
- Interface-typed returns wrap as their runtime class. IPropertySet (ApplicationDataContainer.Values, CoreApplication.Properties) declares no members itself, so HasKey/Lookup/Insert/First were missing. - Methods whose overloads all carry [Overload] names are reachable by their public name (StorageFile.CopyAsync/MoveAsync), and prototype methods switch overload on argc (RenameAsync(name), DeleteAsync()). - Objects implementing IInitializeWithWindow (pickers) get the app's top-level window as owner instead of the console window, which a packaged app does not have.
WinRT wrappers do not expose __native_ptr, so a projected object passed to dotnet.invoke fell through to toString() and arrived as a string. Encode the wrapper's COM instance as a WinRT ref (tag 0x0A) directly, and have the bridge project it through C#/WinRT when loaded, so it casts to its projected type (FileOpenPicker) and works with WinRT.Interop.InitializeWithWindow.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runtime side of NativeScript/NativeScript#11613, NativeScript/NativeScript#11614 and NativeScript/NativeScript#11616. The core side is on NativeScript
feat/windows(097ece1ee, 5513b7fd6).Projection (classic + napi)
IPropertySetdeclares no members of its own, only the genericIMap/IIterableit requires, soApplicationData.Current.LocalSettings.ValuesandCoreApplication.Propertiescame back with noHasKey/Lookup/Insert/First. The classicreturn_value_from_kindpath and the napi proxy path now resolve the runtime class fromGetRuntimeClassName, as the ns_proxy builder already did.[Overload]-only methods.StorageFile.CopyAsync/MoveAsyncoverloads are all namedCopyOverload*/MoveOverload*, sofile.CopyAsync(...)was undefined on classic. The class member index now also records the public name. Prototype methods switch overload by argument count, soRenameAsync(name)andDeleteAsync()no longer hit the overload that takes an extra option argument.IInitializeWithWindowwere initialized withGetConsoleWindow(), which is null in a packaged app, so pickers failed. They now get a visible, unowned top-level window of this thread (then this process, then the console). The napi activation paths now do the same..NET bridge
__native_ptr, so a WinRT object passed todotnet.invokefell through totoString()and arrived asSystem.String. The encoders (classic and napi, args and callback values) now send the wrapper's COM instance as a WinRT ref (tag0x0A) directly. The pointer is borrowed: the wrapper keeps it alive during the synchronous coercion, and the managed wrapper takes its own reference.CoerceBinprojects WinRT refs throughWinRT.MarshalInspectable<object>.FromAbi(by reflection) when C#/WinRT is loaded, so the object is a realFileOpenPickerand works withWinRT.Interop.InitializeWithWindow. It falls back to the existingMarshalpaths otherwise.Not runtime bugs (from the same reports)
JsonValue,PropertySetand the clipboard. Clipboard NUL truncation is the OS behavior (clipboard text is NUL-terminated).Task-returningdotnet.invokecalls stopped blocking in a6666c5. The reporter is on0.1.0-alpha.144, which predates that.Testing
projection_test.rs:IPropertySetreturn members;CopyAsync/MoveAsync/RenameAsync(name)/DeleteAsync()against a temp folder.cargo test -p runtime --lib: 165 passed, 11 failed. The 11 are the known environment-dependent baseline failures and are unchanged.npm test: 439/439. dotnet-bridge-tests: 136/136.