9 Replies Latest reply on Nov 22, 2013 12:50 PM by hotter

    ADL_Overdrive5_Temperature_Get Returns -100

    ahmetmahmet

      I'm using ADL_Overdrive5_Temperature_Get to get temperature of GPU. But it doesn't work correctly. It should return 0 but it returns -100. The interesting side of this is return value doesn't exist in defined error codes. What is the problem? Thanks. (Sorry for my bad English.)

        • Re: ADL_Overdrive5_Temperature_Get Returns -100
          ahmetmahmet

          My graphics card ATI Mobility Radeon HD 4650.

          1 of 1 people found this helpful
            • Re: ADL_Overdrive5_Temperature_Get Returns -100

              Hello!

              Can you please post the code that you are using to get -100?

               

              Cheers!

              Kristen

              1 of 1 people found this helpful
                • Re: ADL_Overdrive5_Temperature_Get Returns -100
                  ahmetmahmet

                  #include <Windows.h>

                   

                   

                   

                   

                  #include "adl_sdk.h"

                   

                   

                   

                   

                   

                   

                  #include <iostream>

                   

                   

                   

                   

                   

                   

                  using std::cout;

                  using std::cerr;

                  using std::cin;

                   

                   

                   

                   

                   

                   

                  typedef int (* ADL_MAIN_CONTROL_CREATE)(ADL_MAIN_MALLOC_CALLBACK, int);                              // ADL_Main_Control_Create

                  typedef int (* ADL_MAIN_CONTROL_DESTROY)();                                                                                                    // ADL_Main_Control_Destroy

                  typedef int (* ADL_ADAPTER_NUMBEROFADAPTERS_GET)(int *);                                                            // ADL_Adapter_NumberOfAdapters_Get

                  typedef int (* ADL_ADAPTER_ADAPTERINFO_GET)(LPAdapterInfo, int);                                        // ADL_Adapter_AdapterInfo_Get

                  typedef int (* ADL_OVERDRIVE5_TEMPERATURE_GET)(int, int, ADLTemperature *);                    // ADL_Overdrive5_Temperature_Get

                  typedef int (* ADL_ADAPTER_ID_GET)(int, int *);                                                                                          // ADL_Adapter_ID_Get

                   

                   

                   

                   

                   

                   

                  void *__stdcall ADL_Main_Memory_Alloc(int iSize)          // ADL için bellek ayırma işlevi.

                  {

                      void *lpBuffer = malloc(iSize);

                   

                   

                      return lpBuffer;

                  }

                   

                   

                   

                   

                   

                   

                  int main(int argc, char *argv[])

                  {

                            HMODULE hModule = NULL;                                                                                                                                            // DLL

                   

                   

                   

                   

                            ADL_MAIN_CONTROL_CREATE ADL_Main_Control_Create = NULL;                                                            // Denetimleri oluşturan işlev.

                   

                   

                   

                   

                            ADL_MAIN_CONTROL_DESTROY ADL_Main_Control_Destroy = NULL;                                                  // Denetimleri yıkan işlev.

                   

                   

                   

                   

                            ADL_ADAPTER_NUMBEROFADAPTERS_GET ADL_Adapter_NumberOfAdapters_Get = NULL;          // Bağlayıcı sayısını alan işlev.

                            int iAdapterNumber = 0;                                                                                                                                            // Bağlayıcı sayısını tutan değişken.

                   

                   

                   

                   

                            ADL_ADAPTER_ADAPTERINFO_GET ADL_Adapter_AdapterInfo_Get = NULL;                                        // Bağlayıcı bilgilerini alan işlev.

                            AdapterInfo *paiInfo = NULL;                                                                                                                        // Bağlayıcı bilgilerini tutan dizi.

                   

                   

                   

                   

                            ADL_OVERDRIVE5_TEMPERATURE_GET ADL_Overdrive5_Temperature_Get = NULL;                    // Sıcaklığı alan işlev.

                            ADLTemperature temperature = { 0 };                                                                                                              // Sıcaklığı tutan yapı.

                   

                   

                            ADL_ADAPTER_ID_GET ADL_Adapter_ID_Get = NULL;

                            int iAdapterIndex = 0;

                   

                   

                   

                   

                   

                   

                            setlocale(LC_ALL, "Turkish");                                                                                                                        // Konsol dilini Türkçe yap.

                   

                   

                   

                   

                   

                   

                            if (!(hModule = LoadLibraryA("atiadlxx.dll")))                                                                                // DLL'yi yükle.

                            {

                                      cerr << "atiadlxx.dll yüklenemedi!\n";

                   

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                   

                   

                   

                            ADL_Main_Control_Create = (ADL_MAIN_CONTROL_CREATE)

                                                                                          GetProcAddress(hModule,

                                                                                                                                 "ADL_Main_Control_Create");                    // DLL'den işlev adresini al.

                   

                   

                   

                   

                            if (!ADL_Main_Control_Create)

                            {

                                      cerr << "İşlev adresi alınamadı!\n";

                   

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                   

                            if (ADL_Main_Control_Create(ADL_Main_Memory_Alloc, 1) != ADL_OK)                              // Denetimleri oluştur.

                            {

                                      cerr << "Ana kontrol oluşturulamadı!\n";

                   

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                   

                   

                   

                            ADL_Main_Control_Destroy = (ADL_MAIN_CONTROL_DESTROY)

                                                                                           GetProcAddress(hModule,

                                                                                                                                  "ADL_Main_Control_Destroy");                    // DLL'den işlev adresini al.

                   

                   

                   

                   

                            if (ADL_Main_Control_Destroy)

                            {

                                      atexit((void (__cdecl *)()) ADL_Main_Control_Destroy);

                            }

                   

                   

                   

                   

                   

                   

                            ADL_Adapter_NumberOfAdapters_Get = (ADL_ADAPTER_NUMBEROFADAPTERS_GET)

                                                                                                               GetProcAddress(hModule,

                                                                                                                                                      "ADL_Adapter_NumberOfAdapters_Get");

                   

                   

                   

                   

                            if (!ADL_Adapter_NumberOfAdapters_Get)

                            {

                                      cerr << "İşlev adresi alınamadı!\n";

                   

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                            if (ADL_Adapter_NumberOfAdapters_Get(&iAdapterNumber) != ADL_OK)

                            {

                                      cerr << "Bağlayıcı sayısı alınamadı!\n";

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                   

                   

                   

                            ADL_Adapter_AdapterInfo_Get = (ADL_ADAPTER_ADAPTERINFO_GET)

                                                                                                    GetProcAddress(hModule,

                                                                                                                                           "ADL_Adapter_AdapterInfo_Get");

                   

                   

                   

                   

                            if (!ADL_Adapter_AdapterInfo_Get)

                            {

                                      cerr << "İşlev adresi alınamadı!\n";

                   

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                            paiInfo = new AdapterInfo[iAdapterNumber];

                   

                   

                   

                   

                            memset(paiInfo, 0, sizeof(AdapterInfo) * iAdapterNumber);

                   

                   

                   

                   

                            if (ADL_Adapter_AdapterInfo_Get(paiInfo, sizeof(AdapterInfo) * iAdapterNumber) != ADL_OK)

                            {

                                      cerr << "Bağlayıcı bilgileri alınamadı!\n";

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                   

                   

                   

                            ADL_Overdrive5_Temperature_Get = (ADL_OVERDRIVE5_TEMPERATURE_GET)

                                                                                                             GetProcAddress(hModule,

                                                                                                                                                    "ADL_Overdrive5_Temperature_Get");

                   

                   

                   

                   

                            if (!ADL_Overdrive5_Temperature_Get)

                            {

                                      cerr << "İşlev adresi alınamadı!\n";

                   

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                   

                   

                   

                            ADL_Adapter_ID_Get = (ADL_ADAPTER_ID_GET)

                                                                               GetProcAddress(hModule,

                                                                                                                      "ADL_Adapter_ID_Get");

                   

                   

                   

                   

                            if (!ADL_Adapter_ID_Get)

                            {

                                      cerr << "İşlev adresi alınamadı!\n";

                   

                   

                                      cin.get();

                   

                   

                                      return 1;

                            }

                   

                   

                   

                   

                   

                   

                            temperature.iSize = sizeof(ADLTemperature);

                   

                   

                   

                   

                            for (int i = 0; i < iAdapterNumber; ++i)

                            {

                                      cout << ADL_Overdrive5_Temperature_Get(paiInfo[i].iAdapterIndex, 0, &temperature) << "\n";

                   

                   

                                      cout << temperature.iTemperature << "\n";

                            }

                   

                   

                            cin.get();

                   

                   

                            delete[] paiInfo;

                  }