From 966b8336de6dacf2a86d0ae85cdee78efc081d38 Mon Sep 17 00:00:00 2001 From: Vincent Maas Date: Wed, 28 Jun 2023 10:35:40 +0200 Subject: [PATCH] fixed final content type issues and message form width --- ColorControl/ColorControl.csproj | 4 ++-- ColorControl/MainForm.cs | 2 +- ColorControl/Services/NVIDIA/NvService.cs | 7 ++++--- Nspector/Native/NVAPI/NvapiDrsWrapper.cs | 14 +++++++++++--- Shared/Forms/MessageForms.cs | 5 ++++- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ColorControl/ColorControl.csproj b/ColorControl/ColorControl.csproj index 036f6b7..620f600 100644 --- a/ColorControl/ColorControl.csproj +++ b/ColorControl/ColorControl.csproj @@ -18,8 +18,8 @@ Maassoft Maassoft 0 - 9.6.0.0 - 9.6.0.0 + 9.6.1.0 + 9.6.1.0 false true false diff --git a/ColorControl/MainForm.cs b/ColorControl/MainForm.cs index d06a342..764afa5 100644 --- a/ColorControl/MainForm.cs +++ b/ColorControl/MainForm.cs @@ -1014,7 +1014,7 @@ NOTE: installing the service may cause a User Account Control popup."); private async Task CheckForUpdates() { - if (!_config.CheckForUpdates || _checkedForUpdates || Debugger.IsAttached) + if (!_config.CheckForUpdates || _checkedForUpdates/* || Debugger.IsAttached*/) { return; } diff --git a/ColorControl/Services/NVIDIA/NvService.cs b/ColorControl/Services/NVIDIA/NvService.cs index 83b1735..ac55b80 100644 --- a/ColorControl/Services/NVIDIA/NvService.cs +++ b/ColorControl/Services/NVIDIA/NvService.cs @@ -712,14 +712,15 @@ namespace ColorControl.Services.NVIDIA infoValue.SetContentType(contentType); - displayDevice.SetHDMIVideoFrameInformation(infoValue); + displayDevice.SetHDMIVideoFrameInformation(infoValue, true); } } + public InfoFrameVideoContentType GetHDMIContentType(Display display) { var displayDevice = display.DisplayDevice; - var info = displayDevice.HDMIVideoFrameCurrentInformation; + var info = displayDevice.HDMIVideoFrameOverrideInformation ?? displayDevice.HDMIVideoFrameCurrentInformation; return info.HasValue ? info.Value.ContentType : InfoFrameVideoContentType.Auto; } @@ -989,7 +990,7 @@ namespace ColorControl.Services.NVIDIA _settings.AddRange(normalSettings); _driverSettingIds.Clear(); - _driverSettingIds.AddRange(_settings.Where(s => !s.IsStringValue && !s.SettingText.Contains("SLI")).Select(s => s.SettingId)); + _driverSettingIds.AddRange(_settings.Where(s => !s.IsStringValue && !s.SettingText.Contains("SLI") && s.GroupName != null && s.GroupName != "Unknown").Select(s => s.SettingId)); if (firstTime) { diff --git a/Nspector/Native/NVAPI/NvapiDrsWrapper.cs b/Nspector/Native/NVAPI/NvapiDrsWrapper.cs index 6998003..2541d85 100644 --- a/Nspector/Native/NVAPI/NvapiDrsWrapper.cs +++ b/Nspector/Native/NVAPI/NvapiDrsWrapper.cs @@ -644,7 +644,7 @@ namespace nspector.Native.NVAPI2 NvAPI_Status res; var settingIdArray = new uint[maxCount]; var pSettingIds = IntPtr.Zero; - NativeArrayHelper.SetArrayData(settingIdArray, out pSettingIds); + NativeArrayHelper.SetArrayDataNative(settingIdArray, out pSettingIds); try { res = DRS_EnumAvailableSettingIdsInternal(pSettingIds, ref maxCount); @@ -662,9 +662,17 @@ namespace nspector.Native.NVAPI2 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate NvAPI_Status DRS_EnumAvailableSettingValuesDelegate(uint settingId, ref uint pMaxNumValues, IntPtr pSettingValues); private static readonly DRS_EnumAvailableSettingValuesDelegate DRS_EnumAvailableSettingValuesInternal; + + [ThreadStatic] + private static IntPtr pSettingValues; + 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))); + if (pSettingValues == IntPtr.Zero) + { + pSettingValues = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NVDRS_SETTING_VALUES))); + } + NvAPI_Status res; try { @@ -675,7 +683,7 @@ namespace nspector.Native.NVAPI2 } finally { - Marshal.FreeHGlobal(pSettingValues); + //Marshal.FreeHGlobal(pSettingValues); } return res; } diff --git a/Shared/Forms/MessageForms.cs b/Shared/Forms/MessageForms.cs index 6e19251..d891bdf 100644 --- a/Shared/Forms/MessageForms.cs +++ b/Shared/Forms/MessageForms.cs @@ -143,6 +143,7 @@ namespace ColorControl.Shared.Forms var top = 10; var boxes = new List(); + var labels = new List