Validate D2D factories when creating managed wrappers
このコミットが含まれているのは:
1 親
e6a22dc159
コミット
84836bb423
2ファイル変更
+52
-2
検索条件に一致するファイルはありません
@@ -51,7 +51,7 @@ internal static unsafe class IUnknownExtensions
|
||||
/// <typeparam name="T">The type of object being copied.</typeparam>
|
||||
/// <param name="source">The source <see cref="IUnknown"/> object.</param>
|
||||
/// <param name="destination">The destination <see cref="ComPtr{T}"/> location.</param>
|
||||
/// <returns>The <see cref="HRESULT"/> for the operation (always <see cref="S.S_OK"/>).</returns>
|
||||
/// <returns>The <see cref="HRESULT"/> for the operation.</returns>
|
||||
public static HRESULT CopyTo<T>(this ref T source, ref ComPtr<T> destination)
|
||||
where T : unmanaged // IUnknown
|
||||
{
|
||||
@@ -65,4 +65,21 @@ internal static unsafe class IUnknownExtensions
|
||||
|
||||
return temporary.CopyTo(ref destination);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies the source <see cref="IUnknown"/> object onto a target <typeparamref name="U"/> location.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of object being copied.</typeparam>
|
||||
/// <typeparam name="U">The type of destination object being copied.</typeparam>
|
||||
/// <param name="source">The source <see cref="IUnknown"/> object.</param>
|
||||
/// <param name="destination">The destination <typeparamref name="U"/> location.</param>
|
||||
/// <returns>The <see cref="HRESULT"/> for the operation.</returns>
|
||||
public static HRESULT CopyTo<T, U>(this ref T source, U** destination)
|
||||
where T : unmanaged // IUnknown
|
||||
where U : unmanaged // IUnknown
|
||||
{
|
||||
using ComPtr<T> temporary = new((T*)Unsafe.AsPointer(ref source));
|
||||
|
||||
return temporary.CopyTo(destination);
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする