From 18b2d1015f7df07c6654d7dc9fc5c95a0f04069c Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 24 Nov 2023 09:22:31 +0100 Subject: [PATCH] Fix return type in [MemberFunction] CCW signatures --- .../IWICStreamExtensions.IBufferWriter.cs | 44 +++++++++---------- .../Interop/IWICStreamExtensions.Stream.cs | 44 +++++++++---------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.IBufferWriter.cs b/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.IBufferWriter.cs index 7b2fd788..03eb665d 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.IBufferWriter.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.IBufferWriter.cs @@ -53,17 +53,17 @@ unsafe partial class IWICStreamExtensions lpVtbl[0] = (delegate* unmanaged[MemberFunction])&QueryInterface; lpVtbl[1] = (delegate* unmanaged[MemberFunction])&AddRef; lpVtbl[2] = (delegate* unmanaged[MemberFunction])&Release; - lpVtbl[3] = (delegate* unmanaged[MemberFunction])&Read; - lpVtbl[4] = (delegate* unmanaged[MemberFunction])&Write; - lpVtbl[5] = (delegate* unmanaged[MemberFunction])&Seek; - lpVtbl[6] = (delegate* unmanaged[MemberFunction])&SetSize; - lpVtbl[7] = (delegate* unmanaged[MemberFunction])&CopyTo; - lpVtbl[8] = (delegate* unmanaged[MemberFunction])&Commit; - lpVtbl[9] = (delegate* unmanaged[MemberFunction])&Revert; - lpVtbl[10] = (delegate* unmanaged[MemberFunction])&LockRegion; - lpVtbl[11] = (delegate* unmanaged[MemberFunction])&UnlockRegion; - lpVtbl[12] = (delegate* unmanaged[MemberFunction])&Stat; - lpVtbl[13] = (delegate* unmanaged[MemberFunction])&Clone; + lpVtbl[3] = (delegate* unmanaged[MemberFunction])&Read; + lpVtbl[4] = (delegate* unmanaged[MemberFunction])&Write; + lpVtbl[5] = (delegate* unmanaged[MemberFunction])&Seek; + lpVtbl[6] = (delegate* unmanaged[MemberFunction])&SetSize; + lpVtbl[7] = (delegate* unmanaged[MemberFunction])&CopyTo; + lpVtbl[8] = (delegate* unmanaged[MemberFunction])&Commit; + lpVtbl[9] = (delegate* unmanaged[MemberFunction])&Revert; + lpVtbl[10] = (delegate* unmanaged[MemberFunction])&LockRegion; + lpVtbl[11] = (delegate* unmanaged[MemberFunction])&UnlockRegion; + lpVtbl[12] = (delegate* unmanaged[MemberFunction])&Stat; + lpVtbl[13] = (delegate* unmanaged[MemberFunction])&Clone; return lpVtbl; } @@ -177,14 +177,14 @@ unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Read(IBufferWriterWrapper* @this, void* pv, uint cb, uint* pcbRead) + private static int Read(IBufferWriterWrapper* @this, void* pv, uint cb, uint* pcbRead) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Write(IBufferWriterWrapper* @this, void* pv, uint cb, uint* pcbWritten) + private static int Write(IBufferWriterWrapper* @this, void* pv, uint cb, uint* pcbWritten) { if (pv == null) { @@ -220,56 +220,56 @@ unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Seek(IBufferWriterWrapper* @this, LARGE_INTEGER dlibMove, uint dwOrigin, ULARGE_INTEGER* plibNewPosition) + private static int Seek(IBufferWriterWrapper* @this, LARGE_INTEGER dlibMove, uint dwOrigin, ULARGE_INTEGER* plibNewPosition) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT SetSize(IBufferWriterWrapper* @this, ULARGE_INTEGER libNewSize) + private static int SetSize(IBufferWriterWrapper* @this, ULARGE_INTEGER libNewSize) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT CopyTo(IBufferWriterWrapper* @this, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) + private static int CopyTo(IBufferWriterWrapper* @this, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { return E_NOTIMPL; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Commit(IBufferWriterWrapper* @this, uint grfCommitFlags) + private static int Commit(IBufferWriterWrapper* @this, uint grfCommitFlags) { return S_OK; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Revert(IBufferWriterWrapper* @this) + private static int Revert(IBufferWriterWrapper* @this) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT LockRegion(IBufferWriterWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType) + private static int LockRegion(IBufferWriterWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT UnlockRegion(IBufferWriterWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType) + private static int UnlockRegion(IBufferWriterWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Stat(IBufferWriterWrapper* @this, STATSTG* pstatstg, uint grfStatFlag) + private static int Stat(IBufferWriterWrapper* @this, STATSTG* pstatstg, uint grfStatFlag) { if (pstatstg == null) { @@ -301,7 +301,7 @@ unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Clone(IBufferWriterWrapper* @this, IStream** ppstm) + private static int Clone(IBufferWriterWrapper* @this, IStream** ppstm) { return STG_E_INVALIDFUNCTION; } diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.Stream.cs b/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.Stream.cs index 64fe382b..108b6a60 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.Stream.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/IWICStreamExtensions.Stream.cs @@ -55,17 +55,17 @@ internal static unsafe partial class IWICStreamExtensions lpVtbl[0] = (delegate* unmanaged[MemberFunction])&QueryInterface; lpVtbl[1] = (delegate* unmanaged[MemberFunction])&AddRef; lpVtbl[2] = (delegate* unmanaged[MemberFunction])&Release; - lpVtbl[3] = (delegate* unmanaged[MemberFunction])&Read; - lpVtbl[4] = (delegate* unmanaged[MemberFunction])&Write; - lpVtbl[5] = (delegate* unmanaged[MemberFunction])&Seek; - lpVtbl[6] = (delegate* unmanaged[MemberFunction])&SetSize; - lpVtbl[7] = (delegate* unmanaged[MemberFunction])&CopyTo; - lpVtbl[8] = (delegate* unmanaged[MemberFunction])&Commit; - lpVtbl[9] = (delegate* unmanaged[MemberFunction])&Revert; - lpVtbl[10] = (delegate* unmanaged[MemberFunction])&LockRegion; - lpVtbl[11] = (delegate* unmanaged[MemberFunction])&UnlockRegion; - lpVtbl[12] = (delegate* unmanaged[MemberFunction])&Stat; - lpVtbl[13] = (delegate* unmanaged[MemberFunction])&Clone; + lpVtbl[3] = (delegate* unmanaged[MemberFunction])&Read; + lpVtbl[4] = (delegate* unmanaged[MemberFunction])&Write; + lpVtbl[5] = (delegate* unmanaged[MemberFunction])&Seek; + lpVtbl[6] = (delegate* unmanaged[MemberFunction])&SetSize; + lpVtbl[7] = (delegate* unmanaged[MemberFunction])&CopyTo; + lpVtbl[8] = (delegate* unmanaged[MemberFunction])&Commit; + lpVtbl[9] = (delegate* unmanaged[MemberFunction])&Revert; + lpVtbl[10] = (delegate* unmanaged[MemberFunction])&LockRegion; + lpVtbl[11] = (delegate* unmanaged[MemberFunction])&UnlockRegion; + lpVtbl[12] = (delegate* unmanaged[MemberFunction])&Stat; + lpVtbl[13] = (delegate* unmanaged[MemberFunction])&Clone; return lpVtbl; } @@ -179,7 +179,7 @@ internal static unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Read(IStreamWrapper* @this, void* pv, uint cb, uint* pcbRead) + private static int Read(IStreamWrapper* @this, void* pv, uint cb, uint* pcbRead) { if (pv == null) { @@ -227,7 +227,7 @@ internal static unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Write(IStreamWrapper* @this, void* pv, uint cb, uint* pcbWritten) + private static int Write(IStreamWrapper* @this, void* pv, uint cb, uint* pcbWritten) { if (pv == null) { @@ -263,7 +263,7 @@ internal static unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Seek(IStreamWrapper* @this, LARGE_INTEGER dlibMove, uint dwOrigin, ULARGE_INTEGER* plibNewPosition) + private static int Seek(IStreamWrapper* @this, LARGE_INTEGER dlibMove, uint dwOrigin, ULARGE_INTEGER* plibNewPosition) { SeekOrigin origin = (SeekOrigin)dwOrigin; @@ -301,7 +301,7 @@ internal static unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT SetSize(IStreamWrapper* @this, ULARGE_INTEGER libNewSize) + private static int SetSize(IStreamWrapper* @this, ULARGE_INTEGER libNewSize) { if (libNewSize.QuadPart > long.MaxValue) { @@ -322,14 +322,14 @@ internal static unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT CopyTo(IStreamWrapper* @this, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) + private static int CopyTo(IStreamWrapper* @this, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { return E_NOTIMPL; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Commit(IStreamWrapper* @this, uint grfCommitFlags) + private static int Commit(IStreamWrapper* @this, uint grfCommitFlags) { try { @@ -345,28 +345,28 @@ internal static unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Revert(IStreamWrapper* @this) + private static int Revert(IStreamWrapper* @this) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT LockRegion(IStreamWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType) + private static int LockRegion(IStreamWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT UnlockRegion(IStreamWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType) + private static int UnlockRegion(IStreamWrapper* @this, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, uint dwLockType) { return STG_E_INVALIDFUNCTION; } /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Stat(IStreamWrapper* @this, STATSTG* pstatstg, uint grfStatFlag) + private static int Stat(IStreamWrapper* @this, STATSTG* pstatstg, uint grfStatFlag) { if (pstatstg == null) { @@ -434,7 +434,7 @@ internal static unsafe partial class IWICStreamExtensions /// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - private static HRESULT Clone(IStreamWrapper* @this, IStream** ppstm) + private static int Clone(IStreamWrapper* @this, IStream** ppstm) { return STG_E_INVALIDFUNCTION; }