add/improve some picture settings, allow enabling OLED Motion Pro for C2/G2, add NVIDIA resolution and driver settings
No files matched your search
@@ -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<uint> GetAvailableRefreshRates(AmdPreset preset = null)
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<PublisherName>Maassoft</PublisherName>
|
||||
<Company>Maassoft</Company>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>5.7.1.0</ApplicationVersion>
|
||||
<Version>5.7.1.0</Version>
|
||||
<ApplicationVersion>6.0.0.0</ApplicationVersion>
|
||||
<Version>6.0.0.0</Version>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>false</BootstrapperEnabled>
|
||||
@@ -93,6 +93,12 @@
|
||||
<PackageReference Include="TaskScheduler" Version="2.9.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="nspector\CustomSettingNames.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="nspector\Reference.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
||||
@@ -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<DEVMODEA> GetAvailableResolutionsInternal(string displayName, bool portrait, uint refreshRate = 0)
|
||||
{
|
||||
var list = new List<DEVMODEA>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -137,10 +137,11 @@ namespace ColorControl
|
||||
|
||||
AddInvokableAction("WOL", new Func<Dictionary<string, object>, 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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<uint>;
|
||||
|
||||
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<uint>)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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,11 @@ namespace ColorControl
|
||||
numericEdit.Maximum = field.MaxValue;
|
||||
}
|
||||
|
||||
if (field.Value != null)
|
||||
{
|
||||
numericEdit.Text = field.Value.ToString();
|
||||
}
|
||||
|
||||
control = numericEdit;
|
||||
break;
|
||||
|
||||
|
||||
@@ -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<uint, uint> 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<uint, uint>();
|
||||
}
|
||||
|
||||
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<uint, uint>(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<string> 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<string>();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<SettingItem> _settings = new List<SettingItem>();
|
||||
|
||||
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<uint> _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<KeyValuePair<uint, string>>();
|
||||
|
||||
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<uint, string>(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<uint> GetAvailableRefreshRates(NvPreset preset = null)
|
||||
@@ -464,10 +534,29 @@ namespace ColorControl
|
||||
return new List<uint>();
|
||||
}
|
||||
|
||||
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<DEVMODEA> GetAvailableResolutions(NvPreset preset = null)
|
||||
{
|
||||
if (preset != null)
|
||||
{
|
||||
SetCurrentDisplay(preset);
|
||||
}
|
||||
|
||||
var display = GetCurrentDisplay();
|
||||
if (display == null)
|
||||
{
|
||||
return new List<DEVMODEA>();
|
||||
}
|
||||
|
||||
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<NvDisplayInfo>();
|
||||
|
||||
RefreshProfileSettings();
|
||||
|
||||
foreach (var display in displays)
|
||||
{
|
||||
var values = new List<string>();
|
||||
@@ -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<string>();
|
||||
|
||||
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<SettingItem> 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<string, string>();
|
||||
var normalSettings = _drs.GetSettingsForProfile(_baseProfileName, SettingViewMode.Normal, ref applications);
|
||||
|
||||
_settings = new List<SettingItem>();
|
||||
_settings.AddRange(normalSettings);
|
||||
}
|
||||
|
||||
protected override void Uninitialize()
|
||||
|
||||
@@ -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"];
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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<int>();
|
||||
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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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<CachedSettingValue> SettingValues = new List<CachedSettingValue>();
|
||||
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<CustomSettingValue> 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); }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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<CustomSetting> Settings = new List<CustomSetting>();
|
||||
|
||||
public void StoreToFile(string filename)
|
||||
{
|
||||
XMLHelper<CustomSettingNames>.SerializeToXmlFile(this, filename, Encoding.Unicode, true);
|
||||
}
|
||||
|
||||
public static CustomSettingNames FactoryLoadFromFile(string filename)
|
||||
{
|
||||
return XMLHelper<CustomSettingNames>.DeserializeFromXMLFile(filename);
|
||||
}
|
||||
|
||||
public static CustomSettingNames FactoryLoadFromString(string xml)
|
||||
{
|
||||
return XMLHelper<CustomSettingNames>.DeserializeFromXmlString(xml);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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<string> _InternalSettings = new HashSet<string>();
|
||||
|
||||
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<string>();
|
||||
|
||||
var paProfile = "Profile\\s\\\"(?<profileName>.*?)\\\"";
|
||||
var rxProfile = new Regex(paProfile, RegexOptions.Compiled);
|
||||
|
||||
var paSetting = "ID_0x(?<sid>[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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<string> 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<Profiles>.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<Profiles>.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<string>();
|
||||
|
||||
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<uint>();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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> CachedSettings = new List<CachedSettings>();
|
||||
internal List<string> ModifiedProfiles = new List<string>();
|
||||
internal HashSet<string> UserProfiles = new HashSet<string>();
|
||||
|
||||
// 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<uint> 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<int> progress, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
ModifiedProfiles = new List<string>();
|
||||
UserProfiles = new HashSet<string>();
|
||||
var knownPredefines = new List<uint>(_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<uint>();
|
||||
|
||||
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<string>();
|
||||
|
||||
DrsSession((hSession) =>
|
||||
{
|
||||
SaveSettingsFileEx(hSession, tmpfile);
|
||||
});
|
||||
|
||||
if (File.Exists(tmpfile))
|
||||
{
|
||||
string content = File.ReadAllText(tmpfile);
|
||||
string pattern = "\\sProfile\\s\\\"(?<profile>.*?)\\\"(?<scope>.*?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\\\"(?<app>.*?)\\\"", 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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<T>(Func<IntPtr, T> action, bool forceNonGlobalSession = false, bool preventLoadSettings = false)
|
||||
{
|
||||
lock (_Sync)
|
||||
{
|
||||
if (!HoldSession || forceNonGlobalSession)
|
||||
return NonGlobalDrsSession<T>(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<T>(Func<IntPtr, T> 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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<MetaServiceItem> MetaServices = new List<MetaServiceItem>();
|
||||
|
||||
private Dictionary<uint, SettingMeta> settingMetaCache = new Dictionary<uint, SettingMeta>();
|
||||
|
||||
public DrsSettingsMetaService(CustomSettingNames customSettings, CustomSettingNames referenceSettings = null)
|
||||
{
|
||||
_customSettings = customSettings;
|
||||
_referenceSettings = referenceSettings;
|
||||
|
||||
ResetMetaCache(true);
|
||||
}
|
||||
|
||||
public void ResetMetaCache(bool initOnly = false)
|
||||
{
|
||||
settingMetaCache = new Dictionary<uint, SettingMeta>();
|
||||
MetaServices = new List<MetaServiceItem>();
|
||||
|
||||
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<SettingValue<T>> MergeSettingValues<T>(List<SettingValue<T>> a, List<SettingValue<T>> 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<SettingValue<byte[]>> GetBinaryValues(uint settingId)
|
||||
{
|
||||
var result = new List<SettingValue<byte[]>>();
|
||||
|
||||
foreach (var service in MetaServices.OrderByDescending(x => x.ValueNamePrio))
|
||||
{
|
||||
result = MergeSettingValues(result, service.Service.GetBinaryValues(settingId));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<SettingValue<string>> GetStringValues(uint settingId)
|
||||
{
|
||||
var result = new List<SettingValue<string>>();
|
||||
|
||||
foreach (var service in MetaServices.OrderByDescending(x => x.ValueNamePrio))
|
||||
{
|
||||
result = MergeSettingValues(result, service.Service.GetStringValues(settingId));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<SettingValue<uint>> GetDwordValues(uint settingId)
|
||||
{
|
||||
var result = new List<SettingValue<uint>>();
|
||||
|
||||
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<uint> GetSettingIds(SettingViewMode viewMode)
|
||||
{
|
||||
var settingIds = new List<uint>();
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<uint> InitBaseProfileSettingIds()
|
||||
{
|
||||
return DrsSession((hSession) =>
|
||||
{
|
||||
var hBaseProfile = GetProfileHandle(hSession, "");
|
||||
var baseProfileSettings = GetProfileSettings(hSession, hBaseProfile);
|
||||
|
||||
return baseProfileSettings.Select(x => x.settingId).ToList();
|
||||
});
|
||||
}
|
||||
|
||||
private readonly List<uint> _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 = "(?<rpl>\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<string> GetProfileNames(ref string baseProfileName, bool enumProfiles = true)
|
||||
{
|
||||
var lstResult = new List<string>();
|
||||
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<KeyValuePair<uint, string>> 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<SettingValue<uint>>();
|
||||
|
||||
|
||||
if (settingMeta.StringValues == null)
|
||||
settingMeta.StringValues = new List<SettingValue<string>>();
|
||||
|
||||
if (settingMeta.BinaryValues == null)
|
||||
settingMeta.BinaryValues = new List<SettingValue<byte[]>>();
|
||||
|
||||
|
||||
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<SettingItem> GetSettingsForProfile(string profileName, SettingViewMode viewMode, ref Dictionary<string, string> applications)
|
||||
{
|
||||
var result = new List<SettingItem>();
|
||||
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}";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<IntPtr> action, bool forceNonGlobalSession = false, bool preventLoadSettings = false)
|
||||
{
|
||||
DrsSessionScope.DrsSession<bool>((hSession) =>
|
||||
{
|
||||
action(hSession);
|
||||
return true;
|
||||
}, forceNonGlobalSession: forceNonGlobalSession, preventLoadSettings: preventLoadSettings);
|
||||
}
|
||||
|
||||
protected T DrsSession<T>(Func<IntPtr, T> action, bool forceDedicatedScope = false)
|
||||
{
|
||||
return DrsSessionScope.DrsSession<T>(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<IntPtr> EnumProfileHandles(IntPtr hSession)
|
||||
{
|
||||
var profileHandles = new List<IntPtr>();
|
||||
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<NVDRS_SETTING> 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<NVDRS_SETTING>();
|
||||
|
||||
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<NVDRS_APPLICATION_V3> 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<NVDRS_APPLICATION_V3>();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<string, byte>(input.Split('-'), s => Convert.ToByte(s, 16));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<ToolStrip, int> ScrollInternal
|
||||
= (Action<ToolStrip, int>)Delegate.CreateDelegate(typeof(Action<ToolStrip, int>),
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<string> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace nspector.Common.Helper
|
||||
{
|
||||
|
||||
public class ListViewGroupHeaderSorter : IComparer<ListViewGroup>
|
||||
{
|
||||
private bool _ascending = true;
|
||||
public ListViewGroupHeaderSorter(bool ascending)
|
||||
{
|
||||
_ascending = ascending;
|
||||
}
|
||||
|
||||
#region IComparer<ListViewGroup> 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<ListViewGroup> lvgs = new List<ListViewGroup>();
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -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) {}
|
||||
}
|
||||
}
|
||||
@@ -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 "";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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+(?<appid>\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<string> FindAllExecutablesForApp(int appid)
|
||||
{
|
||||
if (_appinfoBytes == null)
|
||||
return new List<string>();
|
||||
|
||||
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<string>();
|
||||
else
|
||||
offset = appidOffset + appidPattern.Length;
|
||||
|
||||
var launchOffset = FindOffset(_appinfoBytes, launchPattern, offset);
|
||||
if (launchOffset == -1)
|
||||
return new List<string>();
|
||||
else
|
||||
offset = launchOffset;
|
||||
|
||||
var executables = new List<string>();
|
||||
FindExecutables(_appinfoBytes, ref offset, ref executables);
|
||||
return executables;
|
||||
}
|
||||
|
||||
|
||||
private void FindExecutables(byte[] bytes, ref int offset, ref List<string> 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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("-", ""));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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<UserSettings>.SerializeToXmlFile(this, GetSettingsFilename(), Encoding.Unicode, true);
|
||||
}
|
||||
|
||||
public static UserSettings LoadSettings()
|
||||
{
|
||||
var filename = GetSettingsFilename();
|
||||
if (!File.Exists(filename)) return new UserSettings();
|
||||
|
||||
return XMLHelper<UserSettings>.DeserializeFromXMLFile(GetSettingsFilename());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<T> 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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace nspector.Common.Import
|
||||
{
|
||||
[Serializable]
|
||||
public class Profile
|
||||
{
|
||||
public string ProfileName = "";
|
||||
public List<string> Executeables = new List<string>();
|
||||
public List<ProfileSetting> Settings = new List<ProfileSetting>();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace nspector.Common.Import
|
||||
{
|
||||
[Serializable]
|
||||
public class Profiles : List<Profile>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace nspector.Common.Import
|
||||
{
|
||||
public enum SettingValueType : int
|
||||
{
|
||||
Dword,
|
||||
AnsiString,
|
||||
String,
|
||||
Binary
|
||||
}
|
||||
}
|
||||
@@ -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<ESetting, Type> settingEnumTypeCache;
|
||||
|
||||
private string[] ignoreSettingNames = new[] { "TOTAL_DWORD_SETTING_NUM", "TOTAL_WSTRING_SETTING_NUM",
|
||||
"TOTAL_SETTING_NUM", "INVALID_SETTING_ID" };
|
||||
|
||||
private Dictionary<ESetting, Type> CreateSettingEnumTypeCache()
|
||||
{
|
||||
var result = new Dictionary<ESetting, Type>();
|
||||
|
||||
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<SettingValue<string>> 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<SettingValue<uint>> 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<uint>(Source)
|
||||
{
|
||||
Value = ParseEnumValue(enumType, x),
|
||||
ValueName = DrsUtil.GetDwordString(ParseEnumValue(enumType, x)) + " " + x
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private HashSet<uint> settingIds;
|
||||
public List<uint> GetSettingIds()
|
||||
{
|
||||
if (settingIds == null)
|
||||
settingIds = new HashSet<uint>(
|
||||
Enum.GetValues(typeof(ESetting))
|
||||
.Cast<ESetting>()
|
||||
.Where(x => !ignoreSettingNames.Contains(x.ToString()))
|
||||
.Cast<uint>()
|
||||
.Distinct()
|
||||
.ToList());
|
||||
|
||||
return settingIds.ToList();
|
||||
}
|
||||
|
||||
|
||||
public string GetGroupName(uint settingId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public byte[] GetBinaryDefaultValue(uint settingId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<SettingValue<byte[]>> GetBinaryValues(uint settingId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public SettingMetaSource Source
|
||||
{
|
||||
get { return SettingMetaSource.ConstantSettings; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<SettingValue<string>> GetStringValues(uint settingId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<SettingValue<uint>> 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<uint>(Source)
|
||||
{
|
||||
ValuePos = i++,
|
||||
Value = x.SettingValue,
|
||||
ValueName = _source == SettingMetaSource.CustomSettings ? x.UserfriendlyName : DrsUtil.GetDwordString(x.SettingValue) + " " + x.UserfriendlyName,
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<uint> 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<SettingValue<byte[]>> GetBinaryValues(uint settingId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public SettingMetaSource Source
|
||||
{
|
||||
get { return _source; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<uint, SettingMeta> _settingMetaCache = new Dictionary<uint, SettingMeta>();
|
||||
private readonly List<uint> _settingIds;
|
||||
|
||||
public DriverSettingMetaService()
|
||||
{
|
||||
_settingIds = InitSettingIds();
|
||||
}
|
||||
|
||||
private List<uint> InitSettingIds()
|
||||
{
|
||||
var settingIds = new List<uint>();
|
||||
|
||||
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<SettingValue<uint>>();
|
||||
for (int i = 0; i < values.numSettingValues; i++)
|
||||
{
|
||||
result.DwordValues.Add(
|
||||
new SettingValue<uint>(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<SettingValue<string>>();
|
||||
for (int i = 0; i < values.numSettingValues; i++)
|
||||
{
|
||||
var strValue = values.settingValues[i].stringValue;
|
||||
if (strValue != null)
|
||||
{
|
||||
result.StringValues.Add(
|
||||
new SettingValue<string>(Source)
|
||||
{
|
||||
Value = strValue,
|
||||
ValueName = strValue,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (values.settingType == NVDRS_SETTING_TYPE.NVDRS_BINARY_TYPE)
|
||||
{
|
||||
result.DefaultBinaryValue = values.defaultValue.binaryValue;
|
||||
result.BinaryValues = new List<SettingValue<byte[]>>();
|
||||
for (int i = 0; i < values.numSettingValues; i++)
|
||||
{
|
||||
var binValue = values.settingValues[i].binaryValue;
|
||||
if (binValue != null)
|
||||
{
|
||||
result.BinaryValues.Add(
|
||||
new SettingValue<byte[]>(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<SettingValue<string>> GetStringValues(uint settingId)
|
||||
{
|
||||
var settingMeta = GetSettingsMeta(settingId);
|
||||
if (settingMeta != null)
|
||||
return settingMeta.StringValues;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<SettingValue<uint>> GetDwordValues(uint settingId)
|
||||
{
|
||||
var settingMeta = GetSettingsMeta(settingId);
|
||||
if (settingMeta != null)
|
||||
return settingMeta.DwordValues;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<uint> 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<SettingValue<byte[]>> GetBinaryValues(uint settingId)
|
||||
{
|
||||
var settingMeta = GetSettingsMeta(settingId);
|
||||
if (settingMeta != null)
|
||||
return settingMeta.BinaryValues;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public SettingMetaSource Source
|
||||
{
|
||||
get { return SettingMetaSource.DriverSettings; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<SettingValue<string>> GetStringValues(uint settingId);
|
||||
|
||||
List<SettingValue<uint>> GetDwordValues(uint settingId);
|
||||
|
||||
List<SettingValue<byte[]>> GetBinaryValues(uint settingId);
|
||||
|
||||
List<uint> GetSettingIds();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace nspector.Common.Meta
|
||||
{
|
||||
internal class MetaServiceItem
|
||||
{
|
||||
public ISettingMetaService Service { get; set; }
|
||||
public uint ValueNamePrio { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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> CachedSettings;
|
||||
|
||||
public ScannedSettingMetaService(List<CachedSettings> 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<SettingValue<string>> GetStringValues(uint settingId)
|
||||
{
|
||||
var cached = CachedSettings.FirstOrDefault(x => x.SettingId.Equals(settingId));
|
||||
if (cached != null)
|
||||
return cached.SettingValues.Select(s => new SettingValue<string>(Source)
|
||||
{
|
||||
Value = s.ValueStr,
|
||||
ValueName = string.Format("'{0}' ({1})", s.ValueStr.Trim(), s.ProfileNames),
|
||||
|
||||
}).ToList();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<SettingValue<uint>> GetDwordValues(uint settingId)
|
||||
{
|
||||
var cached = CachedSettings.FirstOrDefault(x => x.SettingId.Equals(settingId));
|
||||
if (cached != null)
|
||||
return cached.SettingValues.Select(s => new SettingValue<uint>(Source)
|
||||
{
|
||||
Value = s.Value,
|
||||
ValueName = string.Format("0x{0:X8} ({1})", s.Value, s.ProfileNames),
|
||||
|
||||
}).ToList();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<uint> GetSettingIds()
|
||||
{
|
||||
return CachedSettings.Select(c => c.SettingId).ToList();
|
||||
}
|
||||
|
||||
public byte[] GetBinaryDefaultValue(uint settingId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<SettingValue<byte[]>> GetBinaryValues(uint settingId)
|
||||
{
|
||||
var cached = CachedSettings.FirstOrDefault(x => x.SettingId.Equals(settingId));
|
||||
if (cached != null)
|
||||
return cached.SettingValues.Select(s => new SettingValue<byte[]>(Source)
|
||||
{
|
||||
Value = s.ValueBin,
|
||||
ValueName = string.Format("{0} ({1})", DrsUtil.GetBinaryString(s.ValueBin), s.ProfileNames),
|
||||
|
||||
}).ToList();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<SettingValue<string>> StringValues { get; set; }
|
||||
|
||||
public List<SettingValue<uint>> DwordValues { get; set; }
|
||||
|
||||
public List<SettingValue<byte[]>> BinaryValues { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace nspector.Common.Meta
|
||||
{
|
||||
public enum SettingMetaSource
|
||||
{
|
||||
CustomSettings = 10,
|
||||
DriverSettings = 20,
|
||||
ConstantSettings = 30,
|
||||
ReferenceSettings = 40,
|
||||
ScannedSettings = 50,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace nspector.Common.Meta
|
||||
{
|
||||
internal class SettingValue<T>
|
||||
{
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace nspector.Common
|
||||
{
|
||||
public enum SettingViewMode
|
||||
{
|
||||
Normal,
|
||||
IncludeScannedSetttings,
|
||||
CustomSettingsOnly,
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 830 B |
|
After Width: | Height: | Size: 744 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 507 B |
|
After Width: | Height: | Size: 430 B |
|
After Width: | Height: | Size: 742 B |
|
After Width: | Height: | Size: 734 B |
|
After Width: | Height: | Size: 351 B |
|
After Width: | Height: | Size: 857 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 554 B |
|
After Width: | Height: | Size: 929 B |
|
After Width: | Height: | Size: 611 B |
|
After Width: | Height: | Size: 669 B |
@@ -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<order.Length; i++)
|
||||
{
|
||||
col = this.Columns[order[i]];
|
||||
if (col.Index == SubItem)
|
||||
break;
|
||||
subItemX += col.Width;
|
||||
}
|
||||
|
||||
subItemRect = new Rectangle(subItemX, lviBounds.Top-1, this.Columns[order[i]].Width, lviBounds.Height);
|
||||
|
||||
return subItemRect;
|
||||
}
|
||||
|
||||
internal void AddEmbeddedControl(Control c, int col, int row)
|
||||
{
|
||||
AddEmbeddedControl(c,col,row,DockStyle.Fill);
|
||||
}
|
||||
|
||||
internal void AddEmbeddedControl(Control c, int col, int row, DockStyle dock)
|
||||
{
|
||||
if (c==null)
|
||||
throw new ArgumentNullException();
|
||||
if (col>=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<this.Font.Height))
|
||||
{
|
||||
ec.Control.Visible = false;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
ec.Control.Visible = true;
|
||||
}
|
||||
|
||||
switch (ec.Dock)
|
||||
{
|
||||
case DockStyle.Fill:
|
||||
break;
|
||||
case DockStyle.Top:
|
||||
rc.Height = ec.Control.Height;
|
||||
break;
|
||||
case DockStyle.Left:
|
||||
rc.Width = ec.Control.Width;
|
||||
break;
|
||||
case DockStyle.Bottom:
|
||||
rc.Offset(0, rc.Height-ec.Control.Height);
|
||||
rc.Height = ec.Control.Height;
|
||||
break;
|
||||
case DockStyle.Right:
|
||||
rc.Offset(rc.Width-ec.Control.Width, 0);
|
||||
rc.Width = ec.Control.Width;
|
||||
break;
|
||||
case DockStyle.None:
|
||||
rc.Size = ec.Control.Size;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
rc.X = rc.X + ec.Control.Margin.Left;
|
||||
rc.Y = rc.Y + ec.Control.Margin.Top;
|
||||
rc.Width = rc.Width - ec.Control.Margin.Right;
|
||||
rc.Height = rc.Height - ec.Control.Margin.Bottom;
|
||||
|
||||
ec.Control.Bounds = rc;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DROPFILES:
|
||||
|
||||
if (OnDropFilesNative != null)
|
||||
{
|
||||
var dropped = DragQueryFile(m.WParam, 0xFFFFFFFF, null, 0);
|
||||
if (dropped > 0)
|
||||
{
|
||||
var files = new List<string>();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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+(?<name>.*?)\\{(?<enums>.*?)\\}";
|
||||
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("");
|
||||
}
|
||||
|
||||
#>
|
||||
}
|
||||
@@ -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<NVDRS_SETTING_VALUES>(1);
|
||||
public static uint NVDRS_SETTING_VER = MAKE_NVAPI_VERSION<NVDRS_SETTING>(1);
|
||||
public static uint NVDRS_APPLICATION_VER_V1 = MAKE_NVAPI_VERSION<NVDRS_APPLICATION_V1>(1);
|
||||
public static uint NVDRS_APPLICATION_VER_V2 = MAKE_NVAPI_VERSION<NVDRS_APPLICATION_V2>(2);
|
||||
public static uint NVDRS_APPLICATION_VER_V3 = MAKE_NVAPI_VERSION<NVDRS_APPLICATION_V3>(3);
|
||||
public static uint NVDRS_APPLICATION_VER = NVDRS_APPLICATION_VER_V3;
|
||||
public static uint NVDRS_PROFILE_VER = MAKE_NVAPI_VERSION<NVDRS_PROFILE>(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<T>(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<T>(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<T>(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<TDrsAppVersion>(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<TDrsAppVersion>(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<NVDRS_SETTING>(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<uint> 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<uint>(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<nvapi_QueryInterfaceDelegate>(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
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace nspector.Native
|
||||
{
|
||||
internal class NativeArrayHelper
|
||||
{
|
||||
public static T GetArrayItemData<T>(IntPtr sourcePointer)
|
||||
{
|
||||
return (T)Marshal.PtrToStructure(sourcePointer, typeof(T));
|
||||
}
|
||||
|
||||
public static T[] GetArrayData<T>(IntPtr sourcePointer, int itemCount)
|
||||
{
|
||||
var lstResult = new List<T>();
|
||||
if (sourcePointer != IntPtr.Zero && itemCount > 0)
|
||||
{
|
||||
var sizeOfItem = Marshal.SizeOf(typeof(T));
|
||||
for (int i = 0; i < itemCount; i++)
|
||||
{
|
||||
lstResult.Add(GetArrayItemData<T>(sourcePointer + (sizeOfItem * i)));
|
||||
}
|
||||
}
|
||||
return lstResult.ToArray();
|
||||
}
|
||||
|
||||
public static void SetArrayData<T>(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>(T item, out IntPtr targetPointer)
|
||||
{
|
||||
var sizeOfItem = Marshal.SizeOf(typeof(T));
|
||||
targetPointer = Marshal.AllocHGlobal(sizeOfItem);
|
||||
Marshal.StructureToPtr(item, targetPointer, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace nspector.Native.WINAPI
|
||||
{
|
||||
internal static class DragAcceptNativeHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Modifies the User Interface Privilege Isolation (UIPI) message filter for whole process. (Vista only)
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="dwFlag"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
internal static extern IntPtr ChangeWindowMessageFilter(int message, int dwFlag);
|
||||
|
||||
/// <summary>
|
||||
/// Modifies the User Interface Privilege Isolation (UIPI) message filter for a specified window. (Win7 or higher)
|
||||
/// </summary>
|
||||
/// <param name="handle"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="action"></param>
|
||||
/// <returns></returns>
|
||||
[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;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 { }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace nspector.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// 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() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap apply {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("apply", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
public static string CustomSettingNames {
|
||||
get {
|
||||
return ResourceManager.GetString("CustomSettingNames", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap export1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("export1", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap filter_user {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("filter_user", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap find_set2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("find_set2", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap home_sm {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("home_sm", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol).
|
||||
/// </summary>
|
||||
public static System.Drawing.Icon Icon1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Icon1", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap ieframe_1_18212 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ieframe_1_18212", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap ieframe_1_31073_002 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ieframe_1_31073_002", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap import1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("import1", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap n1_016 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("n1-016", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap nv_btn {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("nv_btn", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap PortableDeviceStatus_3_16_011 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PortableDeviceStatus_3_16_011", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol).
|
||||
/// </summary>
|
||||
public static System.Drawing.Icon shield16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("shield16", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap text_binary {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("text_binary", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap transparent16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("transparent16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap window_application_add {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("window_application_add", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap window_application_delete {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("window_application_delete", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="transparent16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\transparent16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="filter_user" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\filter_user.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="apply" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\apply.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="export1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\export1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ieframe_1_18212" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\ieframe_1_18212.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="window_application_delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\window_application_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="home_sm" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\home_sm.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="window_application_add" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\window_application_add.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="shield16" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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==
|
||||
</value>
|
||||
</data>
|
||||
<data name="PortableDeviceStatus_3_16_011" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\PortableDeviceStatus_3_16-011.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="text_binary" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\text_binary.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="nv_btn" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\nv_btn.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="import1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\import1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ieframe_1_31073_002" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\ieframe_1_31073-002.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="find_set2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\find_set2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="n1-016" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\n1-016.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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==
|
||||
</value>
|
||||
</data>
|
||||
<data name="CustomSettingNames" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\CustomSettingNames.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<asmv2:trustInfo xmlns:asmv2="urn:schemas-microsoft-com:asm.v2">
|
||||
<asmv2:security>
|
||||
<asmv2:requestedPrivileges>
|
||||
<asmv2:requestedExecutionLevel level="requireAdministrator" />
|
||||
</asmv2:requestedPrivileges>
|
||||
</asmv2:security>
|
||||
</asmv2:trustInfo>
|
||||
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
<dpiAware>true</dpiAware>
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
</assembly>
|
||||
@@ -0,0 +1,253 @@
|
||||
namespace nspector
|
||||
{
|
||||
partial class frmBitEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,613 @@
|
||||
namespace nspector
|
||||
{
|
||||
partial class frmDrvSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ilListView.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>115, 17</value>
|
||||
</metadata>
|
||||
<data name="ilListView.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
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==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="pbMain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="tsMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>217, 17</value>
|
||||
</metadata>
|
||||
<metadata name="tsMain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="tsbRefreshProfile.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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==
|
||||
</value>
|
||||
</data>
|
||||
<data name="tsbRestoreProfile.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAFcSURBVDhP3VFNK0RhFL4/wNbM3PdcCgsfsbHDgkJKWPgD
|
||||
ilJGNN73XEs/gbKUmvITuPc9d5iwYKfZyULZ26BkhTjnnXs1TWTNqafOx/M895z3ev84FsrwigQfvyGl
|
||||
1yNM1IyO4cQNrUKdqGFj1awmuGgWZnDC9Wouz8U1xnATkj+oE78HLVyWKPeAlH9EUkOa1FyzWOAxeVIS
|
||||
JuxtRoVeERhS51zviLlsIHNjYRltW1ejWOChDdbqhEIfRoVbE0PZbXXoP3G/ygZFNyeYZ4xlwgzC9fAI
|
||||
7rmomUrQL01TyXekPUfSVo3zSSVXW3Ug75PNnEEpau+Uglff5XsnOH9D8reZuBJamOa6JvPQqkXhF89a
|
||||
W9jw+MtAIiTVjRE88+AKY3/E5fKVGO74jC3hbMTBAPf2XT+FEzcGb7BqrH/KWNIUTLk34LX5V740Cn80
|
||||
yGKU4P07QTNS+t8Nz/sEkToIpLSWKNoAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="tsbCreateProfile.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="btnResetValue.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lblApplications.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="toolStripButton5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButton6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="ilCombo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cbValues.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lblWidth96.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lblWidth330.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lblWidth16.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lblWidth30.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lvSettings.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,180 @@
|
||||
namespace nspector
|
||||
{
|
||||
partial class frmExportProfiles
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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<lvProfiles.Items.Count;i++)
|
||||
{
|
||||
lvProfiles.Items[i].Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnSelNone_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < lvProfiles.Items.Count; i++)
|
||||
{
|
||||
lvProfiles.Items[i].Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnInvertSelection_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < lvProfiles.Items.Count; i++)
|
||||
{
|
||||
lvProfiles.Items[i].Checked = !lvProfiles.Items[i].Checked;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.DefaultExt = "*.nip";
|
||||
sfd.Filter = Application.ProductName + " Profiles|*.nip";
|
||||
if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
var profileNamesToExport = new List<string>();
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||