Compare commits

..

14 Commits

Author SHA1 Message Date
Orbmu2k
6d3237bfeb unified scan to a single run for better startup time #41 2020-01-12 14:20:22 +01:00
Orbmu2k
5dbb8ef721 fixed profiles counter for 3d vision settings 2020-01-12 00:36:00 +01:00
Orbmu2k
fcd9ef5346 merge 2020-01-11 13:46:18 +01:00
Orbmu2k
67bb397b6a fixed readme 2020-01-11 13:42:52 +01:00
Orbmu2k
ffff16ca83 Update README.md 2020-01-11 13:39:36 +01:00
Orbmu2k
cd8caa5702 fix #43 - delete application may not be successful 2020-01-11 13:38:06 +01:00
Orbmu2k
2d57d6b885 updated readme.md 2020-01-11 12:43:33 +01:00
Orbmu2k
84749fdf5f possible fix #27 #40 2020-01-11 01:10:00 +01:00
Orbmu2k
b651dae816 moved ansel setting to common group 2020-01-11 00:18:15 +01:00
Orbmu2k
0a27ce1c36 STRG+C will copy userdefined settings to clipboard 2020-01-11 00:10:16 +01:00
Orbmu2k
499cdde758 fixed drs db reset 2020-01-10 22:55:25 +01:00
Orbmu2k
cedcd4e2c6 fix #33 - using settings.xml in working folder if exists 2020-01-07 23:39:06 +01:00
Orbmu2k
5301c52c16 fixed "-disableScan" mode 2020-01-07 23:20:21 +01:00
Orbmu2k
bf8243adaf Updated Settings R441 2020-01-07 11:17:35 +01:00
15 changed files with 2069 additions and 166 deletions

View File

@@ -1 +1,11 @@
# nvidiaProfileInspector
![](/nspector/Images/n1-016.png) **NVIDIA Profile Inspector**
This tool is used for modifying game profiles inside the internal driver database of the nvidia driver.
All game profiles are provided by the nvidia driver, but you can add your own profiles for games missing in the driver database.
You also have access to hidden and undocumented settings, which are not provided by the drivers control panel.
For more information how to use this tool, you can find some very good wikis here:
* https://wiki.step-project.com/Guide:NVIDIA_Inspector
* https://www.pcgamingwiki.com/wiki/Nvidia_Profile_Inspector
![](npi_screenshot.png)

BIN
npi_screenshot.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View File

@@ -31,7 +31,11 @@ namespace nspector.Common
public DrsDecrypterService(DrsSettingsMetaService metaService) : base(metaService)
{
CreateInternalSettingMap();
try
{
CreateInternalSettingMap();
}
catch { }
}
private uint GetDwordFromKey(uint offset)

View File

@@ -43,7 +43,7 @@ namespace nspector.Common
{
LoadSettingsFileEx(hSession, filename);
SaveSettings(hSession);
});
}, forceNonGlobalSession: true, preventLoadSettings: true);
}
internal void ExportProfiles(List<string> profileNames, string filename, bool includePredefined)

View File

