mirror of
https://github.com/Orbmu2k/nvidiaProfileInspector.git
synced 2026-01-10 07:48:10 -05:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f1d636fae | ||
|
|
acb5607a6d | ||
|
|
b6ec45a334 | ||
|
|
75c99ea6c7 | ||
|
|
5aed1a0051 | ||
|
|
128efcdb86 | ||
|
|
d4ce1c9018 | ||
|
|
abef5e1eb1 |
@@ -15,6 +15,7 @@ namespace nspector.Common.CustomSettings
|
||||
public string GroupName { get; set; }
|
||||
public string OverrideDefault { get; set; }
|
||||
public float MinRequiredDriverVersion { get; set; }
|
||||
public bool Hidden { get; set; }
|
||||
|
||||
public List<CustomSettingValue> SettingValues { get; set; }
|
||||
|
||||
|
||||
@@ -301,12 +301,17 @@ namespace nspector.Common
|
||||
if (groupName == null)
|
||||
groupName = GetLegacyGroupName(settingId, settingName);
|
||||
|
||||
|
||||
|
||||
var result = new SettingMeta()
|
||||
{
|
||||
SettingType = settingType,
|
||||
SettingName = settingName,
|
||||
GroupName = groupName,
|
||||
|
||||
IsApiExposed = GetIsApiExposed(settingId),
|
||||
IsSettingHidden = GetIsSettingHidden(settingId),
|
||||
|
||||
DefaultDwordValue =
|
||||
settingType == NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE
|
||||
? GetDwordDefaultValue(settingId) : 0,
|
||||
@@ -345,6 +350,8 @@ namespace nspector.Common
|
||||
SettingName = settingMeta.SettingName,
|
||||
SettingType = settingMeta.SettingType,
|
||||
GroupName = settingMeta.GroupName,
|
||||
IsApiExposed = settingMeta.IsApiExposed,
|
||||
IsSettingHidden = settingMeta.IsSettingHidden,
|
||||
};
|
||||
|
||||
if (string.IsNullOrEmpty(newMeta.SettingName))
|
||||
@@ -403,5 +410,16 @@ namespace nspector.Common
|
||||
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));
|
||||
}
|
||||
|
||||
private bool GetIsSettingHidden(uint settingId)
|
||||
{
|
||||
var csnMeta = MetaServices.FirstOrDefault(m => m.Service.Source == SettingMetaSource.CustomSettings);
|
||||
return (csnMeta != null && ((CustomSettingMetaService)csnMeta.Service).IsSettingHidden(settingId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,6 +442,8 @@ namespace nspector.Common
|
||||
ValueText = valueText,
|
||||
State = settingState,
|
||||
IsStringValue = settingMeta.SettingType == NVDRS_SETTING_TYPE.NVDRS_WSTRING_TYPE,
|
||||
IsApiExposed = settingMeta.IsApiExposed,
|
||||
IsSettingHidden = settingMeta.IsSettingHidden,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -468,6 +470,8 @@ namespace nspector.Common
|
||||
|
||||
foreach (var settingId in settingIds)
|
||||
{
|
||||
if (settingId == 0) continue;
|
||||
|
||||
var setting = ReadSetting(hSession, hProfile, settingId);
|
||||
if (setting != null)
|
||||
result.Add(CreateSettingItem(setting.Value));
|
||||
|
||||
@@ -101,6 +101,14 @@ namespace nspector.Common.Meta
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool IsSettingHidden(uint settingId)
|
||||
{
|
||||
var setting = customSettings.Settings
|
||||
.FirstOrDefault(x => x.SettingId.Equals(settingId));
|
||||
|
||||
return setting?.Hidden ?? false;
|
||||
}
|
||||
|
||||
public SettingMetaSource Source
|
||||
{
|
||||
get { return _source; }
|
||||
|
||||
@@ -17,6 +17,10 @@ namespace nspector.Common.Meta
|
||||
|
||||
public byte[] DefaultBinaryValue { get; set; }
|
||||
|
||||
public bool IsApiExposed { get; set; }
|
||||
|
||||
public bool IsSettingHidden { get; set; }
|
||||
|
||||
public List<SettingValue<string>> StringValues { get; set; }
|
||||
|
||||
public List<SettingValue<uint>> DwordValues { get; set; }
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
public bool IsStringValue { get; set; }
|
||||
|
||||
public bool IsApiExposed { get; set; }
|
||||
|
||||
public bool IsSettingHidden { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}; 0x{1:X8}; {2}; {3}; {4};", State, SettingId, SettingText, ValueText, ValueRaw);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -586,13 +586,24 @@ namespace nspector.Native.NVAPI2
|
||||
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;
|
||||
public static NvAPI_Status DRS_SetSetting(IntPtr hSession, IntPtr hProfile, ref NVDRS_SETTING pSetting)
|
||||
{
|
||||
return _DRS_SetSetting(hSession, hProfile, ref pSetting, 0, 0);
|
||||
}
|
||||
|
||||
public static NvAPI_Status DRS_GetSetting(IntPtr hSession, IntPtr hProfile, uint settingId, ref NVDRS_SETTING pSetting)
|
||||
{
|
||||
uint x = 0;
|
||||
return _DRS_GetSetting(hSession, hProfile, settingId, ref pSetting, ref x);
|
||||
}
|
||||
|
||||
[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;
|
||||
public delegate NvAPI_Status DRS_SetSettingDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_SETTING pSetting, uint x, uint y);
|
||||
private 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, ref uint x);
|
||||
private 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);
|
||||
@@ -728,17 +739,17 @@ namespace nspector.Native.NVAPI2
|
||||
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(0x8A2CF5F5, out _DRS_SetSetting);
|
||||
GetDelegate(0xEA99498D, out _DRS_GetSetting);
|
||||
GetDelegate(0xCFD6983E, out DRS_EnumSettingsInternal);
|
||||
GetDelegate(0xE5DE48E5, out DRS_EnumAvailableSettingIdsInternal);
|
||||
GetDelegate(0x2EC39F90, out DRS_EnumAvailableSettingValuesInternal);
|
||||
GetDelegate(0xCB7309CD, out DRS_GetSettingIdFromName);
|
||||
GetDelegate(0xD61CBE6E, out DRS_GetSettingNameFromId);
|
||||
GetDelegate(0x1EB13791, out DRS_GetSettingNameFromId);
|
||||
GetDelegate(0xE4A26362, out DRS_DeleteProfileSetting);
|
||||
GetDelegate(0x5927B094, out DRS_RestoreAllDefaults);
|
||||
GetDelegate(0xFA5F6134, out DRS_RestoreProfileDefault);
|
||||
GetDelegate(0x53F0381E, out DRS_RestoreProfileDefaultSetting);
|
||||
GetDelegate(0x7DD5B261, out DRS_RestoreProfileDefaultSetting);
|
||||
GetDelegate(0xDA8466A0, out DRS_GetBaseProfile);
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("NVIDIA Profile Inspector")]
|
||||
[assembly: AssemblyCopyright("©2020 by Orbmu2k")]
|
||||
[assembly: AssemblyCopyright("©2022 by Orbmu2k")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -32,7 +32,7 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.3.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.3.0.0")]
|
||||
[assembly: AssemblyVersion("2.4.0.1")]
|
||||
[assembly: AssemblyFileVersion("2.4.0.1")]
|
||||
|
||||
|
||||
|
||||
24
nspector/Properties/Resources.Designer.cs
generated
24
nspector/Properties/Resources.Designer.cs
generated
@@ -19,7 +19,7 @@ namespace nspector.Properties {
|
||||
// -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.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class Resources {
|
||||
@@ -73,17 +73,19 @@ namespace nspector.Properties {
|
||||
/// <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.
|
||||
/// <CustomSetting>
|
||||
/// <UserfriendlyName>VRR Support Indicator</UserfriendlyName>
|
||||
/// <HexSettingID>0x8df510</HexSettingID>
|
||||
/// <GroupName>2 - Sync and Refresh</GroupName>
|
||||
/// <SettingValues>
|
||||
/// <CustomSettingValue>
|
||||
/// <UserfriendlyName>Off</UserfriendlyName>
|
||||
/// <HexValue>0x00000000</HexValue>
|
||||
/// </CustomSettingValue>
|
||||
/// <CustomSettingValue>
|
||||
/// <UserfriendlyName>On</UserfriendlyName>
|
||||
/// <HexValue>0x0000000 [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt.
|
||||
/// </summary>
|
||||
public static string CustomSettingNames {
|
||||
get {
|
||||
|
||||
3
nspector/app.config
Normal file
3
nspector/app.config
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
|
||||
@@ -150,7 +150,13 @@ namespace nspector
|
||||
|
||||
foreach (var settingItem in _currentProfileSettingItems)
|
||||
{
|
||||
lvSettings.Items.Add(CreateListViewItem(settingItem));
|
||||
if (settingItem.IsSettingHidden) continue;
|
||||
|
||||
var itm = lvSettings.Items.Add(CreateListViewItem(settingItem));
|
||||
if (Debugger.IsAttached && !settingItem.IsApiExposed)
|
||||
{
|
||||
itm.ForeColor = Color.LightCoral;
|
||||
}
|
||||
}
|
||||
|
||||
btnResetValue.Enabled = false;
|
||||
@@ -1216,8 +1222,71 @@ namespace nspector
|
||||
{
|
||||
CopyModifiedSettingsToClipBoard();
|
||||
}
|
||||
|
||||
if (Debugger.IsAttached && e.Control && e.KeyCode == Keys.T)
|
||||
{
|
||||
TestStoreSettings();
|
||||
}
|
||||
}
|
||||
|
||||
private void TestStoreSettings()
|
||||
{
|
||||
var sbSettings = new StringBuilder();
|
||||
sbSettings.AppendFormat("{0,-40} {1}\r\n", "### Inspector Store Failed ###", _CurrentProfile);
|
||||
|
||||
pbMain.Minimum = 0;
|
||||
pbMain.Maximum = lvSettings.Items.Count;
|
||||
int cntIndex = 0;
|
||||
|
||||
foreach (ListViewGroup group in lvSettings.Groups)
|
||||
{
|
||||
bool groupTitleAdded = false;
|
||||
foreach (ListViewItem item in group.Items)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
pbMain.Value = cntIndex++;
|
||||
|
||||
var settingId = (uint)item.Tag;
|
||||
var meta = _meta.GetSettingMeta(settingId);
|
||||
if (meta.SettingType != NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE) continue;
|
||||
|
||||
var wasNotSet = new int[] { 1, 2, 3 }.Contains(item.ImageIndex);
|
||||
|
||||
if (wasNotSet)
|
||||
{
|
||||
_drs.SetDwordValueToProfile(_CurrentProfile, settingId, 0x0);
|
||||
_drs.ResetValue(_CurrentProfile, settingId, out var rm);
|
||||
}
|
||||
else
|
||||
{
|
||||
var tmpValue = _drs.GetDwordValueFromProfile(_CurrentProfile, settingId);
|
||||
_drs.SetDwordValueToProfile(_CurrentProfile, settingId, 0x0);
|
||||
_drs.SetDwordValueToProfile(_CurrentProfile, settingId, tmpValue);
|
||||
}
|
||||
|
||||
}
|
||||
catch (NvapiException ne)
|
||||
{
|
||||
if (!groupTitleAdded)
|
||||
{
|
||||
sbSettings.AppendFormat("\r\n[{0}]\r\n", group.Header);
|
||||
groupTitleAdded = true;
|
||||
}
|
||||
sbSettings.AppendFormat("{0,-40} SettingId: {1} Failed: {2}\r\n", item.Text, DrsUtil.GetDwordString((uint)item.Tag), ne.Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pbMain.Value = 0;
|
||||
|
||||
Clipboard.SetText(sbSettings.ToString());
|
||||
MessageBox.Show("Failed Settings Stored to Clipboard");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void CopyModifiedSettingsToClipBoard()
|
||||
{
|
||||
var sbSettings = new StringBuilder();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>nspector</RootNamespace>
|
||||
<AssemblyName>nvidiaProfileInspector</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<TargetFrameworkProfile />
|
||||
@@ -226,6 +226,7 @@
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="app.manifest">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
|
||||
Reference in New Issue
Block a user