<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3783766</guid>
        <pubDate>Mon, 26 Nov 2018 02:36:23 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3783766</link>
        <description><![CDATA[seci20: <strong class='tag-b'>Сержик</strong> AdbNextInterface source help me ? not found unit...]]></description>
        <author>seci20</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652766</guid>
        <pubDate>Fri, 12 Feb 2016 16:16:53 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652766</link>
        <description><![CDATA[leo: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=408015&view=findpost&p=3652709'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Filka &#064; <time class="tag-quote__quoted-time" datetime="2016-02-12T11:56:32+00:00">12.02.16, 11:56</time></span><div class='quote '>bool (4 байта) &lt;&gt; Boolean (1 байт)</div></div><br>
А с чего ты взял, что bool - 4 байта?<br>
Это же не виндовый BOOL, а стандартный сишный bool, размер которого не регламентирован. Но из соображений совместимости в большинстве компиляторов используется минимальный размер bool в 1 байт со значениями false&#092;true = 0&#092;1.]]></description>
        <author>leo</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652739</guid>
        <pubDate>Fri, 12 Feb 2016 14:30:41 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652739</link>
        <description><![CDATA[Сержик: переделал<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">AdbInterfaceInfo = packed record</div><div class="code_line">&nbsp;&nbsp; &nbsp;class_id: TGUID;</div><div class="code_line">&nbsp;&nbsp; &nbsp;flags : DWORD;</div><div class="code_line">&nbsp;&nbsp; &nbsp;device_name: array [0..255] of WideChar;</div><div class="code_line">&nbsp;&nbsp;end;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>Сержик</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652730</guid>
        <pubDate>Fri, 12 Feb 2016 13:35:20 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652730</link>
        <description><![CDATA[leo: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=408015&view=findpost&p=3652718'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Сержик &#064; <time class="tag-quote__quoted-time" datetime="2016-02-12T12:28:06+00:00">12.02.16, 12:28</time></span><div class='quote '>так будет ?</div></div><br>
Нет, конечно.<br>
device_name - не указатель на массив, а сам массив из одного элемента array[0..0] of WideChar.<br>
Хотя можно и сразу задать массив &quot;достаточной длины&quot;, например [0..255]<br>
<br>
PS:  А говоришь &quot;Пробовал&quot;...]]></description>
        <author>leo</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652718</guid>
        <pubDate>Fri, 12 Feb 2016 12:28:06 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652718</link>
        <description><![CDATA[Сержик: На дельфи эта структура<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">typedef struct _AdbInterfaceInfo {</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp;GUID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;class_id; &nbsp;</div><div class="code_line">&nbsp;&nbsp;unsigned long flags;</div><div class="code_line">&nbsp;&nbsp;wchar_t &nbsp; &nbsp; &nbsp; device_name[1];</div><div class="code_line">} AdbInterfaceInfo;</div></ol></div></div></div></div><br>
<br>
так будет ?<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">AdbInterfaceInfo = packed record</div><div class="code_line">&nbsp;&nbsp; &nbsp;class_id: TGUID;</div><div class="code_line">&nbsp;&nbsp; &nbsp;flags : DWORD;</div><div class="code_line">&nbsp;&nbsp; &nbsp;device_name: PWideChar;</div><div class="code_line">&nbsp;&nbsp;end;</div></ol></div></div></div></div>]]></description>
        <author>Сержик</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652709</guid>
        <pubDate>Fri, 12 Feb 2016 11:56:32 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652709</link>
        <description><![CDATA[Filka: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">ADBWIN_API ADBAPIHANDLE __cdecl AdbEnumInterfaces(GUID class_id,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool exclude_not_present,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool exclude_removed,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool active_only);</div></ol></div></div></div></div><br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp;AdbEnumInterfaces: &nbsp;function(class_id: TGUID; exclude_not_present: Boolean;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exclude_removed: &nbsp; &nbsp; Boolean;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; active_only: &nbsp; &nbsp; &nbsp; &nbsp; Boolean): ADBAPIHANDLE; cdecl;</div></ol></div></div></div></div><br>
bool (4 байта) &lt;&gt; Boolean (1 байт)]]></description>
        <author>Filka</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652693</guid>
        <pubDate>Fri, 12 Feb 2016 11:22:34 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652693</link>
        <description><![CDATA[Сержик: GetLastError  ,ошибку не показал :no-sad:]]></description>
        <author>Сержик</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652674</guid>
        <pubDate>Fri, 12 Feb 2016 10:30:36 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652674</link>
        <description><![CDATA[leo: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=408015&view=findpost&p=3652673'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Сержик &#064; <time class="tag-quote__quoted-time" datetime="2016-02-12T10:22:07+00:00">12.02.16, 10:22</time></span><div class='quote '>Пробывал, возвращает всегда False</div></div><br>
1) Вызови GetLastError и посмотри в своем sdk, что означает код ошибки<br>
2) Покажи как пробовал, может что-то не так...<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=408015&view=findpost&p=3652673'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Сержик &#064; <time class="tag-quote__quoted-time" datetime="2016-02-12T10:22:07+00:00">12.02.16, 10:22</time></span><div class='quote '>Еще заметил если несколько раз вызвать первую функцию , то Handle увеличивается по порядку 1 потом 2 и т.д</div></div><br>
Ну и что? Значит это просто порядковый индекс чего-то]]></description>
        <author>leo</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652673</guid>
        <pubDate>Fri, 12 Feb 2016 10:22:07 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652673</link>
        <description><![CDATA[Сержик: Пробывал, возвращает всегда False<br><br>Еще заметил если несколько раз вызвать первую функцию , то Handle увеличивается по порядку 1 потом 2 и т.д]]></description>
        <author>Сержик</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652670</guid>
        <pubDate>Fri, 12 Feb 2016 10:10:07 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652670</link>
        <description><![CDATA[leo: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=408015&view=findpost&p=3652668'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Сержик &#064; <time class="tag-quote__quoted-time" datetime="2016-02-12T09:57:04+00:00">12.02.16, 09:57</time></span><div class='quote '>А здесь тогда как?</div></div><br>
Чего как? Первым параметром - полученный хэндл, вторым - указатель на структуру AdbInterfaceInfo, третим - размер этой структуры.<br>
<br>
PS: Поскольку в структуре AdbInterfaceInfo под device_name отведен всего один символ, то подразумевается динамическое выделение памяти - сначала вызываешь функцию с info = nil и получаешь size = требуемому размеру, затем выделяешь память по GetMem и передаешь указатель в функцию вместо info]]></description>
        <author>leo</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652668</guid>
        <pubDate>Fri, 12 Feb 2016 09:57:04 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652668</link>
        <description><![CDATA[Сержик: Не знаю :blush: <br>
Я еще новичек <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2016-02-12T10:01:04+00:00">12.02.16, 10:01</time></span></span><br>
А здесь тогда как?<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">typedef struct _AdbInterfaceInfo {</div><div class="code_line">&nbsp;&nbsp;/// Inteface&#39;s class id (see SP_DEVICE_INTERFACE_DATA for details)</div><div class="code_line">&nbsp;&nbsp;GUID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;class_id;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;/// Interface flags (see SP_DEVICE_INTERFACE_DATA for details)</div><div class="code_line">&nbsp;&nbsp;unsigned long flags;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;/// Device name for the interface (see SP_DEVICE_INTERFACE_DETAIL_DATA</div><div class="code_line">&nbsp;&nbsp;/// for details)</div><div class="code_line">&nbsp;&nbsp;wchar_t &nbsp; &nbsp; &nbsp; device_name[1];</div><div class="code_line">} AdbInterfaceInfo;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; </div><div class="code_line">&nbsp;</div><div class="code_line">@param[in] adb_handle Handle to interface enumerator object obtained via</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; AdbEnumInterfaces call.</div><div class="code_line">&nbsp;&nbsp;@param[out] info Upon successful completion will receive interface</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; information. Can be NULL. If it is NULL, upon return from this</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; routine size parameter will contain memory size required for the</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; next entry.</div><div class="code_line">&nbsp;&nbsp;@param[in,out] size On the way in provides size of the memory buffer</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; addressed by info parameter. On the way out (only if buffer was not</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; big enough) will provide memory size required for the next entry.</div><div class="code_line">&nbsp;&nbsp;@return true on success, false on error. If false is returned</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GetLastError() provides extended error information.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ERROR_INSUFFICIENT_BUFFER indicates that buffer provided in info</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameter was not big enough and size parameter contains memory size</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;required for the next entry. ERROR_NO_MORE_ITEMS indicates that</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enumeration is over and there are no more entries to return.</div><div class="code_line">*/</div><div class="code_line">ADBWIN_API bool __cdecl AdbNextInterface(ADBAPIHANDLE adb_handle,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AdbInterfaceInfo* info,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unsigned long* size);</div></ol></div></div></div></div>]]></description>
        <author>Сержик</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652667</guid>
        <pubDate>Fri, 12 Feb 2016 09:52:10 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652667</link>
        <description><![CDATA[leo: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=408015&view=findpost&p=3652663'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Сержик &#064; <time class="tag-quote__quoted-time" datetime="2016-02-12T08:59:38+00:00">12.02.16, 08:59</time></span><div class='quote '>Функция возвращает всегда 1 , а не Handle</div></div><br>
А ты считаешь, что Handle не может иметь значение = 1?]]></description>
        <author>leo</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652663</guid>
        <pubDate>Fri, 12 Feb 2016 08:59:38 +0000</pubDate>
        <title>Помогите с AdbWinApi.dll</title>
        <link>https://forum.sources.ru/index.php?showtopic=408015&amp;view=findpost&amp;p=3652663</link>
        <description><![CDATA[Сержик: Всем доброго времени суток.<br>
<br>
Есть такая функция  с описанием <br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;\brief Creates USB interface enumerator</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;This routine enumerates all USB interfaces that match provided class ID.</div><div class="code_line">&nbsp;&nbsp;This routine uses SetupDiGetClassDevs SDK routine to enumerate devices that</div><div class="code_line">&nbsp;&nbsp;match class ID and then SetupDiEnumDeviceInterfaces SDK routine is called</div><div class="code_line">&nbsp;&nbsp;to enumerate interfaces on the devices.</div><div class="code_line">&nbsp;&nbsp;@param[in] class_id Device class ID, assigned by the driver.</div><div class="code_line">&nbsp;&nbsp;@param[in] exclude_not_present If true enumation will include only those</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; devices that are currently present.</div><div class="code_line">&nbsp;&nbsp;@param[in] exclude_removed If true interfaces with SPINT_REMOVED flag set</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; will be not included in the enumeration.</div><div class="code_line">&nbsp;&nbsp;@param[in] active_only If true only active interfaces (with flag</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SPINT_ACTIVE set) will be included in the enumeration.</div><div class="code_line">&nbsp;&nbsp;@return Handle to the enumerator object or NULL on failure. If NULL is</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;returned GetLastError() provides extended error information.</div><div class="code_line">*/</div><div class="code_line">typedef void* ADBAPIHANDLE;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">ADBWIN_API ADBAPIHANDLE __cdecl AdbEnumInterfaces(GUID class_id,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool exclude_not_present,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool exclude_removed,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool active_only);</div></ol></div></div></div></div><br>
<br>
В Delphi вызываю так <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">type</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;ADBAPIHANDLE = Pointer;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;TForm1 = class(TForm)</div><div class="code_line">&nbsp;&nbsp; &nbsp;Button1: TButton;</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure Button1Click(Sender: TObject);</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure FormCreate(Sender: TObject);</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure FormDestroy(Sender: TObject);</div><div class="code_line">&nbsp;&nbsp;private</div><div class="code_line">&nbsp;&nbsp; &nbsp;{ Private declarations }</div><div class="code_line">&nbsp;&nbsp;public</div><div class="code_line">&nbsp;&nbsp; &nbsp;{ Public declarations }</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;Form1: TForm1;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;AdbLoad: THandle;</div><div class="code_line">&nbsp;&nbsp;enum_handle: ADBAPIHANDLE;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;AdbEnumInterfaces: &nbsp;function(class_id: TGUID; exclude_not_present: Boolean;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exclude_removed: &nbsp; &nbsp; Boolean;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; active_only: &nbsp; &nbsp; &nbsp; &nbsp; Boolean): ADBAPIHANDLE; cdecl;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">implementation</div><div class="code_line">&nbsp;</div><div class="code_line">{$R *.dfm}</div><div class="code_line">&nbsp;</div><div class="code_line">Procedure LoadMyLibrary(FileName: String);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;AdbLoad := LoadLibrary(PWideChar(FileName));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;if AdbLoad = 0 then begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox(0,&#39;Невозможно загрузить библиотеку&#39;,0,0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp;AdbEnumInterfaces := GetProcAddress(Adbload, &#39;AdbEnumInterfaces&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;AdbNextInterface &nbsp;:= GetProcAddress(AdbLoad, &#39;AdbNextInterface&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;//AdbCloseHandle &nbsp; &nbsp;:= GetProcAddress(AdbLoad, &#39;AdbCloseHandle&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;if @AdbEnumInterfaces = nil then begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; MessageBox(0,&#39;Невозможно загрузить библиотеку&#39;,0,0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; exit;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;if @AdbNextInterface = nil then begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; MessageBox(0,&#39;Невозможно загрузить библиотеку&#39;,0,0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; exit;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TForm1.Button1Click(Sender: TObject);</div><div class="code_line">&nbsp;</div><div class="code_line">const</div><div class="code_line">&nbsp;&nbsp; &nbsp;ANDROID_USB_CLASS_ID: TGUID = &#39;{F72FE0D4-CBCB-407d-8814-9ED673D0DD6B}&#39;;</div><div class="code_line">&nbsp;</div><div class="code_line">begin</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; enum_handle := AdbEnumInterfaces(ANDROID_USB_CLASS_ID, True, True, True);</div><div class="code_line">&nbsp;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TForm1.FormCreate(Sender: TObject);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;LoadMyLibrary(&#39;AdbWinApi.dll&#39;);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TForm1.FormDestroy(Sender: TObject);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;FreeLibrary(Adbload);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">end.</div></ol></div></div></div></div><br>
<br>
Функция возвращает всегда 1 , а не Handle<br>
 Где я не правильно делаю?<br>
<br>
А вот пример использования на С<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">const GUID kAdbInterfaceId = ANDROID_USB_CLASS_ID;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">bool TestEnumInterfaces() {</div><div class="code_line">&nbsp;&nbsp;// Enumerate interfaces</div><div class="code_line">&nbsp;&nbsp;ADBAPIHANDLE enum_handle =</div><div class="code_line">&nbsp;&nbsp; &nbsp;AdbEnumInterfaces(kAdbInterfaceId, true, true, true);</div><div class="code_line">&nbsp;&nbsp;if (NULL == enum_handle) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;printf(&quot;\nEnum interfaces failure:&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;printf(&quot;\nUnable to enumerate ADB interfaces: %u&quot;, GetLastError());</div><div class="code_line">&nbsp;&nbsp; &nbsp;return false;</div><div class="code_line">&nbsp;&nbsp;}</div></ol></div></div></div></div>]]></description>
        <author>Сержик</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	