Fixed Issue 209.
authormoel.mich
Sun, 15 Jan 2012 15:35:03 +0000
changeset 334013e148e8f12
parent 333 c34cbcc7df66
child 335 9549c46bebb1
Fixed Issue 209.
Hardware/Nvidia/NVAPI.cs
Hardware/Nvidia/NvidiaGPU.cs
     1.1 --- a/Hardware/Nvidia/NVAPI.cs	Sun Jan 15 15:07:23 2012 +0000
     1.2 +++ b/Hardware/Nvidia/NVAPI.cs	Sun Jan 15 15:35:03 2012 +0000
     1.3 @@ -16,7 +16,7 @@
     1.4  
     1.5    The Initial Developer of the Original Code is 
     1.6    Michael Möller <m.moeller@gmx.ch>.
     1.7 -  Portions created by the Initial Developer are Copyright (C) 2009-2011
     1.8 +  Portions created by the Initial Developer are Copyright (C) 2009-2012
     1.9    the Initial Developer. All Rights Reserved.
    1.10  
    1.11    Contributor(s):
    1.12 @@ -299,6 +299,9 @@
    1.13        nvDisplayDriverVersion);
    1.14      public delegate NvStatus NvAPI_GetInterfaceVersionStringDelegate(
    1.15        StringBuilder version);
    1.16 +    public delegate NvStatus NvAPI_GPU_GetPCIIdentifiersDelegate(
    1.17 +      NvPhysicalGpuHandle gpuHandle, out uint deviceId, out uint subSystemId, 
    1.18 +      out uint revisionId, out uint extDeviceId);
    1.19  
    1.20      private static readonly bool available;
    1.21      private static readonly nvapi_QueryInterfaceDelegate nvapi_QueryInterface;
    1.22 @@ -332,6 +335,8 @@
    1.23        NvAPI_GPU_GetMemoryInfo;
    1.24      public static readonly NvAPI_GetDisplayDriverVersionDelegate
    1.25        NvAPI_GetDisplayDriverVersion;
    1.26 +    public static readonly NvAPI_GPU_GetPCIIdentifiersDelegate
    1.27 +      NvAPI_GPU_GetPCIIdentifiers;
    1.28  
    1.29      private NVAPI() { }
    1.30  
    1.31 @@ -406,6 +411,7 @@
    1.32          GetDelegate(0x774AA982, out NvAPI_GPU_GetMemoryInfo);
    1.33          GetDelegate(0xF951A4D1, out NvAPI_GetDisplayDriverVersion);
    1.34          GetDelegate(0x01053FA5, out _NvAPI_GetInterfaceVersionString);
    1.35 +        GetDelegate(0x2DDFB66E, out NvAPI_GPU_GetPCIIdentifiers);
    1.36  
    1.37          available = true;
    1.38        }
     2.1 --- a/Hardware/Nvidia/NvidiaGPU.cs	Sun Jan 15 15:07:23 2012 +0000
     2.2 +++ b/Hardware/Nvidia/NvidiaGPU.cs	Sun Jan 15 15:35:03 2012 +0000
     2.3 @@ -16,7 +16,7 @@
     2.4  
     2.5    The Initial Developer of the Original Code is 
     2.6    Michael Möller <m.moeller@gmx.ch>.
     2.7 -  Portions created by the Initial Developer are Copyright (C) 2009-2011
     2.8 +  Portions created by the Initial Developer are Copyright (C) 2009-2012
     2.9    the Initial Developer. All Rights Reserved.
    2.10  
    2.11    Contributor(s):
    2.12 @@ -265,6 +265,25 @@
    2.13        }
    2.14        r.AppendLine();
    2.15  
    2.16 +      if (NVAPI.NvAPI_GPU_GetPCIIdentifiers != null) {
    2.17 +        uint deviceId, subSystemId, revisionId, extDeviceId;
    2.18 +
    2.19 +        NvStatus status = NVAPI.NvAPI_GPU_GetPCIIdentifiers(handle, 
    2.20 +          out deviceId, out subSystemId, out revisionId, out extDeviceId);
    2.21 +
    2.22 +        if (status == NvStatus.OK) {
    2.23 +          r.Append("DeviceID: 0x");
    2.24 +          r.AppendLine(deviceId.ToString("X", CultureInfo.InvariantCulture));
    2.25 +          r.Append("SubSystemID: 0x");
    2.26 +          r.AppendLine(subSystemId.ToString("X", CultureInfo.InvariantCulture));
    2.27 +          r.Append("RevisionID: 0x");
    2.28 +          r.AppendLine(revisionId.ToString("X", CultureInfo.InvariantCulture));
    2.29 +          r.Append("ExtDeviceID: 0x");
    2.30 +          r.AppendLine(extDeviceId.ToString("X", CultureInfo.InvariantCulture));
    2.31 +          r.AppendLine();
    2.32 +        }
    2.33 +      }
    2.34 +
    2.35        if (NVAPI.NvAPI_GPU_GetThermalSettings != null) {
    2.36          NvGPUThermalSettings settings = new NvGPUThermalSettings();
    2.37          settings.Version = NVAPI.GPU_THERMAL_SETTINGS_VER;