diff --git a/NVIDIAInfo/Program.cs b/NVIDIAInfo/Program.cs index e382606..19462e2 100644 --- a/NVIDIAInfo/Program.cs +++ b/NVIDIAInfo/Program.cs @@ -53,15 +53,15 @@ static void Main(string[] args) NLog.LogManager.Configuration = config; // Start the Log file - SharedLogger.logger.Info($"NVIDIAInfo/Main: Starting NVIDIAInfo v1.8.0"); + SharedLogger.logger.Info($"NVIDIAInfo/Main: Starting NVIDIAInfo v1.8.1"); - Console.WriteLine($"\nNVIDIAInfo v1.8.0"); + Console.WriteLine($"\nNVIDIAInfo v1.8.1"); Console.WriteLine($"================="); Console.WriteLine($"By Terry MacDonald (c) 2022\n"); // First check that we have an NVIDIA Video Card in this PC - List videoCardVendors = WinLibrary.GetLibrary().GetCurrentPCIVideoCardVendors(); + List videoCardVendors = WinLibrary.GetLibrary().GetAllPCIVideoCardVendors(); if (!NVIDIALibrary.GetLibrary().PCIVendorIDs.All(value => videoCardVendors.Contains(value))) { SharedLogger.logger.Error($"NVIDIAInfo/Main: There are no NVIDIA Video Cards enabled within this computer. NVIDIAInfo requires at least one NVIDIA Video Card to work. Please use DisplayMagician instead."); diff --git a/NVIDIAInfo/Properties/AssemblyInfo.cs b/NVIDIAInfo/Properties/AssemblyInfo.cs index 289cc98..a635a35 100644 --- a/NVIDIAInfo/Properties/AssemblyInfo.cs +++ b/NVIDIAInfo/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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("1.8.0.0")] -[assembly: AssemblyFileVersion("1.8.0.0")] +[assembly: AssemblyVersion("1.8.1.0")] +[assembly: AssemblyFileVersion("1.8.1.0")] diff --git a/NVIDIAInfo/WinLibrary.cs b/NVIDIAInfo/WinLibrary.cs index e19959c..5b1ac85 100644 --- a/NVIDIAInfo/WinLibrary.cs +++ b/NVIDIAInfo/WinLibrary.cs @@ -254,35 +254,35 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon { Dictionary adapterOldToNewMap = new Dictionary(); - Dictionary currentAdapterMap = GetCurrentAdapterIDs(); + Dictionary currentAdapterMap = GetAllAdapterIDs(); try { - SharedLogger.logger.Trace("WinLibrary/PatchAdapterIDs: Going through the list of adapters we stored in the config to figure out the old adapterIDs"); + SharedLogger.logger.Trace("WinLibrary/PatchWindowsDisplayConfig: Going through the list of adapters we stored in the config to figure out the old adapterIDs"); foreach (KeyValuePair savedAdapter in savedDisplayConfig.DisplayAdapters) { bool adapterMatched = false; foreach (KeyValuePair currentAdapter in currentAdapterMap) { - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Checking if saved adapter {savedAdapter.Key} (AdapterName is {savedAdapter.Value}) is equal to current adapter id {currentAdapter.Key} (AdapterName is {currentAdapter.Value})"); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Checking if saved adapter {savedAdapter.Key} (AdapterName is {savedAdapter.Value}) is equal to current adapter id {currentAdapter.Key} (AdapterName is {currentAdapter.Value})"); if (currentAdapter.Value.Equals(savedAdapter.Value)) { // we have found the new LUID Value for the same adapter // So we want to store it - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: We found that saved adapter {savedAdapter.Key} has now been assigned adapter id {currentAdapter.Key} (AdapterName is {savedAdapter.Value})"); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: We found that saved adapter {savedAdapter.Key} has now been assigned adapter id {currentAdapter.Key} (AdapterName is {savedAdapter.Value})"); adapterOldToNewMap.Add(savedAdapter.Key, currentAdapter.Key); adapterMatched = true; } } if (!adapterMatched) { - SharedLogger.logger.Error($"WinLibrary/PatchAdapterIDs: Saved adapter {savedAdapter.Key} (AdapterName is {savedAdapter.Value}) doesn't have a current match! The adapters have changed since the configuration was last saved."); + SharedLogger.logger.Error($"WinLibrary/PatchWindowsDisplayConfig: Saved adapter {savedAdapter.Key} (AdapterName is {savedAdapter.Value}) doesn't have a current match! The adapters have changed since the configuration was last saved."); } } } catch (Exception ex) { - SharedLogger.logger.Error(ex, "WinLibrary/PatchAdapterIDs: Exception while going through the list of adapters we stored in the config to figure out the old adapterIDs"); + SharedLogger.logger.Error(ex, "WinLibrary/PatchWindowsDisplayConfig: Exception while going through the list of adapters we stored in the config to figure out the old adapterIDs"); } ulong newAdapterValue = 0; @@ -291,7 +291,7 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon try { // Update the DisplayAdapters with the current adapter id - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Going through the display adatpers to update the adapter id"); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Going through the display adatpers to update the adapter id"); ulong[] currentKeys = savedDisplayConfig.DisplayAdapters.Keys.ToArray(); var currentLength = savedDisplayConfig.DisplayAdapters.Count; for (int i = 0; i < currentLength; i++) @@ -311,19 +311,19 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon // Remove the old dictionary key savedDisplayConfig.DisplayAdapters.Remove(oldAdapterValue); } - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Updated DisplayAdapter from adapter {oldAdapterValue} to adapter {newAdapterValue} instead."); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Updated DisplayAdapter from adapter {oldAdapterValue} to adapter {newAdapterValue} instead."); } } } catch (Exception ex) { - SharedLogger.logger.Error(ex, "WinLibrary/PatchAdapterIDs: Exception while going through the display adapters update the adapter ids"); + SharedLogger.logger.Error(ex, "WinLibrary/PatchWindowsDisplayConfig: Exception while going through the display adapters update the adapter ids"); } try { // Update the paths with the current adapter id - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Going through the display config paths to update the adapter id"); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Going through the display config paths to update the adapter id"); for (int i = 0; i < savedDisplayConfig.DisplayConfigPaths.Length; i++) { // Change the Path SourceInfo and TargetInfo AdapterIDs @@ -334,14 +334,14 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId = AdapterValueToLUID(newAdapterValue); newAdapterValue = adapterOldToNewMap[savedDisplayConfig.DisplayConfigPaths[i].TargetInfo.AdapterId.Value]; savedDisplayConfig.DisplayConfigPaths[i].TargetInfo.AdapterId = AdapterValueToLUID(newAdapterValue); - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Updated DisplayConfig Path #{i} from adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} to adapter {newAdapterValue} instead."); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Updated DisplayConfig Path #{i} from adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} to adapter {newAdapterValue} instead."); } else { // if there isn't a matching adapter, then we just pick the first current one and hope that works! // (it is highly likely to... its only if the user has multiple graphics cards with some weird config it may break) newAdapterValue = currentAdapterMap.First().Key; - SharedLogger.logger.Warn($"WinLibrary/PatchAdapterIDs: Uh Oh. Adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} didn't have a current match! It's possible the adapter was swapped or disabled. Attempting to use adapter {newAdapterValue} instead."); + SharedLogger.logger.Warn($"WinLibrary/PatchWindowsDisplayConfig: Uh Oh. Adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} didn't have a current match! It's possible the adapter was swapped or disabled. Attempting to use adapter {newAdapterValue} instead."); savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId = AdapterValueToLUID(newAdapterValue); savedDisplayConfig.DisplayConfigPaths[i].TargetInfo.AdapterId = AdapterValueToLUID(newAdapterValue); } @@ -349,13 +349,13 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon } catch (Exception ex) { - SharedLogger.logger.Error(ex, "WinLibrary/PatchAdapterIDs: Exception while going through the display config paths to update the adapter id"); + SharedLogger.logger.Error(ex, "WinLibrary/PatchWindowsDisplayConfig: Exception while going through the display config paths to update the adapter id"); } try { - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Going through the display config modes to update the adapter id"); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Going through the display config modes to update the adapter id"); // Update the modes with the current adapter id for (int i = 0; i < savedDisplayConfig.DisplayConfigModes.Length; i++) { @@ -365,27 +365,27 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon // We get here if there is a matching adapter newAdapterValue = adapterOldToNewMap[savedDisplayConfig.DisplayConfigModes[i].AdapterId.Value]; savedDisplayConfig.DisplayConfigModes[i].AdapterId = AdapterValueToLUID(newAdapterValue); - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Updated DisplayConfig Mode #{i} from adapter {savedDisplayConfig.DisplayConfigModes[i].AdapterId.Value} to adapter {newAdapterValue} instead."); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Updated DisplayConfig Mode #{i} from adapter {savedDisplayConfig.DisplayConfigModes[i].AdapterId.Value} to adapter {newAdapterValue} instead."); } else { // if there isn't a matching adapter, then we just pick the first current one and hope that works! // (it is highly likely to... its only if the user has multiple graphics cards with some weird config it may break) newAdapterValue = currentAdapterMap.First().Key; - SharedLogger.logger.Warn($"WinLibrary/PatchAdapterIDs: Uh Oh. Adapter {savedDisplayConfig.DisplayConfigModes[i].AdapterId.Value} didn't have a current match! It's possible the adapter was swapped or disabled. Attempting to use adapter {newAdapterValue} instead."); + SharedLogger.logger.Warn($"WinLibrary/PatchWindowsDisplayConfig: Uh Oh. Adapter {savedDisplayConfig.DisplayConfigModes[i].AdapterId.Value} didn't have a current match! It's possible the adapter was swapped or disabled. Attempting to use adapter {newAdapterValue} instead."); savedDisplayConfig.DisplayConfigModes[i].AdapterId = AdapterValueToLUID(newAdapterValue); } } } catch (Exception ex) { - SharedLogger.logger.Error(ex, "WinLibrary/PatchAdapterIDs: Exception while going through the display config modes to update the adapter id"); + SharedLogger.logger.Error(ex, "WinLibrary/PatchWindowsDisplayConfig: Exception while going through the display config modes to update the adapter id"); } try { - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Going through the display config HDR info to update the adapter id"); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Going through the display config HDR info to update the adapter id"); if (savedDisplayConfig.DisplayHDRStates.Count > 0) { // Update the HDRInfo with the current adapter id @@ -395,7 +395,7 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon // Change the Mode AdapterID if (adapterOldToNewMap.ContainsKey(savedDisplayConfig.DisplayHDRStates[i].AdapterId.Value)) { - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: adapterOldToNewMap contains adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} so using the new adapter ID of {newAdapterValue} instead."); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: adapterOldToNewMap contains adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} so using the new adapter ID of {newAdapterValue} instead."); // We get here if there is a matching adapter newAdapterValue = adapterOldToNewMap[savedDisplayConfig.DisplayHDRStates[i].AdapterId.Value]; hdrInfo.AdapterId = AdapterValueToLUID(newAdapterValue); @@ -403,14 +403,14 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon hdrInfo.AdvancedColorInfo.Header.AdapterId = AdapterValueToLUID(newAdapterValue); newAdapterValue = adapterOldToNewMap[savedDisplayConfig.DisplayHDRStates[i].SDRWhiteLevel.Header.AdapterId.Value]; hdrInfo.SDRWhiteLevel.Header.AdapterId = AdapterValueToLUID(newAdapterValue); - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Updated Display HDR state #{i} from adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} to adapter {newAdapterValue} instead."); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Updated Display HDR state #{i} from adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} to adapter {newAdapterValue} instead."); } else { // if there isn't a matching adapter, then we just pick the first current one and hope that works! // (it is highly likely to... its only if the user has multiple graphics cards with some weird config it may break) newAdapterValue = currentAdapterMap.First().Key; - SharedLogger.logger.Warn($"WinLibrary/PatchAdapterIDs: Uh Oh. Adapter {savedDisplayConfig.DisplayHDRStates[i].AdapterId.Value} didn't have a current match! It's possible the adapter was swapped or disabled. Attempting to use adapter {newAdapterValue} instead."); + SharedLogger.logger.Warn($"WinLibrary/PatchWindowsDisplayConfig: Uh Oh. Adapter {savedDisplayConfig.DisplayHDRStates[i].AdapterId.Value} didn't have a current match! It's possible the adapter was swapped or disabled. Attempting to use adapter {newAdapterValue} instead."); hdrInfo.AdapterId = AdapterValueToLUID(newAdapterValue); hdrInfo.AdvancedColorInfo.Header.AdapterId = AdapterValueToLUID(newAdapterValue); hdrInfo.SDRWhiteLevel.Header.AdapterId = AdapterValueToLUID(newAdapterValue); @@ -420,18 +420,18 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon } else { - SharedLogger.logger.Warn($"WinLibrary/PatchAdapterIDs: There are no Display HDR states to update. Skipping."); + SharedLogger.logger.Warn($"WinLibrary/PatchWindowsDisplayConfig: There are no Display HDR states to update. Skipping."); } } catch (Exception ex) { - SharedLogger.logger.Error(ex, "WinLibrary/PatchAdapterIDs: Exception while going through the display config HDR info to update the adapter id"); + SharedLogger.logger.Error(ex, "WinLibrary/PatchWindowsDisplayConfig: Exception while going through the display config HDR info to update the adapter id"); } try { - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Going through the display sources list info to update the adapter id"); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Going through the display sources list info to update the adapter id"); // Update the DisplaySources with the current adapter id for (int i = 0; i < savedDisplayConfig.DisplaySources.Count; i++) { @@ -447,7 +447,7 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon // We get here if there is a matching adapter newAdapterValue = adapterOldToNewMap[ds.AdapterId.Value]; ds.AdapterId = AdapterValueToLUID(newAdapterValue); - SharedLogger.logger.Trace($"WinLibrary/PatchAdapterIDs: Updated DisplaySource #{i} from adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} to adapter {newAdapterValue} instead."); + SharedLogger.logger.Trace($"WinLibrary/PatchWindowsDisplayConfig: Updated DisplaySource #{i} from adapter {savedDisplayConfig.DisplayConfigPaths[i].SourceInfo.AdapterId.Value} to adapter {newAdapterValue} instead."); } else { @@ -464,7 +464,7 @@ public void PatchWindowsDisplayConfig(ref WINDOWS_DISPLAY_CONFIG savedDisplayCon } catch (Exception ex) { - SharedLogger.logger.Error(ex, "WinLibrary/PatchAdapterIDs: Exception while going through the display sources list info to update the adapter id"); + SharedLogger.logger.Error(ex, "WinLibrary/PatchWindowsDisplayConfig: Exception while going through the display sources list info to update the adapter id"); } } @@ -668,7 +668,7 @@ private WINDOWS_DISPLAY_CONFIG GetWindowsDisplayConfig(QDC selector = QDC.QDC_ON paths[i].TargetInfo.ModeInfoIdx = CCDImport.DISPLAYCONFIG_PATH_MODE_IDX_INVALID; } - // Get adapter ID for later + /*// Get adapter ID for later SharedLogger.logger.Trace($"WinLibrary/GetWindowsDisplayConfig: Attempting to get adapter name for adapter {paths[i].TargetInfo.AdapterId.Value}."); if (!windowsDisplayConfig.DisplayAdapters.ContainsKey(paths[i].TargetInfo.AdapterId.Value)) { @@ -695,7 +695,7 @@ private WINDOWS_DISPLAY_CONFIG GetWindowsDisplayConfig(QDC selector = QDC.QDC_ON // We already have the adapter name SharedLogger.logger.Trace($"WinLibrary/GetWindowsDisplayConfig: We already have the adapter name {windowsDisplayConfig.DisplayAdapters[paths[i].TargetInfo.AdapterId.Value]} for adapter {paths[i].TargetInfo.AdapterId.Value} so skipping storing it."); //gotAdapterName = true; - } + }*/ // Get advanced color info @@ -774,6 +774,9 @@ private WINDOWS_DISPLAY_CONFIG GetWindowsDisplayConfig(QDC selector = QDC.QDC_ON } } + // Get all the DisplayAdapters currently in the system + // This will be used for windows to translate the adapter details beween reboots + windowsDisplayConfig.DisplayAdapters = GetAllAdapterIDs(); // Go through the list of physicalTargetIdsAvailable // ignore the ones that were found @@ -2132,7 +2135,7 @@ private List GetSomeDisplayIdentifiers(QDC selector = QDC.QDC_ONLY_ACTIV return displayIdentifiers; } - public List GetCurrentPCIVideoCardVendors() + public List GetAllPCIVideoCardVendors() { SharedLogger.logger.Trace($"WinLibrary/GetCurrentPCIVideoCardVendors: Getting the current PCI vendor ids for the videocards reported to Windows"); List videoCardVendorIds = new List(); @@ -2283,56 +2286,56 @@ public List GetCurrentPCIVideoCardVendors() } - public Dictionary GetCurrentAdapterIDs() + public Dictionary GetAllAdapterIDs() { - SharedLogger.logger.Trace($"WinLibrary/GetCurrentAdapterIDs: Getting the current adapter ids for the videocards Windows knows about"); + SharedLogger.logger.Trace($"WinLibrary/GetAllAdapterIDs: Getting the current adapter ids for the videocards Windows knows about"); Dictionary currentAdapterMap = new Dictionary(); - SharedLogger.logger.Trace($"WinLibrary/GetCurrentAdapterIDs: Testing whether the display configuration is valid (allowing tweaks)."); + SharedLogger.logger.Trace($"WinLibrary/GetAllAdapterIDs: Testing whether the display configuration is valid (allowing tweaks)."); // Get the size of the largest All Paths and Modes arrays int pathCount = 0; int modeCount = 0; WIN32STATUS err = CCDImport.GetDisplayConfigBufferSizes(QDC.QDC_ALL_PATHS, out pathCount, out modeCount); if (err != WIN32STATUS.ERROR_SUCCESS) { - SharedLogger.logger.Error($"WinLibrary/GetCurrentAdapterIDs: ERROR - GetDisplayConfigBufferSizes returned WIN32STATUS {err} when trying to get the maximum path and mode sizes"); - throw new WinLibraryException($"GetCurrentAdapterIDs returned WIN32STATUS {err} when trying to get the maximum path and mode sizes"); + SharedLogger.logger.Error($"WinLibrary/GetAllAdapterIDs: ERROR - GetDisplayConfigBufferSizes returned WIN32STATUS {err} when trying to get the maximum path and mode sizes"); + throw new WinLibraryException($"GetAllAdapterIDs returned WIN32STATUS {err} when trying to get the maximum path and mode sizes"); } - SharedLogger.logger.Trace($"WinLibrary/GetCurrentAdapterIDs: Getting the current Display Config path and mode arrays"); + SharedLogger.logger.Trace($"WinLibrary/GetAllAdapterIDs: Getting the current Display Config path and mode arrays"); var paths = new DISPLAYCONFIG_PATH_INFO[pathCount]; var modes = new DISPLAYCONFIG_MODE_INFO[modeCount]; err = CCDImport.QueryDisplayConfig(QDC.QDC_ALL_PATHS, ref pathCount, paths, ref modeCount, modes, IntPtr.Zero); if (err == WIN32STATUS.ERROR_INSUFFICIENT_BUFFER) { - SharedLogger.logger.Warn($"WinLibrary/GetCurrentAdapterIDs: The displays were modified between GetDisplayConfigBufferSizes and QueryDisplayConfig so we need to get the buffer sizes again."); - SharedLogger.logger.Trace($"WinLibrary/GetCurrentAdapterIDs: Getting the size of the largest Active Paths and Modes arrays"); + SharedLogger.logger.Warn($"WinLibrary/GetAllAdapterIDs: The displays were modified between GetDisplayConfigBufferSizes and QueryDisplayConfig so we need to get the buffer sizes again."); + SharedLogger.logger.Trace($"WinLibrary/GetAllAdapterIDs: Getting the size of the largest Active Paths and Modes arrays"); // Screen changed in between GetDisplayConfigBufferSizes and QueryDisplayConfig, so we need to get buffer sizes again // as per https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-querydisplayconfig err = CCDImport.GetDisplayConfigBufferSizes(QDC.QDC_ALL_PATHS, out pathCount, out modeCount); if (err != WIN32STATUS.ERROR_SUCCESS) { - SharedLogger.logger.Error($"WinLibrary/GetCurrentAdapterIDs: ERROR - GetDisplayConfigBufferSizes returned WIN32STATUS {err} when trying to get the maximum path and mode sizes again"); + SharedLogger.logger.Error($"WinLibrary/GetAllAdapterIDs: ERROR - GetDisplayConfigBufferSizes returned WIN32STATUS {err} when trying to get the maximum path and mode sizes again"); throw new WinLibraryException($"GetDisplayConfigBufferSizes returned WIN32STATUS {err} when trying to get the maximum path and mode sizes again"); } - SharedLogger.logger.Trace($"WinLibrary/GetCurrentAdapterIDs: Getting the current Display Config path and mode arrays"); + SharedLogger.logger.Trace($"WinLibrary/GetAllAdapterIDs: Getting the current Display Config path and mode arrays"); paths = new DISPLAYCONFIG_PATH_INFO[pathCount]; modes = new DISPLAYCONFIG_MODE_INFO[modeCount]; err = CCDImport.QueryDisplayConfig(QDC.QDC_ALL_PATHS, ref pathCount, paths, ref modeCount, modes, IntPtr.Zero); if (err == WIN32STATUS.ERROR_INSUFFICIENT_BUFFER) { - SharedLogger.logger.Error($"WinLibrary/GetCurrentAdapterIDs: ERROR - The displays were still modified between GetDisplayConfigBufferSizes and QueryDisplayConfig, even though we tried twice. Something is wrong."); + SharedLogger.logger.Error($"WinLibrary/GetAllAdapterIDs: ERROR - The displays were still modified between GetDisplayConfigBufferSizes and QueryDisplayConfig, even though we tried twice. Something is wrong."); throw new WinLibraryException($"The displays were still modified between GetDisplayConfigBufferSizes and QueryDisplayConfig, even though we tried twice. Something is wrong."); } else if (err != WIN32STATUS.ERROR_SUCCESS) { - SharedLogger.logger.Error($"WinLibrary/GetCurrentAdapterIDs: ERROR - QueryDisplayConfig returned WIN32STATUS {err} when trying to query all available displays again"); + SharedLogger.logger.Error($"WinLibrary/GetAllAdapterIDs: ERROR - QueryDisplayConfig returned WIN32STATUS {err} when trying to query all available displays again"); throw new WinLibraryException($"QueryDisplayConfig returned WIN32STATUS {err} when trying to query all available displays again."); } } else if (err != WIN32STATUS.ERROR_SUCCESS) { - SharedLogger.logger.Error($"WinLibrary/GetCurrentAdapterIDs: ERROR - QueryDisplayConfig returned WIN32STATUS {err} when trying to query all available displays"); + SharedLogger.logger.Error($"WinLibrary/GetAllAdapterIDs: ERROR - QueryDisplayConfig returned WIN32STATUS {err} when trying to query all available displays"); throw new WinLibraryException($"QueryDisplayConfig returned WIN32STATUS {err} when trying to query all available displays."); } @@ -2341,7 +2344,7 @@ public Dictionary GetCurrentAdapterIDs() if (path.TargetInfo.TargetAvailable == false) { // We want to skip this one cause it's not valid - SharedLogger.logger.Trace($"WinLibrary/GetCurrentAdapterIDs: Skipping path due to TargetAvailable not existing in display #{path.TargetInfo.Id}"); + SharedLogger.logger.Trace($"WinLibrary/GetAllAdapterIDs: Skipping path due to TargetAvailable not existing in display #{path.TargetInfo.Id}"); continue; } @@ -2354,12 +2357,12 @@ public Dictionary GetCurrentAdapterIDs() err = CCDImport.DisplayConfigGetDeviceInfo(ref adapterInfo); if (err == WIN32STATUS.ERROR_SUCCESS) { - SharedLogger.logger.Trace($"WinLibrary/GetCurrentAdapterIDs: Successfully got the display name info from {path.TargetInfo.Id}."); + SharedLogger.logger.Trace($"WinLibrary/GetAllAdapterIDs: Successfully got the display name info from {path.TargetInfo.Id}."); currentAdapterMap[path.TargetInfo.AdapterId.Value] = adapterInfo.AdapterDevicePath; } else { - SharedLogger.logger.Warn($"WinLibrary/GetCurrentAdapterIDs: WARNING - DisplayConfigGetDeviceInfo returned WIN32STATUS {err} when trying to get the target info for display #{path.TargetInfo.Id}"); + SharedLogger.logger.Warn($"WinLibrary/GetAllAdapterIDs: WARNING - DisplayConfigGetDeviceInfo returned WIN32STATUS {err} when trying to get the target info for display #{path.TargetInfo.Id}"); } }