diff --git a/scripts/ChangesSinceLastRelease.txt b/scripts/ChangesSinceLastRelease.txt index f5e01be5e..d53158141 100644 --- a/scripts/ChangesSinceLastRelease.txt +++ b/scripts/ChangesSinceLastRelease.txt @@ -2894,3 +2894,13 @@ Windows.Win32.Graphics.GdiPlus.SmoothingMode.SmoothingModeAntiAlias8x8 added Windows.Win32.Graphics.GdiPlus.Status.ProfileNotFound added Windows.Win32.Graphics.GdiPlus.Tint added Windows.Win32.Graphics.GdiPlus.TintParams added +# Add missing BYTE constants +Windows.Win32.Media.Audio.Apis.MEVT_COMMENT added +Windows.Win32.Media.Audio.Apis.MEVT_LONGMSG added +Windows.Win32.Media.Audio.Apis.MEVT_NOP added +Windows.Win32.Media.Audio.Apis.MEVT_SHORTMSG added +Windows.Win32.Media.Audio.Apis.MEVT_TEMPO added +Windows.Win32.Media.Audio.Apis.MEVT_VERSION added +Windows.Win32.NetworkManagement.IpHelper.Apis.FILTER_ICMP_CODE_ANY added +Windows.Win32.NetworkManagement.IpHelper.Apis.FILTER_ICMP_TYPE_ANY added +Windows.Win32.System.SystemServices.Apis.DECIMAL_NEG added diff --git a/sources/MetadataUtils/ConstantsScraper.cs b/sources/MetadataUtils/ConstantsScraper.cs index af861018f..cc7c3bc34 100644 --- a/sources/MetadataUtils/ConstantsScraper.cs +++ b/sources/MetadataUtils/ConstantsScraper.cs @@ -35,7 +35,7 @@ private class ConstantsScraperImpl : IDisposable private static readonly Regex DefineConstantRegex = new Regex( - @"^((_HRESULT_TYPEDEF_|_NDIS_ERROR_TYPEDEF_)\(((?:0x)?[\da-f]+L?)\)|(\(HRESULT\)((?:0x)?[\da-f]+L?))|(-?\d+\.\d+(?:e\+\d+)?f?)|((?:0x[\da-f]+|\-?\d+)(?:UL|L)?)|((\d+)\s*(<<\s*\d+))|(MAKEINTRESOURCE[AW]{0,1}\(\s*(\-?\d+)\s*\))|(\(HWND\)(-?\d+|(?:0x)?[\da-f]+))|([a-z0-9_]+U?\s*[\+\-]\s*(\d+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8}L?,?\s*){3}\s*(?:(?:0x)?[\da-f]{1,2}L?,?\s*){8}\s*\})|(\(UCHAR\)\s*((?:0x)?\d+))|(\(UCHAR\)\s*(-\d+))|(\(BYTE\)((?:0x)?[\da-f]+L?))|([a-z0-9_]+))$", RegexOptions.IgnoreCase); private static readonly Regex DefineGuidConstRegex = new Regex( @@ -868,10 +868,16 @@ private void ScrapeConstantsFromTraversedFiles(Dictionary traver this.AddConstantValue(currentNamespace, "ushort", name, $"unchecked((ushort){match.Groups[35].Value})"); continue; } - // SOME_OTHER_CONSTANT + // (BYTE) 0x42 else if (match.Groups[36].Success) { - string otherName = match.Groups[36].Value; + this.AddConstantValue(currentNamespace, "byte", name, match.Groups[37].Value); + continue; + } + // SOME_OTHER_CONSTANT + else if (match.Groups[38].Success) + { + string otherName = match.Groups[38].Value; matchedToOtherName = true;