From e559be49e2d2dc064874a815cbf81846074c42ae Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 10:27:27 -0700 Subject: [PATCH 01/17] Migrate SecurityCenter and WinSat native header contracts Capture 28 existing MIDL retval facts with exact custom-attribute and CLI flag controls. Keep shared owners and SDK library derivation unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 32 +++++++ .../Partitions/SecurityCenter/settings.rsp | 2 + .../WinSDK/Partitions/WinSat/settings.rsp | 2 + generation/WinSDK/emitter.settings.rsp | 1 - ...HeaderAnnotations.expected-differences.txt | 31 +++++- generation/WinSDK/patches/SdkHeaders.json | 27 +++++- .../post-midl/um/iwscapi.annotations.patch | 33 +++++++ .../um/winsatcominterfacei.annotations.patch | 67 +++++++++++++ .../post-midl/um/wscapi.annotations.patch | 35 +++++++ generation/WinSDK/supportedOS.rsp | 12 --- scripts/Build-WinHttpMigrationImage.ps1 | 17 +++- .../WinHttpMigrationTests.cs | 96 +++++++++++++++++-- 12 files changed, 326 insertions(+), 29 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/um/iwscapi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/winsatcominterfacei.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/wscapi.annotations.patch diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 230c85a36..c1f3bf11e 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -368,3 +368,35 @@ That needs a separate compatibility/design decision. No SDK value, metadata value, macro or alias is changed to force this candidate through the playbook. Accepting existing native annotations is not approval to repair that logical enum conflict or manufacture new enums or members. + +## Next bounded wave above PR 2365 + +This separate draft starts at `162f8118a7da2ecb38d410a66b729dda64ca6767`; +the reviewed tooling and WinHttp-plus-ten branches are unchanged. Its checkpoints +are SecurityCenter/WinSat, then Wcm/InputRadial/WinContacts/WinLocation, then +Rdc/Nla/Com.CallObj/Enstor. The latter eight have real emitted authored OS facts, +not just parser opt-ins. Their unmodified-header admission compares exact C# +declaration tokens after removing only the explicitly identified native MIDL +`RetVal` additions. This admission is not a final-winmd or consumer grade. + +SecurityCenter relocates five OS floors and the existing +`IWSCProductList.Initialize.provider` association; WinSat relocates seven +interface OS floors. Three reviewed patches preserve the original native types, +macros, method order and signatures. Shared Foundation, COM, BSTR/VARIANT and RPC +facts remain under their existing owners, and FileHistory remains an opted-out +physical-header dependent. + +The first pair deliberately captures 28 native-derived `RetValAttribute` +additions: 16 SecurityCenter and 12 WinSat parameters. The existing +`iwscapi.h:189` and `winsatcominterfacei.h:259` MIDL comments are representative +sources. These are not newly authored retval assertions. Exact expectations and +physical architecture cases distinguish the custom attribute from raw CLI +`ParameterAttributes.Retval`, retain `Out`, and check unchanged signatures. +The earlier rejected receipt is historical evidence and is not relabeled. + +The existing image helper now relocates a copied frozen traversal map to its +owning worktree and prepared headers. It verifies one original SDK project root, +keeps the frozen OLD files/provenance unchanged, and records that original root +in the new receipt; it never reads the previous owner's checkout while emitting. +Fresh consumer compatibility remains **UNVERIFIED**; no consumer work or merging +is part of this wave. diff --git a/generation/WinSDK/Partitions/SecurityCenter/settings.rsp b/generation/WinSDK/Partitions/SecurityCenter/settings.rsp index 8e383afc5..4b42c981f 100644 --- a/generation/WinSDK/Partitions/SecurityCenter/settings.rsp +++ b/generation/WinSDK/Partitions/SecurityCenter/settings.rsp @@ -3,3 +3,5 @@ /um/Wscapi.h --namespace Windows.Win32.System.SecurityCenter +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/WinSat/settings.rsp b/generation/WinSDK/Partitions/WinSat/settings.rsp index 1f1f9af33..9878f2d70 100644 --- a/generation/WinSDK/Partitions/WinSat/settings.rsp +++ b/generation/WinSDK/Partitions/WinSat/settings.rsp @@ -2,3 +2,5 @@ /um/winsatcominterfacei.h --namespace Windows.Win32.System.AssessmentTool +--config +parse-win32-annotations diff --git a/generation/WinSDK/emitter.settings.rsp b/generation/WinSDK/emitter.settings.rsp index e70216580..aa9b237b7 100644 --- a/generation/WinSDK/emitter.settings.rsp +++ b/generation/WinSDK/emitter.settings.rsp @@ -1504,7 +1504,6 @@ IStream::LockRegion::dwLockType=[AssociatedEnum("LOCKTYPE")] IStream::Stat::grfStatFlag=[AssociatedEnum("STATFLAG")] IVBGetControl::EnumControls::dwOleContF=[AssociatedEnum("OLECONTF")] IWPCProviderConfig::RequestOverride::dwFlags=[AssociatedEnum("WPCFLAG_RESTRICTION")] -IWSCProductList::Initialize::provider=[AssociatedEnum("WSC_SECURITY_PROVIDER")] JOBOBJECT_IO_RATE_CONTROL_INFORMATION::ControlFlags=[AssociatedEnum("JOB_OBJECT_IO_RATE_CONTROL_FLAGS")] LdapMapErrorToWin32::LdapError=[AssociatedEnum("LDAP_RETCODE")] LOGPEN::lopnStyle=[AssociatedEnum("PEN_STYLE")] diff --git a/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt b/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt index 130cf5126..b2fec90b1 100644 --- a/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt +++ b/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt @@ -1,5 +1,6 @@ # Same-SDK b5b7b26 OLD to the complete header-annotation NEW. -# Only existing logical-enum use sites become native integers plus AssociatedEnum. +# Existing logical-enum use sites become native integers plus AssociatedEnum. +# Exact native MIDL retval comments add RetValAttribute; CLI parameter flags stay unchanged. # Preserve OLD logical scheme members and ordinary native constants. # No import, OS, last-error, callback, port, dependent-partition, or value changes. Windows.Win32.Networking.WinHttp.Apis.WinHttpCreateUrl : parameter 2 (dwFlags) : [In] => [AssociatedEnum(WIN_HTTP_CREATE_URL_FLAGS),In] @@ -50,3 +51,31 @@ Windows.Win32.UI.Input.XboxController.XINPUT_KEYSTROKE.VirtualKey : => [Associa Windows.Win32.UI.Input.XboxController.XINPUT_KEYSTROKE.VirtualKey...Windows.Win32.UI.Input.XboxController.XINPUT_VIRTUAL_KEY => System.UInt16 Windows.Win32.UI.Input.XboxController.XINPUT_KEYSTROKE.Flags : => [AssociatedEnum(XINPUT_KEYSTROKE_FLAGS)] Windows.Win32.UI.Input.XboxController.XINPUT_KEYSTROKE.Flags...Windows.Win32.UI.Input.XboxController.XINPUT_KEYSTROKE_FLAGS => System.UInt16 +Windows.Win32.System.AssessmentTool.IProvideWinSATAssessmentInfo.get_Description : parameter 1 (description) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IProvideWinSATAssessmentInfo.get_Score : parameter 1 (score) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IProvideWinSATAssessmentInfo.get_Title : parameter 1 (title) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IProvideWinSATResultsInfo.get_AssessmentDateTime : parameter 1 (fileTime) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IProvideWinSATResultsInfo.get_AssessmentState : parameter 1 (state) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IProvideWinSATResultsInfo.get_RatingStateDesc : parameter 1 (description) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IProvideWinSATResultsInfo.get_SystemRating : parameter 1 (level) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IProvideWinSATResultsInfo.GetAssessmentInfo : parameter 2 (ppinfo) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IQueryAllWinSATAssessments.get_AllXML : parameter 3 (ppDomNodeList) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IQueryOEMWinSATCustomization.GetOEMPrePopulationInfo : parameter 1 (state) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IQueryRecentWinSATAssessment.get_Info : parameter 1 (ppWinSATAssessmentInfo) : [Out] => [Out,RetVal] +Windows.Win32.System.AssessmentTool.IQueryRecentWinSATAssessment.get_XML : parameter 3 (ppDomNodeList) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct.get_ProductGuid : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct.get_ProductIsDefault : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct.get_ProductName : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct.get_ProductState : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct.get_ProductStateTimestamp : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct.get_RemediationPath : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct.get_SignatureStatus : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct2.get_AntivirusProtectionUpdateSubstatus : parameter 1 (peStatus) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct2.get_AntivirusScanSubstatus : parameter 1 (peStatus) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct2.get_AntivirusSettingsSubstatus : parameter 1 (peStatus) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct2.get_FirewallDomainProfileSubstatus : parameter 1 (peStatus) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct2.get_FirewallPrivateProfileSubstatus : parameter 1 (peStatus) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct2.get_FirewallPublicProfileSubstatus : parameter 1 (peStatus) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWscProduct3.get_AntivirusDaysUntilExpired : parameter 1 (pdwDays) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWSCProductList.get_Count : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.System.SecurityCenter.IWSCProductList.get_Item : parameter 2 (pVal) : [Out] => [Out,RetVal] diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index 0a3905177..96868c261 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -87,6 +87,24 @@ "sourceSha256": "EE657D80B788EEAE76ED0D63932ED8AD619E001D8C2BBA5BF670837F07DDB3B4", "sdkPath": "c\\include\\10.0.26100.0\\um\\Xinput.h", "sdkSha256": "EE657D80B788EEAE76ED0D63932ED8AD619E001D8C2BBA5BF670837F07DDB3B4" + }, + { + "path": "um\\iwscapi.h", + "sourceSha256": "FA56628E0426D07A7E5CC93E0F0D09821C805D4519B28BAF11B03EE8BA6AA0F8", + "sdkPath": "c\\include\\10.0.26100.0\\um\\iwscapi.h", + "sdkSha256": "FA56628E0426D07A7E5CC93E0F0D09821C805D4519B28BAF11B03EE8BA6AA0F8" + }, + { + "path": "um\\wscapi.h", + "sourceSha256": "34E079E0DDF931DDD634BB8E99EE0FC467D134531920C40E25C233427E182B5B", + "sdkPath": "c\\include\\10.0.26100.0\\um\\wscapi.h", + "sdkSha256": "34E079E0DDF931DDD634BB8E99EE0FC467D134531920C40E25C233427E182B5B" + }, + { + "path": "um\\winsatcominterfacei.h", + "sourceSha256": "1EEDA1A0FB95BA15479F6FD702B712B979D01100D328F1CF0C20418D004677B3", + "sdkPath": "c\\include\\10.0.26100.0\\um\\winsatcominterfacei.h", + "sdkSha256": "1EEDA1A0FB95BA15479F6FD702B712B979D01100D328F1CF0C20418D004677B3" } ], "partitions": [ @@ -104,7 +122,9 @@ "ToolHelp", "UpdateAssessment", "Wsl", - "Xinput" + "Xinput", + "SecurityCenter", + "WinSat" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -122,6 +142,9 @@ "post-midl\\um\\tlhelp32.annotations.patch", "post-midl\\um\\waasapi.annotations.patch", "post-midl\\um\\wslapi.annotations.patch", - "post-midl\\um\\xinput.annotations.patch" + "post-midl\\um\\xinput.annotations.patch", + "post-midl\\um\\iwscapi.annotations.patch", + "post-midl\\um\\wscapi.annotations.patch", + "post-midl\\um\\winsatcominterfacei.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/um/iwscapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/iwscapi.annotations.patch new file mode 100644 index 000000000..94d2868b4 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/iwscapi.annotations.patch @@ -0,0 +1,33 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/iwscapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/iwscapi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/iwscapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/iwscapi.h +@@ -119,6 +119,7 @@ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #ifndef __WSC_SECURITY_PRODUCT_SUBSTATUS__ +@@ -183,6 +184,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8C38232E-3A45-4A27-92B0-1A16A975F669") ++ _Windows_SupportedOS_Windows8_ + IWscProduct : public IDispatch + { + public: +@@ -881,11 +883,12 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("722A338C-6E8E-4E72-AC27-1417FB0C81C2") ++ _Windows_SupportedOS_Windows8_ + IWSCProductList : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Initialize( +- /* [in] */ ULONG provider) = 0; ++ /* [in] */ _Win32_AssociatedEnum_(WSC_SECURITY_PROVIDER) ULONG provider) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( + /* [retval][out] */ __RPC__out LONG *pVal) = 0; diff --git a/generation/WinSDK/patches/post-midl/um/winsatcominterfacei.annotations.patch b/generation/WinSDK/patches/post-midl/um/winsatcominterfacei.annotations.patch new file mode 100644 index 000000000..ae6808f5b --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/winsatcominterfacei.annotations.patch @@ -0,0 +1,67 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/winsatcominterfacei.h b/generation/WinSDK/RecompiledIdlHeaders/um/winsatcominterfacei.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/winsatcominterfacei.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/winsatcominterfacei.h +@@ -196,6 +196,7 @@ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + typedef /* [public][public] */ +@@ -253,6 +254,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0CD1C380-52D3-4678-AC6F-E929E480BE9E") ++ _Windows_SupportedOS_WindowsVista_ + IProvideWinSATAssessmentInfo : public IDispatch + { + public: +@@ -413,6 +415,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F8334D5D-568E-4075-875F-9DF341506640") ++ _Windows_SupportedOS_WindowsVista_ + IProvideWinSATResultsInfo : public IDispatch + { + public: +@@ -597,6 +600,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F8AD5D1F-3B47-4bdc-9375-7C6B1DA4ECA7") ++ _Windows_SupportedOS_WindowsVista_ + IQueryRecentWinSATAssessment : public IDispatch + { + public: +@@ -750,6 +754,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A9F4ADE0-871A-42a3-B813-3078D25162C9") ++ _Windows_SupportedOS_WindowsVista_ + IProvideWinSATVisuals : public IUnknown + { + public: +@@ -840,6 +845,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0B89ED1D-6398-4fea-87FC-567D8D19176F") ++ _Windows_SupportedOS_WindowsVista_ + IQueryAllWinSATAssessments : public IDispatch + { + public: +@@ -982,6 +988,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("262A1918-BA0D-41d5-92C2-FAB4633EE74F") ++ _Windows_SupportedOS_WindowsVista_ + IWinSATInitiateEvents : public IUnknown + { + public: +@@ -1083,6 +1090,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D983FC50-F5BF-49d5-B5ED-CCCB18AA7FC1") ++ _Windows_SupportedOS_WindowsVista_ + IInitiateWinSATAssessment : public IUnknown + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/wscapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/wscapi.annotations.patch new file mode 100644 index 000000000..e5642f95e --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/wscapi.annotations.patch @@ -0,0 +1,35 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/wscapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/wscapi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/wscapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/wscapi.h +@@ -3,6 +3,7 @@ + // + #pragma once + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -69,6 +70,7 @@ + + + ++_Windows_SupportedOS_WindowsVista_ + STDAPI WscRegisterForChanges(LPVOID Reserved, + PHANDLE phCallbackRegistration, + LPTHREAD_START_ROUTINE lpCallbackAddress, +@@ -84,6 +86,7 @@ + // Return Values: + // Returns S_OK if the function succeeds, otherwise returns an error code. + ++_Windows_SupportedOS_WindowsVista_ + STDAPI WscUnRegisterChanges(HANDLE hRegistrationHandle); + + // The WscRegisterForUserNotifications function registers a callback function to be run when the Security Center service +@@ -111,6 +114,7 @@ + // is always S_FALSE and the pHealth out parameter is always set to WSC_SECURITY_PROVIDER_HEALTH_POOR. + // + ++_Windows_SupportedOS_WindowsVista_ + STDAPI WscGetSecurityProviderHealth(DWORD Providers, + PWSC_SECURITY_PROVIDER_HEALTH pHealth); + diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 5dd79f940..144fa27c1 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -4362,8 +4362,6 @@ SetIScsiInitiatorRADIUSSharedSecret=SupportedOSPlatform("windows6.0.6000") SetIScsiTunnelModeOuterAddressA=SupportedOSPlatform("windows6.0.6000") SetIScsiTunnelModeOuterAddressW=SupportedOSPlatform("windows6.0.6000") SetupPersistentIScsiDevices=SupportedOSPlatform("windows6.0.6000") -IWscProduct=SupportedOSPlatform("windows8.0") -IWSCProductList=SupportedOSPlatform("windows8.0") IAMWstDecoder=SupportedOSPlatform("windows5.1.2600") IsProcessInJob=SupportedOSPlatform("windows5.1.2600") AssignProcessToJobObject=SupportedOSPlatform("windows5.1.2600") @@ -15317,13 +15315,6 @@ SaferiIsExecutableFileType=SupportedOSPlatform("windows5.1.2600") SaferRecordEventLogEntry=SupportedOSPlatform("windows5.1.2600") SaferSetLevelInformation=SupportedOSPlatform("windows5.1.2600") SaferSetPolicyInformation=SupportedOSPlatform("windows5.1.2600") -IInitiateWinSATAssessment=SupportedOSPlatform("windows6.0.6000") -IProvideWinSATAssessmentInfo=SupportedOSPlatform("windows6.0.6000") -IProvideWinSATResultsInfo=SupportedOSPlatform("windows6.0.6000") -IProvideWinSATVisuals=SupportedOSPlatform("windows6.0.6000") -IQueryAllWinSATAssessments=SupportedOSPlatform("windows6.0.6000") -IQueryRecentWinSATAssessment=SupportedOSPlatform("windows6.0.6000") -IWinSATInitiateEvents=SupportedOSPlatform("windows6.0.6000") GetOpenCardNameA=SupportedOSPlatform("windows5.1.2600") GetOpenCardNameW=SupportedOSPlatform("windows5.1.2600") SCardAccessStartedEvent=SupportedOSPlatform("windows5.1.2600") @@ -16775,9 +16766,6 @@ IWsbApplicationRestoreSupport=SupportedOSPlatform("windowsserver2008") DeregisterOnlineBackupFromWindowsServerBackup=SupportedOSPlatform("windowsserver2012") RegisterOnlineBackupWithWindowsServerBackup=SupportedOSPlatform("windowsserver2012") UpdateOBStatusInWindowsServerBackup=SupportedOSPlatform("windowsserver2012") -WscGetSecurityProviderHealth=SupportedOSPlatform("windows6.0.6000") -WscRegisterForChanges=SupportedOSPlatform("windows6.0.6000") -WscUnRegisterChanges=SupportedOSPlatform("windows6.0.6000") WSDCreateOutboundAttachment=SupportedOSPlatform("windows6.0.6000") IWSDAttachment=SupportedOSPlatform("windows6.0.6000") IWSDInboundAttachment=SupportedOSPlatform("windows6.0.6000") diff --git a/scripts/Build-WinHttpMigrationImage.ps1 b/scripts/Build-WinHttpMigrationImage.ps1 index c54b2b768..cbc2b2bf6 100644 --- a/scripts/Build-WinHttpMigrationImage.ps1 +++ b/scripts/Build-WinHttpMigrationImage.ps1 @@ -273,12 +273,20 @@ try { [string[]](@('--reducePointerLevel') + @($reduce | Sort-Object)), [Text.UTF8Encoding]::new($false)) $mapping = [IO.File]::ReadAllText("$oldGenerated\traversedFileToNamespace.rsp") - $oldRoot = "$repo\generation\WinSDK\RecompiledIdlHeaders" - if (!$mapping.Contains($oldRoot)) { - throw 'The frozen traversal map is not rooted in this baseline worktree.' + $oldRoots = @([regex]::Matches($mapping, '(?m)^([^\r\n=]+[\\/]generation[\\/]WinSDK[\\/]RecompiledIdlHeaders)[\\/][^\r\n=]+=') | + ForEach-Object { $_.Groups[1].Value } | Sort-Object -Unique -CaseSensitive) + if ($oldRoots.Count -ne 1) { + throw 'The frozen traversal map must have exactly one SDK mirror root.' + } + $oldRoot = $oldRoots[0] + $oldProjectRoot = [IO.Path]::GetDirectoryName($oldRoot) + if (@([IO.File]::ReadAllLines("$oldGenerated\traversedFileToNamespace.rsp") | + Where-Object { $_ -and !$_.StartsWith('--') -and !$_.StartsWith($oldProjectRoot + '/', [StringComparison]::Ordinal) -and + !$_.StartsWith($oldProjectRoot + '\', [StringComparison]::Ordinal) }).Count) { + throw 'Every frozen traversal input must belong to the same SDK project.' } [IO.File]::WriteAllText("$generated\traversedFileToNamespace.rsp", - $mapping.Replace($oldRoot, $includeRoot), [Text.UTF8Encoding]::new($false)) + $mapping.Replace($oldRoot, $includeRoot).Replace($oldProjectRoot, $project), [Text.UTF8Encoding]::new($false)) $constantArguments = @("$repo\bin\Release\net10.0\ConstantsScraper.dll", '--headerTextFile', "$generated\ConstantsScraper.header.generated.txt", '--scraperOutputDir', $generated, @@ -305,6 +313,7 @@ try { baselineToolingCommit = $baseline.toolingCommit sdkPackageVersion = $baseline.sdkPackageVersion baselineProvenanceSha256 = Get-Sha256 $provenancePath + baselineTraversalRoot = $oldRoot oldWinmdSha256 = $baseline.winmdSha256 newWinmdSha256 = Get-Sha256 $winmd preparedIncludeRoot = $includeRoot diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index de9d72a63..318958d97 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -52,6 +52,37 @@ private static readonly (string Owner, string Member, string Enum, string Native new EnumUse("Windows.Win32.UI.Input.XboxController", "XINPUT_KEYSTROKE", "VirtualKey", "XINPUT_VIRTUAL_KEY", "UInt16"), new EnumUse("Windows.Win32.UI.Input.XboxController", "XINPUT_KEYSTROKE", "Flags", "XINPUT_KEYSTROKE_FLAGS", "UInt16"), }).ToArray(); + private static readonly (string Namespace, string Owner, string Method, string Parameter)[] NativeRetvalUses = + { + ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Description", "description"), + ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Score", "score"), + ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Title", "title"), + ("Windows.Win32.System.AssessmentTool", "IProvideWinSATResultsInfo", "get_AssessmentDateTime", "fileTime"), + ("Windows.Win32.System.AssessmentTool", "IProvideWinSATResultsInfo", "get_AssessmentState", "state"), + ("Windows.Win32.System.AssessmentTool", "IProvideWinSATResultsInfo", "get_RatingStateDesc", "description"), + ("Windows.Win32.System.AssessmentTool", "IProvideWinSATResultsInfo", "get_SystemRating", "level"), + ("Windows.Win32.System.AssessmentTool", "IProvideWinSATResultsInfo", "GetAssessmentInfo", "ppinfo"), + ("Windows.Win32.System.AssessmentTool", "IQueryAllWinSATAssessments", "get_AllXML", "ppDomNodeList"), + ("Windows.Win32.System.AssessmentTool", "IQueryOEMWinSATCustomization", "GetOEMPrePopulationInfo", "state"), + ("Windows.Win32.System.AssessmentTool", "IQueryRecentWinSATAssessment", "get_Info", "ppWinSATAssessmentInfo"), + ("Windows.Win32.System.AssessmentTool", "IQueryRecentWinSATAssessment", "get_XML", "ppDomNodeList"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct", "get_ProductGuid", "pVal"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct", "get_ProductIsDefault", "pVal"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct", "get_ProductName", "pVal"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct", "get_ProductState", "pVal"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct", "get_ProductStateTimestamp", "pVal"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct", "get_RemediationPath", "pVal"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct", "get_SignatureStatus", "pVal"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct2", "get_AntivirusProtectionUpdateSubstatus", "peStatus"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct2", "get_AntivirusScanSubstatus", "peStatus"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct2", "get_AntivirusSettingsSubstatus", "peStatus"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct2", "get_FirewallDomainProfileSubstatus", "peStatus"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct2", "get_FirewallPrivateProfileSubstatus", "peStatus"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct2", "get_FirewallPublicProfileSubstatus", "peStatus"), + ("Windows.Win32.System.SecurityCenter", "IWscProduct3", "get_AntivirusDaysUntilExpired", "pdwDays"), + ("Windows.Win32.System.SecurityCenter", "IWSCProductList", "get_Count", "pVal"), + ("Windows.Win32.System.SecurityCenter", "IWSCProductList", "get_Item", "pVal"), + }; private static readonly string[] AdditionalOwnedMethods = { "CeipIsOptedIn", @@ -82,12 +113,18 @@ private static readonly (string Owner, string Member, string Enum, string Native "WslConfigureDistribution", "WslGetDistributionConfiguration", "WslLaunchInteractive", "WslLaunch", "XInputGetState", "XInputSetState", "XInputGetCapabilities", "XInputEnable", "XInputGetAudioDeviceIds", "XInputGetBatteryInformation", "XInputGetKeystroke", + "WscRegisterForChanges", "WscUnRegisterChanges", "WscRegisterForUserNotifications", + "WscGetSecurityProviderHealth", "WscQueryAntiMalwareUri", "WscGetAntiMalwareUri", }; private static readonly string[] AdditionalOwnedTypes = { "HEAPENTRY32", "IWaaSAssessor", "WSL_DISTRIBUTION_FLAGS", "XINPUT_BATTERY_INFORMATION", "XINPUT_CAPABILITIES", "XINPUT_GAMEPAD", "XINPUT_KEYSTROKE", + "IWscProduct", "IWscProduct2", "IWscProduct3", "IWSCProductList", + "IInitiateWinSATAssessment", "IProvideWinSATAssessmentInfo", "IProvideWinSATResultsInfo", + "IProvideWinSATVisuals", "IQueryAllWinSATAssessments", "IQueryRecentWinSATAssessment", + "IWinSATInitiateEvents", "IQueryOEMWinSATCustomization", }; private static readonly string[] AdditionalLogicalEnums = { @@ -147,7 +184,7 @@ public void FrozenInputToolingControlChangesOnlyMissingConstructorInstanceBits() } [MigrationFact] - public void EveryPhysicalTypeHasOnlyReviewedEnumUseSiteChanges() + public void EveryPhysicalTypeHasOnlyReviewedHeaderChanges() { using var control = Open("WINHTTP_MIGRATION_TOOLING_CONTROL"); using var current = Open("WINHTTP_MIGRATION_NEW"); @@ -155,16 +192,48 @@ public void EveryPhysicalTypeHasOnlyReviewedEnumUseSiteChanges() var after = Types(current.Reader); Assert.Equal(before.Keys.OrderBy(value => value), after.Keys.OrderBy(value => value)); var used = new HashSet(StringComparer.Ordinal); + var usedRetvals = new HashSet(StringComparer.Ordinal); int unchanged = 0; foreach (var entry in before) { - string expected = SnapshotType(control.Reader, entry.Value, normalizeReviewedEnumUses: true, usedEnumSites: used); + string expected = SnapshotType(control.Reader, entry.Value, normalizeReviewedChanges: true, + usedEnumSites: used, usedRetvalSites: usedRetvals); string actual = SnapshotType(current.Reader, after[entry.Key]); Assert.True(expected == actual, $"Unexpected physical metadata change in {entry.Key}.\nExpected:\n{expected}\nActual:\n{actual}"); unchanged += SnapshotType(control.Reader, entry.Value) == actual ? 1 : 0; } Assert.Equal(ReviewedEnumUses.Select(value => value.Site).OrderBy(value => value), used.OrderBy(value => value)); - this.output.WriteLine($"All {before.Count} physical types graded: {unchanged} unchanged; only {used.Count} exact native-type/AssociatedEnum sites normalized."); + Assert.Equal(NativeRetvalUses.Select(value => $"{value.Namespace}.{value.Owner}.{value.Method}.{value.Parameter}") + .OrderBy(value => value), usedRetvals.OrderBy(value => value)); + this.output.WriteLine($"All {before.Count} physical types graded: {unchanged} unchanged; " + + $"{used.Count} exact native-type/AssociatedEnum sites and {usedRetvals.Count} native MIDL retval sites normalized."); + } + + [MigrationTheory] + [InlineData(1)] + [InlineData(2)] + [InlineData(4)] + public void NativeMidlRetvalsReachEveryPhysicalArchitectureWithoutChangingCliFlags(int architecture) + { + using var old = Open("WINHTTP_MIGRATION_OLD"); + using var current = Open("WINHTTP_MIGRATION_NEW"); + foreach (var use in NativeRetvalUses) + { + var before = Methods(old.Reader, use.Namespace, use.Owner, architecture)[use.Method]; + var after = Methods(current.Reader, use.Namespace, use.Owner, architecture)[use.Method]; + Assert.Equal(Signature(before.DecodeSignature(Signatures, null)), Signature(after.DecodeSignature(Signatures, null))); + var original = before.GetParameters().Select(old.Reader.GetParameter) + .Single(value => old.Reader.GetString(value.Name) == use.Parameter); + var parameter = after.GetParameters().Select(current.Reader.GetParameter) + .Single(value => current.Reader.GetString(value.Name) == use.Parameter); + Assert.Equal(original.Attributes, parameter.Attributes); + Assert.True(parameter.Attributes.HasFlag(ParameterAttributes.Out)); + Assert.False(parameter.Attributes.HasFlag(ParameterAttributes.Retval)); + Assert.DoesNotContain(original.GetCustomAttributes(), handle => AttributeName(old.Reader, handle) == "RetValAttribute"); + var attribute = Assert.Single(parameter.GetCustomAttributes().Where(handle => AttributeName(current.Reader, handle) == "RetValAttribute")); + Assert.Equal(new byte[] { 1, 0, 0, 0 }, current.Reader.GetBlobBytes(current.Reader.GetCustomAttribute(attribute).Value)); + } + this.output.WriteLine($"{NativeRetvalUses.Length} exact native MIDL RetValAttribute additions on architecture {architecture}; CLI parameter flags and signatures unchanged."); } [MigrationTheory] @@ -448,10 +517,10 @@ public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() File.ReadAllText(Path.Combine(project, "supportedOS.rsp"))); } foreach (string partition in new[] { "CEIP", "ApplicationVerifier", "MagApi", "PsApi1", "Time", "Ual", - "ToolHelp", "UpdateAssessment", "Wsl", "Xinput" }) + "ToolHelp", "UpdateAssessment", "Wsl", "Xinput", "SecurityCenter", "WinSat" }) Assert.Contains("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); Assert.DoesNotContain("--with-librarypath", File.ReadAllText(Path.Combine(project, "Partitions", "Wsl", "settings.rsp"))); - foreach (string partition in new[] { "PsApi2", "SecurityCenter", "WinSat" }) + foreach (string partition in new[] { "PsApi2" }) Assert.DoesNotContain("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); } @@ -583,9 +652,9 @@ internal static string[] SnapshotNamespace(MetadataReader reader, string ns) .Select(type => SnapshotType(reader, type)).OrderBy(value => value, StringComparer.Ordinal).ToArray(); internal static string SnapshotType(MetadataReader reader, TypeDefinition type, bool correctConstructorInstanceBits = false, - bool normalizeReviewedEnumUses = false, ISet usedEnumSites = null) + bool normalizeReviewedChanges = false, ISet usedEnumSites = null, ISet usedRetvalSites = null) { - string Attributes(CustomAttributeHandleCollection values, string associatedEnum = null) + string Attributes(CustomAttributeHandleCollection values, string associatedEnum = null, bool nativeRetval = false) { var attributes = values.Select(handle => AttributeTypeName(reader, handle) + ":" + Convert.ToHexString(reader.GetBlobBytes(reader.GetCustomAttribute(handle).Value))).ToList(); @@ -598,12 +667,17 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum value.WriteUInt16(0); attributes.Add(MetadataNamespace + ".AssociatedEnumAttribute:" + Convert.ToHexString(value.ToArray())); } + if (nativeRetval) + { + Assert.DoesNotContain(values, handle => AttributeName(reader, handle) == "RetValAttribute"); + attributes.Add(MetadataNamespace + ".RetValAttribute:01000000"); + } return string.Join(",", attributes.OrderBy(value => value, StringComparer.Ordinal)); } string Blob(BlobHandle blob) => blob.IsNil ? "" : Convert.ToHexString(reader.GetBlobBytes(blob)); string ns = reader.GetString(type.Namespace); string typeName = reader.GetString(type.Name); - var uses = normalizeReviewedEnumUses ? ReviewedEnumUses.Where(value => value.Namespace == ns).ToArray() : Array.Empty(); + var uses = normalizeReviewedChanges ? ReviewedEnumUses.Where(value => value.Namespace == ns).ToArray() : Array.Empty(); var rows = new List { reader.GetString(type.Namespace) + "." + reader.GetString(type.Name), @@ -660,7 +734,11 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum $"{Import(reader, method)}|{Attributes(method.GetCustomAttributes())}"); foreach (var parameter in parameters) { - string attributes = Attributes(parameter.GetCustomAttributes(), parameterEnums.GetValueOrDefault(parameter.SequenceNumber)); + string parameterName = reader.GetString(parameter.Name); + bool nativeRetval = normalizeReviewedChanges && NativeRetvalUses.Contains((ns, typeName, methodName, parameterName)); + if (nativeRetval) + usedRetvalSites?.Add($"{ns}.{typeName}.{methodName}.{parameterName}"); + string attributes = Attributes(parameter.GetCustomAttributes(), parameterEnums.GetValueOrDefault(parameter.SequenceNumber), nativeRetval); rows.Add($"P|{parameter.SequenceNumber}|{reader.GetString(parameter.Name)}|{parameter.Attributes}|" + $"{Blob(parameter.GetMarshallingDescriptor())}|{attributes}"); } From 7f7dd082e6d9ecf6b308620e5bf2b41c85541543 Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 11:20:35 -0700 Subject: [PATCH 02/17] Migrate connection, radial, contacts, and location header annotations Relocate nineteen emitted OS floors and capture thirty-nine existing native MIDL retval contracts without changing ABI or logical enum identities. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 30 ++++++++- .../Partitions/InputRadial/settings.rsp | 2 + generation/WinSDK/Partitions/Wcm/settings.rsp | 2 + .../Partitions/WinContacts/settings.rsp | 2 + .../Partitions/WinLocation/settings.rsp | 2 + ...HeaderAnnotations.expected-differences.txt | 39 +++++++++++ generation/WinSDK/patches/SdkHeaders.json | 54 ++++++++++++++- .../post-midl/um/icontact.annotations.patch | 51 ++++++++++++++ .../um/locationapi.annotations.patch | 67 +++++++++++++++++++ .../radialcontrollerinterop.annotations.patch | 27 ++++++++ .../post-midl/um/wcmapi.annotations.patch | 43 ++++++++++++ generation/WinSDK/supportedOS.rsp | 19 ------ .../WinHttpMigrationTests.cs | 49 +++++++++++++- 13 files changed, 364 insertions(+), 23 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/um/icontact.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/locationapi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/radialcontrollerinterop.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/wcmapi.annotations.patch diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index c1f3bf11e..fc042bbd9 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -374,11 +374,19 @@ enum conflict or manufacture new enums or members. This separate draft starts at `162f8118a7da2ecb38d410a66b729dda64ca6767`; the reviewed tooling and WinHttp-plus-ten branches are unchanged. Its checkpoints are SecurityCenter/WinSat, then Wcm/InputRadial/WinContacts/WinLocation, then -Rdc/Nla/Com.CallObj/Enstor. The latter eight have real emitted authored OS facts, +Rdc/Nla/Com.CallObj/Com.Events. The latter eight have real emitted authored OS facts, not just parser opt-ins. Their unmodified-header admission compares exact C# declaration tokens after removing only the explicitly identified native MIDL `RetVal` additions. This admission is not a final-winmd or consumer grade. +Enstor is excluded as a **Learn-versus-legacy-sidecar discrepancy**: its existing +Vista RTM floor differs from the published Vista SP2 requirement. This is not a +conflicting native-header annotation and does not qualify acceptance of native +SDK/SAL/MIDL contracts. Its header, floor and sidecars remain unchanged; there is +no further Enstor investigation in this wave. Com.Events is the routine +replacement, admitted against unmodified headers with 15 actual emitted +Windows 2000 floors and no predicted new final retval metadata. + SecurityCenter relocates five OS floors and the existing `IWSCProductList.Initialize.provider` association; WinSat relocates seven interface OS floors. Three reviewed patches preserve the original native types, @@ -394,6 +402,26 @@ physical architecture cases distinguish the custom attribute from raw CLI `ParameterAttributes.Retval`, retain `Out`, and check unchanged signatures. The earlier rejected receipt is historical evidence and is not relabeled. +The first pair's immutable local checkpoint is producer +`e559be49e2d2dc064874a815cbf81846074c42ae`, image SHA256 +`B45712BFF48B652A6A304AB043D599EBB086E5CE145A986F900E1404E8362F23`. +Strict B9-CI-to-checkpoint grading uses exactly 28 native additions; cumulative +OLD-to-checkpoint grading uses 76 differences, including the prior layer's 48 +enum representation entries. Both have zero unknown and zero unused +expectations. All 37,314 physical types and 7,791 enum identities are graded; +25 preparation/retval, 51 native architecture, 26 physical/no-fallback/mutation +and 14 full-SDK cases executed with zero skipped. The owning receipt is +`artifacts\next-header-annotation-wave\checkpoint1-review-grade.json`, SHA256 +`A939C4740676722D2500A10BD98290301BF27CB0D2679C49CEC41ADE8DE79E61`. + +Checkpoint two relocates 19 existing OS floors through four ordinary per-header +patches: Wcm 5, InputRadial 2, WinContacts 5 and WinLocation 7. Exact native +`locationapi.h` MIDL declarations identify 39 additional retval sites, including +`ILocationReport.GetTimestamp.pCreationTime` and +`ILocation.GetReport.ppLocationReport`. WinContacts' injected source annotations +repeat final metadata already supplied by SAL; source occurrence counts are not +new final-attribute counts. Checkpoint two's full-image grade remains pending. + The existing image helper now relocates a copied frozen traversal map to its owning worktree and prepared headers. It verifies one original SDK project root, keeps the frozen OLD files/provenance unchanged, and records that original root diff --git a/generation/WinSDK/Partitions/InputRadial/settings.rsp b/generation/WinSDK/Partitions/InputRadial/settings.rsp index 6c0042c49..d80ee601d 100644 --- a/generation/WinSDK/Partitions/InputRadial/settings.rsp +++ b/generation/WinSDK/Partitions/InputRadial/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/RadialControllerInterop.h --namespace diff --git a/generation/WinSDK/Partitions/Wcm/settings.rsp b/generation/WinSDK/Partitions/Wcm/settings.rsp index 1d0f00f53..f5b9a1426 100644 --- a/generation/WinSDK/Partitions/Wcm/settings.rsp +++ b/generation/WinSDK/Partitions/Wcm/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/wcmapi.h --namespace diff --git a/generation/WinSDK/Partitions/WinContacts/settings.rsp b/generation/WinSDK/Partitions/WinContacts/settings.rsp index 80e81eca6..aab468970 100644 --- a/generation/WinSDK/Partitions/WinContacts/settings.rsp +++ b/generation/WinSDK/Partitions/WinContacts/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/IContact.h /um/contactaggregation.h diff --git a/generation/WinSDK/Partitions/WinLocation/settings.rsp b/generation/WinSDK/Partitions/WinLocation/settings.rsp index 43b1f0d54..c7fae5dbb 100644 --- a/generation/WinSDK/Partitions/WinLocation/settings.rsp +++ b/generation/WinSDK/Partitions/WinLocation/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /shared/gnssdriver.h /um/locationapi.h diff --git a/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt b/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt index b2fec90b1..6503da4f2 100644 --- a/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt +++ b/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt @@ -79,3 +79,42 @@ Windows.Win32.System.SecurityCenter.IWscProduct2.get_FirewallPublicProfileSubsta Windows.Win32.System.SecurityCenter.IWscProduct3.get_AntivirusDaysUntilExpired : parameter 1 (pdwDays) : [Out] => [Out,RetVal] Windows.Win32.System.SecurityCenter.IWSCProductList.get_Count : parameter 1 (pVal) : [Out] => [Out,RetVal] Windows.Win32.System.SecurityCenter.IWSCProductList.get_Item : parameter 2 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ICivicAddressReport.GetAddressLine1 : parameter 1 (pbstrAddress1) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ICivicAddressReport.GetAddressLine2 : parameter 1 (pbstrAddress2) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ICivicAddressReport.GetCity : parameter 1 (pbstrCity) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ICivicAddressReport.GetCountryRegion : parameter 1 (pbstrCountryRegion) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ICivicAddressReport.GetDetailLevel : parameter 1 (pDetailLevel) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ICivicAddressReport.GetPostalCode : parameter 1 (pbstrPostalCode) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ICivicAddressReport.GetStateProvince : parameter 1 (pbstrStateProvince) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ICivicAddressReportFactory.get_CivicAddressReport : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDefaultLocation.GetReport : parameter 2 (ppLocationReport) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispCivicAddressReport.get_AddressLine1 : parameter 1 (pAddress1) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispCivicAddressReport.get_AddressLine2 : parameter 1 (pAddress2) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispCivicAddressReport.get_City : parameter 1 (pCity) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispCivicAddressReport.get_CountryRegion : parameter 1 (pCountryRegion) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispCivicAddressReport.get_DetailLevel : parameter 1 (pDetailLevel) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispCivicAddressReport.get_PostalCode : parameter 1 (pPostalCode) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispCivicAddressReport.get_StateProvince : parameter 1 (pStateProvince) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispCivicAddressReport.get_Timestamp : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispLatLongReport.get_Altitude : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispLatLongReport.get_AltitudeError : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispLatLongReport.get_ErrorRadius : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispLatLongReport.get_Latitude : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispLatLongReport.get_Longitude : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.IDispLatLongReport.get_Timestamp : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILatLongReport.GetAltitude : parameter 1 (pAltitude) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILatLongReport.GetAltitudeError : parameter 1 (pAltitudeError) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILatLongReport.GetErrorRadius : parameter 1 (pErrorRadius) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILatLongReport.GetLatitude : parameter 1 (pLatitude) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILatLongReport.GetLongitude : parameter 1 (pLongitude) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILatLongReportFactory.get_LatLongReport : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocation.GetDesiredAccuracy : parameter 2 (pDesiredAccuracy) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocation.GetReport : parameter 2 (ppLocationReport) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocation.GetReportInterval : parameter 2 (pMilliseconds) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocation.GetReportStatus : parameter 2 (pStatus) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocationReport.GetSensorID : parameter 1 (pSensorID) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocationReport.GetTimestamp : parameter 1 (pCreationTime) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocationReport.GetValue : parameter 2 (pValue) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocationReportFactory.get_DesiredAccuracy : parameter 1 (pDesiredAccuracy) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocationReportFactory.get_ReportInterval : parameter 1 (pMilliseconds) : [Out] => [Out,RetVal] +Windows.Win32.Devices.Geolocation.ILocationReportFactory.get_Status : parameter 1 (pVal) : [Out] => [Out,RetVal] diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index 96868c261..912d86d2b 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -105,6 +105,48 @@ "sourceSha256": "1EEDA1A0FB95BA15479F6FD702B712B979D01100D328F1CF0C20418D004677B3", "sdkPath": "c\\include\\10.0.26100.0\\um\\winsatcominterfacei.h", "sdkSha256": "1EEDA1A0FB95BA15479F6FD702B712B979D01100D328F1CF0C20418D004677B3" + }, + { + "path": "um\\wcmapi.h", + "sourceSha256": "06BF23E24924AF388A1039E9441E3A00569B1F63B2BACD30AEFF1155D17B14FE", + "sdkPath": "c\\include\\10.0.26100.0\\um\\wcmapi.h", + "sdkSha256": "06BF23E24924AF388A1039E9441E3A00569B1F63B2BACD30AEFF1155D17B14FE" + }, + { + "path": "um\\RadialControllerInterop.h", + "sourceSha256": "33B813E9A18CA0CC098D8D5D068B72BF76D42FA228F622449685399D6EABA14D", + "sdkPath": "c\\include\\10.0.26100.0\\um\\RadialControllerInterop.idl", + "sdkSha256": "FD6A57358A3B3527076A6D982C0BDCDC47B0150DD769962731E8C268B7EF9EEF" + }, + { + "path": "um\\IContact.h", + "sourceSha256": "B9E7611C0328B160E3E7B62AACECFCE82FACBB00681AD281730452322F9BFA13", + "sdkPath": "c\\include\\10.0.26100.0\\um\\IContact.idl", + "sdkSha256": "DCC9C8D2A58B422BF4515494C3028A366687DDC875F9250FAE574E1298DC6ABD" + }, + { + "path": "um\\contactaggregation.h", + "sourceSha256": "4D0949D0E0400070BE16C0B72C51A71AFBF7D5FD4EA0BFCC5E1B3798E079575A", + "sdkPath": "c\\include\\10.0.26100.0\\um\\contactaggregation.idl", + "sdkSha256": "20BA280603DD19B48AEF891596073769916317802F5A0AA21297F02350EE6159" + }, + { + "path": "um\\icontactproperties.h", + "sourceSha256": "19A449C82651190007CCC4B56AEBDEBF7CEB95251BBA60F30E4F619FDC64DB26", + "sdkPath": "c\\include\\10.0.26100.0\\um\\icontactproperties.h", + "sdkSha256": "19A449C82651190007CCC4B56AEBDEBF7CEB95251BBA60F30E4F619FDC64DB26" + }, + { + "path": "shared\\gnssdriver.h", + "sourceSha256": "EF03674C6ECA66C55D65F3C1AA6B419DDF24D76CD227EDA95B60AF1B356A8F11", + "sdkPath": "c\\include\\10.0.26100.0\\shared\\gnssdriver.h", + "sdkSha256": "EF03674C6ECA66C55D65F3C1AA6B419DDF24D76CD227EDA95B60AF1B356A8F11" + }, + { + "path": "um\\locationapi.h", + "sourceSha256": "565800816BE42A0B059BE0B5296C84E85F8FEF59E0E98CAD83BC6F7C5C935471", + "sdkPath": "c\\include\\10.0.26100.0\\um\\locationapi.h", + "sdkSha256": "565800816BE42A0B059BE0B5296C84E85F8FEF59E0E98CAD83BC6F7C5C935471" } ], "partitions": [ @@ -124,7 +166,11 @@ "Wsl", "Xinput", "SecurityCenter", - "WinSat" + "WinSat", + "Wcm", + "InputRadial", + "WinContacts", + "WinLocation" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -145,6 +191,10 @@ "post-midl\\um\\xinput.annotations.patch", "post-midl\\um\\iwscapi.annotations.patch", "post-midl\\um\\wscapi.annotations.patch", - "post-midl\\um\\winsatcominterfacei.annotations.patch" + "post-midl\\um\\winsatcominterfacei.annotations.patch", + "post-midl\\um\\wcmapi.annotations.patch", + "post-midl\\um\\radialcontrollerinterop.annotations.patch", + "post-midl\\um\\icontact.annotations.patch", + "post-midl\\um\\locationapi.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/um/icontact.annotations.patch b/generation/WinSDK/patches/post-midl/um/icontact.annotations.patch new file mode 100644 index 000000000..29d56331a --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/icontact.annotations.patch @@ -0,0 +1,51 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/IContact.h b/generation/WinSDK/RecompiledIdlHeaders/um/IContact.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/IContact.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/IContact.h +@@ -119,6 +119,7 @@ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + +@@ -142,6 +143,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ad553d98-deb1-474a-8e17-fc0c2075b738") ++ _Windows_SupportedOS_WindowsVista_ + IContactManager : public IUnknown + { + public: +@@ -306,6 +308,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("b6afa338-d779-11d9-8bde-f66bad1e3f3a") ++ _Windows_SupportedOS_WindowsVista_ + IContactCollection : public IUnknown + { + public: +@@ -412,6 +415,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("70dd27dd-5cbd-46e8-bef0-23b6b346288f") ++ _Windows_SupportedOS_WindowsVista_ + IContactProperties : public IUnknown + { + public: +@@ -775,6 +779,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F941B671-BDA7-4f77-884A-F46462F226A7") ++ _Windows_SupportedOS_WindowsVista_ + IContact : public IUnknown + { + public: +@@ -909,6 +914,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ffd3adf8-fa64-4328-b1b6-2e0db509cb3c") ++ _Windows_SupportedOS_WindowsVista_ + IContactPropertyCollection : public IUnknown + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/locationapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/locationapi.annotations.patch new file mode 100644 index 000000000..377d3dd2a --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/locationapi.annotations.patch @@ -0,0 +1,67 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/locationapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/locationapi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/locationapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/locationapi.h +@@ -255,6 +255,7 @@ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #include +@@ -291,6 +292,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C8B7F7EE-75D0-4db9-B62D-7A0F369CA456") ++ _Windows_SupportedOS_Windows7_ + ILocationReport : public IUnknown + { + public: +@@ -399,6 +401,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7FED806D-0EF8-4f07-80AC-36A0BEAE3134") ++ _Windows_SupportedOS_Windows7_ + ILatLongReport : public ILocationReport + { + public: +@@ -553,6 +556,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0B19F70-4ADF-445d-87F2-CAD8FD711792") ++ _Windows_SupportedOS_Windows7_ + ICivicAddressReport : public ILocationReport + { + public: +@@ -730,6 +734,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("AB2ECE69-56D9-4F28-B525-DE1B0EE44237") ++ _Windows_SupportedOS_Windows7_ + ILocation : public IUnknown + { + public: +@@ -924,6 +929,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("193E7729-AB6B-4b12-8617-7596E1BB191C") ++ _Windows_SupportedOS_Windows8_ + ILocationPower : public IUnknown + { + public: +@@ -1015,6 +1021,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A65AF77E-969A-4a2e-8ACA-33BB7CBB1235") ++ _Windows_SupportedOS_Windows7_ + IDefaultLocation : public IUnknown + { + public: +@@ -1114,6 +1121,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("CAE02BBF-798B-4508-A207-35A7906DC73D") ++ _Windows_SupportedOS_Windows7_ + ILocationEvents : public IUnknown + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/radialcontrollerinterop.annotations.patch b/generation/WinSDK/patches/post-midl/um/radialcontrollerinterop.annotations.patch new file mode 100644 index 000000000..b4eac1f67 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/radialcontrollerinterop.annotations.patch @@ -0,0 +1,27 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/RadialControllerInterop.h b/generation/WinSDK/RecompiledIdlHeaders/um/RadialControllerInterop.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/RadialControllerInterop.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/RadialControllerInterop.h +@@ -80,6 +80,7 @@ + /* [local] */ + + #include ++#include + #if (NTDDI_VERSION >= NTDDI_WIN10_RS1) + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -100,6 +101,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1B0535C9-57AD-45C1-9D79-AD5C34360513") ++ _Windows_SupportedOS_14393_ + IRadialControllerInterop : public IInspectable + { + public: +@@ -221,6 +223,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("787cdaac-3186-476d-87e4-b9374a7b9970") ++ _Windows_SupportedOS_14393_ + IRadialControllerConfigurationInterop : public IInspectable + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/wcmapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/wcmapi.annotations.patch new file mode 100644 index 000000000..863947c01 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/wcmapi.annotations.patch @@ -0,0 +1,43 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/wcmapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/wcmapi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/wcmapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/wcmapi.h +@@ -7,6 +7,7 @@ + #ifndef _WCMAPI_H + #define _WCMAPI_H + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -135,6 +136,7 @@ + + #ifndef __midl + ++ _Windows_SupportedOS_Windows8_ + DWORD WINAPI WcmQueryProperty( + _In_opt_ const GUID* pInterface, // NULL for global properties + _In_opt_ LPCWSTR strProfileName, +@@ -143,6 +145,7 @@ + _Out_ PDWORD pdwDataSize, + _Outptr_result_buffer_maybenull_(*pdwDataSize) PBYTE* ppData); + ++ _Windows_SupportedOS_Windows8_ + DWORD WINAPI WcmSetProperty( + _In_opt_ const GUID* pInterface, // NULL for global properties + _In_opt_ LPCWSTR strProfileName, +@@ -151,12 +154,15 @@ + _In_ DWORD dwDataSize, + _In_reads_opt_(dwDataSize) const BYTE* pbData); + ++ _Windows_SupportedOS_Windows8_ + DWORD WINAPI WcmGetProfileList(_Reserved_ void* pReserved, _Outptr_ WCM_PROFILE_INFO_LIST** ppProfileList); + + // Ethernet pseudo-profiles should not be included in pProfileList ++ _Windows_SupportedOS_Windows8_ + DWORD WINAPI WcmSetProfileList( + _In_ WCM_PROFILE_INFO_LIST* pProfileList, _In_ DWORD dwPosition, _In_ BOOL fIgnoreUnknownProfiles, _Reserved_ void* pReserved); + ++ _Windows_SupportedOS_Windows8_ + void WINAPI WcmFreeMemory(__deallocate(Mem) void* pMemory); + + #endif // not __midl diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 144fa27c1..7d1343e93 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -3846,11 +3846,6 @@ IcmpParseReplies=SupportedOSPlatform("windows5.0") IcmpSendEcho=SupportedOSPlatform("windows5.0") IcmpSendEcho2=SupportedOSPlatform("windows5.0") IcmpSendEcho2Ex=SupportedOSPlatform("windows6.0.6000") -IContact=SupportedOSPlatform("windows6.0.6000") -IContactCollection=SupportedOSPlatform("windows6.0.6000") -IContactManager=SupportedOSPlatform("windows6.0.6000") -IContactProperties=SupportedOSPlatform("windows6.0.6000") -IContactPropertyCollection=SupportedOSPlatform("windows6.0.6000") IContentPrefetcherTaskTrigger=SupportedOSPlatform("windows8.1") IAssociatedIdentityProvider=SupportedOSPlatform("windows6.1") IConnectedIdentityProvider=SupportedOSPlatform("windows8.0") @@ -4594,13 +4589,6 @@ LoadPerfCounterTextStringsA=SupportedOSPlatform("windows5.1.2600") LoadPerfCounterTextStringsW=SupportedOSPlatform("windows5.1.2600") UnloadPerfCounterTextStringsA=SupportedOSPlatform("windows5.1.2600") UnloadPerfCounterTextStringsW=SupportedOSPlatform("windows5.1.2600") -ICivicAddressReport=SupportedOSPlatform("windows6.1") -IDefaultLocation=SupportedOSPlatform("windows6.1") -ILatLongReport=SupportedOSPlatform("windows6.1") -ILocation=SupportedOSPlatform("windows6.1") -ILocationEvents=SupportedOSPlatform("windows6.1") -ILocationPower=SupportedOSPlatform("windows8.0") -ILocationReport=SupportedOSPlatform("windows6.1") CapabilitiesRequestAndCapabilitiesReply=SupportedOSPlatform("windows6.0.6000") GetCapabilitiesStringLength=SupportedOSPlatform("windows6.0.6000") GetTimingReport=SupportedOSPlatform("windows6.0.6000") @@ -8167,8 +8155,6 @@ QOSRemoveSocketFromFlow=SupportedOSPlatform("windows6.0.6000") QOSSetFlow=SupportedOSPlatform("windows6.0.6000") QOSStartTrackingClient=SupportedOSPlatform("windows6.0.6000") QOSStopTrackingClient=SupportedOSPlatform("windows6.0.6000") -IRadialControllerConfigurationInterop=SupportedOSPlatform("windows10.0.14393") -IRadialControllerInterop=SupportedOSPlatform("windows10.0.14393") RasClearConnectionStatistics=SupportedOSPlatform("windows5.0") RasClearLinkStatistics=SupportedOSPlatform("windows5.0") RasConnectionNotificationA=SupportedOSPlatform("windows5.0") @@ -12417,11 +12403,6 @@ IWbemProviderIdentity=SupportedOSPlatform("windows6.0.6000") IWbemProviderInit=SupportedOSPlatform("windows6.0.6000") IWbemProviderInitSink=SupportedOSPlatform("windows6.0.6000") IWbemUnboundObjectSink=SupportedOSPlatform("windows6.0.6000") -WcmFreeMemory=SupportedOSPlatform("windows8.0") -WcmGetProfileList=SupportedOSPlatform("windows8.0") -WcmQueryProperty=SupportedOSPlatform("windows8.0") -WcmSetProfileList=SupportedOSPlatform("windows8.0") -WcmSetProperty=SupportedOSPlatform("windows8.0") IItemEnumerator=SupportedOSPlatform("windows6.0.6000") ISettingsContext=SupportedOSPlatform("windows6.0.6000") ISettingsEngine=SupportedOSPlatform("windows6.0.6000") diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index 318958d97..5eed2add1 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -54,6 +54,45 @@ private static readonly (string Owner, string Member, string Enum, string Native }).ToArray(); private static readonly (string Namespace, string Owner, string Method, string Parameter)[] NativeRetvalUses = { + ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetAddressLine1", "pbstrAddress1"), + ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetAddressLine2", "pbstrAddress2"), + ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetCity", "pbstrCity"), + ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetCountryRegion", "pbstrCountryRegion"), + ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetDetailLevel", "pDetailLevel"), + ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetPostalCode", "pbstrPostalCode"), + ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetStateProvince", "pbstrStateProvince"), + ("Windows.Win32.Devices.Geolocation", "ICivicAddressReportFactory", "get_CivicAddressReport", "pVal"), + ("Windows.Win32.Devices.Geolocation", "IDefaultLocation", "GetReport", "ppLocationReport"), + ("Windows.Win32.Devices.Geolocation", "IDispCivicAddressReport", "get_AddressLine1", "pAddress1"), + ("Windows.Win32.Devices.Geolocation", "IDispCivicAddressReport", "get_AddressLine2", "pAddress2"), + ("Windows.Win32.Devices.Geolocation", "IDispCivicAddressReport", "get_City", "pCity"), + ("Windows.Win32.Devices.Geolocation", "IDispCivicAddressReport", "get_CountryRegion", "pCountryRegion"), + ("Windows.Win32.Devices.Geolocation", "IDispCivicAddressReport", "get_DetailLevel", "pDetailLevel"), + ("Windows.Win32.Devices.Geolocation", "IDispCivicAddressReport", "get_PostalCode", "pPostalCode"), + ("Windows.Win32.Devices.Geolocation", "IDispCivicAddressReport", "get_StateProvince", "pStateProvince"), + ("Windows.Win32.Devices.Geolocation", "IDispCivicAddressReport", "get_Timestamp", "pVal"), + ("Windows.Win32.Devices.Geolocation", "IDispLatLongReport", "get_Altitude", "pVal"), + ("Windows.Win32.Devices.Geolocation", "IDispLatLongReport", "get_AltitudeError", "pVal"), + ("Windows.Win32.Devices.Geolocation", "IDispLatLongReport", "get_ErrorRadius", "pVal"), + ("Windows.Win32.Devices.Geolocation", "IDispLatLongReport", "get_Latitude", "pVal"), + ("Windows.Win32.Devices.Geolocation", "IDispLatLongReport", "get_Longitude", "pVal"), + ("Windows.Win32.Devices.Geolocation", "IDispLatLongReport", "get_Timestamp", "pVal"), + ("Windows.Win32.Devices.Geolocation", "ILatLongReport", "GetAltitude", "pAltitude"), + ("Windows.Win32.Devices.Geolocation", "ILatLongReport", "GetAltitudeError", "pAltitudeError"), + ("Windows.Win32.Devices.Geolocation", "ILatLongReport", "GetErrorRadius", "pErrorRadius"), + ("Windows.Win32.Devices.Geolocation", "ILatLongReport", "GetLatitude", "pLatitude"), + ("Windows.Win32.Devices.Geolocation", "ILatLongReport", "GetLongitude", "pLongitude"), + ("Windows.Win32.Devices.Geolocation", "ILatLongReportFactory", "get_LatLongReport", "pVal"), + ("Windows.Win32.Devices.Geolocation", "ILocation", "GetDesiredAccuracy", "pDesiredAccuracy"), + ("Windows.Win32.Devices.Geolocation", "ILocation", "GetReport", "ppLocationReport"), + ("Windows.Win32.Devices.Geolocation", "ILocation", "GetReportInterval", "pMilliseconds"), + ("Windows.Win32.Devices.Geolocation", "ILocation", "GetReportStatus", "pStatus"), + ("Windows.Win32.Devices.Geolocation", "ILocationReport", "GetSensorID", "pSensorID"), + ("Windows.Win32.Devices.Geolocation", "ILocationReport", "GetTimestamp", "pCreationTime"), + ("Windows.Win32.Devices.Geolocation", "ILocationReport", "GetValue", "pValue"), + ("Windows.Win32.Devices.Geolocation", "ILocationReportFactory", "get_DesiredAccuracy", "pDesiredAccuracy"), + ("Windows.Win32.Devices.Geolocation", "ILocationReportFactory", "get_ReportInterval", "pMilliseconds"), + ("Windows.Win32.Devices.Geolocation", "ILocationReportFactory", "get_Status", "pVal"), ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Description", "description"), ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Score", "score"), ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Title", "title"), @@ -115,6 +154,7 @@ private static readonly (string Namespace, string Owner, string Method, string P "XInputGetAudioDeviceIds", "XInputGetBatteryInformation", "XInputGetKeystroke", "WscRegisterForChanges", "WscUnRegisterChanges", "WscRegisterForUserNotifications", "WscGetSecurityProviderHealth", "WscQueryAntiMalwareUri", "WscGetAntiMalwareUri", + "WcmQueryProperty", "WcmSetProperty", "WcmGetProfileList", "WcmSetProfileList", "WcmFreeMemory", }; private static readonly string[] AdditionalOwnedTypes = { @@ -125,6 +165,12 @@ private static readonly (string Namespace, string Owner, string Method, string P "IInitiateWinSATAssessment", "IProvideWinSATAssessmentInfo", "IProvideWinSATResultsInfo", "IProvideWinSATVisuals", "IQueryAllWinSATAssessments", "IQueryRecentWinSATAssessment", "IWinSATInitiateEvents", "IQueryOEMWinSATCustomization", + "IRadialControllerInterop", "IRadialControllerConfigurationInterop", + "IContact", "IContactManager", "IContactCollection", "IContactProperties", "IContactPropertyCollection", + "ILocationReport", "ILatLongReport", "ICivicAddressReport", "ILocation", + "ILocationPower", "IDefaultLocation", "ILocationEvents", + "IDispLatLongReport", "IDispCivicAddressReport", "ILocationReportFactory", + "ILatLongReportFactory", "ICivicAddressReportFactory", }; private static readonly string[] AdditionalLogicalEnums = { @@ -517,7 +563,8 @@ public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() File.ReadAllText(Path.Combine(project, "supportedOS.rsp"))); } foreach (string partition in new[] { "CEIP", "ApplicationVerifier", "MagApi", "PsApi1", "Time", "Ual", - "ToolHelp", "UpdateAssessment", "Wsl", "Xinput", "SecurityCenter", "WinSat" }) + "ToolHelp", "UpdateAssessment", "Wsl", "Xinput", "SecurityCenter", "WinSat", + "Wcm", "InputRadial", "WinContacts", "WinLocation" }) Assert.Contains("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); Assert.DoesNotContain("--with-librarypath", File.ReadAllText(Path.Combine(project, "Partitions", "Wsl", "settings.rsp"))); foreach (string partition in new[] { "PsApi2" }) From b61b71256b05d09c3a7f51cf7f823856ba6bbf2b Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 12:49:54 -0700 Subject: [PATCH 03/17] Migrate RDC, network lists, and COM header contracts Relocate 51 emitted OS floors and the approved IEnumEventObject.Reset result contract. Capture the original Nla retval and preserve exact physical and native architecture controls. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 40 ++++- .../Partitions/Com.CallObj/settings.rsp | 2 + .../WinSDK/Partitions/Com.Events/settings.rsp | 3 +- generation/WinSDK/Partitions/Nla/settings.rsp | 2 + generation/WinSDK/Partitions/Rdc/settings.rsp | 2 + generation/WinSDK/emitter.settings.rsp | 1 - ...HeaderAnnotations.expected-differences.txt | 3 + generation/WinSDK/patches/SdkHeaders.json | 39 ++++- .../post-midl/um/callobj.annotations.patch | 67 ++++++++ .../post-midl/um/eventsys.annotations.patch | 139 +++++++++++++++++ .../post-midl/um/msrdc.annotations.patch | 147 ++++++++++++++++++ .../post-midl/um/netlistmgr.annotations.patch | 107 +++++++++++++ generation/WinSDK/supportedOS.rsp | 51 ------ .../WinHttpMigrationTests.cs | 77 ++++++++- 14 files changed, 616 insertions(+), 64 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/um/callobj.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/eventsys.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/msrdc.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/netlistmgr.annotations.patch diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index fc042bbd9..7930aba16 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -420,7 +420,45 @@ patches: Wcm 5, InputRadial 2, WinContacts 5 and WinLocation 7. Exact native `ILocationReport.GetTimestamp.pCreationTime` and `ILocation.GetReport.ppLocationReport`. WinContacts' injected source annotations repeat final metadata already supplied by SAL; source occurrence counts are not -new final-attribute counts. Checkpoint two's full-image grade remains pending. +new final-attribute counts. The verified second checkpoint is producer +`7f7dd082e6d9ecf6b308620e5bf2b41c85541543`, image SHA256 +`8EDA57048DC25ED5C97844991B17CEE94B498005E941000EB6D1A14B9EAC7A02`. +Its strict first-checkpoint delta is 39; B9-CI-to-checkpoint is 67 and cumulative +OLD-to-checkpoint is 115, each with zero unknown and zero unused expectations. +All physical types and enum identities remain unchanged. Actual execution is +26 preparation/retval/ownership, 63 native architecture, 26 physical/no-fallback/ +mutation and 14 full-SDK cases, with zero skipped. Its immutable receipt is +`artifacts\next-header-annotation-wave\checkpoint2-review-grade.json`, SHA256 +`06BF5961603134C7AE57FC0B145065FD50CB846AFF5E2D5D9332038186EECEAE`. + +Checkpoint three relocates another 51 emitted OS floors: Rdc 17, Nla 12, +Com.CallObj 7 and Com.Events 15. Four ordinary per-header patches preserve all +existing declarations. The original `netlistmgr.h:1860` MIDL +`/* [retval][out] */ __RPC__out BOOL *pValue` contract identifies the single additional +site `INetworkConnection2.IsDomainAuthenticatedBy.pValue`. Com.Events' source +injections repeat final SAL-derived attributes rather than introducing new ones. +ComOle, WindowsConnectionManager and TransactionServer join the preparation and +native-control closure as explicitly opted-out physical-header dependents. + +Com.Events also relocates the existing +`IEnumEventObject::Reset=[CanReturnMultipleSuccessValues]` authored contract to +`_Win32_PreserveResult_` on the same native method in `EventSys.h`. The explicitly +review-approved representation removes that legacy custom attribute and sets the +CLI `MethodImplAttributes.PreserveSig` bit. This is an authored-fact representation +change, not a newly discovered native annotation or a conflicting SDK contract. +The existing reader and vocabulary already support it; no tooling expansion is +needed. It has its own exact declaration expectation and physical checks on x86, +x64 and arm64. HRESULT, signature and vtable order stay unchanged; fresh consumer +compatibility remains **UNVERIFIED**. + +The bounded wave therefore relocates 82 OS floors, one existing association and +one existing success-value contract through 11 patches; it does not author new +enum representations or library overrides. The exact expected native additions +are SecurityCenter 16, WinSat 12, WinLocation 39 and Nla 1. B9-to-final expectations +are 68 native additions plus the single reviewed preserved-result representation; +the cumulative OLD-to-final total is 117, including the 48 enum representation +differences from the preceding reviewed layer, not this new wave. Final-checkpoint +local and actual CI grades are still pending. The existing image helper now relocates a copied frozen traversal map to its owning worktree and prepared headers. It verifies one original SDK project root, diff --git a/generation/WinSDK/Partitions/Com.CallObj/settings.rsp b/generation/WinSDK/Partitions/Com.CallObj/settings.rsp index 7b29d3aa9..f41db59a2 100644 --- a/generation/WinSDK/Partitions/Com.CallObj/settings.rsp +++ b/generation/WinSDK/Partitions/Com.CallObj/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --exclude _GUID --traverse diff --git a/generation/WinSDK/Partitions/Com.Events/settings.rsp b/generation/WinSDK/Partitions/Com.Events/settings.rsp index 672c0a414..ea2b37bda 100644 --- a/generation/WinSDK/Partitions/Com.Events/settings.rsp +++ b/generation/WinSDK/Partitions/Com.Events/settings.rsp @@ -1,7 +1,8 @@ +--config +parse-win32-annotations --exclude IResourceManagerXXX --traverse /um/EventSys.h --namespace Windows.Win32.System.Com.Events - diff --git a/generation/WinSDK/Partitions/Nla/settings.rsp b/generation/WinSDK/Partitions/Nla/settings.rsp index 576f1c7c5..ba3202936 100644 --- a/generation/WinSDK/Partitions/Nla/settings.rsp +++ b/generation/WinSDK/Partitions/Nla/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/netlistmgr.h --namespace diff --git a/generation/WinSDK/Partitions/Rdc/settings.rsp b/generation/WinSDK/Partitions/Rdc/settings.rsp index f3f243c0d..7b3212904 100644 --- a/generation/WinSDK/Partitions/Rdc/settings.rsp +++ b/generation/WinSDK/Partitions/Rdc/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/msrdc.h --namespace diff --git a/generation/WinSDK/emitter.settings.rsp b/generation/WinSDK/emitter.settings.rsp index aa9b237b7..e9d5fc007 100644 --- a/generation/WinSDK/emitter.settings.rsp +++ b/generation/WinSDK/emitter.settings.rsp @@ -1827,7 +1827,6 @@ IEnumConnectionPoints::Next=[CanReturnMultipleSuccessValues] IEnumOleUndoUnits::Next=[CanReturnMultipleSuccessValues] IEnumFORMATETC::Next=[CanReturnMultipleSuccessValues] IEnumConnections::Next=[CanReturnMultipleSuccessValues] -IEnumEventObject::Reset=[CanReturnMultipleSuccessValues] IPinConnection::IsEndPin=[CanReturnMultipleSuccessValues] IBitsPeerCacheAdministration::SetMaximumContentAge=[CanReturnMultipleSuccessValues] IMoniker::IsEqual=[CanReturnMultipleSuccessValues] diff --git a/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt b/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt index 6503da4f2..6589f7660 100644 --- a/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt +++ b/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt @@ -118,3 +118,6 @@ Windows.Win32.Devices.Geolocation.ILocationReport.GetValue : parameter 2 (pValue Windows.Win32.Devices.Geolocation.ILocationReportFactory.get_DesiredAccuracy : parameter 1 (pDesiredAccuracy) : [Out] => [Out,RetVal] Windows.Win32.Devices.Geolocation.ILocationReportFactory.get_ReportInterval : parameter 1 (pMilliseconds) : [Out] => [Out,RetVal] Windows.Win32.Devices.Geolocation.ILocationReportFactory.get_Status : parameter 1 (pVal) : [Out] => [Out,RetVal] +Windows.Win32.Networking.NetworkListManager.INetworkConnection2.IsDomainAuthenticatedBy : parameter 2 (pValue) : [Out] => [Out,RetVal] +# Review-approved authored-result representation, not native annotation discovery. +Windows.Win32.System.Com.Events.IEnumEventObject.Reset : [CanReturnMultipleSuccessValues,Documentation(https://learn.microsoft.com/windows/win32/api/eventsys/nf-eventsys-ienumeventobject-reset)] => [Documentation(https://learn.microsoft.com/windows/win32/api/eventsys/nf-eventsys-ienumeventobject-reset),PreserveSig] diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index 912d86d2b..5ba8bb533 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -147,6 +147,30 @@ "sourceSha256": "565800816BE42A0B059BE0B5296C84E85F8FEF59E0E98CAD83BC6F7C5C935471", "sdkPath": "c\\include\\10.0.26100.0\\um\\locationapi.h", "sdkSha256": "565800816BE42A0B059BE0B5296C84E85F8FEF59E0E98CAD83BC6F7C5C935471" + }, + { + "path": "um\\msrdc.h", + "sourceSha256": "F5D0B91C185535A176E91A5D8F2076BB4124EA76DE5D8E4A7FB814CF65CDD19D", + "sdkPath": "c\\include\\10.0.26100.0\\um\\msrdc.idl", + "sdkSha256": "4470145098F210805D6893F68D438911C647FE814B5E7E3138C2BFC6453C2177" + }, + { + "path": "um\\netlistmgr.h", + "sourceSha256": "61D5529E64622D1B47C8BC1700FDA8EABA6818A4B76DCC7CE1575D41DCF87AAF", + "sdkPath": "c\\include\\10.0.26100.0\\um\\netlistmgr.idl", + "sdkSha256": "C334776532B435450D5DA0E0EF4F92B5A8B639B13E737221CC1B47A5787D8E54" + }, + { + "path": "um\\callobj.h", + "sourceSha256": "ABAC062F0ADDAF42B97B72BA556785169ECBA23188015423A460BA7A5AF3B305", + "sdkPath": "c\\include\\10.0.26100.0\\um\\callobj.idl", + "sdkSha256": "CEF9673107F25AEEC0FDD86A62F69A4C897D2455603F6E95D4E3A8F1DD4EEFC0" + }, + { + "path": "um\\EventSys.h", + "sourceSha256": "4F728FEF9AA5666482B448DCDCB908078429ACE810C388D430EEB46C17824016", + "sdkPath": "c\\include\\10.0.26100.0\\um\\EventSys.idl", + "sdkSha256": "FB9D8FCAB51FF13E259E06D4B899FE12C2399557FA16827F2876B6451028D728" } ], "partitions": [ @@ -170,7 +194,14 @@ "Wcm", "InputRadial", "WinContacts", - "WinLocation" + "WinLocation", + "Rdc", + "Nla", + "Com.CallObj", + "Com.Events", + "ComOle", + "WindowsConnectionManager", + "TransactionServer" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -195,6 +226,10 @@ "post-midl\\um\\wcmapi.annotations.patch", "post-midl\\um\\radialcontrollerinterop.annotations.patch", "post-midl\\um\\icontact.annotations.patch", - "post-midl\\um\\locationapi.annotations.patch" + "post-midl\\um\\locationapi.annotations.patch", + "post-midl\\um\\msrdc.annotations.patch", + "post-midl\\um\\netlistmgr.annotations.patch", + "post-midl\\um\\callobj.annotations.patch", + "post-midl\\um\\eventsys.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/um/callobj.annotations.patch b/generation/WinSDK/patches/post-midl/um/callobj.annotations.patch new file mode 100644 index 000000000..0c30e9b8c --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/callobj.annotations.patch @@ -0,0 +1,67 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/callobj.h b/generation/WinSDK/RecompiledIdlHeaders/um/callobj.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/callobj.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/callobj.h +@@ -108,6 +108,7 @@ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + +@@ -199,6 +200,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D573B4B0-894E-11d2-B8B6-00C04FB9618A") ++ _Windows_SupportedOS_Windows2000_ + ICallFrame : public IUnknown + { + public: +@@ -642,6 +644,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D573B4B1-894E-11d2-B8B6-00C04FB9618A") ++ _Windows_SupportedOS_Windows2000_ + ICallIndirect : public IUnknown + { + public: +@@ -804,6 +807,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("60C7CA75-896D-11d2-B8B6-00C04FB9618A") ++ _Windows_SupportedOS_Windows2000_ + ICallInterceptor : public ICallIndirect + { + public: +@@ -959,6 +963,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("FD5E0843-FC91-11d0-97D7-00C04FB9618A") ++ _Windows_SupportedOS_Windows2000_ + ICallFrameEvents : public IUnknown + { + public: +@@ -1046,6 +1051,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5333B003-2E42-11d2-B89D-00C04FB9618A") ++ _Windows_SupportedOS_Windows2000_ + ICallUnmarshal : public IUnknown + { + public: +@@ -1194,6 +1200,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("08B23919-392D-11d2-B8A4-00C04FB9618A") ++ _Windows_SupportedOS_Windows2000_ + ICallFrameWalker : public IUnknown + { + public: +@@ -1397,6 +1404,7 @@ + /* interface ICallFrameAPIs */ + /* [local][uuid] */ + ++_Windows_SupportedOS_Windows2000_ + HRESULT __stdcall CoGetInterceptor( + /* [annotation][in] */ + _In_ REFIID iidIntercepted, diff --git a/generation/WinSDK/patches/post-midl/um/eventsys.annotations.patch b/generation/WinSDK/patches/post-midl/um/eventsys.annotations.patch new file mode 100644 index 000000000..b8a400f49 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/eventsys.annotations.patch @@ -0,0 +1,139 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/EventSys.h b/generation/WinSDK/RecompiledIdlHeaders/um/EventSys.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/EventSys.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/EventSys.h +@@ -244,6 +244,7 @@ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #define PROGID_EventSystem OLESTR("EventSystem.EventSystem") +@@ -280,6 +281,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4E14FB9F-2E22-11D1-9964-00C04FBBB345") ++ _Windows_SupportedOS_Windows2000_ + IEventSystem : public IDispatch + { + public: +@@ -533,6 +535,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("E341516B-2E32-11D1-9964-00C04FBBB345") ++ _Windows_SupportedOS_Windows2000_ + IEventPublisher : public IDispatch + { + public: +@@ -859,6 +862,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("fb2b72a0-7a68-11d1-88f9-0080c7d771bf") ++ _Windows_SupportedOS_Windows2000_ + IEventClass : public IDispatch + { + public: +@@ -1177,6 +1181,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("fb2b72a1-7a68-11d1-88f9-0080c7d771bf") ++ _Windows_SupportedOS_Windows2000_ + IEventClass2 : public IEventClass + { + public: +@@ -1544,6 +1549,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4A6B0E15-2E38-11D1-9965-00C04FBBB345") ++ _Windows_SupportedOS_Windows2000_ + IEventSubscription : public IDispatch + { + public: +@@ -2138,6 +2144,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e0498c93-4efe-11d1-9971-00c04fbbb345") ++ _Windows_SupportedOS_Windows2000_ + IFiringControl : public IDispatch + { + public: +@@ -2290,6 +2297,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("465e5cc0-7b26-11d1-88fb-0080c7d771bf") ++ _Windows_SupportedOS_Windows2000_ + IPublisherFilter : public IUnknown + { + public: +@@ -2398,6 +2406,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("465e5cc1-7b26-11d1-88fb-0080c7d771bf") ++ _Windows_SupportedOS_Windows2000_ + IMultiInterfacePublisherFilter : public IUnknown + { + public: +@@ -2514,6 +2523,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F4A07D70-2E25-11D1-9964-00C04FBBB345") ++ _Windows_SupportedOS_Windows2000_ + IEventObjectChange : public IUnknown + { + public: +@@ -2660,6 +2670,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7701A9C3-BD68-438f-83E0-67BF4F53A422") ++ _Windows_SupportedOS_Windows2000_ + IEventObjectChange2 : public IUnknown + { + public: +@@ -2760,6 +2771,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F4A07D63-2E25-11D1-9964-00C04FBBB345") ++ _Windows_SupportedOS_Windows2000_ + IEnumEventObject : public IUnknown + { + public: +@@ -2775,6 +2787,7 @@ + /* [annotation][out] */ + _Out_ ULONG *cRetElem) = 0; + ++ _Win32_PreserveResult_ + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Skip( +@@ -2890,6 +2903,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f89ac270-d4eb-11d1-b682-00805fc79216") ++ _Windows_SupportedOS_Windows2000_ + IEventObjectCollection : public IDispatch + { + public: +@@ -3112,6 +3126,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("da538ee2-f4de-11d1-b6bb-00805fc79216") ++ _Windows_SupportedOS_Windows2000_ + IEventProperty : public IDispatch + { + public: +@@ -3303,6 +3318,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0343e2f4-86f6-11d1-b760-00c04fb926af") ++ _Windows_SupportedOS_Windows2000_ + IEventControl : public IDispatch + { + public: +@@ -3528,6 +3544,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0343e2f5-86f6-11d1-b760-00c04fb926af") ++ _Windows_SupportedOS_Windows2000_ + IMultiInterfaceEventControl : public IUnknown + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/msrdc.annotations.patch b/generation/WinSDK/patches/post-midl/um/msrdc.annotations.patch new file mode 100644 index 000000000..4b08e9990 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/msrdc.annotations.patch @@ -0,0 +1,147 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/msrdc.h b/generation/WinSDK/RecompiledIdlHeaders/um/msrdc.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/msrdc.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/msrdc.h +@@ -371,6 +371,7 @@ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #define RDCE_TABLE_FULL ( 0x80040001 ) +@@ -533,6 +534,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A71-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcGeneratorParameters : public IUnknown + { + public: +@@ -671,6 +673,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A72-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcGeneratorFilterMaxParameters : public IUnknown + { + public: +@@ -797,6 +800,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A73-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcGenerator : public IUnknown + { + public: +@@ -921,6 +925,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A74-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcFileReader : public IUnknown + { + public: +@@ -1050,6 +1055,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A75-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcFileWriter : public IRdcFileReader + { + public: +@@ -1199,6 +1205,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A76-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcSignatureReader : public IUnknown + { + public: +@@ -1303,6 +1310,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A77-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcComparator : public IUnknown + { + public: +@@ -1406,6 +1414,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A78-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcLibrary : public IUnknown + { + public: +@@ -1615,6 +1624,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A7A-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + ISimilarityReportProgress : public IUnknown + { + public: +@@ -1702,6 +1712,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A7B-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + ISimilarityTableDumpState : public IUnknown + { + public: +@@ -1801,6 +1812,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A7C-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + ISimilarityTraitsMappedView : public IUnknown + { + public: +@@ -1935,6 +1947,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A7D-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + ISimilarityTraitsMapping : public IUnknown + { + public: +@@ -2128,6 +2141,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A7E-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + ISimilarityTraitsTable : public IUnknown + { + public: +@@ -2331,6 +2345,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A7F-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + ISimilarityFileIdTable : public IUnknown + { + public: +@@ -2530,6 +2545,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A80-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IRdcSimilarityGenerator : public IUnknown + { + public: +@@ -2626,6 +2642,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A81-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + IFindSimilarResults : public IUnknown + { + public: +@@ -2730,6 +2747,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("96236A83-9DBC-11DA-9E3F-0011114AE311") ++ _Windows_SupportedOS_WindowsVista_ + ISimilarity : public IUnknown + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/netlistmgr.annotations.patch b/generation/WinSDK/patches/post-midl/um/netlistmgr.annotations.patch new file mode 100644 index 000000000..1d515b698 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/netlistmgr.annotations.patch @@ -0,0 +1,107 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/netlistmgr.h b/generation/WinSDK/RecompiledIdlHeaders/um/netlistmgr.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/netlistmgr.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/netlistmgr.h +@@ -179,6 +179,7 @@ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + +@@ -327,6 +328,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00000-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_WindowsVista_ + INetworkListManager : public IDispatch + { + public: +@@ -588,6 +590,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00001-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_WindowsVista_ + INetworkListManagerEvents : public IUnknown + { + public: +@@ -683,6 +686,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00002-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_WindowsVista_ + INetwork : public IDispatch + { + public: +@@ -1277,6 +1281,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00003-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_WindowsVista_ + IEnumNetworks : public IDispatch + { + public: +@@ -1490,6 +1495,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00004-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_WindowsVista_ + INetworkEvents : public IUnknown + { + public: +@@ -1624,6 +1630,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00005-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_WindowsVista_ + INetworkConnection : public IDispatch + { + public: +@@ -2066,6 +2073,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00006-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_WindowsVista_ + IEnumNetworkConnections : public IDispatch + { + public: +@@ -2275,6 +2283,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00007-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_WindowsVista_ + INetworkConnectionEvents : public IUnknown + { + public: +@@ -2383,6 +2392,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00008-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_Windows8_ + INetworkCostManager : public IUnknown + { + public: +@@ -2510,6 +2520,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB00009-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_Windows8_ + INetworkCostManagerEvents : public IUnknown + { + public: +@@ -2614,6 +2625,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB0000a-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_Windows8_ + INetworkConnectionCost : public IUnknown + { + public: +@@ -2714,6 +2726,7 @@ + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DCB0000b-570F-4A9B-8D69-199FDBA5723B") ++ _Windows_SupportedOS_Windows8_ + INetworkConnectionCostEvents : public IUnknown + { + public: diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 7d1343e93..708e855f4 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -476,13 +476,6 @@ BluetoothGATTRegisterEvent=SupportedOSPlatform("windows8.0") BluetoothGATTSetCharacteristicValue=SupportedOSPlatform("windows8.0") BluetoothGATTSetDescriptorValue=SupportedOSPlatform("windows8.0") BluetoothGATTUnregisterEvent=SupportedOSPlatform("windows8.0") -CoGetInterceptor=SupportedOSPlatform("windows5.0") -ICallFrame=SupportedOSPlatform("windows5.0") -ICallFrameEvents=SupportedOSPlatform("windows5.0") -ICallFrameWalker=SupportedOSPlatform("windows5.0") -ICallIndirect=SupportedOSPlatform("windows5.0") -ICallInterceptor=SupportedOSPlatform("windows5.0") -ICallUnmarshal=SupportedOSPlatform("windows5.0") ICameraUIControl=SupportedOSPlatform("windows8.0") ICameraUIControlEventCallback=SupportedOSPlatform("windows8.0") ICertificateEnrollmentPolicyServerSetup=SupportedOSPlatform("windows6.1") @@ -3061,21 +3054,6 @@ EcRetrySubscription=SupportedOSPlatform("windows6.0.6000") EcSaveSubscription=SupportedOSPlatform("windows6.0.6000") EcSetObjectArrayProperty=SupportedOSPlatform("windows6.0.6000") EcSetSubscriptionProperty=SupportedOSPlatform("windows6.0.6000") -IEnumEventObject=SupportedOSPlatform("windows5.0") -IEventClass=SupportedOSPlatform("windows5.0") -IEventClass2=SupportedOSPlatform("windows5.0") -IEventControl=SupportedOSPlatform("windows5.0") -IEventObjectChange=SupportedOSPlatform("windows5.0") -IEventObjectChange2=SupportedOSPlatform("windows5.0") -IEventObjectCollection=SupportedOSPlatform("windows5.0") -IEventProperty=SupportedOSPlatform("windows5.0") -IEventPublisher=SupportedOSPlatform("windows5.0") -IEventSubscription=SupportedOSPlatform("windows5.0") -IEventSystem=SupportedOSPlatform("windows5.0") -IFiringControl=SupportedOSPlatform("windows5.0") -IMultiInterfaceEventControl=SupportedOSPlatform("windows5.0") -IMultiInterfacePublisherFilter=SupportedOSPlatform("windows5.0") -IPublisherFilter=SupportedOSPlatform("windows5.0") EventAccessControl=SupportedOSPlatform("windows6.0.6000") EventAccessQuery=SupportedOSPlatform("windows6.0.6000") EventAccessRemove=SupportedOSPlatform("windows6.0.6000") @@ -6354,23 +6332,6 @@ IOpcSignatureRelationshipReferenceEnumerator=SupportedOSPlatform("windows6.1") IOpcSignatureRelationshipReferenceSet=SupportedOSPlatform("windows6.1") IOpcSigningOptions=SupportedOSPlatform("windows6.1") IOpcUri=SupportedOSPlatform("windows6.1") -IFindSimilarResults=SupportedOSPlatform("windows6.0.6000") -IRdcComparator=SupportedOSPlatform("windows6.0.6000") -IRdcFileReader=SupportedOSPlatform("windows6.0.6000") -IRdcFileWriter=SupportedOSPlatform("windows6.0.6000") -IRdcGenerator=SupportedOSPlatform("windows6.0.6000") -IRdcGeneratorFilterMaxParameters=SupportedOSPlatform("windows6.0.6000") -IRdcGeneratorParameters=SupportedOSPlatform("windows6.0.6000") -IRdcLibrary=SupportedOSPlatform("windows6.0.6000") -IRdcSignatureReader=SupportedOSPlatform("windows6.0.6000") -IRdcSimilarityGenerator=SupportedOSPlatform("windows6.0.6000") -ISimilarity=SupportedOSPlatform("windows6.0.6000") -ISimilarityFileIdTable=SupportedOSPlatform("windows6.0.6000") -ISimilarityReportProgress=SupportedOSPlatform("windows6.0.6000") -ISimilarityTableDumpState=SupportedOSPlatform("windows6.0.6000") -ISimilarityTraitsMappedView=SupportedOSPlatform("windows6.0.6000") -ISimilarityTraitsMapping=SupportedOSPlatform("windows6.0.6000") -ISimilarityTraitsTable=SupportedOSPlatform("windows6.0.6000") CryptSIPAddProvider=SupportedOSPlatform("windows5.1.2600") CryptSIPCreateIndirectData=SupportedOSPlatform("windows5.1.2600") CryptSIPGetCaps=SupportedOSPlatform("windows8.0") @@ -6592,18 +6553,6 @@ SetIpForwardEntry2=SupportedOSPlatform("windows6.0.6000") SetIpInterfaceEntry=SupportedOSPlatform("windows6.0.6000") SetIpNetEntry2=SupportedOSPlatform("windows6.0.6000") SetUnicastIpAddressEntry=SupportedOSPlatform("windows6.0.6000") -IEnumNetworkConnections=SupportedOSPlatform("windows6.0.6000") -IEnumNetworks=SupportedOSPlatform("windows6.0.6000") -INetwork=SupportedOSPlatform("windows6.0.6000") -INetworkConnection=SupportedOSPlatform("windows6.0.6000") -INetworkConnectionCost=SupportedOSPlatform("windows8.0") -INetworkConnectionCostEvents=SupportedOSPlatform("windows8.0") -INetworkConnectionEvents=SupportedOSPlatform("windows6.0.6000") -INetworkCostManager=SupportedOSPlatform("windows8.0") -INetworkCostManagerEvents=SupportedOSPlatform("windows8.0") -INetworkEvents=SupportedOSPlatform("windows6.0.6000") -INetworkListManager=SupportedOSPlatform("windows6.0.6000") -INetworkListManagerEvents=SupportedOSPlatform("windows6.0.6000") MatchEnumTag=SupportedOSPlatform("windows5.1.2600") MatchToken=SupportedOSPlatform("windows5.1.2600") PreprocessCommand=SupportedOSPlatform("windows5.1.2600") diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index 5eed2add1..85966c095 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -93,6 +93,7 @@ private static readonly (string Namespace, string Owner, string Method, string P ("Windows.Win32.Devices.Geolocation", "ILocationReportFactory", "get_DesiredAccuracy", "pDesiredAccuracy"), ("Windows.Win32.Devices.Geolocation", "ILocationReportFactory", "get_ReportInterval", "pMilliseconds"), ("Windows.Win32.Devices.Geolocation", "ILocationReportFactory", "get_Status", "pVal"), + ("Windows.Win32.Networking.NetworkListManager", "INetworkConnection2", "IsDomainAuthenticatedBy", "pValue"), ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Description", "description"), ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Score", "score"), ("Windows.Win32.System.AssessmentTool", "IProvideWinSATAssessmentInfo", "get_Title", "title"), @@ -122,6 +123,8 @@ private static readonly (string Namespace, string Owner, string Method, string P ("Windows.Win32.System.SecurityCenter", "IWSCProductList", "get_Count", "pVal"), ("Windows.Win32.System.SecurityCenter", "IWSCProductList", "get_Item", "pVal"), }; + private static readonly (string Namespace, string Owner, string Method) ReviewedPreservedResult = + ("Windows.Win32.System.Com.Events", "IEnumEventObject", "Reset"); private static readonly string[] AdditionalOwnedMethods = { "CeipIsOptedIn", @@ -155,6 +158,7 @@ private static readonly (string Namespace, string Owner, string Method, string P "WscRegisterForChanges", "WscUnRegisterChanges", "WscRegisterForUserNotifications", "WscGetSecurityProviderHealth", "WscQueryAntiMalwareUri", "WscGetAntiMalwareUri", "WcmQueryProperty", "WcmSetProperty", "WcmGetProfileList", "WcmSetProfileList", "WcmFreeMemory", + "CoGetInterceptor", }; private static readonly string[] AdditionalOwnedTypes = { @@ -171,6 +175,18 @@ private static readonly (string Namespace, string Owner, string Method, string P "ILocationPower", "IDefaultLocation", "ILocationEvents", "IDispLatLongReport", "IDispCivicAddressReport", "ILocationReportFactory", "ILatLongReportFactory", "ICivicAddressReportFactory", + "IRdcGeneratorParameters", "IRdcGeneratorFilterMaxParameters", "IRdcGenerator", + "IRdcFileReader", "IRdcFileWriter", "IRdcSignatureReader", "IRdcComparator", "IRdcLibrary", + "ISimilarityReportProgress", "ISimilarityTableDumpState", "ISimilarityTraitsMappedView", + "ISimilarityTraitsMapping", "ISimilarityTraitsTable", "ISimilarityFileIdTable", + "IRdcSimilarityGenerator", "IFindSimilarResults", "ISimilarity", + "INetworkListManager", "INetworkListManagerEvents", "INetwork", "IEnumNetworks", "INetworkEvents", + "INetworkConnection", "INetworkConnection2", "IEnumNetworkConnections", "INetworkConnectionEvents", + "INetworkCostManager", "INetworkCostManagerEvents", "INetworkConnectionCost", "INetworkConnectionCostEvents", + "ICallFrame", "ICallIndirect", "ICallInterceptor", "ICallFrameEvents", "ICallUnmarshal", "ICallFrameWalker", + "IEventSystem", "IEventPublisher", "IEventClass", "IEventClass2", "IEventSubscription", "IFiringControl", + "IPublisherFilter", "IMultiInterfacePublisherFilter", "IEventObjectChange", "IEventObjectChange2", + "IEnumEventObject", "IEventObjectCollection", "IEventProperty", "IEventControl", "IMultiInterfaceEventControl", }; private static readonly string[] AdditionalLogicalEnums = { @@ -239,11 +255,12 @@ public void EveryPhysicalTypeHasOnlyReviewedHeaderChanges() Assert.Equal(before.Keys.OrderBy(value => value), after.Keys.OrderBy(value => value)); var used = new HashSet(StringComparer.Ordinal); var usedRetvals = new HashSet(StringComparer.Ordinal); + var usedPreservedResults = new HashSet(StringComparer.Ordinal); int unchanged = 0; foreach (var entry in before) { string expected = SnapshotType(control.Reader, entry.Value, normalizeReviewedChanges: true, - usedEnumSites: used, usedRetvalSites: usedRetvals); + usedEnumSites: used, usedRetvalSites: usedRetvals, usedPreservedResultSites: usedPreservedResults); string actual = SnapshotType(current.Reader, after[entry.Key]); Assert.True(expected == actual, $"Unexpected physical metadata change in {entry.Key}.\nExpected:\n{expected}\nActual:\n{actual}"); unchanged += SnapshotType(control.Reader, entry.Value) == actual ? 1 : 0; @@ -251,8 +268,11 @@ public void EveryPhysicalTypeHasOnlyReviewedHeaderChanges() Assert.Equal(ReviewedEnumUses.Select(value => value.Site).OrderBy(value => value), used.OrderBy(value => value)); Assert.Equal(NativeRetvalUses.Select(value => $"{value.Namespace}.{value.Owner}.{value.Method}.{value.Parameter}") .OrderBy(value => value), usedRetvals.OrderBy(value => value)); + Assert.Equal(new[] { $"{ReviewedPreservedResult.Namespace}.{ReviewedPreservedResult.Owner}.{ReviewedPreservedResult.Method}" }, + usedPreservedResults.OrderBy(value => value)); this.output.WriteLine($"All {before.Count} physical types graded: {unchanged} unchanged; " + - $"{used.Count} exact native-type/AssociatedEnum sites and {usedRetvals.Count} native MIDL retval sites normalized."); + $"{used.Count} exact native-type/AssociatedEnum sites, {usedRetvals.Count} native MIDL retval sites " + + $"and {usedPreservedResults.Count} reviewed preserved-result site normalized."); } [MigrationTheory] @@ -282,6 +302,30 @@ public void NativeMidlRetvalsReachEveryPhysicalArchitectureWithoutChangingCliFla this.output.WriteLine($"{NativeRetvalUses.Length} exact native MIDL RetValAttribute additions on architecture {architecture}; CLI parameter flags and signatures unchanged."); } + [MigrationTheory] + [InlineData(1)] + [InlineData(2)] + [InlineData(4)] + public void ReviewedPreservedResultReplacesOnlyTheLegacySuccessAttribute(int architecture) + { + using var old = Open("WINHTTP_MIGRATION_OLD"); + using var current = Open("WINHTTP_MIGRATION_NEW"); + var use = ReviewedPreservedResult; + var before = Methods(old.Reader, use.Namespace, use.Owner, architecture)[use.Method]; + var after = Methods(current.Reader, use.Namespace, use.Owner, architecture)[use.Method]; + Assert.Equal(Signature(before.DecodeSignature(Signatures, null)), Signature(after.DecodeSignature(Signatures, null))); + Assert.Equal(before.Attributes, after.Attributes); + Assert.False(before.ImplAttributes.HasFlag(MethodImplAttributes.PreserveSig)); + Assert.Equal(before.ImplAttributes | MethodImplAttributes.PreserveSig, after.ImplAttributes); + var attribute = Assert.Single(before.GetCustomAttributes() + .Where(handle => AttributeName(old.Reader, handle) == "CanReturnMultipleSuccessValuesAttribute")); + Assert.Equal(new byte[] { 1, 0, 0, 0 }, old.Reader.GetBlobBytes(old.Reader.GetCustomAttribute(attribute).Value)); + Assert.DoesNotContain(after.GetCustomAttributes(), handle => AttributeName(current.Reader, handle) + is "CanReturnMultipleSuccessValuesAttribute" or "CanReturnErrorsAsSuccessAttribute" or "PreserveSigAttribute"); + this.output.WriteLine($"IEnumEventObject.Reset/{architecture}: reviewed legacy custom attribute removed; " + + "CLI PreserveSig set; signature and method flags unchanged."); + } + [MigrationTheory] [InlineData(1)] [InlineData(2)] @@ -564,10 +608,11 @@ public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() } foreach (string partition in new[] { "CEIP", "ApplicationVerifier", "MagApi", "PsApi1", "Time", "Ual", "ToolHelp", "UpdateAssessment", "Wsl", "Xinput", "SecurityCenter", "WinSat", - "Wcm", "InputRadial", "WinContacts", "WinLocation" }) + "Wcm", "InputRadial", "WinContacts", "WinLocation", "Rdc", "Nla", "Com.CallObj", "Com.Events" }) Assert.Contains("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); Assert.DoesNotContain("--with-librarypath", File.ReadAllText(Path.Combine(project, "Partitions", "Wsl", "settings.rsp"))); - foreach (string partition in new[] { "PsApi2" }) + foreach (string partition in new[] { "Base", "FileHistory", "PsApi2", "HttpServer", + "ComOle", "WindowsConnectionManager", "TransactionServer", "Enstor" }) Assert.DoesNotContain("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); } @@ -699,9 +744,11 @@ internal static string[] SnapshotNamespace(MetadataReader reader, string ns) .Select(type => SnapshotType(reader, type)).OrderBy(value => value, StringComparer.Ordinal).ToArray(); internal static string SnapshotType(MetadataReader reader, TypeDefinition type, bool correctConstructorInstanceBits = false, - bool normalizeReviewedChanges = false, ISet usedEnumSites = null, ISet usedRetvalSites = null) + bool normalizeReviewedChanges = false, ISet usedEnumSites = null, ISet usedRetvalSites = null, + ISet usedPreservedResultSites = null) { - string Attributes(CustomAttributeHandleCollection values, string associatedEnum = null, bool nativeRetval = false) + string Attributes(CustomAttributeHandleCollection values, string associatedEnum = null, bool nativeRetval = false, + bool preservedResult = false) { var attributes = values.Select(handle => AttributeTypeName(reader, handle) + ":" + Convert.ToHexString(reader.GetBlobBytes(reader.GetCustomAttribute(handle).Value))).ToList(); @@ -719,6 +766,12 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum Assert.DoesNotContain(values, handle => AttributeName(reader, handle) == "RetValAttribute"); attributes.Add(MetadataNamespace + ".RetValAttribute:01000000"); } + if (preservedResult) + { + var attribute = Assert.Single(values.Where(handle => AttributeName(reader, handle) == "CanReturnMultipleSuccessValuesAttribute")); + Assert.Equal(new byte[] { 1, 0, 0, 0 }, reader.GetBlobBytes(reader.GetCustomAttribute(attribute).Value)); + Assert.True(attributes.Remove(MetadataNamespace + ".CanReturnMultipleSuccessValuesAttribute:01000000")); + } return string.Join(",", attributes.OrderBy(value => value, StringComparer.Ordinal)); } string Blob(BlobHandle blob) => blob.IsNil ? "" : Convert.ToHexString(reader.GetBlobBytes(blob)); @@ -777,8 +830,16 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum Assert.Equal(0, header); header |= 0x20; } - rows.Add($"M|{methodName}|{method.Attributes}|{method.ImplAttributes}|{Signature(signature, header, parameterTypes)}|" + - $"{Import(reader, method)}|{Attributes(method.GetCustomAttributes())}"); + bool preservedResult = normalizeReviewedChanges && (ns, typeName, methodName) == ReviewedPreservedResult; + var implementation = method.ImplAttributes; + if (preservedResult) + { + Assert.False(implementation.HasFlag(MethodImplAttributes.PreserveSig)); + implementation |= MethodImplAttributes.PreserveSig; + usedPreservedResultSites?.Add($"{ns}.{typeName}.{methodName}"); + } + rows.Add($"M|{methodName}|{method.Attributes}|{implementation}|{Signature(signature, header, parameterTypes)}|" + + $"{Import(reader, method)}|{Attributes(method.GetCustomAttributes(), preservedResult: preservedResult)}"); foreach (var parameter in parameters) { string parameterName = reader.GetString(parameter.Name); From 74bc5f11251e09b6fa7f7b6d5f11e44572b5857f Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 13:47:40 -0700 Subject: [PATCH 04/17] Record verified ten-owner migration evidence Separate native SDK additions, approved preserved-result representation, immutable local producer, and required final CI artifact provenance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 42 ++++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 7930aba16..fa9e65957 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -453,12 +453,48 @@ compatibility remains **UNVERIFIED**. The bounded wave therefore relocates 82 OS floors, one existing association and one existing success-value contract through 11 patches; it does not author new -enum representations or library overrides. The exact expected native additions +enum representations or library overrides. The exact measured native additions are SecurityCenter 16, WinSat 12, WinLocation 39 and Nla 1. B9-to-final expectations are 68 native additions plus the single reviewed preserved-result representation; the cumulative OLD-to-final total is 117, including the 48 enum representation -differences from the preceding reviewed layer, not this new wave. Final-checkpoint -local and actual CI grades are still pending. +differences from the preceding reviewed layer, not this new wave. + +| Owner | OS floors relocated | Other existing facts relocated | Native RetVal additions | Patches | +| --- | ---: | --- | ---: | ---: | +| SecurityCenter | 5 | 1 provider association | 16 | 2 | +| WinSat | 7 | None | 12 | 1 | +| Wcm | 5 | None | 0 | 1 | +| InputRadial | 2 | None | 0 | 1 | +| WinContacts | 5 | None | 0 | 1 | +| WinLocation | 7 | None | 39 | 1 | +| Rdc | 17 | None | 0 | 1 | +| Nla | 12 | None | 1 | 1 | +| Com.CallObj | 7 | None | 0 | 1 | +| Com.Events | 15 | 1 preserved-result contract | 0 | 1 | + +The verified final local producer is +`b61b71256b05d09c3a7f51cf7f823856ba6bbf2b`, image SHA256 +`9F95FBD1913EAF47F1E0D4C495AD0247F6642F6F9F545A4F80B0F682409DF8A8`. +Strict checkpoint-two-to-final grading uses 2 differences; B9-CI-to-final uses +69 and cumulative OLD-to-final uses 117, each with zero unknown and zero unused +expectations. All 37,314 physical types and 7,791 enum identities/content are +graded, with no new types, enums, members, values or native ABI changes. +The 29 preparation/retval/preserved-result/ownership, 84 native architecture, +29 physical/no-fallback/mutation and 14 full-SDK cases actually executed with +zero skipped. The SDK integrity suite used 786 hash-recorded diagnostic inputs. +The immutable local receipt is +`artifacts\next-header-annotation-wave\checkpoint3-review-grade.json`, SHA256 +`3DA0A4DA1B29FC0A5412CD0F4BD677AE410A88619169659209CE7D134A1AE825`. + +The complete tracked SDK mirror remains tree +`77817f12308e29ec8bf77dc6fe56786e65ff9e08`. Derived `libMappings.rsp` is +byte-identical to the filtered starting baseline, SHA256 +`BE92DDDD387279BEA0BDF8F3D838B1466A5465A694BFFB6B6FAAE94447F9EC7A`. +Final CI acceptance is a separate mandatory gate: the +[draft review report](https://github.com/microsoft/win32metadata/pull/2367) +records the exact review head, actual checkout commit/tree, green run, downloaded +artifact and independent artifact grade. A documentation-only review head is not +the local emission producer, and this local receipt is not CI provenance. The existing image helper now relocates a copied frozen traversal map to its owning worktree and prepared headers. It verifies one original SDK project root, From 6c339d8dd9411318cc01355de27c66fa8afa1863 Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:33:47 -0700 Subject: [PATCH 05/17] Replace selected frozen header sources as a complete set Validate every fresh source before removing selected common/x86/x64/arm64 inputs. Preserve all unselected bytes and record exact removed paths in existing provenance. Keep nine actual-function regression cases in PreparedSdkHeadersTests and compare the synchronized image literally with the real prior owning CI artifact. The59 applicable preparation and physical cases pass with no skips; the earlier raw-string draft is retained as failed evidence and corrected to the existing CSharp9 language setting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 9 ++ scripts/Build-WinHttpMigrationImage.ps1 | 39 ++++- .../PreparedSdkHeadersTests.cs | 149 +++++++++++++++++- .../WinHttpMigrationTests.cs | 11 ++ 4 files changed, 199 insertions(+), 9 deletions(-) diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 4789bf507..5a733f7c2 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -609,3 +609,12 @@ own actual image grade before queued owner payloads are admitted. diagnostic is not an accepted control, and no field sidecar is removed by this synchronization. Native field activation, fresh physical dependency closure and final full-SDK image/CI acceptance remain separate gates. + +Selected-image assembly checks every fresh input before removing any frozen +source. It replaces the selected partitions' entire common/x86/x64/arm64 file +set, preserves unselected and non-header bytes, and records the exact removed +paths in `removedBaselineHeaderSources`. The existing preparation-test fixture +exercises architecture-shape changes, missing-input safety and overlapping-root +rejection against the actual helper function. This corrects selected-source +replacement, not stale unselected dependencies: the Network layer still needs +a fresh canonical SDK scrape for its full physical include closure. diff --git a/scripts/Build-WinHttpMigrationImage.ps1 b/scripts/Build-WinHttpMigrationImage.ps1 index cbc2b2bf6..b316eaeb5 100644 --- a/scripts/Build-WinHttpMigrationImage.ps1 +++ b/scripts/Build-WinHttpMigrationImage.ps1 @@ -76,6 +76,40 @@ function Get-SelectedInputs([string]$Obj, [string[]]$Overlays) { }) } +function Set-SelectedHeaderSources([string]$SelectedGenerated, [string]$Generated, + [string[]]$Partitions, [string[]]$Overlays) { + $SelectedGenerated = [IO.Path]::GetFullPath($SelectedGenerated).TrimEnd('\') + $Generated = [IO.Path]::GetFullPath($Generated).TrimEnd('\') + if ($SelectedGenerated.Equals($Generated, [StringComparison]::OrdinalIgnoreCase) -or + $SelectedGenerated.StartsWith("$Generated\", [StringComparison]::OrdinalIgnoreCase) -or + $Generated.StartsWith("$SelectedGenerated\", [StringComparison]::OrdinalIgnoreCase)) { + throw 'Selected and assembled generated-source roots must not overlap.' + } + foreach ($relative in $Overlays) { + if (![IO.File]::Exists("$SelectedGenerated\$relative")) { + throw "The selected header source is missing: $relative" + } + } + + $removed = [Collections.Generic.List[string]]::new() + foreach ($partition in $Partitions) { + foreach ($architecture in @('common', 'x86', 'x64', 'arm64')) { + $relative = "$architecture\$partition.cs" + $target = "$Generated\$relative" + if ([IO.File]::Exists($target)) { + [IO.File]::Delete($target) + $removed.Add($relative) + } + } + } + foreach ($relative in $Overlays) { + $target = "$Generated\$relative" + [IO.Directory]::CreateDirectory([IO.Path]::GetDirectoryName($target)) | Out-Null + [IO.File]::Copy("$SelectedGenerated\$relative", $target) + } + return ,$removed.ToArray() +} + $sourceCommit = & git -C $repo rev-parse HEAD if ($LASTEXITCODE -ne 0) { throw 'The producer commit could not be resolved.' @@ -247,9 +281,7 @@ try { [IO.Directory]::CreateDirectory($obj) | Out-Null Copy-Item -LiteralPath $oldGenerated -Destination $obj -Recurse $generated = "$obj\generated" - foreach ($path in $overlays) { - [IO.File]::Copy("$selectedObj\generated\$path", "$generated\$path", $true) - } + $removedBaselineHeaderSources = Set-SelectedHeaderSources "$selectedObj\generated" $generated $partitions $overlays foreach ($name in @('filtered.headers.generated.rsp', 'filtered.constants.generated.rsp', 'filtered.emitter.generated.rsp')) { if (Test-Path -LiteralPath "$selectedObj\generated\$name") { [IO.File]::Copy("$selectedObj\generated\$name", "$generated\$name", $true) @@ -321,6 +353,7 @@ try { preparationRecipeSha256 = Get-Sha256 $recipePath selectedPartitions = $partitions overlaidHeaderSources = $overlays + removedBaselineHeaderSources = $removedBaselineHeaderSources repeatedSelectionInputs = $repeatedInputs sourceCommit = $sourceCommit toolFiles = $toolFiles diff --git a/tests/Win32MetadataScraperTests/PreparedSdkHeadersTests.cs b/tests/Win32MetadataScraperTests/PreparedSdkHeadersTests.cs index 38cc911c9..5b0644dc1 100644 --- a/tests/Win32MetadataScraperTests/PreparedSdkHeadersTests.cs +++ b/tests/Win32MetadataScraperTests/PreparedSdkHeadersTests.cs @@ -186,6 +186,85 @@ public void OneSdkPreparationPrecedesAllConsumersAndInvalidatesEveryArchitecture } } + [Theory] + [InlineData(new[] { @"common\Sample.cs" }, + new[] { @"x86\Sample.cs", @"x64\Sample.cs", @"arm64\Sample.cs" }, new[] { "Sample" })] + [InlineData(new[] { @"x86\Sample.cs", @"x64\Sample.cs", @"arm64\Sample.cs" }, + new[] { @"common\Sample.cs" }, new[] { "Sample" })] + [InlineData(new[] { @"x64\Sample.cs" }, new[] { @"x64\Sample.cs" }, new[] { "Sample" })] + [InlineData(new string[0], new[] { @"arm64\Sample.cs" }, new[] { "Sample" })] + [InlineData(new[] { @"common\Sample.cs", @"x86\Second.cs", @"x64\Second.cs" }, + new[] { @"x86\Sample.cs", @"x64\Sample.cs", @"arm64\Sample.cs", @"common\Second.cs" }, + new[] { "Sample", "Second" })] + public void SelectedHeaderReplacementUsesTheCompleteFreshSetAndPreservesOtherInputs( + string[] before, string[] after, string[] partitions) + { + using var fixture = new Fixture(); + string[] unrelated = { @"common\Other.cs", @"common\Manual.cs", "scraper.autoRemaps.generated.rsp" }; + byte[] frozen = { 0xff, 0xfe, 0x61, 0, 0x0d, 0, 0x0a, 0 }; + foreach (string relative in before.Concat(unrelated)) + Fixture.WriteGeneratedFile(fixture.AssembledSources, relative, frozen); + foreach (string relative in after.Concat(new[] { @"common\Unselected.cs" })) + Fixture.WriteGeneratedFile(fixture.SelectedSources, relative, + new byte[] { 0xef, 0xbb, 0xbf }.Concat(Encoding.UTF8.GetBytes("fresh:" + relative + "\r\n")).ToArray()); + + var selected = Directory.GetFiles(fixture.SelectedSources, "*", SearchOption.AllDirectories) + .ToDictionary(path => path, File.ReadAllBytes); + var result = fixture.ReplaceSelectedHeaders(partitions, after); + Assert.True(result.ExitCode == 0, result.Error + result.Output); + string[] removed = JsonSerializer.Deserialize(result.Output); + Assert.NotNull(removed); + Assert.Equal(before.OrderBy(path => path, StringComparer.Ordinal), + removed.OrderBy(path => path, StringComparer.Ordinal)); + Assert.Equal(after.Concat(unrelated).OrderBy(path => path, StringComparer.Ordinal), + Directory.GetFiles(fixture.AssembledSources, "*", SearchOption.AllDirectories) + .Select(path => Path.GetRelativePath(fixture.AssembledSources, path)) + .OrderBy(path => path, StringComparer.Ordinal)); + Assert.All(after, relative => Assert.Equal(selected[Path.Combine(fixture.SelectedSources, relative)], + File.ReadAllBytes(Path.Combine(fixture.AssembledSources, relative)))); + Assert.All(unrelated, relative => Assert.Equal(frozen, + File.ReadAllBytes(Path.Combine(fixture.AssembledSources, relative)))); + Assert.Equal(selected.Count, Directory.GetFiles(fixture.SelectedSources, "*", SearchOption.AllDirectories).Length); + Assert.All(selected, entry => Assert.Equal(entry.Value, File.ReadAllBytes(entry.Key))); + } + + [Fact] + public void MissingFreshHeaderFailsBeforeAnyFrozenSourceIsRemoved() + { + using var fixture = new Fixture(); + byte[] frozen = Encoding.ASCII.GetBytes("frozen\r\n"); + byte[] fresh = Encoding.ASCII.GetBytes("fresh\r\n"); + Fixture.WriteGeneratedFile(fixture.AssembledSources, @"common\Sample.cs", frozen); + Fixture.WriteGeneratedFile(fixture.AssembledSources, @"common\Other.cs", frozen); + Fixture.WriteGeneratedFile(fixture.SelectedSources, @"x86\Sample.cs", fresh); + + var result = fixture.ReplaceSelectedHeaders(new[] { "Sample" }, + new[] { @"x86\Sample.cs", @"x64\Sample.cs" }); + Assert.NotEqual(0, result.ExitCode); + Assert.Contains(@"The selected header source is missing: x64\Sample.cs", result.Error); + Assert.Equal(2, Directory.GetFiles(fixture.AssembledSources, "*", SearchOption.AllDirectories).Length); + Assert.Equal(frozen, File.ReadAllBytes(Path.Combine(fixture.AssembledSources, @"common\Sample.cs"))); + Assert.Equal(frozen, File.ReadAllBytes(Path.Combine(fixture.AssembledSources, @"common\Other.cs"))); + Assert.Equal(fresh, File.ReadAllBytes(Path.Combine(fixture.SelectedSources, @"x86\Sample.cs"))); + } + + [Theory] + [InlineData("equal")] + [InlineData("source-contains-destination")] + [InlineData("destination-contains-source")] + public void SelectedHeaderReplacementRejectsOverlappingRoots(string relationship) + { + using var fixture = new Fixture(); + string selected = relationship == "destination-contains-source" + ? Path.Combine(fixture.SelectedSources, "child") : fixture.SelectedSources; + string assembled = relationship == "source-contains-destination" + ? Path.Combine(fixture.SelectedSources, "child") : fixture.SelectedSources; + var result = fixture.ReplaceSelectedHeaders(new[] { "Sample" }, Array.Empty(), selected, assembled); + Assert.NotEqual(0, result.ExitCode); + Assert.Contains("Selected and assembled generated-source roots must not overlap.", result.Error); + Assert.False(Directory.Exists(fixture.SelectedSources)); + } + private sealed class Fixture : IDisposable { internal const string Before = "#ifndef SAMPLE_H\r\n#define SAMPLE_H\r\n#define VALUE 1\r\n#endif\r\n"; @@ -233,6 +312,8 @@ internal Fixture() internal string Unrelated { get; } internal string SdkHeader { get; } internal string Output { get; } + internal string SelectedSources => Path.Combine(this.root, "selected-sources"); + internal string AssembledSources => Path.Combine(this.root, "assembled-sources"); internal string BuildEvents => Path.Combine(this.root, "build-events.txt"); internal string[] ScrapeMarkers => new[] { "scannedheaders.crossarch.txt", "scannedheaders.x86.txt", "scannedheaders.x64.txt", "scannedheaders.arm64.txt", "constants.scraped.txt" } @@ -279,7 +360,66 @@ internal PreparationResult Prepare(string workingDirectory = null) internal ProcessResult Run(string workingDirectory = null) { - static string Quote(string value) => "'" + value.Replace("'", "''") + "'"; + return RunPowerShell("$ErrorActionPreference = 'Stop'; & " + + Quote(Path.Combine(RepositoryRoot, "scripts", "Prepare-SdkHeaders.ps1")) + + " -Recipe " + Quote(this.recipe) + " -SourceRoot " + Quote(this.source) + + " -SdkPackageRoot " + Quote(this.sdk) + " -OutputRoot " + Quote(Output) + + " | ConvertTo-Json -Compress", workingDirectory); + } + + internal static void WriteGeneratedFile(string root, string relative, byte[] bytes) + { + string path = Path.Combine(root, relative); + Directory.CreateDirectory(Path.GetDirectoryName(path)); + File.WriteAllBytes(path, bytes); + } + + internal ProcessResult ReplaceSelectedHeaders(string[] partitions, string[] overlays, + string selected = null, string assembled = null) + { + string inputs = Path.Combine(this.root, "source-replacement.json"); + File.WriteAllText(inputs, JsonSerializer.Serialize(new + { + Selected = selected ?? SelectedSources, + Assembled = assembled ?? AssembledSources, + Partitions = partitions, + Overlays = overlays, + })); + return RunPowerShell(@" + $ErrorActionPreference = 'Stop' + Set-StrictMode -Version Latest + $tokens = $null + $errors = $null + $ast = [Management.Automation.Language.Parser]::ParseFile( + " + Quote(Path.Combine(RepositoryRoot, "scripts", "Build-WinHttpMigrationImage.ps1")) + @", + [ref]$tokens, [ref]$errors) + if ($errors.Count) { throw ($errors.Message -join [Environment]::NewLine) } + $definitions = @($ast.FindAll({ + param($node) + $node -is [Management.Automation.Language.FunctionDefinitionAst] -and + $node.Name -ceq 'Set-SelectedHeaderSources' + }, $true)) + $calls = @($ast.FindAll({ + param($node) + $node -is [Management.Automation.Language.CommandAst] -and + $node.GetCommandName() -ceq 'Set-SelectedHeaderSources' + }, $true)) + if ($definitions.Count -ne 1 -or $calls.Count -ne 1) { + throw 'The image helper must define and invoke selected-source replacement exactly once.' + } + . ([ScriptBlock]::Create($definitions[0].Extent.Text)) + $fixture = Get-Content -LiteralPath " + Quote(inputs) + @" -Raw | ConvertFrom-Json + $removed = Set-SelectedHeaderSources $fixture.Selected $fixture.Assembled ` + @($fixture.Partitions) @($fixture.Overlays) + if ($null -eq $removed -or $removed.GetType() -ne [string[]]) { + throw 'Removed-source provenance must be a string array, including when empty.' + } + ConvertTo-Json -InputObject $removed -Compress + "); + } + + private ProcessResult RunPowerShell(string command, string workingDirectory = null) + { var start = new ProcessStartInfo("pwsh") { WorkingDirectory = workingDirectory ?? RepositoryRoot, @@ -293,11 +433,7 @@ internal ProcessResult Run(string workingDirectory = null) start.ArgumentList.Add(argument); } - start.ArgumentList.Add("$ErrorActionPreference = 'Stop'; & " + - Quote(Path.Combine(RepositoryRoot, "scripts", "Prepare-SdkHeaders.ps1")) + - " -Recipe " + Quote(this.recipe) + " -SourceRoot " + Quote(this.source) + - " -SdkPackageRoot " + Quote(this.sdk) + " -OutputRoot " + Quote(Output) + - " | ConvertTo-Json -Compress"); + start.ArgumentList.Add(command); return Execute(start); } @@ -358,6 +494,7 @@ private static ProcessResult Execute(ProcessStartInfo start) public void Dispose() => Directory.Delete(this.root, recursive: true); private static string Hash(byte[] bytes) => Convert.ToHexString(System.Security.Cryptography.SHA256.HashData(bytes)); + private static string Quote(string value) => "'" + value.Replace("'", "''") + "'"; } public sealed class PreparationResult diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index d542fe787..b0a773ead 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -336,6 +336,17 @@ public void ReviewedPreservedResultReplacesOnlyTheLegacySuccessAttribute(int arc "CLI PreserveSig set; signature and method flags unchanged."); } + [MigrationFact("WINHTTP_MIGRATION_PRIOR_CHECKPOINT")] + public void QualifiedToolingSynchronizationPreservesTheAcceptedOwningCheckpoint() + { + string path = Environment.GetEnvironmentVariable("WINHTTP_MIGRATION_PRIOR_CHECKPOINT"); + Assert.Equal("A8017542A473F502837A488628431B6D11B325C6CABAAA1F674A3C9176711199", + Convert.ToHexString(SHA256.HashData(File.ReadAllBytes(path)))); + using var accepted = Open("WINHTTP_MIGRATION_PRIOR_CHECKPOINT"); + using var current = Open("WINHTTP_MIGRATION_NEW"); + AssertEveryPhysicalTypeUnchanged(accepted.Reader, current.Reader, "accepted owning checkpoint"); + } + [MigrationFact("WINHTTP_MIGRATION_ACCEPTED")] public void ScopedSupportedOSPreservesEveryAcceptedPhysicalType() { From 4b3043a469620af4d1e1276d5c1bbaab50b41ba9 Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:35:17 -0700 Subject: [PATCH 06/17] Integrate bounded Network header annotation payload Apply only producer3e13f6f0879e2e01fc9f325e9293b2715646c903 above the qualified c587/43af owning history. Preserve the canonical SDK tree and existing logical enum contents. Keep DHCP_IP_ARRAY.Elements CountParamIndex0 and default-off native field inference pending separate activation. This source integration is not actual combined image, dependent closure or CI acceptance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../WinSDK/Partitions/Dhcp/settings.rsp | 2 + .../WinSDK/Partitions/NetBios/settings.rsp | 2 + .../WinSDK/Partitions/NetShell/settings.rsp | 2 + .../WinSDK/Partitions/Wnet/settings.rsp | 2 + generation/WinSDK/WithSetLastError.rsp | 2 - generation/WinSDK/emitter.settings.rsp | 54 -- generation/WinSDK/enums.json | 349 ------- generation/WinSDK/patches/SdkHeaders.json | 67 +- .../post-midl/um/dhcpcsdk.annotations.patch | 57 ++ .../post-midl/um/dhcpsapi.annotations.patch | 398 ++++++++ .../post-midl/um/dhcpv6csdk.annotations.patch | 41 + .../post-midl/um/nb30.annotations.patch | 19 + .../post-midl/um/netsh.annotations.patch | 27 + .../post-midl/um/npapi.annotations.patch | 270 ++++++ .../post-midl/um/winnetwk.annotations.patch | 890 ++++++++++++++++++ generation/WinSDK/supportedOS.rsp | 257 ----- 16 files changed, 1775 insertions(+), 664 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/um/dhcpcsdk.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/dhcpsapi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/dhcpv6csdk.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/nb30.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/netsh.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/npapi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/winnetwk.annotations.patch diff --git a/generation/WinSDK/Partitions/Dhcp/settings.rsp b/generation/WinSDK/Partitions/Dhcp/settings.rsp index 752225d2b..00a68427e 100644 --- a/generation/WinSDK/Partitions/Dhcp/settings.rsp +++ b/generation/WinSDK/Partitions/Dhcp/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/DhcpCSdk.h /um/dhcpsapi.h diff --git a/generation/WinSDK/Partitions/NetBios/settings.rsp b/generation/WinSDK/Partitions/NetBios/settings.rsp index d28041efc..f70fc55e6 100644 --- a/generation/WinSDK/Partitions/NetBios/settings.rsp +++ b/generation/WinSDK/Partitions/NetBios/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/nb30.h --namespace diff --git a/generation/WinSDK/Partitions/NetShell/settings.rsp b/generation/WinSDK/Partitions/NetShell/settings.rsp index 6e02c6b19..cb3c9f575 100644 --- a/generation/WinSDK/Partitions/NetShell/settings.rsp +++ b/generation/WinSDK/Partitions/NetShell/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/NetSh.h --namespace diff --git a/generation/WinSDK/Partitions/Wnet/settings.rsp b/generation/WinSDK/Partitions/Wnet/settings.rsp index 37bcdb39e..b745c33aa 100644 --- a/generation/WinSDK/Partitions/Wnet/settings.rsp +++ b/generation/WinSDK/Partitions/Wnet/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/Npapi.h /um/winnetwk.h diff --git a/generation/WinSDK/WithSetLastError.rsp b/generation/WinSDK/WithSetLastError.rsp index 67bab180d..bde9b1b7d 100644 --- a/generation/WinSDK/WithSetLastError.rsp +++ b/generation/WinSDK/WithSetLastError.rsp @@ -3105,8 +3105,6 @@ WinUsb_WriteIsochPipe WinUsb_WriteIsochPipeAsap WinUsb_WritePipe WlanAllocateMemory -WNetGetLastErrorA -WNetGetLastErrorW Wow64DisableWow64FsRedirection Wow64GetThreadContext Wow64GetThreadSelectorEntry diff --git a/generation/WinSDK/emitter.settings.rsp b/generation/WinSDK/emitter.settings.rsp index e9d5fc007..787591f26 100644 --- a/generation/WinSDK/emitter.settings.rsp +++ b/generation/WinSDK/emitter.settings.rsp @@ -1112,7 +1112,6 @@ NCryptOpenKey::dwLegacyKeySpec=[-Optional] MFPCreateMediaPlayer::creationOptions=[-Optional] DirectSoundCreate::pUnkOuter=[Optional] IDirectSound::CreateSoundBuffer::pUnkOuter=[Optional] -DhcpEnumSubnets::EnumInfo=[-In] I_RpcNsInterfaceExported::EntryName=[In] I_RpcNsInterfaceExported::RpcInterfaceInformation=[In] FNCERTSRVBACKUPGETDYNAMICFILELISTW::hbc=[In] @@ -1709,8 +1708,6 @@ PerfStartProviderEx::Provider=[RAIIFree("PerfStopProvider")] RegisterEventSourceA::return=[RAIIFree("DeregisterEventSource")] RegisterEventSourceW::return=[RAIIFree("DeregisterEventSource")] SHChangeNotification_Lock::return=[RAIIFree("SHChangeNotification_Unlock")] -WNetOpenEnumA::lphEnum=[RAIIFree("WNetCloseEnum")] -WNetOpenEnumW::lphEnum=[RAIIFree("WNetCloseEnum")] WTSVirtualChannelOpen::return=[RAIIFree("WTSVirtualChannelClose")] WTSVirtualChannelOpenEx::return=[RAIIFree("WTSVirtualChannelClose")] CLRCreateInstance::ppInterface=[Out][ComOutPtr] @@ -1751,49 +1748,6 @@ IAMStreamConfig::GetStreamCaps::pSCC=[NativeArrayInfo] ENUM_SERVICE_TYPE=[AssociatedConstant("SERVICE_NO_CHANGE")] SERVICE_ERROR=[AssociatedConstant("SERVICE_NO_CHANGE")] SERVICE_START_TYPE=[AssociatedConstant("SERVICE_NO_CHANGE")] -WNetAddConnection2A::return=WIN32_ERROR -WNetAddConnection2W::return=WIN32_ERROR -WNetAddConnection3A::return=WIN32_ERROR -WNetAddConnection3W::return=WIN32_ERROR -WNetAddConnection4A::return=WIN32_ERROR -WNetAddConnection4W::return=WIN32_ERROR -WNetAddConnectionA::return=WIN32_ERROR -WNetAddConnectionW::return=WIN32_ERROR -WNetCancelConnection2A::return=WIN32_ERROR -WNetCancelConnection2W::return=WIN32_ERROR -WNetCancelConnectionA::return=WIN32_ERROR -WNetCancelConnectionW::return=WIN32_ERROR -WNetCloseEnum::return=WIN32_ERROR -WNetConnectionDialog::return=WIN32_ERROR -WNetConnectionDialog1A::return=WIN32_ERROR -WNetConnectionDialog1W::return=WIN32_ERROR -WNetDisconnectDialog::return=WIN32_ERROR -WNetDisconnectDialog1A::return=WIN32_ERROR -WNetDisconnectDialog1W::return=WIN32_ERROR -WNetEnumResourceA::return=WIN32_ERROR -WNetEnumResourceW::return=WIN32_ERROR -WNetGetConnectionA::return=WIN32_ERROR -WNetGetConnectionW::return=WIN32_ERROR -WNetGetLastErrorA::return=WIN32_ERROR -WNetGetLastErrorW::return=WIN32_ERROR -WNetGetNetworkInformationA::return=WIN32_ERROR -WNetGetNetworkInformationW::return=WIN32_ERROR -WNetGetProviderNameA::return=WIN32_ERROR -WNetGetProviderNameW::return=WIN32_ERROR -WNetGetResourceInformationA::return=WIN32_ERROR -WNetGetResourceInformationW::return=WIN32_ERROR -WNetGetResourceParentA::return=WIN32_ERROR -WNetGetResourceParentW::return=WIN32_ERROR -WNetGetUniversalNameA::return=WIN32_ERROR -WNetGetUniversalNameW::return=WIN32_ERROR -WNetGetUserA::return=WIN32_ERROR -WNetGetUserW::return=WIN32_ERROR -WNetOpenEnumA::return=WIN32_ERROR -WNetOpenEnumW::return=WIN32_ERROR -WNetUseConnection4A::return=WIN32_ERROR -WNetUseConnection4W::return=WIN32_ERROR -WNetUseConnectionA::return=WIN32_ERROR -WNetUseConnectionW::return=WIN32_ERROR HttpReceiveHttpRequest::Overlapped=[In][Out][Optional][Retained] PFTASKDIALOGCALLBACK::msg=[AssociatedEnum("TASKDIALOG_NOTIFICATIONS")] GlobalMemoryStatusEx::lpBuffer=[In] @@ -2466,9 +2420,6 @@ GdipGetImageDecoders::decoders=[ContainsInteriorPointers] # https://learn.microsoft.com/windows/win32/api/winnetwk/nf-winnetwk-wnetenumresourcew # https://learn.microsoft.com/windows/win32/api/winnetwk/nf-winnetwk-wnetgetresourceinformationw # https://learn.microsoft.com/windows/win32/api/winnetwk/nf-winnetwk-wnetgetuniversalnamew -WNetEnumResourceW::lpBuffer=[ContainsInteriorPointers] -WNetGetResourceInformationW::lpBuffer=[ContainsInteriorPointers] -WNetGetUniversalNameW::lpBuffer=[ContainsInteriorPointers] # https://learn.microsoft.com/windows/win32/api/http/nf-http-httpreceivehttprequest HttpReceiveHttpRequest::RequestBuffer=[ContainsInteriorPointers] # https://learn.microsoft.com/windows/win32/api/wininet/nf-wininet-internetqueryoptionw @@ -2543,11 +2494,6 @@ IcmpParseReplies::ReplyBuffer=[ContainsInteriorPointers] # https://learn.microsoft.com/windows/win32/api/winnetwk/nf-winnetwk-wnetgetuniversalnamea # https://learn.microsoft.com/windows/win32/api/winnetwk/nf-winnetwk-wnetgetresourceparenta # https://learn.microsoft.com/windows/win32/api/winnetwk/nf-winnetwk-wnetgetresourceparentw -WNetEnumResourceA::lpBuffer=[ContainsInteriorPointers] -WNetGetResourceInformationA::lpBuffer=[ContainsInteriorPointers] -WNetGetUniversalNameA::lpBuffer=[ContainsInteriorPointers] -WNetGetResourceParentA::lpBuffer=[ContainsInteriorPointers] -WNetGetResourceParentW::lpBuffer=[ContainsInteriorPointers] PSCreateMemoryPropertyStore::ppv=[ComOutPtr] FwpmCalloutCreateEnumHandle0::enumHandle=FWPM_CALLOUT_ENUM_HANDLE* FwpmCalloutEnum0::enumHandle=FWPM_CALLOUT_ENUM_HANDLE diff --git a/generation/WinSDK/enums.json b/generation/WinSDK/enums.json index d6cf9896b..50b19e791 100644 --- a/generation/WinSDK/enums.json +++ b/generation/WinSDK/enums.json @@ -4395,10 +4395,6 @@ { "method": "SetLastErrorEx", "parameter": "dwErrCode" - }, - { - "struct": "NETINFOSTRUCT", - "field": "dwStatus" } ] }, @@ -6576,31 +6572,6 @@ } ] }, - { - "name": "UNC_INFO_LEVEL", - "members": [ - { - "name": "UNIVERSAL_NAME_INFO_LEVEL" - }, - { - "name": "REMOTE_NAME_INFO_LEVEL" - } - ], - "uses": [ - { - "method": "NPGetUniversalName", - "parameter": "dwInfoLevel" - }, - { - "method": "WNetGetUniversalNameW", - "parameter": "dwInfoLevel" - }, - { - "method": "WNetGetUniversalNameA", - "parameter": "dwInfoLevel" - } - ] - }, { "name": "GET_DCX_FLAGS", "flags": true, @@ -8030,30 +8001,6 @@ } ] }, - { - "name": "WNPERM_DLG", - "members": [ - { - "name": "WNPERM_DLG_PERM" - }, - { - "name": "WNPERM_DLG_AUDIT" - }, - { - "name": "WNPERM_DLG_OWNER" - } - ], - "uses": [ - { - "method": "NPFMXGetPermHelp", - "parameter": "nDialogType" - }, - { - "method": "NPFMXEditPerm", - "parameter": "nDialogType" - } - ] - }, { "addUsesTo": "COMAdminApplicationInstallOptions", "members": [], @@ -9734,38 +9681,6 @@ } ] }, - { - "name": "WNET_OPEN_ENUM_USAGE", - "flags": true, - "members": [ - { - "name": "RESOURCEUSAGE_NONE", - "value": "0" - }, - { - "name": "RESOURCEUSAGE_CONNECTABLE" - }, - { - "name": "RESOURCEUSAGE_CONTAINER" - }, - { - "name": "RESOURCEUSAGE_ATTACHED" - }, - { - "name": "RESOURCEUSAGE_ALL" - } - ], - "uses": [ - { - "method": "WNetOpenEnumA", - "parameter": "dwUsage" - }, - { - "method": "WNetOpenEnumW", - "parameter": "dwUsage" - } - ] - }, { "addUsesTo": "NtmsMountOptions", "flags": true, @@ -12146,64 +12061,6 @@ } ] }, - { - "name": "NET_CONNECT_FLAGS", - "flags": true, - "autoPopulate": { - "filter": "CONNECT_", - "header": "winnetwk.h" - }, - "uses": [ - { - "method": "WNetAddConnection2A", - "parameter": "dwFlags" - }, - { - "method": "WNetAddConnection2W", - "parameter": "dwFlags" - }, - { - "method": "WNetAddConnection3A", - "parameter": "dwFlags" - }, - { - "method": "WNetAddConnection3W", - "parameter": "dwFlags" - }, - { - "method": "WNetAddConnection4A", - "parameter": "dwFlags" - }, - { - "method": "WNetAddConnection4W", - "parameter": "dwFlags" - }, - { - "method": "WNetCancelConnection2A", - "parameter": "dwFlags" - }, - { - "method": "WNetCancelConnection2W", - "parameter": "dwFlags" - }, - { - "method": "WNetUseConnectionW", - "parameter": "dwFlags" - }, - { - "method": "WNetUseConnectionA", - "parameter": "dwFlags" - }, - { - "method": "NPAddConnection3", - "parameter": "dwFlags" - }, - { - "struct": "NOTIFYADD", - "field": "dwAddFlags" - } - ] - }, { "name": "VIRTUAL_ALLOCATION_TYPE", "flags": true, @@ -12502,50 +12359,6 @@ } ] }, - { - "name": "NP_PROPERTY_DIALOG_SELECTION", - "members": [ - { - "name": "WNPS_FILE" - }, - { - "name": "WNPS_DIR" - }, - { - "name": "WNPS_MULT" - } - ], - "uses": [ - { - "method": "NPPropertyDialog", - "parameter": "nPropSel" - }, - { - "method": "NPGetPropertyText", - "parameter": "nPropSel" - } - ] - }, - { - "name": "NPDIRECTORY_NOTIFY_OPERATION", - "members": [ - { - "name": "WNDN_MKDIR" - }, - { - "name": "WNDN_RMDIR" - }, - { - "name": "WNDN_MVDIR" - } - ], - "uses": [ - { - "method": "NPDirectoryNotify", - "parameter": "dwOper" - } - ] - }, { "name": "FONT_RESOURCE_CHARACTERISTICS", "members": [ @@ -15304,39 +15117,6 @@ } ] }, - { - "name": "NET_RESOURCE_TYPE", - "flags": true, - "members": [ - { - "name": "RESOURCETYPE_ANY" - }, - { - "name": "RESOURCETYPE_DISK" - }, - { - "name": "RESOURCETYPE_PRINT" - } - ], - "uses": [ - { - "method": "WNetOpenEnumA", - "parameter": "dwType" - }, - { - "method": "WNetOpenEnumW", - "parameter": "dwType" - }, - { - "struct": "NETRESOURCEA", - "field": "dwType" - }, - { - "struct": "NETRESOURCEW", - "field": "dwType" - } - ] - }, { "addUsesTo": "R2_MODE", "autoPopulate": { @@ -17291,23 +17071,6 @@ } ] }, - { - "name": "NETWORK_NAME_FORMAT_FLAGS", - "members": [ - { - "name": "WNFMT_MULTILINE" - }, - { - "name": "WNFMT_ABBREVIATED" - } - ], - "uses": [ - { - "method": "NPFormatNetworkName", - "parameter": "dwFlags" - } - ] - }, { "name": "EXECUTION_STATE", "flags": true, @@ -17793,41 +17556,6 @@ } ] }, - { - "name": "NET_RESOURCE_SCOPE", - "members": [ - { - "name": "RESOURCE_CONNECTED" - }, - { - "name": "RESOURCE_CONTEXT" - }, - { - "name": "RESOURCE_GLOBALNET" - }, - { - "name": "RESOURCE_REMEMBERED" - } - ], - "uses": [ - { - "method": "WNetOpenEnumW", - "parameter": "dwScope" - }, - { - "method": "WNetOpenEnumA", - "parameter": "dwScope" - }, - { - "struct": "NETRESOURCEA", - "field": "dwScope" - }, - { - "struct": "NETRESOURCEW", - "field": "dwScope" - } - ] - }, { "name": "NET_SERVER_TYPE", "flags": true, @@ -22861,27 +22589,6 @@ } ] }, - { - "name": "NETINFOSTRUCT_CHARACTERISTICS", - "flags": true, - "members": [ - { - "name": "NETINFO_DLL16" - }, - { - "name": "NETINFO_DISKRED" - }, - { - "name": "NETINFO_PRINTERRED" - } - ], - "uses": [ - { - "struct": "NETINFOSTRUCT", - "field": "dwCharacteristics" - } - ] - }, { "name": "DROPEFFECT", "flags": true, @@ -25969,40 +25676,6 @@ } ] }, - { - "name": "CONNECTDLGSTRUCT_FLAGS", - "flags": true, - "members": [ - { - "name": "CONNDLG_RO_PATH" - }, - { - "name": "CONNDLG_CONN_POINT" - }, - { - "name": "CONNDLG_USE_MRU" - }, - { - "name": "CONNDLG_HIDE_BOX" - }, - { - "name": "CONNDLG_PERSIST" - }, - { - "name": "CONNDLG_NOT_PERSIST" - } - ], - "uses": [ - { - "struct": "CONNECTDLGSTRUCTW", - "field": "dwFlags" - }, - { - "struct": "CONNECTDLGSTRUCTA", - "field": "dwFlags" - } - ] - }, { "name": "DRAWITEMSTRUCT_CTL_TYPE", "members": [ @@ -26646,28 +26319,6 @@ } ] }, - { - "name": "DISCDLGSTRUCT_FLAGS", - "flags": true, - "members": [ - { - "name": "DISC_UPDATE_PROFILE" - }, - { - "name": "DISC_NO_FORCE" - } - ], - "uses": [ - { - "struct": "DISCDLGSTRUCTA", - "field": "dwFlags" - }, - { - "struct": "DISCDLGSTRUCTW", - "field": "dwFlags" - } - ] - }, { "name": "ENDCOMPOSITIONNOTIFY_CODE", "members": [ diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index b336b2367..0f657a9d3 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -171,6 +171,54 @@ "sourceSha256": "4F728FEF9AA5666482B448DCDCB908078429ACE810C388D430EEB46C17824016", "sdkPath": "c\\include\\10.0.26100.0\\um\\EventSys.idl", "sdkSha256": "FB9D8FCAB51FF13E259E06D4B899FE12C2399557FA16827F2876B6451028D728" + }, + { + "path": "um\\nb30.h", + "sourceSha256": "69759909F41583263F20CADFE1A013F023BA89A6A7752DCCC16240B1E9B5FC1B", + "sdkPath": "c\\include\\10.0.26100.0\\um\\nb30.h", + "sdkSha256": "69759909F41583263F20CADFE1A013F023BA89A6A7752DCCC16240B1E9B5FC1B" + }, + { + "path": "um\\winnetwk.h", + "sourceSha256": "7C7412DF502FB6EA390C96D7C9F805A2A211609B95B8FDB4740540F789D9C4CE", + "sdkPath": "c\\include\\10.0.26100.0\\um\\winnetwk.h", + "sdkSha256": "7C7412DF502FB6EA390C96D7C9F805A2A211609B95B8FDB4740540F789D9C4CE" + }, + { + "path": "um\\Npapi.h", + "sourceSha256": "78986BC3A057E7FC0B6D10FDC4D0E1B1FF54B5B2F5BC198598ED1F224002F0DC", + "sdkPath": "c\\include\\10.0.26100.0\\um\\Npapi.h", + "sdkSha256": "78986BC3A057E7FC0B6D10FDC4D0E1B1FF54B5B2F5BC198598ED1F224002F0DC" + }, + { + "path": "um\\Dhcpv6cSdk.h", + "sourceSha256": "1018C3FBEAF08B3B11DA6E9AF89BBCC98724561EEB363F4CA2F61D14FB8415A6", + "sdkPath": "c\\include\\10.0.26100.0\\um\\Dhcpv6cSdk.h", + "sdkSha256": "1018C3FBEAF08B3B11DA6E9AF89BBCC98724561EEB363F4CA2F61D14FB8415A6" + }, + { + "path": "um\\DhcpCSdk.h", + "sourceSha256": "0A5B9BD25AD8D9079506229D06DD5A16999DE9177EFABCBE5E1C569F2E4BECFB", + "sdkPath": "c\\include\\10.0.26100.0\\um\\DhcpCSdk.h", + "sdkSha256": "0A5B9BD25AD8D9079506229D06DD5A16999DE9177EFABCBE5E1C569F2E4BECFB" + }, + { + "path": "um\\DhcpSSdk.h", + "sourceSha256": "7A1821118531FD531E211E6ECB69E7BA283D2A24E71202691F04B12B58F3023A", + "sdkPath": "c\\include\\10.0.26100.0\\um\\DhcpSSdk.h", + "sdkSha256": "7A1821118531FD531E211E6ECB69E7BA283D2A24E71202691F04B12B58F3023A" + }, + { + "path": "um\\dhcpsapi.h", + "sourceSha256": "A2CFDA0309F30B167D08218C6FFE89E57B860A2690A6F49650D4A252A8A0AC4D", + "sdkPath": "c\\include\\10.0.26100.0\\um\\dhcpsapi.h", + "sdkSha256": "A2CFDA0309F30B167D08218C6FFE89E57B860A2690A6F49650D4A252A8A0AC4D" + }, + { + "path": "um\\NetSh.h", + "sourceSha256": "5AFA73066E9F0875B348F082FF9F158B33812B566DECE3D0A338CEC9961D940B", + "sdkPath": "c\\include\\10.0.26100.0\\um\\NetSh.h", + "sdkSha256": "5AFA73066E9F0875B348F082FF9F158B33812B566DECE3D0A338CEC9961D940B" } ], "partitions": [ @@ -201,7 +249,15 @@ "Com.Events", "ComOle", "WindowsConnectionManager", - "TransactionServer" + "TransactionServer", + "NetBios", + "Wnet", + "Dhcp", + "NetShell", + "Foundation", + "Com", + "Rpc", + "WinSock" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -230,6 +286,13 @@ "post-midl\\um\\msrdc.annotations.patch", "post-midl\\um\\netlistmgr.annotations.patch", "post-midl\\um\\callobj.annotations.patch", - "post-midl\\um\\eventsys.annotations.patch" + "post-midl\\um\\eventsys.annotations.patch", + "post-midl\\um\\nb30.annotations.patch", + "post-midl\\um\\winnetwk.annotations.patch", + "post-midl\\um\\npapi.annotations.patch", + "post-midl\\um\\dhcpv6csdk.annotations.patch", + "post-midl\\um\\dhcpcsdk.annotations.patch", + "post-midl\\um\\dhcpsapi.annotations.patch", + "post-midl\\um\\netsh.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/um/dhcpcsdk.annotations.patch b/generation/WinSDK/patches/post-midl/um/dhcpcsdk.annotations.patch new file mode 100644 index 000000000..f3033b974 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/dhcpcsdk.annotations.patch @@ -0,0 +1,57 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/DhcpCSdk.h b/generation/WinSDK/RecompiledIdlHeaders/um/DhcpCSdk.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/DhcpCSdk.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/DhcpCSdk.h +@@ -1,4 +1,5 @@ + #include ++#include + + /*++ + +@@ -215,6 +216,7 @@ + #define DHCPCAPI_REQUEST_CANCEL 0x08 // cancel request + #define DHCPCAPI_REQUEST_MASK 0x0F // allowed flags.. + ++_Win32_SupportedOS_BEGIN_(Windows2000) + DWORD + APIENTRY + DhcpCApiInitialize( +@@ -240,6 +242,7 @@ + _Inout_ LPDWORD pSize, // i/p: size of above in BYTES, o/p required bytes.. + _In_ LPWSTR RequestIdStr // needed for persistent requests + ); // returns ERROR_MORE_DATA if o/p buffer is of insufficient size, and fills in reqd size in # of bytes ++_Win32_SupportedOS_END_() + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */ + #pragma endregion +@@ -247,6 +250,7 @@ + #pragma region Desktop Family or OneCore Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) + ++_Win32_SupportedOS_Windows2000_ + DWORD // win32 status + APIENTRY + DhcpUndoRequestParams( // undo the effect of a persistent request -- currently undo from registry +@@ -257,6 +261,7 @@ + ); + + #define DHCPCAPI_REGISTER_HANDLE_EVENT 0x01 // handle returned is to an event ++_Win32_SupportedOS_Windows2000_ + DWORD // win32 status + APIENTRY + DhcpRegisterParamChange( // notify if a parameter has changed +@@ -269,6 +274,7 @@ + ); + + #define DHCPCAPI_DEREGISTER_HANDLE_EVENT 0x01 // de-register handle that is an event ++_Win32_SupportedOS_BEGIN_(Windows2000) + DWORD + APIENTRY + DhcpDeRegisterParamChange( // undo the registration +@@ -282,6 +288,7 @@ + DhcpRemoveDNSRegistrations( + VOID + ); ++_Win32_SupportedOS_END_() + + DWORD + APIENTRY diff --git a/generation/WinSDK/patches/post-midl/um/dhcpsapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/dhcpsapi.annotations.patch new file mode 100644 index 000000000..6a7c85fe1 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/dhcpsapi.annotations.patch @@ -0,0 +1,398 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/dhcpsapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/dhcpsapi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/dhcpsapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/dhcpsapi.h +@@ -13,6 +13,7 @@ + + #pragma once + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -1825,6 +1826,7 @@ + // + + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD DHCP_API_FUNCTION + DhcpAddFilterV4( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -1860,12 +1862,14 @@ + _Out_ DWORD *ElementsRead, + _Out_ DWORD *ElementsTotal + ); ++_Win32_SupportedOS_END_() + + + // + // Subnet APIs + // + ++_Win32_SupportedOS_BEGIN_(Server2000) + DWORD DHCP_API_FUNCTION + DhcpCreateSubnet( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -1896,7 +1900,9 @@ + _Out_ DWORD *ElementsRead, + _Out_ DWORD *ElementsTotal + ); +- ++_Win32_SupportedOS_END_() ++ ++_Win32_SupportedOS_Server2008_ + DWORD DHCP_API_FUNCTION + DhcpAddSubnetElement( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -1904,6 +1910,7 @@ + DHCP_CONST DHCP_SUBNET_ELEMENT_DATA * AddElementInfo + ); + ++_Win32_SupportedOS_Server2000_ + DWORD DHCP_API_FUNCTION + DhcpEnumSubnetElements( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -1916,6 +1923,7 @@ + DWORD *ElementsTotal + ); + ++_Win32_SupportedOS_Server2008_ + DWORD DHCP_API_FUNCTION + DhcpRemoveSubnetElement( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -1924,6 +1932,7 @@ + DHCP_FORCE_FLAG ForceFlag + ); + ++_Win32_SupportedOS_Server2000_ + DWORD DHCP_API_FUNCTION + DhcpDeleteSubnet( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -1935,6 +1944,7 @@ + // Option APIs + // + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD DHCP_API_FUNCTION + DhcpCreateOption( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -1986,7 +1996,9 @@ + DHCP_CONST DHCP_OPTION_SCOPE_INFO *ScopeInfo, + DHCP_CONST DHCP_OPTION_VALUE_ARRAY *OptionValues + ); +- ++_Win32_SupportedOS_END_() ++ ++_Win32_SupportedOS_Server2000_ + DWORD DHCP_API_FUNCTION + DhcpGetOptionValue( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -1995,6 +2007,7 @@ + LPDHCP_OPTION_VALUE *OptionValue + ); + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD DHCP_API_FUNCTION + DhcpEnumOptionValues( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -2056,7 +2069,9 @@ + DWORD *ClientsRead, + DWORD *ClientsTotal + ); +- ++_Win32_SupportedOS_END_() ++ ++_Win32_SupportedOS_BEGIN_(Server2000) + DWORD DHCP_API_FUNCTION + DhcpCreateClientInfo( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -2092,7 +2107,9 @@ + DWORD *ClientsRead, + DWORD *ClientsTotal + ); +- ++_Win32_SupportedOS_END_() ++ ++_Win32_SupportedOS_Server2008_ + DWORD DHCP_API_FUNCTION + DhcpGetClientOptions( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -2107,6 +2124,7 @@ + LPDHCP_MIB_INFO *MibInfo + ); + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD DHCP_API_FUNCTION + DhcpServerSetConfig( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -2129,7 +2147,9 @@ + DWORD FixFlag, + LPDHCP_SCAN_LIST *ScanList + ); +- ++_Win32_SupportedOS_END_() ++ ++_Win32_SupportedOS_BEGIN_(Server2000) + VOID DHCP_API_FUNCTION + DhcpRpcFreeMemory( + PVOID BufferPointer +@@ -2141,10 +2161,12 @@ + LPDWORD MajorVersion, + LPDWORD MinorVersion + ); +- +- +- +- ++_Win32_SupportedOS_END_() ++ ++ ++ ++ ++_Win32_SupportedOS_Server2008_ + DWORD DHCP_API_FUNCTION + DhcpAddSubnetElementV4( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -2152,6 +2174,7 @@ + DHCP_CONST DHCP_SUBNET_ELEMENT_DATA_V4 *AddElementInfo + ); + ++_Win32_SupportedOS_Server2000_ + DWORD DHCP_API_FUNCTION + DhcpEnumSubnetElementsV4( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -2164,6 +2187,7 @@ + DWORD *ElementsTotal + ); + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD DHCP_API_FUNCTION + DhcpRemoveSubnetElementV4( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -2315,8 +2339,10 @@ + _In_opt_ IN LPWSTR ClassName, + _In_opt_ IN LPWSTR VendorName + ) ; +- +- ++_Win32_SupportedOS_END_() ++ ++ ++_Win32_SupportedOS_Server2000_ + DWORD // OPTION_NOT_PRESENT if option is not defined + DhcpSetOptionValueV5( // replace or add a new option value + _In_opt_ IN LPWSTR ServerIpAddress, +@@ -2329,6 +2355,7 @@ + ) ; + + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD + DhcpSetOptionValuesV5( + _In_opt_ IN LPWSTR ServerIpAddress, +@@ -2376,8 +2403,10 @@ + OUT DWORD *OptionsRead, + OUT DWORD *OptionsTotal + ) ; +- +- ++_Win32_SupportedOS_END_() ++ ++ ++_Win32_SupportedOS_Server2000_ + DWORD + DhcpRemoveOptionValueV5( + _In_opt_ IN LPWSTR ServerIpAddress, +@@ -2389,6 +2418,7 @@ + ) ; + + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD + DhcpCreateClass( + _In_opt_ IN LPWSTR ServerIpAddress, +@@ -2464,6 +2494,7 @@ + IN LPDHCP_OPTION_SCOPE_INFO6 ScopeInfo, + OUT LPDHCP_ALL_OPTION_VALUES *Values + ); ++_Win32_SupportedOS_END_() + + + +@@ -2473,6 +2504,7 @@ + //DOC DhcpEnumServers enumerates the list of servers found in the DS. If the DS + //DOC is not accessible, it returns an error. The only currently used parameter + //DOC is the out parameter Servers. This is a SLOW call. ++_Win32_SupportedOS_BEGIN_(Server2000) + DWORD + DhcpEnumServers( + IN DWORD Flags, // must be zero +@@ -2555,8 +2587,10 @@ + DHCP_CONST DHCP_SUBNET_ELEMENT_DATA_V5 *RemoveElementInfo, + DHCP_FORCE_FLAG ForceFlag + ); +- +- ++_Win32_SupportedOS_END_() ++ ++ ++_Win32_SupportedOS_Server2012_ + DWORD DHCP_API_FUNCTION + DhcpV4EnumSubnetReservations( + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, +@@ -2572,6 +2606,7 @@ + + + //V6 Api's ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD DHCP_API_FUNCTION + DhcpCreateOptionV6( + _In_opt_ IN LPWSTR ServerIpAddress, +@@ -2679,12 +2714,14 @@ + DWORD *OptionsRead, + DWORD *OptionsTotal + ); ++_Win32_SupportedOS_END_() + + #endif + + //DOC DhcpDsInit must be called exactly once per process.. this initializes the + //DOC memory and other structures for this process. This initializes some DS + //DOC object handles (memory), and hence is slow as this has to read from DS. ++_Win32_SupportedOS_BEGIN_(Server2000) + DWORD + DhcpDsInit( + VOID +@@ -2697,8 +2734,10 @@ + DhcpDsCleanup( + VOID + ); +- +- ++_Win32_SupportedOS_END_() ++ ++ ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD + DhcpSetThreadOptions( // set options for current thread + IN DWORD Flags, // options, currently 0 or DHCP_FLAGS_DONT_ACCESS_DS +@@ -2730,13 +2769,16 @@ + IN DHCP_ATTRIB_ID pDhcpAttribs[],// array of attribs + OUT LPDHCP_ATTRIB_ARRAY *pDhcpAttribArr // Ptr is filled w/ array + ); +- ++_Win32_SupportedOS_END_() ++ ++_Win32_SupportedOS_Server2000_ + DWORD // Status code + DhcpServerRedoAuthorization( // retry the rogue server stuff + _In_opt_ IN LPWSTR ServerIpAddr, // String form of server IP + IN ULONG dwReserved // reserved for future + ); + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD + DhcpAuditLogSetParams( // set some auditlogging params + _In_opt_ IN LPWSTR ServerIpAddress, +@@ -2768,6 +2810,7 @@ + IN ULONG DomainSize, // in BYTES + _Out_writes_(DomainSize) LPWSTR Domain + ); ++_Win32_SupportedOS_END_() + + DWORD + DhcpServerSetDnsRegCredentials( +@@ -2777,6 +2820,7 @@ + _In_opt_ IN LPWSTR Passwd + ); + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD + DhcpServerSetDnsRegCredentialsV5( + _In_opt_ IN LPWSTR ServerIpAddress, +@@ -2819,12 +2863,14 @@ + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, + LPDHCP_SERVER_SPECIFIC_STRINGS *ServerSpecificStrings + ); ++_Win32_SupportedOS_END_() + + void DHCP_API_FUNCTION + DhcpServerAuditlogParamsFree( + DHCP_SERVER_CONFIG_INFO_VQ *ConfigInfo + ); + ++_Win32_SupportedOS_BEGIN_(Server2008) + DWORD DHCP_API_FUNCTION + DhcpCreateSubnetV6( + _In_opt_ LPWSTR ServerIpAddress, +@@ -3003,6 +3049,7 @@ + _In_opt_z_ DHCP_CONST WCHAR *ServerIpAddress, + OUT LPDHCP_MIB_INFO_V5 *MibInfo + ); ++_Win32_SupportedOS_END_() + + DWORD DHCP_API_FUNCTION + DhcpAddSecurityGroup( +@@ -3010,6 +3057,7 @@ + ); + + ++_Win32_SupportedOS_BEGIN_(Server2012) + DWORD DHCP_API_FUNCTION + DhcpV4GetOptionValue ( + _In_opt_ IN LPWSTR ServerIpAddress, +@@ -3059,6 +3107,7 @@ + IN LPDHCP_OPTION_SCOPE_INFO ScopeInfo, + OUT LPDHCP_ALL_OPTION_VALUES_PB *Values + ); ++_Win32_SupportedOS_END_() + + + +@@ -3210,6 +3259,7 @@ + #define PREVSTATE 0x00000020 + #define SHAREDSECRET 0x00000040 + ++_Win32_SupportedOS_BEGIN_(Server2012) + DWORD DHCP_API_FUNCTION + DhcpV4FailoverCreateRelationship( + _In_opt_ LPWSTR ServerIpAddress, +@@ -3317,6 +3367,7 @@ + _In_ BOOL Enabled, + _Out_ LPDHCP_POLICY *Policy + ); ++_Win32_SupportedOS_END_() + + DWORD DHCP_API_FUNCTION + DhcpHlprCreateV4PolicyEx ( +@@ -3330,6 +3381,7 @@ + _Out_ LPDHCP_POLICY_EX *Policy + ); + ++_Win32_SupportedOS_BEGIN_(Server2012) + DWORD DHCP_API_FUNCTION + DhcpHlprAddV4PolicyExpr ( + _Inout_ LPDHCP_POLICY Policy, +@@ -3373,6 +3425,7 @@ + DhcpHlprFreeV4Policy ( + _Inout_ LPDHCP_POLICY Policy + ); ++_Win32_SupportedOS_END_() + + VOID DHCP_API_FUNCTION + DhcpHlprFreeV4PolicyArray ( +@@ -3406,6 +3459,7 @@ + _In_ DHCP_PROPERTY_TYPE Type + ); + ++_Win32_SupportedOS_BEGIN_(Server2012) + BOOL DHCP_API_FUNCTION + DhcpHlprIsV4PolicySingleUC( + _In_ LPDHCP_POLICY Policy +@@ -3575,6 +3629,7 @@ + _In_ DWORD NumFreeAddrReq, + _Out_ LPDHCPV6_IP_ARRAY *IPAddrList + ); ++_Win32_SupportedOS_END_() + + + diff --git a/generation/WinSDK/patches/post-midl/um/dhcpv6csdk.annotations.patch b/generation/WinSDK/patches/post-midl/um/dhcpv6csdk.annotations.patch new file mode 100644 index 000000000..4943c0192 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/dhcpv6csdk.annotations.patch @@ -0,0 +1,41 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/Dhcpv6cSdk.h b/generation/WinSDK/RecompiledIdlHeaders/um/Dhcpv6cSdk.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/Dhcpv6cSdk.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/Dhcpv6cSdk.h +@@ -1,4 +1,5 @@ + #include ++#include + + /*++ + +@@ -150,6 +151,7 @@ + #pragma region Application Family or OneCore Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + VOID + APIENTRY + Dhcpv6CApiInitialize( +@@ -173,6 +175,7 @@ + IN LPBYTE buffer, + IN OUT LPDWORD pSize + ); ++_Win32_SupportedOS_END_() + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */ + #pragma endregion +@@ -180,6 +183,7 @@ + #pragma region Desktop Family or OneCore Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + DWORD + APIENTRY + Dhcpv6RequestPrefix( +@@ -206,6 +210,7 @@ + IN LPDHCPV6CAPI_CLASSID classId, + IN LPDHCPV6PrefixLeaseInformation leaseInfo + ); ++_Win32_SupportedOS_END_() + + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */ diff --git a/generation/WinSDK/patches/post-midl/um/nb30.annotations.patch b/generation/WinSDK/patches/post-midl/um/nb30.annotations.patch new file mode 100644 index 000000000..17ae031ec --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/nb30.annotations.patch @@ -0,0 +1,19 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/nb30.h b/generation/WinSDK/RecompiledIdlHeaders/um/nb30.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/nb30.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/nb30.h +@@ -19,6 +19,7 @@ + #endif + + #include ++#include + + #ifdef __cplusplus + extern "C" { +@@ -302,6 +303,7 @@ + * Usage: result = Netbios( pncb ); * + ****************************************************************/ + ++_Win32_SupportedOS_Windows2000_ + UCHAR + APIENTRY + Netbios( diff --git a/generation/WinSDK/patches/post-midl/um/netsh.annotations.patch b/generation/WinSDK/patches/post-midl/um/netsh.annotations.patch new file mode 100644 index 000000000..8e7bddfbf --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/netsh.annotations.patch @@ -0,0 +1,27 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/NetSh.h b/generation/WinSDK/RecompiledIdlHeaders/um/NetSh.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/NetSh.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/NetSh.h +@@ -18,6 +18,7 @@ + #pragma once + #endif + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -310,6 +311,7 @@ + + typedef NS_DLL_INIT_FN *PNS_DLL_INIT_FN; + ++_Win32_SupportedOS_BEGIN_(WindowsXP) + DWORD WINAPI MatchEnumTag( + IN HANDLE hModule, + IN LPCWSTR pwcArg, +@@ -360,6 +362,7 @@ + IN CONST GUID *pguidParentContext, + IN CONST NS_HELPER_ATTRIBUTES *pfnRegisterSubContext + ); ++_Win32_SupportedOS_END_() + + #ifdef __cplusplus + } diff --git a/generation/WinSDK/patches/post-midl/um/npapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/npapi.annotations.patch new file mode 100644 index 000000000..765af6549 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/npapi.annotations.patch @@ -0,0 +1,270 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/Npapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/Npapi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/Npapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/Npapi.h +@@ -25,6 +25,7 @@ + #pragma once + #endif + #include ++#include + + #pragma region Desktop Family or OneCore Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) +@@ -43,6 +44,7 @@ + // CONNECTIONS + // + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPAddConnection ( + _In_ LPNETRESOURCEW lpNetResource, +@@ -57,13 +59,14 @@ + ); + + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPAddConnection3 ( + _In_opt_ HWND hwndOwner, + _In_ LPNETRESOURCEW lpNetResource, + _In_opt_ LPWSTR lpPassword, + _In_opt_ LPWSTR lpUserName, +- _In_ DWORD dwFlags ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags + ); + + typedef DWORD (APIENTRY *PF_NPAddConnection3) ( +@@ -95,6 +98,7 @@ + _In_ DWORD cbUseOptions + ); + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPCancelConnection ( + _In_ LPWSTR lpName, +@@ -119,6 +123,7 @@ + _In_ DWORD dwFlags + ); + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPGetConnection ( + _In_ LPWSTR lpLocalName, +@@ -136,6 +141,7 @@ + #define WNGETCON_CONNECTED 0x00000000 + #define WNGETCON_DISCONNECTED 0x00000001 + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPGetConnection3 ( + _In_ LPCWSTR lpLocalName, +@@ -152,10 +158,11 @@ + ); + + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPGetUniversalName ( + _In_ LPCWSTR lpLocalPath, +- _In_ DWORD dwInfoLevel, ++ _Win32_AssociatedEnum_(UNC_INFO_LEVEL) _In_ DWORD dwInfoLevel, + _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, + _Inout_ LPDWORD lpBufferSize + ); +@@ -167,6 +174,7 @@ + _Inout_ LPDWORD lpnBufferSize + ); + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPGetConnectionPerformance ( + _In_ LPCWSTR lpRemoteName, +@@ -179,6 +187,7 @@ + ); + + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPOpenEnum ( + _In_ DWORD dwScope, +@@ -196,6 +205,7 @@ + _Out_ LPHANDLE lphEnum + ); + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPEnumResource ( + _In_ HANDLE hEnum, +@@ -211,6 +221,7 @@ + _Inout_ LPDWORD lpBufferSize + ); + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPCloseEnum ( + _In_ HANDLE hEnum +@@ -284,6 +295,7 @@ + + + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPGetCaps ( + _In_ DWORD ndex +@@ -297,6 +309,7 @@ + // OTHER + // + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPGetUser ( + _In_ LPWSTR lpName, +@@ -381,6 +394,7 @@ + #pragma region Desktop Family or RemoteFS Package + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PKG_REMOTEFS) + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPGetResourceParent( + _In_ LPNETRESOURCEW lpNetResource, +@@ -394,6 +408,7 @@ + _Inout_ LPDWORD lpBufferSize + ); + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY NPGetResourceInformation( + _In_ LPNETRESOURCEW lpNetResource, + _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, +@@ -408,12 +423,13 @@ + _Outptr_ LPWSTR *lplpSystem + ); + ++_Win32_SupportedOS_WindowsXP_ + DWORD APIENTRY + NPFormatNetworkName( + _In_ LPWSTR lpRemoteName, + _Out_writes_(*lpnLength) LPWSTR lpFormattedName, + _Inout_ LPDWORD lpnLength, +- _In_ DWORD dwFlags, ++ _Win32_AssociatedEnum_(NETWORK_NAME_FORMAT_FLAGS) _In_ DWORD dwFlags, + _In_ DWORD dwAveCharPerLine + ); + +@@ -434,7 +450,7 @@ + DWORD APIENTRY + NPGetPropertyText( + _In_ DWORD iButton, +- _In_ DWORD nPropSel, ++ _Win32_AssociatedEnum_(NP_PROPERTY_DIALOG_SELECTION) _In_ DWORD nPropSel, + _In_ LPWSTR lpName, + _Out_writes_(nButtonNameLen) LPWSTR lpButtonName, + _In_ DWORD nButtonNameLen, +@@ -454,7 +470,7 @@ + NPPropertyDialog( + _In_ HWND hwndParent, + _In_ DWORD iButtonDlg, +- _In_ DWORD nPropSel, ++ _Win32_AssociatedEnum_(NP_PROPERTY_DIALOG_SELECTION) _In_ DWORD nPropSel, + _In_ LPWSTR lpFileName, + _In_ DWORD nType + ); +@@ -496,7 +512,7 @@ + NPDirectoryNotify ( + _In_ HWND hwnd, + _In_ LPWSTR lpDir, +- _In_ DWORD dwOper ++ _Win32_AssociatedEnum_(NPDIRECTORY_NOTIFY_OPERATION) _In_ DWORD dwOper + ); + + typedef DWORD (APIENTRY *PF_NPDirectoryNotify) ( +@@ -511,6 +527,7 @@ + #pragma region Desktop Family or OneCore Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) + ++_Win32_SupportedOS_WindowsXP_ + VOID + WNetSetLastErrorA( + _In_ DWORD err, +@@ -615,7 +632,7 @@ + typedef struct _NOTIFYADD { + HWND hwndOwner; + NETRESOURCE NetResource; +- DWORD dwAddFlags; ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) DWORD dwAddFlags; + } NOTIFYADD, *LPNOTIFYADD; + + typedef struct _NOTIFYCANCEL { +@@ -679,7 +696,7 @@ + NPFMXEditPerm ( + _In_ LPWSTR lpDriveName, + _In_ HWND hwndFMX, +- _In_ DWORD nDialogType ++ _Win32_AssociatedEnum_(WNPERM_DLG) _In_ DWORD nDialogType + ); + + typedef DWORD (APIENTRY *PF_NPFMXEditPerm) ( +@@ -691,7 +708,7 @@ + DWORD APIENTRY + NPFMXGetPermHelp ( + _In_ LPWSTR lpDriveName, +- _In_ DWORD nDialogType, ++ _Win32_AssociatedEnum_(WNPERM_DLG) _In_ DWORD nDialogType, + _In_ BOOL fDirectory, + _Out_writes_(*lpBufferSize) LPVOID lpFileNameBuffer, + _Inout_ LPDWORD lpBufferSize, +@@ -707,6 +724,56 @@ + _Out_ LPDWORD lpnHelpContext + ); + ++#ifdef WIN32METADATA ++#pragma push_macro("WNPERM_DLG_PERM") ++#undef WNPERM_DLG_PERM ++#pragma push_macro("WNPERM_DLG_AUDIT") ++#undef WNPERM_DLG_AUDIT ++#pragma push_macro("WNPERM_DLG_OWNER") ++#undef WNPERM_DLG_OWNER ++enum WNPERM_DLG : DWORD ++{ ++ WNPERM_DLG_PERM = 0u, ++ WNPERM_DLG_AUDIT = 1u, ++ WNPERM_DLG_OWNER = 2u, ++}; ++#pragma pop_macro("WNPERM_DLG_OWNER") ++#pragma pop_macro("WNPERM_DLG_AUDIT") ++#pragma pop_macro("WNPERM_DLG_PERM") ++ ++#pragma push_macro("WNPS_FILE") ++#undef WNPS_FILE ++#pragma push_macro("WNPS_DIR") ++#undef WNPS_DIR ++#pragma push_macro("WNPS_MULT") ++#undef WNPS_MULT ++enum NP_PROPERTY_DIALOG_SELECTION : DWORD ++{ ++ WNPS_FILE = 0u, ++ WNPS_DIR = 1u, ++ WNPS_MULT = 2u, ++}; ++#pragma pop_macro("WNPS_MULT") ++#pragma pop_macro("WNPS_DIR") ++#pragma pop_macro("WNPS_FILE") ++ ++#pragma push_macro("WNDN_MKDIR") ++#undef WNDN_MKDIR ++#pragma push_macro("WNDN_RMDIR") ++#undef WNDN_RMDIR ++#pragma push_macro("WNDN_MVDIR") ++#undef WNDN_MVDIR ++enum NPDIRECTORY_NOTIFY_OPERATION : DWORD ++{ ++ WNDN_MKDIR = 1u, ++ WNDN_RMDIR = 2u, ++ WNDN_MVDIR = 3u, ++}; ++#pragma pop_macro("WNDN_MVDIR") ++#pragma pop_macro("WNDN_RMDIR") ++#pragma pop_macro("WNDN_MKDIR") ++#endif ++ + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ + #pragma endregion + diff --git a/generation/WinSDK/patches/post-midl/um/winnetwk.annotations.patch b/generation/WinSDK/patches/post-midl/um/winnetwk.annotations.patch new file mode 100644 index 000000000..87afd4080 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/winnetwk.annotations.patch @@ -0,0 +1,890 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/winnetwk.h b/generation/WinSDK/RecompiledIdlHeaders/um/winnetwk.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/winnetwk.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/winnetwk.h +@@ -1,4 +1,5 @@ + #include ++#include + + /*++ + +@@ -98,8 +99,8 @@ + #endif /* WINVER >= 0x0400 */ + + typedef struct _NETRESOURCEA { +- DWORD dwScope; +- DWORD dwType; ++ _Win32_AssociatedEnum_(NET_RESOURCE_SCOPE) DWORD dwScope; ++ _Win32_AssociatedEnum_(NET_RESOURCE_TYPE) DWORD dwType; + DWORD dwDisplayType; + DWORD dwUsage; + LPSTR lpLocalName; +@@ -108,8 +109,8 @@ + LPSTR lpProvider; + }NETRESOURCEA, *LPNETRESOURCEA; + typedef struct _NETRESOURCEW { +- DWORD dwScope; +- DWORD dwType; ++ _Win32_AssociatedEnum_(NET_RESOURCE_SCOPE) DWORD dwScope; ++ _Win32_AssociatedEnum_(NET_RESOURCE_TYPE) DWORD dwType; + DWORD dwDisplayType; + DWORD dwUsage; + LPWSTR lpLocalName; +@@ -162,6 +163,8 @@ + + #endif + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetAddConnectionA( +@@ -169,6 +172,7 @@ + _In_opt_ LPCSTR lpPassword, + _In_opt_ LPCSTR lpLocalName + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetAddConnectionW( +@@ -176,34 +180,41 @@ + _In_opt_ LPCWSTR lpPassword, + _In_opt_ LPCWSTR lpLocalName + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetAddConnection WNetAddConnectionW + #else + #define WNetAddConnection WNetAddConnectionA + #endif // !UNICODE + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetAddConnection2A( + _In_ LPNETRESOURCEA lpNetResource, + _In_opt_ LPCSTR lpPassword, + _In_opt_ LPCSTR lpUserName, +- _In_ DWORD dwFlags +- ); ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags ++ ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetAddConnection2W( + _In_ LPNETRESOURCEW lpNetResource, + _In_opt_ LPCWSTR lpPassword, + _In_opt_ LPCWSTR lpUserName, +- _In_ DWORD dwFlags +- ); ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags ++ ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetAddConnection2 WNetAddConnection2W + #else + #define WNetAddConnection2 WNetAddConnection2A + #endif // !UNICODE + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetAddConnection3A( +@@ -211,8 +222,9 @@ + _In_ LPNETRESOURCEA lpNetResource, + _In_opt_ LPCSTR lpPassword, + _In_opt_ LPCSTR lpUserName, +- _In_ DWORD dwFlags +- ); ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags ++ ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetAddConnection3W( +@@ -220,8 +232,9 @@ + _In_ LPNETRESOURCEW lpNetResource, + _In_opt_ LPCWSTR lpPassword, + _In_opt_ LPCWSTR lpUserName, +- _In_ DWORD dwFlags +- ); ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags ++ ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetAddConnection3 WNetAddConnection3W + #else +@@ -229,6 +242,7 @@ + #endif // !UNICODE + + #if(_WIN32_WINNT >= _WIN32_WINNT_WIN10) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetAddConnection4A( +@@ -236,10 +250,11 @@ + _In_ LPNETRESOURCEA lpNetResource, + _In_reads_bytes_(cbAuthBuffer) PVOID pAuthBuffer, + _In_ DWORD cbAuthBuffer, +- _In_ DWORD dwFlags, ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags, + _In_reads_bytes_(cbUseOptions) PBYTE lpUseOptions, + _In_ DWORD cbUseOptions + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetAddConnection4W( +@@ -247,7 +262,7 @@ + _In_ LPNETRESOURCEW lpNetResource, + _In_reads_bytes_(cbAuthBuffer) PVOID pAuthBuffer, + _In_ DWORD cbAuthBuffer, +- _In_ DWORD dwFlags, ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags, + _In_reads_bytes_(cbUseOptions) PBYTE lpUseOptions, + _In_ DWORD cbUseOptions + ); +@@ -258,44 +273,54 @@ + #endif // !UNICODE + #endif //(_WIN32_WINNT >= _WIN32_WINNT_WIN10) + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetCancelConnectionA( + _In_ LPCSTR lpName, + _In_ BOOL fForce + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetCancelConnectionW( + _In_ LPCWSTR lpName, + _In_ BOOL fForce + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetCancelConnection WNetCancelConnectionW + #else + #define WNetCancelConnection WNetCancelConnectionA + #endif // !UNICODE + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetCancelConnection2A( + _In_ LPCSTR lpName, +- _In_ DWORD dwFlags, ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags, + _In_ BOOL fForce + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetCancelConnection2W( + _In_ LPCWSTR lpName, +- _In_ DWORD dwFlags, ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags, + _In_ BOOL fForce + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetCancelConnection2 WNetCancelConnection2W + #else + #define WNetCancelConnection2 WNetCancelConnection2A + #endif // !UNICODE + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetConnectionA( +@@ -303,6 +328,7 @@ + _Out_writes_opt_(*lpnLength) LPSTR lpRemoteName, + _Inout_ LPDWORD lpnLength + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetConnectionW( +@@ -310,6 +336,7 @@ + _Out_writes_opt_(*lpnLength) LPWSTR lpRemoteName, + _Inout_ LPDWORD lpnLength + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetGetConnection WNetGetConnectionW + #else +@@ -349,6 +376,8 @@ + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) + + #if(WINVER >= 0x0400) ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetUseConnectionA( +@@ -356,11 +385,12 @@ + _In_ LPNETRESOURCEA lpNetResource, + _In_opt_ LPCSTR lpPassword, + _In_opt_ LPCSTR lpUserId, +- _In_ DWORD dwFlags, ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags, + _Out_writes_opt_(*lpBufferSize) LPSTR lpAccessName, + _Inout_opt_ LPDWORD lpBufferSize, + _Out_opt_ LPDWORD lpResult + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetUseConnectionW( +@@ -368,11 +398,12 @@ + _In_ LPNETRESOURCEW lpNetResource, + _In_opt_ LPCWSTR lpPassword, + _In_opt_ LPCWSTR lpUserId, +- _In_ DWORD dwFlags, ++ _Win32_AssociatedEnum_(NET_CONNECT_FLAGS) _In_ DWORD dwFlags, + _Out_writes_opt_(*lpBufferSize) LPWSTR lpAccessName, + _Inout_opt_ LPDWORD lpBufferSize, + _Out_opt_ LPDWORD lpResult + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetUseConnection WNetUseConnectionW + #else +@@ -381,6 +412,7 @@ + #endif /* WINVER >= 0x0400 */ + + #if(_WIN32_WINNT >= _WIN32_WINNT_WIN10) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetUseConnection4A( +@@ -395,6 +427,7 @@ + _Inout_opt_ LPDWORD lpBufferSize, + _Out_opt_ LPDWORD lpResult + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetUseConnection4W( +@@ -420,6 +453,8 @@ + // + // Network Connection Dialogs. + // ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetConnectionDialog( +@@ -427,26 +462,28 @@ + _In_ DWORD dwType + ); + ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetDisconnectDialog( + _In_opt_ HWND hwnd, + _In_ DWORD dwType + ); ++_Win32_SupportedOS_END_() + + #if(WINVER >= 0x0400) + typedef struct _CONNECTDLGSTRUCTA{ + DWORD cbStructure; /* size of this structure in bytes */ + HWND hwndOwner; /* owner window for the dialog */ + LPNETRESOURCEA lpConnRes;/* Requested Resource info */ +- DWORD dwFlags; /* flags (see below) */ ++ _Win32_AssociatedEnum_(CONNECTDLGSTRUCT_FLAGS) DWORD dwFlags; /* flags (see below) */ + DWORD dwDevNum; /* number of devices connected to */ + } CONNECTDLGSTRUCTA, FAR *LPCONNECTDLGSTRUCTA; + typedef struct _CONNECTDLGSTRUCTW{ + DWORD cbStructure; /* size of this structure in bytes */ + HWND hwndOwner; /* owner window for the dialog */ + LPNETRESOURCEW lpConnRes;/* Requested Resource info */ +- DWORD dwFlags; /* flags (see below) */ ++ _Win32_AssociatedEnum_(CONNECTDLGSTRUCT_FLAGS) DWORD dwFlags; /* flags (see below) */ + DWORD dwDevNum; /* number of devices connected to */ + } CONNECTDLGSTRUCTW, FAR *LPCONNECTDLGSTRUCTW; + #ifdef UNICODE +@@ -470,16 +507,20 @@ + #define CONNDLG_PERSIST 0x00000010 /* Force persistent connection */ + #define CONNDLG_NOT_PERSIST 0x00000020 /* Force connection NOT persistent */ + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetConnectionDialog1A( + _Inout_ LPCONNECTDLGSTRUCTA lpConnDlgStruct + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetConnectionDialog1W( + _Inout_ LPCONNECTDLGSTRUCTW lpConnDlgStruct + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetConnectionDialog1 WNetConnectionDialog1W + #else +@@ -491,14 +532,14 @@ + HWND hwndOwner; /* owner window for the dialog */ + LPSTR lpLocalName; /* local device name */ + LPSTR lpRemoteName; /* network resource name */ +- DWORD dwFlags; /* flags */ ++ _Win32_AssociatedEnum_(DISCDLGSTRUCT_FLAGS) DWORD dwFlags; /* flags */ + } DISCDLGSTRUCTA, FAR *LPDISCDLGSTRUCTA; + typedef struct _DISCDLGSTRUCTW{ + DWORD cbStructure; /* size of this structure in bytes */ + HWND hwndOwner; /* owner window for the dialog */ + LPWSTR lpLocalName; /* local device name */ + LPWSTR lpRemoteName; /* network resource name */ +- DWORD dwFlags; /* flags */ ++ _Win32_AssociatedEnum_(DISCDLGSTRUCT_FLAGS) DWORD dwFlags; /* flags */ + } DISCDLGSTRUCTW, FAR *LPDISCDLGSTRUCTW; + #ifdef UNICODE + typedef DISCDLGSTRUCTW DISCDLGSTRUCT; +@@ -511,16 +552,20 @@ + #define DISC_UPDATE_PROFILE 0x00000001 + #define DISC_NO_FORCE 0x00000040 + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetDisconnectDialog1A( + _In_ LPDISCDLGSTRUCTA lpConnDlgStruct + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetDisconnectDialog1W( + _In_ LPDISCDLGSTRUCTW lpConnDlgStruct + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetDisconnectDialog1 WNetDisconnectDialog1W + #else +@@ -532,52 +577,62 @@ + // Network Browsing. + // + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetOpenEnumA( +- _In_ DWORD dwScope, +- _In_ DWORD dwType, +- _In_ DWORD dwUsage, ++ _Win32_AssociatedEnum_(NET_RESOURCE_SCOPE) _In_ DWORD dwScope, ++ _Win32_AssociatedEnum_(NET_RESOURCE_TYPE) _In_ DWORD dwType, ++ _Win32_AssociatedEnum_(WNET_OPEN_ENUM_USAGE) _In_ DWORD dwUsage, + _In_opt_ LPNETRESOURCEA lpNetResource, +- _Out_ LPHANDLE lphEnum +- ); ++ _Win32_RAIIFree_(WNetCloseEnum) _Out_ LPHANDLE lphEnum ++ ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetOpenEnumW( +- _In_ DWORD dwScope, +- _In_ DWORD dwType, +- _In_ DWORD dwUsage, ++ _Win32_AssociatedEnum_(NET_RESOURCE_SCOPE) _In_ DWORD dwScope, ++ _Win32_AssociatedEnum_(NET_RESOURCE_TYPE) _In_ DWORD dwType, ++ _Win32_AssociatedEnum_(WNET_OPEN_ENUM_USAGE) _In_ DWORD dwUsage, + _In_opt_ LPNETRESOURCEW lpNetResource, +- _Out_ LPHANDLE lphEnum +- ); ++ _Win32_RAIIFree_(WNetCloseEnum) _Out_ LPHANDLE lphEnum ++ ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetOpenEnum WNetOpenEnumW + #else + #define WNetOpenEnum WNetOpenEnumA + #endif // !UNICODE + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetEnumResourceA( + _In_ HANDLE hEnum, + _Inout_ LPDWORD lpcCount, +- _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, ++ _Win32_ContainsInteriorPointers_ _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, + _Inout_ LPDWORD lpBufferSize + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetEnumResourceW( + _In_ HANDLE hEnum, + _Inout_ LPDWORD lpcCount, +- _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, ++ _Win32_ContainsInteriorPointers_ _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, + _Inout_ LPDWORD lpBufferSize + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetEnumResource WNetEnumResourceW + #else + #define WNetEnumResource WNetEnumResourceA + #endif // !UNICODE + ++_Win32_SupportedOS_Windows2000_ ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetCloseEnum( +@@ -585,42 +640,50 @@ + ); + + #if(WINVER >= 0x0400) ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetResourceParentA( + _In_ LPNETRESOURCEA lpNetResource, +- _Out_writes_bytes_(*lpcbBuffer) LPVOID lpBuffer, ++ _Win32_ContainsInteriorPointers_ _Out_writes_bytes_(*lpcbBuffer) LPVOID lpBuffer, + _Inout_ LPDWORD lpcbBuffer + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetResourceParentW( + _In_ LPNETRESOURCEW lpNetResource, +- _Out_writes_bytes_(*lpcbBuffer) LPVOID lpBuffer, ++ _Win32_ContainsInteriorPointers_ _Out_writes_bytes_(*lpcbBuffer) LPVOID lpBuffer, + _Inout_ LPDWORD lpcbBuffer + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetGetResourceParent WNetGetResourceParentW + #else + #define WNetGetResourceParent WNetGetResourceParentA + #endif // !UNICODE + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetResourceInformationA( + _In_ LPNETRESOURCEA lpNetResource, +- _Out_writes_bytes_(*lpcbBuffer) LPVOID lpBuffer, ++ _Win32_ContainsInteriorPointers_ _Out_writes_bytes_(*lpcbBuffer) LPVOID lpBuffer, + _Inout_ LPDWORD lpcbBuffer, + _Outptr_ LPSTR *lplpSystem + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetResourceInformationW( + _In_ LPNETRESOURCEW lpNetResource, +- _Out_writes_bytes_(*lpcbBuffer) LPVOID lpBuffer, ++ _Win32_ContainsInteriorPointers_ _Out_writes_bytes_(*lpcbBuffer) LPVOID lpBuffer, + _Inout_ LPDWORD lpcbBuffer, + _Outptr_ LPWSTR *lplpSystem + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetGetResourceInformation WNetGetResourceInformationW + #else +@@ -667,22 +730,26 @@ + typedef LPREMOTE_NAME_INFOA LPREMOTE_NAME_INFO; + #endif // UNICODE + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetUniversalNameA( + _In_ LPCSTR lpLocalPath, +- _In_ DWORD dwInfoLevel, +- _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, ++ _Win32_AssociatedEnum_(UNC_INFO_LEVEL) _In_ DWORD dwInfoLevel, ++ _Win32_ContainsInteriorPointers_ _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, + _Inout_ LPDWORD lpBufferSize + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetUniversalNameW( + _In_ LPCWSTR lpLocalPath, +- _In_ DWORD dwInfoLevel, +- _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, ++ _Win32_AssociatedEnum_(UNC_INFO_LEVEL) _In_ DWORD dwInfoLevel, ++ _Win32_ContainsInteriorPointers_ _Out_writes_bytes_(*lpBufferSize) LPVOID lpBuffer, + _Inout_ LPDWORD lpBufferSize + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetGetUniversalName WNetGetUniversalNameW + #else +@@ -692,6 +759,8 @@ + // + // Authentication and Logon/Logoff. + // ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetUserA( +@@ -702,6 +771,7 @@ + // + // Authentication and Logon/Logoff. + // ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetUserW( +@@ -709,6 +779,7 @@ + _Out_writes_(*lpnLength) LPWSTR lpUserName, + _Inout_ LPDWORD lpnLength + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetGetUser WNetGetUserW + #else +@@ -730,6 +801,8 @@ + + + #if(WINVER >= 0x0400) ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetProviderNameA( +@@ -737,6 +810,7 @@ + _Out_writes_(*lpBufferSize) LPSTR lpProviderName, + _Inout_ LPDWORD lpBufferSize + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetProviderNameW( +@@ -744,6 +818,7 @@ + _Out_writes_(*lpBufferSize) LPWSTR lpProviderName, + _Inout_ LPDWORD lpBufferSize + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetGetProviderName WNetGetProviderNameW + #else +@@ -753,8 +828,8 @@ + typedef struct _NETINFOSTRUCT{ + DWORD cbStructure; + DWORD dwProviderVersion; +- DWORD dwStatus; +- DWORD dwCharacteristics; ++ _Win32_AssociatedEnum_(WIN32_ERROR) DWORD dwStatus; ++ _Win32_AssociatedEnum_(NETINFOSTRUCT_CHARACTERISTICS) DWORD dwCharacteristics; + ULONG_PTR dwHandle; + WORD wNetType; + DWORD dwPrinters; +@@ -765,18 +840,22 @@ + #define NETINFO_DISKRED 0x00000004 /* Provider requires disk redirections to connect */ + #define NETINFO_PRINTERRED 0x00000008 /* Provider requires printer redirections to connect */ + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetNetworkInformationA( + _In_ LPCSTR lpProvider, + _Out_ LPNETINFOSTRUCT lpNetInfoStruct + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) + _Check_return_ + DWORD APIENTRY + WNetGetNetworkInformationW( + _In_ LPCWSTR lpProvider, + _Out_ LPNETINFOSTRUCT lpNetInfoStruct + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetGetNetworkInformation WNetGetNetworkInformationW + #else +@@ -789,6 +868,9 @@ + // Error handling. + // + ++_Win32_SupportedOS_BEGIN_(Windows2000) ++_Win32_AssociatedEnum_(WIN32_ERROR) ++_Win32_SetLastError_ + _Check_return_ + DWORD APIENTRY + WNetGetLastErrorA( +@@ -798,6 +880,8 @@ + _Out_writes_(nNameBufSize) LPSTR lpNameBuf, + _In_ DWORD nNameBufSize + ); ++_Win32_AssociatedEnum_(WIN32_ERROR) ++_Win32_SetLastError_ + _Check_return_ + DWORD APIENTRY + WNetGetLastErrorW( +@@ -807,6 +891,7 @@ + _Out_writes_(nNameBufSize) LPWSTR lpNameBuf, + _In_ DWORD nNameBufSize + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define WNetGetLastError WNetGetLastErrorW + #else +@@ -895,6 +980,7 @@ + #define WNCON_SLOWLINK 0x00000004 + #define WNCON_DYNAMIC 0x00000008 + ++_Win32_SupportedOS_BEGIN_(Windows2000) + _Check_return_ + DWORD APIENTRY + MultinetGetConnectionPerformanceA( +@@ -907,6 +993,7 @@ + _In_ LPNETRESOURCEW lpNetResource, + _Out_ LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct + ); ++_Win32_SupportedOS_END_() + #ifdef UNICODE + #define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceW + #else +@@ -914,6 +1001,228 @@ + #endif // !UNICODE + #endif /* WINVER >= 0x0400 */ + ++ ++#ifdef WIN32METADATA ++#pragma push_macro("UNIVERSAL_NAME_INFO_LEVEL") ++#undef UNIVERSAL_NAME_INFO_LEVEL ++#pragma push_macro("REMOTE_NAME_INFO_LEVEL") ++#undef REMOTE_NAME_INFO_LEVEL ++enum UNC_INFO_LEVEL : DWORD ++{ ++ UNIVERSAL_NAME_INFO_LEVEL = 1u, ++ REMOTE_NAME_INFO_LEVEL = 2u, ++}; ++#pragma pop_macro("REMOTE_NAME_INFO_LEVEL") ++#pragma pop_macro("UNIVERSAL_NAME_INFO_LEVEL") ++ ++#pragma push_macro("RESOURCEUSAGE_NONE") ++#undef RESOURCEUSAGE_NONE ++#pragma push_macro("RESOURCEUSAGE_CONNECTABLE") ++#undef RESOURCEUSAGE_CONNECTABLE ++#pragma push_macro("RESOURCEUSAGE_CONTAINER") ++#undef RESOURCEUSAGE_CONTAINER ++#pragma push_macro("RESOURCEUSAGE_ATTACHED") ++#undef RESOURCEUSAGE_ATTACHED ++#pragma push_macro("RESOURCEUSAGE_ALL") ++#undef RESOURCEUSAGE_ALL ++enum [[clang::flag_enum]] WNET_OPEN_ENUM_USAGE : DWORD ++{ ++ RESOURCEUSAGE_NONE = 0u, ++ RESOURCEUSAGE_CONNECTABLE = 1u, ++ RESOURCEUSAGE_CONTAINER = 2u, ++ RESOURCEUSAGE_ATTACHED = 16u, ++ RESOURCEUSAGE_ALL = 19u, ++}; ++#pragma pop_macro("RESOURCEUSAGE_ALL") ++#pragma pop_macro("RESOURCEUSAGE_ATTACHED") ++#pragma pop_macro("RESOURCEUSAGE_CONTAINER") ++#pragma pop_macro("RESOURCEUSAGE_CONNECTABLE") ++#pragma pop_macro("RESOURCEUSAGE_NONE") ++ ++#pragma push_macro("CONNECT_UPDATE_PROFILE") ++#undef CONNECT_UPDATE_PROFILE ++#pragma push_macro("CONNECT_UPDATE_RECENT") ++#undef CONNECT_UPDATE_RECENT ++#pragma push_macro("CONNECT_TEMPORARY") ++#undef CONNECT_TEMPORARY ++#pragma push_macro("CONNECT_INTERACTIVE") ++#undef CONNECT_INTERACTIVE ++#pragma push_macro("CONNECT_PROMPT") ++#undef CONNECT_PROMPT ++#pragma push_macro("CONNECT_NEED_DRIVE") ++#undef CONNECT_NEED_DRIVE ++#pragma push_macro("CONNECT_REFCOUNT") ++#undef CONNECT_REFCOUNT ++#pragma push_macro("CONNECT_REDIRECT") ++#undef CONNECT_REDIRECT ++#pragma push_macro("CONNECT_LOCALDRIVE") ++#undef CONNECT_LOCALDRIVE ++#pragma push_macro("CONNECT_CURRENT_MEDIA") ++#undef CONNECT_CURRENT_MEDIA ++#pragma push_macro("CONNECT_DEFERRED") ++#undef CONNECT_DEFERRED ++#pragma push_macro("CONNECT_RESERVED") ++#undef CONNECT_RESERVED ++#pragma push_macro("CONNECT_COMMANDLINE") ++#undef CONNECT_COMMANDLINE ++#pragma push_macro("CONNECT_CMD_SAVECRED") ++#undef CONNECT_CMD_SAVECRED ++#pragma push_macro("CONNECT_CRED_RESET") ++#undef CONNECT_CRED_RESET ++#pragma push_macro("CONNECT_REQUIRE_INTEGRITY") ++#undef CONNECT_REQUIRE_INTEGRITY ++#pragma push_macro("CONNECT_REQUIRE_PRIVACY") ++#undef CONNECT_REQUIRE_PRIVACY ++#pragma push_macro("CONNECT_WRITE_THROUGH_SEMANTICS") ++#undef CONNECT_WRITE_THROUGH_SEMANTICS ++#pragma push_macro("CONNECT_GLOBAL_MAPPING") ++#undef CONNECT_GLOBAL_MAPPING ++enum [[clang::flag_enum]] NET_CONNECT_FLAGS : DWORD ++{ ++ CONNECT_UPDATE_PROFILE = 1u, ++ CONNECT_UPDATE_RECENT = 2u, ++ CONNECT_TEMPORARY = 4u, ++ CONNECT_INTERACTIVE = 8u, ++ CONNECT_PROMPT = 16u, ++ CONNECT_NEED_DRIVE = 32u, ++ CONNECT_REFCOUNT = 64u, ++ CONNECT_REDIRECT = 128u, ++ CONNECT_LOCALDRIVE = 256u, ++ CONNECT_CURRENT_MEDIA = 512u, ++ CONNECT_DEFERRED = 1024u, ++ CONNECT_RESERVED = 4278190080u, ++ CONNECT_COMMANDLINE = 2048u, ++ CONNECT_CMD_SAVECRED = 4096u, ++ CONNECT_CRED_RESET = 8192u, ++ CONNECT_REQUIRE_INTEGRITY = 16384u, ++ CONNECT_REQUIRE_PRIVACY = 32768u, ++ CONNECT_WRITE_THROUGH_SEMANTICS = 65536u, ++ CONNECT_GLOBAL_MAPPING = 262144u, ++}; ++#pragma pop_macro("CONNECT_GLOBAL_MAPPING") ++#pragma pop_macro("CONNECT_WRITE_THROUGH_SEMANTICS") ++#pragma pop_macro("CONNECT_REQUIRE_PRIVACY") ++#pragma pop_macro("CONNECT_REQUIRE_INTEGRITY") ++#pragma pop_macro("CONNECT_CRED_RESET") ++#pragma pop_macro("CONNECT_CMD_SAVECRED") ++#pragma pop_macro("CONNECT_COMMANDLINE") ++#pragma pop_macro("CONNECT_RESERVED") ++#pragma pop_macro("CONNECT_DEFERRED") ++#pragma pop_macro("CONNECT_CURRENT_MEDIA") ++#pragma pop_macro("CONNECT_LOCALDRIVE") ++#pragma pop_macro("CONNECT_REDIRECT") ++#pragma pop_macro("CONNECT_REFCOUNT") ++#pragma pop_macro("CONNECT_NEED_DRIVE") ++#pragma pop_macro("CONNECT_PROMPT") ++#pragma pop_macro("CONNECT_INTERACTIVE") ++#pragma pop_macro("CONNECT_TEMPORARY") ++#pragma pop_macro("CONNECT_UPDATE_RECENT") ++#pragma pop_macro("CONNECT_UPDATE_PROFILE") ++ ++#pragma push_macro("RESOURCETYPE_ANY") ++#undef RESOURCETYPE_ANY ++#pragma push_macro("RESOURCETYPE_DISK") ++#undef RESOURCETYPE_DISK ++#pragma push_macro("RESOURCETYPE_PRINT") ++#undef RESOURCETYPE_PRINT ++enum [[clang::flag_enum]] NET_RESOURCE_TYPE : DWORD ++{ ++ RESOURCETYPE_ANY = 0u, ++ RESOURCETYPE_DISK = 1u, ++ RESOURCETYPE_PRINT = 2u, ++}; ++#pragma pop_macro("RESOURCETYPE_PRINT") ++#pragma pop_macro("RESOURCETYPE_DISK") ++#pragma pop_macro("RESOURCETYPE_ANY") ++ ++#pragma push_macro("WNFMT_MULTILINE") ++#undef WNFMT_MULTILINE ++#pragma push_macro("WNFMT_ABBREVIATED") ++#undef WNFMT_ABBREVIATED ++enum NETWORK_NAME_FORMAT_FLAGS : DWORD ++{ ++ WNFMT_MULTILINE = 1u, ++ WNFMT_ABBREVIATED = 2u, ++}; ++#pragma pop_macro("WNFMT_ABBREVIATED") ++#pragma pop_macro("WNFMT_MULTILINE") ++ ++#pragma push_macro("RESOURCE_CONNECTED") ++#undef RESOURCE_CONNECTED ++#pragma push_macro("RESOURCE_CONTEXT") ++#undef RESOURCE_CONTEXT ++#pragma push_macro("RESOURCE_GLOBALNET") ++#undef RESOURCE_GLOBALNET ++#pragma push_macro("RESOURCE_REMEMBERED") ++#undef RESOURCE_REMEMBERED ++enum NET_RESOURCE_SCOPE : DWORD ++{ ++ RESOURCE_CONNECTED = 1u, ++ RESOURCE_CONTEXT = 5u, ++ RESOURCE_GLOBALNET = 2u, ++ RESOURCE_REMEMBERED = 3u, ++}; ++#pragma pop_macro("RESOURCE_REMEMBERED") ++#pragma pop_macro("RESOURCE_GLOBALNET") ++#pragma pop_macro("RESOURCE_CONTEXT") ++#pragma pop_macro("RESOURCE_CONNECTED") ++ ++#pragma push_macro("NETINFO_DLL16") ++#undef NETINFO_DLL16 ++#pragma push_macro("NETINFO_DISKRED") ++#undef NETINFO_DISKRED ++#pragma push_macro("NETINFO_PRINTERRED") ++#undef NETINFO_PRINTERRED ++enum [[clang::flag_enum]] NETINFOSTRUCT_CHARACTERISTICS : DWORD ++{ ++ NETINFO_DLL16 = 1u, ++ NETINFO_DISKRED = 4u, ++ NETINFO_PRINTERRED = 8u, ++}; ++#pragma pop_macro("NETINFO_PRINTERRED") ++#pragma pop_macro("NETINFO_DISKRED") ++#pragma pop_macro("NETINFO_DLL16") ++ ++#pragma push_macro("CONNDLG_RO_PATH") ++#undef CONNDLG_RO_PATH ++#pragma push_macro("CONNDLG_CONN_POINT") ++#undef CONNDLG_CONN_POINT ++#pragma push_macro("CONNDLG_USE_MRU") ++#undef CONNDLG_USE_MRU ++#pragma push_macro("CONNDLG_HIDE_BOX") ++#undef CONNDLG_HIDE_BOX ++#pragma push_macro("CONNDLG_PERSIST") ++#undef CONNDLG_PERSIST ++#pragma push_macro("CONNDLG_NOT_PERSIST") ++#undef CONNDLG_NOT_PERSIST ++enum [[clang::flag_enum]] CONNECTDLGSTRUCT_FLAGS : DWORD ++{ ++ CONNDLG_RO_PATH = 1u, ++ CONNDLG_CONN_POINT = 2u, ++ CONNDLG_USE_MRU = 4u, ++ CONNDLG_HIDE_BOX = 8u, ++ CONNDLG_PERSIST = 16u, ++ CONNDLG_NOT_PERSIST = 32u, ++}; ++#pragma pop_macro("CONNDLG_NOT_PERSIST") ++#pragma pop_macro("CONNDLG_PERSIST") ++#pragma pop_macro("CONNDLG_HIDE_BOX") ++#pragma pop_macro("CONNDLG_USE_MRU") ++#pragma pop_macro("CONNDLG_CONN_POINT") ++#pragma pop_macro("CONNDLG_RO_PATH") ++ ++#pragma push_macro("DISC_UPDATE_PROFILE") ++#undef DISC_UPDATE_PROFILE ++#pragma push_macro("DISC_NO_FORCE") ++#undef DISC_NO_FORCE ++enum [[clang::flag_enum]] DISCDLGSTRUCT_FLAGS : DWORD ++{ ++ DISC_UPDATE_PROFILE = 1u, ++ DISC_NO_FORCE = 64u, ++}; ++#pragma pop_macro("DISC_NO_FORCE") ++#pragma pop_macro("DISC_UPDATE_PROFILE") ++#endif + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */ + #pragma endregion diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 708e855f4..8e6b94e9e 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -2325,197 +2325,6 @@ IPart=SupportedOSPlatform("windows6.0.6000") IPartsList=SupportedOSPlatform("windows6.0.6000") IPerChannelDbLevel=SupportedOSPlatform("windows6.0.6000") ISubunit=SupportedOSPlatform("windows6.0.6000") -DhcpCApiCleanup=SupportedOSPlatform("windows5.0") -DhcpCApiInitialize=SupportedOSPlatform("windows5.0") -DhcpDeRegisterParamChange=SupportedOSPlatform("windows5.0") -DhcpRegisterParamChange=SupportedOSPlatform("windows5.0") -DhcpRemoveDNSRegistrations=SupportedOSPlatform("windows5.0") -DhcpRequestParams=SupportedOSPlatform("windows5.0") -DhcpUndoRequestParams=SupportedOSPlatform("windows5.0") -DhcpAddFilterV4=SupportedOSPlatform("windowsserver2008") -DhcpAddServer=SupportedOSPlatform("windowsserver2000") -DhcpAddSubnetElement=SupportedOSPlatform("windowsserver2008") -DhcpAddSubnetElementV4=SupportedOSPlatform("windowsserver2008") -DhcpAddSubnetElementV5=SupportedOSPlatform("windowsserver2000") -DhcpAddSubnetElementV6=SupportedOSPlatform("windowsserver2008") -DhcpAuditLogGetParams=SupportedOSPlatform("windowsserver2008") -DhcpAuditLogSetParams=SupportedOSPlatform("windowsserver2008") -DhcpCreateClass=SupportedOSPlatform("windowsserver2008") -DhcpCreateClassV6=SupportedOSPlatform("windowsserver2008") -DhcpCreateClientInfo=SupportedOSPlatform("windowsserver2000") -DhcpCreateClientInfoV4=SupportedOSPlatform("windowsserver2008") -DhcpCreateClientInfoVQ=SupportedOSPlatform("windowsserver2008") -DhcpCreateOption=SupportedOSPlatform("windowsserver2008") -DhcpCreateOptionV5=SupportedOSPlatform("windowsserver2008") -DhcpCreateOptionV6=SupportedOSPlatform("windowsserver2008") -DhcpCreateSubnet=SupportedOSPlatform("windowsserver2000") -DhcpCreateSubnetV6=SupportedOSPlatform("windowsserver2008") -DhcpCreateSubnetVQ=SupportedOSPlatform("windowsserver2008") -DhcpDeleteClass=SupportedOSPlatform("windowsserver2008") -DhcpDeleteClassV6=SupportedOSPlatform("windowsserver2008") -DhcpDeleteClientInfo=SupportedOSPlatform("windowsserver2000") -DhcpDeleteClientInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpDeleteFilterV4=SupportedOSPlatform("windowsserver2008") -DhcpDeleteServer=SupportedOSPlatform("windowsserver2000") -DhcpDeleteSubnet=SupportedOSPlatform("windowsserver2000") -DhcpDeleteSubnetV6=SupportedOSPlatform("windowsserver2008") -DhcpDeleteSuperScopeV4=SupportedOSPlatform("windowsserver2008") -DhcpDsCleanup=SupportedOSPlatform("windowsserver2000") -DhcpDsInit=SupportedOSPlatform("windowsserver2000") -DhcpEnumClasses=SupportedOSPlatform("windowsserver2008") -DhcpEnumClassesV6=SupportedOSPlatform("windowsserver2008") -DhcpEnumFilterV4=SupportedOSPlatform("windowsserver2008") -DhcpEnumOptions=SupportedOSPlatform("windowsserver2008") -DhcpEnumOptionsV5=SupportedOSPlatform("windowsserver2008") -DhcpEnumOptionsV6=SupportedOSPlatform("windowsserver2008") -DhcpEnumOptionValues=SupportedOSPlatform("windowsserver2008") -DhcpEnumOptionValuesV5=SupportedOSPlatform("windowsserver2008") -DhcpEnumOptionValuesV6=SupportedOSPlatform("windowsserver2008") -DhcpEnumServers=SupportedOSPlatform("windowsserver2000") -DhcpEnumSubnetClients=SupportedOSPlatform("windowsserver2000") -DhcpEnumSubnetClientsFilterStatusInfo=SupportedOSPlatform("windowsserver2008") -DhcpEnumSubnetClientsV4=SupportedOSPlatform("windowsserver2008") -DhcpEnumSubnetClientsV5=SupportedOSPlatform("windowsserver2008") -DhcpEnumSubnetClientsV6=SupportedOSPlatform("windowsserver2008") -DhcpEnumSubnetClientsVQ=SupportedOSPlatform("windowsserver2008") -DhcpEnumSubnetElements=SupportedOSPlatform("windowsserver2000") -DhcpEnumSubnetElementsV4=SupportedOSPlatform("windowsserver2000") -DhcpEnumSubnetElementsV5=SupportedOSPlatform("windowsserver2000") -DhcpEnumSubnetElementsV6=SupportedOSPlatform("windowsserver2008") -DhcpEnumSubnets=SupportedOSPlatform("windowsserver2000") -DhcpEnumSubnetsV6=SupportedOSPlatform("windowsserver2008") -DhcpGetAllOptions=SupportedOSPlatform("windowsserver2008") -DhcpGetAllOptionsV6=SupportedOSPlatform("windowsserver2008") -DhcpGetAllOptionValues=SupportedOSPlatform("windowsserver2008") -DhcpGetAllOptionValuesV6=SupportedOSPlatform("windowsserver2008") -DhcpGetClassInfo=SupportedOSPlatform("windowsserver2008") -DhcpGetClientInfo=SupportedOSPlatform("windowsserver2000") -DhcpGetClientInfoV4=SupportedOSPlatform("windowsserver2008") -DhcpGetClientInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpGetClientInfoVQ=SupportedOSPlatform("windowsserver2008") -DhcpGetClientOptions=SupportedOSPlatform("windowsserver2008") -DhcpGetFilterV4=SupportedOSPlatform("windowsserver2008") -DhcpGetMibInfoV5=SupportedOSPlatform("windowsserver2008") -DhcpGetMibInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpGetOptionInfo=SupportedOSPlatform("windowsserver2008") -DhcpGetOptionInfoV5=SupportedOSPlatform("windowsserver2008") -DhcpGetOptionInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpGetOptionValue=SupportedOSPlatform("windowsserver2000") -DhcpGetOptionValueV5=SupportedOSPlatform("windowsserver2008") -DhcpGetOptionValueV6=SupportedOSPlatform("windowsserver2008") -DhcpGetServerBindingInfo=SupportedOSPlatform("windowsserver2000") -DhcpGetServerBindingInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpGetServerSpecificStrings=SupportedOSPlatform("windowsserver2008") -DhcpGetSubnetDelayOffer=SupportedOSPlatform("windowsserver2008") -DhcpGetSubnetInfo=SupportedOSPlatform("windowsserver2000") -DhcpGetSubnetInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpGetSubnetInfoVQ=SupportedOSPlatform("windowsserver2008") -DhcpGetSuperScopeInfoV4=SupportedOSPlatform("windowsserver2008") -DhcpGetThreadOptions=SupportedOSPlatform("windowsserver2008") -DhcpGetVersion=SupportedOSPlatform("windowsserver2000") -DhcpHlprAddV4PolicyCondition=SupportedOSPlatform("windowsserver2012") -DhcpHlprAddV4PolicyExpr=SupportedOSPlatform("windowsserver2012") -DhcpHlprAddV4PolicyRange=SupportedOSPlatform("windowsserver2012") -DhcpHlprCreateV4Policy=SupportedOSPlatform("windowsserver2012") -DhcpHlprFreeV4Policy=SupportedOSPlatform("windowsserver2012") -DhcpHlprIsV4PolicySingleUC=SupportedOSPlatform("windowsserver2012") -DhcpHlprIsV4PolicyValid=SupportedOSPlatform("windowsserver2012") -DhcpHlprIsV4PolicyWellFormed=SupportedOSPlatform("windowsserver2012") -DhcpHlprModifyV4PolicyExpr=SupportedOSPlatform("windowsserver2012") -DhcpHlprResetV4PolicyExpr=SupportedOSPlatform("windowsserver2012") -DhcpModifyClass=SupportedOSPlatform("windowsserver2008") -DhcpModifyClassV6=SupportedOSPlatform("windowsserver2008") -DhcpRemoveOption=SupportedOSPlatform("windowsserver2008") -DhcpRemoveOptionV5=SupportedOSPlatform("windowsserver2008") -DhcpRemoveOptionV6=SupportedOSPlatform("windowsserver2008") -DhcpRemoveOptionValue=SupportedOSPlatform("windowsserver2008") -DhcpRemoveOptionValueV5=SupportedOSPlatform("windowsserver2000") -DhcpRemoveOptionValueV6=SupportedOSPlatform("windowsserver2008") -DhcpRemoveSubnetElement=SupportedOSPlatform("windowsserver2008") -DhcpRemoveSubnetElementV4=SupportedOSPlatform("windowsserver2008") -DhcpRemoveSubnetElementV5=SupportedOSPlatform("windowsserver2000") -DhcpRemoveSubnetElementV6=SupportedOSPlatform("windowsserver2008") -DhcpRpcFreeMemory=SupportedOSPlatform("windowsserver2000") -DhcpScanDatabase=SupportedOSPlatform("windowsserver2008") -DhcpServerBackupDatabase=SupportedOSPlatform("windowsserver2008") -DhcpServerGetConfig=SupportedOSPlatform("windowsserver2008") -DhcpServerGetConfigV4=SupportedOSPlatform("windowsserver2008") -DhcpServerGetConfigV6=SupportedOSPlatform("windowsserver2008") -DhcpServerGetConfigVQ=SupportedOSPlatform("windowsserver2008") -DhcpServerQueryAttribute=SupportedOSPlatform("windowsserver2008") -DhcpServerQueryAttributes=SupportedOSPlatform("windowsserver2008") -DhcpServerQueryDnsRegCredentials=SupportedOSPlatform("windowsserver2008") -DhcpServerRedoAuthorization=SupportedOSPlatform("windowsserver2000") -DhcpServerRestoreDatabase=SupportedOSPlatform("windowsserver2008") -DhcpServerSetConfig=SupportedOSPlatform("windowsserver2008") -DhcpServerSetConfigV4=SupportedOSPlatform("windowsserver2008") -DhcpServerSetConfigV6=SupportedOSPlatform("windowsserver2008") -DhcpServerSetConfigVQ=SupportedOSPlatform("windowsserver2008") -DhcpServerSetDnsRegCredentialsV5=SupportedOSPlatform("windowsserver2008") -DhcpSetClientInfo=SupportedOSPlatform("windowsserver2000") -DhcpSetClientInfoV4=SupportedOSPlatform("windowsserver2008") -DhcpSetClientInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpSetClientInfoVQ=SupportedOSPlatform("windowsserver2008") -DhcpSetFilterV4=SupportedOSPlatform("windowsserver2008") -DhcpSetOptionInfo=SupportedOSPlatform("windowsserver2008") -DhcpSetOptionInfoV5=SupportedOSPlatform("windowsserver2008") -DhcpSetOptionInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpSetOptionValue=SupportedOSPlatform("windowsserver2008") -DhcpSetOptionValues=SupportedOSPlatform("windowsserver2008") -DhcpSetOptionValuesV5=SupportedOSPlatform("windowsserver2008") -DhcpSetOptionValueV5=SupportedOSPlatform("windowsserver2000") -DhcpSetOptionValueV6=SupportedOSPlatform("windowsserver2008") -DhcpSetServerBindingInfo=SupportedOSPlatform("windowsserver2000") -DhcpSetServerBindingInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpSetSubnetDelayOffer=SupportedOSPlatform("windowsserver2008") -DhcpSetSubnetInfo=SupportedOSPlatform("windowsserver2000") -DhcpSetSubnetInfoV6=SupportedOSPlatform("windowsserver2008") -DhcpSetSubnetInfoVQ=SupportedOSPlatform("windowsserver2008") -DhcpSetSuperScopeV4=SupportedOSPlatform("windowsserver2008") -DhcpSetThreadOptions=SupportedOSPlatform("windowsserver2008") -DhcpV4AddPolicyRange=SupportedOSPlatform("windowsserver2012") -DhcpV4CreateClientInfo=SupportedOSPlatform("windowsserver2012") -DhcpV4CreatePolicy=SupportedOSPlatform("windowsserver2012") -DhcpV4DeletePolicy=SupportedOSPlatform("windowsserver2012") -DhcpV4EnumPolicies=SupportedOSPlatform("windowsserver2012") -DhcpV4EnumSubnetClients=SupportedOSPlatform("windowsserver2012") -DhcpV4EnumSubnetReservations=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverAddScopeToRelationship=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverCreateRelationship=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverDeleteRelationship=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverDeleteScopeFromRelationship=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverEnumRelationship=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverGetAddressStatus=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverGetClientInfo=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverGetRelationship=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverGetScopeRelationship=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverGetScopeStatistics=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverGetSystemTime=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverSetRelationship=SupportedOSPlatform("windowsserver2012") -DhcpV4FailoverTriggerAddrAllocation=SupportedOSPlatform("windowsserver2012") -DhcpV4GetAllOptionValues=SupportedOSPlatform("windowsserver2012") -DhcpV4GetClientInfo=SupportedOSPlatform("windowsserver2012") -DhcpV4GetFreeIPAddress=SupportedOSPlatform("windowsserver2012") -DhcpV4GetOptionValue=SupportedOSPlatform("windowsserver2012") -DhcpV4GetPolicy=SupportedOSPlatform("windowsserver2012") -DhcpV4QueryPolicyEnforcement=SupportedOSPlatform("windowsserver2012") -DhcpV4RemoveOptionValue=SupportedOSPlatform("windowsserver2012") -DhcpV4RemovePolicyRange=SupportedOSPlatform("windowsserver2012") -DhcpV4SetOptionValue=SupportedOSPlatform("windowsserver2012") -DhcpV4SetOptionValues=SupportedOSPlatform("windowsserver2012") -DhcpV4SetPolicy=SupportedOSPlatform("windowsserver2012") -DhcpV4SetPolicyEnforcement=SupportedOSPlatform("windowsserver2012") -DhcpV6CreateClientInfo=SupportedOSPlatform("windowsserver2012") -DhcpV6GetFreeIPAddress=SupportedOSPlatform("windowsserver2012") -DhcpV6GetStatelessStatistics=SupportedOSPlatform("windowsserver2012") -DhcpV6GetStatelessStoreParams=SupportedOSPlatform("windowsserver2012") -DhcpV6SetStatelessStoreParams=SupportedOSPlatform("windowsserver2012") -Dhcpv6CApiCleanup=SupportedOSPlatform("windows6.0.6000") -Dhcpv6CApiInitialize=SupportedOSPlatform("windows6.0.6000") -Dhcpv6ReleasePrefix=SupportedOSPlatform("windows6.0.6000") -Dhcpv6RenewPrefix=SupportedOSPlatform("windows6.0.6000") -Dhcpv6RequestParams=SupportedOSPlatform("windows6.0.6000") -Dhcpv6RequestPrefix=SupportedOSPlatform("windows6.0.6000") DdqCancelDiagnosticRecordOperation=SupportedOSPlatform("windows10.0.19041") DdqCloseSession=SupportedOSPlatform("windows10.0.19041") DdqCreateSession=SupportedOSPlatform("windows10.0.19041") @@ -6380,7 +6189,6 @@ INATNumberOfEntriesCallback=SupportedOSPlatform("windows5.1.2600") IStaticPortMapping=SupportedOSPlatform("windows5.1.2600") IStaticPortMappingCollection=SupportedOSPlatform("windows5.1.2600") IUPnPNAT=SupportedOSPlatform("windows5.1.2600") -Netbios=SupportedOSPlatform("windows5.0") NCryptCreateClaim=SupportedOSPlatform("windows10.0.10240") NCryptCreatePersistedKey=SupportedOSPlatform("windows6.0.6000") NCryptDecrypt=SupportedOSPlatform("windows6.0.6000") @@ -6553,14 +6361,6 @@ SetIpForwardEntry2=SupportedOSPlatform("windows6.0.6000") SetIpInterfaceEntry=SupportedOSPlatform("windows6.0.6000") SetIpNetEntry2=SupportedOSPlatform("windows6.0.6000") SetUnicastIpAddressEntry=SupportedOSPlatform("windows6.0.6000") -MatchEnumTag=SupportedOSPlatform("windows5.1.2600") -MatchToken=SupportedOSPlatform("windows5.1.2600") -PreprocessCommand=SupportedOSPlatform("windows5.1.2600") -PrintError=SupportedOSPlatform("windows5.1.2600") -PrintMessage=SupportedOSPlatform("windows5.1.2600") -PrintMessageFromModule=SupportedOSPlatform("windows5.1.2600") -RegisterContext=SupportedOSPlatform("windows5.1.2600") -RegisterHelper=SupportedOSPlatform("windows5.1.2600") DiInstallDevice=SupportedOSPlatform("windows6.0.6000") DiInstallDriverA=SupportedOSPlatform("windows6.0.6000") DiInstallDriverW=SupportedOSPlatform("windows6.0.6000") @@ -6573,33 +6373,17 @@ UpdateDriverForPlugAndPlayDevicesW=SupportedOSPlatform("windows5.0") INotificationActivationCallback=SupportedOSPlatform("windows10.0.10240") AddConnectNotify=SupportedOSPlatform("windows5.1.2600") CancelConnectNotify=SupportedOSPlatform("windows5.1.2600") -NPAddConnection=SupportedOSPlatform("windows5.1.2600") -NPAddConnection3=SupportedOSPlatform("windows5.1.2600") -NPCancelConnection=SupportedOSPlatform("windows5.1.2600") -NPCloseEnum=SupportedOSPlatform("windows5.1.2600") NPDeviceMode=SupportedOSPlatform("windows5.1.2600") NPDirectoryNotify=SupportedOSPlatform("windows5.1.2600") -NPEnumResource=SupportedOSPlatform("windows5.1.2600") NPFMXEditPerm=SupportedOSPlatform("windows5.1.2600") NPFMXGetPermCaps=SupportedOSPlatform("windows5.1.2600") NPFMXGetPermHelp=SupportedOSPlatform("windows5.1.2600") -NPFormatNetworkName=SupportedOSPlatform("windows5.1.2600") -NPGetCaps=SupportedOSPlatform("windows5.1.2600") -NPGetConnection=SupportedOSPlatform("windows5.1.2600") -NPGetConnection3=SupportedOSPlatform("windows5.1.2600") -NPGetConnectionPerformance=SupportedOSPlatform("windows5.1.2600") NPGetDirectoryType=SupportedOSPlatform("windows5.1.2600") NPGetPropertyText=SupportedOSPlatform("windows5.1.2600") -NPGetResourceInformation=SupportedOSPlatform("windows5.1.2600") -NPGetResourceParent=SupportedOSPlatform("windows5.1.2600") -NPGetUniversalName=SupportedOSPlatform("windows5.1.2600") -NPGetUser=SupportedOSPlatform("windows5.1.2600") NPLogonNotify=SupportedOSPlatform("windows5.1.2600") -NPOpenEnum=SupportedOSPlatform("windows5.1.2600") NPPasswordChangeNotify=SupportedOSPlatform("windows5.1.2600") NPPropertyDialog=SupportedOSPlatform("windows5.1.2600") NPSearchDialog=SupportedOSPlatform("windows5.1.2600") -WNetSetLastErrorA=SupportedOSPlatform("windows5.1.2600") EnumProtocolsA=SupportedOSPlatform("windows5.0") EnumProtocolsW=SupportedOSPlatform("windows5.0") GetAddressByNameA=SupportedOSPlatform("windows5.0") @@ -14932,48 +14716,7 @@ IWinMLEvaluationContext=SupportedOSPlatform("windows10.0.17134") IWinMLModel=SupportedOSPlatform("windows10.0.17134") IWinMLRuntime=SupportedOSPlatform("windows10.0.17134") IWinMLRuntimeFactory=SupportedOSPlatform("windows10.0.17134") -MultinetGetConnectionPerformanceA=SupportedOSPlatform("windows5.0") -MultinetGetConnectionPerformanceW=SupportedOSPlatform("windows5.0") -WNetAddConnection2A=SupportedOSPlatform("windows5.0") -WNetAddConnection2W=SupportedOSPlatform("windows5.0") -WNetAddConnection3A=SupportedOSPlatform("windows5.0") -WNetAddConnection3W=SupportedOSPlatform("windows5.0") -WNetAddConnectionA=SupportedOSPlatform("windows5.0") -WNetAddConnectionW=SupportedOSPlatform("windows5.0") -WNetCancelConnection2A=SupportedOSPlatform("windows5.0") -WNetCancelConnection2W=SupportedOSPlatform("windows5.0") -WNetCancelConnectionA=SupportedOSPlatform("windows5.0") -WNetCancelConnectionW=SupportedOSPlatform("windows5.0") -WNetCloseEnum=SupportedOSPlatform("windows5.0") -WNetConnectionDialog=SupportedOSPlatform("windows5.0") -WNetConnectionDialog1A=SupportedOSPlatform("windows5.0") -WNetConnectionDialog1W=SupportedOSPlatform("windows5.0") -WNetDisconnectDialog=SupportedOSPlatform("windows5.0") -WNetDisconnectDialog1A=SupportedOSPlatform("windows5.0") -WNetDisconnectDialog1W=SupportedOSPlatform("windows5.0") -WNetEnumResourceA=SupportedOSPlatform("windows5.0") -WNetEnumResourceW=SupportedOSPlatform("windows5.0") -WNetGetConnectionA=SupportedOSPlatform("windows5.0") -WNetGetConnectionW=SupportedOSPlatform("windows5.0") -WNetGetLastErrorA=SupportedOSPlatform("windows5.0") -WNetGetLastErrorW=SupportedOSPlatform("windows5.0") -WNetGetNetworkInformationA=SupportedOSPlatform("windows5.0") -WNetGetNetworkInformationW=SupportedOSPlatform("windows5.0") -WNetGetProviderNameA=SupportedOSPlatform("windows5.0") -WNetGetProviderNameW=SupportedOSPlatform("windows5.0") -WNetGetResourceInformationA=SupportedOSPlatform("windows5.0") -WNetGetResourceInformationW=SupportedOSPlatform("windows5.0") -WNetGetResourceParentA=SupportedOSPlatform("windows5.0") -WNetGetResourceParentW=SupportedOSPlatform("windows5.0") -WNetGetUniversalNameA=SupportedOSPlatform("windows5.0") -WNetGetUniversalNameW=SupportedOSPlatform("windows5.0") -WNetGetUserA=SupportedOSPlatform("windows5.0") -WNetGetUserW=SupportedOSPlatform("windows5.0") -WNetOpenEnumA=SupportedOSPlatform("windows5.0") -WNetOpenEnumW=SupportedOSPlatform("windows5.0") WNetRestoreConnectionW=SupportedOSPlatform("windows5.0") -WNetUseConnectionA=SupportedOSPlatform("windows5.0") -WNetUseConnectionW=SupportedOSPlatform("windows5.0") CompareString=SupportedOSPlatform("windows5.0") CompareStringA=SupportedOSPlatform("windows5.0") ConvertDefaultLocale=SupportedOSPlatform("windows5.0") From 9984a79a6dea38f393b9bb08c75e041afab7e85d Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:37:05 -0700 Subject: [PATCH 07/17] Integrate strict Network source-bound grading controls Apply only producerf4e364953f7088798a56a3c60c060bdb5db9a1c7 after the paired3e13 source input. All23 return/direction/closure/literal mutation cases execute successfully on the synchronized runner. Architecture, native and actual full-image Network assertions remain pending central canonical production; no field activation or broad closure admission. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../WinHttpMigrationTests.cs | 485 +++++++++++++++++- .../WinHttpNativeControlTests.cs | 59 +++ 2 files changed, 529 insertions(+), 15 deletions(-) diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index b0a773ead..712c7f96a 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -19,6 +19,8 @@ public class WinHttpMigrationTests { internal const string WinHttpNamespace = "Windows.Win32.Networking.WinHttp"; private const string MetadataNamespace = "Windows.Win32.Foundation.Metadata"; + private const string WNetNamespace = "Windows.Win32.NetworkManagement.WNet"; + private const string DhcpNamespace = "Windows.Win32.NetworkManagement.Dhcp"; private readonly ITestOutputHelper output; private static readonly SignatureNames Signatures = new SignatureNames(); private static readonly (string Owner, string Member, string Enum, string Native)[] Associations = @@ -52,6 +54,81 @@ private static readonly (string Owner, string Member, string Enum, string Native new EnumUse("Windows.Win32.UI.Input.XboxController", "XINPUT_GAMEPAD", "wButtons", "XINPUT_GAMEPAD_BUTTON_FLAGS", "UInt16"), new EnumUse("Windows.Win32.UI.Input.XboxController", "XINPUT_KEYSTROKE", "VirtualKey", "XINPUT_VIRTUAL_KEY", "UInt16"), new EnumUse("Windows.Win32.UI.Input.XboxController", "XINPUT_KEYSTROKE", "Flags", "XINPUT_KEYSTROKE_FLAGS", "UInt16"), + new EnumUse(WNetNamespace, "CONNECTDLGSTRUCTA", "dwFlags", "CONNECTDLGSTRUCT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "CONNECTDLGSTRUCTW", "dwFlags", "CONNECTDLGSTRUCT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "DISCDLGSTRUCTA", "dwFlags", "DISCDLGSTRUCT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "DISCDLGSTRUCTW", "dwFlags", "DISCDLGSTRUCT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "NETINFOSTRUCT", "dwCharacteristics", "NETINFOSTRUCT_CHARACTERISTICS", "UInt32"), + new EnumUse(WNetNamespace, "NETINFOSTRUCT", "dwStatus", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "NETRESOURCEA", "dwScope", "NET_RESOURCE_SCOPE", "UInt32"), + new EnumUse(WNetNamespace, "NETRESOURCEA", "dwType", "NET_RESOURCE_TYPE", "UInt32"), + new EnumUse(WNetNamespace, "NETRESOURCEW", "dwScope", "NET_RESOURCE_SCOPE", "UInt32"), + new EnumUse(WNetNamespace, "NETRESOURCEW", "dwType", "NET_RESOURCE_TYPE", "UInt32"), + new EnumUse(WNetNamespace, "NOTIFYADD", "dwAddFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "NPAddConnection3", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "NPFormatNetworkName", "dwFlags", "NETWORK_NAME_FORMAT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "NPGetUniversalName", "dwInfoLevel", "UNC_INFO_LEVEL", "UInt32"), + new EnumUse(WNetNamespace, "WNetAddConnection2A", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetAddConnection2A", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetAddConnection2W", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetAddConnection2W", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetAddConnection3A", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetAddConnection3A", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetAddConnection3W", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetAddConnection3W", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetAddConnection4A", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetAddConnection4A", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetAddConnection4W", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetAddConnection4W", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetAddConnectionA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetAddConnectionW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetCancelConnection2A", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetCancelConnection2A", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetCancelConnection2W", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetCancelConnection2W", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetCancelConnectionA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetCancelConnectionW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetCloseEnum", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetConnectionDialog", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetConnectionDialog1A", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetConnectionDialog1W", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetDisconnectDialog", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetDisconnectDialog1A", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetDisconnectDialog1W", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetEnumResourceA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetEnumResourceW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetConnectionA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetConnectionW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetLastErrorA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetLastErrorW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetNetworkInformationA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetNetworkInformationW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetProviderNameA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetProviderNameW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetResourceInformationA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetResourceInformationW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetResourceParentA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetResourceParentW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetUniversalNameA", "dwInfoLevel", "UNC_INFO_LEVEL", "UInt32"), + new EnumUse(WNetNamespace, "WNetGetUniversalNameA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetUniversalNameW", "dwInfoLevel", "UNC_INFO_LEVEL", "UInt32"), + new EnumUse(WNetNamespace, "WNetGetUniversalNameW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetUserA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetGetUserW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetOpenEnumA", "dwScope", "NET_RESOURCE_SCOPE", "UInt32"), + new EnumUse(WNetNamespace, "WNetOpenEnumA", "dwType", "NET_RESOURCE_TYPE", "UInt32"), + new EnumUse(WNetNamespace, "WNetOpenEnumA", "dwUsage", "WNET_OPEN_ENUM_USAGE", "UInt32"), + new EnumUse(WNetNamespace, "WNetOpenEnumA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetOpenEnumW", "dwScope", "NET_RESOURCE_SCOPE", "UInt32"), + new EnumUse(WNetNamespace, "WNetOpenEnumW", "dwType", "NET_RESOURCE_TYPE", "UInt32"), + new EnumUse(WNetNamespace, "WNetOpenEnumW", "dwUsage", "WNET_OPEN_ENUM_USAGE", "UInt32"), + new EnumUse(WNetNamespace, "WNetOpenEnumW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetUseConnection4A", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetUseConnection4W", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetUseConnectionA", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetUseConnectionA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), + new EnumUse(WNetNamespace, "WNetUseConnectionW", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), + new EnumUse(WNetNamespace, "WNetUseConnectionW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), }).ToArray(); private static readonly (string Namespace, string Owner, string Method, string Parameter)[] NativeRetvalUses = { @@ -126,6 +203,12 @@ private static readonly (string Namespace, string Owner, string Method, string P }; private static readonly (string Namespace, string Owner, string Method) ReviewedPreservedResult = ("Windows.Win32.System.Com.Events", "IEnumEventObject", "Reset"); + private static readonly (string Namespace, string Owner, string Method, string Parameter, + ParameterAttributes Before, ParameterAttributes After)[] NativeDirectionUses = + { + (DhcpNamespace, "Apis", "DhcpEnumSubnets", "EnumInfo", + ParameterAttributes.Out, ParameterAttributes.In | ParameterAttributes.Out), + }; private static readonly string[] AdditionalOwnedMethods = { "CeipIsOptedIn", @@ -160,6 +243,77 @@ private static readonly (string Namespace, string Owner, string Method) Reviewed "WscGetSecurityProviderHealth", "WscQueryAntiMalwareUri", "WscGetAntiMalwareUri", "WcmQueryProperty", "WcmSetProperty", "WcmGetProfileList", "WcmSetProfileList", "WcmFreeMemory", "CoGetInterceptor", + "DhcpAddFilterV4", "DhcpAddSecurityGroup", "DhcpAddServer", "DhcpAddSubnetElement", + "DhcpAddSubnetElementV4", "DhcpAddSubnetElementV5", "DhcpAddSubnetElementV6", "DhcpAuditLogGetParams", + "DhcpAuditLogSetParams", "DhcpCApiCleanup", "DhcpCApiInitialize", "DhcpCreateClass", + "DhcpCreateClassV6", "DhcpCreateClientInfo", "DhcpCreateClientInfoV4", "DhcpCreateClientInfoVQ", + "DhcpCreateOption", "DhcpCreateOptionV5", "DhcpCreateOptionV6", "DhcpCreateSubnet", + "DhcpCreateSubnetV6", "DhcpCreateSubnetVQ", "DhcpDeRegisterParamChange", "DhcpDeleteClass", + "DhcpDeleteClassV6", "DhcpDeleteClientInfo", "DhcpDeleteClientInfoV6", "DhcpDeleteFilterV4", + "DhcpDeleteServer", "DhcpDeleteSubnet", "DhcpDeleteSubnetV6", "DhcpDeleteSuperScopeV4", + "DhcpDsCleanup", "DhcpDsInit", "DhcpEnumClasses", "DhcpEnumClassesV6", + "DhcpEnumFilterV4", "DhcpEnumOptionValues", "DhcpEnumOptionValuesV5", "DhcpEnumOptionValuesV6", + "DhcpEnumOptions", "DhcpEnumOptionsV5", "DhcpEnumOptionsV6", "DhcpEnumServers", + "DhcpEnumSubnetClients", "DhcpEnumSubnetClientsFilterStatusInfo", "DhcpEnumSubnetClientsV4", "DhcpEnumSubnetClientsV5", + "DhcpEnumSubnetClientsV6", "DhcpEnumSubnetClientsVQ", "DhcpEnumSubnetElements", "DhcpEnumSubnetElementsV4", + "DhcpEnumSubnetElementsV5", "DhcpEnumSubnetElementsV6", "DhcpEnumSubnets", "DhcpEnumSubnetsV6", + "DhcpGetAllOptionValues", "DhcpGetAllOptionValuesV6", "DhcpGetAllOptions", "DhcpGetAllOptionsV6", + "DhcpGetClassInfo", "DhcpGetClientInfo", "DhcpGetClientInfoV4", "DhcpGetClientInfoV6", + "DhcpGetClientInfoVQ", "DhcpGetClientOptions", "DhcpGetFilterV4", "DhcpGetMibInfo", + "DhcpGetMibInfoV5", "DhcpGetMibInfoV6", "DhcpGetOptionInfo", "DhcpGetOptionInfoV5", + "DhcpGetOptionInfoV6", "DhcpGetOptionValue", "DhcpGetOptionValueV5", "DhcpGetOptionValueV6", + "DhcpGetOriginalSubnetMask", "DhcpGetServerBindingInfo", "DhcpGetServerBindingInfoV6", "DhcpGetServerSpecificStrings", + "DhcpGetSubnetDelayOffer", "DhcpGetSubnetInfo", "DhcpGetSubnetInfoV6", "DhcpGetSubnetInfoVQ", + "DhcpGetSuperScopeInfoV4", "DhcpGetThreadOptions", "DhcpGetVersion", "DhcpHlprAddV4PolicyCondition", + "DhcpHlprAddV4PolicyExpr", "DhcpHlprAddV4PolicyRange", "DhcpHlprCreateV4Policy", "DhcpHlprCreateV4PolicyEx", + "DhcpHlprFindV4DhcpProperty", "DhcpHlprFreeV4DhcpProperty", "DhcpHlprFreeV4DhcpPropertyArray", "DhcpHlprFreeV4Policy", + "DhcpHlprFreeV4PolicyArray", "DhcpHlprFreeV4PolicyEx", "DhcpHlprFreeV4PolicyExArray", "DhcpHlprIsV4PolicySingleUC", + "DhcpHlprIsV4PolicyValid", "DhcpHlprIsV4PolicyWellFormed", "DhcpHlprModifyV4PolicyExpr", "DhcpHlprResetV4PolicyExpr", + "DhcpModifyClass", "DhcpModifyClassV6", "DhcpRegisterParamChange", "DhcpRemoveDNSRegistrations", + "DhcpRemoveOption", "DhcpRemoveOptionV5", "DhcpRemoveOptionV6", "DhcpRemoveOptionValue", + "DhcpRemoveOptionValueV5", "DhcpRemoveOptionValueV6", "DhcpRemoveSubnetElement", "DhcpRemoveSubnetElementV4", + "DhcpRemoveSubnetElementV5", "DhcpRemoveSubnetElementV6", "DhcpRequestParams", "DhcpRpcFreeMemory", + "DhcpScanDatabase", "DhcpServerAuditlogParamsFree", "DhcpServerBackupDatabase", "DhcpServerGetConfig", + "DhcpServerGetConfigV4", "DhcpServerGetConfigV6", "DhcpServerGetConfigVQ", "DhcpServerQueryAttribute", + "DhcpServerQueryAttributes", "DhcpServerQueryDnsRegCredentials", "DhcpServerRedoAuthorization", "DhcpServerRestoreDatabase", + "DhcpServerSetConfig", "DhcpServerSetConfigV4", "DhcpServerSetConfigV6", "DhcpServerSetConfigVQ", + "DhcpServerSetDnsRegCredentials", "DhcpServerSetDnsRegCredentialsV5", "DhcpSetClientInfo", "DhcpSetClientInfoV4", + "DhcpSetClientInfoV6", "DhcpSetClientInfoVQ", "DhcpSetFilterV4", "DhcpSetOptionInfo", + "DhcpSetOptionInfoV5", "DhcpSetOptionInfoV6", "DhcpSetOptionValue", "DhcpSetOptionValueV5", + "DhcpSetOptionValueV6", "DhcpSetOptionValues", "DhcpSetOptionValuesV5", "DhcpSetServerBindingInfo", + "DhcpSetServerBindingInfoV6", "DhcpSetSubnetDelayOffer", "DhcpSetSubnetInfo", "DhcpSetSubnetInfoV6", + "DhcpSetSubnetInfoVQ", "DhcpSetSuperScopeV4", "DhcpSetThreadOptions", "DhcpUndoRequestParams", + "DhcpV4AddPolicyRange", "DhcpV4CreateClientInfo", "DhcpV4CreateClientInfoEx", "DhcpV4CreatePolicy", + "DhcpV4CreatePolicyEx", "DhcpV4DeletePolicy", "DhcpV4EnumPolicies", "DhcpV4EnumPoliciesEx", + "DhcpV4EnumSubnetClients", "DhcpV4EnumSubnetClientsEx", "DhcpV4EnumSubnetReservations", "DhcpV4FailoverAddScopeToRelationship", + "DhcpV4FailoverCreateRelationship", "DhcpV4FailoverDeleteRelationship", "DhcpV4FailoverDeleteScopeFromRelationship", "DhcpV4FailoverEnumRelationship", + "DhcpV4FailoverGetAddressStatus", "DhcpV4FailoverGetClientInfo", "DhcpV4FailoverGetRelationship", "DhcpV4FailoverGetScopeRelationship", + "DhcpV4FailoverGetScopeStatistics", "DhcpV4FailoverGetSystemTime", "DhcpV4FailoverSetRelationship", "DhcpV4FailoverTriggerAddrAllocation", + "DhcpV4GetAllOptionValues", "DhcpV4GetClientInfo", "DhcpV4GetClientInfoEx", "DhcpV4GetFreeIPAddress", + "DhcpV4GetOptionValue", "DhcpV4GetPolicy", "DhcpV4GetPolicyEx", "DhcpV4QueryPolicyEnforcement", + "DhcpV4RemoveOptionValue", "DhcpV4RemovePolicyRange", "DhcpV4SetOptionValue", "DhcpV4SetOptionValues", + "DhcpV4SetPolicy", "DhcpV4SetPolicyEnforcement", "DhcpV4SetPolicyEx", "DhcpV6CreateClientInfo", + "DhcpV6GetFreeIPAddress", "DhcpV6GetStatelessStatistics", "DhcpV6GetStatelessStoreParams", "DhcpV6SetStatelessStoreParams", + "Dhcpv6CApiCleanup", "Dhcpv6CApiInitialize", "Dhcpv6ReleasePrefix", "Dhcpv6RenewPrefix", + "Dhcpv6RequestParams", "Dhcpv6RequestPrefix", "MatchEnumTag", "MatchToken", + "MultinetGetConnectionPerformanceA", "MultinetGetConnectionPerformanceW", "NPAddConnection", "NPAddConnection3", + "NPAddConnection4", "NPCancelConnection", "NPCancelConnection2", "NPCloseEnum", + "NPEnumResource", "NPFormatNetworkName", "NPGetCaps", "NPGetConnection", + "NPGetConnection3", "NPGetConnectionPerformance", "NPGetPersistentUseOptionsForConnection", "NPGetResourceInformation", + "NPGetResourceParent", "NPGetUniversalName", "NPGetUser", "NPOpenEnum", + "Netbios", "PreprocessCommand", "PrintError", "PrintMessage", + "PrintMessageFromModule", "RegisterContext", "RegisterHelper", "WNetAddConnection2A", + "WNetAddConnection2W", "WNetAddConnection3A", "WNetAddConnection3W", "WNetAddConnection4A", + "WNetAddConnection4W", "WNetAddConnectionA", "WNetAddConnectionW", "WNetCancelConnection2A", + "WNetCancelConnection2W", "WNetCancelConnectionA", "WNetCancelConnectionW", "WNetCloseEnum", + "WNetConnectionDialog", "WNetConnectionDialog1A", "WNetConnectionDialog1W", "WNetDisconnectDialog", + "WNetDisconnectDialog1A", "WNetDisconnectDialog1W", "WNetEnumResourceA", "WNetEnumResourceW", + "WNetGetConnectionA", "WNetGetConnectionW", "WNetGetLastErrorA", "WNetGetLastErrorW", + "WNetGetNetworkInformationA", "WNetGetNetworkInformationW", "WNetGetProviderNameA", "WNetGetProviderNameW", + "WNetGetResourceInformationA", "WNetGetResourceInformationW", "WNetGetResourceParentA", "WNetGetResourceParentW", + "WNetGetUniversalNameA", "WNetGetUniversalNameW", "WNetGetUserA", "WNetGetUserW", + "WNetOpenEnumA", "WNetOpenEnumW", "WNetSetLastErrorA", "WNetSetLastErrorW", + "WNetUseConnection4A", "WNetUseConnection4W", "WNetUseConnectionA", "WNetUseConnectionW", }; private static readonly string[] AdditionalOwnedTypes = { @@ -188,15 +342,27 @@ private static readonly (string Namespace, string Owner, string Method) Reviewed "IEventSystem", "IEventPublisher", "IEventClass", "IEventClass2", "IEventSubscription", "IFiringControl", "IPublisherFilter", "IMultiInterfacePublisherFilter", "IEventObjectChange", "IEventObjectChange2", "IEnumEventObject", "IEventObjectCollection", "IEventProperty", "IEventControl", "IMultiInterfaceEventControl", + "CONNECTDLGSTRUCTA", "CONNECTDLGSTRUCTW", "CONNECTDLGSTRUCT_FLAGS", "DHCP_IP_ARRAY", + "DISCDLGSTRUCTA", "DISCDLGSTRUCTW", "DISCDLGSTRUCT_FLAGS", "NETINFOSTRUCT", + "NETINFOSTRUCT_CHARACTERISTICS", "NETRESOURCEA", "NETRESOURCEW", "NETWORK_NAME_FORMAT_FLAGS", + "NET_CONNECT_FLAGS", "NET_RESOURCE_SCOPE", "NET_RESOURCE_TYPE", "NOTIFYADD", + "NPDIRECTORY_NOTIFY_OPERATION", "NP_PROPERTY_DIALOG_SELECTION", "UNC_INFO_LEVEL", "WNET_OPEN_ENUM_USAGE", + "WNPERM_DLG", + }; + private static readonly string[] NetworkLogicalEnums = + { + "UNC_INFO_LEVEL", "WNPERM_DLG", "WNET_OPEN_ENUM_USAGE", "NET_CONNECT_FLAGS", + "NP_PROPERTY_DIALOG_SELECTION", "NPDIRECTORY_NOTIFY_OPERATION", "NET_RESOURCE_TYPE", "NETWORK_NAME_FORMAT_FLAGS", + "NET_RESOURCE_SCOPE", "NETINFOSTRUCT_CHARACTERISTICS", "CONNECTDLGSTRUCT_FLAGS", "DISCDLGSTRUCT_FLAGS", }; - private static readonly string[] AdditionalLogicalEnums = + private static readonly string[] AdditionalLogicalEnums = new[] { "VERIFIER_ENUM_RESOURCE_FLAGS", "ENUM_PROCESS_MODULES_EX_FLAGS", "MW_FILTERMODE", "CREATE_TOOLHELP_SNAPSHOT_FLAGS", "HEAPENTRY32_FLAGS", "XINPUT_VIRTUAL_KEY", "BATTERY_TYPE", "BATTERY_LEVEL", "BATTERY_DEVTYPE", "XINPUT_DEVTYPE", "XINPUT_DEVSUBTYPE", "XINPUT_CAPABILITIES_FLAGS", "XINPUT_GAMEPAD_BUTTON_FLAGS", "XINPUT_KEYSTROKE_FLAGS", "XINPUT_FLAG", - }; + }.Concat(NetworkLogicalEnums).ToArray(); public WinHttpMigrationTests(ITestOutputHelper output) => this.output = output; @@ -266,11 +432,13 @@ public void EveryPhysicalTypeHasOnlyReviewedHeaderChanges() var used = new HashSet(StringComparer.Ordinal); var usedRetvals = new HashSet(StringComparer.Ordinal); var usedPreservedResults = new HashSet(StringComparer.Ordinal); + var usedNativeDirections = new HashSet(StringComparer.Ordinal); int unchanged = 0; foreach (var entry in before) { string expected = SnapshotType(control.Reader, entry.Value, normalizeReviewedChanges: true, - usedEnumSites: used, usedRetvalSites: usedRetvals, usedPreservedResultSites: usedPreservedResults); + usedEnumSites: used, usedRetvalSites: usedRetvals, usedPreservedResultSites: usedPreservedResults, + usedNativeDirectionSites: usedNativeDirections); string actual = SnapshotType(current.Reader, after[entry.Key]); Assert.True(expected == actual, $"Unexpected physical metadata change in {entry.Key}.\nExpected:\n{expected}\nActual:\n{actual}"); unchanged += SnapshotType(control.Reader, entry.Value) == actual ? 1 : 0; @@ -280,9 +448,11 @@ public void EveryPhysicalTypeHasOnlyReviewedHeaderChanges() .OrderBy(value => value), usedRetvals.OrderBy(value => value)); Assert.Equal(new[] { $"{ReviewedPreservedResult.Namespace}.{ReviewedPreservedResult.Owner}.{ReviewedPreservedResult.Method}" }, usedPreservedResults.OrderBy(value => value)); + Assert.Equal(NativeDirectionUses.Select(value => $"{value.Namespace}.{value.Owner}.{value.Method}.{value.Parameter}") + .OrderBy(value => value), usedNativeDirections.OrderBy(value => value)); this.output.WriteLine($"All {before.Count} physical types graded: {unchanged} unchanged; " + $"{used.Count} exact native-type/AssociatedEnum sites, {usedRetvals.Count} native MIDL retval sites " + - $"and {usedPreservedResults.Count} reviewed preserved-result site normalized."); + $"{usedPreservedResults.Count} reviewed preserved-result site and {usedNativeDirections.Count} exact native SAL direction site normalized."); } [MigrationTheory] @@ -448,6 +618,125 @@ public void HeaderFactsReachEveryPhysicalArchitecture(int architecture) SnapshotType(current.Reader, Type(current.Reader, "WINHTTP_STATUS_CALLBACK", architecture))); } + [MigrationTheory] + [InlineData(1)] + [InlineData(2)] + [InlineData(4)] + public void NetworkHeaderFactsPreserveBindingsFloorsAndOwnedRepresentations(int architecture) + { + using var old = Open("WINHTTP_MIGRATION_OLD"); + using var current = Open("WINHTTP_MIGRATION_NEW"); + int imports = 0, floors = 0, lastError = 0; + foreach (var (suffix, methodCount, floorCount) in new[] + { + ("NetBios", 1, 1), ("WNet", 65, 57), ("Dhcp", 210, 191), ("NetShell", 8, 8), + }) + { + string ns = "Windows.Win32.NetworkManagement." + suffix; + var before = Methods(old.Reader, ns, "Apis", architecture); + var after = Methods(current.Reader, ns, "Apis", architecture); + Assert.Equal(methodCount, before.Count); + Assert.Equal(before.Keys.OrderBy(value => value), after.Keys.OrderBy(value => value)); + int ownedFloors = 0; + foreach (var entry in before) + { + var original = entry.Value; + var method = after[entry.Key]; + Assert.Equal(original.Attributes, method.Attributes); + Assert.Equal(original.ImplAttributes, method.ImplAttributes); + Assert.Equal(Import(old.Reader, original), Import(current.Reader, method)); + Assert.Equal(AttributeValues(old.Reader, original.GetCustomAttributes(), "SupportedOSPlatformAttribute"), + AttributeValues(current.Reader, method.GetCustomAttributes(), "SupportedOSPlatformAttribute")); + ownedFloors += AttributeValues(current.Reader, method.GetCustomAttributes(), "SupportedOSPlatformAttribute").Length; + imports++; + lastError += method.GetImport().Attributes.HasFlag(MethodImportAttributes.SetLastError) ? 1 : 0; + var originalParameters = original.GetParameters().Select(old.Reader.GetParameter) + .ToDictionary(value => value.SequenceNumber); + var parameters = method.GetParameters().Select(current.Reader.GetParameter) + .ToDictionary(value => value.SequenceNumber); + Assert.Equal(originalParameters.Keys.OrderBy(value => value), parameters.Keys.OrderBy(value => value)); + foreach (var parameter in originalParameters) + { + string name = old.Reader.GetString(parameter.Value.Name); + Assert.Equal(name, current.Reader.GetString(parameters[parameter.Key].Name)); + var direction = NativeDirectionUses.SingleOrDefault(value => + (value.Namespace, value.Owner, value.Method, value.Parameter) == (ns, "Apis", entry.Key, name)); + if (direction.Parameter == null) + Assert.Equal(parameter.Value.Attributes, parameters[parameter.Key].Attributes); + else + { + Assert.Equal(direction.Before, parameter.Value.Attributes); + Assert.Equal(direction.After, parameters[parameter.Key].Attributes); + } + } + } + Assert.Equal(floorCount, ownedFloors); + floors += ownedFloors; + } + Assert.Equal(284, imports); + Assert.Equal(257, floors); + Assert.Equal(2, lastError); + + var oldApis = Methods(old.Reader, WNetNamespace, "Apis", architecture); + var apis = Methods(current.Reader, WNetNamespace, "Apis", architecture); + var uses = ReviewedEnumUses.Where(value => value.Namespace == WNetNamespace).ToArray(); + Assert.Equal(75, uses.Length); + foreach (var use in uses) + { + if (apis.TryGetValue(use.Owner, out var method)) + { + var original = oldApis[use.Owner]; + var beforeSignature = original.DecodeSignature(Signatures, null); + var signature = method.DecodeSignature(Signatures, null); + var parameter = use.Member == "return" + ? method.GetParameters().Select(current.Reader.GetParameter).Single(value => value.SequenceNumber == 0) + : method.GetParameters().Select(current.Reader.GetParameter) + .Single(value => current.Reader.GetString(value.Name) == use.Member); + Assert.Equal(new[] { use.Enum }, AttributeValues(current.Reader, parameter.GetCustomAttributes(), "AssociatedEnumAttribute")); + if (use.Member == "return") + { + Assert.Equal(use.OldType, beforeSignature.ReturnType); + Assert.Equal(use.Native, signature.ReturnType); + Assert.DoesNotContain(method.GetCustomAttributes(), handle => AttributeName(current.Reader, handle) == "AssociatedEnumAttribute"); + } + else + { + Assert.Equal(use.OldType, beforeSignature.ParameterTypes[parameter.SequenceNumber - 1]); + Assert.Equal(use.Native, signature.ParameterTypes[parameter.SequenceNumber - 1]); + } + } + else + { + var before = Type(old.Reader, use.Owner, architecture, WNetNamespace); + var after = Type(current.Reader, use.Owner, architecture, WNetNamespace); + var original = before.GetFields().Select(old.Reader.GetFieldDefinition) + .Single(value => old.Reader.GetString(value.Name) == use.Member); + var field = after.GetFields().Select(current.Reader.GetFieldDefinition) + .Single(value => current.Reader.GetString(value.Name) == use.Member); + Assert.Equal(use.OldType, original.DecodeSignature(Signatures, null)); + Assert.Equal(use.Native, field.DecodeSignature(Signatures, null)); + Assert.Equal(new[] { use.Enum }, AttributeValues(current.Reader, field.GetCustomAttributes(), "AssociatedEnumAttribute")); + } + } + + int members = 0; + foreach (string name in NetworkLogicalEnums) + { + var before = Type(old.Reader, name, architecture, WNetNamespace); + var after = Type(current.Reader, name, architecture, WNetNamespace); + Assert.Equal(SnapshotType(old.Reader, before), SnapshotType(current.Reader, after)); + Assert.Equal("System.Enum", FullName(current.Reader, after.BaseType)); + Assert.DoesNotContain(after.GetCustomAttributes(), handle => AttributeName(current.Reader, handle) == "ScopedEnumAttribute"); + var fields = after.GetFields().Select(current.Reader.GetFieldDefinition).ToArray(); + Assert.Equal("UInt32", fields.Single(value => current.Reader.GetString(value.Name) == "value__").DecodeSignature(Signatures, null)); + members += fields.Count(value => !value.GetDefaultValue().IsNil); + } + Assert.Equal(12, NetworkLogicalEnums.Length); + Assert.Equal(55, members); + this.output.WriteLine($"Network/{architecture}: {imports} exact DLL bindings, {floors} unchanged OS floors, " + + $"{lastError} last-error imports, {uses.Length} exact associations, and 12 unchanged logical enums/{members} members."); + } + [MigrationTheory] [InlineData(1)] [InlineData(2)] @@ -651,7 +940,8 @@ public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() } foreach (string partition in new[] { "CEIP", "ApplicationVerifier", "MagApi", "PsApi1", "Time", "Ual", "ToolHelp", "UpdateAssessment", "Wsl", "Xinput", "SecurityCenter", "WinSat", - "Wcm", "InputRadial", "WinContacts", "WinLocation", "Rdc", "Nla", "Com.CallObj", "Com.Events" }) + "Wcm", "InputRadial", "WinContacts", "WinLocation", "Rdc", "Nla", "Com.CallObj", "Com.Events", + "NetBios", "Wnet", "Dhcp", "NetShell" }) Assert.Contains("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); Assert.DoesNotContain("--with-librarypath", File.ReadAllText(Path.Combine(project, "Partitions", "Wsl", "settings.rsp"))); foreach (string partition in new[] { "Base", "FileHistory", "PsApi2", "HttpServer", @@ -659,6 +949,147 @@ public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() Assert.DoesNotContain("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); } + [Theory] + [InlineData("valid")] + [InlineData("wrong-enum")] + [InlineData("wrong-target")] + [InlineData("wrong-native-type")] + [InlineData("wrong-old-enum-namespace")] + [InlineData("missing-return-parameter")] + [InlineData("changed-import")] + public void ReturnAssociationNormalizationRequiresExactMetadata(string mutation) + { + using var old = Fixture(native: false, mutation); + using var current = Fixture(native: true, mutation); + var before = old.GetMetadataReader(); + var after = current.GetMetadataReader(); + var used = new HashSet(StringComparer.Ordinal); + var original = before.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(3)); + if (mutation == "wrong-old-enum-namespace") + { + Assert.ThrowsAny(() => SnapshotType(before, original, + normalizeReviewedChanges: true, usedEnumSites: used)); + Assert.Empty(used); + return; + } + string expected = SnapshotType(before, original, normalizeReviewedChanges: true, usedEnumSites: used); + string actual = SnapshotType(after, after.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(3))); + Assert.Equal(new[] { WNetNamespace + ".WNetAddConnectionA::return" }, used); + if (mutation == "valid") + Assert.Equal(expected, actual); + else + Assert.NotEqual(expected, actual); + + static MetadataReaderProvider Fixture(bool native, string mutation) + { + var metadata = new MetadataBuilder(); + metadata.AddModule(0, metadata.GetOrAddString("Return.winmd"), metadata.GetOrAddGuid(Guid.NewGuid()), default, default); + var runtime = metadata.AddAssemblyReference(metadata.GetOrAddString("System.Runtime"), + new Version(10, 0), default, default, 0, default); + var enumBase = metadata.AddTypeReference(runtime, metadata.GetOrAddString("System"), metadata.GetOrAddString("Enum")); + metadata.AddTypeDefinition(TypeAttributes.NotPublic, default, metadata.GetOrAddString(""), default, + MetadataTokens.FieldDefinitionHandle(1), MetadataTokens.MethodDefinitionHandle(1)); + var enumeration = metadata.AddTypeDefinition(TypeAttributes.Public, + metadata.GetOrAddString(!native && mutation == "wrong-old-enum-namespace" ? WNetNamespace : "Windows.Win32.Foundation"), + metadata.GetOrAddString("WIN32_ERROR"), enumBase, + MetadataTokens.FieldDefinitionHandle(1), MetadataTokens.MethodDefinitionHandle(1)); + var fieldSignature = new BlobBuilder(); + new BlobEncoder(fieldSignature).FieldSignature().UInt32(); + metadata.AddFieldDefinition(FieldAttributes.Public | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName, + metadata.GetOrAddString("value__"), metadata.GetOrAddBlob(fieldSignature)); + metadata.AddTypeDefinition(TypeAttributes.Public | TypeAttributes.Abstract | TypeAttributes.Sealed, + metadata.GetOrAddString(WNetNamespace), metadata.GetOrAddString("Apis"), default, + MetadataTokens.FieldDefinitionHandle(2), MetadataTokens.MethodDefinitionHandle(1)); + var signature = new BlobBuilder(); + new BlobEncoder(signature).MethodSignature().Parameters(0, result => + { + var type = result.Type(); + if (!native) + type.Type(enumeration, isValueType: true); + else if (mutation == "wrong-native-type") + type.Int32(); + else + type.UInt32(); + }, parameters => { }); + var method = metadata.AddMethodDefinition(MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.PinvokeImpl, + MethodImplAttributes.PreserveSig, metadata.GetOrAddString("WNetAddConnectionA"), metadata.GetOrAddBlob(signature), -1, + MetadataTokens.ParameterHandle(1)); + var module = metadata.AddModuleReference(metadata.GetOrAddString(native && mutation == "changed-import" ? "other.dll" : "MPR.dll")); + metadata.AddMethodImport(method, MethodImportAttributes.CallingConventionWinApi, metadata.GetOrAddString("WNetAddConnectionA"), module); + if (!native || mutation != "missing-return-parameter") + { + var parameter = metadata.AddParameter(0, metadata.GetOrAddString(""), 0); + if (native) + { + var attribute = metadata.AddTypeReference(MetadataTokens.EntityHandle(1), + metadata.GetOrAddString(MetadataNamespace), metadata.GetOrAddString("AssociatedEnumAttribute")); + var constructorSignature = new BlobBuilder(); + new BlobEncoder(constructorSignature).MethodSignature(isInstanceMethod: true).Parameters(1, + result => result.Void(), parameters => parameters.AddParameter().Type().String()); + var constructor = metadata.AddMemberReference(attribute, metadata.GetOrAddString(".ctor"), + metadata.GetOrAddBlob(constructorSignature)); + var value = new BlobBuilder(); + value.WriteUInt16(1); + value.WriteSerializedString(mutation == "wrong-enum" ? "NET_CONNECT_FLAGS" : "WIN32_ERROR"); + value.WriteUInt16(0); + metadata.AddCustomAttribute(mutation == "wrong-target" ? (EntityHandle)method : parameter, + constructor, metadata.GetOrAddBlob(value)); + } + } + var image = new BlobBuilder(); + new MetadataRootBuilder(metadata).Serialize(image, 0, 0); + return MetadataReaderProvider.FromMetadataImage(image.ToImmutableArray()); + } + } + + [Theory] + [InlineData(3, true)] + [InlineData(2, false)] + [InlineData(1, false)] + [InlineData(19, false)] + [InlineData(11, false)] + public void NativeDirectionNormalizationChangesOnlyTheExactSdkFlags(int flags, bool equal) + { + using var old = Fixture(ParameterAttributes.Out); + using var current = Fixture((ParameterAttributes)flags); + var before = old.GetMetadataReader(); + var after = current.GetMetadataReader(); + var used = new HashSet(StringComparer.Ordinal); + string expected = SnapshotType(before, before.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(2)), + normalizeReviewedChanges: true, usedNativeDirectionSites: used); + string actual = SnapshotType(after, after.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(2))); + Assert.Equal(new[] { DhcpNamespace + ".Apis.DhcpEnumSubnets.EnumInfo" }, used); + Assert.Equal(equal, expected == actual); + + static MetadataReaderProvider Fixture(ParameterAttributes direction) + { + var metadata = new MetadataBuilder(); + metadata.AddModule(0, metadata.GetOrAddString("Direction.winmd"), metadata.GetOrAddGuid(Guid.NewGuid()), default, default); + metadata.AddTypeDefinition(TypeAttributes.NotPublic, default, metadata.GetOrAddString(""), default, + MetadataTokens.FieldDefinitionHandle(1), MetadataTokens.MethodDefinitionHandle(1)); + metadata.AddTypeDefinition(TypeAttributes.Public | TypeAttributes.Abstract | TypeAttributes.Sealed, + metadata.GetOrAddString(DhcpNamespace), metadata.GetOrAddString("Apis"), default, + MetadataTokens.FieldDefinitionHandle(1), MetadataTokens.MethodDefinitionHandle(1)); + var signature = new BlobBuilder(); + new BlobEncoder(signature).MethodSignature().Parameters(6, result => result.Type().UInt32(), parameters => + { + for (int index = 0; index < 6; index++) + parameters.AddParameter().Type().UInt32(); + }); + var method = metadata.AddMethodDefinition(MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.PinvokeImpl, + MethodImplAttributes.PreserveSig, metadata.GetOrAddString("DhcpEnumSubnets"), metadata.GetOrAddBlob(signature), -1, + MetadataTokens.ParameterHandle(1)); + var module = metadata.AddModuleReference(metadata.GetOrAddString("dhcpsapi.dll")); + metadata.AddMethodImport(method, MethodImportAttributes.CallingConventionWinApi, metadata.GetOrAddString("DhcpEnumSubnets"), module); + var names = new[] { "ServerIpAddress", "ResumeHandle", "PreferredMaximum", "EnumInfo", "ElementsRead", "ElementsTotal" }; + for (int index = 0; index < names.Length; index++) + metadata.AddParameter(index == 3 ? direction : ParameterAttributes.In, metadata.GetOrAddString(names[index]), index + 1); + var image = new BlobBuilder(); + new MetadataRootBuilder(metadata).Serialize(image, 0, 0); + return MetadataReaderProvider.FromMetadataImage(image.ToImmutableArray()); + } + } + [Theory] [InlineData("valid")] [InlineData("missing-type")] @@ -804,7 +1235,7 @@ private void AssertEveryPhysicalTypeUnchanged(MetadataReader expectedReader, Met internal static string SnapshotType(MetadataReader reader, TypeDefinition type, bool correctConstructorInstanceBits = false, bool normalizeReviewedChanges = false, ISet usedEnumSites = null, ISet usedRetvalSites = null, - ISet usedPreservedResultSites = null) + ISet usedPreservedResultSites = null, ISet usedNativeDirectionSites = null) { string Attributes(CustomAttributeHandleCollection values, string associatedEnum = null, bool nativeRetval = false, bool preservedResult = false) @@ -872,10 +1303,22 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum string methodName = reader.GetString(method.Name); var parameters = method.GetParameters().Select(reader.GetParameter).ToArray(); var parameterTypes = signature.ParameterTypes.ToArray(); + string returnType = signature.ReturnType; var parameterEnums = new Dictionary(); foreach (var use in uses.Where(value => typeName == "Apis" && value.Owner == methodName)) { - var parameter = parameters.Single(value => reader.GetString(value.Name) == use.Member); + var parameter = use.Member == "return" + ? parameters.Single(value => value.SequenceNumber == 0) + : parameters.Single(value => reader.GetString(value.Name) == use.Member); + if (use.Member == "return") + { + Assert.Equal("", reader.GetString(parameter.Name)); + Assert.Equal(use.OldType, returnType); + returnType = use.Native; + parameterEnums.Add(0, use.Enum); + usedEnumSites?.Add(use.Site); + continue; + } Assert.True(parameter.SequenceNumber > 0); Assert.Equal(use.OldType, parameterTypes[parameter.SequenceNumber - 1]); parameterTypes[parameter.SequenceNumber - 1] = use.Native; @@ -897,7 +1340,7 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum implementation |= MethodImplAttributes.PreserveSig; usedPreservedResultSites?.Add($"{ns}.{typeName}.{methodName}"); } - rows.Add($"M|{methodName}|{method.Attributes}|{implementation}|{Signature(signature, header, parameterTypes)}|" + + rows.Add($"M|{methodName}|{method.Attributes}|{implementation}|{Signature(signature, header, parameterTypes, returnType)}|" + $"{Import(reader, method)}|{Attributes(method.GetCustomAttributes(), preservedResult: preservedResult)}"); foreach (var parameter in parameters) { @@ -905,8 +1348,19 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum bool nativeRetval = normalizeReviewedChanges && NativeRetvalUses.Contains((ns, typeName, methodName, parameterName)); if (nativeRetval) usedRetvalSites?.Add($"{ns}.{typeName}.{methodName}.{parameterName}"); + var direction = normalizeReviewedChanges + ? NativeDirectionUses.SingleOrDefault(value => + (value.Namespace, value.Owner, value.Method, value.Parameter) == (ns, typeName, methodName, parameterName)) + : default; + var parameterAttributes = parameter.Attributes; + if (direction.Parameter != null) + { + Assert.Equal(direction.Before, parameterAttributes); + parameterAttributes = direction.After; + usedNativeDirectionSites?.Add($"{ns}.{typeName}.{methodName}.{parameterName}"); + } string attributes = Attributes(parameter.GetCustomAttributes(), parameterEnums.GetValueOrDefault(parameter.SequenceNumber), nativeRetval); - rows.Add($"P|{parameter.SequenceNumber}|{reader.GetString(parameter.Name)}|{parameter.Attributes}|" + + rows.Add($"P|{parameter.SequenceNumber}|{reader.GetString(parameter.Name)}|{parameterAttributes}|" + $"{Blob(parameter.GetMarshallingDescriptor())}|{attributes}"); } } @@ -941,8 +1395,8 @@ private static Dictionary Types(MetadataReader reader) } }, reader.GetTypeDefinition, StringComparer.Ordinal); - private static TypeDefinition Type(MetadataReader reader, string name, int architecture) - => reader.TypeDefinitions.Select(reader.GetTypeDefinition).Single(type => reader.GetString(type.Namespace) == WinHttpNamespace && + private static TypeDefinition Type(MetadataReader reader, string name, int architecture, string ns = WinHttpNamespace) + => reader.TypeDefinitions.Select(reader.GetTypeDefinition).Single(type => reader.GetString(type.Namespace) == ns && reader.GetString(type.Name) == name && Supports(reader, type.GetCustomAttributes(), architecture)); private static bool Supports(MetadataReader reader, CustomAttributeHandleCollection attributes, int architecture) @@ -1005,14 +1459,15 @@ private static string FullName(MetadataReader reader, EntityHandle handle) throw new InvalidDataException("Unsupported type handle: " + handle.Kind); } - private static string Signature(MethodSignature signature, int? header = null, IEnumerable parameterTypes = null) - => $"{header ?? signature.Header.RawValue}|{signature.GenericParameterCount}|{signature.RequiredParameterCount}|{signature.ReturnType}|" + + private static string Signature(MethodSignature signature, int? header = null, IEnumerable parameterTypes = null, + string returnType = null) + => $"{header ?? signature.Header.RawValue}|{signature.GenericParameterCount}|{signature.RequiredParameterCount}|{returnType ?? signature.ReturnType}|" + string.Join(",", parameterTypes ?? signature.ParameterTypes); - private sealed record EnumUse(string Namespace, string Owner, string Member, string Enum, string Native) + private sealed record EnumUse(string Namespace, string Owner, string Member, string Enum, string Native, string EnumNamespace = null) { internal string Site => Namespace + "." + Owner + "::" + Member; - internal string OldType => Namespace + "." + Enum + new string('*', Native.Length - Native.TrimEnd('*').Length); + internal string OldType => (EnumNamespace ?? Namespace) + "." + Enum + new string('*', Native.Length - Native.TrimEnd('*').Length); } private static Image Open(string variable) => new Image(Environment.GetEnvironmentVariable(variable)); diff --git a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs index 09d745462..9d6503beb 100644 --- a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs @@ -192,6 +192,65 @@ public void AdditionalPreparedPartitionsKeepOrdinaryNativeAbi(string partition, static_assert(XINPUT_KEYSTROKE_KEYUP == 2); static_assert(XINPUT_KEYSTROKE_REPEAT == 4); static_assert(XINPUT_FLAG_GAMEPAD == 1); +", + "Wnet" => @" +#ifdef RESOURCEUSAGE_NONE +#error Metadata-only RESOURCEUSAGE_NONE must not become a native macro +#endif +static_assert(UNIVERSAL_NAME_INFO_LEVEL == 1u); +static_assert(REMOTE_NAME_INFO_LEVEL == 2u); +static_assert(WNPERM_DLG_PERM == 0u); +static_assert(WNPERM_DLG_AUDIT == 1u); +static_assert(WNPERM_DLG_OWNER == 2u); +static_assert(RESOURCEUSAGE_CONNECTABLE == 1u); +static_assert(RESOURCEUSAGE_CONTAINER == 2u); +static_assert(RESOURCEUSAGE_ATTACHED == 16u); +static_assert(RESOURCEUSAGE_ALL == 19u); +static_assert(CONNECT_UPDATE_PROFILE == 1u); +static_assert(CONNECT_UPDATE_RECENT == 2u); +static_assert(CONNECT_TEMPORARY == 4u); +static_assert(CONNECT_INTERACTIVE == 8u); +static_assert(CONNECT_PROMPT == 16u); +static_assert(CONNECT_NEED_DRIVE == 32u); +static_assert(CONNECT_REFCOUNT == 64u); +static_assert(CONNECT_REDIRECT == 128u); +static_assert(CONNECT_LOCALDRIVE == 256u); +static_assert(CONNECT_CURRENT_MEDIA == 512u); +static_assert(CONNECT_DEFERRED == 1024u); +static_assert(CONNECT_RESERVED == 4278190080u); +static_assert(CONNECT_COMMANDLINE == 2048u); +static_assert(CONNECT_CMD_SAVECRED == 4096u); +static_assert(CONNECT_CRED_RESET == 8192u); +static_assert(CONNECT_REQUIRE_INTEGRITY == 16384u); +static_assert(CONNECT_REQUIRE_PRIVACY == 32768u); +static_assert(CONNECT_WRITE_THROUGH_SEMANTICS == 65536u); +static_assert(CONNECT_GLOBAL_MAPPING == 262144u); +static_assert(WNPS_FILE == 0u); +static_assert(WNPS_DIR == 1u); +static_assert(WNPS_MULT == 2u); +static_assert(WNDN_MKDIR == 1u); +static_assert(WNDN_RMDIR == 2u); +static_assert(WNDN_MVDIR == 3u); +static_assert(RESOURCETYPE_ANY == 0u); +static_assert(RESOURCETYPE_DISK == 1u); +static_assert(RESOURCETYPE_PRINT == 2u); +static_assert(WNFMT_MULTILINE == 1u); +static_assert(WNFMT_ABBREVIATED == 2u); +static_assert(RESOURCE_CONNECTED == 1u); +static_assert(RESOURCE_CONTEXT == 5u); +static_assert(RESOURCE_GLOBALNET == 2u); +static_assert(RESOURCE_REMEMBERED == 3u); +static_assert(NETINFO_DLL16 == 1u); +static_assert(NETINFO_DISKRED == 4u); +static_assert(NETINFO_PRINTERRED == 8u); +static_assert(CONNDLG_RO_PATH == 1u); +static_assert(CONNDLG_CONN_POINT == 2u); +static_assert(CONNDLG_USE_MRU == 4u); +static_assert(CONNDLG_HIDE_BOX == 8u); +static_assert(CONNDLG_PERSIST == 16u); +static_assert(CONNDLG_NOT_PERSIST == 32u); +static_assert(DISC_UPDATE_PROFILE == 1u); +static_assert(DISC_NO_FORCE == 64u); ", _ => "", }; From 5bdbee6013d2bc529654dcb00a35a24e0db9059f Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:38:15 -0700 Subject: [PATCH 08/17] Integrate bounded Device header annotation source payload Apply only8d236a58dc348a52ab483d9959f3a7cba770b04f above qualified c587/43af and the ordered Network sequence. Union exact source preimages/partitions/patches without overwriting inherited inputs; native-only DeviceAccess and orphan HANDLE_SDP_TYPE are not admitted migrations. The following exact84df payload preserves complete authored invalid sets before any central image production. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../WinSDK/ConstantsScraper.settings.rsp | 2 - .../WinSDK/Partitions/Bluetooth/settings.rsp | 2 + .../Partitions/DeviceQuery/settings.rsp | 2 + generation/WinSDK/Partitions/Hid/settings.rsp | 2 + generation/WinSDK/WithSetLastError.rsp | 12 -- generation/WinSDK/autoTypes.json | 14 -- generation/WinSDK/patches/SdkHeaders.json | 49 ++++- .../post-midl/shared/hidpi.annotations.patch | 14 ++ .../um/bluetoothapis.annotations.patch | 190 ++++++++++++++++++ .../um/bluetoothleapis.annotations.patch | 23 +++ .../um/devfiltertypes.annotations.patch | 12 ++ .../post-midl/um/dinput.annotations.patch | 13 ++ .../post-midl/um/ws2bth.annotations.patch | 14 ++ generation/WinSDK/scraper.settings.rsp | 1 - generation/WinSDK/supportedOS.rsp | 48 ----- 15 files changed, 319 insertions(+), 79 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/shared/hidpi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/bluetoothapis.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/bluetoothleapis.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/devfiltertypes.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/dinput.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/ws2bth.annotations.patch diff --git a/generation/WinSDK/ConstantsScraper.settings.rsp b/generation/WinSDK/ConstantsScraper.settings.rsp index f75796430..18653ec0d 100644 --- a/generation/WinSDK/ConstantsScraper.settings.rsp +++ b/generation/WinSDK/ConstantsScraper.settings.rsp @@ -3,7 +3,6 @@ E_FAIL=NativeTypeName("HRESULT") E_INVALIDARG=NativeTypeName("HRESULT") E_NOTIMPL=NativeTypeName("HRESULT") E_OUTOFMEMORY=NativeTypeName("HRESULT") -HIDP_STATUS_I8242_TRANS_UNKNOWN=NativeTypeName("NTSTATUS") IDI_APPLICATION=NativeTypeName("LPCWSTR") IDI_ASTERISK=NativeTypeName("LPCWSTR") IDI_ERROR=NativeTypeName("LPCWSTR") @@ -21,7 +20,6 @@ AF_APPLETALK=ushort AF_ATM=ushort AF_BAN=ushort AF_BAN=ushort -AF_BTH=ushort AF_CCITT=ushort AF_CHAOS=ushort AF_CLUSTER=ushort diff --git a/generation/WinSDK/Partitions/Bluetooth/settings.rsp b/generation/WinSDK/Partitions/Bluetooth/settings.rsp index 51b2399ce..627e3f1d3 100644 --- a/generation/WinSDK/Partitions/Bluetooth/settings.rsp +++ b/generation/WinSDK/Partitions/Bluetooth/settings.rsp @@ -8,3 +8,5 @@ /um/ws2bth.h --namespace Windows.Win32.Devices.Bluetooth +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/DeviceQuery/settings.rsp b/generation/WinSDK/Partitions/DeviceQuery/settings.rsp index 5e0057c83..f03e96b09 100644 --- a/generation/WinSDK/Partitions/DeviceQuery/settings.rsp +++ b/generation/WinSDK/Partitions/DeviceQuery/settings.rsp @@ -4,3 +4,5 @@ /um/devquerydef.h --namespace Windows.Win32.Devices.DeviceQuery +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/Hid/settings.rsp b/generation/WinSDK/Partitions/Hid/settings.rsp index ab91bc86b..16f81f707 100644 --- a/generation/WinSDK/Partitions/Hid/settings.rsp +++ b/generation/WinSDK/Partitions/Hid/settings.rsp @@ -11,3 +11,5 @@ /um/gpiobuttontypes.h --namespace Windows.Win32.Devices.HumanInterfaceDevice +--config +parse-win32-annotations diff --git a/generation/WinSDK/WithSetLastError.rsp b/generation/WinSDK/WithSetLastError.rsp index bde9b1b7d..d9a30568e 100644 --- a/generation/WinSDK/WithSetLastError.rsp +++ b/generation/WinSDK/WithSetLastError.rsp @@ -164,18 +164,6 @@ BindImageEx BindIoCompletionCallback BitBlt BlockInput -BluetoothDisplayDeviceProperties -BluetoothFindDeviceClose -BluetoothFindFirstDevice -BluetoothFindFirstRadio -BluetoothFindNextDevice -BluetoothFindNextRadio -BluetoothFindRadioClose -BluetoothGetRadioInfo -BluetoothRegisterForAuthentication -BluetoothSdpEnumAttributes -BluetoothSelectDevices -BluetoothUnregisterAuthentication BringWindowToTop BroadcastSystemMessage BroadcastSystemMessageExA diff --git a/generation/WinSDK/autoTypes.json b/generation/WinSDK/autoTypes.json index 81716c0f9..566c73aac 100644 --- a/generation/WinSDK/autoTypes.json +++ b/generation/WinSDK/autoTypes.json @@ -1692,20 +1692,6 @@ "ValueType": "void*", "NativeTypedef": true }, - { - "Name": "HBLUETOOTH_DEVICE_FIND", - "ValueType": "DECLARE_HANDLE", - "CloseApi": "BluetoothFindDeviceClose", - "InvalidHandleValues": [ -1, 0 ], - "NativeTypedef": true - }, - { - "Name": "HBLUETOOTH_RADIO_FIND", - "ValueType": "DECLARE_HANDLE", - "CloseApi": "BluetoothFindRadioClose", - "InvalidHandleValues": [ -1, 0 ], - "NativeTypedef": true - }, { "Name": "HDEVNOTIFY", "ValueType": "void*", diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index 0f657a9d3..fe1ebc744 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -219,6 +219,42 @@ "sourceSha256": "5AFA73066E9F0875B348F082FF9F158B33812B566DECE3D0A338CEC9961D940B", "sdkPath": "c\\include\\10.0.26100.0\\um\\NetSh.h", "sdkSha256": "5AFA73066E9F0875B348F082FF9F158B33812B566DECE3D0A338CEC9961D940B" + }, + { + "path": "um\\bluetoothapis.h", + "sourceSha256": "9253AB24097AFC6BDFC9C01D4E1AF404AD3C07E2C40DFD00A5772F7455AD9CBF", + "sdkPath": "c\\include\\10.0.26100.0\\um\\bluetoothapis.h", + "sdkSha256": "9253AB24097AFC6BDFC9C01D4E1AF404AD3C07E2C40DFD00A5772F7455AD9CBF" + }, + { + "path": "um\\bluetoothleapis.h", + "sourceSha256": "17EFD0367A3EC5A6FD2D61318AEBA69ED5F7AE5DBB3BC24AF0014FB0A5476D99", + "sdkPath": "c\\include\\10.0.26100.0\\um\\bluetoothleapis.h", + "sdkSha256": "17EFD0367A3EC5A6FD2D61318AEBA69ED5F7AE5DBB3BC24AF0014FB0A5476D99" + }, + { + "path": "um\\ws2bth.h", + "sourceSha256": "E4A7B6EF2DCFFBB736F826E475046916AF6C26C96282D5411EA71350CCCC5271", + "sdkPath": "c\\include\\10.0.26100.0\\um\\ws2bth.h", + "sdkSha256": "E4A7B6EF2DCFFBB736F826E475046916AF6C26C96282D5411EA71350CCCC5271" + }, + { + "path": "um\\dinput.h", + "sourceSha256": "FF440B043BB853835E6BD3E641EE3BFD11B63FC08AF7A935BAB2983F2A52070A", + "sdkPath": "c\\include\\10.0.26100.0\\um\\dinput.h", + "sdkSha256": "FF440B043BB853835E6BD3E641EE3BFD11B63FC08AF7A935BAB2983F2A52070A" + }, + { + "path": "shared\\hidpi.h", + "sourceSha256": "0A2A18C3F6347B0CA5D33DC74ABC4A81160B2F5C5A23A83AEE063421BA87D09C", + "sdkPath": "c\\include\\10.0.26100.0\\shared\\hidpi.h", + "sdkSha256": "0A2A18C3F6347B0CA5D33DC74ABC4A81160B2F5C5A23A83AEE063421BA87D09C" + }, + { + "path": "um\\devfiltertypes.h", + "sourceSha256": "2F37EFE3FC233B830BAC96E9733D269847200D5E85586E67A1423B699C642896", + "sdkPath": "c\\include\\10.0.26100.0\\um\\devfiltertypes.h", + "sdkSha256": "2F37EFE3FC233B830BAC96E9733D269847200D5E85586E67A1423B699C642896" } ], "partitions": [ @@ -257,7 +293,10 @@ "Foundation", "Com", "Rpc", - "WinSock" + "WinSock", + "Bluetooth", + "Hid", + "DeviceQuery" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -293,6 +332,12 @@ "post-midl\\um\\dhcpv6csdk.annotations.patch", "post-midl\\um\\dhcpcsdk.annotations.patch", "post-midl\\um\\dhcpsapi.annotations.patch", - "post-midl\\um\\netsh.annotations.patch" + "post-midl\\um\\netsh.annotations.patch", + "post-midl\\um\\bluetoothapis.annotations.patch", + "post-midl\\um\\bluetoothleapis.annotations.patch", + "post-midl\\um\\ws2bth.annotations.patch", + "post-midl\\um\\dinput.annotations.patch", + "post-midl\\shared\\hidpi.annotations.patch", + "post-midl\\um\\devfiltertypes.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/shared/hidpi.annotations.patch b/generation/WinSDK/patches/post-midl/shared/hidpi.annotations.patch new file mode 100644 index 000000000..4f3791037 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/shared/hidpi.annotations.patch @@ -0,0 +1,14 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/shared/hidpi.h b/generation/WinSDK/RecompiledIdlHeaders/shared/hidpi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/shared/hidpi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/shared/hidpi.h +@@ -2032,3 +2032,10 @@ + #define HIDP_STATUS_I8242_TRANS_UNKNOWN HIDP_STATUS_I8042_TRANS_UNKNOWN + ++#ifdef WIN32METADATA ++#pragma push_macro("HIDP_STATUS_I8242_TRANS_UNKNOWN") ++#undef HIDP_STATUS_I8242_TRANS_UNKNOWN ++constexpr NTSTATUS HIDP_STATUS_I8242_TRANS_UNKNOWN = HIDP_STATUS_I8042_TRANS_UNKNOWN; ++#pragma pop_macro("HIDP_STATUS_I8242_TRANS_UNKNOWN") ++#endif ++ + #ifndef _KERNEL_MODE diff --git a/generation/WinSDK/patches/post-midl/um/bluetoothapis.annotations.patch b/generation/WinSDK/patches/post-midl/um/bluetoothapis.annotations.patch new file mode 100644 index 000000000..90fc6b2e0 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/bluetoothapis.annotations.patch @@ -0,0 +1,190 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothapis.h b/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothapis.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothapis.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothapis.h +@@ -5,6 +5,7 @@ + + #pragma once + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -138,3 +139,6 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ ++_Win32_RAIIFree_(BluetoothFindRadioClose, 0) + HBLUETOOTH_RADIO_FIND + WINAPI + BluetoothFindFirstRadio( +@@ -177,3 +181,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + BOOL + WINAPI + BluetoothFindNextRadio( +@@ -202,3 +208,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + BOOL + WINAPI + BluetoothFindRadioClose( +@@ -255,3 +263,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + DWORD + WINAPI + BluetoothGetRadioInfo( +@@ -423,3 +433,6 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ ++_Win32_RAIIFree_(BluetoothFindDeviceClose, 0) + HBLUETOOTH_DEVICE_FIND + WINAPI + BluetoothFindFirstDevice( +@@ -466,3 +479,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + BOOL + WINAPI + BluetoothFindNextDevice( +@@ -491,3 +506,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + BOOL + WINAPI + BluetoothFindDeviceClose( +@@ -536,3 +553,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothGetDeviceInfo( +@@ -571,3 +589,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothUpdateDeviceRecord( +@@ -590,3 +609,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothRemoveDevice( +@@ -710,3 +730,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + BOOL + WINAPI + BluetoothSelectDevices( +@@ -730,3 +752,4 @@ ++_Win32_SupportedOS_WindowsVista_ + BOOL + WINAPI + BluetoothSelectDevicesFree( +@@ -764,3 +787,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + BOOL + WINAPI + BluetoothDisplayDeviceProperties( +@@ -853,3 +878,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothAuthenticateDevice( +@@ -971,3 +997,4 @@ ++_Win32_SupportedOS_WindowsXP_ + DWORD + WINAPI + BluetoothAuthenticateDeviceEx( +@@ -1027,3 +1054,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothAuthenticateMultipleDevices( +@@ -1096,3 +1124,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothSetServiceState( +@@ -1139,3 +1168,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothEnumerateInstalledServices( +@@ -1178,3 +1208,5 @@ ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++ + BOOL + WINAPI + BluetoothEnableDiscovery( +@@ -1268,6 +1300,8 @@ + BluetoothIsConnectable( + _In_opt_ HANDLE hRadio + ); ++ ++_Win32_SupportedOS_END_() + + // *************************************************************************** + // +@@ -1318,3 +1352,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + DWORD + WINAPI + BluetoothRegisterForAuthentication( +@@ -1376,3 +1412,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothRegisterForAuthenticationEx( +@@ -1410,3 +1447,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + BOOL + WINAPI + BluetoothUnregisterAuthentication( +@@ -1450,3 +1489,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothSendAuthenticationResponse( +@@ -1521,3 +1561,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothSendAuthenticationResponseEx( +@@ -1642,3 +1683,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothSdpGetElementData( +@@ -1713,3 +1755,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothSdpGetContainerElementData( +@@ -1767,3 +1810,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothSdpGetAttributeValue( +@@ -1854,3 +1898,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothSdpGetString( +@@ -1902,3 +1947,5 @@ ++_Win32_SupportedOS_WindowsVista_ ++_Win32_SetLastError_ + BOOL + WINAPI + BluetoothSdpEnumAttributes( +@@ -1920,3 +1967,4 @@ ++_Win32_SupportedOS_WindowsVista_ + DWORD + WINAPI + BluetoothSetLocalServiceInfo( +@@ -1952,3 +2000,4 @@ ++_Win32_SupportedOS_WindowsVista_ + BOOL + WINAPI + BluetoothIsVersionAvailable( diff --git a/generation/WinSDK/patches/post-midl/um/bluetoothleapis.annotations.patch b/generation/WinSDK/patches/post-midl/um/bluetoothleapis.annotations.patch new file mode 100644 index 000000000..069a1a405 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/bluetoothleapis.annotations.patch @@ -0,0 +1,23 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothleapis.h b/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothleapis.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothleapis.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothleapis.h +@@ -20,6 +20,7 @@ + #endif //_MSC_VER + #include + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -32,3 +33,5 @@ + #if NTDDI_VERSION >= NTDDI_WIN8 + ++_Win32_SupportedOS_BEGIN_(Windows8) ++ + +@@ -714,3 +717,5 @@ + + ++_Win32_SupportedOS_END_() ++ + #endif //NTDDI_WIN8 diff --git a/generation/WinSDK/patches/post-midl/um/devfiltertypes.annotations.patch b/generation/WinSDK/patches/post-midl/um/devfiltertypes.annotations.patch new file mode 100644 index 000000000..b8434bf62 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/devfiltertypes.annotations.patch @@ -0,0 +1,12 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/devfiltertypes.h b/generation/WinSDK/RecompiledIdlHeaders/um/devfiltertypes.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/devfiltertypes.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/devfiltertypes.h +@@ -33,3 +33,7 @@ + #endif +-enum _DEVPROP_OPERATOR { ++enum _DEVPROP_OPERATOR ++#ifdef WIN32METADATA ++ : unsigned int ++#endif ++{ + // operator modifiers diff --git a/generation/WinSDK/patches/post-midl/um/dinput.annotations.patch b/generation/WinSDK/patches/post-midl/um/dinput.annotations.patch new file mode 100644 index 000000000..7fb111001 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/dinput.annotations.patch @@ -0,0 +1,13 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/dinput.h b/generation/WinSDK/RecompiledIdlHeaders/um/dinput.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/dinput.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/dinput.h +@@ -13,3 +13,4 @@ + #include ++#include + + #ifndef DIJ_RINGZERO +@@ -4348,3 +4349,4 @@ + * dwFlags is reserved and should be set to zero + */ ++_Win32_SupportedOS_Windows2000_ + WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags ); diff --git a/generation/WinSDK/patches/post-midl/um/ws2bth.annotations.patch b/generation/WinSDK/patches/post-midl/um/ws2bth.annotations.patch new file mode 100644 index 000000000..55cf367d0 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/ws2bth.annotations.patch @@ -0,0 +1,14 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/ws2bth.h b/generation/WinSDK/RecompiledIdlHeaders/um/ws2bth.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/ws2bth.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/ws2bth.h +@@ -54,3 +54,10 @@ + #endif + ++#ifdef WIN32METADATA ++#pragma push_macro("AF_BTH") ++#undef AF_BTH ++constexpr USHORT AF_BTH = 32; ++#pragma pop_macro("AF_BTH") ++#endif ++ + typedef struct _SOCKADDR_BTH diff --git a/generation/WinSDK/scraper.settings.rsp b/generation/WinSDK/scraper.settings.rsp index 95b5ca5e6..32658fe72 100644 --- a/generation/WinSDK/scraper.settings.rsp +++ b/generation/WinSDK/scraper.settings.rsp @@ -14,7 +14,6 @@ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS=uint INTERACTION_FLAGS=uint INTERACTION_CONFIGURATION_FLAGS=uint CROSS_SLIDE_FLAGS=uint -DEVPROP_OPERATOR=uint PSS_CAPTURE_FLAGS=uint PRJ_NOTIFY_TYPES=uint CF_SYNC_PROVIDER_STATUS=uint diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 8e6b94e9e..95aabee99 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -429,53 +429,6 @@ IBackgroundCopyFile5=SupportedOSPlatform("windows8.0") IBackgroundCopyJob5=SupportedOSPlatform("windows8.0") IBITSExtensionSetup=SupportedOSPlatform("windows6.0.6000") IBITSExtensionSetupFactory=SupportedOSPlatform("windows6.0.6000") -BluetoothAuthenticateDevice=SupportedOSPlatform("windows6.0.6000") -BluetoothAuthenticateDeviceEx=SupportedOSPlatform("windows5.1.2600") -BluetoothAuthenticateMultipleDevices=SupportedOSPlatform("windows6.0.6000") -BluetoothDisplayDeviceProperties=SupportedOSPlatform("windows6.0.6000") -BluetoothEnableDiscovery=SupportedOSPlatform("windows6.0.6000") -BluetoothEnableIncomingConnections=SupportedOSPlatform("windows6.0.6000") -BluetoothEnumerateInstalledServices=SupportedOSPlatform("windows6.0.6000") -BluetoothFindDeviceClose=SupportedOSPlatform("windows6.0.6000") -BluetoothFindFirstDevice=SupportedOSPlatform("windows6.0.6000") -BluetoothFindFirstRadio=SupportedOSPlatform("windows6.0.6000") -BluetoothFindNextDevice=SupportedOSPlatform("windows6.0.6000") -BluetoothFindNextRadio=SupportedOSPlatform("windows6.0.6000") -BluetoothFindRadioClose=SupportedOSPlatform("windows6.0.6000") -BluetoothGetDeviceInfo=SupportedOSPlatform("windows6.0.6000") -BluetoothGetRadioInfo=SupportedOSPlatform("windows6.0.6000") -BluetoothIsConnectable=SupportedOSPlatform("windows6.0.6000") -BluetoothIsDiscoverable=SupportedOSPlatform("windows6.0.6000") -BluetoothIsVersionAvailable=SupportedOSPlatform("windows6.0.6000") -BluetoothRegisterForAuthentication=SupportedOSPlatform("windows6.0.6000") -BluetoothRegisterForAuthenticationEx=SupportedOSPlatform("windows6.0.6000") -BluetoothRemoveDevice=SupportedOSPlatform("windows6.0.6000") -BluetoothSdpEnumAttributes=SupportedOSPlatform("windows6.0.6000") -BluetoothSdpGetAttributeValue=SupportedOSPlatform("windows6.0.6000") -BluetoothSdpGetContainerElementData=SupportedOSPlatform("windows6.0.6000") -BluetoothSdpGetElementData=SupportedOSPlatform("windows6.0.6000") -BluetoothSdpGetString=SupportedOSPlatform("windows6.0.6000") -BluetoothSelectDevices=SupportedOSPlatform("windows6.0.6000") -BluetoothSelectDevicesFree=SupportedOSPlatform("windows6.0.6000") -BluetoothSendAuthenticationResponse=SupportedOSPlatform("windows6.0.6000") -BluetoothSendAuthenticationResponseEx=SupportedOSPlatform("windows6.0.6000") -BluetoothSetLocalServiceInfo=SupportedOSPlatform("windows6.0.6000") -BluetoothSetServiceState=SupportedOSPlatform("windows6.0.6000") -BluetoothUnregisterAuthentication=SupportedOSPlatform("windows6.0.6000") -BluetoothUpdateDeviceRecord=SupportedOSPlatform("windows6.0.6000") -BluetoothGATTAbortReliableWrite=SupportedOSPlatform("windows8.0") -BluetoothGATTBeginReliableWrite=SupportedOSPlatform("windows8.0") -BluetoothGATTEndReliableWrite=SupportedOSPlatform("windows8.0") -BluetoothGATTGetCharacteristics=SupportedOSPlatform("windows8.0") -BluetoothGATTGetCharacteristicValue=SupportedOSPlatform("windows8.0") -BluetoothGATTGetDescriptors=SupportedOSPlatform("windows8.0") -BluetoothGATTGetDescriptorValue=SupportedOSPlatform("windows8.0") -BluetoothGATTGetIncludedServices=SupportedOSPlatform("windows8.0") -BluetoothGATTGetServices=SupportedOSPlatform("windows8.0") -BluetoothGATTRegisterEvent=SupportedOSPlatform("windows8.0") -BluetoothGATTSetCharacteristicValue=SupportedOSPlatform("windows8.0") -BluetoothGATTSetDescriptorValue=SupportedOSPlatform("windows8.0") -BluetoothGATTUnregisterEvent=SupportedOSPlatform("windows8.0") ICameraUIControl=SupportedOSPlatform("windows8.0") ICameraUIControlEventCallback=SupportedOSPlatform("windows8.0") ICertificateEnrollmentPolicyServerSetup=SupportedOSPlatform("windows6.1") @@ -4155,7 +4108,6 @@ QueryIoRateControlInformationJobObject=SupportedOSPlatform("windows10.0.10240") SetInformationJobObject=SupportedOSPlatform("windows5.1.2600") SetIoRateControlInformationJobObject=SupportedOSPlatform("windows10.0.10240") TerminateJobObject=SupportedOSPlatform("windows5.1.2600") -joyConfigChanged=SupportedOSPlatform("windows5.0") joyGetDevCaps=SupportedOSPlatform("windows5.0") joyGetDevCapsW=SupportedOSPlatform("windows5.0") joyGetNumDevs=SupportedOSPlatform("windows5.0") From f64bfbcb57fd73f601d423e7e9f51f0604b7cd2b Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:38:58 -0700 Subject: [PATCH 09/17] Preserve complete Bluetooth invalid-handle sets during integration Apply the exact84df8c8a1c4cfae13f3d734eca99334d27bbb6a5 correction immediately after8d236 source integration. Preserve [-1,0] for BluetoothFindRadioClose and BluetoothFindDeviceClose; do not narrow existing authored invalid contracts to zero. Canonical combined validation follows serial owner integration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../patches/post-midl/um/bluetoothapis.annotations.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generation/WinSDK/patches/post-midl/um/bluetoothapis.annotations.patch b/generation/WinSDK/patches/post-midl/um/bluetoothapis.annotations.patch index 90fc6b2e0..22bf4815d 100644 --- a/generation/WinSDK/patches/post-midl/um/bluetoothapis.annotations.patch +++ b/generation/WinSDK/patches/post-midl/um/bluetoothapis.annotations.patch @@ -12,7 +12,7 @@ diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothapis.h b/generat @@ -138,3 +139,6 @@ +_Win32_SupportedOS_WindowsVista_ +_Win32_SetLastError_ -+_Win32_RAIIFree_(BluetoothFindRadioClose, 0) ++_Win32_RAIIFree_(BluetoothFindRadioClose, -1, 0) HBLUETOOTH_RADIO_FIND WINAPI BluetoothFindFirstRadio( @@ -37,7 +37,7 @@ diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/bluetoothapis.h b/generat @@ -423,3 +433,6 @@ +_Win32_SupportedOS_WindowsVista_ +_Win32_SetLastError_ -+_Win32_RAIIFree_(BluetoothFindDeviceClose, 0) ++_Win32_RAIIFree_(BluetoothFindDeviceClose, -1, 0) HBLUETOOTH_DEVICE_FIND WINAPI BluetoothFindFirstDevice( From 8c43c8890244762feb3b8b10aeea39abce40ad3f Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:40:25 -0700 Subject: [PATCH 10/17] Integrate bounded System header annotation payload Apply only5e90db00e6fd5490c3486de9035d3ab44991d8d5 into qualified c587/43af plus ordered Network/Device inputs. Preserve held DWM_SHOWCONTACT uint projection and EFFECTIVE_POWER_MODE_CALLBACK pointer-reduction encoding. WER cleanup targets native producers; measure physical HREPORT/HREPORTSTORE representation without invented handles or assumed type totals. Canonical closure and actual image grading remain pending. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- generation/WinSDK/Partitions/Dwm/settings.rsp | 2 + .../WinSDK/Partitions/Power/settings.rsp | 2 + generation/WinSDK/Partitions/Wec/settings.rsp | 2 + generation/WinSDK/Partitions/Wer/settings.rsp | 2 + generation/WinSDK/WithSetLastError.rsp | 20 - generation/WinSDK/autoTypes.json | 14 - generation/WinSDK/emitter.settings.rsp | 62 -- generation/WinSDK/enums.json | 156 +---- generation/WinSDK/patches/SdkHeaders.json | 75 ++- .../post-midl/um/dwmapi.annotations.patch | 129 ++++ .../post-midl/um/errorrep.annotations.patch | 34 ++ .../post-midl/um/evcoll.annotations.patch | 36 ++ .../post-midl/um/powerbase.annotations.patch | 66 ++ .../um/powersetting.annotations.patch | 109 ++++ .../post-midl/um/powrprof.annotations.patch | 563 ++++++++++++++++++ .../post-midl/um/werapi.annotations.patch | 330 ++++++++++ generation/WinSDK/supportedOS.rsp | 162 ----- .../WinHttpNativeControlTests.cs | 57 ++ 18 files changed, 1406 insertions(+), 415 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/um/dwmapi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/errorrep.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/evcoll.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/powerbase.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/powersetting.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/powrprof.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/werapi.annotations.patch diff --git a/generation/WinSDK/Partitions/Dwm/settings.rsp b/generation/WinSDK/Partitions/Dwm/settings.rsp index baf7b802b..f2b17b4c4 100644 --- a/generation/WinSDK/Partitions/Dwm/settings.rsp +++ b/generation/WinSDK/Partitions/Dwm/settings.rsp @@ -2,3 +2,5 @@ /um/dwmapi.h --namespace Windows.Win32.Graphics.Dwm +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/Power/settings.rsp b/generation/WinSDK/Partitions/Power/settings.rsp index 2a36176a0..b16d308de 100644 --- a/generation/WinSDK/Partitions/Power/settings.rsp +++ b/generation/WinSDK/Partitions/Power/settings.rsp @@ -7,3 +7,5 @@ /um/powrprof.h --namespace Windows.Win32.System.Power +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/Wec/settings.rsp b/generation/WinSDK/Partitions/Wec/settings.rsp index 9abd7b314..b0ac645e4 100644 --- a/generation/WinSDK/Partitions/Wec/settings.rsp +++ b/generation/WinSDK/Partitions/Wec/settings.rsp @@ -2,3 +2,5 @@ /um/EvColl.h --namespace Windows.Win32.System.EventCollector +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/Wer/settings.rsp b/generation/WinSDK/Partitions/Wer/settings.rsp index 2dddaf26e..8978fddb7 100644 --- a/generation/WinSDK/Partitions/Wer/settings.rsp +++ b/generation/WinSDK/Partitions/Wer/settings.rsp @@ -3,3 +3,5 @@ /um/ErrorRep.h --namespace Windows.Win32.System.ErrorReporting +--config +parse-win32-annotations diff --git a/generation/WinSDK/WithSetLastError.rsp b/generation/WinSDK/WithSetLastError.rsp index d9a30568e..d9794a283 100644 --- a/generation/WinSDK/WithSetLastError.rsp +++ b/generation/WinSDK/WithSetLastError.rsp @@ -32,8 +32,6 @@ AddConditionalAce AddConsoleAliasA AddConsoleAliasW AddDllDirectory -AddERExcludedApplicationA -AddERExcludedApplicationW AddIntegrityLabelToBoundaryDescriptor AddLogContainer AddLogContainerSet @@ -180,7 +178,6 @@ CancelIo CancelIoEx CancelSynchronousIo CancelWaitableTimer -CanUserWritePwrScheme CapabilitiesRequestAndCapabilitiesReply CascadeWindows CertAddCertificateContextToStore @@ -713,7 +710,6 @@ DeletePortW DeletePrinter DeleteProfileA DeleteProfileW -DeletePwrScheme DeleteService DeleteTimerQueue DeleteTimerQueueEx @@ -744,7 +740,6 @@ DestroyPrivateObjectSecurity DestroyWindow DetectAutoProxyUrl DeviceIoControl -DevicePowerSetDeviceState DialogBoxIndirectParamA DialogBoxIndirectParamW DialogBoxParamA @@ -783,8 +778,6 @@ DumpLogRecords DuplicateHandle DuplicateToken DuplicateTokenEx -EcOpenSubscription -EcOpenSubscriptionEnum EditSecurity EmptyClipboard EnableMouseInPointer @@ -834,7 +827,6 @@ EnumPrintersA EnumPrintersW EnumProtocolsA EnumProtocolsW -EnumPwrSchemes EnumResourceLanguagesA EnumResourceLanguagesExA EnumResourceLanguagesExW @@ -1096,7 +1088,6 @@ GenerateConsoleCtrlEvent GetAce GetAclInformation GetActiveProcessorCount -GetActivePwrScheme GetAddressByNameA GetAddressByNameW getaddrinfo @@ -1205,7 +1196,6 @@ GetCurrentDirectory GetCurrentHwProfileA GetCurrentHwProfileW GetCurrentInputMessageSource -GetCurrentPowerPolicies GetCurrentUmsThread GetCursorInfo GetCursorPos @@ -1446,8 +1436,6 @@ GetProfilesDirectoryW GetProfileType getprotobyname getprotobynumber -GetPwrCapabilities -GetPwrDiskSpindownRange GetQueuedCompletionStatus GetQueuedCompletionStatusEx GetRawInputBuffer @@ -2083,7 +2071,6 @@ ReadEventLogW ReadFile ReadFileEx ReadFileScatter -ReadGlobalPwrPolicy ReadLogArchiveMetadata ReadLogNotification ReadLogRecord @@ -2092,8 +2079,6 @@ ReadNextLogRecord ReadOnlyEnlistment ReadPreviousLogRestartArea ReadProcessMemory -ReadProcessorPwrScheme -ReadPwrScheme ReadUrlCacheEntryStream RealGetWindowClassW ReBaseImage @@ -2228,7 +2213,6 @@ SendNotifyMessageA SendNotifyMessageW sendto SetAclInformation -SetActivePwrScheme SetActiveWindow SetCalendarInfoA SetCalendarInfoW @@ -2384,7 +2368,6 @@ SetServiceStatus SetServiceW setsockopt SetStdHandle -SetSuspendState SetSysColors SetSystemCursor SetSystemFileCacheSize @@ -3111,7 +3094,6 @@ WriteConsoleW WriteFile WriteFileEx WriteFileGather -WriteGlobalPwrPolicy WriteLogRestartArea WritePrivateProfileSectionA WritePrivateProfileSectionW @@ -3120,12 +3102,10 @@ WritePrivateProfileStringW WritePrivateProfileStructA WritePrivateProfileStructW WriteProcessMemory -WriteProcessorPwrScheme WriteProfileSectionA WriteProfileSectionW WriteProfileStringA WriteProfileStringW -WritePwrScheme WSAAccept WSAAddressToStringA WSAAddressToStringW diff --git a/generation/WinSDK/autoTypes.json b/generation/WinSDK/autoTypes.json index 566c73aac..a1712454e 100644 --- a/generation/WinSDK/autoTypes.json +++ b/generation/WinSDK/autoTypes.json @@ -551,20 +551,6 @@ "InvalidHandleValues": [ -1, 0 ], "NativeTypedef": true }, - { - "Name": "HREPORT", - "ValueType": "DECLARE_HANDLE", - "CloseApi": "WerReportCloseHandle", - "InvalidHandleValues": [ -1, 0 ], - "NativeTypedef": true - }, - { - "Name": "HREPORTSTORE", - "ValueType": "DECLARE_HANDLE", - "CloseApi": "WerStoreClose", - "InvalidHandleValues": [ -1, 0 ], - "NativeTypedef": true - }, { "Namespace": "Windows.Win32.UI.Animation", "Name": "UI_ANIMATION_KEYFRAME", diff --git a/generation/WinSDK/emitter.settings.rsp b/generation/WinSDK/emitter.settings.rsp index 787591f26..7d1aba7e4 100644 --- a/generation/WinSDK/emitter.settings.rsp +++ b/generation/WinSDK/emitter.settings.rsp @@ -361,18 +361,6 @@ PCCERT_CONTEXT=[Const] EXCEPTION_RECORD::ExceptionCode=NTSTATUS EXCEPTION_RECORD32::ExceptionCode=NTSTATUS EXCEPTION_RECORD64::ExceptionCode=NTSTATUS -WerStoreClose::hReportStore=HREPORTSTORE -WerStoreGetFirstReportKey::hReportStore=HREPORTSTORE -WerStoreGetNextReportKey::hReportStore=HREPORTSTORE -WerStoreOpen::phReportStore=HREPORTSTORE* -WerStoreQueryReportMetadataV2::hReportStore=HREPORTSTORE -WerReportAddDump::hReportHandle=HREPORT -WerReportAddFile::hReportHandle=HREPORT -WerReportCloseHandle::hReportHandle=HREPORT -WerReportCreate::phReportHandle=HREPORT* -WerReportSetParameter::hReportHandle=HREPORT -WerReportSetUIOption::hReportHandle=HREPORT -WerReportSubmit::::hReportHandle=HREPORT ITransactionImport::Import::piid=[Const] MLOperatorAttributeType=[ScopedEnum] MLOperatorEdgeType=[ScopedEnum] @@ -1054,54 +1042,6 @@ HttpWaitForDisconnect::Overlapped=[In][Out][Optional][Retained] HttpWaitForDisconnectEx::Overlapped=[In][Out][Optional][Retained] HttpWaitForDisconnectEx::Reserved=[Optional] IDCompositionSurface::BeginDraw::updateObject=[ComOutPtr] -# powerbase.h -PowerRegisterSuspendResumeNotification::return=WIN32_ERROR -PowerUnregisterSuspendResumeNotification::return=WIN32_ERROR -# powersetting.h -PowerGetActiveScheme::return=WIN32_ERROR -PowerReadACValue::return=WIN32_ERROR -PowerReadDCValue::return=WIN32_ERROR -PowerSetActiveScheme::return=WIN32_ERROR -PowerSettingRegisterNotification::return=WIN32_ERROR -PowerSettingUnregisterNotification::return=WIN32_ERROR -# powrprof.h -PowerCanRestoreIndividualDefaultPowerScheme::return=WIN32_ERROR -PowerCreatePossibleSetting::return=WIN32_ERROR -PowerCreateSetting::return=WIN32_ERROR -PowerDeleteScheme::return=WIN32_ERROR -PowerDuplicateScheme::return=WIN32_ERROR -PowerEnumerate::return=WIN32_ERROR -PowerImportPowerScheme::return=WIN32_ERROR -PowerReadACValueIndex::return=WIN32_ERROR -PowerReadDescription::return=WIN32_ERROR -PowerReadFriendlyName::return=WIN32_ERROR -PowerReadIconResourceSpecifier::return=WIN32_ERROR -PowerReadPossibleDescription::return=WIN32_ERROR -PowerReadPossibleFriendlyName::return=WIN32_ERROR -PowerReadPossibleValue::return=WIN32_ERROR -PowerReadValueIncrement::return=WIN32_ERROR -PowerReadValueMax::return=WIN32_ERROR -PowerReadValueMin::return=WIN32_ERROR -PowerReadValueUnitsSpecifier::return=WIN32_ERROR -PowerRemovePowerSetting::return=WIN32_ERROR -PowerReplaceDefaultPowerScheme::return=WIN32_ERROR -PowerReportThermalEvent::return=WIN32_ERROR -PowerRestoreDefaultPowerSchemes::return=WIN32_ERROR -PowerRestoreIndividualDefaultPowerScheme::return=WIN32_ERROR -PowerSettingAccessCheck::return=WIN32_ERROR -PowerSettingAccessCheckEx::return=WIN32_ERROR -PowerWriteACValueIndex::return=WIN32_ERROR -PowerWriteDescription::return=WIN32_ERROR -PowerWriteFriendlyName::return=WIN32_ERROR -PowerWriteIconResourceSpecifier::return=WIN32_ERROR -PowerWritePossibleDescription::return=WIN32_ERROR -PowerWritePossibleFriendlyName::return=WIN32_ERROR -PowerWritePossibleValue::return=WIN32_ERROR -PowerWriteSettingAttributes::return=WIN32_ERROR -PowerWriteValueIncrement::return=WIN32_ERROR -PowerWriteValueMax::return=WIN32_ERROR -PowerWriteValueMin::return=WIN32_ERROR -PowerWriteValueUnitsSpecifier::return=WIN32_ERROR ^Pdh\w+::return$=uint EnumSystemGeoNames::data=[-Optional] FindNLSStringEx::sortHandle=[-Optional] @@ -1442,8 +1382,6 @@ D3D11_TEXTURE3D_DESC1::CPUAccessFlags=[AssociatedEnum("D3D11_CPU_ACCESS_FLAG")] D3D11_TEXTURE3D_DESC1::MiscFlags=[AssociatedEnum("D3D11_RESOURCE_MISC_FLAG")] DOCHOSTUIINFO::dwDoubleClick=[AssociatedEnum("DOCHOSTUIDBLCLK")] DOCHOSTUIINFO::dwFlags=[AssociatedEnum("DOCHOSTUIFLAG")] -DwmGetWindowAttribute::dwAttribute=[AssociatedEnum("DWMWINDOWATTRIBUTE")] -DwmSetWindowAttribute::dwAttribute=[AssociatedEnum("DWMWINDOWATTRIBUTE")] DXVA2_DecodeBufferDesc::CompressedBufferType=[AssociatedEnum("DXVA2_BufferfType")] EMREXTSELECTCLIPRGN::iMode=[AssociatedEnum("RGN_COMBINE_MODE")] ExtCreatePen::iPenStyle=[AssociatedEnum("PEN_STYLE")] diff --git a/generation/WinSDK/enums.json b/generation/WinSDK/enums.json index 50b19e791..8d37f3170 100644 --- a/generation/WinSDK/enums.json +++ b/generation/WinSDK/enums.json @@ -7428,28 +7428,6 @@ } ] }, - { - "name": "WER_FILE", - "flags": true, - "members": [ - { - "name": "WER_FILE_ANONYMOUS_DATA" - }, - { - "name": "WER_FILE_DELETE_WHEN_DONE" - } - ], - "uses": [ - { - "method": "WerReportAddFile", - "parameter": "dwFileFlags" - }, - { - "method": "WerRegisterFile", - "parameter": "dwFlags" - } - ] - }, { "name": "TRACE_MESSAGE_FLAGS", "flags": true, @@ -11439,12 +11417,7 @@ "name": "POWER_PLATFORM_ROLE_V2" } ], - "uses": [ - { - "method": "PowerDeterminePlatformRoleEx", - "parameter": "Version" - } - ] + "uses": [] }, { "addUsesTo": "WIN_HTTP_CREATE_URL_FLAGS", @@ -11824,14 +11797,6 @@ "method": "RegisterSuspendResumeNotification", "parameter": "Flags" }, - { - "method": "PowerSettingRegisterNotification", - "parameter": "Flags" - }, - { - "method": "PowerRegisterSuspendResumeNotification", - "parameter": "Flags" - }, { "method": "RegisterPowerSettingNotification", "parameter": "Flags" @@ -12149,74 +12114,6 @@ } ] }, - { - "name": "WER_SUBMIT_FLAGS", - "flags": true, - "members": [ - { - "name": "WER_SUBMIT_ADD_REGISTERED_DATA", - "value": "16" - }, - { - "name": "WER_SUBMIT_HONOR_RECOVERY", - "value": "1" - }, - { - "name": "WER_SUBMIT_HONOR_RESTART", - "value": "2" - }, - { - "name": "WER_SUBMIT_NO_ARCHIVE", - "value": "256" - }, - { - "name": "WER_SUBMIT_NO_CLOSE_UI", - "value": "64" - }, - { - "name": "WER_SUBMIT_NO_QUEUE", - "value": "128" - }, - { - "name": "WER_SUBMIT_OUTOFPROCESS", - "value": "32" - }, - { - "name": "WER_SUBMIT_OUTOFPROCESS_ASYNC", - "value": "1024" - }, - { - "name": "WER_SUBMIT_QUEUE", - "value": "4" - }, - { - "name": "WER_SUBMIT_SHOW_DEBUG", - "value": "8" - }, - { - "name": "WER_SUBMIT_START_MINIMIZED", - "value": "512" - }, - { - "name": "WER_SUBMIT_BYPASS_DATA_THROTTLING", - "value": "2048" - }, - { - "name": "WER_SUBMIT_ARCHIVE_PARAMETERS_ONLY", - "value": "4096" - }, - { - "name": "WER_SUBMIT_REPORT_MACHINE_ID", - "value": "8192" - } - ], - "uses": [ - { - "method": "WerReportSubmit", - "parameter": "dwFlags" - } - ] - }, { "addUsesTo": "FILE_FLAGS_AND_ATTRIBUTES", "flags": true, @@ -14537,37 +14434,6 @@ } ] }, - { - "name": "WER_FAULT_REPORTING", - "flags": true, - "members": [ - { - "name": "WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION" - }, - { - "name": "WER_FAULT_REPORTING_FLAG_NOHEAP" - }, - { - "name": "WER_FAULT_REPORTING_FLAG_QUEUE" - }, - { - "name": "WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD" - }, - { - "name": "WER_FAULT_REPORTING_ALWAYS_SHOW_UI" - } - ], - "uses": [ - { - "method": "WerSetFlags", - "parameter": "dwFlags" - }, - { - "method": "WerGetFlags", - "parameter": "pdwFlags" - } - ] - }, { "name": "SNMP_LOG", "type": "int", @@ -14822,16 +14688,6 @@ } ] }, - { - "addUsesTo": "REG_SAM_FLAGS", - "members": [], - "uses": [ - { - "method": "PowerSettingAccessCheckEx", - "parameter": "AccessType" - } - ] - }, { "name": "PEEK_MESSAGE_REMOVE_TYPE", "flags": true, @@ -36229,16 +36085,6 @@ } ] }, - { - "namespace": "Windows.Win32.System.Power", - "name": "DEVICE_POWER_CAPABILITIES", - "flags": true, - "autoPopulate": { - "filter": "PDCAP_", - "header": "powrprof.h;winnt.h" - }, - "uses": [] - }, { "name": "DISPLAY_DEVICE_STATE_FLAGS", "flags": true, diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index fe1ebc744..1aaaf57f4 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -255,6 +255,66 @@ "sourceSha256": "2F37EFE3FC233B830BAC96E9733D269847200D5E85586E67A1423B699C642896", "sdkPath": "c\\include\\10.0.26100.0\\um\\devfiltertypes.h", "sdkSha256": "2F37EFE3FC233B830BAC96E9733D269847200D5E85586E67A1423B699C642896" + }, + { + "path": "um\\dwmapi.h", + "sourceSha256": "CB7AA3810F0676539FB8222D70A04D3F934D0ED0E7CA226531820C650FF6E314", + "sdkPath": "c\\include\\10.0.26100.0\\um\\dwmapi.h", + "sdkSha256": "CB7AA3810F0676539FB8222D70A04D3F934D0ED0E7CA226531820C650FF6E314" + }, + { + "path": "um\\WerApi.h", + "sourceSha256": "0CF852DAF581826BEB6F5D3C3F60B759E143B72CA958C74B7057F5003F546F46", + "sdkPath": "c\\include\\10.0.26100.0\\um\\WerApi.h", + "sdkSha256": "0CF852DAF581826BEB6F5D3C3F60B759E143B72CA958C74B7057F5003F546F46" + }, + { + "path": "um\\ErrorRep.h", + "sourceSha256": "2EEB745D0BE079168310A031514C04AAD7C2E818D762069EDB41B34C67B1E8A5", + "sdkPath": "c\\include\\10.0.26100.0\\um\\ErrorRep.h", + "sdkSha256": "2EEB745D0BE079168310A031514C04AAD7C2E818D762069EDB41B34C67B1E8A5" + }, + { + "path": "um\\EvColl.h", + "sourceSha256": "F50C9DBCB7B7B52C5171A77DA8779AF378304AB344E7B30D909EF32D909763EB", + "sdkPath": "c\\include\\10.0.26100.0\\um\\EvColl.h", + "sdkSha256": "F50C9DBCB7B7B52C5171A77DA8779AF378304AB344E7B30D909EF32D909763EB" + }, + { + "path": "um\\powrprof.h", + "sourceSha256": "2075A213F792A8206C510E26D94A81FF4E1A59F0168A3FD900822D14E863CEB1", + "sdkPath": "c\\include\\10.0.26100.0\\um\\powrprof.h", + "sdkSha256": "2075A213F792A8206C510E26D94A81FF4E1A59F0168A3FD900822D14E863CEB1" + }, + { + "path": "um\\powersetting.h", + "sourceSha256": "68FDCDB5586156AE65DE15738FF040C5FD303B5EF97CDC7EE448D96EEC0488E6", + "sdkPath": "c\\include\\10.0.26100.0\\um\\powersetting.h", + "sdkSha256": "68FDCDB5586156AE65DE15738FF040C5FD303B5EF97CDC7EE448D96EEC0488E6" + }, + { + "path": "um\\powerbase.h", + "sourceSha256": "66082F57FF576850899FA3DEB4779C0B762163A70946D0BE4DF78F3A2A506FB2", + "sdkPath": "c\\include\\10.0.26100.0\\um\\powerbase.h", + "sdkSha256": "66082F57FF576850899FA3DEB4779C0B762163A70946D0BE4DF78F3A2A506FB2" + }, + { + "path": "shared\\poclass.h", + "sourceSha256": "77D0D1F11EC072568818F4D82217EF22BADBD39747FF2729553A7F619C27CE31", + "sdkPath": "c\\include\\10.0.26100.0\\shared\\poclass.h", + "sdkSha256": "77D0D1F11EC072568818F4D82217EF22BADBD39747FF2729553A7F619C27CE31" + }, + { + "path": "shared\\batclass.h", + "sourceSha256": "C2F7DF9B22D2C2C606805AF85C08327AC424F409F639DC0670DEF6F177BCC451", + "sdkPath": "c\\include\\10.0.26100.0\\shared\\batclass.h", + "sdkSha256": "C2F7DF9B22D2C2C606805AF85C08327AC424F409F639DC0670DEF6F177BCC451" + }, + { + "path": "shared\\emi.h", + "sourceSha256": "7C9E06256A91F7D2B0F77FAC8FC6FE04934FBC615147CE1945A0FBA7BB25C305", + "sdkPath": "c\\include\\10.0.26100.0\\shared\\emi.h", + "sdkSha256": "7C9E06256A91F7D2B0F77FAC8FC6FE04934FBC615147CE1945A0FBA7BB25C305" } ], "partitions": [ @@ -296,7 +356,11 @@ "WinSock", "Bluetooth", "Hid", - "DeviceQuery" + "DeviceQuery", + "Dwm", + "Wer", + "Wec", + "Power" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -338,6 +402,13 @@ "post-midl\\um\\ws2bth.annotations.patch", "post-midl\\um\\dinput.annotations.patch", "post-midl\\shared\\hidpi.annotations.patch", - "post-midl\\um\\devfiltertypes.annotations.patch" + "post-midl\\um\\devfiltertypes.annotations.patch", + "post-midl\\um\\dwmapi.annotations.patch", + "post-midl\\um\\werapi.annotations.patch", + "post-midl\\um\\errorrep.annotations.patch", + "post-midl\\um\\evcoll.annotations.patch", + "post-midl\\um\\powrprof.annotations.patch", + "post-midl\\um\\powersetting.annotations.patch", + "post-midl\\um\\powerbase.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/um/dwmapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/dwmapi.annotations.patch new file mode 100644 index 000000000..83301d8f6 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/dwmapi.annotations.patch @@ -0,0 +1,129 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/dwmapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/dwmapi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/dwmapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/dwmapi.h +@@ -3,6 +3,7 @@ + #define _DWMAPI_H_ + + #include ++#include + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + + +@@ -377,6 +378,7 @@ + + #define DWM_FRAME_DURATION_DEFAULT -1 + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + DWMAPI_(BOOL) + DwmDefWindowProc( + _In_ HWND hWnd, +@@ -432,7 +434,7 @@ + DWMAPI + DwmGetWindowAttribute( + HWND hwnd, +- DWORD dwAttribute, ++ _Win32_AssociatedEnum_(DWMWINDOWATTRIBUTE) DWORD dwAttribute, + _Out_writes_bytes_(cbAttribute) PVOID pvAttribute, + DWORD cbAttribute + ); +@@ -477,7 +479,7 @@ + DWMAPI + DwmSetWindowAttribute( + HWND hwnd, +- DWORD dwAttribute, ++ _Win32_AssociatedEnum_(DWMWINDOWATTRIBUTE) DWORD dwAttribute, + _In_reads_bytes_(cbAttribute) LPCVOID pvAttribute, + DWORD cbAttribute + ); +@@ -492,10 +494,12 @@ + HTHUMBNAIL hThumbnailId, + _In_ const DWM_THUMBNAIL_PROPERTIES* ptnProperties + ); ++_Win32_SupportedOS_END_() + + #if(_WIN32_WINNT >= 0x0601) + #define DWM_SIT_DISPLAYFRAME 0x00000001 // Display a window frame around the provided bitmap + ++_Win32_SupportedOS_BEGIN_(Windows7) + DWMAPI DwmSetIconicThumbnail( + HWND hwnd, + HBITMAP hbmp, +@@ -512,9 +516,11 @@ + DWMAPI DwmInvalidateIconicBitmaps( + HWND hwnd + ); ++_Win32_SupportedOS_END_() + + #endif /* _WIN32_WINNT >= 0x0601 */ + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + DWMAPI + DwmAttachMilContent( + _In_ HWND hwnd +@@ -527,6 +533,7 @@ + + DWMAPI + DwmFlush(); ++_Win32_SupportedOS_END_() + + #ifndef MILCORE_KERNEL_COMPONENT + #ifndef _MIL_MATRIX3X2D_DEFINED +@@ -551,6 +558,7 @@ + #define MILCORE_MIL_MATRIX3X2D_COMPAT_TYPEDEF + #endif // MILCORE_MIL_MATRIX3X2D_COMPAT_TYPEDEF + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + DWMAPI + DwmGetGraphicsStreamTransformHint( + UINT uIndex, +@@ -562,8 +570,10 @@ + UINT uIndex, + _Out_ UUID *pClientUuid + ); ++_Win32_SupportedOS_END_() + #endif // MILCORE_KERNEL_COMPONENT + ++_Win32_SupportedOS_WindowsVista_ + DWMAPI + DwmGetTransportAttributes( + _Out_writes_(1) BOOL *pfIsRemoting, +@@ -578,6 +588,7 @@ + DWMTRANSITION_OWNEDWINDOW_REPOSITION = 0, + }; + ++_Win32_SupportedOS_Windows8_ + DWMAPI + DwmTransitionOwnedWindow( + HWND hwnd, +@@ -602,6 +613,7 @@ + GT_TOUCH_PRESSANDTAP = 10, + }; + ++_Win32_SupportedOS_BEGIN_(Windows8) + DWMAPI + DwmRenderGesture( + _In_ enum GESTURE_TYPE gt, +@@ -616,6 +628,7 @@ + BOOL fEnable, + POINT ptTether + ); ++_Win32_SupportedOS_END_() + + enum DWM_SHOWCONTACT + { +@@ -630,6 +643,7 @@ + }; + DEFINE_ENUM_FLAG_OPERATORS(DWM_SHOWCONTACT); + ++_Win32_SupportedOS_Windows8_ + DWMAPI + DwmShowContact( + DWORD dwPointerID, +@@ -688,6 +702,7 @@ + DEFINE_ENUM_FLAG_OPERATORS(DWM_TAB_WINDOW_REQUIREMENTS); + + // Checks the requirements needed to get tabs in the application title bar. ++_Win32_SupportedOS_17134_ + DWMAPI DwmGetUnmetTabRequirements(_In_opt_ HWND appWindow, _Out_ enum DWM_TAB_WINDOW_REQUIREMENTS* value); + + #endif // NTDDI_WIN10_RS4 diff --git a/generation/WinSDK/patches/post-midl/um/errorrep.annotations.patch b/generation/WinSDK/patches/post-midl/um/errorrep.annotations.patch new file mode 100644 index 000000000..d5c3b9152 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/errorrep.annotations.patch @@ -0,0 +1,34 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/ErrorRep.h b/generation/WinSDK/RecompiledIdlHeaders/um/ErrorRep.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/ErrorRep.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/ErrorRep.h +@@ -18,6 +18,7 @@ + #endif + + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -38,10 +39,14 @@ + frrvErrDoubleFault, + } EFaultRepRetVal; + ++_Win32_SupportedOS_BEGIN_(WindowsXP) + EFaultRepRetVal APIENTRY ReportFault(_In_ LPEXCEPTION_POINTERS pep, _In_ DWORD dwOpt); + ++_Win32_SetLastError_ + BOOL APIENTRY AddERExcludedApplicationA(_In_ LPCSTR szApplication); ++_Win32_SetLastError_ + BOOL APIENTRY AddERExcludedApplicationW(_In_ LPCWSTR wszApplication); ++_Win32_SupportedOS_END_() + + + typedef EFaultRepRetVal (APIENTRY *pfn_REPORTFAULT)(_In_ LPEXCEPTION_POINTERS, _In_ DWORD); +@@ -59,6 +64,7 @@ + // + //+++++++++++++++++++++ Hang reporting api ++++++++++++++++++++++++++++++++ + // ++_Win32_SupportedOS_WindowsVista_ + HRESULT + WINAPI + WerReportHang( diff --git a/generation/WinSDK/patches/post-midl/um/evcoll.annotations.patch b/generation/WinSDK/patches/post-midl/um/evcoll.annotations.patch new file mode 100644 index 000000000..d7af1af5e --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/evcoll.annotations.patch @@ -0,0 +1,36 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/EvColl.h b/generation/WinSDK/RecompiledIdlHeaders/um/EvColl.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/EvColl.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/EvColl.h +@@ -16,6 +16,7 @@ + #ifndef __EVCOLL_H__ + #define __EVCOLL_H__ + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -179,6 +180,8 @@ + } EC_SUBSCRIPTION_RUNTIME_STATUS_ACTIVE_STATUS; + + ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++_Win32_SetLastError_ + EC_HANDLE WINAPI EcOpenSubscriptionEnum( + DWORD Flags + ); +@@ -191,6 +194,7 @@ + _Out_ PDWORD SubscriptionNameBufferUsed + ); + ++_Win32_SetLastError_ + EC_HANDLE WINAPI EcOpenSubscription( + LPCWSTR SubscriptionName, + DWORD AccessMask, +@@ -275,6 +279,7 @@ + BOOL WINAPI EcClose( + EC_HANDLE Object + ); ++_Win32_SupportedOS_END_() + + + #ifdef __cplusplus diff --git a/generation/WinSDK/patches/post-midl/um/powerbase.annotations.patch b/generation/WinSDK/patches/post-midl/um/powerbase.annotations.patch new file mode 100644 index 000000000..5482a163c --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/powerbase.annotations.patch @@ -0,0 +1,66 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/powerbase.h b/generation/WinSDK/RecompiledIdlHeaders/um/powerbase.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/powerbase.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/powerbase.h +@@ -16,6 +16,7 @@ + #define _POWERBASE_H_ + + #include ++#include + #include + + #ifdef _CONTRACT_GEN +@@ -44,6 +45,7 @@ + #define _OVERRIDE_NTSTATUS_ + #endif + ++_Win32_SupportedOS_BEGIN_(WindowsXP) + NTSTATUS + WINAPI + CallNtPowerInformation( +@@ -58,26 +60,30 @@ + #undef NTSTATUS + #endif + ++_Win32_SetLastError_ + BOOLEAN + WINAPI + GetPwrCapabilities( + _Out_ PSYSTEM_POWER_CAPABILITIES lpspc + ); ++_Win32_SupportedOS_END_() + + #if (NTDDI_VERSION >= NTDDI_WIN8) ++_Win32_SupportedOS_BEGIN_(Windows8) + POWER_PLATFORM_ROLE + WINAPI + PowerDeterminePlatformRoleEx( +- _In_ ULONG Version ++ _In_ _Win32_AssociatedEnum_(POWER_PLATFORM_ROLE_VERSION) ULONG Version + ); + + #endif + + #if (NTDDI_VERSION >= NTDDI_WIN8) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerRegisterSuspendResumeNotification( +- _In_ DWORD Flags, ++ _In_ _Win32_AssociatedEnum_(REGISTER_NOTIFICATION_FLAGS) DWORD Flags, + _In_ HANDLE Recipient, + _Out_ PHPOWERNOTIFY RegistrationHandle + ); +@@ -85,11 +91,13 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_WIN8) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerUnregisterSuspendResumeNotification( + _Inout_ HPOWERNOTIFY RegistrationHandle + ); ++_Win32_SupportedOS_END_() + + #endif + diff --git a/generation/WinSDK/patches/post-midl/um/powersetting.annotations.patch b/generation/WinSDK/patches/post-midl/um/powersetting.annotations.patch new file mode 100644 index 000000000..278730b71 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/powersetting.annotations.patch @@ -0,0 +1,109 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/powersetting.h b/generation/WinSDK/RecompiledIdlHeaders/um/powersetting.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/powersetting.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/powersetting.h +@@ -16,6 +16,7 @@ + #define _POWERSETTING_H_ + + #include ++#include + #include + + #ifdef _CONTRACT_GEN +@@ -40,6 +41,8 @@ + #endif // _HPOWERNOTIFY_DEF_ + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerReadACValue( +@@ -55,6 +58,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerReadDCValue( +@@ -70,6 +74,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerWriteACValueIndex( +@@ -96,6 +101,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerGetActiveScheme( +@@ -106,21 +112,25 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerSetActiveScheme( + _In_opt_ HKEY UserRootPowerKey, + _In_opt_ CONST GUID* SchemeGuid + ); ++_Win32_SupportedOS_END_() + + #endif + + #if (NTDDI_VERSION >= NTDDI_WIN7) ++_Win32_SupportedOS_BEGIN_(Windows7) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerSettingRegisterNotification( + _In_ LPCGUID SettingGuid, +- _In_ DWORD Flags, ++ _In_ _Win32_AssociatedEnum_(REGISTER_NOTIFICATION_FLAGS) DWORD Flags, + _In_ HANDLE Recipient, + _Out_ PHPOWERNOTIFY RegistrationHandle + ); +@@ -128,11 +138,13 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_WIN7) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD + WINAPI + PowerSettingUnregisterNotification( + _Inout_ HPOWERNOTIFY RegistrationHandle + ); ++_Win32_SupportedOS_END_() + + #endif + +@@ -153,6 +165,7 @@ + #define EFFECTIVE_POWER_MODE_V1 (0x00000001) + #define EFFECTIVE_POWER_MODE_V2 (0x00000002) + ++_Win32_SupportedOS_17763_ + typedef _Function_class_(EFFECTIVE_POWER_MODE_CALLBACK) + VOID + WINAPI +@@ -163,6 +176,7 @@ + #endif + + #if NTDDI_VERSION >= NTDDI_WIN10_RS5 ++_Win32_SupportedOS_BEGIN_(17763) + _Must_inspect_result_ + HRESULT + WINAPI +@@ -181,6 +195,7 @@ + PowerUnregisterFromEffectivePowerModeNotifications( + _In_ PVOID RegistrationHandle + ); ++_Win32_SupportedOS_END_() + + #endif + diff --git a/generation/WinSDK/patches/post-midl/um/powrprof.annotations.patch b/generation/WinSDK/patches/post-midl/um/powrprof.annotations.patch new file mode 100644 index 000000000..e9d241364 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/powrprof.annotations.patch @@ -0,0 +1,563 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/powrprof.h b/generation/WinSDK/RecompiledIdlHeaders/um/powrprof.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/powrprof.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/powrprof.h +@@ -16,6 +16,7 @@ + #define _POWRPROF_H_ + + #include ++#include + #include + #include + +@@ -205,29 +206,35 @@ + + // Public function prototypes + ++_Win32_SupportedOS_BEGIN_(WindowsXP) ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + GetPwrDiskSpindownRange( + _Out_ PUINT puiMax, + _Out_ PUINT puiMin + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + EnumPwrSchemes( + _In_ PWRSCHEMESENUMPROC lpfn, + _In_ LPARAM lParam + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + ReadGlobalPwrPolicy( + _In_ PGLOBAL_POWER_POLICY pGlobalPowerPolicy + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + ReadPwrScheme( + _In_ UINT uiID, + _Out_ PPOWER_POLICY pPowerPolicy + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + WritePwrScheme( + _In_ PUINT puiID, +@@ -236,21 +243,25 @@ + _In_ PPOWER_POLICY lpScheme + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + WriteGlobalPwrPolicy( + _In_ PGLOBAL_POWER_POLICY pGlobalPowerPolicy + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + DeletePwrScheme( + _In_ UINT uiID + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + GetActivePwrScheme( + _Out_ PUINT puiID + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + SetActivePwrScheme( + _In_ UINT uiID, +@@ -272,12 +283,15 @@ + IsPwrShutdownAllowed( + VOID + ); ++_Win32_SupportedOS_END_() + + STDAPI_(BOOLEAN) + IsAdminOverrideActive( + _In_ PADMINISTRATOR_POWER_POLICY papp + ); + ++_Win32_SupportedOS_BEGIN_(WindowsXP) ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + SetSuspendState( + _In_ BOOLEAN bHibernate, +@@ -285,21 +299,26 @@ + _In_ BOOLEAN bWakeupEventsDisabled + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + GetCurrentPowerPolicies( + _Out_ PGLOBAL_POWER_POLICY pGlobalPowerPolicy, + _Out_ PPOWER_POLICY pPowerPolicy + ); + ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + CanUserWritePwrScheme( + VOID + ); ++_Win32_SupportedOS_END_() + + #if (NTDDI_VERSION >= NTDDI_WINXP) + // + // deprecated. + // ++_Win32_SupportedOS_WindowsXP_ ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + ReadProcessorPwrScheme( + _In_ UINT uiID, +@@ -311,6 +330,8 @@ + // + // deprecated. + // ++_Win32_SupportedOS_WindowsXP_ ++_Win32_SetLastError_ + STDAPI_(BOOLEAN) + WriteProcessorPwrScheme( + _In_ UINT uiID, +@@ -409,6 +430,7 @@ + + + #if (NTDDI_VERSION >= NTDDI_WIN7) ++_Win32_SupportedOS_BEGIN_(Windows7) + STDAPI_(BOOLEAN) + PowerIsSettingRangeDefined ( + _In_opt_ CONST GUID *SubKeyGuid OPTIONAL, +@@ -418,16 +440,20 @@ + + + #if (NTDDI_VERSION >= NTDDI_WIN7) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerSettingAccessCheckEx ( + _In_ POWER_DATA_ACCESSOR AccessFlags, + _In_opt_ CONST GUID *PowerGuid, +- _In_ REGSAM AccessType +- ); +-#endif +- +- +-#if (NTDDI_VERSION >= NTDDI_VISTA) ++ _In_ _Win32_AssociatedEnum_(REG_SAM_FLAGS) REGSAM AccessType ++ ); ++_Win32_SupportedOS_END_() ++#endif ++ ++ ++#if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_SupportedOS_WindowsVista_ ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerSettingAccessCheck ( + _In_ POWER_DATA_ACCESSOR AccessFlags, +@@ -467,6 +493,8 @@ + // Read functions. + // + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadACValueIndex ( + _In_opt_ HKEY RootPowerKey, +@@ -489,6 +517,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadFriendlyName ( + _In_opt_ HKEY RootPowerKey, +@@ -501,6 +530,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadDescription ( + _In_opt_ HKEY RootPowerKey, +@@ -513,6 +543,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadPossibleValue ( + _In_opt_ HKEY RootPowerKey, +@@ -526,6 +557,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadPossibleFriendlyName ( + _In_opt_ HKEY RootPowerKey, +@@ -538,6 +570,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadPossibleDescription ( + _In_opt_ HKEY RootPowerKey, +@@ -550,6 +583,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadValueMin ( + _In_opt_ HKEY RootPowerKey, +@@ -560,6 +594,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadValueMax ( + _In_opt_ HKEY RootPowerKey, +@@ -570,6 +605,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadValueIncrement ( + _In_opt_ HKEY RootPowerKey, +@@ -580,6 +616,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadValueUnitsSpecifier ( + _In_opt_ HKEY RootPowerKey, +@@ -613,6 +650,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReadIconResourceSpecifier ( + _In_opt_ HKEY RootPowerKey, +@@ -630,12 +668,15 @@ + _In_opt_ CONST GUID *SubGroupGuid, + _In_opt_ CONST GUID *PowerSettingGuid + ); ++_Win32_SupportedOS_END_() + #endif + + // + // Write functions. + // + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWriteFriendlyName ( + _In_opt_ HKEY RootPowerKey, +@@ -648,6 +689,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWriteDescription ( + _In_opt_ HKEY RootPowerKey, +@@ -660,6 +702,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWritePossibleValue ( + _In_opt_ HKEY RootPowerKey, +@@ -673,6 +716,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWritePossibleFriendlyName ( + _In_opt_ HKEY RootPowerKey, +@@ -685,6 +729,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWritePossibleDescription ( + _In_opt_ HKEY RootPowerKey, +@@ -697,6 +742,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWriteValueMin ( + _In_opt_ HKEY RootPowerKey, +@@ -707,6 +753,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWriteValueMax ( + _In_opt_ HKEY RootPowerKey, +@@ -717,6 +764,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWriteValueIncrement ( + _In_opt_ HKEY RootPowerKey, +@@ -727,6 +775,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWriteValueUnitsSpecifier ( + _In_opt_ HKEY RootPowerKey, +@@ -760,6 +809,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWriteIconResourceSpecifier ( + _In_opt_ HKEY RootPowerKey, +@@ -772,6 +822,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerWriteSettingAttributes ( + _In_opt_ CONST GUID *SubGroupGuid, +@@ -781,6 +832,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerDuplicateScheme ( + _In_opt_ HKEY RootPowerKey, +@@ -790,6 +842,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerImportPowerScheme ( + _In_opt_ HKEY RootPowerKey, +@@ -799,6 +852,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerDeleteScheme ( + _In_opt_ HKEY RootPowerKey, +@@ -807,6 +861,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerRemovePowerSetting ( + _In_ CONST GUID *PowerSettingSubKeyGuid, +@@ -815,6 +870,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerCreateSetting ( + _In_opt_ HKEY RootSystemPowerKey, +@@ -824,6 +880,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerCreatePossibleSetting ( + _In_opt_ HKEY RootSystemPowerKey, +@@ -837,6 +894,7 @@ + // Enumerate Functions. + // + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerEnumerate ( + _In_opt_ HKEY RootPowerKey, +@@ -847,6 +905,7 @@ + _Out_writes_bytes_opt_(*BufferSize) UCHAR *Buffer, + _Inout_ DWORD *BufferSize + ); ++_Win32_SupportedOS_END_() + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) +@@ -868,6 +927,8 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerCanRestoreIndividualDefaultPowerScheme ( + _In_ CONST GUID *SchemeGuid +@@ -875,6 +936,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerRestoreIndividualDefaultPowerScheme ( + _In_ CONST GUID *SchemeGuid +@@ -882,6 +944,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_VISTA) ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerRestoreDefaultPowerSchemes( + VOID +@@ -900,6 +963,7 @@ + PowerDeterminePlatformRole( + VOID + ); ++_Win32_SupportedOS_END_() + #endif + + // +@@ -1046,6 +1110,7 @@ + // Function prototypes + // + #if (NTDDI_VERSION >= NTDDI_WS03) ++_Win32_SupportedOS_BEGIN_(WindowsVista) + STDAPI_(BOOLEAN) + DevicePowerEnumDevices( + _In_ ULONG QueryIndex, +@@ -1057,6 +1122,7 @@ + #endif + + #if (NTDDI_VERSION >= NTDDI_WS03) ++_Win32_SetLastError_ + STDAPI_(DWORD) + DevicePowerSetDeviceState( + _In_ LPCWSTR DeviceDescription, +@@ -1077,6 +1143,7 @@ + DevicePowerClose( + VOID + ); ++_Win32_SupportedOS_END_() + #endif + + // +@@ -1095,12 +1162,96 @@ + } THERMAL_EVENT, *PTHERMAL_EVENT; + + #if (NTDDI_VERSION >= NTDDI_WINBLUE) ++_Win32_SupportedOS_Windows81_ ++_Win32_AssociatedEnum_(WIN32_ERROR) + STDAPI_(DWORD) + PowerReportThermalEvent ( + _In_ PTHERMAL_EVENT Event + ); + #endif + ++#ifdef WIN32METADATA ++#pragma push_macro("PDCAP_D0_SUPPORTED") ++#undef PDCAP_D0_SUPPORTED ++#pragma push_macro("PDCAP_D1_SUPPORTED") ++#undef PDCAP_D1_SUPPORTED ++#pragma push_macro("PDCAP_D2_SUPPORTED") ++#undef PDCAP_D2_SUPPORTED ++#pragma push_macro("PDCAP_D3_SUPPORTED") ++#undef PDCAP_D3_SUPPORTED ++#pragma push_macro("PDCAP_WAKE_FROM_D0_SUPPORTED") ++#undef PDCAP_WAKE_FROM_D0_SUPPORTED ++#pragma push_macro("PDCAP_WAKE_FROM_D1_SUPPORTED") ++#undef PDCAP_WAKE_FROM_D1_SUPPORTED ++#pragma push_macro("PDCAP_WAKE_FROM_D2_SUPPORTED") ++#undef PDCAP_WAKE_FROM_D2_SUPPORTED ++#pragma push_macro("PDCAP_WAKE_FROM_D3_SUPPORTED") ++#undef PDCAP_WAKE_FROM_D3_SUPPORTED ++#pragma push_macro("PDCAP_WARM_EJECT_SUPPORTED") ++#undef PDCAP_WARM_EJECT_SUPPORTED ++#pragma push_macro("PDCAP_S0_SUPPORTED") ++#undef PDCAP_S0_SUPPORTED ++#pragma push_macro("PDCAP_S1_SUPPORTED") ++#undef PDCAP_S1_SUPPORTED ++#pragma push_macro("PDCAP_S2_SUPPORTED") ++#undef PDCAP_S2_SUPPORTED ++#pragma push_macro("PDCAP_S3_SUPPORTED") ++#undef PDCAP_S3_SUPPORTED ++#pragma push_macro("PDCAP_WAKE_FROM_S0_SUPPORTED") ++#undef PDCAP_WAKE_FROM_S0_SUPPORTED ++#pragma push_macro("PDCAP_WAKE_FROM_S1_SUPPORTED") ++#undef PDCAP_WAKE_FROM_S1_SUPPORTED ++#pragma push_macro("PDCAP_WAKE_FROM_S2_SUPPORTED") ++#undef PDCAP_WAKE_FROM_S2_SUPPORTED ++#pragma push_macro("PDCAP_WAKE_FROM_S3_SUPPORTED") ++#undef PDCAP_WAKE_FROM_S3_SUPPORTED ++#pragma push_macro("PDCAP_S4_SUPPORTED") ++#undef PDCAP_S4_SUPPORTED ++#pragma push_macro("PDCAP_S5_SUPPORTED") ++#undef PDCAP_S5_SUPPORTED ++enum [[clang::flag_enum]] DEVICE_POWER_CAPABILITIES : DWORD ++{ ++ PDCAP_D0_SUPPORTED = 0x00000001, ++ PDCAP_D1_SUPPORTED = 0x00000002, ++ PDCAP_D2_SUPPORTED = 0x00000004, ++ PDCAP_D3_SUPPORTED = 0x00000008, ++ PDCAP_WAKE_FROM_D0_SUPPORTED = 0x00000010, ++ PDCAP_WAKE_FROM_D1_SUPPORTED = 0x00000020, ++ PDCAP_WAKE_FROM_D2_SUPPORTED = 0x00000040, ++ PDCAP_WAKE_FROM_D3_SUPPORTED = 0x00000080, ++ PDCAP_WARM_EJECT_SUPPORTED = 0x00000100, ++ PDCAP_S0_SUPPORTED = 0x00010000, ++ PDCAP_S1_SUPPORTED = 0x00020000, ++ PDCAP_S2_SUPPORTED = 0x00040000, ++ PDCAP_S3_SUPPORTED = 0x00080000, ++ PDCAP_WAKE_FROM_S0_SUPPORTED = 0x00100000, ++ PDCAP_WAKE_FROM_S1_SUPPORTED = 0x00200000, ++ PDCAP_WAKE_FROM_S2_SUPPORTED = 0x00400000, ++ PDCAP_WAKE_FROM_S3_SUPPORTED = 0x00800000, ++ PDCAP_S4_SUPPORTED = 0x01000000, ++ PDCAP_S5_SUPPORTED = 0x02000000, ++}; ++#pragma pop_macro("PDCAP_S5_SUPPORTED") ++#pragma pop_macro("PDCAP_S4_SUPPORTED") ++#pragma pop_macro("PDCAP_WAKE_FROM_S3_SUPPORTED") ++#pragma pop_macro("PDCAP_WAKE_FROM_S2_SUPPORTED") ++#pragma pop_macro("PDCAP_WAKE_FROM_S1_SUPPORTED") ++#pragma pop_macro("PDCAP_WAKE_FROM_S0_SUPPORTED") ++#pragma pop_macro("PDCAP_S3_SUPPORTED") ++#pragma pop_macro("PDCAP_S2_SUPPORTED") ++#pragma pop_macro("PDCAP_S1_SUPPORTED") ++#pragma pop_macro("PDCAP_S0_SUPPORTED") ++#pragma pop_macro("PDCAP_WARM_EJECT_SUPPORTED") ++#pragma pop_macro("PDCAP_WAKE_FROM_D3_SUPPORTED") ++#pragma pop_macro("PDCAP_WAKE_FROM_D2_SUPPORTED") ++#pragma pop_macro("PDCAP_WAKE_FROM_D1_SUPPORTED") ++#pragma pop_macro("PDCAP_WAKE_FROM_D0_SUPPORTED") ++#pragma pop_macro("PDCAP_D3_SUPPORTED") ++#pragma pop_macro("PDCAP_D2_SUPPORTED") ++#pragma pop_macro("PDCAP_D1_SUPPORTED") ++#pragma pop_macro("PDCAP_D0_SUPPORTED") ++#endif ++ + #ifdef __cplusplus + } + #endif diff --git a/generation/WinSDK/patches/post-midl/um/werapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/werapi.annotations.patch new file mode 100644 index 000000000..638cb2d7a --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/werapi.annotations.patch @@ -0,0 +1,330 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/WerApi.h b/generation/WinSDK/RecompiledIdlHeaders/um/WerApi.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/WerApi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/WerApi.h +@@ -1,4 +1,5 @@ + #include ++#include + + /*++ + +@@ -85,6 +86,32 @@ + // Mark the process as requiring flushing of its report store. + // + #define WER_FAULT_REPORTING_DURABLE 1024 ++ ++#ifdef WIN32METADATA ++#pragma push_macro("WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION") ++#undef WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION ++#pragma push_macro("WER_FAULT_REPORTING_FLAG_NOHEAP") ++#undef WER_FAULT_REPORTING_FLAG_NOHEAP ++#pragma push_macro("WER_FAULT_REPORTING_FLAG_QUEUE") ++#undef WER_FAULT_REPORTING_FLAG_QUEUE ++#pragma push_macro("WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD") ++#undef WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD ++#pragma push_macro("WER_FAULT_REPORTING_ALWAYS_SHOW_UI") ++#undef WER_FAULT_REPORTING_ALWAYS_SHOW_UI ++enum [[clang::flag_enum]] WER_FAULT_REPORTING : DWORD ++{ ++ WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION = 4, ++ WER_FAULT_REPORTING_FLAG_NOHEAP = 1, ++ WER_FAULT_REPORTING_FLAG_QUEUE = 2, ++ WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD = 8, ++ WER_FAULT_REPORTING_ALWAYS_SHOW_UI = 16, ++}; ++#pragma pop_macro("WER_FAULT_REPORTING_ALWAYS_SHOW_UI") ++#pragma pop_macro("WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD") ++#pragma pop_macro("WER_FAULT_REPORTING_FLAG_QUEUE") ++#pragma pop_macro("WER_FAULT_REPORTING_FLAG_NOHEAP") ++#pragma pop_macro("WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION") ++#endif + + // + // This is the maximum length of any created URL +@@ -265,6 +292,20 @@ + #define WER_FILE_ANONYMOUS_DATA 2 // This file does not contain any PII + #define WER_FILE_COMPRESSED 4 // This file has been compressed using SQS + ++#ifdef WIN32METADATA ++#pragma push_macro("WER_FILE_ANONYMOUS_DATA") ++#undef WER_FILE_ANONYMOUS_DATA ++#pragma push_macro("WER_FILE_DELETE_WHEN_DONE") ++#undef WER_FILE_DELETE_WHEN_DONE ++enum [[clang::flag_enum]] WER_FILE : DWORD ++{ ++ WER_FILE_ANONYMOUS_DATA = 2, ++ WER_FILE_DELETE_WHEN_DONE = 1, ++}; ++#pragma pop_macro("WER_FILE_DELETE_WHEN_DONE") ++#pragma pop_macro("WER_FILE_ANONYMOUS_DATA") ++#endif ++ + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */ + #pragma endregion + +@@ -292,6 +333,68 @@ + #define WER_SUBMIT_BYPASS_NETWORK_COST_THROTTLING 32768 // Bypass network-related throttling (when on restricted networks) + + #define WER_SUBMIT_DISCARD_IF_QUEUED WER_SUBMIT_NO_QUEUE ++ ++#ifdef WIN32METADATA ++#pragma push_macro("WER_SUBMIT_ADD_REGISTERED_DATA") ++#undef WER_SUBMIT_ADD_REGISTERED_DATA ++#pragma push_macro("WER_SUBMIT_HONOR_RECOVERY") ++#undef WER_SUBMIT_HONOR_RECOVERY ++#pragma push_macro("WER_SUBMIT_HONOR_RESTART") ++#undef WER_SUBMIT_HONOR_RESTART ++#pragma push_macro("WER_SUBMIT_NO_ARCHIVE") ++#undef WER_SUBMIT_NO_ARCHIVE ++#pragma push_macro("WER_SUBMIT_NO_CLOSE_UI") ++#undef WER_SUBMIT_NO_CLOSE_UI ++#pragma push_macro("WER_SUBMIT_NO_QUEUE") ++#undef WER_SUBMIT_NO_QUEUE ++#pragma push_macro("WER_SUBMIT_OUTOFPROCESS") ++#undef WER_SUBMIT_OUTOFPROCESS ++#pragma push_macro("WER_SUBMIT_OUTOFPROCESS_ASYNC") ++#undef WER_SUBMIT_OUTOFPROCESS_ASYNC ++#pragma push_macro("WER_SUBMIT_QUEUE") ++#undef WER_SUBMIT_QUEUE ++#pragma push_macro("WER_SUBMIT_SHOW_DEBUG") ++#undef WER_SUBMIT_SHOW_DEBUG ++#pragma push_macro("WER_SUBMIT_START_MINIMIZED") ++#undef WER_SUBMIT_START_MINIMIZED ++#pragma push_macro("WER_SUBMIT_BYPASS_DATA_THROTTLING") ++#undef WER_SUBMIT_BYPASS_DATA_THROTTLING ++#pragma push_macro("WER_SUBMIT_ARCHIVE_PARAMETERS_ONLY") ++#undef WER_SUBMIT_ARCHIVE_PARAMETERS_ONLY ++#pragma push_macro("WER_SUBMIT_REPORT_MACHINE_ID") ++#undef WER_SUBMIT_REPORT_MACHINE_ID ++enum [[clang::flag_enum]] WER_SUBMIT_FLAGS : DWORD ++{ ++ WER_SUBMIT_ADD_REGISTERED_DATA = 16, ++ WER_SUBMIT_HONOR_RECOVERY = 1, ++ WER_SUBMIT_HONOR_RESTART = 2, ++ WER_SUBMIT_NO_ARCHIVE = 256, ++ WER_SUBMIT_NO_CLOSE_UI = 64, ++ WER_SUBMIT_NO_QUEUE = 128, ++ WER_SUBMIT_OUTOFPROCESS = 32, ++ WER_SUBMIT_OUTOFPROCESS_ASYNC = 1024, ++ WER_SUBMIT_QUEUE = 4, ++ WER_SUBMIT_SHOW_DEBUG = 8, ++ WER_SUBMIT_START_MINIMIZED = 512, ++ WER_SUBMIT_BYPASS_DATA_THROTTLING = 2048, ++ WER_SUBMIT_ARCHIVE_PARAMETERS_ONLY = 4096, ++ WER_SUBMIT_REPORT_MACHINE_ID = 8192, ++}; ++#pragma pop_macro("WER_SUBMIT_REPORT_MACHINE_ID") ++#pragma pop_macro("WER_SUBMIT_ARCHIVE_PARAMETERS_ONLY") ++#pragma pop_macro("WER_SUBMIT_BYPASS_DATA_THROTTLING") ++#pragma pop_macro("WER_SUBMIT_START_MINIMIZED") ++#pragma pop_macro("WER_SUBMIT_SHOW_DEBUG") ++#pragma pop_macro("WER_SUBMIT_QUEUE") ++#pragma pop_macro("WER_SUBMIT_OUTOFPROCESS_ASYNC") ++#pragma pop_macro("WER_SUBMIT_OUTOFPROCESS") ++#pragma pop_macro("WER_SUBMIT_NO_QUEUE") ++#pragma pop_macro("WER_SUBMIT_NO_CLOSE_UI") ++#pragma pop_macro("WER_SUBMIT_NO_ARCHIVE") ++#pragma pop_macro("WER_SUBMIT_HONOR_RESTART") ++#pragma pop_macro("WER_SUBMIT_HONOR_RECOVERY") ++#pragma pop_macro("WER_SUBMIT_ADD_REGISTERED_DATA") ++#endif + + typedef struct _WER_REPORT_INFORMATION + { +@@ -435,13 +538,14 @@ + WerConsentMax + }WER_CONSENT; + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + HRESULT + WINAPI + WerReportCreate( + _In_ PCWSTR pwzEventType, + _In_ WER_REPORT_TYPE repType, + _In_opt_ PWER_REPORT_INFORMATION pReportInformation, +- _Out_ HREPORT *phReportHandle ++ _Out_ _Win32_RAIIFree_(WerReportCloseHandle, -1, 0) HREPORT *phReportHandle + ); + + HRESULT +@@ -459,7 +563,7 @@ + _In_ HREPORT hReportHandle, + _In_ PCWSTR pwzPath, + _In_ WER_FILE_TYPE repFileType, +- _In_ DWORD dwFileFlags ++ _In_ _Win32_AssociatedEnum_(WER_FILE) DWORD dwFileFlags + ); + + HRESULT +@@ -475,9 +579,10 @@ + WerReportSubmit( + _In_ HREPORT hReportHandle, + _In_ WER_CONSENT consent, +- _In_ DWORD dwFlags, ++ _In_ _Win32_AssociatedEnum_(WER_SUBMIT_FLAGS) DWORD dwFlags, + _Out_opt_ PWER_SUBMIT_RESULT pSubmitResult + ); ++_Win32_SupportedOS_END_() + + // + // Masks to be used for customizing the dump +@@ -513,6 +618,7 @@ + WerDumpTypeMax = 5 + } WER_DUMP_TYPE; + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + HRESULT + WINAPI + WerReportAddDump( +@@ -530,6 +636,7 @@ + WerReportCloseHandle( + _In_ HREPORT hReportHandle + ); ++_Win32_SupportedOS_END_() + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ + #pragma endregion +@@ -600,12 +707,13 @@ + #pragma region Application Family or OneCore Family or Games Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM | WINAPI_PARTITION_GAMES) + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + HRESULT + WINAPI + WerRegisterFile( + _In_ PCWSTR pwzFile, + _In_ WER_REGISTER_FILE_TYPE regFileType, +- _In_ DWORD dwFlags ++ _In_ _Win32_AssociatedEnum_(WER_FILE) DWORD dwFlags + ); + + HRESULT +@@ -626,7 +734,9 @@ + WerUnregisterMemoryBlock( + _In_ PVOID pvAddress + ); ++_Win32_SupportedOS_END_() + ++_Win32_SupportedOS_BEGIN_(15063) + STDAPI + WerRegisterExcludedMemoryBlock( + _In_ const void* address, +@@ -648,6 +758,7 @@ + WerUnregisterCustomMetadata( + _In_ PCWSTR key + ); ++_Win32_SupportedOS_END_() + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM | WINAPI_PARTITION_GAMES) */ + #pragma endregion +@@ -655,6 +766,7 @@ + #pragma region Application Family or OneCore Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) + ++_Win32_SupportedOS_BEGIN_(15063) + STDAPI + WerRegisterAdditionalProcess( + _In_ DWORD processId, +@@ -665,7 +777,9 @@ + WerUnregisterAdditionalProcess( + _In_ DWORD processId + ); ++_Win32_SupportedOS_END_() + ++_Win32_SupportedOS_BEGIN_(16299) + STDAPI + WerRegisterAppLocalDump( + _In_ PCWSTR localAppDataRelativePath +@@ -673,6 +787,7 @@ + + STDAPI + WerUnregisterAppLocalDump(); ++_Win32_SupportedOS_END_() + + STDAPI + WerSetMaxProcessHoldMilliseconds( +@@ -685,18 +800,20 @@ + #pragma region Desktop Family or OneCore Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + HRESULT + WINAPI + WerSetFlags( +- _In_ DWORD dwFlags ++ _In_ _Win32_AssociatedEnum_(WER_FAULT_REPORTING) DWORD dwFlags + ); + + HRESULT + WINAPI + WerGetFlags( + _In_ HANDLE hProcess, +- _Out_ PDWORD pdwFlags +- ); ++ _Out_ _Win32_AssociatedEnum_(WER_FAULT_REPORTING) PDWORD pdwFlags ++ ); ++_Win32_SupportedOS_END_() + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */ + #pragma endregion +@@ -707,6 +824,7 @@ + // + // ++++++++++++++++++++++++++ Application Setup APIs ++++++++++++++++++++++++++++++++++++++ + // ++_Win32_SupportedOS_BEGIN_(WindowsVista) + HRESULT + WINAPI + WerAddExcludedApplication( +@@ -720,6 +838,7 @@ + _In_ PCWSTR pwzExeName, + _In_ BOOL bAllUsers + ); ++_Win32_SupportedOS_END_() + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ + #pragma endregion +@@ -733,6 +852,7 @@ + + #define WER_MAX_REGISTERED_RUNTIME_EXCEPTION_MODULES 16 + ++_Win32_SupportedOS_BEGIN_(Windows7) + HRESULT + WINAPI + WerRegisterRuntimeExceptionModule( +@@ -746,6 +866,7 @@ + _In_ PCWSTR pwszOutOfProcessCallbackDll, + _In_ PVOID pContext + ); ++_Win32_SupportedOS_END_() + + #define WER_RUNTIME_EXCEPTION_EVENT_FUNCTION "OutOfProcessExceptionEventCallback" + #define WER_RUNTIME_EXCEPTION_EVENT_SIGNATURE_FUNCTION "OutOfProcessExceptionEventSignatureCallback" +@@ -952,11 +1073,12 @@ + ULONGLONG LegacyBucketId; + } WER_REPORT_METADATA_V3, *PWER_REPORT_METADATA_V3; + ++_Win32_SupportedOS_BEGIN_(15063) + __control_entrypoint(DllExport) + HRESULT + WerStoreOpen( + _In_ REPORT_STORE_TYPES repStoreType, +- _Out_ PHREPORTSTORE phReportStore ++ _Out_ _Win32_RAIIFree_(WerStoreClose, -1, 0) PHREPORTSTORE phReportStore + ); + + __control_entrypoint(DllExport) +@@ -986,6 +1108,7 @@ + _In_ PCWSTR pszReportKey, + _Out_ PWER_REPORT_METADATA_V2 pReportMetadata + ); ++_Win32_SupportedOS_END_() + + __control_entrypoint(DllExport) + HRESULT +@@ -995,6 +1118,7 @@ + _Out_ PWER_REPORT_METADATA_V3 pReportMetadata + ); + ++_Win32_SupportedOS_15063_ + __control_entrypoint(DllExport) + VOID + WerFreeString( diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 95aabee99..3778366bf 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -2532,37 +2532,6 @@ IPBDA_Services=SupportedOSPlatform("windows6.1") IPBDAAttributesDescriptor=SupportedOSPlatform("windows6.1") IPBDAEntitlementDescriptor=SupportedOSPlatform("windows6.1") IPBDASiParser=SupportedOSPlatform("windows6.1") -DwmAttachMilContent=SupportedOSPlatform("windows6.0.6000") -DwmDefWindowProc=SupportedOSPlatform("windows6.0.6000") -DwmDetachMilContent=SupportedOSPlatform("windows6.0.6000") -DwmEnableBlurBehindWindow=SupportedOSPlatform("windows6.0.6000") -DwmEnableComposition=SupportedOSPlatform("windows6.0.6000") -DwmEnableMMCSS=SupportedOSPlatform("windows6.0.6000") -DwmExtendFrameIntoClientArea=SupportedOSPlatform("windows6.0.6000") -DwmFlush=SupportedOSPlatform("windows6.0.6000") -DwmGetColorizationColor=SupportedOSPlatform("windows6.0.6000") -DwmGetCompositionTimingInfo=SupportedOSPlatform("windows6.0.6000") -DwmGetGraphicsStreamClient=SupportedOSPlatform("windows6.0.6000") -DwmGetGraphicsStreamTransformHint=SupportedOSPlatform("windows6.0.6000") -DwmGetTransportAttributes=SupportedOSPlatform("windows6.0.6000") -DwmGetUnmetTabRequirements=SupportedOSPlatform("windows10.0.17134") -DwmGetWindowAttribute=SupportedOSPlatform("windows6.0.6000") -DwmInvalidateIconicBitmaps=SupportedOSPlatform("windows6.1") -DwmIsCompositionEnabled=SupportedOSPlatform("windows6.0.6000") -DwmModifyPreviousDxFrameDuration=SupportedOSPlatform("windows6.0.6000") -DwmQueryThumbnailSourceSize=SupportedOSPlatform("windows6.0.6000") -DwmRegisterThumbnail=SupportedOSPlatform("windows6.0.6000") -DwmRenderGesture=SupportedOSPlatform("windows8.0") -DwmSetDxFrameDuration=SupportedOSPlatform("windows6.0.6000") -DwmSetIconicLivePreviewBitmap=SupportedOSPlatform("windows6.1") -DwmSetIconicThumbnail=SupportedOSPlatform("windows6.1") -DwmSetPresentParameters=SupportedOSPlatform("windows6.0.6000") -DwmSetWindowAttribute=SupportedOSPlatform("windows6.0.6000") -DwmShowContact=SupportedOSPlatform("windows8.0") -DwmTetherContact=SupportedOSPlatform("windows8.0") -DwmTransitionOwnedWindow=SupportedOSPlatform("windows8.0") -DwmUnregisterThumbnail=SupportedOSPlatform("windows6.0.6000") -DwmUpdateThumbnailProperties=SupportedOSPlatform("windows6.0.6000") DWRITE_MAKE_OPENTYPE_TAG=SupportedOSPlatform("windows6.1") DWriteCreateFactory=SupportedOSPlatform("windows6.1") IDWriteBitmapRenderTarget=SupportedOSPlatform("windows6.1") @@ -2797,25 +2766,6 @@ SetLastError=SupportedOSPlatform("windows5.1.2600") SetThreadErrorMode=SupportedOSPlatform("windows6.1") SetUnhandledExceptionFilter=SupportedOSPlatform("windows5.1.2600") UnhandledExceptionFilter=SupportedOSPlatform("windows5.1.2600") -AddERExcludedApplicationA=SupportedOSPlatform("windows5.1.2600") -AddERExcludedApplicationW=SupportedOSPlatform("windows5.1.2600") -ReportFault=SupportedOSPlatform("windows5.1.2600") -WerReportHang=SupportedOSPlatform("windows6.0.6000") -EcClose=SupportedOSPlatform("windows6.0.6000") -EcDeleteSubscription=SupportedOSPlatform("windows6.0.6000") -EcEnumNextSubscription=SupportedOSPlatform("windows6.0.6000") -EcGetObjectArrayProperty=SupportedOSPlatform("windows6.0.6000") -EcGetObjectArraySize=SupportedOSPlatform("windows6.0.6000") -EcGetSubscriptionProperty=SupportedOSPlatform("windows6.0.6000") -EcGetSubscriptionRunTimeStatus=SupportedOSPlatform("windows6.0.6000") -EcInsertObjectArrayElement=SupportedOSPlatform("windows6.0.6000") -EcOpenSubscription=SupportedOSPlatform("windows6.0.6000") -EcOpenSubscriptionEnum=SupportedOSPlatform("windows6.0.6000") -EcRemoveObjectArrayElement=SupportedOSPlatform("windows6.0.6000") -EcRetrySubscription=SupportedOSPlatform("windows6.0.6000") -EcSaveSubscription=SupportedOSPlatform("windows6.0.6000") -EcSetObjectArrayProperty=SupportedOSPlatform("windows6.0.6000") -EcSetSubscriptionProperty=SupportedOSPlatform("windows6.0.6000") EventAccessControl=SupportedOSPlatform("windows6.0.6000") EventAccessQuery=SupportedOSPlatform("windows6.0.6000") EventAccessRemove=SupportedOSPlatform("windows6.0.6000") @@ -7258,87 +7208,6 @@ IPortableDeviceServiceMethods=SupportedOSPlatform("windows6.1") IPortableDeviceUnitsStream=SupportedOSPlatform("windows8.0") IPortableDeviceWebControl=SupportedOSPlatform("windows8.0") IPortableDeviceConnector=SupportedOSPlatform("windows6.1") -CallNtPowerInformation=SupportedOSPlatform("windows5.1.2600") -GetPwrCapabilities=SupportedOSPlatform("windows5.1.2600") -PowerDeterminePlatformRoleEx=SupportedOSPlatform("windows8.0") -PowerRegisterSuspendResumeNotification=SupportedOSPlatform("windows8.0") -PowerUnregisterSuspendResumeNotification=SupportedOSPlatform("windows8.0") -EFFECTIVE_POWER_MODE_CALLBACK=SupportedOSPlatform("windows10.0.17763") -PowerGetActiveScheme=SupportedOSPlatform("windows6.0.6000") -PowerReadACValue=SupportedOSPlatform("windows6.0.6000") -PowerReadDCValue=SupportedOSPlatform("windows6.0.6000") -PowerRegisterForEffectivePowerModeNotifications=SupportedOSPlatform("windows10.0.17763") -PowerSetActiveScheme=SupportedOSPlatform("windows6.0.6000") -PowerSettingRegisterNotification=SupportedOSPlatform("windows6.1") -PowerSettingUnregisterNotification=SupportedOSPlatform("windows6.1") -PowerUnregisterFromEffectivePowerModeNotifications=SupportedOSPlatform("windows10.0.17763") -PowerWriteACValueIndex=SupportedOSPlatform("windows6.0.6000") -PowerWriteDCValueIndex=SupportedOSPlatform("windows6.0.6000") -CanUserWritePwrScheme=SupportedOSPlatform("windows5.1.2600") -DeletePwrScheme=SupportedOSPlatform("windows5.1.2600") -DevicePowerClose=SupportedOSPlatform("windows6.0.6000") -DevicePowerEnumDevices=SupportedOSPlatform("windows6.0.6000") -DevicePowerOpen=SupportedOSPlatform("windows6.0.6000") -DevicePowerSetDeviceState=SupportedOSPlatform("windows6.0.6000") -EnumPwrSchemes=SupportedOSPlatform("windows5.1.2600") -GetActivePwrScheme=SupportedOSPlatform("windows5.1.2600") -GetCurrentPowerPolicies=SupportedOSPlatform("windows5.1.2600") -GetPwrDiskSpindownRange=SupportedOSPlatform("windows5.1.2600") -IsPwrHibernateAllowed=SupportedOSPlatform("windows5.1.2600") -IsPwrShutdownAllowed=SupportedOSPlatform("windows5.1.2600") -IsPwrSuspendAllowed=SupportedOSPlatform("windows5.1.2600") -PowerCanRestoreIndividualDefaultPowerScheme=SupportedOSPlatform("windows6.0.6000") -PowerCreatePossibleSetting=SupportedOSPlatform("windows6.0.6000") -PowerCreateSetting=SupportedOSPlatform("windows6.0.6000") -PowerDeleteScheme=SupportedOSPlatform("windows6.0.6000") -PowerDeterminePlatformRole=SupportedOSPlatform("windows6.0.6000") -PowerDuplicateScheme=SupportedOSPlatform("windows6.0.6000") -PowerEnumerate=SupportedOSPlatform("windows6.0.6000") -PowerImportPowerScheme=SupportedOSPlatform("windows6.0.6000") -PowerIsSettingRangeDefined=SupportedOSPlatform("windows6.1") -PowerReadACDefaultIndex=SupportedOSPlatform("windows6.0.6000") -PowerReadACValueIndex=SupportedOSPlatform("windows6.0.6000") -PowerReadDCDefaultIndex=SupportedOSPlatform("windows6.0.6000") -PowerReadDCValueIndex=SupportedOSPlatform("windows6.0.6000") -PowerReadDescription=SupportedOSPlatform("windows6.0.6000") -PowerReadFriendlyName=SupportedOSPlatform("windows6.0.6000") -PowerReadIconResourceSpecifier=SupportedOSPlatform("windows6.0.6000") -PowerReadPossibleDescription=SupportedOSPlatform("windows6.0.6000") -PowerReadPossibleFriendlyName=SupportedOSPlatform("windows6.0.6000") -PowerReadPossibleValue=SupportedOSPlatform("windows6.0.6000") -PowerReadSettingAttributes=SupportedOSPlatform("windows6.0.6000") -PowerReadValueIncrement=SupportedOSPlatform("windows6.0.6000") -PowerReadValueMax=SupportedOSPlatform("windows6.0.6000") -PowerReadValueMin=SupportedOSPlatform("windows6.0.6000") -PowerReadValueUnitsSpecifier=SupportedOSPlatform("windows6.0.6000") -PowerRemovePowerSetting=SupportedOSPlatform("windows6.0.6000") -PowerReplaceDefaultPowerSchemes=SupportedOSPlatform("windows6.0.6000") -PowerReportThermalEvent=SupportedOSPlatform("windows8.1") -PowerRestoreDefaultPowerSchemes=SupportedOSPlatform("windows6.0.6000") -PowerRestoreIndividualDefaultPowerScheme=SupportedOSPlatform("windows6.0.6000") -PowerSettingAccessCheck=SupportedOSPlatform("windows6.0.6000") -PowerSettingAccessCheckEx=SupportedOSPlatform("windows6.1") -PowerWriteACDefaultIndex=SupportedOSPlatform("windows6.0.6000") -PowerWriteDCDefaultIndex=SupportedOSPlatform("windows6.0.6000") -PowerWriteDescription=SupportedOSPlatform("windows6.0.6000") -PowerWriteFriendlyName=SupportedOSPlatform("windows6.0.6000") -PowerWriteIconResourceSpecifier=SupportedOSPlatform("windows6.0.6000") -PowerWritePossibleDescription=SupportedOSPlatform("windows6.0.6000") -PowerWritePossibleFriendlyName=SupportedOSPlatform("windows6.0.6000") -PowerWritePossibleValue=SupportedOSPlatform("windows6.0.6000") -PowerWriteSettingAttributes=SupportedOSPlatform("windows6.0.6000") -PowerWriteValueIncrement=SupportedOSPlatform("windows6.0.6000") -PowerWriteValueMax=SupportedOSPlatform("windows6.0.6000") -PowerWriteValueMin=SupportedOSPlatform("windows6.0.6000") -PowerWriteValueUnitsSpecifier=SupportedOSPlatform("windows6.0.6000") -ReadGlobalPwrPolicy=SupportedOSPlatform("windows5.1.2600") -ReadProcessorPwrScheme=SupportedOSPlatform("windows5.1.2600") -ReadPwrScheme=SupportedOSPlatform("windows5.1.2600") -SetActivePwrScheme=SupportedOSPlatform("windows5.1.2600") -SetSuspendState=SupportedOSPlatform("windows5.1.2600") -WriteGlobalPwrPolicy=SupportedOSPlatform("windows5.1.2600") -WriteProcessorPwrScheme=SupportedOSPlatform("windows5.1.2600") -WritePwrScheme=SupportedOSPlatform("windows5.1.2600") IPrintManagerInterop=SupportedOSPlatform("windows8.0") CreatePrintAsyncNotifyChannel=SupportedOSPlatform("windows6.0.6000") RegisterForPrintAsyncNotifications=SupportedOSPlatform("windows6.0.6000") @@ -12448,37 +12317,6 @@ WebSocketGetAction=SupportedOSPlatform("windows8.0") WebSocketGetGlobalProperty=SupportedOSPlatform("windows8.0") WebSocketReceive=SupportedOSPlatform("windows8.0") WebSocketSend=SupportedOSPlatform("windows8.0") -WerAddExcludedApplication=SupportedOSPlatform("windows6.0.6000") -WerFreeString=SupportedOSPlatform("windows10.0.15063") -WerGetFlags=SupportedOSPlatform("windows6.0.6000") -WerRegisterAdditionalProcess=SupportedOSPlatform("windows10.0.15063") -WerRegisterAppLocalDump=SupportedOSPlatform("windows10.0.16299") -WerRegisterCustomMetadata=SupportedOSPlatform("windows10.0.15063") -WerRegisterExcludedMemoryBlock=SupportedOSPlatform("windows10.0.15063") -WerRegisterFile=SupportedOSPlatform("windows6.0.6000") -WerRegisterMemoryBlock=SupportedOSPlatform("windows6.0.6000") -WerRegisterRuntimeExceptionModule=SupportedOSPlatform("windows6.1") -WerRemoveExcludedApplication=SupportedOSPlatform("windows6.0.6000") -WerReportAddDump=SupportedOSPlatform("windows6.0.6000") -WerReportAddFile=SupportedOSPlatform("windows6.0.6000") -WerReportCloseHandle=SupportedOSPlatform("windows6.0.6000") -WerReportCreate=SupportedOSPlatform("windows6.0.6000") -WerReportSetParameter=SupportedOSPlatform("windows6.0.6000") -WerReportSetUIOption=SupportedOSPlatform("windows6.0.6000") -WerReportSubmit=SupportedOSPlatform("windows6.0.6000") -WerSetFlags=SupportedOSPlatform("windows6.0.6000") -WerStoreClose=SupportedOSPlatform("windows10.0.15063") -WerStoreGetFirstReportKey=SupportedOSPlatform("windows10.0.15063") -WerStoreGetNextReportKey=SupportedOSPlatform("windows10.0.15063") -WerStoreOpen=SupportedOSPlatform("windows10.0.15063") -WerStoreQueryReportMetadataV2=SupportedOSPlatform("windows10.0.15063") -WerUnregisterAdditionalProcess=SupportedOSPlatform("windows10.0.15063") -WerUnregisterAppLocalDump=SupportedOSPlatform("windows10.0.16299") -WerUnregisterCustomMetadata=SupportedOSPlatform("windows10.0.15063") -WerUnregisterExcludedMemoryBlock=SupportedOSPlatform("windows10.0.15063") -WerUnregisterFile=SupportedOSPlatform("windows6.0.6000") -WerUnregisterMemoryBlock=SupportedOSPlatform("windows6.0.6000") -WerUnregisterRuntimeExceptionModule=SupportedOSPlatform("windows6.1") LPSAFEARRAY_UserFree64=SupportedOSPlatform("windows5.1.2600") LPSAFEARRAY_UserMarshal64=SupportedOSPlatform("windows5.1.2600") LPSAFEARRAY_UserSize64=SupportedOSPlatform("windows5.1.2600") diff --git a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs index 9d6503beb..cd256bab8 100644 --- a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs @@ -100,6 +100,63 @@ public void AdditionalPreparedPartitionsKeepOrdinaryNativeAbi(string partition, static_assert(LF32_FIXED == 1); static_assert(LF32_FREE == 2); static_assert(LF32_MOVEABLE == 4); +", + "Dwm" => @" +static_assert(__is_same(__underlying_type(DWM_SHOWCONTACT), int)); +static_assert(sizeof(DWM_SHOWCONTACT) == 4); +static_assert(DWMSC_DOWN == 1); +static_assert(DWMSC_UP == 2); +static_assert(DWMSC_DRAG == 4); +static_assert(DWMSC_HOLD == 8); +static_assert(DWMSC_PENBARREL == 16); +static_assert(DWMSC_NONE == 0); +static_assert(static_cast(DWMSC_ALL) == 0xFFFFFFFFu); +", + "Wer" => @" +static_assert(__is_same(HREPORT, HANDLE)); +static_assert(__is_same(HREPORTSTORE, void*)); +static_assert(WER_FILE_ANONYMOUS_DATA == 2); +static_assert(WER_FILE_DELETE_WHEN_DONE == 1); +static_assert(WER_SUBMIT_ADD_REGISTERED_DATA == 16); +static_assert(WER_SUBMIT_HONOR_RECOVERY == 1); +static_assert(WER_SUBMIT_HONOR_RESTART == 2); +static_assert(WER_SUBMIT_NO_ARCHIVE == 256); +static_assert(WER_SUBMIT_NO_CLOSE_UI == 64); +static_assert(WER_SUBMIT_NO_QUEUE == 128); +static_assert(WER_SUBMIT_OUTOFPROCESS == 32); +static_assert(WER_SUBMIT_OUTOFPROCESS_ASYNC == 1024); +static_assert(WER_SUBMIT_QUEUE == 4); +static_assert(WER_SUBMIT_SHOW_DEBUG == 8); +static_assert(WER_SUBMIT_START_MINIMIZED == 512); +static_assert(WER_SUBMIT_BYPASS_DATA_THROTTLING == 2048); +static_assert(WER_SUBMIT_ARCHIVE_PARAMETERS_ONLY == 4096); +static_assert(WER_SUBMIT_REPORT_MACHINE_ID == 8192); +static_assert(WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION == 4); +static_assert(WER_FAULT_REPORTING_FLAG_NOHEAP == 1); +static_assert(WER_FAULT_REPORTING_FLAG_QUEUE == 2); +static_assert(WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD == 8); +static_assert(WER_FAULT_REPORTING_ALWAYS_SHOW_UI == 16); +", + "Power" => @" +static_assert(PDCAP_D0_SUPPORTED == 0x00000001); +static_assert(PDCAP_D1_SUPPORTED == 0x00000002); +static_assert(PDCAP_D2_SUPPORTED == 0x00000004); +static_assert(PDCAP_D3_SUPPORTED == 0x00000008); +static_assert(PDCAP_WAKE_FROM_D0_SUPPORTED == 0x00000010); +static_assert(PDCAP_WAKE_FROM_D1_SUPPORTED == 0x00000020); +static_assert(PDCAP_WAKE_FROM_D2_SUPPORTED == 0x00000040); +static_assert(PDCAP_WAKE_FROM_D3_SUPPORTED == 0x00000080); +static_assert(PDCAP_WARM_EJECT_SUPPORTED == 0x00000100); +static_assert(PDCAP_S0_SUPPORTED == 0x00010000); +static_assert(PDCAP_S1_SUPPORTED == 0x00020000); +static_assert(PDCAP_S2_SUPPORTED == 0x00040000); +static_assert(PDCAP_S3_SUPPORTED == 0x00080000); +static_assert(PDCAP_WAKE_FROM_S0_SUPPORTED == 0x00100000); +static_assert(PDCAP_WAKE_FROM_S1_SUPPORTED == 0x00200000); +static_assert(PDCAP_WAKE_FROM_S2_SUPPORTED == 0x00400000); +static_assert(PDCAP_WAKE_FROM_S3_SUPPORTED == 0x00800000); +static_assert(PDCAP_S4_SUPPORTED == 0x01000000); +static_assert(PDCAP_S5_SUPPORTED == 0x02000000); ", "Wsl" => @" static_assert(WSL_DISTRIBUTION_FLAGS_NONE == 0); From ae3ce2bc257c16d1d751bb968ad4cc83d0bdaf6d Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:41:55 -0700 Subject: [PATCH 11/17] Integrate bounded small-owner header annotation payload Apply only8f8f3211f409aca39276abc9c5b5a7d0c6293763, not its private tooling merge, to qualified c587/43af plus ordered Network/Device/System inputs. Preserve signed Int32 FDICREATE_CPU_TYPE identity, values, order and one native-int use. Retain the undeclared MDM manual DLL row. Keep two private declaration expectations queued separately; the original117 expectations await actual combined central measurement. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 42 ++++++++++ .../WinSDK/Partitions/Cabinets/settings.rsp | 2 + .../WinSDK/Partitions/MdmReg/settings.rsp | 2 + generation/WinSDK/Partitions/Wcn/settings.rsp | 2 + .../WinSDK/Partitions/WebDav/settings.rsp | 2 + generation/WinSDK/enums.json | 22 ----- generation/WinSDK/patches/SdkHeaders.json | 72 +++++++++++++++- .../post-midl/um/davclnt.annotations.patch | 28 +++++++ .../post-midl/um/fdi.annotations.patch | 62 ++++++++++++++ .../um/mdmregistration.annotations.patch | 84 +++++++++++++++++++ .../post-midl/um/wcndevice.annotations.patch | 28 +++++++ generation/WinSDK/supportedOS.rsp | 28 ------- .../WinHttpNativeControlTests.cs | 6 ++ 13 files changed, 328 insertions(+), 52 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/um/davclnt.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/fdi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/mdmregistration.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/wcndevice.annotations.patch diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 5a733f7c2..7bb0d5ef5 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -618,3 +618,45 @@ exercises architecture-shape changes, missing-input safety and overlapping-root rejection against the actual helper function. This corrects selected-source replacement, not stale unselected dependencies: the Network layer still needs a fresh canonical SDK scrape for its full physical include closure. + +## Parallel small API patch input + +The Wcn, Cabinets, MdmReg and WebDav input relocates 28 existing emitted OS +floors through four physical header patches. The two Wcn interface floors stay +direct annotations. The four FDI functions and eleven WebDav functions use +bounded same-floor scopes; MdmReg uses three scopes plus direct annotations to +avoid assigning floors to intervening, previously unannotated functions. + +Cabinets also relocates the existing unscoped, nonflags `FDICREATE_CPU_TYPE`, +preserving signed 32-bit storage and member order/values `cpuUNKNOWN = -1`, +`cpu80286 = 0`, `cpu80386 = 1`. Native macros are restored after the metadata-only +enum declaration. `FDICreate.cpuType` remains native `int` plus its existing enum +association rather than a substituted native enum. The two exact declaration +expectations describe that representation change, not a new enum identity. + +The recipe pins all ten owner-cluster headers to matching selected-SDK +preimages; only four are patched. Generated DLL mappings, callback identities, +SAL, ABI and unrelated authored settings stay unchanged. The adjacent manual +`RegisterDeviceDualEnrollMmpcUsingAADDeviceCredentials` import row has no +declaration in these selected headers and remains explicitly unbound rather than +being recreated. Global native field-array inference remains absent/default-off. + +The private handoff is bounded patch-production evidence, not a final full-image grade. +Artifacts under `artifacts\parallel-small-api-migration` separate unmodified +parser activation, isolated owner controls and combined-recipe preparation. +Its private combined recipe prepared and reused its immutable cache successfully. +Bounded native and scraper controls used only these four patches because its +historical inherited patches still referenced `_Windows_SupportedOS_*`. +The owning integration now inherits qualified `c5879a77`/`43af342a` and applies +the canonical spelling overlay to its inherited patches. The private handoff +does not qualify the combined owning recipe or its physical include closure. + +The source controls separately check OS targets/payloads, their qualified +attribute spelling/order and removal of an unused versioning import. Four +`FDIDECRYPT` anonymous-record `NativeTypeName` coordinates move by one line +after the new include; that attribute is not emitted into the winmd. These +source details are not additional authored facts or a full-image grade. + +Broad physical closure, final OLD/control/NEW images and exact-head full-SDK CI +remain integration-owner gates after ordered tooling/pilot adoption. Consumer +compatibility remains **UNVERIFIED**. diff --git a/generation/WinSDK/Partitions/Cabinets/settings.rsp b/generation/WinSDK/Partitions/Cabinets/settings.rsp index 8576c0f7e..3e500eb24 100644 --- a/generation/WinSDK/Partitions/Cabinets/settings.rsp +++ b/generation/WinSDK/Partitions/Cabinets/settings.rsp @@ -4,3 +4,5 @@ /um/fdi.h --namespace Windows.Win32.Storage.Cabinets +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/MdmReg/settings.rsp b/generation/WinSDK/Partitions/MdmReg/settings.rsp index 641bd1bf4..c9c9fe125 100644 --- a/generation/WinSDK/Partitions/MdmReg/settings.rsp +++ b/generation/WinSDK/Partitions/MdmReg/settings.rsp @@ -3,3 +3,5 @@ /um/mdmlocalmanagement.h --namespace Windows.Win32.Management.MobileDeviceManagementRegistration +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/Wcn/settings.rsp b/generation/WinSDK/Partitions/Wcn/settings.rsp index d24ba3597..3ab476bd5 100644 --- a/generation/WinSDK/Partitions/Wcn/settings.rsp +++ b/generation/WinSDK/Partitions/Wcn/settings.rsp @@ -5,3 +5,5 @@ /um/wcnfunctiondiscoverykeys.h --namespace Windows.Win32.NetworkManagement.WindowsConnectNow +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/WebDav/settings.rsp b/generation/WinSDK/Partitions/WebDav/settings.rsp index 7231bb2ff..f24dae441 100644 --- a/generation/WinSDK/Partitions/WebDav/settings.rsp +++ b/generation/WinSDK/Partitions/WebDav/settings.rsp @@ -2,3 +2,5 @@ /um/davclnt.h --namespace Windows.Win32.NetworkManagement.WebDav +--config +parse-win32-annotations diff --git a/generation/WinSDK/enums.json b/generation/WinSDK/enums.json index 8d37f3170..97ecb767d 100644 --- a/generation/WinSDK/enums.json +++ b/generation/WinSDK/enums.json @@ -13455,28 +13455,6 @@ } ] }, - { - "name": "FDICREATE_CPU_TYPE", - "members": [ - { - "name": "cpuUNKNOWN" - }, - { - "name": "cpu80286", - "value": "0" - }, - { - "name": "cpu80386", - "value": "1" - } - ], - "uses": [ - { - "method": "FDICreate", - "parameter": "cpuType" - } - ] - }, { "name": "FONT_OUTPUT_PRECISION", "type": "byte", diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index 1aaaf57f4..f68945b18 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -315,6 +315,66 @@ "sourceSha256": "7C9E06256A91F7D2B0F77FAC8FC6FE04934FBC615147CE1945A0FBA7BB25C305", "sdkPath": "c\\include\\10.0.26100.0\\shared\\emi.h", "sdkSha256": "7C9E06256A91F7D2B0F77FAC8FC6FE04934FBC615147CE1945A0FBA7BB25C305" + }, + { + "path": "um\\wcnapi.h", + "sourceSha256": "071CBD5761C166CC48CB8AD559E9B794CF3A02ADC1D34EB3B7C64F854C47B34A", + "sdkPath": "c\\include\\10.0.26100.0\\um\\wcnapi.h", + "sdkSha256": "071CBD5761C166CC48CB8AD559E9B794CF3A02ADC1D34EB3B7C64F854C47B34A" + }, + { + "path": "um\\WcnTypes.h", + "sourceSha256": "4D72A8E38AF50C110BD68C4A863936F92EC97F936403E7AA02CFBEDCB07A2C99", + "sdkPath": "c\\include\\10.0.26100.0\\um\\WcnTypes.h", + "sdkSha256": "4D72A8E38AF50C110BD68C4A863936F92EC97F936403E7AA02CFBEDCB07A2C99" + }, + { + "path": "um\\WcnDevice.h", + "sourceSha256": "54AD4BAD1B3326E46E6CAB2DDDEDA117B9AC6749BEDB234B11E78CC935225588", + "sdkPath": "c\\include\\10.0.26100.0\\um\\WcnDevice.h", + "sdkSha256": "54AD4BAD1B3326E46E6CAB2DDDEDA117B9AC6749BEDB234B11E78CC935225588" + }, + { + "path": "um\\wcnfunctiondiscoverykeys.h", + "sourceSha256": "2ADA6D7422140E198EFC405962B7D74FB8206FFE9270FB5C9DA10C304F81590D", + "sdkPath": "c\\include\\10.0.26100.0\\um\\wcnfunctiondiscoverykeys.h", + "sdkSha256": "2ADA6D7422140E198EFC405962B7D74FB8206FFE9270FB5C9DA10C304F81590D" + }, + { + "path": "um\\fci.h", + "sourceSha256": "91A44645F72D776E4E0FCF8F97EA53A9BF73F356CD5ADFFCCB79316A75942B37", + "sdkPath": "c\\include\\10.0.26100.0\\um\\fci.h", + "sdkSha256": "91A44645F72D776E4E0FCF8F97EA53A9BF73F356CD5ADFFCCB79316A75942B37" + }, + { + "path": "um\\fdi_fci_types.h", + "sourceSha256": "27A1F6F7728F5DB64D11E434D101819D646CA49270930606BB76C7989EBE0254", + "sdkPath": "c\\include\\10.0.26100.0\\um\\fdi_fci_types.h", + "sdkSha256": "27A1F6F7728F5DB64D11E434D101819D646CA49270930606BB76C7989EBE0254" + }, + { + "path": "um\\fdi.h", + "sourceSha256": "F85A2D27CB0F286EA6CB2964CE81F28F58971FE0E40581CD7540437229C8D8D3", + "sdkPath": "c\\include\\10.0.26100.0\\um\\fdi.h", + "sdkSha256": "F85A2D27CB0F286EA6CB2964CE81F28F58971FE0E40581CD7540437229C8D8D3" + }, + { + "path": "um\\MDMRegistration.h", + "sourceSha256": "9CED99DB4C56E2AF8F8A77437EE1E657CE904F9383406E26E893F98D5DFD3233", + "sdkPath": "c\\include\\10.0.26100.0\\um\\MDMRegistration.h", + "sdkSha256": "9CED99DB4C56E2AF8F8A77437EE1E657CE904F9383406E26E893F98D5DFD3233" + }, + { + "path": "um\\mdmlocalmanagement.h", + "sourceSha256": "22B6B2BF8C61EC7A2CF4B961AE3F9E378CA338C11F223D010B42CD8466C7F47D", + "sdkPath": "c\\include\\10.0.26100.0\\um\\mdmlocalmanagement.h", + "sdkSha256": "22B6B2BF8C61EC7A2CF4B961AE3F9E378CA338C11F223D010B42CD8466C7F47D" + }, + { + "path": "um\\davclnt.h", + "sourceSha256": "9E9032F6463B611F3BCF049B95A2E8E44793428368887C2C65607975F5EDD132", + "sdkPath": "c\\include\\10.0.26100.0\\um\\davclnt.h", + "sdkSha256": "9E9032F6463B611F3BCF049B95A2E8E44793428368887C2C65607975F5EDD132" } ], "partitions": [ @@ -360,7 +420,11 @@ "Dwm", "Wer", "Wec", - "Power" + "Power", + "Wcn", + "Cabinets", + "MdmReg", + "WebDav" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -409,6 +473,10 @@ "post-midl\\um\\evcoll.annotations.patch", "post-midl\\um\\powrprof.annotations.patch", "post-midl\\um\\powersetting.annotations.patch", - "post-midl\\um\\powerbase.annotations.patch" + "post-midl\\um\\powerbase.annotations.patch", + "post-midl\\um\\wcndevice.annotations.patch", + "post-midl\\um\\fdi.annotations.patch", + "post-midl\\um\\mdmregistration.annotations.patch", + "post-midl\\um\\davclnt.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/um/davclnt.annotations.patch b/generation/WinSDK/patches/post-midl/um/davclnt.annotations.patch new file mode 100644 index 000000000..3aded68f6 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/davclnt.annotations.patch @@ -0,0 +1,28 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/davclnt.h b/generation/WinSDK/RecompiledIdlHeaders/um/davclnt.h +index c369d61a..b83bd24f 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/davclnt.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/davclnt.h +@@ -18,6 +18,7 @@ Revision History: + #define _DAV_CLNT_H_ + + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -80,6 +81,7 @@ typedef DWORD (CALLBACK *PFNDAVAUTHCALLBACK)( + _Out_ PFNDAVAUTHCALLBACK_FREECRED *pFreeCred // Callback to free the memory allocated for creds by the callback + ); + ++_Win32_SupportedOS_BEGIN_(WindowsVista) + _Success_(return == ERROR_SUCCESS) + DWORD + WINAPI +@@ -166,6 +168,7 @@ DavRegisterAuthCallback(_In_ PFNDAVAUTHCALLBACK CallBack, + VOID + WINAPI + DavUnregisterAuthCallback(_In_ OPAQUE_HANDLE hCallback); ++_Win32_SupportedOS_END_() + + #ifdef __cplusplus + } diff --git a/generation/WinSDK/patches/post-midl/um/fdi.annotations.patch b/generation/WinSDK/patches/post-midl/um/fdi.annotations.patch new file mode 100644 index 000000000..5c4c9aad5 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/fdi.annotations.patch @@ -0,0 +1,62 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/fdi.h b/generation/WinSDK/RecompiledIdlHeaders/um/fdi.h +index 271b4b96..407ec49f 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/fdi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/fdi.h +@@ -187,6 +187,7 @@ + #define INCLUDED_FDI 1 + + #include ++#include + typedef _Null_terminated_ char* LPSTR; + + #ifdef __cplusplus +@@ -925,6 +926,24 @@ typedef FDISPILLFILE *PFDISPILLFILE; /* pfdisf */ + #define cpu80286 (0) /* '286 opcodes only */ + #define cpu80386 (1) /* '386 opcodes used */ + ++#ifdef WIN32METADATA ++#pragma push_macro("cpuUNKNOWN") ++#pragma push_macro("cpu80286") ++#pragma push_macro("cpu80386") ++#undef cpuUNKNOWN ++#undef cpu80286 ++#undef cpu80386 ++enum FDICREATE_CPU_TYPE : int ++{ ++ cpuUNKNOWN = -1, ++ cpu80286 = 0, ++ cpu80386 = 1, ++}; ++#pragma pop_macro("cpu80386") ++#pragma pop_macro("cpu80286") ++#pragma pop_macro("cpuUNKNOWN") ++#endif ++ + + /*** FDICreate - Create an FDI context + * +@@ -957,6 +976,7 @@ typedef FDISPILLFILE *PFDISPILLFILE; /* pfdisf */ + * FDICreate(), and then free it up afterwards (or do all your allocation + * before calling FDICreate(). + */ ++_Win32_SupportedOS_BEGIN_(Windows2000) + HFDI FAR DIAMONDAPI FDICreate(__callback PFNALLOC pfnalloc, + __callback PFNFREE pfnfree, + __callback PFNOPEN pfnopen, +@@ -964,7 +984,7 @@ HFDI FAR DIAMONDAPI FDICreate(__callback PFNALLOC pfnalloc, + __callback PFNWRITE pfnwrite, + __callback PFNCLOSE pfnclose, + __callback PFNSEEK pfnseek, +- int cpuType, ++ _Win32_AssociatedEnum_(FDICREATE_CPU_TYPE) int cpuType, + _Inout_ PERF perf); + + +@@ -1035,6 +1055,7 @@ BOOL FAR DIAMONDAPI FDICopy(_In_ HFDI hfdi, + * Returns FALSE; + */ + BOOL FAR DIAMONDAPI FDIDestroy(_In_ HFDI hfdi); ++_Win32_SupportedOS_END_() + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */ + #pragma endregion diff --git a/generation/WinSDK/patches/post-midl/um/mdmregistration.annotations.patch b/generation/WinSDK/patches/post-midl/um/mdmregistration.annotations.patch new file mode 100644 index 000000000..69b682d16 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/mdmregistration.annotations.patch @@ -0,0 +1,84 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/MDMRegistration.h b/generation/WinSDK/RecompiledIdlHeaders/um/MDMRegistration.h +index 19c93fd2..13b0b94f 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/MDMRegistration.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/MDMRegistration.h +@@ -29,6 +29,7 @@ Notes: + #endif + + #include ++#include + #include + + #pragma region Desktop Family +@@ -168,6 +169,7 @@ Return Value: + HRESULT indicating success or failure. + + --*/ ++_Win32_SupportedOS_BEGIN_(Windows81) + HRESULT WINAPI + GetDeviceRegistrationInfo( + _In_ REGISTRATION_INFORMATION_CLASS DeviceInformationClass, +@@ -217,6 +219,7 @@ HRESULT WINAPI + IsManagementRegistrationAllowed( + _Out_ BOOL *pfIsManagementRegistrationAllowed + ); ++_Win32_SupportedOS_END_() + + /*++ + Routine Description: +@@ -251,6 +254,7 @@ Return Value: + HRESULT indicating success or failure. + + --*/ ++_Win32_SupportedOS_Windows81_ + HRESULT WINAPI + SetManagedExternally( + _In_ BOOL IsManagedExternally +@@ -274,6 +278,7 @@ Return Value: + ppMgmtInfo - Struct containing MDM service URIs + + --*/ ++_Win32_SupportedOS_BEGIN_(Windows81) + HRESULT WINAPI + DiscoverManagementService( + _In_z_ LPCWSTR pszUPN, +@@ -319,6 +324,7 @@ HRESULT indicating success or failure. + --*/ + HRESULT WINAPI + RegisterDeviceWithManagementUsingAADDeviceCredentials(); ++_Win32_SupportedOS_END_() + + + /*++ +@@ -359,6 +365,7 @@ Return Value: + HRESULT indicating success or failure. + + --*/ ++_Win32_SupportedOS_BEGIN_(Windows81) + HRESULT WINAPI + RegisterDeviceWithManagement( + _In_z_ LPCWSTR pszUPN, +@@ -385,6 +392,7 @@ HRESULT WINAPI + UnregisterDeviceWithManagement( + _In_opt_z_ LPCWSTR enrollmentID + ); ++_Win32_SupportedOS_END_() + + /*++ + +@@ -453,6 +461,7 @@ Return Value: + HRESULT indicating success or failure. + + --*/ ++_Win32_SupportedOS_Windows81_ + HRESULT WINAPI + GetManagementAppHyperlink( + _In_ DWORD cchHyperlink, +@@ -479,6 +488,7 @@ Return Value: + ppMgmtInfo - Struct containing MDM service URIs + --*/ + ++_Win32_SupportedOS_Windows81_ + HRESULT WINAPI + DiscoverManagementServiceEx( + _In_z_ LPCWSTR pszUPN, diff --git a/generation/WinSDK/patches/post-midl/um/wcndevice.annotations.patch b/generation/WinSDK/patches/post-midl/um/wcndevice.annotations.patch new file mode 100644 index 000000000..f58cab537 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/wcndevice.annotations.patch @@ -0,0 +1,28 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/WcnDevice.h b/generation/WinSDK/RecompiledIdlHeaders/um/WcnDevice.h +index e1218c7d..4367ba09 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/WcnDevice.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/WcnDevice.h +@@ -99,6 +99,7 @@ Abstract: + + --*/ + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #if NTDDI_VERSION >= NTDDI_WIN7 +@@ -159,6 +160,7 @@ EXTERN_C const IID IID_IWCNDevice; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C100BE9C-D33A-4a4b-BF23-BBEF4663D017") ++ _Win32_SupportedOS_Windows7_ + IWCNDevice : public IUnknown + { + public: +@@ -393,6 +395,7 @@ EXTERN_C const IID IID_IWCNConnectNotify; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C100BE9F-D33A-4a4b-BF23-BBEF4663D017") ++ _Win32_SupportedOS_Windows7_ + IWCNConnectNotify : public IUnknown + { + public: diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 3778366bf..9edb6a5eb 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -2140,17 +2140,6 @@ GetDateFormatW=SupportedOSPlatform("windows5.0") GetTimeFormatA=SupportedOSPlatform("windows5.0") GetTimeFormatEx=SupportedOSPlatform("windows6.0.6000") GetTimeFormatW=SupportedOSPlatform("windows5.0") -DavAddConnection=SupportedOSPlatform("windows6.0.6000") -DavCancelConnectionsToServer=SupportedOSPlatform("windows6.0.6000") -DavDeleteConnection=SupportedOSPlatform("windows6.0.6000") -DavFlushFile=SupportedOSPlatform("windows6.0.6000") -DavGetExtendedError=SupportedOSPlatform("windows6.0.6000") -DavGetHTTPFromUNCPath=SupportedOSPlatform("windows6.0.6000") -DavGetTheLockOwnerOfTheFile=SupportedOSPlatform("windows6.0.6000") -DavGetUNCFromHTTPPath=SupportedOSPlatform("windows6.0.6000") -DavInvalidateCache=SupportedOSPlatform("windows6.0.6000") -DavRegisterAuthCallback=SupportedOSPlatform("windows6.0.6000") -DavUnregisterAuthCallback=SupportedOSPlatform("windows6.0.6000") DCIBeginAccess=SupportedOSPlatform("windows5.0") DCICloseProvider=SupportedOSPlatform("windows5.0") DCICreatePrimary=SupportedOSPlatform("windows5.0") @@ -2945,10 +2934,6 @@ FaxRouteDeviceEnable=SupportedOSPlatform("windows5.0") FaxRouteGetRoutingInfo=SupportedOSPlatform("windows5.0") FaxRouteInitialize=SupportedOSPlatform("windows5.0") FaxRouteSetRoutingInfo=SupportedOSPlatform("windows5.0") -FDICopy=SupportedOSPlatform("windows5.0") -FDICreate=SupportedOSPlatform("windows5.0") -FDIDestroy=SupportedOSPlatform("windows5.0") -FDIIsCabinet=SupportedOSPlatform("windows5.0") IFhConfigMgr=SupportedOSPlatform("windows8.0") IFhReassociation=SupportedOSPlatform("windows8.0") IFhScopeIterator=SupportedOSPlatform("windows8.0") @@ -4350,17 +4335,6 @@ IMbnSmsReadMsgTextCdma=SupportedOSPlatform("windows6.1") IMbnSubscriberInformation=SupportedOSPlatform("windows6.1") IMbnVendorSpecificEvents=SupportedOSPlatform("windows6.1") IMbnVendorSpecificOperation=SupportedOSPlatform("windows6.1") -DiscoverManagementService=SupportedOSPlatform("windows8.1") -DiscoverManagementServiceEx=SupportedOSPlatform("windows8.1") -GetDeviceRegistrationInfo=SupportedOSPlatform("windows8.1") -GetManagementAppHyperlink=SupportedOSPlatform("windows8.1") -IsDeviceRegisteredWithManagement=SupportedOSPlatform("windows8.1") -IsManagementRegistrationAllowed=SupportedOSPlatform("windows8.1") -RegisterDeviceWithManagement=SupportedOSPlatform("windows8.1") -RegisterDeviceWithManagementUsingAADCredentials=SupportedOSPlatform("windows8.1") -RegisterDeviceWithManagementUsingAADDeviceCredentials=SupportedOSPlatform("windows8.1") -SetManagedExternally=SupportedOSPlatform("windows8.1") -UnregisterDeviceWithManagement=SupportedOSPlatform("windows8.1") AllocateUserPhysicalPages=SupportedOSPlatform("windows5.1.2600") AllocateUserPhysicalPagesNuma=SupportedOSPlatform("windows6.0.6000") CreateFileMappingFromApp=SupportedOSPlatform("windows8.0") @@ -11965,8 +11939,6 @@ ISettingsItem=SupportedOSPlatform("windows6.0.6000") ISettingsNamespace=SupportedOSPlatform("windows6.0.6000") ISettingsResult=SupportedOSPlatform("windows6.0.6000") ITargetInfo=SupportedOSPlatform("windows6.0.6000") -IWCNConnectNotify=SupportedOSPlatform("windows6.1") -IWCNDevice=SupportedOSPlatform("windows6.1") CloseThreadWaitChainSession=SupportedOSPlatform("windows6.0.6000") GetThreadWaitChain=SupportedOSPlatform("windows6.0.6000") OpenThreadWaitChainSession=SupportedOSPlatform("windows6.0.6000") diff --git a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs index cd256bab8..3d8e751e5 100644 --- a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs @@ -75,6 +75,12 @@ public void AdditionalPreparedPartitionsKeepOrdinaryNativeAbi(string partition, Assert.NotEmpty(headers); string checks = partition switch { + "Cabinets" => @" +static_assert(cpuUNKNOWN == -1); +static_assert(cpu80286 == 0); +static_assert(cpu80386 == 1); +static_assert(sizeof(int) == 4); +", "ApplicationVerifier" => @" static_assert(AVRF_ENUM_RESOURCES_FLAGS_DONT_RESOLVE_TRACES == 2); static_assert(AVRF_ENUM_RESOURCES_FLAGS_SUSPEND == 1); From 00c09afd306fa00a957f2d029d1f2440093ebd6b Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:43:56 -0700 Subject: [PATCH 12/17] Integrate bounded service-owner SDK annotation payload Apply onlydd439da660ad50a0522fd1aee32c8f44296e5e5a, not its private43af tooling merge. Distinguish42 relocated OS rows from43 owned emitted OS targets and four unchanged shared BSTR RPC forwards. Preserve complete[-1,0] producer cleanup contracts, structural native handle rows, GetDeviceID=tbs.dll binding and held TBS/AMSI/source-floor residuals. Actual combined canonical image/closure/CI grading remains pending. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 3 +- .../Partitions/Antimalware/settings.rsp | 2 + .../Partitions/FileHistory/settings.rsp | 2 + generation/WinSDK/Partitions/Tbs/settings.rsp | 4 +- .../WinSDK/Partitions/WebSock/settings.rsp | 2 + generation/WinSDK/autoTypes.json | 4 - generation/WinSDK/patches/SdkHeaders.json | 54 +++++- .../post-midl/shared/tbs.annotations.patch | 84 ++++++++ .../post-midl/um/amsi.annotations.patch | 71 +++++++ .../post-midl/um/fhcfg.annotations.patch | 44 +++++ .../post-midl/um/fhsvcctl.annotations.patch | 36 ++++ .../post-midl/um/websocket.annotations.patch | 44 +++++ generation/WinSDK/supportedOS.rsp | 42 ---- .../HeaderAnnotationWinmdTests.cs | 183 +++++++++++++++++- .../WinHttpMigrationTests.cs | 2 +- 15 files changed, 523 insertions(+), 54 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/shared/tbs.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/amsi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/fhcfg.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/fhsvcctl.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/websocket.annotations.patch diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 7bb0d5ef5..04e471f4f 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -246,7 +246,8 @@ Each batch must pass the preceding producer gates before the next is admitted. The image helper reads the recipe's complete owner/dependent partition list and overlays the sources actually produced for those partitions. `Base` and -`FileHistory` also include batch-1 headers; they remain unconverted dependents. +`FileHistory` also include batch-1 headers; at that checkpoint they remained +unconverted dependents. `PsApi2` shares `psapi.h` with `PsApi1` and must remain unchanged. A shared namespace is not evidence of shared semantic ownership. diff --git a/generation/WinSDK/Partitions/Antimalware/settings.rsp b/generation/WinSDK/Partitions/Antimalware/settings.rsp index 0be54014e..fb772cd44 100644 --- a/generation/WinSDK/Partitions/Antimalware/settings.rsp +++ b/generation/WinSDK/Partitions/Antimalware/settings.rsp @@ -2,3 +2,5 @@ /um/amsi.h --namespace Windows.Win32.System.Antimalware +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/FileHistory/settings.rsp b/generation/WinSDK/Partitions/FileHistory/settings.rsp index dab4b0895..def3d12f0 100644 --- a/generation/WinSDK/Partitions/FileHistory/settings.rsp +++ b/generation/WinSDK/Partitions/FileHistory/settings.rsp @@ -5,3 +5,5 @@ /um/fhstatus.h --namespace Windows.Win32.Storage.FileHistory +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/Tbs/settings.rsp b/generation/WinSDK/Partitions/Tbs/settings.rsp index d08fac83b..ed528714f 100644 --- a/generation/WinSDK/Partitions/Tbs/settings.rsp +++ b/generation/WinSDK/Partitions/Tbs/settings.rsp @@ -1,6 +1,6 @@ ---with-librarypath -GetDeviceID=tbs.dll --traverse /shared/tbs.h --namespace Windows.Win32.System.TpmBaseServices +--config +parse-win32-annotations diff --git a/generation/WinSDK/Partitions/WebSock/settings.rsp b/generation/WinSDK/Partitions/WebSock/settings.rsp index 59c189eee..4371b4c4c 100644 --- a/generation/WinSDK/Partitions/WebSock/settings.rsp +++ b/generation/WinSDK/Partitions/WebSock/settings.rsp @@ -2,3 +2,5 @@ /um/websocket.h --namespace Windows.Win32.Networking.WebSocket +--config +parse-win32-annotations diff --git a/generation/WinSDK/autoTypes.json b/generation/WinSDK/autoTypes.json index a1712454e..21e426405 100644 --- a/generation/WinSDK/autoTypes.json +++ b/generation/WinSDK/autoTypes.json @@ -771,8 +771,6 @@ "Namespace": "Windows.Win32.Storage.FileHistory", "Name": "FH_SERVICE_PIPE_HANDLE", "ValueType": "DECLARE_HANDLE", - "CloseApi": "FhServiceClosePipe", - "InvalidHandleValues": [ -1, 0 ], "NativeTypedef": true }, { @@ -990,8 +988,6 @@ "Namespace": "Windows.Win32.Networking.WebSocket", "Name": "WEB_SOCKET_HANDLE", "ValueType": "DECLARE_HANDLE", - "CloseApi": "WebSocketDeleteHandle", - "InvalidHandleValues": [ -1, 0 ], "NativeTypedef": true }, { diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index f68945b18..88e1c9e3a 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -375,6 +375,48 @@ "sourceSha256": "9E9032F6463B611F3BCF049B95A2E8E44793428368887C2C65607975F5EDD132", "sdkPath": "c\\include\\10.0.26100.0\\um\\davclnt.h", "sdkSha256": "9E9032F6463B611F3BCF049B95A2E8E44793428368887C2C65607975F5EDD132" + }, + { + "path": "shared\\tbs.h", + "sourceSha256": "27522D3315474402723D83375BA6CDE07D40AB2B952F36C64B48C153A707C2EA", + "sdkPath": "c\\include\\10.0.26100.0\\shared\\tbs.h", + "sdkSha256": "27522D3315474402723D83375BA6CDE07D40AB2B952F36C64B48C153A707C2EA" + }, + { + "path": "um\\FhCfg.h", + "sourceSha256": "1BE428193494C7C6FFA98EA2DE61748F54351F5741BCA6404F2514D6FF4B2F75", + "sdkPath": "c\\include\\10.0.26100.0\\um\\FhCfg.idl", + "sdkSha256": "EE64E8CCA3D20B51AA58023C2C8561000A722B3A0CD39786ABF5835584B4DF3C" + }, + { + "path": "um\\FhSvcCtl.h", + "sourceSha256": "7E0C895E8FC27B22646D01E6D8D73F8989682F592B872C5A74A0D0D3EED9BF59", + "sdkPath": "c\\include\\10.0.26100.0\\um\\FhSvcCtl.h", + "sdkSha256": "7E0C895E8FC27B22646D01E6D8D73F8989682F592B872C5A74A0D0D3EED9BF59" + }, + { + "path": "um\\fherrors.h", + "sourceSha256": "A4A1E4ED07785A0568C8A08EB37900AFDE1DC2F14FD76FED7E6F42D9E56A475B", + "sdkPath": "c\\include\\10.0.26100.0\\um\\fherrors.h", + "sdkSha256": "A4A1E4ED07785A0568C8A08EB37900AFDE1DC2F14FD76FED7E6F42D9E56A475B" + }, + { + "path": "um\\fhstatus.h", + "sourceSha256": "83AD5BD5559360FCFC816F4D7740EC7801779F39DE3690845D760E6CD014779F", + "sdkPath": "c\\include\\10.0.26100.0\\um\\fhstatus.h", + "sdkSha256": "83AD5BD5559360FCFC816F4D7740EC7801779F39DE3690845D760E6CD014779F" + }, + { + "path": "um\\amsi.h", + "sourceSha256": "9B3F9C3AE71FDEB1EC2A948EE98EABD74C3D9FCC355A754881D89A3C53C838CE", + "sdkPath": "c\\include\\10.0.26100.0\\um\\amsi.idl", + "sdkSha256": "17D39F2A78E7D3DCF0E10AC146F11070BFE9374004199F424E194568C7B62EAC" + }, + { + "path": "um\\websocket.h", + "sourceSha256": "7F7EE5D2FDBE9623A0D10DA5E49986485820684BACE387184BA30F1836FDB114", + "sdkPath": "c\\include\\10.0.26100.0\\um\\websocket.h", + "sdkSha256": "7F7EE5D2FDBE9623A0D10DA5E49986485820684BACE387184BA30F1836FDB114" } ], "partitions": [ @@ -424,7 +466,10 @@ "Wcn", "Cabinets", "MdmReg", - "WebDav" + "WebDav", + "Tbs", + "Antimalware", + "WebSock" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -477,6 +522,11 @@ "post-midl\\um\\wcndevice.annotations.patch", "post-midl\\um\\fdi.annotations.patch", "post-midl\\um\\mdmregistration.annotations.patch", - "post-midl\\um\\davclnt.annotations.patch" + "post-midl\\um\\davclnt.annotations.patch", + "post-midl\\shared\\tbs.annotations.patch", + "post-midl\\um\\fhcfg.annotations.patch", + "post-midl\\um\\fhsvcctl.annotations.patch", + "post-midl\\um\\amsi.annotations.patch", + "post-midl\\um\\websocket.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/shared/tbs.annotations.patch b/generation/WinSDK/patches/post-midl/shared/tbs.annotations.patch new file mode 100644 index 000000000..78e4fd975 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/shared/tbs.annotations.patch @@ -0,0 +1,84 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/shared/tbs.h b/generation/WinSDK/RecompiledIdlHeaders/shared/tbs.h +index c6e1f5d9..be1cc302 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/shared/tbs.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/shared/tbs.h +@@ -18,6 +18,7 @@ Contents: Definitions and prototypes for the TBS (TPM Base Services) for + #pragma once + #endif + #include ++#include + + #pragma region Desktop Family or SecureStartup Package + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PKG_SECURESTARTUP) +@@ -94,6 +95,7 @@ typedef struct tdTBS_CONTEXT_PARAMS + } TBS_CONTEXT_PARAMS, *PTBS_CONTEXT_PARAMS; + typedef const TBS_CONTEXT_PARAMS *PCTBS_CONTEXT_PARAMS; + ++_Win32_SupportedOS_WindowsVista_ + TBS_RESULT WINAPI + Tbsi_Context_Create( + _In_ PCTBS_CONTEXT_PARAMS pContextParams, +@@ -104,10 +106,12 @@ Tbsi_Tpm_Vendor_Maintenance_Mode( + _In_ PCTBS_CONTEXT_PARAMS pContextParams, + _Out_ PTBS_HCONTEXT phContext); + ++_Win32_SupportedOS_WindowsVista_ + TBS_RESULT WINAPI + Tbsip_Context_Close( + _In_ TBS_HCONTEXT hContext); + ++_Win32_SupportedOS_WindowsVista_ + TBS_RESULT WINAPI + Tbsip_Submit_Command( + _In_ TBS_HCONTEXT hContext, +@@ -118,10 +122,12 @@ Tbsip_Submit_Command( + _Out_writes_bytes_(*pcbResult) PBYTE pabResult, + _Inout_ PUINT32 pcbResult); + ++_Win32_SupportedOS_WindowsVista_ + TBS_RESULT WINAPI + Tbsip_Cancel_Commands( + _In_ TBS_HCONTEXT hContext); + ++_Win32_SupportedOS_WindowsVista_ + TBS_RESULT WINAPI + Tbsi_Physical_Presence_Command( + _In_ TBS_HCONTEXT hContext, +@@ -213,11 +219,13 @@ typedef struct _TPM_DEVICE_INFO + typedef const TPM_DEVICE_INFO *PCTPM_DEVICE_INFO; + #endif //TPM_VERSION_UNKNOWN + ++_Win32_SupportedOS_Windows8_ + TBS_RESULT WINAPI + Tbsi_GetDeviceInfo( + _In_ UINT32 Size, + _Out_writes_bytes_(Size) PVOID Info); + ++_Win32_SupportedOS_Windows8_ + _Success_(return == TBS_SUCCESS) + TBS_RESULT WINAPI + Tbsi_Get_OwnerAuth( +@@ -226,6 +234,7 @@ Tbsi_Get_OwnerAuth( + _Out_writes_bytes_to_opt_(*pOutputBufLen, *pOutputBufLen) PBYTE pOutputBuf, + _Inout_ PUINT32 pOutputBufLen); + ++_Win32_SupportedOS_Windows8_ + TBS_RESULT WINAPI + Tbsi_Revoke_Attestation(); + +@@ -237,6 +246,7 @@ Tbsi_Revoke_Attestation(); + + // These functions are not available in kernel mode + ++_Win32_ImportLibrary_("tbs.dll") + HRESULT + GetDeviceID( + _Out_writes_bytes_to_opt_(cbWindowsAIK, *pcbResult) PBYTE pbWindowsAIK, +@@ -282,6 +292,7 @@ Tbsi_Create_Windows_Key( + #define TBS_TCGLOG_DRTM_RESUME 5 + // (User mode only) Returns the DRTM log associated with the current resume from hibernation + ++_Win32_SupportedOS_17134_ + _Success_(return == TBS_SUCCESS) + TBS_RESULT WINAPI + Tbsi_Get_TCG_Log_Ex( diff --git a/generation/WinSDK/patches/post-midl/um/amsi.annotations.patch b/generation/WinSDK/patches/post-midl/um/amsi.annotations.patch new file mode 100644 index 000000000..78810e285 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/amsi.annotations.patch @@ -0,0 +1,71 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/amsi.h b/generation/WinSDK/RecompiledIdlHeaders/um/amsi.h +index 8a8d37b3..5016e7ed 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/amsi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/amsi.h +@@ -102,6 +102,7 @@ extern "C"{ + /* [local] */ + + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -255,6 +256,7 @@ EXTERN_C const IID IID_IAmsiStream; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3e47f2e5-81d4-4d3b-897f-545096770373") ++ _Win32_SupportedOS_10240_ + IAmsiStream : public IUnknown + { + public: +@@ -375,6 +377,7 @@ EXTERN_C const IID IID_IAntimalwareProvider; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("b2cabfe3-fe04-42b1-a5df-08d483d4d125") ++ _Win32_SupportedOS_10240_ + IAntimalwareProvider : public IUnknown + { + public: +@@ -729,6 +732,7 @@ EXTERN_C const IID IID_IAntimalware; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("82d29c2e-f062-44e6-b5c9-3d9a2f24a2df") ++ _Win32_SupportedOS_10240_ + IAntimalware : public IUnknown + { + public: +@@ -962,21 +966,26 @@ EXTERN_C const CLSID CLSID_Antimalware; + DECLARE_HANDLE(HAMSICONTEXT); + DECLARE_HANDLE(HAMSISESSION); + ++_Win32_SupportedOS_10240_ + STDAPI AmsiInitialize( + _In_ LPCWSTR appName, + _Outptr_ HAMSICONTEXT* amsiContext); + ++_Win32_SupportedOS_10240_ + STDAPI_(VOID) AmsiUninitialize( + _In_ HAMSICONTEXT amsiContext); + ++_Win32_SupportedOS_10240_ + STDAPI AmsiOpenSession( + _In_ HAMSICONTEXT amsiContext, + _Out_ HAMSISESSION* amsiSession); + ++_Win32_SupportedOS_10240_ + STDAPI_(VOID) AmsiCloseSession( + _In_ HAMSICONTEXT amsiContext, + _In_ HAMSISESSION amsiSession); + ++_Win32_SupportedOS_10240_ + STDAPI AmsiScanBuffer( + _In_ HAMSICONTEXT amsiContext, + _In_reads_bytes_(length) PVOID buffer, +@@ -992,6 +1001,7 @@ STDAPI AmsiNotifyOperation( + _In_opt_ LPCWSTR contentName, + _Out_ AMSI_RESULT* result); + ++_Win32_SupportedOS_10240_ + STDAPI AmsiScanString( + _In_ HAMSICONTEXT amsiContext, + _In_ LPCWSTR string, diff --git a/generation/WinSDK/patches/post-midl/um/fhcfg.annotations.patch b/generation/WinSDK/patches/post-midl/um/fhcfg.annotations.patch new file mode 100644 index 000000000..928a4818d --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/fhcfg.annotations.patch @@ -0,0 +1,44 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/FhCfg.h b/generation/WinSDK/RecompiledIdlHeaders/um/FhCfg.h +index 86e8285d..7cf967f7 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/FhCfg.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/FhCfg.h +@@ -119,6 +119,7 @@ extern "C"{ + /* */ + /*******************************************************************************/ + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #if NTDDI_VERSION >= NTDDI_WIN8 +@@ -160,6 +161,7 @@ EXTERN_C const IID IID_IFhTarget; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D87965FD-2BAD-4657-BD3B-9567EB300CED") ++ _Win32_SupportedOS_Windows8_ + IFhTarget : public IUnknown + { + public: +@@ -277,6 +279,7 @@ EXTERN_C const IID IID_IFhScopeIterator; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3197ABCE-532A-44C6-8615-F3666566A720") ++ _Win32_SupportedOS_Windows8_ + IFhScopeIterator : public IUnknown + { + public: +@@ -437,6 +440,7 @@ EXTERN_C const IID IID_IFhConfigMgr; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6A5FEA5B-BF8F-4EE5-B8C3-44D8A0D7331C") ++ _Win32_SupportedOS_Windows8_ + IFhConfigMgr : public IUnknown + { + public: +@@ -730,6 +734,7 @@ EXTERN_C const IID IID_IFhReassociation; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6544A28A-F68D-47ac-91EF-16B2B36AA3EE") ++ _Win32_SupportedOS_Windows8_ + IFhReassociation : public IUnknown + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/fhsvcctl.annotations.patch b/generation/WinSDK/patches/post-midl/um/fhsvcctl.annotations.patch new file mode 100644 index 000000000..46805ba23 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/fhsvcctl.annotations.patch @@ -0,0 +1,36 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/FhSvcCtl.h b/generation/WinSDK/RecompiledIdlHeaders/um/FhSvcCtl.h +index 9c81aab7..14f6a5f5 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/FhSvcCtl.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/FhSvcCtl.h +@@ -26,6 +26,7 @@ Environment: + #endif + + #include ++#include + + #ifdef __cplusplus + extern "C" { +@@ -49,12 +50,14 @@ typedef enum { + + DECLARE_HANDLE (FH_SERVICE_PIPE_HANDLE); + ++_Win32_SupportedOS_BEGIN_(Windows8) ++ + __declspec(deprecated("FhServiceOpenPipe is deprecated and might not work on all platforms. For more info, see MSDN.")) + HRESULT + WINAPI + FhServiceOpenPipe( + _In_ BOOL StartServiceIfStopped, +- _Out_ FH_SERVICE_PIPE_HANDLE *Pipe ++ _Out_ _Win32_RAIIFree_(FhServiceClosePipe, -1, 0) FH_SERVICE_PIPE_HANDLE *Pipe + ); + + __declspec(deprecated("FhServiceClosePipe is deprecated and might not work on all platforms. For more info, see MSDN.")) +@@ -101,6 +104,7 @@ FhServiceUnblockBackup( + _In_ FH_SERVICE_PIPE_HANDLE Pipe + ); + ++_Win32_SupportedOS_END_() + + #endif // NTDDI_VERSION >= NTDDI_WIN8 + diff --git a/generation/WinSDK/patches/post-midl/um/websocket.annotations.patch b/generation/WinSDK/patches/post-midl/um/websocket.annotations.patch new file mode 100644 index 000000000..e2544458f --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/websocket.annotations.patch @@ -0,0 +1,44 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/websocket.h b/generation/WinSDK/RecompiledIdlHeaders/um/websocket.h +index eaf19371..19f5ba10 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/websocket.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/websocket.h +@@ -25,6 +25,7 @@ extern "C" + #endif + + #include ++#include + + #pragma region Desktop Family or OneCore Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) +@@ -120,10 +121,12 @@ typedef union _WEB_SOCKET_BUFFER + } CloseStatus; + } WEB_SOCKET_BUFFER, *PWEB_SOCKET_BUFFER; + ++_Win32_SupportedOS_BEGIN_(Windows8) ++ + HRESULT WINAPI WebSocketCreateClientHandle( + _In_reads_(ulPropertyCount) const PWEB_SOCKET_PROPERTY pProperties, + _In_ ULONG ulPropertyCount, +- _Out_ WEB_SOCKET_HANDLE *phWebSocket); ++ _Out_ _Win32_RAIIFree_(WebSocketDeleteHandle, -1, 0) WEB_SOCKET_HANDLE *phWebSocket); + + HRESULT WINAPI WebSocketBeginClientHandshake( + _In_ WEB_SOCKET_HANDLE hWebSocket, +@@ -147,7 +150,7 @@ HRESULT WINAPI WebSocketEndClientHandshake( + HRESULT WINAPI WebSocketCreateServerHandle( + _In_reads_(ulPropertyCount) const PWEB_SOCKET_PROPERTY pProperties, + _In_ ULONG ulPropertyCount, +- _Out_ WEB_SOCKET_HANDLE *phWebSocket); ++ _Out_ _Win32_RAIIFree_(WebSocketDeleteHandle, -1, 0) WEB_SOCKET_HANDLE *phWebSocket); + + HRESULT WINAPI WebSocketBeginServerHandshake( + _In_ WEB_SOCKET_HANDLE hWebSocket, +@@ -199,6 +202,8 @@ HRESULT WINAPI WebSocketGetGlobalProperty( + _Inout_updates_to_(*ulSize, *ulSize) PVOID pvValue, + _Inout_ ULONG* ulSize); + ++_Win32_SupportedOS_END_() ++ + #endif //NTDDI_VERSION >= NTDDI_WIN8 + + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */ diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 9edb6a5eb..215161b87 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -94,16 +94,7 @@ RegInstallA=SupportedOSPlatform("windows10.0.10240") RegInstallW=SupportedOSPlatform("windows10.0.10240") IAMDirectSound=SupportedOSPlatform("windows5.0") IAMParse=SupportedOSPlatform("windows5.1.2600") -AmsiCloseSession=SupportedOSPlatform("windows10.0.10240") -AmsiInitialize=SupportedOSPlatform("windows10.0.10240") -AmsiOpenSession=SupportedOSPlatform("windows10.0.10240") AmsiResultIsMalware=SupportedOSPlatform("windows10.0.10240") -AmsiScanBuffer=SupportedOSPlatform("windows10.0.10240") -AmsiScanString=SupportedOSPlatform("windows10.0.10240") -AmsiUninitialize=SupportedOSPlatform("windows10.0.10240") -IAmsiStream=SupportedOSPlatform("windows10.0.10240") -IAntimalware=SupportedOSPlatform("windows10.0.10240") -IAntimalwareProvider=SupportedOSPlatform("windows10.0.10240") IDirectDrawMediaSample=SupportedOSPlatform("windows5.0") IDirectDrawMediaSampleAllocator=SupportedOSPlatform("windows5.0") IDirectDrawVideo=SupportedOSPlatform("windows5.0") @@ -2934,17 +2925,6 @@ FaxRouteDeviceEnable=SupportedOSPlatform("windows5.0") FaxRouteGetRoutingInfo=SupportedOSPlatform("windows5.0") FaxRouteInitialize=SupportedOSPlatform("windows5.0") FaxRouteSetRoutingInfo=SupportedOSPlatform("windows5.0") -IFhConfigMgr=SupportedOSPlatform("windows8.0") -IFhReassociation=SupportedOSPlatform("windows8.0") -IFhScopeIterator=SupportedOSPlatform("windows8.0") -IFhTarget=SupportedOSPlatform("windows8.0") -FhServiceBlockBackup=SupportedOSPlatform("windows8.0") -FhServiceClosePipe=SupportedOSPlatform("windows8.0") -FhServiceOpenPipe=SupportedOSPlatform("windows8.0") -FhServiceReloadConfiguration=SupportedOSPlatform("windows8.0") -FhServiceStartBackup=SupportedOSPlatform("windows8.0") -FhServiceStopBackup=SupportedOSPlatform("windows8.0") -FhServiceUnblockBackup=SupportedOSPlatform("windows8.0") FlsAlloc=SupportedOSPlatform("windows6.0.6000") FlsFree=SupportedOSPlatform("windows6.0.6000") FlsGetValue=SupportedOSPlatform("windows6.0.6000") @@ -10700,16 +10680,7 @@ ITimeTrigger=SupportedOSPlatform("windows6.0.6000") ITrigger=SupportedOSPlatform("windows6.0.6000") ITriggerCollection=SupportedOSPlatform("windows6.0.6000") IWeeklyTrigger=SupportedOSPlatform("windows6.0.6000") -Tbsi_Context_Create=SupportedOSPlatform("windows6.0.6000") -Tbsi_Get_OwnerAuth=SupportedOSPlatform("windows8.0") -Tbsi_Get_TCG_Log_Ex=SupportedOSPlatform("windows10.0.17134") Tbsi_Get_TCG_Log=SupportedOSPlatform("windows6.0.6000") -Tbsi_GetDeviceInfo=SupportedOSPlatform("windows8.0") -Tbsi_Physical_Presence_Command=SupportedOSPlatform("windows6.0.6000") -Tbsi_Revoke_Attestation=SupportedOSPlatform("windows8.0") -Tbsip_Cancel_Commands=SupportedOSPlatform("windows6.0.6000") -Tbsip_Context_Close=SupportedOSPlatform("windows6.0.6000") -Tbsip_Submit_Command=SupportedOSPlatform("windows6.0.6000") TdhAggregatePayloadFilters=SupportedOSPlatform("windows8.1") TdhCleanupPayloadEventFilterDescriptor=SupportedOSPlatform("windows8.1") TdhCloseDecodingHandle=SupportedOSPlatform("windows8.0") @@ -12276,19 +12247,6 @@ WsWriteXmlBuffer=SupportedOSPlatform("windows6.1") WsWriteXmlBufferToBytes=SupportedOSPlatform("windows6.1") WsWriteXmlnsAttribute=SupportedOSPlatform("windows6.1") WsXmlStringEquals=SupportedOSPlatform("windows6.1") -WebSocketAbortHandle=SupportedOSPlatform("windows8.0") -WebSocketBeginClientHandshake=SupportedOSPlatform("windows8.0") -WebSocketBeginServerHandshake=SupportedOSPlatform("windows8.0") -WebSocketCompleteAction=SupportedOSPlatform("windows8.0") -WebSocketCreateClientHandle=SupportedOSPlatform("windows8.0") -WebSocketCreateServerHandle=SupportedOSPlatform("windows8.0") -WebSocketDeleteHandle=SupportedOSPlatform("windows8.0") -WebSocketEndClientHandshake=SupportedOSPlatform("windows8.0") -WebSocketEndServerHandshake=SupportedOSPlatform("windows8.0") -WebSocketGetAction=SupportedOSPlatform("windows8.0") -WebSocketGetGlobalProperty=SupportedOSPlatform("windows8.0") -WebSocketReceive=SupportedOSPlatform("windows8.0") -WebSocketSend=SupportedOSPlatform("windows8.0") LPSAFEARRAY_UserFree64=SupportedOSPlatform("windows5.1.2600") LPSAFEARRAY_UserMarshal64=SupportedOSPlatform("windows5.1.2600") LPSAFEARRAY_UserSize64=SupportedOSPlatform("windows5.1.2600") diff --git a/tests/Win32MetadataScraperTests/HeaderAnnotationWinmdTests.cs b/tests/Win32MetadataScraperTests/HeaderAnnotationWinmdTests.cs index 821ec2184..6dbb1046c 100644 --- a/tests/Win32MetadataScraperTests/HeaderAnnotationWinmdTests.cs +++ b/tests/Win32MetadataScraperTests/HeaderAnnotationWinmdTests.cs @@ -726,12 +726,182 @@ void Walk(Cursor cursor) private static MetadataImage Emit(HeaderAnnotationTests.NativeFixture fixture, string architecture) => Emit(fixture.DirectoryPath, architecture); - internal static MetadataImage Emit(string directory, string architecture, HashSet reducePointerLevels = null, bool nativeFieldArrayInfo = false) + [ServiceApiMigrationTheory] + [InlineData("x86")] + [InlineData("x64")] + [InlineData("arm64")] + public void ServiceApiHeaderMigrationMatchesBoundedComponent(string architecture) + { + string artifacts = Environment.GetEnvironmentVariable("SERVICE_API_MIGRATION_ARTIFACTS"); + string[] owners = { "Tbs", "FileHistory", "Antimalware", "WebSock" }; + foreach (string owner in owners) + Assert.Contains("parse-win32-annotations", File.ReadAllText(Path.Combine( + WinHttpMigrationTests.RepositoryRoot, "generation", "WinSDK", "Partitions", owner, "settings.rsp"))); + string constants = Path.Combine(artifacts, "constants"); + var remaps = File.ReadLines(Path.Combine(constants, "enumsRemap.rsp")) + .Where(line => line.Contains('=')).Select(line => line.Split('=', 2)) + .ToDictionary(pair => pair[0], pair => pair[1]); + var namespaces = new HashSet(new[] + { + "Windows.Win32.Foundation", "Windows.Win32.Foundation.Metadata", + "Windows.Win32.System.Com", + "Windows.Win32.System.TpmBaseServices", "Windows.Win32.Storage.FileHistory", + "Windows.Win32.System.Antimalware", "Windows.Win32.Networking.WebSocket", + }); + var dependencies = new Dictionary(); + foreach (var item in new[] { (File: "Foundation", Type: "FILETIME"), (File: "Com", Type: "IUnknown") }) + { + var dependency = CSharpSyntaxTree.ParseText(File.ReadAllText( + Path.Combine(artifacts, "dependencies", item.File + ".cs"))).GetCompilationUnitRoot(); + var type = dependency.DescendantNodes().OfType() + .Single(value => value.Identifier.ValueText == item.Type); + var ns = type.Ancestors().OfType().Single() + .WithMembers(SyntaxFactory.SingletonList(type)); + dependencies.Add(item.File, dependency.WithMembers(SyntaxFactory.SingletonList(ns))); + } + var movements = new[] + { + (Type: "FH_SERVICE_PIPE_HANDLE", Owner: "FileHistory", Method: "FhServiceOpenPipe", Parameter: "Pipe"), + (Type: "WEB_SOCKET_HANDLE", Owner: "WebSock", Method: "WebSocketCreateClientHandle", Parameter: "phWebSocket"), + (Type: "WEB_SOCKET_HANDLE", Owner: "WebSock", Method: "WebSocketCreateServerHandle", Parameter: "phWebSocket"), + }; + string directory = Path.Combine(artifacts, "components", architecture); + foreach (string state in new[] { "original", "parser-control", "migrated", "expected" }) + { + string output = Path.Combine(directory, state); + string sources = Path.Combine(output, architecture); + Directory.CreateDirectory(sources); + File.Delete(Path.Combine(output, "Metadata.manual.cs")); + string aliases = Path.Combine(sources, "autotypes.cs"); + File.Delete(aliases); + foreach (string owner in owners) + { + var source = CSharpSyntaxTree.ParseText(File.ReadAllText(Path.Combine(artifacts, + state == "expected" ? "parser-control" : state, architecture, owner + ".cs"))).GetCompilationUnitRoot(); + source = source.WithUsings(SyntaxFactory.List(source.Usings.Where(value => + !value.Name.ToString().StartsWith("Windows.Win32.", StringComparison.Ordinal) + || namespaces.Contains(value.Name.ToString())))); + File.WriteAllText(Path.Combine(sources, owner + ".cs"), source.ToFullString()); + } + foreach (var dependency in dependencies) + File.WriteAllText(Path.Combine(output, dependency.Key + ".dependency.cs"), dependency.Value.ToFullString()); + foreach (string path in Directory.GetFiles(constants, "*.cs")) + File.Copy(path, Path.Combine(output, Path.GetFileName(path)), overwrite: true); + var autoTypes = AutoTypeHelpers.GetAutoTypesFromFiles(new[] + { + Path.Combine(artifacts, state == "migrated" ? "current-owned-autoTypes.json" : "original-owned-autoTypes.json"), + }).ToArray(); + var names = MetadataUtils.ScraperUtils.GetNameToNamespaceMap(output, + MetadataUtils.ScraperUtils.NameOptions.Methods | MetadataUtils.ScraperUtils.NameOptions.Structs); + using (var stream = File.Create(aliases)) + NativeTypedefStructsCreator.WriteToStream(names, autoTypes, stream); + if (state != "expected") + continue; + + var aliasesSource = CSharpSyntaxTree.ParseText(File.ReadAllText(aliases)).GetCompilationUnitRoot(); + var lifecycle = new Dictionary>(); + var types = aliasesSource.DescendantNodes().OfType() + .Where(type => movements.Any(value => value.Type == type.Identifier.ValueText)).ToArray(); + aliasesSource = aliasesSource.ReplaceNodes(types, (original, rewritten) => + { + bool IsLifecycle(AttributeListSyntax list) => list.Attributes.All(attribute => + attribute.Name.ToString() is "RAIIFree" or "InvalidHandleValue"); + lifecycle.Add(original.Identifier.ValueText, + SyntaxFactory.List(original.AttributeLists.Where(IsLifecycle))); + return rewritten.WithAttributeLists( + SyntaxFactory.List(rewritten.AttributeLists.Where(list => !IsLifecycle(list)))); + }); + File.WriteAllText(aliases, aliasesSource.ToFullString()); + foreach (var movement in movements) + { + string path = Path.Combine(sources, movement.Owner + ".cs"); + var source = CSharpSyntaxTree.ParseText(File.ReadAllText(path)).GetCompilationUnitRoot(); + var method = source.DescendantNodes().OfType() + .Single(value => value.Identifier.ValueText == movement.Method); + var parameter = method.ParameterList.Parameters.Single(value => value.Identifier.ValueText == movement.Parameter); + Assert.DoesNotContain(parameter.AttributeLists.SelectMany(list => list.Attributes), + attribute => attribute.Name.ToString() is "RAIIFree" or "InvalidHandleValue"); + source = source.ReplaceNode(parameter, parameter.AddAttributeLists(lifecycle[movement.Type].ToArray())); + File.WriteAllText(path, source.ToFullString()); + } + } + + using var original = Emit(Path.Combine(directory, "original"), architecture, memberRemaps: remaps); + using var control = Emit(Path.Combine(directory, "parser-control"), architecture, memberRemaps: remaps); + using var current = Emit(Path.Combine(directory, "migrated"), architecture, memberRemaps: remaps); + using var expected = Emit(Path.Combine(directory, "expected"), architecture, memberRemaps: remaps); + foreach (var image in new[] { original, control, current, expected }) + AssertMetadataClosure(image.Reader); + Assert.Equal(Snapshot(original.Reader), Snapshot(control.Reader)); + Assert.Equal(Snapshot(expected.Reader), Snapshot(current.Reader)); + foreach (var movement in movements) + { + var oldType = FindType(control.Reader, movement.Type); + Assert.Equal(new long[] { -1, 0 }, ReadInvalidValues(control.Reader, oldType.GetCustomAttributes()).OrderBy(value => value)); + string cleanup = ReadStringAttribute(control.Reader, oldType.GetCustomAttributes(), "RAIIFreeAttribute"); + var newType = FindType(current.Reader, movement.Type); + AssertDoesNotHaveAttribute(current.Reader, newType.GetCustomAttributes(), "RAIIFreeAttribute"); + AssertDoesNotHaveAttribute(current.Reader, newType.GetCustomAttributes(), "InvalidHandleValueAttribute"); + var method = current.Reader.MethodDefinitions.Select(current.Reader.GetMethodDefinition) + .Single(value => current.Reader.GetString(value.Name) == movement.Method); + var parameter = method.GetParameters().Select(current.Reader.GetParameter) + .Single(value => current.Reader.GetString(value.Name) == movement.Parameter); + Assert.True(parameter.Attributes.HasFlag(ParameterAttributes.Out)); + AssertStringAttribute(current.Reader, parameter.GetCustomAttributes(), "RAIIFreeAttribute", cleanup); + Assert.Equal(new long[] { -1, 0 }, ReadInvalidValues(current.Reader, parameter.GetCustomAttributes()).OrderBy(value => value)); + } + foreach (string name in new[] { "HAMSICONTEXT", "HAMSISESSION" }) + Assert.Equal(new long[] { -1, 0 }, ReadInvalidValues(current.Reader, FindType(current.Reader, name).GetCustomAttributes()).OrderBy(value => value)); + var getDeviceId = current.Reader.MethodDefinitions.Select(current.Reader.GetMethodDefinition) + .Single(method => current.Reader.GetString(method.Name) == "GetDeviceID").GetImport(); + Assert.Equal("tbs.dll", current.Reader.GetString(current.Reader.GetModuleReference(getDeviceId.Module).Name)); + Assert.DoesNotContain(current.Reader.MethodDefinitions.Select(current.Reader.GetMethodDefinition), + method => current.Reader.GetString(method.Name) == "AmsiResultIsMalware"); + string[] sharedRpc = { "BSTR_UserSize64", "BSTR_UserMarshal64", "BSTR_UserUnmarshal64", "BSTR_UserFree64" }; + foreach (string name in sharedRpc) + { + var method = current.Reader.MethodDefinitions.Select(current.Reader.GetMethodDefinition) + .Single(value => current.Reader.GetString(value.Name) == name); + AssertStringAttribute(current.Reader, method.GetCustomAttributes(), + "SupportedOSPlatformAttribute", "windows5.1.2600"); + } + Assert.Equal(43 + sharedRpc.Length, current.Reader.CustomAttributes.Count(handle => + AttributeName(current.Reader, handle) == "SupportedOSPlatformAttribute")); + foreach (var item in new[] + { + (Name: "TBS_COMMAND_PRIORITY", Members: new[] { "LOW", "NORMAL", "SYSTEM", "HIGH", "MAX" }, + Values: new uint[] { 100, 200, 400, 300, 0x80000000 }), + (Name: "TBS_COMMAND_LOCALITY", Members: new[] { "ZERO", "ONE", "TWO", "THREE", "FOUR" }, + Values: new uint[] { 0, 1, 2, 3, 4 }), + }) + { + var type = FindType(current.Reader, item.Name); + AssertDoesNotHaveAttribute(current.Reader, type.GetCustomAttributes(), "FlagsAttribute"); + AssertDoesNotHaveAttribute(current.Reader, type.GetCustomAttributes(), "ScopedEnumAttribute"); + var fields = type.GetFields().Select(current.Reader.GetFieldDefinition).ToArray(); + Assert.Equal("value__", current.Reader.GetString(fields[0].Name)); + Assert.Equal("UInt32", fields[0].DecodeSignature(new SignatureNames(), null)); + Assert.Equal(item.Members.Select(name => item.Name + "_" + name), + fields.Skip(1).Select(field => current.Reader.GetString(field.Name))); + Assert.Equal(item.Values, fields.Skip(1).Select(field => + { + var constant = current.Reader.GetConstant(field.GetDefaultValue()); + Assert.Equal(ConstantTypeCode.UInt32, constant.TypeCode); + return current.Reader.GetBlobReader(constant.Value).ReadUInt32(); + })); + } + + static string[] Snapshot(MetadataReader reader) => reader.TypeDefinitions.Select(reader.GetTypeDefinition) + .Select(type => WinHttpMigrationTests.SnapshotType(reader, type)).OrderBy(value => value, StringComparer.Ordinal).ToArray(); + } + + internal static MetadataImage Emit(string directory, string architecture, HashSet reducePointerLevels = null, + bool nativeFieldArrayInfo = false, Dictionary memberRemaps = null) { File.Copy(Path.Combine(AppContext.BaseDirectory, "assets", "Metadata.cs"), Path.Combine(directory, "Metadata.manual.cs")); var compilation = ClangSharpSourceCompilation.Create(directory, architecture, - new Dictionary(), new Dictionary>(), Array.Empty(), + memberRemaps ?? new Dictionary(), new Dictionary>(), Array.Empty(), new Dictionary(), new Dictionary(), new HashSet(), Array.Empty(), new Dictionary(), new Dictionary(), nativeFieldArrayInfo); Assert.Empty(compilation.GetDiagnostics().Where(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error)); @@ -880,4 +1050,13 @@ private string GetTypeName(MetadataReader reader, StringHandle @namespace, Strin => this.qualifiedNames ? reader.GetString(@namespace) + "." + reader.GetString(name) : reader.GetString(name); } } + + public sealed class ServiceApiMigrationTheoryAttribute : TheoryAttribute + { + public ServiceApiMigrationTheoryAttribute() + { + if (Environment.GetEnvironmentVariable("SERVICE_API_MIGRATION_ARTIFACTS") == null) + Skip = "Set SERVICE_API_MIGRATION_ARTIFACTS to the bounded actual-header migration sources."; + } + } } diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index 712c7f96a..4119ff18a 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -944,7 +944,7 @@ public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() "NetBios", "Wnet", "Dhcp", "NetShell" }) Assert.Contains("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); Assert.DoesNotContain("--with-librarypath", File.ReadAllText(Path.Combine(project, "Partitions", "Wsl", "settings.rsp"))); - foreach (string partition in new[] { "Base", "FileHistory", "PsApi2", "HttpServer", + foreach (string partition in new[] { "Base", "PsApi2", "HttpServer", "ComOle", "WindowsConnectionManager", "TransactionServer", "Enstor" }) Assert.DoesNotContain("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); } From 2595e01ad0b8bf81d02b91123717cbbe47121db4 Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:49:16 -0700 Subject: [PATCH 13/17] Integrate exact RstMgr enum and scoped OS source contracts Surgically apply the frozen eight-file candidate above qualified c587/43af and serial Network/Device/System/Small/Service inputs: eleven WIN32_ERROR return associations, native ULONG AppStatus association and one Vista scope for exactly eleven functions. Preserve native RM_APP_STATUS identity/nine members/nonflags and the held sizeof-derived CCH_RM_SESSION_KEY row. Existing source/mutation runner executed197 passes; its one optional Service component fixture was not executed and remains a separate central gate. Architecture and actual image/closure/CI grading are still pending. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 16 +++ .../WinSDK/Partitions/RstMgr/settings.rsp | 2 + generation/WinSDK/emitter.settings.rsp | 12 -- generation/WinSDK/patches/SdkHeaders.json | 12 +- .../um/restartmanager.annotations.patch | 118 ++++++++++++++++++ generation/WinSDK/supportedOS.rsp | 11 -- .../WinHttpMigrationTests.cs | 73 ++++++++++- .../WinHttpNativeControlTests.cs | 13 ++ 8 files changed, 231 insertions(+), 26 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/um/restartmanager.annotations.patch diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 04e471f4f..149ddd9fb 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -166,6 +166,22 @@ Use the existing selected scrape/full-source overlay loop where appropriate. closure. Recompute complete constants and pointer discoveries, retaining unselected inputs. Reject success-shaped partial images with dangling references. +For expanded integration, an emitted overlay image is not proof that every +physical dependent was freshly scraped. `Windows.h` unconditionally includes +`winnetwk.h`; at least 308 direct Windows-header-dependent partitions require +fresh source closure in the actual full-SDK producer run. They are physical +dependents, not additional semantic owner migrations. + +RstMgr relocates eleven existing `WIN32_ERROR` return substitutions to native +`DWORD` returns with exact enum associations, and the existing +`RM_PROCESS_INFO.AppStatus` association stays on native `ULONG` storage. The +native `RM_APP_STATUS` enum, its nine members and non-Flags representation stay +unchanged. One bounded Vista scope covers exactly the eleven owned functions, +replacing eleven matching OS sidecar rows. Correct SDK library bindings remain +derived. `CCH_RM_SESSION_KEY` remains a separately held native-expression parser +gap; no native macro or manual constant shape is changed. This source integration +does not constitute actual architecture/image/full-SDK/CI acceptance. + ## 5. Validate the actual output, not a proxy - Compile metadata-disabled native owner/dependent translation units on x86, diff --git a/generation/WinSDK/Partitions/RstMgr/settings.rsp b/generation/WinSDK/Partitions/RstMgr/settings.rsp index 36cb0d4ba..9bd82f2db 100644 --- a/generation/WinSDK/Partitions/RstMgr/settings.rsp +++ b/generation/WinSDK/Partitions/RstMgr/settings.rsp @@ -2,3 +2,5 @@ /um/RestartManager.h --namespace Windows.Win32.System.RestartManager +--config +parse-win32-annotations diff --git a/generation/WinSDK/emitter.settings.rsp b/generation/WinSDK/emitter.settings.rsp index 7d1aba7e4..7f66c6766 100644 --- a/generation/WinSDK/emitter.settings.rsp +++ b/generation/WinSDK/emitter.settings.rsp @@ -1651,18 +1651,6 @@ WTSVirtualChannelOpenEx::return=[RAIIFree("WTSVirtualChannelClose")] CLRCreateInstance::ppInterface=[Out][ComOutPtr] CfReleaseTransferKey::TransferKey=[-Out][In] STATEMGRSTATUS::nStatus=WIN32_ERROR -RM_PROCESS_INFO::AppStatus=[AssociatedEnum("RM_APP_STATUS")] -RmAddFilter::return=WIN32_ERROR -RmCancelCurrentTask::return=WIN32_ERROR -RmEndSession::return=WIN32_ERROR -RmGetFilterList::return=WIN32_ERROR -RmGetList::return=WIN32_ERROR -RmJoinSession::return=WIN32_ERROR -RmRegisterResources::return=WIN32_ERROR -RmRemoveFilter::return=WIN32_ERROR -RmRestart::return=WIN32_ERROR -RmShutdown::return=WIN32_ERROR -RmStartSession::return=WIN32_ERROR IServiceProvider::QueryService::ppvObject=[ComOutPtr] LoadResource::return=[DoNotRelease] CertOpenStore::hCryptProv=[Reserved] diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index 88e1c9e3a..1b3bdc6ce 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -417,6 +417,12 @@ "sourceSha256": "7F7EE5D2FDBE9623A0D10DA5E49986485820684BACE387184BA30F1836FDB114", "sdkPath": "c\\include\\10.0.26100.0\\um\\websocket.h", "sdkSha256": "7F7EE5D2FDBE9623A0D10DA5E49986485820684BACE387184BA30F1836FDB114" + }, + { + "path": "um\\RestartManager.h", + "sourceSha256": "C7094C7B308BE0CA37E2BD5C77CF7D793F324FDE10BF306660B09B9641F093F8", + "sdkPath": "c\\include\\10.0.26100.0\\um\\RestartManager.h", + "sdkSha256": "C7094C7B308BE0CA37E2BD5C77CF7D793F324FDE10BF306660B09B9641F093F8" } ], "partitions": [ @@ -469,7 +475,8 @@ "WebDav", "Tbs", "Antimalware", - "WebSock" + "WebSock", + "RstMgr" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -527,6 +534,7 @@ "post-midl\\um\\fhcfg.annotations.patch", "post-midl\\um\\fhsvcctl.annotations.patch", "post-midl\\um\\amsi.annotations.patch", - "post-midl\\um\\websocket.annotations.patch" + "post-midl\\um\\websocket.annotations.patch", + "post-midl\\um\\restartmanager.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/um/restartmanager.annotations.patch b/generation/WinSDK/patches/post-midl/um/restartmanager.annotations.patch new file mode 100644 index 000000000..ab246c87b --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/restartmanager.annotations.patch @@ -0,0 +1,118 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/RestartManager.h b/generation/WinSDK/RecompiledIdlHeaders/um/RestartManager.h +--- a/generation/WinSDK/RecompiledIdlHeaders/um/RestartManager.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/RestartManager.h +@@ -8,6 +8,7 @@ + + #pragma once + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -95,7 +96,7 @@ + WCHAR strServiceShortName[CCH_RM_MAX_SVC_NAME+1]; // Service short name, + // if applicable + RM_APP_TYPE ApplicationType; // Application type +- ULONG AppStatus; // Bit mask of application status ++ _Win32_AssociatedEnum_(RM_APP_STATUS) ULONG AppStatus; // Bit mask of application status + DWORD TSSessionId; // Terminal Service session ID of + // process (-1 if n/a) + BOOL bRestartable; // Is application restartable? +@@ -147,6 +148,8 @@ + // Read/write operation failed. + // ERROR_OUTOFMEMORY + // Could not allocate memory or instantiate class object. ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmStartSession( + _Out_ DWORD *pSessionHandle, +@@ -164,6 +167,7 @@ + // Read/write operation failed. + // ERROR_OUTOFMEMORY + // Could not allocate memory or instantiate class object. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmJoinSession( + _Out_ DWORD *pSessionHandle, +@@ -182,6 +186,7 @@ + // Could not allocate memory or instantiate class object. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmEndSession( _In_ DWORD dwSessionHandle ); + +@@ -203,6 +208,7 @@ + // Could not allocate memory or instantiate class object. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmRegisterResources( + _In_ DWORD dwSessionHandle, +@@ -236,6 +242,7 @@ + // Could not allocate memory or instantiate class object. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmGetList( + _In_ DWORD dwSessionHandle, +@@ -264,6 +271,7 @@ + // Could not allocate memory or instantiate class object. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmShutdown( + _In_ DWORD dwSessionHandle, +@@ -291,6 +299,7 @@ + // Could not allocate memory or instantiate class object. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmRestart( + _In_ DWORD dwSessionHandle, +@@ -307,6 +316,7 @@ + // Could not allocate memory or instantiate class object. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmCancelCurrentTask( + _In_ DWORD dwSessionHandle); +@@ -320,6 +330,7 @@ + // An invalid argument was supplied to the function. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmAddFilter( + _In_ DWORD dwSessionHandle, +@@ -338,6 +349,7 @@ + // An invalid argument was supplied to the function. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmRemoveFilter( + _In_ DWORD dwSessionHandle, +@@ -353,6 +365,7 @@ + // An invalid argument was supplied to the function. + // ERROR_INVALID_HANDLE + // No session exists for the supplied handle. ++_Win32_AssociatedEnum_(WIN32_ERROR) + DWORD WINAPI + RmGetFilterList( + _In_ DWORD dwSessionHandle, +@@ -359,6 +372,8 @@ + _Out_writes_bytes_opt_(cbFilterBuf) PBYTE pbFilterBuf, + _In_ DWORD cbFilterBuf, + _Out_ LPDWORD cbFilterBufNeeded ); + ++_Win32_SupportedOS_END_() ++ + #ifdef __cplusplus + } diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index 215161b87..e3d86514b 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -7971,17 +7971,6 @@ CreateResourceIndexer=SupportedOSPlatform("windows10.0.10240") DestroyIndexedResults=SupportedOSPlatform("windows10.0.10240") DestroyResourceIndexer=SupportedOSPlatform("windows10.0.10240") IndexFilePath=SupportedOSPlatform("windows10.0.10240") -RmAddFilter=SupportedOSPlatform("windows6.0.6000") -RmCancelCurrentTask=SupportedOSPlatform("windows6.0.6000") -RmEndSession=SupportedOSPlatform("windows6.0.6000") -RmGetFilterList=SupportedOSPlatform("windows6.0.6000") -RmGetList=SupportedOSPlatform("windows6.0.6000") -RmJoinSession=SupportedOSPlatform("windows6.0.6000") -RmRegisterResources=SupportedOSPlatform("windows6.0.6000") -RmRemoveFilter=SupportedOSPlatform("windows6.0.6000") -RmRestart=SupportedOSPlatform("windows6.0.6000") -RmShutdown=SupportedOSPlatform("windows6.0.6000") -RmStartSession=SupportedOSPlatform("windows6.0.6000") ILanguageExceptionErrorInfo=SupportedOSPlatform("windows8.1") ILanguageExceptionErrorInfo2=SupportedOSPlatform("windows10.0.15063") ILanguageExceptionStackBackTrace=SupportedOSPlatform("windows10.0.15063") diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index 4119ff18a..7c78b8070 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -21,6 +21,7 @@ public class WinHttpMigrationTests private const string MetadataNamespace = "Windows.Win32.Foundation.Metadata"; private const string WNetNamespace = "Windows.Win32.NetworkManagement.WNet"; private const string DhcpNamespace = "Windows.Win32.NetworkManagement.Dhcp"; + private const string RestartManagerNamespace = "Windows.Win32.System.RestartManager"; private readonly ITestOutputHelper output; private static readonly SignatureNames Signatures = new SignatureNames(); private static readonly (string Owner, string Member, string Enum, string Native)[] Associations = @@ -34,6 +35,11 @@ private static readonly (string Owner, string Member, string Enum, string Native ("URL_COMPONENTS", "nScheme", "WINHTTP_INTERNET_SCHEME", "Int32"), ("WINHTTP_PROXY_RESULT_ENTRY", "ProxyScheme", "WINHTTP_INTERNET_SCHEME", "Int32"), }; + private static readonly string[] RestartManagerFunctions = + { + "RmStartSession", "RmJoinSession", "RmEndSession", "RmRegisterResources", "RmGetList", + "RmShutdown", "RmRestart", "RmCancelCurrentTask", "RmAddFilter", "RmRemoveFilter", "RmGetFilterList", + }; private static readonly EnumUse[] ReviewedEnumUses = Associations .Select(value => new EnumUse(WinHttpNamespace, value.Owner, value.Member, value.Enum, value.Native)) .Concat(new[] @@ -129,7 +135,9 @@ private static readonly (string Owner, string Member, string Enum, string Native new EnumUse(WNetNamespace, "WNetUseConnectionA", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), new EnumUse(WNetNamespace, "WNetUseConnectionW", "dwFlags", "NET_CONNECT_FLAGS", "UInt32"), new EnumUse(WNetNamespace, "WNetUseConnectionW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), - }).ToArray(); + }) + .Concat(RestartManagerFunctions.Select(name => new EnumUse(RestartManagerNamespace, name, + "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"))).ToArray(); private static readonly (string Namespace, string Owner, string Method, string Parameter)[] NativeRetvalUses = { ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetAddressLine1", "pbstrAddress1"), @@ -455,6 +463,69 @@ public void EveryPhysicalTypeHasOnlyReviewedHeaderChanges() $"{usedPreservedResults.Count} reviewed preserved-result site and {usedNativeDirections.Count} exact native SAL direction site normalized."); } + [MigrationTheory] + [InlineData(1)] + [InlineData(2)] + [InlineData(4)] + public void RestartManagerAssociationsPreserveNativeContracts(int architecture) + { + using var old = Open("WINHTTP_MIGRATION_OLD"); + using var current = Open("WINHTTP_MIGRATION_NEW"); + var before = Methods(old.Reader, RestartManagerNamespace, "Apis", architecture); + var after = Methods(current.Reader, RestartManagerNamespace, "Apis", architecture); + Assert.Equal(RestartManagerFunctions.OrderBy(value => value), before.Keys.OrderBy(value => value)); + Assert.Equal(before.Keys.OrderBy(value => value), after.Keys.OrderBy(value => value)); + foreach (string name in RestartManagerFunctions) + { + var original = before[name]; + var method = after[name]; + var oldSignature = original.DecodeSignature(Signatures, null); + var newSignature = method.DecodeSignature(Signatures, null); + Assert.Equal("Windows.Win32.Foundation.WIN32_ERROR", oldSignature.ReturnType); + Assert.Equal("UInt32", newSignature.ReturnType); + Assert.Equal(Signature(oldSignature, returnType: "UInt32"), Signature(newSignature)); + Assert.Equal(original.Attributes, method.Attributes); + Assert.Equal(original.ImplAttributes, method.ImplAttributes); + Assert.Equal(Import(old.Reader, original), Import(current.Reader, method)); + Assert.Equal(new[] { "windows6.0.6000" }, + AttributeValues(current.Reader, method.GetCustomAttributes(), "SupportedOSPlatformAttribute")); + Assert.Equal(AttributeValues(old.Reader, original.GetCustomAttributes(), "SupportedOSPlatformAttribute"), + AttributeValues(current.Reader, method.GetCustomAttributes(), "SupportedOSPlatformAttribute")); + var oldParameters = original.GetParameters().Select(old.Reader.GetParameter).ToArray(); + var parameters = method.GetParameters().Select(current.Reader.GetParameter).ToArray(); + Assert.Equal(oldParameters.Select(value => value.SequenceNumber), parameters.Select(value => value.SequenceNumber)); + Assert.Equal(oldParameters.Select(value => value.Attributes), parameters.Select(value => value.Attributes)); + var result = parameters.Single(value => value.SequenceNumber == 0); + Assert.Single(result.GetCustomAttributes()); + Assert.Equal(new[] { "WIN32_ERROR" }, + AttributeValues(current.Reader, result.GetCustomAttributes(), "AssociatedEnumAttribute")); + } + foreach (string name in new[] { "RM_PROCESS_INFO", "RM_APP_STATUS", "WIN32_ERROR" }) + Assert.Equal(SnapshotType(old.Reader, Type(old.Reader, name, architecture)), + SnapshotType(current.Reader, Type(current.Reader, name, architecture))); + } + + [Fact] + public void RestartManagerHeaderFactsHaveNoAuthoredFallback() + { + string project = Path.Combine(RepositoryRoot, "generation", "WinSDK"); + string[] rows = File.ReadAllLines(Path.Combine(project, "emitter.settings.rsp")); + string[] osRows = File.ReadAllLines(Path.Combine(project, "supportedOS.rsp")); + Assert.DoesNotContain(rows, row => row.StartsWith("RM_PROCESS_INFO::AppStatus=", StringComparison.Ordinal)); + foreach (string name in RestartManagerFunctions) + { + Assert.DoesNotContain(rows, row => row.StartsWith(name + "::return=", StringComparison.Ordinal)); + Assert.DoesNotContain(osRows, row => row.StartsWith(name + "=", StringComparison.Ordinal)); + } + Assert.Contains("parse-win32-annotations", + File.ReadAllText(Path.Combine(project, "Partitions", "RstMgr", "settings.rsp"))); + string patch = File.ReadAllText(Path.Combine(project, "patches", "post-midl", "um", "restartmanager.annotations.patch")); + Assert.Single(patch.Split('\n').Where(line => line.TrimEnd('\r') == "+_Win32_SupportedOS_BEGIN_(WindowsVista)")); + Assert.Single(patch.Split('\n').Where(line => line.TrimEnd('\r') == "+_Win32_SupportedOS_END_()")); + Assert.DoesNotContain("_Win32_DllImport_", patch); + Assert.DoesNotContain("_Win32_ImportLibrary_", patch); + } + [MigrationTheory] [InlineData(1)] [InlineData(2)] diff --git a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs index 3d8e751e5..d57f855bb 100644 --- a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs @@ -75,6 +75,19 @@ public void AdditionalPreparedPartitionsKeepOrdinaryNativeAbi(string partition, Assert.NotEmpty(headers); string checks = partition switch { + "RstMgr" => @" +static_assert(sizeof(DWORD) == 4); +static_assert(sizeof(((RM_PROCESS_INFO*)nullptr)->AppStatus) == 4); +static_assert(RmStatusUnknown == 0); +static_assert(RmStatusRunning == 1); +static_assert(RmStatusStopped == 2); +static_assert(RmStatusStoppedOther == 4); +static_assert(RmStatusRestarted == 8); +static_assert(RmStatusErrorOnStop == 0x10); +static_assert(RmStatusErrorOnRestart == 0x20); +static_assert(RmStatusShutdownMasked == 0x40); +static_assert(RmStatusRestartMasked == 0x80); +", "Cabinets" => @" static_assert(cpuUNKNOWN == -1); static_assert(cpu80286 == 0); From 92fdfdc45ba7cd35b34ecc8e55034ce3eb78575b Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 19:52:33 -0700 Subject: [PATCH 14/17] Integrate bounded snapshot monitor and identity header contracts Apply only verified9cd27b6b07073bff4bf37f8e9765ee4c52557f89 above the ordered owning sequence, retaining c587/43af. Preserve HPSS invalid-only residual, native handle wrappers, global PSS_CAPTURE_FLAGS uint repair, four Monitor BOOL return repairs and Identity parser configuration. Move only the full HPSSWALK producer lifecycle contract. Source counts78/13/1 are not physical admission; seven anonymous coordinates provide no physical allowances. Canonical image/closure/CI gates remain pending. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 11 ++ .../Partitions/IdentityProvider/settings.rsp | 2 + .../WinSDK/Partitions/Monitor/settings.rsp | 2 + .../WinSDK/Partitions/Proc_Snap/settings.rsp | 2 + generation/WinSDK/WithSetLastError.rsp | 26 ---- generation/WinSDK/autoTypes.json | 2 - generation/WinSDK/emitter.settings.rsp | 3 - generation/WinSDK/patches/SdkHeaders.json | 61 ++++++++- ...lmonitorconfigurationapi.annotations.patch | 123 ++++++++++++++++++ .../um/identityprovider.annotations.patch | 70 ++++++++++ .../um/identitystore.annotations.patch | 20 +++ ...lmonitorconfigurationapi.annotations.patch | 45 +++++++ ...calmonitorenumerationapi.annotations.patch | 45 +++++++ .../um/processsnapshot.annotations.patch | 37 ++++++ generation/WinSDK/supportedOS.rsp | 47 ------- .../WinHttpNativeControlTests.cs | 33 +++++ 16 files changed, 449 insertions(+), 80 deletions(-) create mode 100644 generation/WinSDK/patches/post-midl/um/highlevelmonitorconfigurationapi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/identityprovider.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/identitystore.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/lowlevelmonitorconfigurationapi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/physicalmonitorenumerationapi.annotations.patch create mode 100644 generation/WinSDK/patches/post-midl/um/processsnapshot.annotations.patch diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 149ddd9fb..2646404c1 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -182,6 +182,17 @@ derived. `CCH_RM_SESSION_KEY` remains a separately held native-expression parser gap; no native macro or manual constant shape is changed. This source integration does not constitute actual architecture/image/full-SDK/CI acceptance. +The Proc_Snap/Monitor/IdentityProvider input preserves native handle projection, +the `PSS_CAPTURE_FLAGS=uint` storage repair, four Monitor `_BOOL` return-alias +repairs and Identity parser/name configuration. Only HPSSWALK's complete +`PssWalkMarkerFree`/`[-1,0]` contract moves to its actual creator output. HPSS's +invalid-only row stays: `PssFreeSnapshot` takes both a process and snapshot handle, +so it is not a unary cleanup contract. Native `IdentityUpdateEvent` stays +unscoped with its original eight members; its Flags designation and two +native-DWORD associations move into headers. Seven anonymous source-coordinate +shifts are transport details, not permissions to change physical field metadata. +The private input counts are source accounting, not final emitted admission. + ## 5. Validate the actual output, not a proxy - Compile metadata-disabled native owner/dependent translation units on x86, diff --git a/generation/WinSDK/Partitions/IdentityProvider/settings.rsp b/generation/WinSDK/Partitions/IdentityProvider/settings.rsp index 243c7cbd3..db85330f3 100644 --- a/generation/WinSDK/Partitions/IdentityProvider/settings.rsp +++ b/generation/WinSDK/Partitions/IdentityProvider/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --with-type _tagSLDATATYPE=uint SLDATATYPE=uint diff --git a/generation/WinSDK/Partitions/Monitor/settings.rsp b/generation/WinSDK/Partitions/Monitor/settings.rsp index 34b956779..706471505 100644 --- a/generation/WinSDK/Partitions/Monitor/settings.rsp +++ b/generation/WinSDK/Partitions/Monitor/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/lowlevelmonitorconfigurationapi.h /um/highlevelmonitorconfigurationapi.h diff --git a/generation/WinSDK/Partitions/Proc_Snap/settings.rsp b/generation/WinSDK/Partitions/Proc_Snap/settings.rsp index 9430d25c4..99f0c84e2 100644 --- a/generation/WinSDK/Partitions/Proc_Snap/settings.rsp +++ b/generation/WinSDK/Partitions/Proc_Snap/settings.rsp @@ -1,3 +1,5 @@ +--config +parse-win32-annotations --traverse /um/ProcessSnapshot.h --namespace diff --git a/generation/WinSDK/WithSetLastError.rsp b/generation/WinSDK/WithSetLastError.rsp index d9794a283..f566649c1 100644 --- a/generation/WinSDK/WithSetLastError.rsp +++ b/generation/WinSDK/WithSetLastError.rsp @@ -178,7 +178,6 @@ CancelIo CancelIoEx CancelSynchronousIo CancelWaitableTimer -CapabilitiesRequestAndCapabilitiesReply CascadeWindows CertAddCertificateContextToStore CertAddCertificateLinkToStore @@ -690,7 +689,6 @@ DecryptFileW DeferWindowPos DefineDosDeviceA DefineDosDeviceW -DegaussMonitor DeleteAce DeleteAtom DeleteEnclave @@ -734,8 +732,6 @@ DestroyCursor DestroyEnvironmentBlock DestroyIcon DestroyMenu -DestroyPhysicalMonitor -DestroyPhysicalMonitors DestroyPrivateObjectSecurity DestroyWindow DetectAutoProxyUrl @@ -1103,7 +1099,6 @@ GetBinaryTypeW GetCalendarInfoA GetCalendarInfoEx GetCalendarInfoW -GetCapabilitiesStringLength GetCaretBlinkTime GetCaretPos GetClassInfoA @@ -1331,14 +1326,6 @@ GetModuleHandleA GetModuleHandleExA GetModuleHandleExW GetModuleHandleW -GetMonitorBrightness -GetMonitorColorTemperature -GetMonitorContrast -GetMonitorDisplayAreaPosition -GetMonitorDisplayAreaSize -GetMonitorRedGreenOrBlueDrive -GetMonitorRedGreenOrBlueGain -GetMonitorTechnologyType GetMouseMovePointsEx GetNameByTypeA GetNameByTypeW @@ -1372,7 +1359,6 @@ GetNumberFormatW GetNumberOfConsoleInputEvents GetNumberOfConsoleMouseButtons GetNumberOfEventLogRecords -GetNumberOfPhysicalMonitorsFromHMONITOR GetOldestEventLogRecord GetOpenClipboardWindow GetOverlappedResult @@ -1381,7 +1367,6 @@ GetParent getpeername GetPhysicalCursorPos GetPhysicallyInstalledSystemMemory -GetPhysicalMonitorsFromHMONITOR GetPixelFormat GetPointerCursorId GetPointerDevice @@ -1518,7 +1503,6 @@ GetTimeFormatA GetTimeFormatEx GetTimeFormatW GetTimestampForLoadedLibrary -GetTimingReport GetTitleBarInfo GetTokenInformation GetTopWindow @@ -1555,7 +1539,6 @@ GetUserObjectSecurity GetUserPreferredUILanguages GetUserProfileDirectoryA GetUserProfileDirectoryW -GetVCPFeatureAndVCPFeatureReply GetVersionExA GetVersionExW GetVolumeInformationA @@ -2147,8 +2130,6 @@ ResetCompressor ResetDecompressor ResetEvent ResolveLocaleName -RestoreMonitorFactoryColorDefaults -RestoreMonitorFactoryDefaults ResumeSuspendedDownload ResumeThread ResUtilDupString @@ -2186,8 +2167,6 @@ SaferIdentifyLevel SaferRecordEventLogEntry SaferSetLevelInformation SaferSetPolicyInformation -SaveCurrentMonitorSettings -SaveCurrentSettings ScanLogContainers SCardAccessStartedEvent ScrollConsoleScreenBufferA @@ -2317,11 +2296,6 @@ SetMenuInfo SetMenuItemBitmaps SetMenuItemInfoA SetMenuItemInfoW -SetMonitorBrightness -SetMonitorColorTemperature -SetMonitorContrast -SetMonitorDisplayAreaPosition -SetMonitorDisplayAreaSize SetNamedPipeHandleState SetParent SetPhysicalCursorPos diff --git a/generation/WinSDK/autoTypes.json b/generation/WinSDK/autoTypes.json index 21e426405..54e7e22fd 100644 --- a/generation/WinSDK/autoTypes.json +++ b/generation/WinSDK/autoTypes.json @@ -896,8 +896,6 @@ "Namespace": "Windows.Win32.System.Diagnostics.ProcessSnapshotting", "Name": "HPSSWALK", "ValueType": "DECLARE_HANDLE", - "CloseApi": "PssWalkMarkerFree", - "InvalidHandleValues": [ -1, 0 ], "NativeTypedef": true }, { diff --git a/generation/WinSDK/emitter.settings.rsp b/generation/WinSDK/emitter.settings.rsp index 7f66c6766..16ed4a4a4 100644 --- a/generation/WinSDK/emitter.settings.rsp +++ b/generation/WinSDK/emitter.settings.rsp @@ -61,7 +61,6 @@ GETPROPERTYSTOREFLAGS HLBWIF_FLAGS HLFNAMEF HLNF -IdentityUpdateEvent JOB_OBJECT_NET_RATE_CONTROL_FLAGS KSPROPERTY_IPSINK MERGE_VIRTUAL_DISK_FLAG @@ -1417,8 +1416,6 @@ IDirectXVideoAccelerationService::CreateSurface::DxvaType=[AssociatedEnum("DXVA2 IDirectXVideoDecoder::GetBuffer::BufferType=[AssociatedEnum("DXVA2_BufferfType")] IFolderView::ItemCount::uFlags=[AssociatedEnum("_SVGIO")] IFolderView::Items::uFlags=[AssociatedEnum("_SVGIO")] -IIdentityAdvise::IdentityUpdated::dwIdentityUpdateEvents=[AssociatedEnum("IdentityUpdateEvent")] -IIdentityProvider::Advise::dwIdentityUpdateEvents=[AssociatedEnum("IdentityUpdateEvent")] IImePad::Request::reqId=[AssociatedEnum("IME_PAD_REQUEST_FLAGS")] IOleClientSite::GetMoniker::dwAssign=[AssociatedEnum("OLEGETMONIKER")] IOleClientSite::GetMoniker::dwWhichMoniker=[AssociatedEnum("OLEWHICHMK")] diff --git a/generation/WinSDK/patches/SdkHeaders.json b/generation/WinSDK/patches/SdkHeaders.json index 1b3bdc6ce..8f7da0efc 100644 --- a/generation/WinSDK/patches/SdkHeaders.json +++ b/generation/WinSDK/patches/SdkHeaders.json @@ -423,6 +423,54 @@ "sourceSha256": "C7094C7B308BE0CA37E2BD5C77CF7D793F324FDE10BF306660B09B9641F093F8", "sdkPath": "c\\include\\10.0.26100.0\\um\\RestartManager.h", "sdkSha256": "C7094C7B308BE0CA37E2BD5C77CF7D793F324FDE10BF306660B09B9641F093F8" + }, + { + "path": "um\\ProcessSnapshot.h", + "sourceSha256": "93C20675D17F18B1945A5B05D44FA9BFBCF091EEB27687FBCCBCDA072D5C32CC", + "sdkPath": "c\\include\\10.0.26100.0\\um\\ProcessSnapshot.h", + "sdkSha256": "93C20675D17F18B1945A5B05D44FA9BFBCF091EEB27687FBCCBCDA072D5C32CC" + }, + { + "path": "um\\lowlevelmonitorconfigurationapi.h", + "sourceSha256": "058DFA39D9B1FF05FFDF14DE7B0B11E67640C4BA7A40B2A198DF98F26A159501", + "sdkPath": "c\\include\\10.0.26100.0\\um\\lowlevelmonitorconfigurationapi.h", + "sdkSha256": "058DFA39D9B1FF05FFDF14DE7B0B11E67640C4BA7A40B2A198DF98F26A159501" + }, + { + "path": "um\\highlevelmonitorconfigurationapi.h", + "sourceSha256": "E61B41906C1A32A729D0F461A53DD9AB4A630C4853948A4EFE8F91082FE39E5A", + "sdkPath": "c\\include\\10.0.26100.0\\um\\highlevelmonitorconfigurationapi.h", + "sdkSha256": "E61B41906C1A32A729D0F461A53DD9AB4A630C4853948A4EFE8F91082FE39E5A" + }, + { + "path": "um\\physicalmonitorenumerationapi.h", + "sourceSha256": "66131CE43587F3C254733E7DC618C48ACDE735E90CB9C24FA654AA3B62F6731A", + "sdkPath": "c\\include\\10.0.26100.0\\um\\physicalmonitorenumerationapi.h", + "sdkSha256": "66131CE43587F3C254733E7DC618C48ACDE735E90CB9C24FA654AA3B62F6731A" + }, + { + "path": "um\\cloneviewhelper.h", + "sourceSha256": "1C2F9082CF784E3C30DDECEF6836E3F9C5457B6EB246BF8B4457CD05058E50DC", + "sdkPath": "c\\include\\10.0.26100.0\\um\\cloneviewhelper.idl", + "sdkSha256": "1F6798B72D5E14812538C70A35E532CA53809893D1DB2B4799E69F615BEE1A95" + }, + { + "path": "um\\IdentityCommon.h", + "sourceSha256": "259C4D59C5162FB190C729003D7BDF74E63A2AED7FF1CBC75B323447C77F779A", + "sdkPath": "c\\include\\10.0.26100.0\\um\\IdentityCommon.h", + "sdkSha256": "259C4D59C5162FB190C729003D7BDF74E63A2AED7FF1CBC75B323447C77F779A" + }, + { + "path": "um\\IdentityProvider.h", + "sourceSha256": "24A3462C7B117F8D3C59382E0F94F911FF764C20182936EF2CDCA5EF9D7E77BE", + "sdkPath": "c\\include\\10.0.26100.0\\um\\IdentityProvider.h", + "sdkSha256": "24A3462C7B117F8D3C59382E0F94F911FF764C20182936EF2CDCA5EF9D7E77BE" + }, + { + "path": "um\\IdentityStore.h", + "sourceSha256": "EE96A96BA3DA324BC971E272DB518AC2B4808D6A452A3444E438CDCC22816774", + "sdkPath": "c\\include\\10.0.26100.0\\um\\IdentityStore.h", + "sdkSha256": "EE96A96BA3DA324BC971E272DB518AC2B4808D6A452A3444E438CDCC22816774" } ], "partitions": [ @@ -476,7 +524,10 @@ "Tbs", "Antimalware", "WebSock", - "RstMgr" + "RstMgr", + "Proc_Snap", + "Monitor", + "IdentityProvider" ], "patches": [ "post-midl\\um\\winhttp.supported-os.patch", @@ -535,6 +586,12 @@ "post-midl\\um\\fhsvcctl.annotations.patch", "post-midl\\um\\amsi.annotations.patch", "post-midl\\um\\websocket.annotations.patch", - "post-midl\\um\\restartmanager.annotations.patch" + "post-midl\\um\\restartmanager.annotations.patch", + "post-midl\\um\\processsnapshot.annotations.patch", + "post-midl\\um\\lowlevelmonitorconfigurationapi.annotations.patch", + "post-midl\\um\\highlevelmonitorconfigurationapi.annotations.patch", + "post-midl\\um\\physicalmonitorenumerationapi.annotations.patch", + "post-midl\\um\\identityprovider.annotations.patch", + "post-midl\\um\\identitystore.annotations.patch" ] } diff --git a/generation/WinSDK/patches/post-midl/um/highlevelmonitorconfigurationapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/highlevelmonitorconfigurationapi.annotations.patch new file mode 100644 index 000000000..1536b0fcd --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/highlevelmonitorconfigurationapi.annotations.patch @@ -0,0 +1,123 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/highlevelmonitorconfigurationapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/highlevelmonitorconfigurationapi.h +index 9148a814..e1b1a339 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/highlevelmonitorconfigurationapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/highlevelmonitorconfigurationapi.h +@@ -5,6 +5,7 @@ + #define HighLevelMonitorConfigurationAPI_h + + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -109,6 +110,7 @@ typedef enum _MC_COLOR_TEMPERATURE + /****************************************************************************** + Monitor capability functions + ******************************************************************************/ ++_Win32_SupportedOS_BEGIN_(WindowsVista) + _BOOL WINAPI GetMonitorCapabilities + ( + HANDLE hMonitor, +@@ -119,16 +121,19 @@ _BOOL WINAPI GetMonitorCapabilities + /****************************************************************************** + Monitor setting persistence functions + ******************************************************************************/ ++_Win32_SetLastError_ + _BOOL WINAPI SaveCurrentMonitorSettings( HANDLE hMonitor ); + + /****************************************************************************** + Monitor meta-data functions + ******************************************************************************/ ++_Win32_SetLastError_ + _BOOL WINAPI GetMonitorTechnologyType( HANDLE hMonitor, LPMC_DISPLAY_TECHNOLOGY_TYPE pdtyDisplayTechnologyType ); + + /****************************************************************************** + Monitor image calibration functions + ******************************************************************************/ ++_Win32_SetLastError_ + _BOOL WINAPI GetMonitorBrightness + ( + HANDLE hMonitor, +@@ -136,6 +141,7 @@ _BOOL WINAPI GetMonitorBrightness + _Out_ LPDWORD pdwCurrentBrightness, + _Out_ LPDWORD pdwMaximumBrightness + ); ++_Win32_SetLastError_ + _BOOL WINAPI GetMonitorContrast + ( + HANDLE hMonitor, +@@ -143,7 +149,9 @@ _BOOL WINAPI GetMonitorContrast + _Out_ LPDWORD pdwCurrentContrast, + _Out_ LPDWORD pdwMaximumContrast + ); ++_Win32_SetLastError_ + _BOOL WINAPI GetMonitorColorTemperature( HANDLE hMonitor, _Out_ LPMC_COLOR_TEMPERATURE pctCurrentColorTemperature ); ++_Win32_SetLastError_ + _BOOL WINAPI GetMonitorRedGreenOrBlueDrive + ( + HANDLE hMonitor, +@@ -152,6 +160,7 @@ _BOOL WINAPI GetMonitorRedGreenOrBlueDrive + _Out_ LPDWORD pdwCurrentDrive, + _Out_ LPDWORD pdwMaximumDrive + ); ++_Win32_SetLastError_ + _BOOL WINAPI GetMonitorRedGreenOrBlueGain + ( + HANDLE hMonitor, +@@ -161,16 +170,21 @@ _BOOL WINAPI GetMonitorRedGreenOrBlueGain + _Out_ LPDWORD pdwMaximumGain + ); + ++_Win32_SetLastError_ + _BOOL WINAPI SetMonitorBrightness( HANDLE hMonitor, DWORD dwNewBrightness ); ++_Win32_SetLastError_ + _BOOL WINAPI SetMonitorContrast( HANDLE hMonitor, DWORD dwNewContrast ); ++_Win32_SetLastError_ + _BOOL WINAPI SetMonitorColorTemperature( HANDLE hMonitor, MC_COLOR_TEMPERATURE ctCurrentColorTemperature ); + _BOOL WINAPI SetMonitorRedGreenOrBlueDrive( HANDLE hMonitor, MC_DRIVE_TYPE dtDriveType, DWORD dwNewDrive ); + _BOOL WINAPI SetMonitorRedGreenOrBlueGain( HANDLE hMonitor, MC_GAIN_TYPE gtGainType, DWORD dwNewGain ); ++_Win32_SetLastError_ + _BOOL WINAPI DegaussMonitor( HANDLE hMonitor ); + + /****************************************************************************** + Monitor image size and position calibration functions + ******************************************************************************/ ++_Win32_SetLastError_ + _BOOL WINAPI GetMonitorDisplayAreaSize + ( + HANDLE hMonitor, +@@ -179,6 +193,7 @@ _BOOL WINAPI GetMonitorDisplayAreaSize + _Out_ LPDWORD pdwCurrentWidthOrHeight, + _Out_ LPDWORD pdwMaximumWidthOrHeight + ); ++_Win32_SetLastError_ + _BOOL WINAPI GetMonitorDisplayAreaPosition + ( + HANDLE hMonitor, +@@ -187,12 +202,14 @@ _BOOL WINAPI GetMonitorDisplayAreaPosition + _Out_ LPDWORD pdwCurrentPosition, + _Out_ LPDWORD pdwMaximumPosition + ); ++_Win32_SetLastError_ + _BOOL WINAPI SetMonitorDisplayAreaSize + ( + HANDLE hMonitor, + MC_SIZE_TYPE stSizeType, + DWORD dwNewDisplayAreaWidthOrHeight + ); ++_Win32_SetLastError_ + _BOOL WINAPI SetMonitorDisplayAreaPosition + ( + HANDLE hMonitor, +@@ -203,8 +220,11 @@ _BOOL WINAPI SetMonitorDisplayAreaPosition + /****************************************************************************** + Restore to defaults functions + ******************************************************************************/ ++_Win32_SetLastError_ + _BOOL WINAPI RestoreMonitorFactoryColorDefaults( HANDLE hMonitor ); ++_Win32_SetLastError_ + _BOOL WINAPI RestoreMonitorFactoryDefaults( HANDLE hMonitor ); ++_Win32_SupportedOS_END_() + + #pragma pack( pop ) + diff --git a/generation/WinSDK/patches/post-midl/um/identityprovider.annotations.patch b/generation/WinSDK/patches/post-midl/um/identityprovider.annotations.patch new file mode 100644 index 000000000..adce721ec --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/identityprovider.annotations.patch @@ -0,0 +1,70 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/IdentityProvider.h b/generation/WinSDK/RecompiledIdlHeaders/um/IdentityProvider.h +index 2d6f99ca..13eb4d3a 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/IdentityProvider.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/IdentityProvider.h +@@ -132,12 +132,17 @@ extern "C"{ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #if 0 + #endif // 0 + +-enum tag_IdentityUpdateEvent ++enum ++#if defined(WIN32METADATA) && defined(__clang__) ++[[clang::flag_enum]] ++#endif ++tag_IdentityUpdateEvent + { + IDENTITY_ASSOCIATED = 0x1, + IDENTITY_DISASSOCIATED = 0x2, +@@ -170,11 +175,12 @@ EXTERN_C const IID IID_IIdentityAdvise; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4e982fed-d14b-440c-b8d6-bb386453d386") ++ _Win32_SupportedOS_Windows7_ + IIdentityAdvise : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE IdentityUpdated( +- /* [in] */ DWORD dwIdentityUpdateEvents, ++ /* [in] */ _Win32_AssociatedEnum_(IdentityUpdateEvent) DWORD dwIdentityUpdateEvents, + /* [in] */ __RPC__in LPCWSTR lpszUniqueID) = 0; + + }; +@@ -351,6 +357,7 @@ EXTERN_C const IID IID_IIdentityProvider; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0d1b9e0c-e8ba-4f55-a81b-bce934b948f5") ++ _Win32_SupportedOS_Windows7_ + IIdentityProvider : public IUnknown + { + public: +@@ -381,7 +388,7 @@ EXTERN_C const IID IID_IIdentityProvider; + + virtual HRESULT STDMETHODCALLTYPE Advise( + /* [in] */ __RPC__in_opt IIdentityAdvise *pIdentityAdvise, +- /* [in] */ DWORD dwIdentityUpdateEvents, ++ /* [in] */ _Win32_AssociatedEnum_(IdentityUpdateEvent) DWORD dwIdentityUpdateEvents, + /* [out] */ __RPC__out DWORD *pdwCookie) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnAdvise( +@@ -781,6 +788,7 @@ EXTERN_C const IID IID_IAssociatedIdentityProvider; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2af066b3-4cbb-4cba-a798-204b6af68cc0") ++ _Win32_SupportedOS_Windows7_ + IAssociatedIdentityProvider : public IUnknown + { + public: +@@ -1067,6 +1075,7 @@ EXTERN_C const IID IID_IConnectedIdentityProvider; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B7417B54-E08C-429b-96C8-678D1369ECB1") ++ _Win32_SupportedOS_Windows8_ + IConnectedIdentityProvider : public IUnknown + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/identitystore.annotations.patch b/generation/WinSDK/patches/post-midl/um/identitystore.annotations.patch new file mode 100644 index 000000000..2abaab172 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/identitystore.annotations.patch @@ -0,0 +1,20 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/IdentityStore.h b/generation/WinSDK/RecompiledIdlHeaders/um/IdentityStore.h +index 4b71a291..932460ab 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/IdentityStore.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/IdentityStore.h +@@ -114,6 +114,7 @@ extern "C"{ + /* [local] */ + + #include ++#include + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + +@@ -133,6 +134,7 @@ EXTERN_C const IID IID_IIdentityStore; + #if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("df586fa5-6f35-44f1-b209-b38e169772eb") ++ _Win32_SupportedOS_Windows7_ + IIdentityStore : public IUnknown + { + public: diff --git a/generation/WinSDK/patches/post-midl/um/lowlevelmonitorconfigurationapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/lowlevelmonitorconfigurationapi.annotations.patch new file mode 100644 index 000000000..f54b7216a --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/lowlevelmonitorconfigurationapi.annotations.patch @@ -0,0 +1,45 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/lowlevelmonitorconfigurationapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/lowlevelmonitorconfigurationapi.h +index 38f5623b..34dafde5 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/lowlevelmonitorconfigurationapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/lowlevelmonitorconfigurationapi.h +@@ -5,6 +5,7 @@ + #define LowLevelMonitorConfigurationAPI_h + + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -32,6 +33,8 @@ typedef enum _MC_VCP_CODE_TYPE + + } MC_VCP_CODE_TYPE, *LPMC_VCP_CODE_TYPE; + ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++_Win32_SetLastError_ + _BOOL WINAPI GetVCPFeatureAndVCPFeatureReply + ( + HANDLE hMonitor, +@@ -43,10 +46,13 @@ _BOOL WINAPI GetVCPFeatureAndVCPFeatureReply + + _BOOL WINAPI SetVCPFeature( HANDLE hMonitor, BYTE bVCPCode, DWORD dwNewValue ); + ++_Win32_SetLastError_ + _BOOL WINAPI SaveCurrentSettings( HANDLE hMonitor ); + ++_Win32_SetLastError_ + _BOOL WINAPI GetCapabilitiesStringLength( HANDLE hMonitor, _Out_ LPDWORD pdwCapabilitiesStringLengthInCharacters ); + ++_Win32_SetLastError_ + _BOOL WINAPI CapabilitiesRequestAndCapabilitiesReply + ( + HANDLE hMonitor, +@@ -54,7 +60,9 @@ _BOOL WINAPI CapabilitiesRequestAndCapabilitiesReply + DWORD dwCapabilitiesStringLengthInCharacters + ); + ++_Win32_SetLastError_ + _BOOL WINAPI GetTimingReport( HANDLE hMonitor, _Out_ LPMC_TIMING_REPORT pmtrMonitorTimingReport ); ++_Win32_SupportedOS_END_() + + #pragma pack( pop ) + diff --git a/generation/WinSDK/patches/post-midl/um/physicalmonitorenumerationapi.annotations.patch b/generation/WinSDK/patches/post-midl/um/physicalmonitorenumerationapi.annotations.patch new file mode 100644 index 000000000..9c63468f6 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/physicalmonitorenumerationapi.annotations.patch @@ -0,0 +1,45 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/physicalmonitorenumerationapi.h b/generation/WinSDK/RecompiledIdlHeaders/um/physicalmonitorenumerationapi.h +index 0b231f7f..e828dd14 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/physicalmonitorenumerationapi.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/physicalmonitorenumerationapi.h +@@ -5,6 +5,7 @@ + #define PhysicalMonitorEnumerationAPI_h + + #include ++#include + + #pragma region Desktop Family + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +@@ -43,6 +44,8 @@ typedef struct _PHYSICAL_MONITOR + /****************************************************************************** + Physical Monitor Enumeration Functions + ******************************************************************************/ ++_Win32_SupportedOS_BEGIN_(WindowsVista) ++_Win32_SetLastError_ + _BOOL WINAPI GetNumberOfPhysicalMonitorsFromHMONITOR + ( + HMONITOR hMonitor, +@@ -54,6 +57,7 @@ HRESULT WINAPI GetNumberOfPhysicalMonitorsFromIDirect3DDevice9 + _Out_ LPDWORD pdwNumberOfPhysicalMonitors + ); + ++_Win32_SetLastError_ + _BOOL WINAPI GetPhysicalMonitorsFromHMONITOR + ( + _In_ HMONITOR hMonitor, +@@ -67,12 +71,15 @@ HRESULT WINAPI GetPhysicalMonitorsFromIDirect3DDevice9 + _Out_writes_(dwPhysicalMonitorArraySize) LPPHYSICAL_MONITOR pPhysicalMonitorArray + ); + ++_Win32_SetLastError_ + _BOOL WINAPI DestroyPhysicalMonitor( _In_ HANDLE hMonitor ); ++_Win32_SetLastError_ + _BOOL WINAPI DestroyPhysicalMonitors + ( + _In_ DWORD dwPhysicalMonitorArraySize, + _In_reads_(dwPhysicalMonitorArraySize) LPPHYSICAL_MONITOR pPhysicalMonitorArray + ); ++_Win32_SupportedOS_END_() + + #pragma pack( pop ) + diff --git a/generation/WinSDK/patches/post-midl/um/processsnapshot.annotations.patch b/generation/WinSDK/patches/post-midl/um/processsnapshot.annotations.patch new file mode 100644 index 000000000..5548fb9c9 --- /dev/null +++ b/generation/WinSDK/patches/post-midl/um/processsnapshot.annotations.patch @@ -0,0 +1,37 @@ +diff --git a/generation/WinSDK/RecompiledIdlHeaders/um/ProcessSnapshot.h b/generation/WinSDK/RecompiledIdlHeaders/um/ProcessSnapshot.h +index ea1e95f7..6c12258c 100644 +--- a/generation/WinSDK/RecompiledIdlHeaders/um/ProcessSnapshot.h ++++ b/generation/WinSDK/RecompiledIdlHeaders/um/ProcessSnapshot.h +@@ -13,6 +13,7 @@ Abstract: + #pragma once + #endif + ++#include + + // Handle descriptor flags. + typedef enum +@@ -370,6 +371,7 @@ typedef struct + #if (NTDDI_VERSION >= NTDDI_WINBLUE) + + // Win32 APIs. ++_Win32_SupportedOS_BEGIN_(Windows81) + _Success_(return == ERROR_SUCCESS) + STDAPI_(DWORD) + PssCaptureSnapshot( +@@ -420,7 +422,7 @@ _Success_(return == ERROR_SUCCESS) + STDAPI_(DWORD) + PssWalkMarkerCreate( + _In_opt_ PSS_ALLOCATOR const *Allocator, +- _Out_ HPSSWALK* WalkMarkerHandle ++ _Out_ _Win32_RAIIFree_(PssWalkMarkerFree, -1, 0) HPSSWALK* WalkMarkerHandle + ); + + _Success_(return == ERROR_SUCCESS) +@@ -448,6 +450,7 @@ STDAPI_(DWORD) + PssWalkMarkerSeekToBeginning( + _In_ HPSSWALK WalkMarkerHandle + ); ++_Win32_SupportedOS_END_() + + #endif // (NTDDI_VERSION >= NTDDI_WINBLUE) + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */ diff --git a/generation/WinSDK/supportedOS.rsp b/generation/WinSDK/supportedOS.rsp index e3d86514b..8863b93fc 100644 --- a/generation/WinSDK/supportedOS.rsp +++ b/generation/WinSDK/supportedOS.rsp @@ -3361,26 +3361,6 @@ HeapSize=SupportedOSPlatform("windows5.1.2600") HeapUnlock=SupportedOSPlatform("windows5.1.2600") HeapValidate=SupportedOSPlatform("windows5.1.2600") HeapWalk=SupportedOSPlatform("windows5.1.2600") -DegaussMonitor=SupportedOSPlatform("windows6.0.6000") -GetMonitorBrightness=SupportedOSPlatform("windows6.0.6000") -GetMonitorCapabilities=SupportedOSPlatform("windows6.0.6000") -GetMonitorColorTemperature=SupportedOSPlatform("windows6.0.6000") -GetMonitorContrast=SupportedOSPlatform("windows6.0.6000") -GetMonitorDisplayAreaPosition=SupportedOSPlatform("windows6.0.6000") -GetMonitorDisplayAreaSize=SupportedOSPlatform("windows6.0.6000") -GetMonitorRedGreenOrBlueDrive=SupportedOSPlatform("windows6.0.6000") -GetMonitorRedGreenOrBlueGain=SupportedOSPlatform("windows6.0.6000") -GetMonitorTechnologyType=SupportedOSPlatform("windows6.0.6000") -RestoreMonitorFactoryColorDefaults=SupportedOSPlatform("windows6.0.6000") -RestoreMonitorFactoryDefaults=SupportedOSPlatform("windows6.0.6000") -SaveCurrentMonitorSettings=SupportedOSPlatform("windows6.0.6000") -SetMonitorBrightness=SupportedOSPlatform("windows6.0.6000") -SetMonitorColorTemperature=SupportedOSPlatform("windows6.0.6000") -SetMonitorContrast=SupportedOSPlatform("windows6.0.6000") -SetMonitorDisplayAreaPosition=SupportedOSPlatform("windows6.0.6000") -SetMonitorDisplayAreaSize=SupportedOSPlatform("windows6.0.6000") -SetMonitorRedGreenOrBlueDrive=SupportedOSPlatform("windows6.0.6000") -SetMonitorRedGreenOrBlueGain=SupportedOSPlatform("windows6.0.6000") IHolographicSpaceInterop=SupportedOSPlatform("windows10.0.15063") IXAPOHrtfParameters=SupportedOSPlatform("windows10.0.10240") HTTP_EQUAL_VERSION=SupportedOSPlatform("windows6.0.6000") @@ -3502,11 +3482,6 @@ IcmpSendEcho=SupportedOSPlatform("windows5.0") IcmpSendEcho2=SupportedOSPlatform("windows5.0") IcmpSendEcho2Ex=SupportedOSPlatform("windows6.0.6000") IContentPrefetcherTaskTrigger=SupportedOSPlatform("windows8.1") -IAssociatedIdentityProvider=SupportedOSPlatform("windows6.1") -IConnectedIdentityProvider=SupportedOSPlatform("windows8.0") -IIdentityAdvise=SupportedOSPlatform("windows6.1") -IIdentityProvider=SupportedOSPlatform("windows6.1") -IIdentityStore=SupportedOSPlatform("windows6.1") IAMLine21Decoder=SupportedOSPlatform("windows5.0") BindImage=SupportedOSPlatform("windows5.1.2600") BindImageEx=SupportedOSPlatform("windows5.1.2600") @@ -4243,12 +4218,6 @@ LoadPerfCounterTextStringsA=SupportedOSPlatform("windows5.1.2600") LoadPerfCounterTextStringsW=SupportedOSPlatform("windows5.1.2600") UnloadPerfCounterTextStringsA=SupportedOSPlatform("windows5.1.2600") UnloadPerfCounterTextStringsW=SupportedOSPlatform("windows5.1.2600") -CapabilitiesRequestAndCapabilitiesReply=SupportedOSPlatform("windows6.0.6000") -GetCapabilitiesStringLength=SupportedOSPlatform("windows6.0.6000") -GetTimingReport=SupportedOSPlatform("windows6.0.6000") -GetVCPFeatureAndVCPFeatureReply=SupportedOSPlatform("windows6.0.6000") -SaveCurrentSettings=SupportedOSPlatform("windows6.0.6000") -SetVCPFeature=SupportedOSPlatform("windows6.0.6000") LPM_AdmitRsvpMsg=SupportedOSPlatform("windows5.0") LPM_CommitResv=SupportedOSPlatform("windows5.0") LPM_Deinitialize=SupportedOSPlatform("windows5.0") @@ -7125,12 +7094,6 @@ PerfSetULongLongCounterValue=SupportedOSPlatform("windows6.0.6000") PerfStartProvider=SupportedOSPlatform("windows6.0.6000") PerfStartProviderEx=SupportedOSPlatform("windows6.0.6000") PerfStopProvider=SupportedOSPlatform("windows6.0.6000") -DestroyPhysicalMonitor=SupportedOSPlatform("windows6.0.6000") -DestroyPhysicalMonitors=SupportedOSPlatform("windows6.0.6000") -GetNumberOfPhysicalMonitorsFromHMONITOR=SupportedOSPlatform("windows6.0.6000") -GetNumberOfPhysicalMonitorsFromIDirect3DDevice9=SupportedOSPlatform("windows6.0.6000") -GetPhysicalMonitorsFromHMONITOR=SupportedOSPlatform("windows6.0.6000") -GetPhysicalMonitorsFromIDirect3DDevice9=SupportedOSPlatform("windows6.0.6000") IAlertDataCollector=SupportedOSPlatform("windows6.0.6000") IApiTracingDataCollector=SupportedOSPlatform("windows6.0.6000") IConfigurationDataCollector=SupportedOSPlatform("windows6.0.6000") @@ -7196,16 +7159,6 @@ SearchPathA=SupportedOSPlatform("windows5.1.2600") SearchPathW=SupportedOSPlatform("windows5.1.2600") SetEnvironmentVariableA=SupportedOSPlatform("windows5.1.2600") SetEnvironmentVariableW=SupportedOSPlatform("windows5.1.2600") -PssCaptureSnapshot=SupportedOSPlatform("windows8.1") -PssDuplicateSnapshot=SupportedOSPlatform("windows8.1") -PssFreeSnapshot=SupportedOSPlatform("windows8.1") -PssQuerySnapshot=SupportedOSPlatform("windows8.1") -PssWalkMarkerCreate=SupportedOSPlatform("windows8.1") -PssWalkMarkerFree=SupportedOSPlatform("windows8.1") -PssWalkMarkerGetPosition=SupportedOSPlatform("windows8.1") -PssWalkMarkerSeekToBeginning=SupportedOSPlatform("windows8.1") -PssWalkMarkerSetPosition=SupportedOSPlatform("windows8.1") -PssWalkSnapshot=SupportedOSPlatform("windows8.1") CreateProcessA=SupportedOSPlatform("windows5.1.2600") CreateProcessAsUserA=SupportedOSPlatform("windows5.1.2600") CreateProcessAsUserW=SupportedOSPlatform("windows5.1.2600") diff --git a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs index d57f855bb..e8683107c 100644 --- a/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpNativeControlTests.cs @@ -93,6 +93,39 @@ public void AdditionalPreparedPartitionsKeepOrdinaryNativeAbi(string partition, static_assert(cpu80286 == 0); static_assert(cpu80386 == 1); static_assert(sizeof(int) == 4); +", + "Proc_Snap" => @" +static_assert(sizeof(HPSS) == sizeof(void*)); +static_assert(sizeof(HPSSWALK) == sizeof(void*)); +static_assert(sizeof(PSS_CAPTURE_FLAGS) == sizeof(DWORD)); +static_assert(PSS_CREATE_RELEASE_SECTION == 0x80000000u); +static_assert(PSS_CREATE_MEASURE_PERFORMANCE == 0x40000000); +", + "Monitor" => @" +static_assert(sizeof(_BOOL) == sizeof(BOOL)); +static_assert(sizeof(PHYSICAL_MONITOR) == sizeof(HANDLE) + 128 * sizeof(WCHAR)); +static_assert(sizeof(MC_TIMING_REPORT) == 9); +static_assert(MC_CAPS_NONE == 0); +static_assert(MC_RESTORE_FACTORY_DEFAULTS_ENABLES_MONITOR_SETTINGS == 0x1000); +static_assert(MC_SUPPORTED_COLOR_TEMPERATURE_11500K == 0x80); +static_assert(GETCONNECTEDIDS_TARGET == 0); +static_assert(GETCONNECTEDIDS_SOURCE == 1); +static_assert(SETCONFIGURATION_STATUS_APPLIED == 0); +static_assert(SETCONFIGURATION_STATUS_ADDITIONAL == 1); +static_assert(SETCONFIGURATION_STATUS_OVERRIDDEN == 2); +", + "IdentityProvider" => @" +static_assert(IDENTITIES_ALL == 0); +static_assert(IDENTITIES_ME_ONLY == 1); +static_assert(sizeof(tag_IdentityUpdateEvent) == sizeof(DWORD)); +static_assert(IDENTITY_ASSOCIATED == 1); +static_assert(IDENTITY_DISASSOCIATED == 2); +static_assert(IDENTITY_CREATED == 4); +static_assert(IDENTITY_IMPORTED == 8); +static_assert(IDENTITY_DELETED == 16); +static_assert(IDENTITY_PROPCHANGED == 32); +static_assert(IDENTITY_CONNECTED == 64); +static_assert(IDENTITY_DISCONNECTED == 128); ", "ApplicationVerifier" => @" static_assert(AVRF_ENUM_RESOURCES_FLAGS_DONT_RESOLVE_TRACES == 2); From 72a0991788f8e022e76f771eef758ff0a26f93b8 Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 21:26:05 -0700 Subject: [PATCH 15/17] Preserve native constant aliases after enum-member relocation Bind simple aliases to the unique same-namespace enum member for the applicable architecture, preserving constant storage and rejecting ambiguous bindings. Cover native three-architecture emission, signed values, namespace isolation and the existing fourteen-member WER enum without changing SDK bytes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 7 ++ .../ClangSharpSourceCompilation.cs | 41 ++++++- .../MetadataSyntaxTreeCleaner.cs | 21 +++- .../HeaderAnnotationWinmdTests.cs | 102 ++++++++++++++++++ 4 files changed, 167 insertions(+), 4 deletions(-) diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 2646404c1..381f2c2e7 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -85,6 +85,13 @@ value conflicts. Preserve existing logical member names and values while leaving native macros intact unless a separate review resolves a conflict. Document any user-approved metadata-only naming exception at the header boundary. +Retain genuine native macro aliases when a logical enum moves into headers. +Removing a duplicate loose enum-member constant must not leave a surviving alias +initializer unbound. The emitter qualifies a simple alias to the unique enum +member in the same namespace and applicable architecture, preserving the alias's +declared constant type. Ambiguous bindings remain errors; do not add enum members, +rewrite native values or suppress aliases merely because OLD omitted them. + Keep expectations exact and source-backed, with zero unknown differences and zero unused expectations. There is no blanket native-derived difference or duplicate allowlist, and no assumption that faithful capture implies consumer compatibility. diff --git a/sources/ClangSharpSourceToWinmd/ClangSharpSourceCompilation.cs b/sources/ClangSharpSourceToWinmd/ClangSharpSourceCompilation.cs index 1446b4bbe..dc356b238 100644 --- a/sources/ClangSharpSourceToWinmd/ClangSharpSourceCompilation.cs +++ b/sources/ClangSharpSourceToWinmd/ClangSharpSourceCompilation.cs @@ -205,9 +205,19 @@ public static ClangSharpSourceCompilation Create( watch.Restart(); HashSet enumsMakeFlagsHashSet = enumsMakeFlags != null ? new HashSet(enumsMakeFlags) : new HashSet(); + Architecture compilationArchitecture = arch switch + { + "x86" => Architecture.X86, + "x64" => Architecture.X64, + "arm64" => Architecture.Arm64, + _ => Architecture.None, + }; System.Threading.Tasks.Parallel.ForEach(FilesToTrees(modifiedFiles), opt, (tree) => { - var cleanedTree = MetadataSyntaxTreeCleaner.CleanSyntaxTree(tree, remaps, enumAdditions, enumsMakeFlagsHashSet, requiredNamespaces, staticLibs, apiNamesToNamespaces, infoFinder.EmptyStructs, infoFinder.EnumMemberNames, tree.FilePath, nativeFieldArrayInfo); + var treeArchitecture = GetArchitectureForFileName(tree.FilePath); + var cleanedTree = MetadataSyntaxTreeCleaner.CleanSyntaxTree(tree, remaps, enumAdditions, enumsMakeFlagsHashSet, requiredNamespaces, staticLibs, apiNamesToNamespaces, infoFinder.EmptyStructs, infoFinder.EnumMemberNames, tree.FilePath, nativeFieldArrayInfo, + (namespaceName, memberName) => infoFinder.GetEnumMemberReference(namespaceName, memberName, + treeArchitecture == Architecture.None ? compilationArchitecture : treeArchitecture)); WriteTree(cleanedTree, cleanedTree.FilePath); }); @@ -443,6 +453,7 @@ public TreeInfoFinder() public HashSet EnumMemberNames { get; } = new HashSet(); + private readonly Dictionary<(string Namespace, string Name, Architecture Architecture), HashSet> enumMemberReferences = new(); public void AnalyzeTree(SyntaxTree tree) { @@ -454,11 +465,39 @@ public override void VisitEnumMemberDeclaration(EnumMemberDeclarationSyntax node lock (this.EnumMemberNames) { this.EnumMemberNames.Add(node.Identifier.ValueText); + var key = (SyntaxUtils.GetEnclosingNamespace(node) ?? string.Empty, + node.Identifier.ValueText, GetArchitectureForFileName(node.SyntaxTree.FilePath)); + if (!this.enumMemberReferences.TryGetValue(key, out var references)) + { + references = new HashSet(); + this.enumMemberReferences.Add(key, references); + } + + references.Add("global::" + SyntaxUtils.GetFullName(node, true).Replace("::", ".")); } base.VisitEnumMemberDeclaration(node); } + public string GetEnumMemberReference(string namespaceName, string memberName, Architecture architecture) + { + var references = new HashSet(); + foreach (var candidate in new[] { Architecture.None, architecture }.Distinct()) + { + if (this.enumMemberReferences.TryGetValue((namespaceName, memberName, candidate), out var matches)) + { + references.UnionWith(matches); + } + } + + if (references.Count > 1) + { + throw new InvalidOperationException($"Ambiguous enum constant alias '{namespaceName}.{memberName}': {string.Join(", ", references.OrderBy(value => value, StringComparer.Ordinal))}."); + } + + return references.SingleOrDefault(); + } + public override void VisitStructDeclaration(StructDeclarationSyntax node) { if (!SyntaxUtils.IsEmptyStruct(node)) diff --git a/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs b/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs index fec2bc8e1..9a3bcde6a 100644 --- a/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs +++ b/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs @@ -15,9 +15,9 @@ public static class MetadataSyntaxTreeCleaner { public const string ArgListVarName = "__arglist__"; - public static SyntaxTree CleanSyntaxTree(SyntaxTree tree, Dictionary remaps, Dictionary> enumAdditions, HashSet enumsMakeFlags, Dictionary requiredNamespaces, Dictionary staticLibs, Dictionary apiNamesToNamespaces, HashSet nonEmptyStructs, HashSet enumMemberNames, string filePath, bool nativeFieldArrayInfo = false) + public static SyntaxTree CleanSyntaxTree(SyntaxTree tree, Dictionary remaps, Dictionary> enumAdditions, HashSet enumsMakeFlags, Dictionary requiredNamespaces, Dictionary staticLibs, Dictionary apiNamesToNamespaces, HashSet nonEmptyStructs, HashSet enumMemberNames, string filePath, bool nativeFieldArrayInfo = false, Func enumMemberReference = null) { - TreeRewriter treeRewriter = new TreeRewriter(remaps, enumAdditions, enumsMakeFlags, requiredNamespaces, staticLibs, apiNamesToNamespaces, nonEmptyStructs, enumMemberNames, nativeFieldArrayInfo); + TreeRewriter treeRewriter = new TreeRewriter(remaps, enumAdditions, enumsMakeFlags, requiredNamespaces, staticLibs, apiNamesToNamespaces, nonEmptyStructs, enumMemberNames, nativeFieldArrayInfo, enumMemberReference); var newRoot = (CSharpSyntaxNode)treeRewriter.Visit(tree.GetRoot()); var ret = CSharpSyntaxTree.Create(newRoot, null, filePath); return ret; @@ -43,8 +43,9 @@ private class TreeRewriter : CSharpSyntaxRewriter private HashSet enumsToMakeFlags; private HashSet usingNamespaces = new HashSet(); private readonly bool nativeFieldArrayInfo; + private readonly Func enumMemberReference; - public TreeRewriter(Dictionary remaps, Dictionary> enumAdditions, HashSet enumsToMakeFlags, Dictionary requiredNamespaces, Dictionary staticLibs, Dictionary apiNamesToNamespaces, HashSet nonEmptyStructs, HashSet enumMemberNames, bool nativeFieldArrayInfo) + public TreeRewriter(Dictionary remaps, Dictionary> enumAdditions, HashSet enumsToMakeFlags, Dictionary requiredNamespaces, Dictionary staticLibs, Dictionary apiNamesToNamespaces, HashSet nonEmptyStructs, HashSet enumMemberNames, bool nativeFieldArrayInfo, Func enumMemberReference) { this.remaps = remaps; this.InitRegexRemaps(); @@ -57,6 +58,7 @@ public TreeRewriter(Dictionary remaps, Dictionary Emit(fixture.DirectoryPath, architecture); + [Theory] + [InlineData("x86", "i686-pc-windows-msvc", false)] + [InlineData("x64", "x86_64-pc-windows-msvc", false)] + [InlineData("arm64", "aarch64-pc-windows-msvc", false)] + [InlineData("x86", "i686-pc-windows-msvc", true)] + [InlineData("x64", "x86_64-pc-windows-msvc", true)] + [InlineData("arm64", "aarch64-pc-windows-msvc", true)] + public void NativeEnumConstantAliasesReachFinalWinmd(string architecture, string target, bool common) + { + string[] names = + { + "WER_SUBMIT_ADD_REGISTERED_DATA", "WER_SUBMIT_HONOR_RECOVERY", "WER_SUBMIT_HONOR_RESTART", + "WER_SUBMIT_NO_ARCHIVE", "WER_SUBMIT_NO_CLOSE_UI", "WER_SUBMIT_NO_QUEUE", + "WER_SUBMIT_OUTOFPROCESS", "WER_SUBMIT_OUTOFPROCESS_ASYNC", "WER_SUBMIT_QUEUE", + "WER_SUBMIT_SHOW_DEBUG", "WER_SUBMIT_START_MINIMIZED", "WER_SUBMIT_BYPASS_DATA_THROTTLING", + "WER_SUBMIT_ARCHIVE_PARAMETERS_ONLY", "WER_SUBMIT_REPORT_MACHINE_ID", + }; + uint[] values = { 16, 1, 2, 256, 64, 128, 32, 1024, 4, 8, 512, 2048, 4096, 8192 }; + string declarations = "enum [[clang::flag_enum]] WER_SUBMIT_FLAGS : unsigned { " + + string.Join(", ", names.Zip(values, (name, value) => $"{name} = {value}")) + " };" + + " enum SIGNED_FLAGS : int { SIGNED_ALL = -1 };"; + using var fixture = new HeaderAnnotationTests.NativeFixture(architecture, target, declarations); + Assert.True(fixture.Run() == 0, fixture.Diagnostics); + if (common) + { + string commonDirectory = Path.Combine(fixture.DirectoryPath, "common"); + Directory.CreateDirectory(commonDirectory); + File.Move(fixture.Output, Path.Combine(commonDirectory, "Bindings.cs")); + } + File.WriteAllText(Path.Combine(fixture.DirectoryPath, "Aliases.constants.cs"), @" +namespace Other { public enum OtherFlags : uint { WER_SUBMIT_NO_QUEUE = 7 } } +namespace Test { public static class Apis { + public const uint WER_SUBMIT_NO_QUEUE = 128; + public const uint WER_SUBMIT_DISCARD_IF_QUEUED = WER_SUBMIT_NO_QUEUE; + public const uint ALIAS_CHAIN = WER_SUBMIT_DISCARD_IF_QUEUED; + public const uint SIGNED_ALL = 0xffffffff; + public const uint UNSIGNED_ALIAS = SIGNED_ALL; + public const uint UNRELATED = 9; + public const uint UNRELATED_ALIAS = UNRELATED; +}}"); + using var image = Emit(fixture, architecture); + var reader = image.Reader; + var flags = FindType(reader, "WER_SUBMIT_FLAGS"); + AssertHasAttribute(reader, flags.GetCustomAttributes(), "FlagsAttribute"); + AssertDoesNotHaveAttribute(reader, flags.GetCustomAttributes(), "ScopedEnumAttribute"); + var fields = flags.GetFields().Select(reader.GetFieldDefinition).ToArray(); + Assert.Equal("UInt32", fields[0].DecodeSignature(new SignatureNames(), null)); + Assert.Equal(names, fields.Skip(1).Select(field => reader.GetString(field.Name))); + Assert.Equal(values, fields.Skip(1).Select(ReadUInt32)); + var constants = FindType(reader, "Apis").GetFields().Select(reader.GetFieldDefinition) + .ToDictionary(field => reader.GetString(field.Name)); + Assert.All(constants.Values, field => + Assert.Equal("UInt32", field.DecodeSignature(new SignatureNames(), null))); + Assert.DoesNotContain("WER_SUBMIT_NO_QUEUE", constants.Keys); + Assert.DoesNotContain("SIGNED_ALL", constants.Keys); + Assert.Equal(128u, ReadUInt32(constants["WER_SUBMIT_DISCARD_IF_QUEUED"])); + Assert.Equal(128u, ReadUInt32(constants["ALIAS_CHAIN"])); + Assert.Equal(uint.MaxValue, ReadUInt32(constants["UNSIGNED_ALIAS"])); + Assert.Equal(9u, ReadUInt32(constants["UNRELATED_ALIAS"])); + Assert.Equal(7u, ReadUInt32(FindType(reader, "OtherFlags").GetFields().Select(reader.GetFieldDefinition) + .Single(field => reader.GetString(field.Name) == "WER_SUBMIT_NO_QUEUE"))); + AssertMetadataClosure(reader); + + uint ReadUInt32(FieldDefinition field) + { + var value = reader.GetConstant(field.GetDefaultValue()); + Assert.Equal(ConstantTypeCode.UInt32, value.TypeCode); + return reader.GetBlobReader(value.Value).ReadUInt32(); + } + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public void EnumConstantAliasesDoNotGuessAnotherNamespaceOrAmbiguousEnum(bool ambiguous) + { + using var fixture = new HeaderAnnotationTests.NativeFixture("x64", "x86_64-pc-windows-msvc", ""); + File.WriteAllText(Path.Combine(fixture.DirectoryPath, "Bindings.cs"), ambiguous ? @" +namespace Test { +public enum First { SHARED = 1 } +public enum Second { SHARED = 2 } +public static class Apis { public const int ALIAS = SHARED; } +}" : @" +namespace Other { public enum First { SHARED = 1 } } +namespace Test { public static class Apis { public const int ALIAS = SHARED; } }"); + if (ambiguous) + { + var exception = Assert.Throws(Create); + Assert.Contains(exception.Flatten().InnerExceptions, error => + error is InvalidOperationException && error.Message.Contains("Ambiguous enum constant alias 'Test.SHARED'")); + } + else + { + Assert.Contains(Create().GetDiagnostics(), diagnostic => diagnostic.Id == "CS0103"); + } + + ClangSharpSourceCompilation Create() => ClangSharpSourceCompilation.Create(fixture.DirectoryPath, "x64", + new Dictionary(), new Dictionary>(), Array.Empty(), + new Dictionary(), new Dictionary(), new HashSet(), + Array.Empty(), new Dictionary(), new Dictionary()); + } + [ServiceApiMigrationTheory] [InlineData("x86")] [InlineData("x64")] From 89a2ad02cda4f6eee30d639bf8707cf3902d594c Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 21:59:42 -0700 Subject: [PATCH 16/17] Preserve logical enum identity and grade exact native header contracts Keep the retained Power enum namespace after moving its use into headers. Grade four verified synthetic handle removals, 23 native signatures, complete lifecycle transfers, 164 enum associations and exact native constant transport without weakening other physical metadata. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 8 + .../WinSDK/requiredNamespacesForNames.rsp | 1 + .../WinHttpMigrationTests.cs | 596 +++++++++++++++++- 3 files changed, 591 insertions(+), 14 deletions(-) diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 381f2c2e7..117156d8d 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -92,6 +92,14 @@ member in the same namespace and applicable architecture, preserving the alias's declared constant type. Ambiguous bindings remain errors; do not add enum members, rewrite native values or suppress aliases merely because OLD omitted them. +Removing an authored enum use can also remove the namespace inference of a +retained, unmigrated logical enum. Preserve its existing namespace through the +existing global namespace-resolution configuration; do not retain a semantic +fallback use, duplicate the enum or allow a namespace change in the grade. +For a typed native constant that changes source-emission position, any physical +comparison adjustment must name that exact static literal, assert its complete +type/value/attribute shape, and preserve every other field's order and layout. + Keep expectations exact and source-backed, with zero unknown differences and zero unused expectations. There is no blanket native-derived difference or duplicate allowlist, and no assumption that faithful capture implies consumer compatibility. diff --git a/generation/WinSDK/requiredNamespacesForNames.rsp b/generation/WinSDK/requiredNamespacesForNames.rsp index dbcff5db3..b383ddb87 100644 --- a/generation/WinSDK/requiredNamespacesForNames.rsp +++ b/generation/WinSDK/requiredNamespacesForNames.rsp @@ -1865,6 +1865,7 @@ POWER_MONITOR_REQUEST_REASON=Windows.Win32.System.Power POWER_MONITOR_REQUEST_TYPE=Windows.Win32.System.Power POWER_PLATFORM_INFORMATION=Windows.Win32.System.Power POWER_PLATFORM_ROLE=Windows.Win32.System.Power +POWER_PLATFORM_ROLE_VERSION=Windows.Win32.System.Power POWER_REQUEST_TYPE=Windows.Win32.System.Power POWER_SESSION_ALLOW_EXTERNAL_DMA_DEVICES=Windows.Win32.System.Power POWER_SESSION_CONNECT=Windows.Win32.System.Power diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index 7c78b8070..bb7eedda5 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -22,6 +22,18 @@ public class WinHttpMigrationTests private const string WNetNamespace = "Windows.Win32.NetworkManagement.WNet"; private const string DhcpNamespace = "Windows.Win32.NetworkManagement.Dhcp"; private const string RestartManagerNamespace = "Windows.Win32.System.RestartManager"; + private const string BluetoothNamespace = "Windows.Win32.Devices.Bluetooth"; + private const string HidNamespace = "Windows.Win32.Devices.HumanInterfaceDevice"; + private const string WerNamespace = "Windows.Win32.System.ErrorReporting"; + private const string PowerNamespace = "Windows.Win32.System.Power"; + private const string CabinetsNamespace = "Windows.Win32.Storage.Cabinets"; + private const string WebSocketNamespace = "Windows.Win32.Networking.WebSocket"; + private const string FileHistoryNamespace = "Windows.Win32.Storage.FileHistory"; + private const string ProcessSnapshotNamespace = "Windows.Win32.System.Diagnostics.ProcessSnapshotting"; + private const string HidConstant = "HIDP_STATUS_I8242_TRANS_UNKNOWN"; + private const string WerAlias = "WER_SUBMIT_DISCARD_IF_QUEUED"; + private const string WerAliasField = "F|" + WerAlias + + "|Public, Static, Literal, HasDefault|UInt32|-1|UInt32:80000000||"; private readonly ITestOutputHelper output; private static readonly SignatureNames Signatures = new SignatureNames(); private static readonly (string Owner, string Member, string Enum, string Native)[] Associations = @@ -40,6 +52,21 @@ private static readonly (string Owner, string Member, string Enum, string Native "RmStartSession", "RmJoinSession", "RmEndSession", "RmRegisterResources", "RmGetList", "RmShutdown", "RmRestart", "RmCancelCurrentTask", "RmAddFilter", "RmRemoveFilter", "RmGetFilterList", }; + private static readonly string[] PowerErrorFunctions = + { + "PowerRegisterSuspendResumeNotification", "PowerUnregisterSuspendResumeNotification", "PowerGetActiveScheme", + "PowerReadACValue", "PowerReadDCValue", "PowerSetActiveScheme", "PowerSettingRegisterNotification", + "PowerSettingUnregisterNotification", "PowerCanRestoreIndividualDefaultPowerScheme", "PowerCreatePossibleSetting", + "PowerCreateSetting", "PowerDeleteScheme", "PowerDuplicateScheme", "PowerEnumerate", "PowerImportPowerScheme", + "PowerReadACValueIndex", "PowerReadDescription", "PowerReadFriendlyName", "PowerReadIconResourceSpecifier", + "PowerReadPossibleDescription", "PowerReadPossibleFriendlyName", "PowerReadPossibleValue", "PowerReadValueIncrement", + "PowerReadValueMax", "PowerReadValueMin", "PowerReadValueUnitsSpecifier", "PowerRemovePowerSetting", + "PowerReportThermalEvent", "PowerRestoreDefaultPowerSchemes", "PowerRestoreIndividualDefaultPowerScheme", + "PowerSettingAccessCheck", "PowerSettingAccessCheckEx", "PowerWriteACValueIndex", "PowerWriteDescription", + "PowerWriteFriendlyName", "PowerWriteIconResourceSpecifier", "PowerWritePossibleDescription", + "PowerWritePossibleFriendlyName", "PowerWritePossibleValue", "PowerWriteSettingAttributes", + "PowerWriteValueIncrement", "PowerWriteValueMax", "PowerWriteValueMin", "PowerWriteValueUnitsSpecifier", + }; private static readonly EnumUse[] ReviewedEnumUses = Associations .Select(value => new EnumUse(WinHttpNamespace, value.Owner, value.Member, value.Enum, value.Native)) .Concat(new[] @@ -137,7 +164,68 @@ private static readonly (string Owner, string Member, string Enum, string Native new EnumUse(WNetNamespace, "WNetUseConnectionW", "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"), }) .Concat(RestartManagerFunctions.Select(name => new EnumUse(RestartManagerNamespace, name, - "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"))).ToArray(); + "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"))) + .Concat(PowerErrorFunctions.Select(name => new EnumUse(PowerNamespace, name, + "return", "WIN32_ERROR", "UInt32", "Windows.Win32.Foundation"))) + .Concat(new[] + { + new EnumUse(WerNamespace, "WerRegisterFile", "dwFlags", "WER_FILE", "UInt32"), + new EnumUse(WerNamespace, "WerReportAddFile", "dwFileFlags", "WER_FILE", "UInt32"), + new EnumUse(WerNamespace, "WerReportSubmit", "dwFlags", "WER_SUBMIT_FLAGS", "UInt32"), + new EnumUse(WerNamespace, "WerGetFlags", "pdwFlags", "WER_FAULT_REPORTING", "UInt32*"), + new EnumUse(WerNamespace, "WerSetFlags", "dwFlags", "WER_FAULT_REPORTING", "UInt32"), + new EnumUse(PowerNamespace, "PowerDeterminePlatformRoleEx", "Version", "POWER_PLATFORM_ROLE_VERSION", "UInt32"), + new EnumUse(PowerNamespace, "PowerRegisterSuspendResumeNotification", "Flags", "REGISTER_NOTIFICATION_FLAGS", + "UInt32", "Windows.Win32.UI.WindowsAndMessaging"), + new EnumUse(PowerNamespace, "PowerSettingRegisterNotification", "Flags", "REGISTER_NOTIFICATION_FLAGS", + "UInt32", "Windows.Win32.UI.WindowsAndMessaging"), + new EnumUse(PowerNamespace, "PowerSettingAccessCheckEx", "AccessType", "REG_SAM_FLAGS", + "UInt32", "Windows.Win32.System.Registry"), + new EnumUse(CabinetsNamespace, "FDICreate", "cpuType", "FDICREATE_CPU_TYPE", "Int32"), + }).ToArray(); + private static readonly HandleUse[] ReviewedHandleUses = + { + new HandleUse(BluetoothNamespace, "BluetoothFindDeviceClose", "hFind", "HBLUETOOTH_DEVICE_FIND", "IntPtr"), + new HandleUse(BluetoothNamespace, "BluetoothFindFirstDevice", "return", "HBLUETOOTH_DEVICE_FIND", "IntPtr"), + new HandleUse(BluetoothNamespace, "BluetoothFindFirstRadio", "return", "HBLUETOOTH_RADIO_FIND", "IntPtr"), + new HandleUse(BluetoothNamespace, "BluetoothFindNextDevice", "hFind", "HBLUETOOTH_DEVICE_FIND", "IntPtr"), + new HandleUse(BluetoothNamespace, "BluetoothFindNextRadio", "hFind", "HBLUETOOTH_RADIO_FIND", "IntPtr"), + new HandleUse(BluetoothNamespace, "BluetoothFindRadioClose", "hFind", "HBLUETOOTH_RADIO_FIND", "IntPtr"), + new HandleUse(WerNamespace, "WerReportAddDump", "hReportHandle", "HREPORT", "IntPtr"), + new HandleUse(WerNamespace, "WerReportAddFile", "hReportHandle", "HREPORT", "IntPtr"), + new HandleUse(WerNamespace, "WerReportCloseHandle", "hReportHandle", "HREPORT", "IntPtr"), + new HandleUse(WerNamespace, "WerReportCreate", "phReportHandle", "HREPORT*", "IntPtr*"), + new HandleUse(WerNamespace, "WerReportSetParameter", "hReportHandle", "HREPORT", "IntPtr"), + new HandleUse(WerNamespace, "WerReportSetUIOption", "hReportHandle", "HREPORT", "IntPtr"), + new HandleUse(WerNamespace, "WerReportSubmit", "hReportHandle", "HREPORT", "IntPtr"), + new HandleUse(WerNamespace, "WerStoreClose", "hReportStore", "HREPORTSTORE", "Void*"), + new HandleUse(WerNamespace, "WerStoreGetFirstReportKey", "hReportStore", "HREPORTSTORE", "Void*"), + new HandleUse(WerNamespace, "WerStoreGetNextReportKey", "hReportStore", "HREPORTSTORE", "Void*"), + new HandleUse(WerNamespace, "WerStoreGetReportCount", "hReportStore", "HREPORTSTORE", "Void*"), + new HandleUse(WerNamespace, "WerStoreGetSizeOnDisk", "hReportStore", "HREPORTSTORE", "Void*"), + new HandleUse(WerNamespace, "WerStoreOpen", "phReportStore", "HREPORTSTORE*", "Void**"), + new HandleUse(WerNamespace, "WerStoreQueryReportMetadataV1", "hReportStore", "HREPORTSTORE", "Void*"), + new HandleUse(WerNamespace, "WerStoreQueryReportMetadataV2", "hReportStore", "HREPORTSTORE", "Void*"), + new HandleUse(WerNamespace, "WerStoreQueryReportMetadataV3", "hReportStore", "HREPORTSTORE", "Void*"), + new HandleUse(WerNamespace, "WerStoreUploadReport", "hReportStore", "HREPORTSTORE", "Void*"), + }; + private static readonly LifecycleTransfer[] ReviewedLifecycleTransfers = + { + new LifecycleTransfer(BluetoothNamespace, "HBLUETOOTH_DEVICE_FIND", "BluetoothFindFirstDevice", "return", "BluetoothFindDeviceClose", true), + new LifecycleTransfer(BluetoothNamespace, "HBLUETOOTH_RADIO_FIND", "BluetoothFindFirstRadio", "return", "BluetoothFindRadioClose", true), + new LifecycleTransfer(WerNamespace, "HREPORT", "WerReportCreate", "phReportHandle", "WerReportCloseHandle", true), + new LifecycleTransfer(WerNamespace, "HREPORTSTORE", "WerStoreOpen", "phReportStore", "WerStoreClose", true), + new LifecycleTransfer(WebSocketNamespace, "WEB_SOCKET_HANDLE", "WebSocketCreateClientHandle", "phWebSocket", "WebSocketDeleteHandle"), + new LifecycleTransfer(WebSocketNamespace, "WEB_SOCKET_HANDLE", "WebSocketCreateServerHandle", "phWebSocket", "WebSocketDeleteHandle"), + new LifecycleTransfer(FileHistoryNamespace, "FH_SERVICE_PIPE_HANDLE", "FhServiceOpenPipe", "Pipe", "FhServiceClosePipe"), + new LifecycleTransfer(ProcessSnapshotNamespace, "HPSSWALK", "PssWalkMarkerCreate", "WalkMarkerHandle", "PssWalkMarkerFree"), + }; + private static readonly string[] ReviewedNativeConstantSites = + { + BluetoothNamespace + ".Apis.AF_BTH", + HidNamespace + ".Apis." + HidConstant, + WerNamespace + ".Apis." + WerAlias, + }; private static readonly (string Namespace, string Owner, string Method, string Parameter)[] NativeRetvalUses = { ("Windows.Win32.Devices.Geolocation", "ICivicAddressReport", "GetAddressLine1", "pbstrAddress1"), @@ -389,7 +477,9 @@ public void CompleteNewImageClosesConstructorsAndFrozenOldDefectIsExplicit() using var old = Open("WINHTTP_MIGRATION_OLD"); using var current = Open("WINHTTP_MIGRATION_NEW"); Assert.Equal(37314, old.Reader.TypeDefinitions.Count); - Assert.Equal(old.Reader.TypeDefinitions.Count, current.Reader.TypeDefinitions.Count); + AssertReviewedTypeSet(old.Reader, current.Reader); + Assert.Equal(old.Reader.MethodDefinitions.Count, current.Reader.MethodDefinitions.Count); + Assert.Equal(old.Reader.FieldDefinitions.Count - 4 + 1, current.Reader.FieldDefinitions.Count); string[] beforeEnums = EnumIdentities(old.Reader); Assert.Equal(beforeEnums, EnumIdentities(current.Reader)); this.output.WriteLine($"Complete enum identity set unchanged: {beforeEnums.Length}; added 0, removed 0."); @@ -436,17 +526,23 @@ public void EveryPhysicalTypeHasOnlyReviewedHeaderChanges() using var current = Open("WINHTTP_MIGRATION_NEW"); var before = Types(control.Reader); var after = Types(current.Reader); - Assert.Equal(before.Keys.OrderBy(value => value), after.Keys.OrderBy(value => value)); + AssertReviewedTypeSet(control.Reader, current.Reader); + var removed = ReviewedLifecycleTransfers.Where(value => value.Synthetic) + .Select(value => value.TypeSite + "#124").ToHashSet(StringComparer.Ordinal); var used = new HashSet(StringComparer.Ordinal); var usedRetvals = new HashSet(StringComparer.Ordinal); var usedPreservedResults = new HashSet(StringComparer.Ordinal); var usedNativeDirections = new HashSet(StringComparer.Ordinal); + var usedHandles = new HashSet(StringComparer.Ordinal); + var usedLifecycles = new HashSet(StringComparer.Ordinal); + var usedConstants = new HashSet(StringComparer.Ordinal); int unchanged = 0; - foreach (var entry in before) + foreach (var entry in before.Where(value => !removed.Contains(value.Key))) { string expected = SnapshotType(control.Reader, entry.Value, normalizeReviewedChanges: true, usedEnumSites: used, usedRetvalSites: usedRetvals, usedPreservedResultSites: usedPreservedResults, - usedNativeDirectionSites: usedNativeDirections); + usedNativeDirectionSites: usedNativeDirections, usedHandleSites: usedHandles, + usedLifecycleSites: usedLifecycles, usedNativeConstantSites: usedConstants); string actual = SnapshotType(current.Reader, after[entry.Key]); Assert.True(expected == actual, $"Unexpected physical metadata change in {entry.Key}.\nExpected:\n{expected}\nActual:\n{actual}"); unchanged += SnapshotType(control.Reader, entry.Value) == actual ? 1 : 0; @@ -458,9 +554,94 @@ public void EveryPhysicalTypeHasOnlyReviewedHeaderChanges() usedPreservedResults.OrderBy(value => value)); Assert.Equal(NativeDirectionUses.Select(value => $"{value.Namespace}.{value.Owner}.{value.Method}.{value.Parameter}") .OrderBy(value => value), usedNativeDirections.OrderBy(value => value)); - this.output.WriteLine($"All {before.Count} physical types graded: {unchanged} unchanged; " + + Assert.Equal(ReviewedHandleUses.Select(value => value.Site).OrderBy(value => value), usedHandles.OrderBy(value => value)); + Assert.Equal(ReviewedLifecycleTransfers.Select(value => value.Site) + .Concat(ReviewedLifecycleTransfers.Where(value => !value.Synthetic).Select(value => value.TypeSite)).Distinct() + .OrderBy(value => value), usedLifecycles.OrderBy(value => value)); + Assert.Equal(ReviewedNativeConstantSites.OrderBy(value => value), usedConstants.OrderBy(value => value)); + this.output.WriteLine($"All {after.Count} surviving physical types graded; exactly {removed.Count} verified synthetic handles removed, 0 types added; " + + $"{unchanged} surviving types unchanged; " + $"{used.Count} exact native-type/AssociatedEnum sites, {usedRetvals.Count} native MIDL retval sites " + - $"{usedPreservedResults.Count} reviewed preserved-result site and {usedNativeDirections.Count} exact native SAL direction site normalized."); + $"{usedPreservedResults.Count} reviewed preserved-result site, {usedNativeDirections.Count} exact native SAL direction site, " + + $"{usedHandles.Count} native handle signature sites, {usedLifecycles.Count} lifecycle targets and {usedConstants.Count} exact native constant sites normalized."); + } + + [MigrationTheory] + [InlineData(1)] + [InlineData(2)] + [InlineData(4)] + public void NativeHandleContractsReachOnlyTheExactProducerTargets(int architecture) + { + using var old = Open("WINHTTP_MIGRATION_OLD"); + using var current = Open("WINHTTP_MIGRATION_NEW"); + foreach (var transfer in ReviewedLifecycleTransfers) + { + var original = Type(old.Reader, transfer.Type, architecture, transfer.Namespace); + string[] originalOwnership = Ownership(old.Reader, original.GetCustomAttributes()); + Assert.Equal(LifecycleAttributes(transfer.Cleanup), originalOwnership); + var method = Methods(current.Reader, transfer.Namespace, "Apis", architecture)[transfer.Method]; + var parameter = method.GetParameters().Select(current.Reader.GetParameter).Single(value => + transfer.Member == "return" ? value.SequenceNumber == 0 : current.Reader.GetString(value.Name) == transfer.Member); + Assert.Equal(transfer.Member == "return" ? ParameterAttributes.None : ParameterAttributes.Out, parameter.Attributes); + Assert.Equal(originalOwnership, Ownership(current.Reader, parameter.GetCustomAttributes())); + foreach (var other in method.GetParameters().Select(current.Reader.GetParameter) + .Where(value => value.SequenceNumber != parameter.SequenceNumber)) + Assert.Empty(Ownership(current.Reader, other.GetCustomAttributes())); + if (!transfer.Synthetic) + Assert.Empty(Ownership(current.Reader, Type(current.Reader, transfer.Type, architecture, transfer.Namespace).GetCustomAttributes())); + } + var snapshot = Type(current.Reader, "HPSS", architecture, ProcessSnapshotNamespace); + Assert.Empty(AttributeValues(current.Reader, snapshot.GetCustomAttributes(), "RAIIFreeAttribute")); + Assert.Equal(new[] + { + MetadataNamespace + ".InvalidHandleValueAttribute:010000000000000000000000", + MetadataNamespace + ".InvalidHandleValueAttribute:0100FFFFFFFFFFFFFFFF0000", + }, Ownership(current.Reader, snapshot.GetCustomAttributes())); + + static string[] Ownership(MetadataReader reader, CustomAttributeHandleCollection attributes) + => attributes.Where(handle => AttributeName(reader, handle) is "RAIIFreeAttribute" or "InvalidHandleValueAttribute") + .Select(handle => AttributeTypeName(reader, handle) + ":" + + Convert.ToHexString(reader.GetBlobBytes(reader.GetCustomAttribute(handle).Value))) + .OrderBy(value => value, StringComparer.Ordinal).ToArray(); + } + + [MigrationTheory] + [InlineData(1)] + [InlineData(2)] + [InlineData(4)] + public void NativeConstantTransportPreservesExactTypesValuesAndLogicalMembers(int architecture) + { + using var old = Open("WINHTTP_MIGRATION_OLD"); + using var current = Open("WINHTTP_MIGRATION_NEW"); + var original = Type(old.Reader, "Apis", architecture, WerNamespace); + var after = Type(current.Reader, "Apis", architecture, WerNamespace); + Assert.DoesNotContain(original.GetFields(), handle => old.Reader.GetString(old.Reader.GetFieldDefinition(handle).Name) == WerAlias); + var alias = after.GetFields().Select(current.Reader.GetFieldDefinition).Single(value => current.Reader.GetString(value.Name) == WerAlias); + Assert.Equal(FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal | FieldAttributes.HasDefault, alias.Attributes); + Assert.Equal("UInt32", alias.DecodeSignature(Signatures, null)); + Assert.Equal(-1, alias.GetOffset()); + Assert.True(alias.GetMarshallingDescriptor().IsNil); + Assert.Empty(alias.GetCustomAttributes()); + var constant = current.Reader.GetConstant(alias.GetDefaultValue()); + Assert.Equal(ConstantTypeCode.UInt32, constant.TypeCode); + Assert.Equal(new byte[] { 128, 0, 0, 0 }, current.Reader.GetBlobBytes(constant.Value)); + var flags = Type(current.Reader, "WER_SUBMIT_FLAGS", architecture, WerNamespace); + Assert.Equal(14, flags.GetFields().Select(current.Reader.GetFieldDefinition) + .Count(value => value.Attributes.HasFlag(FieldAttributes.Literal))); + Assert.Equal(SnapshotType(old.Reader, Type(old.Reader, "WER_SUBMIT_FLAGS", architecture, WerNamespace)), + SnapshotType(current.Reader, flags)); + foreach (var image in new[] { old, current }) + { + var apis = Type(image.Reader, "Apis", architecture, HidNamespace); + AssertHidConstant(image.Reader, apis.GetFields().Select(image.Reader.GetFieldDefinition) + .Single(value => image.Reader.GetString(value.Name) == HidConstant)); + apis = Type(image.Reader, "Apis", architecture, BluetoothNamespace); + AssertNativeLiteral(image.Reader, apis.GetFields().Select(image.Reader.GetFieldDefinition) + .Single(value => image.Reader.GetString(value.Name) == "AF_BTH"), + "UInt16", ConstantTypeCode.UInt16, new byte[] { 32, 0 }); + } + Assert.Equal(SnapshotType(old.Reader, Type(old.Reader, "POWER_PLATFORM_ROLE_VERSION", architecture, PowerNamespace)), + SnapshotType(current.Reader, Type(current.Reader, "POWER_PLATFORM_ROLE_VERSION", architecture, PowerNamespace))); } [MigrationTheory] @@ -526,6 +707,54 @@ public void RestartManagerHeaderFactsHaveNoAuthoredFallback() Assert.DoesNotContain("_Win32_ImportLibrary_", patch); } + [Fact] + public void IntegratedEnumAndLifecycleFactsHaveNoSemanticSidecarFallback() + { + string project = Path.Combine(RepositoryRoot, "generation", "WinSDK"); + string[] emitter = File.ReadAllLines(Path.Combine(project, "emitter.settings.rsp")); + foreach (var use in ReviewedEnumUses) + Assert.DoesNotContain(emitter, row => row.StartsWith(use.Owner + "::" + use.Member + "=", StringComparison.Ordinal)); + using var enums = JsonDocument.Parse(File.ReadAllText(Path.Combine(project, "enums.json"))); + string[] relocated = { "WER_FILE", "WER_SUBMIT_FLAGS", "WER_FAULT_REPORTING", + "DEVICE_POWER_CAPABILITIES", "FDICREATE_CPU_TYPE", "RM_APP_STATUS" }; + foreach (var item in enums.RootElement.GetProperty("items").EnumerateArray()) + { + if (item.TryGetProperty("name", out var name)) + Assert.DoesNotContain(name.GetString(), relocated); + if (!item.TryGetProperty("uses", out var uses)) + continue; + foreach (var use in uses.EnumerateArray()) + { + string owner = use.TryGetProperty("method", out var method) ? method.GetString() + : use.TryGetProperty("struct", out var record) ? record.GetString() : null; + string member = use.TryGetProperty("parameter", out var parameter) ? parameter.GetString() + : use.TryGetProperty("field", out var field) ? field.GetString() : null; + Assert.DoesNotContain(ReviewedEnumUses, expected => expected.Owner == owner && expected.Member == member); + } + } + using var types = JsonDocument.Parse(File.ReadAllText(Path.Combine(project, "autoTypes.json"))); + foreach (var transfer in ReviewedLifecycleTransfers) + { + var matches = types.RootElement.EnumerateArray() + .Where(value => value.GetProperty("Name").GetString() == transfer.Type).ToArray(); + if (transfer.Synthetic) + Assert.Empty(matches); + else + { + var type = Assert.Single(matches); + Assert.Equal("DECLARE_HANDLE", type.GetProperty("ValueType").GetString()); + Assert.True(type.GetProperty("NativeTypedef").GetBoolean()); + Assert.False(type.TryGetProperty("CloseApi", out _)); + Assert.False(type.TryGetProperty("InvalidHandleValues", out _)); + } + } + var snapshot = types.RootElement.EnumerateArray().Single(value => value.GetProperty("Name").GetString() == "HPSS"); + Assert.False(snapshot.TryGetProperty("CloseApi", out _)); + Assert.Equal(new[] { -1, 0 }, snapshot.GetProperty("InvalidHandleValues").EnumerateArray().Select(value => value.GetInt32())); + Assert.Contains("POWER_PLATFORM_ROLE_VERSION=" + PowerNamespace, + File.ReadAllLines(Path.Combine(project, "requiredNamespacesForNames.rsp"))); + } + [MigrationTheory] [InlineData(1)] [InlineData(2)] @@ -1020,6 +1249,202 @@ public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() Assert.DoesNotContain("parse-win32-annotations", File.ReadAllText(Path.Combine(project, "Partitions", partition, "settings.rsp"))); } + [Theory] + [InlineData("valid")] + [InlineData("wrong-value")] + [InlineData("wrong-type")] + [InlineData("wrong-flags")] + [InlineData("wrong-other-field-order")] + [InlineData("wrong-other-field-type")] + [InlineData("wrong-namespace")] + [InlineData("incomplete-old")] + [InlineData("instance-old")] + public void NativeConstantOrderNormalizationMovesOnlyTheExactStaticLiteral(string mutation) + { + using var old = Fixture(false, mutation); + using var current = Fixture(true, mutation); + var before = old.GetMetadataReader(); + var after = current.GetMetadataReader(); + var original = before.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(2)); + if (mutation is "incomplete-old" or "instance-old") + { + Assert.ThrowsAny(() => SnapshotType(before, original, normalizeReviewedChanges: true)); + return; + } + var used = new HashSet(StringComparer.Ordinal); + string expected = SnapshotType(before, original, normalizeReviewedChanges: true, usedNativeConstantSites: used); + string actual = SnapshotType(after, after.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(2))); + if (mutation == "valid") + { + Assert.Equal(expected, actual); + Assert.Equal(new[] { BluetoothNamespace + ".Apis.AF_BTH" }, used); + } + else + Assert.NotEqual(expected, actual); + if (mutation == "wrong-namespace") + Assert.Empty(used); + + static MetadataReaderProvider Fixture(bool native, string mutation) + { + var metadata = new MetadataBuilder(); + metadata.AddModule(0, metadata.GetOrAddString("Constants.winmd"), metadata.GetOrAddGuid(Guid.NewGuid()), default, default); + metadata.AddTypeDefinition(TypeAttributes.NotPublic, default, metadata.GetOrAddString(""), default, + MetadataTokens.FieldDefinitionHandle(1), MetadataTokens.MethodDefinitionHandle(1)); + metadata.AddTypeDefinition(TypeAttributes.Public | TypeAttributes.Abstract | TypeAttributes.Sealed, + metadata.GetOrAddString(mutation == "wrong-namespace" ? BluetoothNamespace + ".Other" : BluetoothNamespace), + metadata.GetOrAddString("Apis"), default, MetadataTokens.FieldDefinitionHandle(1), MetadataTokens.MethodDefinitionHandle(1)); + string[] names = native + ? mutation == "wrong-other-field-order" ? new[] { "One", "Three", "Two", "AF_BTH" } : new[] { "One", "Two", "Three", "AF_BTH" } + : new[] { "One", "AF_BTH", "Two", "Three" }; + foreach (string name in names) + { + var signature = new BlobBuilder(); + var encoder = new BlobEncoder(signature).FieldSignature(); + var attributes = FieldAttributes.Public | FieldAttributes.Static; + bool wide = native && mutation == "wrong-type"; + if (name == "AF_BTH") + { + if (wide) encoder.UInt32(); else encoder.UInt16(); + attributes |= FieldAttributes.Literal | FieldAttributes.HasDefault; + if (native && mutation == "wrong-flags") + attributes &= ~FieldAttributes.Literal; + if (!native && mutation == "instance-old") + attributes &= ~FieldAttributes.Static; + } + else if (native && mutation == "wrong-other-field-type" && name == "Two") + encoder.Int64(); + else + encoder.Int32(); + var field = metadata.AddFieldDefinition(attributes, metadata.GetOrAddString(name), metadata.GetOrAddBlob(signature)); + if (name == "AF_BTH") + { + if (wide) + metadata.AddConstant(field, 32U); + else + metadata.AddConstant(field, (ushort)((native && mutation == "wrong-value") || (!native && mutation == "incomplete-old") ? 33 : 32)); + } + } + var image = new BlobBuilder(); + new MetadataRootBuilder(metadata).Serialize(image, 0, 0); + return MetadataReaderProvider.FromMetadataImage(image.ToImmutableArray()); + } + } + + [Theory] + [InlineData("valid")] + [InlineData("missing-zero")] + [InlineData("missing-minus-one")] + [InlineData("duplicate-invalid")] + [InlineData("wrong-free")] + [InlineData("wrong-target")] + [InlineData("borrowed-input")] + [InlineData("missing-out")] + [InlineData("retained-type-ownership")] + [InlineData("wrong-native-type")] + [InlineData("incomplete-old")] + public void LifecycleNormalizationRequiresCompleteContractsAndExactTargets(string mutation) + { + using var old = Fixture(false, mutation); + using var current = Fixture(true, mutation); + var before = old.GetMetadataReader(); + var after = current.GetMetadataReader(); + var original = before.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(2)); + if (mutation == "incomplete-old") + { + Assert.ThrowsAny(() => SnapshotType(before, original, normalizeReviewedChanges: true)); + return; + } + var expected = new[] { 2, 3 }.Select(row => SnapshotType(before, + before.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(row)), normalizeReviewedChanges: true)).ToArray(); + var actual = new[] { 2, 3 }.Select(row => SnapshotType(after, + after.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(row)))).ToArray(); + if (mutation == "valid") + Assert.Equal(expected, actual); + else + Assert.NotEqual(expected, actual); + + static MetadataReaderProvider Fixture(bool native, string mutation) + { + var metadata = new MetadataBuilder(); + metadata.AddModule(0, metadata.GetOrAddString("Ownership.winmd"), metadata.GetOrAddGuid(Guid.NewGuid()), default, default); + var runtime = metadata.AddAssemblyReference(metadata.GetOrAddString("System.Runtime"), + new Version(10, 0), default, default, 0, default); + var valueType = metadata.AddTypeReference(runtime, metadata.GetOrAddString("System"), metadata.GetOrAddString("ValueType")); + metadata.AddTypeDefinition(TypeAttributes.NotPublic, default, metadata.GetOrAddString(""), default, + MetadataTokens.FieldDefinitionHandle(1), MetadataTokens.MethodDefinitionHandle(1)); + var handle = metadata.AddTypeDefinition(TypeAttributes.Public | TypeAttributes.SequentialLayout | TypeAttributes.Sealed, + metadata.GetOrAddString(WebSocketNamespace), metadata.GetOrAddString("WEB_SOCKET_HANDLE"), valueType, + MetadataTokens.FieldDefinitionHandle(1), MetadataTokens.MethodDefinitionHandle(1)); + var field = new BlobBuilder(); + new BlobEncoder(field).FieldSignature().IntPtr(); + metadata.AddFieldDefinition(FieldAttributes.Public, metadata.GetOrAddString("Value"), metadata.GetOrAddBlob(field)); + if (!native || mutation == "retained-type-ownership") + AddOwnership(handle, "WebSocketDeleteHandle", includeZero: mutation != "incomplete-old"); + metadata.AddTypeDefinition(TypeAttributes.Public | TypeAttributes.Abstract | TypeAttributes.Sealed, + metadata.GetOrAddString(WebSocketNamespace), metadata.GetOrAddString("Apis"), default, + MetadataTokens.FieldDefinitionHandle(2), MetadataTokens.MethodDefinitionHandle(1)); + var signature = new BlobBuilder(); + new BlobEncoder(signature).MethodSignature().Parameters(3, result => result.Type().Int32(), parameters => + { + parameters.AddParameter().Type().IntPtr(); + parameters.AddParameter().Type().UInt32(); + var output = parameters.AddParameter().Type(); + if (native && mutation == "wrong-native-type") + output.IntPtr(); + else + output.Pointer().Type(handle, isValueType: true); + }); + metadata.AddMethodDefinition(MethodAttributes.Public | MethodAttributes.Static, MethodImplAttributes.IL, + metadata.GetOrAddString("WebSocketCreateClientHandle"), metadata.GetOrAddBlob(signature), -1, + MetadataTokens.ParameterHandle(1)); + metadata.AddParameter(ParameterAttributes.None, default, 0); + var input = metadata.AddParameter(ParameterAttributes.In, metadata.GetOrAddString("pProperties"), 1); + metadata.AddParameter(ParameterAttributes.In, metadata.GetOrAddString("ulPropertyCount"), 2); + var result = metadata.AddParameter(native && mutation == "missing-out" ? ParameterAttributes.None : ParameterAttributes.Out, + metadata.GetOrAddString("phWebSocket"), 3); + if (native) + { + var target = mutation == "wrong-target" ? input : result; + AddOwnership(target, mutation == "wrong-free" ? "OtherFree" : "WebSocketDeleteHandle", + includeZero: mutation != "missing-zero", includeMinusOne: mutation != "missing-minus-one"); + if (mutation == "borrowed-input") + AddOwnership(input, "WebSocketDeleteHandle"); + if (mutation == "duplicate-invalid") + AddAttribute(result, "InvalidHandleValueAttribute", 0L); + } + var image = new BlobBuilder(); + new MetadataRootBuilder(metadata).Serialize(image, 0, 0); + return MetadataReaderProvider.FromMetadataImage(image.ToImmutableArray()); + + void AddOwnership(EntityHandle target, string cleanup, bool includeZero = true, bool includeMinusOne = true) + { + AddAttribute(target, "RAIIFreeAttribute", cleanup); + if (includeMinusOne) + AddAttribute(target, "InvalidHandleValueAttribute", -1L); + if (includeZero) + AddAttribute(target, "InvalidHandleValueAttribute", 0L); + } + + void AddAttribute(EntityHandle target, string name, object value) + { + var attribute = metadata.AddTypeReference(MetadataTokens.EntityHandle(1), + metadata.GetOrAddString(MetadataNamespace), metadata.GetOrAddString(name)); + var signature = new BlobBuilder(); + new BlobEncoder(signature).MethodSignature(isInstanceMethod: true).Parameters(1, result => result.Void(), parameters => + { + var type = parameters.AddParameter().Type(); + if (value is string) type.String(); else type.Int64(); + }); + var constructor = metadata.AddMemberReference(attribute, metadata.GetOrAddString(".ctor"), metadata.GetOrAddBlob(signature)); + var bytes = new BlobBuilder(); + bytes.WriteUInt16(1); + if (value is string text) bytes.WriteSerializedString(text); else bytes.WriteInt64((long)value); + bytes.WriteUInt16(0); + metadata.AddCustomAttribute(target, constructor, metadata.GetOrAddBlob(bytes)); + } + } + } + [Theory] [InlineData("valid")] [InlineData("wrong-enum")] @@ -1304,12 +1729,34 @@ private void AssertEveryPhysicalTypeUnchanged(MetadataReader expectedReader, Met this.output.WriteLine($"All {before.Count} {baseline} physical types unchanged; no scope-adoption normalization or allowances."); } + private static void AssertReviewedTypeSet(MetadataReader expectedReader, MetadataReader actualReader) + { + var before = Types(expectedReader); + var after = Types(actualReader); + var removed = ReviewedLifecycleTransfers.Where(value => value.Synthetic).ToArray(); + Assert.Equal(4, removed.Length); + foreach (var transfer in removed) + { + string key = transfer.TypeSite + "#124"; + Assert.True(before.ContainsKey(key), "Missing original synthetic handle: " + key); + Assert.DoesNotContain(key, after.Keys); + var attributes = LifecycleAttributes(transfer.Cleanup) + .Append(MetadataNamespace + ".NativeTypedefAttribute:01000000").OrderBy(value => value, StringComparer.Ordinal); + string expected = transfer.TypeSite + "\nPublic, SequentialLayout, Sealed, BeforeFieldInit|System.ValueType|0|0|" + + string.Join(",", attributes) + "\nF|Value|Public|Void*|-1|||"; + Assert.Equal(expected, SnapshotType(expectedReader, before[key])); + } + Assert.Equal(before.Keys.Except(removed.Select(value => value.TypeSite + "#124")).OrderBy(value => value), + after.Keys.OrderBy(value => value)); + } + internal static string SnapshotType(MetadataReader reader, TypeDefinition type, bool correctConstructorInstanceBits = false, bool normalizeReviewedChanges = false, ISet usedEnumSites = null, ISet usedRetvalSites = null, - ISet usedPreservedResultSites = null, ISet usedNativeDirectionSites = null) + ISet usedPreservedResultSites = null, ISet usedNativeDirectionSites = null, + ISet usedHandleSites = null, ISet usedLifecycleSites = null, ISet usedNativeConstantSites = null) { string Attributes(CustomAttributeHandleCollection values, string associatedEnum = null, bool nativeRetval = false, - bool preservedResult = false) + bool preservedResult = false, string cleanup = null, bool removeLifecycle = false) { var attributes = values.Select(handle => AttributeTypeName(reader, handle) + ":" + Convert.ToHexString(reader.GetBlobBytes(reader.GetCustomAttribute(handle).Value))).ToList(); @@ -1333,23 +1780,66 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum Assert.Equal(new byte[] { 1, 0, 0, 0 }, reader.GetBlobBytes(reader.GetCustomAttribute(attribute).Value)); Assert.True(attributes.Remove(MetadataNamespace + ".CanReturnMultipleSuccessValuesAttribute:01000000")); } + if (cleanup != null) + { + string[] ownership = values.Where(handle => AttributeName(reader, handle) is "RAIIFreeAttribute" or "InvalidHandleValueAttribute") + .Select(handle => AttributeTypeName(reader, handle) + ":" + + Convert.ToHexString(reader.GetBlobBytes(reader.GetCustomAttribute(handle).Value))) + .OrderBy(value => value, StringComparer.Ordinal).ToArray(); + string[] expected = LifecycleAttributes(cleanup); + if (removeLifecycle) + { + Assert.Equal(expected, ownership); + foreach (string value in expected) + Assert.True(attributes.Remove(value)); + } + else + { + Assert.Empty(ownership); + attributes.AddRange(expected); + } + } return string.Join(",", attributes.OrderBy(value => value, StringComparer.Ordinal)); } string Blob(BlobHandle blob) => blob.IsNil ? "" : Convert.ToHexString(reader.GetBlobBytes(blob)); string ns = reader.GetString(type.Namespace); string typeName = reader.GetString(type.Name); var uses = normalizeReviewedChanges ? ReviewedEnumUses.Where(value => value.Namespace == ns).ToArray() : Array.Empty(); + var handleUses = normalizeReviewedChanges + ? ReviewedHandleUses.Where(value => value.Namespace == ns).ToArray() : Array.Empty(); + var transfers = normalizeReviewedChanges + ? ReviewedLifecycleTransfers.Where(value => value.Namespace == ns).ToArray() : Array.Empty(); + var typeTransfer = transfers.FirstOrDefault(value => value.Type == typeName); + if (typeTransfer != null) + usedLifecycleSites?.Add(typeTransfer.TypeSite); var rows = new List { reader.GetString(type.Namespace) + "." + reader.GetString(type.Name), - $"{type.Attributes}|{FullName(reader, type.BaseType)}|{type.GetLayout().PackingSize}|{type.GetLayout().Size}|{Attributes(type.GetCustomAttributes())}", + $"{type.Attributes}|{FullName(reader, type.BaseType)}|{type.GetLayout().PackingSize}|{type.GetLayout().Size}|" + + Attributes(type.GetCustomAttributes(), cleanup: typeTransfer?.Cleanup, removeLifecycle: true), }; IEnumerable fields = type.GetFields(); - if (typeName == "Apis" && fields.All(handle => - reader.GetFieldDefinition(handle).Attributes.HasFlag(FieldAttributes.Static | FieldAttributes.Literal))) + bool sortedLiteralFields = typeName == "Apis" && fields.All(handle => + reader.GetFieldDefinition(handle).Attributes.HasFlag(FieldAttributes.Static | FieldAttributes.Literal)); + if (sortedLiteralFields) { fields = fields.OrderBy(handle => reader.GetString(reader.GetFieldDefinition(handle).Name), StringComparer.Ordinal); } + if (normalizeReviewedChanges && ns == HidNamespace && typeName == "Apis") + { + var field = fields.Select(reader.GetFieldDefinition).Single(value => reader.GetString(value.Name) == HidConstant); + AssertHidConstant(reader, field); + fields = fields.OrderBy(handle => reader.GetString(reader.GetFieldDefinition(handle).Name) == HidConstant); + usedNativeConstantSites?.Add(HidNamespace + ".Apis." + HidConstant); + } + if (normalizeReviewedChanges && ns == BluetoothNamespace && typeName == "Apis") + { + var field = fields.Select(reader.GetFieldDefinition).Single(value => reader.GetString(value.Name) == "AF_BTH"); + AssertNativeLiteral(reader, field, "UInt16", ConstantTypeCode.UInt16, new byte[] { 32, 0 }); + fields = fields.OrderBy(handle => reader.GetString(reader.GetFieldDefinition(handle).Name) == "AF_BTH"); + usedNativeConstantSites?.Add(BluetoothNamespace + ".Apis.AF_BTH"); + } + var fieldRows = new List(); foreach (var handle in fields) { var field = reader.GetFieldDefinition(handle); @@ -1364,9 +1854,19 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum } string constant = field.GetDefaultValue().IsNil ? "" : reader.GetConstant(field.GetDefaultValue()).TypeCode + ":" + Blob(reader.GetConstant(field.GetDefaultValue()).Value); - rows.Add($"F|{name}|{field.Attributes}|{fieldType}|{field.GetOffset()}|" + + fieldRows.Add($"F|{name}|{field.Attributes}|{fieldType}|{field.GetOffset()}|" + $"{constant}|{Blob(field.GetMarshallingDescriptor())}|{Attributes(field.GetCustomAttributes(), use?.Enum)}"); } + if (normalizeReviewedChanges && ns == WerNamespace && typeName == "Apis") + { + Assert.True(sortedLiteralFields); + Assert.DoesNotContain(fields, handle => reader.GetString(reader.GetFieldDefinition(handle).Name) == WerAlias); + fieldRows.Add(WerAliasField); + usedNativeConstantSites?.Add(WerNamespace + ".Apis." + WerAlias); + } + rows.AddRange(sortedLiteralFields + ? fieldRows.OrderBy(value => value.Split('|')[1], StringComparer.Ordinal) + : fieldRows); foreach (var handle in type.GetMethods()) { var method = reader.GetMethodDefinition(handle); @@ -1396,6 +1896,25 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum parameterEnums.Add(parameter.SequenceNumber, use.Enum); usedEnumSites?.Add(use.Site); } + foreach (var use in handleUses.Where(value => typeName == "Apis" && value.Method == methodName)) + { + var parameter = use.Member == "return" + ? parameters.Single(value => value.SequenceNumber == 0) + : parameters.Single(value => reader.GetString(value.Name) == use.Member); + if (use.Member == "return") + { + Assert.Equal("", reader.GetString(parameter.Name)); + Assert.Equal(use.OldType, returnType); + returnType = use.Native; + } + else + { + Assert.True(parameter.SequenceNumber > 0); + Assert.Equal(use.OldType, parameterTypes[parameter.SequenceNumber - 1]); + parameterTypes[parameter.SequenceNumber - 1] = use.Native; + } + usedHandleSites?.Add(use.Site); + } int header = signature.Header.RawValue; if (correctConstructorInstanceBits && reader.GetString(method.Name) == ".ctor" && !method.Attributes.HasFlag(MethodAttributes.Static) && !signature.Header.IsInstance) @@ -1430,7 +1949,15 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum parameterAttributes = direction.After; usedNativeDirectionSites?.Add($"{ns}.{typeName}.{methodName}.{parameterName}"); } - string attributes = Attributes(parameter.GetCustomAttributes(), parameterEnums.GetValueOrDefault(parameter.SequenceNumber), nativeRetval); + var transfer = transfers.SingleOrDefault(value => typeName == "Apis" && value.Method == methodName && + (value.Member == "return" ? parameter.SequenceNumber == 0 : value.Member == parameterName)); + if (transfer != null) + { + Assert.Equal(transfer.Member == "return" ? ParameterAttributes.None : ParameterAttributes.Out, parameter.Attributes); + usedLifecycleSites?.Add(transfer.Site); + } + string attributes = Attributes(parameter.GetCustomAttributes(), parameterEnums.GetValueOrDefault(parameter.SequenceNumber), + nativeRetval, cleanup: transfer?.Cleanup); rows.Add($"P|{parameter.SequenceNumber}|{reader.GetString(parameter.Name)}|{parameterAttributes}|" + $"{Blob(parameter.GetMarshallingDescriptor())}|{attributes}"); } @@ -1438,6 +1965,35 @@ string Attributes(CustomAttributeHandleCollection values, string associatedEnum return string.Join("\n", rows); } + private static string[] LifecycleAttributes(string cleanup) + { + var value = new BlobBuilder(); + value.WriteUInt16(1); + value.WriteSerializedString(cleanup); + value.WriteUInt16(0); + return new[] + { + MetadataNamespace + ".InvalidHandleValueAttribute:010000000000000000000000", + MetadataNamespace + ".InvalidHandleValueAttribute:0100FFFFFFFFFFFFFFFF0000", + MetadataNamespace + ".RAIIFreeAttribute:" + Convert.ToHexString(value.ToArray()), + }; + } + + private static void AssertHidConstant(MetadataReader reader, FieldDefinition field) + => AssertNativeLiteral(reader, field, "Windows.Win32.Foundation.NTSTATUS", ConstantTypeCode.Int32, new byte[] { 9, 0, 0x11, 0xc0 }); + + private static void AssertNativeLiteral(MetadataReader reader, FieldDefinition field, string signature, ConstantTypeCode typeCode, byte[] bytes) + { + Assert.Equal(FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal | FieldAttributes.HasDefault, field.Attributes); + Assert.Equal(signature, field.DecodeSignature(Signatures, null)); + Assert.Equal(-1, field.GetOffset()); + Assert.True(field.GetMarshallingDescriptor().IsNil); + Assert.Empty(field.GetCustomAttributes()); + var constant = reader.GetConstant(field.GetDefaultValue()); + Assert.Equal(typeCode, constant.TypeCode); + Assert.Equal(bytes, reader.GetBlobBytes(constant.Value)); + } + private static string Import(MetadataReader reader, MethodDefinition method) { var import = method.GetImport(); @@ -1541,6 +2097,18 @@ private sealed record EnumUse(string Namespace, string Owner, string Member, str internal string OldType => (EnumNamespace ?? Namespace) + "." + Enum + new string('*', Native.Length - Native.TrimEnd('*').Length); } + private sealed record HandleUse(string Namespace, string Method, string Member, string Type, string Native) + { + internal string Site => Namespace + "." + Method + "::" + Member; + internal string OldType => Namespace + "." + Type; + } + + private sealed record LifecycleTransfer(string Namespace, string Type, string Method, string Member, string Cleanup, bool Synthetic = false) + { + internal string Site => Namespace + ".Apis." + Method + "::" + Member; + internal string TypeSite => Namespace + "." + Type; + } + private static Image Open(string variable) => new Image(Environment.GetEnvironmentVariable(variable)); private static MetadataReaderProvider CreateClosureFixture(string mutation) From 9a1fd6f8526403ae3dff806c7345bd82a38c382a Mon Sep 17 00:00:00 2001 From: Jevan Saks Date: Thu, 15 Oct 2026 22:24:57 -0700 Subject: [PATCH 17/17] Record exact combined header image grade and held residuals Preserve all original117 declaration expectations and add320 exact source-backed entries after complete physical grading. Correct Restart Manager namespace lookups, explicitly retain the unqualified DHCP array residual, and verify unary cleanup bindings on actual producer targets. Both independently sourced images pass76 actual gates and the primary passes14 SDK cases; final CI remains separate. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/header-annotation-migration-playbook.md | 71 ++++ ...HeaderAnnotations.expected-differences.txt | 324 ++++++++++++++++++ .../WinHttpMigrationTests.cs | 22 +- 3 files changed, 414 insertions(+), 3 deletions(-) diff --git a/docs/header-annotation-migration-playbook.md b/docs/header-annotation-migration-playbook.md index 117156d8d..8a635c490 100644 --- a/docs/header-annotation-migration-playbook.md +++ b/docs/header-annotation-migration-playbook.md @@ -703,3 +703,74 @@ source details are not additional authored facts or a full-image grade. Broad physical closure, final OLD/control/NEW images and exact-head full-SDK CI remain integration-owner gates after ordered tooling/pilot adoption. Consumer compatibility remains **UNVERIFIED**. + +## Combined canonical image local grade + +The ordered owning inputs through Proc_Snap/Monitor/IdentityProvider are emitted +from two independent, unfiltered SDK scrapes at +`92fdfdc45ba7cd35b34ecc8e55034ce3eb78575b`: 321 actual owners and 393 scan legs +each. Their 813 generated C# files and eight discovery response files match +byte-for-byte. After the generic constant-alias correction and namespace +preservation, committed tooling/configuration +`89a2ad02cda4f6eee30d639bf8707cf3902d594c` re-emits separate hash-bound copies +without a frozen OLD source overlay. This is source reuse after emitter changes, +not a claim that a new scrape ran at that tooling commit. + +| Local image | SHA256 | +| --- | --- | +| Canonical full SDK | `B1F987EA8E7B78A6DA30480FD72B08B397464B1C601301B3A951EE3B7D3842CC` | +| Independent canonical repeat | `9437ADC219899CE777E6856A01F9AC685ED7DFC2DADA5FBAC9E2A2FD35DE7725` | +| Matched frozen OLD tooling control | `26B5BCBB4914575956788D47E77C2E9CF9540A231D9537673F1D4DBB5428696A` | + +Both full images have 37,310 physical types, 247,659 fields, 70,740 methods and +152,513 attributes. Their physical snapshots are literally identical without +reviewed-change normalization. All 7,791 enum identities, member order, values, +underlying types and flags remain unchanged, including the retained +`System.Power.POWER_PLATFORM_ROLE_VERSION` namespace. The control differs from +OLD only in the 39 known constructor instance-bit corrections. + +The exact declaration grade preserves all original 117 expectations and adds +320 measured entries, with zero unknown or unused differences: + +| Classification | Exact declaration entries | +| --- | ---: | +| Previously reviewed enum uses, native MIDL retval capture and preserved result | 117 | +| 140 further native-type/AssociatedEnum sites | 280 | +| Native `DhcpEnumSubnets.EnumInfo` In/Out contract | 1 | +| Native signatures at 23 exact handle-use sites | 23 | +| Eight producer lifecycle targets, three retained-type lifecycle removals and four fabricated typedef removals | 15 | +| Genuine native `WER_SUBMIT_DISCARD_IF_QUEUED` constant | 1 | + +The removed fabricated types are the two Bluetooth search handles and +`HREPORT`/`HREPORTSTORE`. Their exact signatures retain native `IntPtr`, +`Void*` and corresponding output pointer levels rather than imposing a uniform +handle representation. Every relocated producer keeps its complete authored +cleanup and invalid-value set `[-1,0]`; borrowed inputs gain no ownership. +`WEB_SOCKET_HANDLE`, `FH_SERVICE_PIPE_HANDLE` and `HPSSWALK` retain their +structural identities. `HPSS` remains invalid-only because `PssFreeSnapshot` +requires both process and snapshot handles, not a unary cleanup. + +The WER addition is the existing macro alias in `WerApi.h:294` to +`WER_SUBMIT_NO_QUEUE` at line 284: UInt32, value 128, all three architectures. +Its 14-member unscoped UInt32/Flags logical enum remains unchanged. +`AF_BTH` remains UInt16/value 32 and `HIDP_STATUS_I8242_TRANS_UNKNOWN` remains +the same native NTSTATUS/Int32 bit pattern `0xC0110009`. Their field-table position +adjustments name only these two static literals; every other field's order, type, +value, attributes and layout in those two mixed-field API holders remains +strictly graded. Existing API-only literal-row-order handling is unchanged; +instance and enum field order remains strict. + +Each full image passes all 76 actual physical/no-fallback/mutation cases without +skips. The primary image passes all 14 SDK integrity cases against the complete +fresh 1,179-file scratch set, including all 393 scan diagnostics. The first +combined test invocation's three wrong-namespace Restart Manager lookups and +overbroad DHCP fallback assertion are preserved as failed evidence; the tests +are corrected rather than changing metadata or removing the held DHCP row. + +Native field inference remains absent/default-off; the rejected 563-field image +is not admitted. The exact `DHCP_IP_ARRAY::Elements` CountParamIndex=0 sidecar +and the held DWM storage override remain. Root `7ea6c85d` is not implicitly +inherited. These local receipts do not replace final-head CI and downloaded-image +qualification in the draft review report. Managed projection/source effects of +the native signatures, output ownership and newly captured native facts remain +**UNVERIFIED**; no consumer work is implied by producer equivalence. diff --git a/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt b/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt index 6589f7660..985ed341f 100644 --- a/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt +++ b/generation/WinSDK/patches/HeaderAnnotations.expected-differences.txt @@ -2,6 +2,9 @@ # Existing logical-enum use sites become native integers plus AssociatedEnum. # Exact native MIDL retval comments add RetValAttribute; CLI parameter flags stay unchanged. # Preserve OLD logical scheme members and ordinary native constants. +# Four fabricated handle typedefs give way to exact native signatures and eight complete producer cleanup/[-1,0] targets. +# DhcpEnumSubnets.EnumInfo faithfully captures the native In/Out contract; its separate legacy array sidecar remains held. +# WerApi.h:284,294 supplies the genuine UInt32 WER_SUBMIT_DISCARD_IF_QUEUED alias, value 128; no enum member is added. # No import, OS, last-error, callback, port, dependent-partition, or value changes. Windows.Win32.Networking.WinHttp.Apis.WinHttpCreateUrl : parameter 2 (dwFlags) : [In] => [AssociatedEnum(WIN_HTTP_CREATE_URL_FLAGS),In] Windows.Win32.Networking.WinHttp.Apis.WinHttpCreateUrl : parameter 2 (dwFlags)...Windows.Win32.Networking.WinHttp.WIN_HTTP_CREATE_URL_FLAGS => System.UInt32 @@ -121,3 +124,324 @@ Windows.Win32.Devices.Geolocation.ILocationReportFactory.get_Status : parameter Windows.Win32.Networking.NetworkListManager.INetworkConnection2.IsDomainAuthenticatedBy : parameter 2 (pValue) : [Out] => [Out,RetVal] # Review-approved authored-result representation, not native annotation discovery. Windows.Win32.System.Com.Events.IEnumEventObject.Reset : [CanReturnMultipleSuccessValues,Documentation(https://learn.microsoft.com/windows/win32/api/eventsys/nf-eventsys-ienumeventobject-reset)] => [Documentation(https://learn.microsoft.com/windows/win32/api/eventsys/nf-eventsys-ienumeventobject-reset),PreserveSig] +# Exact source-backed Network/System/FDI associations, native handle contracts and genuine WER alias; complete physical enum/field/value/ownership grade required. +Windows.Win32.Devices.Bluetooth.Apis.BluetoothFindDeviceClose : parameter 1 (hFind)...Windows.Win32.Devices.Bluetooth.HBLUETOOTH_DEVICE_FIND => System.IntPtr +Windows.Win32.Devices.Bluetooth.Apis.BluetoothFindFirstDevice : return : => [InvalidHandleValue(-1),InvalidHandleValue(0),RAIIFree(BluetoothFindDeviceClose)] +Windows.Win32.Devices.Bluetooth.Apis.BluetoothFindFirstDevice : return...Windows.Win32.Devices.Bluetooth.HBLUETOOTH_DEVICE_FIND => System.IntPtr +Windows.Win32.Devices.Bluetooth.Apis.BluetoothFindFirstRadio : return : => [InvalidHandleValue(-1),InvalidHandleValue(0),RAIIFree(BluetoothFindRadioClose)] +Windows.Win32.Devices.Bluetooth.Apis.BluetoothFindFirstRadio : return...Windows.Win32.Devices.Bluetooth.HBLUETOOTH_RADIO_FIND => System.IntPtr +Windows.Win32.Devices.Bluetooth.Apis.BluetoothFindNextDevice : parameter 1 (hFind)...Windows.Win32.Devices.Bluetooth.HBLUETOOTH_DEVICE_FIND => System.IntPtr +Windows.Win32.Devices.Bluetooth.Apis.BluetoothFindNextRadio : parameter 1 (hFind)...Windows.Win32.Devices.Bluetooth.HBLUETOOTH_RADIO_FIND => System.IntPtr +Windows.Win32.Devices.Bluetooth.Apis.BluetoothFindRadioClose : parameter 1 (hFind)...Windows.Win32.Devices.Bluetooth.HBLUETOOTH_RADIO_FIND => System.IntPtr +Windows.Win32.Devices.Bluetooth.HBLUETOOTH_DEVICE_FIND removed +Windows.Win32.Devices.Bluetooth.HBLUETOOTH_RADIO_FIND removed +Windows.Win32.Networking.WebSocket.Apis.WebSocketCreateClientHandle : parameter 3 (phWebSocket) : [Out] => [InvalidHandleValue(-1),InvalidHandleValue(0),Out,RAIIFree(WebSocketDeleteHandle)] +Windows.Win32.Networking.WebSocket.Apis.WebSocketCreateServerHandle : parameter 3 (phWebSocket) : [Out] => [InvalidHandleValue(-1),InvalidHandleValue(0),Out,RAIIFree(WebSocketDeleteHandle)] +Windows.Win32.Networking.WebSocket.WEB_SOCKET_HANDLE : [InvalidHandleValue(-1),InvalidHandleValue(0),NativeTypedef,RAIIFree(WebSocketDeleteHandle)] => [NativeTypedef] +Windows.Win32.NetworkManagement.Dhcp.Apis.DhcpEnumSubnets : parameter 4 (EnumInfo) : [Out] => [In,Out] +Windows.Win32.NetworkManagement.WNet.Apis.NPAddConnection3 : parameter 5 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.NPAddConnection3 : parameter 5 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.NPFormatNetworkName : parameter 4 (dwFlags) : [In] => [AssociatedEnum(NETWORK_NAME_FORMAT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.NPFormatNetworkName : parameter 4 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NETWORK_NAME_FORMAT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.NPGetUniversalName : parameter 2 (dwInfoLevel) : [In] => [AssociatedEnum(UNC_INFO_LEVEL),In] +Windows.Win32.NetworkManagement.WNet.Apis.NPGetUniversalName : parameter 2 (dwInfoLevel)...Windows.Win32.NetworkManagement.WNet.UNC_INFO_LEVEL => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection2A : parameter 4 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection2A : parameter 4 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection2A : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection2A : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection2W : parameter 4 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection2W : parameter 4 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection2W : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection2W : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection3A : parameter 5 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection3A : parameter 5 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection3A : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection3A : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection3W : parameter 5 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection3W : parameter 5 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection3W : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection3W : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection4A : parameter 5 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection4A : parameter 5 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection4A : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection4A : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection4W : parameter 5 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection4W : parameter 5 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection4W : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnection4W : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnectionA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnectionA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnectionW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetAddConnectionW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnection2A : parameter 2 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnection2A : parameter 2 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnection2A : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnection2A : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnection2W : parameter 2 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnection2W : parameter 2 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnection2W : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnection2W : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnectionA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnectionA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnectionW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetCancelConnectionW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetCloseEnum : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetCloseEnum : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetConnectionDialog : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetConnectionDialog : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetConnectionDialog1A : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetConnectionDialog1A : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetConnectionDialog1W : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetConnectionDialog1W : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetDisconnectDialog : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetDisconnectDialog : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetDisconnectDialog1A : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetDisconnectDialog1A : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetDisconnectDialog1W : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetDisconnectDialog1W : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetEnumResourceA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetEnumResourceA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetEnumResourceW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetEnumResourceW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetConnectionA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetConnectionA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetConnectionW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetConnectionW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetLastErrorA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetLastErrorA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetLastErrorW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetLastErrorW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetNetworkInformationA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetNetworkInformationA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetNetworkInformationW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetNetworkInformationW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetProviderNameA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetProviderNameA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetProviderNameW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetProviderNameW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetResourceInformationA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetResourceInformationA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetResourceInformationW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetResourceInformationW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetResourceParentA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetResourceParentA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetResourceParentW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetResourceParentW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUniversalNameA : parameter 2 (dwInfoLevel) : [In] => [AssociatedEnum(UNC_INFO_LEVEL),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUniversalNameA : parameter 2 (dwInfoLevel)...Windows.Win32.NetworkManagement.WNet.UNC_INFO_LEVEL => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUniversalNameA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUniversalNameA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUniversalNameW : parameter 2 (dwInfoLevel) : [In] => [AssociatedEnum(UNC_INFO_LEVEL),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUniversalNameW : parameter 2 (dwInfoLevel)...Windows.Win32.NetworkManagement.WNet.UNC_INFO_LEVEL => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUniversalNameW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUniversalNameW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUserA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUserA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUserW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetGetUserW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumA : parameter 1 (dwScope) : [In] => [AssociatedEnum(NET_RESOURCE_SCOPE),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumA : parameter 1 (dwScope)...Windows.Win32.NetworkManagement.WNet.NET_RESOURCE_SCOPE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumA : parameter 2 (dwType) : [In] => [AssociatedEnum(NET_RESOURCE_TYPE),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumA : parameter 2 (dwType)...Windows.Win32.NetworkManagement.WNet.NET_RESOURCE_TYPE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumA : parameter 3 (dwUsage) : [In] => [AssociatedEnum(WNET_OPEN_ENUM_USAGE),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumA : parameter 3 (dwUsage)...Windows.Win32.NetworkManagement.WNet.WNET_OPEN_ENUM_USAGE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumW : parameter 1 (dwScope) : [In] => [AssociatedEnum(NET_RESOURCE_SCOPE),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumW : parameter 1 (dwScope)...Windows.Win32.NetworkManagement.WNet.NET_RESOURCE_SCOPE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumW : parameter 2 (dwType) : [In] => [AssociatedEnum(NET_RESOURCE_TYPE),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumW : parameter 2 (dwType)...Windows.Win32.NetworkManagement.WNet.NET_RESOURCE_TYPE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumW : parameter 3 (dwUsage) : [In] => [AssociatedEnum(WNET_OPEN_ENUM_USAGE),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumW : parameter 3 (dwUsage)...Windows.Win32.NetworkManagement.WNet.WNET_OPEN_ENUM_USAGE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetOpenEnumW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnection4A : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnection4A : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnection4W : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnection4W : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnectionA : parameter 5 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnectionA : parameter 5 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnectionA : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnectionA : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnectionW : parameter 5 (dwFlags) : [In] => [AssociatedEnum(NET_CONNECT_FLAGS),In] +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnectionW : parameter 5 (dwFlags)...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnectionW : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.Apis.WNetUseConnectionW : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.CONNECTDLGSTRUCTA.dwFlags : => [AssociatedEnum(CONNECTDLGSTRUCT_FLAGS)] +Windows.Win32.NetworkManagement.WNet.CONNECTDLGSTRUCTA.dwFlags...Windows.Win32.NetworkManagement.WNet.CONNECTDLGSTRUCT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.CONNECTDLGSTRUCTW.dwFlags : => [AssociatedEnum(CONNECTDLGSTRUCT_FLAGS)] +Windows.Win32.NetworkManagement.WNet.CONNECTDLGSTRUCTW.dwFlags...Windows.Win32.NetworkManagement.WNet.CONNECTDLGSTRUCT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.DISCDLGSTRUCTA.dwFlags : => [AssociatedEnum(DISCDLGSTRUCT_FLAGS)] +Windows.Win32.NetworkManagement.WNet.DISCDLGSTRUCTA.dwFlags...Windows.Win32.NetworkManagement.WNet.DISCDLGSTRUCT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.DISCDLGSTRUCTW.dwFlags : => [AssociatedEnum(DISCDLGSTRUCT_FLAGS)] +Windows.Win32.NetworkManagement.WNet.DISCDLGSTRUCTW.dwFlags...Windows.Win32.NetworkManagement.WNet.DISCDLGSTRUCT_FLAGS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.NETINFOSTRUCT.dwCharacteristics : => [AssociatedEnum(NETINFOSTRUCT_CHARACTERISTICS)] +Windows.Win32.NetworkManagement.WNet.NETINFOSTRUCT.dwCharacteristics...Windows.Win32.NetworkManagement.WNet.NETINFOSTRUCT_CHARACTERISTICS => System.UInt32 +Windows.Win32.NetworkManagement.WNet.NETINFOSTRUCT.dwStatus : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.NetworkManagement.WNet.NETINFOSTRUCT.dwStatus...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.NetworkManagement.WNet.NETRESOURCEA.dwScope : => [AssociatedEnum(NET_RESOURCE_SCOPE)] +Windows.Win32.NetworkManagement.WNet.NETRESOURCEA.dwScope...Windows.Win32.NetworkManagement.WNet.NET_RESOURCE_SCOPE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.NETRESOURCEA.dwType : => [AssociatedEnum(NET_RESOURCE_TYPE)] +Windows.Win32.NetworkManagement.WNet.NETRESOURCEA.dwType...Windows.Win32.NetworkManagement.WNet.NET_RESOURCE_TYPE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.NETRESOURCEW.dwScope : => [AssociatedEnum(NET_RESOURCE_SCOPE)] +Windows.Win32.NetworkManagement.WNet.NETRESOURCEW.dwScope...Windows.Win32.NetworkManagement.WNet.NET_RESOURCE_SCOPE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.NETRESOURCEW.dwType : => [AssociatedEnum(NET_RESOURCE_TYPE)] +Windows.Win32.NetworkManagement.WNet.NETRESOURCEW.dwType...Windows.Win32.NetworkManagement.WNet.NET_RESOURCE_TYPE => System.UInt32 +Windows.Win32.NetworkManagement.WNet.NOTIFYADD.dwAddFlags : => [AssociatedEnum(NET_CONNECT_FLAGS)] +Windows.Win32.NetworkManagement.WNet.NOTIFYADD.dwAddFlags...Windows.Win32.NetworkManagement.WNet.NET_CONNECT_FLAGS => System.UInt32 +Windows.Win32.Storage.Cabinets.Apis.FDICreate : parameter 8 (cpuType) : [In] => [AssociatedEnum(FDICREATE_CPU_TYPE),In] +Windows.Win32.Storage.Cabinets.Apis.FDICreate : parameter 8 (cpuType)...Windows.Win32.Storage.Cabinets.FDICREATE_CPU_TYPE => System.Int32 +Windows.Win32.Storage.FileHistory.Apis.FhServiceOpenPipe : parameter 2 (Pipe) : [Out] => [InvalidHandleValue(-1),InvalidHandleValue(0),Out,RAIIFree(FhServiceClosePipe)] +Windows.Win32.Storage.FileHistory.FH_SERVICE_PIPE_HANDLE : [InvalidHandleValue(-1),InvalidHandleValue(0),NativeTypedef,RAIIFree(FhServiceClosePipe)] => [NativeTypedef] +Windows.Win32.System.Diagnostics.ProcessSnapshotting.Apis.PssWalkMarkerCreate : parameter 2 (WalkMarkerHandle) : [Out] => [InvalidHandleValue(-1),InvalidHandleValue(0),Out,RAIIFree(PssWalkMarkerFree)] +Windows.Win32.System.Diagnostics.ProcessSnapshotting.HPSSWALK : [InvalidHandleValue(-1),InvalidHandleValue(0),NativeTypedef,RAIIFree(PssWalkMarkerFree)] => [NativeTypedef] +Windows.Win32.System.ErrorReporting.Apis.WER_SUBMIT_DISCARD_IF_QUEUED added +Windows.Win32.System.ErrorReporting.Apis.WerGetFlags : parameter 2 (pdwFlags) : [Out] => [AssociatedEnum(WER_FAULT_REPORTING),Out] +Windows.Win32.System.ErrorReporting.Apis.WerGetFlags : parameter 2 (pdwFlags)...Windows.Win32.System.ErrorReporting.WER_FAULT_REPORTING* => System.UInt32* +Windows.Win32.System.ErrorReporting.Apis.WerRegisterFile : parameter 3 (dwFlags) : [In] => [AssociatedEnum(WER_FILE),In] +Windows.Win32.System.ErrorReporting.Apis.WerRegisterFile : parameter 3 (dwFlags)...Windows.Win32.System.ErrorReporting.WER_FILE => System.UInt32 +Windows.Win32.System.ErrorReporting.Apis.WerReportAddDump : parameter 1 (hReportHandle)...Windows.Win32.System.ErrorReporting.HREPORT => System.IntPtr +Windows.Win32.System.ErrorReporting.Apis.WerReportAddFile : parameter 1 (hReportHandle)...Windows.Win32.System.ErrorReporting.HREPORT => System.IntPtr +Windows.Win32.System.ErrorReporting.Apis.WerReportAddFile : parameter 4 (dwFileFlags) : [In] => [AssociatedEnum(WER_FILE),In] +Windows.Win32.System.ErrorReporting.Apis.WerReportAddFile : parameter 4 (dwFileFlags)...Windows.Win32.System.ErrorReporting.WER_FILE => System.UInt32 +Windows.Win32.System.ErrorReporting.Apis.WerReportCloseHandle : parameter 1 (hReportHandle)...Windows.Win32.System.ErrorReporting.HREPORT => System.IntPtr +Windows.Win32.System.ErrorReporting.Apis.WerReportCreate : parameter 4 (phReportHandle) : [Out] => [InvalidHandleValue(-1),InvalidHandleValue(0),Out,RAIIFree(WerReportCloseHandle)] +Windows.Win32.System.ErrorReporting.Apis.WerReportCreate : parameter 4 (phReportHandle)...Windows.Win32.System.ErrorReporting.HREPORT* => System.IntPtr* +Windows.Win32.System.ErrorReporting.Apis.WerReportSetParameter : parameter 1 (hReportHandle)...Windows.Win32.System.ErrorReporting.HREPORT => System.IntPtr +Windows.Win32.System.ErrorReporting.Apis.WerReportSetUIOption : parameter 1 (hReportHandle)...Windows.Win32.System.ErrorReporting.HREPORT => System.IntPtr +Windows.Win32.System.ErrorReporting.Apis.WerReportSubmit : parameter 1 (hReportHandle)...Windows.Win32.System.ErrorReporting.HREPORT => System.IntPtr +Windows.Win32.System.ErrorReporting.Apis.WerReportSubmit : parameter 3 (dwFlags) : [In] => [AssociatedEnum(WER_SUBMIT_FLAGS),In] +Windows.Win32.System.ErrorReporting.Apis.WerReportSubmit : parameter 3 (dwFlags)...Windows.Win32.System.ErrorReporting.WER_SUBMIT_FLAGS => System.UInt32 +Windows.Win32.System.ErrorReporting.Apis.WerSetFlags : parameter 1 (dwFlags) : [In] => [AssociatedEnum(WER_FAULT_REPORTING),In] +Windows.Win32.System.ErrorReporting.Apis.WerSetFlags : parameter 1 (dwFlags)...Windows.Win32.System.ErrorReporting.WER_FAULT_REPORTING => System.UInt32 +Windows.Win32.System.ErrorReporting.Apis.WerStoreClose : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.Apis.WerStoreGetFirstReportKey : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.Apis.WerStoreGetNextReportKey : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.Apis.WerStoreGetReportCount : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.Apis.WerStoreGetSizeOnDisk : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.Apis.WerStoreOpen : parameter 2 (phReportStore) : [Out] => [InvalidHandleValue(-1),InvalidHandleValue(0),Out,RAIIFree(WerStoreClose)] +Windows.Win32.System.ErrorReporting.Apis.WerStoreOpen : parameter 2 (phReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE* => System.Void** +Windows.Win32.System.ErrorReporting.Apis.WerStoreQueryReportMetadataV1 : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.Apis.WerStoreQueryReportMetadataV2 : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.Apis.WerStoreQueryReportMetadataV3 : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.Apis.WerStoreUploadReport : parameter 1 (hReportStore)...Windows.Win32.System.ErrorReporting.HREPORTSTORE => System.Void* +Windows.Win32.System.ErrorReporting.HREPORT removed +Windows.Win32.System.ErrorReporting.HREPORTSTORE removed +Windows.Win32.System.Power.Apis.PowerCanRestoreIndividualDefaultPowerScheme : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerCanRestoreIndividualDefaultPowerScheme : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerCreatePossibleSetting : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerCreatePossibleSetting : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerCreateSetting : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerCreateSetting : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerDeleteScheme : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerDeleteScheme : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerDeterminePlatformRoleEx : parameter 1 (Version) : [In] => [AssociatedEnum(POWER_PLATFORM_ROLE_VERSION),In] +Windows.Win32.System.Power.Apis.PowerDeterminePlatformRoleEx : parameter 1 (Version)...Windows.Win32.System.Power.POWER_PLATFORM_ROLE_VERSION => System.UInt32 +Windows.Win32.System.Power.Apis.PowerDuplicateScheme : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerDuplicateScheme : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerEnumerate : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerEnumerate : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerGetActiveScheme : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerGetActiveScheme : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerImportPowerScheme : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerImportPowerScheme : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadACValue : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadACValue : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadACValueIndex : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadACValueIndex : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadDCValue : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadDCValue : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadDescription : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadDescription : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadFriendlyName : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadFriendlyName : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadIconResourceSpecifier : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadIconResourceSpecifier : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadPossibleDescription : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadPossibleDescription : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadPossibleFriendlyName : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadPossibleFriendlyName : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadPossibleValue : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadPossibleValue : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadValueIncrement : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadValueIncrement : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadValueMax : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadValueMax : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadValueMin : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadValueMin : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReadValueUnitsSpecifier : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReadValueUnitsSpecifier : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerRegisterSuspendResumeNotification : parameter 1 (Flags) : [In] => [AssociatedEnum(REGISTER_NOTIFICATION_FLAGS),In] +Windows.Win32.System.Power.Apis.PowerRegisterSuspendResumeNotification : parameter 1 (Flags)...Windows.Win32.UI.WindowsAndMessaging.REGISTER_NOTIFICATION_FLAGS => System.UInt32 +Windows.Win32.System.Power.Apis.PowerRegisterSuspendResumeNotification : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerRegisterSuspendResumeNotification : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerRemovePowerSetting : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerRemovePowerSetting : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerReportThermalEvent : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerReportThermalEvent : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerRestoreDefaultPowerSchemes : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerRestoreDefaultPowerSchemes : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerRestoreIndividualDefaultPowerScheme : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerRestoreIndividualDefaultPowerScheme : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerSetActiveScheme : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerSetActiveScheme : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerSettingAccessCheck : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerSettingAccessCheck : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerSettingAccessCheckEx : parameter 3 (AccessType) : [In] => [AssociatedEnum(REG_SAM_FLAGS),In] +Windows.Win32.System.Power.Apis.PowerSettingAccessCheckEx : parameter 3 (AccessType)...Windows.Win32.System.Registry.REG_SAM_FLAGS => System.UInt32 +Windows.Win32.System.Power.Apis.PowerSettingAccessCheckEx : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerSettingAccessCheckEx : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerSettingRegisterNotification : parameter 2 (Flags) : [In] => [AssociatedEnum(REGISTER_NOTIFICATION_FLAGS),In] +Windows.Win32.System.Power.Apis.PowerSettingRegisterNotification : parameter 2 (Flags)...Windows.Win32.UI.WindowsAndMessaging.REGISTER_NOTIFICATION_FLAGS => System.UInt32 +Windows.Win32.System.Power.Apis.PowerSettingRegisterNotification : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerSettingRegisterNotification : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerSettingUnregisterNotification : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerSettingUnregisterNotification : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerUnregisterSuspendResumeNotification : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerUnregisterSuspendResumeNotification : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteACValueIndex : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteACValueIndex : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteDescription : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteDescription : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteFriendlyName : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteFriendlyName : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteIconResourceSpecifier : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteIconResourceSpecifier : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWritePossibleDescription : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWritePossibleDescription : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWritePossibleFriendlyName : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWritePossibleFriendlyName : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWritePossibleValue : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWritePossibleValue : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteSettingAttributes : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteSettingAttributes : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteValueIncrement : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteValueIncrement : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteValueMax : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteValueMax : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteValueMin : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteValueMin : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.Power.Apis.PowerWriteValueUnitsSpecifier : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.Power.Apis.PowerWriteValueUnitsSpecifier : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmAddFilter : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmAddFilter : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmCancelCurrentTask : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmCancelCurrentTask : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmEndSession : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmEndSession : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmGetFilterList : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmGetFilterList : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmGetList : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmGetList : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmJoinSession : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmJoinSession : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmRegisterResources : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmRegisterResources : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmRemoveFilter : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmRemoveFilter : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmRestart : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmRestart : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmShutdown : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmShutdown : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 +Windows.Win32.System.RestartManager.Apis.RmStartSession : return : => [AssociatedEnum(WIN32_ERROR)] +Windows.Win32.System.RestartManager.Apis.RmStartSession : return...Windows.Win32.Foundation.WIN32_ERROR => System.UInt32 diff --git a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs index bb7eedda5..55a9d0164 100644 --- a/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs +++ b/tests/Win32MetadataScraperTests/WinHttpMigrationTests.cs @@ -32,6 +32,7 @@ public class WinHttpMigrationTests private const string ProcessSnapshotNamespace = "Windows.Win32.System.Diagnostics.ProcessSnapshotting"; private const string HidConstant = "HIDP_STATUS_I8242_TRANS_UNKNOWN"; private const string WerAlias = "WER_SUBMIT_DISCARD_IF_QUEUED"; + private const string HeldDhcpArrayRow = "DHCP_IP_ARRAY::Elements=[NativeArrayInfo(CountParamIndex=0)]"; private const string WerAliasField = "F|" + WerAlias + "|Public, Static, Literal, HasDefault|UInt32|-1|UInt32:80000000||"; private readonly ITestOutputHelper output; @@ -584,6 +585,15 @@ public void NativeHandleContractsReachOnlyTheExactProducerTargets(int architectu transfer.Member == "return" ? value.SequenceNumber == 0 : current.Reader.GetString(value.Name) == transfer.Member); Assert.Equal(transfer.Member == "return" ? ParameterAttributes.None : ParameterAttributes.Out, parameter.Attributes); Assert.Equal(originalOwnership, Ownership(current.Reader, parameter.GetCustomAttributes())); + var signature = method.DecodeSignature(Signatures, null); + string producedType = transfer.Member == "return" ? signature.ReturnType : signature.ParameterTypes[parameter.SequenceNumber - 1]; + if (transfer.Member != "return") + { + Assert.EndsWith("*", producedType); + producedType = producedType.Substring(0, producedType.Length - 1); + } + var cleanup = Methods(current.Reader, transfer.Namespace, "Apis", architecture)[transfer.Cleanup].DecodeSignature(Signatures, null); + Assert.Equal(producedType, Assert.Single(cleanup.ParameterTypes)); foreach (var other in method.GetParameters().Select(current.Reader.GetParameter) .Where(value => value.SequenceNumber != parameter.SequenceNumber)) Assert.Empty(Ownership(current.Reader, other.GetCustomAttributes())); @@ -682,8 +692,11 @@ public void RestartManagerAssociationsPreserveNativeContracts(int architecture) AttributeValues(current.Reader, result.GetCustomAttributes(), "AssociatedEnumAttribute")); } foreach (string name in new[] { "RM_PROCESS_INFO", "RM_APP_STATUS", "WIN32_ERROR" }) - Assert.Equal(SnapshotType(old.Reader, Type(old.Reader, name, architecture)), - SnapshotType(current.Reader, Type(current.Reader, name, architecture))); + { + string ns = name == "WIN32_ERROR" ? "Windows.Win32.Foundation" : RestartManagerNamespace; + Assert.Equal(SnapshotType(old.Reader, Type(old.Reader, name, architecture, ns)), + SnapshotType(current.Reader, Type(current.Reader, name, architecture, ns))); + } } [Fact] @@ -1185,7 +1198,7 @@ public void EmittedWinHttpScopeUsesSdkBindingsWithoutAuthoredSemanticFallback() } [MigrationFact] - public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() + public void AdditionalEmittedOwnersHaveOnlyTheExplicitDhcpArrayResidual() { using var old = Open("WINHTTP_MIGRATION_OLD"); var emitted = old.Reader.MethodDefinitions.Select(old.Reader.GetMethodDefinition) @@ -1201,12 +1214,15 @@ public void AdditionalEmittedOwnersHaveNoAuthoredSemanticFallback() { foreach (string line in File.ReadLines(Path.Combine(project, file))) { + if (file == "emitter.settings.rsp" && line == HeldDhcpArrayRow) + continue; string target = line.Split('=')[0].Split(new[] { "::" }, StringSplitOptions.None)[0]; Assert.DoesNotContain(target, AdditionalOwnedMethods); Assert.DoesNotContain(target, AdditionalLogicalEnums); Assert.DoesNotContain(target, AdditionalOwnedTypes); } } + Assert.Single(File.ReadLines(Path.Combine(project, "emitter.settings.rsp")).Where(line => line == HeldDhcpArrayRow)); using var enums = JsonDocument.Parse(File.ReadAllText(Path.Combine(project, "enums.json"))); foreach (var item in enums.RootElement.GetProperty("items").EnumerateArray()) {