Skip to content

Commit 90d5b28

Browse files
committed
Fix trim warnings in 'WindowsRuntimeStreamExtensions'
1 parent 070e04e commit 90d5b28

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/cswinrt/strings/additions/Windows.Storage.Streams/WindowsRuntimeBuffer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private static unsafe void EnsureHasMarshalProxy()
8181
{
8282
IntPtr proxyPtr = default;
8383
int hr = RoGetBufferMarshaler(&proxyPtr);
84-
IMarshal proxy = new ABI.Com.IMarshal(ObjectReference<ABI.Com.IMarshal.Vftbl>.Attach(ref proxyPtr));
84+
IMarshal proxy = new ABI.Com.IMarshal(ObjectReference<ABI.Com.IMarshal.Vftbl>.Attach(ref proxyPtr, global::WinRT.Interop.IIDs.IID_IMarshal));
8585
t_winRtMarshalProxy = proxy;
8686

8787
if (hr != 0)

src/cswinrt/strings/additions/Windows.Storage.Streams/WindowsRuntimeStreamExtensions.cs

+10-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ namespace System.IO
77
{
88
using System.ComponentModel;
99
using System.Diagnostics;
10+
#if NET
11+
using System.Diagnostics.CodeAnalysis;
12+
#endif
1013
using System.IO;
1114
using System.Runtime.CompilerServices;
1215
using System.Runtime.InteropServices;
@@ -42,10 +45,13 @@ private static readonly ConditionalWeakTable<Stream, NetFxToWinRtStreamAdapter>
4245
#region Helpers
4346

4447
#if DEBUG
45-
private static void AssertMapContains<TKey, TValue>(ConditionalWeakTable<TKey, TValue> map, TKey key, TValue value,
46-
bool valueMayBeWrappedInBufferedStream)
47-
where TKey : class
48-
where TValue : class
48+
private static void AssertMapContains<TKey, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TValue>(
49+
ConditionalWeakTable<TKey, TValue> map,
50+
TKey key,
51+
TValue value,
52+
bool valueMayBeWrappedInBufferedStream)
53+
where TKey : class
54+
where TValue : class
4955
{
5056
TValue valueInMap;
5157

0 commit comments

Comments
 (0)