@@ -63,7 +63,7 @@ namespace nspector.Common
checkedSettingsCount++;
AddScannedSettingToCache(profile, setting);
alreadyCheckedSettingIds.Add(setting.settingId);
return true;
return (setting.isCurrentPredefined != 1);
}
else if (setting.isCurrentPredefined != 1)
{
@@ -79,11 +79,10 @@ namespace nspector.Common
return (current > 0) ? (int)Math.Round((current * 100f) / max) : 0; ;
}
public async Task ScanForModifiedProfilesAsync(IProgress<int> progress, CancellationToken token = default(CancellationToken))
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);
@@ -105,97 +104,28 @@ namespace nspector.Common
var profile = GetProfileInfo(hSession, hProfile);
int checkedSettingsCount = 0;
bool foundModifiedProfile = false;
var alreadyChecked = new List<uint>();
bool foundModifiedProfile = false;
if (profile.isPredefined == 0)
{
ModifiedProfiles.Add(profile.profileName);
UserProfiles.Add(profile.profileName);
continue;
foundModifiedProfile = true;
}
if ((hBaseProfile == hProfile || profile.numOfApps > 0) && profile.numOfSettings > 0)
{
var alreadyChecked = new List<uint>();
foreach (uint settingId in knownPredefines)
{
if (CheckCommonSetting(hSession, hProfile, profile,
ref checkedSettingsCount, settingId, false, ref alreadyChecked))
{
foundModifiedProfile = true;
ModifiedProfiles.Add(profile.profileName);
break;
}
}
// the detection if only applications has changed in a profile makes the scan process very slow, we leave it out!
//if (!foundModifiedProfile && profile.numOfApps > 0)
//{
// var apps = GetProfileApplications(hSession, hProfile);
// foreach (var app in apps)
// {
// if (app.isPredefined == 0)
// {
// foundModifiedProfile = true;
// ModifiedProfiles.Add(profile.profileName);
// break;
// }
// }
//}
if (foundModifiedProfile || 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 (setting.isCurrentPredefined != 1)
{
ModifiedProfiles.Add(profile.profileName);
break;
}
}
}
}
});
});
}
public async Task ScanForPredefinedProfileSettingsAsync(IProgress<int> progress, CancellationToken token = default(CancellationToken))
{
await Task.Run(() =>
{
var knownPredefines = new List<uint>(_commonSettingIds);
DrsSession((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>();
foreach (uint kpd in knownPredefines)
{
CheckCommonSetting(hSession, hProfile, profile,
ref checkedSettingsCount, kpd, true, ref alreadyChecked);
if (CheckCommonSetting(hSession, hProfile, profile,
ref checkedSettingsCount, kpd, !justModified, ref alreadyChecked))
{
if (!foundModifiedProfile)
{
foundModifiedProfile = true;
ModifiedProfiles.Add(profile.profileName);
}
}
}
if (checkedSettingsCount >= profile.numOfSettings)
@@ -207,8 +137,17 @@ namespace nspector.Common
if (knownPredefines.IndexOf(setting.settingId) < 0)
knownPredefines.Add(setting.settingId);
if (alreadyChecked.IndexOf(setting.settingId) < 0)
if (!justModified && alreadyChecked.IndexOf(setting.settingId) < 0)
AddScannedSettingToCache(profile, setting);
if (setting.isCurrentPredefined != 1)
{
if (!foundModifiedProfile)
{
foundModifiedProfile = true;
ModifiedProfiles.Add(profile.profileName);
}
}
}
}
});
@@ -245,6 +184,8 @@ namespace nspector.Common
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);

View File

