Skip to content

Conversation

@kythant
Copy link

@kythant kythant commented Nov 25, 2025

No description provided.

@kythant kythant closed this Nov 25, 2025
@kythant kythant reopened this Nov 26, 2025
@kythant kythant closed this Nov 27, 2025
@kythant kythant reopened this Dec 1, 2025
kythant and others added 17 commits December 1, 2025 15:59
Simplifies and clarifies the handling of TypeReference creation, including improved comments and restructuring for primitive and proxy types. Ensures more consistent reporting of TypeKind and streamlines marshalling info usage.
Changed the TypeReference.Name field from string? to ReadOnlySpan<char> for improved memory safety and performance. Updated marshalling logic and related references to accommodate the new type.
Added [WindowsRuntimeMetadata] attributes to ABI type classes in WinRT.Runtime2 to specify their associated Windows contracts. This improves metadata clarity and contract mapping for types such as Boolean, Byte, Char, DateTimeOffset, Double, EventHandler, Exception, Guid, Int16, Int32, Int64, Numerics types, Object, Single, String, TimeSpan, Type, UInt16, UInt32, UInt64, and Uri.
Introduces TypeMapAssociation attributes for DynamicInterfaceCastableImplementationTypeMapGroup to INotifyDataErrorInfo, IDisposable, and IServiceProvider ABI interfaces. Also adds WindowsRuntimeMetadata and WindowsRuntimeClassName attributes to their respective interface implementations for improved WinRT interop.
Added logic to TypeMarshaller to support round-tripping C# primitive types (e.g., System.SByte) that are not Windows Runtime types. This ensures such types can be resolved even if not found in the WindowsRuntimeMarshallingInfo lookup.
Sergio0694 and others added 21 commits December 5, 2025 16:21
Introduced TypeMapAssociation attributes for WindowsRuntimeMetadataTypeMapGroup in ABI types including IDisposable, IServiceProvider, AsyncActionCompletedHandler, IVectorChangedEventArgs, IAsyncAction, and IAsyncInfo to improve type mapping and metadata handling.
Replaces WindowsRuntimeComWrappersTypeMapGroup with WindowsRuntimeMetadataTypeMapGroup in Matrix3x2, Matrix4x4, Plane, Quaternion, and Vector2 type map attributes for improved metadata handling.
Deleted the [WindowsRuntimeMetadataTypeName("Object")] attribute from the Object class as it was unnecessary. This helps clean up the code and avoid redundant metadata.
Added TypeMapAssemblyTarget attributes for WindowsRuntimeMetadataTypeMapGroup and DynamicInterfaceCastableImplementationTypeMapGroup to support additional type mapping scenarios in generated assemblies.
Refactored ABI.System.ComponentModel.INotifyDataErrorInfo to consistently use fully qualified type names for global::System.ComponentModel.INotifyDataErrorInfo throughout the file. Added new TypeMap and TypeMapAssociation attributes for WindowsRuntimeMetadataTypeMapGroup, and improved documentation comments for clarity. This enhances type safety and interoperability with Windows Runtime metadata.
Replaces PlaceholderWindowsRuntimeComWrappersMarshallerAttribute with WindowsRuntimeComWrappersMarshallerAttributePlaceholder in a new file and updates all references. Removes the old placeholder and related reference type attribute from WindowsRuntimeMarshallingInfo.cs for improved clarity and maintainability.
Replaces PlaceholderDynamicInterfaceCastableImplementationForwarderAttribute with DynamicInterfaceCastableImplementationForwarderAttributePlaceholder and moves its implementation to a new file. Updates all references to use the new class name, improving clarity and organization.
Refactors ContextAwareObjectReference to use NullPlaceholder.Instance instead of PlaceholderNullAgileReference.Instance. Removes the now-unused PlaceholderNullAgileReference class.
Added [WindowsRuntimeMappedType] attributes to various ABI types in the WinRT.Runtime2 project. This change improves type mapping between .NET types and their Windows Runtime counterparts, enhancing interop and metadata clarity.
Introduces the WindowsRuntimeMappedMetadataAttribute for annotating custom-mapped types with their source Windows Runtime metadata file. The attribute is marked obsolete and is intended for internal use.
Replaces the check for WindowsRuntimeMetadataAttribute with WindowsRuntimeMappedMetadataAttribute for proxy types, ensuring correct identification of custom-mapped types. Adds a Debug.Assert to verify the code path is only triggered for proxy types. Also updates a comment for clarity and removes the unused isMetadataType argument in one constructor call.
Updated all ABI type files to use the [WindowsRuntimeMappedMetadata] attribute instead of [WindowsRuntimeMetadata] for contract mapping. This change standardizes the attribute usage across all relevant types in the WinRT.Runtime2 ABI layer.
Refactored the static ConditionalWeakTable field to improve naming consistency and clarity. Updated all references to use the new name, reflecting its purpose of mapping types to metadata info rather than marshalling info.
Added WindowsRuntimeMetadataTypeName and WindowsRuntimeReferenceType attributes to the EventRegistrationToken struct to enhance metadata and type information for interop scenarios.
Updated ABI files for IVectorChangedEventArgs, IAsyncAction, and IAsyncInfo to use direct type references instead of global::Windows.Foundation.* type names. Removed redundant TypeMapAssociation attributes and adjusted marshaller and interface implementation code accordingly. Also removed an unused attribute from EventRegistrationToken. These changes improve code clarity and maintainability by reducing reliance on global type names and streamlining type mapping.
@kythant kythant changed the title User/kythant/type handling System.Type Marshaling Jan 5, 2026
Sergio0694 and others added 7 commits January 6, 2026 13:49
Introduced GetAnonymousInspectableMarshallingInfo to centralize logic for retrieving marshalling info for anonymous objects, including special cases for Exception and Type. This improves code clarity and maintainability by removing repeated logic and handling custom exception and Type instances more explicitly.
Added special handling for projected types, exceptions, and System.Type in TypeMarshaller. Improved logic for mapping metadata types to CLR types, including handling for KeyValuePair and delegate types. These changes improve accuracy and round-tripping of type information during marshalling.
Enhanced TypeMarshaller to better handle value types and delegates without explicit metadata names, and to properly bypass marshalling for Nullable<KeyValuePair<,>> types. Removed redundant [WindowsRuntimeMetadataTypeName] attributes from Point, Rect, and Size to align with updated marshalling logic.
Replaces usage of _metadataTypeName with _runtimeClassName when retrieving the cached runtime class name, ensuring the correct value is returned.
@kythant kythant marked this pull request as ready for review January 9, 2026 22:38
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.

4 participants