dilemma

ADL how to use ADL.ADL_Overdrive5_ODPerformanceLevels_Get

Discussion created by dilemma on Mar 18, 2010
Latest reply on Aug 12, 2010 by nbsi

Dears,

I want to use ADL.ADL_Overdrive5_ODPerformanceLevels_Get to get some level informations, but I try a lot of times , still fail.

I don't know how to declare the structure and pass to ADL.ADL_Overdrive5_ODPerformanceLevels_Get

Here is my code.

I still don't what is the meaning of

" Array of performance state descriptors. Must have ADLODParameters.iNumberOfPerformanceLevels elements."

about the ADLODPerformanceLevels.aLevels

Whould please any professions give me some advise...

Thanks a lot

 

[StructLayout(LayoutKind.Sequential)] internal struct ADLODPerformanceLevel { internal int iEngineClock; //Engine clock. internal int iMemoryClock; //Memory clock. internal int iVddc; //Core voltage. } [StructLayout(LayoutKind.Sequential)] internal struct ADLODPerformanceLevels { internal int iSize; //Must be set to sizeof( ADLODPerformanceLevels ) + sizeof( ADLODPerformanceLevel ) * (ADLODParameters.iNumberOfPerformanceLevels - 1). internal int iReserved; internal ADLODPerformanceLevel[] aLevels; //Array of performance state descriptors. Must have ADLODParameters.iNumberOfPerformanceLevels elements. } ADLRet = -1; ADLODPerformanceLevels OverDrive_PerformanceLevels = new ADLODPerformanceLevels(); ADLODPerformanceLevel pp = new ADLODPerformanceLevel(); OverDrive_PerformanceLevels.aLevels = new ADLODPerformanceLevel[1]; OverDrive_PerformanceLevels.iSize = System.Runtime.InteropServices.Marshal.SizeOf(OverDrive_PerformanceLevels) + System.Runtime.InteropServices.Marshal.SizeOf(pp) * (OverDrive5ParameterRange.iNumberOfPerformanceLevels - 1); if (null != ADL.ADL_Overdrive5_ODPerformanceLevels_Get) { ADLRet = ADL.ADL_Overdrive5_ODPerformanceLevels_Get(0, 1,ref OverDrive_PerformanceLevels); } else { textBox3.Text = "Function Not Found!!" + "\r\n"; } if (ADL.ADL_SUCCESS == ADLRet) { } else { textBox3.Text = "Function Error!! " + ADLRet.ToString () + "\r\n"; }

Outcomes