diff --git a/generation/um/dxcapi/generate.rsp b/generation/um/dxcapi/generate.rsp new file mode 100644 index 0000000000..f1f4ec8dcc --- /dev/null +++ b/generation/um/dxcapi/generate.rsp @@ -0,0 +1,52 @@ +@../../settings.rsp +@../../remap.rsp +--exclude +DxcValidatorFlags_Default +DxcValidatorFlags_InPlaceEdit +DxcValidatorFlags_RootSignatureOnly +DxcValidatorFlags_ModuleOnly +DxcValidatorFlags_ValidMask +DxcVersionInfoFlags_None +DxcVersionInfoFlags_Debug +DxcVersionInfoFlags_Internal +CLSID_DxcCompiler +CLSID_DxcLinker +CLSID_DxcDiaDataSource +CLSID_DxcLibrary +CLSID_DxcValidator +CLSID_DxcAssembler +CLSID_DxcContainerReflection +CLSID_DxcOptimizer +CLSID_DxcContainerBuilder +--file +um-dxcapi.h +--output +../../../sources/Interop/Windows/um/dxcapi +--traverse +C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/dxcapi.h +--with-attribute +IDxcAssembly=Guid("091F7A26-1C1F-4948-904B-E6E3A8A771D5") +IDxcBlob=Guid("8BA5FB08-5195-40e2-AC58-0D989C3A0102") +IDxcBlobEncoding=Guid("7241d424-2646-4191-97c0-98e96e42fc68") +IDxcBlobUtf16=Guid("A3F84EAB-0FAA-497E-A39C-EE6ED60B2D84") +IDxcBlobUtf8=Guid("3DA636C9-BA71-4024-A301-30CBF125305B") +IDxcIncludeHandler=Guid("7f61fc7d-950d-467f-b3e3-3c02fb49187c") +IDxcCompilerArgs=Guid("73EFFE2A-70DC-45F8-9690-EFF64C02429D") +IDxcLibrary=Guid("e5204dc7-d18c-4c3c-bdfb-851673980fe7") +IDxcOperationResult=Guid("CEDB484A-D4E9-445A-B991-CA21CA157DC2") +IDxcCompiler=Guid("8c210bf3-011f-4422-8d70-6f9acb8db617") +IDxcCompiler2=Guid("A005A9D9-B8BB-4594-B5C9-0E633BEC4D37") +IDxcLinker=Guid("F1B5BE2A-62DD-4327-A1C2-42AC1E1E78E6") +IDxcUtils=Guid("4605C4CB-2019-492A-ADA4-65F20BB7D67F") +IDxcResult=Guid("58346CDA-DDE7-4497-9461-6F87AF5E0659") +IDxcCompiler3=Guid("228B4687-5A6A-4730-900C-9702B2203F54") +IDxcValidator=Guid("A6E82BD2-1FD7-4826-9811-2857E797F49A") +IDxcContainerBuilder=Guid("334b1f50-2292-4b35-99a1-25588d8c17fe") +IDxcAssembler=Guid("091f7a26-1c1f-4948-904b-e6e3a8a771d5") +IDxcContainerReflection=Guid("d2c21b26-8350-4bdc-976a-331ce6f4c54c") +IDxcOptimizerPass=Guid("AE2CD79F-CC22-453F-9B6B-B124E7A5204C") +IDxcOptimizer=Guid("25740E2E-9CBA-401B-9119-4FB42F39F270") +IDxcVersionInfo=Guid("b04f5b50-2059-4f12-a8ff-a1e0cde1cc7e") +IDxcVersionInfo2=Guid("fb6904c4-42f0-4b62-9c46-983af7da7c83") +--with-librarypath +*=dxcompiler diff --git a/generation/um/dxcapi/header.txt b/generation/um/dxcapi/header.txt new file mode 100644 index 0000000000..5ea72b71a2 --- /dev/null +++ b/generation/um/dxcapi/header.txt @@ -0,0 +1,4 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. diff --git a/generation/um/dxcapi/um-dxcapi.h b/generation/um/dxcapi/um-dxcapi.h new file mode 100644 index 0000000000..0ecba099f2 --- /dev/null +++ b/generation/um/dxcapi/um-dxcapi.h @@ -0,0 +1,2 @@ +#include +#include diff --git a/samples/DirectX/D3D12/HelloTriangle12.cs b/samples/DirectX/D3D12/HelloTriangle12.cs index 599a3fed6b..65108594d8 100644 --- a/samples/DirectX/D3D12/HelloTriangle12.cs +++ b/samples/DirectX/D3D12/HelloTriangle12.cs @@ -338,7 +338,7 @@ private void LoadAssets() InputSlotClass = D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, }, }; - + // Describe and create the graphics pipeline state object (PSO). var psoDesc = new D3D12_GRAPHICS_PIPELINE_STATE_DESC { InputLayout = new D3D12_INPUT_LAYOUT_DESC { diff --git a/sources/Interop/Windows/um/dxcapi/DxcCreateInstance2Proc.cs b/sources/Interop/Windows/um/dxcapi/DxcCreateInstance2Proc.cs new file mode 100644 index 0000000000..4e138b74fa --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/DxcCreateInstance2Proc.cs @@ -0,0 +1,14 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public unsafe delegate int DxcCreateInstance2Proc([NativeTypeName("IMalloc *")] IMalloc* pMalloc, [NativeTypeName("const IID &")] Guid* rclsid, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("LPVOID *")] void** ppv); +} diff --git a/sources/Interop/Windows/um/dxcapi/DxcCreateInstanceProc.cs b/sources/Interop/Windows/um/dxcapi/DxcCreateInstanceProc.cs new file mode 100644 index 0000000000..44483f0536 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/DxcCreateInstanceProc.cs @@ -0,0 +1,14 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public unsafe delegate int DxcCreateInstanceProc([NativeTypeName("const IID &")] Guid* rclsid, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("LPVOID *")] void** ppv); +} diff --git a/sources/Interop/Windows/um/dxcapi/DxcDefine.cs b/sources/Interop/Windows/um/dxcapi/DxcDefine.cs new file mode 100644 index 0000000000..d89f03726f --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/DxcDefine.cs @@ -0,0 +1,16 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop +{ + public unsafe partial struct DxcDefine + { + [NativeTypeName("LPCWSTR")] + public ushort* Name; + + [NativeTypeName("LPCWSTR")] + public ushort* Value; + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcAssembler.cs b/sources/Interop/Windows/um/dxcapi/IDxcAssembler.cs new file mode 100644 index 0000000000..c90e00dc56 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcAssembler.cs @@ -0,0 +1,72 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("091f7a26-1c1f-4948-904b-e6e3a8a771d5")] + public unsafe partial struct IDxcAssembler + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcAssembler* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcAssembler* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcAssembler* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _AssembleToContainer(IDxcAssembler* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pShader, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcAssembler*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcAssembler*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcAssembler*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int AssembleToContainer([NativeTypeName("IDxcBlob *")] IDxcBlob* pShader, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_AssembleToContainer>(lpVtbl->AssembleToContainer)((IDxcAssembler*)Unsafe.AsPointer(ref this), pShader, ppResult); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (IDxcBlob *, IDxcOperationResult **) __attribute__((stdcall))")] + public IntPtr AssembleToContainer; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcBlob.cs b/sources/Interop/Windows/um/dxcapi/IDxcBlob.cs new file mode 100644 index 0000000000..93f023a20b --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcBlob.cs @@ -0,0 +1,85 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("8BA5FB08-5195-40e2-AC58-0D989C3A0102")] + public unsafe partial struct IDxcBlob + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcBlob* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcBlob* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcBlob* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("LPVOID")] + public delegate void* _GetBufferPointer(IDxcBlob* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("SIZE_T")] + public delegate nuint _GetBufferSize(IDxcBlob* pThis); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcBlob*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcBlob*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcBlob*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("LPVOID")] + public void* GetBufferPointer() + { + return Marshal.GetDelegateForFunctionPointer<_GetBufferPointer>(lpVtbl->GetBufferPointer)((IDxcBlob*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("SIZE_T")] + public nuint GetBufferSize() + { + return Marshal.GetDelegateForFunctionPointer<_GetBufferSize>(lpVtbl->GetBufferSize)((IDxcBlob*)Unsafe.AsPointer(ref this)); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("LPVOID () __attribute__((stdcall))")] + public IntPtr GetBufferPointer; + + [NativeTypeName("SIZE_T () __attribute__((stdcall))")] + public IntPtr GetBufferSize; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcBlobEncoding.cs b/sources/Interop/Windows/um/dxcapi/IDxcBlobEncoding.cs new file mode 100644 index 0000000000..de7e3e8b2e --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcBlobEncoding.cs @@ -0,0 +1,98 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("7241d424-2646-4191-97c0-98e96e42fc68")] + public unsafe partial struct IDxcBlobEncoding + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcBlobEncoding* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcBlobEncoding* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcBlobEncoding* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("LPVOID")] + public delegate void* _GetBufferPointer(IDxcBlobEncoding* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("SIZE_T")] + public delegate nuint _GetBufferSize(IDxcBlobEncoding* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetEncoding(IDxcBlobEncoding* pThis, [NativeTypeName("BOOL *")] int* pKnown, [NativeTypeName("UINT32 *")] uint* pCodePage); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcBlobEncoding*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcBlobEncoding*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcBlobEncoding*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("LPVOID")] + public void* GetBufferPointer() + { + return Marshal.GetDelegateForFunctionPointer<_GetBufferPointer>(lpVtbl->GetBufferPointer)((IDxcBlobEncoding*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("SIZE_T")] + public nuint GetBufferSize() + { + return Marshal.GetDelegateForFunctionPointer<_GetBufferSize>(lpVtbl->GetBufferSize)((IDxcBlobEncoding*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int GetEncoding([NativeTypeName("BOOL *")] int* pKnown, [NativeTypeName("UINT32 *")] uint* pCodePage) + { + return Marshal.GetDelegateForFunctionPointer<_GetEncoding>(lpVtbl->GetEncoding)((IDxcBlobEncoding*)Unsafe.AsPointer(ref this), pKnown, pCodePage); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("LPVOID () __attribute__((stdcall))")] + public IntPtr GetBufferPointer; + + [NativeTypeName("SIZE_T () __attribute__((stdcall))")] + public IntPtr GetBufferSize; + + [NativeTypeName("HRESULT (BOOL *, UINT32 *) __attribute__((stdcall))")] + public IntPtr GetEncoding; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcCompiler.cs b/sources/Interop/Windows/um/dxcapi/IDxcCompiler.cs new file mode 100644 index 0000000000..b9c91b8e5d --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcCompiler.cs @@ -0,0 +1,98 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("8c210bf3-011f-4422-8d70-6f9acb8db617")] + public unsafe partial struct IDxcCompiler + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcCompiler* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcCompiler* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcCompiler* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Compile(IDxcCompiler* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR")] ushort* pEntryPoint, [NativeTypeName("LPCWSTR")] ushort* pTargetProfile, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Preprocess(IDxcCompiler* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Disassemble(IDxcCompiler* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** ppDisassembly); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcCompiler*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcCompiler*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcCompiler*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int Compile([NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR")] ushort* pEntryPoint, [NativeTypeName("LPCWSTR")] ushort* pTargetProfile, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_Compile>(lpVtbl->Compile)((IDxcCompiler*)Unsafe.AsPointer(ref this), pSource, pSourceName, pEntryPoint, pTargetProfile, pArguments, argCount, pDefines, defineCount, pIncludeHandler, ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int Preprocess([NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_Preprocess>(lpVtbl->Preprocess)((IDxcCompiler*)Unsafe.AsPointer(ref this), pSource, pSourceName, pArguments, argCount, pDefines, defineCount, pIncludeHandler, ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int Disassemble([NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** ppDisassembly) + { + return Marshal.GetDelegateForFunctionPointer<_Disassemble>(lpVtbl->Disassemble)((IDxcCompiler*)Unsafe.AsPointer(ref this), pSource, ppDisassembly); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (IDxcBlob *, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR *, UINT32, const DxcDefine *, UINT32, IDxcIncludeHandler *, IDxcOperationResult **) __attribute__((stdcall))")] + public IntPtr Compile; + + [NativeTypeName("HRESULT (IDxcBlob *, LPCWSTR, LPCWSTR *, UINT32, const DxcDefine *, UINT32, IDxcIncludeHandler *, IDxcOperationResult **) __attribute__((stdcall))")] + public IntPtr Preprocess; + + [NativeTypeName("HRESULT (IDxcBlob *, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr Disassemble; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcCompiler2.cs b/sources/Interop/Windows/um/dxcapi/IDxcCompiler2.cs new file mode 100644 index 0000000000..e1bd0258ac --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcCompiler2.cs @@ -0,0 +1,111 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("A005A9D9-B8BB-4594-B5C9-0E633BEC4D37")] + public unsafe partial struct IDxcCompiler2 + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcCompiler2* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcCompiler2* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcCompiler2* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Compile(IDxcCompiler2* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR")] ushort* pEntryPoint, [NativeTypeName("LPCWSTR")] ushort* pTargetProfile, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Preprocess(IDxcCompiler2* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Disassemble(IDxcCompiler2* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** ppDisassembly); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _CompileWithDebug(IDxcCompiler2* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR")] ushort* pEntryPoint, [NativeTypeName("LPCWSTR")] ushort* pTargetProfile, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult, [NativeTypeName("LPWSTR *")] ushort** ppDebugBlobName, [NativeTypeName("IDxcBlob **")] IDxcBlob** ppDebugBlob); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcCompiler2*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcCompiler2*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcCompiler2*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int Compile([NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR")] ushort* pEntryPoint, [NativeTypeName("LPCWSTR")] ushort* pTargetProfile, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_Compile>(lpVtbl->Compile)((IDxcCompiler2*)Unsafe.AsPointer(ref this), pSource, pSourceName, pEntryPoint, pTargetProfile, pArguments, argCount, pDefines, defineCount, pIncludeHandler, ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int Preprocess([NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_Preprocess>(lpVtbl->Preprocess)((IDxcCompiler2*)Unsafe.AsPointer(ref this), pSource, pSourceName, pArguments, argCount, pDefines, defineCount, pIncludeHandler, ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int Disassemble([NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** ppDisassembly) + { + return Marshal.GetDelegateForFunctionPointer<_Disassemble>(lpVtbl->Disassemble)((IDxcCompiler2*)Unsafe.AsPointer(ref this), pSource, ppDisassembly); + } + + [return: NativeTypeName("HRESULT")] + public int CompileWithDebug([NativeTypeName("IDxcBlob *")] IDxcBlob* pSource, [NativeTypeName("LPCWSTR")] ushort* pSourceName, [NativeTypeName("LPCWSTR")] ushort* pEntryPoint, [NativeTypeName("LPCWSTR")] ushort* pTargetProfile, [NativeTypeName("LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("const DxcDefine *")] DxcDefine* pDefines, [NativeTypeName("UINT32")] uint defineCount, [NativeTypeName("IDxcIncludeHandler *")] IDxcIncludeHandler* pIncludeHandler, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult, [NativeTypeName("LPWSTR *")] ushort** ppDebugBlobName, [NativeTypeName("IDxcBlob **")] IDxcBlob** ppDebugBlob) + { + return Marshal.GetDelegateForFunctionPointer<_CompileWithDebug>(lpVtbl->CompileWithDebug)((IDxcCompiler2*)Unsafe.AsPointer(ref this), pSource, pSourceName, pEntryPoint, pTargetProfile, pArguments, argCount, pDefines, defineCount, pIncludeHandler, ppResult, ppDebugBlobName, ppDebugBlob); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (IDxcBlob *, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR *, UINT32, const DxcDefine *, UINT32, IDxcIncludeHandler *, IDxcOperationResult **) __attribute__((stdcall))")] + public IntPtr Compile; + + [NativeTypeName("HRESULT (IDxcBlob *, LPCWSTR, LPCWSTR *, UINT32, const DxcDefine *, UINT32, IDxcIncludeHandler *, IDxcOperationResult **) __attribute__((stdcall))")] + public IntPtr Preprocess; + + [NativeTypeName("HRESULT (IDxcBlob *, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr Disassemble; + + [NativeTypeName("HRESULT (IDxcBlob *, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR *, UINT32, const DxcDefine *, UINT32, IDxcIncludeHandler *, IDxcOperationResult **, LPWSTR *, IDxcBlob **) __attribute__((stdcall))")] + public IntPtr CompileWithDebug; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcContainerBuilder.cs b/sources/Interop/Windows/um/dxcapi/IDxcContainerBuilder.cs new file mode 100644 index 0000000000..d5eff5f2ef --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcContainerBuilder.cs @@ -0,0 +1,111 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("334b1f50-2292-4b35-99a1-25588d8c17fe")] + public unsafe partial struct IDxcContainerBuilder + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcContainerBuilder* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcContainerBuilder* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcContainerBuilder* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Load(IDxcContainerBuilder* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pDxilContainerHeader); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _AddPart(IDxcContainerBuilder* pThis, [NativeTypeName("UINT32")] uint fourCC, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _RemovePart(IDxcContainerBuilder* pThis, [NativeTypeName("UINT32")] uint fourCC); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _SerializeContainer(IDxcContainerBuilder* pThis, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcContainerBuilder*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcContainerBuilder*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcContainerBuilder*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int Load([NativeTypeName("IDxcBlob *")] IDxcBlob* pDxilContainerHeader) + { + return Marshal.GetDelegateForFunctionPointer<_Load>(lpVtbl->Load)((IDxcContainerBuilder*)Unsafe.AsPointer(ref this), pDxilContainerHeader); + } + + [return: NativeTypeName("HRESULT")] + public int AddPart([NativeTypeName("UINT32")] uint fourCC, [NativeTypeName("IDxcBlob *")] IDxcBlob* pSource) + { + return Marshal.GetDelegateForFunctionPointer<_AddPart>(lpVtbl->AddPart)((IDxcContainerBuilder*)Unsafe.AsPointer(ref this), fourCC, pSource); + } + + [return: NativeTypeName("HRESULT")] + public int RemovePart([NativeTypeName("UINT32")] uint fourCC) + { + return Marshal.GetDelegateForFunctionPointer<_RemovePart>(lpVtbl->RemovePart)((IDxcContainerBuilder*)Unsafe.AsPointer(ref this), fourCC); + } + + [return: NativeTypeName("HRESULT")] + public int SerializeContainer([NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_SerializeContainer>(lpVtbl->SerializeContainer)((IDxcContainerBuilder*)Unsafe.AsPointer(ref this), ppResult); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (IDxcBlob *) __attribute__((stdcall))")] + public IntPtr Load; + + [NativeTypeName("HRESULT (UINT32, IDxcBlob *) __attribute__((stdcall))")] + public IntPtr AddPart; + + [NativeTypeName("HRESULT (UINT32) __attribute__((stdcall))")] + public IntPtr RemovePart; + + [NativeTypeName("HRESULT (IDxcOperationResult **) __attribute__((stdcall))")] + public IntPtr SerializeContainer; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcContainerReflection.cs b/sources/Interop/Windows/um/dxcapi/IDxcContainerReflection.cs new file mode 100644 index 0000000000..2b75446a8d --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcContainerReflection.cs @@ -0,0 +1,137 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("d2c21b26-8350-4bdc-976a-331ce6f4c54c")] + public unsafe partial struct IDxcContainerReflection + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcContainerReflection* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcContainerReflection* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcContainerReflection* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Load(IDxcContainerReflection* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pContainer); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetPartCount(IDxcContainerReflection* pThis, [NativeTypeName("UINT32 *")] uint* pResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetPartKind(IDxcContainerReflection* pThis, [NativeTypeName("UINT32")] uint idx, [NativeTypeName("UINT32 *")] uint* pResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetPartContent(IDxcContainerReflection* pThis, [NativeTypeName("UINT32")] uint idx, [NativeTypeName("IDxcBlob **")] IDxcBlob** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _FindFirstPartKind(IDxcContainerReflection* pThis, [NativeTypeName("UINT32")] uint kind, [NativeTypeName("UINT32 *")] uint* pResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetPartReflection(IDxcContainerReflection* pThis, [NativeTypeName("UINT32")] uint idx, [NativeTypeName("const IID &")] Guid* iid, [NativeTypeName("void **")] void** ppvObject); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcContainerReflection*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcContainerReflection*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcContainerReflection*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int Load([NativeTypeName("IDxcBlob *")] IDxcBlob* pContainer) + { + return Marshal.GetDelegateForFunctionPointer<_Load>(lpVtbl->Load)((IDxcContainerReflection*)Unsafe.AsPointer(ref this), pContainer); + } + + [return: NativeTypeName("HRESULT")] + public int GetPartCount([NativeTypeName("UINT32 *")] uint* pResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetPartCount>(lpVtbl->GetPartCount)((IDxcContainerReflection*)Unsafe.AsPointer(ref this), pResult); + } + + [return: NativeTypeName("HRESULT")] + public int GetPartKind([NativeTypeName("UINT32")] uint idx, [NativeTypeName("UINT32 *")] uint* pResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetPartKind>(lpVtbl->GetPartKind)((IDxcContainerReflection*)Unsafe.AsPointer(ref this), idx, pResult); + } + + [return: NativeTypeName("HRESULT")] + public int GetPartContent([NativeTypeName("UINT32")] uint idx, [NativeTypeName("IDxcBlob **")] IDxcBlob** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetPartContent>(lpVtbl->GetPartContent)((IDxcContainerReflection*)Unsafe.AsPointer(ref this), idx, ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int FindFirstPartKind([NativeTypeName("UINT32")] uint kind, [NativeTypeName("UINT32 *")] uint* pResult) + { + return Marshal.GetDelegateForFunctionPointer<_FindFirstPartKind>(lpVtbl->FindFirstPartKind)((IDxcContainerReflection*)Unsafe.AsPointer(ref this), kind, pResult); + } + + [return: NativeTypeName("HRESULT")] + public int GetPartReflection([NativeTypeName("UINT32")] uint idx, [NativeTypeName("const IID &")] Guid* iid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_GetPartReflection>(lpVtbl->GetPartReflection)((IDxcContainerReflection*)Unsafe.AsPointer(ref this), idx, iid, ppvObject); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (IDxcBlob *) __attribute__((stdcall))")] + public IntPtr Load; + + [NativeTypeName("HRESULT (UINT32 *) __attribute__((stdcall))")] + public IntPtr GetPartCount; + + [NativeTypeName("HRESULT (UINT32, UINT32 *) __attribute__((stdcall))")] + public IntPtr GetPartKind; + + [NativeTypeName("HRESULT (UINT32, IDxcBlob **) __attribute__((stdcall))")] + public IntPtr GetPartContent; + + [NativeTypeName("HRESULT (UINT32, UINT32 *) __attribute__((stdcall))")] + public IntPtr FindFirstPartKind; + + [NativeTypeName("HRESULT (UINT32, const IID &, void **) __attribute__((stdcall))")] + public IntPtr GetPartReflection; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcIncludeHandler.cs b/sources/Interop/Windows/um/dxcapi/IDxcIncludeHandler.cs new file mode 100644 index 0000000000..52d24fdbfc --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcIncludeHandler.cs @@ -0,0 +1,72 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("7f61fc7d-950d-467f-b3e3-3c02fb49187c")] + public unsafe partial struct IDxcIncludeHandler + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcIncludeHandler* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcIncludeHandler* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcIncludeHandler* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _LoadSource(IDxcIncludeHandler* pThis, [NativeTypeName("LPCWSTR")] ushort* pFilename, [NativeTypeName("IDxcBlob **")] IDxcBlob** ppIncludeSource); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcIncludeHandler*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcIncludeHandler*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcIncludeHandler*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int LoadSource([NativeTypeName("LPCWSTR")] ushort* pFilename, [NativeTypeName("IDxcBlob **")] IDxcBlob** ppIncludeSource) + { + return Marshal.GetDelegateForFunctionPointer<_LoadSource>(lpVtbl->LoadSource)((IDxcIncludeHandler*)Unsafe.AsPointer(ref this), pFilename, ppIncludeSource); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (LPCWSTR, IDxcBlob **) __attribute__((stdcall))")] + public IntPtr LoadSource; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcLibrary.cs b/sources/Interop/Windows/um/dxcapi/IDxcLibrary.cs new file mode 100644 index 0000000000..13781b78b5 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcLibrary.cs @@ -0,0 +1,189 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("e5204dc7-d18c-4c3c-bdfb-851673980fe7")] + public unsafe partial struct IDxcLibrary + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcLibrary* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcLibrary* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcLibrary* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _SetMalloc(IDxcLibrary* pThis, [NativeTypeName("IMalloc *")] IMalloc* pMalloc); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _CreateBlobFromBlob(IDxcLibrary* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("UINT32")] uint offset, [NativeTypeName("UINT32")] uint length, [NativeTypeName("IDxcBlob **")] IDxcBlob** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _CreateBlobFromFile(IDxcLibrary* pThis, [NativeTypeName("LPCWSTR")] ushort* pFileName, [NativeTypeName("UINT32 *")] uint* codePage, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _CreateBlobWithEncodingFromPinned(IDxcLibrary* pThis, [NativeTypeName("LPCVOID")] void* pText, [NativeTypeName("UINT32")] uint size, [NativeTypeName("UINT32")] uint codePage, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _CreateBlobWithEncodingOnHeapCopy(IDxcLibrary* pThis, [NativeTypeName("LPCVOID")] void* pText, [NativeTypeName("UINT32")] uint size, [NativeTypeName("UINT32")] uint codePage, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _CreateBlobWithEncodingOnMalloc(IDxcLibrary* pThis, [NativeTypeName("LPCVOID")] void* pText, [NativeTypeName("IMalloc *")] IMalloc* pIMalloc, [NativeTypeName("UINT32")] uint size, [NativeTypeName("UINT32")] uint codePage, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _CreateIncludeHandler(IDxcLibrary* pThis, [NativeTypeName("IDxcIncludeHandler **")] IDxcIncludeHandler** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _CreateStreamFromBlobReadOnly(IDxcLibrary* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("IStream **")] IStream** ppStream); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetBlobAsUtf8(IDxcLibrary* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetBlobAsUtf16(IDxcLibrary* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcLibrary*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcLibrary*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcLibrary*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int SetMalloc([NativeTypeName("IMalloc *")] IMalloc* pMalloc) + { + return Marshal.GetDelegateForFunctionPointer<_SetMalloc>(lpVtbl->SetMalloc)((IDxcLibrary*)Unsafe.AsPointer(ref this), pMalloc); + } + + [return: NativeTypeName("HRESULT")] + public int CreateBlobFromBlob([NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("UINT32")] uint offset, [NativeTypeName("UINT32")] uint length, [NativeTypeName("IDxcBlob **")] IDxcBlob** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_CreateBlobFromBlob>(lpVtbl->CreateBlobFromBlob)((IDxcLibrary*)Unsafe.AsPointer(ref this), pBlob, offset, length, ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int CreateBlobFromFile([NativeTypeName("LPCWSTR")] ushort* pFileName, [NativeTypeName("UINT32 *")] uint* codePage, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding) + { + return Marshal.GetDelegateForFunctionPointer<_CreateBlobFromFile>(lpVtbl->CreateBlobFromFile)((IDxcLibrary*)Unsafe.AsPointer(ref this), pFileName, codePage, pBlobEncoding); + } + + [return: NativeTypeName("HRESULT")] + public int CreateBlobWithEncodingFromPinned([NativeTypeName("LPCVOID")] void* pText, [NativeTypeName("UINT32")] uint size, [NativeTypeName("UINT32")] uint codePage, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding) + { + return Marshal.GetDelegateForFunctionPointer<_CreateBlobWithEncodingFromPinned>(lpVtbl->CreateBlobWithEncodingFromPinned)((IDxcLibrary*)Unsafe.AsPointer(ref this), pText, size, codePage, pBlobEncoding); + } + + [return: NativeTypeName("HRESULT")] + public int CreateBlobWithEncodingOnHeapCopy([NativeTypeName("LPCVOID")] void* pText, [NativeTypeName("UINT32")] uint size, [NativeTypeName("UINT32")] uint codePage, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding) + { + return Marshal.GetDelegateForFunctionPointer<_CreateBlobWithEncodingOnHeapCopy>(lpVtbl->CreateBlobWithEncodingOnHeapCopy)((IDxcLibrary*)Unsafe.AsPointer(ref this), pText, size, codePage, pBlobEncoding); + } + + [return: NativeTypeName("HRESULT")] + public int CreateBlobWithEncodingOnMalloc([NativeTypeName("LPCVOID")] void* pText, [NativeTypeName("IMalloc *")] IMalloc* pIMalloc, [NativeTypeName("UINT32")] uint size, [NativeTypeName("UINT32")] uint codePage, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding) + { + return Marshal.GetDelegateForFunctionPointer<_CreateBlobWithEncodingOnMalloc>(lpVtbl->CreateBlobWithEncodingOnMalloc)((IDxcLibrary*)Unsafe.AsPointer(ref this), pText, pIMalloc, size, codePage, pBlobEncoding); + } + + [return: NativeTypeName("HRESULT")] + public int CreateIncludeHandler([NativeTypeName("IDxcIncludeHandler **")] IDxcIncludeHandler** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_CreateIncludeHandler>(lpVtbl->CreateIncludeHandler)((IDxcLibrary*)Unsafe.AsPointer(ref this), ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int CreateStreamFromBlobReadOnly([NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("IStream **")] IStream** ppStream) + { + return Marshal.GetDelegateForFunctionPointer<_CreateStreamFromBlobReadOnly>(lpVtbl->CreateStreamFromBlobReadOnly)((IDxcLibrary*)Unsafe.AsPointer(ref this), pBlob, ppStream); + } + + [return: NativeTypeName("HRESULT")] + public int GetBlobAsUtf8([NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding) + { + return Marshal.GetDelegateForFunctionPointer<_GetBlobAsUtf8>(lpVtbl->GetBlobAsUtf8)((IDxcLibrary*)Unsafe.AsPointer(ref this), pBlob, pBlobEncoding); + } + + [return: NativeTypeName("HRESULT")] + public int GetBlobAsUtf16([NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pBlobEncoding) + { + return Marshal.GetDelegateForFunctionPointer<_GetBlobAsUtf16>(lpVtbl->GetBlobAsUtf16)((IDxcLibrary*)Unsafe.AsPointer(ref this), pBlob, pBlobEncoding); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (IMalloc *) __attribute__((stdcall))")] + public IntPtr SetMalloc; + + [NativeTypeName("HRESULT (IDxcBlob *, UINT32, UINT32, IDxcBlob **) __attribute__((stdcall))")] + public IntPtr CreateBlobFromBlob; + + [NativeTypeName("HRESULT (LPCWSTR, UINT32 *, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr CreateBlobFromFile; + + [NativeTypeName("HRESULT (LPCVOID, UINT32, UINT32, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr CreateBlobWithEncodingFromPinned; + + [NativeTypeName("HRESULT (LPCVOID, UINT32, UINT32, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr CreateBlobWithEncodingOnHeapCopy; + + [NativeTypeName("HRESULT (LPCVOID, IMalloc *, UINT32, UINT32, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr CreateBlobWithEncodingOnMalloc; + + [NativeTypeName("HRESULT (IDxcIncludeHandler **) __attribute__((stdcall))")] + public IntPtr CreateIncludeHandler; + + [NativeTypeName("HRESULT (IDxcBlob *, IStream **) __attribute__((stdcall))")] + public IntPtr CreateStreamFromBlobReadOnly; + + [NativeTypeName("HRESULT (IDxcBlob *, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr GetBlobAsUtf8; + + [NativeTypeName("HRESULT (IDxcBlob *, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr GetBlobAsUtf16; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcLinker.cs b/sources/Interop/Windows/um/dxcapi/IDxcLinker.cs new file mode 100644 index 0000000000..7095d97f18 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcLinker.cs @@ -0,0 +1,85 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("F1B5BE2A-62DD-4327-A1C2-42AC1E1E78E6")] + public unsafe partial struct IDxcLinker + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcLinker* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcLinker* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcLinker* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _RegisterLibrary(IDxcLinker* pThis, [NativeTypeName("LPCWSTR")] ushort* pLibName, [NativeTypeName("IDxcBlob *")] IDxcBlob* pLib); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Link(IDxcLinker* pThis, [NativeTypeName("LPCWSTR")] ushort* pEntryName, [NativeTypeName("LPCWSTR")] ushort* pTargetProfile, [NativeTypeName("const LPCWSTR *")] ushort** pLibNames, [NativeTypeName("UINT32")] uint libCount, [NativeTypeName("const LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcLinker*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcLinker*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcLinker*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int RegisterLibrary([NativeTypeName("LPCWSTR")] ushort* pLibName, [NativeTypeName("IDxcBlob *")] IDxcBlob* pLib) + { + return Marshal.GetDelegateForFunctionPointer<_RegisterLibrary>(lpVtbl->RegisterLibrary)((IDxcLinker*)Unsafe.AsPointer(ref this), pLibName, pLib); + } + + [return: NativeTypeName("HRESULT")] + public int Link([NativeTypeName("LPCWSTR")] ushort* pEntryName, [NativeTypeName("LPCWSTR")] ushort* pTargetProfile, [NativeTypeName("const LPCWSTR *")] ushort** pLibNames, [NativeTypeName("UINT32")] uint libCount, [NativeTypeName("const LPCWSTR *")] ushort** pArguments, [NativeTypeName("UINT32")] uint argCount, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_Link>(lpVtbl->Link)((IDxcLinker*)Unsafe.AsPointer(ref this), pEntryName, pTargetProfile, pLibNames, libCount, pArguments, argCount, ppResult); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (LPCWSTR, IDxcBlob *) __attribute__((thiscall))")] + public IntPtr RegisterLibrary; + + [NativeTypeName("HRESULT (LPCWSTR, LPCWSTR, const LPCWSTR *, UINT32, const LPCWSTR *, UINT32, IDxcOperationResult **) __attribute__((stdcall))")] + public IntPtr Link; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcOperationResult.cs b/sources/Interop/Windows/um/dxcapi/IDxcOperationResult.cs new file mode 100644 index 0000000000..a69c62ac48 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcOperationResult.cs @@ -0,0 +1,98 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("CEDB484A-D4E9-445A-B991-CA21CA157DC2")] + public unsafe partial struct IDxcOperationResult + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcOperationResult* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcOperationResult* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcOperationResult* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetStatus(IDxcOperationResult* pThis, [NativeTypeName("HRESULT *")] int* pStatus); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetResult(IDxcOperationResult* pThis, [NativeTypeName("IDxcBlob **")] IDxcBlob** pResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetErrorBuffer(IDxcOperationResult* pThis, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pErrors); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcOperationResult*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcOperationResult*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcOperationResult*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int GetStatus([NativeTypeName("HRESULT *")] int* pStatus) + { + return Marshal.GetDelegateForFunctionPointer<_GetStatus>(lpVtbl->GetStatus)((IDxcOperationResult*)Unsafe.AsPointer(ref this), pStatus); + } + + [return: NativeTypeName("HRESULT")] + public int GetResult([NativeTypeName("IDxcBlob **")] IDxcBlob** pResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetResult>(lpVtbl->GetResult)((IDxcOperationResult*)Unsafe.AsPointer(ref this), pResult); + } + + [return: NativeTypeName("HRESULT")] + public int GetErrorBuffer([NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** pErrors) + { + return Marshal.GetDelegateForFunctionPointer<_GetErrorBuffer>(lpVtbl->GetErrorBuffer)((IDxcOperationResult*)Unsafe.AsPointer(ref this), pErrors); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (HRESULT *) __attribute__((stdcall))")] + public IntPtr GetStatus; + + [NativeTypeName("HRESULT (IDxcBlob **) __attribute__((stdcall))")] + public IntPtr GetResult; + + [NativeTypeName("HRESULT (IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr GetErrorBuffer; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcOptimizer.cs b/sources/Interop/Windows/um/dxcapi/IDxcOptimizer.cs new file mode 100644 index 0000000000..680f63c673 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcOptimizer.cs @@ -0,0 +1,98 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("25740E2E-9CBA-401B-9119-4FB42F39F270")] + public unsafe partial struct IDxcOptimizer + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcOptimizer* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcOptimizer* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcOptimizer* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetAvailablePassCount(IDxcOptimizer* pThis, [NativeTypeName("UINT32 *")] uint* pCount); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetAvailablePass(IDxcOptimizer* pThis, [NativeTypeName("UINT32")] uint index, [NativeTypeName("IDxcOptimizerPass **")] IDxcOptimizerPass** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _RunOptimizer(IDxcOptimizer* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("LPCWSTR *")] ushort** ppOptions, [NativeTypeName("UINT32")] uint optionCount, [NativeTypeName("IDxcBlob **")] IDxcBlob** pOutputModule, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** ppOutputText); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcOptimizer*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcOptimizer*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcOptimizer*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int GetAvailablePassCount([NativeTypeName("UINT32 *")] uint* pCount) + { + return Marshal.GetDelegateForFunctionPointer<_GetAvailablePassCount>(lpVtbl->GetAvailablePassCount)((IDxcOptimizer*)Unsafe.AsPointer(ref this), pCount); + } + + [return: NativeTypeName("HRESULT")] + public int GetAvailablePass([NativeTypeName("UINT32")] uint index, [NativeTypeName("IDxcOptimizerPass **")] IDxcOptimizerPass** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetAvailablePass>(lpVtbl->GetAvailablePass)((IDxcOptimizer*)Unsafe.AsPointer(ref this), index, ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int RunOptimizer([NativeTypeName("IDxcBlob *")] IDxcBlob* pBlob, [NativeTypeName("LPCWSTR *")] ushort** ppOptions, [NativeTypeName("UINT32")] uint optionCount, [NativeTypeName("IDxcBlob **")] IDxcBlob** pOutputModule, [NativeTypeName("IDxcBlobEncoding **")] IDxcBlobEncoding** ppOutputText) + { + return Marshal.GetDelegateForFunctionPointer<_RunOptimizer>(lpVtbl->RunOptimizer)((IDxcOptimizer*)Unsafe.AsPointer(ref this), pBlob, ppOptions, optionCount, pOutputModule, ppOutputText); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (UINT32 *) __attribute__((stdcall))")] + public IntPtr GetAvailablePassCount; + + [NativeTypeName("HRESULT (UINT32, IDxcOptimizerPass **) __attribute__((stdcall))")] + public IntPtr GetAvailablePass; + + [NativeTypeName("HRESULT (IDxcBlob *, LPCWSTR *, UINT32, IDxcBlob **, IDxcBlobEncoding **) __attribute__((stdcall))")] + public IntPtr RunOptimizer; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcOptimizerPass.cs b/sources/Interop/Windows/um/dxcapi/IDxcOptimizerPass.cs new file mode 100644 index 0000000000..7b7d8c97da --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcOptimizerPass.cs @@ -0,0 +1,124 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("AE2CD79F-CC22-453F-9B6B-B124E7A5204C")] + public unsafe partial struct IDxcOptimizerPass + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcOptimizerPass* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcOptimizerPass* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcOptimizerPass* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetOptionName(IDxcOptimizerPass* pThis, [NativeTypeName("LPWSTR *")] ushort** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetDescription(IDxcOptimizerPass* pThis, [NativeTypeName("LPWSTR *")] ushort** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetOptionArgCount(IDxcOptimizerPass* pThis, [NativeTypeName("UINT32 *")] uint* pCount); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetOptionArgName(IDxcOptimizerPass* pThis, [NativeTypeName("UINT32")] uint argIndex, [NativeTypeName("LPWSTR *")] ushort** ppResult); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetOptionArgDescription(IDxcOptimizerPass* pThis, [NativeTypeName("UINT32")] uint argIndex, [NativeTypeName("LPWSTR *")] ushort** ppResult); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcOptimizerPass*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcOptimizerPass*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcOptimizerPass*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int GetOptionName([NativeTypeName("LPWSTR *")] ushort** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetOptionName>(lpVtbl->GetOptionName)((IDxcOptimizerPass*)Unsafe.AsPointer(ref this), ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int GetDescription([NativeTypeName("LPWSTR *")] ushort** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetDescription>(lpVtbl->GetDescription)((IDxcOptimizerPass*)Unsafe.AsPointer(ref this), ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int GetOptionArgCount([NativeTypeName("UINT32 *")] uint* pCount) + { + return Marshal.GetDelegateForFunctionPointer<_GetOptionArgCount>(lpVtbl->GetOptionArgCount)((IDxcOptimizerPass*)Unsafe.AsPointer(ref this), pCount); + } + + [return: NativeTypeName("HRESULT")] + public int GetOptionArgName([NativeTypeName("UINT32")] uint argIndex, [NativeTypeName("LPWSTR *")] ushort** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetOptionArgName>(lpVtbl->GetOptionArgName)((IDxcOptimizerPass*)Unsafe.AsPointer(ref this), argIndex, ppResult); + } + + [return: NativeTypeName("HRESULT")] + public int GetOptionArgDescription([NativeTypeName("UINT32")] uint argIndex, [NativeTypeName("LPWSTR *")] ushort** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_GetOptionArgDescription>(lpVtbl->GetOptionArgDescription)((IDxcOptimizerPass*)Unsafe.AsPointer(ref this), argIndex, ppResult); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (LPWSTR *) __attribute__((stdcall))")] + public IntPtr GetOptionName; + + [NativeTypeName("HRESULT (LPWSTR *) __attribute__((stdcall))")] + public IntPtr GetDescription; + + [NativeTypeName("HRESULT (UINT32 *) __attribute__((stdcall))")] + public IntPtr GetOptionArgCount; + + [NativeTypeName("HRESULT (UINT32, LPWSTR *) __attribute__((stdcall))")] + public IntPtr GetOptionArgName; + + [NativeTypeName("HRESULT (UINT32, LPWSTR *) __attribute__((stdcall))")] + public IntPtr GetOptionArgDescription; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcValidator.cs b/sources/Interop/Windows/um/dxcapi/IDxcValidator.cs new file mode 100644 index 0000000000..ac84863285 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcValidator.cs @@ -0,0 +1,72 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("A6E82BD2-1FD7-4826-9811-2857E797F49A")] + public unsafe partial struct IDxcValidator + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcValidator* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcValidator* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcValidator* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _Validate(IDxcValidator* pThis, [NativeTypeName("IDxcBlob *")] IDxcBlob* pShader, [NativeTypeName("UINT32")] uint Flags, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcValidator*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcValidator*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcValidator*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int Validate([NativeTypeName("IDxcBlob *")] IDxcBlob* pShader, [NativeTypeName("UINT32")] uint Flags, [NativeTypeName("IDxcOperationResult **")] IDxcOperationResult** ppResult) + { + return Marshal.GetDelegateForFunctionPointer<_Validate>(lpVtbl->Validate)((IDxcValidator*)Unsafe.AsPointer(ref this), pShader, Flags, ppResult); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (IDxcBlob *, UINT32, IDxcOperationResult **) __attribute__((stdcall))")] + public IntPtr Validate; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcVersionInfo.cs b/sources/Interop/Windows/um/dxcapi/IDxcVersionInfo.cs new file mode 100644 index 0000000000..b0aab797e8 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcVersionInfo.cs @@ -0,0 +1,85 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("b04f5b50-2059-4f12-a8ff-a1e0cde1cc7e")] + public unsafe partial struct IDxcVersionInfo + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcVersionInfo* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcVersionInfo* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcVersionInfo* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetVersion(IDxcVersionInfo* pThis, [NativeTypeName("UINT32 *")] uint* pMajor, [NativeTypeName("UINT32 *")] uint* pMinor); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetFlags(IDxcVersionInfo* pThis, [NativeTypeName("UINT32 *")] uint* pFlags); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcVersionInfo*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcVersionInfo*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcVersionInfo*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int GetVersion([NativeTypeName("UINT32 *")] uint* pMajor, [NativeTypeName("UINT32 *")] uint* pMinor) + { + return Marshal.GetDelegateForFunctionPointer<_GetVersion>(lpVtbl->GetVersion)((IDxcVersionInfo*)Unsafe.AsPointer(ref this), pMajor, pMinor); + } + + [return: NativeTypeName("HRESULT")] + public int GetFlags([NativeTypeName("UINT32 *")] uint* pFlags) + { + return Marshal.GetDelegateForFunctionPointer<_GetFlags>(lpVtbl->GetFlags)((IDxcVersionInfo*)Unsafe.AsPointer(ref this), pFlags); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (UINT32 *, UINT32 *) __attribute__((stdcall))")] + public IntPtr GetVersion; + + [NativeTypeName("HRESULT (UINT32 *) __attribute__((stdcall))")] + public IntPtr GetFlags; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/IDxcVersionInfo2.cs b/sources/Interop/Windows/um/dxcapi/IDxcVersionInfo2.cs new file mode 100644 index 0000000000..c4b252826b --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/IDxcVersionInfo2.cs @@ -0,0 +1,98 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("fb6904c4-42f0-4b62-9c46-983af7da7c83")] + public unsafe partial struct IDxcVersionInfo2 + { + public Vtbl* lpVtbl; + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _QueryInterface(IDxcVersionInfo2* pThis, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _AddRef(IDxcVersionInfo2* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("ULONG")] + public delegate uint _Release(IDxcVersionInfo2* pThis); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetVersion(IDxcVersionInfo2* pThis, [NativeTypeName("UINT32 *")] uint* pMajor, [NativeTypeName("UINT32 *")] uint* pMinor); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetFlags(IDxcVersionInfo2* pThis, [NativeTypeName("UINT32 *")] uint* pFlags); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + [return: NativeTypeName("HRESULT")] + public delegate int _GetCommitInfo(IDxcVersionInfo2* pThis, [NativeTypeName("UINT32 *")] uint* pCommitCount, [NativeTypeName("char **")] sbyte** pCommitHash); + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return Marshal.GetDelegateForFunctionPointer<_QueryInterface>(lpVtbl->QueryInterface)((IDxcVersionInfo2*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return Marshal.GetDelegateForFunctionPointer<_AddRef>(lpVtbl->AddRef)((IDxcVersionInfo2*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return Marshal.GetDelegateForFunctionPointer<_Release>(lpVtbl->Release)((IDxcVersionInfo2*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int GetVersion([NativeTypeName("UINT32 *")] uint* pMajor, [NativeTypeName("UINT32 *")] uint* pMinor) + { + return Marshal.GetDelegateForFunctionPointer<_GetVersion>(lpVtbl->GetVersion)((IDxcVersionInfo2*)Unsafe.AsPointer(ref this), pMajor, pMinor); + } + + [return: NativeTypeName("HRESULT")] + public int GetFlags([NativeTypeName("UINT32 *")] uint* pFlags) + { + return Marshal.GetDelegateForFunctionPointer<_GetFlags>(lpVtbl->GetFlags)((IDxcVersionInfo2*)Unsafe.AsPointer(ref this), pFlags); + } + + [return: NativeTypeName("HRESULT")] + public int GetCommitInfo([NativeTypeName("UINT32 *")] uint* pCommitCount, [NativeTypeName("char **")] sbyte** pCommitHash) + { + return Marshal.GetDelegateForFunctionPointer<_GetCommitInfo>(lpVtbl->GetCommitInfo)((IDxcVersionInfo2*)Unsafe.AsPointer(ref this), pCommitCount, pCommitHash); + } + + public partial struct Vtbl + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public IntPtr QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public IntPtr Release; + + [NativeTypeName("HRESULT (UINT32 *, UINT32 *) __attribute__((stdcall))")] + public IntPtr GetVersion; + + [NativeTypeName("HRESULT (UINT32 *) __attribute__((stdcall))")] + public IntPtr GetFlags; + + [NativeTypeName("HRESULT (UINT32 *, char **) __attribute__((stdcall))")] + public IntPtr GetCommitInfo; + } + } +} diff --git a/sources/Interop/Windows/um/dxcapi/Windows.Manual.cs b/sources/Interop/Windows/um/dxcapi/Windows.Manual.cs new file mode 100644 index 0000000000..beaac997b2 --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/Windows.Manual.cs @@ -0,0 +1,108 @@ +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + public static unsafe partial class Windows + { + [NativeTypeName("const UINT32")] + public const uint DxcValidatorFlags_Default = 0; + + [NativeTypeName("const UINT32")] + public const uint DxcValidatorFlags_InPlaceEdit = 1; + + [NativeTypeName("const UINT32")] + public const uint DxcValidatorFlags_RootSignatureOnly = 2; + + [NativeTypeName("const UINT32")] + public const uint DxcValidatorFlags_ModuleOnly = 4; + + [NativeTypeName("const UINT32")] + public const uint DxcValidatorFlags_ValidMask = 0x7; + + [NativeTypeName("const UINT32")] + public const uint DxcVersionInfoFlags_None = 0; + + [NativeTypeName("const UINT32")] + public const uint DxcVersionInfoFlags_Debug = 1; + + [NativeTypeName("const UINT32")] + public const uint DxcVersionInfoFlags_Internal = 2; + + [NativeTypeName("const CLSID")] + public static readonly Guid CLSID_DxcCompiler = new Guid(0x73e22d93, 0xe6ce, 0x47f3, 0xb5, 0xbf, 0xf0, 0x66, 0x4f, 0x39, 0xc1, 0xb0); + + [NativeTypeName("const GUID")] + public static readonly Guid CLSID_DxcLinker = new Guid(0xef6a8087, 0xb0ea, 0x4d56, 0x9e, 0x45, 0xd0, 0x7e, 0x1a, 0x8b, 0x78, 0x6); + + [NativeTypeName("const CLSID")] + public static readonly Guid CLSID_DxcDiaDataSource = new Guid(0xcd1f6b73, 0x2ab0, 0x484d, 0x8e, 0xdc, 0xeb, 0xe7, 0xa4, 0x3c, 0xa0, 0x9f); + + [NativeTypeName("const GUID")] + public static readonly Guid CLSID_DxcCompilerArgs = new Guid(0x3e56ae82, 0x224d, 0x470f, 0xa1, 0xa1, 0xfe, 0x30, 0x16, 0xee, 0x9f, 0x9d); + + [NativeTypeName("const GUID")] + public static readonly Guid CLSID_DxcLibrary = new Guid(0x6245d6af, 0x66e0, 0x48fd, 0x80, 0xb4, 0x4d, 0x27, 0x17, 0x96, 0x74, 0x8c); + + [NativeTypeName("const GUID")] + public static readonly Guid CLSID_DxcValidator = new Guid(0x8ca3e215, 0xf728, 0x4cf3, 0x8c, 0xdd, 0x88, 0xaf, 0x91, 0x75, 0x87, 0xa1); + + [NativeTypeName("const GUID")] + public static readonly Guid CLSID_DxcAssembler = new Guid(0xd728db68, 0xf903, 0x4f80, 0x94, 0xcd, 0xdc, 0xcf, 0x76, 0xec, 0x71, 0x51); + + [NativeTypeName("const GUID")] + public static readonly Guid CLSID_DxcContainerReflection = new Guid(0xb9f54489, 0x55b8, 0x400c, 0xba, 0x3a, 0x16, 0x75, 0xe4, 0x72, 0x8b, 0x91); + + [NativeTypeName("const GUID")] + public static readonly Guid CLSID_DxcOptimizer = new Guid(0xae2cd79f, 0xcc22, 0x453f, 0x9b, 0x6b, 0xb1, 0x24, 0xe7, 0xa5, 0x20, 0x4c); + + [NativeTypeName("const GUID")] + public static readonly Guid CLSID_DxcContainerBuilder = new Guid(0x94134294, 0x411f, 0x4574, 0xb4, 0xd0, 0x87, 0x41, 0xe2, 0x52, 0x40, 0xd2); + + public static readonly Guid IID_IDxcAssembly = new Guid(0x091F7A26, 0x1C1F, 0x4948, 0x90, 0x4B, 0xE6, 0xE3, 0xA8, 0xA7, 0x71, 0xD5); + + public static readonly Guid IID_IDxcBlob = new Guid(0x8BA5FB08, 0x5195, 0x40e2, 0xAC, 0x58, 0x0D, 0x98, 0x9C, 0x3A, 0x01, 0x02); + + public static readonly Guid IID_IDxcBlobEncoding = new Guid(0x7241d424, 0x2646, 0x4191, 0x97, 0xc0, 0x98, 0xe9, 0x6e, 0x42, 0xfc, 0x68); + + public static readonly Guid IID_IDxcBlobUtf16 = new Guid(0xA3F84EAB, 0x0FAA, 0x497E, 0xA3, 0x9C, 0xEE, 0x6E, 0xD6, 0x0B, 0x2D, 0x84); + + public static readonly Guid IID_IDxcBlobUtf8 = new Guid(0x3DA636C9, 0xBA71, 0x4024, 0xA3, 0x01, 0x30, 0xCB, 0xF1, 0x25, 0x30, 0x5B); + + public static readonly Guid IID_IDxcIncludeHandler = new Guid(0x7f61fc7d, 0x950d, 0x467f, 0xb3, 0xe3, 0x3c, 0x02, 0xfb, 0x49, 0x18, 0x7c); + + public static readonly Guid IID_IDxcCompilerArgs = new Guid(0x73EFFE2A, 0x70DC, 0x45F8, 0x96, 0x90, 0xEF, 0xF6, 0x4C, 0x02, 0x42, 0x9D); + + public static readonly Guid IID_IDxcLibrary = new Guid(0xe5204dc7, 0xd18c, 0x4c3c, 0xbd, 0xfb, 0x85, 0x16, 0x73, 0x98, 0x0f, 0xe7); + + public static readonly Guid IID_IDxcOperationResult = new Guid(0xCEDB484A, 0xD4E9, 0x445A, 0xB9, 0x91, 0xCA, 0x21, 0xCA, 0x15, 0x7D, 0xC2); + + public static readonly Guid IID_IDxcCompiler = new Guid(0x8c210bf3, 0x011f, 0x4422, 0x8d, 0x70, 0x6f, 0x9a, 0xcb, 0x8d, 0xb6, 0x17); + + public static readonly Guid IID_IDxcCompiler2 = new Guid(0xA005A9D9, 0xB8BB, 0x4594, 0xB5, 0xC9, 0x0E, 0x63, 0x3B, 0xEC, 0x4D, 0x37); + + public static readonly Guid IID_IDxcLinker = new Guid(0xF1B5BE2A, 0x62DD, 0x4327, 0xA1, 0xC2, 0x42, 0xAC, 0x1E, 0x1E, 0x78, 0xE6); + + public static readonly Guid IID_IDxcUtils = new Guid(0x4605C4CB, 0x2019, 0x492A, 0xAD, 0xA4, 0x65, 0xF2, 0x0B, 0xB7, 0xD6, 0x7F); + + public static readonly Guid IID_IDxcResult = new Guid(0x58346CDA, 0xDDE7, 0x4497, 0x94, 0x61, 0x6F, 0x87, 0xAF, 0x5E, 0x06, 0x59); + + public static readonly Guid IID_IDxcCompiler3 = new Guid(0x228B4687, 0x5A6A, 0x4730, 0x90, 0x0C, 0x97, 0x02, 0xB2, 0x20, 0x3F, 0x54); + + public static readonly Guid IID_IDxcValidator = new Guid(0xA6E82BD2, 0x1FD7, 0x4826, 0x98, 0x11, 0x28, 0x57, 0xE7, 0x97, 0xF4, 0x9A); + + public static readonly Guid IID_IDxcContainerBuilder = new Guid(0x334b1f50, 0x2292, 0x4b35, 0x99, 0xa1, 0x25, 0x58, 0x8d, 0x8c, 0x17, 0xfe); + + public static readonly Guid IID_IDxcAssembler = new Guid(0x091f7a26, 0x1c1f, 0x4948, 0x90, 0x4b, 0xe6, 0xe3, 0xa8, 0xa7, 0x71, 0xd5); + + public static readonly Guid IID_IDxcContainerReflection = new Guid(0xd2c21b26, 0x8350, 0x4bdc, 0x97, 0x6a, 0x33, 0x1c, 0xe6, 0xf4, 0xc5, 0x4c); + + public static readonly Guid IID_IDxcOptimizerPass = new Guid(0xAE2CD79F, 0xCC22, 0x453F, 0x9B, 0x6B, 0xB1, 0x24, 0xE7, 0xA5, 0x20, 0x4C); + + public static readonly Guid IID_IDxcOptimizer = new Guid(0x25740E2E, 0x9CBA, 0x401B, 0x91, 0x19, 0x4F, 0xB4, 0x2F, 0x39, 0xF2, 0x70); + + public static readonly Guid IID_IDxcVersionInfo = new Guid(0xb04f5b50, 0x2059, 0x4f12, 0xa8, 0xff, 0xa1, 0xe0, 0xcd, 0xe1, 0xcc, 0x7e); + + public static readonly Guid IID_IDxcVersionInfo2 = new Guid(0xfb6904c4, 0x42f0, 0x4b62, 0x9c, 0x46, 0x98, 0x3a, 0xf7, 0xda, 0x7c, 0x83); + } +} \ No newline at end of file diff --git a/sources/Interop/Windows/um/dxcapi/Windows.cs b/sources/Interop/Windows/um/dxcapi/Windows.cs new file mode 100644 index 0000000000..ab98e99efb --- /dev/null +++ b/sources/Interop/Windows/um/dxcapi/Windows.cs @@ -0,0 +1,21 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + public static unsafe partial class Windows + { + [DllImport("dxcompiler", EntryPoint = "DxcCreateInstance", ExactSpelling = true)] + [return: NativeTypeName("HRESULT")] + public static extern int DxcCreateInstance([NativeTypeName("const IID &")] Guid* rclsid, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("LPVOID *")] void** ppv); + + [DllImport("dxcompiler", EntryPoint = "DxcCreateInstance2", ExactSpelling = true)] + [return: NativeTypeName("HRESULT")] + public static extern int DxcCreateInstance2([NativeTypeName("IMalloc *")] IMalloc* pMalloc, [NativeTypeName("const IID &")] Guid* rclsid, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("LPVOID *")] void** ppv); + } +}