1dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/* 2dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * Copyright (C) 2006 The Android Open Source Project 3dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * 4dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * Licensed under the Apache License, Version 2.0 (the "License"); 5dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * you may not use this file except in compliance with the License. 6dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * You may obtain a copy of the License at 7dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * 8dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * http://www.apache.org/licenses/LICENSE-2.0 9dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * 10dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * Unless required by applicable law or agreed to in writing, software 11dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * distributed under the License is distributed on an "AS IS" BASIS, 12dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * See the License for the specific language governing permissions and 14dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine * limitations under the License. 15dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine */ 16dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 17dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#ifndef ANDROID_USB_API_ADBWINAPI_H__ 18dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define ANDROID_USB_API_ADBWINAPI_H__ 198267511c96e3226e45a0be773ee442b66261824dvchtchetkine 20dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \file 21dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine This file consists of declarations of routines exported by the API as well 22dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine as types, structures, and constants definitions used in the API. 23dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 24dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 25dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// Enables compillation for "straight" C 26dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#ifdef __cplusplus 27dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine #define EXTERN_C extern "C" 28dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#else 29dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine #define EXTERN_C extern 30dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine typedef int bool; 31dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine #define true 1 32dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine #define false 0 33dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#endif 34dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 35dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Enumerates ADB endpoint types. 36dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 37dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine This enum is taken from WDF_USB_PIPE_TYPE enum found in WDK. 38dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 39dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkinetypedef enum _AdbEndpointType { 40dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Unknown (invalid, or not initialized) endpoint type. 41dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointTypeInvalid = 0, 42dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 43dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Endpoint is device control pipe. 44dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointTypeControl, 45dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 46dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Endpoint is isochronous r/w pipe. 47dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointTypeIsochronous, 48dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 49dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Endpoint is a bulk r/w pipe. 50dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointTypeBulk, 51dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 52dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Endpoint is an interrupt r/w pipe. 53dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointTypeInterrupt, 54dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine} AdbEndpointType; 55dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 56dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Endpoint desriptor. 57dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 58dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine This structure is based on WDF_USB_PIPE_INFORMATION structure found in WDK. 59dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 60dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkinetypedef struct _AdbEndpointInformation { 61dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Maximum packet size this endpoint is capable of. 62dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long max_packet_size; 63dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 64dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Maximum size of one transfer which should be sent to the host controller. 65dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long max_transfer_size; 66dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 67dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// ADB endpoint type. 68dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointType endpoint_type; 69dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 70dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Raw endpoint address on the device as described by its descriptor. 71dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned char endpoint_address; 72dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 73dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Polling interval. 74dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned char polling_interval; 75dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 76dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Which alternate setting this structure is relevant for. 77dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned char setting_index; 78dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine} AdbEndpointInformation; 79dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 80dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Shortcut to default write bulk endpoint in zero-based endpoint index API. 81dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define ADB_QUERY_BULK_WRITE_ENDPOINT_INDEX 0xFC 82dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 83dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Shortcut to default read bulk endpoint in zero-based endpoint index API. 84dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define ADB_QUERY_BULK_READ_ENDPOINT_INDEX 0xFE 85dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 86dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// {F72FE0D4-CBCB-407d-8814-9ED673D0DD6B} 87dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Our USB class id that driver uses to register our device. 88dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define ANDROID_USB_CLASS_ID \ 89dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine{0xf72fe0d4, 0xcbcb, 0x407d, {0x88, 0x14, 0x9e, 0xd6, 0x73, 0xd0, 0xdd, 0x6b}}; 90dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 91dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Defines vendor ID for HCT devices. 92dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define DEVICE_VENDOR_ID 0x0BB4 93dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 94dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Defines product ID for the device with single interface. 95dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define DEVICE_SINGLE_PRODUCT_ID 0x0C01 96dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 97dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Defines product ID for the Dream composite device. 98dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define DEVICE_COMPOSITE_PRODUCT_ID 0x0C02 99dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 100dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Defines product ID for the Magic composite device. 101dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define DEVICE_MAGIC_COMPOSITE_PRODUCT_ID 0x0C03 102dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 103dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Defines interface ID for the device. 104dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define DEVICE_INTERFACE_ID 0x01 105dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 106dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Defines vendor ID for the device 107dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define DEVICE_EMULATOR_VENDOR_ID 0x18D1 108dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 109dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// Defines product ID for a SoftUSB device simulator that is used to test 110dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/// the driver in isolation from hardware. 111dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define DEVICE_EMULATOR_PROD_ID 0xDDDD 112dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 113dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// The following ifdef block is the standard way of creating macros which make 114dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// exporting from a DLL simpler. All files within this DLL are compiled with 115dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// the ADBWIN_EXPORTS symbol defined on the command line. this symbol should 116dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// not be defined on any project that uses this DLL. This way any other project 117dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// whose source files include this file see ADBWIN_API functions as being 118dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// imported from a DLL, whereas this DLL sees symbols defined with this macro 119dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine// as being exported. 120dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#ifdef ADBWIN_EXPORTS 121dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define ADBWIN_API EXTERN_C __declspec(dllexport) 122acc6f826433e639b1ba00c021ab5f9161eb56e59vchtchetkine#define ADBWIN_API_CLASS __declspec(dllexport) 123dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#else 124dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#define ADBWIN_API EXTERN_C __declspec(dllimport) 125acc6f826433e639b1ba00c021ab5f9161eb56e59vchtchetkine#define ADBWIN_API_CLASS __declspec(dllimport) 126dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#endif 127dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 128dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Handle to an API object. 129dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 130dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine To access USB interface and its components clients must first obtain a 131dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine handle to the required object. API Objects that are represented by a 132dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine handle are: 133dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 1. Interface enumerator that provides access to a list of interfaces that 134dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine match certain criterias that were specified when interface enumerator 135dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine has been created. This handle is created in AdbEnumInterfaces routine. 136dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 2. Interface that is the major object this API deals with. In Windows 137dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine model of the USB stack each USB device (that is physical device, 138dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine attached to a USB port) exposes one or more interfaces that become the 139dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine major entities through which that device gets accessed. Each of these 140dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine interfaces are represented as Windows Device Objects on the USB stack. 141dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine So, to this extent, at least as this API is concerned, terms "interface" 142dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine and "device" are interchangeable, since each interface is represented by 143dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine a device object on the Windows USB stack. This handle is created in 144dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine either AdbCreateInterface or AdbCreateInterfaceByName routines. 145dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 3. Endpoint object (also called a pipe) represents an endpoint on interface 146dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine through which all I/O operations are performed. This handle is created in 147dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine one of these routines: AdbOpenEndpoint, AdbOpenDefaultBulkReadEndpoint, 148dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine or AdbOpenDefaultBulkWriteEndpoint. 149dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 4. I/O completion object that tracks completion information of asynchronous 150dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine I/O performed on an endpoint. When an endpoint object gets opened through 151dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine this API it is opened for asynchronous (or overlapped) I/O. And each time 152dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine an asynchronous I/O is performed by this API an I/O completion object is 153dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine created to track the result of that I/O when it gets completed. Clients 154dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the API can then use a handle to I/O completion object to query for 155dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine the status and result of asynchronous I/O as well as wait for this I/O 156dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine completion. This handle is created in one of these routines: 157dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbReadEndpointAsync, or AdbWriteEndpointAsync. 158dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine After object is no longer needed by the client, its handle must be closed 159dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine using AdbCloseHandle routine. 160dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 161dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkinetypedef void* ADBAPIHANDLE; 162dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 163dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Defines access type with which an I/O object (endpoint) 164dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine should be opened. 165dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 166dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkinetypedef enum _AdbOpenAccessType { 167dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Opens for read and write access. 168dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenAccessTypeReadWrite, 169dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 170dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Opens for read only access. 171dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenAccessTypeRead, 172dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 173dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Opens for write only access. 174dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenAccessTypeWrite, 175dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 176dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Opens for querying information. 177dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenAccessTypeQueryInfo, 178dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine} AdbOpenAccessType; 179dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 180dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Defines sharing mode with which an I/O object (endpoint) 181dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine should be opened. 182dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 183dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkinetypedef enum _AdbOpenSharingMode { 184dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Shares read and write. 185dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenSharingModeReadWrite, 186dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 187dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Shares only read. 188dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenSharingModeRead, 189dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 190dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Shares only write. 191dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenSharingModeWrite, 192dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 193dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Opens exclusive. 194dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenSharingModeExclusive, 195dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine} AdbOpenSharingMode; 196dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 197dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Provides information about an interface. 198dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 199dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkinetypedef struct _AdbInterfaceInfo { 200dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Inteface's class id (see SP_DEVICE_INTERFACE_DATA for details) 201dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GUID class_id; 202dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 203dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Interface flags (see SP_DEVICE_INTERFACE_DATA for details) 204dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long flags; 205dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 206dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// Device name for the interface (see SP_DEVICE_INTERFACE_DETAIL_DATA 207dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine /// for details) 208dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine wchar_t device_name[1]; 209dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine} AdbInterfaceInfo; 210dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 211dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Creates USB interface enumerator 212dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 213dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine This routine enumerates all USB interfaces that match provided class ID. 214dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine This routine uses SetupDiGetClassDevs SDK routine to enumerate devices that 215dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine match class ID and then SetupDiEnumDeviceInterfaces SDK routine is called 216dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine to enumerate interfaces on the devices. 217dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] class_id Device class ID, assigned by the driver. 218dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] exclude_not_present If true enumation will include only those 219dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine devices that are currently present. 220dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] exclude_removed If true interfaces with SPINT_REMOVED flag set 221dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine will be not included in the enumeration. 222dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] active_only If true only active interfaces (with flag 223dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine SPINT_ACTIVE set) will be included in the enumeration. 224dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return Handle to the enumerator object or NULL on failure. If NULL is 225dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 226dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 227dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbEnumInterfaces(GUID class_id, 228dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine bool exclude_not_present, 229dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine bool exclude_removed, 230dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine bool active_only); 231dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 232dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets next interface information 233dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 234dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_handle Handle to interface enumerator object obtained via 235dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEnumInterfaces call. 236dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] info Upon successful completion will receive interface 237dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine information. Can be NULL. If it is NULL, upon return from this 238dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine routine size parameter will contain memory size required for the 239dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine next entry. 240dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in,out] size On the way in provides size of the memory buffer 241dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine addressed by info parameter. On the way out (only if buffer was not 242dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine big enough) will provide memory size required for the next entry. 243dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on error. If false is returned 244dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 245dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine ERROR_INSUFFICIENT_BUFFER indicates that buffer provided in info 246dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine parameter was not big enough and size parameter contains memory size 247dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine required for the next entry. ERROR_NO_MORE_ITEMS indicates that 248dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine enumeration is over and there are no more entries to return. 249dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 250dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbNextInterface(ADBAPIHANDLE adb_handle, 251dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbInterfaceInfo* info, 252dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long* size); 253dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 254dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Resets enumerator so next call to AdbNextInterface will start 255dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine from the beginning. 256dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 257dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_handle Handle to interface enumerator object obtained via 258dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEnumInterfaces call. 259dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on error. If false is returned GetLastError() 260dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine provides extended error information. 261dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 262dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbResetInterfaceEnum(ADBAPIHANDLE adb_handle); 263dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 264dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Creates USB interface object 265dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 266dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine This routine creates an object that represents a USB interface. 267dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] interface_name Name of the interface. 268dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return Handle to the interface object or NULL on failure. If NULL is 269dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 270dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 271dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbCreateInterfaceByName(const wchar_t* interface_name); 272dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 273dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Creates USB interface object based on vendor, product and 274dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine interface IDs. 275dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 276dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine This routine creates and object that represents a USB interface on our 277dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine device. It uses AdbCreateInterfaceByName to actually do the create. 278dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] class_id Device class ID, assigned by the driver. 279dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] vendor_id Device vendor ID 280dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] product_id Device product ID 281dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] interface_id Device interface ID. This parameter is optional. 282dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine Value 0xFF indicates that interface should be addressed by vendor 283dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine and product IDs only. 284dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return Handle to the interface object or NULL on failure. If NULL is 285dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 286dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 287dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbCreateInterface(GUID class_id, 288dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned short vendor_id, 289dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned short product_id, 290dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned char interface_id); 291dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 292dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets interface name. 293dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 294dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 295dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 296dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] buffer Buffer for the name. Can be NULL in which case 297dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine buffer_char_size will contain number of characters required for 298dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine the name. 299dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in,out] buffer_char_size On the way in supplies size (in characters) 300dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the buffer. On the way out, if method failed and GetLastError 301dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine reports ERROR_INSUFFICIENT_BUFFER, will contain number of characters 302dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine required for the name. 303dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] ansi If true the name will be returned as single character 304dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine string. Otherwise name will be returned as wide character string. 305dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 306dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 307dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 308dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetInterfaceName(ADBAPIHANDLE adb_interface, 309dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine void* buffer, 310dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long* buffer_char_size, 311dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine bool ansi); 312dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 313dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets serial number for interface's device. 314dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 315dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 316dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 317dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] buffer Buffer for the serail number string. Can be NULL in which 318dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine case buffer_char_size will contain number of characters required for 319dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine the string. 320dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in,out] buffer_char_size On the way in supplies size (in characters) 321dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the buffer. On the way out, if method failed and GetLastError 322dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine reports ERROR_INSUFFICIENT_BUFFER, will contain number of characters 323dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine required for the name. 324dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] ansi If true the name will be returned as single character 325dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine string. Otherwise name will be returned as wide character string. 326dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 327dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 328dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 329dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetSerialNumber(ADBAPIHANDLE adb_interface, 330dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine void* buffer, 331dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long* buffer_char_size, 332dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine bool ansi); 333dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 334dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets device descriptor for the USB device associated with 335dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine the given interface. 336dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 337dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 338dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 339dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] desc Upon successful completion will have usb device 340dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine descriptor. 341dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 342dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 343dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 344dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetUsbDeviceDescriptor(ADBAPIHANDLE adb_interface, 345dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine USB_DEVICE_DESCRIPTOR* desc); 346dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 347dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets descriptor for the selected USB device configuration. 348dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 349dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 350dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 351dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] desc Upon successful completion will have usb device 352dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine configuration descriptor. 353dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 354dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 355dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 356dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetUsbConfigurationDescriptor( 357dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine ADBAPIHANDLE adb_interface, 358dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine USB_CONFIGURATION_DESCRIPTOR* desc); 359dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 360dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets descriptor for the given interface. 361dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 362dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 363dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 364dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] desc Upon successful completion will have usb device 365dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine configuration descriptor. 366dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 367dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 368dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 369dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetUsbInterfaceDescriptor(ADBAPIHANDLE adb_interface, 370dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine USB_INTERFACE_DESCRIPTOR* desc); 371dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 372dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets information about an endpoint on the given interface. 373dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 374dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 375dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 376dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] endpoint_index Zero-based endpoint index. There are two 377dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine shortcuts for this parameter: ADB_QUERY_BULK_WRITE_ENDPOINT_INDEX 378dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine and ADB_QUERY_BULK_READ_ENDPOINT_INDEX that provide information 379dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine about bulk write and bulk read endpoints respectively. 380dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] info Upon successful completion will have endpoint information. 381dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 382dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 383dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 384dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetEndpointInformation(ADBAPIHANDLE adb_interface, 385dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned char endpoint_index, 386dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointInformation* info); 387dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 388dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets information about default bulk read endpoint on the given 389dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine interface. 390dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 391dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 392dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 393dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] info Upon successful completion will have endpoint information. 394dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 395dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 396dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 397dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetDefaultBulkReadEndpointInformation( 398dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine ADBAPIHANDLE adb_interface, 399dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointInformation* info); 400dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 401dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets information about default bulk write endpoint on the given 402dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine interface. 403dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 404dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 405dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 406dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] info Upon successful completion will have endpoint information. 407dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 408dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 409dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 410dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetDefaultBulkWriteEndpointInformation( 411dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine ADBAPIHANDLE adb_interface, 412dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointInformation* info); 413dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 414dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Opens an endpoint on the given interface. 415dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 416dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine Endpoints are always opened for overlapped I/O. 417dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 418dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 419dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] endpoint_index Zero-based endpoint index. There are two 420dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine shortcuts for this parameter: ADB_QUERY_BULK_WRITE_ENDPOINT_INDEX 421dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine and ADB_QUERY_BULK_READ_ENDPOINT_INDEX that provide information 422dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine about bulk write and bulk read endpoints respectively. 423dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] access_type Desired access type. In the current implementation 424dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine this parameter has no effect on the way endpoint is opened. It's 425dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine always read / write access. 426dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] sharing_mode Desired share mode. In the current implementation 427dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine this parameter has no effect on the way endpoint is opened. It's 428dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine always shared for read / write. 429dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return Handle to the opened endpoint object or NULL on failure. If NULL is 430dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 431dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 432dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbOpenEndpoint(ADBAPIHANDLE adb_interface, 433dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned char endpoint_index, 434dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenAccessType access_type, 435dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenSharingMode sharing_mode); 436dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 437dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Opens default bulk read endpoint on the given interface. 438dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 439dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine Endpoints are always opened for overlapped I/O. 440dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 441dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 442dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] access_type Desired access type. In the current implementation 443dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine this parameter has no effect on the way endpoint is opened. It's 444dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine always read / write access. 445dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] sharing_mode Desired share mode. In the current implementation 446dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine this parameter has no effect on the way endpoint is opened. It's 447dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine always shared for read / write. 448dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return Handle to the opened endpoint object or NULL on failure. If NULL is 449dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 450dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 451dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbOpenDefaultBulkReadEndpoint( 452dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine ADBAPIHANDLE adb_interface, 453dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenAccessType access_type, 454dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenSharingMode sharing_mode); 455dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 456dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Opens default bulk write endpoint on the given interface. 457dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 458dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine Endpoints are always opened for overlapped I/O. 459dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_interface A handle to interface object created with 460dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbCreateInterface call. 461dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] access_type Desired access type. In the current implementation 462dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine this parameter has no effect on the way endpoint is opened. It's 463dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine always read / write access. 464dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] sharing_mode Desired share mode. In the current implementation 465dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine this parameter has no effect on the way endpoint is opened. It's 466dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine always shared for read / write. 467dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return Handle to the opened endpoint object or NULL on failure. If NULL is 468dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 469dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 470dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbOpenDefaultBulkWriteEndpoint( 471dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine ADBAPIHANDLE adb_interface, 472dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenAccessType access_type, 473dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbOpenSharingMode sharing_mode); 474dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 475dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets handle to interface object for the given endpoint 476dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 477dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_endpoint A handle to opened endpoint object, obtained via one 478dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the AdbOpenXxxEndpoint calls. 479dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return Handle to the interface for this endpoint or NULL on failure. If NULL 480dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine is returned GetLastError() provides extended error information. 481dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 482dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbGetEndpointInterface(ADBAPIHANDLE adb_endpoint); 483dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 484dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets information about the given endpoint. 485dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 486dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_endpoint A handle to opened endpoint object, obtained via one 487dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the AdbOpenXxxEndpoint calls. 488dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] info Upon successful completion will have endpoint information. 489dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success, false on failure. If false is returned 490dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 491dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 492dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbQueryInformationEndpoint(ADBAPIHANDLE adb_endpoint, 493dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine AdbEndpointInformation* info); 494dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 495dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Asynchronously reads from the given endpoint. 496dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 497dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_endpoint A handle to opened endpoint object, obtained via one 498dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the AdbOpenXxxEndpoint calls. 499dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] buffer Pointer to the buffer that receives the data. 500dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] bytes_to_read Number of bytes to be read. 501dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] bytes_read Number of bytes read. Can be NULL. 502dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] event_handle Event handle that should be signaled when async I/O 503dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine completes. Can be NULL. If it's not NULL this handle will be used to 504dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine initialize OVERLAPPED structure for this I/O. 505dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] time_out A timeout (in milliseconds) required for this I/O to 506dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine complete. Zero value for this parameter means that there is no 507dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine timeout for this I/O. 508dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return A handle to IO completion object or NULL on failure. If NULL is 509dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 510dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 511dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbReadEndpointAsync(ADBAPIHANDLE adb_endpoint, 512dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine void* buffer, 513dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long bytes_to_read, 514dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long* bytes_read, 515dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long time_out, 516dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine HANDLE event_handle); 517dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 518dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Asynchronously writes to the given endpoint. 519dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 520dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_endpoint A handle to opened endpoint object, obtained via one 521dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the AdbOpenXxxEndpoint calls. 522dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] buffer Pointer to the buffer containing the data to be written. 523dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] bytes_to_write Number of bytes to be written. 524dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] bytes_written Number of bytes written. Can be NULL. 525dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] event_handle Event handle that should be signaled when async I/O 526dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine completes. Can be NULL. If it's not NULL this handle will be used to 527dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine initialize OVERLAPPED structure for this I/O. 528dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] time_out A timeout (in milliseconds) required for this I/O to 529dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine complete. Zero value for this parameter means that there is no 530dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine timeout for this I/O. 531dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return A handle to IO completion object or NULL on failure. If NULL is 532dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 533dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 534dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API ADBAPIHANDLE __cdecl AdbWriteEndpointAsync(ADBAPIHANDLE adb_endpoint, 535dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine void* buffer, 536dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long bytes_to_write, 537dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long* bytes_written, 538dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long time_out, 539dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine HANDLE event_handle); 540dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 541dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Synchronously reads from the given endpoint. 542dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 543dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_endpoint A handle to opened endpoint object, obtained via one 544dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the AdbOpenXxxEndpoint calls. 545dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] buffer Pointer to the buffer that receives the data. 546dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] bytes_to_read Number of bytes to be read. 547dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] bytes_read Number of bytes read. Can be NULL. 548dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] time_out A timeout (in milliseconds) required for this I/O to 549dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine complete. Zero value for this parameter means that there is no 550dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine timeout for this I/O. 551dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success and false on failure. If false is 552dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 553dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 554dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbReadEndpointSync(ADBAPIHANDLE adb_endpoint, 555dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine void* buffer, 556dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long bytes_to_read, 557dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long* bytes_read, 558dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long time_out); 559dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 560dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Synchronously writes to the given endpoint. 561dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 562dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_endpoint A handle to opened endpoint object, obtained via one 563dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine of the AdbOpenXxxEndpoint calls. 564dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] buffer Pointer to the buffer containing the data to be written. 565dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] bytes_to_write Number of bytes to be written. 566dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] bytes_written Number of bytes written. Can be NULL. 567dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] time_out A timeout (in milliseconds) required for this I/O to 568dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine complete. Zero value for this parameter means that there is no 569dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine timeout for this I/O. 570dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success and false on failure. If false is 571dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine returned GetLastError() provides extended error information. 572dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 573dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbWriteEndpointSync(ADBAPIHANDLE adb_endpoint, 574dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine void* buffer, 575dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long bytes_to_write, 576dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long* bytes_written, 577dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long time_out); 578dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 579dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Gets overlapped I/O result for async I/O performed on the 580dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine given endpoint. 581dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 582dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_io_completion A handle to an I/O completion object returned 583dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine from AdbRead/WriteAsync routines. 584dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] ovl_data Buffer for the copy of this object's OVERLAPPED 585dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine structure. Can be NULL. 586dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[out] bytes_transferred Pointer to a variable that receives the 587dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine number of bytes that were actually transferred by a read or write 588dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine operation. See SDK doc on GetOvelappedResult for more information. 589dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine Unlike regular GetOvelappedResult call this parameter can be NULL. 590dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] wait If this parameter is true, the method does not return 591dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine until the operation has been completed. If this parameter is false 592dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine and the operation is still pending, the method returns false and 593dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine the GetLastError function returns ERROR_IO_INCOMPLETE. 594dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true if I/O has been completed or false on failure or if request 595dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine is not yet completed. If false is returned GetLastError() provides 596dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine extended error information. If GetLastError returns 597dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine ERROR_IO_INCOMPLETE it means that I/O is not yet completed. 598dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 599dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbGetOvelappedIoResult(ADBAPIHANDLE adb_io_completion, 600dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine LPOVERLAPPED overlapped, 601dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine unsigned long* bytes_transferred, 602dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine bool wait); 603dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 604dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Checks if overlapped I/O has been completed. 605dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 606dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_io_completion A handle to an I/O completion object returned 607dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine from AdbRead/WriteAsync routines. 608dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true if I/O has been completed or false if it's still 609dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine incomplete. Regardless of the returned value, caller should 610dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine check GetLastError to validate that handle was OK. 611dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 612dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbHasOvelappedIoComplated(ADBAPIHANDLE adb_io_completion); 613dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 614dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine/** \brief Closes handle previously opened with one of the API calls 615dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 616dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @param[in] adb_handle ADB handle previously opened with one of the API calls 617dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine @return true on success or false on failure. If false is returned 618dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine GetLastError() provides extended error information. 619dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine*/ 620dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkineADBWIN_API bool __cdecl AdbCloseHandle(ADBAPIHANDLE adb_handle); 621dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine 622dceaaa52cec11631c72cfea5fb74ee607602ecdevchtchetkine#endif // ANDROID_USB_API_ADBWINAPI_H__ 623