# HG changeset patch # User moel.mich # Date 1326641703 0 # Node ID 013e148e8f1201e5b76a1a0895669698e59d1a75 # Parent c34cbcc7df66040b712585537c449d807a64c403 Fixed Issue 209. diff -r c34cbcc7df66 -r 013e148e8f12 Hardware/Nvidia/NVAPI.cs --- a/Hardware/Nvidia/NVAPI.cs Sun Jan 15 15:07:23 2012 +0000 +++ b/Hardware/Nvidia/NVAPI.cs Sun Jan 15 15:35:03 2012 +0000 @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2011 + Portions created by the Initial Developer are Copyright (C) 2009-2012 the Initial Developer. All Rights Reserved. Contributor(s): @@ -299,6 +299,9 @@ nvDisplayDriverVersion); public delegate NvStatus NvAPI_GetInterfaceVersionStringDelegate( StringBuilder version); + public delegate NvStatus NvAPI_GPU_GetPCIIdentifiersDelegate( + NvPhysicalGpuHandle gpuHandle, out uint deviceId, out uint subSystemId, + out uint revisionId, out uint extDeviceId); private static readonly bool available; private static readonly nvapi_QueryInterfaceDelegate nvapi_QueryInterface; @@ -332,6 +335,8 @@ NvAPI_GPU_GetMemoryInfo; public static readonly NvAPI_GetDisplayDriverVersionDelegate NvAPI_GetDisplayDriverVersion; + public static readonly NvAPI_GPU_GetPCIIdentifiersDelegate + NvAPI_GPU_GetPCIIdentifiers; private NVAPI() { } @@ -406,6 +411,7 @@ GetDelegate(0x774AA982, out NvAPI_GPU_GetMemoryInfo); GetDelegate(0xF951A4D1, out NvAPI_GetDisplayDriverVersion); GetDelegate(0x01053FA5, out _NvAPI_GetInterfaceVersionString); + GetDelegate(0x2DDFB66E, out NvAPI_GPU_GetPCIIdentifiers); available = true; } diff -r c34cbcc7df66 -r 013e148e8f12 Hardware/Nvidia/NvidiaGPU.cs --- a/Hardware/Nvidia/NvidiaGPU.cs Sun Jan 15 15:07:23 2012 +0000 +++ b/Hardware/Nvidia/NvidiaGPU.cs Sun Jan 15 15:35:03 2012 +0000 @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2011 + Portions created by the Initial Developer are Copyright (C) 2009-2012 the Initial Developer. All Rights Reserved. Contributor(s): @@ -265,6 +265,25 @@ } r.AppendLine(); + if (NVAPI.NvAPI_GPU_GetPCIIdentifiers != null) { + uint deviceId, subSystemId, revisionId, extDeviceId; + + NvStatus status = NVAPI.NvAPI_GPU_GetPCIIdentifiers(handle, + out deviceId, out subSystemId, out revisionId, out extDeviceId); + + if (status == NvStatus.OK) { + r.Append("DeviceID: 0x"); + r.AppendLine(deviceId.ToString("X", CultureInfo.InvariantCulture)); + r.Append("SubSystemID: 0x"); + r.AppendLine(subSystemId.ToString("X", CultureInfo.InvariantCulture)); + r.Append("RevisionID: 0x"); + r.AppendLine(revisionId.ToString("X", CultureInfo.InvariantCulture)); + r.Append("ExtDeviceID: 0x"); + r.AppendLine(extDeviceId.ToString("X", CultureInfo.InvariantCulture)); + r.AppendLine(); + } + } + if (NVAPI.NvAPI_GPU_GetThermalSettings != null) { NvGPUThermalSettings settings = new NvGPUThermalSettings(); settings.Version = NVAPI.GPU_THERMAL_SETTINGS_VER;