From 2c54f11f703d4741b2eae10f0513358d455b9021 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Fri, 3 May 2024 14:01:59 -0700 Subject: [PATCH 1/4] Add references for all assemblies passed in via --refs (#1886) --- .../ClangSharpSourceWinmdGenerator.cs | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/sources/ClangSharpSourceToWinmd/ClangSharpSourceWinmdGenerator.cs b/sources/ClangSharpSourceToWinmd/ClangSharpSourceWinmdGenerator.cs index 8cde8735a..5854cc0ef 100644 --- a/sources/ClangSharpSourceToWinmd/ClangSharpSourceWinmdGenerator.cs +++ b/sources/ClangSharpSourceToWinmd/ClangSharpSourceWinmdGenerator.cs @@ -144,31 +144,17 @@ void InitModule(string assemblyName) void InitReferences() { - Version systemVersion = new Version(2, 1, 0, 0); - var netstandardAssembly = this.compilation.ReferencedAssemblyNames.ToList().Find(a => a.Name == SystemAssemblyName); - var systemAssemblyRef = - this.metadataBuilder.AddAssemblyReference( - this.metadataBuilder.GetOrAddString(netstandardAssembly.Name), - netstandardAssembly.Version, - default, - this.metadataBuilder.GetOrAddBlob(netstandardAssembly.PublicKeyToken), - default, - default); - this.assemblyNamesToRefHandles[SystemAssemblyName] = systemAssemblyRef; - - var win32Assembly = this.compilation.ReferencedAssemblyNames.ToList().Find(a => a.Name == Win32MetadataAssemblyName); - if (win32Assembly != null) + foreach (var assembly in this.compilation.ReferencedAssemblyNames) { - var win32MetadataAssemblyRef = + var assemblyRef = this.metadataBuilder.AddAssemblyReference( - this.metadataBuilder.GetOrAddString(win32Assembly.Name), - win32Assembly.Version, + this.metadataBuilder.GetOrAddString(assembly.Name), + assembly.Version, default, - this.metadataBuilder.GetOrAddBlob(win32Assembly.PublicKeyToken), + this.metadataBuilder.GetOrAddBlob(assembly.PublicKeyToken), default, default); - - this.assemblyNamesToRefHandles[Win32MetadataAssemblyName] = win32MetadataAssemblyRef; + this.assemblyNamesToRefHandles[assembly.Name] = assemblyRef; } } } From 389a556758bfc010af0c1b14b167a0eb4fc146a4 Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 3 May 2024 14:07:22 -0700 Subject: [PATCH 2/4] Add additional InvalidHandleValues metadata (#1893) --- generation/WinSDK/autoTypes.json | 4 ++++ scripts/ChangesSinceLastRelease.txt | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/generation/WinSDK/autoTypes.json b/generation/WinSDK/autoTypes.json index 39d58b4ca..d35fe0be3 100644 --- a/generation/WinSDK/autoTypes.json +++ b/generation/WinSDK/autoTypes.json @@ -1365,6 +1365,7 @@ "Name": "SOCKET", "ValueType": "UIntPtr", "CloseApi": "closesocket", + "InvalidHandleValues": [ -1 ], "NativeTypedef": true }, { @@ -2300,12 +2301,14 @@ "Name": "PTP_POOL", "ValueType": "typedef struct _TP_POOL", "CloseApi": "CloseThreadpool", + "InvalidHandleValues": [ 0 ], "NativeTypedef": true }, { "Name": "PTP_CLEANUP_GROUP", "ValueType": "typedef struct _TP_CLEANUP_GROUP", "CloseApi": "CloseThreadpoolCleanupGroup", + "InvalidHandleValues": [ 0 ], "NativeTypedef": true }, { @@ -2498,6 +2501,7 @@ "Name": "HIORING", "ValueType": "DECLARE_HANDLE", "CloseApi": "CloseIoRing", + "InvalidHandleValues": [ -1, 0 ], "NativeTypedef": true }, { diff --git a/scripts/ChangesSinceLastRelease.txt b/scripts/ChangesSinceLastRelease.txt index 3a65293d9..ed92ddec5 100644 --- a/scripts/ChangesSinceLastRelease.txt +++ b/scripts/ChangesSinceLastRelease.txt @@ -291,3 +291,8 @@ Windows.Win32.UI.WindowsAndMessaging.Apis.SendMessageTimeoutW : [DllImport(USER3 # Fixed #1866. Windows.Win32.System.WinRT.Printing.IPrintDocumentPageSource added Windows.Win32.System.WinRT.Printing.IPrintPreviewPageCollection added +# Add additional InvalidHandleValue metadata +Windows.Win32.Networking.WinSock.SOCKET : [NativeTypedef,RAIIFree(closesocket)] => [InvalidHandleValue(-1),NativeTypedef,RAIIFree(closesocket)] +Windows.Win32.Storage.FileSystem.HIORING : [NativeTypedef,RAIIFree(CloseIoRing)] => [InvalidHandleValue(-1),InvalidHandleValue(0),NativeTypedef,RAIIFree(CloseIoRing)] +Windows.Win32.System.Threading.PTP_CLEANUP_GROUP : [NativeTypedef,RAIIFree(CloseThreadpoolCleanupGroup)] => [InvalidHandleValue(0),NativeTypedef,RAIIFree(CloseThreadpoolCleanupGroup)] +Windows.Win32.System.Threading.PTP_POOL : [NativeTypedef,RAIIFree(CloseThreadpool)] => [InvalidHandleValue(0),NativeTypedef,RAIIFree(CloseThreadpool)] From 2e09958451eddaf97438d58748b1cae6809231ff Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Mon, 6 May 2024 17:55:07 +0200 Subject: [PATCH 3/4] Associate DXGI function parameters and struct fields with the corresponding enum type (#1757) * Associate DXGI function parameters and struct fields with the corresponding enum type These are more convenient and descriptive to use than plain `UINT`s. * dxgi: Annotate `*_FLAG` enums with missing `[Flags]` attribute * dxgi: Scrape some loose flag constants into enums * dxgi: Annotate GetDesc::pDesc with RetVal attribute --------- Co-authored-by: Mike Battista <13860912+mikebattista@users.noreply.github.com> --- .../WinSDK/Partitions/Dxgi/settings.rsp | 8 + generation/WinSDK/emitter.settings.rsp | 26 ++- generation/WinSDK/enums.json | 159 ++++++++++++++++-- scripts/ChangesSinceLastRelease.txt | 107 ++++++++++++ sources/MetadataUtils/ConstantsScraper.cs | 4 +- 5 files changed, 288 insertions(+), 16 deletions(-) diff --git a/generation/WinSDK/Partitions/Dxgi/settings.rsp b/generation/WinSDK/Partitions/Dxgi/settings.rsp index b2c512bb4..bdbf32893 100644 --- a/generation/WinSDK/Partitions/Dxgi/settings.rsp +++ b/generation/WinSDK/Partitions/Dxgi/settings.rsp @@ -13,3 +13,11 @@ _D3DCOLORVALUE /um/dxprogrammablecapture.h --namespace Windows.Win32.Graphics.Dxgi +--with-attribute +DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS=Flags +DXGI_OFFER_RESOURCE_FLAGS=Flags +DXGI_OUTDUPL_FLAG=Flags +DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG=Flags +DXGI_OVERLAY_SUPPORT_FLAG=Flags +DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG=Flags +DXGI_SWAP_CHAIN_FLAG=Flags diff --git a/generation/WinSDK/emitter.settings.rsp b/generation/WinSDK/emitter.settings.rsp index 38ee3912f..ba46a9628 100644 --- a/generation/WinSDK/emitter.settings.rsp +++ b/generation/WinSDK/emitter.settings.rsp @@ -1308,7 +1308,6 @@ D3D12_ROOT_SIGNATURE_DESC1::pStaticSamplers=[NativeArrayInfo(CountFieldName = "N D3D12_STREAM_OUTPUT_DESC::pBufferStrides=[NativeArrayInfo(CountFieldName = "NumStrides")] D3D12_STREAM_OUTPUT_DESC::pSODeclaration=[NativeArrayInfo(CountFieldName = "NumEntries")] D3D12_VIEW_INSTANCING_DESC::pViewInstanceLocations=[NativeArrayInfo(CountFieldName = "ViewInstanceCount")] -DXGI_SWAP_CHAIN_DESC1::Flags=[AssociatedEnum("DXGI_SWAP_CHAIN_FLAG")] CreatePipe::hReadPipe=[IgnoreIfReturn("0")] CreatePipe::hWritePipe=[IgnoreIfReturn("0")] MapViewOfFile::return=MEMORY_MAPPED_VIEW_ADDRESS @@ -1814,4 +1813,27 @@ GetFileAttributesA=[CanReturnMultipleSuccessValues] GetFileAttributesW=[CanReturnMultipleSuccessValues] GetFileVersionInfoSizeA=[CanReturnMultipleSuccessValues] GetFileVersionInfoSizeW=[CanReturnMultipleSuccessValues] -CertCreateCertificateContext=[CanReturnMultipleSuccessValues] \ No newline at end of file +CertCreateCertificateContext=[CanReturnMultipleSuccessValues] +DXGI_ADAPTER_DESC1::Flags=[AssociatedEnum("DXGI_ADAPTER_FLAG")] +DXGI_ADAPTER_DESC2::Flags=[AssociatedEnum("DXGI_ADAPTER_FLAG")] +DXGI_DECODE_SWAP_CHAIN_DESC::Flags=[AssociatedEnum("DXGI_SWAP_CHAIN_FLAG")] +DXGI_SWAP_CHAIN_DESC::Flags=[AssociatedEnum("DXGI_SWAP_CHAIN_FLAG")] +DXGI_SWAP_CHAIN_DESC1::Flags=[AssociatedEnum("DXGI_SWAP_CHAIN_FLAG")] +IDXGIDevice4::OfferResources1::Flags=[AssociatedEnum("DXGI_OFFER_RESOURCE_FLAGS")] +IDXGIOutput3::CheckOverlaySupport::pFlags=[AssociatedEnum("DXGI_OVERLAY_SUPPORT_FLAG")] +IDXGIOutput4::CheckOverlayColorSpaceSupport::pFlags=[AssociatedEnum("DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG")] +IDXGIOutput6::CheckHardwareCompositionSupport::pFlags=[AssociatedEnum("DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS")] +IDXGISwapChain::ResizeBuffers::SwapChainFlags=[AssociatedEnum("DXGI_SWAP_CHAIN_FLAG")] +IDXGISwapChain3::CheckColorSpaceSupport::pColorSpaceSupport=[AssociatedEnum("DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG")] +IDXGISwapChain3::ResizeBuffers1::SwapChainFlags=[AssociatedEnum("DXGI_SWAP_CHAIN_FLAG")] +IDXGIAdapter::GetDesc::pDesc=[RetVal] +IDXGIAdapter1::GetDesc1::pDesc=[RetVal] +IDXGIAdapter2::GetDesc2::pDesc=[RetVal] +IDXGIAdapter4::GetDesc3::pDesc=[RetVal] +IDXGIOutput::GetDesc::pDesc=[RetVal] +IDXGIOutput6::GetDesc1::pDesc=[RetVal] +IDXGIOutputDuplication::GetDesc::pDesc=[RetVal] +IDXGISurface::GetDesc::pDesc=[RetVal] +IDXGISwapChain::GetDesc::pDesc=[RetVal] +IDXGISwapChain1::GetDesc1::pDesc=[RetVal] +IDXGISwapChain1::GetFullscreenDesc::pDesc=[RetVal] diff --git a/generation/WinSDK/enums.json b/generation/WinSDK/enums.json index 0f0ed1344..95d2c81af 100644 --- a/generation/WinSDK/enums.json +++ b/generation/WinSDK/enums.json @@ -32199,7 +32199,7 @@ { "name": "UIA_EVENT_ID", "type": "int", - "members": [ + "members": [ { "name": "UIA_ToolTipOpenedEventId", "value": 20000 @@ -32408,7 +32408,7 @@ { "name": "UIA_PROPERTY_ID", "type": "int", - "members": [ + "members": [ { "name": "UIA_RuntimeIdPropertyId", "value": 30000 @@ -33215,7 +33215,7 @@ { "name": "UIA_TEXTATTRIBUTE_ID", "type": "int", - "members": [ + "members": [ { "name": "UIA_AnimationStyleAttributeId", "value": 40000 @@ -33424,7 +33424,7 @@ { "name": "UIA_CONTROLTYPE_ID", "type": "int", - "members": [ + "members": [ { "name": "UIA_ButtonControlTypeId", "value": 50000 @@ -33606,7 +33606,7 @@ { "name": "UIA_ANNOTATIONTYPE", "type": "int", - "members": [ + "members": [ { "name": "AnnotationType_Unknown", "value": 60000 @@ -33729,7 +33729,7 @@ { "name": "UIA_STYLE_ID", "type": "int", - "members": [ + "members": [ { "name": "StyleId_Custom", "value": 70000 @@ -33820,7 +33820,7 @@ { "name": "UIA_LANDMARKTYPE_ID", "type": "int", - "members": [ + "members": [ { "name": "UIA_CustomLandmarkTypeId", "value": 80000 @@ -33858,7 +33858,7 @@ { "name": "UIA_HEADINGLEVEL_ID", "type": "int", - "members": [ + "members": [ { "name": "HeadingLevel_None", "value": 80050 @@ -33917,7 +33917,7 @@ "namespace": "Windows.Win32.UI.Accessibility", "name": "UIA_CHANGE_ID", "type": "int", - "members": [ + "members": [ { "name": "UIA_SummaryChangeId", "value": 90000 @@ -33927,7 +33927,7 @@ { "name": "UIA_METADATA_ID", "type": "int", - "members": [ + "members": [ { "name": "UIA_SayAsInterpretAsMetadataId", "value": 100000 @@ -34491,7 +34491,7 @@ ] }, { - "type": "int", + "type": "int", "namespace": "Windows.Win32.UI.WindowsAndMessaging", "name": "SCROLLBAR_COMMAND", "members": [ @@ -34757,6 +34757,7 @@ ] }, { + "namespace": "Windows.Win32.Graphics.Dxgi", "type": "uint", "name": "DXGI_USAGE", "flags": true, @@ -34764,7 +34765,6 @@ "filter": "DXGI_USAGE_", "header": "dxgi.h" }, - "members": [], "uses": [ { "struct": "DXGI_SWAP_CHAIN_DESC", @@ -34782,6 +34782,141 @@ } ] }, + { + "namespace": "Windows.Win32.Graphics.Dxgi", + "type": "uint", + "name": "DXGI_PRESENT", + "flags": true, + "autoPopulate": { + "filter": "DXGI_PRESENT_", + "header": "dxgi.h" + }, + "uses": [ + { + "interface": "IDXGISwapChain", + "method": "Present", + "parameter": "Flags" + }, + { + "interface": "IDXGISwapChain1", + "method": "Present1", + "parameter": "PresentFlags" + }, + { + "interface": "IDXGIDecodeSwapChain", + "method": "PresentBuffer", + "parameter": "Flags" + } + ] + }, + { + "namespace": "Windows.Win32.Graphics.Dxgi", + "type": "uint", + "name": "DXGI_ENUM_MODES", + "flags": true, + "autoPopulate": { + "filter": "DXGI_ENUM_MODES_", + "header": "dxgi.h;dxgi1_2.h" + }, + "uses": [ + { + "interface": "IDXGIOutput", + "method": "GetDisplayModeList", + "parameter": "Flags" + }, + { + "interface": "IDXGIOutput1", + "method": "GetDisplayModeList1", + "parameter": "Flags" + } + ] + }, + { + "namespace": "Windows.Win32.Graphics.Dxgi", + "type": "uint", + "name": "DXGI_MWA_FLAGS", + "flags": true, + "autoPopulate": { + "filter": "DXGI_MWA_", + "header": "dxgi.h" + }, + "uses": [ + { + "interface": "IDXGIFactory", + "method": "MakeWindowAssociation", + "parameter": "Flags" + } + ] + }, + { + "namespace": "Windows.Win32.Graphics.Dxgi", + "type": "uint", + "name": "DXGI_MAP_FLAGS", + "flags": true, + "autoPopulate": { + "filter": "DXGI_MAP_", + "header": "dxgi.h" + }, + "uses": [ + { + "interface": "IDXGISurface", + "method": "Map", + "parameter": "MapFlags" + } + ] + }, + { + "namespace": "Windows.Win32.Graphics.Dxgi", + "type": "uint", + "name": "DXGI_RESOURCE_PRIORITY", + "autoPopulate": { + "filter": "DXGI_RESOURCE_PRIORITY_", + "header": "dxgi.h" + }, + "uses": [ + { + "interface": "IDXGIResource", + "method": "SetEvictionPriority", + "parameter": "EvictionPriority" + }, + { + "interface": "IDXGIResource", + "method": "GetEvictionPriority", + "parameter": "pEvictionPriority" + } + ] + }, + { + "namespace": "Windows.Win32.Graphics.Dxgi", + "type": "uint", + "name": "DXGI_SHARED_RESOURCE_RW", + "flags": true, + "autoPopulate": { + "filter": "DXGI_SHARED_RESOURCE_", + "header": "dxgi1_2.h" + } + }, + { + "namespace": "Windows.Win32.Graphics.Dxgi", + "type": "uint", + "name": "DXGI_CREATE_FACTORY_FLAGS", + "flags": true, + "autoPopulate": { + "filter": "DXGI_CREATE_FACTORY_", + "header": "dxgi1_3.h" + }, + "uses": [ + { + "method": "CreateDXGIFactory2", + "parameter": "Flags" + }, + { + "interface": "IDXGIFactory3", + "method": "GetCreationFlags", + "parameter": "return" + } + ] + }, { "namespace": "Windows.Win32.Data.HtmlHelp", "name": "HTML_HELP_COMMAND", diff --git a/scripts/ChangesSinceLastRelease.txt b/scripts/ChangesSinceLastRelease.txt index ed92ddec5..dba948f78 100644 --- a/scripts/ChangesSinceLastRelease.txt +++ b/scripts/ChangesSinceLastRelease.txt @@ -291,6 +291,113 @@ Windows.Win32.UI.WindowsAndMessaging.Apis.SendMessageTimeoutW : [DllImport(USER3 # Fixed #1866. Windows.Win32.System.WinRT.Printing.IPrintDocumentPageSource added Windows.Win32.System.WinRT.Printing.IPrintPreviewPageCollection added +# Associate DXGI function parameters and struct fields with the corresponding enum type +Windows.Win32.Graphics.Dxgi.DXGI_ADAPTER_DESC1.Flags : => [AssociatedEnum(DXGI_ADAPTER_FLAG)] +Windows.Win32.Graphics.Dxgi.DXGI_ADAPTER_DESC2.Flags : => [AssociatedEnum(DXGI_ADAPTER_FLAG)] +Windows.Win32.Graphics.Dxgi.DXGI_DECODE_SWAP_CHAIN_DESC.Flags : => [AssociatedEnum(DXGI_SWAP_CHAIN_FLAG)] +Windows.Win32.Graphics.Dxgi.DXGI_SWAP_CHAIN_DESC.Flags : => [AssociatedEnum(DXGI_SWAP_CHAIN_FLAG)] +Windows.Win32.Graphics.Dxgi.IDXGIDevice4.OfferResources1 : Flags : [In] => [AssociatedEnum(DXGI_OFFER_RESOURCE_FLAGS),In] +Windows.Win32.Graphics.Dxgi.IDXGIOutput3.CheckOverlaySupport : pFlags : [Out] => [AssociatedEnum(DXGI_OVERLAY_SUPPORT_FLAG),Out] +Windows.Win32.Graphics.Dxgi.IDXGIOutput4.CheckOverlayColorSpaceSupport : pFlags : [Out] => [AssociatedEnum(DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG),Out] +Windows.Win32.Graphics.Dxgi.IDXGIOutput6.CheckHardwareCompositionSupport : pFlags : [Out] => [AssociatedEnum(DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS),Out] +Windows.Win32.Graphics.Dxgi.IDXGISwapChain.ResizeBuffers : SwapChainFlags : [In] => [AssociatedEnum(DXGI_SWAP_CHAIN_FLAG),In] +Windows.Win32.Graphics.Dxgi.IDXGISwapChain3.CheckColorSpaceSupport : pColorSpaceSupport : [Out] => [AssociatedEnum(DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG),Out] +Windows.Win32.Graphics.Dxgi.IDXGISwapChain3.ResizeBuffers1 : SwapChainFlags : [In] => [AssociatedEnum(DXGI_SWAP_CHAIN_FLAG),In] +# dxgi: Annotate *_FLAG enums with missing [Flags] attribute +Windows.Win32.Graphics.Dxgi.DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS : [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_3/ne-dxgi1_3-dxgi_multiplane_overlay_ycbcr_flags)] => [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_3/ne-dxgi1_3-dxgi_multiplane_overlay_ycbcr_flags),Flags] +Windows.Win32.Graphics.Dxgi.DXGI_OFFER_RESOURCE_FLAGS : [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_5/ne-dxgi1_5-dxgi_offer_resource_flags)] => [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_5/ne-dxgi1_5-dxgi_offer_resource_flags),Flags] +Windows.Win32.Graphics.Dxgi.DXGI_OUTDUPL_FLAG : => [Flags] +Windows.Win32.Graphics.Dxgi.DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG : [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_4/ne-dxgi1_4-dxgi_overlay_color_space_support_flag)] => [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_4/ne-dxgi1_4-dxgi_overlay_color_space_support_flag),Flags] +Windows.Win32.Graphics.Dxgi.DXGI_OVERLAY_SUPPORT_FLAG : [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_3/ne-dxgi1_3-dxgi_overlay_support_flag)] => [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_3/ne-dxgi1_3-dxgi_overlay_support_flag),Flags] +Windows.Win32.Graphics.Dxgi.DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG : [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_4/ne-dxgi1_4-dxgi_swap_chain_color_space_support_flag)] => [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi1_4/ne-dxgi1_4-dxgi_swap_chain_color_space_support_flag),Flags] +Windows.Win32.Graphics.Dxgi.DXGI_SWAP_CHAIN_FLAG : [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi/ne-dxgi-dxgi_swap_chain_flag)] => [Documentation(https://learn.microsoft.com/windows/win32/api/dxgi/ne-dxgi-dxgi_swap_chain_flag),Flags] +# dxgi: Scrape some loose flag constants into enums +Windows.Win32.Graphics.Dxgi.Apis.CreateDXGIFactory2 : Flags...UInt32 => DXGI_CREATE_FACTORY_FLAGS +Windows.Win32.Graphics.Dxgi.Apis.DXGI_CREATE_FACTORY_DEBUG removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_ENUM_MODES_DISABLED_STEREO removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_ENUM_MODES_INTERLACED removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_ENUM_MODES_SCALING removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_ENUM_MODES_STEREO removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_MAP_DISCARD removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_MAP_READ removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_MAP_WRITE removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_MWA_NO_ALT_ENTER removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_MWA_NO_PRINT_SCREEN removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_MWA_NO_WINDOW_CHANGES removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_MWA_VALID removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_ALLOW_TEARING removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_DO_NOT_SEQUENCE removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_DO_NOT_WAIT removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_RESTART removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_RESTRICT_TO_OUTPUT removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_STEREO_PREFER_RIGHT removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_STEREO_TEMPORARY_MONO removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_TEST removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_PRESENT_USE_DURATION removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_RESOURCE_PRIORITY_HIGH removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_RESOURCE_PRIORITY_LOW removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_RESOURCE_PRIORITY_MAXIMUM removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_RESOURCE_PRIORITY_MINIMUM removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_RESOURCE_PRIORITY_NORMAL removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_SHARED_RESOURCE_READ removed +Windows.Win32.Graphics.Dxgi.Apis.DXGI_SHARED_RESOURCE_WRITE removed +Windows.Win32.Graphics.Dxgi.DXGI_CREATE_FACTORY_FLAGS added +Windows.Win32.Graphics.Dxgi.DXGI_CREATE_FACTORY_FLAGS.DXGI_CREATE_FACTORY_DEBUG added +Windows.Win32.Graphics.Dxgi.DXGI_ENUM_MODES added +Windows.Win32.Graphics.Dxgi.DXGI_ENUM_MODES.DXGI_ENUM_MODES_DISABLED_STEREO added +Windows.Win32.Graphics.Dxgi.DXGI_ENUM_MODES.DXGI_ENUM_MODES_INTERLACED added +Windows.Win32.Graphics.Dxgi.DXGI_ENUM_MODES.DXGI_ENUM_MODES_SCALING added +Windows.Win32.Graphics.Dxgi.DXGI_ENUM_MODES.DXGI_ENUM_MODES_STEREO added +Windows.Win32.Graphics.Dxgi.DXGI_MAP_FLAGS added +Windows.Win32.Graphics.Dxgi.DXGI_MAP_FLAGS.DXGI_MAP_DISCARD added +Windows.Win32.Graphics.Dxgi.DXGI_MAP_FLAGS.DXGI_MAP_READ added +Windows.Win32.Graphics.Dxgi.DXGI_MAP_FLAGS.DXGI_MAP_WRITE added +Windows.Win32.Graphics.Dxgi.DXGI_MWA_FLAGS added +Windows.Win32.Graphics.Dxgi.DXGI_MWA_FLAGS.DXGI_MWA_NO_ALT_ENTER added +Windows.Win32.Graphics.Dxgi.DXGI_MWA_FLAGS.DXGI_MWA_NO_PRINT_SCREEN added +Windows.Win32.Graphics.Dxgi.DXGI_MWA_FLAGS.DXGI_MWA_NO_WINDOW_CHANGES added +Windows.Win32.Graphics.Dxgi.DXGI_MWA_FLAGS.DXGI_MWA_VALID added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_ALLOW_TEARING added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_DO_NOT_SEQUENCE added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_DO_NOT_WAIT added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_RESTART added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_RESTRICT_TO_OUTPUT added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_STEREO_PREFER_RIGHT added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_STEREO_TEMPORARY_MONO added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_TEST added +Windows.Win32.Graphics.Dxgi.DXGI_PRESENT.DXGI_PRESENT_USE_DURATION added +Windows.Win32.Graphics.Dxgi.DXGI_RESOURCE_PRIORITY added +Windows.Win32.Graphics.Dxgi.DXGI_RESOURCE_PRIORITY.DXGI_RESOURCE_PRIORITY_HIGH added +Windows.Win32.Graphics.Dxgi.DXGI_RESOURCE_PRIORITY.DXGI_RESOURCE_PRIORITY_LOW added +Windows.Win32.Graphics.Dxgi.DXGI_RESOURCE_PRIORITY.DXGI_RESOURCE_PRIORITY_MAXIMUM added +Windows.Win32.Graphics.Dxgi.DXGI_RESOURCE_PRIORITY.DXGI_RESOURCE_PRIORITY_MINIMUM added +Windows.Win32.Graphics.Dxgi.DXGI_RESOURCE_PRIORITY.DXGI_RESOURCE_PRIORITY_NORMAL added +Windows.Win32.Graphics.Dxgi.DXGI_SHARED_RESOURCE_RW added +Windows.Win32.Graphics.Dxgi.DXGI_SHARED_RESOURCE_RW.DXGI_SHARED_RESOURCE_READ added +Windows.Win32.Graphics.Dxgi.DXGI_SHARED_RESOURCE_RW.DXGI_SHARED_RESOURCE_WRITE added +Windows.Win32.Graphics.Dxgi.IDXGIDecodeSwapChain.PresentBuffer : Flags...UInt32 => DXGI_PRESENT +Windows.Win32.Graphics.Dxgi.IDXGIFactory.MakeWindowAssociation : Flags...UInt32 => DXGI_MWA_FLAGS +Windows.Win32.Graphics.Dxgi.IDXGIFactory3.GetCreationFlags : return...UInt32 => DXGI_CREATE_FACTORY_FLAGS +Windows.Win32.Graphics.Dxgi.IDXGIOutput.GetDisplayModeList : Flags...UInt32 => DXGI_ENUM_MODES +Windows.Win32.Graphics.Dxgi.IDXGIOutput1.GetDisplayModeList1 : Flags...UInt32 => DXGI_ENUM_MODES +Windows.Win32.Graphics.Dxgi.IDXGIResource.GetEvictionPriority : pEvictionPriority...UInt32* => DXGI_RESOURCE_PRIORITY* +Windows.Win32.Graphics.Dxgi.IDXGIResource.SetEvictionPriority : EvictionPriority...UInt32 => DXGI_RESOURCE_PRIORITY +Windows.Win32.Graphics.Dxgi.IDXGISurface.Map : MapFlags...UInt32 => DXGI_MAP_FLAGS +Windows.Win32.Graphics.Dxgi.IDXGISwapChain.Present : Flags...UInt32 => DXGI_PRESENT +Windows.Win32.Graphics.Dxgi.IDXGISwapChain1.Present1 : PresentFlags...UInt32 => DXGI_PRESENT +# dxgi: Annotate GetDesc::pDesc with RetVal attribute +Windows.Win32.Graphics.Dxgi.IDXGIAdapter.GetDesc : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGIAdapter1.GetDesc1 : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGIAdapter2.GetDesc2 : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGIAdapter4.GetDesc3 : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGIOutput.GetDesc : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGIOutput6.GetDesc1 : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGIOutputDuplication.GetDesc : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGISurface.GetDesc : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGISwapChain.GetDesc : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGISwapChain1.GetDesc1 : pDesc : [Out] => [Out,RetVal] +Windows.Win32.Graphics.Dxgi.IDXGISwapChain1.GetFullscreenDesc : pDesc : [Out] => [Out,RetVal] # Add additional InvalidHandleValue metadata Windows.Win32.Networking.WinSock.SOCKET : [NativeTypedef,RAIIFree(closesocket)] => [InvalidHandleValue(-1),NativeTypedef,RAIIFree(closesocket)] Windows.Win32.Storage.FileSystem.HIORING : [NativeTypedef,RAIIFree(CloseIoRing)] => [InvalidHandleValue(-1),InvalidHandleValue(0),NativeTypedef,RAIIFree(CloseIoRing)] diff --git a/sources/MetadataUtils/ConstantsScraper.cs b/sources/MetadataUtils/ConstantsScraper.cs index 0771da68e..36f994ffb 100644 --- a/sources/MetadataUtils/ConstantsScraper.cs +++ b/sources/MetadataUtils/ConstantsScraper.cs @@ -360,7 +360,7 @@ private void AddConstantValue(string originalNamespace, string type, string name this.writtenConstants.Add(name, type); } - + private void AddConstantGuid(string defineGuidKeyword, string originalNamespace, string line) { int firstComma = line.IndexOf(','); @@ -518,7 +518,7 @@ private void ScrapeConstantsFromTraversedFiles(Dictionary traver .Where( e => e.autoPopulate != null && !string.IsNullOrEmpty(e.autoPopulate.filter) && - e.autoPopulate.header.ToLowerInvariant() == currentHeaderName) + e.autoPopulate.header.ToLowerInvariant().Split(';').Contains(currentHeaderName)) .ToArray(); Regex autoPopulateReg = null; From c0b204464c1e298a46938998d63e412ef9f76c40 Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Mon, 6 May 2024 08:57:04 -0700 Subject: [PATCH 4/4] Remove invalid D2D DWRITE_PAINT_FEATURE_LEVEL enum (#1897) --- generation/WinSDK/Partitions/Direct2D/settings.rsp | 1 + scripts/ChangesSinceLastRelease.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/generation/WinSDK/Partitions/Direct2D/settings.rsp b/generation/WinSDK/Partitions/Direct2D/settings.rsp index 4a8db503f..02a61ccce 100644 --- a/generation/WinSDK/Partitions/Direct2D/settings.rsp +++ b/generation/WinSDK/Partitions/Direct2D/settings.rsp @@ -3,6 +3,7 @@ IWICBitmapSource IWICBitmap DWRITE_GLYPH_RUN DWRITE_GLYPH_RUN_DESCRIPTION +DWRITE_PAINT_FEATURE_LEVEL --traverse /um/d2d1_2helper.h /um/d2d1_3helper.h diff --git a/scripts/ChangesSinceLastRelease.txt b/scripts/ChangesSinceLastRelease.txt index dba948f78..18ff62b2d 100644 --- a/scripts/ChangesSinceLastRelease.txt +++ b/scripts/ChangesSinceLastRelease.txt @@ -403,3 +403,5 @@ Windows.Win32.Networking.WinSock.SOCKET : [NativeTypedef,RAIIFree(closesocket)] Windows.Win32.Storage.FileSystem.HIORING : [NativeTypedef,RAIIFree(CloseIoRing)] => [InvalidHandleValue(-1),InvalidHandleValue(0),NativeTypedef,RAIIFree(CloseIoRing)] Windows.Win32.System.Threading.PTP_CLEANUP_GROUP : [NativeTypedef,RAIIFree(CloseThreadpoolCleanupGroup)] => [InvalidHandleValue(0),NativeTypedef,RAIIFree(CloseThreadpoolCleanupGroup)] Windows.Win32.System.Threading.PTP_POOL : [NativeTypedef,RAIIFree(CloseThreadpool)] => [InvalidHandleValue(0),NativeTypedef,RAIIFree(CloseThreadpool)] +# Remove invalid D2D DWRITE_PAINT_FEATURE_LEVEL enum +Windows.Win32.Graphics.Direct2D.DWRITE_PAINT_FEATURE_LEVEL removed