From 4e1e5666188d76cde441ab320e17d34efd5000b8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:38:32 +0000 Subject: [PATCH] Update the composition Windows version facts --- .../Win32k/CompositionTables.Generated.cs | 1035 ++++++++++++----- 1 file changed, 725 insertions(+), 310 deletions(-) diff --git a/Brovan/Core/Emulation/OS/Windows/Win32k/CompositionTables.Generated.cs b/Brovan/Core/Emulation/OS/Windows/Win32k/CompositionTables.Generated.cs index e429b29..1be2c26 100644 --- a/Brovan/Core/Emulation/OS/Windows/Win32k/CompositionTables.Generated.cs +++ b/Brovan/Core/Emulation/OS/Windows/Win32k/CompositionTables.Generated.cs @@ -1,310 +1,725 @@ -// -// Written by Brovan.WinFacts from win32kbase.sys and its public PDB. Run the tool to change it, never by hand. -// -// Set22621_7640: 1 version, extracted, not run -// Set26100_1: 1 version -// Set26100_9711: 1 version -// Set28000_3086: 1 version, extracted, not run -// -// Left out: -// 22000.3260: command switch: 0 jump tables -// - -using System; - -namespace Brovan.Core.Emulation.OS.Windows.Win32k -{ - internal enum CompositionCommand : byte - { - None, - Other, - CreateResource, - ReleaseResource, - SetCallbackId, - SetInteger, - SetBuffer, - SetReference, - SetVisualInputSink, - } - - internal enum CompositionClass : byte - { - None, - BlurredWallpaperBackdropBrush, - ColorBrush, - ComponentTransform3D, - Visual, - } - - internal enum CompositionProperty : byte - { - PropertyChangeMask, - VisualTransform, - } - - internal sealed class CompositionTableSet - { - internal const string KeyFile = "win32kbase.sys"; - - internal readonly CompositionCommand[] Commands; - internal readonly byte[] RecordSizes; - internal readonly uint MaxType; - internal readonly byte[] Parents; - internal readonly CompositionClass[] TypeClasses; - private readonly uint[] PropertyIds; - private readonly uint[] RequiredBases; - private readonly (CompositionClass Class, CompositionSlots Setter, uint[] Properties)[] OwnProperties; - - // NT: an opcode the kernel refuses has record size 0 and command None. Parents has one entry per type, and its - // length is where the walk ends. - private CompositionTableSet(byte[] RecordSizes, (int Opcode, CompositionCommand Command)[] Commands, byte[] Parents, - (int Type, CompositionClass Class)[] Classes, (CompositionProperty Property, uint Id, uint Base)[] Properties, - (CompositionClass Class, CompositionSlots Setter, uint[] Properties)[] OwnProperties) - { - this.RecordSizes = RecordSizes; - this.Commands = new CompositionCommand[RecordSizes.Length]; - for (int Opcode = 0; Opcode < RecordSizes.Length; Opcode++) - this.Commands[Opcode] = RecordSizes[Opcode] == 0 ? CompositionCommand.None : CompositionCommand.Other; - - foreach ((int Opcode, CompositionCommand Command) in Commands) - this.Commands[Opcode] = Command; - - MaxType = (uint)Parents.Length - 1; - this.Parents = Parents; - TypeClasses = new CompositionClass[MaxType + 1]; - foreach ((int Type, CompositionClass Class) in Classes) - TypeClasses[Type] = Class; - - PropertyIds = new uint[Properties.Length]; - RequiredBases = new uint[Properties.Length]; - foreach ((CompositionProperty Property, uint Id, uint Base) in Properties) - { - PropertyIds[(int)Property] = Id; - RequiredBases[(int)Property] = Base; - } - - this.OwnProperties = OwnProperties; - } - - internal uint Property(CompositionProperty Property) => PropertyIds[(int)Property]; - - internal uint RequiredBase(CompositionProperty Property) => RequiredBases[(int)Property]; - - internal bool IsOwnProperty(CompositionClass Class, CompositionSlots Setter, uint Property) - { - foreach ((CompositionClass OwnClass, CompositionSlots OwnSetter, uint[] Properties) in OwnProperties) - { - if (OwnClass == Class && OwnSetter == Setter) - return Array.IndexOf(Properties, Property) >= 0; - } - - return false; - } - - private static readonly CompositionTableSet Set22621_7640 = new( - new byte[] { 24, 16, 24, 8, 24, 24, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, - new[] - { - (1, CompositionCommand.CreateResource), - (3, CompositionCommand.ReleaseResource), - (7, CompositionCommand.SetCallbackId), - (8, CompositionCommand.SetInteger), - (12, CompositionCommand.SetBuffer), - (13, CompositionCommand.SetReference), - (19, CompositionCommand.SetVisualInputSink), - }, - new byte[] - { - 0xCE, 0x3D, 0x0A, 0x86, 0x93, 0x86, 0x3D, 0x2F, 0x93, 0x11, 0x93, 0x72, 0x93, 0x55, 0x3D, 0x11, - 0x3D, 0x93, 0x55, 0x93, 0x92, 0x11, 0x11, 0x93, 0x3D, 0x93, 0x93, 0x43, 0x72, 0x86, 0xBB, 0x3D, - 0x24, 0x93, 0x24, 0xB8, 0x93, 0x93, 0x24, 0x86, 0x11, 0x24, 0x2F, 0xB8, 0x93, 0x0B, 0xC1, 0x93, - 0xAA, 0xAA, 0xC4, 0x93, 0x92, 0x93, 0x93, 0x27, 0x86, 0x11, 0x38, 0x43, 0x0B, 0x38, 0x93, 0x3D, - 0x3D, 0x93, 0xB4, 0x86, 0x93, 0x44, 0x43, 0x93, 0x2F, 0x11, 0x5F, 0x72, 0x72, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x3D, 0x5F, 0x93, 0x92, 0x0B, 0x2F, 0x93, 0x72, 0x72, 0x0B, 0xC4, 0x93, 0x93, - 0x92, 0x60, 0x93, 0x49, 0x4A, 0x3D, 0x43, 0x92, 0x92, 0x72, 0xBA, 0x11, 0x93, 0xBA, 0xBB, 0x44, - 0x0B, 0x11, 0x93, 0x93, 0x93, 0x93, 0x74, 0x2F, 0xC4, 0x93, 0x74, 0x74, 0x74, 0x74, 0x43, 0x93, - 0x93, 0x2F, 0x2F, 0x86, 0x86, 0x86, 0x72, 0x86, 0x43, 0x49, 0x43, 0x93, 0x93, 0xC4, 0x43, 0x92, - 0x92, 0x2F, 0x93, 0xCE, 0xBA, 0xBB, 0x3D, 0x0A, 0xBA, 0xBB, 0xA2, 0x93, 0x93, 0xA2, 0xA4, 0xA3, - 0x2C, 0xA2, 0x93, 0x9B, 0x9A, 0x9C, 0xC4, 0x3D, 0xC4, 0xAA, 0x93, 0x93, 0x93, 0xBA, 0x2F, 0x5F, - 0xC4, 0xC1, 0xC4, 0xC4, 0x2F, 0x11, 0xB4, 0x3D, 0x93, 0xC4, 0xBB, 0x38, 0xBB, 0xBA, 0xBA, 0xBB, - 0x3D, 0x93, 0x93, 0x14, 0x86, 0x2F, 0x92, 0x93, 0x93, 0xC8, 0x93, 0x11, 0xC4, 0x2F, - }, - new[] - { - (0x9, CompositionClass.BlurredWallpaperBackdropBrush), - (0xF, CompositionClass.BlurredWallpaperBackdropBrush), - (0x16, CompositionClass.ColorBrush), - (0x1E, CompositionClass.ComponentTransform3D), - (0xC4, CompositionClass.Visual), - (0xCB, CompositionClass.BlurredWallpaperBackdropBrush), - }, - new[] - { - (CompositionProperty.PropertyChangeMask, 0xFFFFu, 0x0u), - (CompositionProperty.VisualTransform, 0x3u, 0xBBu), - }, - new[] - { - (CompositionClass.Visual, CompositionSlots.Integer, - new uint[] { 0x7, 0x8, 0x9, 0xD, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x1A, 0x24, 0x25, 0x28, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), - (CompositionClass.Visual, CompositionSlots.Reference, - new uint[] { 0x3, 0x4, 0x5, 0x6, 0xA, 0x16, 0x26, 0x27, 0x31 }), - }); - - private static readonly CompositionTableSet Set26100_1 = new( - new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, - new[] - { - (2, CompositionCommand.CreateResource), - (4, CompositionCommand.ReleaseResource), - (10, CompositionCommand.SetCallbackId), - (11, CompositionCommand.SetInteger), - (15, CompositionCommand.SetBuffer), - (16, CompositionCommand.SetReference), - (22, CompositionCommand.SetVisualInputSink), - }, - new byte[] - { - 0xBF, 0x3B, 0x0A, 0x79, 0x85, 0x79, 0x3B, 0x2D, 0x85, 0x11, 0x85, 0x70, 0x85, 0x53, 0x3B, 0x11, - 0x3B, 0x85, 0x53, 0x85, 0x84, 0x11, 0x11, 0x85, 0x3B, 0x85, 0x85, 0x41, 0x70, 0x79, 0xAC, 0x3B, - 0x23, 0x23, 0xA9, 0x85, 0x85, 0x23, 0x79, 0x23, 0x2D, 0xA9, 0x85, 0x0B, 0xB2, 0x85, 0x9C, 0x9C, - 0xB5, 0x85, 0x84, 0xA5, 0x85, 0x26, 0x79, 0x11, 0x36, 0x41, 0x0B, 0x36, 0x85, 0x3B, 0x3B, 0x85, - 0xA5, 0x79, 0x85, 0x42, 0x41, 0x85, 0x2D, 0x11, 0x5D, 0x70, 0x70, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x3B, 0x5D, 0x85, 0x84, 0x0B, 0x2D, 0x85, 0x70, 0x70, 0x0B, 0xB5, 0x85, 0x85, 0x84, 0x5E, - 0x85, 0x47, 0x48, 0x3B, 0x41, 0x84, 0x84, 0x70, 0xAB, 0x11, 0x85, 0xAB, 0xAC, 0x42, 0x0B, 0x11, - 0x85, 0x41, 0x85, 0x85, 0x2D, 0x2D, 0x79, 0x79, 0x79, 0x70, 0x79, 0x41, 0x47, 0x41, 0x85, 0xB5, - 0x41, 0x84, 0x84, 0x2D, 0x85, 0xBF, 0xAB, 0xAC, 0x3B, 0x0A, 0xAB, 0xAC, 0x94, 0x85, 0x85, 0x94, - 0x96, 0x95, 0x2A, 0x94, 0x85, 0x8D, 0x8C, 0x8E, 0xB5, 0x3B, 0xB5, 0x9C, 0x85, 0x85, 0x85, 0xAB, - 0x2D, 0x5D, 0xB2, 0xB5, 0xB5, 0x2D, 0x11, 0xA5, 0x3B, 0x85, 0xB5, 0xAC, 0x36, 0xAC, 0xAB, 0xAB, - 0xAC, 0x3B, 0x85, 0x85, 0x14, 0x79, 0x2D, 0x84, 0x85, 0x85, 0xB9, 0x85, 0x11, 0xB5, 0x2D, - }, - new[] - { - (0x9, CompositionClass.BlurredWallpaperBackdropBrush), - (0xF, CompositionClass.BlurredWallpaperBackdropBrush), - (0x16, CompositionClass.ColorBrush), - (0x1E, CompositionClass.ComponentTransform3D), - (0xB5, CompositionClass.Visual), - (0xBC, CompositionClass.BlurredWallpaperBackdropBrush), - }, - new[] - { - (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), - (CompositionProperty.VisualTransform, 0x4u, 0xACu), - }, - new[] - { - (CompositionClass.Visual, CompositionSlots.Integer, - new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), - (CompositionClass.Visual, CompositionSlots.Reference, - new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x31 }), - }); - - private static readonly CompositionTableSet Set26100_9711 = new( - new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, - new[] - { - (2, CompositionCommand.CreateResource), - (4, CompositionCommand.ReleaseResource), - (10, CompositionCommand.SetCallbackId), - (11, CompositionCommand.SetInteger), - (15, CompositionCommand.SetBuffer), - (16, CompositionCommand.SetReference), - (22, CompositionCommand.SetVisualInputSink), - }, - new byte[] - { - 0xBE, 0x3B, 0x0A, 0x79, 0x85, 0x79, 0x3B, 0x2D, 0x85, 0x11, 0x85, 0x70, 0x85, 0x53, 0x3B, 0x11, - 0x3B, 0x85, 0x53, 0x85, 0x84, 0x11, 0x11, 0x85, 0x3B, 0x85, 0x85, 0x41, 0x70, 0x79, 0xAB, 0x3B, - 0x23, 0x23, 0x2D, 0x85, 0x11, 0x85, 0x23, 0x79, 0x23, 0x2D, 0x85, 0x0B, 0xB1, 0x85, 0x9C, 0x9C, - 0xB4, 0x85, 0x84, 0xA6, 0x85, 0x27, 0x79, 0x11, 0x36, 0x41, 0x0B, 0x36, 0x85, 0x3B, 0x3B, 0x85, - 0xA6, 0x79, 0x85, 0x42, 0x41, 0x85, 0x2D, 0x11, 0x5D, 0x70, 0x70, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x3B, 0x5D, 0x85, 0x84, 0x0B, 0x2D, 0x85, 0x70, 0x70, 0x0B, 0xB4, 0x85, 0x85, 0x84, 0x5E, - 0x85, 0x47, 0x48, 0x3B, 0x41, 0x84, 0x84, 0x70, 0xAA, 0x11, 0x85, 0xAA, 0xAB, 0x42, 0x0B, 0x11, - 0x85, 0x41, 0x85, 0x85, 0x2D, 0x2D, 0x79, 0x79, 0x79, 0x70, 0x79, 0x41, 0x47, 0x41, 0x85, 0xB4, - 0x41, 0x84, 0x84, 0x2D, 0x85, 0xBE, 0xAA, 0xAB, 0x3B, 0x0A, 0xAA, 0xAB, 0x94, 0x85, 0x85, 0x94, - 0x96, 0x95, 0x2A, 0x94, 0x85, 0x8D, 0x8C, 0x8E, 0xB4, 0x3B, 0xB4, 0x9C, 0x85, 0x85, 0x85, 0xAA, - 0x2D, 0x85, 0x5D, 0xB1, 0xB4, 0xB4, 0x2D, 0x11, 0xA6, 0x3B, 0xAB, 0x36, 0xAB, 0xAA, 0xAA, 0xAB, - 0x3B, 0x85, 0x85, 0x14, 0x79, 0x2D, 0x84, 0x85, 0x85, 0xB8, 0x85, 0x11, 0xB4, 0x2D, - }, - new[] - { - (0x9, CompositionClass.BlurredWallpaperBackdropBrush), - (0xF, CompositionClass.BlurredWallpaperBackdropBrush), - (0x16, CompositionClass.ColorBrush), - (0x1E, CompositionClass.ComponentTransform3D), - (0xB4, CompositionClass.Visual), - (0xBB, CompositionClass.BlurredWallpaperBackdropBrush), - }, - new[] - { - (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), - (CompositionProperty.VisualTransform, 0x4u, 0xABu), - }, - new[] - { - (CompositionClass.Visual, CompositionSlots.Integer, - new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), - (CompositionClass.Visual, CompositionSlots.Reference, - new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x31 }), - }); - - private static readonly CompositionTableSet Set28000_3086 = new( - new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, - new[] - { - (2, CompositionCommand.CreateResource), - (4, CompositionCommand.ReleaseResource), - (10, CompositionCommand.SetCallbackId), - (11, CompositionCommand.SetInteger), - (15, CompositionCommand.SetBuffer), - (16, CompositionCommand.SetReference), - (22, CompositionCommand.SetVisualInputSink), - }, - new byte[] - { - 0xA4, 0x32, 0x4B, 0x09, 0x62, 0x6D, 0x62, 0x32, 0x10, 0x6D, 0x58, 0x6D, 0x6D, 0x32, 0x10, 0x32, - 0x6D, 0x6D, 0x6C, 0x10, 0x6D, 0x32, 0x37, 0x58, 0x62, 0x92, 0x32, 0x23, 0x10, 0x6D, 0x62, 0x23, - 0x6D, 0x0A, 0x98, 0x6D, 0x84, 0x84, 0x9A, 0x6D, 0x6C, 0x8D, 0x6D, 0x5B, 0x1E, 0x62, 0x10, 0x2D, - 0x37, 0x0A, 0x2D, 0x32, 0x32, 0x6D, 0x8D, 0x62, 0x6D, 0x23, 0x10, 0x6D, 0x32, 0x6C, 0x0A, 0x23, - 0x6D, 0x43, 0x43, 0x58, 0x58, 0x0A, 0x9A, 0x6D, 0x6C, 0x48, 0x6D, 0x6D, 0x3A, 0x32, 0x37, 0x6C, - 0x6C, 0x58, 0x91, 0x10, 0x91, 0x92, 0x0A, 0x10, 0x6D, 0x37, 0x5B, 0x4B, 0x6D, 0x23, 0x23, 0x62, - 0x62, 0x62, 0x58, 0x62, 0x37, 0x3A, 0x37, 0x9A, 0x37, 0x6C, 0x6C, 0x23, 0x6D, 0xA4, 0x91, 0x92, - 0x32, 0x09, 0x91, 0x92, 0x7C, 0x6D, 0x6D, 0x7C, 0x7E, 0x7D, 0x20, 0x7C, 0x6D, 0x75, 0x74, 0x76, - 0x9A, 0x32, 0x9A, 0x84, 0x6D, 0x6D, 0x91, 0x23, 0x6D, 0x5B, 0x98, 0x9A, 0x9A, 0x23, 0x10, 0x8D, - 0x32, 0x92, 0x2D, 0x92, 0x91, 0x91, 0x92, 0x32, 0x6D, 0x6D, 0x62, 0x23, 0x62, 0x6D, 0x6D, 0x9E, - 0x6D, 0x10, 0x9A, 0x23, - }, - new[] - { - (0x8, CompositionClass.BlurredWallpaperBackdropBrush), - (0xE, CompositionClass.BlurredWallpaperBackdropBrush), - (0x13, CompositionClass.ColorBrush), - (0x19, CompositionClass.ComponentTransform3D), - (0x3B, CompositionClass.BlurredWallpaperBackdropBrush), - (0x9A, CompositionClass.Visual), - (0xA1, CompositionClass.BlurredWallpaperBackdropBrush), - }, - new[] - { - (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), - (CompositionProperty.VisualTransform, 0x4u, 0x92u), - }, - new[] - { - (CompositionClass.Visual, CompositionSlots.Integer, - new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x2E, 0x31 }), - (CompositionClass.Visual, CompositionSlots.Reference, - new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x2F }), - }); - - internal static CompositionTableSet Find(ushort Build, ushort Revision) => (Build, Revision) switch - { - (22621, 7640) => Set22621_7640, - (26100, 1) => Set26100_1, - (26100, 9711) => Set26100_9711, - (28000, 3086) => Set28000_3086, - _ => null, - }; - } -} +// +// Written by Brovan.WinFacts from win32kbase.sys and its public PDB. Run the tool to change it, never by hand. +// +// Set22621_1252: 49 versions, extracted, not run +// Set26100_1: 11 versions +// Set26100_2454: 4 versions, extracted, not run +// Set26100_3323: 19 versions, extracted, not run +// Set26100_7705: 11 versions, extracted, not run +// Set26100_8972: 5 versions +// Set28000_2113: 1 version, extracted, not run +// Set28000_2525: 1 version, extracted, not run +// Set28000_3086: 1 version, extracted, not run +// +// Left out: +// 22000.194: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.258: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.318: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.347: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.434: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.469: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.493: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.527: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.554: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.588: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.613: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.740: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.795: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.826: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.856: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1030: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1100: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1165: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1219: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1281: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1335: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1455: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1516: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1574: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1696: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1815: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1880: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.1936: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2110: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2124: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2176: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2360: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2416: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2538: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2777: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2830: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2899: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.2960: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.3019: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.3139: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.3197: no CApplicationChannel::CreatePrivateMarshaler to run +// 22000.3260: no CApplicationChannel::CreatePrivateMarshaler to run +// 22621.378: CreateResource (opcode 1): no type range check +// 22621.525: CreateResource (opcode 1): no type range check +// 22621.608: CreateResource (opcode 1): no type range check +// 22621.675: CreateResource (opcode 1): no type range check +// 22621.754: CreateResource (opcode 1): no type range check +// 22621.815: CreateResource (opcode 1): no type range check +// 22621.900: CreateResource (opcode 1): no type range check +// 22621.963: CreateResource (opcode 1): no type range check +// 22621.1113: CreateResource (opcode 1): no type range check +// 22621.1125: CreateResource (opcode 1): no type range check +// 22621.1180: CreateResource (opcode 1): no type range check +// 22621.1244: CreateResource (opcode 1): no type range check +// 22621.1265: CreateResource (opcode 1): no type range check +// 22621.1391: CreateResource (opcode 1): no type range check +// 22621.1415: CreateResource (opcode 1): no type range check +// 22621.1485: CreateResource (opcode 1): no type range check +// 22621.1555: CreateResource (opcode 1): no type range check +// 22621.1690: CreateResource (opcode 1): no type range check +// 22621.1778: CreateResource (opcode 1): no type range check +// 22621.1848: CreateResource (opcode 1): no type range check +// 22621.1928: CreateResource (opcode 1): no type range check +// 22621.1992: CreateResource (opcode 1): no type range check +// 22621.2209: CreateResource (opcode 1): no type range check +// 22621.2340: CreateResource (opcode 1): no type range check +// 22621.2428: CreateResource (opcode 1): no type range check +// + +using System; + +namespace Brovan.Core.Emulation.OS.Windows.Win32k +{ + internal enum CompositionCommand : byte + { + None, + Other, + CreateResource, + ReleaseResource, + SetCallbackId, + SetInteger, + SetBuffer, + SetReference, + SetVisualInputSink, + } + + internal enum CompositionClass : byte + { + None, + BlurredWallpaperBackdropBrush, + ColorBrush, + ComponentTransform3D, + Visual, + } + + internal enum CompositionProperty : byte + { + PropertyChangeMask, + VisualTransform, + } + + internal sealed class CompositionTableSet + { + internal const string KeyFile = "win32kbase.sys"; + + internal readonly CompositionCommand[] Commands; + internal readonly byte[] RecordSizes; + internal readonly uint MaxType; + internal readonly byte[] Parents; + internal readonly CompositionClass[] TypeClasses; + private readonly uint[] PropertyIds; + private readonly uint[] RequiredBases; + private readonly (CompositionClass Class, CompositionSlots Setter, uint[] Properties)[] OwnProperties; + + // NT: an opcode the kernel refuses has record size 0 and command None. Parents has one entry per type, and its + // length is where the walk ends. + private CompositionTableSet(byte[] RecordSizes, (int Opcode, CompositionCommand Command)[] Commands, byte[] Parents, + (int Type, CompositionClass Class)[] Classes, (CompositionProperty Property, uint Id, uint Base)[] Properties, + (CompositionClass Class, CompositionSlots Setter, uint[] Properties)[] OwnProperties) + { + this.RecordSizes = RecordSizes; + this.Commands = new CompositionCommand[RecordSizes.Length]; + for (int Opcode = 0; Opcode < RecordSizes.Length; Opcode++) + this.Commands[Opcode] = RecordSizes[Opcode] == 0 ? CompositionCommand.None : CompositionCommand.Other; + + foreach ((int Opcode, CompositionCommand Command) in Commands) + this.Commands[Opcode] = Command; + + MaxType = (uint)Parents.Length - 1; + this.Parents = Parents; + TypeClasses = new CompositionClass[MaxType + 1]; + foreach ((int Type, CompositionClass Class) in Classes) + TypeClasses[Type] = Class; + + PropertyIds = new uint[Properties.Length]; + RequiredBases = new uint[Properties.Length]; + foreach ((CompositionProperty Property, uint Id, uint Base) in Properties) + { + PropertyIds[(int)Property] = Id; + RequiredBases[(int)Property] = Base; + } + + this.OwnProperties = OwnProperties; + } + + internal uint Property(CompositionProperty Property) => PropertyIds[(int)Property]; + + internal uint RequiredBase(CompositionProperty Property) => RequiredBases[(int)Property]; + + internal bool IsOwnProperty(CompositionClass Class, CompositionSlots Setter, uint Property) + { + foreach ((CompositionClass OwnClass, CompositionSlots OwnSetter, uint[] Properties) in OwnProperties) + { + if (OwnClass == Class && OwnSetter == Setter) + return Array.IndexOf(Properties, Property) >= 0; + } + + return false; + } + + private static readonly CompositionTableSet Set22621_1252 = new( + new byte[] { 24, 16, 24, 8, 24, 24, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (1, CompositionCommand.CreateResource), + (3, CompositionCommand.ReleaseResource), + (7, CompositionCommand.SetCallbackId), + (8, CompositionCommand.SetInteger), + (12, CompositionCommand.SetBuffer), + (13, CompositionCommand.SetReference), + (19, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xCE, 0x3D, 0x0A, 0x86, 0x93, 0x86, 0x3D, 0x2F, 0x93, 0x11, 0x93, 0x72, 0x93, 0x55, 0x3D, 0x11, + 0x3D, 0x93, 0x55, 0x93, 0x92, 0x11, 0x11, 0x93, 0x3D, 0x93, 0x93, 0x43, 0x72, 0x86, 0xBB, 0x3D, + 0x24, 0x93, 0x24, 0xB8, 0x93, 0x93, 0x24, 0x86, 0x11, 0x24, 0x2F, 0xB8, 0x93, 0x0B, 0xC1, 0x93, + 0xAA, 0xAA, 0xC4, 0x93, 0x92, 0x93, 0x93, 0x27, 0x86, 0x11, 0x38, 0x43, 0x0B, 0x38, 0x93, 0x3D, + 0x3D, 0x93, 0xB4, 0x86, 0x93, 0x44, 0x43, 0x93, 0x2F, 0x11, 0x5F, 0x72, 0x72, 0x93, 0x93, 0x93, + 0x93, 0x93, 0x93, 0x3D, 0x5F, 0x93, 0x92, 0x0B, 0x2F, 0x93, 0x72, 0x72, 0x0B, 0xC4, 0x93, 0x93, + 0x92, 0x60, 0x93, 0x49, 0x4A, 0x3D, 0x43, 0x92, 0x92, 0x72, 0xBA, 0x11, 0x93, 0xBA, 0xBB, 0x44, + 0x0B, 0x11, 0x93, 0x93, 0x93, 0x93, 0x74, 0x2F, 0xC4, 0x93, 0x74, 0x74, 0x74, 0x74, 0x43, 0x93, + 0x93, 0x2F, 0x2F, 0x86, 0x86, 0x86, 0x72, 0x86, 0x43, 0x49, 0x43, 0x93, 0x93, 0xC4, 0x43, 0x92, + 0x92, 0x2F, 0x93, 0xCE, 0xBA, 0xBB, 0x3D, 0x0A, 0xBA, 0xBB, 0xA2, 0x93, 0x93, 0xA2, 0xA4, 0xA3, + 0x2C, 0xA2, 0x93, 0x9B, 0x9A, 0x9C, 0xC4, 0x3D, 0xC4, 0xAA, 0x93, 0x93, 0x93, 0xBA, 0x2F, 0x5F, + 0xC4, 0xC1, 0xC4, 0xC4, 0x2F, 0x11, 0xB4, 0x3D, 0x93, 0xC4, 0xBB, 0x38, 0xBB, 0xBA, 0xBA, 0xBB, + 0x3D, 0x93, 0x93, 0x14, 0x86, 0x2F, 0x92, 0x93, 0x93, 0xC8, 0x93, 0x11, 0xC4, 0x2F, + }, + new[] + { + (0x9, CompositionClass.BlurredWallpaperBackdropBrush), + (0xF, CompositionClass.BlurredWallpaperBackdropBrush), + (0x16, CompositionClass.ColorBrush), + (0x1E, CompositionClass.ComponentTransform3D), + (0xC4, CompositionClass.Visual), + (0xCB, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0xFFFFu, 0x0u), + (CompositionProperty.VisualTransform, 0x3u, 0xBBu), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x7, 0x8, 0x9, 0xD, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x1A, 0x24, 0x25, 0x28, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x3, 0x4, 0x5, 0x6, 0xA, 0x16, 0x26, 0x27, 0x31 }), + }); + + private static readonly CompositionTableSet Set26100_1 = new( + new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (2, CompositionCommand.CreateResource), + (4, CompositionCommand.ReleaseResource), + (10, CompositionCommand.SetCallbackId), + (11, CompositionCommand.SetInteger), + (15, CompositionCommand.SetBuffer), + (16, CompositionCommand.SetReference), + (22, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xBF, 0x3B, 0x0A, 0x79, 0x85, 0x79, 0x3B, 0x2D, 0x85, 0x11, 0x85, 0x70, 0x85, 0x53, 0x3B, 0x11, + 0x3B, 0x85, 0x53, 0x85, 0x84, 0x11, 0x11, 0x85, 0x3B, 0x85, 0x85, 0x41, 0x70, 0x79, 0xAC, 0x3B, + 0x23, 0x23, 0xA9, 0x85, 0x85, 0x23, 0x79, 0x23, 0x2D, 0xA9, 0x85, 0x0B, 0xB2, 0x85, 0x9C, 0x9C, + 0xB5, 0x85, 0x84, 0xA5, 0x85, 0x26, 0x79, 0x11, 0x36, 0x41, 0x0B, 0x36, 0x85, 0x3B, 0x3B, 0x85, + 0xA5, 0x79, 0x85, 0x42, 0x41, 0x85, 0x2D, 0x11, 0x5D, 0x70, 0x70, 0x85, 0x85, 0x85, 0x85, 0x85, + 0x85, 0x3B, 0x5D, 0x85, 0x84, 0x0B, 0x2D, 0x85, 0x70, 0x70, 0x0B, 0xB5, 0x85, 0x85, 0x84, 0x5E, + 0x85, 0x47, 0x48, 0x3B, 0x41, 0x84, 0x84, 0x70, 0xAB, 0x11, 0x85, 0xAB, 0xAC, 0x42, 0x0B, 0x11, + 0x85, 0x41, 0x85, 0x85, 0x2D, 0x2D, 0x79, 0x79, 0x79, 0x70, 0x79, 0x41, 0x47, 0x41, 0x85, 0xB5, + 0x41, 0x84, 0x84, 0x2D, 0x85, 0xBF, 0xAB, 0xAC, 0x3B, 0x0A, 0xAB, 0xAC, 0x94, 0x85, 0x85, 0x94, + 0x96, 0x95, 0x2A, 0x94, 0x85, 0x8D, 0x8C, 0x8E, 0xB5, 0x3B, 0xB5, 0x9C, 0x85, 0x85, 0x85, 0xAB, + 0x2D, 0x5D, 0xB2, 0xB5, 0xB5, 0x2D, 0x11, 0xA5, 0x3B, 0x85, 0xB5, 0xAC, 0x36, 0xAC, 0xAB, 0xAB, + 0xAC, 0x3B, 0x85, 0x85, 0x14, 0x79, 0x2D, 0x84, 0x85, 0x85, 0xB9, 0x85, 0x11, 0xB5, 0x2D, + }, + new[] + { + (0x9, CompositionClass.BlurredWallpaperBackdropBrush), + (0xF, CompositionClass.BlurredWallpaperBackdropBrush), + (0x16, CompositionClass.ColorBrush), + (0x1E, CompositionClass.ComponentTransform3D), + (0xB5, CompositionClass.Visual), + (0xBC, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), + (CompositionProperty.VisualTransform, 0x4u, 0xACu), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x31 }), + }); + + private static readonly CompositionTableSet Set26100_2454 = new( + new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (2, CompositionCommand.CreateResource), + (4, CompositionCommand.ReleaseResource), + (10, CompositionCommand.SetCallbackId), + (11, CompositionCommand.SetInteger), + (15, CompositionCommand.SetBuffer), + (16, CompositionCommand.SetReference), + (22, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xC0, 0x3C, 0x0A, 0x7A, 0x86, 0x7A, 0x3C, 0x2E, 0x86, 0x11, 0x86, 0x71, 0x86, 0x54, 0x3C, 0x11, + 0x3C, 0x86, 0x54, 0x86, 0x85, 0x11, 0x11, 0x86, 0x3C, 0x86, 0x86, 0x42, 0x71, 0x7A, 0xAD, 0x3C, + 0x23, 0x23, 0xAA, 0x86, 0x86, 0x23, 0x7A, 0x23, 0x2E, 0xAA, 0x28, 0x86, 0x0B, 0xB3, 0x86, 0x9D, + 0x9D, 0xB6, 0x86, 0x85, 0xA6, 0x86, 0x26, 0x7A, 0x11, 0x37, 0x42, 0x0B, 0x37, 0x86, 0x3C, 0x3C, + 0x86, 0xA6, 0x7A, 0x86, 0x43, 0x42, 0x86, 0x2E, 0x11, 0x5E, 0x71, 0x71, 0x86, 0x86, 0x86, 0x86, + 0x86, 0x86, 0x3C, 0x5E, 0x86, 0x85, 0x0B, 0x2E, 0x86, 0x71, 0x71, 0x0B, 0xB6, 0x86, 0x86, 0x85, + 0x5F, 0x86, 0x48, 0x49, 0x3C, 0x42, 0x85, 0x85, 0x71, 0xAC, 0x11, 0x86, 0xAC, 0xAD, 0x43, 0x0B, + 0x11, 0x86, 0x42, 0x86, 0x86, 0x2E, 0x2E, 0x7A, 0x7A, 0x7A, 0x71, 0x7A, 0x42, 0x48, 0x42, 0x86, + 0xB6, 0x42, 0x85, 0x85, 0x2E, 0x86, 0xC0, 0xAC, 0xAD, 0x3C, 0x0A, 0xAC, 0xAD, 0x95, 0x86, 0x86, + 0x95, 0x97, 0x96, 0x2B, 0x95, 0x86, 0x8E, 0x8D, 0x8F, 0xB6, 0x3C, 0xB6, 0x9D, 0x86, 0x86, 0x86, + 0xAC, 0x2E, 0x5E, 0xB3, 0xB6, 0xB6, 0x2E, 0x11, 0xA6, 0x3C, 0x86, 0xB6, 0xAD, 0x37, 0xAD, 0xAC, + 0xAC, 0xAD, 0x3C, 0x86, 0x86, 0x14, 0x7A, 0x2E, 0x85, 0x86, 0x86, 0xBA, 0x86, 0x11, 0xB6, 0x2E, + }, + new[] + { + (0x9, CompositionClass.BlurredWallpaperBackdropBrush), + (0xF, CompositionClass.BlurredWallpaperBackdropBrush), + (0x16, CompositionClass.ColorBrush), + (0x1E, CompositionClass.ComponentTransform3D), + (0xB6, CompositionClass.Visual), + (0xBD, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), + (CompositionProperty.VisualTransform, 0x4u, 0xADu), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x31 }), + }); + + private static readonly CompositionTableSet Set26100_3323 = new( + new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (2, CompositionCommand.CreateResource), + (4, CompositionCommand.ReleaseResource), + (10, CompositionCommand.SetCallbackId), + (11, CompositionCommand.SetInteger), + (15, CompositionCommand.SetBuffer), + (16, CompositionCommand.SetReference), + (22, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xC0, 0x3C, 0x0A, 0x7A, 0x86, 0x7A, 0x3C, 0x2E, 0x86, 0x11, 0x86, 0x71, 0x86, 0x54, 0x3C, 0x11, + 0x3C, 0x86, 0x54, 0x86, 0x85, 0x11, 0x11, 0x86, 0x3C, 0x86, 0x86, 0x42, 0x71, 0x7A, 0xAD, 0x3C, + 0x24, 0x24, 0x2E, 0xAA, 0x86, 0x86, 0x24, 0x7A, 0x24, 0x2E, 0xAA, 0x86, 0x0B, 0xB3, 0x86, 0x9D, + 0x9D, 0xB6, 0x86, 0x85, 0xA6, 0x86, 0x27, 0x7A, 0x11, 0x37, 0x42, 0x0B, 0x37, 0x86, 0x3C, 0x3C, + 0x86, 0xA6, 0x7A, 0x86, 0x43, 0x42, 0x86, 0x2E, 0x11, 0x5E, 0x71, 0x71, 0x86, 0x86, 0x86, 0x86, + 0x86, 0x86, 0x3C, 0x5E, 0x86, 0x85, 0x0B, 0x2E, 0x86, 0x71, 0x71, 0x0B, 0xB6, 0x86, 0x86, 0x85, + 0x5F, 0x86, 0x48, 0x49, 0x3C, 0x42, 0x85, 0x85, 0x71, 0xAC, 0x11, 0x86, 0xAC, 0xAD, 0x43, 0x0B, + 0x11, 0x86, 0x42, 0x86, 0x86, 0x2E, 0x2E, 0x7A, 0x7A, 0x7A, 0x71, 0x7A, 0x42, 0x48, 0x42, 0x86, + 0xB6, 0x42, 0x85, 0x85, 0x2E, 0x86, 0xC0, 0xAC, 0xAD, 0x3C, 0x0A, 0xAC, 0xAD, 0x95, 0x86, 0x86, + 0x95, 0x97, 0x96, 0x2B, 0x95, 0x86, 0x8E, 0x8D, 0x8F, 0xB6, 0x3C, 0xB6, 0x9D, 0x86, 0x86, 0x86, + 0xAC, 0x2E, 0x5E, 0xB3, 0xB6, 0xB6, 0x2E, 0x11, 0xA6, 0x3C, 0x86, 0xB6, 0xAD, 0x37, 0xAD, 0xAC, + 0xAC, 0xAD, 0x3C, 0x86, 0x86, 0x14, 0x7A, 0x2E, 0x85, 0x86, 0x86, 0xBA, 0x86, 0x11, 0xB6, 0x2E, + }, + new[] + { + (0x9, CompositionClass.BlurredWallpaperBackdropBrush), + (0xF, CompositionClass.BlurredWallpaperBackdropBrush), + (0x16, CompositionClass.ColorBrush), + (0x1E, CompositionClass.ComponentTransform3D), + (0xB6, CompositionClass.Visual), + (0xBD, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), + (CompositionProperty.VisualTransform, 0x4u, 0xADu), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x31 }), + }); + + private static readonly CompositionTableSet Set26100_7705 = new( + new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (2, CompositionCommand.CreateResource), + (4, CompositionCommand.ReleaseResource), + (10, CompositionCommand.SetCallbackId), + (11, CompositionCommand.SetInteger), + (15, CompositionCommand.SetBuffer), + (16, CompositionCommand.SetReference), + (22, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xC2, 0x3D, 0x0A, 0x7B, 0x87, 0x7B, 0x3D, 0x2F, 0x87, 0x11, 0x87, 0x72, 0x87, 0x55, 0x3D, 0x11, + 0x3D, 0x87, 0x55, 0x87, 0x86, 0x11, 0x11, 0x87, 0x3D, 0x87, 0x87, 0x43, 0x72, 0x7B, 0xAF, 0x3D, + 0x24, 0x24, 0x2F, 0xAC, 0x87, 0x11, 0x87, 0x24, 0x7B, 0x24, 0x2F, 0xAC, 0x87, 0x0B, 0xB5, 0x87, + 0x9E, 0x9E, 0xB8, 0x87, 0x86, 0xA8, 0x87, 0x28, 0x7B, 0x11, 0x38, 0x43, 0x0B, 0x38, 0x87, 0x3D, + 0x3D, 0x87, 0xA8, 0x7B, 0x87, 0x44, 0x43, 0x87, 0x2F, 0x11, 0x5F, 0x72, 0x72, 0x87, 0x87, 0x87, + 0x87, 0x87, 0x87, 0x3D, 0x5F, 0x87, 0x86, 0x0B, 0x2F, 0x87, 0x72, 0x72, 0x0B, 0xB8, 0x87, 0x87, + 0x86, 0x60, 0x87, 0x49, 0x4A, 0x3D, 0x43, 0x86, 0x86, 0x72, 0xAE, 0x11, 0x87, 0xAE, 0xAF, 0x44, + 0x0B, 0x11, 0x87, 0x43, 0x87, 0x87, 0x2F, 0x2F, 0x7B, 0x7B, 0x7B, 0x72, 0x7B, 0x43, 0x49, 0x43, + 0x87, 0xB8, 0x43, 0x86, 0x86, 0x2F, 0x87, 0xC2, 0xAE, 0xAF, 0x3D, 0x0A, 0xAE, 0xAF, 0x96, 0x87, + 0x87, 0x96, 0x98, 0x97, 0x2C, 0x96, 0x87, 0x8F, 0x8E, 0x90, 0xB8, 0x3D, 0xB8, 0x9E, 0x87, 0x87, + 0x87, 0xAE, 0x2F, 0x87, 0x5F, 0xB5, 0xB8, 0xB8, 0x2F, 0x11, 0xA8, 0x3D, 0x87, 0xB8, 0xAF, 0x38, + 0xAF, 0xAE, 0xAE, 0xAF, 0x3D, 0x87, 0x87, 0x14, 0x7B, 0x2F, 0x86, 0x87, 0x87, 0xBC, 0x87, 0x11, + 0xB8, 0x2F, + }, + new[] + { + (0x9, CompositionClass.BlurredWallpaperBackdropBrush), + (0xF, CompositionClass.BlurredWallpaperBackdropBrush), + (0x16, CompositionClass.ColorBrush), + (0x1E, CompositionClass.ComponentTransform3D), + (0xB8, CompositionClass.Visual), + (0xBF, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), + (CompositionProperty.VisualTransform, 0x4u, 0xAFu), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x31 }), + }); + + private static readonly CompositionTableSet Set26100_8972 = new( + new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (2, CompositionCommand.CreateResource), + (4, CompositionCommand.ReleaseResource), + (10, CompositionCommand.SetCallbackId), + (11, CompositionCommand.SetInteger), + (15, CompositionCommand.SetBuffer), + (16, CompositionCommand.SetReference), + (22, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xBE, 0x3B, 0x0A, 0x79, 0x85, 0x79, 0x3B, 0x2D, 0x85, 0x11, 0x85, 0x70, 0x85, 0x53, 0x3B, 0x11, + 0x3B, 0x85, 0x53, 0x85, 0x84, 0x11, 0x11, 0x85, 0x3B, 0x85, 0x85, 0x41, 0x70, 0x79, 0xAB, 0x3B, + 0x23, 0x23, 0x2D, 0x85, 0x11, 0x85, 0x23, 0x79, 0x23, 0x2D, 0x85, 0x0B, 0xB1, 0x85, 0x9C, 0x9C, + 0xB4, 0x85, 0x84, 0xA6, 0x85, 0x27, 0x79, 0x11, 0x36, 0x41, 0x0B, 0x36, 0x85, 0x3B, 0x3B, 0x85, + 0xA6, 0x79, 0x85, 0x42, 0x41, 0x85, 0x2D, 0x11, 0x5D, 0x70, 0x70, 0x85, 0x85, 0x85, 0x85, 0x85, + 0x85, 0x3B, 0x5D, 0x85, 0x84, 0x0B, 0x2D, 0x85, 0x70, 0x70, 0x0B, 0xB4, 0x85, 0x85, 0x84, 0x5E, + 0x85, 0x47, 0x48, 0x3B, 0x41, 0x84, 0x84, 0x70, 0xAA, 0x11, 0x85, 0xAA, 0xAB, 0x42, 0x0B, 0x11, + 0x85, 0x41, 0x85, 0x85, 0x2D, 0x2D, 0x79, 0x79, 0x79, 0x70, 0x79, 0x41, 0x47, 0x41, 0x85, 0xB4, + 0x41, 0x84, 0x84, 0x2D, 0x85, 0xBE, 0xAA, 0xAB, 0x3B, 0x0A, 0xAA, 0xAB, 0x94, 0x85, 0x85, 0x94, + 0x96, 0x95, 0x2A, 0x94, 0x85, 0x8D, 0x8C, 0x8E, 0xB4, 0x3B, 0xB4, 0x9C, 0x85, 0x85, 0x85, 0xAA, + 0x2D, 0x85, 0x5D, 0xB1, 0xB4, 0xB4, 0x2D, 0x11, 0xA6, 0x3B, 0xAB, 0x36, 0xAB, 0xAA, 0xAA, 0xAB, + 0x3B, 0x85, 0x85, 0x14, 0x79, 0x2D, 0x84, 0x85, 0x85, 0xB8, 0x85, 0x11, 0xB4, 0x2D, + }, + new[] + { + (0x9, CompositionClass.BlurredWallpaperBackdropBrush), + (0xF, CompositionClass.BlurredWallpaperBackdropBrush), + (0x16, CompositionClass.ColorBrush), + (0x1E, CompositionClass.ComponentTransform3D), + (0xB4, CompositionClass.Visual), + (0xBB, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), + (CompositionProperty.VisualTransform, 0x4u, 0xABu), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x30, 0x33 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x31 }), + }); + + private static readonly CompositionTableSet Set28000_2113 = new( + new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (2, CompositionCommand.CreateResource), + (4, CompositionCommand.ReleaseResource), + (10, CompositionCommand.SetCallbackId), + (11, CompositionCommand.SetInteger), + (15, CompositionCommand.SetBuffer), + (16, CompositionCommand.SetReference), + (22, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xA6, 0x33, 0x4C, 0x09, 0x63, 0x6E, 0x63, 0x33, 0x10, 0x6E, 0x59, 0x6E, 0x6E, 0x33, 0x10, 0x33, + 0x6E, 0x6E, 0x6D, 0x10, 0x6E, 0x33, 0x38, 0x59, 0x63, 0x94, 0x33, 0x24, 0x91, 0x6E, 0x63, 0x24, + 0x91, 0x6E, 0x0A, 0x9A, 0x6E, 0x85, 0x85, 0x9C, 0x6E, 0x6D, 0x8D, 0x6E, 0x5C, 0x1E, 0x63, 0x10, + 0x2E, 0x38, 0x0A, 0x2E, 0x33, 0x33, 0x6E, 0x8D, 0x63, 0x6E, 0x24, 0x10, 0x6E, 0x33, 0x6D, 0x0A, + 0x24, 0x6E, 0x44, 0x44, 0x59, 0x59, 0x0A, 0x9C, 0x6E, 0x6D, 0x49, 0x6E, 0x6E, 0x3B, 0x33, 0x38, + 0x6D, 0x6D, 0x59, 0x93, 0x10, 0x93, 0x94, 0x0A, 0x10, 0x6E, 0x38, 0x5C, 0x4C, 0x6E, 0x24, 0x24, + 0x63, 0x63, 0x63, 0x59, 0x63, 0x38, 0x3B, 0x38, 0x9C, 0x38, 0x6D, 0x6D, 0x24, 0x6E, 0xA6, 0x93, + 0x94, 0x33, 0x09, 0x93, 0x94, 0x7D, 0x6E, 0x6E, 0x7D, 0x7F, 0x7E, 0x21, 0x7D, 0x6E, 0x76, 0x75, + 0x77, 0x9C, 0x33, 0x9C, 0x85, 0x6E, 0x6E, 0x93, 0x24, 0x5C, 0x9A, 0x9C, 0x9C, 0x24, 0x10, 0x8D, + 0x33, 0x6E, 0x9C, 0x94, 0x2E, 0x94, 0x93, 0x93, 0x94, 0x33, 0x6E, 0x6E, 0x63, 0x24, 0x63, 0x6E, + 0x6E, 0xA0, 0x6E, 0x10, 0x9C, 0x24, + }, + new[] + { + (0x8, CompositionClass.BlurredWallpaperBackdropBrush), + (0xE, CompositionClass.BlurredWallpaperBackdropBrush), + (0x13, CompositionClass.ColorBrush), + (0x19, CompositionClass.ComponentTransform3D), + (0x3C, CompositionClass.BlurredWallpaperBackdropBrush), + (0x9C, CompositionClass.Visual), + (0xA3, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), + (CompositionProperty.VisualTransform, 0x4u, 0x94u), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x2E, 0x31 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x2F }), + }); + + private static readonly CompositionTableSet Set28000_2525 = new( + new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (2, CompositionCommand.CreateResource), + (4, CompositionCommand.ReleaseResource), + (10, CompositionCommand.SetCallbackId), + (11, CompositionCommand.SetInteger), + (15, CompositionCommand.SetBuffer), + (16, CompositionCommand.SetReference), + (22, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xA8, 0x34, 0x4D, 0x09, 0x64, 0x6F, 0x64, 0x34, 0x10, 0x6F, 0x5A, 0x6F, 0x6F, 0x34, 0x10, 0x34, + 0x6F, 0x6F, 0x6E, 0x10, 0x6F, 0x34, 0x39, 0x5A, 0x64, 0x96, 0x34, 0x25, 0x93, 0x10, 0x6F, 0x64, + 0x25, 0x93, 0x6F, 0x0A, 0x9C, 0x6F, 0x86, 0x86, 0x9E, 0x6F, 0x6E, 0x8F, 0x6F, 0x5D, 0x1F, 0x64, + 0x10, 0x2F, 0x39, 0x0A, 0x2F, 0x34, 0x34, 0x6F, 0x8F, 0x64, 0x6F, 0x25, 0x10, 0x6F, 0x34, 0x6E, + 0x0A, 0x25, 0x6F, 0x45, 0x45, 0x5A, 0x5A, 0x0A, 0x9E, 0x6F, 0x6E, 0x4A, 0x6F, 0x6F, 0x3C, 0x34, + 0x39, 0x6E, 0x6E, 0x5A, 0x95, 0x10, 0x95, 0x96, 0x0A, 0x10, 0x6F, 0x39, 0x5D, 0x4D, 0x6F, 0x25, + 0x25, 0x64, 0x64, 0x64, 0x5A, 0x64, 0x39, 0x3C, 0x39, 0x9E, 0x39, 0x6E, 0x6E, 0x25, 0x6F, 0xA8, + 0x95, 0x96, 0x34, 0x09, 0x95, 0x96, 0x7E, 0x6F, 0x6F, 0x7E, 0x80, 0x7F, 0x22, 0x7E, 0x6F, 0x77, + 0x76, 0x78, 0x9E, 0x34, 0x9E, 0x86, 0x6F, 0x6F, 0x95, 0x25, 0x6F, 0x5D, 0x9C, 0x9E, 0x9E, 0x25, + 0x10, 0x8F, 0x34, 0x6F, 0x9E, 0x96, 0x2F, 0x96, 0x95, 0x95, 0x96, 0x34, 0x6F, 0x6F, 0x64, 0x25, + 0x64, 0x6F, 0x6F, 0xA2, 0x6F, 0x10, 0x9E, 0x25, + }, + new[] + { + (0x8, CompositionClass.BlurredWallpaperBackdropBrush), + (0xE, CompositionClass.BlurredWallpaperBackdropBrush), + (0x13, CompositionClass.ColorBrush), + (0x19, CompositionClass.ComponentTransform3D), + (0x3D, CompositionClass.BlurredWallpaperBackdropBrush), + (0x9E, CompositionClass.Visual), + (0xA5, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), + (CompositionProperty.VisualTransform, 0x4u, 0x96u), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x2E, 0x31 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x2F }), + }); + + private static readonly CompositionTableSet Set28000_3086 = new( + new byte[] { 24, 8, 16, 24, 8, 16, 24, 24, 12, 16, 12, 24, 16, 24, 16, 16, 16, 16, 16, 16, 20, 72, 16, 12 }, + new[] + { + (2, CompositionCommand.CreateResource), + (4, CompositionCommand.ReleaseResource), + (10, CompositionCommand.SetCallbackId), + (11, CompositionCommand.SetInteger), + (15, CompositionCommand.SetBuffer), + (16, CompositionCommand.SetReference), + (22, CompositionCommand.SetVisualInputSink), + }, + new byte[] + { + 0xA4, 0x32, 0x4B, 0x09, 0x62, 0x6D, 0x62, 0x32, 0x10, 0x6D, 0x58, 0x6D, 0x6D, 0x32, 0x10, 0x32, + 0x6D, 0x6D, 0x6C, 0x10, 0x6D, 0x32, 0x37, 0x58, 0x62, 0x92, 0x32, 0x23, 0x10, 0x6D, 0x62, 0x23, + 0x6D, 0x0A, 0x98, 0x6D, 0x84, 0x84, 0x9A, 0x6D, 0x6C, 0x8D, 0x6D, 0x5B, 0x1E, 0x62, 0x10, 0x2D, + 0x37, 0x0A, 0x2D, 0x32, 0x32, 0x6D, 0x8D, 0x62, 0x6D, 0x23, 0x10, 0x6D, 0x32, 0x6C, 0x0A, 0x23, + 0x6D, 0x43, 0x43, 0x58, 0x58, 0x0A, 0x9A, 0x6D, 0x6C, 0x48, 0x6D, 0x6D, 0x3A, 0x32, 0x37, 0x6C, + 0x6C, 0x58, 0x91, 0x10, 0x91, 0x92, 0x0A, 0x10, 0x6D, 0x37, 0x5B, 0x4B, 0x6D, 0x23, 0x23, 0x62, + 0x62, 0x62, 0x58, 0x62, 0x37, 0x3A, 0x37, 0x9A, 0x37, 0x6C, 0x6C, 0x23, 0x6D, 0xA4, 0x91, 0x92, + 0x32, 0x09, 0x91, 0x92, 0x7C, 0x6D, 0x6D, 0x7C, 0x7E, 0x7D, 0x20, 0x7C, 0x6D, 0x75, 0x74, 0x76, + 0x9A, 0x32, 0x9A, 0x84, 0x6D, 0x6D, 0x91, 0x23, 0x6D, 0x5B, 0x98, 0x9A, 0x9A, 0x23, 0x10, 0x8D, + 0x32, 0x92, 0x2D, 0x92, 0x91, 0x91, 0x92, 0x32, 0x6D, 0x6D, 0x62, 0x23, 0x62, 0x6D, 0x6D, 0x9E, + 0x6D, 0x10, 0x9A, 0x23, + }, + new[] + { + (0x8, CompositionClass.BlurredWallpaperBackdropBrush), + (0xE, CompositionClass.BlurredWallpaperBackdropBrush), + (0x13, CompositionClass.ColorBrush), + (0x19, CompositionClass.ComponentTransform3D), + (0x3B, CompositionClass.BlurredWallpaperBackdropBrush), + (0x9A, CompositionClass.Visual), + (0xA1, CompositionClass.BlurredWallpaperBackdropBrush), + }, + new[] + { + (CompositionProperty.PropertyChangeMask, 0x0u, 0x0u), + (CompositionProperty.VisualTransform, 0x4u, 0x92u), + }, + new[] + { + (CompositionClass.Visual, CompositionSlots.Integer, + new uint[] { 0x8, 0x9, 0xA, 0xE, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x1B, 0x25, 0x26, 0x29, 0x2A, 0x2B, 0x2E, 0x31 }), + (CompositionClass.Visual, CompositionSlots.Reference, + new uint[] { 0x4, 0x5, 0x6, 0x7, 0xB, 0x17, 0x27, 0x28, 0x2F }), + }); + + internal static CompositionTableSet Find(ushort Build, ushort Revision) => (Build, Revision) switch + { + (22621, 1252) => Set22621_1252, + (22621, 1254) => Set22621_1252, + (22621, 1258) => Set22621_1252, + (22621, 2792) => Set22621_1252, + (22621, 3085) => Set22621_1252, + (22621, 3155) => Set22621_1252, + (22621, 3227) => Set22621_1252, + (22621, 3296) => Set22621_1252, + (22621, 3447) => Set22621_1252, + (22621, 3570) => Set22621_1252, + (22621, 3593) => Set22621_1252, + (22621, 3672) => Set22621_1252, + (22621, 3733) => Set22621_1252, + (22621, 3810) => Set22621_1252, + (22621, 3880) => Set22621_1252, + (22621, 4034) => Set22621_1252, + (22621, 4110) => Set22621_1252, + (22621, 4169) => Set22621_1252, + (22621, 4245) => Set22621_1252, + (22621, 4317) => Set22621_1252, + (22621, 4391) => Set22621_1252, + (22621, 4455) => Set22621_1252, + (22621, 4541) => Set22621_1252, + (22621, 4746) => Set22621_1252, + (22621, 4890) => Set22621_1252, + (22621, 4974) => Set22621_1252, + (22621, 5124) => Set22621_1252, + (22621, 5192) => Set22621_1252, + (22621, 5331) => Set22621_1252, + (22621, 5401) => Set22621_1252, + (22621, 5471) => Set22621_1252, + (22621, 5547) => Set22621_1252, + (22621, 5624) => Set22621_1252, + (22621, 5697) => Set22621_1252, + (22621, 5771) => Set22621_1252, + (22621, 5909) => Set22621_1252, + (22621, 6060) => Set22621_1252, + (22621, 6133) => Set22621_1252, + (22621, 6197) => Set22621_1252, + (22621, 6270) => Set22621_1252, + (22621, 6493) => Set22621_1252, + (22621, 6783) => Set22621_1252, + (22621, 6929) => Set22621_1252, + (22621, 7079) => Set22621_1252, + (22621, 7208) => Set22621_1252, + (22621, 7372) => Set22621_1252, + (22621, 7510) => Set22621_1252, + (22621, 7581) => Set22621_1252, + (22621, 7640) => Set22621_1252, + (26100, 1) => Set26100_1, + (26100, 863) => Set26100_1, + (26100, 1000) => Set26100_1, + (26100, 1150) => Set26100_1, + (26100, 1301) => Set26100_1, + (26100, 1591) => Set26100_1, + (26100, 1742) => Set26100_1, + (26100, 1882) => Set26100_1, + (26100, 2033) => Set26100_1, + (26100, 2161) => Set26100_1, + (26100, 2314) => Set26100_1, + (26100, 2454) => Set26100_2454, + (26100, 2605) => Set26100_2454, + (26100, 3037) => Set26100_2454, + (26100, 3194) => Set26100_2454, + (26100, 3323) => Set26100_3323, + (26100, 3470) => Set26100_3323, + (26100, 3624) => Set26100_3323, + (26100, 3775) => Set26100_3323, + (26100, 3912) => Set26100_3323, + (26100, 4061) => Set26100_3323, + (26100, 4202) => Set26100_3323, + (26100, 4343) => Set26100_3323, + (26100, 4484) => Set26100_3323, + (26100, 4652) => Set26100_3323, + (26100, 4768) => Set26100_3323, + (26100, 4946) => Set26100_3323, + (26100, 5074) => Set26100_3323, + (26100, 6725) => Set26100_3323, + (26100, 6899) => Set26100_3323, + (26100, 7019) => Set26100_3323, + (26100, 7171) => Set26100_3323, + (26100, 7309) => Set26100_3323, + (26100, 7623) => Set26100_3323, + (26100, 7705) => Set26100_7705, + (26100, 7920) => Set26100_7705, + (26100, 8036) => Set26100_7705, + (26100, 8115) => Set26100_7705, + (26100, 8246) => Set26100_7705, + (26100, 8328) => Set26100_7705, + (26100, 8457) => Set26100_7705, + (26100, 8524) => Set26100_7705, + (26100, 8655) => Set26100_7705, + (26100, 8737) => Set26100_7705, + (26100, 8875) => Set26100_7705, + (26100, 8972) => Set26100_8972, + (26100, 9278) => Set26100_8972, + (26100, 9444) => Set26100_8972, + (26100, 9549) => Set26100_8972, + (26100, 9711) => Set26100_8972, + (28000, 2113) => Set28000_2113, + (28000, 2525) => Set28000_2525, + (28000, 3086) => Set28000_3086, + _ => null, + }; + } +}