Ati ADL SDK benutzen

  • moin

    ich möchte die atiadlxx.dll benutzen um infos über die grafikkarte abzufragen ( gpu temperatur, lüfter drehzahl, gpu auslastung)
    die dll ist bei dem catalyst control center dabei um den treiber steuern zu können
    dafür würde ich gerne eine udf schreiben (jedenfalls für die funktionen die ich brauche)

    in der beschreibung steht das die funktion ADL_Main_Control_Create als erstes aufgerufen soll
    wie rufe ich die funktion richtig auf?
    was genau bedeutet der parameter callback?

    hier die erklärung aus der hilfe datei

    Spoiler anzeigen


    int ADL_Main_Control_Create ( ADL_MAIN_MALLOC_CALLBACK callback,

    int
    iEnumConnectedAdapters

    )

    Function to initialize the ADL interface. This function should be called first.

    This function initializes the ADL library. It also initializes global
    pointers and, at the same time, calls the ADL_Main_Control_Refresh
    function.

    Supported Platforms: Linux and Windows(XP, Vista and Windows 7); 32bit and 64bit

    Parameters:


    [in] callback,: The memory allocation function for memory buffer allocation. This must be provided by the user.

    [in] iEnumConnectedAdapters,: Specify
    a value of 0 to retrieve adapter information for all adapters that have
    ever been present in the system. Specify a value of 1 to retrieve
    adapter information only for adapters that are physically present and
    enabled in the system.


    Returns:If the function succeeds, the return value is ADL_OK. Otherwise the return value is an ADL error code. Result Codes


    so?

    Spoiler anzeigen
    [autoit]

    Global Const $Obj = DllOpen( "C:\WINDOWS\system32\atiadlxx.dll" )
    MsgBox(0,"dllopen", $Obj)
    $dllcall = DllCall( $Obj, "int", "ADL_Main_Control_Create", "int", "callback?", "int", 1)
    MsgBox(0, "dllcall", $dllcall)

    [/autoit]

    ich hab in anderen udf´s gesehen das nach dem dllopen die funktion dllstructcreate benutzt wird muss ich das hier auch machen?


    hier noch die komplette hilfe datei zum sdk

    mfg bulli

    ;EDIT: da bisher noch keiner geantwortet hat habe ich die fragestellung nochmal überarbeitet

    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

  • Hi,

    [autoit]

    #include <Array.au3>
    Global Const $Obj = DllOpen( "C:\WINDOWS\system32\atiadlxx.dll" )
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Obj = ' & $Obj & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    ;~ MsgBox(0,"dllopen", $Obj)

    [/autoit][autoit][/autoit][autoit]

    $struct=dllstructcreate("byte[1000]");Speicher reservieren, wieviel?
    $dllcall = DllCall( $Obj, "int:cdecl", "ADL_Main_Control_Create","ptr",dllstructgetptr($struct),"int",1);aufruf call

    [/autoit][autoit][/autoit][autoit]

    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $dllcall = ' & $dllcall & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    _arraydisplay($dllcall); wenn 0 zurück, dann erfolgreich

    [/autoit][autoit][/autoit][autoit][/autoit]

    //EDIT//
    Habe mal bissl rumgespielt, anhand des vorliegenden Scripts solltest du den Rest auch hinbekommen

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <Memory.au3>
    Global Const $Obj = DllOpen( "C:\WINDOWS\system32\atiadlxx.dll" )

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Obj = ' & $Obj & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

    [/autoit] [autoit][/autoit] [autoit]

    ;~ MsgBox(0,"dllopen", $Obj)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ $dll=dllopen(@systemdir & "\atiadlxy.dll")
    ;~ $handle=dllcallbackregister("allocatememory","int_ptr","int")
    ;~ $ret=dllcall($dll,"int:cdecl","ADL_Main_Control_Create","ptr",dllcallbackgetptr($handle),"int",1)
    ;~ ;dllcallbackfree($handle)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ func allocatememory($i)
    ;~ _memglobalalloc($i)
    ;~ endfunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $struct=dllstructcreate("byte[1000]")

    [/autoit] [autoit][/autoit] [autoit]

    $ret = DllCall( $Obj, "int:cdecl", "ADL_Main_Control_Create","ptr",dllstructgetptr($struct),"int",1)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ret = ' & $ret & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    _arraydisplay($ret)

    [/autoit] [autoit][/autoit] [autoit]

    ;ADL_Adapter_NumberOfAdapters_Get
    $numberofadapters=0;dllstructcreate("int")
    $ret = DllCall( $Obj, "int:cdecl", "ADL_Adapter_NumberOfAdapters_Get","int*",$numberofadapters)
    _arraydisplay($ret)
    $iNumberAdapters=$ret[1]
    ;~ if $iNumberAdapters=0 Then
    ;~ msgbox(0,"ADL_INFO","Keine Adapter gefunden! Programm Ende!")
    ;~ Exit
    ;~ endif

    [/autoit] [autoit][/autoit] [autoit]

    ;ADL_Display_Modes_Get
    ;~ $iNumModes=0;dllstructcreate("int")
    ;~ $lpADLMode=0;dllstructcreate("int")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;~ $ret = DllCall( $Obj, "int:cdecl", "ADL_Display_Modes_Get","int",-1,"int",-1,"int*",$iNumModes,"int*",$lpADLMode)
    ;~ _arraydisplay($ret)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;~ typedef struct AdapterInfo
    ;~ {
    ;~ /// \ALL_STRUCT_MEM

    [/autoit] [autoit][/autoit] [autoit]

    ;~ /// Size of the structure.
    ;~ int iSize;
    ;~ /// The ADL index handle. One GPU may be associated with one or two index handles
    ;~ int iAdapterIndex;
    ;~ /// The unique device ID associated with this adapter.
    ;~ char strUDID[ADL_MAX_PATH];
    ;~ /// The BUS number associated with this adapter.
    ;~ int iBusNumber;
    ;~ /// The driver number associated with this adapter.
    ;~ int iDeviceNumber;
    ;~ /// The function number.
    ;~ int iFunctionNumber;
    ;~ /// The vendor ID associated with this adapter.
    ;~ int iVendorID;
    ;~ /// Adapter name.
    ;~ char strAdapterName[ADL_MAX_PATH];
    ;~ /// Display name. For example, "\\Display0" for Windows or ":0:0" for Linux.
    ;~ char strDisplayName[ADL_MAX_PATH];
    ;~ /// Present or not; 1 if present and 0 if not present.It the logical adapter is present, the display name such as \\.\Display1 can be found from OS
    ;~ int iPresent;

    [/autoit] [autoit][/autoit] [autoit]

    ;~ /// Exist or not; 1 is exist and 0 is not present.
    ;~ int iExist;
    ;~ /// Driver registry path.
    ;~ char strDriverPath[ADL_MAX_PATH];
    ;~ /// Driver registry path Ext for.
    ;~ char strDriverPathExt[ADL_MAX_PATH];
    ;~ /// PNP string from Windows.
    ;~ char strPNPString[ADL_MAX_PATH];
    ;~ /// It is generated from EnumDisplayDevices.
    ;~ int iOSDisplayIndex;

    [/autoit] [autoit][/autoit] [autoit]

    $adapterinfostruct=dllstructcreate("byte["&1572*$iNumberAdapters&"]");struct

    [/autoit] [autoit][/autoit] [autoit]

    dim $adapterinfo[$iNumberAdapters]

    [/autoit] [autoit][/autoit] [autoit]

    for $i=0 to $iNumberAdapters-1
    $adapterinfo[$i]=dllstructcreate("int iSize;"& _
    "int iAdapterIndex;"& _
    "char strUDID[256];"& _
    "int iBusNumber;"& _
    "int iDeviceNumber;"& _
    "int iFunctionNumber;"& _
    "int iVendorID;"& _
    "char strAdapterName[256];"& _
    "char strDisplayname[256];"& _
    "int iPresent;"& _
    "int iExist;"& _
    "char strDriverPath[256];"& _
    "char strDriverPathExt[256];"& _
    "char strPNPString[256];"& _
    "int iOSDisplayIndex",dllstructgetptr($adapterinfostruct)+$i*1572)
    next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $ret = DllCall( $Obj, "int:cdecl", "ADL_Adapter_AdapterInfo_Get","ptr",dllstructgetptr($adapterinfostruct),"int",dllstructgetsize($adapterinfostruct))

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ret = ' & $ret & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    _arraydisplay($ret)

    [/autoit] [autoit][/autoit] [autoit]

    for $i=0 to $iNumberAdapters
    msgbox(0,"AdapterInfo Nr.:"&$i, "Size "&dllstructgetdata($adapterinfo[$i],1)&@crlf& _
    "AdapterIndex "&dllstructgetdata($adapterinfo,2)&@crlf& _
    "UDID "&dllstructgetdata($adapterinfo[$i],3)&@crlf& _
    "BusNumber "&dllstructgetdata($adapterinfo[$i],4)&@crlf& _
    "Devicenumber "&dllstructgetdata($adapterinfo[$i],5)&@crlf& _
    "FunctionNumber "&dllstructgetdata($adapterinfo[$i],6)&@crlf& _
    "VendorID "&dllstructgetdata($adapterinfo[$i],7)&@crlf& _
    "AdapterName "&dllstructgetdata($adapterinfo[$i],8)&@crlf& _
    "Displayname "&dllstructgetdata($adapterinfo[$i],9)&@crlf& _
    "Present ;) "&dllstructgetdata($adapterinfo[$i],10)&@crlf& _
    "Exist "&dllstructgetdata($adapterinfo[$i],11)&@crlf& _
    "DriverPath "&dllstructgetdata($adapterinfo[$i],12)&@crlf& _
    "DriverPathExt "&dllstructgetdata($adapterinfo[$i],13)&@crlf& _
    "PNPString "&dllstructgetdata($adapterinfo[$i],14)&@crlf& _
    "OSDisplayIndex "&dllstructgetdata($adapterinfo[$i],15))

    [/autoit] [autoit][/autoit] [autoit]

    next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;~ Functions

    [/autoit] [autoit][/autoit] [autoit]

    ;~ int ADL_Adapter_Active_Set (int iAdapterIndex, int iStatus, int *lpNewlyActivate)
    ;~ Function to set the current extended desktop mode status for a display.
    ;~ int ADL_Adapter_Active_SetPrefer (int iAdapterIndex, int iStatus, int iNumPreferTarget, ADLDisplayTarget *lpPreferTarget, int *lpNewlyActivate)
    ;~ Function to set the current extended desktop mode status for the display.
    ;~ int ADL_Adapter_Primary_Get (int *lpPrimaryAdapterIndex)
    ;~ Function to retrieve the primary display adapter index.
    ;~ int ADL_Adapter_Primary_Set (int iAdapterIndex)
    ;~ Function to set the primary display adapter index.
    ;~ int ADL_Adapter_ModeSwitch (int iAdapterIndex)
    ;~ Function to perform a mode switch for an adapter.
    ;~ int ADL_Display_Modes_Get (int iAdapterIndex, int iDisplayIndex, int *lpNumModes, ADLMode **lppModes)
    ;~ Function to retrieve the display mode information.
    ;~ int ADL_Display_Modes_Set (int iAdapterIndex, int iDisplayIndex, int iNumModes, ADLMode *lpModes)
    ;~ Function to set display mode information.
    ;~ int ADL_Display_PossibleMode_Get (int iAdapterIndex, int *lpNumModes, ADLMode **lppModes)
    ;~ Function to retrieve the OS possible modes list for an adapter (all OS platforms).
    ;~ int ADL_Display_ForcibleDisplay_Get (int iAdapterIndex, int iDisplayIndex, int *lpStatus)
    ;~ Function to retrieve the forcible connected status of a display.
    ;~ int ADL_Display_ForcibleDisplay_Set (int iAdapterIndex, int iDisplayIndex, int iStatus)
    ;~ Function to set the forcible connected status of a display.
    ;~ int ADL_Adapter_NumberOfActivatableSources_Get (int iAdapterIndex, int *lpNumSources, ADLActivatableSource **lppSources)
    ;~ Function to retrieve the number of Activatable sources based on ADL Index.
    ;~ int ADL_Adapter_Display_Caps (int iAdapterIndex, int *lpNumDisplayCaps, ADLAdapterDisplayCap **lppAdapterDisplayCaps)
    ;~ Function to retrieve the adapter display manner capabilities based on ADL index.
    ;~ int ADL_Display_DisplayMapConfig_Get (int iAdapterIndex, int *lpNumDisplayMap, ADLDisplayMap **lppDisplayMap, int *lpNumDisplayTarget, ADLDisplayTarget **lppDisplayTarget, int iOptions)
    ;~ Function to retrieve current display map configurations.
    ;~ int ADL_Display_DisplayMapConfig_Set (int iAdapterIndex, int iNumDisplayMap, ADLDisplayMap *lpDisplayMap, int iNumDisplayTarget, ADLDisplayTarget *lpDisplayTarget)
    ;~ Function to set the current display configuration.
    ;~ int ADL_Display_PossibleMapping_Get (int iAdapterIndex, int iNumberOfPresetMapping, ADLPossibleMapping *lpPresetMappings, int iEnquiryControllerIndex, int *lpNumberOfEnquiryPossibleMappings, ADLPossibleMapping **lppEnquiryPossibleMappings)
    ;~ Function to retrieve the possible display mappings.
    ;~ int ADL_Display_DisplayMapConfig_Validate (int iAdapterIndex, int iNumPossibleMap, ADLPossibleMap *lpPossibleMaps, int *lpNumPossibleMapResult, ADLPossibleMapResult **lppPossibleMapResult)
    ;~ Function to validate the list of the display configurations based on ADL Index.
    ;~ int ADL_Display_DisplayMapConfig_PossibleAddAndRemove (int iAdapterIndex, int iNumDisplayMap, ADLDisplayMap *lpDisplayMap, int iNumDisplayTarget, ADLDisplayTarget *lpDisplayTarget, int *lpNumPossibleAddTarget, ADLDisplayTarget **lppPossibleAddTarget, int *lpNumPossibleRemoveTarget, ADLDisplayTarget **lppPossibleRemoveTarget)
    ;~ Function to validate a list of display configurations.
    ;~ int ADL_Display_SLSGrid_Caps (int iAdapterIndex, int *lpNumSLSGrid, ADLSLSGrid **lppSLSGrid, int iOption)
    ;~ Function to get the current supported SLS grid patterns (MxN) for a GPU.
    ;~ int ADL_Display_SLSMapIndexList_Get (int iAdapterIndex, int *lpNumSLSMapIndexList, int **lppSLSMapIndexList, int iOptions)
    ;~ Function to get the active SLS map index list for a given GPU.
    ;~ int ADL_Display_SLSMapIndex_Get (int iAdapterIndex, int iADLNumDisplayTarget, ADLDisplayTarget *lpDisplayTarget, int *lpSLSMapIndex)
    ;~ Function to get the SLS map index for a given adapter and a given display device.
    ;~ int ADL_Display_SLSMapConfig_Get (int iAdapterIndex, int iSLSMapIndex, ADLSLSMap *lpSLSMap, int *lpNumSLSTarget, ADLSLSTarget **lppSLSTarget, int *lpNumNativeMode, ADLSLSMode **lppNativeMode, int *lpNumBezelMode, ADLBezelTransientMode **lppBezelMode, int *lpNumTransientMode, ADLBezelTransientMode **lppTransientMode, int *lpNumSLSOffset, ADLSLSOffset **lppSLSOffset, int iOption)
    ;~ Function to retrieve an SLS configuration.
    ;~ int ADL_Display_SLSMapConfig_Create (int iAdapterIndex, ADLSLSMap SLSMap, int iNumTargetTarget, ADLSLSTarget *lpSLSTarget, int iBezelModePercent, int *lpSLSMapIndex, int iOption)
    ;~ Function to create an SLS configuration.
    ;~ int ADL_Display_SLSMapConfig_Delete (int iAdapterIndex, int iSLSMapIndex)
    ;~ Function to delete an SLS map from the driver database.
    ;~ int ADL_Display_SLSMapConfig_SetState (int iAdapterIndex, int iSLSMapIndex, int iState)
    ;~ Function to enable/disable SLS bind.
    ;~ int ADL_Display_SLSMapConfig_Rearrange (int iAdapterIndex, int iSLSMapIndex, int iNumDisplayTarget, ADLSLSTarget *lpSLSTarget, ADLSLSMap slsMap, int iOption)
    ;~ Function to rearrange display orders in an SLS map.
    ;~ int ADL_Display_PossibleMode_WinXP_Get (int iAdapterIndex, int iNumDisplayTargets, ADLDisplayTarget *lpDisplayTargets, int iLargeDesktopSupportedType, int iDevicePanningControl, int *lpNumModes, ADLMode **lppModes)
    ;~ Function to retrieve the ATI possible modes list for an adapter and preset mapping (Windows XP).
    ;~ int ADL_Display_BezelOffsetSteppingSize_Get (int iAdapterIndex, int *lpNumBezelOffsetSteppingSize, ADLBezelOffsetSteppingSize **lppBezelOffsetSteppingSize)
    ;~ Get bezel offset stepping size for the input adapter.
    ;~ int ADL_Display_BezelOffset_Set (int iAdapterIndex, int iSLSMapIndex, int iNumBezelOffset, LPADLSLSOffset lpBezelOffset, ADLSLSMap SLSMap, int iOption)
    ;~ Set SLS bezel offsets for each display index.
    ;~ int ADL_Display_BezelSupported_Validate (int iAdapterIndex, int iNumPossibleSLSMap, LPADLPossibleSLSMap lpPossibleSLSMaps, int *lpNumPossibleSLSMapResult, LPADLPossibleMapResult *lppPossibleMapResult)
    ;~ Validate the list of the SLS display configurations to determine if bezel is supported or not.

    [/autoit]

    ciao
    Andy


    "Schlechtes Benehmen halten die Leute doch nur deswegen für eine Art Vorrecht, weil keiner ihnen aufs Maul haut." Klaus Kinski
    "Hint: Write comments after each line. So you can (better) see what your program does and what it not does. And we can see what you're thinking what your program does and we can point to the missunderstandings." A-Jay

    Wie man Fragen richtig stellt... Tutorial: Wie man Script-Fehler findet und beseitigt...X-Y-Problem

    Einmal editiert, zuletzt von Andy (21. März 2012 um 22:31)

  • edit voriger Post

  • wie ich es mir schon gedacht hatte habe ich es natürlich nicht hinbekommen :S
    also das ist mein kläglicher versuch:

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <Memory.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _AtiADL_Open()
    Global Const $Obj = DllOpen( "C:\WINDOWS\system32\atiadlxx.dll" )
    Return $Obj
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _AtiAdl_Close()
    DllClose($Obj)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _AtiADL_MainControl()
    $struct = dllstructcreate("byte[1000]")
    $ret = DllCall( $Obj, "int:cdecl", "ADL_Main_Control_Create","ptr",dllstructgetptr($struct),"int",1)
    Return $ret
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _AtiADL_AdapterNum()
    $numberofadapters = 0
    $ret = DllCall( $Obj, "int:cdecl", "ADL_Adapter_NumberOfAdapters_Get","int*",$numberofadapters)
    $iNumberAdapters=$ret[1]
    $adapterinfostruct = dllstructcreate("byte["&1572*$iNumberAdapters&"]")
    dim $adapterinfo[$iNumberAdapters]

    [/autoit] [autoit][/autoit] [autoit]

    for $i=0 to $iNumberAdapters-1
    $adapterinfo[$i] = dllstructcreate("int iSize;"& _
    "int iAdapterIndex;"& _
    "char strUDID[256];"& _
    "int iBusNumber;"& _
    "int iDeviceNumber;"& _
    "int iFunctionNumber;"& _
    "int iVendorID;"& _
    "char strAdapterName[256];"& _
    "char strDisplayname[256];"& _
    "int iPresent;"& _
    "int iExist;"& _
    "char strDriverPath[256];"& _
    "char strDriverPathExt[256];"& _
    "char strPNPString[256];"& _
    "int iOSDisplayIndex",dllstructgetptr($adapterinfostruct)+$i*1572)
    next
    Return $ret[1]
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _AtiADL_Temp()
    $ret = DllCall($Obj, "int", "ADL_PM_Temperature_Get", "int", "1000")
    Return $ret
    EndFunc

    [/autoit]


    gibt es ein gutes tutorial mit vielen beispielen zu dem thema?
    falls mir jemand helfen möchte wäre ich sehr dankbar (als kleiner leckerbissen: daraus wird eine G15 app)
    danke an andy für die hilfe bis jetzt :thumbup:
    mfg bulli

  • Hi,
    die im SDK enthaltenen Beispiele (ok, bissl C sollte man LESEN können ^^ ) zeigen, wie das SDK benutzt wird.
    Schau dir mal die im Ordner \ADL_SDK\inlude die *.h - Dateien an.
    Mit einem AutoIt-10-Zeiler erhälst du aus der adl_defines.h sämtliche Konstanten.
    Aus

    Code
    #define ADL_MAX_CHAR        4096


    wird

    [autoit]

    $ADL_MAX_CHAR = 4096

    [/autoit]

    uswusf.

    Ein weiterer 10-Zeiler erstellt dir aus der adl_structures.h sämtliche Strukturen ( dllstructcreate("blablub") s. mein Posting oben)

    Spoiler anzeigen

    wird zu

    Spoiler anzeigen
    [autoit]

    $adapterinfo = dllstructcreate("int iSize;"& _
    "int iAdapterIndex;"& _
    "char strUDID[256];"& _
    "int iBusNumber;"& _
    "int iDeviceNumber;"& _
    "int iFunctionNumber;"& _
    "int iVendorID;"& _
    "char strAdapterName[256];"& _
    "char strDisplayname[256];"& _
    "int iPresent;"& _
    "int iExist;"& _
    "char strDriverPath[256];"& _
    "char strDriverPathExt[256];"& _
    "char strPNPString[256];"& _
    "int iOSDisplayIndex")

    [/autoit]


    Solltest du mit dem Erstellen der Scripte um aus den *.h Dateien die AutoIt-#include-Dateien zu erzeugen schon Probleme haben, dann lass den Rest^^

    Die Funktionen und die zu übergebenden Datentypen sind u.a. in den HTML-Dateien im Ordner \public_documents\html beschrieben. (Start mit der HTML-Datei adl_sdk.html im Hauptordner)
    Im SDK ist eigendlich alles enthalten, das heisst nicht umsonst SoftwareDevelopmentKit^^.

    Nachdem du die Strukturen erstellt hast, rufst du die Funktionen auf mit den Pointern auf die zu füllenden Structs und liest danach die gefüllten Structs aus.

    Lies dir auch mal die ( sehr gut in Deutsch übersetzte) AutoIt-Hilfe durch, darin steht z.B. auch, dass DllCall´s ein Array zurückgeben.
    die Funktion

    [autoit]

    Func _AtiADL_Temp()
    $ret = DllCall($Obj, "int", "ADL_PM_Temperature_Get", "int", "1000")
    Return $ret
    EndFunc

    [/autoit]

    wird also nie einen sinnvollen Wert zurückgeben

    besser ist es so^^

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <Memory.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ;***********************************************
    ;sämtliche structs gehören in ein #include
    $ADLtemperature = DllStructCreate("int iSize;int iTemperature")
    DllStructSetData($ADLtemperature, "iSize", DllStructGetSize($ADLtemperature))

    [/autoit] [autoit][/autoit] [autoit]

    $iNumberAdapters = 10 ; für 10 adapter platz machen^^
    Global $adapterinfostruct = DllStructCreate("byte[" & 1572 * $iNumberAdapters & "]");struct
    Dim $adapterinfo[$iNumberAdapters]
    For $i = 0 To $iNumberAdapters - 1
    $adapterinfo[$i] = DllStructCreate("int iSize;" & _
    "int iAdapterIndex;" & _
    "char strUDID[256];" & _
    "int iBusNumber;" & _
    "int iDeviceNumber;" & _
    "int iFunctionNumber;" & _
    "int iVendorID;" & _
    "char strAdapterName[256];" & _
    "char strDisplayname[256];" & _
    "int iPresent;" & _
    "int iExist;" & _
    "char strDriverPath[256];" & _
    "char strDriverPathExt[256];" & _
    "char strPNPString[256];" & _
    "int iOSDisplayIndex", DllStructGetPtr($adapterinfostruct) + $i * 1572)
    Next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;***********************************************
    ;und auch alle konstanten gehören in ein #include
    Global Const $Obj = DllOpen("C:\WINDOWS\system32\atiadlxx.dll")
    ;errorhandling nicht vergessen ^^

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;***********************************************
    ;und die Variablen

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;***********************************************
    ;und auch alle Funktionen gehören in ein #include
    ;Function-Header nicht vergessen^^
    Func ADL_init()
    $struct = DllStructCreate("byte[1000]")
    $ret = DllCall($Obj, "int:cdecl", "ADL_Main_Control_Create", "ptr", DllStructGetPtr($struct), "int", 1)
    EndFunc ;==>ADL_init

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func ADL_Adapter_NumberOfAdapters_Get()
    Local $numberofadapters = 0 ;dllstructcreate("int")
    $ret = DllCall($Obj, "int:cdecl", "ADL_Adapter_NumberOfAdapters_Get", "int*", $numberofadapters)
    Return $ret[1]
    EndFunc ;==>ADL_Adapter_NumberOfAdapters_Get

    [/autoit] [autoit][/autoit] [autoit]

    Func ADL_Overdrive5_Temperature_Get($iAdapterIndexnr)
    $ret = DllCall($Obj, "int:cdecl", "ADL_Overdrive5_Temperature_Get", "int", $iAdapterIndexnr, "int", 0, "ptr", DllStructGetPtr($ADLtemperature))
    Return DllStructGetData($ADLtemperature, "iTemperature") ;in tausenstel grad
    EndFunc ;==>ADL_Overdrive5_Temperature_Get

    [/autoit] [autoit][/autoit] [autoit]

    Func ADL_Get_Adapter_Info()
    $ret = DllCall($Obj, "int:cdecl", "ADL_Adapter_AdapterInfo_Get", "ptr", DllStructGetPtr($adapterinfostruct), "int", $iNumberAdapters * 1572);DllStructGetSize($adapterinfostruct))
    EndFunc ;==>ADL_Get_Adapter_Info

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;hier gehts dann los mit dem Programm
    ADL_init()

    [/autoit] [autoit][/autoit] [autoit]

    Global $iNumberAdapters = ADL_Adapter_NumberOfAdapters_Get()

    [/autoit] [autoit][/autoit] [autoit]

    ADL_Get_Adapter_Info() ;füllt die struct $adapterinfo

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $iNumberAdapters - 1 ;anzahl der adapter
    $iAdapterIndex = DllStructGetData($adapterinfo[$i], "iAdapterIndex");index aus der struct auslesen
    $temperature = ADL_Overdrive5_Temperature_Get($iAdapterIndex) ;temperatur auslesen
    MsgBox(262144, "Temperatur von Adapter Nr.: " & $iAdapterIndex, StringFormat("%.3f °Celsius", $temperature / 1000))
    Next

    [/autoit] [autoit][/autoit] [autoit][/autoit]