@@ -14,12 +14,12 @@ namespace nspector.Common
private static object _Sync = new object();
public static T DrsSession<T>(Func<IntPtr, T> action, bool forceNonGlobalSession = false)
public static T DrsSession<T>(Func<IntPtr, T> action, bool forceNonGlobalSession = false, bool preventLoadSettings = false)
{
lock (_Sync)
{
if (!HoldSession || forceNonGlobalSession)
return NonGlobalDrsSession<T>(action);
return NonGlobalDrsSession<T>(action, preventLoadSettings);
if (GlobalSession == IntPtr.Zero)
@@ -31,10 +31,13 @@ namespace nspector.Common
if (csRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_CreateSession", csRes);
var nvRes = nvw.DRS_LoadSettings(GlobalSession);
if (nvRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_LoadSettings", nvRes);
if (!preventLoadSettings)
{
var nvRes = nvw.DRS_LoadSettings(GlobalSession);
if (nvRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_LoadSettings", nvRes);
}
}
}
@@ -58,7 +61,7 @@ namespace nspector.Common
}
}
private static T NonGlobalDrsSession<T>(Func<IntPtr, T> action)
private static T NonGlobalDrsSession<T>(Func<IntPtr, T> action, bool preventLoadSettings = false)
{
IntPtr hSession = IntPtr.Zero;
var csRes = nvw.DRS_CreateSession(ref hSession);
@@ -67,9 +70,12 @@ namespace nspector.Common
try
{
var nvRes = nvw.DRS_LoadSettings(hSession);
if (nvRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_LoadSettings", nvRes);
if (!preventLoadSettings)
{
var nvRes = nvw.DRS_LoadSettings(hSession);
if (nvRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_LoadSettings", nvRes);
}
return action(hSession);
}

View File

@@ -38,6 +38,22 @@ namespace nspector.Common
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");
}
@@ -433,7 +449,7 @@ namespace nspector.Common
}
public List<SettingItem> GetSettingsForProfile(string profileName, SettingViewMode viewMode, ref List<string> applications)
public List<SettingItem> GetSettingsForProfile(string profileName, SettingViewMode viewMode, ref Dictionary<string, string> applications)
{
var result = new List<SettingItem>();
var settingIds = meta.GetSettingIds(viewMode);
@@ -466,7 +482,7 @@ namespace nspector.Common
}
return GetProfileApplications(hSession, hProfile)
.Select(x => x.appName).ToList(); ;
.Select(x => Tuple.Create(x.appName,GetApplicationFingerprint(x))).ToDictionary(x=> x.Item2, x=> x.Item1);
});
@@ -483,24 +499,25 @@ namespace nspector.Common
});
}
public void DeleteApplication(string profileName, string applicationName)
public void RemoveApplication(string profileName, string applicationFingerprint)
{
DrsSession((hSession) =>
{
var hProfile = GetProfileHandle(hSession, profileName);
DeleteApplication(hSession, hProfile, applicationName);
var applications = GetProfileApplications(hSession, hProfile);
foreach (var app in applications)
{
if (GetApplicationFingerprint(app) != applicationFingerprint) continue;
DeleteApplication(hSession, hProfile, app);
break;
}
SaveSettings(hSession);
});
}
public List<string> GetApplications(string profileName)
private string GetApplicationFingerprint(NVDRS_APPLICATION_V3 application)
{
return DrsSession((hSession) =>
{
var hProfile = GetProfileHandle(hSession, profileName);
var applications = GetProfileApplications(hSession, hProfile);
return applications.Select(x => x.appName).ToList();
});
return $"{application.appName}|{application.fileInFolder}|{application.userFriendlyName}|{application.launcher}";
}
}

View File

