From 3d0bfcb67da7da9f565e7db5ab387c5bac6c57d0 Mon Sep 17 00:00:00 2001 From: reflectronic Date: Fri, 29 Jan 2021 21:13:45 -0500 Subject: [PATCH 1/3] Add xamlOM.h --- TerraFX.Interop.Windows.sln | 8 + generation/um/xamlOM/generate.rsp | 16 ++ generation/um/xamlOM/header.txt | 4 + generation/um/xamlOM/um-xamlOM.h | 2 + .../Windows/um/xamlOM/BaseValueSource.cs | 26 +++ .../Windows/um/xamlOM/BitmapDescription.cs | 20 ++ .../um/xamlOM/CollectionElementValue.cs | 22 +++ sources/Interop/Windows/um/xamlOM/EnumType.cs | 19 ++ .../Interop/Windows/um/xamlOM/IBitmapData.cs | 67 +++++++ .../Windows/um/xamlOM/IVisualTreeService.cs | 123 ++++++++++++ .../Windows/um/xamlOM/IVisualTreeService2.cs | 151 +++++++++++++++ .../Windows/um/xamlOM/IVisualTreeService3.cs | 179 ++++++++++++++++++ .../um/xamlOM/IVisualTreeServiceCallback.cs | 46 +++++ .../um/xamlOM/IVisualTreeServiceCallback2.cs | 53 ++++++ .../Windows/um/xamlOM/IXamlDiagnostics.cs | 95 ++++++++++ .../Interop/Windows/um/xamlOM/MetadataBit.cs | 22 +++ .../Windows/um/xamlOM/ParentChildRelation.cs | 19 ++ .../Windows/um/xamlOM/PropertyChainSource.cs | 23 +++ .../Windows/um/xamlOM/PropertyChainValue.cs | 40 ++++ .../um/xamlOM/RenderTargetBitmapOptions.cs | 13 ++ .../Interop/Windows/um/xamlOM/ResourceType.cs | 13 ++ .../Interop/Windows/um/xamlOM/SourceInfo.cs | 25 +++ .../Windows/um/xamlOM/VisualElement.cs | 24 +++ .../Windows/um/xamlOM/VisualElementState.cs | 14 ++ .../Windows/um/xamlOM/VisualMutationType.cs | 13 ++ sources/Interop/Windows/um/xamlOM/Windows.cs | 37 ++++ .../um/xamlOM/BitmapDescriptionTests.cs | 35 ++++ .../um/xamlOM/CollectionElementValueTests.cs | 43 +++++ .../Windows/um/xamlOM/EnumTypeTests.cs | 43 +++++ .../Windows/um/xamlOM/IBitmapDataTests.cs | 51 +++++ .../um/xamlOM/IVisualTreeService2Tests.cs | 51 +++++ .../um/xamlOM/IVisualTreeService3Tests.cs | 51 +++++ .../IVisualTreeServiceCallback2Tests.cs | 51 +++++ .../xamlOM/IVisualTreeServiceCallbackTests.cs | 51 +++++ .../um/xamlOM/IVisualTreeServiceTests.cs | 51 +++++ .../um/xamlOM/IXamlDiagnosticsTests.cs | 51 +++++ .../um/xamlOM/ParentChildRelationTests.cs | 35 ++++ .../um/xamlOM/PropertyChainSourceTests.cs | 43 +++++ .../um/xamlOM/PropertyChainValueTests.cs | 43 +++++ .../Windows/um/xamlOM/SourceInfoTests.cs | 43 +++++ .../Windows/um/xamlOM/VisualElementTests.cs | 43 +++++ 41 files changed, 1759 insertions(+) create mode 100644 generation/um/xamlOM/generate.rsp create mode 100644 generation/um/xamlOM/header.txt create mode 100644 generation/um/xamlOM/um-xamlOM.h create mode 100644 sources/Interop/Windows/um/xamlOM/BaseValueSource.cs create mode 100644 sources/Interop/Windows/um/xamlOM/BitmapDescription.cs create mode 100644 sources/Interop/Windows/um/xamlOM/CollectionElementValue.cs create mode 100644 sources/Interop/Windows/um/xamlOM/EnumType.cs create mode 100644 sources/Interop/Windows/um/xamlOM/IBitmapData.cs create mode 100644 sources/Interop/Windows/um/xamlOM/IVisualTreeService.cs create mode 100644 sources/Interop/Windows/um/xamlOM/IVisualTreeService2.cs create mode 100644 sources/Interop/Windows/um/xamlOM/IVisualTreeService3.cs create mode 100644 sources/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback.cs create mode 100644 sources/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback2.cs create mode 100644 sources/Interop/Windows/um/xamlOM/IXamlDiagnostics.cs create mode 100644 sources/Interop/Windows/um/xamlOM/MetadataBit.cs create mode 100644 sources/Interop/Windows/um/xamlOM/ParentChildRelation.cs create mode 100644 sources/Interop/Windows/um/xamlOM/PropertyChainSource.cs create mode 100644 sources/Interop/Windows/um/xamlOM/PropertyChainValue.cs create mode 100644 sources/Interop/Windows/um/xamlOM/RenderTargetBitmapOptions.cs create mode 100644 sources/Interop/Windows/um/xamlOM/ResourceType.cs create mode 100644 sources/Interop/Windows/um/xamlOM/SourceInfo.cs create mode 100644 sources/Interop/Windows/um/xamlOM/VisualElement.cs create mode 100644 sources/Interop/Windows/um/xamlOM/VisualElementState.cs create mode 100644 sources/Interop/Windows/um/xamlOM/VisualMutationType.cs create mode 100644 sources/Interop/Windows/um/xamlOM/Windows.cs create mode 100644 tests/Interop/Windows/um/xamlOM/BitmapDescriptionTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/CollectionElementValueTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/EnumTypeTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/IBitmapDataTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/IVisualTreeService2Tests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/IVisualTreeService3Tests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback2Tests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/IVisualTreeServiceCallbackTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/IVisualTreeServiceTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/IXamlDiagnosticsTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/ParentChildRelationTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/PropertyChainSourceTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/PropertyChainValueTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/SourceInfoTests.cs create mode 100644 tests/Interop/Windows/um/xamlOM/VisualElementTests.cs diff --git a/TerraFX.Interop.Windows.sln b/TerraFX.Interop.Windows.sln index 4b637a247b..3b291babc6 100644 --- a/TerraFX.Interop.Windows.sln +++ b/TerraFX.Interop.Windows.sln @@ -1790,6 +1790,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TlHelp32", "TlHelp32", "{BB generation\um\TlHelp32\um-TlHelp32.h = generation\um\TlHelp32\um-TlHelp32.h EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "xamlOM", "xamlOM", "{9337A17E-7551-48F3-B73D-AF8086062660}" + ProjectSection(SolutionItems) = preProject + generation\um\xamlOM\generate.rsp = generation\um\xamlOM\generate.rsp + generation\um\xamlOM\header.txt = generation\um\xamlOM\header.txt + generation\um\xamlOM\um-xamlOM.h = generation\um\xamlOM\um-xamlOM.h + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2073,6 +2080,7 @@ Global {ED73B6ED-F05F-49B9-9E01-0A27AEAA69F5} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} {A40DA57D-3CE9-4CAA-B94F-62BEA1704A4F} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} {BB1D1950-8068-4353-A482-0A2C60ED4644} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} + {9337A17E-7551-48F3-B73D-AF8086062660} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2FE36DF8-2D9C-4F20-8787-45DC74B57461} diff --git a/generation/um/xamlOM/generate.rsp b/generation/um/xamlOM/generate.rsp new file mode 100644 index 0000000000..98a973480f --- /dev/null +++ b/generation/um/xamlOM/generate.rsp @@ -0,0 +1,16 @@ +@../../settings.rsp +@../../remap.rsp +--exclude +InitializeXamlDiagnostic +--file +um-xamlOM.h +--output +../../../sources/Interop/Windows/um/xamlOM +--test-output +../../../tests/Interop/Windows/um/xamlOM +--traverse +C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/xamlOM.h +--with-attribute +MetadataBit=Flags +--with-librarypath +*=Windows.UI.Xaml.dll diff --git a/generation/um/xamlOM/header.txt b/generation/um/xamlOM/header.txt new file mode 100644 index 0000000000..9500e7822f --- /dev/null +++ b/generation/um/xamlOM/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/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. diff --git a/generation/um/xamlOM/um-xamlOM.h b/generation/um/xamlOM/um-xamlOM.h new file mode 100644 index 0000000000..3378eb38f3 --- /dev/null +++ b/generation/um/xamlOM/um-xamlOM.h @@ -0,0 +1,2 @@ +#include +#include diff --git a/sources/Interop/Windows/um/xamlOM/BaseValueSource.cs b/sources/Interop/Windows/um/xamlOM/BaseValueSource.cs new file mode 100644 index 0000000000..20300f0f38 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/BaseValueSource.cs @@ -0,0 +1,26 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop +{ + public enum BaseValueSource + { + BaseValueSourceUnknown = 0, + BaseValueSourceDefault = (BaseValueSourceUnknown + 1), + BaseValueSourceBuiltInStyle = (BaseValueSourceDefault + 1), + BaseValueSourceStyle = (BaseValueSourceBuiltInStyle + 1), + BaseValueSourceLocal = (BaseValueSourceStyle + 1), + Inherited = (BaseValueSourceLocal + 1), + DefaultStyleTrigger = (Inherited + 1), + TemplateTrigger = (DefaultStyleTrigger + 1), + StyleTrigger = (TemplateTrigger + 1), + ImplicitStyleReference = (StyleTrigger + 1), + ParentTemplate = (ImplicitStyleReference + 1), + ParentTemplateTrigger = (ParentTemplate + 1), + Animation = (ParentTemplateTrigger + 1), + Coercion = (Animation + 1), + BaseValueSourceVisualState = (Coercion + 1), + } +} diff --git a/sources/Interop/Windows/um/xamlOM/BitmapDescription.cs b/sources/Interop/Windows/um/xamlOM/BitmapDescription.cs new file mode 100644 index 0000000000..f90dacd09d --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/BitmapDescription.cs @@ -0,0 +1,20 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop +{ + public partial struct BitmapDescription + { + [NativeTypeName("unsigned int")] + public uint Width; + + [NativeTypeName("unsigned int")] + public uint Height; + + public DXGI_FORMAT Format; + + public DXGI_ALPHA_MODE AlphaMode; + } +} diff --git a/sources/Interop/Windows/um/xamlOM/CollectionElementValue.cs b/sources/Interop/Windows/um/xamlOM/CollectionElementValue.cs new file mode 100644 index 0000000000..064b1dd76d --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/CollectionElementValue.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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 CollectionElementValue + { + [NativeTypeName("unsigned int")] + public uint Index; + + [NativeTypeName("BSTR")] + public ushort* ValueType; + + [NativeTypeName("BSTR")] + public ushort* Value; + + [NativeTypeName("long long")] + public long MetadataBits; + } +} diff --git a/sources/Interop/Windows/um/xamlOM/EnumType.cs b/sources/Interop/Windows/um/xamlOM/EnumType.cs new file mode 100644 index 0000000000..a04e638b1d --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/EnumType.cs @@ -0,0 +1,19 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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 EnumType + { + [NativeTypeName("BSTR")] + public ushort* Name; + + [NativeTypeName("SAFEARRAY *")] + public SAFEARRAY* ValueInts; + + [NativeTypeName("SAFEARRAY *")] + public SAFEARRAY* ValueStrings; + } +} diff --git a/sources/Interop/Windows/um/xamlOM/IBitmapData.cs b/sources/Interop/Windows/um/xamlOM/IBitmapData.cs new file mode 100644 index 0000000000..f5edfbed9b --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/IBitmapData.cs @@ -0,0 +1,67 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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("D1A34EF2-CAD8-4635-A3D2-FCDA8D3F3CAF")] + [NativeTypeName("struct IBitmapData : IUnknown")] + public unsafe partial struct IBitmapData + { + public void** lpVtbl; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IBitmapData*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IBitmapData*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IBitmapData*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int CopyBytesTo([NativeTypeName("unsigned int")] uint sourceOffsetInBytes, [NativeTypeName("unsigned int")] uint maxBytesToCopy, [NativeTypeName("byte *")] byte* pvBytes, [NativeTypeName("unsigned int *")] uint* numberOfBytesCopied) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IBitmapData*)Unsafe.AsPointer(ref this), sourceOffsetInBytes, maxBytesToCopy, pvBytes, numberOfBytesCopied); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetStride([NativeTypeName("unsigned int *")] uint* pStride) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IBitmapData*)Unsafe.AsPointer(ref this), pStride); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetBitmapDescription([NativeTypeName("BitmapDescription *")] BitmapDescription* pBitmapDescription) + { + return ((delegate* unmanaged)(lpVtbl[5]))((IBitmapData*)Unsafe.AsPointer(ref this), pBitmapDescription); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetSourceBitmapDescription([NativeTypeName("BitmapDescription *")] BitmapDescription* pBitmapDescription) + { + return ((delegate* unmanaged)(lpVtbl[6]))((IBitmapData*)Unsafe.AsPointer(ref this), pBitmapDescription); + } + } +} diff --git a/sources/Interop/Windows/um/xamlOM/IVisualTreeService.cs b/sources/Interop/Windows/um/xamlOM/IVisualTreeService.cs new file mode 100644 index 0000000000..735791a420 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/IVisualTreeService.cs @@ -0,0 +1,123 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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("A593B11A-D17F-48BB-8F66-83910731C8A5")] + [NativeTypeName("struct IVisualTreeService : IUnknown")] + public unsafe partial struct IVisualTreeService + { + public void** lpVtbl; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IVisualTreeService*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IVisualTreeService*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IVisualTreeService*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int AdviseVisualTreeChange([NativeTypeName("IVisualTreeServiceCallback *")] IVisualTreeServiceCallback* pCallback) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IVisualTreeService*)Unsafe.AsPointer(ref this), pCallback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int UnadviseVisualTreeChange([NativeTypeName("IVisualTreeServiceCallback *")] IVisualTreeServiceCallback* pCallback) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IVisualTreeService*)Unsafe.AsPointer(ref this), pCallback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetEnums([NativeTypeName("unsigned int *")] uint* pCount, [NativeTypeName("EnumType **")] EnumType** ppEnums) + { + return ((delegate* unmanaged)(lpVtbl[5]))((IVisualTreeService*)Unsafe.AsPointer(ref this), pCount, ppEnums); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int CreateInstance([NativeTypeName("BSTR")] ushort* typeName, [NativeTypeName("BSTR")] ushort* value, [NativeTypeName("InstanceHandle *")] ulong* pInstanceHandle) + { + return ((delegate* unmanaged)(lpVtbl[6]))((IVisualTreeService*)Unsafe.AsPointer(ref this), typeName, value, pInstanceHandle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetPropertyValuesChain([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int *")] uint* pSourceCount, [NativeTypeName("PropertyChainSource **")] PropertyChainSource** ppPropertySources, [NativeTypeName("unsigned int *")] uint* pPropertyCount, [NativeTypeName("PropertyChainValue **")] PropertyChainValue** ppPropertyValues) + { + return ((delegate* unmanaged)(lpVtbl[7]))((IVisualTreeService*)Unsafe.AsPointer(ref this), instanceHandle, pSourceCount, ppPropertySources, pPropertyCount, ppPropertyValues); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int SetProperty([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("InstanceHandle")] ulong value, [NativeTypeName("unsigned int")] uint propertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[8]))((IVisualTreeService*)Unsafe.AsPointer(ref this), instanceHandle, value, propertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ClearProperty([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int")] uint propertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[9]))((IVisualTreeService*)Unsafe.AsPointer(ref this), instanceHandle, propertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetCollectionCount([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int *")] uint* pCollectionSize) + { + return ((delegate* unmanaged)(lpVtbl[10]))((IVisualTreeService*)Unsafe.AsPointer(ref this), instanceHandle, pCollectionSize); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetCollectionElements([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int")] uint startIndex, [NativeTypeName("unsigned int *")] uint* pElementCount, [NativeTypeName("CollectionElementValue **")] CollectionElementValue** ppElementValues) + { + return ((delegate* unmanaged)(lpVtbl[11]))((IVisualTreeService*)Unsafe.AsPointer(ref this), instanceHandle, startIndex, pElementCount, ppElementValues); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int AddChild([NativeTypeName("InstanceHandle")] ulong parent, [NativeTypeName("InstanceHandle")] ulong child, [NativeTypeName("unsigned int")] uint index) + { + return ((delegate* unmanaged)(lpVtbl[12]))((IVisualTreeService*)Unsafe.AsPointer(ref this), parent, child, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int RemoveChild([NativeTypeName("InstanceHandle")] ulong parent, [NativeTypeName("unsigned int")] uint index) + { + return ((delegate* unmanaged)(lpVtbl[13]))((IVisualTreeService*)Unsafe.AsPointer(ref this), parent, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ClearChildren([NativeTypeName("InstanceHandle")] ulong parent) + { + return ((delegate* unmanaged)(lpVtbl[14]))((IVisualTreeService*)Unsafe.AsPointer(ref this), parent); + } + } +} diff --git a/sources/Interop/Windows/um/xamlOM/IVisualTreeService2.cs b/sources/Interop/Windows/um/xamlOM/IVisualTreeService2.cs new file mode 100644 index 0000000000..dafa1061e6 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/IVisualTreeService2.cs @@ -0,0 +1,151 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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("130F5136-EC43-4F61-89C7-9801A36D2E95")] + [NativeTypeName("struct IVisualTreeService2 : IVisualTreeService")] + public unsafe partial struct IVisualTreeService2 + { + public void** lpVtbl; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IVisualTreeService2*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IVisualTreeService2*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int AdviseVisualTreeChange([NativeTypeName("IVisualTreeServiceCallback *")] IVisualTreeServiceCallback* pCallback) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), pCallback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int UnadviseVisualTreeChange([NativeTypeName("IVisualTreeServiceCallback *")] IVisualTreeServiceCallback* pCallback) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), pCallback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetEnums([NativeTypeName("unsigned int *")] uint* pCount, [NativeTypeName("EnumType **")] EnumType** ppEnums) + { + return ((delegate* unmanaged)(lpVtbl[5]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), pCount, ppEnums); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int CreateInstance([NativeTypeName("BSTR")] ushort* typeName, [NativeTypeName("BSTR")] ushort* value, [NativeTypeName("InstanceHandle *")] ulong* pInstanceHandle) + { + return ((delegate* unmanaged)(lpVtbl[6]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), typeName, value, pInstanceHandle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetPropertyValuesChain([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int *")] uint* pSourceCount, [NativeTypeName("PropertyChainSource **")] PropertyChainSource** ppPropertySources, [NativeTypeName("unsigned int *")] uint* pPropertyCount, [NativeTypeName("PropertyChainValue **")] PropertyChainValue** ppPropertyValues) + { + return ((delegate* unmanaged)(lpVtbl[7]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), instanceHandle, pSourceCount, ppPropertySources, pPropertyCount, ppPropertyValues); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int SetProperty([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("InstanceHandle")] ulong value, [NativeTypeName("unsigned int")] uint propertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[8]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), instanceHandle, value, propertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ClearProperty([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int")] uint propertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[9]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), instanceHandle, propertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetCollectionCount([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int *")] uint* pCollectionSize) + { + return ((delegate* unmanaged)(lpVtbl[10]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), instanceHandle, pCollectionSize); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetCollectionElements([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int")] uint startIndex, [NativeTypeName("unsigned int *")] uint* pElementCount, [NativeTypeName("CollectionElementValue **")] CollectionElementValue** ppElementValues) + { + return ((delegate* unmanaged)(lpVtbl[11]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), instanceHandle, startIndex, pElementCount, ppElementValues); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int AddChild([NativeTypeName("InstanceHandle")] ulong parent, [NativeTypeName("InstanceHandle")] ulong child, [NativeTypeName("unsigned int")] uint index) + { + return ((delegate* unmanaged)(lpVtbl[12]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), parent, child, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int RemoveChild([NativeTypeName("InstanceHandle")] ulong parent, [NativeTypeName("unsigned int")] uint index) + { + return ((delegate* unmanaged)(lpVtbl[13]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), parent, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ClearChildren([NativeTypeName("InstanceHandle")] ulong parent) + { + return ((delegate* unmanaged)(lpVtbl[14]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), parent); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetPropertyIndex([NativeTypeName("InstanceHandle")] ulong @object, [NativeTypeName("LPCWSTR")] ushort* propertyName, [NativeTypeName("unsigned int *")] uint* pPropertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[15]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), @object, propertyName, pPropertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetProperty([NativeTypeName("InstanceHandle")] ulong @object, [NativeTypeName("unsigned int")] uint propertyIndex, [NativeTypeName("InstanceHandle *")] ulong* pValue) + { + return ((delegate* unmanaged)(lpVtbl[16]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), @object, propertyIndex, pValue); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ReplaceResource([NativeTypeName("InstanceHandle")] ulong resourceDictionary, [NativeTypeName("InstanceHandle")] ulong key, [NativeTypeName("InstanceHandle")] ulong newValue) + { + return ((delegate* unmanaged)(lpVtbl[17]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), resourceDictionary, key, newValue); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int RenderTargetBitmap([NativeTypeName("InstanceHandle")] ulong handle, RenderTargetBitmapOptions options, [NativeTypeName("unsigned int")] uint maxPixelWidth, [NativeTypeName("unsigned int")] uint maxPixelHeight, [NativeTypeName("IBitmapData **")] IBitmapData** ppBitmapData) + { + return ((delegate* unmanaged)(lpVtbl[18]))((IVisualTreeService2*)Unsafe.AsPointer(ref this), handle, options, maxPixelWidth, maxPixelHeight, ppBitmapData); + } + } +} diff --git a/sources/Interop/Windows/um/xamlOM/IVisualTreeService3.cs b/sources/Interop/Windows/um/xamlOM/IVisualTreeService3.cs new file mode 100644 index 0000000000..e660a218a9 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/IVisualTreeService3.cs @@ -0,0 +1,179 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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("0E79C6E0-85A0-4BE8-B41A-655CF1FD19BD")] + [NativeTypeName("struct IVisualTreeService3 : IVisualTreeService2")] + public unsafe partial struct IVisualTreeService3 + { + public void** lpVtbl; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IVisualTreeService3*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IVisualTreeService3*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int AdviseVisualTreeChange([NativeTypeName("IVisualTreeServiceCallback *")] IVisualTreeServiceCallback* pCallback) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), pCallback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int UnadviseVisualTreeChange([NativeTypeName("IVisualTreeServiceCallback *")] IVisualTreeServiceCallback* pCallback) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), pCallback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetEnums([NativeTypeName("unsigned int *")] uint* pCount, [NativeTypeName("EnumType **")] EnumType** ppEnums) + { + return ((delegate* unmanaged)(lpVtbl[5]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), pCount, ppEnums); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int CreateInstance([NativeTypeName("BSTR")] ushort* typeName, [NativeTypeName("BSTR")] ushort* value, [NativeTypeName("InstanceHandle *")] ulong* pInstanceHandle) + { + return ((delegate* unmanaged)(lpVtbl[6]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), typeName, value, pInstanceHandle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetPropertyValuesChain([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int *")] uint* pSourceCount, [NativeTypeName("PropertyChainSource **")] PropertyChainSource** ppPropertySources, [NativeTypeName("unsigned int *")] uint* pPropertyCount, [NativeTypeName("PropertyChainValue **")] PropertyChainValue** ppPropertyValues) + { + return ((delegate* unmanaged)(lpVtbl[7]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), instanceHandle, pSourceCount, ppPropertySources, pPropertyCount, ppPropertyValues); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int SetProperty([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("InstanceHandle")] ulong value, [NativeTypeName("unsigned int")] uint propertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[8]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), instanceHandle, value, propertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ClearProperty([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int")] uint propertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[9]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), instanceHandle, propertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetCollectionCount([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int *")] uint* pCollectionSize) + { + return ((delegate* unmanaged)(lpVtbl[10]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), instanceHandle, pCollectionSize); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetCollectionElements([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("unsigned int")] uint startIndex, [NativeTypeName("unsigned int *")] uint* pElementCount, [NativeTypeName("CollectionElementValue **")] CollectionElementValue** ppElementValues) + { + return ((delegate* unmanaged)(lpVtbl[11]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), instanceHandle, startIndex, pElementCount, ppElementValues); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int AddChild([NativeTypeName("InstanceHandle")] ulong parent, [NativeTypeName("InstanceHandle")] ulong child, [NativeTypeName("unsigned int")] uint index) + { + return ((delegate* unmanaged)(lpVtbl[12]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), parent, child, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int RemoveChild([NativeTypeName("InstanceHandle")] ulong parent, [NativeTypeName("unsigned int")] uint index) + { + return ((delegate* unmanaged)(lpVtbl[13]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), parent, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ClearChildren([NativeTypeName("InstanceHandle")] ulong parent) + { + return ((delegate* unmanaged)(lpVtbl[14]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), parent); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetPropertyIndex([NativeTypeName("InstanceHandle")] ulong @object, [NativeTypeName("LPCWSTR")] ushort* propertyName, [NativeTypeName("unsigned int *")] uint* pPropertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[15]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), @object, propertyName, pPropertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetProperty([NativeTypeName("InstanceHandle")] ulong @object, [NativeTypeName("unsigned int")] uint propertyIndex, [NativeTypeName("InstanceHandle *")] ulong* pValue) + { + return ((delegate* unmanaged)(lpVtbl[16]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), @object, propertyIndex, pValue); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ReplaceResource([NativeTypeName("InstanceHandle")] ulong resourceDictionary, [NativeTypeName("InstanceHandle")] ulong key, [NativeTypeName("InstanceHandle")] ulong newValue) + { + return ((delegate* unmanaged)(lpVtbl[17]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), resourceDictionary, key, newValue); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int RenderTargetBitmap([NativeTypeName("InstanceHandle")] ulong handle, RenderTargetBitmapOptions options, [NativeTypeName("unsigned int")] uint maxPixelWidth, [NativeTypeName("unsigned int")] uint maxPixelHeight, [NativeTypeName("IBitmapData **")] IBitmapData** ppBitmapData) + { + return ((delegate* unmanaged)(lpVtbl[18]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), handle, options, maxPixelWidth, maxPixelHeight, ppBitmapData); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int ResolveResource([NativeTypeName("InstanceHandle")] ulong resourceContext, [NativeTypeName("LPCWSTR")] ushort* resourceName, ResourceType resourceType, [NativeTypeName("unsigned int")] uint propertyIndex) + { + return ((delegate* unmanaged)(lpVtbl[19]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), resourceContext, resourceName, resourceType, propertyIndex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetDictionaryItem([NativeTypeName("InstanceHandle")] ulong dictionaryHandle, [NativeTypeName("LPCWSTR")] ushort* resourceName, [NativeTypeName("BOOL")] int resourceIsImplicitStyle, [NativeTypeName("InstanceHandle *")] ulong* resourceHandle) + { + return ((delegate* unmanaged)(lpVtbl[20]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), dictionaryHandle, resourceName, resourceIsImplicitStyle, resourceHandle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int AddDictionaryItem([NativeTypeName("InstanceHandle")] ulong dictionaryHandle, [NativeTypeName("InstanceHandle")] ulong resourceKey, [NativeTypeName("InstanceHandle")] ulong resourceHandle) + { + return ((delegate* unmanaged)(lpVtbl[21]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), dictionaryHandle, resourceKey, resourceHandle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int RemoveDictionaryItem([NativeTypeName("InstanceHandle")] ulong dictionaryHandle, [NativeTypeName("InstanceHandle")] ulong resourceKey) + { + return ((delegate* unmanaged)(lpVtbl[22]))((IVisualTreeService3*)Unsafe.AsPointer(ref this), dictionaryHandle, resourceKey); + } + } +} diff --git a/sources/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback.cs b/sources/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback.cs new file mode 100644 index 0000000000..96f4f70afe --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback.cs @@ -0,0 +1,46 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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("AA7A8931-80E4-4FEC-8F3B-553F87B4966E")] + [NativeTypeName("struct IVisualTreeServiceCallback : IUnknown")] + public unsafe partial struct IVisualTreeServiceCallback + { + public void** lpVtbl; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IVisualTreeServiceCallback*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IVisualTreeServiceCallback*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IVisualTreeServiceCallback*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int OnVisualTreeChange(ParentChildRelation relation, VisualElement element, VisualMutationType mutationType) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IVisualTreeServiceCallback*)Unsafe.AsPointer(ref this), relation, element, mutationType); + } + } +} diff --git a/sources/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback2.cs b/sources/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback2.cs new file mode 100644 index 0000000000..338f28fa8e --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback2.cs @@ -0,0 +1,53 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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("BAD9EB88-AE77-4397-B948-5FA2DB0A19EA")] + [NativeTypeName("struct IVisualTreeServiceCallback2 : IVisualTreeServiceCallback")] + public unsafe partial struct IVisualTreeServiceCallback2 + { + public void** lpVtbl; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IVisualTreeServiceCallback2*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IVisualTreeServiceCallback2*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IVisualTreeServiceCallback2*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int OnVisualTreeChange(ParentChildRelation relation, VisualElement element, VisualMutationType mutationType) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IVisualTreeServiceCallback2*)Unsafe.AsPointer(ref this), relation, element, mutationType); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int OnElementStateChanged([NativeTypeName("InstanceHandle")] ulong element, VisualElementState elementState, [NativeTypeName("LPCWSTR")] ushort* context) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IVisualTreeServiceCallback2*)Unsafe.AsPointer(ref this), element, elementState, context); + } + } +} diff --git a/sources/Interop/Windows/um/xamlOM/IXamlDiagnostics.cs b/sources/Interop/Windows/um/xamlOM/IXamlDiagnostics.cs new file mode 100644 index 0000000000..326ba2dc97 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/IXamlDiagnostics.cs @@ -0,0 +1,95 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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("18C9E2B6-3F43-4116-9F2B-FF935D7770D2")] + [NativeTypeName("struct IXamlDiagnostics : IUnknown")] + public unsafe partial struct IXamlDiagnostics + { + public void** lpVtbl; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetDispatcher([NativeTypeName("IInspectable **")] IInspectable** ppDispatcher) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), ppDispatcher); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetUiLayer([NativeTypeName("IInspectable **")] IInspectable** ppLayer) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), ppLayer); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetApplication([NativeTypeName("IInspectable **")] IInspectable** ppApplication) + { + return ((delegate* unmanaged)(lpVtbl[5]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), ppApplication); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetIInspectableFromHandle([NativeTypeName("InstanceHandle")] ulong instanceHandle, [NativeTypeName("IInspectable **")] IInspectable** ppInstance) + { + return ((delegate* unmanaged)(lpVtbl[6]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), instanceHandle, ppInstance); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetHandleFromIInspectable([NativeTypeName("IInspectable *")] IInspectable* pInstance, [NativeTypeName("InstanceHandle *")] ulong* pHandle) + { + return ((delegate* unmanaged)(lpVtbl[7]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), pInstance, pHandle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int HitTest(RECT rect, [NativeTypeName("unsigned int *")] uint* pCount, [NativeTypeName("InstanceHandle **")] ulong** ppInstanceHandles) + { + return ((delegate* unmanaged)(lpVtbl[8]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), rect, pCount, ppInstanceHandles); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int RegisterInstance([NativeTypeName("IInspectable *")] IInspectable* pInstance, [NativeTypeName("InstanceHandle *")] ulong* pInstanceHandle) + { + return ((delegate* unmanaged)(lpVtbl[9]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), pInstance, pInstanceHandle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NativeTypeName("HRESULT")] + public int GetInitializationData([NativeTypeName("BSTR *")] ushort** pInitializationData) + { + return ((delegate* unmanaged)(lpVtbl[10]))((IXamlDiagnostics*)Unsafe.AsPointer(ref this), pInitializationData); + } + } +} diff --git a/sources/Interop/Windows/um/xamlOM/MetadataBit.cs b/sources/Interop/Windows/um/xamlOM/MetadataBit.cs new file mode 100644 index 0000000000..5f17bba2b6 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/MetadataBit.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; + +namespace TerraFX.Interop +{ + [Flags] + public enum MetadataBit + { + None = 0, + IsValueHandle = 0x1, + IsPropertyReadOnly = 0x2, + IsValueCollection = 0x4, + IsValueCollectionReadOnly = 0x8, + IsValueBindingExpression = 0x10, + IsValueNull = 0x20, + IsValueHandleAndEvaluatedValue = 0x40, + } +} diff --git a/sources/Interop/Windows/um/xamlOM/ParentChildRelation.cs b/sources/Interop/Windows/um/xamlOM/ParentChildRelation.cs new file mode 100644 index 0000000000..690d53bff7 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/ParentChildRelation.cs @@ -0,0 +1,19 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop +{ + public partial struct ParentChildRelation + { + [NativeTypeName("InstanceHandle")] + public ulong Parent; + + [NativeTypeName("InstanceHandle")] + public ulong Child; + + [NativeTypeName("unsigned int")] + public uint ChildIndex; + } +} diff --git a/sources/Interop/Windows/um/xamlOM/PropertyChainSource.cs b/sources/Interop/Windows/um/xamlOM/PropertyChainSource.cs new file mode 100644 index 0000000000..8944ad2d3b --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/PropertyChainSource.cs @@ -0,0 +1,23 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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 PropertyChainSource + { + [NativeTypeName("InstanceHandle")] + public ulong Handle; + + [NativeTypeName("BSTR")] + public ushort* TargetType; + + [NativeTypeName("BSTR")] + public ushort* Name; + + public BaseValueSource Source; + + public SourceInfo SrcInfo; + } +} diff --git a/sources/Interop/Windows/um/xamlOM/PropertyChainValue.cs b/sources/Interop/Windows/um/xamlOM/PropertyChainValue.cs new file mode 100644 index 0000000000..4a95b7c601 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/PropertyChainValue.cs @@ -0,0 +1,40 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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 PropertyChainValue + { + [NativeTypeName("unsigned int")] + public uint Index; + + [NativeTypeName("BSTR")] + public ushort* Type; + + [NativeTypeName("BSTR")] + public ushort* DeclaringType; + + [NativeTypeName("BSTR")] + public ushort* ValueType; + + [NativeTypeName("BSTR")] + public ushort* ItemType; + + [NativeTypeName("BSTR")] + public ushort* Value; + + [NativeTypeName("BOOL")] + public int Overridden; + + [NativeTypeName("long long")] + public long MetadataBits; + + [NativeTypeName("BSTR")] + public ushort* PropertyName; + + [NativeTypeName("unsigned int")] + public uint PropertyChainIndex; + } +} diff --git a/sources/Interop/Windows/um/xamlOM/RenderTargetBitmapOptions.cs b/sources/Interop/Windows/um/xamlOM/RenderTargetBitmapOptions.cs new file mode 100644 index 0000000000..e0790b0a28 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/RenderTargetBitmapOptions.cs @@ -0,0 +1,13 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop +{ + public enum RenderTargetBitmapOptions + { + RenderTarget = 0, + RenderTargetAndChildren = (RenderTarget + 1), + } +} diff --git a/sources/Interop/Windows/um/xamlOM/ResourceType.cs b/sources/Interop/Windows/um/xamlOM/ResourceType.cs new file mode 100644 index 0000000000..f00fa7c731 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/ResourceType.cs @@ -0,0 +1,13 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop +{ + public enum ResourceType + { + ResourceTypeStatic = 0, + ResourceTypeTheme = (ResourceTypeStatic + 1), + } +} diff --git a/sources/Interop/Windows/um/xamlOM/SourceInfo.cs b/sources/Interop/Windows/um/xamlOM/SourceInfo.cs new file mode 100644 index 0000000000..5d8f5030f3 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/SourceInfo.cs @@ -0,0 +1,25 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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 SourceInfo + { + [NativeTypeName("BSTR")] + public ushort* FileName; + + [NativeTypeName("unsigned int")] + public uint LineNumber; + + [NativeTypeName("unsigned int")] + public uint ColumnNumber; + + [NativeTypeName("unsigned int")] + public uint CharPosition; + + [NativeTypeName("BSTR")] + public ushort* Hash; + } +} diff --git a/sources/Interop/Windows/um/xamlOM/VisualElement.cs b/sources/Interop/Windows/um/xamlOM/VisualElement.cs new file mode 100644 index 0000000000..3db88027dc --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/VisualElement.cs @@ -0,0 +1,24 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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 VisualElement + { + [NativeTypeName("InstanceHandle")] + public ulong Handle; + + public SourceInfo SrcInfo; + + [NativeTypeName("BSTR")] + public ushort* Type; + + [NativeTypeName("BSTR")] + public ushort* Name; + + [NativeTypeName("unsigned int")] + public uint NumChildren; + } +} diff --git a/sources/Interop/Windows/um/xamlOM/VisualElementState.cs b/sources/Interop/Windows/um/xamlOM/VisualElementState.cs new file mode 100644 index 0000000000..4ab279bd16 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/VisualElementState.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/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop +{ + public enum VisualElementState + { + ErrorResolved = 0, + ErrorResourceNotFound = (ErrorResolved + 1), + ErrorInvalidResource = (ErrorResourceNotFound + 1), + } +} diff --git a/sources/Interop/Windows/um/xamlOM/VisualMutationType.cs b/sources/Interop/Windows/um/xamlOM/VisualMutationType.cs new file mode 100644 index 0000000000..98ff4f7470 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/VisualMutationType.cs @@ -0,0 +1,13 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop +{ + public enum VisualMutationType + { + Add = 0, + Remove = (Add + 1), + } +} diff --git a/sources/Interop/Windows/um/xamlOM/Windows.cs b/sources/Interop/Windows/um/xamlOM/Windows.cs new file mode 100644 index 0000000000..c428b9bcf3 --- /dev/null +++ b/sources/Interop/Windows/um/xamlOM/Windows.cs @@ -0,0 +1,37 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.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("Windows.UI.Xaml.dll", ExactSpelling = true)] + [return: NativeTypeName("HRESULT")] + public static extern int InitializeXamlDiagnosticsEx([NativeTypeName("LPCWSTR")] ushort* endPointName, [NativeTypeName("DWORD")] uint pid, [NativeTypeName("LPCWSTR")] ushort* wszDllXamlDiagnostics, [NativeTypeName("LPCWSTR")] ushort* wszTAPDllName, [NativeTypeName("CLSID")] Guid tapClsid, [NativeTypeName("LPCWSTR")] ushort* wszInitializationData); + + [NativeTypeName("#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)")] + public static readonly int E_NOTFOUND = HRESULT_FROM_WIN32(1168); + + [NativeTypeName("#define E_UNKNOWNTYPE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XAML, 40L)")] + public const int E_UNKNOWNTYPE = unchecked((int)(((uint)(1) << 31) | ((uint)(43) << 16) | ((uint)(40)))); + + public static readonly Guid IID_IVisualTreeServiceCallback = new Guid(0xAA7A8931, 0x80E4, 0x4FEC, 0x8F, 0x3B, 0x55, 0x3F, 0x87, 0xB4, 0x96, 0x6E); + + public static readonly Guid IID_IVisualTreeServiceCallback2 = new Guid(0xBAD9EB88, 0xAE77, 0x4397, 0xB9, 0x48, 0x5F, 0xA2, 0xDB, 0x0A, 0x19, 0xEA); + + public static readonly Guid IID_IVisualTreeService = new Guid(0xA593B11A, 0xD17F, 0x48BB, 0x8F, 0x66, 0x83, 0x91, 0x07, 0x31, 0xC8, 0xA5); + + public static readonly Guid IID_IXamlDiagnostics = new Guid(0x18C9E2B6, 0x3F43, 0x4116, 0x9F, 0x2B, 0xFF, 0x93, 0x5D, 0x77, 0x70, 0xD2); + + public static readonly Guid IID_IBitmapData = new Guid(0xD1A34EF2, 0xCAD8, 0x4635, 0xA3, 0xD2, 0xFC, 0xDA, 0x8D, 0x3F, 0x3C, 0xAF); + + public static readonly Guid IID_IVisualTreeService2 = new Guid(0x130F5136, 0xEC43, 0x4F61, 0x89, 0xC7, 0x98, 0x01, 0xA3, 0x6D, 0x2E, 0x95); + + public static readonly Guid IID_IVisualTreeService3 = new Guid(0x0E79C6E0, 0x85A0, 0x4BE8, 0xB4, 0x1A, 0x65, 0x5C, 0xF1, 0xFD, 0x19, 0xBD); + } +} diff --git a/tests/Interop/Windows/um/xamlOM/BitmapDescriptionTests.cs b/tests/Interop/Windows/um/xamlOM/BitmapDescriptionTests.cs new file mode 100644 index 0000000000..f8d32f2e69 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/BitmapDescriptionTests.cs @@ -0,0 +1,35 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class BitmapDescriptionTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(BitmapDescription))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(BitmapDescription).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(BitmapDescription), Is.EqualTo(16)); + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/CollectionElementValueTests.cs b/tests/Interop/Windows/um/xamlOM/CollectionElementValueTests.cs new file mode 100644 index 0000000000..265ea5a53b --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/CollectionElementValueTests.cs @@ -0,0 +1,43 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class CollectionElementValueTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(CollectionElementValue))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(CollectionElementValue).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(CollectionElementValue), Is.EqualTo(32)); + } + else + { + Assert.That(sizeof(CollectionElementValue), Is.EqualTo(24)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/EnumTypeTests.cs b/tests/Interop/Windows/um/xamlOM/EnumTypeTests.cs new file mode 100644 index 0000000000..62f8b5a218 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/EnumTypeTests.cs @@ -0,0 +1,43 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class EnumTypeTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(EnumType))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(EnumType).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(EnumType), Is.EqualTo(24)); + } + else + { + Assert.That(sizeof(EnumType), Is.EqualTo(12)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/IBitmapDataTests.cs b/tests/Interop/Windows/um/xamlOM/IBitmapDataTests.cs new file mode 100644 index 0000000000..cd0356c242 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/IBitmapDataTests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class IBitmapDataTests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IBitmapData).GUID, Is.EqualTo(IID_IBitmapData)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IBitmapData))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IBitmapData).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IBitmapData), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IBitmapData), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/IVisualTreeService2Tests.cs b/tests/Interop/Windows/um/xamlOM/IVisualTreeService2Tests.cs new file mode 100644 index 0000000000..00f5bcaadf --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/IVisualTreeService2Tests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class IVisualTreeService2Tests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IVisualTreeService2).GUID, Is.EqualTo(IID_IVisualTreeService2)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IVisualTreeService2))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IVisualTreeService2).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IVisualTreeService2), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IVisualTreeService2), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/IVisualTreeService3Tests.cs b/tests/Interop/Windows/um/xamlOM/IVisualTreeService3Tests.cs new file mode 100644 index 0000000000..e3c76d19d7 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/IVisualTreeService3Tests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class IVisualTreeService3Tests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IVisualTreeService3).GUID, Is.EqualTo(IID_IVisualTreeService3)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IVisualTreeService3))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IVisualTreeService3).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IVisualTreeService3), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IVisualTreeService3), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback2Tests.cs b/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback2Tests.cs new file mode 100644 index 0000000000..5d9100f799 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceCallback2Tests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class IVisualTreeServiceCallback2Tests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IVisualTreeServiceCallback2).GUID, Is.EqualTo(IID_IVisualTreeServiceCallback2)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IVisualTreeServiceCallback2))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IVisualTreeServiceCallback2).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IVisualTreeServiceCallback2), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IVisualTreeServiceCallback2), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceCallbackTests.cs b/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceCallbackTests.cs new file mode 100644 index 0000000000..2f79a6908f --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceCallbackTests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class IVisualTreeServiceCallbackTests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IVisualTreeServiceCallback).GUID, Is.EqualTo(IID_IVisualTreeServiceCallback)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IVisualTreeServiceCallback))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IVisualTreeServiceCallback).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IVisualTreeServiceCallback), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IVisualTreeServiceCallback), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceTests.cs b/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceTests.cs new file mode 100644 index 0000000000..d133b18884 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/IVisualTreeServiceTests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class IVisualTreeServiceTests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IVisualTreeService).GUID, Is.EqualTo(IID_IVisualTreeService)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IVisualTreeService))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IVisualTreeService).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IVisualTreeService), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IVisualTreeService), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/IXamlDiagnosticsTests.cs b/tests/Interop/Windows/um/xamlOM/IXamlDiagnosticsTests.cs new file mode 100644 index 0000000000..e3df95fa2a --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/IXamlDiagnosticsTests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class IXamlDiagnosticsTests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IXamlDiagnostics).GUID, Is.EqualTo(IID_IXamlDiagnostics)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IXamlDiagnostics))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IXamlDiagnostics).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IXamlDiagnostics), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IXamlDiagnostics), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/ParentChildRelationTests.cs b/tests/Interop/Windows/um/xamlOM/ParentChildRelationTests.cs new file mode 100644 index 0000000000..c27e19efb1 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/ParentChildRelationTests.cs @@ -0,0 +1,35 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class ParentChildRelationTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(ParentChildRelation))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(ParentChildRelation).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(ParentChildRelation), Is.EqualTo(24)); + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/PropertyChainSourceTests.cs b/tests/Interop/Windows/um/xamlOM/PropertyChainSourceTests.cs new file mode 100644 index 0000000000..8ec0e84602 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/PropertyChainSourceTests.cs @@ -0,0 +1,43 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class PropertyChainSourceTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PropertyChainSource))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PropertyChainSource).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PropertyChainSource), Is.EqualTo(64)); + } + else + { + Assert.That(sizeof(PropertyChainSource), Is.EqualTo(40)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/PropertyChainValueTests.cs b/tests/Interop/Windows/um/xamlOM/PropertyChainValueTests.cs new file mode 100644 index 0000000000..47a761199d --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/PropertyChainValueTests.cs @@ -0,0 +1,43 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class PropertyChainValueTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PropertyChainValue))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PropertyChainValue).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PropertyChainValue), Is.EqualTo(80)); + } + else + { + Assert.That(sizeof(PropertyChainValue), Is.EqualTo(48)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/SourceInfoTests.cs b/tests/Interop/Windows/um/xamlOM/SourceInfoTests.cs new file mode 100644 index 0000000000..8e716a1cc1 --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/SourceInfoTests.cs @@ -0,0 +1,43 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class SourceInfoTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(SourceInfo))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(SourceInfo).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(SourceInfo), Is.EqualTo(32)); + } + else + { + Assert.That(sizeof(SourceInfo), Is.EqualTo(20)); + } + } + } +} diff --git a/tests/Interop/Windows/um/xamlOM/VisualElementTests.cs b/tests/Interop/Windows/um/xamlOM/VisualElementTests.cs new file mode 100644 index 0000000000..6ddeef97ef --- /dev/null +++ b/tests/Interop/Windows/um/xamlOM/VisualElementTests.cs @@ -0,0 +1,43 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/xamlOM.h in the Windows SDK for Windows 10.0.19041.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class VisualElementTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(VisualElement))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(VisualElement).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(VisualElement), Is.EqualTo(64)); + } + else + { + Assert.That(sizeof(VisualElement), Is.EqualTo(40)); + } + } + } +} From e8b28a43440bc8a86f08bab35ebef172be8dd922 Mon Sep 17 00:00:00 2001 From: reflectronic Date: Sun, 31 Jan 2021 20:48:13 -0500 Subject: [PATCH 2/3] Fix build break --- generation/um/xamlOM/generate.rsp | 1 + sources/Interop/Windows/um/xamlOM/Windows.cs | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/generation/um/xamlOM/generate.rsp b/generation/um/xamlOM/generate.rsp index 98a973480f..239a4f1a15 100644 --- a/generation/um/xamlOM/generate.rsp +++ b/generation/um/xamlOM/generate.rsp @@ -1,6 +1,7 @@ @../../settings.rsp @../../remap.rsp --exclude +E_NOTFOUND InitializeXamlDiagnostic --file um-xamlOM.h diff --git a/sources/Interop/Windows/um/xamlOM/Windows.cs b/sources/Interop/Windows/um/xamlOM/Windows.cs index c428b9bcf3..a99385aff4 100644 --- a/sources/Interop/Windows/um/xamlOM/Windows.cs +++ b/sources/Interop/Windows/um/xamlOM/Windows.cs @@ -14,9 +14,6 @@ public static unsafe partial class Windows [return: NativeTypeName("HRESULT")] public static extern int InitializeXamlDiagnosticsEx([NativeTypeName("LPCWSTR")] ushort* endPointName, [NativeTypeName("DWORD")] uint pid, [NativeTypeName("LPCWSTR")] ushort* wszDllXamlDiagnostics, [NativeTypeName("LPCWSTR")] ushort* wszTAPDllName, [NativeTypeName("CLSID")] Guid tapClsid, [NativeTypeName("LPCWSTR")] ushort* wszInitializationData); - [NativeTypeName("#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)")] - public static readonly int E_NOTFOUND = HRESULT_FROM_WIN32(1168); - [NativeTypeName("#define E_UNKNOWNTYPE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XAML, 40L)")] public const int E_UNKNOWNTYPE = unchecked((int)(((uint)(1) << 31) | ((uint)(43) << 16) | ((uint)(40)))); From 5f4e585e96c4e7ec47dbbb2ec1faa0b3012713cc Mon Sep 17 00:00:00 2001 From: John Kelly Date: Mon, 8 Feb 2021 12:34:03 +0000 Subject: [PATCH 3/3] Fix static init order bug This wasn't being initialised properly --- sources/Interop/Windows/other/dxcapi/Windows.Manual.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/Interop/Windows/other/dxcapi/Windows.Manual.cs b/sources/Interop/Windows/other/dxcapi/Windows.Manual.cs index d90796a610..a5845cac4f 100644 --- a/sources/Interop/Windows/other/dxcapi/Windows.Manual.cs +++ b/sources/Interop/Windows/other/dxcapi/Windows.Manual.cs @@ -13,7 +13,7 @@ public static unsafe partial class Windows 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_DxcUtils = CLSID_DxcLibrary; + public static readonly Guid CLSID_DxcUtils = new Guid(0x6245d6af, 0x66e0, 0x48fd, 0x80, 0xb4, 0x4d, 0x27, 0x17, 0x96, 0x74, 0x8c); public static readonly Guid IID_IDxcResult = new Guid(0x58346CDA, 0xDDE7, 0x4497, 0x94, 0x61, 0x6F, 0x87, 0xAF, 0x5E, 0x06, 0x59);