title: ATI ADL - AdapterInfo_Get
body: <p>Good evening guys!</p>
  
  <p>I'm currently trying to work with a <code>Delphi pascal</code> translation of the <code>ATI ADL</code> structure. In brief, this allows me to retrieve information from an ATI/AMD GPU in a system, and potentially control various aspects of it (such as clock and fan speeds).</p>
  
  <p>The translation was taken from <a href="http://translate.google.co.uk/translate?hl=en&amp;sl=de&amp;u=http://www.delphipraxis.net/151628-amd-ati-display-library-adl-sdk-3-0-fuer-pascal.html" rel="nofollow">Delphi-Praxis (Google Translated)</a> or <a href="http://www.delphipraxis.net/151628-amd-ati-display-library-adl-sdk-3-0-fuer-pascal.html" rel="nofollow">Delphi-Praxis (not translated)</a> and the provided example application works. I successfully transferred it over to a visual/GUI application, but i'm having trouble getting my head around expanding from the example. I wish to update one of my existing applications with support for ATI GPU's, but i'm having trouble.</p>
  
  <p>My main purpose is to retrieve the <code>strAdapterName</code> from <code>AdapterInfo</code> inside <code>adl_structures</code>. Having not worked with units like this from scratch before, i'm unsure how i define the type itself inside my application. The record structure of <code>AdapterInfo</code> is as follows;</p>
  
  <pre><code>type
   AdapterInfo = record
    /// Size of the structure.
    iSize : integer;
    /// The ADL index handle. One GPU may be associated with one or two index handles
    iAdapterIndex : integer;
    /// The unique device ID associated with this adapter.
    strUDID : array [0..ADL_MAX_PATH] of char;
    /// The BUS number associated with this adapter.
    iBusNumber : integer;
    /// The driver number associated with this adapter.
    iDeviceNumber : integer;
    /// The function number.
    iFunctionNumber : integer;
    /// The vendor ID associated with this adapter.
    iVendorID : integer;
    /// Adapter name.
    strAdapterName : array [0..ADL_MAX_PATH] of char;
    /// Display name. For example, "\\Display0" for Windows or ":0:0" for Linux.
    strDisplayName : array [0..ADL_MAX_PATH] of char;
    /// Present or not; 1 if present and 0 if not present.
    iPresent : integer;
   // @}
  end;
  </code></pre>
  
  <p>I'm honestly struggling to figure out exactly what i need to define in the <code>type</code> section of my application, and moreover, to actually get something workable.</p>
  
  <p>There's very little delphi-specific information on the ADL library (the only information was the Delphi-praxis link above) and while it's well documented in it's SDK format, i unfortunately lack the knowledge to be able to translate between languages (e.g. i can't read <code>C</code> or <code>C++</code> code and translate what data type variables are).</p>
  
  <p>Any ideas?</p>