@@ -41,13 +41,13 @@ namespace nspector.Common
return result;
}
protected void DrsSession(Action<IntPtr> action)
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)
@@ -227,9 +227,9 @@ namespace nspector.Common
}
protected void DeleteApplication(IntPtr hSession, IntPtr hProfile, string applicationName)
protected void DeleteApplication(IntPtr hSession, IntPtr hProfile, NVDRS_APPLICATION_V3 application)
{
var caRes = nvw.DRS_DeleteApplication(hSession, hProfile, new StringBuilder(applicationName));
var caRes = nvw.DRS_DeleteApplicationEx(hSession, hProfile, ref application);
if (caRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_DeleteApplication", caRes);
}

View File

@@ -19,6 +19,9 @@ namespace nspector.Common.Helper
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"); ;

View File

File diff suppressed because it is too large Load Diff

View File

@@ -35,12 +35,13 @@
ANSEL_WHITELISTED_ID = 0x1085DA8A,
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID = 0x104554B6,
APPLICATION_STEAM_ID_ID = 0x107CDDBC,
BATTERY_BOOST_ID = 0x10115C89,
AUTOFL_ID = 0x10834FFE,
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,
FXAA_ALLOW_ID = 0x1034CB89,
FXAA_ENABLE_ID = 0x1074C972,
FXAA_INDICATOR_ENABLE_ID = 0x1068FB9C,
@@ -100,9 +101,9 @@
SET_VAB_DATA_ID = 0x00AB8687,
VSYNCMODE_ID = 0x00A879CF,
VSYNCTEARCONTROL_ID = 0x005A375C,
TOTAL_DWORD_SETTING_NUM = 95,
TOTAL_DWORD_SETTING_NUM = 96,
TOTAL_WSTRING_SETTING_NUM = 4,
TOTAL_SETTING_NUM = 99,
TOTAL_SETTING_NUM = 100,
INVALID_SETTING_ID = 0xFFFFFFFF
}
@@ -209,11 +210,11 @@
}
public enum EValues_OGL_SLI_CFR_MODE : uint {
OGL_SLI_CFR_MODE_CFR = 0x00,
OGL_SLI_CFR_MODE_CLASSIC_SFR = 0x01,
OGL_SLI_CFR_MODE_DISABLE = 0x02,
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_CFR
OGL_SLI_CFR_MODE_DEFAULT = OGL_SLI_CFR_MODE_DISABLE
}
public enum EValues_OGL_SLI_MULTICAST : uint {
@@ -441,13 +442,11 @@
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DEFAULT = APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED
}
public enum EValues_BATTERY_BOOST : uint {
BATTERY_BOOST_MIN = 0x00000001,
BATTERY_BOOST_MAX = 0x000000ff,
BATTERY_BOOST_ENABLED = 0x10000000,
BATTERY_BOOST_DISABLED = 0x00000000,
BATTERY_BOOST_NUM_VALUES = 4,
BATTERY_BOOST_DEFAULT = BATTERY_BOOST_DISABLED
public enum EValues_AUTOFL : uint {
AUTOFL_OFF = 0,
AUTOFL_ON = 1,
AUTOFL_NUM_VALUES = 2,
AUTOFL_DEFAULT = AUTOFL_ON
}
public enum EValues_BATTERY_BOOST_APP_FPS : uint {
@@ -472,6 +471,13 @@
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_FXAA_ALLOW : uint {
FXAA_ALLOW_DISALLOWED = 0,
FXAA_ALLOW_ALLOWED = 1,
@@ -549,9 +555,11 @@
PS_FRAMERATE_LIMITER_FPSMASK = 0x000000ff,
PS_FRAMERATE_LIMITER_NO_ALIGN = 0x00004000,
PS_FRAMERATE_LIMITER_BB_QM = 0x00008000,
PS_FRAMERATE_LIMITER_LOW_LATENCY_AUTO = 0x00010000,
PS_FRAMERATE_LIMITER_LOWER_FPS_TO_ALIGN = 0x00020000,
PS_FRAMERATE_LIMITER_FORCE_VSYNC_OFF = 0x00040000,
PS_FRAMERATE_LIMITER_GPS_WEB = 0x00080000,
PS_FRAMERATE_LIMITER_LOW_LATENCY_LOG = 0x00100000,
PS_FRAMERATE_LIMITER_DISALLOWED = 0x00200000,
PS_FRAMERATE_LIMITER_USE_CPU_WAIT = 0x00400000,
PS_FRAMERATE_LIMITER_NO_LAG_OFFSET = 0x00800000,
@@ -560,8 +568,8 @@
PS_FRAMERATE_LIMITER_FORCEON = 0x40000000,
PS_FRAMERATE_LIMITER_ENABLED = 0x80000000,
PS_FRAMERATE_LIMITER_OPENGL_REMOTE_DESKTOP = 0xe000003c,
PS_FRAMERATE_LIMITER_MASK = 0xf0eec0ff,
PS_FRAMERATE_LIMITER_NUM_VALUES = 19,
PS_FRAMERATE_LIMITER_MASK = 0xf0ffc0ff,
PS_FRAMERATE_LIMITER_NUM_VALUES = 21,
PS_FRAMERATE_LIMITER_DEFAULT = PS_FRAMERATE_LIMITER_DISABLED
}
@@ -600,7 +608,7 @@
PS_FRAMERATE_MONITOR_CTRL_THRESHOLD_PCT_MASK = 0x000000FF,
PS_FRAMERATE_MONITOR_CTRL_MOVING_AVG_X_MASK = 0x00000F00,
PS_FRAMERATE_MONITOR_CTRL_MOVING_AVG_X_SHIFT = 8,
PS_FRAMERATE_MONITOR_CTRL_ENABLE_FINE_GRAINED = 0x00400000,
PS_FRAMERATE_MONITOR_CTRL_LOW_LATENCY_LOG = 0x00100000,
PS_FRAMERATE_MONITOR_CTRL_ENABLE_ON_VSYNC = 0x00800000,
PS_FRAMERATE_MONITOR_CTRL_VSYNC_OFFSET_MASK = 0x0000F000,
PS_FRAMERATE_MONITOR_CTRL_VSYNC_OFFSET_SHIFT = 12,
@@ -671,8 +679,10 @@
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_NUM_VALUES = 25,
SHIM_RENDERING_OPTIONS_DEFAULT = SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE
SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x01000000,
SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x02000000,
SHIM_RENDERING_OPTIONS_NUM_VALUES = 27,
SHIM_RENDERING_OPTIONS_DEFAULT = 0x00000000
}
public enum EValues_SLI_GPU_COUNT : uint {
@@ -868,7 +878,7 @@
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_OFF
WKS_STEREO_DONGLE_SUPPORT_DEFAULT = WKS_STEREO_DONGLE_SUPPORT_DAC
}
public enum EValues_WKS_STEREO_SUPPORT : uint {

View File

@@ -74,12 +74,13 @@
#define ANSEL_WHITELISTED_STRING L"Ansel flags for enabled applications"
#define APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_STRING L"Application Profile Notification Popup Timeout"
#define APPLICATION_STEAM_ID_STRING L"Steam Application ID"
#define BATTERY_BOOST_STRING L"Battery Boost"
#define AUTOFL_STRING L"Platform Boost"
#define BATTERY_BOOST_APP_FPS_STRING L"Battery Boost Application FPS"
#define CPL_HIDDEN_PROFILE_STRING L"Do not display this profile in the Control Panel"
#define CUDA_EXCLUDED_GPUS_STRING L"List of Universal GPU ids"
#define D3DOGL_GPU_MAX_POWER_STRING L"Maximum GPU Power"
#define EXPORT_PERF_COUNTERS_STRING L"Export Performance Counters"
#define EXTERNAL_QUIET_MODE_STRING L"External Quiet Mode (XQM)"
#define FXAA_ALLOW_STRING L"NVIDIA Predefined FXAA Usage"
#define FXAA_ENABLE_STRING L"Enable FXAA"
#define FXAA_INDICATOR_ENABLE_STRING L"Enable FXAA Indicator"
@@ -175,12 +176,13 @@ enum ESetting {
ANSEL_WHITELISTED_ID = 0x1085DA8A,
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID = 0x104554B6,
APPLICATION_STEAM_ID_ID = 0x107CDDBC,
BATTERY_BOOST_ID = 0x10115C89,
AUTOFL_ID = 0x10834FFE,
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,
FXAA_ALLOW_ID = 0x1034CB89,
FXAA_ENABLE_ID = 0x1074C972,
FXAA_INDICATOR_ENABLE_ID = 0x1068FB9C,
@@ -240,9 +242,9 @@ enum ESetting {
SET_VAB_DATA_ID = 0x00AB8687,
VSYNCMODE_ID = 0x00A879CF,
VSYNCTEARCONTROL_ID = 0x005A375C,
TOTAL_DWORD_SETTING_NUM = 95,
TOTAL_DWORD_SETTING_NUM = 96,
TOTAL_WSTRING_SETTING_NUM = 4,
TOTAL_SETTING_NUM = 99,
TOTAL_SETTING_NUM = 100,
INVALID_SETTING_ID = 0xFFFFFFFF
};
@@ -354,11 +356,11 @@ enum EValues_OGL_SINGLE_BACKDEPTH_BUFFER {
};
enum EValues_OGL_SLI_CFR_MODE {
OGL_SLI_CFR_MODE_CFR = 0x00,
OGL_SLI_CFR_MODE_CLASSIC_SFR = 0x01,
OGL_SLI_CFR_MODE_DISABLE = 0x02,
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_CFR
OGL_SLI_CFR_MODE_DEFAULT = OGL_SLI_CFR_MODE_DISABLE
};
enum EValues_OGL_SLI_MULTICAST {
@@ -586,13 +588,11 @@ enum EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT {
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DEFAULT = APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED
};
enum EValues_BATTERY_BOOST {
BATTERY_BOOST_MIN = 0x00000001,
BATTERY_BOOST_MAX = 0x000000ff,
BATTERY_BOOST_ENABLED = 0x10000000,
BATTERY_BOOST_DISABLED = 0x00000000,
BATTERY_BOOST_NUM_VALUES = 4,
BATTERY_BOOST_DEFAULT = BATTERY_BOOST_DISABLED
enum EValues_AUTOFL {
AUTOFL_OFF = 0,
AUTOFL_ON = 1,
AUTOFL_NUM_VALUES = 2,
AUTOFL_DEFAULT = AUTOFL_ON
};
enum EValues_BATTERY_BOOST_APP_FPS {
@@ -625,6 +625,13 @@ enum EValues_EXPORT_PERF_COUNTERS {
EXPORT_PERF_COUNTERS_DEFAULT = EXPORT_PERF_COUNTERS_OFF
};
enum EValues_EXTERNAL_QUIET_MODE {
EXTERNAL_QUIET_MODE_ON = 0x00000001,
EXTERNAL_QUIET_MODE_OFF = 0x00000000,
EXTERNAL_QUIET_MODE_NUM_VALUES = 2,
EXTERNAL_QUIET_MODE_DEFAULT = EXTERNAL_QUIET_MODE_OFF
};
enum EValues_FXAA_ALLOW {
FXAA_ALLOW_DISALLOWED = 0,
FXAA_ALLOW_ALLOWED = 1,
@@ -702,9 +709,11 @@ enum EValues_PS_FRAMERATE_LIMITER {
PS_FRAMERATE_LIMITER_FPSMASK = 0x000000ff,
PS_FRAMERATE_LIMITER_NO_ALIGN = 0x00004000,
PS_FRAMERATE_LIMITER_BB_QM = 0x00008000,
PS_FRAMERATE_LIMITER_LOW_LATENCY_AUTO = 0x00010000,
PS_FRAMERATE_LIMITER_LOWER_FPS_TO_ALIGN = 0x00020000,
PS_FRAMERATE_LIMITER_FORCE_VSYNC_OFF = 0x00040000,
PS_FRAMERATE_LIMITER_GPS_WEB = 0x00080000,
PS_FRAMERATE_LIMITER_LOW_LATENCY_LOG = 0x00100000,
PS_FRAMERATE_LIMITER_DISALLOWED = 0x00200000,
PS_FRAMERATE_LIMITER_USE_CPU_WAIT = 0x00400000,
PS_FRAMERATE_LIMITER_NO_LAG_OFFSET = 0x00800000,
@@ -713,8 +722,8 @@ enum EValues_PS_FRAMERATE_LIMITER {
PS_FRAMERATE_LIMITER_FORCEON = 0x40000000,
PS_FRAMERATE_LIMITER_ENABLED = 0x80000000,
PS_FRAMERATE_LIMITER_OPENGL_REMOTE_DESKTOP = 0xe000003c,
PS_FRAMERATE_LIMITER_MASK = 0xf0eec0ff,
PS_FRAMERATE_LIMITER_NUM_VALUES = 19,
PS_FRAMERATE_LIMITER_MASK = 0xf0ffc0ff,
PS_FRAMERATE_LIMITER_NUM_VALUES = 21,
PS_FRAMERATE_LIMITER_DEFAULT = PS_FRAMERATE_LIMITER_DISABLED
};
@@ -753,7 +762,7 @@ enum EValues_PS_FRAMERATE_MONITOR_CTRL {
PS_FRAMERATE_MONITOR_CTRL_THRESHOLD_PCT_MASK = 0x000000FF,
PS_FRAMERATE_MONITOR_CTRL_MOVING_AVG_X_MASK = 0x00000F00,
PS_FRAMERATE_MONITOR_CTRL_MOVING_AVG_X_SHIFT = 8,
PS_FRAMERATE_MONITOR_CTRL_ENABLE_FINE_GRAINED = 0x00400000,
PS_FRAMERATE_MONITOR_CTRL_LOW_LATENCY_LOG = 0x00100000,
PS_FRAMERATE_MONITOR_CTRL_ENABLE_ON_VSYNC = 0x00800000,
PS_FRAMERATE_MONITOR_CTRL_VSYNC_OFFSET_MASK = 0x0000F000,
PS_FRAMERATE_MONITOR_CTRL_VSYNC_OFFSET_SHIFT = 12,
@@ -824,8 +833,10 @@ enum EValues_SHIM_RENDERING_OPTIONS {
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_NUM_VALUES = 25,
SHIM_RENDERING_OPTIONS_DEFAULT = SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE
SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x01000000,
SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x02000000,
SHIM_RENDERING_OPTIONS_NUM_VALUES = 27,
SHIM_RENDERING_OPTIONS_DEFAULT = 0x00000000
};
enum EValues_SLI_GPU_COUNT {
@@ -1021,7 +1032,7 @@ enum EValues_WKS_STEREO_DONGLE_SUPPORT {
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_OFF
WKS_STEREO_DONGLE_SUPPORT_DEFAULT = WKS_STEREO_DONGLE_SUPPORT_DAC
};
enum EValues_WKS_STEREO_SUPPORT {
@@ -1063,7 +1074,6 @@ enum EValues_AUTO_LODBIASADJUST {
AUTO_LODBIASADJUST_DEFAULT = AUTO_LODBIASADJUST_ON
};
enum EValues_EXPORT_PERF_COUNTERS_DX9_ONLY {
EXPORT_PERF_COUNTERS_DX9_ONLY_OFF = 0x00000000,
EXPORT_PERF_COUNTERS_DX9_ONLY_ON = 0x00000001,

View File

@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NVIDIA Profile Inspector")]
[assembly: AssemblyCopyright("©2019 by Orbmu2k")]
[assembly: AssemblyCopyright("©2020 by Orbmu2k")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@@ -515,6 +515,7 @@
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
//

View File

@@ -10,6 +10,7 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -107,15 +108,16 @@ namespace nspector
return item;
}
private void RefreshApplicationsCombosAndText(List<string> applications)
private void RefreshApplicationsCombosAndText(Dictionary<string,string> applications)
{
lblApplications.Text = "";
tssbRemoveApplication.DropDownItems.Clear();
lblApplications.Text = " " + string.Join(", ", applications);
lblApplications.Text = " " + string.Join(", ", applications.Select(x=>x.Value));
foreach (var app in applications)
{
tssbRemoveApplication.DropDownItems.Add(app, Properties.Resources.ieframe_1_18212);
var item = tssbRemoveApplication.DropDownItems.Add(app.Value, Properties.Resources.ieframe_1_18212);
item.Tag = app.Key;
}
tssbRemoveApplication.Enabled = (tssbRemoveApplication.DropDownItems.Count > 0);
}
@@ -141,7 +143,7 @@ namespace nspector
{
lvSettings.Items.Clear();
lvSettings.Groups.Clear();
var applications = new List<string>();
var applications = new Dictionary<string,string>();
_currentProfileSettingItems = _drs.GetSettingsForProfile(_CurrentProfile, GetSettingViewMode(), ref applications);
RefreshApplicationsCombosAndText(applications);
@@ -667,7 +669,19 @@ namespace nspector
private async Task ScanProfilesSilentAsync(bool scanPredefined, bool showProfileDialog)
{
if (_skipScan)
{
if (scanPredefined && !_alreadyScannedForPredefinedSettings)
{
_alreadyScannedForPredefinedSettings = true;
_meta.ResetMetaCache();
tsbModifiedProfiles.Enabled = true;
exportUserdefinedProfilesToolStripMenuItem.Enabled = false;
RefreshCurrentProfile();
}
return;
}
tsbModifiedProfiles.Enabled = false;
tsbRefreshProfile.Enabled = false;
@@ -685,12 +699,15 @@ namespace nspector
if (scanPredefined && !_alreadyScannedForPredefinedSettings)
{
_alreadyScannedForPredefinedSettings = true;
await _scanner.ScanForPredefinedProfileSettingsAsync(progressHandler, _scannerCancelationTokenSource.Token);
await _scanner.ScanProfileSettingsAsync(false, progressHandler, _scannerCancelationTokenSource.Token);
_meta.ResetMetaCache();
tscbShowScannedUnknownSettings.Enabled = true;
}
await _scanner.ScanForModifiedProfilesAsync(progressHandler, _scannerCancelationTokenSource.Token);
else
{
await _scanner.ScanProfileSettingsAsync(true, progressHandler, _scannerCancelationTokenSource.Token);
}
RefreshModifiesProfilesDropDown();
tsbModifiedProfiles.Enabled = true;
@@ -813,7 +830,7 @@ namespace nspector
new Thread(SetTaskbarIcon).Start();
await ScanProfilesSilentAsync(true, false);
if (!_scannerCancelationTokenSource.Token.IsCancellationRequested && WindowState != FormWindowState.Maximized)
if (_scannerCancelationTokenSource != null && !_scannerCancelationTokenSource.Token.IsCancellationRequested && WindowState != FormWindowState.Maximized)
{
new MessageHelper().bringAppToFront((int)this.Handle);
}
@@ -900,7 +917,7 @@ namespace nspector
//{
// drs.DeleteApplication(currentProfile, e.ClickedItem.Text);
//}
_drs.DeleteApplication(_CurrentProfile, e.ClickedItem.Text);
_drs.RemoveApplication(_CurrentProfile, e.ClickedItem.Tag.ToString());
RefreshCurrentProfile();
}
@@ -1032,6 +1049,7 @@ namespace nspector
{
_import.ImportAllProfilesFromNvidiaTextFile(openDialog.FileName);
MessageBox.Show("Profile(s) successfully imported!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
DrsSessionScope.DestroyGlobalSession();
RefreshAll();
}
catch (NvapiException)
@@ -1184,6 +1202,39 @@ namespace nspector
_scannerCancelationTokenSource?.Cancel();
SaveSettings();
}
private void lvSettings_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.C)
{
CopyModifiedSettingsToClipBoard();
}
}
private void CopyModifiedSettingsToClipBoard()
{
var sbSettings = new StringBuilder();
sbSettings.AppendFormat("{0,-40} {1}\r\n", "### NVIDIA Profile Inspector ###", _CurrentProfile);
foreach (ListViewGroup group in lvSettings.Groups)
{
bool groupTitleAdded = false;
foreach (ListViewItem item in group.Items)
{
if (item.ImageIndex != 0) continue;
if(!groupTitleAdded)
{
sbSettings.AppendFormat("\r\n[{0}]\r\n", group.Header);
groupTitleAdded = true;
}
sbSettings.AppendFormat("{0,-40} {1}\r\n", item.Text, item.SubItems[1].Text);
}
}
Clipboard.SetText(sbSettings.ToString());
}
}
}