File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public unsafe struct ComHeapPtr<T> : IDisposable where T : unmanaged
16
16
private T * _ptr ;
17
17
18
18
public bool IsNull
19
- => _ptr == default ;
19
+ => _ptr == null ;
20
20
21
21
public ComHeapPtr ( T * ptr )
22
22
{
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public unsafe struct ComPtr<T> : IDisposable where T : unmanaged
16
16
private T * _ptr ;
17
17
18
18
public bool IsNull
19
- => _ptr == default ;
19
+ => _ptr == null ;
20
20
21
21
public ComPtr ( T * ptr )
22
22
{
@@ -38,6 +38,14 @@ public ComPtr(T* ptr)
38
38
return ( T * * ) Unsafe . AsPointer ( ref Unsafe . AsRef ( in this ) ) ;
39
39
}
40
40
41
+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
42
+ public readonly ComPtr < U > As < U > ( Guid riid ) where U : unmanaged
43
+ {
44
+ ComPtr < U > pNewPtr = default ;
45
+ ( ( IUnknown * ) _ptr ) ->QueryInterface ( & riid , ( void * * ) pNewPtr . GetAddressOf ( ) ) ;
46
+ return pNewPtr ;
47
+ }
48
+
41
49
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
42
50
public void Dispose ( )
43
51
{
You can’t perform that action at this time.
0 commit comments