Fix WinRT marshalling for NotifyPropertyChangedEventArgs and NotifyCollectionChangedEventArgs (CoreFX side) (dotnet/corefx#36224)
The fix for dotnet/corefxdotnet/corefx#35909 requires both some runtime work and some framework work since the marshalling helpers for NotifyPropertyChangedEventArgs and NotifyCollectionChangedEventArgs lives in corefx.
In this PR:
- Update the signatures of `INotifyCollectionChangedEventArgsFactory.CreateInstanceWithAllParameters` and `INotifyPropertyChangedEventArgsFactory.CreateInstance` to be as close to their official `winmd` signature as possible.
We cannot update the return types since we need to make sure we return the raw COM object pointer and not a pointer to an RCW that was projected through our WinRT type projection back to managed. (depends on dotnet/coreclrdotnet/corefx#23401)
- Call a new function on `System.Runtime.InteropServices.WindowsRuntimeMarshal` called `GetUniqueObjectForIUnknownWithoutUnboxing` (introduced in dotnet/coreclrdotnet/corefx#23401) to get back an RCW for the IUnknown pointer without going through the WinRT projections. The WinRT projections for `INotifyPropertyChangedEventArgs` and `INotifyCollectionChangedEventArgs` go through this code to project themselves to the managed code, so we need a way to get back a "raw" RCW that is not projected to avoid infinitely recursing into a stack-overflow (current behavior) and avoid having to manually traversing the vtable of the native interfaces (impractical to implement).
Depends on dotnet/coreclrdotnet/corefx#23401
Fixes dotnet/corefx#35909
Co-authored-by: Jeff Schwartz <JeffSchw@microsoft.com>
Commit migrated from https://github.com/dotnet/corefx/commit/
b0123b9bdd9a4bf0b1447d9d2a4c4b77ed708f05