<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>I tried to make an import for libusb-1.0.22.7z from
      <a class="moz-txt-link-freetext" href="https://libusb.info/">https://libusb.info/</a> .<br>
      The import unit is very buggy but I could make a small program to
      list the usb devices.<br>
      On my machine, it gives the same results that the example program
      libusb-1.0.22\examples\bin64\testlibusb.exe<br>
      <br>
      I've published this program and the import at
<a class="moz-txt-link-freetext" href="https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte/tools/lsusb">https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte/tools/lsusb</a><br>
      You can get the corresponding binaries in this release
<a class="moz-txt-link-freetext" href="https://github.com/jsuzineau/pascal_o_r_mapping/releases/tag/2019_08_03_lsusb">https://github.com/jsuzineau/pascal_o_r_mapping/releases/tag/2019_08_03_lsusb</a>
      .</p>
    <p>I used lazarus to generate and compile the console app, but I
      verified, you can compile it from the command line, you'll just
      have to change the path to you freepascal installation.</p>
    <p>I converted the libusb.h to libusb.pas with h2pas from the
      lazarus plugin H2Paswizard (
      <a class="moz-txt-link-freetext" href="https://wiki.freepascal.org/H2Paswizard">https://wiki.freepascal.org/H2Paswizard</a> ). <br>
    </p>
    <p>You'll find the project for H2Paswizard at
<a class="moz-txt-link-freetext" href="https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte/tools/lsusb/include/libusb-1.0/project1.h2p">https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte/tools/lsusb/include/libusb-1.0/project1.h2p</a></p>
    <p>It's a very quick an dirty conversion. In h2paswizard I added  a
      rename from <span class="pl-s">LIBUSB_CALL to WINAPI.</span></p>
    <p><span class="pl-s">I got some problems with var parameters in
        functions for example I needed to change</span><br>
           function libusb_open(dev: Plibusb_device; <b>var</b>
      dev_handle:Plibusb_device_handle):longint;cdecl;external name
      'libusb_open';<br>
      into<br>
          function libusb_open(dev: Plibusb_device; dev_handle:<b>PPlibusb_device_handle</b>):longint;cdecl;external
      name 'libusb_open'; <br>
    </p>
    <p>I think this can be fixed by tuning some details of the import.<br>
    </p>
    <p><span class="pl-s"></span></p>
  </body>
</html>