diff --git a/ColorControl/AmdService.cs b/ColorControl/AmdService.cs index a6b5539..ab99033 100644 --- a/ColorControl/AmdService.cs +++ b/ColorControl/AmdService.cs @@ -144,8 +144,8 @@ namespace ColorControl if (preset.applyRefreshRate) { - if (!SetRefreshRate(preset.refreshRate)) { + if (!SetRefreshRate(preset.refreshRate)) result = false; } } @@ -218,7 +218,7 @@ namespace ColorControl var portrait = vertical > horizontal; - return SetRefreshRateInternal(GetDisplayDeviceName(display), refreshRate, portrait, horizontal, vertical); + return SetRefreshRateInternal(GetDisplayDeviceName(display), (int)refreshRate, portrait, horizontal, vertical); } public List GetAvailableRefreshRates(AmdPreset preset = null) diff --git a/ColorControl/ColorControl.csproj b/ColorControl/ColorControl.csproj index 1006946..e67d893 100644 --- a/ColorControl/ColorControl.csproj +++ b/ColorControl/ColorControl.csproj @@ -18,8 +18,8 @@ Maassoft Maassoft 0 - 5.7.1.0 - 5.7.1.0 + 6.0.0.0 + 6.0.0.0 false true false @@ -93,6 +93,12 @@ + + PreserveNewest + + + PreserveNewest + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/ColorControl/GraphicsService.cs b/ColorControl/GraphicsService.cs index 7fe4689..7bc313e 100644 --- a/ColorControl/GraphicsService.cs +++ b/ColorControl/GraphicsService.cs @@ -51,7 +51,7 @@ namespace ColorControl } } - protected bool SetRefreshRateInternal(string displayName, uint refreshRate, bool portrait, int horizontal, int vertical, bool updateRegistry = false) + protected bool SetRefreshRateInternal(string displayName, int refreshRate, bool portrait, int horizontal, int vertical, bool updateRegistry = false) { uint i = 0; DEVMODEA devMode; @@ -106,5 +106,29 @@ namespace ColorControl } return 0; } + + protected List GetAvailableResolutionsInternal(string displayName, bool portrait, uint refreshRate = 0) + { + var list = new List(); + + uint i = 0; + DEVMODEA devMode; + while (NativeMethods.EnumDisplaySettingsA(displayName, i, out devMode)) + { + if ((portrait ? devMode.dmPelsWidth < devMode.dmPelsHeight : devMode.dmPelsWidth > devMode.dmPelsHeight) && + (refreshRate == 0 || devMode.dmDisplayFrequency == refreshRate) && + !list.Any(m => m.dmPelsWidth == devMode.dmPelsWidth && m.dmPelsHeight == devMode.dmPelsHeight)) + { + list.Add(devMode); + } + i++; + } + + list.Sort((a, b) => (int)(a.dmPelsWidth - b.dmPelsWidth)); + + return list; + } + + } } diff --git a/ColorControl/LgDevice.cs b/ColorControl/LgDevice.cs index dbf7d64..45ba857 100644 --- a/ColorControl/LgDevice.cs +++ b/ColorControl/LgDevice.cs @@ -137,10 +137,11 @@ namespace ColorControl AddInvokableAction("WOL", new Func, bool>(WakeAction)); AddGenericPictureAction("backlight", minValue: 0, maxValue: 100); - AddGenericPictureAction("brightness", minValue: 0, maxValue: 100); + AddGenericPictureAction("brightness", minValue: 0, maxValue: 100, title: "Brightness/Black Level"); AddGenericPictureAction("contrast", minValue: 0, maxValue: 100); AddGenericPictureAction("color", minValue: 0, maxValue: 100); AddGenericPictureAction("pictureMode", typeof(PictureMode), title: "Picture Mode"); + AddGenericPictureAction("sharpness", minValue: 0, maxValue: 50); //AddGenericPictureAction("dynamicRange", typeof(DynamicRange), category: "dimensionInfo", title: "Dynamic Range"); AddGenericPictureAction("colorGamut", typeof(ColorGamut), title: "Color Gamut"); AddGenericPictureAction("dynamicContrast", typeof(OffToHigh), title: "Dynamic Contrast"); @@ -152,9 +153,11 @@ namespace ColorControl AddGenericPictureAction("smoothGradation", typeof(OffToAuto), title: "Smooth Gradation"); AddGenericPictureAction("energySaving", typeof(EnergySaving), title: "Energy Saving"); AddGenericPictureAction("hdrDynamicToneMapping", typeof(DynamicTonemapping), title: "HDR Dynamic Tone Mapping"); - //AddGenericPictureAction("blackLevel", typeof(LowToAuto)); + AddGenericPictureAction("blackLevel", typeof(BlackLevel), title: "HDMI Black Level"); //AddGenericPictureAction("ambientLightCompensation", typeof(OffToAuto2)); - //AddGenericPictureAction("truMotionMode", typeof(TruMotionMode)); + AddGenericPictureAction("truMotionMode", typeof(TruMotionMode), title: "TruMotion"); + AddGenericPictureAction("truMotionJudder", minValue: 0, maxValue: 10, title: "TruMotion Judder"); + AddGenericPictureAction("truMotionBlur", minValue: 0, maxValue: 10, title: "TruMotion Blur"); AddGenericPictureAction("motionProOLED", typeof(OffToHigh), title: "OLED Motion Pro"); AddGenericPictureAction("motionPro", typeof(OffToOn), title: "Motion Pro"); AddGenericPictureAction("uhdDeepColorHDMI1", typeof(OffToOn), category: "other"); @@ -181,6 +184,7 @@ namespace ColorControl AddInternalPresetAction(new LgPreset("InStart", "com.webos.app.factorywin", new[] { "0", "4", "1", "3" }, new { id = "executeFactory", irKey = "inStart" })); AddInternalPresetAction(new LgPreset("EzAdjust", "com.webos.app.factorywin", new[] { "0", "4", "1", "3" }, new { id = "executeFactory", irKey = "ezAdjust" })); + //AddInternalPresetAction(new LgPreset("PictureCheck", "com.webos.app.factorywin", null, new { id = "executeFactory", irKey = "pCheck" })); AddInternalPresetAction(new LgPreset("Software Update", "com.webos.app.softwareupdate", null, new { mode = "user", flagUpdate = true })); AddSetDeviceConfigAction("HDMI_1_icon", typeof(HdmiIcon), "HDMI 1 icon"); diff --git a/ColorControl/MainForm.Designer.cs b/ColorControl/MainForm.Designer.cs index 489d328..0e41b03 100644 --- a/ColorControl/MainForm.Designer.cs +++ b/ColorControl/MainForm.Designer.cs @@ -52,6 +52,8 @@ this.miNvPresetColorSettings = new System.Windows.Forms.ToolStripMenuItem(); this.mnuRefreshRate = new System.Windows.Forms.ToolStripMenuItem(); this.miRefreshRateIncluded = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuNvResolution = new System.Windows.Forms.ToolStripMenuItem(); + this.miNvResolutionIncluded = new System.Windows.Forms.ToolStripMenuItem(); this.miNvPresetDithering = new System.Windows.Forms.ToolStripMenuItem(); this.miNvPresetApplyDithering = new System.Windows.Forms.ToolStripMenuItem(); this.miNvPresetDitheringEnabled = new System.Windows.Forms.ToolStripMenuItem(); @@ -69,6 +71,8 @@ this.miHDRIncluded = new System.Windows.Forms.ToolStripMenuItem(); this.miToggleHDR = new System.Windows.Forms.ToolStripMenuItem(); this.miHDREnabled = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuNvDriverSettings = new System.Windows.Forms.ToolStripMenuItem(); + this.miNvDriverSettingsIncluded = new System.Windows.Forms.ToolStripMenuItem(); this.miNvCopyId = new System.Windows.Forms.ToolStripMenuItem(); this.btnApply = new System.Windows.Forms.Button(); this.lvNvPresets = new System.Windows.Forms.ListView(); @@ -406,11 +410,13 @@ this.mnuNvDisplay, this.mnuNvPresetsColorSettings, this.mnuRefreshRate, + this.mnuNvResolution, this.miNvPresetDithering, this.miNvHDR, + this.mnuNvDriverSettings, this.miNvCopyId}); this.mnuNvPresets.Name = "mnuNvPresets"; - this.mnuNvPresets.Size = new System.Drawing.Size(185, 186); + this.mnuNvPresets.Size = new System.Drawing.Size(185, 230); this.mnuNvPresets.Opening += new System.ComponentModel.CancelEventHandler(this.mnuNvPresets_Opening); // // miNvApply @@ -454,7 +460,7 @@ this.miNvPresetColorSettings}); this.mnuNvPresetsColorSettings.Name = "mnuNvPresetsColorSettings"; this.mnuNvPresetsColorSettings.Size = new System.Drawing.Size(184, 22); - this.mnuNvPresetsColorSettings.Text = "Color settings"; + this.mnuNvPresetsColorSettings.Text = "Color Settings"; // // miNvPresetColorSettings // @@ -478,6 +484,22 @@ this.miRefreshRateIncluded.Text = "Included"; this.miRefreshRateIncluded.Click += new System.EventHandler(this.includedToolStripMenuItem_Click); // + // mnuNvResolution + // + this.mnuNvResolution.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miNvResolutionIncluded}); + this.mnuNvResolution.Name = "mnuNvResolution"; + this.mnuNvResolution.Size = new System.Drawing.Size(184, 22); + this.mnuNvResolution.Text = "Resolution"; + // + // miNvResolutionIncluded + // + this.miNvResolutionIncluded.CheckOnClick = true; + this.miNvResolutionIncluded.Name = "miNvResolutionIncluded"; + this.miNvResolutionIncluded.Size = new System.Drawing.Size(120, 22); + this.miNvResolutionIncluded.Text = "Included"; + this.miNvResolutionIncluded.Click += new System.EventHandler(this.miNvResolutionIncluded_Click); + // // miNvPresetDithering // this.miNvPresetDithering.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -620,6 +642,21 @@ this.miHDREnabled.Text = "Enabled"; this.miHDREnabled.Click += new System.EventHandler(this.miHDREnabled_Click); // + // mnuNvDriverSettings + // + this.mnuNvDriverSettings.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miNvDriverSettingsIncluded}); + this.mnuNvDriverSettings.Name = "mnuNvDriverSettings"; + this.mnuNvDriverSettings.Size = new System.Drawing.Size(184, 22); + this.mnuNvDriverSettings.Text = "Driver Settings"; + // + // miNvDriverSettingsIncluded + // + this.miNvDriverSettingsIncluded.Name = "miNvDriverSettingsIncluded"; + this.miNvDriverSettingsIncluded.Size = new System.Drawing.Size(120, 22); + this.miNvDriverSettingsIncluded.Text = "Included"; + this.miNvDriverSettingsIncluded.Click += new System.EventHandler(this.miNvDriverSettingsIncluded_Click); + // // miNvCopyId // this.miNvCopyId.Name = "miNvCopyId"; @@ -651,6 +688,7 @@ this.lvNvPresets.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.lvNvPresets.MultiSelect = false; this.lvNvPresets.Name = "lvNvPresets"; + this.lvNvPresets.ShowItemToolTips = true; this.lvNvPresets.Size = new System.Drawing.Size(1098, 415); this.lvNvPresets.TabIndex = 0; this.lvNvPresets.UseCompatibleStateImageBehavior = false; @@ -963,6 +1001,7 @@ this.lvAmdPresets.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.lvAmdPresets.MultiSelect = false; this.lvAmdPresets.Name = "lvAmdPresets"; + this.lvAmdPresets.ShowItemToolTips = true; this.lvAmdPresets.Size = new System.Drawing.Size(1098, 415); this.lvAmdPresets.TabIndex = 10; this.lvAmdPresets.UseCompatibleStateImageBehavior = false; @@ -1245,7 +1284,7 @@ this.miLgDisableMotionPro}); this.mnuLgOLEDMotionPro.Name = "mnuLgOLEDMotionPro"; this.mnuLgOLEDMotionPro.Size = new System.Drawing.Size(320, 22); - this.mnuLgOLEDMotionPro.Text = "Activate OLED Motion Pro (B9/C9/E9/W9 only)"; + this.mnuLgOLEDMotionPro.Text = "Activate OLED Motion Pro (B9/C9/E9/W9/C2/G2 only)"; // // miLgEnableMotionPro // @@ -1336,6 +1375,7 @@ this.lvLgPresets.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.lvLgPresets.MultiSelect = false; this.lvLgPresets.Name = "lvLgPresets"; + this.lvLgPresets.ShowItemToolTips = true; this.lvLgPresets.Size = new System.Drawing.Size(883, 106); this.lvLgPresets.TabIndex = 8; this.lvLgPresets.UseCompatibleStateImageBehavior = false; @@ -2486,6 +2526,10 @@ private System.Windows.Forms.TextBox edtLgGameBarShortcut; private System.Windows.Forms.ComboBox cbxLgPcHdmiPort; private System.Windows.Forms.Label lblLgPcHdmiPort; + private System.Windows.Forms.ToolStripMenuItem mnuNvResolution; + private System.Windows.Forms.ToolStripMenuItem miNvResolutionIncluded; + private System.Windows.Forms.ToolStripMenuItem mnuNvDriverSettings; + private System.Windows.Forms.ToolStripMenuItem miNvDriverSettingsIncluded; } } diff --git a/ColorControl/MainForm.cs b/ColorControl/MainForm.cs index d2ea351..57cdde9 100644 --- a/ColorControl/MainForm.cs +++ b/ColorControl/MainForm.cs @@ -3,10 +3,13 @@ using LgTv; using Newtonsoft.Json; using NLog; using NonInvasiveKeyboardHookLibrary; +using nspector.Common; +using nspector.Common.Meta; using NStandard; using NvAPIWrapper.Display; using NvAPIWrapper.Native.Display; using NWin32; +using NWin32.NativeTypes; using System; using System.Collections; using System.Collections.Generic; @@ -299,6 +302,7 @@ namespace ColorControl lbPlugins.Items.Add("NvAPIWrapper.Net by Soroush Falahati"); lbPlugins.Items.Add("NWin32 by zmjack"); lbPlugins.Items.Add("TaskScheduler by David Hall"); + lbPlugins.Items.Add("NVIDIA Profile Inspector by Orbmu2k"); } private void OpenForm(object sender, EventArgs e) @@ -936,8 +940,10 @@ namespace ColorControl miNvPresetColorSettings.Enabled = preset != null; mnuNvPresetsColorSettings.Enabled = preset != null; mnuRefreshRate.Enabled = preset != null; + mnuNvResolution.Enabled = preset != null; miNvPresetDithering.Enabled = preset != null; miNvHDR.Enabled = preset != null; + mnuNvDriverSettings.Enabled = preset != null; if (preset != null) { @@ -973,6 +979,10 @@ namespace ColorControl { mnuRefreshRate.DropDownItems.RemoveAt(mnuRefreshRate.DropDownItems.Count - 1); } + while (mnuNvResolution.DropDownItems.Count > 1) + { + mnuNvResolution.DropDownItems.RemoveAt(mnuNvResolution.DropDownItems.Count - 1); + } } if (mnuRefreshRate.DropDownItems.Count == 1) @@ -988,16 +998,24 @@ namespace ColorControl } } + if (mnuNvResolution.DropDownItems.Count == 1) + { + var modes = _nvService.GetAvailableResolutions(preset); + + foreach (var mode in modes) + { + var item = mnuNvResolution.DropDownItems.Add($"{mode.dmPelsWidth}x{mode.dmPelsHeight}"); + item.Tag = mode; + item.Click += resolutionNvMenuItem_Click; + } + } + miNvPrimaryDisplay.Checked = preset.primaryDisplay; foreach (var item in mnuNvDisplay.DropDownItems) { - if (item is ToolStripMenuItem) + if (item is ToolStripMenuItem menuItem && menuItem.Tag != null) { - var menuItem = (ToolStripMenuItem)item; - if (menuItem.Tag != null) - { - menuItem.Checked = ((Display)menuItem.Tag).Name.Equals(preset.displayName); - } + menuItem.Checked = ((Display)menuItem.Tag).Name.Equals(preset.displayName); } } @@ -1006,13 +1024,19 @@ namespace ColorControl miRefreshRateIncluded.Checked = preset.applyRefreshRate; foreach (var item in mnuRefreshRate.DropDownItems) { - if (item is ToolStripMenuItem) + if (item is ToolStripMenuItem menuItem && menuItem.Tag != null) { - var menuItem = (ToolStripMenuItem)item; - if (menuItem.Tag != null) - { - menuItem.Checked = (uint)menuItem.Tag == preset.refreshRate; - } + menuItem.Checked = (uint)menuItem.Tag == preset.refreshRate; + } + } + + miNvResolutionIncluded.Checked = preset.applyResolution; + foreach (var item in mnuNvResolution.DropDownItems) + { + if (item is ToolStripMenuItem menuItem && menuItem.Tag != null) + { + var mode = (DEVMODEA)menuItem.Tag; + menuItem.Checked = mode.dmPelsWidth == preset.resolutionWidth && mode.dmPelsHeight == preset.resolutionHeight; } } @@ -1037,6 +1061,87 @@ namespace ColorControl miHDRIncluded.Checked = preset.applyHDR; miHDREnabled.Checked = preset.HDREnabled; miToggleHDR.Checked = preset.toggleHDR; + + var driverSettings = _nvService.GetVisibleSettings(); + + miNvDriverSettingsIncluded.Checked = preset.applyDriverSettings; + if (mnuNvDriverSettings.DropDownItems.Count == 1) + { + foreach (var driverSetting in driverSettings) + { + var item = new ToolStripMenuItem(driverSetting.SettingText); + mnuNvDriverSettings.DropDownItems.Add(item); + item.Tag = driverSetting; + + var subItemUnchanged = item.DropDownItems.Add("Unchanged"); + subItemUnchanged.Click += driverSettingValueNvMenuItem_Click; + + var settingMeta = _nvService.GetSettingMeta(driverSetting.SettingId); + + if (driverSetting.SettingId == NvService.DRS_FRAME_RATE_LIMITER_V3) + { + var subItem = item.DropDownItems.Add($"{driverSetting.ValueText} (click to change)"); + + var value = settingMeta.DwordValues.FirstOrDefault(v => v.ValueName == driverSetting.ValueText); + + subItem.Tag = value?.Value ?? 0; + subItem.Click += driverSettingFrameRateNvMenuItem_Click; + + continue; + } + + foreach (var settingValue in settingMeta.DwordValues) + { + var subItem = item.DropDownItems.Add(settingValue.ValueName); + subItem.Tag = settingValue; + subItem.Click += driverSettingValueNvMenuItem_Click; + } + } + } + + foreach (var item in mnuNvDriverSettings.DropDownItems) + { + if (item is ToolStripMenuItem menuItem && menuItem.Tag != null) + { + var driverSetting = menuItem.Tag as SettingItem; + var presetSetting = preset.driverSettings.GetValueOrDefault(driverSetting.SettingId, uint.MaxValue); + + foreach (var subItem in menuItem.DropDownItems) + { + if (subItem is ToolStripMenuItem subMenuItem) + { + if (subMenuItem.Tag != null) + { + if (driverSetting.SettingId == NvService.DRS_FRAME_RATE_LIMITER_V3) + { + if (presetSetting != uint.MaxValue) + { + var settingMeta = _nvService.GetSettingMeta(driverSetting.SettingId); + var metaValue = settingMeta.DwordValues.FirstOrDefault(v => v.Value == presetSetting); + subMenuItem.Text = $"{metaValue?.ValueName ?? "??FPS"} (click to change)"; + + subMenuItem.Checked = true; + + continue; + } + + subMenuItem.Checked = false; + + continue; + } + + var settingValue = subMenuItem.Tag as SettingValue; + + subMenuItem.Checked = presetSetting == settingValue.Value; + } + else + { + subMenuItem.Checked = presetSetting == uint.MaxValue; + } + } + } + } + } } } @@ -1078,6 +1183,18 @@ namespace ColorControl AddOrUpdateItem(); } + private void resolutionNvMenuItem_Click(object sender, EventArgs e) + { + var mode = (DEVMODEA)((ToolStripItem)sender).Tag; + + var preset = GetSelectedNvPreset(); + + preset.resolutionWidth = mode.dmPelsWidth; + preset.resolutionHeight = mode.dmPelsHeight; + + AddOrUpdateItem(); + } + private void refreshRateMenuItemAmd_Click(object sender, EventArgs e) { var refreshRate = (uint)((ToolStripItem)sender).Tag; @@ -1596,7 +1713,7 @@ namespace ColorControl private void UpdateTrayMenuNv() { - var presets = _nvService.GetPresets().Where(x => x.applyColorData || x.applyDithering || x.applyHDR || x.applyRefreshRate); + var presets = _nvService.GetPresets().Where(x => x.applyColorData || x.applyDithering || x.applyHDR || x.applyRefreshRate || x.applyResolution || x.applyDriverSettings); _nvTrayMenu.DropDownItems.Clear(); @@ -1902,6 +2019,7 @@ namespace ColorControl var action = item.Tag as LgDevice.InvokableAction; var text = action.Name; + var title = action.Title ?? action.Name; var value = string.Empty; @@ -1963,7 +2081,7 @@ namespace ColorControl var values = MessageForms.ShowDialog("Choose value", new[] { new MessageForms.FieldDefinition { - Label = "Choose desired " + text, + Label = "Choose desired " + title, FieldType = MessageForms.FieldType.DropDown, Values = dropDownValues } @@ -2890,7 +3008,7 @@ Do you want to continue?" { var device = _lgService.SelectedDevice; - var eligibleModels = new[] { "B9", "C9", "E9", "W9" }; + var eligibleModels = new[] { "B9", "C9", "E9", "W9", "C2", "G2" }; var visible = device?.ModelName != null ? eligibleModels.Any(m => device.ModelName.Contains(m)) : false; mnuLgOLEDMotionPro.Visible = visible; @@ -3238,5 +3356,81 @@ The InStart and Software Update items are now visible under the Expert-button." // Perform the sort with these new sort options. listView.Sort(); } + + private void miNvResolutionIncluded_Click(object sender, EventArgs e) + { + var preset = GetSelectedNvPreset(); + + preset.applyResolution = !preset.applyResolution; + + AddOrUpdateItem(); + } + + private void miNvDriverSettingsIncluded_Click(object sender, EventArgs e) + { + var preset = GetSelectedNvPreset(); + + preset.applyDriverSettings = !preset.applyDriverSettings; + + AddOrUpdateItem(); + } + + private void driverSettingValueNvMenuItem_Click(object sender, EventArgs e) + { + var preset = GetSelectedNvPreset(); + + var menuItem = (ToolStripItem)sender; + var parentMenuItem = menuItem.OwnerItem as ToolStripMenuItem; + + var settingItem = (SettingItem)parentMenuItem.Tag; + + if (menuItem.Tag == null) + { + preset.ResetDriverSetting(settingItem.SettingId); + } + else + { + var settingValue = (SettingValue)menuItem.Tag; + + preset.UpdateDriverSetting(settingItem, settingValue.Value); + } + + AddOrUpdateItem(); + } + + private void driverSettingFrameRateNvMenuItem_Click(object sender, EventArgs e) + { + var preset = GetSelectedNvPreset(); + + var menuItem = (ToolStripItem)sender; + var parentMenuItem = menuItem.OwnerItem as ToolStripMenuItem; + + var settingItem = (SettingItem)parentMenuItem.Tag; + + var settingMeta = _nvService.GetSettingMeta(settingItem.SettingId); + var presetValue = preset.driverSettings.GetValueOrDefault(settingItem.SettingId, settingMeta.DefaultDwordValue); + + var field = new MessageForms.FieldDefinition + { + MinValue = settingMeta.DwordValues.First().Value, + MaxValue = settingMeta.DwordValues.Last().Value, + Label = settingMeta.SettingName, + FieldType = MessageForms.FieldType.Numeric, + Value = presetValue + }; + + var resultFields = MessageForms.ShowDialog(field.Label, new[] { field }); + + if (!resultFields.Any()) + { + return; + } + + var settingValue = (uint)Utils.ParseInt((string)resultFields.First().Value); + + preset.UpdateDriverSetting(settingItem, settingValue); + + AddOrUpdateItem(); + } } } \ No newline at end of file diff --git a/ColorControl/MessageForms.cs b/ColorControl/MessageForms.cs index 2ce91b9..1bca212 100644 --- a/ColorControl/MessageForms.cs +++ b/ColorControl/MessageForms.cs @@ -120,6 +120,11 @@ namespace ColorControl numericEdit.Maximum = field.MaxValue; } + if (field.Value != null) + { + numericEdit.Text = field.Value.ToString(); + } + control = numericEdit; break; diff --git a/ColorControl/NvPreset.cs b/ColorControl/NvPreset.cs index 9685794..acae6ab 100644 --- a/ColorControl/NvPreset.cs +++ b/ColorControl/NvPreset.cs @@ -1,13 +1,18 @@ -using NvAPIWrapper.Display; +using nspector.Common; +using nspector.Common.Meta; +using NvAPIWrapper.Display; using NvAPIWrapper.Native.Display; using System; using System.Collections.Generic; +using System.Linq; using System.Text; namespace ColorControl { class NvPreset : PresetBase { + public static NvService NvService { get; set; } + public bool applyColorData { get; set; } public ColorData colorData { get; set; } public bool applyHDR { get; set; } @@ -17,10 +22,15 @@ namespace ColorControl public bool ditheringEnabled { get; set; } public bool applyRefreshRate { get; set; } public uint refreshRate { get; set; } + public bool applyResolution { get; set; } + public uint resolutionWidth { get; set; } + public uint resolutionHeight { get; set; } public bool primaryDisplay { get; set; } public string displayName { get; set; } public uint ditheringBits { get; set; } public uint ditheringMode { get; set; } + public bool applyDriverSettings { get; set; } + public Dictionary driverSettings { get; set; } public NvPreset() : base() { @@ -32,9 +42,14 @@ namespace ColorControl toggleHDR = false; applyRefreshRate = false; refreshRate = 60; + applyResolution = false; + resolutionWidth = 0; + resolutionHeight = 0; primaryDisplay = true; ditheringBits = 1; ditheringMode = 4; + applyDriverSettings = false; + driverSettings = new Dictionary(); } public NvPreset(ColorData colorData) : this() @@ -61,6 +76,11 @@ namespace ColorControl ditheringEnabled = preset.ditheringEnabled; applyRefreshRate = preset.applyRefreshRate; refreshRate = preset.refreshRate; + applyResolution = preset.applyResolution; + resolutionWidth = preset.resolutionWidth; + resolutionHeight = preset.resolutionHeight; + applyDriverSettings = preset.applyDriverSettings; + driverSettings = new Dictionary(preset.driverSettings); } public NvPreset Clone() @@ -73,7 +93,7 @@ namespace ColorControl public static string[] GetColumnNames() { //return new[] { "BPC", "Format", "Dynamic range", "Toggle HDR", "Shortcut" }; - return new[] { "Name", "Display|140", "Color settings (BPC, format, dyn. range, color space)|260", "Refresh rate|100", "Dithering", "HDR", "Shortcut", "Apply on startup" }; + return new[] { "Name", "Display|140", "Color settings (BPC, format, dyn. range, color space)|260", "Refresh rate|100", "Resolution|120", "Dithering", "HDR", "Driver settings|300", "Shortcut", "Apply on startup" }; } public override List GetDisplayValues(Config config = null) @@ -90,15 +110,22 @@ namespace ColorControl values.Add(colorSettings); values.Add(string.Format("{0}: {1}Hz", applyRefreshRate ? "Included" : "Excluded", refreshRate)); + if (applyResolution || resolutionWidth > 0) + { + values.Add(string.Format("{0}: {1}x{2}", applyResolution ? "Included" : "Excluded", resolutionWidth, resolutionHeight)); + } + else + { + values.Add(string.Format("Excluded")); + } + var dithering = GetDitheringDescription(); values.Add(string.Format("{0}: {1}", applyDithering ? "Included" : "Excluded", dithering)); values.Add(string.Format("{0}: {1}", applyHDR ? "Included" : "Excluded", toggleHDR ? "Toggle" : HDREnabled ? "Enabled" : "Disabled")); - //values.Add(colorData.ColorDepth.ToString()); - //values.Add(colorData.ColorFormat.ToString()); - //values.Add(colorData.DynamicRange.ToString()); - //values.Add(toggleHDR.ToString()); + values.Add(string.Format("{0}: {1}", applyDriverSettings ? "Included" : "Excluded", GetDriverSettingsDescription())); + values.Add(shortcut); values.Add(string.Format("{0}", config?.NvPresetId_ApplyOnStartup == id ? "Yes" : string.Empty)); @@ -106,6 +133,27 @@ namespace ColorControl return values; } + public string GetDriverSettingsDescription() + { + if (driverSettings.Count == 0) + { + return "None"; + } + + var values = new List(); + + foreach (var driverSetting in driverSettings) + { + var settingMeta = NvService.GetSettingMeta(driverSetting.Key); + + var settingValue = settingMeta.DwordValues.FirstOrDefault(s => s.Value == driverSetting.Value); + + values.Add($"{settingMeta.SettingName}: {settingValue?.ValueName ?? "Unknown"}"); + } + + return string.Join(", ", values); + } + public string GetDitheringDescription(string disabledText = "Disabled") { var dithering = ditheringEnabled ? string.Empty : disabledText; @@ -166,6 +214,11 @@ namespace ColorControl sb.AppendFormat("{0}Hz", refreshRate); sb.Append(" / "); } + if (applyResolution) + { + sb.AppendFormat("{0}x{1}", resolutionWidth, resolutionHeight); + sb.Append(" / "); + } if (applyDithering) { var dithering = GetDitheringDescription("No"); @@ -177,6 +230,11 @@ namespace ColorControl sb.AppendFormat("HDR: {0}", toggleHDR ? "Toggle" : HDREnabled ? "Enabled" : "Disabled"); sb.Append(" / "); } + if (applyDriverSettings) + { + sb.AppendFormat("DRS: {0}", GetDriverSettingsDescription()); + sb.Append(" / "); + } } return sb.ToString(0, Math.Max(0, sb.Length - 3)); @@ -218,6 +276,15 @@ namespace ColorControl return new ColorData(format, dynamicRange: dynamicRange, colorimetry: colorimetry, colorDepth: colorDepth, colorSelectionPolicy: selectionPolicy, desktopColorDepth: ColorDataDesktopDepth.Default); } + internal void UpdateDriverSetting(SettingItem settingItem, uint settingValue) + { + driverSettings[settingItem.SettingId] = settingValue; + } + + internal void ResetDriverSetting(uint settingId) + { + driverSettings.Remove(settingId); + } } } diff --git a/ColorControl/NvService.cs b/ColorControl/NvService.cs index 9073657..c35a238 100644 --- a/ColorControl/NvService.cs +++ b/ColorControl/NvService.cs @@ -1,8 +1,11 @@ using Newtonsoft.Json; +using nspector.Common; +using nspector.Common.Meta; using NvAPIWrapper; using NvAPIWrapper.Display; using NvAPIWrapper.Native.Display; using NvAPIWrapper.Native.GPU.Structures; +using NWin32.NativeTypes; using System; using System.Collections.Generic; using System.ComponentModel; @@ -79,9 +82,24 @@ namespace ColorControl }; private Display _currentDisplay; + private string _baseProfileName = ""; + + private DrsSettingsService _drs; + private DrsSettingsMetaService _meta; + private List _settings = new List(); + + public const uint DRS_GSYNC_APPLICATION_MODE = 294973784; + public const uint DRS_VSYNC_CONTROL = 11041231; + //public const uint DRS_ULTRA_LOW_LATENCY = 0x10835000; + public const uint DRS_PRERENDERED_FRAMES = 8102046; + public const uint DRS_FRAME_RATE_LIMITER_V3 = 277041154; + + private static readonly List _driverSettingIds = new() { DRS_GSYNC_APPLICATION_MODE, DRS_VSYNC_CONTROL, DRS_PRERENDERED_FRAMES, DRS_FRAME_RATE_LIMITER_V3 }; public NvService(string dataPath) : base(dataPath, "NvPresets.json") { + NvPreset.NvService = this; + AddJsonConverter(new ColorDataConverter()); LoadPresets(); @@ -232,15 +250,24 @@ namespace ColorControl // applyHdr = false; //} - if (preset.applyRefreshRate) + if (preset.applyRefreshRate || preset.applyResolution) { var timing = display.DisplayDevice.CurrentTiming; - if (preset.refreshRate < timing.Extra.RefreshRate) + if ((preset.applyRefreshRate && preset.refreshRate < timing.Extra.RefreshRate) || (preset.applyResolution && preset.resolutionWidth < timing.HorizontalVisible)) { - SetRefreshRate(preset.refreshRate, true); + SetMode(preset.applyResolution ? preset.resolutionWidth : 0, preset.applyResolution ? preset.resolutionHeight : 0, preset.applyRefreshRate ? preset.refreshRate : 0, true); } } + //if (preset.applyRefreshRate) + //{ + // var timing = display.DisplayDevice.CurrentTiming; + // if (preset.refreshRate < timing.Extra.RefreshRate) + // { + // SetRefreshRate(preset.refreshRate, true); + // } + //} + try { display.DisplayDevice.SetColorData(preset.colorData); @@ -266,14 +293,19 @@ namespace ColorControl SetHDRState(display, newHdrEnabled, colorData, appContext.StartUpParams.NoGui); } - if (preset.applyRefreshRate) + if (preset.applyRefreshRate || preset.applyResolution) { - var timing = display.DisplayDevice.CurrentTiming; - - if (preset.refreshRate != timing.Extra.RefreshRate && !SetRefreshRate(preset.refreshRate, true)) + if (!SetMode(preset.applyResolution ? preset.resolutionWidth : 0, preset.applyResolution ? preset.resolutionHeight : 0, preset.applyRefreshRate ? preset.refreshRate : 0, true)) { result = false; } + + //var timing = display.DisplayDevice.CurrentTiming; + + //if (preset.refreshRate != timing.Extra.RefreshRate && !SetRefreshRate(preset.refreshRate, true)) + //{ + // result = false; + //} } if (preset.applyDithering) @@ -284,6 +316,11 @@ namespace ColorControl } } + if (preset.applyDriverSettings) + { + SetDriverSettings(preset); + } + _lastAppliedPreset = preset; PresetApplied(); @@ -291,6 +328,27 @@ namespace ColorControl return result; } + private void SetDriverSettings(NvPreset preset) + { + var settings = new List>(); + + foreach (var keyValue in preset.driverSettings) + { + var settingMeta = _meta.GetSettingMeta(keyValue.Key); + + var value = settingMeta.DwordValues.FirstOrDefault(v => v.Value == keyValue.Value); + + if (value == null) + { + continue; + } + + settings.Add(new KeyValuePair(keyValue.Key, value.ValueName)); + } + + _drs.StoreSettingsToProfile(_baseProfileName, settings); + } + private ColorData GetCurrentColorData(Display display) { try @@ -431,7 +489,7 @@ namespace ColorControl return dither; } - public bool SetRefreshRate(uint refreshRate, bool updateRegistry = false) + public bool SetMode(uint resolutionWidth = 0, uint resolutionHeight = 0, uint refreshRate = 0, bool updateRegistry = false) { var display = GetCurrentDisplay(); if (display == null) @@ -440,15 +498,27 @@ namespace ColorControl } var timing = display.DisplayDevice.CurrentTiming; + var desktopRect = display.DisplayDevice.ScanOutInformation.SourceDesktopRectangle; - if (timing.Extra.RefreshRate == refreshRate) + if (refreshRate == 0) + { + refreshRate = (uint)timing.Extra.RefreshRate; + } + + if (resolutionWidth == 0) + { + resolutionWidth = (uint)desktopRect.Width; + resolutionHeight = (uint)desktopRect.Height; + } + + if (timing.Extra.RefreshRate == refreshRate && desktopRect.Width == resolutionWidth && desktopRect.Height == resolutionHeight) { return true; } var portrait = new[] { Rotate.Degree90, Rotate.Degree270 }.Contains(display.DisplayDevice.ScanOutInformation.SourceToTargetRotation); - return SetRefreshRateInternal(display.Name, refreshRate, portrait, timing.HorizontalVisible, timing.VerticalVisible, updateRegistry); + return SetRefreshRateInternal(display.Name, (int)refreshRate, portrait, (int)resolutionWidth, (int)resolutionHeight, updateRegistry); } public List GetAvailableRefreshRates(NvPreset preset = null) @@ -464,10 +534,29 @@ namespace ColorControl return new List(); } + var portrait = new[] { Rotate.Degree90, Rotate.Degree270 }.Contains(display.DisplayDevice.ScanOutInformation.SourceToTargetRotation); + var desktopRect = display.DisplayDevice.ScanOutInformation.SourceDesktopRectangle; + + return GetAvailableRefreshRatesInternal(display.Name, portrait, desktopRect.Width, desktopRect.Height); + } + + public List GetAvailableResolutions(NvPreset preset = null) + { + if (preset != null) + { + SetCurrentDisplay(preset); + } + + var display = GetCurrentDisplay(); + if (display == null) + { + return new List(); + } + var portrait = new[] { Rotate.Degree90, Rotate.Degree270 }.Contains(display.DisplayDevice.ScanOutInformation.SourceToTargetRotation); var timing = display.DisplayDevice.CurrentTiming; - return GetAvailableRefreshRatesInternal(display.Name, portrait, timing.HorizontalVisible, timing.VerticalVisible); + return GetAvailableResolutionsInternal(display.Name, portrait, (uint)(timing.Extra.RefreshRate)); } public bool IsHDREnabled() @@ -495,6 +584,8 @@ namespace ColorControl var displays = GetDisplays(); var list = new List(); + RefreshProfileSettings(); + foreach (var display in displays) { var values = new List(); @@ -521,6 +612,10 @@ namespace ColorControl values.Add($"{refreshRate}Hz"); + var desktopRect = display.DisplayDevice.ScanOutInformation.SourceDesktopRectangle; + + values.Add($"{desktopRect.Width}x{desktopRect.Height}"); + var ditherInfo = GetDithering(); string dithering; @@ -545,6 +640,20 @@ namespace ColorControl var hdrEnabled = IsHDREnabled(); values.Add(hdrEnabled ? "Yes" : "No"); + var settings = GetVisibleSettings(); + var drsValues = new List(); + + foreach (var setting in settings) + { + var settingMeta = GetSettingMeta(setting.SettingId); + + var settingValue = settingMeta.DwordValues.FirstOrDefault(s => s.ValueName == setting.ValueText); + + drsValues.Add($"{settingMeta.SettingName}: {settingValue?.ValueName ?? "Unknown"}"); + } + + values.Add(string.Join(", ", drsValues)); + var infoLine = string.Format("{0}: {1}, {2}Hz, HDR: {3}", name, colorSettings, refreshRate, hdrEnabled ? "Yes" : "No"); var displayInfo = new NvDisplayInfo(display, values, infoLine); @@ -561,10 +670,36 @@ namespace ColorControl } } + public List GetVisibleSettings() + { + return _settings.Where(s => _driverSettingIds.Contains(s.SettingId)).ToList(); + } + + public SettingMeta GetSettingMeta(uint settingId) + { + return _meta.GetSettingMeta(settingId); + } + protected override void Initialize() { NVIDIA.Initialize(); _initialized = true; + + _drs = DrsServiceLocator.SettingService; + _meta = DrsServiceLocator.MetaService; + + _drs.GetProfileNames(ref _baseProfileName, false); + + RefreshProfileSettings(); + } + + private void RefreshProfileSettings() + { + var applications = new Dictionary(); + var normalSettings = _drs.GetSettingsForProfile(_baseProfileName, SettingViewMode.Normal, ref applications); + + _settings = new List(); + _settings.AddRange(normalSettings); } protected override void Uninitialize() diff --git a/ColorControl/Utils.cs b/ColorControl/Utils.cs index 02c0fe9..2c200aa 100644 --- a/ColorControl/Utils.cs +++ b/ColorControl/Utils.cs @@ -370,7 +370,7 @@ namespace ColorControl foreach (var dev in list) { string name = dev.Name; - if (/*dev.IsEnabled &&*/ dev.Name.Contains(deviceName)) + if (/*dev.IsEnabled &&*/ dev.Name.Contains(deviceName, StringComparison.OrdinalIgnoreCase)) { var guid = dev.Properties["System.Devices.DeviceInstanceId"]; diff --git a/ColorControl/WOL.cs b/ColorControl/WOL.cs index 4a00e7e..9810e06 100644 --- a/ColorControl/WOL.cs +++ b/ColorControl/WOL.cs @@ -22,6 +22,7 @@ namespace ColorControl public static bool WakeFunctionToAllNics(string macAddress) { var result = false; + Logger.Debug($"Sending WOL packet to MAC-address {macAddress}"); try { diff --git a/ColorControl/lgtv/LgTvApi.cs b/ColorControl/lgtv/LgTvApi.cs index bdb9d15..f1e4f85 100644 --- a/ColorControl/lgtv/LgTvApi.cs +++ b/ColorControl/lgtv/LgTvApi.cs @@ -132,6 +132,16 @@ namespace LgTv high2 } + public enum BlackLevel + { + low, + medium, + high, + limited, + full, + auto + } + public enum HdmiIcon { [Description("HDMI")] @@ -627,7 +637,7 @@ namespace LgTv await ExecuteRequest(lunauri, @params); } - private static string ParamToJson(object value, ref string key) + private static string ParamToJson(object value, ref string key, bool skipSeparator = false) { string jsonValue; var valueType = value.GetType(); @@ -637,7 +647,7 @@ namespace LgTv var values = ((Array)value).Cast(); jsonValue = "[" + string.Join(", ", values.Select(x => x.ToString()).ToArray()) + ']'; } - else if (key?.Contains("_") == true) + else if (key?.Contains("_") == true && !skipSeparator) { var keys = key.Split('_'); key = keys[0]; @@ -649,6 +659,21 @@ namespace LgTv { jsonValue = value.ToString().ToLowerInvariant(); } + else if (key.Equals("blackLevel", StringComparison.Ordinal)) + { + jsonValue = @"{ + ""ntsc"": ""auto"", + ""ntsc443"": ""auto"", + ""pal"": ""auto"", + ""pal60"": ""auto"", + ""palm"": ""auto"", + ""paln"": ""auto"", + ""secam"": ""auto"", + ""unknown"": ""auto"" + }"; + + jsonValue = jsonValue.Replace("auto", value.ToString()); + } else { jsonValue = $"\"{value}\""; @@ -668,6 +693,18 @@ namespace LgTv await ExecuteRequest(lunauri, @params); } + public async Task SetSystemProperty(string key, object value) + { + var lunauri = "luna://com.webos.service.tv.systemproperty/setProperties"; + + var jsonValue = ParamToJson(value, ref key, true); + + //var @params = JObject.Parse(@"{ ""keys"": { """ + key + @""": " + jsonValue + @" } }"); + var @params = JObject.Parse(@"{ """ + key + @""": " + jsonValue + @" }"); + + await ExecuteRequest(lunauri, @params); + } + public async Task SetDeviceConfig(string id, string icon, string label) { var lunauri = "luna://com.webos.service.eim/setDeviceInfo"; diff --git a/ColorControl/nspector/Common/Cache/CachedSettingValue.cs b/ColorControl/nspector/Common/Cache/CachedSettingValue.cs new file mode 100644 index 0000000..e567fee --- /dev/null +++ b/ColorControl/nspector/Common/Cache/CachedSettingValue.cs @@ -0,0 +1,38 @@ +using System; +using System.Text; + +namespace nspector.Common +{ + internal class CachedSettingValue + { + + internal CachedSettingValue() { } + + internal CachedSettingValue(uint Value, string ProfileNames) + { + this.Value = Value; + this.ProfileNames = new StringBuilder(ProfileNames); + this.ValueProfileCount = 1; + } + + internal CachedSettingValue(string ValueStr, string ProfileNames) + { + this.ValueStr = ValueStr; + this.ProfileNames = new StringBuilder(ProfileNames); + this.ValueProfileCount = 1; + } + + internal CachedSettingValue(byte[] ValueBin, string ProfileNames) + { + this.ValueBin = ValueBin; + this.ProfileNames = new StringBuilder(ProfileNames); + this.ValueProfileCount = 1; + } + + internal string ValueStr = ""; + internal uint Value = 0; + internal byte[] ValueBin = new byte[0]; + internal StringBuilder ProfileNames; + internal uint ValueProfileCount; + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/Cache/CachedSettings.cs b/ColorControl/nspector/Common/Cache/CachedSettings.cs new file mode 100644 index 0000000..bb86863 --- /dev/null +++ b/ColorControl/nspector/Common/Cache/CachedSettings.cs @@ -0,0 +1,72 @@ +using nspector.Native.NVAPI2; +using System.Collections.Generic; +using System.Linq; + +namespace nspector.Common +{ + internal class CachedSettings + { + internal CachedSettings() { } + + internal CachedSettings(uint settingId, NVDRS_SETTING_TYPE settingType) + { + SettingId = settingId; + SettingType = settingType; + } + + internal uint SettingId; + + internal List SettingValues = new List(); + + internal uint ProfileCount = 0; + + internal NVDRS_SETTING_TYPE SettingType = NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE; + + internal void AddDwordValue(uint valueDword, string Profile) + { + var setting = SettingValues.FirstOrDefault(s => s.Value == valueDword); + if (setting == null) + { + SettingValues.Add(new CachedSettingValue(valueDword, Profile)); + } + else + { + setting.ProfileNames.Append(", " + Profile); + setting.ValueProfileCount++; + } + ProfileCount++; + } + + internal void AddStringValue(string valueStr, string Profile) + { + + var setting = SettingValues.FirstOrDefault(s => s.ValueStr == valueStr); + if (setting == null) + { + SettingValues.Add(new CachedSettingValue(valueStr, Profile)); + } + else + { + setting.ProfileNames.Append(", " + Profile); + setting.ValueProfileCount++; + } + ProfileCount++; + } + + internal void AddBinaryValue(byte[] valueBin, string Profile) + { + + var setting = SettingValues.FirstOrDefault(s => s.ValueBin.SequenceEqual(valueBin)); + if (setting == null) + { + SettingValues.Add(new CachedSettingValue(valueBin, Profile)); + } + else + { + setting.ProfileNames.Append(", " + Profile); + setting.ValueProfileCount++; + } + ProfileCount++; + } + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/CustomSettings/CustomSetting.cs b/ColorControl/nspector/Common/CustomSettings/CustomSetting.cs new file mode 100644 index 0000000..4853303 --- /dev/null +++ b/ColorControl/nspector/Common/CustomSettings/CustomSetting.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; + +namespace nspector.Common.CustomSettings +{ + [Serializable] + public class CustomSetting + { + + public string UserfriendlyName { get; set; } + [XmlElement(ElementName = "HexSettingID")] + public string HexSettingId { get; set; } + public string Description { get; set; } + public string GroupName { get; set; } + public string OverrideDefault { get; set; } + public float MinRequiredDriverVersion { get; set; } + + public List SettingValues { get; set; } + + internal uint SettingId + { + get { return Convert.ToUInt32(HexSettingId.Trim(), 16); } + } + + internal uint? DefaultValue + { + get { return string.IsNullOrEmpty(OverrideDefault) ? null : (uint?)Convert.ToUInt32(OverrideDefault.Trim(), 16); } + } + + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/CustomSettings/CustomSettingNames.cs b/ColorControl/nspector/Common/CustomSettings/CustomSettingNames.cs new file mode 100644 index 0000000..d954c36 --- /dev/null +++ b/ColorControl/nspector/Common/CustomSettings/CustomSettingNames.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; +using nspector.Common.Helper; + +namespace nspector.Common.CustomSettings +{ + [Serializable] + public class CustomSettingNames + { + public List Settings = new List(); + + public void StoreToFile(string filename) + { + XMLHelper.SerializeToXmlFile(this, filename, Encoding.Unicode, true); + } + + public static CustomSettingNames FactoryLoadFromFile(string filename) + { + return XMLHelper.DeserializeFromXMLFile(filename); + } + + public static CustomSettingNames FactoryLoadFromString(string xml) + { + return XMLHelper.DeserializeFromXmlString(xml); + } + } +} diff --git a/ColorControl/nspector/Common/CustomSettings/CustomSettingValue.cs b/ColorControl/nspector/Common/CustomSettings/CustomSettingValue.cs new file mode 100644 index 0000000..6a39b2b --- /dev/null +++ b/ColorControl/nspector/Common/CustomSettings/CustomSettingValue.cs @@ -0,0 +1,18 @@ +using System; + +namespace nspector.Common.CustomSettings +{ + [Serializable] + public class CustomSettingValue + { + internal uint SettingValue + { + get { return Convert.ToUInt32(HexValue.Trim(), 16); } + } + + public string UserfriendlyName { get; set; } + + public string HexValue { get; set; } + + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/DrsDecrypterService.cs b/ColorControl/nspector/Common/DrsDecrypterService.cs new file mode 100644 index 0000000..9de27ad --- /dev/null +++ b/ColorControl/nspector/Common/DrsDecrypterService.cs @@ -0,0 +1,146 @@ +using nspector.Common.Helper; +using nspector.Native.NVAPI2; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; + +namespace nspector.Common +{ + internal class DrsDecrypterService : DrsSettingsServiceBase + { + + private static readonly byte[] _InternalSettingsKey = new byte[] { + 0x2f, 0x7c, 0x4f, 0x8b, 0x20, 0x24, 0x52, 0x8d, 0x26, 0x3c, 0x94, 0x77, 0xf3, 0x7c, 0x98, 0xa5, + 0xfa, 0x71, 0xb6, 0x80, 0xdd, 0x35, 0x84, 0xba, 0xfd, 0xb6, 0xa6, 0x1b, 0x39, 0xc4, 0xcc, 0xb0, + 0x7e, 0x95, 0xd9, 0xee, 0x18, 0x4b, 0x9c, 0xf5, 0x2d, 0x4e, 0xd0, 0xc1, 0x55, 0x17, 0xdf, 0x18, + 0x1e, 0x0b, 0x18, 0x8b, 0x88, 0x58, 0x86, 0x5a, 0x1e, 0x03, 0xed, 0x56, 0xfb, 0x16, 0xfe, 0x8a, + 0x01, 0x32, 0x9c, 0x8d, 0xf2, 0xe8, 0x4a, 0xe6, 0x90, 0x8e, 0x15, 0x68, 0xe8, 0x2d, 0xf4, 0x40, + 0x37, 0x9a, 0x72, 0xc7, 0x02, 0x0c, 0xd1, 0xd3, 0x58, 0xea, 0x62, 0xd1, 0x98, 0x36, 0x2b, 0xb2, + 0x16, 0xd5, 0xde, 0x93, 0xf1, 0xba, 0x74, 0xe3, 0x32, 0xc4, 0x9f, 0xf6, 0x12, 0xfe, 0x18, 0xc0, + 0xbb, 0x35, 0x79, 0x9c, 0x6b, 0x7a, 0x23, 0x7f, 0x2b, 0x15, 0x9b, 0x42, 0x07, 0x1a, 0xff, 0x69, + 0xfb, 0x9c, 0xbd, 0x23, 0x97, 0xa8, 0x22, 0x63, 0x8f, 0x32, 0xc8, 0xe9, 0x9b, 0x63, 0x1c, 0xee, + 0x2c, 0xd9, 0xed, 0x8d, 0x3a, 0x35, 0x9c, 0xb1, 0x60, 0xae, 0x5e, 0xf5, 0x97, 0x6b, 0x9f, 0x20, + 0x8c, 0xf7, 0x98, 0x2c, 0x43, 0x79, 0x95, 0x1d, 0xcd, 0x46, 0x36, 0x6c, 0xd9, 0x67, 0x20, 0xab, + 0x41, 0x22, 0x21, 0xe5, 0x55, 0x82, 0xf5, 0x27, 0x20, 0xf5, 0x08, 0x07, 0x3f, 0x6d, 0x69, 0xd9, + 0x1c, 0x4b, 0xf8, 0x26, 0x03, 0x6e, 0xb2, 0x3f, 0x1e, 0xe6, 0xca, 0x3d, 0x61, 0x44, 0xb0, 0x92, + 0xaf, 0xf0, 0x88, 0xca, 0xe0, 0x5f, 0x5d, 0xf4, 0xdf, 0xc6, 0x4c, 0xa4, 0xe0, 0xca, 0xb0, 0x20, + 0x5d, 0xc0, 0xfa, 0xdd, 0x9a, 0x34, 0x8f, 0x50, 0x79, 0x5a, 0x5f, 0x7c, 0x19, 0x9e, 0x40, 0x70, + 0x71, 0xb5, 0x45, 0x19, 0xb8, 0x53, 0xfc, 0xdf, 0x24, 0xbe, 0x22, 0x1c, 0x79, 0xbf, 0x42, 0x89 }; + + public DrsDecrypterService(DrsSettingsMetaService metaService) : base(metaService) + { + try + { + CreateInternalSettingMap(); + } + catch { } + } + + private uint GetDwordFromKey(uint offset) + { + var bytes = new byte[4]; + bytes[0] = _InternalSettingsKey[(offset + 0) % 256]; + bytes[1] = _InternalSettingsKey[(offset + 1) % 256]; + bytes[2] = _InternalSettingsKey[(offset + 2) % 256]; + bytes[3] = _InternalSettingsKey[(offset + 3) % 256]; + return BitConverter.ToUInt32(bytes, 0); + } + + public uint DecryptDwordValue(uint orgValue, uint settingId) + { + var keyOffset = (settingId << 1); + var key = GetDwordFromKey(keyOffset); + return orgValue ^ key; + } + + public string DecryptStringValue(byte[] rawData, uint settingId) + { + var keyOffset = (settingId << 1); + for (uint i = 0; i < (uint)rawData.Length; i++) + { + rawData[i] ^= _InternalSettingsKey[(keyOffset + i) % 256]; + } + return Encoding.Unicode.GetString(rawData).Trim('\0'); + } + + public void DecryptSettingIfNeeded(string profileName, ref NVDRS_SETTING setting) + { + if (setting.isPredefinedValid == 1) + { + if (IsInternalSetting(profileName, setting.settingId)) + { + if (setting.settingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE) + { + setting.predefinedValue.stringValue = DecryptStringValue(setting.predefinedValue.rawData, setting.settingId); + if (setting.isCurrentPredefined == 1) + setting.currentValue.stringValue = DecryptStringValue(setting.currentValue.rawData, setting.settingId); + } + else if (setting.settingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE) + { + setting.predefinedValue.dwordValue = DecryptDwordValue(setting.predefinedValue.dwordValue, setting.settingId); + if (setting.isCurrentPredefined == 1) + setting.currentValue.dwordValue = DecryptDwordValue(setting.currentValue.dwordValue, setting.settingId); + } + } + } + } + + private string FormatInternalSettingKey(string profileName, uint settingId) + { + return profileName + settingId.ToString("X8").ToLower(); + } + + public bool IsInternalSetting(string profileName, uint settingId) + { + return _InternalSettings.Contains(FormatInternalSettingKey(profileName, settingId)); + } + + private HashSet _InternalSettings = new HashSet(); + + private void CreateInternalSettingMap() + { + string tmpfile = TempFile.GetTempFileName(); + + try + { + DrsSession((hSession) => + { + SaveSettingsFileEx(hSession, tmpfile); + }); + + if (File.Exists(tmpfile)) + { + var lines = File.ReadAllLines(tmpfile); + + _InternalSettings = new HashSet(); + + var paProfile = "Profile\\s\\\"(?.*?)\\\""; + var rxProfile = new Regex(paProfile, RegexOptions.Compiled); + + var paSetting = "ID_0x(?[0-9a-fA-F]+)\\s\\=.*?InternalSettingFlag\\=V0"; + var rxSetting = new Regex(paSetting, RegexOptions.Compiled); + + var currentProfileName = ""; + for (int i = 0; i < lines.Length; i++) + { + foreach (Match ms in rxProfile.Matches(lines[i])) + { + currentProfileName = ms.Result("${profileName}"); + } + foreach (Match ms in rxSetting.Matches(lines[i])) + { + _InternalSettings.Add(currentProfileName + ms.Result("${sid}")); + } + } + } + } + finally + { + if (File.Exists(tmpfile)) + File.Delete(tmpfile); + } + } + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/DrsImportService.cs b/ColorControl/nspector/Common/DrsImportService.cs new file mode 100644 index 0000000..6aeac71 --- /dev/null +++ b/ColorControl/nspector/Common/DrsImportService.cs @@ -0,0 +1,277 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using nspector.Common.Import; +using nspector.Native.NVAPI2; +using nvw = nspector.Native.NVAPI2.NvapiDrsWrapper; +using nspector.Common.Helper; + +namespace nspector.Common +{ + internal class DrsImportService : DrsSettingsServiceBase + { + + private readonly DrsSettingsService _SettingService; + private readonly DrsScannerService _ScannerService; + private readonly DrsDecrypterService _DecrypterService; + + public DrsImportService( + DrsSettingsMetaService metaService, + DrsSettingsService settingService, + DrsScannerService scannerService, + DrsDecrypterService decrypterService) + : base(metaService) + { + _SettingService = settingService; + _ScannerService = scannerService; + _DecrypterService = decrypterService; + } + + internal void ExportAllProfilesToNvidiaTextFile(string filename) + { + DrsSession((hSession) => + { + SaveSettingsFileEx(hSession, filename); + }); + } + + internal void ImportAllProfilesFromNvidiaTextFile(string filename) + { + DrsSession((hSession) => + { + LoadSettingsFileEx(hSession, filename); + SaveSettings(hSession); + }, forceNonGlobalSession: true, preventLoadSettings: true); + } + + internal void ExportProfiles(List profileNames, string filename, bool includePredefined) + { + var exports = new Profiles(); + + DrsSession((hSession) => + { + foreach (var profileName in profileNames) + { + var profile = CreateProfileForExport(hSession, profileName, includePredefined); + exports.Add(profile); + } + }); + + XMLHelper.SerializeToXmlFile(exports, filename, Encoding.Unicode, true); + } + + private Profile CreateProfileForExport(IntPtr hSession, string profileName, bool includePredefined) + { + var result = new Profile(); + + var hProfile = GetProfileHandle(hSession, profileName); + if (hProfile != IntPtr.Zero) + { + + result.ProfileName = profileName; + + var apps = GetProfileApplications(hSession, hProfile); + foreach (var app in apps) + { + result.Executeables.Add(app.appName); + } + + var settings = GetProfileSettings(hSession, hProfile); + foreach (var setting in settings) + { + var isPredefined = setting.isCurrentPredefined == 1; + var isCurrentProfile = setting.settingLocation == + NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION; + + if (isCurrentProfile && (!isPredefined || includePredefined)) + { + var exportSetting = setting; + _DecrypterService.DecryptSettingIfNeeded(profileName, ref exportSetting); + + var profileSetting = ImportExportUitl + .ConvertDrsSettingToProfileSetting(exportSetting); + + result.Settings.Add(profileSetting); + } + } + + } + + return result; + } + + internal string ImportProfiles(string filename) + { + var sbFailedProfilesMessage = new StringBuilder(); + var appInUseHint = false; + var profiles = XMLHelper.DeserializeFromXMLFile(filename); + + DrsSession((hSession) => + { + foreach (Profile profile in profiles) + { + var profileCreated = false; + var hProfile = GetProfileHandle(hSession, profile.ProfileName); + if (hProfile == IntPtr.Zero) + { + hProfile = CreateProfile(hSession, profile.ProfileName); + nvw.DRS_SaveSettings(hSession); + profileCreated = true; + } + + if (hProfile != IntPtr.Zero) + { + var modified = false; + _SettingService.ResetProfile(profile.ProfileName, out modified); + try + { + UpdateApplications(hSession, hProfile, profile); + UpdateSettings(hSession, hProfile, profile, profile.ProfileName); + } + catch (NvapiException nex) + { + if (profileCreated) + { + nvw.DRS_DeleteProfile(hSession, hProfile); + } + + sbFailedProfilesMessage.AppendLine(string.Format("Failed to import profile '{0}'", profile.ProfileName)); + var appEx = nex as NvapiAddApplicationException; + if (appEx != null) + { + var profilesWithThisApp = _ScannerService.FindProfilesUsingApplication(appEx.ApplicationName); + sbFailedProfilesMessage.AppendLine(string.Format("- application '{0}' is already in use by profile '{1}'", appEx.ApplicationName, profilesWithThisApp)); + appInUseHint = true; + } + else + { + sbFailedProfilesMessage.AppendLine(string.Format("- {0}", nex.Message)); + } + sbFailedProfilesMessage.AppendLine(""); + } + nvw.DRS_SaveSettings(hSession); + } + } + }); + + if (appInUseHint) + { + sbFailedProfilesMessage.AppendLine("Hint: If just the profile name has been changed by nvidia, consider to manually modify the profile name inside the import file using a text editor."); + } + + return sbFailedProfilesMessage.ToString(); + } + + private bool ExistsImportApp(string appName, Profile importProfile) + { + return importProfile.Executeables.Any(x => x.Equals(appName)); + } + + private void UpdateApplications(IntPtr hSession, IntPtr hProfile, Profile importProfile) + { + var alreadySet = new HashSet(); + + var apps = GetProfileApplications(hSession, hProfile); + foreach (var app in apps) + { + if (ExistsImportApp(app.appName, importProfile) && !alreadySet.Contains(app.appName)) + alreadySet.Add(app.appName); + else + nvw.DRS_DeleteApplication(hSession, hProfile, new StringBuilder(app.appName)); + } + + foreach (string appName in importProfile.Executeables) + { + if (!alreadySet.Contains(appName)) + { + try + { + AddApplication(hSession, hProfile, appName); + } + catch (NvapiException) + { + throw new NvapiAddApplicationException(appName); + } + } + } + } + + private uint GetImportValue(uint settingId, Profile importProfile) + { + var setting = importProfile.Settings + .FirstOrDefault(x => x.SettingId.Equals(settingId)); + + if (setting != null) + return uint.Parse(setting.SettingValue); + + return 0; + } + + private ProfileSetting GetImportProfileSetting(uint settingId, Profile importProfile) + { + return importProfile.Settings + .FirstOrDefault(x => x.SettingId.Equals(settingId)); + } + + private bool ExistsImportValue(uint settingId, Profile importProfile) + { + return importProfile.Settings + .Any(x => x.SettingId.Equals(settingId)); + } + + private void UpdateSettings(IntPtr hSession, IntPtr hProfile, Profile importProfile, string profileName) + { + var alreadySet = new HashSet(); + + var settings = GetProfileSettings(hSession, hProfile); + foreach (var setting in settings) + { + var isCurrentProfile = setting.settingLocation == NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION; + var isPredefined = setting.isCurrentPredefined == 1; + + if (isCurrentProfile) + { + bool exitsValueInImport = ExistsImportValue(setting.settingId, importProfile); + var importSetting = GetImportProfileSetting(setting.settingId, importProfile); + + var decryptedSetting = setting; + _DecrypterService.DecryptSettingIfNeeded(profileName, ref decryptedSetting); + + if (isPredefined && exitsValueInImport && ImportExportUitl.AreDrsSettingEqualToProfileSetting(decryptedSetting, importSetting)) + { + alreadySet.Add(setting.settingId); + } + else if (exitsValueInImport) + { + var updatedSetting = ImportExportUitl.ConvertProfileSettingToDrsSetting(importSetting); + StoreSetting(hSession, hProfile, updatedSetting); + alreadySet.Add(setting.settingId); + } + else if (!isPredefined) + { + nvw.DRS_DeleteProfileSetting(hSession, hProfile, setting.settingId); + } + } + } + + foreach (var setting in importProfile.Settings) + { + if (!alreadySet.Contains(setting.SettingId)) + { + var newSetting = ImportExportUitl.ConvertProfileSettingToDrsSetting(setting); + try + { + StoreSetting(hSession, hProfile, newSetting); + } + catch (NvapiException ex) + { + if (ex.Status != NvAPI_Status.NVAPI_SETTING_NOT_FOUND) + throw; + } + } + } + } + + } +} diff --git a/ColorControl/nspector/Common/DrsScannerService.cs b/ColorControl/nspector/Common/DrsScannerService.cs new file mode 100644 index 0000000..5233de7 --- /dev/null +++ b/ColorControl/nspector/Common/DrsScannerService.cs @@ -0,0 +1,240 @@ +using nspector.Common.Helper; +using nspector.Native.NVAPI2; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; +using nvw = nspector.Native.NVAPI2.NvapiDrsWrapper; + +namespace nspector.Common +{ + + + internal class DrsScannerService : DrsSettingsServiceBase + { + + public DrsScannerService(DrsSettingsMetaService metaService, DrsDecrypterService decrpterService) + : base(metaService, decrpterService) + { } + + + internal List CachedSettings = new List(); + internal List ModifiedProfiles = new List(); + internal HashSet UserProfiles = new HashSet(); + + // most common setting ids as start pattern for the heuristic scan + private readonly uint[] _commonSettingIds = new uint[] { 0x1095DEF8, 0x1033DCD2, 0x1033CEC1, + 0x10930F46, 0x00A06946, 0x10ECDB82, 0x20EBD7B8, 0x0095DEF9, 0x00D55F7D, + 0x1033DCD3, 0x1033CEC2, 0x2072F036, 0x00664339, 0x002C7F45, 0x209746C1, + 0x0076E164, 0x20FF7493, 0x204CFF7B }; + + + private bool CheckCommonSetting(IntPtr hSession, IntPtr hProfile, NVDRS_PROFILE profile, + ref int checkedSettingsCount, uint checkSettingId, bool addToScanResult, + ref List alreadyCheckedSettingIds) + { + + if (checkedSettingsCount >= profile.numOfSettings) + return false; + + var setting = new NVDRS_SETTING(); + setting.version = nvw.NVDRS_SETTING_VER; + + if (nvw.DRS_GetSetting(hSession, hProfile, checkSettingId, ref setting) != NvAPI_Status.NVAPI_OK) + return false; + + if (setting.settingLocation != NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION) + return false; + + if (!addToScanResult && setting.isCurrentPredefined == 1) + { + checkedSettingsCount++; + } + else if (addToScanResult) + { + if (decrypter != null) + { + decrypter.DecryptSettingIfNeeded(profile.profileName, ref setting); + } + + checkedSettingsCount++; + AddScannedSettingToCache(profile, setting); + alreadyCheckedSettingIds.Add(setting.settingId); + return (setting.isCurrentPredefined != 1); + } + else if (setting.isCurrentPredefined != 1) + { + return true; + } + + return false; + } + + + private int CalcPercent(int current, int max) + { + return (current > 0) ? (int)Math.Round((current * 100f) / max) : 0; ; + } + + public async Task ScanProfileSettingsAsync(bool justModified, IProgress progress, CancellationToken token = default(CancellationToken)) + { + await Task.Run(() => + { + ModifiedProfiles = new List(); + UserProfiles = new HashSet(); + var knownPredefines = new List(_commonSettingIds); + + DrsSession((hSession) => + { + IntPtr hBaseProfile = GetProfileHandle(hSession, ""); + var profileHandles = EnumProfileHandles(hSession); + + var maxProfileCount = profileHandles.Count; + int curProfilePos = 0; + + foreach (IntPtr hProfile in profileHandles) + { + if (token.IsCancellationRequested) break; + + progress?.Report(CalcPercent(curProfilePos++, maxProfileCount)); + + var profile = GetProfileInfo(hSession, hProfile); + + int checkedSettingsCount = 0; + var alreadyChecked = new List(); + + bool foundModifiedProfile = false; + if (profile.isPredefined == 0) + { + ModifiedProfiles.Add(profile.profileName); + UserProfiles.Add(profile.profileName); + foundModifiedProfile = true; + if (justModified) continue; + } + + + foreach (uint kpd in knownPredefines) + { + if (CheckCommonSetting(hSession, hProfile, profile, + ref checkedSettingsCount, kpd, !justModified, ref alreadyChecked)) + { + if (!foundModifiedProfile) + { + foundModifiedProfile = true; + ModifiedProfiles.Add(profile.profileName); + if (justModified) break; + } + } + } + + if ((foundModifiedProfile && justModified) || checkedSettingsCount >= profile.numOfSettings) + continue; + + var settings = GetProfileSettings(hSession, hProfile); + foreach (var setting in settings) + { + if (knownPredefines.IndexOf(setting.settingId) < 0) + knownPredefines.Add(setting.settingId); + + if (!justModified && alreadyChecked.IndexOf(setting.settingId) < 0) + AddScannedSettingToCache(profile, setting); + + if (setting.isCurrentPredefined != 1) + { + if (!foundModifiedProfile) + { + foundModifiedProfile = true; + ModifiedProfiles.Add(profile.profileName); + if (justModified) break; + } + } + } + } + }); + + }); + } + + + private void AddScannedSettingToCache(NVDRS_PROFILE profile, NVDRS_SETTING setting) + { + // Skip 3D Vision string values here for improved scan performance + bool allowAddValue = setting.settingId < 0x70000000 || setting.settingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE; + + //bool allowAddValue = true; + + var cachedSetting = CachedSettings + .FirstOrDefault(x => x.SettingId.Equals(setting.settingId)); + + bool cacheEntryExists = true; + if (cachedSetting == null) + { + cacheEntryExists = false; + cachedSetting = new CachedSettings(setting.settingId, setting.settingType); + } + + if (setting.isPredefinedValid == 1) + { + if (allowAddValue) + { + if (setting.settingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE) + cachedSetting.AddStringValue(setting.predefinedValue.stringValue, profile.profileName); + else if (setting.settingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE) + cachedSetting.AddDwordValue(setting.predefinedValue.dwordValue, profile.profileName); + else if (setting.settingType == NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE) + cachedSetting.AddBinaryValue(setting.predefinedValue.binaryValue, profile.profileName); + } + else + cachedSetting.ProfileCount++; + + if (!cacheEntryExists) + CachedSettings.Add(cachedSetting); + } + + } + + public string FindProfilesUsingApplication(string applicationName) + { + string lowerApplicationName = applicationName.ToLower(); + string tmpfile = TempFile.GetTempFileName(); + + try + { + var matchingProfiles = new List(); + + DrsSession((hSession) => + { + SaveSettingsFileEx(hSession, tmpfile); + }); + + if (File.Exists(tmpfile)) + { + string content = File.ReadAllText(tmpfile); + string pattern = "\\sProfile\\s\\\"(?.*?)\\\"(?.*?Executable.*?)EndProfile"; + foreach (Match m in Regex.Matches(content, pattern, RegexOptions.Singleline)) + { + string scope = m.Result("${scope}"); + foreach (Match ms in Regex.Matches(scope, "Executable\\s\\\"(?.*?)\\\"", RegexOptions.Singleline)) + { + if (ms.Result("${app}").ToLower() == lowerApplicationName) + { + matchingProfiles.Add(m.Result("${profile}")); + } + } + } + } + + return string.Join(";", matchingProfiles); + } + finally + { + if (File.Exists(tmpfile)) + File.Delete(tmpfile); + } + } + + } +} diff --git a/ColorControl/nspector/Common/DrsServiceLocator.cs b/ColorControl/nspector/Common/DrsServiceLocator.cs new file mode 100644 index 0000000..9758f45 --- /dev/null +++ b/ColorControl/nspector/Common/DrsServiceLocator.cs @@ -0,0 +1,50 @@ +using System.IO; +using System.Reflection; +using nspector.Common.CustomSettings; + +namespace nspector.Common +{ + internal class DrsServiceLocator + { + private static readonly CustomSettingNames CustomSettings; + public static readonly CustomSettingNames ReferenceSettings; + public static readonly DrsSettingsMetaService MetaService; + public static readonly DrsSettingsService SettingService; + public static readonly DrsImportService ImportService; + public static readonly DrsScannerService ScannerService; + public static readonly DrsDecrypterService DecrypterService; + + static DrsServiceLocator() + { + CustomSettings = LoadCustomSettings(); + ReferenceSettings = LoadReferenceSettings(); + + MetaService = new DrsSettingsMetaService(CustomSettings, ReferenceSettings); + DecrypterService = new DrsDecrypterService(MetaService); + ScannerService = new DrsScannerService(MetaService, DecrypterService); + SettingService = new DrsSettingsService(MetaService, DecrypterService); + ImportService = new DrsImportService(MetaService, SettingService, ScannerService, DecrypterService); + } + + private static CustomSettingNames LoadCustomSettings() + { + string csnDefaultPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\nspector\\CustomSettingNames.xml"; + + if (File.Exists(csnDefaultPath)) + return CustomSettingNames.FactoryLoadFromFile(csnDefaultPath); + else + return new CustomSettingNames(); //return CustomSettingNames.FactoryLoadFromString(Properties.Resources.CustomSettingNames); + } + + private static CustomSettingNames LoadReferenceSettings() + { + string csnDefaultPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\nspector\\Reference.xml"; + + if (File.Exists(csnDefaultPath)) + return CustomSettingNames.FactoryLoadFromFile(csnDefaultPath); + + return null; + } + + } +} diff --git a/ColorControl/nspector/Common/DrsSessionScope.cs b/ColorControl/nspector/Common/DrsSessionScope.cs new file mode 100644 index 0000000..c228bb1 --- /dev/null +++ b/ColorControl/nspector/Common/DrsSessionScope.cs @@ -0,0 +1,93 @@ +using nspector.Native.NVAPI2; +using System; +using nvw = nspector.Native.NVAPI2.NvapiDrsWrapper; + +namespace nspector.Common +{ + public class DrsSessionScope + { + + public static volatile IntPtr GlobalSession; + + public static volatile bool HoldSession = true; + + private static object _Sync = new object(); + + + public static T DrsSession(Func action, bool forceNonGlobalSession = false, bool preventLoadSettings = false) + { + lock (_Sync) + { + if (!HoldSession || forceNonGlobalSession) + return NonGlobalDrsSession(action, preventLoadSettings); + + + if (GlobalSession == IntPtr.Zero) + { + +#pragma warning disable CS0420 + var csRes = nvw.DRS_CreateSession(ref GlobalSession); +#pragma warning restore CS0420 + + if (csRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_CreateSession", csRes); + + if (!preventLoadSettings) + { + var nvRes = nvw.DRS_LoadSettings(GlobalSession); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_LoadSettings", nvRes); + } + } + } + + if (GlobalSession != IntPtr.Zero) + { + return action(GlobalSession); + } + + throw new Exception(nameof(GlobalSession) + " is Zero!"); + } + + public static void DestroyGlobalSession() + { + lock (_Sync) + { + if (GlobalSession != IntPtr.Zero) + { + var csRes = nvw.DRS_DestroySession(GlobalSession); + GlobalSession = IntPtr.Zero; + } + } + } + + private static T NonGlobalDrsSession(Func action, bool preventLoadSettings = false) + { + IntPtr hSession = IntPtr.Zero; + var csRes = nvw.DRS_CreateSession(ref hSession); + if (csRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_CreateSession", csRes); + + try + { + if (!preventLoadSettings) + { + var nvRes = nvw.DRS_LoadSettings(hSession); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_LoadSettings", nvRes); + } + + return action(hSession); + } + finally + { + var nvRes = nvw.DRS_DestroySession(hSession); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_DestroySession", nvRes); + } + + } + + + } +} diff --git a/ColorControl/nspector/Common/DrsSettingsMetaService.cs b/ColorControl/nspector/Common/DrsSettingsMetaService.cs new file mode 100644 index 0000000..6e444b1 --- /dev/null +++ b/ColorControl/nspector/Common/DrsSettingsMetaService.cs @@ -0,0 +1,417 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using nspector.Common.Meta; +using nspector.Common.CustomSettings; +using nspector.Native.NVAPI2; + +namespace nspector.Common +{ + internal class DrsSettingsMetaService + { + + private ISettingMetaService ConstantMeta; + private ISettingMetaService CustomMeta; + public ISettingMetaService DriverMeta; + private ISettingMetaService ScannedMeta; + private ISettingMetaService ReferenceMeta; + + private readonly CustomSettingNames _customSettings; + private readonly CustomSettingNames _referenceSettings; + + private List MetaServices = new List(); + + private Dictionary settingMetaCache = new Dictionary(); + + public DrsSettingsMetaService(CustomSettingNames customSettings, CustomSettingNames referenceSettings = null) + { + _customSettings = customSettings; + _referenceSettings = referenceSettings; + + ResetMetaCache(true); + } + + public void ResetMetaCache(bool initOnly = false) + { + settingMetaCache = new Dictionary(); + MetaServices = new List(); + + CustomMeta = new CustomSettingMetaService(_customSettings); + MetaServices.Add(new MetaServiceItem() { ValueNamePrio = 1, Service = CustomMeta }); + + if (!initOnly) + { + DriverMeta = new DriverSettingMetaService(); + MetaServices.Add(new MetaServiceItem() { ValueNamePrio = 5, Service = DriverMeta }); + + ConstantMeta = new ConstantSettingMetaService(); + MetaServices.Add(new MetaServiceItem() { ValueNamePrio = 2, Service = ConstantMeta }); + + if (DrsServiceLocator.ScannerService != null) + { + ScannedMeta = new ScannedSettingMetaService(DrsServiceLocator.ScannerService.CachedSettings); + MetaServices.Add(new MetaServiceItem() { ValueNamePrio = 3, Service = ScannedMeta }); + } + + if (_referenceSettings != null) + { + ReferenceMeta = new CustomSettingMetaService(_referenceSettings, SettingMetaSource.ReferenceSettings); + MetaServices.Add(new MetaServiceItem() { ValueNamePrio = 4, Service = ReferenceMeta }); + } + } + + } + + private NVDRS_SETTING_TYPE? GetSettingValueType(uint settingId) + { + foreach (var service in MetaServices.OrderBy(x => x.Service.Source)) + { + var settingValueType = service.Service.GetSettingValueType(settingId); + if (settingValueType != null) + return settingValueType.Value; + } + + return NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE; + } + + private string GetSettingName(uint settingId) + { + string hexCandidate = null; + + foreach (var service in MetaServices.OrderBy(x => x.Service.Source)) + { + var settingName = service.Service.GetSettingName(settingId); + + if (!string.IsNullOrEmpty(settingName)) + { + if (settingName.StartsWith("0x")) + { + hexCandidate = settingName; + continue; + } + return settingName; + } + } + return hexCandidate; + } + + private string GetGroupName(uint settingId) + { + foreach (var service in MetaServices.OrderBy(x => x.Service.Source)) + { + var groupName = service.Service.GetGroupName(settingId); + if (groupName != null) + return groupName; + } + return null; + } + + private uint GetDwordDefaultValue(uint settingId) + { + foreach (var service in MetaServices.OrderBy(x => x.Service.Source)) + { + var settingDefault = service.Service.GetDwordDefaultValue(settingId); + if (settingDefault != null) + return settingDefault.Value; + } + + return 0; + } + + private string GetStringDefaultValue(uint settingId) + { + foreach (var service in MetaServices.OrderBy(x => x.Service.Source)) + { + var settingDefault = service.Service.GetStringDefaultValue(settingId); + if (settingDefault != null) + return settingDefault; + } + + return null; + } + + private byte[] GetBinaryDefaultValue(uint settingId) + { + foreach (var service in MetaServices.OrderBy(x => x.Service.Source)) + { + var settingDefault = service.Service.GetBinaryDefaultValue(settingId); + if (settingDefault != null) + return settingDefault; + } + + return null; + } + + private List> MergeSettingValues(List> a, List> b) + { + if (b == null) + return a; + + // force scanned settings to add instead of merge + var isScannedValuesList = (b.Count > 0 && b.First().ValueSource == SettingMetaSource.ScannedSettings); + if (isScannedValuesList) + { + a.AddRange(b); + } + else + { + var currentNonScannedValues = a.Where(xa => xa.ValueSource != SettingMetaSource.ScannedSettings).Select(xa => xa.Value).ToList(); + + var newNonScannedValues = b.Where(xb => !currentNonScannedValues.Contains(xb.Value)).ToList(); + a.AddRange(newNonScannedValues); + + foreach (var settingValue in a) + { + var bVal = b.FirstOrDefault(x => x.Value.Equals(settingValue.Value) && settingValue.ValueSource != SettingMetaSource.ScannedSettings); + if (bVal != null && bVal.ValueName != null) + { + settingValue.ValueName = bVal.ValueName; + settingValue.ValueSource = bVal.ValueSource; + settingValue.ValuePos = bVal.ValuePos; + } + } + } + + var atmp = a.FirstOrDefault(); + if (atmp != null && atmp is IComparable) + return a.OrderBy(x => x.Value).ToList(); + else + return a.ToList(); + } + + private List> GetBinaryValues(uint settingId) + { + var result = new List>(); + + foreach (var service in MetaServices.OrderByDescending(x => x.ValueNamePrio)) + { + result = MergeSettingValues(result, service.Service.GetBinaryValues(settingId)); + } + + return result; + } + + private List> GetStringValues(uint settingId) + { + var result = new List>(); + + foreach (var service in MetaServices.OrderByDescending(x => x.ValueNamePrio)) + { + result = MergeSettingValues(result, service.Service.GetStringValues(settingId)); + } + + return result; + } + + private List> GetDwordValues(uint settingId) + { + var result = new List>(); + + foreach (var service in MetaServices.OrderByDescending(x => x.ValueNamePrio)) + { + result = MergeSettingValues(result, service.Service.GetDwordValues(settingId)); + } + + if (result != null) + { + result = (from v in result.Where(x => 1 == 1 + && !x.ValueName.EndsWith("_NUM") + && !x.ValueName.EndsWith("_MASK") + && (!x.ValueName.EndsWith("_MIN") || x.ValueName.Equals("PREFERRED_PSTATE_PREFER_MIN")) + && (!x.ValueName.EndsWith("_MAX") || x.ValueName.Equals("PREFERRED_PSTATE_PREFER_MAX")) + + ) + group v by v.ValueName into g + select g.First(t => t.ValueName == g.Key)) + .OrderBy(v => v.ValueSource) + .ThenBy(v => v.ValuePos) + .ThenBy(v => v.ValueName).ToList(); + + } + + return result; + } + + public List GetSettingIds(SettingViewMode viewMode) + { + var settingIds = new List(); + var allowedSourcesForViewMode = GetAllowedSettingIdMetaSourcesForViewMode(viewMode); + + foreach (var service in MetaServices.OrderBy(x => x.Service.Source)) + { + if (allowedSourcesForViewMode.Contains(service.Service.Source)) + { + settingIds.AddRange(service.Service.GetSettingIds()); + } + } + return settingIds.Distinct().ToList(); + } + + private SettingMetaSource[] GetAllowedSettingIdMetaSourcesForViewMode(SettingViewMode viewMode) + { + switch (viewMode) + { + case SettingViewMode.CustomSettingsOnly: + return new[] { + SettingMetaSource.CustomSettings + }; + case SettingViewMode.IncludeScannedSetttings: + return new[] { + SettingMetaSource.ConstantSettings, + SettingMetaSource.ScannedSettings, + SettingMetaSource.CustomSettings, + SettingMetaSource.DriverSettings, + SettingMetaSource.ReferenceSettings, + }; + default: + return new[] { + SettingMetaSource.CustomSettings, + SettingMetaSource.DriverSettings, + }; + } + } + + private SettingMetaSource[] GetAllowedSettingValueMetaSourcesForViewMode(SettingViewMode viewMode) + { + switch (viewMode) + { + case SettingViewMode.CustomSettingsOnly: + return new[] { + SettingMetaSource.CustomSettings, + SettingMetaSource.ScannedSettings, + }; + default: + return new[] { + SettingMetaSource.ConstantSettings, + SettingMetaSource.ScannedSettings, + SettingMetaSource.CustomSettings, + SettingMetaSource.DriverSettings, + SettingMetaSource.ReferenceSettings, + + }; + } + } + + private SettingMeta CreateSettingMeta(uint settingId) + { + var settingType = GetSettingValueType(settingId); + var settingName = GetSettingName(settingId); + var groupName = GetGroupName(settingId); + + if (groupName == null) + groupName = GetLegacyGroupName(settingId, settingName); + + + + var result = new SettingMeta() + { + SettingType = settingType, + SettingName = settingName, + GroupName = groupName, + + IsApiExposed = GetIsApiExposed(settingId), + + DefaultDwordValue = + settingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE + ? GetDwordDefaultValue(settingId) : 0, + + DefaultStringValue = + settingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE + ? GetStringDefaultValue(settingId) : null, + + DefaultBinaryValue = + settingType == NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE + ? GetBinaryDefaultValue(settingId) : null, + + DwordValues = + settingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE + ? GetDwordValues(settingId) : null, + + StringValues = + settingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE + ? GetStringValues(settingId) : null, + + BinaryValues = + settingType == NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE + ? GetBinaryValues(settingId) : null, + }; + + return result; + } + + private SettingMeta PostProcessMeta(uint settingId, SettingMeta settingMeta, SettingViewMode viewMode) + { + var newMeta = new SettingMeta() + { + DefaultDwordValue = settingMeta.DefaultDwordValue, + DefaultStringValue = settingMeta.DefaultStringValue, + DefaultBinaryValue = settingMeta.DefaultBinaryValue, + SettingName = settingMeta.SettingName, + SettingType = settingMeta.SettingType, + GroupName = settingMeta.GroupName, + IsApiExposed = settingMeta.IsApiExposed, + }; + + if (string.IsNullOrEmpty(newMeta.SettingName)) + { + newMeta.SettingName = string.Format("0x{0:X8}", settingId); + } + + var allowedSourcesForViewMode = GetAllowedSettingValueMetaSourcesForViewMode(viewMode); + if (settingMeta.DwordValues != null) + { + newMeta.DwordValues = settingMeta.DwordValues + .Where(x => allowedSourcesForViewMode.Contains(x.ValueSource)).ToList(); + } + + if (settingMeta.StringValues != null) + { + newMeta.StringValues = settingMeta.StringValues + .Where(x => allowedSourcesForViewMode.Contains(x.ValueSource)).ToList(); + } + + if (settingMeta.BinaryValues != null) + { + newMeta.BinaryValues = settingMeta.BinaryValues + .Where(x => allowedSourcesForViewMode.Contains(x.ValueSource)).ToList(); + } + + return newMeta; + } + + public SettingMeta GetSettingMeta(uint settingId, SettingViewMode viewMode = SettingViewMode.Normal) + { + if (settingMetaCache.ContainsKey(settingId)) + { + return PostProcessMeta(settingId, settingMetaCache[settingId], viewMode); + } + else + { + var settingMeta = CreateSettingMeta(settingId); + settingMetaCache.Add(settingId, settingMeta); + return PostProcessMeta(settingId, settingMeta, viewMode); + } + } + + private string GetLegacyGroupName(uint settingId, string settingName) + { + if (settingName == null) + return null; + + if (settingName.ToUpper().Contains("SLI")) + return "6 - SLI"; + else if (settingName.ToUpper().Contains("STEREO")) + return "7 - Stereo"; + else if (settingName.StartsWith("0x")) + return "Unknown"; + else + return "Other"; + + } + private bool GetIsApiExposed(uint settingId) + { + var driverMeta = MetaServices.FirstOrDefault(m => m.Service.Source == SettingMetaSource.DriverSettings); + return (driverMeta != null && driverMeta.Service.GetSettingIds().Contains(settingId)); + } + } +} diff --git a/ColorControl/nspector/Common/DrsSettingsService.cs b/ColorControl/nspector/Common/DrsSettingsService.cs new file mode 100644 index 0000000..71ed036 --- /dev/null +++ b/ColorControl/nspector/Common/DrsSettingsService.cs @@ -0,0 +1,527 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using nspector.Common.Helper; +using nspector.Common.Meta; +using nspector.Native.NVAPI2; +using nvw = nspector.Native.NVAPI2.NvapiDrsWrapper; + +namespace nspector.Common +{ + internal class DrsSettingsService : DrsSettingsServiceBase + { + + public DrsSettingsService(DrsSettingsMetaService metaService, DrsDecrypterService decrpterService) + : base(metaService, decrpterService) + { + _baseProfileSettingIds = InitBaseProfileSettingIds(); + } + + private List InitBaseProfileSettingIds() + { + return DrsSession((hSession) => + { + var hBaseProfile = GetProfileHandle(hSession, ""); + var baseProfileSettings = GetProfileSettings(hSession, hBaseProfile); + + return baseProfileSettings.Select(x => x.settingId).ToList(); + }); + } + + private readonly List _baseProfileSettingIds; + + private string GetDrsProgramPath() + { + var nvidiaInstallerFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), @"NVIDIA Corporation\Installer2"); + var driverFolders = Directory.EnumerateDirectories(nvidiaInstallerFolder, "Display.Driver.*"); + foreach (var folder in driverFolders) + { + var fiDbInstaller = new FileInfo(Path.Combine(folder, "dbInstaller.exe")); + if (!fiDbInstaller.Exists) continue; + + var fviDbInstaller = FileVersionInfo.GetVersionInfo(fiDbInstaller.FullName); + + var fileversion = fviDbInstaller.FileVersion.Replace(".", ""); + var driverver = DriverVersion.ToString().Replace(",", "").Replace(".", ""); + + if (fileversion.EndsWith(driverver)) + return fiDbInstaller.DirectoryName; + } + + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), + @"NVIDIA Corporation\Drs"); + } + + private void RunDrsInitProcess() + { + var drsPath = GetDrsProgramPath(); + + var si = new ProcessStartInfo(); + si.UseShellExecute = true; + si.WorkingDirectory = drsPath; + si.Arguments = "-init"; + si.FileName = Path.Combine(drsPath, "dbInstaller.exe"); + if (!AdminHelper.IsAdmin) + si.Verb = "runas"; + var p = Process.Start(si); + p.WaitForExit(); + } + + public void DeleteAllProfilesHard() + { + var tmpFile = TempFile.GetTempFileName(); + try + { + File.WriteAllText(tmpFile, "BaseProfile \"Base Profile\"\r\nSelectedGlobalProfile \"Base Profile\"\r\nProfile \"Base Profile\"\r\nShowOn All\r\nProfileType Global\r\nEndProfile\r\n"); + + DrsSession((hSession) => + { + LoadSettingsFileEx(hSession, tmpFile); + SaveSettings(hSession); + }, forceNonGlobalSession: true, preventLoadSettings: true); + } + finally + { + if (File.Exists(tmpFile)) + File.Delete(tmpFile); + } + + } + + public void DeleteProfileHard(string profileName) + { + var tmpFileName = TempFile.GetTempFileName(); + + try + { + var tmpFileContent = ""; + + DrsSession((hSession) => + { + SaveSettingsFileEx(hSession, tmpFileName); + tmpFileContent = File.ReadAllText(tmpFileName); + string pattern = "(?\nProfile\\s\"" + Regex.Escape(profileName) + "\".*?EndProfile.*?\n)"; + tmpFileContent = Regex.Replace(tmpFileContent, pattern, "", RegexOptions.Singleline); + File.WriteAllText(tmpFileName, tmpFileContent); + }); + + if (tmpFileContent != "") + { + DrsSession((hSession) => + { + LoadSettingsFileEx(hSession, tmpFileName); + SaveSettings(hSession); + }); + } + } + finally + { + if (File.Exists(tmpFileName)) + File.Delete(tmpFileName); + } + } + + public void DeleteProfile(string profileName) + { + DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + if (hProfile != IntPtr.Zero) + { + var nvRes = nvw.DRS_DeleteProfile(hSession, hProfile); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_DeleteProfile", nvRes); + + SaveSettings(hSession); + } + }); + + } + + public List GetProfileNames(ref string baseProfileName, bool enumProfiles = true) + { + var lstResult = new List(); + var tmpBaseProfileName = baseProfileName; + + DrsSession((hSession) => + { + var hBase = GetProfileHandle(hSession, null); + var baseProfile = GetProfileInfo(hSession, hBase); + tmpBaseProfileName = baseProfile.profileName; + + lstResult.Add("_GLOBAL_DRIVER_PROFILE (" + tmpBaseProfileName + ")"); + + if (enumProfiles) + { + var profileHandles = EnumProfileHandles(hSession); + foreach (IntPtr hProfile in profileHandles) + { + var profile = GetProfileInfo(hSession, hProfile); + + if (profile.isPredefined == 0 || profile.numOfApps > 0) + { + lstResult.Add(profile.profileName); + } + } + } + }); + + baseProfileName = tmpBaseProfileName; + return lstResult; + } + + public void CreateProfile(string profileName, string applicationName = null) + { + DrsSession((hSession) => + { + var hProfile = CreateProfile(hSession, profileName); + + if (applicationName != null) + AddApplication(hSession, hProfile, applicationName); + + SaveSettings(hSession); + }); + } + + public void ResetAllProfilesInternal() + { + RunDrsInitProcess(); + + DrsSession((hSession) => + { + var nvRes = nvw.DRS_RestoreAllDefaults(hSession); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_RestoreAllDefaults", nvRes); + + SaveSettings(hSession); + }); + } + + public void ResetProfile(string profileName, out bool removeFromModified) + { + bool tmpRemoveFromModified = false; + DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + var profile = GetProfileInfo(hSession, hProfile); + + if (profile.isPredefined == 1) + { + var nvRes = nvw.DRS_RestoreProfileDefault(hSession, hProfile); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_RestoreProfileDefault", nvRes); + + SaveSettings(hSession); + tmpRemoveFromModified = true; + } + else if (profile.numOfSettings > 0) + { + int dropCount = 0; + var settings = GetProfileSettings(hSession, hProfile); + + foreach (var setting in settings) + { + if (setting.settingLocation == NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION) + { + if (nvw.DRS_DeleteProfileSetting(hSession, hProfile, setting.settingId) == NvAPI_Status.NVAPI_OK) + { + dropCount++; + } + } + } + if (dropCount > 0) + { + SaveSettings(hSession); + } + } + }); + + removeFromModified = tmpRemoveFromModified; + } + + public void ResetValue(string profileName, uint settingId, out bool removeFromModified) + { + var tmpRemoveFromModified = false; + + DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + + if (hProfile != IntPtr.Zero) + { + var nvRes = nvw.DRS_RestoreProfileDefaultSetting(hSession, hProfile, settingId); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_RestoreProfileDefaultSetting", nvRes); + + SaveSettings(hSession); + + var modifyCount = 0; + var settings = GetProfileSettings(hSession, hProfile); + + foreach (var setting in settings) + { + if (setting.isCurrentPredefined == 0 && setting.settingLocation == NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION) + { + modifyCount++; + } + } + tmpRemoveFromModified = (modifyCount == 0); + } + }); + + removeFromModified = tmpRemoveFromModified; + } + + public uint GetDwordValueFromProfile(string profileName, uint settingId, bool returnDefaultValue = false, bool forceDedicatedScope = false) + { + return DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + + var dwordValue = ReadDwordValue(hSession, hProfile, settingId); + + if (dwordValue != null) + return dwordValue.Value; + else if (returnDefaultValue) + return meta.GetSettingMeta(settingId).DefaultDwordValue; + + throw new NvapiException("DRS_GetSetting", NvAPI_Status.NVAPI_SETTING_NOT_FOUND); + }); + } + + public void SetDwordValueToProfile(string profileName, uint settingId, uint dwordValue) + { + DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + StoreDwordValue(hSession, hProfile, settingId, dwordValue); + SaveSettings(hSession); + }); + } + + public int StoreSettingsToProfile(string profileName, List> settings) + { + DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + + foreach (var setting in settings) + { + var settingMeta = meta.GetSettingMeta(setting.Key); + var settingType = settingMeta.SettingType; + + if (settingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE) + { + var dword = DrsUtil.ParseDwordSettingValue(settingMeta, setting.Value); + StoreDwordValue(hSession, hProfile, setting.Key, dword); + } + else if (settingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE) + { + var str = DrsUtil.ParseStringSettingValue(settingMeta, setting.Value); + StoreStringValue(hSession, hProfile, setting.Key, str); + } + else if (settingType == NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE) + { + var bin = DrsUtil.ParseBinarySettingValue(settingMeta, setting.Value); + StoreBinaryValue(hSession, hProfile, setting.Key, bin); + } + } + + SaveSettings(hSession); + }); + + return 0; + } + + + private SettingItem CreateSettingItem(NVDRS_SETTING setting, bool useDefault = false) + { + var settingMeta = meta.GetSettingMeta(setting.settingId); + //settingMeta.SettingType = setting.settingType; + + if (settingMeta.DwordValues == null) + settingMeta.DwordValues = new List>(); + + + if (settingMeta.StringValues == null) + settingMeta.StringValues = new List>(); + + if (settingMeta.BinaryValues == null) + settingMeta.BinaryValues = new List>(); + + + var settingState = SettingState.NotAssiged; + string valueRaw = ""; + string valueText = ""; + + if (settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE) + { + if (useDefault) + { + valueRaw = DrsUtil.GetDwordString(settingMeta.DefaultDwordValue); + valueText = DrsUtil.GetDwordSettingValueName(settingMeta, settingMeta.DefaultDwordValue); + } + else if (setting.isCurrentPredefined == 1 && setting.isPredefinedValid == 1) + { + valueRaw = DrsUtil.GetDwordString(setting.predefinedValue.dwordValue); + valueText = DrsUtil.GetDwordSettingValueName(settingMeta, setting.predefinedValue.dwordValue); + + if (setting.settingLocation == NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION) + settingState = SettingState.NvidiaSetting; + else + settingState = SettingState.GlobalSetting; + } + else + { + valueRaw = DrsUtil.GetDwordString(setting.currentValue.dwordValue); + valueText = DrsUtil.GetDwordSettingValueName(settingMeta, setting.currentValue.dwordValue); + + if (setting.settingLocation == NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION) + settingState = SettingState.UserdefinedSetting; + else + settingState = SettingState.GlobalSetting; + } + } + + if (settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE) + { + if (useDefault) + { + valueRaw = settingMeta.DefaultStringValue; + valueText = DrsUtil.GetStringSettingValueName(settingMeta, settingMeta.DefaultStringValue); + } + else if (setting.isCurrentPredefined == 1 && setting.isPredefinedValid == 1) + { + valueRaw = setting.predefinedValue.stringValue; + valueText = DrsUtil.GetStringSettingValueName(settingMeta, setting.predefinedValue.stringValue); + settingState = SettingState.NvidiaSetting; + } + else + { + valueRaw = setting.currentValue.stringValue; + valueText = DrsUtil.GetStringSettingValueName(settingMeta, setting.currentValue.stringValue); + + if (setting.settingLocation == NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION) + settingState = SettingState.UserdefinedSetting; + else + settingState = SettingState.GlobalSetting; + } + } + + if (settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE) + { + if (useDefault) + { + valueRaw = DrsUtil.GetBinaryString(settingMeta.DefaultBinaryValue); + valueText = DrsUtil.GetBinarySettingValueName(settingMeta, settingMeta.DefaultBinaryValue); + } + else if (setting.isCurrentPredefined == 1 && setting.isPredefinedValid == 1) + { + valueRaw = DrsUtil.GetBinaryString(setting.predefinedValue.binaryValue); + valueText = DrsUtil.GetBinarySettingValueName(settingMeta, setting.predefinedValue.binaryValue); + settingState = SettingState.NvidiaSetting; + } + else + { + valueRaw = DrsUtil.GetBinaryString(setting.currentValue.binaryValue); + valueText = DrsUtil.GetBinarySettingValueName(settingMeta, setting.currentValue.binaryValue); + + if (setting.settingLocation == NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION) + settingState = SettingState.UserdefinedSetting; + else + settingState = SettingState.GlobalSetting; + } + } + + return new SettingItem() + { + SettingId = setting.settingId, + SettingText = settingMeta.SettingName, + GroupName = settingMeta.GroupName, + ValueRaw = valueRaw, + ValueText = valueText, + State = settingState, + IsStringValue = settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE, + IsApiExposed = settingMeta.IsApiExposed, + }; + } + + + public List GetSettingsForProfile(string profileName, SettingViewMode viewMode, ref Dictionary applications) + { + var result = new List(); + var settingIds = meta.GetSettingIds(viewMode); + settingIds.AddRange(_baseProfileSettingIds); + settingIds = settingIds.Distinct().ToList(); + + applications = DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + + var profileSettings = GetProfileSettings(hSession, hProfile); + foreach (var profileSetting in profileSettings) + { + result.Add(CreateSettingItem(profileSetting)); + + if (settingIds.Contains(profileSetting.settingId)) + settingIds.Remove(profileSetting.settingId); + } + + foreach (var settingId in settingIds) + { + var setting = ReadSetting(hSession, hProfile, settingId); + if (setting != null) + result.Add(CreateSettingItem(setting.Value)); + else + { + var dummySetting = new NVDRS_SETTING() { settingId = settingId }; + result.Add(CreateSettingItem(dummySetting, true)); + } + } + + return GetProfileApplications(hSession, hProfile) + .Select(x => Tuple.Create(x.appName, GetApplicationFingerprint(x))).ToDictionary(x => x.Item2, x => x.Item1); + + }); + + return result.OrderBy(x => x.SettingText).ThenBy(x => x.GroupName).ToList(); + } + + public void AddApplication(string profileName, string applicationName) + { + DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + AddApplication(hSession, hProfile, applicationName); + SaveSettings(hSession); + }); + } + + public void RemoveApplication(string profileName, string applicationFingerprint) + { + DrsSession((hSession) => + { + var hProfile = GetProfileHandle(hSession, profileName); + var applications = GetProfileApplications(hSession, hProfile); + foreach (var app in applications) + { + if (GetApplicationFingerprint(app) != applicationFingerprint) continue; + DeleteApplication(hSession, hProfile, app); + break; + } + SaveSettings(hSession); + }); + } + + private string GetApplicationFingerprint(NVDRS_APPLICATION_V3 application) + { + return $"{application.appName}|{application.fileInFolder}|{application.userFriendlyName}|{application.launcher}"; + } + + } + +} + diff --git a/ColorControl/nspector/Common/DrsSettingsServiceBase.cs b/ColorControl/nspector/Common/DrsSettingsServiceBase.cs new file mode 100644 index 0000000..871e556 --- /dev/null +++ b/ColorControl/nspector/Common/DrsSettingsServiceBase.cs @@ -0,0 +1,329 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using nspector.Common.Helper; + +using nspector.Native.NVAPI2; +using nvw = nspector.Native.NVAPI2.NvapiDrsWrapper; + +namespace nspector.Common +{ + internal abstract class DrsSettingsServiceBase + { + + protected DrsSettingsMetaService meta; + protected DrsDecrypterService decrypter; + + public DrsSettingsServiceBase(DrsSettingsMetaService metaService, DrsDecrypterService decrpterService = null) + { + meta = metaService; + decrypter = decrpterService; + DriverVersion = GetDriverVersionInternal(); + } + + public readonly float DriverVersion; + private float GetDriverVersionInternal() + { + float result = 0f; + uint sysDrvVersion = 0; + var sysDrvBranch = new StringBuilder((int)NvapiDrsWrapper.NVAPI_SHORT_STRING_MAX); + + if (nvw.SYS_GetDriverAndBranchVersion(ref sysDrvVersion, sysDrvBranch) == NvAPI_Status.NVAPI_OK) + { + try { result = (float)(sysDrvVersion / 100f); } + catch { } + } + + return result; + } + + protected void DrsSession(Action action, bool forceNonGlobalSession = false, bool preventLoadSettings = false) + { + DrsSessionScope.DrsSession((hSession) => + { + action(hSession); + return true; + }, forceNonGlobalSession: forceNonGlobalSession, preventLoadSettings: preventLoadSettings); + } + + protected T DrsSession(Func action, bool forceDedicatedScope = false) + { + return DrsSessionScope.DrsSession(action, forceDedicatedScope); + } + + protected IntPtr GetProfileHandle(IntPtr hSession, string profileName) + { + var hProfile = IntPtr.Zero; + + if (string.IsNullOrEmpty(profileName)) + { + var nvRes = nvw.DRS_GetCurrentGlobalProfile(hSession, ref hProfile); + + if (hProfile == IntPtr.Zero) + throw new NvapiException("DRS_GetCurrentGlobalProfile", NvAPI_Status.NVAPI_PROFILE_NOT_FOUND); + + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_GetCurrentGlobalProfile", nvRes); + } + else + { + var nvRes = nvw.DRS_FindProfileByName(hSession, new StringBuilder(profileName), ref hProfile); + + if (nvRes == NvAPI_Status.NVAPI_PROFILE_NOT_FOUND) + return IntPtr.Zero; + + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_FindProfileByName", nvRes); + } + return hProfile; + } + + protected IntPtr CreateProfile(IntPtr hSession, string profileName) + { + if (string.IsNullOrEmpty(profileName)) + throw new ArgumentNullException("profileName"); + + var hProfile = IntPtr.Zero; + + var newProfile = new NVDRS_PROFILE() + { + version = nvw.NVDRS_PROFILE_VER, + profileName = profileName, + }; + + var nvRes = nvw.DRS_CreateProfile(hSession, ref newProfile, ref hProfile); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_CreateProfile", nvRes); + + return hProfile; + } + + + protected NVDRS_PROFILE GetProfileInfo(IntPtr hSession, IntPtr hProfile) + { + var tmpProfile = new NVDRS_PROFILE(); + tmpProfile.version = nvw.NVDRS_PROFILE_VER; + + var gpRes = nvw.DRS_GetProfileInfo(hSession, hProfile, ref tmpProfile); + if (gpRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_GetProfileInfo", gpRes); + + return tmpProfile; + } + + protected void StoreSetting(IntPtr hSession, IntPtr hProfile, NVDRS_SETTING newSetting) + { + var ssRes = nvw.DRS_SetSetting(hSession, hProfile, ref newSetting); + if (ssRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_SetSetting", ssRes); + } + + protected void StoreDwordValue(IntPtr hSession, IntPtr hProfile, uint settingId, uint dwordValue) + { + var newSetting = new NVDRS_SETTING() + { + version = nvw.NVDRS_SETTING_VER, + settingId = settingId, + settingType = NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE, + settingLocation = NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION, + currentValue = new NVDRS_SETTING_UNION() + { + dwordValue = dwordValue, + }, + }; + + var ssRes = nvw.DRS_SetSetting(hSession, hProfile, ref newSetting); + if (ssRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_SetSetting", ssRes); + + } + + protected void StoreStringValue(IntPtr hSession, IntPtr hProfile, uint settingId, string stringValue) + { + var newSetting = new NVDRS_SETTING() + { + version = nvw.NVDRS_SETTING_VER, + settingId = settingId, + settingType = NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE, + settingLocation = NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION, + currentValue = new NVDRS_SETTING_UNION() + { + stringValue = stringValue, + }, + }; + + var ssRes = nvw.DRS_SetSetting(hSession, hProfile, ref newSetting); + if (ssRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_SetSetting", ssRes); + + } + + protected void StoreBinaryValue(IntPtr hSession, IntPtr hProfile, uint settingId, byte[] binValue) + { + var newSetting = new NVDRS_SETTING() + { + version = nvw.NVDRS_SETTING_VER, + settingId = settingId, + settingType = NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE, + settingLocation = NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION, + currentValue = new NVDRS_SETTING_UNION() + { + binaryValue = binValue, + }, + }; + + var ssRes = nvw.DRS_SetSetting(hSession, hProfile, ref newSetting); + if (ssRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_SetSetting", ssRes); + + } + + protected NVDRS_SETTING? ReadSetting(IntPtr hSession, IntPtr hProfile, uint settingId) + { + var newSetting = new NVDRS_SETTING() + { + version = nvw.NVDRS_SETTING_VER, + }; + + var ssRes = nvw.DRS_GetSetting(hSession, hProfile, settingId, ref newSetting); + if (ssRes == NvAPI_Status.NVAPI_SETTING_NOT_FOUND) + return null; + + if (ssRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_GetSetting", ssRes); + + if (decrypter != null) + { + var profile = GetProfileInfo(hSession, hProfile); + decrypter.DecryptSettingIfNeeded(profile.profileName, ref newSetting); + } + + return newSetting; + } + + protected uint? ReadDwordValue(IntPtr hSession, IntPtr hProfile, uint settingId) + { + var newSetting = ReadSetting(hSession, hProfile, settingId); + if (newSetting == null) + return null; + return newSetting.Value.currentValue.dwordValue; + } + + protected void AddApplication(IntPtr hSession, IntPtr hProfile, string applicationName) + { + var newApp = new NVDRS_APPLICATION_V3() + { + version = nvw.NVDRS_APPLICATION_VER_V3, + appName = applicationName, + }; + + var caRes = nvw.DRS_CreateApplication(hSession, hProfile, ref newApp); + if (caRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_CreateApplication", caRes); + + } + + protected void DeleteApplication(IntPtr hSession, IntPtr hProfile, NVDRS_APPLICATION_V3 application) + { + var caRes = nvw.DRS_DeleteApplicationEx(hSession, hProfile, ref application); + if (caRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_DeleteApplication", caRes); + } + + protected List EnumProfileHandles(IntPtr hSession) + { + var profileHandles = new List(); + var hProfile = IntPtr.Zero; + uint index = 0; + + NvAPI_Status nvRes; + + do + { + nvRes = nvw.DRS_EnumProfiles(hSession, index, ref hProfile); + if (nvRes == NvAPI_Status.NVAPI_OK) + { + profileHandles.Add(hProfile); + } + index++; + } + while (nvRes == NvAPI_Status.NVAPI_OK); + + if (nvRes != NvAPI_Status.NVAPI_END_ENUMERATION) + throw new NvapiException("DRS_EnumProfiles", nvRes); + + return profileHandles; + } + + protected List GetProfileSettings(IntPtr hSession, IntPtr hProfile) + { + uint settingCount = 512; + var settings = new NVDRS_SETTING[settingCount]; + settings[0].version = NvapiDrsWrapper.NVDRS_SETTING_VER; + + var esRes = NvapiDrsWrapper.DRS_EnumSettings(hSession, hProfile, 0, ref settingCount, ref settings); + + if (esRes == NvAPI_Status.NVAPI_END_ENUMERATION) + return new List(); + + if (esRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_EnumSettings", esRes); + + if (decrypter != null) + { + var profile = GetProfileInfo(hSession, hProfile); + for (int i = 0; i < settingCount; i++) + { + decrypter.DecryptSettingIfNeeded(profile.profileName, ref settings[i]); + } + } + + return settings.ToList(); + } + + protected List GetProfileApplications(IntPtr hSession, IntPtr hProfile) + { + uint appCount = 512; + var apps = new NVDRS_APPLICATION_V3[512]; + apps[0].version = NvapiDrsWrapper.NVDRS_APPLICATION_VER_V3; + + var esRes = NvapiDrsWrapper.DRS_EnumApplications(hSession, hProfile, 0, ref appCount, ref apps); + + if (esRes == NvAPI_Status.NVAPI_END_ENUMERATION) + return new List(); + + if (esRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_EnumApplications", esRes); + + return apps.ToList(); + } + + protected void SaveSettings(IntPtr hSession) + { + var nvRes = nvw.DRS_SaveSettings(hSession); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_SaveSettings", nvRes); + } + + protected void LoadSettingsFileEx(IntPtr hSession, string filename) + { + var nvRes = nvw.DRS_LoadSettingsFromFileEx(hSession, new StringBuilder(filename)); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_LoadSettingsFromFileEx", nvRes); + } + + protected void SaveSettingsFileEx(IntPtr hSession, string filename) + { + var nvRes = nvw.DRS_SaveSettingsToFileEx(hSession, new StringBuilder(filename)); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_SaveSettingsToFileEx", nvRes); + } + + } + +} + diff --git a/ColorControl/nspector/Common/DrsUtil.cs b/ColorControl/nspector/Common/DrsUtil.cs new file mode 100644 index 0000000..1822708 --- /dev/null +++ b/ColorControl/nspector/Common/DrsUtil.cs @@ -0,0 +1,119 @@ +using nspector.Common.Meta; +using System; +using System.Globalization; +using System.Linq; + +namespace nspector.Common +{ + public static class DrsUtil + { + public static string StringValueRaw = "Text"; + + public static string GetDwordString(uint dword) + { + return string.Format("0x{0:X8}", dword); + } + + public static uint ParseDwordByInputSafe(string input) + { + uint result = 0; + if (input.ToLower().StartsWith("0x")) + { + try + { + int blankPos = input.IndexOf(' '); + int parseLen = blankPos > 2 ? blankPos - 2 : input.Length - 2; + result = uint.Parse(input.Substring(2, parseLen), NumberStyles.AllowHexSpecifier); + } + catch { } + } + else + try { result = uint.Parse(input); } + catch { } + + return result; + } + + internal static uint ParseDwordSettingValue(SettingMeta meta, string text) + { + var valueByName = meta.DwordValues.FirstOrDefault(x => x.ValueName != null && x.ValueName.Equals(text)); + if (valueByName != null) + return valueByName.Value; + + return ParseDwordByInputSafe(text); + } + + internal static string GetDwordSettingValueName(SettingMeta meta, uint dwordValue) + { + var settingValue = meta.DwordValues + .FirstOrDefault(x => x.Value.Equals(dwordValue)); + + return settingValue == null ? GetDwordString(dwordValue) : settingValue.ValueName; + } + + internal static string ParseStringSettingValue(SettingMeta meta, string text) + { + var valueByName = meta.StringValues.FirstOrDefault(x => x.ValueName != null && x.ValueName.Equals(text)); + if (valueByName != null) + return valueByName.Value; + + return text; + } + + internal static string GetStringSettingValueName(SettingMeta meta, string stringValue) + { + var settingValue = meta.StringValues + .FirstOrDefault(x => x.Value.Equals(stringValue)); + + return settingValue == null ? stringValue : settingValue.ValueName; + } + + public static string GetBinaryString(byte[] binaryValue) + { + if (binaryValue == null) + return ""; + + if (binaryValue.Length == 8) + return string.Format("0x{0:X16}", BitConverter.ToUInt64(binaryValue, 0)); + + return BitConverter.ToString(binaryValue); + } + + internal static string GetBinarySettingValueName(SettingMeta meta, byte[] binaryValue) + { + var settingValue = meta.BinaryValues? + .FirstOrDefault(x => x.Value.Equals(binaryValue)); + + return settingValue == null ? GetBinaryString(binaryValue) : settingValue.ValueName; + } + + internal static byte[] ParseBinarySettingValue(SettingMeta meta, string text) + { + var valueByName = meta.BinaryValues.FirstOrDefault(x => x.ValueName != null && x.ValueName.Equals(text)); + if (valueByName != null) + return valueByName.Value; + + return ParseBinaryByInputSafe(text); + } + + public static byte[] ParseBinaryByInputSafe(string input) + { + if (string.IsNullOrWhiteSpace(input)) + return null; + + if (input.StartsWith("0x")) + { + int blankPos = input.IndexOf(' '); + int parseLen = blankPos > 2 ? blankPos - 2 : input.Length - 2; + var qword = ulong.Parse(input.Substring(2, parseLen), NumberStyles.AllowHexSpecifier); + return BitConverter.GetBytes(qword); + } + + if (input.Contains("-")) + return Array.ConvertAll(input.Split('-'), s => Convert.ToByte(s, 16)); + + return null; + } + + } +} diff --git a/ColorControl/nspector/Common/Helper/AdminHelper.cs b/ColorControl/nspector/Common/Helper/AdminHelper.cs new file mode 100644 index 0000000..706fc38 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/AdminHelper.cs @@ -0,0 +1,20 @@ +using System.Security.Principal; + +namespace nspector.Common.Helper +{ + public static class AdminHelper + { + private static bool isAdmin = false; + static AdminHelper() + { + var identity = WindowsIdentity.GetCurrent(); + var principal = new WindowsPrincipal(identity); + isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); + } + + public static bool IsAdmin + { + get { return isAdmin; } + } + } +} diff --git a/ColorControl/nspector/Common/Helper/DropDownMenuScrollWheelHandler.cs b/ColorControl/nspector/Common/Helper/DropDownMenuScrollWheelHandler.cs new file mode 100644 index 0000000..f4acf81 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/DropDownMenuScrollWheelHandler.cs @@ -0,0 +1,82 @@ +using System; +using System.Windows.Forms; + +namespace nspector.Common.Helper +{ + + //by Bryce Wagner https://stackoverflow.com/questions/13139074/mouse-wheel-scrolling-toolstrip-menu-items + + public class DropDownMenuScrollWheelHandler : IMessageFilter + { + private static DropDownMenuScrollWheelHandler Instance; + public static void Enable(bool enabled) + { + if (enabled) + { + if (Instance == null) + { + Instance = new DropDownMenuScrollWheelHandler(); + Application.AddMessageFilter(Instance); + } + } + else + { + if (Instance != null) + { + Application.RemoveMessageFilter(Instance); + Instance = null; + } + } + } + private IntPtr activeHwnd; + private ToolStripDropDown activeMenu; + + public bool PreFilterMessage(ref Message m) + { + if (m.Msg == 0x200 && activeHwnd != m.HWnd) // WM_MOUSEMOVE + { + activeHwnd = m.HWnd; + this.activeMenu = Control.FromHandle(m.HWnd) as ToolStripDropDown; + } + else if (m.Msg == 0x20A && this.activeMenu != null) // WM_MOUSEWHEEL + { + int delta = (short)(ushort)(((uint)(ulong)m.WParam) >> 16); + HandleDelta(this.activeMenu, delta); + return true; + } + return false; + } + + private static readonly Action ScrollInternal + = (Action)Delegate.CreateDelegate(typeof(Action), + typeof(ToolStrip).GetMethod("ScrollInternal", + System.Reflection.BindingFlags.NonPublic + | System.Reflection.BindingFlags.Instance)); + + private void HandleDelta(ToolStripDropDown ts, int delta) + { + if (ts.Items.Count == 0) + return; + + var firstItem = ts.Items[0]; + var lastItem = ts.Items[ts.Items.Count - 1]; + + if (lastItem.Bounds.Bottom < ts.Height && firstItem.Bounds.Top > 0) + return; + + delta = delta / -4; + + if (delta < 0 && firstItem.Bounds.Top - delta > 9) + { + delta = firstItem.Bounds.Top - 9; + } + else if (delta > 0 && delta > lastItem.Bounds.Bottom - ts.Height + 9) + { + delta = lastItem.Bounds.Bottom - ts.Height + 9; + } + + if (delta != 0) + ScrollInternal(ts, delta); + } + } +} diff --git a/ColorControl/nspector/Common/Helper/InputBox.cs b/ColorControl/nspector/Common/Helper/InputBox.cs new file mode 100644 index 0000000..e5b3939 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/InputBox.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text.RegularExpressions; +using System.Windows.Forms; + +namespace nspector.Common.Helper +{ + internal class InputBox + { + internal static DialogResult Show(string title, string promptText, ref string value, List invalidInputs, string mandatoryFormatRegExPattern, int maxLength) + { + var form = new Form(); + var label = new Label(); + var textBox = new TextBox(); + var buttonOk = new Button(); + var buttonCancel = new Button(); + var imageBox = new PictureBox(); + + EventHandler textchanged = delegate (object sender, EventArgs e) + { + bool mandatory_success = Regex.IsMatch(textBox.Text, mandatoryFormatRegExPattern); + + if (textBox.Text == "" || textBox.Text.Length > maxLength || !mandatory_success) + { + imageBox.Image = nspector.Properties.Resources.ieframe_1_18212; + buttonOk.Enabled = false; + return; + } + + foreach (string invStr in invalidInputs) + { + if (textBox.Text.ToUpper() == invStr.ToUpper()) + { + imageBox.Image = Properties.Resources.ieframe_1_18212; + buttonOk.Enabled = false; + return; + } + } + + imageBox.Image = Properties.Resources.ieframe_1_31073_002; + buttonOk.Enabled = true; + }; + + + textBox.TextChanged += textchanged; + + + form.Text = title; + label.Text = promptText; + textBox.Text = value; + textBox.MaxLength = maxLength; + imageBox.Image = Properties.Resources.ieframe_1_18212; + + buttonOk.Text = "OK"; + buttonCancel.Text = "Cancel"; + buttonOk.DialogResult = DialogResult.OK; + buttonCancel.DialogResult = DialogResult.Cancel; + + buttonOk.Enabled = false; + + label.SetBounds(9, 20, 372, 13); + textBox.SetBounds(12, 36, 352, 20); + buttonOk.SetBounds(228, 72, 75, 23); + buttonCancel.SetBounds(309, 72, 75, 23); + + imageBox.SetBounds(368, 36, 16, 16); + + label.AutoSize = true; + imageBox.Anchor = AnchorStyles.Top | AnchorStyles.Right; + textBox.Anchor = textBox.Anchor | AnchorStyles.Right; + buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + + form.ClientSize = new Size(396, 107); + form.Controls.AddRange(new Control[] { label, textBox, imageBox, buttonOk, buttonCancel }); + form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height); + form.FormBorderStyle = FormBorderStyle.FixedDialog; + form.StartPosition = FormStartPosition.CenterParent; + form.MinimizeBox = false; + form.MaximizeBox = false; + form.AcceptButton = buttonOk; + form.CancelButton = buttonCancel; + + textchanged(form, new EventArgs()); + + DialogResult dialogResult = form.ShowDialog(); + value = textBox.Text; + return dialogResult; + } + } +} diff --git a/ColorControl/nspector/Common/Helper/ListSort.cs b/ColorControl/nspector/Common/Helper/ListSort.cs new file mode 100644 index 0000000..7c40b56 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/ListSort.cs @@ -0,0 +1,19 @@ +using System.Collections; + +namespace nspector.Common.Helper +{ + internal class ListSort : IComparer + { + public int Compare(object x, object y) + { + try + { + return System.String.CompareOrdinal(x.ToString(), y.ToString()); + } + catch + { + return 0; + } + } + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/Helper/ListViewGroupSorter.cs b/ColorControl/nspector/Common/Helper/ListViewGroupSorter.cs new file mode 100644 index 0000000..d37abe0 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/ListViewGroupSorter.cs @@ -0,0 +1,85 @@ +using System.Collections.Generic; +using System.Windows.Forms; + +namespace nspector.Common.Helper +{ + + public class ListViewGroupHeaderSorter : IComparer + { + private bool _ascending = true; + public ListViewGroupHeaderSorter(bool ascending) + { + _ascending = ascending; + } + + #region IComparer Members + + public int Compare(ListViewGroup x, ListViewGroup y) + { + if (_ascending) + return string.Compare(((ListViewGroup)x).Header, ((ListViewGroup)y).Header); + else + return string.Compare(((ListViewGroup)y).Header, ((ListViewGroup)x).Header); + } + #endregion + } + + public class ListViewGroupSorter + { + internal ListView _listview; + + public static bool operator ==(ListView listview, ListViewGroupSorter sorter) + { + return listview == sorter._listview; + } + public static bool operator !=(ListView listview, ListViewGroupSorter sorter) + { + return listview != sorter._listview; + } + + public static implicit operator ListView(ListViewGroupSorter sorter) + { + return sorter._listview; + } + public static implicit operator ListViewGroupSorter(ListView listview) + { + return new ListViewGroupSorter(listview); + } + + internal ListViewGroupSorter(ListView listview) + { + _listview = listview; + } + + public void SortGroups(bool ascending) + { + _listview.BeginUpdate(); + List lvgs = new List(); + foreach (ListViewGroup lvg in _listview.Groups) + lvgs.Add(lvg); + _listview.Groups.Clear(); + lvgs.Sort(new ListViewGroupHeaderSorter(ascending)); + _listview.Groups.AddRange(lvgs.ToArray()); + _listview.EndUpdate(); + } + + #region overridden methods + + public override bool Equals(object obj) + { + return _listview.Equals(obj); + } + + public override int GetHashCode() + { + return _listview.GetHashCode(); + } + + public override string ToString() + { + return _listview.ToString(); + } + + #endregion + } +} diff --git a/ColorControl/nspector/Common/Helper/NoBorderRenderer.cs b/ColorControl/nspector/Common/Helper/NoBorderRenderer.cs new file mode 100644 index 0000000..1edd521 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/NoBorderRenderer.cs @@ -0,0 +1,11 @@ +using System.Windows.Forms; + +namespace nspector.Common.Helper +{ + internal class NoBorderRenderer : ToolStripProfessionalRenderer + { + protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) {} + + protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) {} + } +} diff --git a/ColorControl/nspector/Common/Helper/ShortcutResolver.cs b/ColorControl/nspector/Common/Helper/ShortcutResolver.cs new file mode 100644 index 0000000..4a7a6bb --- /dev/null +++ b/ColorControl/nspector/Common/Helper/ShortcutResolver.cs @@ -0,0 +1,85 @@ +using System.IO; +using nspector.Native.WINAPI; + +namespace nspector.Common.Helper +{ + public class ShortcutResolver + { + + public static string GetUrlFromInternetShortcut(string filePath) + { + var lines = File.ReadAllLines(filePath); + foreach (var line in lines) + { + if (line.StartsWith("URL=")) + { + string[] splitLine = line.Split('='); + if (splitLine.Length > 0) + { + return splitLine[1]; + } + } + } + return ""; + } + + public static string ResolveExecuteable(string filename, out string profileName) + { + var fileInfo = new FileInfo(filename); + profileName = fileInfo.Name.Substring(0, fileInfo.Name.Length - fileInfo.Extension.Length); + + try + { + switch (fileInfo.Extension.ToLower()) + { + case ".lnk": return ResolveFromShellLinkFile(fileInfo.FullName); + case ".url": return ResolveFromUrlFile(fileInfo.FullName); + case ".exe": return fileInfo.Name; + default: return ""; + } + } + catch + { + return ""; + } + } + + private static string ResolveFromShellLinkFile(string filename) + { + var shellLink = new ShellLink(filename); + if (shellLink.Arguments.StartsWith(SteamAppResolver.SteamUrlPattern)) + { + var resolver = new SteamAppResolver(); + return resolver.ResolveExeFromSteamUrl(shellLink.Arguments); + } + + var targetInfo = new FileInfo(shellLink.Target); + if (targetInfo.Name.ToLower() == SteamAppResolver.SteamExeName) + { + if (shellLink.Arguments.Contains(SteamAppResolver.SteamArgumentPattern)) + { + var resolver = new SteamAppResolver(); + return resolver.ResolveExeFromSteamArguments(shellLink.Arguments); + } + } + + if (targetInfo.Extension.ToLower().Equals(".exe")) + { + return targetInfo.Name; + } + return ""; + } + + private static string ResolveFromUrlFile(string filename) + { + var url = GetUrlFromInternetShortcut(filename); + if (url.StartsWith(SteamAppResolver.SteamUrlPattern)) + { + var resolver = new SteamAppResolver(); + return resolver.ResolveExeFromSteamUrl(url); + } + return ""; + } + + } +} diff --git a/ColorControl/nspector/Common/Helper/SteamAppResolver.cs b/ColorControl/nspector/Common/Helper/SteamAppResolver.cs new file mode 100644 index 0000000..205da56 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/SteamAppResolver.cs @@ -0,0 +1,206 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using Microsoft.Win32; + +namespace nspector.Common.Helper +{ + public class SteamAppResolver + { + + public const string SteamExeName = "steam.exe"; + public const string SteamUrlPattern = "steam://rungameid/"; + public const string SteamArgumentPattern = "-applaunch"; + + private byte[] _appinfoBytes; + + public SteamAppResolver() + { + var appInfoLocation = GetSteamAppInfoLocation(); + if (File.Exists(appInfoLocation)) + _appinfoBytes = File.ReadAllBytes(appInfoLocation); + else + _appinfoBytes = null; + } + + private string GetSteamAppInfoLocation() + { + var reg = Registry.CurrentUser.OpenSubKey(@"Software\Valve\Steam", false); + + if (reg != null) + { + string steamPath = (string)reg.GetValue("SteamPath", null); + if (steamPath != null) + return Path.Combine(steamPath, @"appcache\appinfo.vdf"); + } + + return ""; + } + + public string ResolveExeFromSteamUrl(string url) + { + if (url.StartsWith(SteamUrlPattern)) + { + var appIdStr = url.Substring(SteamUrlPattern.Length); + int appid = 0; + if (int.TryParse(appIdStr, out appid)) + { + return FindCommonExecutableForApp(appid); + } + } + return ""; + } + + public string ResolveExeFromSteamArguments(string arguments) + { + if (arguments.Contains(SteamArgumentPattern)) + { + var rxRungame = new Regex(SteamArgumentPattern + @"\s+(?\d+)"); + foreach (Match m in rxRungame.Matches(arguments)) + { + var appIdStr = m.Result("${appid}"); + int appid = 0; + if (int.TryParse(appIdStr, out appid)) + { + return FindCommonExecutableForApp(appid); + } + } + + } + return ""; + } + + private string FindCommonExecutableForApp(int appid) + { + var apps = FindAllExecutablesForApp(appid); + if (apps.Count > 0) + { + return new FileInfo(apps[0]).Name; + } + return ""; + } + + private List FindAllExecutablesForApp(int appid) + { + if (_appinfoBytes == null) + return new List(); + + var bid = BitConverter.GetBytes(appid); + int offset = 0; + + var appidPattern = new byte[] { 0x08, bid[0], bid[1], bid[2], bid[3] }; + var launchPattern = new byte[] { 0x00, 0x6C, 0x61, 0x75, 0x6E, 0x63, 0x68, 0x00 }; + + var appidOffset = FindOffset(_appinfoBytes, appidPattern, offset); + if (appidOffset == -1) + return new List(); + else + offset = appidOffset + appidPattern.Length; + + var launchOffset = FindOffset(_appinfoBytes, launchPattern, offset); + if (launchOffset == -1) + return new List(); + else + offset = launchOffset; + + var executables = new List(); + FindExecutables(_appinfoBytes, ref offset, ref executables); + return executables; + } + + + private void FindExecutables(byte[] bytes, ref int offset, ref List executables) + { + while (true) + { + var valueType = ReadByte(bytes, ref offset); + if (valueType == 0x08) + { + break; + } + + var valueName = ReadCString(bytes, ref offset); + var valueString = ""; + switch (valueType) + { + case 0: + { + FindExecutables(bytes, ref offset, ref executables); + break; + } + case 1: + { + valueString = ReadCString(bytes, ref offset); + + if (valueName == "executable" && valueString.EndsWith(".exe")) + { + executables.Add(valueString); + } + + break; + } + case 2: + { + offset += 4; + break; + } + + case 7: + { + offset += 8; + break; + } + default: break; + } + } + } + + private static int FindOffset(byte[] bytes, byte[] pattern, int offset = 0, byte? wildcard = null) + { + for (int i = offset; i < bytes.Length; i++) + { + if (pattern[0] == bytes[i] && bytes.Length - i >= pattern.Length) + { + bool ismatch = true; + for (int j = 1; j < pattern.Length && ismatch == true; j++) + { + if (bytes[i + j] != pattern[j] && ((wildcard.HasValue && wildcard != pattern[j]) || !wildcard.HasValue)) + { + ismatch = false; + break; + } + } + if (ismatch) + return i; + + } + } + return -1; + } + + private static byte ReadByte(byte[] bytes, ref int offset) + { + offset += 1; + return bytes[offset - 1]; + } + + private static string ReadCString(byte[] bytes, ref int offset) + { + var tmpOffset = offset; + while (bytes[tmpOffset] != 0) + { + tmpOffset++; + } + + var start = offset; + var length = tmpOffset - offset; + offset += length + 1; + + return Encoding.UTF8.GetString(bytes, start, length); + + } + + } +} diff --git a/ColorControl/nspector/Common/Helper/TempFile.cs b/ColorControl/nspector/Common/Helper/TempFile.cs new file mode 100644 index 0000000..7eb1561 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/TempFile.cs @@ -0,0 +1,24 @@ +using System; +using System.IO; + +namespace nspector.Common.Helper +{ + internal static class TempFile + { + public static string GetTempFileName() + { + while (true) + { + var tempFile = GenerateTempFileName(); + if (!File.Exists(tempFile)) + return tempFile; + } + } + + private static string GenerateTempFileName() + { + return Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString().Replace("-", "")); + } + + } +} diff --git a/ColorControl/nspector/Common/Helper/UserSettings.cs b/ColorControl/nspector/Common/Helper/UserSettings.cs new file mode 100644 index 0000000..9c60b6e --- /dev/null +++ b/ColorControl/nspector/Common/Helper/UserSettings.cs @@ -0,0 +1,47 @@ +using System; +using System.IO; +using System.Text; +using System.Windows.Forms; + +namespace nspector.Common.Helper +{ + public class UserSettings + { + public int WindowTop { get; set; } + + public int WindowLeft { get; set; } + + public int WindowWidth { get; set; } + + public int WindowHeight { get; set; } + + public FormWindowState WindowState { get; set; } + + public bool ShowCustomizedSettingNamesOnly { get; set; } = false; + + public bool ShowScannedUnknownSettings { get; set; } = false; + + private static string GetSettingsFilename() + { + var fiPortalbleSettings = new FileInfo("settings.xml"); + if (fiPortalbleSettings.Exists) return fiPortalbleSettings.FullName; + + var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Application.ProductName); + if (!Directory.Exists(path)) Directory.CreateDirectory(path); + return Path.Combine(path, "settings.xml"); ; + } + + public void SaveSettings() + { + XMLHelper.SerializeToXmlFile(this, GetSettingsFilename(), Encoding.Unicode, true); + } + + public static UserSettings LoadSettings() + { + var filename = GetSettingsFilename(); + if (!File.Exists(filename)) return new UserSettings(); + + return XMLHelper.DeserializeFromXMLFile(GetSettingsFilename()); + } + } +} diff --git a/ColorControl/nspector/Common/Helper/XMLHelper.cs b/ColorControl/nspector/Common/Helper/XMLHelper.cs new file mode 100644 index 0000000..ba6b221 --- /dev/null +++ b/ColorControl/nspector/Common/Helper/XMLHelper.cs @@ -0,0 +1,53 @@ +using System.IO; +using System.Text; +using System.Xml; +using System.Xml.Serialization; + +namespace nspector.Common.Helper +{ + internal static class XMLHelper where T : new() + { + static XmlSerializer xmlSerializer; + + static XMLHelper() + { + xmlSerializer = new XmlSerializer(typeof(T)); + } + + internal static string SerializeToXmlString(T xmlObject, Encoding encoding, bool removeNamespace) + { + var memoryStream = new MemoryStream(); + var xmlWriter = new XmlTextWriter(memoryStream, encoding) { Formatting = Formatting.Indented }; + + if (removeNamespace) + { + var xs = new XmlSerializerNamespaces(); + xs.Add("", ""); + xmlSerializer.Serialize(xmlWriter, xmlObject, xs); + } + else + xmlSerializer.Serialize(xmlWriter, xmlObject); + + return encoding.GetString(memoryStream.ToArray()); + } + + internal static void SerializeToXmlFile(T xmlObject, string filename, Encoding encoding, bool removeNamespace) + { + File.WriteAllText(filename, SerializeToXmlString(xmlObject, encoding, removeNamespace)); + } + + internal static T DeserializeFromXmlString(string xml) + { + var reader = new StringReader(xml); + var xmlObject = (T)xmlSerializer.Deserialize(reader); + return xmlObject; + } + + internal static T DeserializeFromXMLFile(string filename) + { + return DeserializeFromXmlString(File.ReadAllText(filename)); + } + + } + +} diff --git a/ColorControl/nspector/Common/Import/ImportExportUitl.cs b/ColorControl/nspector/Common/Import/ImportExportUitl.cs new file mode 100644 index 0000000..4357586 --- /dev/null +++ b/ColorControl/nspector/Common/Import/ImportExportUitl.cs @@ -0,0 +1,107 @@ +using System; +using nspector.Native.NVAPI2; + +namespace nspector.Common.Import +{ + internal class ImportExportUitl + { + public static bool AreDrsSettingEqualToProfileSetting(NVDRS_SETTING drsSetting, ProfileSetting profileSetting) + { + var profileSettingCompare = ConvertDrsSettingToProfileSetting(drsSetting); + return profileSetting.SettingValue.Equals(profileSettingCompare.SettingValue); + } + + public static ProfileSetting ConvertDrsSettingToProfileSetting(NVDRS_SETTING setting) + { + return new ProfileSetting + { + SettingId = setting.settingId, + SettingNameInfo = setting.settingName, + SettingValue = ConvertSettingValueToString(setting), + ValueType = MapValueType(setting.settingType), + }; + } + + private static string ConvertSettingValueToString(NVDRS_SETTING setting) + { + var settingUnion = setting.currentValue; + if (setting.isCurrentPredefined == 1) + { + settingUnion = setting.predefinedValue; + } + + switch (setting.settingType) + { + case NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE: + return settingUnion.dwordValue.ToString(); + case NVDRS_SETTING_TYPE.NVDRS_STRING_TYPE: + return settingUnion.ansiStringValue; + case NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE: + return settingUnion.stringValue; + case NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE: + return Convert.ToBase64String(settingUnion.binaryValue); + default: + throw new Exception("invalid setting type"); + } + } + + private static SettingValueType MapValueType(NVDRS_SETTING_TYPE input) + { + switch (input) + { + case NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE: return SettingValueType.Binary; + case NVDRS_SETTING_TYPE.NVDRS_STRING_TYPE: return SettingValueType.AnsiString; + case NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE: return SettingValueType.String; + default: return SettingValueType.Dword; + } + } + + public static NVDRS_SETTING ConvertProfileSettingToDrsSetting(ProfileSetting setting) + { + var newSetting = new NVDRS_SETTING() + { + version = NvapiDrsWrapper.NVDRS_SETTING_VER, + settingId = setting.SettingId, + settingType = MapValueType(setting.ValueType), + settingLocation = NVDRS_SETTING_LOCATION.NVDRS_CURRENT_PROFILE_LOCATION, + currentValue = ConvertStringToSettingUnion(setting.ValueType, setting.SettingValue), + }; + return newSetting; + } + + private static NVDRS_SETTING_UNION ConvertStringToSettingUnion(SettingValueType valueType, string valueString) + { + var union = new NVDRS_SETTING_UNION(); + switch (valueType) + { + case SettingValueType.Dword: + union.dwordValue = uint.Parse(valueString); + break; + case SettingValueType.String: + union.stringValue = valueString; + break; + case SettingValueType.AnsiString: + union.ansiStringValue = valueString; + break; + case SettingValueType.Binary: + union.binaryValue = Convert.FromBase64String(valueString); + break; + default: + throw new Exception("invalid value type"); + } + return union; + } + + private static NVDRS_SETTING_TYPE MapValueType(SettingValueType input) + { + switch (input) + { + case SettingValueType.Binary: return NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE; + case SettingValueType.AnsiString: return NVDRS_SETTING_TYPE.NVDRS_STRING_TYPE; + case SettingValueType.String: return NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE; + default: return NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE; + } + } + + } +} diff --git a/ColorControl/nspector/Common/Import/Profile.cs b/ColorControl/nspector/Common/Import/Profile.cs new file mode 100644 index 0000000..2e76be1 --- /dev/null +++ b/ColorControl/nspector/Common/Import/Profile.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; + +namespace nspector.Common.Import +{ + [Serializable] + public class Profile + { + public string ProfileName = ""; + public List Executeables = new List(); + public List Settings = new List(); + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/Import/ProfileSetting.cs b/ColorControl/nspector/Common/Import/ProfileSetting.cs new file mode 100644 index 0000000..280f2ca --- /dev/null +++ b/ColorControl/nspector/Common/Import/ProfileSetting.cs @@ -0,0 +1,18 @@ +using System; +using System.Xml.Serialization; + +namespace nspector.Common.Import +{ + [Serializable] + public class ProfileSetting + { + public string SettingNameInfo = ""; + + [XmlElement(ElementName = "SettingID")] + public uint SettingId = 0; + + public string SettingValue = "0"; + + public SettingValueType ValueType = SettingValueType.Dword; + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/Import/Profiles.cs b/ColorControl/nspector/Common/Import/Profiles.cs new file mode 100644 index 0000000..0c865ec --- /dev/null +++ b/ColorControl/nspector/Common/Import/Profiles.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; + +namespace nspector.Common.Import +{ + [Serializable] + public class Profiles : List + { + + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/Import/SettingValueType.cs b/ColorControl/nspector/Common/Import/SettingValueType.cs new file mode 100644 index 0000000..be8fe56 --- /dev/null +++ b/ColorControl/nspector/Common/Import/SettingValueType.cs @@ -0,0 +1,10 @@ +namespace nspector.Common.Import +{ + public enum SettingValueType : int + { + Dword, + AnsiString, + String, + Binary + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/Meta/ConstantSettingMetaService.cs b/ColorControl/nspector/Common/Meta/ConstantSettingMetaService.cs new file mode 100644 index 0000000..522296a --- /dev/null +++ b/ColorControl/nspector/Common/Meta/ConstantSettingMetaService.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using nspector.Native.NvApi.DriverSettings; +using nspector.Native.NVAPI2; + +namespace nspector.Common.Meta +{ + internal class ConstantSettingMetaService : ISettingMetaService + { + + public ConstantSettingMetaService() + { + settingEnumTypeCache = CreateSettingEnumTypeCache(); + GetSettingIds(); + } + + private readonly Dictionary settingEnumTypeCache; + + private string[] ignoreSettingNames = new[] { "TOTAL_DWORD_SETTING_NUM", "TOTAL_WSTRING_SETTING_NUM", + "TOTAL_SETTING_NUM", "INVALID_SETTING_ID" }; + + private Dictionary CreateSettingEnumTypeCache() + { + var result = new Dictionary(); + + var drsEnumTypes = Assembly.GetExecutingAssembly().GetTypes() + .Where(t => t.Namespace == "nspector.Native.NvApi.DriverSettings" + && t.IsEnum && t.Name.StartsWith("EValues_")).ToList(); + + var settingIdNames = Enum.GetNames(typeof(ESetting)).Distinct().ToList(); + + foreach (var settingIdName in settingIdNames) + { + if (ignoreSettingNames.Contains(settingIdName)) + continue; + + var enumType = drsEnumTypes + .FirstOrDefault(x => settingIdName + .Substring(0, settingIdName.Length - 3) + .Equals(x.Name.Substring(8)) + ); + + if (enumType != null) + { + var settingIdVal = (ESetting)Enum.Parse(typeof(ESetting), settingIdName); + result.Add(settingIdVal, enumType); + } + } + + return result; + } + + public Type GetSettingEnumType(uint settingId) + { + if (settingEnumTypeCache.ContainsKey((ESetting)settingId)) + return settingEnumTypeCache[(ESetting)settingId]; + + return null; + } + + public NVDRS_SETTING_TYPE? GetSettingValueType(uint settingId) + { + return null; + } + + public string GetSettingName(uint settingId) + { + if (settingIds.Contains(settingId)) + return ((ESetting)settingId).ToString(); + + return null; + } + + public uint? GetDwordDefaultValue(uint settingId) + { + if (settingEnumTypeCache.ContainsKey((ESetting)settingId)) + { + var enumType = settingEnumTypeCache[(ESetting)settingId]; + + var defaultName = Enum.GetNames(enumType).FirstOrDefault(x => x.EndsWith("_DEFAULT")); + if (defaultName != null) + return (uint)Enum.Parse(enumType, defaultName); + } + return null; + } + + public string GetStringDefaultValue(uint settingId) + { + return null; + } + + public List> GetStringValues(uint settingId) + { + return null; + } + + private uint ParseEnumValue(Type enumType, string enumText) + { + try + { + return (uint)Enum.Parse(enumType, enumText); + } + catch (InvalidCastException) + { + var intValue = (int)Enum.Parse(enumType, enumText); + var bytes = BitConverter.GetBytes(intValue); + return BitConverter.ToUInt32(bytes, 0); + } + } + + public List> GetDwordValues(uint settingId) + { + if (settingEnumTypeCache.ContainsKey((ESetting)settingId)) + { + var enumType = settingEnumTypeCache[(ESetting)settingId]; + + var validNames = Enum.GetNames(enumType) + .Where(x => 1 == 1 + && !x.EndsWith("_DEFAULT") + && !x.EndsWith("_NUM_VALUES") + //&& !x.EndsWith("_NUM") + //&& !x.EndsWith("_MASK") + //&& (!x.EndsWith("_MIN") || x.Equals("PREFERRED_PSTATE_PREFER_MIN")) + //&& (!x.EndsWith("_MAX") || x.Equals("PREFERRED_PSTATE_PREFER_MAX")) + ).ToList(); + + return validNames.Select(x => new SettingValue(Source) + { + Value = ParseEnumValue(enumType, x), + ValueName = DrsUtil.GetDwordString(ParseEnumValue(enumType, x)) + " " + x + }).ToList(); + + } + return null; + } + + private HashSet settingIds; + public List GetSettingIds() + { + if (settingIds == null) + settingIds = new HashSet( + Enum.GetValues(typeof(ESetting)) + .Cast() + .Where(x => !ignoreSettingNames.Contains(x.ToString())) + .Cast() + .Distinct() + .ToList()); + + return settingIds.ToList(); + } + + + public string GetGroupName(uint settingId) + { + return null; + } + + public byte[] GetBinaryDefaultValue(uint settingId) + { + return null; + } + + public List> GetBinaryValues(uint settingId) + { + return null; + } + + public SettingMetaSource Source + { + get { return SettingMetaSource.ConstantSettings; } + } + } +} diff --git a/ColorControl/nspector/Common/Meta/CustomSettingMetaService.cs b/ColorControl/nspector/Common/Meta/CustomSettingMetaService.cs new file mode 100644 index 0000000..9bfeb6c --- /dev/null +++ b/ColorControl/nspector/Common/Meta/CustomSettingMetaService.cs @@ -0,0 +1,109 @@ +using nspector.Common.CustomSettings; +using nspector.Native.NVAPI2; +using System.Collections.Generic; +using System.Linq; + +namespace nspector.Common.Meta +{ + internal class CustomSettingMetaService : ISettingMetaService + { + + private readonly CustomSettingNames customSettings; + private readonly SettingMetaSource _source; + + public CustomSettingMetaService(CustomSettingNames customSettings, SettingMetaSource sourceOverride = SettingMetaSource.CustomSettings) + { + this.customSettings = customSettings; + _source = sourceOverride; + } + + public NVDRS_SETTING_TYPE? GetSettingValueType(uint settingId) + { + return null; + } + + public string GetSettingName(uint settingId) + { + var setting = customSettings.Settings + .FirstOrDefault(x => x.SettingId.Equals(settingId)); + + if (setting != null) + return setting.UserfriendlyName; + + return null; + } + + public uint? GetDwordDefaultValue(uint settingId) + { + var setting = customSettings.Settings + .FirstOrDefault(x => x.SettingId.Equals(settingId)); + + if (setting != null) + return setting.DefaultValue; + + return null; + } + + public string GetStringDefaultValue(uint settingId) + { + return null; + } + + public List> GetStringValues(uint settingId) + { + return null; + } + + public List> GetDwordValues(uint settingId) + { + var setting = customSettings.Settings + .FirstOrDefault(x => x.SettingId.Equals(settingId)); + + if (setting != null) + { + var i = 0; + return setting.SettingValues.Select(x => new SettingValue(Source) + { + ValuePos = i++, + Value = x.SettingValue, + ValueName = _source == SettingMetaSource.CustomSettings ? x.UserfriendlyName : DrsUtil.GetDwordString(x.SettingValue) + " " + x.UserfriendlyName, + }).ToList(); + } + + return null; + } + + public List GetSettingIds() + { + return customSettings.Settings + .Select(x => x.SettingId).ToList(); + } + + + public string GetGroupName(uint settingId) + { + var setting = customSettings.Settings + .FirstOrDefault(x => x.SettingId.Equals(settingId)); + + if (setting != null && !string.IsNullOrWhiteSpace(setting.GroupName)) + return setting.GroupName; + + return null; + } + + public byte[] GetBinaryDefaultValue(uint settingId) + { + return null; + } + + public List> GetBinaryValues(uint settingId) + { + return null; + } + + public SettingMetaSource Source + { + get { return _source; } + } + } +} diff --git a/ColorControl/nspector/Common/Meta/DriverSettingMetaService.cs b/ColorControl/nspector/Common/Meta/DriverSettingMetaService.cs new file mode 100644 index 0000000..f82e9e6 --- /dev/null +++ b/ColorControl/nspector/Common/Meta/DriverSettingMetaService.cs @@ -0,0 +1,222 @@ +using System.Collections.Generic; +using System.Text; +using nspector.Native.NVAPI2; +using nvw = nspector.Native.NVAPI2.NvapiDrsWrapper; + +namespace nspector.Common.Meta +{ + + internal class DriverSettingMetaService : ISettingMetaService + { + + private readonly Dictionary _settingMetaCache = new Dictionary(); + private readonly List _settingIds; + + public DriverSettingMetaService() + { + _settingIds = InitSettingIds(); + } + + private List InitSettingIds() + { + var settingIds = new List(); + + var nvRes = nvw.DRS_EnumAvailableSettingIds(out settingIds, 512); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_EnumAvailableSettingIds", nvRes); + + return settingIds; + } + + private SettingMeta GetDriverSettingMetaInternal(uint settingId) + { + var values = new NVDRS_SETTING_VALUES(); + values.version = nvw.NVDRS_SETTING_VALUES_VER; + uint valueCount = 255; + + var nvRes = nvw.DRS_EnumAvailableSettingValues(settingId, ref valueCount, ref values); + + if (nvRes == NvAPI_Status.NVAPI_SETTING_NOT_FOUND) + return null; + + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_EnumAvailableSettingValues", nvRes); + + + var sbSettingName = new StringBuilder((int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX); + nvRes = nvw.DRS_GetSettingNameFromId(settingId, sbSettingName); + if (nvRes != NvAPI_Status.NVAPI_OK) + throw new NvapiException("DRS_GetSettingNameFromId", nvRes); + + var settingName = sbSettingName.ToString(); + if (string.IsNullOrWhiteSpace(settingName)) + settingName = DrsUtil.GetDwordString(settingId); + + var result = new SettingMeta + { + SettingType = values.settingType, + SettingName = settingName, + }; + + + if (values.settingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE) + { + result.DefaultDwordValue = values.defaultValue.dwordValue; + result.DwordValues = new List>(); + for (int i = 0; i < values.numSettingValues; i++) + { + result.DwordValues.Add( + new SettingValue(Source) + { + Value = values.settingValues[i].dwordValue, + ValueName = DrsUtil.GetDwordString(values.settingValues[i].dwordValue), + }); + } + } + + if (values.settingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE) + { + result.DefaultStringValue = values.defaultValue.stringValue; + result.StringValues = new List>(); + for (int i = 0; i < values.numSettingValues; i++) + { + var strValue = values.settingValues[i].stringValue; + if (strValue != null) + { + result.StringValues.Add( + new SettingValue(Source) + { + Value = strValue, + ValueName = strValue, + }); + } + } + } + + if (values.settingType == NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE) + { + result.DefaultBinaryValue = values.defaultValue.binaryValue; + result.BinaryValues = new List>(); + for (int i = 0; i < values.numSettingValues; i++) + { + var binValue = values.settingValues[i].binaryValue; + if (binValue != null) + { + result.BinaryValues.Add( + new SettingValue(Source) + { + Value = binValue, + ValueName = DrsUtil.GetBinaryString(binValue), + }); + } + } + } + return result; + + } + + private SettingMeta GetSettingsMeta(uint settingId) + { + if (_settingMetaCache.ContainsKey(settingId)) + return _settingMetaCache[settingId]; + else + { + var settingMeta = GetDriverSettingMetaInternal(settingId); + if (settingMeta != null) + { + _settingMetaCache.Add(settingId, settingMeta); + return settingMeta; + } + + return null; + } + } + + public string GetSettingName(uint settingId) + { + var settingMeta = GetSettingsMeta(settingId); + if (settingMeta != null) + return settingMeta.SettingName; + + return null; + } + + public uint? GetDwordDefaultValue(uint settingId) + { + var settingMeta = GetSettingsMeta(settingId); + if (settingMeta != null) + return settingMeta.DefaultDwordValue; + + return null; + } + + public string GetStringDefaultValue(uint settingId) + { + var settingMeta = GetSettingsMeta(settingId); + if (settingMeta != null) + return settingMeta.DefaultStringValue; + + return null; + } + + public List> GetStringValues(uint settingId) + { + var settingMeta = GetSettingsMeta(settingId); + if (settingMeta != null) + return settingMeta.StringValues; + + return null; + } + + public List> GetDwordValues(uint settingId) + { + var settingMeta = GetSettingsMeta(settingId); + if (settingMeta != null) + return settingMeta.DwordValues; + + return null; + } + + public List GetSettingIds() + { + return _settingIds; + } + + public NVDRS_SETTING_TYPE? GetSettingValueType(uint settingId) + { + var settingMeta = GetSettingsMeta(settingId); + if (settingMeta != null) + return settingMeta.SettingType; + + return null; + } + + public string GetGroupName(uint settingId) + { + return null; + } + + public byte[] GetBinaryDefaultValue(uint settingId) + { + var settingMeta = GetSettingsMeta(settingId); + if (settingMeta != null) + return settingMeta.DefaultBinaryValue; + + return null; + } + + public List> GetBinaryValues(uint settingId) + { + var settingMeta = GetSettingsMeta(settingId); + if (settingMeta != null) + return settingMeta.BinaryValues; + + return null; + } + + public SettingMetaSource Source + { + get { return SettingMetaSource.DriverSettings; } + } + } +} diff --git a/ColorControl/nspector/Common/Meta/ISettingMetaService.cs b/ColorControl/nspector/Common/Meta/ISettingMetaService.cs new file mode 100644 index 0000000..24cc2d1 --- /dev/null +++ b/ColorControl/nspector/Common/Meta/ISettingMetaService.cs @@ -0,0 +1,33 @@ +using nspector.Native.NVAPI2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace nspector.Common.Meta +{ + internal interface ISettingMetaService + { + SettingMetaSource Source { get; } + + NVDRS_SETTING_TYPE? GetSettingValueType(uint settingId); + + string GetSettingName(uint settingId); + + string GetGroupName(uint settingId); + + uint? GetDwordDefaultValue(uint settingId); + + string GetStringDefaultValue(uint settingId); + + byte[] GetBinaryDefaultValue(uint settingId); + + List> GetStringValues(uint settingId); + + List> GetDwordValues(uint settingId); + + List> GetBinaryValues(uint settingId); + + List GetSettingIds(); + } +} diff --git a/ColorControl/nspector/Common/Meta/MetaServiceItem.cs b/ColorControl/nspector/Common/Meta/MetaServiceItem.cs new file mode 100644 index 0000000..ff83183 --- /dev/null +++ b/ColorControl/nspector/Common/Meta/MetaServiceItem.cs @@ -0,0 +1,8 @@ +namespace nspector.Common.Meta +{ + internal class MetaServiceItem + { + public ISettingMetaService Service { get; set; } + public uint ValueNamePrio { get; set; } + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Common/Meta/ScannedSettingMetaService.cs b/ColorControl/nspector/Common/Meta/ScannedSettingMetaService.cs new file mode 100644 index 0000000..a97ef92 --- /dev/null +++ b/ColorControl/nspector/Common/Meta/ScannedSettingMetaService.cs @@ -0,0 +1,108 @@ +using nspector.Native.NVAPI2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace nspector.Common.Meta +{ + internal class ScannedSettingMetaService : ISettingMetaService + { + private readonly List CachedSettings; + + public ScannedSettingMetaService(List cachedSettings) + { + CachedSettings = cachedSettings; + } + + public SettingMetaSource Source + { + get { return SettingMetaSource.ScannedSettings; } + } + + public NVDRS_SETTING_TYPE? GetSettingValueType(uint settingId) + { + var cached = CachedSettings.FirstOrDefault(x => x.SettingId.Equals(settingId)); + if (cached != null) + return cached.SettingType; + + return null; + } + + public string GetSettingName(uint settingId) + { + var cached = CachedSettings.FirstOrDefault(x => x.SettingId.Equals(settingId)); + if (cached != null) + return string.Format("0x{0:X8} ({1} Profiles)", settingId, cached.ProfileCount); + + return null; + } + + public string GetGroupName(uint settingId) + { + return null; + } + + public uint? GetDwordDefaultValue(uint settingId) + { + return null; + } + + public string GetStringDefaultValue(uint settingId) + { + return null; + } + + public List> GetStringValues(uint settingId) + { + var cached = CachedSettings.FirstOrDefault(x => x.SettingId.Equals(settingId)); + if (cached != null) + return cached.SettingValues.Select(s => new SettingValue(Source) + { + Value = s.ValueStr, + ValueName = string.Format("'{0}' ({1})", s.ValueStr.Trim(), s.ProfileNames), + + }).ToList(); + + return null; + } + + public List> GetDwordValues(uint settingId) + { + var cached = CachedSettings.FirstOrDefault(x => x.SettingId.Equals(settingId)); + if (cached != null) + return cached.SettingValues.Select(s => new SettingValue(Source) + { + Value = s.Value, + ValueName = string.Format("0x{0:X8} ({1})", s.Value, s.ProfileNames), + + }).ToList(); + + return null; + } + + public List GetSettingIds() + { + return CachedSettings.Select(c => c.SettingId).ToList(); + } + + public byte[] GetBinaryDefaultValue(uint settingId) + { + return null; + } + + public List> GetBinaryValues(uint settingId) + { + var cached = CachedSettings.FirstOrDefault(x => x.SettingId.Equals(settingId)); + if (cached != null) + return cached.SettingValues.Select(s => new SettingValue(Source) + { + Value = s.ValueBin, + ValueName = string.Format("{0} ({1})", DrsUtil.GetBinaryString(s.ValueBin), s.ProfileNames), + + }).ToList(); + + return null; + } + } +} diff --git a/ColorControl/nspector/Common/Meta/SettingMeta.cs b/ColorControl/nspector/Common/Meta/SettingMeta.cs new file mode 100644 index 0000000..1453720 --- /dev/null +++ b/ColorControl/nspector/Common/Meta/SettingMeta.cs @@ -0,0 +1,28 @@ +using nspector.Native.NVAPI2; +using System.Collections.Generic; + +namespace nspector.Common.Meta +{ + internal class SettingMeta + { + public NVDRS_SETTING_TYPE? SettingType { get; set; } + + public string GroupName { get; set; } + + public string SettingName { get; set; } + + public string DefaultStringValue { get; set; } + + public uint DefaultDwordValue { get; set; } + + public byte[] DefaultBinaryValue { get; set; } + + public bool IsApiExposed { get; set; } + + public List> StringValues { get; set; } + + public List> DwordValues { get; set; } + + public List> BinaryValues { get; set; } + } +} diff --git a/ColorControl/nspector/Common/Meta/SettingMetaSource.cs b/ColorControl/nspector/Common/Meta/SettingMetaSource.cs new file mode 100644 index 0000000..3be65f7 --- /dev/null +++ b/ColorControl/nspector/Common/Meta/SettingMetaSource.cs @@ -0,0 +1,11 @@ +namespace nspector.Common.Meta +{ + public enum SettingMetaSource + { + CustomSettings = 10, + DriverSettings = 20, + ConstantSettings = 30, + ReferenceSettings = 40, + ScannedSettings = 50, + } +} diff --git a/ColorControl/nspector/Common/Meta/SettingValue.cs b/ColorControl/nspector/Common/Meta/SettingValue.cs new file mode 100644 index 0000000..6891baf --- /dev/null +++ b/ColorControl/nspector/Common/Meta/SettingValue.cs @@ -0,0 +1,26 @@ +namespace nspector.Common.Meta +{ + internal class SettingValue + { + + public SettingMetaSource ValueSource; + + public SettingValue(SettingMetaSource source) + { + ValueSource = source; + } + + public int ValuePos { get; set; } + public string ValueName { get; set; } + public T Value { get; set; } + + public override string ToString() + { + if (typeof(T) == typeof(uint)) + return string.Format("Value=0x{0:X8}; ValueName={1}; Source={2};", Value, ValueName, ValueSource); + + return string.Format("Value={0}; ValueName={1};", Value, ValueName); + } + + } +} diff --git a/ColorControl/nspector/Common/NvapiException.cs b/ColorControl/nspector/Common/NvapiException.cs new file mode 100644 index 0000000..8015f31 --- /dev/null +++ b/ColorControl/nspector/Common/NvapiException.cs @@ -0,0 +1,29 @@ +using System; +using nspector.Native.NVAPI2; + +namespace nspector.Common +{ + public class NvapiException : Exception + { + public readonly NvAPI_Status Status; + + public NvapiException(string function, NvAPI_Status status) + : base(function + " failed: " + status) + { + Status = status; + } + + } + + public class NvapiAddApplicationException : NvapiException + { + public readonly string ApplicationName; + + public NvapiAddApplicationException(string applicationName) + : base("DRS_CreateApplication", NvAPI_Status.NVAPI_EXECUTABLE_ALREADY_IN_USE) + { + ApplicationName = applicationName; + } + + } +} diff --git a/ColorControl/nspector/Common/SettingItem.cs b/ColorControl/nspector/Common/SettingItem.cs new file mode 100644 index 0000000..3e9cb04 --- /dev/null +++ b/ColorControl/nspector/Common/SettingItem.cs @@ -0,0 +1,36 @@ +namespace nspector.Common +{ + + internal enum SettingState + { + NotAssiged, + GlobalSetting, + UserdefinedSetting, + NvidiaSetting, + } + + internal class SettingItem + { + public uint SettingId { get; set; } + + public string SettingText { get; set; } + + public string ValueText { get; set; } + + public string ValueRaw { get; set; } + + public string GroupName { get; set; } + + public SettingState State { get; set; } + + public bool IsStringValue { get; set; } + + public bool IsApiExposed { get; set; } + + public override string ToString() + { + return string.Format("{0}; 0x{1:X8}; {2}; {3}; {4};", State, SettingId, SettingText, ValueText, ValueRaw); + } + + } +} diff --git a/ColorControl/nspector/Common/SettingViewMode.cs b/ColorControl/nspector/Common/SettingViewMode.cs new file mode 100644 index 0000000..d7b2316 --- /dev/null +++ b/ColorControl/nspector/Common/SettingViewMode.cs @@ -0,0 +1,9 @@ +namespace nspector.Common +{ + public enum SettingViewMode + { + Normal, + IncludeScannedSetttings, + CustomSettingsOnly, + } +} diff --git a/ColorControl/nspector/CustomSettingNames.xml b/ColorControl/nspector/CustomSettingNames.xml new file mode 100644 index 0000000..d4e6c7e --- /dev/null +++ b/ColorControl/nspector/CustomSettingNames.xml @@ -0,0 +1,8308 @@ + + + + + SLI CFR Mode + 0x20343843 + 6 - SLI + + + + + Frame Rate Limiter V3 + 0x10835002 + 441.87 + 2 - Sync and Refresh + + + Off + 0x00000000 + + + 20 FPS + 0x00000014 + + + 21 FPS + 0x00000015 + + + 22 FPS + 0x00000016 + + + 23 FPS + 0x00000017 + + + 24 FPS + 0x00000018 + + + 25 FPS + 0x00000019 + + + 26 FPS + 0x0000001A + + + 27 FPS + 0x0000001B + + + 28 FPS + 0x0000001C + + + 29 FPS + 0x0000001D + + + 30 FPS + 0x0000001E + + + 31 FPS + 0x0000001F + + + 32 FPS + 0x00000020 + + + 33 FPS + 0x00000021 + + + 34 FPS + 0x00000022 + + + 35 FPS + 0x00000023 + + + 36 FPS + 0x00000024 + + + 37 FPS + 0x00000025 + + + 38 FPS + 0x00000026 + + + 39 FPS + 0x00000027 + + + 40 FPS + 0x00000028 + + + 41 FPS + 0x00000029 + + + 42 FPS + 0x0000002A + + + 43 FPS + 0x0000002B + + + 44 FPS + 0x0000002C + + + 45 FPS + 0x0000002D + + + 46 FPS + 0x0000002E + + + 47 FPS + 0x0000002F + + + 48 FPS + 0x00000030 + + + 49 FPS + 0x00000031 + + + 50 FPS + 0x00000032 + + + 51 FPS + 0x00000033 + + + 52 FPS + 0x00000034 + + + 53 FPS + 0x00000035 + + + 54 FPS + 0x00000036 + + + 55 FPS + 0x00000037 + + + 56 FPS + 0x00000038 + + + 57 FPS + 0x00000039 + + + 58 FPS + 0x0000003A + + + 59 FPS + 0x0000003B + + + 60 FPS + 0x0000003C + + + 61 FPS + 0x0000003D + + + 62 FPS + 0x0000003E + + + 63 FPS + 0x0000003F + + + 64 FPS + 0x00000040 + + + 65 FPS + 0x00000041 + + + 66 FPS + 0x00000042 + + + 67 FPS + 0x00000043 + + + 68 FPS + 0x00000044 + + + 69 FPS + 0x00000045 + + + 70 FPS + 0x00000046 + + + 71 FPS + 0x00000047 + + + 72 FPS + 0x00000048 + + + 73 FPS + 0x00000049 + + + 74 FPS + 0x0000004A + + + 75 FPS + 0x0000004B + + + 76 FPS + 0x0000004C + + + 77 FPS + 0x0000004D + + + 78 FPS + 0x0000004E + + + 79 FPS + 0x0000004F + + + 80 FPS + 0x00000050 + + + 81 FPS + 0x00000051 + + + 82 FPS + 0x00000052 + + + 83 FPS + 0x00000053 + + + 84 FPS + 0x00000054 + + + 85 FPS + 0x00000055 + + + 86 FPS + 0x00000056 + + + 87 FPS + 0x00000057 + + + 88 FPS + 0x00000058 + + + 89 FPS + 0x00000059 + + + 90 FPS + 0x0000005A + + + 91 FPS + 0x0000005B + + + 92 FPS + 0x0000005C + + + 93 FPS + 0x0000005D + + + 94 FPS + 0x0000005E + + + 95 FPS + 0x0000005F + + + 96 FPS + 0x00000060 + + + 97 FPS + 0x00000061 + + + 98 FPS + 0x00000062 + + + 99 FPS + 0x00000063 + + + 100 FPS + 0x00000064 + + + 101 FPS + 0x00000065 + + + 102 FPS + 0x00000066 + + + 103 FPS + 0x00000067 + + + 104 FPS + 0x00000068 + + + 105 FPS + 0x00000069 + + + 106 FPS + 0x0000006A + + + 107 FPS + 0x0000006B + + + 108 FPS + 0x0000006C + + + 109 FPS + 0x0000006D + + + 110 FPS + 0x0000006E + + + 111 FPS + 0x0000006F + + + 112 FPS + 0x00000070 + + + 113 FPS + 0x00000071 + + + 114 FPS + 0x00000072 + + + 115 FPS + 0x00000073 + + + 116 FPS + 0x00000074 + + + 117 FPS + 0x00000075 + + + 118 FPS + 0x00000076 + + + 119 FPS + 0x00000077 + + + 120 FPS + 0x00000078 + + + 121 FPS + 0x00000079 + + + 122 FPS + 0x0000007A + + + 123 FPS + 0x0000007B + + + 124 FPS + 0x0000007C + + + 125 FPS + 0x0000007D + + + 126 FPS + 0x0000007E + + + 127 FPS + 0x0000007F + + + 128 FPS + 0x00000080 + + + 129 FPS + 0x00000081 + + + 130 FPS + 0x00000082 + + + 131 FPS + 0x00000083 + + + 132 FPS + 0x00000084 + + + 133 FPS + 0x00000085 + + + 134 FPS + 0x00000086 + + + 135 FPS + 0x00000087 + + + 136 FPS + 0x00000088 + + + 137 FPS + 0x00000089 + + + 138 FPS + 0x0000008A + + + 139 FPS + 0x0000008B + + + 140 FPS + 0x0000008C + + + 141 FPS + 0x0000008D + + + 142 FPS + 0x0000008E + + + 143 FPS + 0x0000008F + + + 144 FPS + 0x00000090 + + + 145 FPS + 0x00000091 + + + 146 FPS + 0x00000092 + + + 147 FPS + 0x00000093 + + + 148 FPS + 0x00000094 + + + 149 FPS + 0x00000095 + + + 150 FPS + 0x00000096 + + + 151 FPS + 0x00000097 + + + 152 FPS + 0x00000098 + + + 153 FPS + 0x00000099 + + + 154 FPS + 0x0000009A + + + 155 FPS + 0x0000009B + + + 156 FPS + 0x0000009C + + + 157 FPS + 0x0000009D + + + 158 FPS + 0x0000009E + + + 159 FPS + 0x0000009F + + + 160 FPS + 0x000000A0 + + + 161 FPS + 0x000000A1 + + + 162 FPS + 0x000000A2 + + + 163 FPS + 0x000000A3 + + + 164 FPS + 0x000000A4 + + + 165 FPS + 0x000000A5 + + + 166 FPS + 0x000000A6 + + + 167 FPS + 0x000000A7 + + + 168 FPS + 0x000000A8 + + + 169 FPS + 0x000000A9 + + + 170 FPS + 0x000000AA + + + 171 FPS + 0x000000AB + + + 172 FPS + 0x000000AC + + + 173 FPS + 0x000000AD + + + 174 FPS + 0x000000AE + + + 175 FPS + 0x000000AF + + + 176 FPS + 0x000000B0 + + + 177 FPS + 0x000000B1 + + + 178 FPS + 0x000000B2 + + + 179 FPS + 0x000000B3 + + + 180 FPS + 0x000000B4 + + + 181 FPS + 0x000000B5 + + + 182 FPS + 0x000000B6 + + + 183 FPS + 0x000000B7 + + + 184 FPS + 0x000000B8 + + + 185 FPS + 0x000000B9 + + + 186 FPS + 0x000000BA + + + 187 FPS + 0x000000BB + + + 188 FPS + 0x000000BC + + + 189 FPS + 0x000000BD + + + 190 FPS + 0x000000BE + + + 191 FPS + 0x000000BF + + + 192 FPS + 0x000000C0 + + + 193 FPS + 0x000000C1 + + + 194 FPS + 0x000000C2 + + + 195 FPS + 0x000000C3 + + + 196 FPS + 0x000000C4 + + + 197 FPS + 0x000000C5 + + + 198 FPS + 0x000000C6 + + + 199 FPS + 0x000000C7 + + + 200 FPS + 0x000000C8 + + + 201 FPS + 0x000000C9 + + + 202 FPS + 0x000000CA + + + 203 FPS + 0x000000CB + + + 204 FPS + 0x000000CC + + + 205 FPS + 0x000000CD + + + 206 FPS + 0x000000CE + + + 207 FPS + 0x000000CF + + + 208 FPS + 0x000000D0 + + + 209 FPS + 0x000000D1 + + + 210 FPS + 0x000000D2 + + + 211 FPS + 0x000000D3 + + + 212 FPS + 0x000000D4 + + + 213 FPS + 0x000000D5 + + + 214 FPS + 0x000000D6 + + + 215 FPS + 0x000000D7 + + + 216 FPS + 0x000000D8 + + + 217 FPS + 0x000000D9 + + + 218 FPS + 0x000000DA + + + 219 FPS + 0x000000DB + + + 220 FPS + 0x000000DC + + + 221 FPS + 0x000000DD + + + 222 FPS + 0x000000DE + + + 223 FPS + 0x000000DF + + + 224 FPS + 0x000000E0 + + + 225 FPS + 0x000000E1 + + + 226 FPS + 0x000000E2 + + + 227 FPS + 0x000000E3 + + + 228 FPS + 0x000000E4 + + + 229 FPS + 0x000000E5 + + + 230 FPS + 0x000000E6 + + + 231 FPS + 0x000000E7 + + + 232 FPS + 0x000000E8 + + + 233 FPS + 0x000000E9 + + + 234 FPS + 0x000000EA + + + 235 FPS + 0x000000EB + + + 236 FPS + 0x000000EC + + + 237 FPS + 0x000000ED + + + 238 FPS + 0x000000EE + + + 239 FPS + 0x000000EF + + + 240 FPS + 0x000000F0 + + + 241 FPS + 0x000000F1 + + + 242 FPS + 0x000000F2 + + + 243 FPS + 0x000000F3 + + + 244 FPS + 0x000000F4 + + + 245 FPS + 0x000000F5 + + + 246 FPS + 0x000000F6 + + + 247 FPS + 0x000000F7 + + + 248 FPS + 0x000000F8 + + + 249 FPS + 0x000000F9 + + + 250 FPS + 0x000000FA + + + 251 FPS + 0x000000FB + + + 252 FPS + 0x000000FC + + + 253 FPS + 0x000000FD + + + 254 FPS + 0x000000FE + + + 255 FPS + 0x000000FF + + + 256 FPS + 0x00000100 + + + 257 FPS + 0x00000101 + + + 258 FPS + 0x00000102 + + + 259 FPS + 0x00000103 + + + 260 FPS + 0x00000104 + + + 261 FPS + 0x00000105 + + + 262 FPS + 0x00000106 + + + 263 FPS + 0x00000107 + + + 264 FPS + 0x00000108 + + + 265 FPS + 0x00000109 + + + 266 FPS + 0x0000010A + + + 267 FPS + 0x0000010B + + + 268 FPS + 0x0000010C + + + 269 FPS + 0x0000010D + + + 270 FPS + 0x0000010E + + + 271 FPS + 0x0000010F + + + 272 FPS + 0x00000110 + + + 273 FPS + 0x00000111 + + + 274 FPS + 0x00000112 + + + 275 FPS + 0x00000113 + + + 276 FPS + 0x00000114 + + + 277 FPS + 0x00000115 + + + 278 FPS + 0x00000116 + + + 279 FPS + 0x00000117 + + + 280 FPS + 0x00000118 + + + 281 FPS + 0x00000119 + + + 282 FPS + 0x0000011A + + + 283 FPS + 0x0000011B + + + 284 FPS + 0x0000011C + + + 285 FPS + 0x0000011D + + + 286 FPS + 0x0000011E + + + 287 FPS + 0x0000011F + + + 288 FPS + 0x00000120 + + + 289 FPS + 0x00000121 + + + 290 FPS + 0x00000122 + + + 291 FPS + 0x00000123 + + + 292 FPS + 0x00000124 + + + 293 FPS + 0x00000125 + + + 294 FPS + 0x00000126 + + + 295 FPS + 0x00000127 + + + 296 FPS + 0x00000128 + + + 297 FPS + 0x00000129 + + + 298 FPS + 0x0000012A + + + 299 FPS + 0x0000012B + + + 300 FPS + 0x0000012C + + + 301 FPS + 0x0000012D + + + 302 FPS + 0x0000012E + + + 303 FPS + 0x0000012F + + + 304 FPS + 0x00000130 + + + 305 FPS + 0x00000131 + + + 306 FPS + 0x00000132 + + + 307 FPS + 0x00000133 + + + 308 FPS + 0x00000134 + + + 309 FPS + 0x00000135 + + + 310 FPS + 0x00000136 + + + 311 FPS + 0x00000137 + + + 312 FPS + 0x00000138 + + + 313 FPS + 0x00000139 + + + 314 FPS + 0x0000013A + + + 315 FPS + 0x0000013B + + + 316 FPS + 0x0000013C + + + 317 FPS + 0x0000013D + + + 318 FPS + 0x0000013E + + + 319 FPS + 0x0000013F + + + 320 FPS + 0x00000140 + + + 321 FPS + 0x00000141 + + + 322 FPS + 0x00000142 + + + 323 FPS + 0x00000143 + + + 324 FPS + 0x00000144 + + + 325 FPS + 0x00000145 + + + 326 FPS + 0x00000146 + + + 327 FPS + 0x00000147 + + + 328 FPS + 0x00000148 + + + 329 FPS + 0x00000149 + + + 330 FPS + 0x0000014A + + + 331 FPS + 0x0000014B + + + 332 FPS + 0x0000014C + + + 333 FPS + 0x0000014D + + + 334 FPS + 0x0000014E + + + 335 FPS + 0x0000014F + + + 336 FPS + 0x00000150 + + + 337 FPS + 0x00000151 + + + 338 FPS + 0x00000152 + + + 339 FPS + 0x00000153 + + + 340 FPS + 0x00000154 + + + 341 FPS + 0x00000155 + + + 342 FPS + 0x00000156 + + + 343 FPS + 0x00000157 + + + 344 FPS + 0x00000158 + + + 345 FPS + 0x00000159 + + + 346 FPS + 0x0000015A + + + 347 FPS + 0x0000015B + + + 348 FPS + 0x0000015C + + + 349 FPS + 0x0000015D + + + 350 FPS + 0x0000015E + + + 351 FPS + 0x0000015F + + + 352 FPS + 0x00000160 + + + 353 FPS + 0x00000161 + + + 354 FPS + 0x00000162 + + + 355 FPS + 0x00000163 + + + 356 FPS + 0x00000164 + + + 357 FPS + 0x00000165 + + + 358 FPS + 0x00000166 + + + 359 FPS + 0x00000167 + + + 360 FPS + 0x00000168 + + + 361 FPS + 0x00000169 + + + 362 FPS + 0x0000016A + + + 363 FPS + 0x0000016B + + + 364 FPS + 0x0000016C + + + 365 FPS + 0x0000016D + + + 366 FPS + 0x0000016E + + + 367 FPS + 0x0000016F + + + 368 FPS + 0x00000170 + + + 369 FPS + 0x00000171 + + + 370 FPS + 0x00000172 + + + 371 FPS + 0x00000173 + + + 372 FPS + 0x00000174 + + + 373 FPS + 0x00000175 + + + 374 FPS + 0x00000176 + + + 375 FPS + 0x00000177 + + + 376 FPS + 0x00000178 + + + 377 FPS + 0x00000179 + + + 378 FPS + 0x0000017A + + + 379 FPS + 0x0000017B + + + 380 FPS + 0x0000017C + + + 381 FPS + 0x0000017D + + + 382 FPS + 0x0000017E + + + 383 FPS + 0x0000017F + + + 384 FPS + 0x00000180 + + + 385 FPS + 0x00000181 + + + 386 FPS + 0x00000182 + + + 387 FPS + 0x00000183 + + + 388 FPS + 0x00000184 + + + 389 FPS + 0x00000185 + + + 390 FPS + 0x00000186 + + + 391 FPS + 0x00000187 + + + 392 FPS + 0x00000188 + + + 393 FPS + 0x00000189 + + + 394 FPS + 0x0000018A + + + 395 FPS + 0x0000018B + + + 396 FPS + 0x0000018C + + + 397 FPS + 0x0000018D + + + 398 FPS + 0x0000018E + + + 399 FPS + 0x0000018F + + + 400 FPS + 0x00000190 + + + 401 FPS + 0x00000191 + + + 402 FPS + 0x00000192 + + + 403 FPS + 0x00000193 + + + 404 FPS + 0x00000194 + + + 405 FPS + 0x00000195 + + + 406 FPS + 0x00000196 + + + 407 FPS + 0x00000197 + + + 408 FPS + 0x00000198 + + + 409 FPS + 0x00000199 + + + 410 FPS + 0x0000019A + + + 411 FPS + 0x0000019B + + + 412 FPS + 0x0000019C + + + 413 FPS + 0x0000019D + + + 414 FPS + 0x0000019E + + + 415 FPS + 0x0000019F + + + 416 FPS + 0x000001A0 + + + 417 FPS + 0x000001A1 + + + 418 FPS + 0x000001A2 + + + 419 FPS + 0x000001A3 + + + 420 FPS + 0x000001A4 + + + 421 FPS + 0x000001A5 + + + 422 FPS + 0x000001A6 + + + 423 FPS + 0x000001A7 + + + 424 FPS + 0x000001A8 + + + 425 FPS + 0x000001A9 + + + 426 FPS + 0x000001AA + + + 427 FPS + 0x000001AB + + + 428 FPS + 0x000001AC + + + 429 FPS + 0x000001AD + + + 430 FPS + 0x000001AE + + + 431 FPS + 0x000001AF + + + 432 FPS + 0x000001B0 + + + 433 FPS + 0x000001B1 + + + 434 FPS + 0x000001B2 + + + 435 FPS + 0x000001B3 + + + 436 FPS + 0x000001B4 + + + 437 FPS + 0x000001B5 + + + 438 FPS + 0x000001B6 + + + 439 FPS + 0x000001B7 + + + 440 FPS + 0x000001B8 + + + 441 FPS + 0x000001B9 + + + 442 FPS + 0x000001BA + + + 443 FPS + 0x000001BB + + + 444 FPS + 0x000001BC + + + 445 FPS + 0x000001BD + + + 446 FPS + 0x000001BE + + + 447 FPS + 0x000001BF + + + 448 FPS + 0x000001C0 + + + 449 FPS + 0x000001C1 + + + 450 FPS + 0x000001C2 + + + 451 FPS + 0x000001C3 + + + 452 FPS + 0x000001C4 + + + 453 FPS + 0x000001C5 + + + 454 FPS + 0x000001C6 + + + 455 FPS + 0x000001C7 + + + 456 FPS + 0x000001C8 + + + 457 FPS + 0x000001C9 + + + 458 FPS + 0x000001CA + + + 459 FPS + 0x000001CB + + + 460 FPS + 0x000001CC + + + 461 FPS + 0x000001CD + + + 462 FPS + 0x000001CE + + + 463 FPS + 0x000001CF + + + 464 FPS + 0x000001D0 + + + 465 FPS + 0x000001D1 + + + 466 FPS + 0x000001D2 + + + 467 FPS + 0x000001D3 + + + 468 FPS + 0x000001D4 + + + 469 FPS + 0x000001D5 + + + 470 FPS + 0x000001D6 + + + 471 FPS + 0x000001D7 + + + 472 FPS + 0x000001D8 + + + 473 FPS + 0x000001D9 + + + 474 FPS + 0x000001DA + + + 475 FPS + 0x000001DB + + + 476 FPS + 0x000001DC + + + 477 FPS + 0x000001DD + + + 478 FPS + 0x000001DE + + + 479 FPS + 0x000001DF + + + 480 FPS + 0x000001E0 + + + 481 FPS + 0x000001E1 + + + 482 FPS + 0x000001E2 + + + 483 FPS + 0x000001E3 + + + 484 FPS + 0x000001E4 + + + 485 FPS + 0x000001E5 + + + 486 FPS + 0x000001E6 + + + 487 FPS + 0x000001E7 + + + 488 FPS + 0x000001E8 + + + 489 FPS + 0x000001E9 + + + 490 FPS + 0x000001EA + + + 491 FPS + 0x000001EB + + + 492 FPS + 0x000001EC + + + 493 FPS + 0x000001ED + + + 494 FPS + 0x000001EE + + + 495 FPS + 0x000001EF + + + 496 FPS + 0x000001F0 + + + 497 FPS + 0x000001F1 + + + 498 FPS + 0x000001F2 + + + 499 FPS + 0x000001F3 + + + 500 FPS + 0x000001F4 + + + 501 FPS + 0x000001F5 + + + 502 FPS + 0x000001F6 + + + 503 FPS + 0x000001F7 + + + 504 FPS + 0x000001F8 + + + 505 FPS + 0x000001F9 + + + 506 FPS + 0x000001FA + + + 507 FPS + 0x000001FB + + + 508 FPS + 0x000001FC + + + 509 FPS + 0x000001FD + + + 510 FPS + 0x000001FE + + + 511 FPS + 0x000001FF + + + 512 FPS + 0x00000200 + + + 513 FPS + 0x00000201 + + + 514 FPS + 0x00000202 + + + 515 FPS + 0x00000203 + + + 516 FPS + 0x00000204 + + + 517 FPS + 0x00000205 + + + 518 FPS + 0x00000206 + + + 519 FPS + 0x00000207 + + + 520 FPS + 0x00000208 + + + 521 FPS + 0x00000209 + + + 522 FPS + 0x0000020A + + + 523 FPS + 0x0000020B + + + 524 FPS + 0x0000020C + + + 525 FPS + 0x0000020D + + + 526 FPS + 0x0000020E + + + 527 FPS + 0x0000020F + + + 528 FPS + 0x00000210 + + + 529 FPS + 0x00000211 + + + 530 FPS + 0x00000212 + + + 531 FPS + 0x00000213 + + + 532 FPS + 0x00000214 + + + 533 FPS + 0x00000215 + + + 534 FPS + 0x00000216 + + + 535 FPS + 0x00000217 + + + 536 FPS + 0x00000218 + + + 537 FPS + 0x00000219 + + + 538 FPS + 0x0000021A + + + 539 FPS + 0x0000021B + + + 540 FPS + 0x0000021C + + + 541 FPS + 0x0000021D + + + 542 FPS + 0x0000021E + + + 543 FPS + 0x0000021F + + + 544 FPS + 0x00000220 + + + 545 FPS + 0x00000221 + + + 546 FPS + 0x00000222 + + + 547 FPS + 0x00000223 + + + 548 FPS + 0x00000224 + + + 549 FPS + 0x00000225 + + + 550 FPS + 0x00000226 + + + 551 FPS + 0x00000227 + + + 552 FPS + 0x00000228 + + + 553 FPS + 0x00000229 + + + 554 FPS + 0x0000022A + + + 555 FPS + 0x0000022B + + + 556 FPS + 0x0000022C + + + 557 FPS + 0x0000022D + + + 558 FPS + 0x0000022E + + + 559 FPS + 0x0000022F + + + 560 FPS + 0x00000230 + + + 561 FPS + 0x00000231 + + + 562 FPS + 0x00000232 + + + 563 FPS + 0x00000233 + + + 564 FPS + 0x00000234 + + + 565 FPS + 0x00000235 + + + 566 FPS + 0x00000236 + + + 567 FPS + 0x00000237 + + + 568 FPS + 0x00000238 + + + 569 FPS + 0x00000239 + + + 570 FPS + 0x0000023A + + + 571 FPS + 0x0000023B + + + 572 FPS + 0x0000023C + + + 573 FPS + 0x0000023D + + + 574 FPS + 0x0000023E + + + 575 FPS + 0x0000023F + + + 576 FPS + 0x00000240 + + + 577 FPS + 0x00000241 + + + 578 FPS + 0x00000242 + + + 579 FPS + 0x00000243 + + + 580 FPS + 0x00000244 + + + 581 FPS + 0x00000245 + + + 582 FPS + 0x00000246 + + + 583 FPS + 0x00000247 + + + 584 FPS + 0x00000248 + + + 585 FPS + 0x00000249 + + + 586 FPS + 0x0000024A + + + 587 FPS + 0x0000024B + + + 588 FPS + 0x0000024C + + + 589 FPS + 0x0000024D + + + 590 FPS + 0x0000024E + + + 591 FPS + 0x0000024F + + + 592 FPS + 0x00000250 + + + 593 FPS + 0x00000251 + + + 594 FPS + 0x00000252 + + + 595 FPS + 0x00000253 + + + 596 FPS + 0x00000254 + + + 597 FPS + 0x00000255 + + + 598 FPS + 0x00000256 + + + 599 FPS + 0x00000257 + + + 600 FPS + 0x00000258 + + + 601 FPS + 0x00000259 + + + 602 FPS + 0x0000025A + + + 603 FPS + 0x0000025B + + + 604 FPS + 0x0000025C + + + 605 FPS + 0x0000025D + + + 606 FPS + 0x0000025E + + + 607 FPS + 0x0000025F + + + 608 FPS + 0x00000260 + + + 609 FPS + 0x00000261 + + + 610 FPS + 0x00000262 + + + 611 FPS + 0x00000263 + + + 612 FPS + 0x00000264 + + + 613 FPS + 0x00000265 + + + 614 FPS + 0x00000266 + + + 615 FPS + 0x00000267 + + + 616 FPS + 0x00000268 + + + 617 FPS + 0x00000269 + + + 618 FPS + 0x0000026A + + + 619 FPS + 0x0000026B + + + 620 FPS + 0x0000026C + + + 621 FPS + 0x0000026D + + + 622 FPS + 0x0000026E + + + 623 FPS + 0x0000026F + + + 624 FPS + 0x00000270 + + + 625 FPS + 0x00000271 + + + 626 FPS + 0x00000272 + + + 627 FPS + 0x00000273 + + + 628 FPS + 0x00000274 + + + 629 FPS + 0x00000275 + + + 630 FPS + 0x00000276 + + + 631 FPS + 0x00000277 + + + 632 FPS + 0x00000278 + + + 633 FPS + 0x00000279 + + + 634 FPS + 0x0000027A + + + 635 FPS + 0x0000027B + + + 636 FPS + 0x0000027C + + + 637 FPS + 0x0000027D + + + 638 FPS + 0x0000027E + + + 639 FPS + 0x0000027F + + + 640 FPS + 0x00000280 + + + 641 FPS + 0x00000281 + + + 642 FPS + 0x00000282 + + + 643 FPS + 0x00000283 + + + 644 FPS + 0x00000284 + + + 645 FPS + 0x00000285 + + + 646 FPS + 0x00000286 + + + 647 FPS + 0x00000287 + + + 648 FPS + 0x00000288 + + + 649 FPS + 0x00000289 + + + 650 FPS + 0x0000028A + + + 651 FPS + 0x0000028B + + + 652 FPS + 0x0000028C + + + 653 FPS + 0x0000028D + + + 654 FPS + 0x0000028E + + + 655 FPS + 0x0000028F + + + 656 FPS + 0x00000290 + + + 657 FPS + 0x00000291 + + + 658 FPS + 0x00000292 + + + 659 FPS + 0x00000293 + + + 660 FPS + 0x00000294 + + + 661 FPS + 0x00000295 + + + 662 FPS + 0x00000296 + + + 663 FPS + 0x00000297 + + + 664 FPS + 0x00000298 + + + 665 FPS + 0x00000299 + + + 666 FPS + 0x0000029A + + + 667 FPS + 0x0000029B + + + 668 FPS + 0x0000029C + + + 669 FPS + 0x0000029D + + + 670 FPS + 0x0000029E + + + 671 FPS + 0x0000029F + + + 672 FPS + 0x000002A0 + + + 673 FPS + 0x000002A1 + + + 674 FPS + 0x000002A2 + + + 675 FPS + 0x000002A3 + + + 676 FPS + 0x000002A4 + + + 677 FPS + 0x000002A5 + + + 678 FPS + 0x000002A6 + + + 679 FPS + 0x000002A7 + + + 680 FPS + 0x000002A8 + + + 681 FPS + 0x000002A9 + + + 682 FPS + 0x000002AA + + + 683 FPS + 0x000002AB + + + 684 FPS + 0x000002AC + + + 685 FPS + 0x000002AD + + + 686 FPS + 0x000002AE + + + 687 FPS + 0x000002AF + + + 688 FPS + 0x000002B0 + + + 689 FPS + 0x000002B1 + + + 690 FPS + 0x000002B2 + + + 691 FPS + 0x000002B3 + + + 692 FPS + 0x000002B4 + + + 693 FPS + 0x000002B5 + + + 694 FPS + 0x000002B6 + + + 695 FPS + 0x000002B7 + + + 696 FPS + 0x000002B8 + + + 697 FPS + 0x000002B9 + + + 698 FPS + 0x000002BA + + + 699 FPS + 0x000002BB + + + 700 FPS + 0x000002BC + + + 701 FPS + 0x000002BD + + + 702 FPS + 0x000002BE + + + 703 FPS + 0x000002BF + + + 704 FPS + 0x000002C0 + + + 705 FPS + 0x000002C1 + + + 706 FPS + 0x000002C2 + + + 707 FPS + 0x000002C3 + + + 708 FPS + 0x000002C4 + + + 709 FPS + 0x000002C5 + + + 710 FPS + 0x000002C6 + + + 711 FPS + 0x000002C7 + + + 712 FPS + 0x000002C8 + + + 713 FPS + 0x000002C9 + + + 714 FPS + 0x000002CA + + + 715 FPS + 0x000002CB + + + 716 FPS + 0x000002CC + + + 717 FPS + 0x000002CD + + + 718 FPS + 0x000002CE + + + 719 FPS + 0x000002CF + + + 720 FPS + 0x000002D0 + + + 721 FPS + 0x000002D1 + + + 722 FPS + 0x000002D2 + + + 723 FPS + 0x000002D3 + + + 724 FPS + 0x000002D4 + + + 725 FPS + 0x000002D5 + + + 726 FPS + 0x000002D6 + + + 727 FPS + 0x000002D7 + + + 728 FPS + 0x000002D8 + + + 729 FPS + 0x000002D9 + + + 730 FPS + 0x000002DA + + + 731 FPS + 0x000002DB + + + 732 FPS + 0x000002DC + + + 733 FPS + 0x000002DD + + + 734 FPS + 0x000002DE + + + 735 FPS + 0x000002DF + + + 736 FPS + 0x000002E0 + + + 737 FPS + 0x000002E1 + + + 738 FPS + 0x000002E2 + + + 739 FPS + 0x000002E3 + + + 740 FPS + 0x000002E4 + + + 741 FPS + 0x000002E5 + + + 742 FPS + 0x000002E6 + + + 743 FPS + 0x000002E7 + + + 744 FPS + 0x000002E8 + + + 745 FPS + 0x000002E9 + + + 746 FPS + 0x000002EA + + + 747 FPS + 0x000002EB + + + 748 FPS + 0x000002EC + + + 749 FPS + 0x000002ED + + + 750 FPS + 0x000002EE + + + 751 FPS + 0x000002EF + + + 752 FPS + 0x000002F0 + + + 753 FPS + 0x000002F1 + + + 754 FPS + 0x000002F2 + + + 755 FPS + 0x000002F3 + + + 756 FPS + 0x000002F4 + + + 757 FPS + 0x000002F5 + + + 758 FPS + 0x000002F6 + + + 759 FPS + 0x000002F7 + + + 760 FPS + 0x000002F8 + + + 761 FPS + 0x000002F9 + + + 762 FPS + 0x000002FA + + + 763 FPS + 0x000002FB + + + 764 FPS + 0x000002FC + + + 765 FPS + 0x000002FD + + + 766 FPS + 0x000002FE + + + 767 FPS + 0x000002FF + + + 768 FPS + 0x00000300 + + + 769 FPS + 0x00000301 + + + 770 FPS + 0x00000302 + + + 771 FPS + 0x00000303 + + + 772 FPS + 0x00000304 + + + 773 FPS + 0x00000305 + + + 774 FPS + 0x00000306 + + + 775 FPS + 0x00000307 + + + 776 FPS + 0x00000308 + + + 777 FPS + 0x00000309 + + + 778 FPS + 0x0000030A + + + 779 FPS + 0x0000030B + + + 780 FPS + 0x0000030C + + + 781 FPS + 0x0000030D + + + 782 FPS + 0x0000030E + + + 783 FPS + 0x0000030F + + + 784 FPS + 0x00000310 + + + 785 FPS + 0x00000311 + + + 786 FPS + 0x00000312 + + + 787 FPS + 0x00000313 + + + 788 FPS + 0x00000314 + + + 789 FPS + 0x00000315 + + + 790 FPS + 0x00000316 + + + 791 FPS + 0x00000317 + + + 792 FPS + 0x00000318 + + + 793 FPS + 0x00000319 + + + 794 FPS + 0x0000031A + + + 795 FPS + 0x0000031B + + + 796 FPS + 0x0000031C + + + 797 FPS + 0x0000031D + + + 798 FPS + 0x0000031E + + + 799 FPS + 0x0000031F + + + 800 FPS + 0x00000320 + + + 801 FPS + 0x00000321 + + + 802 FPS + 0x00000322 + + + 803 FPS + 0x00000323 + + + 804 FPS + 0x00000324 + + + 805 FPS + 0x00000325 + + + 806 FPS + 0x00000326 + + + 807 FPS + 0x00000327 + + + 808 FPS + 0x00000328 + + + 809 FPS + 0x00000329 + + + 810 FPS + 0x0000032A + + + 811 FPS + 0x0000032B + + + 812 FPS + 0x0000032C + + + 813 FPS + 0x0000032D + + + 814 FPS + 0x0000032E + + + 815 FPS + 0x0000032F + + + 816 FPS + 0x00000330 + + + 817 FPS + 0x00000331 + + + 818 FPS + 0x00000332 + + + 819 FPS + 0x00000333 + + + 820 FPS + 0x00000334 + + + 821 FPS + 0x00000335 + + + 822 FPS + 0x00000336 + + + 823 FPS + 0x00000337 + + + 824 FPS + 0x00000338 + + + 825 FPS + 0x00000339 + + + 826 FPS + 0x0000033A + + + 827 FPS + 0x0000033B + + + 828 FPS + 0x0000033C + + + 829 FPS + 0x0000033D + + + 830 FPS + 0x0000033E + + + 831 FPS + 0x0000033F + + + 832 FPS + 0x00000340 + + + 833 FPS + 0x00000341 + + + 834 FPS + 0x00000342 + + + 835 FPS + 0x00000343 + + + 836 FPS + 0x00000344 + + + 837 FPS + 0x00000345 + + + 838 FPS + 0x00000346 + + + 839 FPS + 0x00000347 + + + 840 FPS + 0x00000348 + + + 841 FPS + 0x00000349 + + + 842 FPS + 0x0000034A + + + 843 FPS + 0x0000034B + + + 844 FPS + 0x0000034C + + + 845 FPS + 0x0000034D + + + 846 FPS + 0x0000034E + + + 847 FPS + 0x0000034F + + + 848 FPS + 0x00000350 + + + 849 FPS + 0x00000351 + + + 850 FPS + 0x00000352 + + + 851 FPS + 0x00000353 + + + 852 FPS + 0x00000354 + + + 853 FPS + 0x00000355 + + + 854 FPS + 0x00000356 + + + 855 FPS + 0x00000357 + + + 856 FPS + 0x00000358 + + + 857 FPS + 0x00000359 + + + 858 FPS + 0x0000035A + + + 859 FPS + 0x0000035B + + + 860 FPS + 0x0000035C + + + 861 FPS + 0x0000035D + + + 862 FPS + 0x0000035E + + + 863 FPS + 0x0000035F + + + 864 FPS + 0x00000360 + + + 865 FPS + 0x00000361 + + + 866 FPS + 0x00000362 + + + 867 FPS + 0x00000363 + + + 868 FPS + 0x00000364 + + + 869 FPS + 0x00000365 + + + 870 FPS + 0x00000366 + + + 871 FPS + 0x00000367 + + + 872 FPS + 0x00000368 + + + 873 FPS + 0x00000369 + + + 874 FPS + 0x0000036A + + + 875 FPS + 0x0000036B + + + 876 FPS + 0x0000036C + + + 877 FPS + 0x0000036D + + + 878 FPS + 0x0000036E + + + 879 FPS + 0x0000036F + + + 880 FPS + 0x00000370 + + + 881 FPS + 0x00000371 + + + 882 FPS + 0x00000372 + + + 883 FPS + 0x00000373 + + + 884 FPS + 0x00000374 + + + 885 FPS + 0x00000375 + + + 886 FPS + 0x00000376 + + + 887 FPS + 0x00000377 + + + 888 FPS + 0x00000378 + + + 889 FPS + 0x00000379 + + + 890 FPS + 0x0000037A + + + 891 FPS + 0x0000037B + + + 892 FPS + 0x0000037C + + + 893 FPS + 0x0000037D + + + 894 FPS + 0x0000037E + + + 895 FPS + 0x0000037F + + + 896 FPS + 0x00000380 + + + 897 FPS + 0x00000381 + + + 898 FPS + 0x00000382 + + + 899 FPS + 0x00000383 + + + 900 FPS + 0x00000384 + + + 901 FPS + 0x00000385 + + + 902 FPS + 0x00000386 + + + 903 FPS + 0x00000387 + + + 904 FPS + 0x00000388 + + + 905 FPS + 0x00000389 + + + 906 FPS + 0x0000038A + + + 907 FPS + 0x0000038B + + + 908 FPS + 0x0000038C + + + 909 FPS + 0x0000038D + + + 910 FPS + 0x0000038E + + + 911 FPS + 0x0000038F + + + 912 FPS + 0x00000390 + + + 913 FPS + 0x00000391 + + + 914 FPS + 0x00000392 + + + 915 FPS + 0x00000393 + + + 916 FPS + 0x00000394 + + + 917 FPS + 0x00000395 + + + 918 FPS + 0x00000396 + + + 919 FPS + 0x00000397 + + + 920 FPS + 0x00000398 + + + 921 FPS + 0x00000399 + + + 922 FPS + 0x0000039A + + + 923 FPS + 0x0000039B + + + 924 FPS + 0x0000039C + + + 925 FPS + 0x0000039D + + + 926 FPS + 0x0000039E + + + 927 FPS + 0x0000039F + + + 928 FPS + 0x000003A0 + + + 929 FPS + 0x000003A1 + + + 930 FPS + 0x000003A2 + + + 931 FPS + 0x000003A3 + + + 932 FPS + 0x000003A4 + + + 933 FPS + 0x000003A5 + + + 934 FPS + 0x000003A6 + + + 935 FPS + 0x000003A7 + + + 936 FPS + 0x000003A8 + + + 937 FPS + 0x000003A9 + + + 938 FPS + 0x000003AA + + + 939 FPS + 0x000003AB + + + 940 FPS + 0x000003AC + + + 941 FPS + 0x000003AD + + + 942 FPS + 0x000003AE + + + 943 FPS + 0x000003AF + + + 944 FPS + 0x000003B0 + + + 945 FPS + 0x000003B1 + + + 946 FPS + 0x000003B2 + + + 947 FPS + 0x000003B3 + + + 948 FPS + 0x000003B4 + + + 949 FPS + 0x000003B5 + + + 950 FPS + 0x000003B6 + + + 951 FPS + 0x000003B7 + + + 952 FPS + 0x000003B8 + + + 953 FPS + 0x000003B9 + + + 954 FPS + 0x000003BA + + + 955 FPS + 0x000003BB + + + 956 FPS + 0x000003BC + + + 957 FPS + 0x000003BD + + + 958 FPS + 0x000003BE + + + 959 FPS + 0x000003BF + + + 960 FPS + 0x000003C0 + + + 961 FPS + 0x000003C1 + + + 962 FPS + 0x000003C2 + + + 963 FPS + 0x000003C3 + + + 964 FPS + 0x000003C4 + + + 965 FPS + 0x000003C5 + + + 966 FPS + 0x000003C6 + + + 967 FPS + 0x000003C7 + + + 968 FPS + 0x000003C8 + + + 969 FPS + 0x000003C9 + + + 970 FPS + 0x000003CA + + + 971 FPS + 0x000003CB + + + 972 FPS + 0x000003CC + + + 973 FPS + 0x000003CD + + + 974 FPS + 0x000003CE + + + 975 FPS + 0x000003CF + + + 976 FPS + 0x000003D0 + + + 977 FPS + 0x000003D1 + + + 978 FPS + 0x000003D2 + + + 979 FPS + 0x000003D3 + + + 980 FPS + 0x000003D4 + + + 981 FPS + 0x000003D5 + + + 982 FPS + 0x000003D6 + + + 983 FPS + 0x000003D7 + + + 984 FPS + 0x000003D8 + + + 985 FPS + 0x000003D9 + + + 986 FPS + 0x000003DA + + + 987 FPS + 0x000003DB + + + 988 FPS + 0x000003DC + + + 989 FPS + 0x000003DD + + + 990 FPS + 0x000003DE + + + 991 FPS + 0x000003DF + + + 992 FPS + 0x000003E0 + + + 993 FPS + 0x000003E1 + + + 994 FPS + 0x000003E2 + + + 995 FPS + 0x000003E3 + + + 996 FPS + 0x000003E4 + + + 997 FPS + 0x000003E5 + + + 998 FPS + 0x000003E6 + + + 999 FPS + 0x000003E7 + + + 1000 FPS + 0x000003E8 + + + + + + + + NVLINK SLI Mode + 0x00A06948 + 6 - SLI + 410.00 + + + Texture filtering - Quality substitution + 0x00CE2692 + 4 - Texture Filtering + 418.00 + + + No Substitution + 0x00000000 + + + High quality becomes quality + 0x00000001 + + + + + + Enable Maxwell sample interleaving (MFAA) + 0x0098C1AC + 3 - Antialiasing + 344.11 + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Prefered Refreshrate + 0x0064B541 + 2 - Sync and Refresh + + + Use the 3D application setting + 0x00000000 + + + Highest available + 0x00000001 + + + + + + + GSYNC - Application Mode + 0x1194F158 + 331.00 + 2 - Sync and Refresh + + + Off + 0x00000000 + + + Fullscreen only + 0x00000001 + + + Fullscreen and Windowed + 0x00000002 + + + + + + GSYNC - Global Mode + 0x1094F1F7 + 331.00 + 2 - Sync and Refresh + + + Off + 0x00000000 + + + Fullscreen only + 0x00000001 + + + Fullscreen and Windowed + 0x00000002 + + + + + + GSYNC - Global Feature + 0x1094F157 + 331.00 + 2 - Sync and Refresh + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + GSYNC - Application State + 0x10A879CF + 331.00 + 2 - Sync and Refresh + + + Allow + 0x00000000 + + + Force Off + 0x00000001 + + + Disallow + 0x00000002 + + + Utra Low Motion Blur + 0x00000003 + + + Fixed Refresh Rate + 0x00000004 + + + + + + GSYNC - Application Requested State + 0x10A879AC + 331.00 + 2 - Sync and Refresh + + + Allow + 0x00000000 + + + Force Off + 0x00000001 + + + Disallow + 0x00000002 + + + Utra Low Motion Blur + 0x00000003 + + + Fixed Refresh Rate + 0x00000004 + + + + + + Prevent Anisotropic filtering + 0x103BCCB5 + 331.00 + 4 - Texture Filtering + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Shadercache + 0x00198FFF + 337.50 + 5 - Common + 0x00000001 + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Antialiasing fix + 0x000858F7 + 320.14 + 1 - Compatibility + 0x00000001 + + + On + 0x00000000 + + + Off + 0x00000001 + + + + + Vertical Sync Smooth AFR behavior + 0x101AE763 + 310.00 + 2 - Sync and Refresh + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Texture filtering - Driver Controlled LOD Bias + 0x00638E8F + 313.00 + 4 - Texture Filtering + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Flip Indicator + 0x002CF156 + 2 - Sync and Refresh + + + Disabled + 0x00000000 + + + GRAPH_FLIP_FPS - FPS graph, measured on display hw flip + 0x00000001 + + + GRAPH_PRESENT_FPS - FPS graph, measured when the user mode driver starts processing present + 0x00000002 + + + GRAPH_APP_PRESENT_FPS - FPS graph, measured on app present + 0x00000004 + + + DISPLAY_PAGING - Add red paging indicator bars to the GRAPH_PRESENT_FPS graph + 0x00000008 + + + DISPLAY_APP_THREAD_WAIT - Add app thread wait time indiator bars to the GRAPH_APP_PRESENT_FPS graph + 0x00000010 + + + Enabled - Enable everything + 0x0000001F + + + + + + + Toggle FXAA on or off + 0x1074C972 + 300.00 + 3 - Antialiasing + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Toggle FXAA Indicator on or off + 0x1068FB9C + 300.00 + 3 - Antialiasing + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + NVIDIA Predefined FXAA Usage + 0x1034CB89 + 300.00 + 3 - Antialiasing + + + Disallowed + 0x00000000 + + + Allowed + 0x00000001 + + + + + + Antialiasing - Line gamma + 0x2089BF6C + 3 - Antialiasing + + + Disabled + 0x00000000 + + + Default + 0x00000010 + + + Enabled + 0x00000023 + + + + + + Texture filtering - LOD Bias (DX) + 0x00738E8F + 4 - Texture Filtering + + + -3.0000 + 0xFFFFFFE8 + + + -2.8750 + 0xFFFFFFE9 + + + -2.7500 + 0xFFFFFFEA + + + -2.6250 + 0xFFFFFFEB + + + -2.5000 + 0xFFFFFFEC + + + -2.3750 + 0xFFFFFFED + + + -2.2500 + 0xFFFFFFEE + + + -2.1250 + 0xFFFFFFEF + + + -2.0000 + 0xFFFFFFF0 + + + -1.8750 + 0xFFFFFFF1 + + + -1.7500 + 0xFFFFFFF2 + + + -1.6250 + 0xFFFFFFF3 + + + -1.5000 + 0xFFFFFFF4 + + + -1.3750 + 0xFFFFFFF5 + + + -1.2500 + 0xFFFFFFF6 + + + -1.1250 + 0xFFFFFFF7 + + + -1.0000 + 0xFFFFFFF8 + + + -0.8750 + 0xFFFFFFF9 + + + -0.7500 + 0xFFFFFFFA + + + -0.6250 + 0xFFFFFFFB + + + -0.5000 + 0xFFFFFFFC + + + -0.3750 + 0xFFFFFFFD + + + -0.2500 + 0xFFFFFFFE + + + -0.1250 + 0xFFFFFFFF + + + +0.0000 + 0x00000000 + + + +0.1250 + 0x00000001 + + + +0.2500 + 0x00000002 + + + +0.3750 + 0x00000003 + + + +0.5000 + 0x00000004 + + + +0.6250 + 0x00000005 + + + +0.7500 + 0x00000006 + + + +0.8750 + 0x00000007 + + + +1.0000 + 0x00000008 + + + +1.1250 + 0x00000009 + + + +1.2500 + 0x0000000A + + + +1.3750 + 0x0000000B + + + +1.5000 + 0x0000000C + + + +1.6250 + 0x0000000D + + + +1.7500 + 0x0000000E + + + +1.8750 + 0x0000000F + + + +2.0000 + 0x00000010 + + + +2.1250 + 0x00000011 + + + +2.2500 + 0x00000012 + + + +2.3750 + 0x00000013 + + + +2.5000 + 0x00000014 + + + +2.6250 + 0x00000015 + + + +2.7500 + 0x00000016 + + + +2.8750 + 0x00000017 + + + +3.0000 + 0x00000018 + + + + + + Texture filtering - LOD Bias (OGL) + 0x20403F79 + 4 - Texture Filtering + + + -3.0000 + 0xFFFFFFD0 + + + -2.9375 + 0xFFFFFFD1 + + + -2.8750 + 0xFFFFFFD2 + + + -2.8125 + 0xFFFFFFD3 + + + -2.7500 + 0xFFFFFFD4 + + + -2.6875 + 0xFFFFFFD5 + + + -2.6250 + 0xFFFFFFD6 + + + -2.5625 + 0xFFFFFFD7 + + + -2.5000 + 0xFFFFFFD8 + + + -2.4375 + 0xFFFFFFD9 + + + -2.3750 + 0xFFFFFFDA + + + -2.3125 + 0xFFFFFFDB + + + -2.2500 + 0xFFFFFFDC + + + -2.1875 + 0xFFFFFFDD + + + -21250 + 0xFFFFFFDE + + + -2.0625 + 0xFFFFFFDF + + + -2.0000 + 0xFFFFFFE0 + + + -1.9375 + 0xFFFFFFE1 + + + -1.8750 + 0xFFFFFFE2 + + + -1.8125 + 0xFFFFFFE3 + + + -1.7500 + 0xFFFFFFE4 + + + -1.6875 + 0xFFFFFFE5 + + + -1.6250 + 0xFFFFFFE6 + + + -1.5625 + 0xFFFFFFE7 + + + -1.5000 + 0xFFFFFFE8 + + + -1.4375 + 0xFFFFFFE9 + + + -1.3750 + 0xFFFFFFEA + + + -1.3125 + 0xFFFFFFEB + + + -1.2500 + 0xFFFFFFEC + + + -1.1875 + 0xFFFFFFED + + + -1.1250 + 0xFFFFFFEE + + + -1.0625 + 0xFFFFFFEF + + + -1.0000 + 0xFFFFFFF0 + + + -0.9375 + 0xFFFFFFF1 + + + -0.8750 + 0xFFFFFFF2 + + + -0.8125 + 0xFFFFFFF3 + + + -0.7500 + 0xFFFFFFF4 + + + -0.6875 + 0xFFFFFFF5 + + + -0.6250 + 0xFFFFFFF6 + + + -0.5625 + 0xFFFFFFF7 + + + -0.5000 + 0xFFFFFFF8 + + + -0.4375 + 0xFFFFFFF9 + + + -0.3750 + 0xFFFFFFFA + + + -0.3125 + 0xFFFFFFFB + + + -0.2500 + 0xFFFFFFFC + + + -0.1875 + 0xFFFFFFFD + + + -0.1250 + 0xFFFFFFFE + + + -0.0625 + 0xFFFFFFFF + + + +0.0000 + 0x00000000 + + + +0.0625 + 0x00000001 + + + +0.1250 + 0x00000002 + + + +0.1875 + 0x00000003 + + + +0.2500 + 0x00000004 + + + +0.3125 + 0x00000005 + + + +0.3750 + 0x00000006 + + + +0.4375 + 0x00000007 + + + +0.5000 + 0x00000008 + + + +0.5625 + 0x00000009 + + + +0.6250 + 0x0000000A + + + +0.6875 + 0x0000000B + + + +0.7500 + 0x0000000C + + + +0.8125 + 0x0000000D + + + +0.8750 + 0x0000000E + + + +0.9375 + 0x0000000F + + + +1.0000 + 0x00000010 + + + +1.0625 + 0x00000011 + + + +1.1250 + 0x00000012 + + + +1.1875 + 0x00000013 + + + +1.2500 + 0x00000014 + + + +1.3125 + 0x00000015 + + + +1.3750 + 0x00000016 + + + +1.4375 + 0x00000017 + + + +1.5000 + 0x00000018 + + + +1.5625 + 0x00000019 + + + +1.6250 + 0x0000001A + + + +1.6875 + 0x0000001B + + + +1.7500 + 0x0000001C + + + +1.8125 + 0x0000001D + + + +1.8750 + 0x0000001E + + + +1.9375 + 0x0000001F + + + +2.0000 + 0x00000020 + + + +2.0625 + 0x00000021 + + + +2.1250 + 0x00000022 + + + +2.1875 + 0x00000023 + + + +2.2500 + 0x00000024 + + + +2.3125 + 0x00000025 + + + +2.3750 + 0x00000026 + + + +2.4375 + 0x00000027 + + + +2.5000 + 0x00000028 + + + +2.5625 + 0x00000029 + + + +2.6250 + 0x0000002A + + + +2.6875 + 0x0000002B + + + +2.7500 + 0x0000002C + + + +2.8125 + 0x0000002D + + + +2.8750 + 0x0000002E + + + +2.9375 + 0x0000002F + + + +3.0000 + 0x00000030 + + + + + + SLI compatibility bits (OGL) + 0x209746C1 + 1 - Compatibility + + + + SLI compatibility bits (DX12) + 0x00A04746 + 1 - Compatibility + + + + SLI compatibility bits (DX10 + DX11) + 0x00A06946 + 1 - Compatibility + + + + SLI Mode + 0x0000000F + + + Auto + 0x00000000 + + + Single + 0x00000004 + + + AFR + 0x00000001 + + + SFR + 0x00000002 + + + AFR-SFR + 0x00000003 + + + 3 Way SLI AFR + 0x00000006 + + + 4 Way SLI AFR + 0x00000005 + + + + + + + SLI compatibility bits + 0x1095DEF8 + 1 - Compatibility + + + + SLI Mode + 0x00000007 + + + Auto + 0x00000000 + + + Single + 0x00000004 + + + AFR + 0x00000001 + + + SFR + 0x00000002 + + + AFR-SFR + 0x00000003 + + + 3 Way SLI AFR + 0x00000006 + + + 4 Way SLI AFR + 0x00000005 + + + + + AFR Mode + 0x02430000 + + + AFR 1 + 0x00000000 + + + AFR 2 + 0x02430000 + + + + + + + Antialiasing compatibility + 0x00D55F7D + 1 - Compatibility + + + + + Antialiasing compatibility (DX1x) + 0x00E32F8A + 1 - Compatibility + + + + + Ambient Occlusion compatibility + 0x002C7F45 + 1 - Compatibility + + + + + Antialiasing - Gamma correction + 0x107D639D + 0x00000002 + 3 - Antialiasing + + + Off + 0x00000000 + + + On + 0x00000002 + + + + + + Antialiasing - Behavior Flags + 0x10ECDB82 + 3 - Antialiasing + + + None + 0x00000000 + + + Treat 'Override any application setting' as 'Application-controlled' + 0x00000001 + + + Treat 'Override any application setting' as 'Enhance the application setting' + 0x00000002 + + + Disable 'Override any application setting' + 0x00000003 + + + Treat 'Enhance the application setting' as 'Application-controlled' + 0x00000004 + + + Treat 'Enhance the application setting' as 'Override any application setting' + 0x00000008 + + + Disable 'Enhance the application setting' + 0x0000000C + + + Disable Antialiasing at NVIDIA Control Panel + 0x00040000 + + + + + + Antialiasing - Mode + 0x107EFC5B + 3 - Antialiasing + + + Application-controlled + 0x00000000 + + + Override any application setting + 0x00000001 + + + Enhance the application setting + 0x00000002 + + + + + + Antialiasing - Setting + 0x10D773D2 + 3 - Antialiasing + + + Application-controlled / Off + 0x00000000 + + + 2x [2x Multisampling] + 0x0000000E + + + 2xQ [2x Quincunx (blurred)] + 0x0000000F + + + 4x [4x Multisampling] + 0x00000010 + + + 8x [8x CSAA (4 color + 4 cv samples)] + 0x00000026 + + + 16x [16x CSAA (4 color + 12 cv samples)] + 0x00000027 + + + 8xQ [8x Multisampling] + 0x00000025 + + + 16xQ [16x CSAA (8 color + 8 cv samples)] + 0x00000028 + + + 32x [32x CSAA (8 color + 24 cv samples)] + 0x0000001D + + + 2x1 [2x1 Supersampling (D3D only)] + 0x00000001 + + + 1x2 [1x2 Supersampling (D3D only)] + 0x00000002 + + + 2x2 [2x2 Supersampling (D3D only)] + 0x00000005 + + + 3x3 [3x3 Supersampling (D3D only)] + 0x0000000A + + + 4x4 [4x4 Supersampling (D3D only)] + 0x0000000C + + + 4xS [Combined: 1x2 SS + 2x MS (D3D only)] + 0x00000013 + + + 8xS [Combined: 1x2 SS + 4x MS] + 0x00000018 + + + 8xSQ [Combined: 2x2 SS + 2x MS] + 0x00000019 + + + 12xS [Combined: 2x2 SS + 4x OGMS (D3D only)] + 0x00000017 + + + 16xS [Combined: 2x2 SS + 4x MS] + 0x0000001A + + + 32xS [Combined: 2x2 SS + 8x MS] + 0x00000029 + + + + + + Antialiasing - Transparency Multisampling + 0x10FC2D9C + 3 - Antialiasing + + + Disabled + 0x00000000 + + + Enabled + 0x00000004 + + + + + + Antialiasing - Transparency Supersampling + 0x10D48A85 + 3 - Antialiasing + + + Off / Multisampling + 0x00000000 + + + Supersampling + 0x00000023 + + + 2x Supersampling + 0x00000014 + + + 4x Supersampling + 0x00000024 + + + 8x Supersampling + 0x00000034 + + + 2x Sparse Grid Supersampling + 0x00000018 + + + 4x Sparse Grid Supersampling + 0x00000028 + + + 8x Sparse Grid Supersampling + 0x00000038 + + + + + + Anisotropic filtering mode + 0x10D2BB16 + 4 - Texture Filtering + + + Application-controlled + 0x00000000 + + + User-defined / Off + 0x00000001 + + + + + + Anisotropic filtering setting + 0x101E61A9 + 4 - Texture Filtering + + + Off [Point] + 0x00000000 + + + Off [Linear] + 0x00000001 + + + 2x + 0x00000002 + + + 4x + 0x00000004 + + + 6x + 0x00000004 + + + 8x + 0x00000008 + + + 12x + 0x0000000C + + + 16x + 0x00000010 + + + + + + Texture filtering - Anisotropic filter optimization + 0x0084CD70 + 4 - Texture Filtering + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Texture filtering - Anisotropic sample optimization + 0x00E73211 + 4 - Texture Filtering + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Texture filtering - Negative LOD bias + 0x0019BB68 + 4 - Texture Filtering + + + Allow + 0x00000000 + + + Clamp + 0x00000001 + + + + + + Texture filtering - Quality + 0x00CE2691 + 4 - Texture Filtering + + + Quality + 0x00000000 + + + Performance + 0x0000000A + + + High performance + 0x00000014 + + + High quality + 0xFFFFFFF6 + + + + + + Texture filtering - Trilinear optimization + 0x002ECAF2 + 4 - Texture Filtering + + + On ( will be ignored if using high quality ) + 0x00000000 + + + Off + 0x00000001 + + + + + + Ambient Occlusion usage + 0x00664339 + 5 - Common + + + Disabled + 0x00000000 + + + Enabled + 0x00000001 + + + + + + Ambient Occlusion setting + 0x00667329 + 5 - Common + + + Off + 0x00000000 + + + Performance + 0x00000001 + + + Quality + 0x00000002 + + + High quality + 0x00000003 + + + + + + Maximum pre-rendered frames + 0x007BA09E + 2 - Sync and Refresh + + + Use the 3D application setting + 0x00000000 + + + 1 + 0x00000001 + + + 2 + 0x00000002 + + + 3 + 0x00000003 + + + 4 + 0x00000004 + + + 5 + 0x00000005 + + + 6 + 0x00000006 + + + 7 + 0x00000007 + + + 8 + 0x00000008 + + + + + + Threaded optimization + 0x20C1221E + 5 - Common + + + Auto + 0x00000000 + + + On + 0x00000001 + + + Off + 0x00000002 + + + + + + Triple buffering + 0x20FDD1F9 + 2 - Sync and Refresh + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Vertical Sync + 0x00A879CF + 2 - Sync and Refresh + + + Force off + 0x08416747 + + + Force on + 0x47814940 + + + Fast Sync + 0x18888888 + + + Use the 3D application setting + 0x60925292 + + + 1/2 Refresh Rate + 0x32610244 + + + 1/3 Refresh Rate + 0x71271021 + + + 1/4 Refresh Rate + 0x13245256 + + + + + + Vertical Sync Tear Control + 0x005A375C + 300.00 + 2 - Sync and Refresh + + + Standard + 0x96861077 + + + Adaptive + 0x99941284 + + + + + + Show PhysX Visual Indicator + 0x1094F16F + 5 - Common + + + On + 0x24545582 + + + Off + 0x34534064 + + + + + + Power management mode + 0x1057EB71 + 5 - Common + + + Adaptive + 0x00000000 + + + Prefer maximum performance + 0x00000001 + + + Optimal performance + 0x00000005 + + + + + + CUDA - Force P2 State + 0x50166C5E + 5 - Common + 0x00000001 + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + + Extension limit + 0x20FF7493 + 5 - Common + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Multi-display/mixed-GPU acceleration + 0x200AEBFC + 5 - Common + + + Single display performance mode + 0x00000000 + + + Compatibility performance mode + 0x00000001 + + + Multi display performance mode + 0x00000003 + + + + + + OpenGL - Version Override + 0x2046B3ED + 5 - Common + + + Disabled + 0x00000000 + + + OpenGL Version 1.0 + 0x00302e31 + + + OpenGL Version 1.1 + 0x00312e31 + + + OpenGL Version 1.2 + 0x00322e31 + + + OpenGL Version 1.3 + 0x00332e31 + + + OpenGL Version 1.4 + 0x00342e31 + + + OpenGL Version 1.5 + 0x00352e31 + + + OpenGL Version 2.0 + 0x00302e32 + + + OpenGL Version 2.1 + 0x00312e32 + + + OpenGL Version 3.0 + 0x00302e33 + + + OpenGL Version 3.1 + 0x00312e33 + + + + + + StereoProfile + 0x701EB457 + 7 - Stereo + + + + No + 0x00000000 + + + Yes + 0x00000001 + + + + + StereoConvergence + 0x708DB8C5 + + 7 - Stereo + 0x40800000 + + + + 0.01 + 0x3c23d70a + + + 0.05 + 0x3d4ccccd + + + 0.1 + 0x3dcccccd + + + 0.2 + 0x3e4ccccd + + + 0.3 + 0x3e99999a + + + 0.4 + 0x3ecccccd + + + 0.5 + 0x3f000000 + + + 0.6 + 0x3f19999a + + + 0.7 + 0x3f333333 + + + 0.8 + 0x3f4ccccd + + + 0.9 + 0x3f666666 + + + 1 + 0x3f800000 + + + 2 + 0x40000000 + + + 3 + 0x40400000 + + + 4 + 0x40800000 + + + 5 + 0x40a00000 + + + 6 + 0x40c00000 + + + 7 + 0x40e00000 + + + 8 + 0x41000000 + + + 9 + 0x41100000 + + + 10 + 0x41200000 + + + 20 + 0x41a00000 + + + 30 + 0x41f00000 + + + 40 + 0x42200000 + + + 50 + 0x42480000 + + + 60 + 0x42700000 + + + 70 + 0x428c0000 + + + 80 + 0x42a00000 + + + 90 + 0x42b40000 + + + 100 + 0x42c80000 + + + 200 + 0x43480000 + + + 300 + 0x43960000 + + + 400 + 0x43c80000 + + + 500 + 0x43fa0000 + + + 600 + 0x44160000 + + + 700 + 0x442f0000 + + + 800 + 0x44480000 + + + 900 + 0x44610000 + + + 1000 + 0x447a0000 + + + + + LaserXAdjust + 0x7057e831 + 7 - Stereo + 0x3f800000 + + + 100% Left + 0x00000000 + + + 95% Left + 0x3d4ccccd + + + 90% Left + 0x3dcccccd + + + 85% Left + 0x3e19999a + + + 80% Left + 0x3e4ccccd + + + 75% Left + 0x3e800000 + + + 70% Left + 0x3e99999a + + + 65% Left + 0x3eb33333 + + + 60% Left + 0x3ecccccd + + + 55% Left + 0x3ee66666 + + + 50% Left + 0x3f000000 + + + 45% Left + 0x3f0ccccd + + + 40% Left + 0x3f19999a + + + 35% Left + 0x3f266666 + + + 30% Left + 0x3f333333 + + + 25% Left + 0x3f400000 + + + 20% Left + 0x3f4ccccd + + + 15% Left + 0x3f59999a + + + 10% Left + 0x3f666666 + + + 5% Left + 0x3f733333 + + + Center + 0x3f800000 + + + 5% Right + 0x3f866666 + + + 10% Right + 0x3f8ccccd + + + 15% Right + 0x3f933333 + + + 20% Right + 0x3f99999a + + + 25% Right + 0x3fa00000 + + + 30% Right + 0x3fa66666 + + + 35% Right + 0x3faccccd + + + 40% Right + 0x3fb33333 + + + 45% Right + 0x3fb9999a + + + 50% Right + 0x3fc00000 + + + 55% Right + 0x3fc66666 + + + 60% Right + 0x3fcccccd + + + 65% Right + 0x3fd33333 + + + 70% Right + 0x3fd9999a + + + 75% Right + 0x3fe00000 + + + 80% Right + 0x3fe66666 + + + 85% Right + 0x3feccccd + + + 90% Right + 0x3ff33333 + + + 95% Right + 0x3ff9999a + + + 100% Right + 0x40000000 + + + + + LaserYAdjust + 0x70225308 + 7 - Stereo + 0x3f800000 + + + 100% Up + 0x00000000 + + + 95% Up + 0x3d4ccccd + + + 90% Up + 0x3dcccccd + + + 85% Up + 0x3e19999a + + + 80% Up + 0x3e4ccccd + + + 75% Up + 0x3e800000 + + + 70% Up + 0x3e99999a + + + 65% Up + 0x3eb33333 + + + 60% Up + 0x3ecccccd + + + 55% Up + 0x3ee66666 + + + 50% Up + 0x3f000000 + + + 45% Up + 0x3f0ccccd + + + 40% Up + 0x3f19999a + + + 35% Up + 0x3f266666 + + + 30% Up + 0x3f333333 + + + 25% Up + 0x3f400000 + + + 20% Up + 0x3f4ccccd + + + 15% Up + 0x3f59999a + + + 10% Up + 0x3f666666 + + + 5% Up + 0x3f733333 + + + Center + 0x3f800000 + + + 5% Down + 0x3f866666 + + + 10% Down + 0x3f8ccccd + + + 15% Down + 0x3f933333 + + + 20% Down + 0x3f99999a + + + 25% Down + 0x3fa00000 + + + 30% Down + 0x3fa66666 + + + 35% Down + 0x3faccccd + + + 40% Down + 0x3fb33333 + + + 45% Down + 0x3fb9999a + + + 50% Down + 0x3fc00000 + + + 55% Down + 0x3fc66666 + + + 60% Down + 0x3fcccccd + + + 65% Down + 0x3fd33333 + + + 70% Down + 0x3fd9999a + + + 75% Down + 0x3fe00000 + + + 80% Down + 0x3fe66666 + + + 85% Down + 0x3feccccd + + + 90% Down + 0x3ff33333 + + + 95% Down + 0x3ff9999a + + + 100% Down + 0x40000000 + + + + + StereoTextureEnable + 0x70EDB381 + 7 - Stereo + 0x00000023 + + + 0x00000001 COMMON_STEREO_TEXTURE_ENABLED + 0x00000001 + + + 0x00000002 SMALL_STEREO_TEXTURE_ENABLED + 0x00000002 + + + 0x00000004 SQUARE_STEREO_TEXTURE_ENABLED + 0x00000004 + + + 0x00000008 DISABLE_BB_SEPARATION_IF_STEREO_TEX + 0x00000008 + + + 0x00000010 DISABLE_BB_SEPARATION_COMPLETELY + 0x00000010 + + + 0x00000020 COMMON_STEREO_PLANERT_ENABLED + 0x00000020 + + + 0x00000040 ORTHO_PROJECTION_DISABLED + 0x00000040 + + + 0x00000080 ENABLE_SEPARATION_IF_ZBNULL + 0x00000080 + + + 0x00000100 RESERVED_BY_DX10 + 0x00000100 + + + 0x00000200 DISABLE_TEX_SEPARATION_IF_STEREO_TEX + 0x00000200 + + + 0x00000400 ENABLE_SEPARATION_IF_MONORT + 0x00000400 + + + 0x00000800 DISABLE_FULLSCREEN_A8R8G8B8_STEREO_TEXTURES + 0x00000800 + + + 0x00001000 DISABLE_SMALL_SQUARE_STEREO_TEXTURES + 0x00001000 + + + 0x00002000 ENABLE_ALL_STEREO_ZB_SIZES + 0x00002000 + + + 0x00004000 ENABLE_NULLFORMAT_PRIMSIZE_RT + 0x00004000 + + + 0x00008000 DISABLE_ALL_NULLFORMAT_RT + 0x00008000 + + + 0x00040000 ENABLE_VSSTEREO_SHADERS_WITHOUT_CONST + 0x00040000 + + + + + StereoCutoff + 0x709A1DDF + 7 - Stereo + 0x00000001 + + + 0x00000002 Use StereoCutoffDepthNear + 0x00000002 + + + 0x00000004 Use StereoCutoffDepthFar + 0x00000004 + + + + + StereoCutoffDepthNear + 0x7050E011 + 7 - Stereo + 0x3F800000 + + + + StereoCutoffDepthFar + 0x70ADD220 + 7 - Stereo + 0x461C4000 + + + + StereoMemoEnabled + 0x707F4B45 + 7 - Stereo + 0x00000001 + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + StereoFlagsDX10 + 0x702442FC + 7 - Stereo + + + 0x00004000 STEREO_COMPUTE_ENABLE + 0x00004000 + + + 0x00008000 STEREO_COMPUTE_SAME_RESOURCES_AS_GRAPHICS + 0x00008000 + + + + + StereoUseMatrix + 0x70E34A78 + 7 - Stereo + + + Only adjust vertex position + 0x00000000 + + + Correct many "halo" type rendering issues + 0x00000001 + + + + + diff --git a/ColorControl/nspector/Images/0_gear2.png b/ColorControl/nspector/Images/0_gear2.png new file mode 100644 index 0000000..70dd71e Binary files /dev/null and b/ColorControl/nspector/Images/0_gear2.png differ diff --git a/ColorControl/nspector/Images/1_gear2_2.png b/ColorControl/nspector/Images/1_gear2_2.png new file mode 100644 index 0000000..90af03c Binary files /dev/null and b/ColorControl/nspector/Images/1_gear2_2.png differ diff --git a/ColorControl/nspector/Images/4_gear_nv2.png b/ColorControl/nspector/Images/4_gear_nv2.png new file mode 100644 index 0000000..43ba6b2 Binary files /dev/null and b/ColorControl/nspector/Images/4_gear_nv2.png differ diff --git a/ColorControl/nspector/Images/6_gear_inherit.png b/ColorControl/nspector/Images/6_gear_inherit.png new file mode 100644 index 0000000..16a52e6 Binary files /dev/null and b/ColorControl/nspector/Images/6_gear_inherit.png differ diff --git a/ColorControl/nspector/Images/PortableDeviceStatus_3_16-011.png b/ColorControl/nspector/Images/PortableDeviceStatus_3_16-011.png new file mode 100644 index 0000000..bdbaf38 Binary files /dev/null and b/ColorControl/nspector/Images/PortableDeviceStatus_3_16-011.png differ diff --git a/ColorControl/nspector/Images/apply.png b/ColorControl/nspector/Images/apply.png new file mode 100644 index 0000000..5b4ba08 Binary files /dev/null and b/ColorControl/nspector/Images/apply.png differ diff --git a/ColorControl/nspector/Images/export1.png b/ColorControl/nspector/Images/export1.png new file mode 100644 index 0000000..fcd1f73 Binary files /dev/null and b/ColorControl/nspector/Images/export1.png differ diff --git a/ColorControl/nspector/Images/filter_user.png b/ColorControl/nspector/Images/filter_user.png new file mode 100644 index 0000000..2200532 Binary files /dev/null and b/ColorControl/nspector/Images/filter_user.png differ diff --git a/ColorControl/nspector/Images/find_set2.png b/ColorControl/nspector/Images/find_set2.png new file mode 100644 index 0000000..42221fd Binary files /dev/null and b/ColorControl/nspector/Images/find_set2.png differ diff --git a/ColorControl/nspector/Images/home_sm.png b/ColorControl/nspector/Images/home_sm.png new file mode 100644 index 0000000..9951eae Binary files /dev/null and b/ColorControl/nspector/Images/home_sm.png differ diff --git a/ColorControl/nspector/Images/ieframe_1_18212.png b/ColorControl/nspector/Images/ieframe_1_18212.png new file mode 100644 index 0000000..09f156c Binary files /dev/null and b/ColorControl/nspector/Images/ieframe_1_18212.png differ diff --git a/ColorControl/nspector/Images/ieframe_1_31073-002.png b/ColorControl/nspector/Images/ieframe_1_31073-002.png new file mode 100644 index 0000000..464bcf4 Binary files /dev/null and b/ColorControl/nspector/Images/ieframe_1_31073-002.png differ diff --git a/ColorControl/nspector/Images/import1.png b/ColorControl/nspector/Images/import1.png new file mode 100644 index 0000000..4f62d90 Binary files /dev/null and b/ColorControl/nspector/Images/import1.png differ diff --git a/ColorControl/nspector/Images/n1-016.png b/ColorControl/nspector/Images/n1-016.png new file mode 100644 index 0000000..d7f0910 Binary files /dev/null and b/ColorControl/nspector/Images/n1-016.png differ diff --git a/ColorControl/nspector/Images/nv_btn.png b/ColorControl/nspector/Images/nv_btn.png new file mode 100644 index 0000000..e44f2d4 Binary files /dev/null and b/ColorControl/nspector/Images/nv_btn.png differ diff --git a/ColorControl/nspector/Images/shield.png b/ColorControl/nspector/Images/shield.png new file mode 100644 index 0000000..15e3c0f Binary files /dev/null and b/ColorControl/nspector/Images/shield.png differ diff --git a/ColorControl/nspector/Images/shield16.ico b/ColorControl/nspector/Images/shield16.ico new file mode 100644 index 0000000..2d60996 Binary files /dev/null and b/ColorControl/nspector/Images/shield16.ico differ diff --git a/ColorControl/nspector/Images/text_binary.png b/ColorControl/nspector/Images/text_binary.png new file mode 100644 index 0000000..1722792 Binary files /dev/null and b/ColorControl/nspector/Images/text_binary.png differ diff --git a/ColorControl/nspector/Images/transparent16.png b/ColorControl/nspector/Images/transparent16.png new file mode 100644 index 0000000..3553e3f Binary files /dev/null and b/ColorControl/nspector/Images/transparent16.png differ diff --git a/ColorControl/nspector/Images/window_application_add.png b/ColorControl/nspector/Images/window_application_add.png new file mode 100644 index 0000000..86bfcec Binary files /dev/null and b/ColorControl/nspector/Images/window_application_add.png differ diff --git a/ColorControl/nspector/Images/window_application_delete.png b/ColorControl/nspector/Images/window_application_delete.png new file mode 100644 index 0000000..4a9b0ba Binary files /dev/null and b/ColorControl/nspector/Images/window_application_delete.png differ diff --git a/ColorControl/nspector/ListViewEx.cs b/ColorControl/nspector/ListViewEx.cs new file mode 100644 index 0000000..1c278f2 --- /dev/null +++ b/ColorControl/nspector/ListViewEx.cs @@ -0,0 +1,275 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace nspector +{ + internal delegate void DropFilesNativeHandler(string[] files); + + internal class ListViewEx : ListView + { + + public event DropFilesNativeHandler OnDropFilesNative; + + [DllImport("user32.dll")] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wPar, IntPtr lPar); + + private const int LVM_FIRST = 0x1000; + private const int LVM_GETCOLUMNORDERARRAY = (LVM_FIRST + 59); + + private const int WM_PAINT = 0x000F; + + private struct EmbeddedControl + { + internal Control Control; + internal int Column; + internal int Row; + internal DockStyle Dock; + internal ListViewItem Item; + } + + private ArrayList _embeddedControls = new ArrayList(); + + public ListViewEx() + { + this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); + this.SetStyle(ControlStyles.EnableNotifyMessage, true); + } + + protected override void OnNotifyMessage(Message m) + { + if (m.Msg != 0x14) + { + base.OnNotifyMessage(m); + } + } + + protected int[] GetColumnOrder() + { + IntPtr lPar = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)) * Columns.Count); + + IntPtr res = SendMessage(Handle, LVM_GETCOLUMNORDERARRAY, new IntPtr(Columns.Count), lPar); + if (res.ToInt32() == 0) + { + Marshal.FreeHGlobal(lPar); + return null; + } + + int [] order = new int[Columns.Count]; + Marshal.Copy(lPar, order, 0, Columns.Count); + + Marshal.FreeHGlobal(lPar); + + return order; + } + + protected Rectangle GetSubItemBounds(ListViewItem Item, int SubItem) + { + Rectangle subItemRect = Rectangle.Empty; + + if (Item == null) + throw new ArgumentNullException("Item"); + + int[] order = GetColumnOrder(); + if (order == null) // No Columns + return subItemRect; + + if (SubItem >= order.Length) + throw new IndexOutOfRangeException("SubItem "+SubItem+" out of range"); + + Rectangle lviBounds = Item.GetBounds(ItemBoundsPortion.Entire); + int subItemX = lviBounds.Left; + + ColumnHeader col; + int i; + for (i=0; i=Columns.Count || row>=Items.Count) + throw new ArgumentOutOfRangeException(); + + EmbeddedControl ec; + ec.Control = c; + ec.Column = col; + ec.Row = row; + ec.Dock = dock; + ec.Item = Items[row]; + + _embeddedControls.Add(ec); + + c.Click += new EventHandler(_embeddedControl_Click); + + this.Controls.Add(c); + } + + internal void RemoveEmbeddedControl(Control c) + { + if (c == null) + throw new ArgumentNullException(); + + for (int i=0; i<_embeddedControls.Count; i++) + { + EmbeddedControl ec = (EmbeddedControl)_embeddedControls[i]; + if (ec.Control == c) + { + c.Click -= new EventHandler(_embeddedControl_Click); + this.Controls.Remove(c); + _embeddedControls.RemoveAt(i); + return; + } + } + } + + internal Control GetEmbeddedControl(int col, int row) + { + foreach (EmbeddedControl ec in _embeddedControls) + if (ec.Row == row && ec.Column == col) + return ec.Control; + + return null; + } + + [DefaultValue(View.LargeIcon)] + internal new View View + { + get + { + return base.View; + } + set + { + foreach (EmbeddedControl ec in _embeddedControls) + ec.Control.Visible = (value == View.Details); + + base.View = value; + } + } + + [DllImport("shell32.dll", CharSet = CharSet.Auto)] + public static extern int DragQueryFile(IntPtr hDrop, uint iFile, [Out] StringBuilder lpszFile, int cch); + private const int WM_DROPFILES = 0x233; + + protected override void WndProc(ref Message m) + { + switch (m.Msg) + { + case WM_PAINT: + if (View != View.Details) + break; + + foreach (EmbeddedControl ec in _embeddedControls) + { + Rectangle rc = this.GetSubItemBounds(ec.Item, ec.Column); + + if ((this.HeaderStyle != ColumnHeaderStyle.None) && + (rc.Top 0) + { + var files = new List(); + + for (uint i = 0; i < dropped; i++) + { + var size = DragQueryFile(m.WParam, i, null, 0); + if (size > 0) + { + var sb = new StringBuilder(size + 1); + var result = DragQueryFile(m.WParam, i, sb, size + 1); + files.Add(sb.ToString()); + } + } + + OnDropFilesNative(files.ToArray()); + } + } + + base.WndProc(ref m); + break; + } + base.WndProc (ref m); + } + + private void _embeddedControl_Click(object sender, EventArgs e) + { + foreach (EmbeddedControl ec in _embeddedControls) + { + if (ec.Control == (Control)sender) + { + this.SelectedItems.Clear(); + ec.Item.Selected = true; + } + } + } + } +} diff --git a/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.cs b/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.cs new file mode 100644 index 0000000..1bff357 --- /dev/null +++ b/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.cs @@ -0,0 +1,967 @@ +namespace nspector.Native.NvApi.DriverSettings +{ + public enum ESetting : uint { + OGL_AA_LINE_GAMMA_ID = 0x2089BF6C, + OGL_DEEP_COLOR_SCANOUT_ID = 0x2097C2F6, + OGL_DEFAULT_SWAP_INTERVAL_ID = 0x206A6582, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID = 0x206C4581, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID = 0x20655CFA, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID = 0x209DF23E, + OGL_EXTENSION_STRING_VERSION_ID = 0x20FF7493, + OGL_FORCE_BLIT_ID = 0x201F619F, + OGL_FORCE_STEREO_ID = 0x204D9A0C, + OGL_IMPLICIT_GPU_AFFINITY_ID = 0x20D0F3E6, + OGL_MAX_FRAMES_ALLOWED_ID = 0x208E55E3, + OGL_OVERLAY_PIXEL_TYPE_ID = 0x209AE66F, + OGL_OVERLAY_SUPPORT_ID = 0x206C28C4, + OGL_QUALITY_ENHANCEMENTS_ID = 0x20797D6C, + OGL_SINGLE_BACKDEPTH_BUFFER_ID = 0x20A29055, + OGL_SLI_CFR_MODE_ID = 0x20343843, + OGL_SLI_MULTICAST_ID = 0x2092D3BE, + OGL_THREAD_CONTROL_ID = 0x20C1221E, + OGL_TMON_LEVEL_ID = 0x202888C1, + OGL_TRIPLE_BUFFER_ID = 0x20FDD1F9, + AA_BEHAVIOR_FLAGS_ID = 0x10ECDB82, + AA_MODE_ALPHATOCOVERAGE_ID = 0x10FC2D9C, + AA_MODE_GAMMACORRECTION_ID = 0x107D639D, + AA_MODE_METHOD_ID = 0x10D773D2, + AA_MODE_REPLAY_ID = 0x10D48A85, + AA_MODE_SELECTOR_ID = 0x107EFC5B, + AA_MODE_SELECTOR_SLIAA_ID = 0x107AFC5B, + ANISO_MODE_LEVEL_ID = 0x101E61A9, + ANISO_MODE_SELECTOR_ID = 0x10D2BB16, + ANSEL_ALLOW_ID = 0x1035DB89, + ANSEL_ALLOWLISTED_ID = 0x1085DA8A, + ANSEL_ENABLE_ID = 0x1075D972, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID = 0x104554B6, + APPLICATION_STEAM_ID_ID = 0x107CDDBC, + BATTERY_BOOST_APP_FPS_ID = 0x10115C8C, + CPL_HIDDEN_PROFILE_ID = 0x106D5CFF, + CUDA_EXCLUDED_GPUS_ID = 0x10354FF8, + D3DOGL_GPU_MAX_POWER_ID = 0x10D1EF29, + EXPORT_PERF_COUNTERS_ID = 0x108F0841, + EXTERNAL_QUIET_MODE_ID = 0x10115C8D, + FRL_FPS_ID = 0x10835002, + FXAA_ALLOW_ID = 0x1034CB89, + FXAA_ENABLE_ID = 0x1074C972, + FXAA_INDICATOR_ENABLE_ID = 0x1068FB9C, + MCSFRSHOWSPLIT_ID = 0x10287051, + NV_QUALITY_UPSCALING_ID = 0x10444444, + OPTIMUS_MAXAA_ID = 0x10F9DC83, + PHYSXINDICATOR_ID = 0x1094F16F, + PREFERRED_PSTATE_ID = 0x1057EB71, + PREVENT_UI_AF_OVERRIDE_ID = 0x103BCCB5, + SHIM_MAXRES_ID = 0x10F9DC82, + SHIM_MCCOMPAT_ID = 0x10F9DC80, + SHIM_RENDERING_MODE_ID = 0x10F9DC81, + SHIM_RENDERING_OPTIONS_ID = 0x10F9DC84, + SLI_GPU_COUNT_ID = 0x1033DCD1, + SLI_PREDEFINED_GPU_COUNT_ID = 0x1033DCD2, + SLI_PREDEFINED_GPU_COUNT_DX10_ID = 0x1033DCD3, + SLI_PREDEFINED_MODE_ID = 0x1033CEC1, + SLI_PREDEFINED_MODE_DX10_ID = 0x1033CEC2, + SLI_RENDERING_MODE_ID = 0x1033CED1, + VRPRERENDERLIMIT_ID = 0x10111133, + VRRFEATUREINDICATOR_ID = 0x1094F157, + VRROVERLAYINDICATOR_ID = 0x1095F16F, + VRRREQUESTSTATE_ID = 0x1094F1F7, + VRR_APP_OVERRIDE_ID = 0x10A879CF, + VRR_APP_OVERRIDE_REQUEST_STATE_ID = 0x10A879AC, + VRR_MODE_ID = 0x1194F158, + VSYNCSMOOTHAFR_ID = 0x101AE763, + VSYNCVRRCONTROL_ID = 0x10A879CE, + VSYNC_BEHAVIOR_FLAGS_ID = 0x10FDEC23, + WKS_API_STEREO_EYES_EXCHANGE_ID = 0x11AE435C, + WKS_API_STEREO_MODE_ID = 0x11E91A61, + WKS_MEMORY_ALLOCATION_POLICY_ID = 0x11112233, + WKS_STEREO_DONGLE_SUPPORT_ID = 0x112493BD, + WKS_STEREO_SUPPORT_ID = 0x11AA9E99, + WKS_STEREO_SWAP_MODE_ID = 0x11333333, + AO_MODE_ID = 0x00667329, + AO_MODE_ACTIVE_ID = 0x00664339, + AUTO_LODBIASADJUST_ID = 0x00638E8F, + EXPORT_PERF_COUNTERS_DX9_ONLY_ID = 0x00B65E72, + ICAFE_LOGO_CONFIG_ID = 0x00DB1337, + LODBIASADJUST_ID = 0x00738E8F, + MAXWELL_B_SAMPLE_INTERLEAVE_ID = 0x0098C1AC, + PRERENDERLIMIT_ID = 0x007BA09E, + PS_SHADERDISKCACHE_ID = 0x00198FFF, + PS_TEXFILTER_ANISO_OPTS2_ID = 0x00E73211, + PS_TEXFILTER_BILINEAR_IN_ANISO_ID = 0x0084CD70, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID = 0x002ECAF2, + PS_TEXFILTER_NO_NEG_LODBIAS_ID = 0x0019BB68, + QUALITY_ENHANCEMENTS_ID = 0x00CE2691, + QUALITY_ENHANCEMENT_SUBSTITUTION_ID = 0x00CE2692, + REFRESH_RATE_OVERRIDE_ID = 0x0064B541, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID = 0x00AE785C, + SET_VAB_DATA_ID = 0x00AB8687, + VSYNCMODE_ID = 0x00A879CF, + VSYNCTEARCONTROL_ID = 0x005A375C, + TOTAL_DWORD_SETTING_NUM = 92, + TOTAL_WSTRING_SETTING_NUM = 4, + TOTAL_SETTING_NUM = 96, + INVALID_SETTING_ID = 0xFFFFFFFF + } + + public enum EValues_OGL_AA_LINE_GAMMA : uint { + OGL_AA_LINE_GAMMA_DISABLED = 0x10, + OGL_AA_LINE_GAMMA_ENABLED = 0x23, + OGL_AA_LINE_GAMMA_MIN = 1, + OGL_AA_LINE_GAMMA_MAX = 100, + OGL_AA_LINE_GAMMA_NUM_VALUES = 4, + OGL_AA_LINE_GAMMA_DEFAULT = OGL_AA_LINE_GAMMA_DISABLED + } + + public enum EValues_OGL_DEEP_COLOR_SCANOUT : uint { + OGL_DEEP_COLOR_SCANOUT_DISABLE = 0, + OGL_DEEP_COLOR_SCANOUT_ENABLE = 1, + OGL_DEEP_COLOR_SCANOUT_NUM_VALUES = 2, + OGL_DEEP_COLOR_SCANOUT_DEFAULT = OGL_DEEP_COLOR_SCANOUT_ENABLE + } + + public enum EValues_OGL_DEFAULT_SWAP_INTERVAL : uint { + OGL_DEFAULT_SWAP_INTERVAL_TEAR = 0, + OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE = 1, + OGL_DEFAULT_SWAP_INTERVAL_VSYNC = 1, + OGL_DEFAULT_SWAP_INTERVAL_VALUE_MASK = 0x0000FFFF, + OGL_DEFAULT_SWAP_INTERVAL_FORCE_MASK = 0xF0000000, + OGL_DEFAULT_SWAP_INTERVAL_FORCE_OFF = 0xF0000000, + OGL_DEFAULT_SWAP_INTERVAL_FORCE_ON = 0x10000000, + OGL_DEFAULT_SWAP_INTERVAL_APP_CONTROLLED = 0x00000000, + OGL_DEFAULT_SWAP_INTERVAL_DISABLE = 0xffffffff, + OGL_DEFAULT_SWAP_INTERVAL_NUM_VALUES = 9, + OGL_DEFAULT_SWAP_INTERVAL_DEFAULT = OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE + } + + public enum EValues_OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL : uint { + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ZERO_SCANLINES = 0, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ONE_FULL_FRAME_OF_SCANLINES = 100, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_NUM_VALUES = 2, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_DEFAULT = 0 + } + + public enum EValues_OGL_DEFAULT_SWAP_INTERVAL_SIGN : uint { + OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE = 0, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_NEGATIVE = 1, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_NUM_VALUES = 2, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_DEFAULT = OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE + } + + public enum EValues_OGL_EVENT_LOG_SEVERITY_THRESHOLD : uint { + OGL_EVENT_LOG_SEVERITY_THRESHOLD_DISABLE = 0, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_CRITICAL = 1, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_WARNING = 2, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_INFORMATION = 3, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL = 4, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_NUM_VALUES = 5, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_DEFAULT = OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL + } + + public enum EValues_OGL_FORCE_BLIT : uint { + OGL_FORCE_BLIT_ON = 1, + OGL_FORCE_BLIT_OFF = 0, + OGL_FORCE_BLIT_NUM_VALUES = 2, + OGL_FORCE_BLIT_DEFAULT = OGL_FORCE_BLIT_OFF + } + + public enum EValues_OGL_FORCE_STEREO : uint { + OGL_FORCE_STEREO_OFF = 0, + OGL_FORCE_STEREO_ON = 1, + OGL_FORCE_STEREO_NUM_VALUES = 2, + OGL_FORCE_STEREO_DEFAULT = OGL_FORCE_STEREO_OFF + } + + public enum EValues_OGL_OVERLAY_PIXEL_TYPE : uint { + OGL_OVERLAY_PIXEL_TYPE_NONE = 0x0, + OGL_OVERLAY_PIXEL_TYPE_CI = 0x1, + OGL_OVERLAY_PIXEL_TYPE_RGBA = 0x2, + OGL_OVERLAY_PIXEL_TYPE_CI_AND_RGBA = 0x3, + OGL_OVERLAY_PIXEL_TYPE_NUM_VALUES = 4, + OGL_OVERLAY_PIXEL_TYPE_DEFAULT = OGL_OVERLAY_PIXEL_TYPE_CI + } + + public enum EValues_OGL_OVERLAY_SUPPORT : uint { + OGL_OVERLAY_SUPPORT_OFF = 0, + OGL_OVERLAY_SUPPORT_ON = 1, + OGL_OVERLAY_SUPPORT_FORCE_SW = 2, + OGL_OVERLAY_SUPPORT_NUM_VALUES = 3, + OGL_OVERLAY_SUPPORT_DEFAULT = OGL_OVERLAY_SUPPORT_OFF + } + + public enum EValues_OGL_QUALITY_ENHANCEMENTS : uint { + OGL_QUALITY_ENHANCEMENTS_HQUAL = 0xfffffff6, + OGL_QUALITY_ENHANCEMENTS_QUAL = 0, + OGL_QUALITY_ENHANCEMENTS_PERF = 10, + OGL_QUALITY_ENHANCEMENTS_HPERF = 20, + OGL_QUALITY_ENHANCEMENTS_NUM_VALUES = 4, + OGL_QUALITY_ENHANCEMENTS_DEFAULT = OGL_QUALITY_ENHANCEMENTS_QUAL + } + + public enum EValues_OGL_SINGLE_BACKDEPTH_BUFFER : uint { + OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE = 0x0, + OGL_SINGLE_BACKDEPTH_BUFFER_ENABLE = 0x1, + OGL_SINGLE_BACKDEPTH_BUFFER_USE_HW_DEFAULT = 0xffffffff, + OGL_SINGLE_BACKDEPTH_BUFFER_NUM_VALUES = 3, + OGL_SINGLE_BACKDEPTH_BUFFER_DEFAULT = OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE + } + + public enum EValues_OGL_SLI_CFR_MODE : uint { + OGL_SLI_CFR_MODE_DISABLE = 0x00, + OGL_SLI_CFR_MODE_ENABLE = 0x01, + OGL_SLI_CFR_MODE_CLASSIC_SFR = 0x02, + OGL_SLI_CFR_MODE_NUM_VALUES = 3, + OGL_SLI_CFR_MODE_DEFAULT = OGL_SLI_CFR_MODE_DISABLE + } + + public enum EValues_OGL_SLI_MULTICAST : uint { + OGL_SLI_MULTICAST_DISABLE = 0x00, + OGL_SLI_MULTICAST_ENABLE = 0x01, + OGL_SLI_MULTICAST_FORCE_DISABLE = 0x02, + OGL_SLI_MULTICAST_ALLOW_MOSAIC = 0x04, + OGL_SLI_MULTICAST_NUM_VALUES = 4, + OGL_SLI_MULTICAST_DEFAULT = OGL_SLI_MULTICAST_DISABLE + } + + public enum EValues_OGL_THREAD_CONTROL : uint { + OGL_THREAD_CONTROL_ENABLE = 0x00000001, + OGL_THREAD_CONTROL_DISABLE = 0x00000002, + OGL_THREAD_CONTROL_NUM_VALUES = 2, + OGL_THREAD_CONTROL_DEFAULT = 0 + } + + public enum EValues_OGL_TMON_LEVEL : uint { + OGL_TMON_LEVEL_DISABLE = 0, + OGL_TMON_LEVEL_CRITICAL = 1, + OGL_TMON_LEVEL_WARNING = 2, + OGL_TMON_LEVEL_INFORMATION = 3, + OGL_TMON_LEVEL_MOST = 4, + OGL_TMON_LEVEL_VERBOSE = 5, + OGL_TMON_LEVEL_NUM_VALUES = 6, + OGL_TMON_LEVEL_DEFAULT = OGL_TMON_LEVEL_MOST + } + + public enum EValues_OGL_TRIPLE_BUFFER : uint { + OGL_TRIPLE_BUFFER_DISABLED = 0x00000000, + OGL_TRIPLE_BUFFER_ENABLED = 0x00000001, + OGL_TRIPLE_BUFFER_NUM_VALUES = 2, + OGL_TRIPLE_BUFFER_DEFAULT = OGL_TRIPLE_BUFFER_DISABLED + } + + public enum EValues_AA_BEHAVIOR_FLAGS : uint { + AA_BEHAVIOR_FLAGS_NONE = 0x00000000, + AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_APP_CONTROLLED = 0x00000001, + AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_ENHANCE = 0x00000002, + AA_BEHAVIOR_FLAGS_DISABLE_OVERRIDE = 0x00000003, + AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_APP_CONTROLLED = 0x00000004, + AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_OVERRIDE = 0x00000008, + AA_BEHAVIOR_FLAGS_DISABLE_ENHANCE = 0x0000000c, + AA_BEHAVIOR_FLAGS_MAP_VCAA_TO_MULTISAMPLING = 0x00010000, + AA_BEHAVIOR_FLAGS_SLI_DISABLE_TRANSPARENCY_SUPERSAMPLING = 0x00020000, + AA_BEHAVIOR_FLAGS_DISABLE_CPLAA = 0x00040000, + AA_BEHAVIOR_FLAGS_SKIP_RT_DIM_CHECK_FOR_ENHANCE = 0x00080000, + AA_BEHAVIOR_FLAGS_DISABLE_SLIAA = 0x00100000, + AA_BEHAVIOR_FLAGS_DEFAULT = 0x00000000, + AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4 = 0xf0000000, + AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4_SHIFT = 28, + AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4 = 0x0f000000, + AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4_SHIFT = 24, + AA_BEHAVIOR_FLAGS_MASK = 0xff1f000f, + AA_BEHAVIOR_FLAGS_NUM_VALUES = 18, + } + + public enum EValues_AA_MODE_ALPHATOCOVERAGE : uint { + AA_MODE_ALPHATOCOVERAGE_MODE_MASK = 0x00000004, + AA_MODE_ALPHATOCOVERAGE_MODE_OFF = 0x00000000, + AA_MODE_ALPHATOCOVERAGE_MODE_ON = 0x00000004, + AA_MODE_ALPHATOCOVERAGE_MODE_MAX = 0x00000004, + AA_MODE_ALPHATOCOVERAGE_NUM_VALUES = 4, + AA_MODE_ALPHATOCOVERAGE_DEFAULT = 0x00000000 + } + + public enum EValues_AA_MODE_GAMMACORRECTION : uint { + AA_MODE_GAMMACORRECTION_MASK = 0x00000003, + AA_MODE_GAMMACORRECTION_OFF = 0x00000000, + AA_MODE_GAMMACORRECTION_ON_IF_FOS = 0x00000001, + AA_MODE_GAMMACORRECTION_ON_ALWAYS = 0x00000002, + AA_MODE_GAMMACORRECTION_MAX = 0x00000002, + AA_MODE_GAMMACORRECTION_DEFAULT = 0x00000000, + AA_MODE_GAMMACORRECTION_DEFAULT_TESLA = 0x00000002, + AA_MODE_GAMMACORRECTION_DEFAULT_FERMI = 0x00000002, + AA_MODE_GAMMACORRECTION_NUM_VALUES = 8, + } + + public enum EValues_AA_MODE_METHOD : uint { + AA_MODE_METHOD_NONE = 0x0, + AA_MODE_METHOD_SUPERSAMPLE_2X_H = 0x1, + AA_MODE_METHOD_SUPERSAMPLE_2X_V = 0x2, + AA_MODE_METHOD_SUPERSAMPLE_1_5X1_5 = 0x2, + AA_MODE_METHOD_FREE_0x03 = 0x3, + AA_MODE_METHOD_FREE_0x04 = 0x4, + AA_MODE_METHOD_SUPERSAMPLE_4X = 0x5, + AA_MODE_METHOD_SUPERSAMPLE_4X_BIAS = 0x6, + AA_MODE_METHOD_SUPERSAMPLE_4X_GAUSSIAN = 0x7, + AA_MODE_METHOD_FREE_0x08 = 0x8, + AA_MODE_METHOD_FREE_0x09 = 0x9, + AA_MODE_METHOD_SUPERSAMPLE_9X = 0xA, + AA_MODE_METHOD_SUPERSAMPLE_9X_BIAS = 0xB, + AA_MODE_METHOD_SUPERSAMPLE_16X = 0xC, + AA_MODE_METHOD_SUPERSAMPLE_16X_BIAS = 0xD, + AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL = 0xE, + AA_MODE_METHOD_MULTISAMPLE_2X_QUINCUNX = 0xF, + AA_MODE_METHOD_MULTISAMPLE_4X = 0x10, + AA_MODE_METHOD_FREE_0x11 = 0x11, + AA_MODE_METHOD_MULTISAMPLE_4X_GAUSSIAN = 0x12, + AA_MODE_METHOD_MIXEDSAMPLE_4X_SKEWED_4TAP = 0x13, + AA_MODE_METHOD_FREE_0x14 = 0x14, + AA_MODE_METHOD_FREE_0x15 = 0x15, + AA_MODE_METHOD_MIXEDSAMPLE_6X = 0x16, + AA_MODE_METHOD_MIXEDSAMPLE_6X_SKEWED_6TAP = 0x17, + AA_MODE_METHOD_MIXEDSAMPLE_8X = 0x18, + AA_MODE_METHOD_MIXEDSAMPLE_8X_SKEWED_8TAP = 0x19, + AA_MODE_METHOD_MIXEDSAMPLE_16X = 0x1a, + AA_MODE_METHOD_MULTISAMPLE_4X_GAMMA = 0x1b, + AA_MODE_METHOD_MULTISAMPLE_16X = 0x1c, + AA_MODE_METHOD_VCAA_32X_8v24 = 0x1d, + AA_MODE_METHOD_CORRUPTION_CHECK = 0x1e, + AA_MODE_METHOD_6X_CT = 0x1f, + AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_GAMMA = 0x20, + AA_MODE_METHOD_SUPERSAMPLE_4X_GAMMA = 0x21, + AA_MODE_METHOD_MULTISAMPLE_4X_FOSGAMMA = 0x22, + AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_FOSGAMMA = 0x23, + AA_MODE_METHOD_SUPERSAMPLE_4X_FOSGAMMA = 0x24, + AA_MODE_METHOD_MULTISAMPLE_8X = 0x25, + AA_MODE_METHOD_VCAA_8X_4v4 = 0x26, + AA_MODE_METHOD_VCAA_16X_4v12 = 0x27, + AA_MODE_METHOD_VCAA_16X_8v8 = 0x28, + AA_MODE_METHOD_MIXEDSAMPLE_32X = 0x29, + AA_MODE_METHOD_SUPERVCAA_64X_4v12 = 0x2a, + AA_MODE_METHOD_SUPERVCAA_64X_8v8 = 0x2b, + AA_MODE_METHOD_MIXEDSAMPLE_64X = 0x2c, + AA_MODE_METHOD_MIXEDSAMPLE_128X = 0x2d, + AA_MODE_METHOD_COUNT = 0x2e, + AA_MODE_METHOD_METHOD_MASK = 0x0000ffff, + AA_MODE_METHOD_METHOD_MAX = 0xf1c57815, + AA_MODE_METHOD_NUM_VALUES = 50, + AA_MODE_METHOD_DEFAULT = AA_MODE_METHOD_NONE + } + + public enum EValues_AA_MODE_REPLAY : uint { + AA_MODE_REPLAY_SAMPLES_MASK = 0x00000070, + AA_MODE_REPLAY_SAMPLES_ONE = 0x00000000, + AA_MODE_REPLAY_SAMPLES_TWO = 0x00000010, + AA_MODE_REPLAY_SAMPLES_FOUR = 0x00000020, + AA_MODE_REPLAY_SAMPLES_EIGHT = 0x00000030, + AA_MODE_REPLAY_SAMPLES_MAX = 0x00000030, + AA_MODE_REPLAY_MODE_MASK = 0x0000000f, + AA_MODE_REPLAY_MODE_OFF = 0x00000000, + AA_MODE_REPLAY_MODE_ALPHA_TEST = 0x00000001, + AA_MODE_REPLAY_MODE_PIXEL_KILL = 0x00000002, + AA_MODE_REPLAY_MODE_DYN_BRANCH = 0x00000004, + AA_MODE_REPLAY_MODE_OPTIMAL = 0x00000004, + AA_MODE_REPLAY_MODE_ALL = 0x00000008, + AA_MODE_REPLAY_MODE_MAX = 0x0000000f, + AA_MODE_REPLAY_TRANSPARENCY = 0x00000023, + AA_MODE_REPLAY_DISALLOW_TRAA = 0x00000100, + AA_MODE_REPLAY_TRANSPARENCY_DEFAULT = 0x00000000, + AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_TESLA = 0x00000000, + AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_FERMI = 0x00000000, + AA_MODE_REPLAY_MASK = 0x0000017f, + AA_MODE_REPLAY_NUM_VALUES = 20, + AA_MODE_REPLAY_DEFAULT = 0x00000000 + } + + public enum EValues_AA_MODE_SELECTOR : uint { + AA_MODE_SELECTOR_MASK = 0x00000003, + AA_MODE_SELECTOR_APP_CONTROL = 0x00000000, + AA_MODE_SELECTOR_OVERRIDE = 0x00000001, + AA_MODE_SELECTOR_ENHANCE = 0x00000002, + AA_MODE_SELECTOR_MAX = 0x00000002, + AA_MODE_SELECTOR_NUM_VALUES = 5, + AA_MODE_SELECTOR_DEFAULT = AA_MODE_SELECTOR_APP_CONTROL + } + + public enum EValues_AA_MODE_SELECTOR_SLIAA : uint { + AA_MODE_SELECTOR_SLIAA_DISABLED = 0, + AA_MODE_SELECTOR_SLIAA_ENABLED = 1, + AA_MODE_SELECTOR_SLIAA_NUM_VALUES = 2, + AA_MODE_SELECTOR_SLIAA_DEFAULT = AA_MODE_SELECTOR_SLIAA_DISABLED + } + + public enum EValues_ANISO_MODE_LEVEL : uint { + ANISO_MODE_LEVEL_MASK = 0x0000ffff, + ANISO_MODE_LEVEL_NONE_POINT = 0x00000000, + ANISO_MODE_LEVEL_NONE_LINEAR = 0x00000001, + ANISO_MODE_LEVEL_MAX = 0x00000010, + ANISO_MODE_LEVEL_DEFAULT = 0x00000001, + ANISO_MODE_LEVEL_NUM_VALUES = 5, + } + + public enum EValues_ANISO_MODE_SELECTOR : uint { + ANISO_MODE_SELECTOR_MASK = 0x0000000f, + ANISO_MODE_SELECTOR_APP = 0x00000000, + ANISO_MODE_SELECTOR_USER = 0x00000001, + ANISO_MODE_SELECTOR_COND = 0x00000002, + ANISO_MODE_SELECTOR_MAX = 0x00000002, + ANISO_MODE_SELECTOR_DEFAULT = 0x00000000, + ANISO_MODE_SELECTOR_NUM_VALUES = 6, + } + + public enum EValues_ANSEL_ALLOW : uint { + ANSEL_ALLOW_DISALLOWED = 0, + ANSEL_ALLOW_ALLOWED = 1, + ANSEL_ALLOW_NUM_VALUES = 2, + ANSEL_ALLOW_DEFAULT = ANSEL_ALLOW_ALLOWED + } + + public enum EValues_ANSEL_ALLOWLISTED : uint { + ANSEL_ALLOWLISTED_DISALLOWED = 0, + ANSEL_ALLOWLISTED_ALLOWED = 1, + ANSEL_ALLOWLISTED_NUM_VALUES = 2, + ANSEL_ALLOWLISTED_DEFAULT = ANSEL_ALLOWLISTED_DISALLOWED + } + + public enum EValues_ANSEL_ENABLE : uint { + ANSEL_ENABLE_OFF = 0, + ANSEL_ENABLE_ON = 1, + ANSEL_ENABLE_NUM_VALUES = 2, + ANSEL_ENABLE_DEFAULT = ANSEL_ENABLE_ON + } + + public enum EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT : uint { + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED = 0, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NINE_SECONDS = 9, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_FIFTEEN_SECONDS = 15, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_THIRTY_SECONDS = 30, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ONE_MINUTE = 60, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_TWO_MINUTES = 120, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NUM_VALUES = 6, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DEFAULT = APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED + } + + public enum EValues_BATTERY_BOOST_APP_FPS : uint { + BATTERY_BOOST_APP_FPS_MIN = 0x00000001, + BATTERY_BOOST_APP_FPS_MAX = 0x000003ff, + BATTERY_BOOST_APP_FPS_NO_OVERRIDE = 0x00000000, + BATTERY_BOOST_APP_FPS_NUM_VALUES = 3, + BATTERY_BOOST_APP_FPS_DEFAULT = BATTERY_BOOST_APP_FPS_NO_OVERRIDE + } + + public enum EValues_CPL_HIDDEN_PROFILE : uint { + CPL_HIDDEN_PROFILE_DISABLED = 0, + CPL_HIDDEN_PROFILE_ENABLED = 1, + CPL_HIDDEN_PROFILE_NUM_VALUES = 2, + CPL_HIDDEN_PROFILE_DEFAULT = CPL_HIDDEN_PROFILE_DISABLED + } + + public enum EValues_EXPORT_PERF_COUNTERS : uint { + EXPORT_PERF_COUNTERS_OFF = 0x00000000, + EXPORT_PERF_COUNTERS_ON = 0x00000001, + EXPORT_PERF_COUNTERS_NUM_VALUES = 2, + EXPORT_PERF_COUNTERS_DEFAULT = EXPORT_PERF_COUNTERS_OFF + } + + public enum EValues_EXTERNAL_QUIET_MODE : uint { + EXTERNAL_QUIET_MODE_ON = 0x00000001, + EXTERNAL_QUIET_MODE_OFF = 0x00000000, + EXTERNAL_QUIET_MODE_NUM_VALUES = 2, + EXTERNAL_QUIET_MODE_DEFAULT = EXTERNAL_QUIET_MODE_OFF + } + + public enum EValues_FRL_FPS : uint { + FRL_FPS_DISABLED = 0x00000000, + FRL_FPS_MIN = 0x00000000, + FRL_FPS_MAX = 0x000003ff, + FRL_FPS_NUM_VALUES = 3, + FRL_FPS_DEFAULT = FRL_FPS_DISABLED + } + + public enum EValues_FXAA_ALLOW : uint { + FXAA_ALLOW_DISALLOWED = 0, + FXAA_ALLOW_ALLOWED = 1, + FXAA_ALLOW_NUM_VALUES = 2, + FXAA_ALLOW_DEFAULT = FXAA_ALLOW_ALLOWED + } + + public enum EValues_FXAA_ENABLE : uint { + FXAA_ENABLE_OFF = 0, + FXAA_ENABLE_ON = 1, + FXAA_ENABLE_NUM_VALUES = 2, + FXAA_ENABLE_DEFAULT = FXAA_ENABLE_OFF + } + + public enum EValues_FXAA_INDICATOR_ENABLE : uint { + FXAA_INDICATOR_ENABLE_OFF = 0, + FXAA_INDICATOR_ENABLE_ON = 1, + FXAA_INDICATOR_ENABLE_NUM_VALUES = 2, + FXAA_INDICATOR_ENABLE_DEFAULT = FXAA_INDICATOR_ENABLE_OFF + } + + public enum EValues_MCSFRSHOWSPLIT : uint { + MCSFRSHOWSPLIT_DISABLED = 0x34534064, + MCSFRSHOWSPLIT_ENABLED = 0x24545582, + MCSFRSHOWSPLIT_NUM_VALUES = 2, + MCSFRSHOWSPLIT_DEFAULT = MCSFRSHOWSPLIT_DISABLED + } + + public enum EValues_NV_QUALITY_UPSCALING : uint { + NV_QUALITY_UPSCALING_OFF = 0, + NV_QUALITY_UPSCALING_ON = 1, + NV_QUALITY_UPSCALING_NUM_VALUES = 2, + NV_QUALITY_UPSCALING_DEFAULT = NV_QUALITY_UPSCALING_OFF + } + + public enum EValues_OPTIMUS_MAXAA : uint { + OPTIMUS_MAXAA_MIN = 0, + OPTIMUS_MAXAA_MAX = 16, + OPTIMUS_MAXAA_NUM_VALUES = 2, + OPTIMUS_MAXAA_DEFAULT = 0 + } + + public enum EValues_PHYSXINDICATOR : uint { + PHYSXINDICATOR_DISABLED = 0x34534064, + PHYSXINDICATOR_ENABLED = 0x24545582, + PHYSXINDICATOR_NUM_VALUES = 2, + PHYSXINDICATOR_DEFAULT = PHYSXINDICATOR_DISABLED + } + + public enum EValues_PREFERRED_PSTATE : uint { + PREFERRED_PSTATE_ADAPTIVE = 0x00000000, + PREFERRED_PSTATE_PREFER_MAX = 0x00000001, + PREFERRED_PSTATE_DRIVER_CONTROLLED = 0x00000002, + PREFERRED_PSTATE_PREFER_CONSISTENT_PERFORMANCE = 0x00000003, + PREFERRED_PSTATE_PREFER_MIN = 0x00000004, + PREFERRED_PSTATE_OPTIMAL_POWER = 0x00000005, + PREFERRED_PSTATE_MIN = 0x00000000, + PREFERRED_PSTATE_MAX = 0x00000005, + PREFERRED_PSTATE_NUM_VALUES = 8, + PREFERRED_PSTATE_DEFAULT = PREFERRED_PSTATE_OPTIMAL_POWER + } + + public enum EValues_PREVENT_UI_AF_OVERRIDE : uint { + PREVENT_UI_AF_OVERRIDE_OFF = 0, + PREVENT_UI_AF_OVERRIDE_ON = 1, + PREVENT_UI_AF_OVERRIDE_NUM_VALUES = 2, + PREVENT_UI_AF_OVERRIDE_DEFAULT = PREVENT_UI_AF_OVERRIDE_OFF + } + + public enum EValues_SHIM_MCCOMPAT : uint { + SHIM_MCCOMPAT_INTEGRATED = 0x00000000, + SHIM_MCCOMPAT_ENABLE = 0x00000001, + SHIM_MCCOMPAT_USER_EDITABLE = 0x00000002, + SHIM_MCCOMPAT_MASK = 0x00000003, + SHIM_MCCOMPAT_VIDEO_MASK = 0x00000004, + SHIM_MCCOMPAT_VARYING_BIT = 0x00000008, + SHIM_MCCOMPAT_AUTO_SELECT = 0x00000010, + SHIM_MCCOMPAT_OVERRIDE_BIT = 0x80000000, + SHIM_MCCOMPAT_NUM_VALUES = 8, + SHIM_MCCOMPAT_DEFAULT = SHIM_MCCOMPAT_AUTO_SELECT + } + + public enum EValues_SHIM_RENDERING_MODE : uint { + SHIM_RENDERING_MODE_INTEGRATED = 0x00000000, + SHIM_RENDERING_MODE_ENABLE = 0x00000001, + SHIM_RENDERING_MODE_USER_EDITABLE = 0x00000002, + SHIM_RENDERING_MODE_MASK = 0x00000003, + SHIM_RENDERING_MODE_VIDEO_MASK = 0x00000004, + SHIM_RENDERING_MODE_VARYING_BIT = 0x00000008, + SHIM_RENDERING_MODE_AUTO_SELECT = 0x00000010, + SHIM_RENDERING_MODE_OVERRIDE_BIT = 0x80000000, + SHIM_RENDERING_MODE_NUM_VALUES = 8, + SHIM_RENDERING_MODE_DEFAULT = SHIM_RENDERING_MODE_AUTO_SELECT + } + + public enum EValues_SHIM_RENDERING_OPTIONS : uint { + SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE = 0x00000000, + SHIM_RENDERING_OPTIONS_DISABLE_ASYNC_PRESENT = 0x00000001, + SHIM_RENDERING_OPTIONS_EHSHELL_DETECT = 0x00000002, + SHIM_RENDERING_OPTIONS_FLASHPLAYER_HOST_DETECT = 0x00000004, + SHIM_RENDERING_OPTIONS_VIDEO_DRM_APP_DETECT = 0x00000008, + SHIM_RENDERING_OPTIONS_IGNORE_OVERRIDES = 0x00000010, + SHIM_RENDERING_OPTIONS_RESERVED1 = 0x00000020, + SHIM_RENDERING_OPTIONS_ENABLE_DWM_ASYNC_PRESENT = 0x00000040, + SHIM_RENDERING_OPTIONS_RESERVED2 = 0x00000080, + SHIM_RENDERING_OPTIONS_ALLOW_INHERITANCE = 0x00000100, + SHIM_RENDERING_OPTIONS_DISABLE_WRAPPERS = 0x00000200, + SHIM_RENDERING_OPTIONS_DISABLE_DXGI_WRAPPERS = 0x00000400, + SHIM_RENDERING_OPTIONS_PRUNE_UNSUPPORTED_FORMATS = 0x00000800, + SHIM_RENDERING_OPTIONS_ENABLE_ALPHA_FORMAT = 0x00001000, + SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING = 0x00002000, + SHIM_RENDERING_OPTIONS_DISABLE_CUDA = 0x00004000, + SHIM_RENDERING_OPTIONS_ALLOW_CP_CAPS_FOR_VIDEO = 0x00008000, + SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING_FWD_OPTIMUS = 0x00010000, + SHIM_RENDERING_OPTIONS_DISABLE_DURING_SECURE_BOOT = 0x00020000, + SHIM_RENDERING_OPTIONS_INVERT_FOR_QUADRO = 0x00040000, + SHIM_RENDERING_OPTIONS_INVERT_FOR_MSHYBRID = 0x00080000, + SHIM_RENDERING_OPTIONS_REGISTER_PROCESS_ENABLE_GOLD = 0x00100000, + SHIM_RENDERING_OPTIONS_HANDLE_WINDOWED_MODE_PERF_OPT = 0x00200000, + SHIM_RENDERING_OPTIONS_HANDLE_WIN7_ASYNC_RUNTIME_BUG = 0x00400000, + SHIM_RENDERING_OPTIONS_EXPLICIT_ADAPTER_OPTED_BY_APP = 0x00800000, + SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x01000000, + SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x02000000, + SHIM_RENDERING_OPTIONS_DISABLE_TURING_POWER_POLICY = 0x04000000, + SHIM_RENDERING_OPTIONS_NUM_VALUES = 28, + SHIM_RENDERING_OPTIONS_DEFAULT = 0x00000000 + } + + public enum EValues_SLI_GPU_COUNT : uint { + SLI_GPU_COUNT_AUTOSELECT = 0x00000000, + SLI_GPU_COUNT_ONE = 0x00000001, + SLI_GPU_COUNT_TWO = 0x00000002, + SLI_GPU_COUNT_THREE = 0x00000003, + SLI_GPU_COUNT_FOUR = 0x00000004, + SLI_GPU_COUNT_NUM_VALUES = 5, + SLI_GPU_COUNT_DEFAULT = SLI_GPU_COUNT_AUTOSELECT + } + + public enum EValues_SLI_PREDEFINED_GPU_COUNT : uint { + SLI_PREDEFINED_GPU_COUNT_AUTOSELECT = 0x00000000, + SLI_PREDEFINED_GPU_COUNT_ONE = 0x00000001, + SLI_PREDEFINED_GPU_COUNT_TWO = 0x00000002, + SLI_PREDEFINED_GPU_COUNT_THREE = 0x00000003, + SLI_PREDEFINED_GPU_COUNT_FOUR = 0x00000004, + SLI_PREDEFINED_GPU_COUNT_NUM_VALUES = 5, + SLI_PREDEFINED_GPU_COUNT_DEFAULT = SLI_PREDEFINED_GPU_COUNT_AUTOSELECT + } + + public enum EValues_SLI_PREDEFINED_GPU_COUNT_DX10 : uint { + SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT = 0x00000000, + SLI_PREDEFINED_GPU_COUNT_DX10_ONE = 0x00000001, + SLI_PREDEFINED_GPU_COUNT_DX10_TWO = 0x00000002, + SLI_PREDEFINED_GPU_COUNT_DX10_THREE = 0x00000003, + SLI_PREDEFINED_GPU_COUNT_DX10_FOUR = 0x00000004, + SLI_PREDEFINED_GPU_COUNT_DX10_NUM_VALUES = 5, + SLI_PREDEFINED_GPU_COUNT_DX10_DEFAULT = SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT + } + + public enum EValues_SLI_PREDEFINED_MODE : uint { + SLI_PREDEFINED_MODE_AUTOSELECT = 0x00000000, + SLI_PREDEFINED_MODE_FORCE_SINGLE = 0x00000001, + SLI_PREDEFINED_MODE_FORCE_AFR = 0x00000002, + SLI_PREDEFINED_MODE_FORCE_AFR2 = 0x00000003, + SLI_PREDEFINED_MODE_FORCE_SFR = 0x00000004, + SLI_PREDEFINED_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, + SLI_PREDEFINED_MODE_NUM_VALUES = 6, + SLI_PREDEFINED_MODE_DEFAULT = SLI_PREDEFINED_MODE_AUTOSELECT + } + + public enum EValues_SLI_PREDEFINED_MODE_DX10 : uint { + SLI_PREDEFINED_MODE_DX10_AUTOSELECT = 0x00000000, + SLI_PREDEFINED_MODE_DX10_FORCE_SINGLE = 0x00000001, + SLI_PREDEFINED_MODE_DX10_FORCE_AFR = 0x00000002, + SLI_PREDEFINED_MODE_DX10_FORCE_AFR2 = 0x00000003, + SLI_PREDEFINED_MODE_DX10_FORCE_SFR = 0x00000004, + SLI_PREDEFINED_MODE_DX10_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, + SLI_PREDEFINED_MODE_DX10_NUM_VALUES = 6, + SLI_PREDEFINED_MODE_DX10_DEFAULT = SLI_PREDEFINED_MODE_DX10_AUTOSELECT + } + + public enum EValues_SLI_RENDERING_MODE : uint { + SLI_RENDERING_MODE_AUTOSELECT = 0x00000000, + SLI_RENDERING_MODE_FORCE_SINGLE = 0x00000001, + SLI_RENDERING_MODE_FORCE_AFR = 0x00000002, + SLI_RENDERING_MODE_FORCE_AFR2 = 0x00000003, + SLI_RENDERING_MODE_FORCE_SFR = 0x00000004, + SLI_RENDERING_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, + SLI_RENDERING_MODE_NUM_VALUES = 6, + SLI_RENDERING_MODE_DEFAULT = SLI_RENDERING_MODE_AUTOSELECT + } + + public enum EValues_VRPRERENDERLIMIT : uint { + VRPRERENDERLIMIT_MIN = 0x00, + VRPRERENDERLIMIT_MAX = 0xff, + VRPRERENDERLIMIT_APP_CONTROLLED = 0x00, + VRPRERENDERLIMIT_DEFAULT = 0x01, + VRPRERENDERLIMIT_NUM_VALUES = 4, + } + + public enum EValues_VRRFEATUREINDICATOR : uint { + VRRFEATUREINDICATOR_DISABLED = 0x0, + VRRFEATUREINDICATOR_ENABLED = 0x1, + VRRFEATUREINDICATOR_NUM_VALUES = 2, + VRRFEATUREINDICATOR_DEFAULT = VRRFEATUREINDICATOR_ENABLED + } + + public enum EValues_VRROVERLAYINDICATOR : uint { + VRROVERLAYINDICATOR_DISABLED = 0x0, + VRROVERLAYINDICATOR_ENABLED = 0x1, + VRROVERLAYINDICATOR_NUM_VALUES = 2, + VRROVERLAYINDICATOR_DEFAULT = VRROVERLAYINDICATOR_ENABLED + } + + public enum EValues_VRRREQUESTSTATE : uint { + VRRREQUESTSTATE_DISABLED = 0x0, + VRRREQUESTSTATE_FULLSCREEN_ONLY = 0x1, + VRRREQUESTSTATE_FULLSCREEN_AND_WINDOWED = 0x2, + VRRREQUESTSTATE_NUM_VALUES = 3, + VRRREQUESTSTATE_DEFAULT = VRRREQUESTSTATE_FULLSCREEN_ONLY + } + + public enum EValues_VRR_APP_OVERRIDE : uint { + VRR_APP_OVERRIDE_ALLOW = 0, + VRR_APP_OVERRIDE_FORCE_OFF = 1, + VRR_APP_OVERRIDE_DISALLOW = 2, + VRR_APP_OVERRIDE_ULMB = 3, + VRR_APP_OVERRIDE_FIXED_REFRESH = 4, + VRR_APP_OVERRIDE_NUM_VALUES = 5, + VRR_APP_OVERRIDE_DEFAULT = VRR_APP_OVERRIDE_ALLOW + } + + public enum EValues_VRR_APP_OVERRIDE_REQUEST_STATE : uint { + VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW = 0, + VRR_APP_OVERRIDE_REQUEST_STATE_FORCE_OFF = 1, + VRR_APP_OVERRIDE_REQUEST_STATE_DISALLOW = 2, + VRR_APP_OVERRIDE_REQUEST_STATE_ULMB = 3, + VRR_APP_OVERRIDE_REQUEST_STATE_FIXED_REFRESH = 4, + VRR_APP_OVERRIDE_REQUEST_STATE_NUM_VALUES = 5, + VRR_APP_OVERRIDE_REQUEST_STATE_DEFAULT = VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW + } + + public enum EValues_VRR_MODE : uint { + VRR_MODE_DISABLED = 0x0, + VRR_MODE_FULLSCREEN_ONLY = 0x1, + VRR_MODE_FULLSCREEN_AND_WINDOWED = 0x2, + VRR_MODE_NUM_VALUES = 3, + VRR_MODE_DEFAULT = VRR_MODE_FULLSCREEN_ONLY + } + + public enum EValues_VSYNCSMOOTHAFR : uint { + VSYNCSMOOTHAFR_OFF = 0x00000000, + VSYNCSMOOTHAFR_ON = 0x00000001, + VSYNCSMOOTHAFR_NUM_VALUES = 2, + VSYNCSMOOTHAFR_DEFAULT = VSYNCSMOOTHAFR_OFF + } + + public enum EValues_VSYNCVRRCONTROL : uint { + VSYNCVRRCONTROL_DISABLE = 0x00000000, + VSYNCVRRCONTROL_ENABLE = 0x00000001, + VSYNCVRRCONTROL_NOTSUPPORTED = 0x9f95128e, + VSYNCVRRCONTROL_NUM_VALUES = 3, + VSYNCVRRCONTROL_DEFAULT = VSYNCVRRCONTROL_ENABLE + } + + public enum EValues_VSYNC_BEHAVIOR_FLAGS : uint { + VSYNC_BEHAVIOR_FLAGS_NONE = 0x00000000, + VSYNC_BEHAVIOR_FLAGS_DEFAULT = 0x00000000, + VSYNC_BEHAVIOR_FLAGS_IGNORE_FLIPINTERVAL_MULTIPLE = 0x00000001, + VSYNC_BEHAVIOR_FLAGS_NUM_VALUES = 3, + } + + public enum EValues_WKS_API_STEREO_EYES_EXCHANGE : uint { + WKS_API_STEREO_EYES_EXCHANGE_OFF = 0, + WKS_API_STEREO_EYES_EXCHANGE_ON = 1, + WKS_API_STEREO_EYES_EXCHANGE_NUM_VALUES = 2, + WKS_API_STEREO_EYES_EXCHANGE_DEFAULT = WKS_API_STEREO_EYES_EXCHANGE_OFF + } + + public enum EValues_WKS_API_STEREO_MODE : uint { + WKS_API_STEREO_MODE_SHUTTER_GLASSES = 0, + WKS_API_STEREO_MODE_VERTICAL_INTERLACED = 1, + WKS_API_STEREO_MODE_TWINVIEW = 2, + WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_AUTO = 3, + WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC0 = 4, + WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC1 = 5, + WKS_API_STEREO_MODE_COLOR_LINE = 6, + WKS_API_STEREO_MODE_COLOR_INTERLEAVED = 7, + WKS_API_STEREO_MODE_ANAGLYPH = 8, + WKS_API_STEREO_MODE_HORIZONTAL_INTERLACED = 9, + WKS_API_STEREO_MODE_SIDE_FIELD = 10, + WKS_API_STEREO_MODE_SUB_FIELD = 11, + WKS_API_STEREO_MODE_CHECKERBOARD = 12, + WKS_API_STEREO_MODE_INVERSE_CHECKERBOARD = 13, + WKS_API_STEREO_MODE_TRIDELITY_SL = 14, + WKS_API_STEREO_MODE_TRIDELITY_MV = 15, + WKS_API_STEREO_MODE_SEEFRONT = 16, + WKS_API_STEREO_MODE_STEREO_MIRROR = 17, + WKS_API_STEREO_MODE_FRAME_SEQUENTIAL = 18, + WKS_API_STEREO_MODE_AUTODETECT_PASSIVE_MODE = 19, + WKS_API_STEREO_MODE_AEGIS_DT_FRAME_SEQUENTIAL = 20, + WKS_API_STEREO_MODE_OEM_EMITTER_FRAME_SEQUENTIAL = 21, + WKS_API_STEREO_MODE_DP_INBAND = 22, + WKS_API_STEREO_MODE_USE_HW_DEFAULT = 0xffffffff, + WKS_API_STEREO_MODE_DEFAULT_GL = 3, + WKS_API_STEREO_MODE_NUM_VALUES = 25, + WKS_API_STEREO_MODE_DEFAULT = WKS_API_STEREO_MODE_SHUTTER_GLASSES + } + + public enum EValues_WKS_MEMORY_ALLOCATION_POLICY : uint { + WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED = 0x0, + WKS_MEMORY_ALLOCATION_POLICY_MODERATE_PRE_ALLOCATION = 0x1, + WKS_MEMORY_ALLOCATION_POLICY_AGGRESSIVE_PRE_ALLOCATION = 0x2, + WKS_MEMORY_ALLOCATION_POLICY_NUM_VALUES = 3, + WKS_MEMORY_ALLOCATION_POLICY_DEFAULT = WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED + } + + public enum EValues_WKS_STEREO_DONGLE_SUPPORT : uint { + WKS_STEREO_DONGLE_SUPPORT_OFF = 0, + WKS_STEREO_DONGLE_SUPPORT_DAC = 1, + WKS_STEREO_DONGLE_SUPPORT_DLP = 2, + WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES = 3, + WKS_STEREO_DONGLE_SUPPORT_DEFAULT = WKS_STEREO_DONGLE_SUPPORT_DAC + } + + public enum EValues_WKS_STEREO_SUPPORT : uint { + WKS_STEREO_SUPPORT_OFF = 0, + WKS_STEREO_SUPPORT_ON = 1, + WKS_STEREO_SUPPORT_NUM_VALUES = 2, + WKS_STEREO_SUPPORT_DEFAULT = WKS_STEREO_SUPPORT_OFF + } + + public enum EValues_WKS_STEREO_SWAP_MODE : uint { + WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL = 0x0, + WKS_STEREO_SWAP_MODE_PER_EYE = 0x1, + WKS_STEREO_SWAP_MODE_PER_EYE_PAIR = 0x2, + WKS_STEREO_SWAP_MODE_LEGACY_BEHAVIOR = 0x3, + WKS_STEREO_SWAP_MODE_PER_EYE_FOR_SWAP_GROUP = 0x4, + WKS_STEREO_SWAP_MODE_NUM_VALUES = 5, + WKS_STEREO_SWAP_MODE_DEFAULT = WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL + } + + public enum EValues_AO_MODE : uint { + AO_MODE_OFF = 0, + AO_MODE_LOW = 1, + AO_MODE_MEDIUM = 2, + AO_MODE_HIGH = 3, + AO_MODE_NUM_VALUES = 4, + AO_MODE_DEFAULT = AO_MODE_OFF + } + + public enum EValues_AO_MODE_ACTIVE : uint { + AO_MODE_ACTIVE_DISABLED = 0, + AO_MODE_ACTIVE_ENABLED = 1, + AO_MODE_ACTIVE_NUM_VALUES = 2, + AO_MODE_ACTIVE_DEFAULT = AO_MODE_ACTIVE_DISABLED + } + + public enum EValues_AUTO_LODBIASADJUST : uint { + AUTO_LODBIASADJUST_OFF = 0x00000000, + AUTO_LODBIASADJUST_ON = 0x00000001, + AUTO_LODBIASADJUST_NUM_VALUES = 2, + AUTO_LODBIASADJUST_DEFAULT = AUTO_LODBIASADJUST_ON + } + + public enum EValues_EXPORT_PERF_COUNTERS_DX9_ONLY : uint { + EXPORT_PERF_COUNTERS_DX9_ONLY_OFF = 0x00000000, + EXPORT_PERF_COUNTERS_DX9_ONLY_ON = 0x00000001, + EXPORT_PERF_COUNTERS_DX9_ONLY_NUM_VALUES = 2, + EXPORT_PERF_COUNTERS_DX9_ONLY_DEFAULT = EXPORT_PERF_COUNTERS_DX9_ONLY_OFF + } + + public enum EValues_LODBIASADJUST : uint { + LODBIASADJUST_MIN = 0xffffff80, + LODBIASADJUST_MAX = 128, + LODBIASADJUST_NUM_VALUES = 2, + LODBIASADJUST_DEFAULT = 0 + } + + public enum EValues_MAXWELL_B_SAMPLE_INTERLEAVE : uint { + MAXWELL_B_SAMPLE_INTERLEAVE_OFF = 0, + MAXWELL_B_SAMPLE_INTERLEAVE_ON = 1, + MAXWELL_B_SAMPLE_INTERLEAVE_NUM_VALUES = 2, + MAXWELL_B_SAMPLE_INTERLEAVE_DEFAULT = MAXWELL_B_SAMPLE_INTERLEAVE_OFF + } + + public enum EValues_PRERENDERLIMIT : uint { + PRERENDERLIMIT_MIN = 0x00, + PRERENDERLIMIT_MAX = 0xff, + PRERENDERLIMIT_APP_CONTROLLED = 0x00, + PRERENDERLIMIT_NUM_VALUES = 3, + PRERENDERLIMIT_DEFAULT = PRERENDERLIMIT_APP_CONTROLLED + } + + public enum EValues_PS_SHADERDISKCACHE : uint { + PS_SHADERDISKCACHE_OFF = 0x00000000, + PS_SHADERDISKCACHE_ON = 0x00000001, + PS_SHADERDISKCACHE_NUM_VALUES = 2, + PS_SHADERDISKCACHE_DEFAULT = 0x1 + } + + public enum EValues_PS_TEXFILTER_ANISO_OPTS2 : uint { + PS_TEXFILTER_ANISO_OPTS2_OFF = 0x00000000, + PS_TEXFILTER_ANISO_OPTS2_ON = 0x00000001, + PS_TEXFILTER_ANISO_OPTS2_NUM_VALUES = 2, + PS_TEXFILTER_ANISO_OPTS2_DEFAULT = PS_TEXFILTER_ANISO_OPTS2_OFF + } + + public enum EValues_PS_TEXFILTER_BILINEAR_IN_ANISO : uint { + PS_TEXFILTER_BILINEAR_IN_ANISO_OFF = 0x00000000, + PS_TEXFILTER_BILINEAR_IN_ANISO_ON = 0x00000001, + PS_TEXFILTER_BILINEAR_IN_ANISO_NUM_VALUES = 2, + PS_TEXFILTER_BILINEAR_IN_ANISO_DEFAULT = PS_TEXFILTER_BILINEAR_IN_ANISO_OFF + } + + public enum EValues_PS_TEXFILTER_DISABLE_TRILIN_SLOPE : uint { + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF = 0x00000000, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ON = 0x00000001, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_NUM_VALUES = 2, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_DEFAULT = PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF + } + + public enum EValues_PS_TEXFILTER_NO_NEG_LODBIAS : uint { + PS_TEXFILTER_NO_NEG_LODBIAS_OFF = 0x00000000, + PS_TEXFILTER_NO_NEG_LODBIAS_ON = 0x00000001, + PS_TEXFILTER_NO_NEG_LODBIAS_NUM_VALUES = 2, + PS_TEXFILTER_NO_NEG_LODBIAS_DEFAULT = PS_TEXFILTER_NO_NEG_LODBIAS_OFF + } + + public enum EValues_QUALITY_ENHANCEMENTS : uint { + QUALITY_ENHANCEMENTS_HIGHQUALITY = 0xfffffff6, + QUALITY_ENHANCEMENTS_QUALITY = 0x00000000, + QUALITY_ENHANCEMENTS_PERFORMANCE = 0x0000000a, + QUALITY_ENHANCEMENTS_HIGHPERFORMANCE = 0x00000014, + QUALITY_ENHANCEMENTS_NUM_VALUES = 4, + QUALITY_ENHANCEMENTS_DEFAULT = QUALITY_ENHANCEMENTS_QUALITY + } + + public enum EValues_QUALITY_ENHANCEMENT_SUBSTITUTION : uint { + QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION = 0x00000000, + QUALITY_ENHANCEMENT_SUBSTITUTION_HIGHQUALITY_BECOMES_QUALITY = 0x00000001, + QUALITY_ENHANCEMENT_SUBSTITUTION_NUM_VALUES = 2, + QUALITY_ENHANCEMENT_SUBSTITUTION_DEFAULT = QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION + } + + public enum EValues_REFRESH_RATE_OVERRIDE : uint { + REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED = 0x00000000, + REFRESH_RATE_OVERRIDE_HIGHEST_AVAILABLE = 0x00000001, + REFRESH_RATE_OVERRIDE_LOW_LATENCY_RR_MASK = 0x00000FF0, + REFRESH_RATE_OVERRIDE_NUM_VALUES = 3, + REFRESH_RATE_OVERRIDE_DEFAULT = REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED + } + + public enum EValues_SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE : uint { + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF = 0x00000000, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ON = 0x00000001, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_NUM_VALUES = 2, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_DEFAULT = SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF + } + + public enum EValues_SET_VAB_DATA : uint { + SET_VAB_DATA_ZERO = 0x00000000, + SET_VAB_DATA_UINT_ONE = 0x00000001, + SET_VAB_DATA_FLOAT_ONE = 0x3f800000, + SET_VAB_DATA_FLOAT_POS_INF = 0x7f800000, + SET_VAB_DATA_FLOAT_NAN = 0x7fc00000, + SET_VAB_DATA_USE_API_DEFAULTS = 0xffffffff, + SET_VAB_DATA_NUM_VALUES = 6, + SET_VAB_DATA_DEFAULT = SET_VAB_DATA_USE_API_DEFAULTS + } + + public enum EValues_VSYNCMODE : uint { + VSYNCMODE_PASSIVE = 0x60925292, + VSYNCMODE_FORCEOFF = 0x08416747, + VSYNCMODE_FORCEON = 0x47814940, + VSYNCMODE_FLIPINTERVAL2 = 0x32610244, + VSYNCMODE_FLIPINTERVAL3 = 0x71271021, + VSYNCMODE_FLIPINTERVAL4 = 0x13245256, + VSYNCMODE_VIRTUAL = 0x18888888, + VSYNCMODE_NUM_VALUES = 7, + VSYNCMODE_DEFAULT = VSYNCMODE_PASSIVE + } + + public enum EValues_VSYNCTEARCONTROL : uint { + VSYNCTEARCONTROL_DISABLE = 0x96861077, + VSYNCTEARCONTROL_ENABLE = 0x99941284, + VSYNCTEARCONTROL_NUM_VALUES = 2, + VSYNCTEARCONTROL_DEFAULT = VSYNCTEARCONTROL_DISABLE + } + +} \ No newline at end of file diff --git a/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.h b/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.h new file mode 100644 index 0000000..5daf6fc --- /dev/null +++ b/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.h @@ -0,0 +1,1137 @@ +/***************************************************************************\ +|* *| +|* Copyright NVIDIA Corporation. All rights reserved. *| +|* *| +|* NOTICE TO USER: *| +|* *| +|* This source code is subject to NVIDIA ownership rights under U.S. *| +|* and international Copyright laws. Users and possessors of this *| +|* source code are hereby granted a nonexclusive, royalty-free *| +|* license to use this code in individual and commercial software. *| +|* *| +|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE *| +|* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR *| +|* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH *| +|* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF *| +|* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR *| +|* PURPOSE. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, *| +|* INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES *| +|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN *| +|* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *| +|* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE *| +|* CODE. *| +|* *| +|* U.S. Government End Users. This source code is a "commercial item" *| +|* as that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting *| +|* of "commercial computer software" and "commercial computer software *| +|* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) *| +|* and is provided to the U.S. Government only as a commercial end item. *| +|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through *| +|* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the *| +|* source code with only those rights set forth herein. *| +|* *| +|* Any use of this source code in individual and commercial software must *| +|* include, in the user documentation and internal comments to the code, *| +|* the above Disclaimer and U.S. Government End Users Notice. *| +|* *| +|* *| +\***************************************************************************/ + +#ifndef _NVAPI_DRIVER_SETTINGS_H_ +#define _NVAPI_DRIVER_SETTINGS_H_ + +#define OGL_AA_LINE_GAMMA_STRING L"Antialiasing - Line gamma" +#define OGL_DEEP_COLOR_SCANOUT_STRING L"Deep color for 3D applications" +#define OGL_DEFAULT_SWAP_INTERVAL_STRING L"OpenGL default swap interval" +#define OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_STRING L"OpenGL default swap interval fraction" +#define OGL_DEFAULT_SWAP_INTERVAL_SIGN_STRING L"OpenGL default swap interval sign" +#define OGL_EVENT_LOG_SEVERITY_THRESHOLD_STRING L"Event Log Severity Threshold" +#define OGL_EXTENSION_STRING_VERSION_STRING L"Extension String version" +#define OGL_FORCE_BLIT_STRING L"Buffer-flipping mode" +#define OGL_FORCE_STEREO_STRING L"Force Stereo shuttering" +#define OGL_IMPLICIT_GPU_AFFINITY_STRING L"Preferred OpenGL GPU" +#define OGL_MAX_FRAMES_ALLOWED_STRING L"Maximum frames allowed" +#define OGL_OVERLAY_PIXEL_TYPE_STRING L"Exported Overlay pixel types" +#define OGL_OVERLAY_SUPPORT_STRING L"Enable overlay" +#define OGL_QUALITY_ENHANCEMENTS_STRING L"High level control of the rendering quality on OpenGL" +#define OGL_SINGLE_BACKDEPTH_BUFFER_STRING L"Unified back/depth buffer" +#define OGL_SLI_CFR_MODE_STRING L"Set CFR mode" +#define OGL_SLI_MULTICAST_STRING L"Enable NV_gpu_multicast extension" +#define OGL_THREAD_CONTROL_STRING L"Threaded optimization" +#define OGL_TMON_LEVEL_STRING L"Event Log Tmon Severity Threshold" +#define OGL_TRIPLE_BUFFER_STRING L"Triple buffering" +#define AA_BEHAVIOR_FLAGS_STRING L"Antialiasing - Behavior Flags" +#define AA_MODE_ALPHATOCOVERAGE_STRING L"Antialiasing - Transparency Multisampling" +#define AA_MODE_GAMMACORRECTION_STRING L"Antialiasing - Gamma correction" +#define AA_MODE_METHOD_STRING L"Antialiasing - Setting" +#define AA_MODE_REPLAY_STRING L"Antialiasing - Transparency Supersampling" +#define AA_MODE_SELECTOR_STRING L"Antialiasing - Mode" +#define AA_MODE_SELECTOR_SLIAA_STRING L"Antialiasing - SLI AA" +#define ANISO_MODE_LEVEL_STRING L"Anisotropic filtering setting" +#define ANISO_MODE_SELECTOR_STRING L"Anisotropic filtering mode" +#define ANSEL_ALLOW_STRING L"NVIDIA Predefined Ansel Usage" +#define ANSEL_ALLOWLISTED_STRING L"Ansel flags for enabled applications" +#define ANSEL_ENABLE_STRING L"Enable Ansel" +#define APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_STRING L"Application Profile Notification Popup Timeout" +#define APPLICATION_STEAM_ID_STRING L"Steam Application ID" +#define BATTERY_BOOST_APP_FPS_STRING L"Battery Boost Application FPS" +#define CPL_HIDDEN_PROFILE_STRING L"Do not display this profile in the Control Panel" +#define CUDA_EXCLUDED_GPUS_STRING L"List of Universal GPU ids" +#define D3DOGL_GPU_MAX_POWER_STRING L"Maximum GPU Power" +#define EXPORT_PERF_COUNTERS_STRING L"Export Performance Counters" +#define EXTERNAL_QUIET_MODE_STRING L"External Quiet Mode (XQM)" +#define FRL_FPS_STRING L"Frame Rate Limiter" +#define FXAA_ALLOW_STRING L"NVIDIA Predefined FXAA Usage" +#define FXAA_ENABLE_STRING L"Enable FXAA" +#define FXAA_INDICATOR_ENABLE_STRING L"Enable FXAA Indicator" +#define MCSFRSHOWSPLIT_STRING L"SLI indicator" +#define NV_QUALITY_UPSCALING_STRING L"NVIDIA Quality upscaling" +#define OPTIMUS_MAXAA_STRING L"Maximum AA samples allowed for a given application" +#define PHYSXINDICATOR_STRING L"Display the PhysX indicator" +#define PREFERRED_PSTATE_STRING L"Power management mode" +#define PREVENT_UI_AF_OVERRIDE_STRING L"No override of Anisotropic filtering" +#define SHIM_MAXRES_STRING L"Maximum resolution allowed for a given application" +#define SHIM_MCCOMPAT_STRING L"Optimus flags for enabled applications" +#define SHIM_RENDERING_MODE_STRING L"Enable application for Optimus" +#define SHIM_RENDERING_OPTIONS_STRING L"Shim Rendering Mode Options per application for Optimus" +#define SLI_GPU_COUNT_STRING L"Number of GPUs to use on SLI rendering mode" +#define SLI_PREDEFINED_GPU_COUNT_STRING L"NVIDIA predefined number of GPUs to use on SLI rendering mode" +#define SLI_PREDEFINED_GPU_COUNT_DX10_STRING L"NVIDIA predefined number of GPUs to use on SLI rendering mode on DirectX 10" +#define SLI_PREDEFINED_MODE_STRING L"NVIDIA predefined SLI mode" +#define SLI_PREDEFINED_MODE_DX10_STRING L"NVIDIA predefined SLI mode on DirectX 10" +#define SLI_RENDERING_MODE_STRING L"SLI rendering mode" +#define VRPRERENDERLIMIT_STRING L"Virtual Reality pre-rendered frames" +#define VRRFEATUREINDICATOR_STRING L"Toggle the VRR global feature" +#define VRROVERLAYINDICATOR_STRING L"Display the VRR Overlay Indicator" +#define VRRREQUESTSTATE_STRING L"VRR requested state" +#define VRR_APP_OVERRIDE_STRING L"G-SYNC" +#define VRR_APP_OVERRIDE_REQUEST_STATE_STRING L"G-SYNC" +#define VRR_MODE_STRING L"Enable G-SYNC globally" +#define VSYNCSMOOTHAFR_STRING L"Flag to control smooth AFR behavior" +#define VSYNCVRRCONTROL_STRING L"Variable refresh Rate" +#define VSYNC_BEHAVIOR_FLAGS_STRING L"Vsync - Behavior Flags" +#define WKS_API_STEREO_EYES_EXCHANGE_STRING L"Stereo - Swap eyes" +#define WKS_API_STEREO_MODE_STRING L"Stereo - Display mode" +#define WKS_MEMORY_ALLOCATION_POLICY_STRING L"Memory Allocation Policy" +#define WKS_STEREO_DONGLE_SUPPORT_STRING L"Stereo - Dongle Support" +#define WKS_STEREO_SUPPORT_STRING L"Stereo - Enable" +#define WKS_STEREO_SWAP_MODE_STRING L"Stereo - swap mode" +#define AO_MODE_STRING L"Ambient Occlusion" +#define AO_MODE_ACTIVE_STRING L"NVIDIA Predefined Ambient Occlusion Usage" +#define AUTO_LODBIASADJUST_STRING L"Texture filtering - Driver Controlled LOD Bias" +#define EXPORT_PERF_COUNTERS_DX9_ONLY_STRING L"Export Performance Counters for DX9 only" +#define ICAFE_LOGO_CONFIG_STRING L"ICafe Settings" +#define LODBIASADJUST_STRING L"Texture filtering - LOD Bias" +#define MAXWELL_B_SAMPLE_INTERLEAVE_STRING L"Enable sample interleaving (MFAA)" +#define PRERENDERLIMIT_STRING L"Maximum pre-rendered frames" +#define PS_SHADERDISKCACHE_STRING L"Shader Cache" +#define PS_TEXFILTER_ANISO_OPTS2_STRING L"Texture filtering - Anisotropic sample optimization" +#define PS_TEXFILTER_BILINEAR_IN_ANISO_STRING L"Texture filtering - Anisotropic filter optimization" +#define PS_TEXFILTER_DISABLE_TRILIN_SLOPE_STRING L"Texture filtering - Trilinear optimization" +#define PS_TEXFILTER_NO_NEG_LODBIAS_STRING L"Texture filtering - Negative LOD bias" +#define QUALITY_ENHANCEMENTS_STRING L"Texture filtering - Quality" +#define QUALITY_ENHANCEMENT_SUBSTITUTION_STRING L"Texture filtering - Quality Substitution" +#define REFRESH_RATE_OVERRIDE_STRING L"Preferred refresh rate" +#define SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_STRING L"PowerThrottle" +#define SET_VAB_DATA_STRING L"VAB Default Data" +#define VSYNCMODE_STRING L"Vertical Sync" +#define VSYNCTEARCONTROL_STRING L"Vertical Sync Tear Control" + +enum ESetting { + OGL_AA_LINE_GAMMA_ID = 0x2089BF6C, + OGL_DEEP_COLOR_SCANOUT_ID = 0x2097C2F6, + OGL_DEFAULT_SWAP_INTERVAL_ID = 0x206A6582, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID = 0x206C4581, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID = 0x20655CFA, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID = 0x209DF23E, + OGL_EXTENSION_STRING_VERSION_ID = 0x20FF7493, + OGL_FORCE_BLIT_ID = 0x201F619F, + OGL_FORCE_STEREO_ID = 0x204D9A0C, + OGL_IMPLICIT_GPU_AFFINITY_ID = 0x20D0F3E6, + OGL_MAX_FRAMES_ALLOWED_ID = 0x208E55E3, + OGL_OVERLAY_PIXEL_TYPE_ID = 0x209AE66F, + OGL_OVERLAY_SUPPORT_ID = 0x206C28C4, + OGL_QUALITY_ENHANCEMENTS_ID = 0x20797D6C, + OGL_SINGLE_BACKDEPTH_BUFFER_ID = 0x20A29055, + OGL_SLI_CFR_MODE_ID = 0x20343843, + OGL_SLI_MULTICAST_ID = 0x2092D3BE, + OGL_THREAD_CONTROL_ID = 0x20C1221E, + OGL_TMON_LEVEL_ID = 0x202888C1, + OGL_TRIPLE_BUFFER_ID = 0x20FDD1F9, + AA_BEHAVIOR_FLAGS_ID = 0x10ECDB82, + AA_MODE_ALPHATOCOVERAGE_ID = 0x10FC2D9C, + AA_MODE_GAMMACORRECTION_ID = 0x107D639D, + AA_MODE_METHOD_ID = 0x10D773D2, + AA_MODE_REPLAY_ID = 0x10D48A85, + AA_MODE_SELECTOR_ID = 0x107EFC5B, + AA_MODE_SELECTOR_SLIAA_ID = 0x107AFC5B, + ANISO_MODE_LEVEL_ID = 0x101E61A9, + ANISO_MODE_SELECTOR_ID = 0x10D2BB16, + ANSEL_ALLOW_ID = 0x1035DB89, + ANSEL_ALLOWLISTED_ID = 0x1085DA8A, + ANSEL_ENABLE_ID = 0x1075D972, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID = 0x104554B6, + APPLICATION_STEAM_ID_ID = 0x107CDDBC, + BATTERY_BOOST_APP_FPS_ID = 0x10115C8C, + CPL_HIDDEN_PROFILE_ID = 0x106D5CFF, + CUDA_EXCLUDED_GPUS_ID = 0x10354FF8, + D3DOGL_GPU_MAX_POWER_ID = 0x10D1EF29, + EXPORT_PERF_COUNTERS_ID = 0x108F0841, + EXTERNAL_QUIET_MODE_ID = 0x10115C8D, + FRL_FPS_ID = 0x10835002, + FXAA_ALLOW_ID = 0x1034CB89, + FXAA_ENABLE_ID = 0x1074C972, + FXAA_INDICATOR_ENABLE_ID = 0x1068FB9C, + MCSFRSHOWSPLIT_ID = 0x10287051, + NV_QUALITY_UPSCALING_ID = 0x10444444, + OPTIMUS_MAXAA_ID = 0x10F9DC83, + PHYSXINDICATOR_ID = 0x1094F16F, + PREFERRED_PSTATE_ID = 0x1057EB71, + PREVENT_UI_AF_OVERRIDE_ID = 0x103BCCB5, + SHIM_MAXRES_ID = 0x10F9DC82, + SHIM_MCCOMPAT_ID = 0x10F9DC80, + SHIM_RENDERING_MODE_ID = 0x10F9DC81, + SHIM_RENDERING_OPTIONS_ID = 0x10F9DC84, + SLI_GPU_COUNT_ID = 0x1033DCD1, + SLI_PREDEFINED_GPU_COUNT_ID = 0x1033DCD2, + SLI_PREDEFINED_GPU_COUNT_DX10_ID = 0x1033DCD3, + SLI_PREDEFINED_MODE_ID = 0x1033CEC1, + SLI_PREDEFINED_MODE_DX10_ID = 0x1033CEC2, + SLI_RENDERING_MODE_ID = 0x1033CED1, + VRPRERENDERLIMIT_ID = 0x10111133, + VRRFEATUREINDICATOR_ID = 0x1094F157, + VRROVERLAYINDICATOR_ID = 0x1095F16F, + VRRREQUESTSTATE_ID = 0x1094F1F7, + VRR_APP_OVERRIDE_ID = 0x10A879CF, + VRR_APP_OVERRIDE_REQUEST_STATE_ID = 0x10A879AC, + VRR_MODE_ID = 0x1194F158, + VSYNCSMOOTHAFR_ID = 0x101AE763, + VSYNCVRRCONTROL_ID = 0x10A879CE, + VSYNC_BEHAVIOR_FLAGS_ID = 0x10FDEC23, + WKS_API_STEREO_EYES_EXCHANGE_ID = 0x11AE435C, + WKS_API_STEREO_MODE_ID = 0x11E91A61, + WKS_MEMORY_ALLOCATION_POLICY_ID = 0x11112233, + WKS_STEREO_DONGLE_SUPPORT_ID = 0x112493BD, + WKS_STEREO_SUPPORT_ID = 0x11AA9E99, + WKS_STEREO_SWAP_MODE_ID = 0x11333333, + AO_MODE_ID = 0x00667329, + AO_MODE_ACTIVE_ID = 0x00664339, + AUTO_LODBIASADJUST_ID = 0x00638E8F, + EXPORT_PERF_COUNTERS_DX9_ONLY_ID = 0x00B65E72, + ICAFE_LOGO_CONFIG_ID = 0x00DB1337, + LODBIASADJUST_ID = 0x00738E8F, + MAXWELL_B_SAMPLE_INTERLEAVE_ID = 0x0098C1AC, + PRERENDERLIMIT_ID = 0x007BA09E, + PS_SHADERDISKCACHE_ID = 0x00198FFF, + PS_TEXFILTER_ANISO_OPTS2_ID = 0x00E73211, + PS_TEXFILTER_BILINEAR_IN_ANISO_ID = 0x0084CD70, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID = 0x002ECAF2, + PS_TEXFILTER_NO_NEG_LODBIAS_ID = 0x0019BB68, + QUALITY_ENHANCEMENTS_ID = 0x00CE2691, + QUALITY_ENHANCEMENT_SUBSTITUTION_ID = 0x00CE2692, + REFRESH_RATE_OVERRIDE_ID = 0x0064B541, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID = 0x00AE785C, + SET_VAB_DATA_ID = 0x00AB8687, + VSYNCMODE_ID = 0x00A879CF, + VSYNCTEARCONTROL_ID = 0x005A375C, + TOTAL_DWORD_SETTING_NUM = 92, + TOTAL_WSTRING_SETTING_NUM = 4, + TOTAL_SETTING_NUM = 96, + INVALID_SETTING_ID = 0xFFFFFFFF +}; + +enum EValues_OGL_AA_LINE_GAMMA { + OGL_AA_LINE_GAMMA_DISABLED = 0x10, + OGL_AA_LINE_GAMMA_ENABLED = 0x23, + OGL_AA_LINE_GAMMA_MIN = 1, + OGL_AA_LINE_GAMMA_MAX = 100, + OGL_AA_LINE_GAMMA_NUM_VALUES = 4, + OGL_AA_LINE_GAMMA_DEFAULT = OGL_AA_LINE_GAMMA_DISABLED +}; + +enum EValues_OGL_DEEP_COLOR_SCANOUT { + OGL_DEEP_COLOR_SCANOUT_DISABLE = 0, + OGL_DEEP_COLOR_SCANOUT_ENABLE = 1, + OGL_DEEP_COLOR_SCANOUT_NUM_VALUES = 2, + OGL_DEEP_COLOR_SCANOUT_DEFAULT = OGL_DEEP_COLOR_SCANOUT_ENABLE +}; + +enum EValues_OGL_DEFAULT_SWAP_INTERVAL { + OGL_DEFAULT_SWAP_INTERVAL_TEAR = 0, + OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE = 1, + OGL_DEFAULT_SWAP_INTERVAL_VSYNC = 1, + OGL_DEFAULT_SWAP_INTERVAL_VALUE_MASK = 0x0000FFFF, + OGL_DEFAULT_SWAP_INTERVAL_FORCE_MASK = 0xF0000000, + OGL_DEFAULT_SWAP_INTERVAL_FORCE_OFF = 0xF0000000, + OGL_DEFAULT_SWAP_INTERVAL_FORCE_ON = 0x10000000, + OGL_DEFAULT_SWAP_INTERVAL_APP_CONTROLLED = 0x00000000, + OGL_DEFAULT_SWAP_INTERVAL_DISABLE = 0xffffffff, + OGL_DEFAULT_SWAP_INTERVAL_NUM_VALUES = 9, + OGL_DEFAULT_SWAP_INTERVAL_DEFAULT = OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE +}; + +enum EValues_OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL { + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ZERO_SCANLINES = 0, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ONE_FULL_FRAME_OF_SCANLINES = 100, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_NUM_VALUES = 2, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_DEFAULT = 0 +}; + +enum EValues_OGL_DEFAULT_SWAP_INTERVAL_SIGN { + OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE = 0, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_NEGATIVE = 1, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_NUM_VALUES = 2, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_DEFAULT = OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE +}; + +enum EValues_OGL_EVENT_LOG_SEVERITY_THRESHOLD { + OGL_EVENT_LOG_SEVERITY_THRESHOLD_DISABLE = 0, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_CRITICAL = 1, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_WARNING = 2, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_INFORMATION = 3, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL = 4, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_NUM_VALUES = 5, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_DEFAULT = OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL +}; + +enum EValues_OGL_FORCE_BLIT { + OGL_FORCE_BLIT_ON = 1, + OGL_FORCE_BLIT_OFF = 0, + OGL_FORCE_BLIT_NUM_VALUES = 2, + OGL_FORCE_BLIT_DEFAULT = OGL_FORCE_BLIT_OFF +}; + +enum EValues_OGL_FORCE_STEREO { + OGL_FORCE_STEREO_OFF = 0, + OGL_FORCE_STEREO_ON = 1, + OGL_FORCE_STEREO_NUM_VALUES = 2, + OGL_FORCE_STEREO_DEFAULT = OGL_FORCE_STEREO_OFF +}; + +#define OGL_IMPLICIT_GPU_AFFINITY_ENV_VAR L"OGL_DEFAULT_RENDERING_GPU" +#define OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT L"autoselect" +#define OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES 1 +#define OGL_IMPLICIT_GPU_AFFINITY_DEFAULT OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT + +enum EValues_OGL_OVERLAY_PIXEL_TYPE { + OGL_OVERLAY_PIXEL_TYPE_NONE = 0x0, + OGL_OVERLAY_PIXEL_TYPE_CI = 0x1, + OGL_OVERLAY_PIXEL_TYPE_RGBA = 0x2, + OGL_OVERLAY_PIXEL_TYPE_CI_AND_RGBA = 0x3, + OGL_OVERLAY_PIXEL_TYPE_NUM_VALUES = 4, + OGL_OVERLAY_PIXEL_TYPE_DEFAULT = OGL_OVERLAY_PIXEL_TYPE_CI +}; + +enum EValues_OGL_OVERLAY_SUPPORT { + OGL_OVERLAY_SUPPORT_OFF = 0, + OGL_OVERLAY_SUPPORT_ON = 1, + OGL_OVERLAY_SUPPORT_FORCE_SW = 2, + OGL_OVERLAY_SUPPORT_NUM_VALUES = 3, + OGL_OVERLAY_SUPPORT_DEFAULT = OGL_OVERLAY_SUPPORT_OFF +}; + +enum EValues_OGL_QUALITY_ENHANCEMENTS { + OGL_QUALITY_ENHANCEMENTS_HQUAL = 0xfffffff6, + OGL_QUALITY_ENHANCEMENTS_QUAL = 0, + OGL_QUALITY_ENHANCEMENTS_PERF = 10, + OGL_QUALITY_ENHANCEMENTS_HPERF = 20, + OGL_QUALITY_ENHANCEMENTS_NUM_VALUES = 4, + OGL_QUALITY_ENHANCEMENTS_DEFAULT = OGL_QUALITY_ENHANCEMENTS_QUAL +}; + +enum EValues_OGL_SINGLE_BACKDEPTH_BUFFER { + OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE = 0x0, + OGL_SINGLE_BACKDEPTH_BUFFER_ENABLE = 0x1, + OGL_SINGLE_BACKDEPTH_BUFFER_USE_HW_DEFAULT = 0xffffffff, + OGL_SINGLE_BACKDEPTH_BUFFER_NUM_VALUES = 3, + OGL_SINGLE_BACKDEPTH_BUFFER_DEFAULT = OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE +}; + +enum EValues_OGL_SLI_CFR_MODE { + OGL_SLI_CFR_MODE_DISABLE = 0x00, + OGL_SLI_CFR_MODE_ENABLE = 0x01, + OGL_SLI_CFR_MODE_CLASSIC_SFR = 0x02, + OGL_SLI_CFR_MODE_NUM_VALUES = 3, + OGL_SLI_CFR_MODE_DEFAULT = OGL_SLI_CFR_MODE_DISABLE +}; + +enum EValues_OGL_SLI_MULTICAST { + OGL_SLI_MULTICAST_DISABLE = 0x00, + OGL_SLI_MULTICAST_ENABLE = 0x01, + OGL_SLI_MULTICAST_FORCE_DISABLE = 0x02, + OGL_SLI_MULTICAST_ALLOW_MOSAIC = 0x04, + OGL_SLI_MULTICAST_NUM_VALUES = 4, + OGL_SLI_MULTICAST_DEFAULT = OGL_SLI_MULTICAST_DISABLE +}; + +enum EValues_OGL_THREAD_CONTROL { + OGL_THREAD_CONTROL_ENABLE = 0x00000001, + OGL_THREAD_CONTROL_DISABLE = 0x00000002, + OGL_THREAD_CONTROL_NUM_VALUES = 2, + OGL_THREAD_CONTROL_DEFAULT = 0 +}; + +enum EValues_OGL_TMON_LEVEL { + OGL_TMON_LEVEL_DISABLE = 0, + OGL_TMON_LEVEL_CRITICAL = 1, + OGL_TMON_LEVEL_WARNING = 2, + OGL_TMON_LEVEL_INFORMATION = 3, + OGL_TMON_LEVEL_MOST = 4, + OGL_TMON_LEVEL_VERBOSE = 5, + OGL_TMON_LEVEL_NUM_VALUES = 6, + OGL_TMON_LEVEL_DEFAULT = OGL_TMON_LEVEL_MOST +}; + +enum EValues_OGL_TRIPLE_BUFFER { + OGL_TRIPLE_BUFFER_DISABLED = 0x00000000, + OGL_TRIPLE_BUFFER_ENABLED = 0x00000001, + OGL_TRIPLE_BUFFER_NUM_VALUES = 2, + OGL_TRIPLE_BUFFER_DEFAULT = OGL_TRIPLE_BUFFER_DISABLED +}; + +enum EValues_AA_BEHAVIOR_FLAGS { + AA_BEHAVIOR_FLAGS_NONE = 0x00000000, + AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_APP_CONTROLLED = 0x00000001, + AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_ENHANCE = 0x00000002, + AA_BEHAVIOR_FLAGS_DISABLE_OVERRIDE = 0x00000003, + AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_APP_CONTROLLED = 0x00000004, + AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_OVERRIDE = 0x00000008, + AA_BEHAVIOR_FLAGS_DISABLE_ENHANCE = 0x0000000c, + AA_BEHAVIOR_FLAGS_MAP_VCAA_TO_MULTISAMPLING = 0x00010000, + AA_BEHAVIOR_FLAGS_SLI_DISABLE_TRANSPARENCY_SUPERSAMPLING = 0x00020000, + AA_BEHAVIOR_FLAGS_DISABLE_CPLAA = 0x00040000, + AA_BEHAVIOR_FLAGS_SKIP_RT_DIM_CHECK_FOR_ENHANCE = 0x00080000, + AA_BEHAVIOR_FLAGS_DISABLE_SLIAA = 0x00100000, + AA_BEHAVIOR_FLAGS_DEFAULT = 0x00000000, + AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4 = 0xf0000000, + AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4_SHIFT = 28, + AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4 = 0x0f000000, + AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4_SHIFT = 24, + AA_BEHAVIOR_FLAGS_MASK = 0xff1f000f, + AA_BEHAVIOR_FLAGS_NUM_VALUES = 18, +}; + +enum EValues_AA_MODE_ALPHATOCOVERAGE { + AA_MODE_ALPHATOCOVERAGE_MODE_MASK = 0x00000004, + AA_MODE_ALPHATOCOVERAGE_MODE_OFF = 0x00000000, + AA_MODE_ALPHATOCOVERAGE_MODE_ON = 0x00000004, + AA_MODE_ALPHATOCOVERAGE_MODE_MAX = 0x00000004, + AA_MODE_ALPHATOCOVERAGE_NUM_VALUES = 4, + AA_MODE_ALPHATOCOVERAGE_DEFAULT = 0x00000000 +}; + +enum EValues_AA_MODE_GAMMACORRECTION { + AA_MODE_GAMMACORRECTION_MASK = 0x00000003, + AA_MODE_GAMMACORRECTION_OFF = 0x00000000, + AA_MODE_GAMMACORRECTION_ON_IF_FOS = 0x00000001, + AA_MODE_GAMMACORRECTION_ON_ALWAYS = 0x00000002, + AA_MODE_GAMMACORRECTION_MAX = 0x00000002, + AA_MODE_GAMMACORRECTION_DEFAULT = 0x00000000, + AA_MODE_GAMMACORRECTION_DEFAULT_TESLA = 0x00000002, + AA_MODE_GAMMACORRECTION_DEFAULT_FERMI = 0x00000002, + AA_MODE_GAMMACORRECTION_NUM_VALUES = 8, +}; + +enum EValues_AA_MODE_METHOD { + AA_MODE_METHOD_NONE = 0x0, + AA_MODE_METHOD_SUPERSAMPLE_2X_H = 0x1, + AA_MODE_METHOD_SUPERSAMPLE_2X_V = 0x2, + AA_MODE_METHOD_SUPERSAMPLE_1_5X1_5 = 0x2, + AA_MODE_METHOD_FREE_0x03 = 0x3, + AA_MODE_METHOD_FREE_0x04 = 0x4, + AA_MODE_METHOD_SUPERSAMPLE_4X = 0x5, + AA_MODE_METHOD_SUPERSAMPLE_4X_BIAS = 0x6, + AA_MODE_METHOD_SUPERSAMPLE_4X_GAUSSIAN = 0x7, + AA_MODE_METHOD_FREE_0x08 = 0x8, + AA_MODE_METHOD_FREE_0x09 = 0x9, + AA_MODE_METHOD_SUPERSAMPLE_9X = 0xA, + AA_MODE_METHOD_SUPERSAMPLE_9X_BIAS = 0xB, + AA_MODE_METHOD_SUPERSAMPLE_16X = 0xC, + AA_MODE_METHOD_SUPERSAMPLE_16X_BIAS = 0xD, + AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL = 0xE, + AA_MODE_METHOD_MULTISAMPLE_2X_QUINCUNX = 0xF, + AA_MODE_METHOD_MULTISAMPLE_4X = 0x10, + AA_MODE_METHOD_FREE_0x11 = 0x11, + AA_MODE_METHOD_MULTISAMPLE_4X_GAUSSIAN = 0x12, + AA_MODE_METHOD_MIXEDSAMPLE_4X_SKEWED_4TAP = 0x13, + AA_MODE_METHOD_FREE_0x14 = 0x14, + AA_MODE_METHOD_FREE_0x15 = 0x15, + AA_MODE_METHOD_MIXEDSAMPLE_6X = 0x16, + AA_MODE_METHOD_MIXEDSAMPLE_6X_SKEWED_6TAP = 0x17, + AA_MODE_METHOD_MIXEDSAMPLE_8X = 0x18, + AA_MODE_METHOD_MIXEDSAMPLE_8X_SKEWED_8TAP = 0x19, + AA_MODE_METHOD_MIXEDSAMPLE_16X = 0x1a, + AA_MODE_METHOD_MULTISAMPLE_4X_GAMMA = 0x1b, + AA_MODE_METHOD_MULTISAMPLE_16X = 0x1c, + AA_MODE_METHOD_VCAA_32X_8v24 = 0x1d, + AA_MODE_METHOD_CORRUPTION_CHECK = 0x1e, + AA_MODE_METHOD_6X_CT = 0x1f, + AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_GAMMA = 0x20, + AA_MODE_METHOD_SUPERSAMPLE_4X_GAMMA = 0x21, + AA_MODE_METHOD_MULTISAMPLE_4X_FOSGAMMA = 0x22, + AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_FOSGAMMA = 0x23, + AA_MODE_METHOD_SUPERSAMPLE_4X_FOSGAMMA = 0x24, + AA_MODE_METHOD_MULTISAMPLE_8X = 0x25, + AA_MODE_METHOD_VCAA_8X_4v4 = 0x26, + AA_MODE_METHOD_VCAA_16X_4v12 = 0x27, + AA_MODE_METHOD_VCAA_16X_8v8 = 0x28, + AA_MODE_METHOD_MIXEDSAMPLE_32X = 0x29, + AA_MODE_METHOD_SUPERVCAA_64X_4v12 = 0x2a, + AA_MODE_METHOD_SUPERVCAA_64X_8v8 = 0x2b, + AA_MODE_METHOD_MIXEDSAMPLE_64X = 0x2c, + AA_MODE_METHOD_MIXEDSAMPLE_128X = 0x2d, + AA_MODE_METHOD_COUNT = 0x2e, + AA_MODE_METHOD_METHOD_MASK = 0x0000ffff, + AA_MODE_METHOD_METHOD_MAX = 0xf1c57815, + AA_MODE_METHOD_NUM_VALUES = 50, + AA_MODE_METHOD_DEFAULT = AA_MODE_METHOD_NONE +}; + +enum EValues_AA_MODE_REPLAY { + AA_MODE_REPLAY_SAMPLES_MASK = 0x00000070, + AA_MODE_REPLAY_SAMPLES_ONE = 0x00000000, + AA_MODE_REPLAY_SAMPLES_TWO = 0x00000010, + AA_MODE_REPLAY_SAMPLES_FOUR = 0x00000020, + AA_MODE_REPLAY_SAMPLES_EIGHT = 0x00000030, + AA_MODE_REPLAY_SAMPLES_MAX = 0x00000030, + AA_MODE_REPLAY_MODE_MASK = 0x0000000f, + AA_MODE_REPLAY_MODE_OFF = 0x00000000, + AA_MODE_REPLAY_MODE_ALPHA_TEST = 0x00000001, + AA_MODE_REPLAY_MODE_PIXEL_KILL = 0x00000002, + AA_MODE_REPLAY_MODE_DYN_BRANCH = 0x00000004, + AA_MODE_REPLAY_MODE_OPTIMAL = 0x00000004, + AA_MODE_REPLAY_MODE_ALL = 0x00000008, + AA_MODE_REPLAY_MODE_MAX = 0x0000000f, + AA_MODE_REPLAY_TRANSPARENCY = 0x00000023, + AA_MODE_REPLAY_DISALLOW_TRAA = 0x00000100, + AA_MODE_REPLAY_TRANSPARENCY_DEFAULT = 0x00000000, + AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_TESLA = 0x00000000, + AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_FERMI = 0x00000000, + AA_MODE_REPLAY_MASK = 0x0000017f, + AA_MODE_REPLAY_NUM_VALUES = 20, + AA_MODE_REPLAY_DEFAULT = 0x00000000 +}; + +enum EValues_AA_MODE_SELECTOR { + AA_MODE_SELECTOR_MASK = 0x00000003, + AA_MODE_SELECTOR_APP_CONTROL = 0x00000000, + AA_MODE_SELECTOR_OVERRIDE = 0x00000001, + AA_MODE_SELECTOR_ENHANCE = 0x00000002, + AA_MODE_SELECTOR_MAX = 0x00000002, + AA_MODE_SELECTOR_NUM_VALUES = 5, + AA_MODE_SELECTOR_DEFAULT = AA_MODE_SELECTOR_APP_CONTROL +}; + +enum EValues_AA_MODE_SELECTOR_SLIAA { + AA_MODE_SELECTOR_SLIAA_DISABLED = 0, + AA_MODE_SELECTOR_SLIAA_ENABLED = 1, + AA_MODE_SELECTOR_SLIAA_NUM_VALUES = 2, + AA_MODE_SELECTOR_SLIAA_DEFAULT = AA_MODE_SELECTOR_SLIAA_DISABLED +}; + +enum EValues_ANISO_MODE_LEVEL { + ANISO_MODE_LEVEL_MASK = 0x0000ffff, + ANISO_MODE_LEVEL_NONE_POINT = 0x00000000, + ANISO_MODE_LEVEL_NONE_LINEAR = 0x00000001, + ANISO_MODE_LEVEL_MAX = 0x00000010, + ANISO_MODE_LEVEL_DEFAULT = 0x00000001, + ANISO_MODE_LEVEL_NUM_VALUES = 5, +}; + +enum EValues_ANISO_MODE_SELECTOR { + ANISO_MODE_SELECTOR_MASK = 0x0000000f, + ANISO_MODE_SELECTOR_APP = 0x00000000, + ANISO_MODE_SELECTOR_USER = 0x00000001, + ANISO_MODE_SELECTOR_COND = 0x00000002, + ANISO_MODE_SELECTOR_MAX = 0x00000002, + ANISO_MODE_SELECTOR_DEFAULT = 0x00000000, + ANISO_MODE_SELECTOR_NUM_VALUES = 6, +}; + +enum EValues_ANSEL_ALLOW { + ANSEL_ALLOW_DISALLOWED = 0, + ANSEL_ALLOW_ALLOWED = 1, + ANSEL_ALLOW_NUM_VALUES = 2, + ANSEL_ALLOW_DEFAULT = ANSEL_ALLOW_ALLOWED +}; + +enum EValues_ANSEL_ALLOWLISTED { + ANSEL_ALLOWLISTED_DISALLOWED = 0, + ANSEL_ALLOWLISTED_ALLOWED = 1, + ANSEL_ALLOWLISTED_NUM_VALUES = 2, + ANSEL_ALLOWLISTED_DEFAULT = ANSEL_ALLOWLISTED_DISALLOWED +}; + +enum EValues_ANSEL_ENABLE { + ANSEL_ENABLE_OFF = 0, + ANSEL_ENABLE_ON = 1, + ANSEL_ENABLE_NUM_VALUES = 2, + ANSEL_ENABLE_DEFAULT = ANSEL_ENABLE_ON +}; + +enum EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT { + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED = 0, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NINE_SECONDS = 9, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_FIFTEEN_SECONDS = 15, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_THIRTY_SECONDS = 30, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ONE_MINUTE = 60, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_TWO_MINUTES = 120, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NUM_VALUES = 6, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DEFAULT = APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED +}; + +enum EValues_BATTERY_BOOST_APP_FPS { + BATTERY_BOOST_APP_FPS_MIN = 0x00000001, + BATTERY_BOOST_APP_FPS_MAX = 0x000003ff, + BATTERY_BOOST_APP_FPS_NO_OVERRIDE = 0x00000000, + BATTERY_BOOST_APP_FPS_NUM_VALUES = 3, + BATTERY_BOOST_APP_FPS_DEFAULT = BATTERY_BOOST_APP_FPS_NO_OVERRIDE +}; + +enum EValues_CPL_HIDDEN_PROFILE { + CPL_HIDDEN_PROFILE_DISABLED = 0, + CPL_HIDDEN_PROFILE_ENABLED = 1, + CPL_HIDDEN_PROFILE_NUM_VALUES = 2, + CPL_HIDDEN_PROFILE_DEFAULT = CPL_HIDDEN_PROFILE_DISABLED +}; + +#define CUDA_EXCLUDED_GPUS_NONE L"none" +#define CUDA_EXCLUDED_GPUS_NUM_VALUES 1 +#define CUDA_EXCLUDED_GPUS_DEFAULT CUDA_EXCLUDED_GPUS_NONE + +#define D3DOGL_GPU_MAX_POWER_DEFAULTPOWER L"0" +#define D3DOGL_GPU_MAX_POWER_NUM_VALUES 1 +#define D3DOGL_GPU_MAX_POWER_DEFAULT D3DOGL_GPU_MAX_POWER_DEFAULTPOWER + +enum EValues_EXPORT_PERF_COUNTERS { + EXPORT_PERF_COUNTERS_OFF = 0x00000000, + EXPORT_PERF_COUNTERS_ON = 0x00000001, + EXPORT_PERF_COUNTERS_NUM_VALUES = 2, + EXPORT_PERF_COUNTERS_DEFAULT = EXPORT_PERF_COUNTERS_OFF +}; + +enum EValues_EXTERNAL_QUIET_MODE { + EXTERNAL_QUIET_MODE_ON = 0x00000001, + EXTERNAL_QUIET_MODE_OFF = 0x00000000, + EXTERNAL_QUIET_MODE_NUM_VALUES = 2, + EXTERNAL_QUIET_MODE_DEFAULT = EXTERNAL_QUIET_MODE_OFF +}; + +enum EValues_FRL_FPS { + FRL_FPS_DISABLED = 0x00000000, + FRL_FPS_MIN = 0x00000000, + FRL_FPS_MAX = 0x000003ff, + FRL_FPS_NUM_VALUES = 3, + FRL_FPS_DEFAULT = FRL_FPS_DISABLED +}; + +enum EValues_FXAA_ALLOW { + FXAA_ALLOW_DISALLOWED = 0, + FXAA_ALLOW_ALLOWED = 1, + FXAA_ALLOW_NUM_VALUES = 2, + FXAA_ALLOW_DEFAULT = FXAA_ALLOW_ALLOWED +}; + +enum EValues_FXAA_ENABLE { + FXAA_ENABLE_OFF = 0, + FXAA_ENABLE_ON = 1, + FXAA_ENABLE_NUM_VALUES = 2, + FXAA_ENABLE_DEFAULT = FXAA_ENABLE_OFF +}; + +enum EValues_FXAA_INDICATOR_ENABLE { + FXAA_INDICATOR_ENABLE_OFF = 0, + FXAA_INDICATOR_ENABLE_ON = 1, + FXAA_INDICATOR_ENABLE_NUM_VALUES = 2, + FXAA_INDICATOR_ENABLE_DEFAULT = FXAA_INDICATOR_ENABLE_OFF +}; + +enum EValues_MCSFRSHOWSPLIT { + MCSFRSHOWSPLIT_DISABLED = 0x34534064, + MCSFRSHOWSPLIT_ENABLED = 0x24545582, + MCSFRSHOWSPLIT_NUM_VALUES = 2, + MCSFRSHOWSPLIT_DEFAULT = MCSFRSHOWSPLIT_DISABLED +}; + +enum EValues_NV_QUALITY_UPSCALING { + NV_QUALITY_UPSCALING_OFF = 0, + NV_QUALITY_UPSCALING_ON = 1, + NV_QUALITY_UPSCALING_NUM_VALUES = 2, + NV_QUALITY_UPSCALING_DEFAULT = NV_QUALITY_UPSCALING_OFF +}; + +enum EValues_OPTIMUS_MAXAA { + OPTIMUS_MAXAA_MIN = 0, + OPTIMUS_MAXAA_MAX = 16, + OPTIMUS_MAXAA_NUM_VALUES = 2, + OPTIMUS_MAXAA_DEFAULT = 0 +}; + +enum EValues_PHYSXINDICATOR { + PHYSXINDICATOR_DISABLED = 0x34534064, + PHYSXINDICATOR_ENABLED = 0x24545582, + PHYSXINDICATOR_NUM_VALUES = 2, + PHYSXINDICATOR_DEFAULT = PHYSXINDICATOR_DISABLED +}; + +enum EValues_PREFERRED_PSTATE { + PREFERRED_PSTATE_ADAPTIVE = 0x00000000, + PREFERRED_PSTATE_PREFER_MAX = 0x00000001, + PREFERRED_PSTATE_DRIVER_CONTROLLED = 0x00000002, + PREFERRED_PSTATE_PREFER_CONSISTENT_PERFORMANCE = 0x00000003, + PREFERRED_PSTATE_PREFER_MIN = 0x00000004, + PREFERRED_PSTATE_OPTIMAL_POWER = 0x00000005, + PREFERRED_PSTATE_MIN = 0x00000000, + PREFERRED_PSTATE_MAX = 0x00000005, + PREFERRED_PSTATE_NUM_VALUES = 8, + PREFERRED_PSTATE_DEFAULT = PREFERRED_PSTATE_OPTIMAL_POWER +}; + +enum EValues_PREVENT_UI_AF_OVERRIDE { + PREVENT_UI_AF_OVERRIDE_OFF = 0, + PREVENT_UI_AF_OVERRIDE_ON = 1, + PREVENT_UI_AF_OVERRIDE_NUM_VALUES = 2, + PREVENT_UI_AF_OVERRIDE_DEFAULT = PREVENT_UI_AF_OVERRIDE_OFF +}; + +enum EValues_SHIM_MCCOMPAT { + SHIM_MCCOMPAT_INTEGRATED = 0x00000000, + SHIM_MCCOMPAT_ENABLE = 0x00000001, + SHIM_MCCOMPAT_USER_EDITABLE = 0x00000002, + SHIM_MCCOMPAT_MASK = 0x00000003, + SHIM_MCCOMPAT_VIDEO_MASK = 0x00000004, + SHIM_MCCOMPAT_VARYING_BIT = 0x00000008, + SHIM_MCCOMPAT_AUTO_SELECT = 0x00000010, + SHIM_MCCOMPAT_OVERRIDE_BIT = 0x80000000, + SHIM_MCCOMPAT_NUM_VALUES = 8, + SHIM_MCCOMPAT_DEFAULT = SHIM_MCCOMPAT_AUTO_SELECT +}; + +enum EValues_SHIM_RENDERING_MODE { + SHIM_RENDERING_MODE_INTEGRATED = 0x00000000, + SHIM_RENDERING_MODE_ENABLE = 0x00000001, + SHIM_RENDERING_MODE_USER_EDITABLE = 0x00000002, + SHIM_RENDERING_MODE_MASK = 0x00000003, + SHIM_RENDERING_MODE_VIDEO_MASK = 0x00000004, + SHIM_RENDERING_MODE_VARYING_BIT = 0x00000008, + SHIM_RENDERING_MODE_AUTO_SELECT = 0x00000010, + SHIM_RENDERING_MODE_OVERRIDE_BIT = 0x80000000, + SHIM_RENDERING_MODE_NUM_VALUES = 8, + SHIM_RENDERING_MODE_DEFAULT = SHIM_RENDERING_MODE_AUTO_SELECT +}; + +enum EValues_SHIM_RENDERING_OPTIONS { + SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE = 0x00000000, + SHIM_RENDERING_OPTIONS_DISABLE_ASYNC_PRESENT = 0x00000001, + SHIM_RENDERING_OPTIONS_EHSHELL_DETECT = 0x00000002, + SHIM_RENDERING_OPTIONS_FLASHPLAYER_HOST_DETECT = 0x00000004, + SHIM_RENDERING_OPTIONS_VIDEO_DRM_APP_DETECT = 0x00000008, + SHIM_RENDERING_OPTIONS_IGNORE_OVERRIDES = 0x00000010, + SHIM_RENDERING_OPTIONS_RESERVED1 = 0x00000020, + SHIM_RENDERING_OPTIONS_ENABLE_DWM_ASYNC_PRESENT = 0x00000040, + SHIM_RENDERING_OPTIONS_RESERVED2 = 0x00000080, + SHIM_RENDERING_OPTIONS_ALLOW_INHERITANCE = 0x00000100, + SHIM_RENDERING_OPTIONS_DISABLE_WRAPPERS = 0x00000200, + SHIM_RENDERING_OPTIONS_DISABLE_DXGI_WRAPPERS = 0x00000400, + SHIM_RENDERING_OPTIONS_PRUNE_UNSUPPORTED_FORMATS = 0x00000800, + SHIM_RENDERING_OPTIONS_ENABLE_ALPHA_FORMAT = 0x00001000, + SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING = 0x00002000, + SHIM_RENDERING_OPTIONS_DISABLE_CUDA = 0x00004000, + SHIM_RENDERING_OPTIONS_ALLOW_CP_CAPS_FOR_VIDEO = 0x00008000, + SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING_FWD_OPTIMUS = 0x00010000, + SHIM_RENDERING_OPTIONS_DISABLE_DURING_SECURE_BOOT = 0x00020000, + SHIM_RENDERING_OPTIONS_INVERT_FOR_QUADRO = 0x00040000, + SHIM_RENDERING_OPTIONS_INVERT_FOR_MSHYBRID = 0x00080000, + SHIM_RENDERING_OPTIONS_REGISTER_PROCESS_ENABLE_GOLD = 0x00100000, + SHIM_RENDERING_OPTIONS_HANDLE_WINDOWED_MODE_PERF_OPT = 0x00200000, + SHIM_RENDERING_OPTIONS_HANDLE_WIN7_ASYNC_RUNTIME_BUG = 0x00400000, + SHIM_RENDERING_OPTIONS_EXPLICIT_ADAPTER_OPTED_BY_APP = 0x00800000, + SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x01000000, + SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x02000000, + SHIM_RENDERING_OPTIONS_DISABLE_TURING_POWER_POLICY = 0x04000000, + SHIM_RENDERING_OPTIONS_NUM_VALUES = 28, + SHIM_RENDERING_OPTIONS_DEFAULT = 0x00000000 +}; + +enum EValues_SLI_GPU_COUNT { + SLI_GPU_COUNT_AUTOSELECT = 0x00000000, + SLI_GPU_COUNT_ONE = 0x00000001, + SLI_GPU_COUNT_TWO = 0x00000002, + SLI_GPU_COUNT_THREE = 0x00000003, + SLI_GPU_COUNT_FOUR = 0x00000004, + SLI_GPU_COUNT_NUM_VALUES = 5, + SLI_GPU_COUNT_DEFAULT = SLI_GPU_COUNT_AUTOSELECT +}; + +enum EValues_SLI_PREDEFINED_GPU_COUNT { + SLI_PREDEFINED_GPU_COUNT_AUTOSELECT = 0x00000000, + SLI_PREDEFINED_GPU_COUNT_ONE = 0x00000001, + SLI_PREDEFINED_GPU_COUNT_TWO = 0x00000002, + SLI_PREDEFINED_GPU_COUNT_THREE = 0x00000003, + SLI_PREDEFINED_GPU_COUNT_FOUR = 0x00000004, + SLI_PREDEFINED_GPU_COUNT_NUM_VALUES = 5, + SLI_PREDEFINED_GPU_COUNT_DEFAULT = SLI_PREDEFINED_GPU_COUNT_AUTOSELECT +}; + +enum EValues_SLI_PREDEFINED_GPU_COUNT_DX10 { + SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT = 0x00000000, + SLI_PREDEFINED_GPU_COUNT_DX10_ONE = 0x00000001, + SLI_PREDEFINED_GPU_COUNT_DX10_TWO = 0x00000002, + SLI_PREDEFINED_GPU_COUNT_DX10_THREE = 0x00000003, + SLI_PREDEFINED_GPU_COUNT_DX10_FOUR = 0x00000004, + SLI_PREDEFINED_GPU_COUNT_DX10_NUM_VALUES = 5, + SLI_PREDEFINED_GPU_COUNT_DX10_DEFAULT = SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT +}; + +enum EValues_SLI_PREDEFINED_MODE { + SLI_PREDEFINED_MODE_AUTOSELECT = 0x00000000, + SLI_PREDEFINED_MODE_FORCE_SINGLE = 0x00000001, + SLI_PREDEFINED_MODE_FORCE_AFR = 0x00000002, + SLI_PREDEFINED_MODE_FORCE_AFR2 = 0x00000003, + SLI_PREDEFINED_MODE_FORCE_SFR = 0x00000004, + SLI_PREDEFINED_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, + SLI_PREDEFINED_MODE_NUM_VALUES = 6, + SLI_PREDEFINED_MODE_DEFAULT = SLI_PREDEFINED_MODE_AUTOSELECT +}; + +enum EValues_SLI_PREDEFINED_MODE_DX10 { + SLI_PREDEFINED_MODE_DX10_AUTOSELECT = 0x00000000, + SLI_PREDEFINED_MODE_DX10_FORCE_SINGLE = 0x00000001, + SLI_PREDEFINED_MODE_DX10_FORCE_AFR = 0x00000002, + SLI_PREDEFINED_MODE_DX10_FORCE_AFR2 = 0x00000003, + SLI_PREDEFINED_MODE_DX10_FORCE_SFR = 0x00000004, + SLI_PREDEFINED_MODE_DX10_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, + SLI_PREDEFINED_MODE_DX10_NUM_VALUES = 6, + SLI_PREDEFINED_MODE_DX10_DEFAULT = SLI_PREDEFINED_MODE_DX10_AUTOSELECT +}; + +enum EValues_SLI_RENDERING_MODE { + SLI_RENDERING_MODE_AUTOSELECT = 0x00000000, + SLI_RENDERING_MODE_FORCE_SINGLE = 0x00000001, + SLI_RENDERING_MODE_FORCE_AFR = 0x00000002, + SLI_RENDERING_MODE_FORCE_AFR2 = 0x00000003, + SLI_RENDERING_MODE_FORCE_SFR = 0x00000004, + SLI_RENDERING_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, + SLI_RENDERING_MODE_NUM_VALUES = 6, + SLI_RENDERING_MODE_DEFAULT = SLI_RENDERING_MODE_AUTOSELECT +}; + +enum EValues_VRPRERENDERLIMIT { + VRPRERENDERLIMIT_MIN = 0x00, + VRPRERENDERLIMIT_MAX = 0xff, + VRPRERENDERLIMIT_APP_CONTROLLED = 0x00, + VRPRERENDERLIMIT_DEFAULT = 0x01, + VRPRERENDERLIMIT_NUM_VALUES = 4, +}; + +enum EValues_VRRFEATUREINDICATOR { + VRRFEATUREINDICATOR_DISABLED = 0x0, + VRRFEATUREINDICATOR_ENABLED = 0x1, + VRRFEATUREINDICATOR_NUM_VALUES = 2, + VRRFEATUREINDICATOR_DEFAULT = VRRFEATUREINDICATOR_ENABLED +}; + +enum EValues_VRROVERLAYINDICATOR { + VRROVERLAYINDICATOR_DISABLED = 0x0, + VRROVERLAYINDICATOR_ENABLED = 0x1, + VRROVERLAYINDICATOR_NUM_VALUES = 2, + VRROVERLAYINDICATOR_DEFAULT = VRROVERLAYINDICATOR_ENABLED +}; + +enum EValues_VRRREQUESTSTATE { + VRRREQUESTSTATE_DISABLED = 0x0, + VRRREQUESTSTATE_FULLSCREEN_ONLY = 0x1, + VRRREQUESTSTATE_FULLSCREEN_AND_WINDOWED = 0x2, + VRRREQUESTSTATE_NUM_VALUES = 3, + VRRREQUESTSTATE_DEFAULT = VRRREQUESTSTATE_FULLSCREEN_ONLY +}; + +enum EValues_VRR_APP_OVERRIDE { + VRR_APP_OVERRIDE_ALLOW = 0, + VRR_APP_OVERRIDE_FORCE_OFF = 1, + VRR_APP_OVERRIDE_DISALLOW = 2, + VRR_APP_OVERRIDE_ULMB = 3, + VRR_APP_OVERRIDE_FIXED_REFRESH = 4, + VRR_APP_OVERRIDE_NUM_VALUES = 5, + VRR_APP_OVERRIDE_DEFAULT = VRR_APP_OVERRIDE_ALLOW +}; + +enum EValues_VRR_APP_OVERRIDE_REQUEST_STATE { + VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW = 0, + VRR_APP_OVERRIDE_REQUEST_STATE_FORCE_OFF = 1, + VRR_APP_OVERRIDE_REQUEST_STATE_DISALLOW = 2, + VRR_APP_OVERRIDE_REQUEST_STATE_ULMB = 3, + VRR_APP_OVERRIDE_REQUEST_STATE_FIXED_REFRESH = 4, + VRR_APP_OVERRIDE_REQUEST_STATE_NUM_VALUES = 5, + VRR_APP_OVERRIDE_REQUEST_STATE_DEFAULT = VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW +}; + +enum EValues_VRR_MODE { + VRR_MODE_DISABLED = 0x0, + VRR_MODE_FULLSCREEN_ONLY = 0x1, + VRR_MODE_FULLSCREEN_AND_WINDOWED = 0x2, + VRR_MODE_NUM_VALUES = 3, + VRR_MODE_DEFAULT = VRR_MODE_FULLSCREEN_ONLY +}; + +enum EValues_VSYNCSMOOTHAFR { + VSYNCSMOOTHAFR_OFF = 0x00000000, + VSYNCSMOOTHAFR_ON = 0x00000001, + VSYNCSMOOTHAFR_NUM_VALUES = 2, + VSYNCSMOOTHAFR_DEFAULT = VSYNCSMOOTHAFR_OFF +}; + +enum EValues_VSYNCVRRCONTROL { + VSYNCVRRCONTROL_DISABLE = 0x00000000, + VSYNCVRRCONTROL_ENABLE = 0x00000001, + VSYNCVRRCONTROL_NOTSUPPORTED = 0x9f95128e, + VSYNCVRRCONTROL_NUM_VALUES = 3, + VSYNCVRRCONTROL_DEFAULT = VSYNCVRRCONTROL_ENABLE +}; + +enum EValues_VSYNC_BEHAVIOR_FLAGS { + VSYNC_BEHAVIOR_FLAGS_NONE = 0x00000000, + VSYNC_BEHAVIOR_FLAGS_DEFAULT = 0x00000000, + VSYNC_BEHAVIOR_FLAGS_IGNORE_FLIPINTERVAL_MULTIPLE = 0x00000001, + VSYNC_BEHAVIOR_FLAGS_NUM_VALUES = 3, +}; + +enum EValues_WKS_API_STEREO_EYES_EXCHANGE { + WKS_API_STEREO_EYES_EXCHANGE_OFF = 0, + WKS_API_STEREO_EYES_EXCHANGE_ON = 1, + WKS_API_STEREO_EYES_EXCHANGE_NUM_VALUES = 2, + WKS_API_STEREO_EYES_EXCHANGE_DEFAULT = WKS_API_STEREO_EYES_EXCHANGE_OFF +}; + +enum EValues_WKS_API_STEREO_MODE { + WKS_API_STEREO_MODE_SHUTTER_GLASSES = 0, + WKS_API_STEREO_MODE_VERTICAL_INTERLACED = 1, + WKS_API_STEREO_MODE_TWINVIEW = 2, + WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_AUTO = 3, + WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC0 = 4, + WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC1 = 5, + WKS_API_STEREO_MODE_COLOR_LINE = 6, + WKS_API_STEREO_MODE_COLOR_INTERLEAVED = 7, + WKS_API_STEREO_MODE_ANAGLYPH = 8, + WKS_API_STEREO_MODE_HORIZONTAL_INTERLACED = 9, + WKS_API_STEREO_MODE_SIDE_FIELD = 10, + WKS_API_STEREO_MODE_SUB_FIELD = 11, + WKS_API_STEREO_MODE_CHECKERBOARD = 12, + WKS_API_STEREO_MODE_INVERSE_CHECKERBOARD = 13, + WKS_API_STEREO_MODE_TRIDELITY_SL = 14, + WKS_API_STEREO_MODE_TRIDELITY_MV = 15, + WKS_API_STEREO_MODE_SEEFRONT = 16, + WKS_API_STEREO_MODE_STEREO_MIRROR = 17, + WKS_API_STEREO_MODE_FRAME_SEQUENTIAL = 18, + WKS_API_STEREO_MODE_AUTODETECT_PASSIVE_MODE = 19, + WKS_API_STEREO_MODE_AEGIS_DT_FRAME_SEQUENTIAL = 20, + WKS_API_STEREO_MODE_OEM_EMITTER_FRAME_SEQUENTIAL = 21, + WKS_API_STEREO_MODE_DP_INBAND = 22, + WKS_API_STEREO_MODE_USE_HW_DEFAULT = 0xffffffff, + WKS_API_STEREO_MODE_DEFAULT_GL = 3, + WKS_API_STEREO_MODE_NUM_VALUES = 25, + WKS_API_STEREO_MODE_DEFAULT = WKS_API_STEREO_MODE_SHUTTER_GLASSES +}; + +enum EValues_WKS_MEMORY_ALLOCATION_POLICY { + WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED = 0x0, + WKS_MEMORY_ALLOCATION_POLICY_MODERATE_PRE_ALLOCATION = 0x1, + WKS_MEMORY_ALLOCATION_POLICY_AGGRESSIVE_PRE_ALLOCATION = 0x2, + WKS_MEMORY_ALLOCATION_POLICY_NUM_VALUES = 3, + WKS_MEMORY_ALLOCATION_POLICY_DEFAULT = WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED +}; + +enum EValues_WKS_STEREO_DONGLE_SUPPORT { + WKS_STEREO_DONGLE_SUPPORT_OFF = 0, + WKS_STEREO_DONGLE_SUPPORT_DAC = 1, + WKS_STEREO_DONGLE_SUPPORT_DLP = 2, + WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES = 3, + WKS_STEREO_DONGLE_SUPPORT_DEFAULT = WKS_STEREO_DONGLE_SUPPORT_DAC +}; + +enum EValues_WKS_STEREO_SUPPORT { + WKS_STEREO_SUPPORT_OFF = 0, + WKS_STEREO_SUPPORT_ON = 1, + WKS_STEREO_SUPPORT_NUM_VALUES = 2, + WKS_STEREO_SUPPORT_DEFAULT = WKS_STEREO_SUPPORT_OFF +}; + +enum EValues_WKS_STEREO_SWAP_MODE { + WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL = 0x0, + WKS_STEREO_SWAP_MODE_PER_EYE = 0x1, + WKS_STEREO_SWAP_MODE_PER_EYE_PAIR = 0x2, + WKS_STEREO_SWAP_MODE_LEGACY_BEHAVIOR = 0x3, + WKS_STEREO_SWAP_MODE_PER_EYE_FOR_SWAP_GROUP = 0x4, + WKS_STEREO_SWAP_MODE_NUM_VALUES = 5, + WKS_STEREO_SWAP_MODE_DEFAULT = WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL +}; + +enum EValues_AO_MODE { + AO_MODE_OFF = 0, + AO_MODE_LOW = 1, + AO_MODE_MEDIUM = 2, + AO_MODE_HIGH = 3, + AO_MODE_NUM_VALUES = 4, + AO_MODE_DEFAULT = AO_MODE_OFF +}; + +enum EValues_AO_MODE_ACTIVE { + AO_MODE_ACTIVE_DISABLED = 0, + AO_MODE_ACTIVE_ENABLED = 1, + AO_MODE_ACTIVE_NUM_VALUES = 2, + AO_MODE_ACTIVE_DEFAULT = AO_MODE_ACTIVE_DISABLED +}; + +enum EValues_AUTO_LODBIASADJUST { + AUTO_LODBIASADJUST_OFF = 0x00000000, + AUTO_LODBIASADJUST_ON = 0x00000001, + AUTO_LODBIASADJUST_NUM_VALUES = 2, + AUTO_LODBIASADJUST_DEFAULT = AUTO_LODBIASADJUST_ON +}; + +enum EValues_EXPORT_PERF_COUNTERS_DX9_ONLY { + EXPORT_PERF_COUNTERS_DX9_ONLY_OFF = 0x00000000, + EXPORT_PERF_COUNTERS_DX9_ONLY_ON = 0x00000001, + EXPORT_PERF_COUNTERS_DX9_ONLY_NUM_VALUES = 2, + EXPORT_PERF_COUNTERS_DX9_ONLY_DEFAULT = EXPORT_PERF_COUNTERS_DX9_ONLY_OFF +}; + +enum EValues_LODBIASADJUST { + LODBIASADJUST_MIN = 0xffffff80, + LODBIASADJUST_MAX = 128, + LODBIASADJUST_NUM_VALUES = 2, + LODBIASADJUST_DEFAULT = 0 +}; + +enum EValues_MAXWELL_B_SAMPLE_INTERLEAVE { + MAXWELL_B_SAMPLE_INTERLEAVE_OFF = 0, + MAXWELL_B_SAMPLE_INTERLEAVE_ON = 1, + MAXWELL_B_SAMPLE_INTERLEAVE_NUM_VALUES = 2, + MAXWELL_B_SAMPLE_INTERLEAVE_DEFAULT = MAXWELL_B_SAMPLE_INTERLEAVE_OFF +}; + +enum EValues_PRERENDERLIMIT { + PRERENDERLIMIT_MIN = 0x00, + PRERENDERLIMIT_MAX = 0xff, + PRERENDERLIMIT_APP_CONTROLLED = 0x00, + PRERENDERLIMIT_NUM_VALUES = 3, + PRERENDERLIMIT_DEFAULT = PRERENDERLIMIT_APP_CONTROLLED +}; + +enum EValues_PS_SHADERDISKCACHE { + PS_SHADERDISKCACHE_OFF = 0x00000000, + PS_SHADERDISKCACHE_ON = 0x00000001, + PS_SHADERDISKCACHE_NUM_VALUES = 2, + PS_SHADERDISKCACHE_DEFAULT = 0x1 +}; + +enum EValues_PS_TEXFILTER_ANISO_OPTS2 { + PS_TEXFILTER_ANISO_OPTS2_OFF = 0x00000000, + PS_TEXFILTER_ANISO_OPTS2_ON = 0x00000001, + PS_TEXFILTER_ANISO_OPTS2_NUM_VALUES = 2, + PS_TEXFILTER_ANISO_OPTS2_DEFAULT = PS_TEXFILTER_ANISO_OPTS2_OFF +}; + +enum EValues_PS_TEXFILTER_BILINEAR_IN_ANISO { + PS_TEXFILTER_BILINEAR_IN_ANISO_OFF = 0x00000000, + PS_TEXFILTER_BILINEAR_IN_ANISO_ON = 0x00000001, + PS_TEXFILTER_BILINEAR_IN_ANISO_NUM_VALUES = 2, + PS_TEXFILTER_BILINEAR_IN_ANISO_DEFAULT = PS_TEXFILTER_BILINEAR_IN_ANISO_OFF +}; + +enum EValues_PS_TEXFILTER_DISABLE_TRILIN_SLOPE { + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF = 0x00000000, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ON = 0x00000001, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_NUM_VALUES = 2, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_DEFAULT = PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF +}; + +enum EValues_PS_TEXFILTER_NO_NEG_LODBIAS { + PS_TEXFILTER_NO_NEG_LODBIAS_OFF = 0x00000000, + PS_TEXFILTER_NO_NEG_LODBIAS_ON = 0x00000001, + PS_TEXFILTER_NO_NEG_LODBIAS_NUM_VALUES = 2, + PS_TEXFILTER_NO_NEG_LODBIAS_DEFAULT = PS_TEXFILTER_NO_NEG_LODBIAS_OFF +}; + +enum EValues_QUALITY_ENHANCEMENTS { + QUALITY_ENHANCEMENTS_HIGHQUALITY = 0xfffffff6, + QUALITY_ENHANCEMENTS_QUALITY = 0x00000000, + QUALITY_ENHANCEMENTS_PERFORMANCE = 0x0000000a, + QUALITY_ENHANCEMENTS_HIGHPERFORMANCE = 0x00000014, + QUALITY_ENHANCEMENTS_NUM_VALUES = 4, + QUALITY_ENHANCEMENTS_DEFAULT = QUALITY_ENHANCEMENTS_QUALITY +}; + +enum EValues_QUALITY_ENHANCEMENT_SUBSTITUTION { + QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION = 0x00000000, + QUALITY_ENHANCEMENT_SUBSTITUTION_HIGHQUALITY_BECOMES_QUALITY = 0x00000001, + QUALITY_ENHANCEMENT_SUBSTITUTION_NUM_VALUES = 2, + QUALITY_ENHANCEMENT_SUBSTITUTION_DEFAULT = QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION +}; + +enum EValues_REFRESH_RATE_OVERRIDE { + REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED = 0x00000000, + REFRESH_RATE_OVERRIDE_HIGHEST_AVAILABLE = 0x00000001, + REFRESH_RATE_OVERRIDE_LOW_LATENCY_RR_MASK = 0x00000FF0, + REFRESH_RATE_OVERRIDE_NUM_VALUES = 3, + REFRESH_RATE_OVERRIDE_DEFAULT = REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED +}; + +enum EValues_SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE { + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF = 0x00000000, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ON = 0x00000001, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_NUM_VALUES = 2, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_DEFAULT = SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF +}; + +enum EValues_SET_VAB_DATA { + SET_VAB_DATA_ZERO = 0x00000000, + SET_VAB_DATA_UINT_ONE = 0x00000001, + SET_VAB_DATA_FLOAT_ONE = 0x3f800000, + SET_VAB_DATA_FLOAT_POS_INF = 0x7f800000, + SET_VAB_DATA_FLOAT_NAN = 0x7fc00000, + SET_VAB_DATA_USE_API_DEFAULTS = 0xffffffff, + SET_VAB_DATA_NUM_VALUES = 6, + SET_VAB_DATA_DEFAULT = SET_VAB_DATA_USE_API_DEFAULTS +}; + +enum EValues_VSYNCMODE { + VSYNCMODE_PASSIVE = 0x60925292, + VSYNCMODE_FORCEOFF = 0x08416747, + VSYNCMODE_FORCEON = 0x47814940, + VSYNCMODE_FLIPINTERVAL2 = 0x32610244, + VSYNCMODE_FLIPINTERVAL3 = 0x71271021, + VSYNCMODE_FLIPINTERVAL4 = 0x13245256, + VSYNCMODE_VIRTUAL = 0x18888888, + VSYNCMODE_NUM_VALUES = 7, + VSYNCMODE_DEFAULT = VSYNCMODE_PASSIVE +}; + +enum EValues_VSYNCTEARCONTROL { + VSYNCTEARCONTROL_DISABLE = 0x96861077, + VSYNCTEARCONTROL_ENABLE = 0x99941284, + VSYNCTEARCONTROL_NUM_VALUES = 2, + VSYNCTEARCONTROL_DEFAULT = VSYNCTEARCONTROL_DISABLE +}; + + + +typedef struct _SettingDWORDNameString { + NvU32 settingId; + const wchar_t* settingNameString; + NvU32 numSettingValues; + NvU32* settingValues; + NvU32 defaultValue; +} SettingDWORDNameString; + +typedef struct _SettingWSTRINGNameString { + NvU32 settingId; + const wchar_t* settingNameString; + NvU32 numSettingValues; + const wchar_t** settingValues; + const wchar_t* defaultValue; +} SettingWSTRINGNameString; + + +#endif // _NVAPI_DRIVER_SETTINGS_H_ + diff --git a/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.tt b/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.tt new file mode 100644 index 0000000..4a51b97 --- /dev/null +++ b/ColorControl/nspector/Native/NVAPI/NvApiDriverSettings.tt @@ -0,0 +1,42 @@ +<#@ template debug="false" hostspecific="true" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ import namespace="System.IO" #> +<#@ import namespace="System.Text.RegularExpressions" #> +<#@ output extension=".cs" #> +namespace nspector.Native.NvApi.DriverSettings +{ +<# + string absolutePath = Host.ResolvePath("NvApiDriverSettings.h"); + string contents = File.ReadAllText(absolutePath); + + string pattern = "enum\\s+(?.*?)\\{(?.*?)\\}"; + var rx = new Regex(pattern, RegexOptions.Singleline); + foreach (Match m in rx.Matches(contents)) + { + PushIndent("\t"); + + string enumSrc = m.Result("${enums}").Trim(); + string enumType = ""; + + if (Regex.IsMatch(enumSrc, "0x[A-Fa-f0-9]{8}L")) + enumType = " : ulong"; + else if (Regex.IsMatch(enumSrc, @".*?=\s+-.*?")) + enumType = " : int"; + else + enumType = " : uint"; + + WriteLine("public enum " + m.Result("${name}").Trim() + enumType + " {"); + + WriteLine("\t" + enumSrc); + + WriteLine("}"); + + PopIndent(); + WriteLine(""); + } + +#> +} \ No newline at end of file diff --git a/ColorControl/nspector/Native/NVAPI/NvapiDrsWrapper.cs b/ColorControl/nspector/Native/NVAPI/NvapiDrsWrapper.cs new file mode 100644 index 0000000..1fd252f --- /dev/null +++ b/ColorControl/nspector/Native/NVAPI/NvapiDrsWrapper.cs @@ -0,0 +1,751 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace nspector.Native.NVAPI2 +{ + + public enum NvAPI_Status : int + { + NVAPI_OK = 0, + NVAPI_ERROR = -1, + NVAPI_LIBRARY_NOT_FOUND = -2, + NVAPI_NO_IMPLEMENTATION = -3, + NVAPI_API_NOT_INITIALIZED = -4, + NVAPI_INVALID_ARGUMENT = -5, + NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, + NVAPI_END_ENUMERATION = -7, + NVAPI_INVALID_HANDLE = -8, + NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, + NVAPI_HANDLE_INVALIDATED = -10, + NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, + NVAPI_INVALID_POINTER = -14, + NVAPI_NO_GL_EXPERT = -12, + NVAPI_INSTRUMENTATION_DISABLED = -13, + NVAPI_NO_GL_NSIGHT = -15, + NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, + NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, + NVAPI_EXPECTED_DISPLAY_HANDLE = -102, + NVAPI_INVALID_COMBINATION = -103, + NVAPI_NOT_SUPPORTED = -104, + NVAPI_PORTID_NOT_FOUND = -105, + NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, + NVAPI_INVALID_PERF_LEVEL = -107, + NVAPI_DEVICE_BUSY = -108, + NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, + NVAPI_PERSIST_DATA_NOT_FOUND = -110, + NVAPI_EXPECTED_TV_DISPLAY = -111, + NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, + NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, + NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, + NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, + NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, + NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, + NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, + NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, + NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, + NVAPI_DATA_NOT_FOUND = -121, + NVAPI_EXPECTED_ANALOG_DISPLAY = -122, + NVAPI_NO_VIDLINK = -123, + NVAPI_REQUIRES_REBOOT = -124, + NVAPI_INVALID_HYBRID_MODE = -125, + NVAPI_MIXED_TARGET_TYPES = -126, + NVAPI_SYSWOW64_NOT_SUPPORTED = -127, + NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, + NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, + NVAPI_OUT_OF_MEMORY = -130, + NVAPI_WAS_STILL_DRAWING = -131, + NVAPI_FILE_NOT_FOUND = -132, + NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, + NVAPI_INVALID_CALL = -134, + NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, + NVAPI_FUNCTION_NOT_FOUND = -136, + NVAPI_INVALID_USER_PRIVILEGE = -137, + NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE = -138, + NVAPI_EXPECTED_COMPUTE_GPU_HANDLE = -139, + NVAPI_STEREO_NOT_INITIALIZED = -140, + NVAPI_STEREO_REGISTRY_ACCESS_FAILED = -141, + NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED = -142, + NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED = -143, + NVAPI_STEREO_NOT_ENABLED = -144, + NVAPI_STEREO_NOT_TURNED_ON = -145, + NVAPI_STEREO_INVALID_DEVICE_INTERFACE = -146, + NVAPI_STEREO_PARAMETER_OUT_OF_RANGE = -147, + NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED = -148, + NVAPI_TOPO_NOT_POSSIBLE = -149, + NVAPI_MODE_CHANGE_FAILED = -150, + NVAPI_D3D11_LIBRARY_NOT_FOUND = -151, + NVAPI_INVALID_ADDRESS = -152, + NVAPI_STRING_TOO_SMALL = -153, + NVAPI_MATCHING_DEVICE_NOT_FOUND = -154, + NVAPI_DRIVER_RUNNING = -155, + NVAPI_DRIVER_NOTRUNNING = -156, + NVAPI_ERROR_DRIVER_RELOAD_REQUIRED = -157, + NVAPI_SET_NOT_ALLOWED = -158, + NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED = -159, + NVAPI_SETTING_NOT_FOUND = -160, + NVAPI_SETTING_SIZE_TOO_LARGE = -161, + NVAPI_TOO_MANY_SETTINGS_IN_PROFILE = -162, + NVAPI_PROFILE_NOT_FOUND = -163, + NVAPI_PROFILE_NAME_IN_USE = -164, + NVAPI_PROFILE_NAME_EMPTY = -165, + NVAPI_EXECUTABLE_NOT_FOUND = -166, + NVAPI_EXECUTABLE_ALREADY_IN_USE = -167, + NVAPI_DATATYPE_MISMATCH = -168, + NVAPI_PROFILE_REMOVED = -169, + NVAPI_UNREGISTERED_RESOURCE = -170, + NVAPI_ID_OUT_OF_RANGE = -171, + NVAPI_DISPLAYCONFIG_VALIDATION_FAILED = -172, + NVAPI_DPMST_CHANGED = -173, + NVAPI_INSUFFICIENT_BUFFER = -174, + NVAPI_ACCESS_DENIED = -175, + NVAPI_MOSAIC_NOT_ACTIVE = -176, + NVAPI_SHARE_RESOURCE_RELOCATED = -177, + NVAPI_REQUEST_USER_TO_DISABLE_DWM = -178, + NVAPI_D3D_DEVICE_LOST = -179, + NVAPI_INVALID_CONFIGURATION = -180, + NVAPI_STEREO_HANDSHAKE_NOT_DONE = -181, + NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS = -182, + NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED = -183, + NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST = -184, + NVAPI_CLUSTER_ALREADY_EXISTS = -185, + NVAPI_DPMST_DISPLAY_ID_EXPECTED = -186, + NVAPI_INVALID_DISPLAY_ID = -187, + NVAPI_STREAM_IS_OUT_OF_SYNC = -188, + NVAPI_INCOMPATIBLE_AUDIO_DRIVER = -189, + NVAPI_VALUE_ALREADY_SET = -190, + NVAPI_TIMEOUT = -191, + NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE = -192, + NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE = -193, + NVAPI_SYNC_NOT_ACTIVE = -194, + NVAPI_SYNC_MASTER_NOT_FOUND = -195, + NVAPI_INVALID_SYNC_TOPOLOGY = -196, + NVAPI_ECID_SIGN_ALGO_UNSUPPORTED = -197, + NVAPI_ECID_KEY_VERIFICATION_FAILED = -198, + } + + internal enum NVDRS_SETTING_TYPE : int + { + NVDRS_DWORD_TYPE, + NVDRS_BINARY_TYPE, + NVDRS_STRING_TYPE, + NVDRS_WSTRING_TYPE, + } + + internal enum NVDRS_SETTING_LOCATION : int + { + NVDRS_CURRENT_PROFILE_LOCATION, + NVDRS_GLOBAL_PROFILE_LOCATION, + NVDRS_BASE_PROFILE_LOCATION, + NVDRS_DEFAULT_PROFILE_LOCATION, + } + + [Flags] + public enum NVDRS_GPU_SUPPORT : uint + { + None, + Geforce, + Quadro, + Nvs, + } + + [StructLayout(LayoutKind.Sequential, Pack = 8)] + internal struct NVDRS_SETTING_VALUES + { + public uint version; + public uint numSettingValues; + public NVDRS_SETTING_TYPE settingType; + public NVDRS_SETTING_UNION defaultValue; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)NvapiDrsWrapper.NVAPI_SETTING_MAX_VALUES)] + public NVDRS_SETTING_UNION[] settingValues; + } + + //[StructLayout(LayoutKind.Sequential, Pack = 8)] + //internal struct NVDRS_BINARY_SETTING + //{ + // public uint valueLength; + + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)NvapiDrsWrapper.NVAPI_BINARY_DATA_MAX)] + // public byte[] valueData; + //} + + //[StructLayout(LayoutKind.Explicit, Pack = 8, CharSet = CharSet.Unicode)] + //internal struct NVDRS_SETTING_UNION + //{ + // public uint dwordValue + // { + // get { return binaryValue.valueLength; } + // set { binaryValue.valueLength = value; } + // } + + // [FieldOffsetAttribute(0)] + // public NVDRS_BINARY_SETTING binaryValue; + + // [FieldOffsetAttribute(0)] + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + // public string stringValue; + //} + + //[StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode, Size = 4100)] + //internal struct NVDRS_SETTING_UNION + //{ + // public uint dwordValue; + + // //massive hack for marshalling issues with unicode string overlapping + // public string stringValue + // { + // get + // { + // var firstPart = Encoding.Unicode.GetString(BitConverter.GetBytes(dwordValue)).Trim('\0'); + // return firstPart + stringRaw; + // } + + // set + // { + // var bytesRaw = Encoding.Unicode.GetBytes(value); + // var bytesFirst = new byte[4]; + // var firstLength = bytesRaw.Length; + // if (firstLength > 4) + // firstLength = 4; + // Buffer.BlockCopy(bytesRaw, 0, bytesFirst, 0, firstLength); + // dwordValue = BitConverter.ToUInt32(bytesFirst, 0); + + // if (value.Length > 2) + // { + // stringRaw = value.Substring(2); + // } + // } + + // } + + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + // private string stringRaw; + + //} + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode, Size = 4100)] + internal struct NVDRS_SETTING_UNION + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4100)] + public byte[] rawData; + + public byte[] binaryValue + { + get + { + var length = BitConverter.ToUInt32(rawData, 0); + var tmpData = new byte[length]; + Buffer.BlockCopy(rawData, 4, tmpData, 0, (int)length); + return tmpData; + } + + set + { + rawData = new byte[4100]; + if (value != null) + { + Buffer.BlockCopy(BitConverter.GetBytes(value.Length), 0, rawData, 0, 4); + Buffer.BlockCopy(value, 0, rawData, 4, value.Length); + } + } + } + + public uint dwordValue + { + get + { + return BitConverter.ToUInt32(rawData, 0); + } + + set + { + rawData = new byte[4100]; + Buffer.BlockCopy(BitConverter.GetBytes(value), 0, rawData, 0, 4); + } + } + + public string stringValue + { + get + { + return Encoding.Unicode.GetString(rawData).Split(new[] { '\0' }, 2)[0]; + } + + set + { + rawData = new byte[4100]; + var bytesRaw = Encoding.Unicode.GetBytes(value); + Buffer.BlockCopy(bytesRaw, 0, rawData, 0, bytesRaw.Length); + } + } + + public string ansiStringValue + { + get + { + return Encoding.Default.GetString(rawData).Split(new[] { '\0' }, 2)[0]; + } + + set + { + rawData = new byte[4100]; + var bytesRaw = Encoding.Default.GetBytes(value); + Buffer.BlockCopy(bytesRaw, 0, rawData, 0, bytesRaw.Length); + } + } + + } + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)] + internal struct NVDRS_SETTING + { + public uint version; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string settingName; + public uint settingId; + public NVDRS_SETTING_TYPE settingType; + public NVDRS_SETTING_LOCATION settingLocation; + public uint isCurrentPredefined; + public uint isPredefinedValid; + public NVDRS_SETTING_UNION predefinedValue; + public NVDRS_SETTING_UNION currentValue; + } + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)] + internal struct NVDRS_APPLICATION_V1 + { + public uint version; + public uint isPredefined; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string appName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string userFriendlyName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string launcher; + } + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)] + internal struct NVDRS_APPLICATION_V2 + { + public uint version; + public uint isPredefined; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string appName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string userFriendlyName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string launcher; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string fileInFolder; + } + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)] + internal struct NVDRS_APPLICATION_V3 + { + public uint isMetro { get { return ((uint)((bitvector1 & 1))); } set { bitvector1 = ((uint)((value | bitvector1))); } } + + public uint version; + public uint isPredefined; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string appName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string userFriendlyName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string launcher; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string fileInFolder; + private uint bitvector1; + } + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)] + internal struct NVDRS_PROFILE + { + public uint version; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)] + public string profileName; + public NVDRS_GPU_SUPPORT gpuSupport; + public uint isPredefined; + public uint numOfApps; + public uint numOfSettings; + } + + internal class NvapiDrsWrapper + { + + #region CONSTANTS + public const uint NVAPI_GENERIC_STRING_MAX = 4096; + public const uint NVAPI_LONG_STRING_MAX = 256; + public const uint NVAPI_SHORT_STRING_MAX = 64; + public const uint NVAPI_MAX_PHYSICAL_GPUS = 64; + public const uint NVAPI_UNICODE_STRING_MAX = 2048; + public const uint NVAPI_BINARY_DATA_MAX = 4096; + + public const uint NVAPI_SETTING_MAX_VALUES = 100; + public static uint NVDRS_SETTING_VALUES_VER = MAKE_NVAPI_VERSION(1); + public static uint NVDRS_SETTING_VER = MAKE_NVAPI_VERSION(1); + public static uint NVDRS_APPLICATION_VER_V1 = MAKE_NVAPI_VERSION(1); + public static uint NVDRS_APPLICATION_VER_V2 = MAKE_NVAPI_VERSION(2); + public static uint NVDRS_APPLICATION_VER_V3 = MAKE_NVAPI_VERSION(3); + public static uint NVDRS_APPLICATION_VER = NVDRS_APPLICATION_VER_V3; + public static uint NVDRS_PROFILE_VER = MAKE_NVAPI_VERSION(1); + + public const uint OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES = 1; + public const uint CUDA_EXCLUDED_GPUS_NUM_VALUES = 1; + public const string D3DOGL_GPU_MAX_POWER_DEFAULTPOWER = "0"; + public const uint D3DOGL_GPU_MAX_POWER_NUM_VALUES = 1; + public const string D3DOGL_GPU_MAX_POWER_DEFAULT = D3DOGL_GPU_MAX_POWER_DEFAULTPOWER; + #endregion + + + private NvapiDrsWrapper() { } + + [DllImport("kernel32.dll")] + private static extern IntPtr LoadLibrary(String dllname); + + [DllImport("kernel32.dll")] + private static extern IntPtr GetProcAddress(IntPtr hModule, String procname); + + private static uint MAKE_NVAPI_VERSION(int version) + { + return (UInt32)((Marshal.SizeOf(typeof(T))) | (int)(version << 16)); + } + + private static string GetDllName() + { + if (IntPtr.Size == 4) + { + return "nvapi.dll"; + } + else + { + return "nvapi64.dll"; + } + } + + private static void GetDelegate(uint id, out T newDelegate) where T : class + { + IntPtr ptr = nvapi_QueryInterface(id); + if (ptr != IntPtr.Zero) + { + newDelegate = Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T; + } + else + { + newDelegate = null; + } + } + + private static T GetDelegateOfFunction(IntPtr pLib, string signature) + { + T FuncT = default(T); + IntPtr FuncAddr = GetProcAddress(pLib, signature); + if (FuncAddr != IntPtr.Zero) + FuncT = (T)(object)Marshal.GetDelegateForFunctionPointer(FuncAddr, typeof(T)); + return FuncT; + } + + #region DELEGATES + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr nvapi_QueryInterfaceDelegate(uint id); + private static readonly nvapi_QueryInterfaceDelegate nvapi_QueryInterface; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status NvAPI_InitializeDelegate(); + public static readonly NvAPI_InitializeDelegate NvAPI_Initialize; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status InitializeDelegate(); + public static readonly InitializeDelegate Initialize; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status UnloadDelegate(); + public static readonly UnloadDelegate Unload; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status GetErrorMessageDelegate(NvAPI_Status nr, [MarshalAs(UnmanagedType.LPStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_SHORT_STRING_MAX)]StringBuilder szDesc); + public static readonly GetErrorMessageDelegate GetErrorMessage; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status GetInterfaceVersionStringDelegate([MarshalAs(UnmanagedType.LPStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_SHORT_STRING_MAX)]StringBuilder szDesc); + public static readonly GetInterfaceVersionStringDelegate GetInterfaceVersionString; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status SYS_GetDriverAndBranchVersionDelegate(ref uint pDriverVersion, [MarshalAs(UnmanagedType.LPStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_SHORT_STRING_MAX)]StringBuilder szBuildBranchString); + public static readonly SYS_GetDriverAndBranchVersionDelegate SYS_GetDriverAndBranchVersion; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_CreateSessionDelegate(ref IntPtr phSession); + public static readonly DRS_CreateSessionDelegate DRS_CreateSession; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_DestroySessionDelegate(IntPtr hSession); + public static readonly DRS_DestroySessionDelegate DRS_DestroySession; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_LoadSettingsDelegate(IntPtr hSession); + public static readonly DRS_LoadSettingsDelegate DRS_LoadSettings; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_SaveSettingsDelegate(IntPtr hSession); + public static readonly DRS_SaveSettingsDelegate DRS_SaveSettings; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_LoadSettingsFromFileDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder fileName); + public static readonly DRS_LoadSettingsFromFileDelegate DRS_LoadSettingsFromFile; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_SaveSettingsToFileDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder fileName); + public static readonly DRS_SaveSettingsToFileDelegate DRS_SaveSettingsToFile; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_LoadSettingsFromFileExDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder fileName); + public static readonly DRS_LoadSettingsFromFileExDelegate DRS_LoadSettingsFromFileEx; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_SaveSettingsToFileExDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder fileName); + public static readonly DRS_SaveSettingsToFileExDelegate DRS_SaveSettingsToFileEx; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_CreateProfileDelegate(IntPtr hSession, ref NVDRS_PROFILE pProfileInfo, ref IntPtr phProfile); + public static readonly DRS_CreateProfileDelegate DRS_CreateProfile; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_DeleteProfileDelegate(IntPtr hSession, IntPtr hProfile); + public static readonly DRS_DeleteProfileDelegate DRS_DeleteProfile; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_SetCurrentGlobalProfileDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder wszGlobalProfileName); + public static readonly DRS_SetCurrentGlobalProfileDelegate DRS_SetCurrentGlobalProfile; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_GetCurrentGlobalProfileDelegate(IntPtr hSession, ref IntPtr phProfile); + public static readonly DRS_GetCurrentGlobalProfileDelegate DRS_GetCurrentGlobalProfile; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_GetProfileInfoDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_PROFILE pProfileInfo); + public static readonly DRS_GetProfileInfoDelegate DRS_GetProfileInfo; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_SetProfileInfoDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_PROFILE pProfileInfo); + public static readonly DRS_SetProfileInfoDelegate DRS_SetProfileInfo; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_FindProfileByNameDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder profileName, ref IntPtr phProfile); + public static readonly DRS_FindProfileByNameDelegate DRS_FindProfileByName; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_EnumProfilesDelegate(IntPtr hSession, uint index, ref IntPtr phProfile); + public static readonly DRS_EnumProfilesDelegate DRS_EnumProfiles; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_GetNumProfilesDelegate(IntPtr hSession, ref uint numProfiles); + public static readonly DRS_GetNumProfilesDelegate DRS_GetNumProfiles; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_CreateApplicationDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_APPLICATION_V3 pApplication); + public static readonly DRS_CreateApplicationDelegate DRS_CreateApplication; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_DeleteApplicationExDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_APPLICATION_V3 pApp); + public static readonly DRS_DeleteApplicationExDelegate DRS_DeleteApplicationEx; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_DeleteApplicationDelegate(IntPtr hSession, IntPtr hProfile, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder appName); + public static readonly DRS_DeleteApplicationDelegate DRS_DeleteApplication; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_GetApplicationInfoDelegate(IntPtr hSession, IntPtr hProfile, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder appName, ref NVDRS_APPLICATION_V3 pApplication); + public static readonly DRS_GetApplicationInfoDelegate DRS_GetApplicationInfo; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate NvAPI_Status DRS_EnumApplicationsDelegate(IntPtr hSession, IntPtr hProfile, uint startIndex, ref uint appCount, IntPtr pApplication); + private static readonly DRS_EnumApplicationsDelegate DRS_EnumApplicationsInternal; + public static NvAPI_Status DRS_EnumApplications(IntPtr hSession, IntPtr hProfile, uint startIndex, ref uint appCount, ref TDrsAppVersion[] apps) + { + NvAPI_Status res; + + IntPtr pSettings; + NativeArrayHelper.SetArrayData(apps, out pSettings); + try + { + res = DRS_EnumApplicationsInternal(hSession, hProfile, startIndex, ref appCount, pSettings); + apps = NativeArrayHelper.GetArrayData(pSettings, (int)appCount); + } + finally + { + Marshal.FreeHGlobal(pSettings); + } + return res; + } + + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_FindApplicationByNameDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder appName, ref IntPtr phProfile, ref NVDRS_APPLICATION_V3 pApplication); + public static readonly DRS_FindApplicationByNameDelegate DRS_FindApplicationByName; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_SetSettingDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_SETTING pSetting); + public static readonly DRS_SetSettingDelegate DRS_SetSetting; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_GetSettingDelegate(IntPtr hSession, IntPtr hProfile, uint settingId, ref NVDRS_SETTING pSetting); + public static readonly DRS_GetSettingDelegate DRS_GetSetting; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate NvAPI_Status DRS_EnumSettingsDelegate(IntPtr hSession, IntPtr hProfile, uint startIndex, ref uint settingsCount, IntPtr pSetting); + private static readonly DRS_EnumSettingsDelegate DRS_EnumSettingsInternal; + public static NvAPI_Status DRS_EnumSettings(IntPtr hSession, IntPtr hProfile, uint startIndex, ref uint settingsCount, ref NVDRS_SETTING[] settings) + { + NvAPI_Status res; + + IntPtr pSettings; + NativeArrayHelper.SetArrayData(settings, out pSettings); + try + { + res = DRS_EnumSettingsInternal(hSession, hProfile, startIndex, ref settingsCount, pSettings); + settings = NativeArrayHelper.GetArrayData(pSettings, (int)settingsCount); + } + finally + { + Marshal.FreeHGlobal(pSettings); + } + return res; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_EnumAvailableSettingIdsDelegate(IntPtr pSettingIds, ref uint pMaxCount); + public static readonly DRS_EnumAvailableSettingIdsDelegate DRS_EnumAvailableSettingIdsInternal; + public static NvAPI_Status DRS_EnumAvailableSettingIds(out List settingIds, uint maxCount) + { + NvAPI_Status res; + var settingIdArray = new uint[maxCount]; + var pSettingIds = IntPtr.Zero; + NativeArrayHelper.SetArrayData(settingIdArray, out pSettingIds); + try + { + res = DRS_EnumAvailableSettingIdsInternal(pSettingIds, ref maxCount); + + settingIdArray = NativeArrayHelper.GetArrayData(pSettingIds, (int)maxCount); + settingIds = settingIdArray.ToList(); + } + finally + { + Marshal.FreeHGlobal(pSettingIds); + } + return res; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate NvAPI_Status DRS_EnumAvailableSettingValuesDelegate(uint settingId, ref uint pMaxNumValues, IntPtr pSettingValues); + private static readonly DRS_EnumAvailableSettingValuesDelegate DRS_EnumAvailableSettingValuesInternal; + public static NvAPI_Status DRS_EnumAvailableSettingValues(uint settingId, ref uint pMaxNumValues, ref NVDRS_SETTING_VALUES settingValues) + { + var pSettingValues = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NVDRS_SETTING_VALUES))); + NvAPI_Status res; + try + { + settingValues.settingValues = new NVDRS_SETTING_UNION[(int)NVAPI_SETTING_MAX_VALUES]; + Marshal.StructureToPtr(settingValues, pSettingValues, true); + res = DRS_EnumAvailableSettingValuesInternal(settingId, ref pMaxNumValues, pSettingValues); + settingValues = (NVDRS_SETTING_VALUES)Marshal.PtrToStructure(pSettingValues, typeof(NVDRS_SETTING_VALUES)); + } + finally + { + Marshal.FreeHGlobal(pSettingValues); + } + return res; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_GetSettingIdFromNameDelegate([MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder settingName, ref uint pSettingId); + public static readonly DRS_GetSettingIdFromNameDelegate DRS_GetSettingIdFromName; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_GetSettingNameFromIdDelegate(uint settingId, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder pSettingName); + public static readonly DRS_GetSettingNameFromIdDelegate DRS_GetSettingNameFromId; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_DeleteProfileSettingDelegate(IntPtr hSession, IntPtr hProfile, uint settingId); + public static readonly DRS_DeleteProfileSettingDelegate DRS_DeleteProfileSetting; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_RestoreAllDefaultsDelegate(IntPtr hSession); + public static readonly DRS_RestoreAllDefaultsDelegate DRS_RestoreAllDefaults; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_RestoreProfileDefaultDelegate(IntPtr hSession, IntPtr hProfile); + public static readonly DRS_RestoreProfileDefaultDelegate DRS_RestoreProfileDefault; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_RestoreProfileDefaultSettingDelegate(IntPtr hSession, IntPtr hProfile, uint settingId); + public static readonly DRS_RestoreProfileDefaultSettingDelegate DRS_RestoreProfileDefaultSetting; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvAPI_Status DRS_GetBaseProfileDelegate(IntPtr hSession, ref IntPtr phProfile); + public static readonly DRS_GetBaseProfileDelegate DRS_GetBaseProfile; + + #endregion + static NvapiDrsWrapper() + { + IntPtr lib = LoadLibrary(GetDllName()); + if (lib != IntPtr.Zero) + { + nvapi_QueryInterface = GetDelegateOfFunction(lib, "nvapi_QueryInterface"); + if (nvapi_QueryInterface != null) + { + GetDelegate(0x0150E828, out NvAPI_Initialize); + if (NvAPI_Initialize() == NvAPI_Status.NVAPI_OK) + { + #region FUNCTION IDs + GetDelegate(0x0150E828, out Initialize); + GetDelegate(0xD22BDD7E, out Unload); + GetDelegate(0x6C2D048C, out GetErrorMessage); + GetDelegate(0x01053FA5, out GetInterfaceVersionString); + GetDelegate(0x2926AAAD, out SYS_GetDriverAndBranchVersion); + GetDelegate(0x0694D52E, out DRS_CreateSession); + GetDelegate(0xDAD9CFF8, out DRS_DestroySession); + GetDelegate(0x375DBD6B, out DRS_LoadSettings); + GetDelegate(0xFCBC7E14, out DRS_SaveSettings); + GetDelegate(0xD3EDE889, out DRS_LoadSettingsFromFile); + GetDelegate(0x2BE25DF8, out DRS_SaveSettingsToFile); + GetDelegate(0xC63C045B, out DRS_LoadSettingsFromFileEx); + GetDelegate(0x1267818E, out DRS_SaveSettingsToFileEx); + GetDelegate(0xCC176068, out DRS_CreateProfile); + GetDelegate(0x17093206, out DRS_DeleteProfile); + GetDelegate(0x1C89C5DF, out DRS_SetCurrentGlobalProfile); + GetDelegate(0x617BFF9F, out DRS_GetCurrentGlobalProfile); + GetDelegate(0x61CD6FD6, out DRS_GetProfileInfo); + GetDelegate(0x16ABD3A9, out DRS_SetProfileInfo); + GetDelegate(0x7E4A9A0B, out DRS_FindProfileByName); + GetDelegate(0xBC371EE0, out DRS_EnumProfiles); + GetDelegate(0x1DAE4FBC, out DRS_GetNumProfiles); + GetDelegate(0x4347A9DE, out DRS_CreateApplication); + GetDelegate(0xC5EA85A1, out DRS_DeleteApplicationEx); + GetDelegate(0x2C694BC6, out DRS_DeleteApplication); + GetDelegate(0xED1F8C69, out DRS_GetApplicationInfo); + GetDelegate(0x7FA2173A, out DRS_EnumApplicationsInternal); + GetDelegate(0xEEE566B2, out DRS_FindApplicationByName); + GetDelegate(0x577DD202, out DRS_SetSetting); + GetDelegate(0x73BF8338, out DRS_GetSetting); + GetDelegate(0xAE3039DA, out DRS_EnumSettingsInternal); + GetDelegate(0xF020614A, out DRS_EnumAvailableSettingIdsInternal); + GetDelegate(0x2EC39F90, out DRS_EnumAvailableSettingValuesInternal); + GetDelegate(0xCB7309CD, out DRS_GetSettingIdFromName); + GetDelegate(0xD61CBE6E, out DRS_GetSettingNameFromId); + GetDelegate(0xE4A26362, out DRS_DeleteProfileSetting); + GetDelegate(0x5927B094, out DRS_RestoreAllDefaults); + GetDelegate(0xFA5F6134, out DRS_RestoreProfileDefault); + GetDelegate(0x53F0381E, out DRS_RestoreProfileDefaultSetting); + GetDelegate(0xDA8466A0, out DRS_GetBaseProfile); + #endregion + + } + } + } + } + } + +} diff --git a/ColorControl/nspector/Native/NativeArrayHelper.cs b/ColorControl/nspector/Native/NativeArrayHelper.cs new file mode 100644 index 0000000..6bf8608 --- /dev/null +++ b/ColorControl/nspector/Native/NativeArrayHelper.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace nspector.Native +{ + internal class NativeArrayHelper + { + public static T GetArrayItemData(IntPtr sourcePointer) + { + return (T)Marshal.PtrToStructure(sourcePointer, typeof(T)); + } + + public static T[] GetArrayData(IntPtr sourcePointer, int itemCount) + { + var lstResult = new List(); + if (sourcePointer != IntPtr.Zero && itemCount > 0) + { + var sizeOfItem = Marshal.SizeOf(typeof(T)); + for (int i = 0; i < itemCount; i++) + { + lstResult.Add(GetArrayItemData(sourcePointer + (sizeOfItem * i))); + } + } + return lstResult.ToArray(); + } + + public static void SetArrayData(T[] items, out IntPtr targetPointer) + { + if (items != null && items.Length > 0) + { + var sizeOfItem = Marshal.SizeOf(typeof(T)); + targetPointer = Marshal.AllocHGlobal(sizeOfItem * items.Length); + for (int i = 0; i < items.Length; i++) + { + Marshal.StructureToPtr(items[i], targetPointer + (sizeOfItem * i), true); + } + } + else + { + targetPointer = IntPtr.Zero; + } + + } + + public static void SetArrayItemData(T item, out IntPtr targetPointer) + { + var sizeOfItem = Marshal.SizeOf(typeof(T)); + targetPointer = Marshal.AllocHGlobal(sizeOfItem); + Marshal.StructureToPtr(item, targetPointer, true); + } + + } +} diff --git a/ColorControl/nspector/Native/WINAPI/DragAcceptNativeHelper.cs b/ColorControl/nspector/Native/WINAPI/DragAcceptNativeHelper.cs new file mode 100644 index 0000000..f153614 --- /dev/null +++ b/ColorControl/nspector/Native/WINAPI/DragAcceptNativeHelper.cs @@ -0,0 +1,45 @@ +using System; +using System.Runtime.InteropServices; + +namespace nspector.Native.WINAPI +{ + internal static class DragAcceptNativeHelper + { + /// + /// Modifies the User Interface Privilege Isolation (UIPI) message filter for whole process. (Vista only) + /// + /// + /// + /// + [DllImport("user32.dll", SetLastError = true)] + internal static extern IntPtr ChangeWindowMessageFilter(int message, int dwFlag); + + /// + /// Modifies the User Interface Privilege Isolation (UIPI) message filter for a specified window. (Win7 or higher) + /// + /// + /// + /// + /// + [DllImport("user32.dll", SetLastError = true)] + internal static extern IntPtr ChangeWindowMessageFilterEx(IntPtr handle, int message, int action, IntPtr pChangeFilterStruct); + + //ChangeWindowMessageFilter + internal const int MSGFLT_ADD = 1; + internal const int MSGFLT_REMOVE = 2; + + //ChangeWindowMessageFilterEx + internal const int MSGFLT_ALLOW = 1; + internal const int MSGFLT_DISALLOW = 2; + internal const int MSGFLT_RESET = 3; + + + [DllImport("shell32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)] + public static extern void DragAcceptFiles(IntPtr hWnd, bool fAccept); + + internal const int WM_DROPFILES = 0x233; + internal const int WM_COPYDATA = 0x004A; + internal const int WM_COPYGLOBALDATA = 0x0049; + + } +} diff --git a/ColorControl/nspector/Native/WINAPI/MessageHelper.cs b/ColorControl/nspector/Native/WINAPI/MessageHelper.cs new file mode 100644 index 0000000..0da9a71 --- /dev/null +++ b/ColorControl/nspector/Native/WINAPI/MessageHelper.cs @@ -0,0 +1,380 @@ +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace nspector.Native.WINAPI +{ + internal class MessageHelper + { + [DllImport("User32.dll")] + private static extern int RegisterWindowMessage(string lpString); + + [DllImport("User32.dll", EntryPoint = "FindWindow")] + internal static extern Int32 FindWindow(String lpClassName, String lpWindowName); + + //For use with WM_COPYDATA and COPYDATASTRUCT + [DllImport("User32.dll", EntryPoint = "SendMessage")] + internal static extern int SendMessage(int hWnd, int Msg, int wParam, ref COPYDATASTRUCT lParam); + + //For use with WM_COPYDATA and COPYDATASTRUCT + [DllImport("User32.dll", EntryPoint = "PostMessage")] + internal static extern int PostMessage(int hWnd, int Msg, int wParam, ref COPYDATASTRUCT lParam); + + [DllImport("User32.dll", EntryPoint = "SendMessage")] + internal static extern int SendMessage(int hWnd, int Msg, int wParam, int lParam); + + [DllImport("User32.dll", EntryPoint = "PostMessage")] + internal static extern int PostMessage(int hWnd, int Msg, int wParam, int lParam); + + [DllImport("User32.dll", EntryPoint = "SetForegroundWindow")] + internal static extern bool SetForegroundWindow(int hWnd); + + [DllImport("User32.dll")] + static extern bool SetWindowPlacement(int hWnd, [In] ref WINDOWPLACEMENT lpwndpl); + + [DllImport("User32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool GetWindowPlacement(int hWnd, ref WINDOWPLACEMENT lpwndpl); + + #region Message Constants + + internal const int WM_NULL = 0x00; + internal const int WM_CREATE = 0x01; + internal const int WM_DESTROY = 0x02; + internal const int WM_MOVE = 0x03; + internal const int WM_SIZE = 0x05; + internal const int WM_ACTIVATE = 0x06; + internal const int WM_SETFOCUS = 0x07; + internal const int WM_KILLFOCUS = 0x08; + internal const int WM_ENABLE = 0x0A; + internal const int WM_SETREDRAW = 0x0B; + internal const int WM_SETTEXT = 0x0C; + internal const int WM_GETTEXT = 0x0D; + internal const int WM_GETTEXTLENGTH = 0x0E; + internal const int WM_PAINT = 0x0F; + internal const int WM_CLOSE = 0x10; + internal const int WM_QUERYENDSESSION = 0x11; + internal const int WM_QUIT = 0x12; + internal const int WM_QUERYOPEN = 0x13; + internal const int WM_ERASEBKGND = 0x14; + internal const int WM_SYSCOLORCHANGE = 0x15; + internal const int WM_ENDSESSION = 0x16; + internal const int WM_SYSTEMERROR = 0x17; + internal const int WM_SHOWWINDOW = 0x18; + internal const int WM_CTLCOLOR = 0x19; + internal const int WM_WININICHANGE = 0x1A; + internal const int WM_SETTINGCHANGE = 0x1A; + internal const int WM_DEVMODECHANGE = 0x1B; + internal const int WM_ACTIVATEAPP = 0x1C; + internal const int WM_FONTCHANGE = 0x1D; + internal const int WM_TIMECHANGE = 0x1E; + internal const int WM_CANCELMODE = 0x1F; + internal const int WM_SETCURSOR = 0x20; + internal const int WM_MOUSEACTIVATE = 0x21; + internal const int WM_CHILDACTIVATE = 0x22; + internal const int WM_QUEUESYNC = 0x23; + internal const int WM_GETMINMAXINFO = 0x24; + internal const int WM_PAINTICON = 0x26; + internal const int WM_ICONERASEBKGND = 0x27; + internal const int WM_NEXTDLGCTL = 0x28; + internal const int WM_SPOOLERSTATUS = 0x2A; + internal const int WM_DRAWITEM = 0x2B; + internal const int WM_MEASUREITEM = 0x2C; + internal const int WM_DELETEITEM = 0x2D; + internal const int WM_VKEYTOITEM = 0x2E; + internal const int WM_CHARTOITEM = 0x2F; + + internal const int WM_SETFONT = 0x30; + internal const int WM_GETFONT = 0x31; + internal const int WM_SETHOTKEY = 0x32; + internal const int WM_GETHOTKEY = 0x33; + internal const int WM_QUERYDRAGICON = 0x37; + internal const int WM_COMPAREITEM = 0x39; + internal const int WM_COMPACTING = 0x41; + internal const int WM_WINDOWPOSCHANGING = 0x46; + internal const int WM_WINDOWPOSCHANGED = 0x47; + internal const int WM_POWER = 0x48; + internal const int WM_COPYDATA = 0x4A; + internal const int WM_CANCELJOURNAL = 0x4B; + internal const int WM_NOTIFY = 0x4E; + internal const int WM_INPUTLANGCHANGEREQUEST = 0x50; + internal const int WM_INPUTLANGCHANGE = 0x51; + internal const int WM_TCARD = 0x52; + internal const int WM_HELP = 0x53; + internal const int WM_USERCHANGED = 0x54; + internal const int WM_NOTIFYFORMAT = 0x55; + internal const int WM_CONTEXTMENU = 0x7B; + internal const int WM_STYLECHANGING = 0x7C; + internal const int WM_STYLECHANGED = 0x7D; + internal const int WM_DISPLAYCHANGE = 0x7E; + internal const int WM_GETICON = 0x7F; + internal const int WM_SETICON = 0x80; + + internal const int WM_NCCREATE = 0x81; + internal const int WM_NCDESTROY = 0x82; + internal const int WM_NCCALCSIZE = 0x83; + internal const int WM_NCHITTEST = 0x84; + internal const int WM_NCPAINT = 0x85; + internal const int WM_NCACTIVATE = 0x86; + internal const int WM_GETDLGCODE = 0x87; + internal const int WM_NCMOUSEMOVE = 0xA0; + internal const int WM_NCLBUTTONDOWN = 0xA1; + internal const int WM_NCLBUTTONUP = 0xA2; + internal const int WM_NCLBUTTONDBLCLK = 0xA3; + internal const int WM_NCRBUTTONDOWN = 0xA4; + internal const int WM_NCRBUTTONUP = 0xA5; + internal const int WM_NCRBUTTONDBLCLK = 0xA6; + internal const int WM_NCMBUTTONDOWN = 0xA7; + internal const int WM_NCMBUTTONUP = 0xA8; + internal const int WM_NCMBUTTONDBLCLK = 0xA9; + + internal const int WM_KEYFIRST = 0x100; + internal const int WM_KEYDOWN = 0x100; + internal const int WM_KEYUP = 0x101; + internal const int WM_CHAR = 0x102; + internal const int WM_DEADCHAR = 0x103; + internal const int WM_SYSKEYDOWN = 0x104; + internal const int WM_SYSKEYUP = 0x105; + internal const int WM_SYSCHAR = 0x106; + internal const int WM_SYSDEADCHAR = 0x107; + internal const int WM_KEYLAST = 0x108; + + internal const int WM_IME_STARTCOMPOSITION = 0x10D; + internal const int WM_IME_ENDCOMPOSITION = 0x10E; + internal const int WM_IME_COMPOSITION = 0x10F; + internal const int WM_IME_KEYLAST = 0x10F; + + internal const int WM_INITDIALOG = 0x110; + internal const int WM_COMMAND = 0x111; + internal const int WM_SYSCOMMAND = 0x112; + internal const int WM_TIMER = 0x113; + internal const int WM_HSCROLL = 0x114; + internal const int WM_VSCROLL = 0x115; + internal const int WM_INITMENU = 0x116; + internal const int WM_INITMENUPOPUP = 0x117; + internal const int WM_MENUSELECT = 0x11F; + internal const int WM_MENUCHAR = 0x120; + internal const int WM_ENTERIDLE = 0x121; + + internal const int WM_CTLCOLORMSGBOX = 0x132; + internal const int WM_CTLCOLOREDIT = 0x133; + internal const int WM_CTLCOLORLISTBOX = 0x134; + internal const int WM_CTLCOLORBTN = 0x135; + internal const int WM_CTLCOLORDLG = 0x136; + internal const int WM_CTLCOLORSCROLLBAR = 0x137; + internal const int WM_CTLCOLORSTATIC = 0x138; + + internal const int WM_MOUSEFIRST = 0x200; + internal const int WM_MOUSEMOVE = 0x200; + internal const int WM_LBUTTONDOWN = 0x201; + internal const int WM_LBUTTONUP = 0x202; + internal const int WM_LBUTTONDBLCLK = 0x203; + internal const int WM_RBUTTONDOWN = 0x204; + internal const int WM_RBUTTONUP = 0x205; + internal const int WM_RBUTTONDBLCLK = 0x206; + internal const int WM_MBUTTONDOWN = 0x207; + internal const int WM_MBUTTONUP = 0x208; + internal const int WM_MBUTTONDBLCLK = 0x209; + internal const int WM_MOUSELAST = 0x20A; + internal const int WM_MOUSEWHEEL = 0x20A; + + internal const int WM_PARENTNOTIFY = 0x210; + internal const int WM_ENTERMENULOOP = 0x211; + internal const int WM_EXITMENULOOP = 0x212; + internal const int WM_NEXTMENU = 0x213; + internal const int WM_SIZING = 0x214; + internal const int WM_CAPTURECHANGED = 0x215; + internal const int WM_MOVING = 0x216; + internal const int WM_POWERBROADCAST = 0x218; + internal const int WM_DEVICECHANGE = 0x219; + + internal const int WM_MDICREATE = 0x220; + internal const int WM_MDIDESTROY = 0x221; + internal const int WM_MDIACTIVATE = 0x222; + internal const int WM_MDIRESTORE = 0x223; + internal const int WM_MDINEXT = 0x224; + internal const int WM_MDIMAXIMIZE = 0x225; + internal const int WM_MDITILE = 0x226; + internal const int WM_MDICASCADE = 0x227; + internal const int WM_MDIICONARRANGE = 0x228; + internal const int WM_MDIGETACTIVE = 0x229; + internal const int WM_MDISETMENU = 0x230; + internal const int WM_ENTERSIZEMOVE = 0x231; + internal const int WM_EXITSIZEMOVE = 0x232; + internal const int WM_DROPFILES = 0x233; + internal const int WM_MDIREFRESHMENU = 0x234; + + internal const int WM_IME_SETCONTEXT = 0x281; + internal const int WM_IME_NOTIFY = 0x282; + internal const int WM_IME_CONTROL = 0x283; + internal const int WM_IME_COMPOSITIONFULL = 0x284; + internal const int WM_IME_SELECT = 0x285; + internal const int WM_IME_CHAR = 0x286; + internal const int WM_IME_KEYDOWN = 0x290; + internal const int WM_IME_KEYUP = 0x291; + + internal const int WM_MOUSEHOVER = 0x2A1; + internal const int WM_NCMOUSELEAVE = 0x2A2; + internal const int WM_MOUSELEAVE = 0x2A3; + + internal const int WM_CUT = 0x300; + internal const int WM_COPY = 0x301; + internal const int WM_PASTE = 0x302; + internal const int WM_CLEAR = 0x303; + internal const int WM_UNDO = 0x304; + + internal const int WM_RENDERFORMAT = 0x305; + internal const int WM_RENDERALLFORMATS = 0x306; + internal const int WM_DESTROYCLIPBOARD = 0x307; + internal const int WM_DRAWCLIPBOARD = 0x308; + internal const int WM_PAINTCLIPBOARD = 0x309; + internal const int WM_VSCROLLCLIPBOARD = 0x30A; + internal const int WM_SIZECLIPBOARD = 0x30B; + internal const int WM_ASKCBFORMATNAME = 0x30C; + internal const int WM_CHANGECBCHAIN = 0x30D; + internal const int WM_HSCROLLCLIPBOARD = 0x30E; + internal const int WM_QUERYNEWPALETTE = 0x30F; + internal const int WM_PALETTEISCHANGING = 0x310; + internal const int WM_PALETTECHANGED = 0x311; + + internal const int WM_HOTKEY = 0x312; + internal const int WM_PRINT = 0x317; + internal const int WM_PRINTCLIENT = 0x318; + + internal const int WM_HANDHELDFIRST = 0x358; + internal const int WM_HANDHELDLAST = 0x35F; + internal const int WM_PENWINFIRST = 0x380; + internal const int WM_PENWINLAST = 0x38F; + internal const int WM_COALESCE_FIRST = 0x390; + internal const int WM_COALESCE_LAST = 0x39F; + internal const int WM_DDE_FIRST = 0x3E0; + internal const int WM_DDE_INITIATE = 0x3E0; + internal const int WM_DDE_TERMINATE = 0x3E1; + internal const int WM_DDE_ADVISE = 0x3E2; + internal const int WM_DDE_UNADVISE = 0x3E3; + internal const int WM_DDE_ACK = 0x3E4; + internal const int WM_DDE_DATA = 0x3E5; + internal const int WM_DDE_REQUEST = 0x3E6; + internal const int WM_DDE_POKE = 0x3E7; + internal const int WM_DDE_EXECUTE = 0x3E8; + internal const int WM_DDE_LAST = 0x3E8; + + internal const int WM_USER = 0x400; + internal const int WM_APP = 0x8000; + + + internal const int SW_HIDE = 0; + internal const int SW_SHOWNORMAL = 1; + internal const int SW_NORMAL = 1; + internal const int SW_SHOWMINIMIZED = 2; + internal const int SW_SHOWMAXIMIZED = 3; + internal const int SW_MAXIMIZE = 3; + internal const int SW_SHOWNOACTIVATE = 4; + internal const int SW_SHOW = 5; + internal const int SW_MINIMIZE = 6; + internal const int SW_SHOWMINNOACTIVE = 7; + internal const int SW_SHOWNA = 8; + internal const int SW_RESTORE = 9; + + #endregion + + //Used for WM_COPYDATA for string messages + internal struct COPYDATASTRUCT + { + internal IntPtr dwData; + internal int cbData; + [MarshalAs(UnmanagedType.LPStr)] + internal string lpData; + } + + + internal struct WINDOWPLACEMENT + { + internal int length; + internal int flags; + internal int showCmd; + internal System.Drawing.Point ptMinPosition; + internal System.Drawing.Point ptMaxPosition; + internal System.Drawing.Rectangle rcNormalPosition; + } + + internal bool bringAppToFront(int hWnd) + { + WINDOWPLACEMENT param = new WINDOWPLACEMENT(); + if (GetWindowPlacement(hWnd, ref param)) + { + if (param.showCmd != SW_NORMAL) + { + param.length = Marshal.SizeOf(typeof(WINDOWPLACEMENT)); + param.showCmd = SW_NORMAL; + SetWindowPlacement(hWnd, ref param); + } + } + return SetForegroundWindow(hWnd); + } + + internal int sendWindowsStringMessage(int hWnd, int wParam, string msg) + { + int result = 0; + + if (hWnd > 0) + { + byte[] sarr = System.Text.Encoding.Default.GetBytes(msg); + int len = sarr.Length; + COPYDATASTRUCT cds; + cds.dwData = (IntPtr)100; + cds.lpData = msg; + cds.cbData = len + 1; + result = SendMessage(hWnd, WM_COPYDATA, wParam, ref cds); + } + + return result; + } + + internal int sendWindowsMessage(int hWnd, int Msg, int wParam, int lParam) + { + int result = 0; + + if (hWnd > 0) + { + result = SendMessage(hWnd, Msg, wParam, lParam); + } + + return result; + } + + internal int getWindowId(string className, string windowName) + { + return FindWindow(className, windowName); + } + + internal int checkIfProcessRunning(string process) + { + Process[] processes = Process.GetProcessesByName(process); + return processes.Length; + } + + internal void closeProcesses(string process, bool force) + { + Process[] processes = Process.GetProcessesByName(process); + + for (int i = 0; i < processes.Length; i++) + { + processes[i].CloseMainWindow(); + + if (force) + processes[i].Kill(); + else + processes[i].WaitForExit(); + } + } + + internal void startProcess(string processName) + { + System.Diagnostics.Process process = new System.Diagnostics.Process(); + process.StartInfo.UseShellExecute = true; + process.StartInfo.FileName = processName; + process.Start(); + } + } +} \ No newline at end of file diff --git a/ColorControl/nspector/Native/WINAPI/SafeNativeMethods.cs b/ColorControl/nspector/Native/WINAPI/SafeNativeMethods.cs new file mode 100644 index 0000000..0279286 --- /dev/null +++ b/ColorControl/nspector/Native/WINAPI/SafeNativeMethods.cs @@ -0,0 +1,11 @@ +using System.Runtime.InteropServices; + +namespace nspector.Native.WINAPI +{ + static class SafeNativeMethods + { + [DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool DeleteFile(string name); + } +} diff --git a/ColorControl/nspector/Native/WINAPI/ShellLink.cs b/ColorControl/nspector/Native/WINAPI/ShellLink.cs new file mode 100644 index 0000000..0f44f22 --- /dev/null +++ b/ColorControl/nspector/Native/WINAPI/ShellLink.cs @@ -0,0 +1,662 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace nspector.Native.WINAPI +{ + + internal class ShellLink : IDisposable + { + + [ComImport()] + [Guid("0000010C-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IPersist + { + [PreserveSig] + void GetClassID(out Guid pClassID); + } + + [ComImport()] + [Guid("0000010B-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IPersistFile + { + [PreserveSig] + void GetClassID(out Guid pClassID); + void IsDirty(); + void Load( + [MarshalAs(UnmanagedType.LPWStr)] string pszFileName, + uint dwMode); + + void Save( + [MarshalAs(UnmanagedType.LPWStr)] string pszFileName, + [MarshalAs(UnmanagedType.Bool)] bool fRemember); + + void SaveCompleted( + [MarshalAs(UnmanagedType.LPWStr)] string pszFileName); + + void GetCurFile( + [MarshalAs(UnmanagedType.LPWStr)] out string ppszFileName); + } + + [ComImport()] + [Guid("000214EE-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IShellLinkA + { + void GetPath( + [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszFile, + int cchMaxPath, + ref _WIN32_FIND_DATAA pfd, + uint fFlags); + + void GetIDList(out IntPtr ppidl); + + void SetIDList(IntPtr pidl); + + void GetDescription( + [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszFile, + int cchMaxName); + + void SetDescription( + [MarshalAs(UnmanagedType.LPStr)] string pszName); + + void GetWorkingDirectory( + [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszDir, + int cchMaxPath); + + void SetWorkingDirectory( + [MarshalAs(UnmanagedType.LPStr)] string pszDir); + + void GetArguments( + [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszArgs, + int cchMaxPath); + + void SetArguments( + [MarshalAs(UnmanagedType.LPStr)] string pszArgs); + + void GetHotkey(out short pwHotkey); + void SetHotkey(short pwHotkey); + + void GetShowCmd(out uint piShowCmd); + void SetShowCmd(uint piShowCmd); + + void GetIconLocation( + [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszIconPath, + int cchIconPath, + out int piIcon); + + void SetIconLocation( + [MarshalAs(UnmanagedType.LPStr)] string pszIconPath, + int iIcon); + + void SetRelativePath( + [MarshalAs(UnmanagedType.LPStr)] string pszPathRel, + uint dwReserved); + + void Resolve( + IntPtr hWnd, + uint fFlags); + + void SetPath( + [MarshalAs(UnmanagedType.LPStr)] string pszFile); + } + + + [ComImport()] + [Guid("000214F9-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IShellLinkW + { + void GetPath( + [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, + int cchMaxPath, + ref _WIN32_FIND_DATAW pfd, + uint fFlags); + + void GetIDList(out IntPtr ppidl); + void SetIDList(IntPtr pidl); + void GetDescription( + [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, + int cchMaxName); + + void SetDescription( + [MarshalAs(UnmanagedType.LPWStr)] string pszName); + + void GetWorkingDirectory( + [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, + int cchMaxPath); + + void SetWorkingDirectory( + [MarshalAs(UnmanagedType.LPWStr)] string pszDir); + + void GetArguments( + [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs, + int cchMaxPath); + + void SetArguments( + [MarshalAs(UnmanagedType.LPWStr)] string pszArgs); + + void GetHotkey(out short pwHotkey); + void SetHotkey(short pwHotkey); + + void GetShowCmd(out uint piShowCmd); + void SetShowCmd(uint piShowCmd); + + void GetIconLocation( + [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszIconPath, + int cchIconPath, + out int piIcon); + + void SetIconLocation( + [MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, + int iIcon); + + void SetRelativePath( + [MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, + uint dwReserved); + + void Resolve( + IntPtr hWnd, + uint fFlags); + + void SetPath( + [MarshalAs(UnmanagedType.LPWStr)] string pszFile); + } + + [Guid("00021401-0000-0000-C000-000000000046")] + [ClassInterface(ClassInterfaceType.None)] + [ComImport()] + private class CShellLink { } + + private enum EShellLinkGP : uint + { + SLGP_SHORTPATH = 1, + SLGP_UNCPRIORITY = 2 + } + + [Flags] + private enum EShowWindowFlags : uint + { + SW_HIDE = 0, + SW_SHOWNORMAL = 1, + SW_NORMAL = 1, + SW_SHOWMINIMIZED = 2, + SW_SHOWMAXIMIZED = 3, + SW_MAXIMIZE = 3, + SW_SHOWNOACTIVATE = 4, + SW_SHOW = 5, + SW_MINIMIZE = 6, + SW_SHOWMINNOACTIVE = 7, + SW_SHOWNA = 8, + SW_RESTORE = 9, + SW_SHOWDEFAULT = 10, + SW_MAX = 10 + } + + + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 0, CharSet = CharSet.Unicode)] + private struct _WIN32_FIND_DATAW + { + internal uint dwFileAttributes; + internal _FILETIME ftCreationTime; + internal _FILETIME ftLastAccessTime; + internal _FILETIME ftLastWriteTime; + internal uint nFileSizeHigh; + internal uint nFileSizeLow; + internal uint dwReserved0; + internal uint dwReserved1; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] // MAX_PATH + internal string cFileName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)] + internal string cAlternateFileName; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 0, CharSet = CharSet.Ansi)] + private struct _WIN32_FIND_DATAA + { + internal uint dwFileAttributes; + internal _FILETIME ftCreationTime; + internal _FILETIME ftLastAccessTime; + internal _FILETIME ftLastWriteTime; + internal uint nFileSizeHigh; + internal uint nFileSizeLow; + internal uint dwReserved0; + internal uint dwReserved1; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] // MAX_PATH + internal string cFileName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)] + internal string cAlternateFileName; + } + + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 0)] + private struct _FILETIME + { + internal uint dwLowDateTime; + internal uint dwHighDateTime; + } + + private class NativeMethods + { + [DllImport("Shell32", CharSet = CharSet.Auto)] + internal extern static int ExtractIconEx([MarshalAs(UnmanagedType.LPTStr)] + string lpszFile, + int nIconIndex, + IntPtr[] phIconLarge, + IntPtr[] phIconSmall, + int nIcons); + + [DllImport("user32")] + internal static extern int DestroyIcon(IntPtr hIcon); + } + + [Flags] + internal enum EShellLinkResolveFlags : uint + { + SLR_ANY_MATCH = 0x2, + SLR_INVOKE_MSI = 0x80, + SLR_NOLINKINFO = 0x40, + SLR_NO_UI = 0x1, + SLR_NO_UI_WITH_MSG_PUMP = 0x101, + SLR_NOUPDATE = 0x8, + SLR_NOSEARCH = 0x10, + SLR_NOTRACK = 0x20, + SLR_UPDATE = 0x4 + } + + internal enum LinkDisplayMode : uint + { + edmNormal = EShowWindowFlags.SW_NORMAL, + edmMinimized = EShowWindowFlags.SW_SHOWMINNOACTIVE, + edmMaximized = EShowWindowFlags.SW_MAXIMIZE + } + + private IShellLinkW linkW; + private IShellLinkA linkA; + private string shortcutFile = ""; + + internal ShellLink() + { + if (System.Environment.OSVersion.Platform == PlatformID.Win32NT) + { + linkW = (IShellLinkW)new CShellLink(); + } + else + { + linkA = (IShellLinkA)new CShellLink(); + } + } + + internal ShellLink(string linkFile) + : this() + { + Open(linkFile); + } + + ~ShellLink() + { + Dispose(); + } + + public void Dispose() + { + if (linkW != null) + { + Marshal.ReleaseComObject(linkW); + linkW = null; + } + if (linkA != null) + { + Marshal.ReleaseComObject(linkA); + linkA = null; + } + } + + internal string ShortCutFile + { + get + { + return this.shortcutFile; + } + set + { + this.shortcutFile = value; + } + } + + internal string IconPath + { + get + { + StringBuilder iconPath = new StringBuilder(260, 260); + int iconIndex = 0; + if (linkA == null) + { + linkW.GetIconLocation(iconPath, iconPath.Capacity, out + iconIndex); + } + else + { + linkA.GetIconLocation(iconPath, iconPath.Capacity, out + iconIndex); + } + return iconPath.ToString(); + } + set + { + StringBuilder iconPath = new StringBuilder(260, 260); + int iconIndex = 0; + if (linkA == null) + { + linkW.GetIconLocation(iconPath, iconPath.Capacity, out + iconIndex); + } + else + { + linkA.GetIconLocation(iconPath, iconPath.Capacity, out + iconIndex); + } + if (linkA == null) + { + linkW.SetIconLocation(value, iconIndex); + } + else + { + linkA.SetIconLocation(value, iconIndex); + } + } + } + + internal int IconIndex + { + get + { + StringBuilder iconPath = new StringBuilder(260, 260); + int iconIndex = 0; + if (linkA == null) + { + linkW.GetIconLocation(iconPath, iconPath.Capacity, out + iconIndex); + } + else + { + linkA.GetIconLocation(iconPath, iconPath.Capacity, out + iconIndex); + } + return iconIndex; + } + set + { + StringBuilder iconPath = new StringBuilder(260, 260); + int iconIndex = 0; + if (linkA == null) + { + linkW.GetIconLocation(iconPath, iconPath.Capacity, out + iconIndex); + } + else + { + linkA.GetIconLocation(iconPath, iconPath.Capacity, out + iconIndex); + } + if (linkA == null) + { + linkW.SetIconLocation(iconPath.ToString(), value); + } + else + { + linkA.SetIconLocation(iconPath.ToString(), value); + } + } + } + + internal string Target + { + get + { + StringBuilder target = new StringBuilder(260, 260); + if (linkA == null) + { + _WIN32_FIND_DATAW fd = new _WIN32_FIND_DATAW(); + linkW.GetPath(target, target.Capacity, ref fd, + (uint)EShellLinkGP.SLGP_UNCPRIORITY); + } + else + { + _WIN32_FIND_DATAA fd = new _WIN32_FIND_DATAA(); + linkA.GetPath(target, target.Capacity, ref fd, + (uint)EShellLinkGP.SLGP_UNCPRIORITY); + } + return target.ToString(); + } + set + { + if (linkA == null) + { + linkW.SetPath(value); + } + else + { + linkA.SetPath(value); + } + } + } + + internal string WorkingDirectory + { + get + { + StringBuilder path = new StringBuilder(260, 260); + if (linkA == null) + { + linkW.GetWorkingDirectory(path, path.Capacity); + } + else + { + linkA.GetWorkingDirectory(path, path.Capacity); + } + return path.ToString(); + } + set + { + if (linkA == null) + { + linkW.SetWorkingDirectory(value); + } + else + { + linkA.SetWorkingDirectory(value); + } + } + } + + internal string Description + { + get + { + StringBuilder description = new StringBuilder(1024, 1024); + if (linkA == null) + { + linkW.GetDescription(description, description.Capacity); + } + else + { + linkA.GetDescription(description, description.Capacity); + } + return description.ToString(); + } + set + { + if (linkA == null) + { + linkW.SetDescription(value); + } + else + { + linkA.SetDescription(value); + } + } + } + + internal string Arguments + { + get + { + StringBuilder arguments = new StringBuilder(260, 260); + if (linkA == null) + { + linkW.GetArguments(arguments, arguments.Capacity); + } + else + { + linkA.GetArguments(arguments, arguments.Capacity); + } + return arguments.ToString(); + } + set + { + if (linkA == null) + { + linkW.SetArguments(value); + } + else + { + linkA.SetArguments(value); + } + } + } + + internal LinkDisplayMode DisplayMode + { + get + { + uint cmd = 0; + if (linkA == null) + { + linkW.GetShowCmd(out cmd); + } + else + { + linkA.GetShowCmd(out cmd); + } + return (LinkDisplayMode)cmd; + } + set + { + if (linkA == null) + { + linkW.SetShowCmd((uint)value); + } + else + { + linkA.SetShowCmd((uint)value); + } + } + } + + internal Keys HotKey + { + get + { + short key = 0; + if (linkA == null) + { + linkW.GetHotkey(out key); + } + else + { + linkA.GetHotkey(out key); + } + return (Keys)key; + } + set + { + if (linkA == null) + { + linkW.SetHotkey((short)value); + } + else + { + linkA.SetHotkey((short)value); + } + } + } + + internal void Save() + { + Save(shortcutFile); + } + + internal void Save(string linkFile + ) + { + if (linkA == null) + { + ((IPersistFile)linkW).Save(linkFile, true); + shortcutFile = linkFile; + } + else + { + ((IPersistFile)linkA).Save(linkFile, true); + shortcutFile = linkFile; + } + } + + internal void Open(string linkFile) + { + Open(linkFile, + IntPtr.Zero, + (EShellLinkResolveFlags.SLR_ANY_MATCH | + EShellLinkResolveFlags.SLR_NO_UI), 1); + } + + internal void Open( + string linkFile, + IntPtr hWnd, + EShellLinkResolveFlags resolveFlags + ) + { + Open(linkFile, + hWnd, + resolveFlags, + 1); + } + + internal void Open( + string linkFile, + IntPtr hWnd, + EShellLinkResolveFlags resolveFlags, + ushort timeOut + ) + { + uint flags; + + if ((resolveFlags & EShellLinkResolveFlags.SLR_NO_UI) + == EShellLinkResolveFlags.SLR_NO_UI) + { + flags = (uint)((int)resolveFlags | (timeOut << 16)); + } + else + { + flags = (uint)resolveFlags; + } + + if (linkA == null) + { + ((IPersistFile)linkW).Load(linkFile, 0); //STGM_DIRECT) + linkW.Resolve(hWnd, flags); + this.shortcutFile = linkFile; + } + else + { + ((IPersistFile)linkA).Load(linkFile, 0); //STGM_DIRECT) + linkA.Resolve(hWnd, flags); + this.shortcutFile = linkFile; + } + } + } + +} + diff --git a/ColorControl/nspector/Native/WINAPI/TaskBarList3.cs b/ColorControl/nspector/Native/WINAPI/TaskBarList3.cs new file mode 100644 index 0000000..43e33f2 --- /dev/null +++ b/ColorControl/nspector/Native/WINAPI/TaskBarList3.cs @@ -0,0 +1,161 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace nspector.Native.WINAPI +{ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct THUMBBUTTON + { + Int32 dwMask; + uint iId; + uint iBitmap; + IntPtr hIcon; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] + string szTip; + Int32 dwFlags; + } + + [Flags] + internal enum THBF + { + THBF_ENABLED = 0x0000, + THBF_DISABLED = 0x0001, + THBF_DISMISSONCLICK = 0x0002, + THBF_NOBACKGROUND = 0x0004, + THBF_HIDDEN = 0x0008 + } + + [Flags] + internal enum THB + { + THB_BITMAP = 0x0001, + THB_ICON = 0x0002, + THB_TOOLTIP = 0x0004, + THB_FLAGS = 0x0008, + THBN_CLICKED = 0x1800 + } + + internal enum TBPFLAG + { + TBPF_NOPROGRESS = 0, + TBPF_INDETERMINATE = 0x1, + TBPF_NORMAL = 0x2, + TBPF_ERROR = 0x4, + TBPF_PAUSED = 0x8 + } + + internal enum TBATFLAG + { + TBATF_USEMDITHUMBNAIL = 0x1, + TBATF_USEMDILIVEPREVIEW = 0x2 + } + + [ComImport, + Guid("EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface ITaskbarList3 + { + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void HrInit(); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void AddTab([In] IntPtr hwnd); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void DeleteTab([In] IntPtr hwnd); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void ActivateTab([In] IntPtr hwnd); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void SetActiveAlt([In] IntPtr hwnd); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void MarkFullscreenWindow([In] IntPtr hwnd, + [In, MarshalAs(UnmanagedType.Bool)] bool fFullscreen); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void SetProgressValue([In] IntPtr hwnd, + [In] ulong ullCompleted, + [In] ulong ullTotal); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void SetProgressState([In] IntPtr hwnd, + [In] TBPFLAG tbpFlags); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void RegisterTab([In] IntPtr hwndTab, + [In] IntPtr hwndMDI); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void UnregisterTab([In] IntPtr hwndTab); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void SetTabOrder([In] IntPtr hwndTab, + [In] IntPtr hwndInsertBefore); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void SetTabActive([In] IntPtr hwndTab, + [In] IntPtr hwndMDI, + [In] TBATFLAG tbatFlags); + + //preliminary + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void ThumbBarAddButtons([In] IntPtr hwnd, + [In] uint cButtons, + [In] IntPtr pButton); + ///* [size_is][in] */ __RPC__in_ecount_full(cButtons) LPTHUMBBUTTON pButton); + + //preliminary + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void ThumbBarUpdateButtons([In] IntPtr hwnd, + [In] uint cButtons, + [In] IntPtr pButton); + ///* [size_is][in] */ __RPC__in_ecount_full(cButtons) LPTHUMBBUTTON pButton); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void ThumbBarSetImageList([In] IntPtr hwnd, + [In] IntPtr himl); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void SetOverlayIcon([In] IntPtr hwnd, + [In] IntPtr hIcon, + [In, MarshalAs(UnmanagedType.LPWStr)] string pszDescription); + + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void SetThumbnailTooltip([In] IntPtr hwnd, + [In, MarshalAs(UnmanagedType.LPWStr)] string pszTip); + + //preliminary + [MethodImpl(MethodImplOptions.InternalCall, + MethodCodeType = MethodCodeType.Runtime)] + void SetThumbnailClip([In] IntPtr hwnd, + [In] IntPtr prcClip); + + } + + + [ComImport] + [Guid("56FDF344-FD6D-11d0-958A-006097C9A090")] + internal class TaskbarList { } + +} diff --git a/ColorControl/nspector/Properties/Resources.Designer.cs b/ColorControl/nspector/Properties/Resources.Designer.cs new file mode 100644 index 0000000..b2452b3 --- /dev/null +++ b/ColorControl/nspector/Properties/Resources.Designer.cs @@ -0,0 +1,254 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace nspector.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("nspector.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap apply { + get { + object obj = ResourceManager.GetObject("apply", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die <?xml version="1.0" encoding="utf-8"?> + ///<CustomSettingNames> + /// <ShowCustomizedSettingNamesOnly>false</ShowCustomizedSettingNamesOnly> + /// <Settings> + /// <CustomSetting> + /// <UserfriendlyName>NVLINK SLI Mode</UserfriendlyName> + /// <HexSettingID>0x00A06948</HexSettingID> + /// <GroupName>6 - SLI</GroupName> + /// <MinRequiredDriverVersion>410.00</MinRequiredDriverVersion> + /// </CustomSetting> + /// <CustomSetting> + /// <UserfriendlyName>Texture filtering - Quality substitution</UserfriendlyName> + /// [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt. + /// + public static string CustomSettingNames { + get { + return ResourceManager.GetString("CustomSettingNames", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap export1 { + get { + object obj = ResourceManager.GetObject("export1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap filter_user { + get { + object obj = ResourceManager.GetObject("filter_user", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap find_set2 { + get { + object obj = ResourceManager.GetObject("find_set2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap home_sm { + get { + object obj = ResourceManager.GetObject("home_sm", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// + public static System.Drawing.Icon Icon1 { + get { + object obj = ResourceManager.GetObject("Icon1", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap ieframe_1_18212 { + get { + object obj = ResourceManager.GetObject("ieframe_1_18212", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap ieframe_1_31073_002 { + get { + object obj = ResourceManager.GetObject("ieframe_1_31073_002", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap import1 { + get { + object obj = ResourceManager.GetObject("import1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap n1_016 { + get { + object obj = ResourceManager.GetObject("n1-016", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap nv_btn { + get { + object obj = ResourceManager.GetObject("nv_btn", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap PortableDeviceStatus_3_16_011 { + get { + object obj = ResourceManager.GetObject("PortableDeviceStatus_3_16_011", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// + public static System.Drawing.Icon shield16 { + get { + object obj = ResourceManager.GetObject("shield16", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap text_binary { + get { + object obj = ResourceManager.GetObject("text_binary", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap transparent16 { + get { + object obj = ResourceManager.GetObject("transparent16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap window_application_add { + get { + object obj = ResourceManager.GetObject("window_application_add", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap window_application_delete { + get { + object obj = ResourceManager.GetObject("window_application_delete", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/ColorControl/nspector/Properties/Resources.resx b/ColorControl/nspector/Properties/Resources.resx new file mode 100644 index 0000000..8ddbb12 --- /dev/null +++ b/ColorControl/nspector/Properties/Resources.resx @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Images\transparent16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\filter_user.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\apply.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\export1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\ieframe_1_18212.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\window_application_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\home_sm.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\window_application_add.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAHJyciV6enqzf39/7H9/f+96enqucnJyIgAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAHV1dUp+fn7nz8/P+NfX1/zX19f7yMjI+H5+fud1dXVKAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAHR0dEp/f3/p19fX+Yewwv84hq//tWY1/7yWZf/Pz8/4f39/6nR0 + dEoAAAAAAAAAAAAAAAAAAAAAAAAAAHFxcRh+fn7e19fX+VWwzP9Nv9v/Pcrq/9l/Hv/Pdjj/t3RA/9DQ + 0Ph+fn7bcXFxGAAAAAAAAAAAAAAAAAAAAAB6enq72NjY+E2qx/9Q1O3/V+L2/z/b8f/Zfxf/9aQq/+qT + LP/BfkH/1tbW93l5eaYAAAAAAAAAAAAAAABycnIikJCQ19fX1/o2sdv/U933/03k9/8/2vH/2HsT//eI + EP/1nSH/0Hcu/9PBqvqPj4/OcXFxHAAAAAAAAAAAdnZ2bb6+vvFAo9L/PMfp/0vi9/9G6ff/P9rx/9h6 + Ef/ufgf/940Y//CZHv/NhSf/urq653Z2dnIAAAAAAAAAAHp6ep/U1NT4K4+k/zfH5f8+2O//Ptjv/z3Z + 8P/WeRH/13UK/9h5EP/agB//uXQ8/9DQ0Pd6enqlAAAAAAAAAAB9fX3S3t7e/c19Dv/Sgh//x3of/8Ny + Iv/GciT/Ir/l/ya85f8pvOP/Jrbd/zacyf/X19f6fX190gAAAAAAAAAAfn5+3N3d3f7ahhL/3Jcm/92R + If/Ndyz/wW0o/yLD5v8ky+z/KM/v/yrW8v8zocj/19fX/H5+fuMAAAAAAAAAAH5+ft7c3Nz+2oYS/+u2 + Wv/orkr/3JAu/8V2LP8qvuT/Vev+/2To/f8f5/3/NZrE/9fX1/x/f3/jAAAAAAAAAAB+fn7d3d3d/uaS + Hf/msVr/7smC/+y1WP/Ohif/M7vi/3To+v806f7/KcLe/ziayP/X19f8f39/4wAAAAAAAAAAfHx80s3N + zfrY2Nj+25Aj/9CHKP/tyIL/048r/x6x3P8f4/n/L7LR/0moxv/Pz8/6zc3N+nx8fNwAAAAAAAAAAHNz + c0yIiIjJioqK6NDQ0PnR0dH9x5FF/8+RNf80osH/RLHP/8DAwPnMzMz3ioqK6IiIiL1zc3NMAAAAAAAA + AAAAAAAAAAAAAHJyciCXl5eVmJiY6MrKyvrY2Nj919fX/MnJyfiUlJTml5eXmHJyciAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAHJyciGIiIi/iYmJ6ImJieqHh4e8cnJyEwAAAAAAAAAAAAAAAAAA + AAAAAAAA+B8AAPAPAADgBwAAwAMAAMADAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIAB + AADgBwAA+B8AAA== + + + + ..\Images\PortableDeviceStatus_3_16-011.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\text_binary.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\nv_btn.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\import1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\ieframe_1_31073-002.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\find_set2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\n1-016.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + AAABAAIAEBAQAAAABAAoAQAAJgAAACAgEAAAAAQA6AIAAE4BAAAoAAAAEAAAACAAAAABAAQAAAAAAMAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/ + AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAH//j/j/jwAAf/+P+P+PAAB4iIiIiIgAAH93h3h3 + jwAAf3eHeHePAAB4iIiIiIgAAH93h3h3jwAAf3eHeHePAAB4iIiIiIgAAH93h3h3jwAAf3eHeHePAAB4 + iIiIgAAAAH//j/j39wAAf/+P+PdwAAB3d3d3dwAAwAEAAMABAADAAQAAwAEAAMABAADAAQAAwAEAAMAB + AADAAQAAwAEAAMABAADAAQAAwAEAAMADAADABwAAwA8AACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD/ + /wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAAAAAAAAAAAAAHiIiIiIiIiIiIiIiIAAAAB/////j///j/ + //j/+AAAAAf////4///4///4//gAAAAH////+P//+P//+P/4AAAAB/////j///j///j/+AAAAAf////4 + ///4///4//gAAAAHiIiIiIiIiIiIiIiIAAAAB/94eHh4eHh4eHj/+AAAAAf/h4eIh4eIh4eI//gAAAAH + /3h4eHh4eHh4eP/4AAAAB/+Hh4iHh4iHh4j/+AAAAAf/eHh4eHh4eHh4//gAAAAHiIiIiIiIiIiIiIiI + AAAAB/94eHh4eHh4eHj/+AAAAAf/h4eIh4eIh4eI//gAAAAH/3h4eHh4eHh4eP/4AAAAB/+Hh4iHh4iH + h4j/+AAAAAf/eHh4eHh4eHh4//gAAAAHiIiIiIiIiIiIiIiIAAAAB/94eHh4eHh4eHj/+AAAAAf/h4eI + h4eIh4eI//gAAAAH/3h4eHh4eHh4eP/4AAAAB/+Hh4iHh4iHh4j/+AAAAAf/eHh4eHh4eHh4//gAAAAH + iIiIiIiIiIiIcAAAAAAAB/////j///j//3/4cAAAAAf////4///4//9/hwAAAAAH////+P//+P//eHAA + AAAAB/////j///j//3cAAAAAAAf////4///4//9wAAAAAAAHd3d3d3d3d3d3cAAAAADgAAAH4AAAB+AA + AAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AA + AAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAAfgAAAH4AAAB+AAAA/gAAAf4AAAP+AAAH/gAAD/4AAB/w== + + + + ..\CustomSettingNames.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + \ No newline at end of file diff --git a/ColorControl/nspector/Reference.xml b/ColorControl/nspector/Reference.xml new file mode 100644 index 0000000..2ad36da --- /dev/null +++ b/ColorControl/nspector/Reference.xml @@ -0,0 +1,4975 @@ + + + + + Time + 0x70AD05C8 + 7 - Stereo + 0 + + + RunTimeName + 0x701A8BE4 + 7 - Stereo + 0 + + + EnableConsumerStereoSupport + 0x70CB9168 + 7 - Stereo + 0 + + + StereoViewer + 0x704915A1 + 7 - Stereo + 0 + + + StereoViewerType + 0x708F9EF7 + 7 - Stereo + 0 + + + ShowAllViewerTypes + 0x708E5CB4 + 7 - Stereo + 0 + + + StereoAdjustEnable + 0x70538AB1 + 7 - Stereo + 0 + + + StereoDisableTnL + 0x70633BD9 + 7 - Stereo + 0 + + + StereoTransformationType + 0x70C27E3C + 7 - Stereo + 0 + + + StereoSeparation + 0x70933C00 + 7 - Stereo + 0 + + + StereoSeparationStep + 0x7082555B + 7 - Stereo + 0 + + + StereoConvergence + 0x708DB8C5 + 7 - Stereo + 0 + + + StereoVRConvergenceBias + 0x708DB8C6 + 7 - Stereo + 0 + + + StereoConvergenceMultiplier + 0x70EFBB5B + 7 - Stereo + 0 + + + StereoVRRefreshRateOverride + 0x708DB8C8 + 7 - Stereo + 0 + + + StereoVRVsync + 0x708DB8C9 + 7 - Stereo + 0 + + + RHW2DDetectionMin + 0x7029432B + 7 - Stereo + 0 + + + RHWGreaterAtScreen + 0x702C861A + 7 - Stereo + 0 + + + RHWEqualAtScreen + 0x70AB2E09 + 7 - Stereo + 0 + + + RHWLessAtScreen + 0x70381472 + 7 - Stereo + 0 + + + AutoConvergence + 0x702A0AB2 + 7 - Stereo + 0 + + + AutoConvergenceAdjustPace + 0x70BF3C6B + 7 - Stereo + 0 + + + StereoToggle + 0x70D76B8B + 7 - Stereo + 0 + + + SaveStereoImage + 0x70121853 + 7 - Stereo + 0 + + + StereoVerticalAdjustMore + 0x7087FE61 + 7 - Stereo + 0 + + + StereoVerticalAdjustLess + 0x703ACFC6 + 7 - Stereo + 0 + + + StereoHorizontalAdjustMore + 0x70062F07 + 7 - Stereo + 0 + + + StereoHorizontalAdjustLess + 0x70871A39 + 7 - Stereo + 0 + + + StereoSeparationAdjustMore + 0x70AB8D32 + 7 - Stereo + 0 + + + StereoSeparationAdjustLess + 0x705D1E02 + 7 - Stereo + 0 + + + StereoConvergenceAdjustMore + 0x701ED576 + 7 - Stereo + 0 + + + StereoConvergenceAdjustLess + 0x70D4ADD7 + 7 - Stereo + 0 + + + StereoToggleMode + 0x70D76B8C + 7 - Stereo + 0 + + + StereoSuggestSettings + 0x706315AF + 7 - Stereo + 0 + + + StereoUnsuggestSettings + 0x7017861C + 7 - Stereo + 0 + + + WriteConfig + 0x700498B3 + 7 - Stereo + 0 + + + DeleteConfig + 0x70C73BA2 + 7 - Stereo + 0 + + + ToggleLaserSight + 0x70B7BD1F + 7 - Stereo + 0 + + + LaserAdjustXPlus + 0x70D8BAE6 + 7 - Stereo + 0 + + + LaserAdjustXMinus + 0x7048B7DC + 7 - Stereo + 0 + + + LaserAdjustYPlus + 0x7024EDA4 + 7 - Stereo + 0 + + + LaserAdjustYMinus + 0x70FB9E1E + 7 - Stereo + 0 + + + ToggleAutoConvergence + 0x70085DE3 + 7 - Stereo + 0 + + + ToggleAutoConvergenceRestore + 0x703BC51E + 7 - Stereo + 0 + + + RHWAtScreenMore + 0x7066A22E + 7 - Stereo + 0 + + + RHWAtScreenLess + 0x709139AD + 7 - Stereo + 0 + + + RHWLessAtScreenMore + 0x704E4BCA + 7 - Stereo + 0 + + + RHWLessAtScreenLess + 0x70B378A1 + 7 - Stereo + 0 + + + GammaAdjustMore + 0x703F4521 + 7 - Stereo + 0 + + + GammaAdjustLess + 0x70E8420C + 7 - Stereo + 0 + + + GlassesDelayPlus + 0x701FC5B4 + 7 - Stereo + 0 + + + GlassesDelayMinus + 0x70B8A743 + 7 - Stereo + 0 + + + FavorSZ + 0x705FAED7 + 7 - Stereo + 0 + + + LaserSight + 0x7058B6E1 + 7 - Stereo + 0 + + + LaserSightFile + 0x707AC50D + 7 - Stereo + 0 + + + LaserSightEnabled + 0x7054837A + 7 - Stereo + 0 + + + LaserSightIndex + 0x70DA83C6 + 7 - Stereo + 0 + + + LaserSightProperty + 0x7032243A + 7 - Stereo + 0 + + + StereoPointer + 0x70364596 + 7 - Stereo + 0 + + + GameSpecific0 + 0x702244B7 + 7 - Stereo + 0 + + + StereoDefaultOn + 0x70AB30A7 + 7 - Stereo + 0 + + + FrustumAdjustMode + 0x70A1411A + 7 - Stereo + 0 + + + MonitorSize + 0x7086EBE9 + 7 - Stereo + 0 + + + MaxMonitorSize + 0x7032022C + 7 - Stereo + 0 + + + MaxVertexCount + 0x709E4A94 + 7 - Stereo + 0 + + + PartialClearMode + 0x709794CC + 7 - Stereo + 0 + + + LaserXAdjust + 0x7057E831 + 7 - Stereo + 0 + + + LaserYAdjust + 0x70225308 + 7 - Stereo + 0 + + + LaserZAdjust + 0x7014FCA2 + 7 - Stereo + 0 + + + StereoRefreshDefaultOn + 0x702BA385 + 7 - Stereo + 0 + + + MixedTnL + 0x70BD11E0 + 7 - Stereo + 0 + + + StereoGamma + 0x70C8B5D1 + 7 - Stereo + 0 + + + LineCodeColor + 0x70DC4A12 + 7 - Stereo + 0 + + + LeftAnaglyphFilter + 0x70D51CD1 + 7 - Stereo + 0 + + + RightAnaglyphFilter + 0x70F4A930 + 7 - Stereo + 0 + + + InterleavePattern0 + 0x70B1C8CC + 7 - Stereo + 0 + + + InterleavePattern1 + 0x7091A772 + 7 - Stereo + 0 + + + StereoForceVSync + 0x70AAE185 + 7 - Stereo + 0 + + + StereoColorKey + 0x70E5773B + 7 - Stereo + 0 + + + ZDirection + 0x70B17872 + 7 - Stereo + 0 + + + StereoCompatibility + 0x70A2000E + 7 - Stereo + 0 + + + LeftColorFilter0 + 0x70AC6888 + 7 - Stereo + 0 + + + LeftColorFilter1 + 0x7090B6CA + 7 - Stereo + 0 + + + RightColorFilter0 + 0x70B9A2F7 + 7 - Stereo + 0 + + + RightColorFilter1 + 0x70ACA0CC + 7 - Stereo + 0 + + + SharpVPI + 0x706E0041 + 7 - Stereo + 0 + + + StereoMode + 0x701BAA09 + 7 - Stereo + 0 + + + Watchdog + 0x700A5654 + 7 - Stereo + 0 + + + StereoOSDEnable + 0x70F455AA + 7 - Stereo + 0 + + + StereoOrthoEnable + 0x703564F6 + 7 - Stereo + 0 + + + StereoTextureEnable + 0x70EDB381 + 7 - Stereo + 0 + + + StereoNotSupported + 0x709AA171 + 7 - Stereo + 0 + + + ModesetWarning + 0x70969BB0 + 7 - Stereo + 0 + + + StereoFirstTime + 0x70AF6400 + 7 - Stereo + 0 + + + StereoRefreshRate + 0x70DED3C0 + 7 - Stereo + 0 + + + GameConfigs + 0x704A905A + 7 - Stereo + 0 + + + CompareEyes + 0x70729E58 + 7 - Stereo + 0 + + + CompareFrom + 0x70EFB726 + 7 - Stereo + 0 + + + StereoImageType + 0x7097906C + 7 - Stereo + 0 + + + SnapShotQuality + 0x7004E7A6 + 7 - Stereo + 0 + + + NoLockSubstitute + 0x7005AD16 + 7 - Stereo + 0 + + + PushbufSubstituteSize + 0x7054FBF8 + 7 - Stereo + 0 + + + DiscardHotkeys + 0x70175566 + 7 - Stereo + 0 + + + StereoLCDPatternType + 0x707CFB97 + 7 - Stereo + 0 + + + GlassesSwitchDelay + 0x70057BB6 + 7 - Stereo + 0 + + + StartZBit + 0x7044D7A6 + 7 - Stereo + 0 + + + DisableOnOutOfMemory + 0x70C71508 + 7 - Stereo + 0 + + + StereoWindowedEnable + 0x709B3484 + 7 - Stereo + 0 + + + AllowNonExclusiveStereo + 0x702C7709 + 7 - Stereo + 0 + + + Rhwinf + 0x706E1913 + 7 - Stereo + 0 + + + Rhwscr + 0x70A4995C + 7 - Stereo + 0 + + + Zinf + 0x70FC13AD + 7 - Stereo + 0 + + + Zscr + 0x707F0E69 + 7 - Stereo + 0 + + + InGameLaserSight + 0x7064F0C2 + 7 - Stereo + 0 + + + CutoffNearDepthLess + 0x70D1BDB5 + 7 - Stereo + 0 + + + CutoffNearDepthMore + 0x7020C991 + 7 - Stereo + 0 + + + CutoffFarDepthLess + 0x704C9A46 + 7 - Stereo + 0 + + + CutoffFarDepthMore + 0x70FBC04D + 7 - Stereo + 0 + + + CutoffStepLess + 0x704B45C7 + 7 - Stereo + 0 + + + CutoffStepMore + 0x700F2971 + 7 - Stereo + 0 + + + StereoCutoffDepthNear + 0x7050E011 + 7 - Stereo + 0 + + + StereoCutoffDepthFar + 0x70ADD220 + 7 - Stereo + 0 + + + StereoCutoff + 0x709A1DDF + 7 - Stereo + 0 + + + EnableCE + 0x702B8C95 + 7 - Stereo + 0 + + + MediaPlayer + 0x70A8FC7F + 7 - Stereo + 0 + + + StereoDX9 + 0x70D10D2B + 7 - Stereo + 0 + + + StereoMsgVerticalOffset + 0x70160EBF + 7 - Stereo + 0 + + + LaserSightTrigger + 0x70031B88 + 7 - Stereo + 0 + + + StereoLaserSightMaxCount + 0x70BC864D + 7 - Stereo + 0 + + + StereoLaserSightCount + 0x70077042 + 7 - Stereo + 0 + + + StereoEasyZCheck + 0x70B6D6ED + 7 - Stereo + 0 + + + StereoStrictLSCheck + 0x709BC378 + 7 - Stereo + 0 + + + StereoDisableAsync + 0x70DE5533 + 7 - Stereo + 0 + + + EnablePartialStereoBlit + 0x7096ECED + 7 - Stereo + 0 + + + StereoMemoEnabled + 0x707F4B45 + 7 - Stereo + 0 + + + StereoNoDepthOverride + 0x709DEA62 + 7 - Stereo + 0 + + + StereoFlagsDX10 + 0x702442FC + 7 - Stereo + 0 + + + StereoUseMatrix + 0x70E34A78 + 7 - Stereo + 0 + + + StereoShaderMatrixCheck + 0x7044F8FB + 7 - Stereo + 0 + + + StereoLogShaders + 0x7052BDD0 + 7 - Stereo + 0 + + + StereoEpsilon + 0x70E5A749 + 7 - Stereo + 0 + + + DelayedStereoDesktop + 0x7042EEF1 + 7 - Stereo + 0 + + + DX10VSCBNumber + 0x70F8E408 + 7 - Stereo + 0 + + + DX10DSCBNumber + 0x70092D4A + 7 - Stereo + 0 + + + InGameLaserSightDX9States + 0x706139AD + 7 - Stereo + 0 + + + StereoMiscFlags + 0x70CCB5F0 + 7 - Stereo + 0 + + + StereoHiddenProfile + 0x70E46F20 + 7 - Stereo + 0 + + + StereoLinkDll + 0x70E46F2A + 7 - Stereo + 0 + + + EnableStereoCursor + 0x70E46F2B + 7 - Stereo + 0 + + + CreateStereoDTAfterPresentNum + 0x70A7FC7F + 7 - Stereo + 0 + + + Date_Rel + 0x705FAFEC + 7 - Stereo + 0 + + + Game + 0x70C8D48E + 7 - Stereo + 0 + + + Style + 0x709CC5E0 + 7 - Stereo + 0 + + + Publisher + 0x706C7030 + 7 - Stereo + 0 + + + Developer + 0x703C4026 + 7 - Stereo + 0 + + + API + 0x70B5603F + 7 - Stereo + 0 + + + Value + 0x7049C7EC + 7 - Stereo + 0 + + + Compat + 0x7051E5F5 + 7 - Stereo + 0 + + + PF_Issues + 0x704CDE5A + 7 - Stereo + 0 + + + Comments + 0x704D456E + 7 - Stereo + 0 + + + Developer_Issues + 0x704F5928 + 7 - Stereo + 0 + + + P1SH0 + 0x70998683 + 7 - Stereo + 0 + + + V1SH0 + 0x70E6A3CF + 7 - Stereo + 0 + + + PSH0 + 0x7046516E + 7 - Stereo + 0 + + + VSH0 + 0x708B7AF8 + 7 - Stereo + 0 + + + VSH1 + 0x708B7AF9 + 7 - Stereo + 0 + + + VSH2 + 0x708B7AFA + 7 - Stereo + 0 + + + VSH3 + 0x708B7AFB + 7 - Stereo + 0 + + + VSH4 + 0x708B7AFC + 7 - Stereo + 0 + + + VSH5 + 0x708B7AFD + 7 - Stereo + 0 + + + VSH6 + 0x708B7AFE + 7 - Stereo + 0 + + + VSH7 + 0x708B7AFF + 7 - Stereo + 0 + + + VSH8 + 0x708B7B00 + 7 - Stereo + 0 + + + VSH9 + 0x708B7B01 + 7 - Stereo + 0 + + + VSH10 + 0x708B7B02 + 7 - Stereo + 0 + + + 2DDHUDSettings + 0x709ADADA + 7 - Stereo + 0 + + + 2DDConvergence + 0x709ADADB + 7 - Stereo + 0 + + + Disable2DD + 0x709ADADD + 7 - Stereo + 0 + + + 2DD_Notes + 0x709ADADC + 7 - Stereo + 0 + + + ASYNC10_ENABLE + 0x0005F511 + + 8 - Extra + + + APP - Enable dual core optimizations unless the application requested to disable them + 0x37605835 + + + OFF - Disable dual core optimizations + 0x53850673 + + + ON - Enable dual core optimizations + 0x42563729 + + + + + + ASYNC10_PRESENT_MODE + 0x0005F512 + + 8 - Extra + + + Default - DX10 present will be in default mode + 0x96184013 + + + Sync - DX10 present will be sync call + 0x53855200 + + + Async - DX10 present will be async call + 0x89624578 + + + + + + LARGE_VA + 0x0007FBB6 + + 8 - Extra + + + Disable - Disable large VA + 0x00000000 + + + Enable_LargeVA - Enable large VA on all GPUs + 0x00000001 + + + Enable_LargeVA_Quadro - Enable large VA on Quadro GPUs + 0x00000002 + + + Enable_LargeVA_Quadro_Tesla - Enable large VA on Quadro Tesla GPUs + 0x00000003 + + + + + + FORCEENABLEDCCAP + 0x001208CB + + 8 - Extra + + + Off + 0x00000000 + + + On - Force enable deferred context cap + 0x00000001 + + + + + + STAGING_CACHE_SIZE + 0x0013FEC2 + + 8 - Extra + + + Min + 0x00000000 + + + Default + 0x00400000 + + + Max + 0x01000001 + + + + + + PS_BM_DEFER_DESTROY_FLAGS + 0x00159046 + + 8 - Extra + + + Default + 0x00000000 + + + Disable Global Renaming + 0x00000001 + + + Allow Global Renaming Pitch Only + 0x00000002 + + + Disable Async Frees + 0x00000004 + + + Disable Alloc Recycling + 0x00000010 + + + + + + ASYNC9_PRESENT_MODE + 0x0015F512 + + 8 - Extra + + + Sync - All DX9 presents will be synchronous + 0x53855200 + + + Async - All DX9 presents will be asynchronous if AllowFlipBatching is set + 0x96184013 + + + Async full screen - Only full screen DX9 presents will be asynchronous if AllowFlipBatching is set + 0x57236402 + + + Force Async - All DX9 presents will be asynchronous + 0x89624578 + + + Force Async full screen - Only full screen DX9 presents will be asynchronous + 0x32469276 + + + + + + D3D_STEREO_BLACK_LIST + 0x00161903 + + 8 - Extra + + + Off + 0x00000000 + + + On - Prohibit stereo shim in DX apps + 0x00000001 + + + + + + DISABLE_Z16 + 0x0017FD6D + + 8 - Extra + + + Off + 0x00000000 + + + On - Replaces all Z16 requests with Z24X8 + 0x00000001 + + + + + + 3DSMax Shim Layer Control + 0x002C74F1 + + 8 - Extra + + + Disable - Disable the 3DSMax shim layer + 0x00000000 + + + Enable - Enable the 3DSMax shim layer on Quadro and GeForce SMB GPUs + 0x00000001 + + + Enable GEFORCE - Enable the 3DSMax shim layer on GeForce and Quadro (DEVELOP/DEBUG only) + 0x00000002 + + + + + + PS_ASYNC_SHADER_SCHEDULER_FLAGS + 0x00313536 + + 8 - Extra + + + IGNORE_LOAD_BALANCING - debug: Ignore gpu load, apply always + 0x00000001 + + + IGNORE_QUOTAS - debug: Ignore quotas + 0x00000002 + + + IGNORE_GARBAGE_COLLECT_THRESHOLD - debug: Ignore fill status and garbage collect every frame + 0x00000004 + + + DISABLE_GARBAGE_COLLECTION - debug: Disables garbage collection + 0x00000008 + + + COMPILE_IMMEDIATELY - debug: stall in the driver thread until the compile result arrives + 0x00000100 + + + LIMIT_SHADER_CREATION_TO_ONE_THREAD - Limit number of spawned threads to one (rather than the number of cores) for async creations + 0x00000200 + + + LIMIT_OPTIMIZED_SHADER_RECOMPILE_TO_ONE_THREAD - Limit number of spawned threads to one (rather than the number of cores) for optimized shader recompiles + 0x00000400 + + + DISABLE_MULTI_APP_THREAD_HEURISTIC - Disable heuristic for detecting multiple app threads compiling shaders + 0x00000800 + + + DISABLE_OPTIMIZED_SHADER_RECOMPILE - Recompile multiple optimized versions of shaders + 0x00001000 + + + DISABLE_SHADER_CREATION - Compile multiple shaders in parallel at creation + 0x00002000 + + + + + + ASYNC10_NVAPI_MODE + 0x005F5A32 + + 8 - Extra + + + ALLOW_NONBLOCKING_NVAPI - Generally allow some nvapi calls to not block async device + 0x00000001 + + + ALLOW_NOBLOCKING_SLISTATE - Allow specific non-blocking optimizations for GetCurrentSliState NVAPI + 0x00000002 + + + ALLOW_ALL - Allow all optimizations + 0x00000003 + + + + + + ASYNC10_OOO_QUERY_LIMIT + 0x005F5A33 + + 8 - Extra + + + Default - How many out of order query getData calls are allowed before stalling the Async Device + 0x0000000A + + + + + + D3D9_CONTROL_BITS + 0x0067345E + + 8 - Extra + + + Set maxRRegsAllowed = 24 for rRegBankSize == 128 + 0x00000001 + + + Set maxRRegsAllowed = 30 for rRegBankSize == 128 + 0x00000003 + + + Set maxRRegsAllowed = 40 for rRegBankSize == 128 + 0x00000005 + + + Set maxRRegsAllowed = 60 for rRegBankSize == 128 + 0x00000007 + + + Set maxRRegsAllowed = 120 for rRegBankSize == 128 + 0x00000009 + + + Set maxRRegsAllowed = 128 for rRegBankSize == 128 + 0x0000000F + + + Set maxRRegsAllowed = 24 for rRegBankSize == 256 + 0x00000010 + + + Set maxRRegsAllowed = 26 for rRegBankSize == 256 + 0x00000020 + + + Set maxRRegsAllowed = 30 for rRegBankSize == 256 + 0x00000030 + + + Set maxRRegsAllowed = 34 for rRegBankSize == 256 + 0x00000040 + + + Set maxRRegsAllowed = 40 for rRegBankSize == 256 + 0x00000050 + + + Set maxRRegsAllowed = 48 for rRegBankSize == 256 + 0x00000060 + + + Set maxRRegsAllowed = 60 for rRegBankSize == 256 + 0x00000070 + + + Set maxRRegsAllowed = 80 for rRegBankSize == 256 + 0x00000080 + + + Set maxRRegsAllowed = 120 for rRegBankSize == 256 + 0x00000090 + + + Set maxRRegsAllowed = 256 for rRegBankSize == 256 + 0x000000F0 + + + Disable ticks + 0x00000100 + + + Disable early-Z ticks + 0x00000200 + + + Force 1-bit compression on depth buffers + 0x00001000 + + + Disable dynamic VB promotion + 0x00002000 + + + Disallow forced vsync (includes adaptive vsync) + 0x00004000 + + + Disallow the use of the CPU Visible segement + 0x00008000 + + + + + + PS_SURFACE_PLACEMENT_HIGHEST_PRIORITY + 0x006BDD49 + + 8 - Extra + + + RTs/ZBs use high priority (default) + 0x187F7082 + + + RTs/ZBs use maximum priority + 0x83B7BC1A + + + RTs/ZBs use maximum priority on mixed-bus GPUs (192-bit 2 GB, etc.) + 0xFC17F610 + + + + + + KEPLER_CLEAR_SM_HALFCTL_CTRL_SCTL_CYA_6 + 0x007033AB + + 8 - Extra + + + Off + 0x00000000 + + + On - Clear + 0x00000001 + + + + + + FERMI_GF110_VOLTAGE_DROP_WAR + 0x00837AAF + + 8 - Extra + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + KEPLER_APPLY_ALD_WAR + 0x00846411 + + 8 - Extra + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + COLORCOMPRESSENABLE + 0x0085F725 + + 8 - Extra + + + Off + 0x99388100 + + + On + 0x25558997 + + + + + + READ_ONLY_DSV_EARLYZ_HAZARD_WAR_ENABLE + 0x008F7215 + + 8 - Extra + + + Off + 0x00000000 + + + On - Track read-only DSVs as last having been bound to PS to catch WAR hazards between early-z and PS + 0x00000001 + + + + + + PS_SURFACE_PLACEMENT_ALLOW + 0x0090F680 + + 8 - Extra + + + VB_FORCE_HOSTMEM + 0x00000001 + + + VB_FORCE_VIDMEM + 0x00000002 + + + VB_IB_FORCE_CPUVISIBLE + 0x00000004 + + + VB_IB_FORCE_LOCKABLE_CPUVISIBLE + 0x00000008 + + + VB_STATIC_PREFERS_HOSTMEM + 0x00000010 + + + VB_STATIC_PREFERS_VIDMEM + 0x00000020 + + + VB_WRITEONLY_PREFERS_HOSTMEM + 0x00000040 + + + VB_WRITEONLY_PREFERS_VIDMEM + 0x00000080 + + + IB_FORCE_HOSTMEM + 0x00000100 + + + IB_FORCE_VIDMEM + 0x00000200 + + + IB_PREFERS_HOSTMEM + 0x00000400 + + + IB_PREFERS_VIDMEM + 0x00000800 + + + TX_FORCE_HOSTMEM + 0x00001000 + + + TX_FORCE_VIDMEM + 0x00002000 + + + TX_PREFERS_HOSTMEM + 0x00004000 + + + TX_PREFERS_VIDMEM + 0x00008000 + + + RT_FORCE_HOSTMEM + 0x00010000 + + + RT_FORCE_VIDMEM + 0x00020000 + + + RT_PREFERS_HOSTMEM + 0x00040000 + + + RT_PREFERS_VIDMEM + 0x00080000 + + + Z_FORCE_HOSTMEM + 0x00100000 + + + Z_FORCE_VIDMEM + 0x00200000 + + + Z_PREFERS_HOSTMEM + 0x00400000 + + + Z_PREFERS_VIDMEM + 0x00800000 + + + Z_PREFERS_BOTH + 0x00C00000 + + + PB_FORCE_HOSTMEM + 0x01000000 + + + PB_FORCE_VIDMEM + 0x02000000 + + + SP_FORCE_INCLUDE_Z + 0x04000000 + + + SP_FORCE_ALL_HEAPS + 0x08000000 + + + SP_USE_NONE + 0x10000000 + + + SP_USE_2V + 0x20000000 + + + SP_USE_2H + 0x40000000 + + + SP_USE_4 + 0x80000000 + + + ALL_FORCE_HOSTMEM + 0x01111111 + + + ALL_FORCE_VIDMEM + 0x02222222 + + + + + + ASYNC9_ENABLE + 0x0092F4DE + + 8 - Extra + + + App - Enable AsyncDevice except in configs that do not work (some SLI, Optimus) or if the application requested to disable them + 0x37605835 + + + When safe - Enable AsyncDevice except in configs that do not work (some SLI, Optimus) + 0x37605846 + + + Off - Disable AsyncDevice and MS dual core optimization + 0x53850673 + + + On - Enable AsyncDevice ignoring safety or application requests + 0x42563729 + + + On if Quadro - Enable AsyncDevice if a Quadro or GeForce SMB GPU is being used, otherwise disable AsyncDevice and MS dual core optimization + 0x42563730 + + + Microsoft - Disable AsyncDevice but allow MS dual core optimization + 0x75328097 + + + + + + SLI Broadcast (DX9) + 0x0095DEF9 + + 1 - Compatibility + + + Do not use broadcast at all + 0x00000000 + + + DYNAMIC_BROADCAST_RENDER_TO_TEXTURE - Dynamic broadcast render to texture to all GPU's + 0x00000002 + + + STICKY_BROADCAST - Once a surface is marked for broadcast, keep this state regardless of future usage + 0x00000004 + + + PROPAGATE_BROADCAST_PROHIBITION_BETWEEN_RT_AND_ZB - If RT is prohibited from going to broadcast, force this on the corresponding ZB too + 0x00000008 + + + STATIC_BROADCAST_CLEARS_TO_TEXTURE - Static broadcast texture clears to all GPU's + 0x00000010 + + + STATIC_BROADCAST_RENDER_TO_TEXTURE - Static broadcast RTT ops to all GPU's + 0x00000020 + + + ALLOW_BROADCAST_ON_SMALLER_HDR_SURFACES - Do not disable dynamic broadcast on HDR surfaces smaller than primary + 0x00000040 + + + USE_BROADCAST_FLAGS_FROM_RT_OR_ZB - Allow to use broadcast flags on ZB together with flags on RT to make broadcast decision + 0x00000100 + + + FORCE_BROADCAST_ZB_CLEAR_IF_RT_IN_BROADCAST - Force broadcast clear on ZB, if the current RT in broadcast + 0x00000200 + + + IGNORE_DISCARD_ON_ZB_IF_RT_IN_BROADCAST - Ignore discard of ZB sync if bounded RT is in broadcast + 0x00001000 + + + DISCARD_TEXTURING_SYNC_AFTER_BLIT_FROM_DISCARDABLE_SRC - Discard texturing sync after unicast blit from discardable source (like back buffer) on broadcast RTT + 0x00002000 + + + BROADCAST_TO_CUBEMIP_TEXTURE - Broadcast to CUBE/MIP texture to all GPU's + 0x00010000 + + + BROADCAST_ON_ZB_IN_TEXTURE_ON_PARTIAL_SRT - Static broadcast on shadow map atlases + 0x00100000 + + + BROADCAST_ON_STENCIL_WRITE - Static broadcast on ZB with enabled and updated stencil + 0x00200000 + + + + + + SLI Copy Engine + 0x009CFEC8 + + 1 - Compatibility + + + Off - Disable the copy engine blitter + 0x00000000 + + + On - Enable the copy engine blitter + 0x00000001 + + + FORCE_CE_BLIT - Force using CE blitter even if CE perfstrategy says otherwise + 0x00000002 + + + FORCE_BASIC_MODEL - Force to run copy engine in basic model (default is basic prime) + 0x00000004 + + + IGNORE_MIN_CE_TRANSFER_SIZE - Ignore d3dreg key MIN_CE_TRANSFER_SIZE and allow all transfer sizes by CE + 0x00000008 + + + ENABLE_CE_UPLOADS Enable - Copy Engine Async Uploads + 0x00000010 + + + FORCE_CE_UPLOADS Force - Copy Engine Async Uploads for all uploads (ignoring location of destination surface) + 0x00000020 + + + ENABLE_LZO_COMPRESSION - Enable LZO compression for the Uploads + 0x00000040 + + + FORCE_LZO_COMPRESSION - Force LZO compression for all uploads (even if we have to stall) + 0x00000080 + + + + + + PS_VB_PROMOTION_FLAGS + 0x009E7462 + + 8 - Extra + + + DISABLE_DYNAMIC_PROMOTION - Don't promote VBs that are locked even if drawn from extensively + 0x00000001 + + + DISABLE_STATIC_PROMOTION Don't promote VBs that are never even locked + 0x00000002 + + + + + + SLI Specific Hacks (DX1x) + 0x00A06746 + + 1 - Compatibility + + + DO_NOT_DISCARD_ON_SCREENSIZE_A2B10G10R10_RTT - Respect sync on screensize A2B10G10R10 RTT, Dirt: Showdown specific hack + 0x00000001 + + + SKIP_TINY_TEXTURE_RESOLVE_ON_BLITTING - Ignore small texture (up to 2x2) resolve on blit, Stormrise specific hack + 0x00000002 + + + FORCE_RESOLVE_ON_SLAVES_FOR_SHARED_RESOURCES - Force resolve on slave GPUs for shared resources, specific for Lucas Arts Hive Engine Demo + 0x00000004 + + + IGNORE_READ_LOCK_FOR_STAGING_TEXTURES - Ignore CPU read lock for staging textures - real hack, specific to Red Faction: Armageddon + 0x00000008 + + + EARLY_PUSH_ALL_SUBRESOURCES - Defer early push of subresources with hope that we an early push the entire resource + 0x00000010 + + + SKIP_NOSUBRES_RTT_BUT_TINY_RESOLVE_ON_TEXTURING - Don't resolve textures before texturing unless they are tiny (2x2), but respect resolve for resources with subresources + 0x00000020 + + + CRYSIS2_HACK_POSTMSAAEDGEFILTERNV_OVERRIDE - Fix up Crysis2 binary to be consistent with SLI + 0x00000040 + + + CAP_PERF_TO_TDP_LIMIT_3_4_Way - Cap the clocks to not go beyond the TDP limit for 3/4-way SLI + 0x00000080 + + + FORCE_REPORT_NO_SLI_SUPPORT_FROM_NVAPI - If applition has buggy its own SLI support we need to do SLI magic in the driver and force app think it's run on single GPU + 0x00000100 + + + DO_NOT_DISCARD_ON_MIDSIZE_TEXTURE_ABGR8_RTT - Syncs on ABGR8 RTT or on any RTT's with 0x100X0x100 size,COD:B02 fetches Online status of player + 0x00000200 + + + + + + SLI Specific Hacks (DX9) + 0x00A0674A + + 1 - Compatibility + + + DISCARD_ON_NOT_EQUALLY_DIRTY_CUBE_MIP_RTT - Discard content of cube maped or mip mapped textures only if number of dirty subres isn't equal number of valid subres + 0x00000001 + + + IGNORE_DISCARD_SRT - Ignore both of the DISCARD_*_SRT bits when the render target has been synced for texturing + 0x00000002 + + + DO_RESOLVE_ON_RTT_MATCHED_PRIMARY - Ignore discard on RT textures matched to primary size + 0x00000004 + + + DISCARD_ON_G16R16_OR_MIDSIZE_ON_TEXTURING - Discard syncs unconditionally on G16R16 RTT or on any RTTs with 0x200X0x200 size, Wow after patch 5.2 hack + 0x00000008 + + + CRYSIS2_HACK_POSTMSAAEDGEFILTERNV_OVERRIDE - Fix up Crysis2 binary to be consistent with SLI + 0x00000040 + + + FORCE_REPORT_NO_SLI_SUPPORT_FROM_NVAPI - If application has buggy its own SLI support we need to do SLI magic in the driver and force app think it's run on single GPU + 0x00000100 + + + + + + SLI Broadcast (DX1x) + 0x00A0694B + + 1 - Compatibility + + + Do not use broadcast at all + 0x00000000 + + + DYNAMIC_BROADCAST_RENDER_TO_TEXTURE - Use broadcast to render interframe depandent content + 0x00000001 + + + DYNAMIC_BROADCAST_TO_TEXTURES_WITH_SUBRESOURCES_ONLY - Allow dynamic broadcast for textures with subresources (cubemap/mipmap) only + 0x00000002 + + + ENABLE_BLIT_BASED_BROADCAST_STATE_CHANGES - Enable blit-based broadcast state changes + 0x00000004 + + + STATIC_BROADCAST_TO_TEXTURES_WITH_SUBRESOURCES - Force broadcast on resources with subresorces (cubemap/mipmap) + 0x00000080 + + + STATIC_BROADCAST _TO_1LINE_32BIT_TEXTURES - Force broadcast on 32 bit textures which has one pixel height but more than 1 pixel width + 0x00000100 + + + LIMIT_BROADCAST_SPREADING_TO_ONE_LEVEL - Limit broadcast spreading only to one level up + 0x00000800 + + + RESPECT _BROADCAST_ZB_RESOLVE_ON_INACTIVE_GPUS - Do not discard sync on ZB if we try to resolve inactive GPUs in broadcast + 0x00008000 + + + + + + VALIDATE_PARAMS + 0x00A9D3C5 + + 8 - Extra + + + Nothing - Do not validate any input + 0x00000000 + + + COPYREGION - Validate input on CopyRegion functions + 0x00000001 + + + INTERPRET_NEGATIVE - Validate input considering negative input even if the parameter type is unsigned + 0x00000002 + + + VALIDATE_ALL - Validate all input + 0x00000003 + + + + + + APP_COMPAT_SHIM + 0x00B82343 + + 8 - Extra + + + Disabled + 0x00000000 + + + DX11_FORCE_DDI_CRITICAL_SECTION - Force a critical section on all non-reentrant DX11 DDI + 0x00000001 + + + DX11_FORCE_DDI_CRITICAL_SECTION_FOR_STEREO - Force a critical section on all non-reentrant DX11 DDI if stereo shim is enabled + 0x00000002 + + + Mask + 0x00000003 + + + + + + SHADERMAXREGALLOWED + 0x00BC6199 + + 8 - Extra + + + Min + 0x00000000 + + + Max - Specifies max register allowed when compiling/optimizing a shader + 0x00000400 + + + + + + MAX_PENDING_CMD_BUFFERS + 0x00C63A79 + + 8 - Extra + + + Off - Limit max number of pending command buffers (per context) in software queue. If key is set zero it will be ignored + 0x00000000 + + + 1 + 0x00000001 + + + 2 + 0x00000002 + + + + + + SYSMEMCACHEDCOPYBEHAVIOR + 0x00DB3853 + + 8 - Extra + + + Disallow - Disable sysmem caching for textures + 0x00000000 + + + ALLOW_FOR_TEXTURES_WITHOUT_SUBRESOURCES - Allow for textures without subresources only (default) + 0x00000001 + + + ALLOW_FOR_TEXTURES_WITH_SUBRESOURCES - Allow for textures with mips + 0x00000002 + + + + + + MCLINKINSTANCED_LIMIT + 0x00DB3857 + + 8 - Extra + + + Default - Threshold in megabytes for using of RT/ZB allocations as LinkInstanced (SLI DX9/10) + 0x00000064 + + + + + + MCFORCEHOSTSTAGINGBUFFERSIZE + 0x00DB3858 + + 8 - Extra + + + Default - size of host staging buffer, mostly for early push + 0x00040000 + + + + + + PS_REDUCTION_LOAD_BALANCED + 0x00DB834A + + 8 - Extra + + + Off + 0x00000000 + + + On - Reduction tracker load balancing + 0x00000001 + + + + + + BM_OFFER_RECLAIM (DX1x) + 0x00DC68B0 + + 8 - Extra + + + DISABLE_OFFER_SMALL_BLOCKS - Disable offering of suballocated Blocks + 0x00000001 + + + DISABLE_INTERNAL_OFFER_RECLAIM - Disable internal Offer/Reclaim + 0x00000002 + + + DISABLE_ALL_OFFER_RECLAIM - Diable all Offer/Reclaim + 0x00000004 + + + + + + PS_DX10_SURFACE_PLACEMENT_HIGHEST_PRIORITY (DX1x) + 0x00EA83C5 + + 8 - Extra + + + RTs/ZBs use high priority (default) + 0x187F7082 + + + RTs/ZBs use maximum priority + 0x83B7BC1A + + + RTs/ZBs use maximum priority on mixed-bus GPUs (192-bit 2 GB, etc.) + 0xFC17F610 + + + + + + WRITE_TO_HOST_STAGING_BUFFER_SIZE + 0x00F63A49 + + 8 - Extra + + + Default - Set size of write staging buffer. If key is set to zero it will be ignored + 0x00000000 + + + + + + AVOID_HOST_REMAPPERS + 0x00F63A50 + + 8 - Extra + + + Off + 0x00000000 + + + On - Try to avoid host remappers. If application is locking BL RT in vidmem, demote it to pitch so that lock won't require remapper. + 0x00000001 + + + + + + SLIMOSAIC_CONTROL + 0x00F713BC + + 8 - Extra + + + ALLOW_ALL - Allow all performance strategies + 0x00000000 + + + DISABLE_TWOD - Disable TwoD engine local transfers optimization + 0x00000001 + + + ENABLE_WINDOWED_AFR - Enable AFR support for windowed applications + 0x00000002 + + + DISABLE_CAN_VECTORIZE_TRACKER - Disable CanVectorizeTracker + 0x00000004 + + + DISABLE_CE_TRANSFER_2WAY - Disable CE transfer on 2 way systems + 0x00000010 + + + DISABLE_CE_TRANSFER_3WAY - Disable CE transfer on 3 way systems + 0x00000020 + + + DISABLE_CE_TRANSFER_4WAY - Disable CE transfer on 4 way systems + 0x00000040 + + + UNICAST_CE_TRANSFER_2WAY - Use unicast CE transfer on 2 way systems + 0x00000100 + + + UNICAST_CE_TRANSFER_3WAY - Use unicast CE transfer on 3 way systems + 0x00000200 + + + UNICAST_CE_TRANSFER_4WAY - Use unicast CE transfer on 4 way systems + 0x00000400 + + + FORCE_BAR1_WAR - Always request aliasing for DX9 primaries + 0x80000000 + + + + + + FERMI_FORCE_1X_TEX + 0x00F865E3 + + 8 - Extra + + + Disabled - Allow 2X tex where available + 0x00000000 + + + ENABLED_3D - Force 1X tex on 2x_TEX parts for 3D channels + 0x00000001 + + + ENABLED_COMPUTE - Force 1X tex on 2x_TEX parts for COMPUTE channels + 0x00000002 + + + + + + MAX_RENAMING_MEMORY + 0x00FE8CC0 + + 8 - Extra + + + Limit max amount of memory used for renaming on XP + 0x08000000 + + + + + + Vertical Sync Indicator + 0x00280880 + + 2 - Sync and Refresh + + + Off + 0x00000000 + + + Show Fullscreen/Flip Status + 0x00000001 + + + Show Vertical Sync Test Line + 0x00000002 + + + Show Flip Counter + 0x00000004 + + + Show Fullscreen/Flip Status and Flip Counter + 0x00000005 + + + Show All + 0x00000007 + + + + + + Antialiasing - Combined (Mode + Setting)  + 0x100B8EDE + + 3 - Antialiasing + + + Application-controlled / Off + 0x00000000 + + + Override | 2x MSAA + 0x1000000E + + + Override | 2x MSAA + 2x TrSSAA + 0x1140000E + + + Override | 2x MSAA + 2x SGSSAA + 0x1180000E + + + Override | 4x MSAA + 0x10000010 + + + Override | 4x MSAA + 4x TrSSAA + 0x12400010 + + + Override | 4x MSAA + 4x SGSSAA + 0x12800010 + + + Override | 8x MSAA + 0x10000025 + + + Override | 8x MSAA + 8x TrSSAA + 0x13400025 + + + Override | 8x MSAA + 8x SGSSAA + 0x13800025 + + + Override | 4x OGSSAA + 0x10000005 + + + Override | 9x OGSSAA + 0x1000000A + + + Override | 16x OGSSAA + 0x1000000C + + + Override | 4x OGSSAA + 2x MSAA + 0x10000019 + + + Override | 4x OGSSAA + 2x MSAA + 2x TrSSAA + 0x11400019 + + + Override | 4x OGSSAA + 2x MSAA + 2x SGSSAA + 0x11800019 + + + Override | 4x OGSSAA + 4x MSAA + 0x1000001A + + + Override | 4x OGSSAA + 4x MSAA + 4x TrSSAA + 0x1240001A + + + Override | 4x OGSSAA + 4x MSAA + 4x SGSSAA + 0x1280001A + + + Override | 4x OGSSAA + 8x MSAA + 0x10000029 + + + Override | 4x OGSSAA + 8x MSAA + 8x TrSSAA + 0x13400029 + + + Override | 4x OGSSAA + 8x MSAA + 8x SGSSAA + 0x13800029 + + + Override | 2xQ [2x Quincunx (blurred)] + 0x1000000F + + + Override | 8x [8x CSAA (4 color + 4 cv samples)] + 0x10000026 + + + Override | 16x [16x CSAA (4 color + 12 cv samples)] + 0x10000027 + + + Override | 16xQ [16x CSAA (8 color + 8 cv samples)] + 0x10000028 + + + Override | 32x [32x CSAA (8 color + 24 cv samples)] + 0x1000001D + + + Override | 2x1 [2x1 Supersampling (D3D only)] + 0x10000001 + + + Override | 1x2 [1x2 Supersampling (D3D only)] + 0x10000002 + + + Override | 4xS [Combined: 1x2 SS + 2x MS (D3D only)] + 0x10000013 + + + Override | 8xS [Combined: 1x2 SS + 4x MS] + 0x10000018 + + + Override | 12xS [Combined: 2x2 SS + 4x OGMS (D3D only)] + 0x10000017 + + + Enhance | 2x MSAA + 0x2000000E + + + Enhance | 2x MSAA + 2x TrSSAA + 0x2140000E + + + Enhance | 2x MSAA + 2x SGSSAA + 0x2180000E + + + Enhance | 4x MSAA + 0x20000010 + + + Enhance | 4x MSAA + 4x TrSSAA + 0x22400010 + + + Enhance | 4x MSAA + 4x SGSSAA + 0x22800010 + + + Enhance | 8x MSAA + 0x20000025 + + + Enhance | 8x MSAA + 8x TrSSAA + 0x23400025 + + + Enhance | 8x MSAA + 8x SGSSAA + 0x23800025 + + + Enhance | 4x OGSSAA + 0x20000005 + + + Enhance | 9x OGSSAA + 0x2000000A + + + Enhance | 16x OGSSAA + 0x2000000C + + + Enhance | 4x OGSSAA + 2x MSAA + 0x20000019 + + + Enhance | 4x OGSSAA + 2x MSAA + 2x TrSSAA + 0x21400019 + + + Enhance | 4x OGSSAA + 2x MSAA + 2x SGSSAA + 0x21800019 + + + Enhance | 4x OGSSAA + 4x MSAA + 0x2000001A + + + Enhance | 4x OGSSAA + 4x MSAA + 4x TrSSAA + 0x2240001A + + + Enhance | 4x OGSSAA + 4x MSAA + 4x SGSSAA + 0x2280001A + + + Enhance | 4x OGSSAA + 8x MSAA + 0x20000029 + + + Enhance | 4x OGSSAA + 8x MSAA + 8x TrSSAA + 0x23400029 + + + Enhance | 4x OGSSAA + 8x MSAA + 8x SGSSAA + 0x23800029 + + + Enhance | 2xQ [2x Quincunx (blurred)] + 0x2000000F + + + Enhance | 8x [8x CSAA (4 color + 4 cv samples)] + 0x20000026 + + + Enhance | 16x [16x CSAA (4 color + 12 cv samples)] + 0x20000027 + + + Enhance | 16xQ [16x CSAA (8 color + 8 cv samples)] + 0x20000028 + + + Enhance | 32x [32x CSAA (8 color + 24 cv samples)] + 0x2000001D + + + Enhance | 2x1 [2x1 Supersampling (D3D only)] + 0x20000001 + + + Enhance | 1x2 [1x2 Supersampling (D3D only)] + 0x20000002 + + + Enhance | 4xS [Combined: 1x2 SS + 2x MS (D3D only)] + 0x20000013 + + + Enhance | 8xS [Combined: 1x2 SS + 4x MS] + 0x20000018 + + + Enhance | 12xS [Combined: 2x2 SS + 4x OGMS (D3D only)] + 0x20000017 + + + 0x10000000 SELECTOR_OVERRIDE + 0x10000000 + + + 0x20000000 SELECTOR_ENHANCE + 0x20000000 + + + 0x01000000 REPLAY_SAMPLES_TWO + 0x01000000 + + + 0x02000000 REPLAY_SAMPLES_FOUR + 0x02000000 + + + 0x03000000 REPLAY_SAMPLES_EIGHT + 0x03000000 + + + 0x08000000 IGNORE_FOS_MEM_LIMITS_ENABLE + 0x08000000 + + + 0x00100000 REPLAY_MODE_ALPHA_TEST + 0x00100000 + + + 0x00200000 REPLAY_MODE_PIXELKILL + 0x00200000 + + + 0x00400000 REPLAY_MODE_OPTIMAL + 0x00400000 + + + 0x00800000 REPLAY_MODE_ALL + 0x00800000 + + + 0x00080000 FORCE_FOS_DISABLED + 0x00080000 + + + 0x00010000 GAMMACORRECTION_ON_IF_FOS + 0x00010000 + + + 0x00020000 GAMMACORRECTION_ON_ALWAYS + 0x00020000 + + + 0x00040000 ALPHATOCOVERAGE_MODE_ON + 0x00040000 + + + + + + STEREO_MCCOMPAT + 0x102E048D + + 8 - Extra + + + Legacy + 0x00000001 + + + Broadcast + 0x00000002 + + + Legacy | Broadcast + 0x00000003 + + + Disable SLI + 0x00000004 + + + Override bit + 0x80000000 + + + + + + MCSFRLOADBALANCE + 0x103C2E03 + + 8 - Extra + + + Static - each GPU receives a equal amount of pixels to process + 0x28384382 + + + Dynamic - moves the split line dynamically to accomodate the load + 0x60606064 + + + + + + CULL_BEFORE_FETCH + 0x10510E76 + + 8 - Extra + + + Dynamic + 0x00000006 + + + Always + 0x00000007 + + + Never + 0x00000008 + + + + + + KEPLER_L1_CACHE_WAR_BUG + 0x10528AB2 + + 8 - Extra + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + PS_ALPHABETA + 0x106044CE + + 8 - Extra + + + Static - The driver always uses Alpha fraction set via PS_ALPHABETA_FRACTION + 0x00000000 + + + Dynamic_Shader - The driver adjusts a shader unique Alpha fraction via AlphaBeta clocks + 0x00000001 + + + Dynamic_VBIB - The driver adjusts a vb/ib ID unique Alpha fraction via AlphaBeta clocks + 0x00000002 + + + + + + PS_ALPHABETA_FRACTION + 0x10842563 + + 8 - Extra + + + Min + 0x00000000 + + + Default - Fixed Alpha fraction to use when PS_ALPHABETA is in static mode + 0x0000003F + + + Max + 0x000000FF + + + + + + PHYSX_APPLICATION + 0x10E3293A + + 8 - Extra + + + Off + 0x00000000 + + + On + 0x00000001 + + + + + + Anisotropic filtering (mode + setting) + 0x10F74257 + + 4 - Texture Filtering + + + Application-controlled + 0x00000000 + + + Off [Linear] + 0x10000001 + + + 2x + 0x10000002 + + + 4x + 0x10000004 + + + 6x + 0x10000004 + + + 8x + 0x10000008 + + + 12x + 0x1000000C + + + 16x + 0x10000010 + + + SELECTOR_USER - do what the user says + 0x10000000 + + + SELECTOR_COND - do what the user says unless the app already specified something + 0x20000000 + + + + + + ENABLE_CE_MS_HYBRID + 0x10FADC84 + + 8 - Extra + + + Disabled - Disable CE for tranfers on MS hybrid + 0x00000000 + + + Enabled - Enable CE for tranfers on MS hybrid + 0x00000001 + + + + + + WKS_FEATURE_SUPPORT_CONTROL + 0x11D9DC84 + + 8 - Extra + + + Off + 0x00000000 + + + SRS_1714_WIN8_STEREO - Enable wks stereo for native dx11 Win8 stereo + 0x00000001 + + + WIN8_STEREO_EXPORT_IF_ENABLED - Export wddm 1.2 stereo modes only if wks stereo is enabled + 0x00000002 + + + HDMI_STEREO - Enables HDMI stereo by overriding any suitable display mode to stereo + 0x00000004 + + + HDMI_EXCLUSIVE_STEREO - Enables stereo just on HDMI displays (requires HDMI_STEREO) + 0x00000008 + + + TFP_CLAIM_EXCLUSIVE_MUTEX - TEAR FREE PRESENT acquires exclusive mutex + 0x00000010 + + + USE_ANY_FRAME_FLIP_STEREO_MODE_FOR_TFP_AND_SWAPGROUP - Use ANY_FRAME instead of PAIR_FLIP flipping mode on Kepler when tearfree or swapgroup is enabled + 0x00000020 + + + + + + OGL_SRV_APP_NON_FSAA_SINGLEBUFFER + 0x2003FF01 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Do not use FSAA modes for single buffered clients (this helps a lot with Studio Tools 10 which draws menues with OpenGL) + 0x00000001 + + + + + + OGL_APP_VBUM_VIRTUAL_ADDRESS (XP only) + 0x2007B25E + + 8 - Extra + + + Disabled - VRAM address passed directly back to the application, may not survive mode switch + 0x00000000 + + + Enabled - Virtual Address created for VBUM card references, safer for mode switching + 0x00000001 + + + + + + OGL_SLI_WINDOWED_AFR + 0x2014CC70 + + 8 - Extra + + + Disable + 0x00000000 + + + Enable + 0x00000001 + + + Use HW Default + 0xFFFFFFFF + + + + + + OGL_SHADER_WARNINGS_AS_ERRORS + 0x201808AC + + 8 - Extra + + + False - Default driver behavior (old setting, used by NVEmulate) + 0x00000000 + + + True - Enabled for all profiles and all shaders (old setting, used by NVEmulate). + 0x00000001 + + + Disabled always - Disabled for all profiles and all shaders (only for debug and to avoid breaking shipping apps). + 0x0000000A + + + Enabled For Version - Enabled for shaders with #version; disabled otherwise + 0x0000000B + + + Enabled For Core or Version - Enabled when using the core and ES profiles, or for shaders with #version; disabled otherwise. + 0x0000000C + + + Enabled always - Enabled for all profiles and all shaders + 0x0000000D + + + + + + OGL_APP_DST_REDUCE + 0x201C3B92 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled + 0x00000001 + + + + + + OGL_PFD_ADJUST + 0x201FEBD1 + + 8 - Extra + + + SUPPORT_GDI + 0x00000001 + + + EXPORT_COMPOSITION + 0x00000002 + + + EXPORT_COMPOSITION_AND_GDI + 0x00000004 + + + USE_HW_DEFAULT + 0xF0000000 + + + + + + OGL_RENDER_QUALITY_FLAGS + 0x20219263 + + 8 - Extra + + + TEXBITS_AUTO + 0x00000000 + + + MMDITHER + 0x00000001 + + + TEXBITS_16 + 0x00000004 + + + TEXBITS_32 + 0x00000008 + + + TEXBITS_RESERVED + 0x0000000C + + + + + + OGL_LDDM_MT_VSYNC_WAIT_METHOD + 0x2027F0A8 + + 8 - Extra + + + DXGKRNL_WAIT - Use Dxgkrnl to block on the vsync event + 0x00000000 + + + SPIN_WAIT - Spin wait on the vsync by polling the scan line + 0x00000001 + + + EXPORT_COMPOSITION_AND_GDI + 0x00000004 + + + DRIVER_DECIDE - The driver chooses the best wait method + 0x00000002 + + + + + + OGL_FORCE_FLUSH_TEXTURES + 0x2027F1A8 + + 8 - Extra + + + Disable - Do not force texture flushes + 0x00000000 + + + Enable - Force flushing textures after cooking them + 0x00000001 + + + + + + OGL_THREAD_OPTIMIZATION_GEFORCE + 0x202DC432 + + 8 - Extra + + + Disable all optimizations + 0x00000000 + + + CACHE_VIEWPORT - Cache calls to glViewport + 0x00000001 + + + CACHE_GLSL_OBJECTS - Cache calls to glGetUniformLocation and glIsShader + 0x00000002 + + + CACHE_GL_STATE - Cache calls to glIsEnabled for a subset of state + 0x00000004 + + + CACHE_MATRIX - Cache calls to glGetFloatv for GL_PROJECTION_MATRIX and GL_MODELVIEW_MATRIX + 0x00000008 + + + IGNORE_CHECK_FB_STATUS - Ignore calls to glCheckFramebufferStatus + 0x00000010 + + + Enable all threading optimizations + 0x0000001F + + + + + + OGL_APP_EXPORT_OPENGL_1_2 + 0x202DE437 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Some applications have problems with opengl 1.3 -> export opengl 1.2 only + 0x00000001 + + + + + + OGL_APP_DIRECT_PUSHBUFFER + 0x202FD652 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Use direct pushbuffer, not cached pushbuffer + 0x00000001 + + + + + + OGL_APP_RUNTIME_VERTEX_ATTRIB_SOURCING + 0x202FE114 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Post VAB generalizes the vertex shader to test the source of each vertex attribute used. Allows enabled array state to change without requiring a new vertex shader + 0x00000001 + + + + + + OGL_APP_YIELD_AFTER_SWAP + 0x20320CE4 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Call GL_YIELD in postSwapBuffers() + 0x00000001 + + + + + + OGL_DX_PRESENT_DEBUG + 0x20324987 + + 8 - Extra + + + Disable - Clear all debug bits + 0x00000000 + + + DISABLE_FULLSCREEN_OPT - disable fullscreen optimization + 0x00000001 + + + DISABLE_THREAD - disable present thread + 0x00000002 + + + ENABLE_DFLIP_ALWAYS - enable use of direct flip API parameters + 0x00000004 + + + ENABLE_NON_STEREO - enable DX present on non-stereo windows + 0x00000008 + + + ENABLE_FULLSCREEN_WIN7_STEREO - enable Win7 fullscreen stereo mechanism + 0x10000000 + + + + + + OGL_FORCE_NX6PLUSMODE + 0x20334278 + + 8 - Extra + + + USE_APP_DETECT - Use App Detection to decide + 0x00000000 + + + FORCE_ON - Force NX6 Plus Mode regardless of app + 0x00000001 + + + FORCE_OFF - Force NX6 Plus Mode off regardless of app + 0x00000002 + + + + + + OGL_APP_NO_SW_FALLBACK + 0x20335BCA + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Don't fall back to SW buffers if HW buffer allocations fail + 0x00000001 + + + + + + OGL_APP_HIDE_GL3_ON_G80_PLUS + 0x20359278 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Advertise OpenGL 2.1 for G80+ GPUs (instead of OpenGL 3.0) + 0x00000001 + + + + + + OGL_APPLICATION_KEY + 0x203691BB + + 8 - Extra + + + None - No application preferences selected + 0x00000000 + + + Standart - Standard application preferences + 0x00000001 + + + SoftImage3D + 0x00000002 + + + 3DSMax + 0x00000003 + + + 3DPaint + 0x00000004 + + + Maya + 0x00000005 + + + Lightscape + 0x00000006 + + + SolidEdge + 0x00000007 + + + Solidworks + 0x00000008 + + + Espri + 0x00000009 + + + Catia + 0x0000000A + + + Unisys + 0x0000000B + + + NX6Plus + 0x0000000C + + + + + + OGL_PERF_STRAT_LDDM_ALLOCATIONTABLE_SIZE + 0x203714A4 + + 8 - Extra + + + Default + 0x00001000 + + + + + + OGL_PULL_MEM_BUFFER_SHARED_THRESHOLD + 0x20378242 + + 8 - Extra + + + Default + 0x00100000 + + + + + + OGL_APP_COPYPIXEL_FRONTBUFFER_FLUSH + 0x2037F53A + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Forces a front buffer update on copy pixels, for broken applications using front buffer rendering without glFlush calls + 0x00000001 + + + + + + OGL_OVERLAY_MERGEBLIT_TIMER_MS + 0x203A0751 + + 8 - Extra + + + Default + 0x00000028 + + + Off - Merge blit timer off + 0x00000000 + + + + + + OGL_APP_PROE_2000I2 + 0x203C136F + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Workaround for Pro/E's wrong vertex array enables + 0x00000001 + + + + + + OGL_GLS_COMPATIBILITY + 0x203D3FC9 + + 8 - Extra + + + Disabled + 0x00000000 + + + NO_BUFFER_SHARING + 0x00000001 + + + BUF_SHARE_ALWAYS_NULLIFY_RASTER + 0x00000002 + + + BUF_SHARE_NEVER_NULLIFY_SURFACE_CLIPS + 0x00000004 + + + BUF_SHARE_NEVER_NULLIFY_SHARED_LIBRARY_COMMAND + 0x00000008 + + + + + + OGL_APP_FORCE_FP_DEFAULT_PRECISION + 0x2040B347 + + 8 - Extra + + + Disabled + 0x00000000 + + + 53_BIT - VC7.1 RT (mistakenly) clobbers the FP precision. This emulates the behavior in newer runtimes, such as VC10 + 0x00000001 + + + + + + OGL_APP_PROMOTE_SHADERS_FROM_140_TO_150 + 0x20441369 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled + 0x00000001 + + + + + + OGL_CHECK_FOR_IDENTITY_MATRIX_MATH + 0x2045959A + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Add cycles to check for identity matrix math in some cases. Limited to app bit to reduce risk, quadro differentiator + 0x00000001 + + + + + + OGL_MULTIMON_BUFFER + 0x204B6CBF + + 8 - Extra + + + Disable - disable multimon buffer, fall back to older MM multimon + 0x00000000 + + + Allow - allow multimon buffer, uMMB when UBB is enabled + 0x00000001 + + + ALLOW_ONLY_NONUNIFIED - allow, but when UBB is enabled fall back to non-unified MMB + 0x00000002 + + + USE_HW_DEFAULT + 0xFFFFFFFF + + + + + + OGL_TEXCLAMP + 0x204CFF7B + + 8 - Extra + + + Use HW values + 0x00000000 + + + Force OGL Spec + 0x00000001 + + + Force Clamp-To-Edge + 0x00000002 + + + + + + OGL_SRV_APP_NO_PFD_SUPPORT_GDI + 0x20568533 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Final override for exporting PFD_SUPPORT_GDI. If this bit is set, PFD_SUPPORT_GDI will not be set, regardless of OGL_PfdAdjust or OGL_VistaControlFlags values + 0x00000001 + + + + + + OGL_SRV_APP_MEMORY_MAP_NOT_REQUIRED + 0x20570FC6 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Disables the mapping of video memory to system memory, consumes too much in Vista + 0x00000001 + + + + + + OGL_APP_CLAW + 0x205F7E3B + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Enable the Workstation Performance Code, CLAW + 0x00000001 + + + + + + OGL_SRV_APP_FORCE_OGL_GEFORCE + 0x205FB5AB + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Enable GeForce optimizations on a Quadro + 0x00000001 + + + + + + OGL_PULL_MEM_DEFAULT_BUFFER_SIZE + 0x206194D6 + + 8 - Extra + + + Default + 0x00080000 + + + + + + OGL_APP_SOFTIMAGE + 0x20630BA7 + + 8 - Extra + + + Softlmage 3.8 + 0x00000026 + + + Softlmage 3.9 + 0x00000027 + + + + + + OGL_APP_LAZY_VBUM_VBOS + 0x20696FC3 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Enable the Lazy VBUM optimization for VBOs + 0x00000001 + + + + + + OGL_APP_HIDE_FLOAT_COLOR_IF_NO_TWO_SIDED + 0x206C7691 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Hide float color extensions (GL_ARB_color_buffer_float; GLX_ARB_fbconfig_float for X11/GLX; WGL_ARB_pixel_format_float for Windows/WGL) if GPU resorts to software fallback possible due to lack of two-sided lighting support (only on NV4x/G7x) + 0x00000001 + + + + + + OGL_APP_PROMOTE_SHADERS_FROM_120_TO_130 + 0x206BD8C7 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled + 0x00000001 + + + + + + OGL_QUADRO_WORKER_THREAD_CREATION + 0x20748292 + + 8 - Extra + + + Disabled - prevent the creation of a suspended worker thread on Quadro + 0x00000000 + + + Enabled + 0x00000001 + + + + + + OGL_TREAT_DEPTH24_AS_DEPTH32 + 0x20748F92 + + 8 - Extra + + + Disable + 0x00000000 + + + Enable - For Quadro, report depth 24 / stencil 0 formats as depth 32 + 0x00000001 + + + + + + OGL_FILTER_PIXELFORMAT + 0x207A3A90 + + 8 - Extra + + + EXPORT_8BPC + 0x00000001 + + + EXPORT_10BPC + 0x00000002 + + + + + + OGL_THREAD_OPTIMIZATION + 0x207A8C92 + + 8 - Extra + + + DISABLE_ALL_OPTIMIZATIONS + 0x00000000 + + + CACHE_VIEWPORT - Cache calls to glViewport + 0x00000001 + + + CACHE_GLSL_OBJECTS - Cache calls to glGetUniformLocation and glIsShader + 0x00000002 + + + CACHE_GL_STATE - Cache calls to glIsEnabled for a subset of state + 0x00000004 + + + CACHE_MATRIX - Cache Calls to glGetFloatv for GL_PROJECTION_MATRIX and GL_MODELVIEW_MATRIX + 0x00000008 + + + IGNORE_CHECK_FB_STATUS - Ignore calls to glCheckFramebufferStatus + 0x00000010 + + + ENABLE_ALL - Enable all threading optimizations + 0x0000001F + + + + + + OGL_APP_CENTROID_SAMPLE + 0x207C128B + + 8 - Extra + + + Disabled - Disable centroid sampling G80 only + 0x00000000 + + + Enabled + 0x00000001 + + + + + + OGL_APP_USE_DX10_SAT + 0x207DF8D1 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled + 0x00000001 + + + + + + OGL_APP_IGNORE_SWAP_HINTS + 0x2084A0A0 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Ignore all swap hint rects + 0x00000001 + + + + + + OGL_APP_NO_GENERIC_ARRAYS_IN_FF + 0x20852142 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - WAR for apps that exploit old-style vertex array access bugs such as KOTOR2 + 0x00000001 + + + + + + OGL_SLI_DL_CONTROL + 0x20873922 + + 8 - Extra + + + ENABLE - Bit set to use SLI DL optimisations + 0x00000001 + + + PUSH - USE PUSH P2P instead of pull + 0x00000002 + + + LIMIT_DL - limit download to one subdivce + 0x00000004 + + + LIMIT_CE - limit CE to use only one engine + 0x00000008 + + + METH_CE - use copy enigine + 0x00000010 + + + CHUNKS - number of chunks to use + 0x00020000 + + + WATERFALL - use waterfall copy + 0x00000100 + + + SKIP_P2P - skip P2P but use rest of algorithm + 0x00000200 + + + ONE_2_MANY - copy from one GPU to many + 0x00000400 + + + BASE - Enable by default with CE + 0x00000111 + + + + + + OGL_SRV_APP_FORCE_SECONDARY_ADAPTER + 0x208D973F + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled + 0x00000001 + + + + + + OGL_OCGCONTROL_DIRECT_NVIR + 0x208F3F2D + + 8 - Extra + + + DRIVER_DEFAULT - Use driver default behavior + 0x00000000 + + + FORCE_ENABLE - Enable nvInst->NVIR conversion, regardless of defaults + 0x00000001 + + + FORCE_DISABLE - Disable nvInst->NVIR conversion, regardless of defaults + 0x00000002 + + + + + + OGL_APP_OPTIMIZED_IMMEDIATE_MODE + 0x2096FD59 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Fast immediate mode path enable + 0x00000001 + + + + + + OGL_MULTIGPU_SUPPORT_BITS + 0x209746C1 + + 8 - Extra + + + 0x00000001 SYNC_VID2VID - Vid2Vid copies (CopyTexImage) update remote gpus + 0x00000001 + + + 0x00000004 TRACK_DIRTY_VIEWPORT - Fallback if usage of glViewport leaves undefined backbuffer content + 0x00000004 + + + 0x00000008 TRACK_DIRTY_DEPTHSTENCIL - Fallback if depth/stencilbuffer is not cleared after toggling gpu + 0x00000008 + + + 0x00000010 SYNC_SLAVE_FOR_MASTER_TRANSITION - Sync master image to slave on AFR_MASTER to AFR transition + 0x00000010 + + + 0x00080000 SYNC_VID2VID_DELAY_ONE_FRAME - Defer P2P texture updates until a texture is used more than one frame later + 0x00080000 + + + 0x00F00000 DISABLE_AFR_FOR_RT_SIZE_MASK - Disable render target width and height smaller or equal to this value. For example, if value is 8 then a render target with both width and height below or equal 8, disable AFR for that target + 0x00F00000 + + + 0x0F000000 AFR_EARLY_PUSH_RT_SIZE_MASK - Early push small AFR render targets. If the render target width and height both smaller or equal to this value, do early push + 0x0F000000 + + + + + + Prevent Antialiasing (OGL) + 0x20992431 + + 3 - Antialiasing + + + Disable none + 0x00000000 + + + Disable FBO Enhance + 0x00000001 + + + Disable Replay (SGSSAA) + 0x00000002 + + + + + + OGL_OVERRIDE_2XTEX + 0x209A0EE9 + + 8 - Extra + + + AUTO - Leave 2x TEX enabled + 0x00000000 + + + FORCE1X - Force 1x TEX mode (disable 2x TEX) + 0x00000001 + + + + + + OGL_THREAD_CONTROL_2 + 0x209FD306 + + 8 - Extra + + + 0x00000010 TOKENIZER_USE_EVENT_ON_LOAD - Forces the tokenizer to use events to wait for the player if a hyperthreaded system is on high load + 0x00000010 + + + 0x00000020 PLAYER_USE_SPIN - Allows the player to spin when waiting for commands + 0x00000020 + + + 0x00000100 FORCE_CACHE_SHARING - Set thread affinity to run app and game within a shared cache. + 0x00000100 + + + 0x00000200 FORCE_CACHE_SEPERATION Set thread affinity to run app and game on seperate caches. + 0x00000200 + + + 0x00000400 FORCE_HT_SEPERATION - Set thread affinity to avoid running driver and app on one hyperthreads of one core. + 0x00000400 + + + 0x00001000 - PLAYER_HTT_NO_OPTIIMIZE - This will disable HTT optimizations i.e. shifting threads around cores + 0x00001000 + + + 0x00002000 PLAYER_HTT_RUN_AWAY_GROUP - When the player thread runs away, bind it to a group of cores. Otherwise, only choose a single core + 0x00002000 + + + 0x00004000 PLAYER_HTT_RUN_AWAY_ONCE - If set, this means the player thread can only run away from the tokenizer thread once. Otherwise, it will constantly check + 0x00004000 + + + 0x00008000 PLAYER_NO_VOTING_LOCK - Don't allow voting to dynamially lock the worker thread onto a core + 0x00008000 + + + 0x00010000 ENABLE_QUADRO_DC - Turn on the DC driver on Quadro + 0x00010000 + + + 0x00020000 FORCE_SYNC_VACACHE - Force a Sync on each BindVertexArray + 0x00020000 + + + 0x00040000 DISABLE_TIMER - Disable front/backend timers normally used to disable threading when not effective + 0x00040000 + + + 0x00080000 IGNORE_OCCLUSION - Ignore GetQuery for occlusion tests, always return TRUE + 0x00080000 + + + 0x00100000 TRACK_CURRENT_COLOR - Track current color in the app thread to speed glGetFloat requests + 0x00100000 + + + 0x00200000 TRACK_CURRENT_MVP_MATRIX - Track current MVP matrix in the app thread to speed glGetFloat requests + 0x00200000 + + + 0x00400000 TRACK_CURRENT_FB_BINDING - Track current FB bindings to avoid syncs in glGetIntegerv + 0x00400000 + + + 0x00800000 CONVERT_MAPBUFFERRANGE - Convert glMapBufFerRange/glUnmapBuffer sequences to glBufferSubData. + 0x00800000 + + + 0x01000000 ASSUME_MAP_INVALIDATE - Assume that the app does not expect valid content when calling glMapBufferRange (as if GL_MAP_INVALIDATE_RANGE_BIT would be set by the app). + 0x01000000 + + + 0x02000000 CACHE_BUFFERNAMES - Enable buffer name came + 0x02000000 + + + 0x04000000 CACHETEXTURENAMES - Enable texture name cache + 0x04000000 + + + 0x08000000 CACHE_VERTEXARRAYNAMES - Enable vertex array name cache + 0x08000000 + + + + + + OGL_SET_REDUCE_COLOR_THRESHOLDS_UNORM8 + 0x20A2DE5F + + 8 - Extra + + + Default + 0x00000004 + + + + + + OGL_DISABLE_WORKSTATION_OPTIMIZATIONS + 0x20A6EEBC + + 8 - Extra + + + Disable + 0x00000000 + + + Enable - Disables automatic enable of some workstation optimizations + 0x00000001 + + + + + + OGL_SRV_APP_NOZ16STENCIL + 0x20AF671D + + 8 - Extra + + + Disable + 0x00000000 + + + Enable - Remove Z16 pixelformats with stencil + 0x00000001 + + + + + + OGL_APP_USE_LOOP_ENHANCE + 0x20AF9927 + + 8 - Extra + + + Disable + 0x00000000 + + + Enable - Replaces some application immediate mode loops with block copy of data + 0x00000001 + + + + + + OGL_FORCE_GAMMA_DOWNSAMPLE + 0x20B36B5C + + 8 - Extra + + + HARDWARE + 0x00000000 + + + LOW_QUALITY + 0x00000001 + + + HIGH_QUALITY + 0x00000002 + + + DISABLED + 0x00000003 + + + + + + OGL_APP_CONSTANT_OPTIMIZE + 0x20B3EDD5 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Optimize based on constant values + 0x00000001 + + + + + + OGL_APP_SET_WGL_COMPATIBILITY_HWND_THREAD_MISMATCH + 0x20B812C1 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Do accept opengl calls with HDCs created by another process than the current one + 0x00000001 + + + + + + OGL_APP_USE_SDDR + 0x20BAC7FA + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Enable frame coherency assuming static data but with dynamic references + 0x00000001 + + + + + + OGL_APP_CLAW_THREADS + 0x20BD755A + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - CLAW threading + 0x00000001 + + + + + + OGL_APP_CLAW_STATISTICS + 0x20BD755B + + 8 - Extra + + + Default + 0x00000000 + + + Non Default + 0x00000001 + + + + + + OGL_APP_CLAW_OPTIMIZE + 0x20BD755C + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Enable the optimizing compile in CLAW + 0x00000001 + + + + + + OGL_APP_MAXIMIZE_TEXTURE + 0x20BE92CB + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Maximize vidmem available for texture storage + 0x00000001 + + + + + + OGL_APP_NO_TEX_RGBA4_TO_RGBA8_MAPPING + 0x20C42A03 + + 8 - Extra + + + Disable - Map the GL_RGBA4 texture format to GL_RGBA8 internally + 0x00000000 + + + Enable - Don't map the GL_RGBA4 texture format to GL_RGBA8 internally + 0x00000001 + + + + + + OGL_APP_TXL_LOD_WAR + 0x20C618F9 + + 8 - Extra + + + Disabled - disables TXL LOD WAR for HW bug + 0x00000000 + + + Enabled + 0x00000001 + + + + + + OGL_AVOID_VALIDATION_ON_POP_MATRIX_WITHOUT_CHANGE + 0x20CBFFC4 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Avoid unnecessary calls to validation on pop matrix where no change has occurred. Limited to app bit to reduce risk + 0x00000001 + + + + + + OGL_VID_HEAP_REUSE_RATIO + 0x20D0DB0D + + 8 - Extra + + + Default - Control the amount of freed video memory the allocator reserves for reuse by future allocations. By default the allocator reserves up to 10% of the total VRAM. The units are in 1/1000ths of total heap. So 100 means 10% + 0x00000064 + + + + + + OGL_CONSUMER_API_STEREO_MODE + 0x20D324C5 + + 8 - Extra + + + AUTOSELECT - Set the stereo mode based on the consumer stereo regkeys + 0x00000000 + + + DISABLED - Disable 3D Vision + 0x00000001 + + + ANAGLYPH - Stereo anaglyph (3D Vision discover) + 0x00000002 + + + LCD - Use a 3D Vision capable LCD + 0x00000003 + + + DLP - Use a 3D Vision capable DLP TV + 0x00000004 + + + DLP_REVERSED - Use a 3D Wsion capable DLP TV (reversed checkerboard) + 0x00000005 + + + HDMI14 - Use a HDMI 1.4 capable TV (3DTV Play) + 0x00000006 + + + AEGIS_DT - Use a 3D Vision capable LCD with embedded AegisDT emitter + 0x00000007 + + + OEM_EMITTER - Use a 3D Vision capable LCD with OEM emitter connected via GPIO + 0x00000008 + + + + + + OGL_APP_VPWW_ALLOW_LATE_ALLOCED + 0x20D377DC + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - In VirtualProtectWriteWatch, allow late allocations + 0x00000001 + + + + + + OGL_PERF_STRAT_LDDM_CMDBUFFER_SIZE + 0x20D38906 + + 8 - Extra + + + Default + 0x00020000 + + + + + + OGL_APP_SHADER_ASSUMES_0 + 0x20D489F4 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - App uses shader that does rely on NV4x behaviour to automatically initializes shader variables + 0x00000001 + + + + + + OGL_APP_VIDMEM_PUSHBUFFER + 0x20D59EDA + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - This app benefits greatly from vidmem pushbuffers + 0x00000001 + + + + + + OGL_MULTISAMPLE_COMPATIBILITY + 0x20D5FDC4 + + 8 - Extra + + + Disabled - Multisample compatibility disabled + 0x00000000 + + + Enabled - Multisample compatibility enabled + 0x00000001 + + + USE_HW_DEFAULT - Select hardware default based on capabilities + 0xFFFFFFFF + + + + + + OGL_SKIP_TEXTURE_HOST_COPIES + 0x20D6CE24 + + 8 - Extra + + + Disable + 0x00000000 + + + Enable + 0x00000001 + + + KEEP_BASE_INITIALLY + 0x00000002 + + + + + + OGL_APP_DLIST_SEGMENTING + 0x20E5C972 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Enable splitting of large Display List (reduce memory peak consumption) + 0x00000001 + + + + + + OGL_PSTATE_BOOST_AT_CLEAR + 0x20E802AF + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Notify RM at each clear that pstates should be pushed to full power + 0x00000001 + + + + + + OGL_PERF_STRAT_LDDM_PATCHLOCATIONTABLE_SIZE + 0x20EA260C + + 8 - Extra + + + Default + 0x00002000 + + + + + + OGL_APP_SUPPORTBITS2 + 0x20EBD7B8 + + 8 - Extra + + + CLAW_DISABLE - Disable the Workstation Performance Code, CLAW + 0x00000002 + + + NO_GENERIC_ARRAYS_IN_FF WAR - for apps that exploit old-style vertex array access bugs such as KOTOR2 + 0x00000004 + + + PTE_COALESCING_DISABLE - Disable PTE coalescing, this fails in G8X and G9X chips + 0x00000008 + + + CLAW_DISABLE_DISPLAY_LIST - Disable the usage of CLAW in display lists + 0x00000010 + + + CONSTANT_OPTIMIZE - Optimize based on constant values + 0x00000040 + + + LAZY_VBUM_VBOS - Enable the Lazy VBUM optimization for VBOS + 0x00000080 + + + HIDE_FLOAT_COLOR_IF_NO_TWO_SIDED - Hide float color extensions (GL_ARB_color_buffer_float; GLX_ARB_fbconfig_float for X11,/GLX; WGL_ARB_pixel_format_float for Windows/WGL) if GPU resorts to software fallback possible due to lack of two—sided lighting support (only on NV4x/G7x) + 0x00000100 + + + VPWW_ALLOW_LATE_ALLOCED - In VirtualProtectWriteWatch, allow late allotions + 0x00000200 + + + HIDE_GL3_ON_G80_PLUS - When set, advertise OpenGL 2.1 for G80+ GPUs Gnstead of OpenGL 3.0) + 0x00000400 + + + DISABLE_DST_REDUCE + 0x00001000 + + + USE_DX10_SAT + 0x00002000 + + + DISABLE_TXL_LOD_WAR - disables TXL LOD WAR for HW bug + 0x00008000 + + + OPTIMIZED_VBOS + 0x00020000 + + + FORCE_PSTATE_P0 + 0x00040000 + + + DISABLE_BYPASS + 0x00400000 + + + COPYPIXEL_FRONTBUFFER_FLUSH - Force a flush after copypixels to the front buffer + 0x00800000 + + + CLIENT_ONLY_BITS + 0x00C6B7DE + + + NVIEW_SPAN_PER_HEAD_FLIPPING - Allow flipping on one head in spanning mode when app is fullscreen on this head + 0x00000001 + + + MEMORY_MAP_NOT_REQUIRED - Disables the mapping of video memory to system memory, consumes too much in Vista + 0x00000020 + + + NO_PFD_SUPPORT_GDI - Final override for exporting PFD_SUPPORT_GDI. If this bit is set, PFD_SUPPORT_GDI will not be set, regardless of OGL_PfdAdjust or OGL_VistaControlFlags values + 0x00000800 + + + FORCE_SECONDARY_ADAPTER + 0x00010000 + + + SERVER_ONLY_BITS + 0x00010821 + + + + + + OGL_TEARING_FREE_SWAP_PRESENT + 0x20EE02B2 + + 8 - Extra + + + FIFO - First client + 0x00000001 + + + MOST _VISIBLE_PIXELS - client with most visible pixels + 0x00000002 + + + LARGEST _WINDOW - client with largest window + 0x00000003 + + + MODE_NO_SPANNING - client can not be in span mode + 0x00000004 + + + DONT_INVALIDATE_RECT_BEFORE_PRESENT - Don't call InvalidateRect before swapping + 0x00000008 + + + PRE_SWAP_WAIT - Wait on the HW flip event for frame N when swapbuffers is called for frame N+1 + 0x00000010 + + + SYNC_SEMAPHORE - Create an overaly surface which will receive be the semaphore surface shared between KMD present blit and HW flip + 0x00000020 + + + + + + OGL_CONFORMANT_INCOMPLETE_TEXTURES + 0x20F107CC + + 8 - Extra + + + NONCONFORMANT - return (0,0,0,0) + 0x00000000 + + + CONFORMANT - return (0,0,0,1) + 0x00000001 + + + + + + OGL_SYSMEM_TEXTURE_PROMOTION + 0x20F2E572 + + 8 - Extra + + + Disable + 0x00000000 + + + Enable - Textures being promoted from Sysmem to Vidmem + 0x00000001 + + + + + + OGL_APP_BROKEN_NV3X_DEMOS + 0x20F49AE8 + + 8 - Extra + + + Disabled + 0x00000000 + + + Enabled - Hacks for broken NV3X demos on NV50 -- cap the number of exposed image units to 16 to avoid crashes, and clamp the position written by vertex programs because NV50 doesn't rasterize primitives with vertices at +/-INF + 0x00000001 + + + + + + OGL_DISPATCH_CONTROL + 0x20FBBC2B + + 8 - Extra + + + DISABLE_BYPASS + 0x00000000 + + + ALLOW_BYPASS + 0x00000001 + + + + + + STEREO_LASERSIGHT_DX10 + 0x7031A2E7 + + 8 - Extra + + + + + + STEREO_STEREOCUTOFFDEPTHNEAR_DX10 + 0x704EF483 + + 8 - Extra + + + + + + STEREO_STEREOCUTOFF_DX10 + 0x704FCF5C + + 8 - Extra + + + + + + STEREO_STEREOCUTOFF_DX11 + 0x7053569A + + 8 - Extra + + + + + + STEREO_STEREOCONVERGENCE_DX10 + 0x7077BACE + + 8 - Extra + + + + + + STEREO_STEREOCONVERGENCE_DX11 + 0x7084807E + + 8 - Extra + + + + + + STEREO_STEREOTEXTUREENABLE_DX11 + 0x70C0125E + + 8 - Extra + + + + + + STEREO_STEREOTEXTUREENABLE_DX10 + 0x70E1518C + + 8 - Extra + + + + + + STEREO_FRUSTUMADJUSTMODE_DX10 + 0x70ED1DA7 + + 8 - Extra + + + + + + Antialiasing - Transparency Multisampling - Setting + 0x0043ED70 + + 3 - Antialiasing + + + Q - (Default, Mixed mode) uses application detection + 0x00000000 + + + ATOC - (Old mode) uses the good old ATOC computation, 1x shader + 0x00000001 + + + A4X_TC - (Quality mode) spawns 4 shader copies, averages alpha only (only texcoords are adjusted) + 0x00000002 + + + C4X_TC - (Quality mode) spawns 4 shader copies, averages r,g,b, and alpha (only texcoords are adjusted) + 0x00000003 + + + A3X_TC - (Quality mode) spawns 3 shader copies, averages alpha only (only texcoords are adjusted) + 0x00000004 + + + C3X_TC - (Quality mode) spawns 3 shader copies, averages r,g,b, and alpha (only texcoords are adjusted) + 0x00000005 + + + A4X_ALL - (Quality mode) spawns 4 shader copies, averages alpha only (all parameters are adjusted) + 0x00000006 + + + C4X_ALL - (Quality mode) spawns 4 shader copies, averages r,g,b, and alpha (all parameters are adjusted) + 0x00000007 + + + A3X_ALL - (Quality mode) spawns 3 shader copies, averages alpha only (all parameters are adjusted) + 0x00000008 + + + C3X_ALL - (Quality mode) spawns 3 shader copies, averages r,g,b, and alpha (all parameters are adjusted) + 0x00000009 + + + SS2X - Used for internal driver purposes only - spawns 2 shader copies + 0x0000000A + + + SS4X - Used for internal driver purposes only - spawns 4 shader copies + 0x0000000B + + + SS8X - Used for internal driver purposes only - spawns 8 shader copies + 0x0000000C + + + TEST - (Test mode) shows shader types in different colors + 0x0000000F + + + + + + diff --git a/ColorControl/nspector/app.manifest b/ColorControl/nspector/app.manifest new file mode 100644 index 0000000..01a68d1 --- /dev/null +++ b/ColorControl/nspector/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + + + + + true + + + \ No newline at end of file diff --git a/ColorControl/nspector/frmBitEditor.Designer.cs b/ColorControl/nspector/frmBitEditor.Designer.cs new file mode 100644 index 0000000..86d861b --- /dev/null +++ b/ColorControl/nspector/frmBitEditor.Designer.cs @@ -0,0 +1,253 @@ +namespace nspector +{ + partial class frmBitEditor + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btnClose = new System.Windows.Forms.Button(); + this.lValue = new System.Windows.Forms.Label(); + this.lFilter = new System.Windows.Forms.Label(); + this.tbFilter = new System.Windows.Forms.TextBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.btnDirectApplyStart = new System.Windows.Forms.Button(); + this.gbDirectTest = new System.Windows.Forms.GroupBox(); + this.btnBrowseGame = new System.Windows.Forms.Button(); + this.tbGamePath = new System.Windows.Forms.TextBox(); + this.lblGamePath = new System.Windows.Forms.Label(); + this.clbBits = new nspector.ListViewEx(); + this.chBit = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chProfileCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chProfileNames = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.gbDirectTest.SuspendLayout(); + this.SuspendLayout(); + // + // btnClose + // + this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnClose.Location = new System.Drawing.Point(914, 806); + this.btnClose.Margin = new System.Windows.Forms.Padding(4); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(132, 29); + this.btnClose.TabIndex = 1; + this.btnClose.Text = "Apply && Close"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // lValue + // + this.lValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lValue.AutoSize = true; + this.lValue.Location = new System.Drawing.Point(21, 813); + this.lValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lValue.Name = "lValue"; + this.lValue.Size = new System.Drawing.Size(48, 17); + this.lValue.TabIndex = 2; + this.lValue.Text = "Value:"; + // + // lFilter + // + this.lFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lFilter.AutoSize = true; + this.lFilter.Location = new System.Drawing.Point(187, 813); + this.lFilter.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lFilter.Name = "lFilter"; + this.lFilter.Size = new System.Drawing.Size(87, 17); + this.lFilter.TabIndex = 23; + this.lFilter.Text = "Profile Filter:"; + // + // tbFilter + // + this.tbFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbFilter.Location = new System.Drawing.Point(274, 809); + this.tbFilter.Margin = new System.Windows.Forms.Padding(4); + this.tbFilter.Name = "tbFilter"; + this.tbFilter.Size = new System.Drawing.Size(632, 22); + this.tbFilter.TabIndex = 24; + this.tbFilter.TextChanged += new System.EventHandler(this.tbFilter_TextChanged); + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.textBox1.Location = new System.Drawing.Point(74, 809); + this.textBox1.Margin = new System.Windows.Forms.Padding(4); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(86, 22); + this.textBox1.TabIndex = 31; + this.textBox1.Text = "0x00FF00FF"; + this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave); + this.textBox1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox1_PreviewKeyDown); + // + // btnDirectApplyStart + // + this.btnDirectApplyStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnDirectApplyStart.Location = new System.Drawing.Point(6, 19); + this.btnDirectApplyStart.Margin = new System.Windows.Forms.Padding(4); + this.btnDirectApplyStart.Name = "btnDirectApplyStart"; + this.btnDirectApplyStart.Size = new System.Drawing.Size(105, 42); + this.btnDirectApplyStart.TabIndex = 32; + this.btnDirectApplyStart.Text = "GO!"; + this.btnDirectApplyStart.UseVisualStyleBackColor = true; + this.btnDirectApplyStart.Click += new System.EventHandler(this.btnDirectApply_Click); + // + // gbDirectTest + // + this.gbDirectTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.gbDirectTest.Controls.Add(this.btnBrowseGame); + this.gbDirectTest.Controls.Add(this.tbGamePath); + this.gbDirectTest.Controls.Add(this.lblGamePath); + this.gbDirectTest.Controls.Add(this.btnDirectApplyStart); + this.gbDirectTest.Location = new System.Drawing.Point(18, 733); + this.gbDirectTest.Margin = new System.Windows.Forms.Padding(4); + this.gbDirectTest.Name = "gbDirectTest"; + this.gbDirectTest.Padding = new System.Windows.Forms.Padding(4); + this.gbDirectTest.Size = new System.Drawing.Size(1029, 66); + this.gbDirectTest.TabIndex = 33; + this.gbDirectTest.TabStop = false; + this.gbDirectTest.Text = "Quick Bit Value Tester (stores this setting value to the current profile and imme" + + "diately starts the game when successful)"; + // + // btnBrowseGame + // + this.btnBrowseGame.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnBrowseGame.Location = new System.Drawing.Point(971, 24); + this.btnBrowseGame.Margin = new System.Windows.Forms.Padding(4); + this.btnBrowseGame.Name = "btnBrowseGame"; + this.btnBrowseGame.Size = new System.Drawing.Size(41, 29); + this.btnBrowseGame.TabIndex = 35; + this.btnBrowseGame.Text = "..."; + this.btnBrowseGame.UseVisualStyleBackColor = true; + this.btnBrowseGame.Click += new System.EventHandler(this.btnBrowseGame_Click); + // + // tbGamePath + // + this.tbGamePath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbGamePath.Location = new System.Drawing.Point(218, 26); + this.tbGamePath.Margin = new System.Windows.Forms.Padding(4); + this.tbGamePath.Name = "tbGamePath"; + this.tbGamePath.Size = new System.Drawing.Size(745, 22); + this.tbGamePath.TabIndex = 34; + // + // lblGamePath + // + this.lblGamePath.AutoSize = true; + this.lblGamePath.Location = new System.Drawing.Point(119, 29); + this.lblGamePath.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lblGamePath.Name = "lblGamePath"; + this.lblGamePath.Size = new System.Drawing.Size(98, 17); + this.lblGamePath.TabIndex = 33; + this.lblGamePath.Text = "Game to start:"; + // + // clbBits + // + this.clbBits.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.clbBits.CheckBoxes = true; + this.clbBits.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chBit, + this.chName, + this.chProfileCount, + this.chProfileNames}); + this.clbBits.FullRowSelect = true; + this.clbBits.GridLines = true; + this.clbBits.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.clbBits.Location = new System.Drawing.Point(12, 12); + this.clbBits.MultiSelect = false; + this.clbBits.Name = "clbBits"; + this.clbBits.ShowGroups = false; + this.clbBits.Size = new System.Drawing.Size(1035, 714); + this.clbBits.TabIndex = 34; + this.clbBits.UseCompatibleStateImageBehavior = false; + this.clbBits.View = System.Windows.Forms.View.Details; + this.clbBits.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.clbBits_ItemCheck); + // + // chBit + // + this.chBit.Text = "Bit"; + // + // chName + // + this.chName.Text = "Name"; + this.chName.Width = 200; + // + // chProfileCount + // + this.chProfileCount.Text = "Count"; + // + // chProfileNames + // + this.chProfileNames.Text = "Profiles"; + this.chProfileNames.Width = 4000; + // + // frmBitEditor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.ClientSize = new System.Drawing.Size(1059, 847); + this.Controls.Add(this.clbBits); + this.Controls.Add(this.gbDirectTest); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.tbFilter); + this.Controls.Add(this.lFilter); + this.Controls.Add(this.lValue); + this.Controls.Add(this.btnClose); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Margin = new System.Windows.Forms.Padding(4); + this.MinimumSize = new System.Drawing.Size(854, 609); + this.Name = "frmBitEditor"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Bit Value Editor"; + this.Load += new System.EventHandler(this.frmBitEditor_Load); + this.gbDirectTest.ResumeLayout(false); + this.gbDirectTest.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Label lValue; + private System.Windows.Forms.Label lFilter; + private System.Windows.Forms.TextBox tbFilter; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button btnDirectApplyStart; + private System.Windows.Forms.GroupBox gbDirectTest; + private System.Windows.Forms.Button btnBrowseGame; + private System.Windows.Forms.TextBox tbGamePath; + private System.Windows.Forms.Label lblGamePath; + private ListViewEx clbBits; + private System.Windows.Forms.ColumnHeader chBit; + private System.Windows.Forms.ColumnHeader chProfileCount; + private System.Windows.Forms.ColumnHeader chName; + private System.Windows.Forms.ColumnHeader chProfileNames; + } +} \ No newline at end of file diff --git a/ColorControl/nspector/frmBitEditor.cs b/ColorControl/nspector/frmBitEditor.cs new file mode 100644 index 0000000..dbd1167 --- /dev/null +++ b/ColorControl/nspector/frmBitEditor.cs @@ -0,0 +1,252 @@ +using System; +using System.Diagnostics; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; +using nspector.Common; +using nspector.Common.CustomSettings; + +namespace nspector +{ + internal partial class frmBitEditor : Form + { + private uint _Settingid = 0; + private frmDrvSettings _SettingsOwner = null; + private uint _InitValue = 0; + private uint _CurrentValue = 0; + + + internal frmBitEditor() + { + InitializeComponent(); + this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); + this.DoubleBuffered = true; + } + + internal void ShowDialog(frmDrvSettings SettingsOwner, uint SettingId, uint InitValue, string SettingName) + { + _Settingid = SettingId; + _SettingsOwner = SettingsOwner; + _InitValue = InitValue; + Text = string.Format("Bit Value Editor - {0}", SettingName); + this.ShowDialog(SettingsOwner); + } + + private void frmBitEditor_Load(object sender, EventArgs e) + { + SplitBitsFromUnknownSettings(); + clbBits.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); + SetValue(_InitValue); + } + + private void SplitBitsFromUnknownSettings() + { + uint lastValue = 0; + lastValue = _CurrentValue; + string[] filters = tbFilter.Text.Split(','); + clbBits.Items.Clear(); + + var referenceSettings = DrsServiceLocator.ReferenceSettings?.Settings.FirstOrDefault(s => s.SettingId == _Settingid); + + var settingsCache = DrsServiceLocator.ScannerService.CachedSettings.FirstOrDefault(x => x.SettingId == _Settingid); + if (settingsCache != null) + { + for (int bit = 0; bit < 32; bit++) + { + string profileNames = ""; + uint profileCount = 0; + + for (int i = 0; i < settingsCache.SettingValues.Count; i++) + { + if (((settingsCache.SettingValues[i].Value >> bit) & 0x1) == 0x1) + { + if (filters.Length == 0) + { + profileNames += settingsCache.SettingValues[i].ProfileNames + ","; + } + else + { + string[] settingProfileNames = settingsCache.SettingValues[i].ProfileNames.ToString().Split(','); + for (int p = 0; p < settingProfileNames.Length; p++) + { + for (int f = 0; f < filters.Length; f++) + { + if (settingProfileNames[p].ToLower().Contains(filters[f].ToLower())) + { + profileNames += settingProfileNames[p] + ","; + } + } + } + } + profileCount += settingsCache.SettingValues[i].ValueProfileCount; + } + } + + uint mask = (uint)1 << bit; + string maskStr=""; + + if (referenceSettings != null) + { + var maskValue = referenceSettings.SettingValues.FirstOrDefault(v => v.SettingValue == mask); + if (maskValue != null) + { + maskStr = maskValue.UserfriendlyName; + if (maskStr.Contains("(")) + { + maskStr = maskStr.Substring(0, maskStr.IndexOf("(") - 1); + } + } + } + + clbBits.Items.Add(new ListViewItem(new string[] { + string.Format("#{0:00}",bit), + maskStr, + profileCount.ToString(), + profileNames, + })); + + } + } + + SetValue(lastValue); + } + + private void updateValue(bool changeState, int changedIndex) + { + uint val = 0; + for (int b = 0; b < clbBits.Items.Count; b++) + { + if (((clbBits.Items[b].Checked) && changedIndex != b) || (changeState && (changedIndex == b))) + { + val = (uint)((uint)val | (uint)(1 << b)); + } + } + + UpdateCurrent(val); + } + + private void UpdateValue() + { + uint val = 0; + for (int b = 0; b < clbBits.Items.Count; b++) + { + if (clbBits.Items[b].Checked) + { + val = (uint)((uint)val | (uint)(1 << b)); + } + } + + UpdateCurrent(val); + } + + + private void SetValue(uint val) + { + for (int b = 0; b < clbBits.Items.Count; b++) + { + if (((val >> b) & 0x1) == 0x1) + clbBits.Items[b].Checked = true; + else + clbBits.Items[b].Checked = false; + } + + UpdateValue(); + } + + private void UpdateCurrent(uint val) + { + _CurrentValue = val; + textBox1.Text = "0x" + (val).ToString("X8"); + } + + private void UpdateCurrent(string text) + { + uint val = DrsUtil.ParseDwordByInputSafe(text); + UpdateCurrent(val); + SetValue(val); + } + + private void clbBits_ItemCheck(object sender, ItemCheckEventArgs e) + { + updateValue(e.NewValue == CheckState.Checked, e.Index); + } + + private void btnClose_Click(object sender, EventArgs e) + { + _SettingsOwner.SetSelectedDwordValue(_CurrentValue); + Close(); + } + + private void tbFilter_TextChanged(object sender, EventArgs e) + { + SplitBitsFromUnknownSettings(); + } + + private void numericUpDown1_ValueChanged(object sender, EventArgs e) + { + SplitBitsFromUnknownSettings(); + } + + private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + if (e.KeyValue == 13) + { + UpdateCurrent(textBox1.Text); + } + } + + private void textBox1_Leave(object sender, EventArgs e) + { + UpdateCurrent(textBox1.Text); + } + + + private void ApplyValueToProfile(uint val) + { + DrsServiceLocator + .SettingService + .SetDwordValueToProfile(_SettingsOwner._CurrentProfile, _Settingid, val); + } + + private async void btnDirectApply_Click(object sender, EventArgs e) + { + ApplyValueToProfile(_CurrentValue); + + await CheckIfSettingIsStored(); + + if (File.Exists(tbGamePath.Text)) + { + Process.Start(tbGamePath.Text); + } + } + + private async Task CheckIfSettingIsStored() + { + await Task.Run(async () => + { + while (_CurrentValue != DrsServiceLocator.SettingService + .GetDwordValueFromProfile(_SettingsOwner._CurrentProfile, _Settingid, false, true)) + { + await Task.Delay(50); + } + }); + } + + private void btnBrowseGame_Click(object sender, EventArgs e) + { + OpenFileDialog ofd = new OpenFileDialog(); + ofd.DefaultExt = "*.exe"; + ofd.Filter = "Applications|*.exe"; + ofd.DereferenceLinks = false; + + if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + tbGamePath.Text = ofd.FileName; + } + } + + } +} diff --git a/ColorControl/nspector/frmBitEditor.resx b/ColorControl/nspector/frmBitEditor.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ColorControl/nspector/frmBitEditor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ColorControl/nspector/frmDrvSettings.Designer.cs b/ColorControl/nspector/frmDrvSettings.Designer.cs new file mode 100644 index 0000000..096f73a --- /dev/null +++ b/ColorControl/nspector/frmDrvSettings.Designer.cs @@ -0,0 +1,613 @@ +namespace nspector +{ + partial class frmDrvSettings + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmDrvSettings)); + this.ilListView = new System.Windows.Forms.ImageList(this.components); + this.pbMain = new System.Windows.Forms.ProgressBar(); + this.tsMain = new System.Windows.Forms.ToolStrip(); + this.tslProfiles = new System.Windows.Forms.ToolStripLabel(); + this.cbProfiles = new System.Windows.Forms.ToolStripComboBox(); + this.tsbModifiedProfiles = new System.Windows.Forms.ToolStripSplitButton(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.tsbRefreshProfile = new System.Windows.Forms.ToolStripButton(); + this.tsbRestoreProfile = new System.Windows.Forms.ToolStripButton(); + this.tsbCreateProfile = new System.Windows.Forms.ToolStripButton(); + this.tsbDeleteProfile = new System.Windows.Forms.ToolStripButton(); + this.tsSep2 = new System.Windows.Forms.ToolStripSeparator(); + this.tsbAddApplication = new System.Windows.Forms.ToolStripButton(); + this.tssbRemoveApplication = new System.Windows.Forms.ToolStripSplitButton(); + this.tsSep3 = new System.Windows.Forms.ToolStripSeparator(); + this.tsbExportProfiles = new System.Windows.Forms.ToolStripSplitButton(); + this.exportCurrentProfileOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportUserdefinedProfilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportAllProfilesNVIDIATextFormatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tsbImportProfiles = new System.Windows.Forms.ToolStripSplitButton(); + this.importProfilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importAllProfilesNVIDIATextFormatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tsSep4 = new System.Windows.Forms.ToolStripSeparator(); + this.tscbShowCustomSettingNamesOnly = new System.Windows.Forms.ToolStripButton(); + this.tsSep5 = new System.Windows.Forms.ToolStripSeparator(); + this.tscbShowScannedUnknownSettings = new System.Windows.Forms.ToolStripButton(); + this.tsbBitValueEditor = new System.Windows.Forms.ToolStripButton(); + this.tsSep6 = new System.Windows.Forms.ToolStripSeparator(); + this.tsbApplyProfile = new System.Windows.Forms.ToolStripButton(); + this.btnResetValue = new System.Windows.Forms.Button(); + this.lblApplications = new System.Windows.Forms.Label(); + this.toolStripButton5 = new System.Windows.Forms.ToolStripButton(); + this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel(); + this.toolStripButton6 = new System.Windows.Forms.ToolStripButton(); + this.ilCombo = new System.Windows.Forms.ImageList(this.components); + this.cbValues = new System.Windows.Forms.ComboBox(); + this.lblWidth96 = new System.Windows.Forms.Label(); + this.lblWidth330 = new System.Windows.Forms.Label(); + this.lblWidth16 = new System.Windows.Forms.Label(); + this.lblWidth30 = new System.Windows.Forms.Label(); + this.lvSettings = new nspector.ListViewEx(); + this.chSettingID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chSettingValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chSettingValueHex = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tsMain.SuspendLayout(); + this.SuspendLayout(); + // + // ilListView + // + this.ilListView.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilListView.ImageStream"))); + this.ilListView.TransparentColor = System.Drawing.Color.Transparent; + this.ilListView.Images.SetKeyName(0, "0_gear2.png"); + this.ilListView.Images.SetKeyName(1, "1_gear2_2.png"); + this.ilListView.Images.SetKeyName(2, "4_gear_nv2.png"); + this.ilListView.Images.SetKeyName(3, "6_gear_inherit.png"); + // + // pbMain + // + this.pbMain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pbMain.Location = new System.Drawing.Point(16, 585); + this.pbMain.Margin = new System.Windows.Forms.Padding(5); + this.pbMain.Name = "pbMain"; + this.pbMain.Size = new System.Drawing.Size(1120, 11); + this.pbMain.TabIndex = 19; + // + // tsMain + // + this.tsMain.AllowMerge = false; + this.tsMain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tsMain.AutoSize = false; + this.tsMain.BackgroundImage = global::nspector.Properties.Resources.transparent16; + this.tsMain.CanOverflow = false; + this.tsMain.Dock = System.Windows.Forms.DockStyle.None; + this.tsMain.GripMargin = new System.Windows.Forms.Padding(0); + this.tsMain.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.tsMain.ImageScalingSize = new System.Drawing.Size(20, 20); + this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tslProfiles, + this.cbProfiles, + this.tsbModifiedProfiles, + this.toolStripSeparator1, + this.tsbRefreshProfile, + this.tsbRestoreProfile, + this.tsbCreateProfile, + this.tsbDeleteProfile, + this.tsSep2, + this.tsbAddApplication, + this.tssbRemoveApplication, + this.tsSep3, + this.tsbExportProfiles, + this.tsbImportProfiles, + this.tsSep4, + this.tscbShowCustomSettingNamesOnly, + this.tsSep5, + this.tscbShowScannedUnknownSettings, + this.tsbBitValueEditor, + this.tsSep6, + this.tsbApplyProfile}); + this.tsMain.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; + this.tsMain.Location = new System.Drawing.Point(16, 5); + this.tsMain.Name = "tsMain"; + this.tsMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; + this.tsMain.Size = new System.Drawing.Size(1120, 31); + this.tsMain.TabIndex = 24; + this.tsMain.Text = "toolStrip1"; + // + // tslProfiles + // + this.tslProfiles.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tslProfiles.Margin = new System.Windows.Forms.Padding(0, 5, 10, 2); + this.tslProfiles.Name = "tslProfiles"; + this.tslProfiles.Size = new System.Drawing.Size(61, 24); + this.tslProfiles.Text = "Profiles:"; + // + // cbProfiles + // + this.cbProfiles.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.cbProfiles.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.cbProfiles.AutoSize = false; + this.cbProfiles.DropDownWidth = 290; + this.cbProfiles.Margin = new System.Windows.Forms.Padding(1); + this.cbProfiles.MaxDropDownItems = 50; + this.cbProfiles.Name = "cbProfiles"; + this.cbProfiles.Size = new System.Drawing.Size(385, 28); + this.cbProfiles.SelectedIndexChanged += new System.EventHandler(this.cbProfiles_SelectedIndexChanged); + this.cbProfiles.TextChanged += new System.EventHandler(this.cbProfiles_TextChanged); + // + // tsbModifiedProfiles + // + this.tsbModifiedProfiles.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbModifiedProfiles.Enabled = false; + this.tsbModifiedProfiles.Image = global::nspector.Properties.Resources.home_sm; + this.tsbModifiedProfiles.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbModifiedProfiles.Name = "tsbModifiedProfiles"; + this.tsbModifiedProfiles.Size = new System.Drawing.Size(39, 28); + this.tsbModifiedProfiles.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay; + this.tsbModifiedProfiles.ToolTipText = "Back to global profile (Home) / User modified profiles"; + this.tsbModifiedProfiles.ButtonClick += new System.EventHandler(this.tsbModifiedProfiles_ButtonClick); + this.tsbModifiedProfiles.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.tsbModifiedProfiles_DropDownItemClicked); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31); + // + // tsbRefreshProfile + // + this.tsbRefreshProfile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbRefreshProfile.Image = ((System.Drawing.Image)(resources.GetObject("tsbRefreshProfile.Image"))); + this.tsbRefreshProfile.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbRefreshProfile.Name = "tsbRefreshProfile"; + this.tsbRefreshProfile.Size = new System.Drawing.Size(24, 28); + this.tsbRefreshProfile.Text = "Refresh current profile."; + this.tsbRefreshProfile.Click += new System.EventHandler(this.tsbRefreshProfile_Click); + // + // tsbRestoreProfile + // + this.tsbRestoreProfile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbRestoreProfile.Image = ((System.Drawing.Image)(resources.GetObject("tsbRestoreProfile.Image"))); + this.tsbRestoreProfile.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbRestoreProfile.Name = "tsbRestoreProfile"; + this.tsbRestoreProfile.Size = new System.Drawing.Size(24, 28); + this.tsbRestoreProfile.Text = "Restore current profile to NVIDIA defaults."; + this.tsbRestoreProfile.Click += new System.EventHandler(this.tsbRestoreProfile_Click); + // + // tsbCreateProfile + // + this.tsbCreateProfile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbCreateProfile.Image = ((System.Drawing.Image)(resources.GetObject("tsbCreateProfile.Image"))); + this.tsbCreateProfile.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbCreateProfile.Name = "tsbCreateProfile"; + this.tsbCreateProfile.Size = new System.Drawing.Size(24, 28); + this.tsbCreateProfile.Text = "Create new profile"; + this.tsbCreateProfile.Click += new System.EventHandler(this.tsbCreateProfile_Click); + // + // tsbDeleteProfile + // + this.tsbDeleteProfile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbDeleteProfile.Image = global::nspector.Properties.Resources.ieframe_1_18212; + this.tsbDeleteProfile.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbDeleteProfile.Name = "tsbDeleteProfile"; + this.tsbDeleteProfile.Size = new System.Drawing.Size(24, 28); + this.tsbDeleteProfile.Text = "Delete current Profile"; + this.tsbDeleteProfile.Click += new System.EventHandler(this.tsbDeleteProfile_Click); + // + // tsSep2 + // + this.tsSep2.Name = "tsSep2"; + this.tsSep2.Size = new System.Drawing.Size(6, 31); + // + // tsbAddApplication + // + this.tsbAddApplication.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbAddApplication.Image = global::nspector.Properties.Resources.window_application_add; + this.tsbAddApplication.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbAddApplication.Name = "tsbAddApplication"; + this.tsbAddApplication.Size = new System.Drawing.Size(24, 28); + this.tsbAddApplication.Text = "Add application to current profile."; + this.tsbAddApplication.Click += new System.EventHandler(this.tsbAddApplication_Click); + // + // tssbRemoveApplication + // + this.tssbRemoveApplication.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tssbRemoveApplication.Image = global::nspector.Properties.Resources.window_application_delete; + this.tssbRemoveApplication.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tssbRemoveApplication.Name = "tssbRemoveApplication"; + this.tssbRemoveApplication.Size = new System.Drawing.Size(39, 28); + this.tssbRemoveApplication.Text = "Remove application from current profile"; + this.tssbRemoveApplication.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.tssbRemoveApplication_DropDownItemClicked); + this.tssbRemoveApplication.Click += new System.EventHandler(this.tssbRemoveApplication_Click); + // + // tsSep3 + // + this.tsSep3.Name = "tsSep3"; + this.tsSep3.Size = new System.Drawing.Size(6, 31); + // + // tsbExportProfiles + // + this.tsbExportProfiles.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbExportProfiles.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.exportCurrentProfileOnlyToolStripMenuItem, + this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem, + this.exportUserdefinedProfilesToolStripMenuItem, + this.exportAllProfilesNVIDIATextFormatToolStripMenuItem}); + this.tsbExportProfiles.Image = global::nspector.Properties.Resources.export1; + this.tsbExportProfiles.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbExportProfiles.Name = "tsbExportProfiles"; + this.tsbExportProfiles.Size = new System.Drawing.Size(39, 28); + this.tsbExportProfiles.Text = "Export user defined profiles"; + this.tsbExportProfiles.Click += new System.EventHandler(this.tsbExportProfiles_Click); + // + // exportCurrentProfileOnlyToolStripMenuItem + // + this.exportCurrentProfileOnlyToolStripMenuItem.Name = "exportCurrentProfileOnlyToolStripMenuItem"; + this.exportCurrentProfileOnlyToolStripMenuItem.Size = new System.Drawing.Size(422, 26); + this.exportCurrentProfileOnlyToolStripMenuItem.Text = "Export current profile only"; + this.exportCurrentProfileOnlyToolStripMenuItem.Click += new System.EventHandler(this.exportCurrentProfileOnlyToolStripMenuItem_Click); + // + // exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem + // + this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Name = "exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem"; + this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Size = new System.Drawing.Size(422, 26); + this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Text = "Export current profile including predefined settings"; + this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Click += new System.EventHandler(this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem_Click); + // + // exportUserdefinedProfilesToolStripMenuItem + // + this.exportUserdefinedProfilesToolStripMenuItem.Name = "exportUserdefinedProfilesToolStripMenuItem"; + this.exportUserdefinedProfilesToolStripMenuItem.Size = new System.Drawing.Size(422, 26); + this.exportUserdefinedProfilesToolStripMenuItem.Text = "Export all customized profiles"; + this.exportUserdefinedProfilesToolStripMenuItem.Click += new System.EventHandler(this.exportUserdefinedProfilesToolStripMenuItem_Click); + // + // exportAllProfilesNVIDIATextFormatToolStripMenuItem + // + this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Name = "exportAllProfilesNVIDIATextFormatToolStripMenuItem"; + this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Size = new System.Drawing.Size(422, 26); + this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Text = "Export all driver profiles (NVIDIA Text Format)"; + this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Click += new System.EventHandler(this.exportAllProfilesNVIDIATextFormatToolStripMenuItem_Click); + // + // tsbImportProfiles + // + this.tsbImportProfiles.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbImportProfiles.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.importProfilesToolStripMenuItem, + this.importAllProfilesNVIDIATextFormatToolStripMenuItem}); + this.tsbImportProfiles.Image = global::nspector.Properties.Resources.import1; + this.tsbImportProfiles.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbImportProfiles.Name = "tsbImportProfiles"; + this.tsbImportProfiles.Size = new System.Drawing.Size(39, 28); + this.tsbImportProfiles.Text = "Import user defined profiles"; + this.tsbImportProfiles.Click += new System.EventHandler(this.tsbImportProfiles_Click); + // + // importProfilesToolStripMenuItem + // + this.importProfilesToolStripMenuItem.Name = "importProfilesToolStripMenuItem"; + this.importProfilesToolStripMenuItem.Size = new System.Drawing.Size(453, 26); + this.importProfilesToolStripMenuItem.Text = "Import profile(s)"; + this.importProfilesToolStripMenuItem.Click += new System.EventHandler(this.importProfilesToolStripMenuItem_Click); + // + // importAllProfilesNVIDIATextFormatToolStripMenuItem + // + this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Name = "importAllProfilesNVIDIATextFormatToolStripMenuItem"; + this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Size = new System.Drawing.Size(453, 26); + this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Text = "Import (replace) all driver profiles (NVIDIA Text Format)"; + this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Click += new System.EventHandler(this.importAllProfilesNVIDIATextFormatToolStripMenuItem_Click); + // + // tsSep4 + // + this.tsSep4.Name = "tsSep4"; + this.tsSep4.Size = new System.Drawing.Size(6, 31); + // + // tscbShowCustomSettingNamesOnly + // + this.tscbShowCustomSettingNamesOnly.CheckOnClick = true; + this.tscbShowCustomSettingNamesOnly.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tscbShowCustomSettingNamesOnly.Image = global::nspector.Properties.Resources.filter_user; + this.tscbShowCustomSettingNamesOnly.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tscbShowCustomSettingNamesOnly.Name = "tscbShowCustomSettingNamesOnly"; + this.tscbShowCustomSettingNamesOnly.Size = new System.Drawing.Size(24, 28); + this.tscbShowCustomSettingNamesOnly.Text = "Show the settings and values from CustomSettingNames file only."; + this.tscbShowCustomSettingNamesOnly.CheckedChanged += new System.EventHandler(this.cbCustomSettingsOnly_CheckedChanged); + // + // tsSep5 + // + this.tsSep5.Name = "tsSep5"; + this.tsSep5.Size = new System.Drawing.Size(6, 31); + // + // tscbShowScannedUnknownSettings + // + this.tscbShowScannedUnknownSettings.CheckOnClick = true; + this.tscbShowScannedUnknownSettings.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tscbShowScannedUnknownSettings.Enabled = false; + this.tscbShowScannedUnknownSettings.Image = global::nspector.Properties.Resources.find_set2; + this.tscbShowScannedUnknownSettings.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tscbShowScannedUnknownSettings.Name = "tscbShowScannedUnknownSettings"; + this.tscbShowScannedUnknownSettings.Size = new System.Drawing.Size(24, 28); + this.tscbShowScannedUnknownSettings.Text = "Show unknown settings from NVIDIA predefined profiles"; + this.tscbShowScannedUnknownSettings.Click += new System.EventHandler(this.tscbShowScannedUnknownSettings_Click); + // + // tsbBitValueEditor + // + this.tsbBitValueEditor.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbBitValueEditor.Image = global::nspector.Properties.Resources.text_binary; + this.tsbBitValueEditor.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbBitValueEditor.Name = "tsbBitValueEditor"; + this.tsbBitValueEditor.Size = new System.Drawing.Size(24, 28); + this.tsbBitValueEditor.Text = "Show bit value editor."; + this.tsbBitValueEditor.Click += new System.EventHandler(this.tsbBitValueEditor_Click); + // + // tsSep6 + // + this.tsSep6.Name = "tsSep6"; + this.tsSep6.Size = new System.Drawing.Size(6, 31); + // + // tsbApplyProfile + // + this.tsbApplyProfile.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.tsbApplyProfile.Image = global::nspector.Properties.Resources.apply; + this.tsbApplyProfile.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsbApplyProfile.Name = "tsbApplyProfile"; + this.tsbApplyProfile.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; + this.tsbApplyProfile.Size = new System.Drawing.Size(130, 28); + this.tsbApplyProfile.Text = "Apply changes"; + this.tsbApplyProfile.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tsbApplyProfile.Click += new System.EventHandler(this.tsbApplyProfile_Click); + // + // btnResetValue + // + this.btnResetValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnResetValue.Enabled = false; + this.btnResetValue.Image = global::nspector.Properties.Resources.nv_btn; + this.btnResetValue.Location = new System.Drawing.Point(976, 215); + this.btnResetValue.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0); + this.btnResetValue.Name = "btnResetValue"; + this.btnResetValue.Size = new System.Drawing.Size(33, 23); + this.btnResetValue.TabIndex = 7; + this.btnResetValue.UseVisualStyleBackColor = true; + this.btnResetValue.Click += new System.EventHandler(this.btnResetValue_Click); + // + // lblApplications + // + this.lblApplications.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblApplications.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(185)))), ((int)(((byte)(0))))); + this.lblApplications.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.lblApplications.ForeColor = System.Drawing.Color.White; + this.lblApplications.Location = new System.Drawing.Point(16, 39); + this.lblApplications.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.lblApplications.Name = "lblApplications"; + this.lblApplications.Size = new System.Drawing.Size(1120, 21); + this.lblApplications.TabIndex = 25; + this.lblApplications.Text = "fsagame.exe, bond.exe, herozero.exe"; + // + // toolStripButton5 + // + this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton5.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton5.Image"))); + this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton5.Name = "toolStripButton5"; + this.toolStripButton5.Size = new System.Drawing.Size(23, 22); + this.toolStripButton5.Text = "toolStripButton5"; + // + // toolStripLabel2 + // + this.toolStripLabel2.Name = "toolStripLabel2"; + this.toolStripLabel2.Size = new System.Drawing.Size(86, 22); + this.toolStripLabel2.Text = "toolStripLabel2"; + // + // toolStripButton6 + // + this.toolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton6.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton6.Image"))); + this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton6.Name = "toolStripButton6"; + this.toolStripButton6.Size = new System.Drawing.Size(23, 22); + this.toolStripButton6.Text = "toolStripButton6"; + // + // ilCombo + // + this.ilCombo.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; + this.ilCombo.ImageSize = new System.Drawing.Size(16, 16); + this.ilCombo.TransparentColor = System.Drawing.Color.Transparent; + // + // cbValues + // + this.cbValues.BackColor = System.Drawing.SystemColors.Window; + this.cbValues.FormattingEnabled = true; + this.cbValues.Location = new System.Drawing.Point(699, 215); + this.cbValues.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.cbValues.Name = "cbValues"; + this.cbValues.Size = new System.Drawing.Size(95, 24); + this.cbValues.TabIndex = 5; + this.cbValues.Visible = false; + this.cbValues.SelectedValueChanged += new System.EventHandler(this.cbValues_SelectedValueChanged); + this.cbValues.Leave += new System.EventHandler(this.cbValues_Leave); + // + // lblWidth96 + // + this.lblWidth96.Location = new System.Drawing.Point(103, 287); + this.lblWidth96.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.lblWidth96.Name = "lblWidth96"; + this.lblWidth96.Size = new System.Drawing.Size(128, 22); + this.lblWidth96.TabIndex = 77; + this.lblWidth96.Text = "96"; + this.lblWidth96.Visible = false; + // + // lblWidth330 + // + this.lblWidth330.Location = new System.Drawing.Point(103, 258); + this.lblWidth330.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.lblWidth330.Name = "lblWidth330"; + this.lblWidth330.Size = new System.Drawing.Size(440, 27); + this.lblWidth330.TabIndex = 78; + this.lblWidth330.Text = "330 (Helper Labels for DPI Scaling)"; + this.lblWidth330.Visible = false; + // + // lblWidth16 + // + this.lblWidth16.Location = new System.Drawing.Point(103, 331); + this.lblWidth16.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.lblWidth16.Name = "lblWidth16"; + this.lblWidth16.Size = new System.Drawing.Size(21, 22); + this.lblWidth16.TabIndex = 79; + this.lblWidth16.Text = "16"; + this.lblWidth16.Visible = false; + // + // lblWidth30 + // + this.lblWidth30.Location = new System.Drawing.Point(103, 309); + this.lblWidth30.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.lblWidth30.Name = "lblWidth30"; + this.lblWidth30.Size = new System.Drawing.Size(40, 22); + this.lblWidth30.TabIndex = 80; + this.lblWidth30.Text = "30"; + this.lblWidth30.Visible = false; + // + // lvSettings + // + this.lvSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvSettings.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chSettingID, + this.chSettingValue, + this.chSettingValueHex}); + this.lvSettings.FullRowSelect = true; + this.lvSettings.GridLines = true; + this.lvSettings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.lvSettings.Location = new System.Drawing.Point(16, 63); + this.lvSettings.Margin = new System.Windows.Forms.Padding(5); + this.lvSettings.MultiSelect = false; + this.lvSettings.Name = "lvSettings"; + this.lvSettings.ShowItemToolTips = true; + this.lvSettings.Size = new System.Drawing.Size(1119, 514); + this.lvSettings.SmallImageList = this.ilListView; + this.lvSettings.TabIndex = 2; + this.lvSettings.UseCompatibleStateImageBehavior = false; + this.lvSettings.View = System.Windows.Forms.View.Details; + this.lvSettings.ColumnWidthChanging += new System.Windows.Forms.ColumnWidthChangingEventHandler(this.lvSettings_ColumnWidthChanging); + this.lvSettings.SelectedIndexChanged += new System.EventHandler(this.lvSettings_SelectedIndexChanged); + this.lvSettings.DoubleClick += new System.EventHandler(this.lvSettings_DoubleClick); + this.lvSettings.Resize += new System.EventHandler(this.lvSettings_Resize); + this.lvSettings.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvSettings_KeyDown); + // + // chSettingID + // + this.chSettingID.Text = "SettingID"; + this.chSettingID.Width = 330; + // + // chSettingValue + // + this.chSettingValue.Text = "SettingValue"; + this.chSettingValue.Width = 340; + // + // chSettingValueHex + // + this.chSettingValueHex.Text = "SettingValueHex"; + this.chSettingValueHex.Width = 96; + // + // frmDrvSettings + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1152, 606); + this.Controls.Add(this.lblWidth30); + this.Controls.Add(this.lblWidth16); + this.Controls.Add(this.lblWidth330); + this.Controls.Add(this.lblWidth96); + this.Controls.Add(this.lvSettings); + this.Controls.Add(this.lblApplications); + this.Controls.Add(this.tsMain); + this.Controls.Add(this.pbMain); + this.Controls.Add(this.btnResetValue); + this.Controls.Add(this.cbValues); + this.Margin = new System.Windows.Forms.Padding(5); + this.MinimumSize = new System.Drawing.Size(1167, 417); + this.Name = "frmDrvSettings"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "nSpector - Driver Profile Settings"; + this.Activated += new System.EventHandler(this.frmDrvSettings_Activated); + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmDrvSettings_FormClosed); + this.Load += new System.EventHandler(this.frmDrvSettings_Load); + this.Shown += new System.EventHandler(this.frmDrvSettings_Shown); + this.tsMain.ResumeLayout(false); + this.tsMain.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private ListViewEx lvSettings; + private System.Windows.Forms.ColumnHeader chSettingID; + private System.Windows.Forms.ColumnHeader chSettingValue; + private System.Windows.Forms.ColumnHeader chSettingValueHex; + private System.Windows.Forms.ImageList ilListView; + private System.Windows.Forms.ComboBox cbValues; + private System.Windows.Forms.Button btnResetValue; + private System.Windows.Forms.ProgressBar pbMain; + private System.Windows.Forms.ToolStrip tsMain; + private System.Windows.Forms.ToolStripButton tsbRestoreProfile; + private System.Windows.Forms.ToolStripButton tsbApplyProfile; + private System.Windows.Forms.ToolStripButton tsbRefreshProfile; + private System.Windows.Forms.ToolStripSeparator tsSep3; + private System.Windows.Forms.ToolStripButton tsbBitValueEditor; + private System.Windows.Forms.ToolStripSeparator tsSep6; + private System.Windows.Forms.ToolStripButton tscbShowCustomSettingNamesOnly; + private System.Windows.Forms.ToolStripSeparator tsSep5; + private System.Windows.Forms.ToolStripButton tscbShowScannedUnknownSettings; + private System.Windows.Forms.ToolStripLabel tslProfiles; + private System.Windows.Forms.Label lblApplications; + private System.Windows.Forms.ToolStripButton toolStripButton5; + private System.Windows.Forms.ToolStripLabel toolStripLabel2; + private System.Windows.Forms.ToolStripButton toolStripButton6; + private System.Windows.Forms.ToolStripSeparator tsSep2; + private System.Windows.Forms.ToolStripButton tsbDeleteProfile; + private System.Windows.Forms.ToolStripButton tsbCreateProfile; + private System.Windows.Forms.ToolStripButton tsbAddApplication; + private System.Windows.Forms.ToolStripSplitButton tssbRemoveApplication; + private System.Windows.Forms.ToolStripSeparator tsSep4; + private System.Windows.Forms.ToolStripSplitButton tsbExportProfiles; + private System.Windows.Forms.ToolStripMenuItem exportCurrentProfileOnlyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem exportUserdefinedProfilesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + public System.Windows.Forms.ToolStripComboBox cbProfiles; + private System.Windows.Forms.ToolStripSplitButton tsbModifiedProfiles; + private System.Windows.Forms.ImageList ilCombo; + private System.Windows.Forms.ToolStripMenuItem exportAllProfilesNVIDIATextFormatToolStripMenuItem; + private System.Windows.Forms.ToolStripSplitButton tsbImportProfiles; + private System.Windows.Forms.ToolStripMenuItem importProfilesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem importAllProfilesNVIDIATextFormatToolStripMenuItem; + private System.Windows.Forms.Label lblWidth96; + private System.Windows.Forms.Label lblWidth330; + private System.Windows.Forms.Label lblWidth16; + private System.Windows.Forms.Label lblWidth30; + private System.Windows.Forms.ToolStripMenuItem exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem; + } +} \ No newline at end of file diff --git a/ColorControl/nspector/frmDrvSettings.cs b/ColorControl/nspector/frmDrvSettings.cs new file mode 100644 index 0000000..efd0270 --- /dev/null +++ b/ColorControl/nspector/frmDrvSettings.cs @@ -0,0 +1,1255 @@ +using nspector.Common; +using nspector.Common.Helper; +using nspector.Native.NVAPI2; +using nspector.Native.WINAPI; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace nspector +{ + + internal partial class frmDrvSettings : Form + { + private readonly DrsSettingsMetaService _meta = DrsServiceLocator.MetaService; + private readonly DrsSettingsService _drs = DrsServiceLocator.SettingService; + private readonly DrsScannerService _scanner = DrsServiceLocator.ScannerService; + private readonly DrsImportService _import = DrsServiceLocator.ImportService; + + private List _currentProfileSettingItems = new List(); + private bool _alreadyScannedForPredefinedSettings = false; + private IntPtr _taskbarParent = IntPtr.Zero; + private bool _activated = false; + private bool _isStartup = true; + private bool _skipScan = false; + + private string _baseProfileName = ""; + private bool _isWin7TaskBar = false; + private int _lastComboRowIndex = -1; + private ITaskbarList3 _taskbarList; + + public string _CurrentProfile = ""; + + protected override void WndProc(ref Message m) + { + switch (m.Msg) + { + case MessageHelper.WM_COPYDATA: + MessageHelper.COPYDATASTRUCT copyDataStruct = new MessageHelper.COPYDATASTRUCT(); + Type copyDataType = copyDataStruct.GetType(); + copyDataStruct = (MessageHelper.COPYDATASTRUCT)m.GetLParam(copyDataType); + if (copyDataStruct.lpData.Equals("ProfilesImported")) + { + DrsSessionScope.DestroyGlobalSession(); + RefreshAll(); + } + break; + } + base.WndProc(ref m); + } + + private ListViewGroup FindOrCreateGroup(string groupName) + { + if (string.IsNullOrEmpty(groupName)) + groupName = "Unknown"; + + foreach (ListViewGroup group in lvSettings.Groups) + if (group.Header == groupName) + return group; + + var newGroup = new ListViewGroup(groupName); + lvSettings.Groups.Insert(0, newGroup); + + return newGroup; + } + + private ListViewItem CreateListViewItem(SettingItem setting) + { + var group = FindOrCreateGroup(setting.GroupName); + + var item = new ListViewItem(setting.SettingText); + item.Tag = setting.SettingId; + item.Group = group; + item.SubItems.Add(setting.ValueText); + item.SubItems.Add(setting.ValueRaw); + + switch (setting.State) + { + default: + item.ImageIndex = 1; + item.ForeColor = SystemColors.GrayText; + break; + + case SettingState.NvidiaSetting: + item.ImageIndex = 2; + break; + + case SettingState.GlobalSetting: + item.ImageIndex = 3; + item.ForeColor = SystemColors.GrayText; + break; + + case SettingState.UserdefinedSetting: + item.ImageIndex = 0; + break; + + + } + + return item; + } + + private void RefreshApplicationsCombosAndText(Dictionary applications) + { + lblApplications.Text = ""; + tssbRemoveApplication.DropDownItems.Clear(); + + lblApplications.Text = " " + string.Join(", ", applications.Select(x=>x.Value)); + foreach (var app in applications) + { + var item = tssbRemoveApplication.DropDownItems.Add(app.Value, Properties.Resources.ieframe_1_18212); + item.Tag = app.Key; + } + tssbRemoveApplication.Enabled = (tssbRemoveApplication.DropDownItems.Count > 0); + } + + private SettingViewMode GetSettingViewMode() + { + if (tscbShowCustomSettingNamesOnly.Checked) + return SettingViewMode.CustomSettingsOnly; + else if (tscbShowScannedUnknownSettings.Checked) + return SettingViewMode.IncludeScannedSetttings; + else + return SettingViewMode.Normal; + } + + private void RefreshCurrentProfile() + { + string lvSelection = ""; + if (lvSettings.SelectedItems.Count > 0) + lvSelection = lvSettings.SelectedItems[0].Text; + + lvSettings.BeginUpdate(); + try + { + lvSettings.Items.Clear(); + lvSettings.Groups.Clear(); + var applications = new Dictionary(); + + _currentProfileSettingItems = _drs.GetSettingsForProfile(_CurrentProfile, GetSettingViewMode(), ref applications); + RefreshApplicationsCombosAndText(applications); + + foreach (var settingItem in _currentProfileSettingItems) + { + var itm = lvSettings.Items.Add(CreateListViewItem(settingItem)); + if (Debugger.IsAttached && !settingItem.IsApiExposed) + { + itm.ForeColor = Color.LightCoral; + } + } + + btnResetValue.Enabled = false; + + try + { + lvSettings.RemoveEmbeddedControl(cbValues); + lvSettings.RemoveEmbeddedControl(btnResetValue); + } + catch { } + } + finally + { + lvSettings.EndUpdate(); + ((ListViewGroupSorter)lvSettings).SortGroups(true); + + GC.Collect(); + for (int i = 0; i < lvSettings.Items.Count; i++) + { + if (lvSettings.Items[i].Text == lvSelection) + { + lvSettings.Items[i].Selected = true; + lvSettings.Items[i].EnsureVisible(); + + if (!cbProfiles.Focused) + { + lvSettings.Select(); + cbValues.Text = lvSettings.Items[i].SubItems[1].Text; + } + break; + } + } + } + } + + private void RefreshProfilesCombo() + { + cbProfiles.Items.Clear(); + + var profileNames = _drs.GetProfileNames(ref _baseProfileName); + cbProfiles.Items.AddRange(profileNames.Cast().ToArray()); + + cbProfiles.Sorted = true; + } + + private void MoveComboToItemAndFill() + { + if (lvSettings.SelectedItems.Count > 0) + { + if (!cbValues.ContainsFocus && (_lastComboRowIndex != lvSettings.SelectedItems[0].Index)) + { + btnResetValue.Enabled = true; + + cbValues.BeginUpdate(); + + cbValues.Items.Clear(); + cbValues.Tag = lvSettings.SelectedItems[0].Tag; + uint settingid = (uint)lvSettings.SelectedItems[0].Tag; + + var settingMeta = _meta.GetSettingMeta(settingid, GetSettingViewMode()); + if (settingMeta != null) + { + if (settingMeta.SettingType == Native.NVAPI2.NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE && settingMeta.DwordValues != null) + { + var valueNames = settingMeta.DwordValues.Select(x => x.ValueName).ToList(); + foreach (string v in valueNames) + { + var itm = ""; + if (v.Length > 4000) + itm = v.Substring(0, 4000) + " ..."; + else + itm = v; + + cbValues.Items.Add(itm); + + } + } + + if (settingMeta.SettingType == Native.NVAPI2.NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE && settingMeta.StringValues != null) + { + var valueNames = settingMeta.StringValues.Select(x => x.ValueName).ToList(); + foreach (string v in valueNames) + cbValues.Items.Add(v); + } + + if (settingMeta.SettingType == Native.NVAPI2.NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE && settingMeta.BinaryValues != null) + { + var valueNames = settingMeta.BinaryValues.Select(x => x.ValueName).ToList(); + foreach (string v in valueNames) + cbValues.Items.Add(v); + } + + var scannedCount = settingMeta?.DwordValues? + .Where(x => x.ValueSource == Common.Meta.SettingMetaSource.ScannedSettings) + .Count(); + + tsbBitValueEditor.Enabled = scannedCount > 0; + + } + + if (cbValues.Items.Count < 1) + { + cbValues.Items.Add(""); + cbValues.Items.RemoveAt(0); + } + + + cbValues.Text = lvSettings.SelectedItems[0].SubItems[1].Text; + cbValues.EndUpdate(); + + lvSettings.AddEmbeddedControl(cbValues, 1, lvSettings.SelectedItems[0].Index); + + if (lvSettings.SelectedItems[0].ImageIndex == 0) + lvSettings.AddEmbeddedControl(btnResetValue, 2, lvSettings.SelectedItems[0].Index, DockStyle.Right); + _lastComboRowIndex = lvSettings.SelectedItems[0].Index; + cbValues.Visible = true; + + + + } + } + else + { + _lastComboRowIndex = -1; + + if (!cbValues.ContainsFocus) + { + try + { + lvSettings.RemoveEmbeddedControl(cbValues); + lvSettings.RemoveEmbeddedControl(btnResetValue); + } + catch { } + + btnResetValue.Enabled = false; + cbValues.Visible = false; + + tsbBitValueEditor.Enabled = false; + } + } + } + + private int GetListViewIndexOfSetting(uint settingId) + { + int idx = 0; + foreach (ListViewItem lvi in lvSettings.Items) + { + if (settingId == (uint)lvi.Tag) + { + return idx; + } + idx++; + } + return -1; + } + + private void UpdateItemByComboValue() + { + var settingId = (uint)cbValues.Tag; + var activeImages = new[] { 0, 2 }; + + int idx = GetListViewIndexOfSetting(settingId); + if (idx != -1) + { + var lvItem = lvSettings.Items[idx]; + + var settingMeta = _meta.GetSettingMeta(settingId, GetSettingViewMode()); + + var currentProfileItem = _currentProfileSettingItems + .First(x => x.SettingId.Equals(settingId)); + + var cbValueText = cbValues.Text.Trim(); + + var valueHasChanged = currentProfileItem.ValueText != cbValueText; + if (settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE) + { + var stringBehind = DrsUtil.ParseStringSettingValue(settingMeta, cbValueText); + valueHasChanged = currentProfileItem.ValueRaw != stringBehind; + } + + if (valueHasChanged || activeImages.Contains(lvItem.ImageIndex)) + { + lvItem.ForeColor = SystemColors.ControlText; + } + else + { + lvItem.ForeColor = SystemColors.GrayText; + } + + if (settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE) + { + lvItem.SubItems[2].Text = DrsUtil.GetDwordString(DrsUtil.ParseDwordSettingValue(settingMeta, cbValueText)); + lvItem.SubItems[1].Text = cbValueText; + } + else if (settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE) + { + lvItem.SubItems[2].Text = DrsUtil.ParseStringSettingValue(settingMeta, cbValueText); // DrsUtil.StringValueRaw; + lvItem.SubItems[1].Text = cbValueText; + } + else if (settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE) + { + lvItem.SubItems[2].Text = DrsUtil.GetBinaryString(DrsUtil.ParseBinarySettingValue(settingMeta, cbValueText)); // DrsUtil.StringValueRaw; + lvItem.SubItems[1].Text = cbValueText; + } + + } + } + + private void StoreChangesOfProfileToDriver() + { + + var settingsToStore = new List>(); + + foreach (ListViewItem lvi in lvSettings.Items) + { + var currentProfileItem = _currentProfileSettingItems + .First(x => x.SettingId.Equals((uint)lvi.Tag)); + + var listValueX = lvi.SubItems[1].Text; + + var itmEmpty = string.IsNullOrEmpty(listValueX); + var curEmpty = string.IsNullOrEmpty(currentProfileItem.ValueText); + + if (currentProfileItem.ValueText != listValueX && !(itmEmpty && curEmpty)) + { + settingsToStore.Add(new KeyValuePair((uint)lvi.Tag, listValueX)); + } + + } + + if (settingsToStore.Count > 0) + { + _drs.StoreSettingsToProfile(_CurrentProfile, settingsToStore); + AddToModifiedProfiles(_CurrentProfile); + } + + RefreshCurrentProfile(); + } + + private void ResetCurrentProfile() + { + bool removeFromModified = false; + _drs.ResetProfile(_CurrentProfile, out removeFromModified); + + if (removeFromModified) + { + RemoveFromModifiedProfiles(_CurrentProfile); + } + RefreshCurrentProfile(); + } + + private void ResetSelectedValue() + { + if (lvSettings.SelectedItems != null && lvSettings.SelectedItems.Count > 0) + { + var settingId = (uint)lvSettings.SelectedItems[0].Tag; + + bool removeFromModified; + _drs.ResetValue(_CurrentProfile, settingId, out removeFromModified); + + if (removeFromModified) + RemoveFromModifiedProfiles(_CurrentProfile); + + RefreshCurrentProfile(); + } + } + + private void InitTaskbarList() + { + if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 1) + { + try + { + _taskbarList = (ITaskbarList3)new TaskbarList(); + _taskbarList.HrInit(); + _taskbarParent = this.Handle; + _isWin7TaskBar = true; + } + catch + { + _taskbarList = null; + _taskbarParent = IntPtr.Zero; + _isWin7TaskBar = false; + } + } + } + + private void SetTaskbarIcon() + { + if (_taskbarList != null && _isWin7TaskBar && AdminHelper.IsAdmin) + { + try + { + _taskbarList.SetOverlayIcon(_taskbarParent, Properties.Resources.shield16.Handle, "Elevated"); + } + catch { } + } + } + + private void SetTitleVersion() + { + var numberFormat = new NumberFormatInfo() { NumberDecimalSeparator = "." }; + var version = Assembly.GetExecutingAssembly().GetName().Version; + var fileVersionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); + Text = $"{Application.ProductName} {version} - Geforce {_drs.DriverVersion.ToString("#.00", numberFormat)} - Profile Settings - {fileVersionInfo.LegalCopyright}"; + } + + private static void InitMessageFilter(IntPtr handle) + { + if ((Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 1)) + { + DragAcceptNativeHelper.ChangeWindowMessageFilterEx(handle, DragAcceptNativeHelper.WM_DROPFILES, DragAcceptNativeHelper.MSGFLT_ALLOW, IntPtr.Zero); + DragAcceptNativeHelper.ChangeWindowMessageFilterEx(handle, DragAcceptNativeHelper.WM_COPYDATA, DragAcceptNativeHelper.MSGFLT_ALLOW, IntPtr.Zero); + DragAcceptNativeHelper.ChangeWindowMessageFilterEx(handle, DragAcceptNativeHelper.WM_COPYGLOBALDATA, DragAcceptNativeHelper.MSGFLT_ALLOW, IntPtr.Zero); + } + else if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 0) + { + DragAcceptNativeHelper.ChangeWindowMessageFilter(DragAcceptNativeHelper.WM_DROPFILES, DragAcceptNativeHelper.MSGFLT_ADD); + DragAcceptNativeHelper.ChangeWindowMessageFilter(DragAcceptNativeHelper.WM_COPYDATA, DragAcceptNativeHelper.MSGFLT_ADD); + DragAcceptNativeHelper.ChangeWindowMessageFilter(DragAcceptNativeHelper.WM_COPYGLOBALDATA, DragAcceptNativeHelper.MSGFLT_ADD); + } + } + + internal frmDrvSettings() : this(false, false) { } + internal frmDrvSettings(bool showCsnOnly, bool skipScan) + { + _skipScan = skipScan; + InitializeComponent(); + InitTaskbarList(); + SetupDropFilesNative(); + SetupToolbar(); + SetupDpiAdjustments(); + + tscbShowCustomSettingNamesOnly.Checked = showCsnOnly; + Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); + } + + private void SetupDpiAdjustments() + { + chSettingID.Width = lblWidth330.Width; + chSettingValueHex.Width = lblWidth96.Width; + } + + private void SetupToolbar() + { + tsMain.Renderer = new NoBorderRenderer(); + tsMain.ImageScalingSize = new Size(lblWidth16.Width, lblWidth16.Width); + } + + private void SetupDropFilesNative() + { + lvSettings.OnDropFilesNative += new DropFilesNativeHandler(lvSettings_OnDropFilesNative); + DragAcceptNativeHelper.DragAcceptFiles(this.Handle, true); + DragAcceptNativeHelper.DragAcceptFiles(lvSettings.Handle, true); + InitMessageFilter(lvSettings.Handle); + } + + private void SetupLayout() + { + if (Screen.GetWorkingArea(this).Height < Height + 10) + { + Height = Screen.GetWorkingArea(this).Height - 20; + } + } + + private void RefreshModifiesProfilesDropDown() + { + tsbModifiedProfiles.DropDownItems.Clear(); + _scanner.ModifiedProfiles.Sort(); + foreach (string modProfile in _scanner.ModifiedProfiles) + if (modProfile != _baseProfileName) + { + var newItem = tsbModifiedProfiles.DropDownItems.Add(modProfile); + if (!_scanner.UserProfiles.Contains(modProfile)) + { + newItem.Image = tsbRestoreProfile.Image; + } + } + + if (tsbModifiedProfiles.DropDownItems.Count > 0) + tsbModifiedProfiles.Enabled = true; + } + + private void frmDrvSettings_Load(object sender, EventArgs e) + { + SetupLayout(); + SetTitleVersion(); + LoadSettings(); + + RefreshProfilesCombo(); + cbProfiles.Text = GetBaseProfileName(); + + tsbBitValueEditor.Enabled = false; + tsbDeleteProfile.Enabled = false; + tsbAddApplication.Enabled = false; + tssbRemoveApplication.Enabled = false; + + InitResetValueTooltip(); + } + + private void InitResetValueTooltip() + { + var toolTip = new ToolTip(); + toolTip.SetToolTip(btnResetValue, "Restore this value to NVIDIA defaults."); + } + + private void lvSettings_SelectedIndexChanged(object sender, EventArgs e) + { + MoveComboToItemAndFill(); + } + + private void cbValues_SelectedValueChanged(object sender, EventArgs e) + { + UpdateItemByComboValue(); + } + + private void cbValues_Leave(object sender, EventArgs e) + { + UpdateItemByComboValue(); + } + + private void btnResetValue_Click(object sender, EventArgs e) + { + ResetSelectedValue(); + } + + private void ChangeCurrentProfile(string profileName) + { + if (profileName == GetBaseProfileName() || profileName == _baseProfileName) + { + _CurrentProfile = _baseProfileName; + cbProfiles.Text = GetBaseProfileName(); + tsbDeleteProfile.Enabled = false; + tsbAddApplication.Enabled = false; + tssbRemoveApplication.Enabled = false; + } + else + { + _CurrentProfile = cbProfiles.Text; + tsbDeleteProfile.Enabled = true; + tsbAddApplication.Enabled = true; + tssbRemoveApplication.Enabled = true; + } + + + RefreshCurrentProfile(); + } + + private void cbProfiles_SelectedIndexChanged(object sender, EventArgs e) + { + if (cbProfiles.SelectedIndex > -1) + { + ChangeCurrentProfile(cbProfiles.Text); + } + } + + private void SetTaskbarProgress(int progress) + { + if (_isWin7TaskBar) + { + try + { + if (progress == 0) + _taskbarList.SetProgressState(_taskbarParent, TBPFLAG.TBPF_NOPROGRESS); + else + { + _taskbarList.SetProgressState(_taskbarParent, TBPFLAG.TBPF_NORMAL); + _taskbarList.SetProgressValue(_taskbarParent, (ulong)progress, 100); + } + } + catch { } + } + } + + private void AddToModifiedProfiles(string profileName, bool userProfile = false) + { + if (!_scanner.UserProfiles.Contains(profileName) && profileName != _baseProfileName && userProfile) + { + _scanner.UserProfiles.Add(profileName); + } + + if (!_scanner.ModifiedProfiles.Contains(profileName) && profileName != _baseProfileName) + { + _scanner.ModifiedProfiles.Add(profileName); + RefreshModifiesProfilesDropDown(); + } + } + + private void RemoveFromModifiedProfiles(string profileName) + { + if (_scanner.UserProfiles.Contains(profileName)) + { + _scanner.UserProfiles.Remove(profileName); + } + + if (_scanner.ModifiedProfiles.Contains(profileName)) + { + _scanner.ModifiedProfiles.Remove(profileName); + RefreshModifiesProfilesDropDown(); + } + } + + private void ShowExportProfiles() + { + if (_scanner.ModifiedProfiles.Count > 0) + { + var frmExport = new frmExportProfiles(); + frmExport.ShowDialog(this); + } + else + MessageBox.Show("No user modified profiles found! Nothing to export.", "Userprofile Search", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + private CancellationTokenSource _scannerCancelationTokenSource; + + private async Task ScanProfilesSilentAsync(bool scanPredefined, bool showProfileDialog) + { + if (_skipScan) + { + + if (scanPredefined && !_alreadyScannedForPredefinedSettings) + { + _alreadyScannedForPredefinedSettings = true; + _meta.ResetMetaCache(); + tsbModifiedProfiles.Enabled = true; + exportUserdefinedProfilesToolStripMenuItem.Enabled = false; + RefreshCurrentProfile(); + } + + return; + } + + tsbModifiedProfiles.Enabled = false; + tsbRefreshProfile.Enabled = false; + pbMain.Minimum = 0; + pbMain.Maximum = 100; + + _scannerCancelationTokenSource = new CancellationTokenSource(); + + var progressHandler = new Progress(value => + { + pbMain.Value = value; + SetTaskbarProgress(value); + }); + + if (scanPredefined && !_alreadyScannedForPredefinedSettings) + { + _alreadyScannedForPredefinedSettings = true; + await _scanner.ScanProfileSettingsAsync(false, progressHandler, _scannerCancelationTokenSource.Token); + _meta.ResetMetaCache(); + tscbShowScannedUnknownSettings.Enabled = true; + } + else + { + await _scanner.ScanProfileSettingsAsync(true, progressHandler, _scannerCancelationTokenSource.Token); + } + + RefreshModifiesProfilesDropDown(); + tsbModifiedProfiles.Enabled = true; + + pbMain.Value = 0; + pbMain.Enabled = false; + SetTaskbarProgress(0); + + if (showProfileDialog) + { + ShowExportProfiles(); + } + + RefreshCurrentProfile(); + tsbRefreshProfile.Enabled = true; + } + + private void cbCustomSettingsOnly_CheckedChanged(object sender, EventArgs e) + { + RefreshCurrentProfile(); + } + + internal void SetSelectedDwordValue(uint dwordValue) + { + if (lvSettings.SelectedItems != null & lvSettings.SelectedItems.Count > 0) + { + cbValues.Text = DrsUtil.GetDwordString(dwordValue); ; + UpdateItemByComboValue(); + } + } + + private async void tsbRestoreProfile_Click(object sender, EventArgs e) + { + if (Control.ModifierKeys == Keys.Control) + { + if (MessageBox.Show(this, + "Restore all profiles to NVIDIA driver defaults?", + "Restore all profiles", + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + _drs.ResetAllProfilesInternal(); + + RefreshProfilesCombo(); + RefreshCurrentProfile(); + await ScanProfilesSilentAsync(true, false); + cbProfiles.Text = GetBaseProfileName(); + } + } + else + ResetCurrentProfile(); + } + + private void tsbRefreshProfile_Click(object sender, EventArgs e) + { + DrsSessionScope.DestroyGlobalSession(); + RefreshAll(); + } + + private void tsbApplyProfile_Click(object sender, EventArgs e) + { + try + { + UpdateItemByComboValue(); + } + catch { } + + StoreChangesOfProfileToDriver(); + } + + private void tsbBitValueEditor_Click(object sender, EventArgs e) + { + if (lvSettings.SelectedItems != null & lvSettings.SelectedItems.Count > 0) + { + var frmBits = new frmBitEditor(); + frmBits.ShowDialog(this, + (uint)lvSettings.SelectedItems[0].Tag, + uint.Parse(lvSettings.SelectedItems[0].SubItems[2].Text.Substring(2), NumberStyles.AllowHexSpecifier), + lvSettings.SelectedItems[0].Text); + } + } + + private void tscbShowScannedUnknownSettings_Click(object sender, EventArgs e) + { + RefreshCurrentProfile(); + } + + private void lvSettings_Resize(object sender, EventArgs e) + { + ResizeColumn(); + } + + private void ResizeColumn() + { + lvSettings.Columns[1].Width = lvSettings.Width - (lvSettings.Columns[0].Width + lvSettings.Columns[2].Width + lblWidth30.Width); + } + + private void lvSettings_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e) + { + if (e.ColumnIndex != 1) + { + + if (e.ColumnIndex == 0 && e.NewWidth < 260) + { + e.NewWidth = 260; + e.Cancel = true; + } + else if (e.ColumnIndex == 2 && e.NewWidth < 96) + { + e.Cancel = true; + e.NewWidth = 96; + } + + ResizeColumn(); + } + } + + private async void frmDrvSettings_Shown(object sender, EventArgs e) + { + if (_isStartup) + { + new Thread(SetTaskbarIcon).Start(); + await ScanProfilesSilentAsync(true, false); + + if (_scannerCancelationTokenSource != null && !_scannerCancelationTokenSource.Token.IsCancellationRequested && WindowState != FormWindowState.Maximized) + { + new MessageHelper().bringAppToFront((int)this.Handle); + } + _isStartup = false; + } + } + + private void tsbDeleteProfile_Click(object sender, EventArgs e) + { + if (Control.ModifierKeys == Keys.Control) + { + if (MessageBox.Show(this, "Really delete all profiles?", "Delete all profiles", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + { + _drs.DeleteAllProfilesHard(); + ChangeCurrentProfile(_baseProfileName); + DrsSessionScope.DestroyGlobalSession(); + RefreshAll(); + } + } + else if (MessageBox.Show(this, "Really delete this profile?\r\n\r\nNote: NVIDIA predefined profiles can not be restored until next driver installation!", "Delete Profile", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + { + if (_drs.DriverVersion > 280 && _drs.DriverVersion < 310) + // hack for driverbug + _drs.DeleteProfileHard(_CurrentProfile); + else + _drs.DeleteProfile(_CurrentProfile); + + RemoveFromModifiedProfiles(_CurrentProfile); + MessageBox.Show(this, string.Format("Profile '{0}' has been deleted.", _CurrentProfile), "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); + RefreshProfilesCombo(); + ChangeCurrentProfile(_baseProfileName); + } + } + + private void tsbAddApplication_Click(object sender, EventArgs e) + { + var openDialog = new OpenFileDialog(); + openDialog.DefaultExt = "*.exe"; + openDialog.Filter = "Application EXE Name|*.exe|Application Absolute Path|*.exe"; + + if (openDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + string applicationName = new FileInfo(openDialog.FileName).Name; + if (openDialog.FilterIndex == 2) + applicationName = openDialog.FileName; + + try + { + _drs.AddApplication(_CurrentProfile, applicationName); + } + catch (NvapiException ex) + { + if (ex.Status == Native.NVAPI2.NvAPI_Status.NVAPI_EXECUTABLE_ALREADY_IN_USE || ex.Status == Native.NVAPI2.NvAPI_Status.NVAPI_ERROR) + { + if (lblApplications.Text.ToUpper().IndexOf(" " + applicationName.ToUpper() + ",") != -1) + MessageBox.Show("This application executable is already assigned to this profile!", + "Error adding Application", MessageBoxButtons.OK, MessageBoxIcon.Error); + else + { + string profileNames = _scanner.FindProfilesUsingApplication(applicationName); + if (profileNames == "") + MessageBox.Show("This application executable might already be assigned to another profile!", + "Error adding Application", MessageBoxButtons.OK, MessageBoxIcon.Error); + else + MessageBox.Show( + "This application executable is already assigned to the following profiles: " + + profileNames, "Error adding Application", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + else + throw; + } + } + RefreshCurrentProfile(); + } + + private void tssbRemoveApplication_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + //if ((uint)e.ClickedItem.Tag == 0 + // || ( + // (uint)e.ClickedItem.Tag == 1 + // && + // MessageBox.Show(this, + // "Do you really want to delete this NVIDIA predefined application executeable?\r\n\r\nNote: This can not be restored until next driver installation!", + // "Delete Application", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + // ) + //{ + // drs.DeleteApplication(currentProfile, e.ClickedItem.Text); + //} + _drs.RemoveApplication(_CurrentProfile, e.ClickedItem.Tag.ToString()); + RefreshCurrentProfile(); + } + + private void tsbCreateProfile_Click(object sender, EventArgs e) + { + ShowCreateProfileDialog(""); + } + + private void ShowCreateProfileDialog(string nameProposal, string applicationName = null) + { + var ignoreList = cbProfiles.Items.Cast().ToList(); + string result = nameProposal; + + if (InputBox.Show("Create Profile", "Please enter profile name:", ref result, ignoreList, "", 2048) == System.Windows.Forms.DialogResult.OK) + { + try + { + _drs.CreateProfile(result, applicationName); + RefreshProfilesCombo(); + cbProfiles.SelectedIndex = cbProfiles.Items.IndexOf(result); + AddToModifiedProfiles(result, true); + } + catch (NvapiException ex) + { + //TODO: could not create profile + MessageBox.Show(ex.Message); + } + } + } + + private void tsbExportProfiles_Click(object sender, EventArgs e) + { + tsbExportProfiles.ShowDropDown(); + } + + private void tsbImportProfiles_Click(object sender, EventArgs e) + { + tsbImportProfiles.ShowDropDown(); + } + + private async void exportUserdefinedProfilesToolStripMenuItem_Click(object sender, EventArgs e) + { + await ScanProfilesSilentAsync(false, true); + } + + private void ExportCurrentProfile(bool includePredefined) + { + var saveDialog = new SaveFileDialog(); + saveDialog.DefaultExt = "*.nip"; + saveDialog.Filter = Application.ProductName + " Profiles|*.nip"; + saveDialog.FileName = _CurrentProfile + ".nip"; + if (saveDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + var profiles = new[] { _CurrentProfile }.ToList(); + _import.ExportProfiles(profiles, saveDialog.FileName, includePredefined); + } + } + + private void exportCurrentProfileOnlyToolStripMenuItem_Click(object sender, EventArgs e) + { + ExportCurrentProfile(false); + } + + private void exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem_Click(object sender, EventArgs e) + { + ExportCurrentProfile(true); + } + + private void tssbRemoveApplication_Click(object sender, EventArgs e) + { + if (tssbRemoveApplication.DropDown.Items.Count > 0) + tssbRemoveApplication.ShowDropDown(); + } + + private void tsbModifiedProfiles_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + cbProfiles.SelectedIndex = cbProfiles.FindStringExact(e.ClickedItem.Text); + } + + private string GetBaseProfileName() + { + return string.Format("_GLOBAL_DRIVER_PROFILE ({0})", _baseProfileName); + } + + private void tsbModifiedProfiles_ButtonClick(object sender, EventArgs e) + { + ChangeCurrentProfile(GetBaseProfileName()); + } + + private void frmDrvSettings_Activated(object sender, EventArgs e) + { + if (!_activated) + _activated = true; + } + + private void exportAllProfilesNVIDIATextFormatToolStripMenuItem_Click(object sender, EventArgs e) + { + var saveDialog = new SaveFileDialog(); + saveDialog.DefaultExt = "*.txt"; + saveDialog.Filter = "Profiles (NVIDIA Text Format)|*.txt"; + if (saveDialog.ShowDialog() == DialogResult.OK) + { + _import.ExportAllProfilesToNvidiaTextFile(saveDialog.FileName); + } + } + + private async void RefreshAll() + { + RefreshProfilesCombo(); + await ScanProfilesSilentAsync(true, false); + + int idx = cbProfiles.Items.IndexOf(_CurrentProfile); + if (idx == -1 || _CurrentProfile == _baseProfileName) + cbProfiles.Text = GetBaseProfileName(); + else + cbProfiles.SelectedIndex = idx; + + RefreshCurrentProfile(); + } + + private void importAllProfilesNVIDIATextFormatToolStripMenuItem_Click(object sender, EventArgs e) + { + var openDialog = new OpenFileDialog(); + openDialog.DefaultExt = "*.txt"; + openDialog.Filter = "Profiles (NVIDIA Text Format)|*.txt"; + if (openDialog.ShowDialog() == DialogResult.OK) + { + try + { + _import.ImportAllProfilesFromNvidiaTextFile(openDialog.FileName); + MessageBox.Show("Profile(s) successfully imported!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); + DrsSessionScope.DestroyGlobalSession(); + RefreshAll(); + } + catch (NvapiException) + { + MessageBox.Show("Profile(s) could not imported!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void importProfilesToolStripMenuItem_Click(object sender, EventArgs e) + { + var openDialog = new OpenFileDialog(); + openDialog.DefaultExt = "*.nip"; + openDialog.Filter = Application.ProductName + " Profiles|*.nip"; + if (openDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + ImportProfiles(openDialog.FileName); + } + } + + private void cbProfiles_TextChanged(object sender, EventArgs e) + { + if (cbProfiles.DroppedDown) + { + string txt = cbProfiles.Text; + cbProfiles.DroppedDown = false; + cbProfiles.Text = txt; + cbProfiles.Select(cbProfiles.Text.Length, 0); + } + } + + + public static void ShowImportDoneMessage(string importReport) + { + if (string.IsNullOrEmpty(importReport)) + { + MessageBox.Show("Profile(s) successfully imported!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + MessageBox.Show("Some profile(s) could not imported!\r\n\r\n" + importReport, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } + + private void ImportProfiles(string nipFileName) + { + var importReport = _import.ImportProfiles(nipFileName); + RefreshAll(); + ShowImportDoneMessage(importReport); + } + + private void lvSettings_OnDropFilesNative(string[] files) + { + if (files.Length == 1) + { + var fileInfo = new FileInfo(files[0]); + if (fileInfo.Extension.ToLower().Equals(".nip")) + { + ImportProfiles(fileInfo.FullName); + return; + } + + + var profileName = ""; + var exeFile = ShortcutResolver.ResolveExecuteable(files[0], out profileName); + if (exeFile != "") + { + var profiles = _scanner.FindProfilesUsingApplication(exeFile); + if (profiles != "") + { + var profile = profiles.Split(';')[0]; + var idx = cbProfiles.Items.IndexOf(profile); + if (idx > -1) + { + cbProfiles.SelectedIndex = idx; + } + } + else + { + var dr = MessageBox.Show("Would you like to create a new profile for this application?", "Profile not found!", MessageBoxButtons.YesNo); + if (dr == DialogResult.Yes) + { + ShowCreateProfileDialog(profileName, exeFile); + } + + } + } + } + } + + private void lvSettings_DoubleClick(object sender, EventArgs e) + { + if (Debugger.IsAttached && lvSettings.SelectedItems != null && lvSettings.SelectedItems.Count == 1) + { + var settingId = ((uint)lvSettings.SelectedItems[0].Tag); + var settingName = lvSettings.SelectedItems[0].Text; + Clipboard.SetText(string.Format($"0x{settingId:X8} {settingName}")); + } + } + + private void HandleScreenConstraints() + { + var workingArea = Screen.GetWorkingArea(this); + + if (Left < workingArea.X) + Left = workingArea.X; + + if (Top < workingArea.Y) + Top = workingArea.Y; + + if ((Left + Width) > workingArea.X + workingArea.Width) + Left = (workingArea.X + workingArea.Width) - Width; + + if ((Top + Height) > workingArea.Y + workingArea.Height) + Top = (workingArea.Y + workingArea.Height) - Height; + } + + private void SaveSettings() + { + var settings = UserSettings.LoadSettings(); + + if (WindowState == FormWindowState.Normal) + { + settings.WindowTop = Top; + settings.WindowLeft = Left; + settings.WindowHeight = Height; + settings.WindowWidth = Width; + } + else + { + settings.WindowTop = RestoreBounds.Top; + settings.WindowLeft = RestoreBounds.Left; + settings.WindowHeight = RestoreBounds.Height; + settings.WindowWidth = RestoreBounds.Width; + } + settings.WindowState = WindowState; + settings.ShowCustomizedSettingNamesOnly = tscbShowCustomSettingNamesOnly.Checked; + settings.ShowScannedUnknownSettings = tscbShowScannedUnknownSettings.Checked; + settings.SaveSettings(); + } + + private void LoadSettings() + { + var settings = UserSettings.LoadSettings(); + SetBounds(settings.WindowLeft, settings.WindowTop, settings.WindowWidth, settings.WindowHeight); + WindowState = settings.WindowState != FormWindowState.Minimized ? settings.WindowState : FormWindowState.Normal; + HandleScreenConstraints(); + tscbShowCustomSettingNamesOnly.Checked = settings.ShowCustomizedSettingNamesOnly; + tscbShowScannedUnknownSettings.Checked = !_skipScan && settings.ShowScannedUnknownSettings; + } + + private void frmDrvSettings_FormClosed(object sender, FormClosedEventArgs e) + { + _scannerCancelationTokenSource?.Cancel(); + SaveSettings(); + } + + private void lvSettings_KeyDown(object sender, KeyEventArgs e) + { + if (e.Control && e.KeyCode == Keys.C) + { + CopyModifiedSettingsToClipBoard(); + } + } + + private void CopyModifiedSettingsToClipBoard() + { + var sbSettings = new StringBuilder(); + sbSettings.AppendFormat("{0,-40} {1}\r\n", "### NVIDIA Profile Inspector ###", _CurrentProfile); + + foreach (ListViewGroup group in lvSettings.Groups) + { + bool groupTitleAdded = false; + foreach (ListViewItem item in group.Items) + { + if (item.ImageIndex != 0) continue; + + if(!groupTitleAdded) + { + sbSettings.AppendFormat("\r\n[{0}]\r\n", group.Header); + groupTitleAdded = true; + } + sbSettings.AppendFormat("{0,-40} {1}\r\n", item.Text, item.SubItems[1].Text); + } + } + + Clipboard.SetText(sbSettings.ToString()); + + } + } +} + + + + + diff --git a/ColorControl/nspector/frmDrvSettings.resx b/ColorControl/nspector/frmDrvSettings.resx new file mode 100644 index 0000000..effbd0a --- /dev/null +++ b/ColorControl/nspector/frmDrvSettings.resx @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 115, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADI + DAAAAk1TRnQBSQFMAgEBBAEAAagBBwGoAQcBEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA + AwABIAMAAQEBAAEYBgABGP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/ADMAAcgBvQGvAacBkQF5BgAD/iEA + A+QD2gYAA/4hAAGXAcMBqwFMAZwBcAYAA/4hAAOmA2gGAAP+FQAB8gHxAfABqQGPAXQBzwHHAbwD/wG6 + AaUBjAGuAZQBeAHxAe8B7QHvAe0B6wGhAYgBbQHkAeAB2xIAA/UD3QPmA/8D4APeA/QD8wPaA+4SAAHt + AfIB7wE3AaEBZgGlAcwBtwP/AVgBsQGAATUBpgFoAekB8AHsAecB7wHqATwBlQFkAdQB4gHaEgAD7gNi + A7UD/wN6A2QD7APqA1oD2BIAAfMB8QHvAbwBoQGGAb4BogGHAb4BpQGIAbsBogGFAbwBogGEAagBlQGB + Aa0BlgF/Aa4BkgF3AegB5QHhEgAD9QnjBuIJ3gPwEgAB6wHyAe4BOgG1AXEBPAG2AXQBPgG3AXMBOgG1 + AXEBOgG1AXEBNwGmAWoBOAGoAWsBNAGkAWcB2QHnAd8SAAPuA3MDdgN0A3EDbwNxA20DZAPeDAAB9AHz + AfIB7wHsAekB6AHiAdwByQGyAZcB0wHCAa4BzgG8AaYBzAG6AaUBzAG5AaMBywG3AaIBygG3AaIBvgGn + AY8BxgG1AaMB5AHgAdsB4wHeAdoD/wMAA/YD8wPvA+cD7AbqCekG5AbuA/8DAAHvAfQB8QHiAe4B5wHM + AeYB1wFCAcMBfAFUAckBiQFOAccBhQFLAcYBggFLAcYBggFJAcUBgQFJAcUBgQE8AbsBdQF7Ab8BmgHT + AeIB2gHTAeAB2QP/AwAD8QPnA9cDhAOgA5cDlgmTA34DlgPYA9cD/wMAAcYBswGdAb4BqAGPAcwBtQGa + AdMBvwGrAdUBxQGyAccBsAGXAcMBrAGNAb8BpgGMAb8BpwGMAcUBrwGXAcYBswGdAbsBowGJAaIBiwFx + AY0BcwFXAeEB3QHYAwAD5QPkA+gD7APtA+cD5APiA+QG5wPjA9sD1APtAwABXQHCAYoBPAG7AXUBSAHE + AYEBVAHJAYkBWAHKAYsBQgHDAXwBQAG+AXgBQAG5AXYBOwG5AXQBQAHCAXsBQwHDAX0BOgG2AXIBMQGb + AWEBLAGAAVEB0QHeAdcDAAOOA30DhwOdA6UDhQN3A3gDeQOGA40DdwNfA0MD1QMAAekB5AHeAcYBrgGU + AdUBxAGtAc0BuQGlAcoBsAGYAeUB3gHXAfgB9wH2A/oB6AHiAdwBwQGpAY4BwAGoAY4BxAGuAZUBsQGZ + AYABzwHGAb0D+wMAA+8D5gPsA+oD5gPtA/kD+wPvBuQD5gPgA+cD/AMAAc4B5wHaAUABwgF8AVUByQGJ + AUwBxgGDAUcBxAF/AcMB4wHRAfQB9wH2AfkC+gHOAeYB2QFFAbkBeQE8AbwBdgE9AcEBeQE3AawBbAGt + AcsBuwH6AvsDAAPZA4IDnQOXA4YD0QP2A/oD2AN6A3wDgwNuA7YD+wMAAfcB9gH1AcgBsAGVAd4BzAG2 + AcsBtQGcAdQByQG6DAAB4gHdAdoBtwGgAY4BwwGwAaEBpQGSAYAB8AHuAewGAAP4A+cD7wboDAAD7gPj + A+gD3gPzBgAB8gH2AfQBQgHCAX0BYAHNAZEBRgHEAX8BmgHRAbMMAAHIAeMB1AE6AbYBcgFFAcQBfgE2 + AaMBaAHnAe8B6gYAA/QDggOnA4oDsQwAA9gDgQOWA3ID6gMAAc0BuQGiAcsBtAGZAeMBzQG3AecB1gHD + AbsBoQGFA/oMAAP6Ab8BpgGMAcwBuQGjAbwBogGEAa4BlAF4AacBkQF5A+cD6APwA/ID4QP7DAAD+wPi + A+kD4gPeA9oBXgHJAY4BRQHEAX4BYwHOAZMBbAHQAZkBPAG0AXMB+QL6DAAB+QL6AUABuQF2AUsBxgGC + AToBtQFxATUBpgFoAUwBnAFwA5IDhgOnA7YDcwP5DAAD+gN4A5MDbwNkA2gB1wHJAbgBzwG4AaIB5gHR + Ab0B7AHbAcoBugGhAYUC+QH4DAAB+AH3AfYBwwGsAY0BzAG6AaUBuwGiAYUBugGlAYwByAG9Aa8D6QPn + A/ED9APhA/oMAAP5A+QD6gPiA+AD5AGKAdMBqwFXAccBigFoAc8BlgFyAdIBnQE8AbIBcAH4AfkB+AwA + AfQB9wH2AUABvgF4AUsBxgGCAToBtQFxAVgBsQGAAZcBwwGrA6wDkgOvA74DcQP4DAAD9gN3A5YDcQN6 + A6YDAAP7AdwByQGzAewB3AHLAccBswGaAc4BxAG5DAAB5QHeAdcBxwGwAZcBzgG8AaYBvgGlAYgD/wYA + A/sD7QP0A+cD5QwAA+0D5wPqA+MD/wYAAfoC+wFeAcwBjwFyAdIBnQFCAcMBfAGoAckBtgwAAcMB4wHR + AUIBwwF8AU4BxwGFAT4BtwFzA/8GAAP7A6MDvwOIA7IMAAPRA4UDlwN0A/8GAAHxAe8B7AHZAcQBrQHv + Ad8BzgHfAc0BuwG2AaEBhQHOAcQBuQL5AfgD+gHUAckBugHKAbABmAHVAcUBsgHTAcIBrgG+AaIBhwHP + AccBvAYAA/QD7QP1A/AD4QPlA/oD+wPoA+YD7QPsA+MD5gYAAeUB8QHqAVkBygGNAXcB1AGhAWMBzgGT + ATwBsQFwAagByQG2AfgB+QH4AfkC+gGaAdEBswFHAcQBfwFYAcoBiwFUAckBiQE8AbYBdAGlAcwBtwYA + A+oDmwPCA64DcQOyA/gD+QOxA4YDpQOgA3YDtQYAAdYBxgGyAdABuAGdAdsBxQGwAfIB4gHSAeABzwG8 + AccBswGaAboBoQGFAbsBoQGFAcsBtQGcAc0BuQGlAdMBvwGrAckBsgGXAbwBoQGGAakBjwF0BgAD6APp + A+wD9gPwA+cG4QPoA+oD7APnA+MD3QYAAXsB0QGhAUkBxQGBAV0BywGOAXsB1QGkAWQBzgGUAUIBwwF8 + ATwBsgFwATwBtAFzAUYBxAF/AUwBxgGDAVQByQGJAUIBwwF8AToBtQFxATcBoQFmBgADowOKA6ADxwOv + A4gDcQNzA4oDlwOdA4QDcwNiBgAB8wHxAe8B8AHtAeoB8QHuAesB4gHOAboB7gHfAc0B7AHcAcsB7AHb + AcoB5wHWAcMB3gHMAbYB1QHEAa0BzAG1AZoB6AHiAdwB8wHxAe8B8gHxAfAGAAP1A/ID8wPwA/UG9APy + A+8D7APoA+8G9QYAAeoB8wHuAeEB7wHnAeMB8AHoAWQBzgGUAXUB0wGfAXIB0gGdAXIB0gGdAWwB0AGZ + AWABzQGRAVUByQGJAUgBxAGBAcwB5gHXAesB8gHuAe0B8gHvBgAD7gPoA+kDrAPAA78DvgO2A6cDnQOH + A9cG7gwAAfQB8wHxAdUBwAGnAdkBwwGqAdwByQGzAeYB0QG9AeMBzQG3AcgBsAGVAcYBrgGUAb4BqAGP + Ae8B7AHpEgAD9gPrA+wD7QPxA/AD5wPmA+QD8xIAAe0B9AHwAVIByAGHAVcByQGJAV4BzAGPAWgBzwGW + AWMBzgGTAUIBwgF9AUABwgF8ATwBuwF1AeIB7gHnEgAD8AOVA5gDowOvA6cGggN9A+cSAAH1AfQB8gHQ + Ab0BpAHgAdYBzAP7Ac8BuAGiAcsBtAGZAfcB9gH1AekB5AHeAcYBswGdAfQB8wHyEgAD9gPpA+sD+wPn + A+gD+APvA+UD9hIAAe4B9QHxAVsByQGNAasB3QHCAfoC+wFXAccBigFFAcQBfgHyAfYB9AHOAecB2gFd + AcIBigHvAfQB8RIAA/EDkgPEA/sDkgOGA/QD2QOOA/EVAAH9AvwD/gMAAdcByQG4Ac0BuQGiIQAD/QP+ + AwAD6QPnIQAD/AP+AwABigHTAasBXgHJAY4hAAP8A/4DAAOsA5IVAAFCAU0BPgcAAT4DAAEoAwABQAMA + ASADAAEBAQABAQYAAQEWAAP/gQAB/gFvAf4BbwH+AW8B/gFvAeABBwHgAQcB4AEHAeABBwHgAQcB4AEH + AeABBwHgAQcBgAEAAYABAAGAAQABgAEAAYABAAGAAQABgAEAAYABAAGAAQABgAEAAYABAAGAAQABgwHB + AYMBwQGDAcEBgwHBAQMBwAEDAcABAwHAAQMBwAEDAcABAwHAAQMBwAEDAcABgwHBAYMBwQGDAcEBgwHB + AYABAQGAAQEBgAEBAYABAQGAAQEBgAEBAYABAQGAAQEBgAEBAYABAQGAAQEBgAEBAeABBwHgAQcB4AEH + AeABBwHgAQcB4AEHAeABBwHgAQcB8gF/AfIBfwHyAX8B8gF/Cw== + + + + True + + + 217, 17 + + + True + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAGgSURBVDhPrZPLSsNAFIb7BoKP4Upw5UoQBHfmMrG1olCa + pFoExY2KiHcRERFEwYUKglSQesFeQK2rFkFr0Y26MRAKpa2+QS+/MzGpaS114wdhQv7/nDknZ8bx7xDi + a+FFeYvnFU2QFHCcRxdEOcQTmTctjWHB4UgM2Wwe5XIZ+fwnko/PWF3bhiAqJzRRp2mtD0/U7oWlTbAK + Bj1jYO/vmo5SqYR44gG9fcPgiNpu2uvDkrCVEG+zIMkqcfqQuEuiWCwidhsHJ8qHhtEOLX2H9cxW81MF + nni7XP1+5PIfKBQKmJlbR1UrVnAul0O9JJa+fxAwPJehqx+fPdh6apPU6nZfY9Gk4SaWGDwN09FlsUfL + rIg2LB/z/NI5SW4bHZ9FJpPBy+sbnG4//Unfk7BjJalNbsBGEzwLIZ1OIxK9AXGqdCdZlSS1iel/HiB2 + OCTXEM4vItB1nc79HpPTK3APjBiHamJquXp09eCI0sGJyvH84gat4hqp1BM0TUMymcJRIEhLV3ZNa2ME + 4nXSCxQ1LhLrmVbAgnskudW0/BcOxxdQeE7WHAMG/AAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAFcSURBVDhP3VFNK0RhFL4/wNbM3PdcCgsfsbHDgkJKWPgD + ilJGNN73XEs/gbKUmvITuPc9d5iwYKfZyULZ26BkhTjnnXs1TWTNqafOx/M895z3ev84FsrwigQfvyGl + 1yNM1IyO4cQNrUKdqGFj1awmuGgWZnDC9Wouz8U1xnATkj+oE78HLVyWKPeAlH9EUkOa1FyzWOAxeVIS + JuxtRoVeERhS51zviLlsIHNjYRltW1ejWOChDdbqhEIfRoVbE0PZbXXoP3G/ygZFNyeYZ4xlwgzC9fAI + 7rmomUrQL01TyXekPUfSVo3zSSVXW3Ug75PNnEEpau+Uglff5XsnOH9D8reZuBJamOa6JvPQqkXhF89a + W9jw+MtAIiTVjRE88+AKY3/E5fKVGO74jC3hbMTBAPf2XT+FEzcGb7BqrH/KWNIUTLk34LX5V740Cn80 + yGKU4P07QTNS+t8Nz/sEkToIpLSWKNoAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAEgSURBVDhP3Y/PKwRhHIf3f5g/wMWUlIuDUk5y5MCB3Dk4 + 7EUbBwdXJ3EXsksjidlk2x27NrXt5kdjlTQXbSFK2iaGaX7s491Zjppx5FNP7/et9/n0fmP/PFwu8JGd + 5OsaLdxpNIyVQPL1GcyDwWDmVsEx1sLLGvdHeLtduKVh/GIPTlbGPRvF3mmjXm0Vh8a9SEBGAl1gCMoS + j2p/uOyX5/AK4/i5bqgI8UrQPFUJO9mOr43gHk/9XOToy9QLCd4O+yAvxCb7gg0JK9WJqcWxTubDf+Kd + x0ERYkqwLliVeE8PRNufWhpnUxY7j2Fu92IlO3jOT+AqMk+lxfAS+6HI6/VW8NA5neVlb6g11zLcVNRo + v/gO1SXM3PTvpL+WWOwT04jC5H73kgIAAAAASUVORK5CYII= + + + + True + + + True + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + 17, 17 + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/ColorControl/nspector/frmExportProfiles.Designer.cs b/ColorControl/nspector/frmExportProfiles.Designer.cs new file mode 100644 index 0000000..f734365 --- /dev/null +++ b/ColorControl/nspector/frmExportProfiles.Designer.cs @@ -0,0 +1,180 @@ +namespace nspector +{ + partial class frmExportProfiles + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lvProfiles = new System.Windows.Forms.ListView(); + this.chProfileName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.lProfiles = new System.Windows.Forms.Label(); + this.btnExport = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnSelAll = new System.Windows.Forms.Button(); + this.btnSelNone = new System.Windows.Forms.Button(); + this.btnInvertSelection = new System.Windows.Forms.Button(); + this.cbIncludePredefined = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // lvProfiles + // + this.lvProfiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvProfiles.CheckBoxes = true; + this.lvProfiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chProfileName}); + this.lvProfiles.FullRowSelect = true; + this.lvProfiles.GridLines = true; + this.lvProfiles.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.lvProfiles.Location = new System.Drawing.Point(12, 40); + this.lvProfiles.MultiSelect = false; + this.lvProfiles.Name = "lvProfiles"; + this.lvProfiles.Size = new System.Drawing.Size(492, 382); + this.lvProfiles.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.lvProfiles.TabIndex = 0; + this.lvProfiles.UseCompatibleStateImageBehavior = false; + this.lvProfiles.View = System.Windows.Forms.View.Details; + this.lvProfiles.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvProfiles_ItemChecked); + // + // chProfileName + // + this.chProfileName.Text = "ProfileName"; + this.chProfileName.Width = 420; + // + // lProfiles + // + this.lProfiles.AutoSize = true; + this.lProfiles.Location = new System.Drawing.Point(9, 12); + this.lProfiles.Name = "lProfiles"; + this.lProfiles.Size = new System.Drawing.Size(184, 13); + this.lProfiles.TabIndex = 1; + this.lProfiles.Text = "Select the profiles you want to export:"; + // + // btnExport + // + this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnExport.Enabled = false; + this.btnExport.Location = new System.Drawing.Point(429, 451); + this.btnExport.Name = "btnExport"; + this.btnExport.Size = new System.Drawing.Size(75, 23); + this.btnExport.TabIndex = 2; + this.btnExport.Text = "Export"; + this.btnExport.UseVisualStyleBackColor = true; + this.btnExport.Click += new System.EventHandler(this.btnExport_Click); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.Location = new System.Drawing.Point(348, 451); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 3; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // btnSelAll + // + this.btnSelAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnSelAll.Location = new System.Drawing.Point(12, 451); + this.btnSelAll.Name = "btnSelAll"; + this.btnSelAll.Size = new System.Drawing.Size(75, 23); + this.btnSelAll.TabIndex = 4; + this.btnSelAll.Text = "Select All"; + this.btnSelAll.UseVisualStyleBackColor = true; + this.btnSelAll.Click += new System.EventHandler(this.btnSelAll_Click); + // + // btnSelNone + // + this.btnSelNone.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnSelNone.Location = new System.Drawing.Point(93, 451); + this.btnSelNone.Name = "btnSelNone"; + this.btnSelNone.Size = new System.Drawing.Size(75, 23); + this.btnSelNone.TabIndex = 4; + this.btnSelNone.Text = "Select None"; + this.btnSelNone.UseVisualStyleBackColor = true; + this.btnSelNone.Click += new System.EventHandler(this.btnSelNone_Click); + // + // btnInvertSelection + // + this.btnInvertSelection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnInvertSelection.Location = new System.Drawing.Point(174, 451); + this.btnInvertSelection.Name = "btnInvertSelection"; + this.btnInvertSelection.Size = new System.Drawing.Size(100, 23); + this.btnInvertSelection.TabIndex = 4; + this.btnInvertSelection.Text = "Invert Selection"; + this.btnInvertSelection.UseVisualStyleBackColor = true; + this.btnInvertSelection.Click += new System.EventHandler(this.btnInvertSelection_Click); + // + // cbIncludePredefined + // + this.cbIncludePredefined.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.cbIncludePredefined.AutoSize = true; + this.cbIncludePredefined.Location = new System.Drawing.Point(12, 428); + this.cbIncludePredefined.Name = "cbIncludePredefined"; + this.cbIncludePredefined.Size = new System.Drawing.Size(153, 17); + this.cbIncludePredefined.TabIndex = 5; + this.cbIncludePredefined.Text = "Include predefined settings"; + this.cbIncludePredefined.UseVisualStyleBackColor = true; + // + // frmExportProfiles + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.ClientSize = new System.Drawing.Size(516, 487); + this.Controls.Add(this.cbIncludePredefined); + this.Controls.Add(this.btnInvertSelection); + this.Controls.Add(this.btnSelNone); + this.Controls.Add(this.btnSelAll); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnExport); + this.Controls.Add(this.lProfiles); + this.Controls.Add(this.lvProfiles); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(464, 319); + this.Name = "frmExportProfiles"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "frmExportProfiles"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ListView lvProfiles; + private System.Windows.Forms.ColumnHeader chProfileName; + private System.Windows.Forms.Label lProfiles; + private System.Windows.Forms.Button btnExport; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnSelAll; + private System.Windows.Forms.Button btnSelNone; + private System.Windows.Forms.Button btnInvertSelection; + private System.Windows.Forms.CheckBox cbIncludePredefined; + } +} \ No newline at end of file diff --git a/ColorControl/nspector/frmExportProfiles.cs b/ColorControl/nspector/frmExportProfiles.cs new file mode 100644 index 0000000..09f15df --- /dev/null +++ b/ColorControl/nspector/frmExportProfiles.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using nspector.Common; +using nspector.Common.Helper; +using nspector.Common.Import; + +namespace nspector +{ + internal partial class frmExportProfiles : Form + { + frmDrvSettings settingsOwner = null; + + internal frmExportProfiles() + { + InitializeComponent(); + this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); + this.DoubleBuffered = true; + } + + internal void ShowDialog(frmDrvSettings SettingsOwner) + { + settingsOwner = SettingsOwner; + Text = "Profile Export"; + updateProfileList(); + this.ShowDialog(); + } + + + private void updateProfileList() + { + lvProfiles.Items.Clear(); + + if (settingsOwner != null) + { + foreach(string mp in DrsServiceLocator.ScannerService.ModifiedProfiles) + { + lvProfiles.Items.Add(mp); + } + } + } + + + private void btnCancel_Click(object sender, EventArgs e) + { + Close(); + } + + private void btnSelAll_Click(object sender, EventArgs e) + { + for(int i=0;i(); + for (int i = 0; i < lvProfiles.Items.Count; i++) + { + if (lvProfiles.Items[i].Checked) + { + profileNamesToExport.Add(lvProfiles.Items[i].Text); + } + } + + DrsServiceLocator.ImportService.ExportProfiles(profileNamesToExport, sfd.FileName, cbIncludePredefined.Checked); + + if (profileNamesToExport.Count > 0) + { + if (MessageBox.Show("Export succeeded.\r\n\r\nWould you like to continue exporting profiles?", "Profiles Export", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No) + Close(); + } + else + MessageBox.Show("Nothing to export"); + } + } + + private void lvProfiles_ItemChecked(object sender, ItemCheckedEventArgs e) + { + int cc = 0; + for (int i = 0; i < lvProfiles.Items.Count;i++ ) + if (lvProfiles.Items[i].Checked) + cc++; + + if (cc > 0) + btnExport.Enabled = true; + else + btnExport.Enabled = false; + } + + + + } + +} diff --git a/ColorControl/nspector/frmExportProfiles.resx b/ColorControl/nspector/frmExportProfiles.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ColorControl/nspector/frmExportProfiles.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ColorControl/nspector/n1.ico b/ColorControl/nspector/n1.ico new file mode 100644 index 0000000..96391d1 Binary files /dev/null and b/ColorControl/nspector/n1.ico differ diff --git a/ColorControl/nspector/nvidiaProfileInspector.csproj b/ColorControl/nspector/nvidiaProfileInspector.csproj new file mode 100644 index 0000000..84f4190 --- /dev/null +++ b/ColorControl/nspector/nvidiaProfileInspector.csproj @@ -0,0 +1,313 @@ + + + + Debug + x86 + 10.0.20506 + 2.0 + {27B20027-E783-4ADC-AF16-40A49463F4BF} + WinExe + Properties + nspector + nvidiaProfileInspector + v4.5 + 512 + x86 + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + bin\x64\Debug\ + DEBUG;TRACE + false + full + x64 + default + prompt + false + false + true + false + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + default + prompt + false + false + true + false + + + true + bin\Debug\ + DEBUG;TRACE + full + AnyCPU + default + prompt + false + false + true + false + false + + + bin\Release\ + TRACE + false + none + AnyCPU + default + prompt + false + false + true + false + false + false + Auto + + + n1.ico + + + nspector.Program + + + app.manifest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + NvApiDriverSettings.tt + + + + + + + + + + Form + + + frmBitEditor.cs + + + Form + + + frmDrvSettings.cs + + + Form + + + frmExportProfiles.cs + + + Component + + + + + frmBitEditor.cs + Designer + + + frmDrvSettings.cs + Designer + + + frmExportProfiles.cs + Designer + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + Designer + + + TextTemplatingFileGenerator + NvApiDriverSettings.cs + + + + + Designer + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4 %28x86 und x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 4.5 + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file