winusbio.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. This Software is provided under the Zope Public License (ZPL) Version 2.1.
  3. Copyright (c) 2009, 2010, 2013 by the mingw-w64 project
  4. See the AUTHORS file for the list of contributors to the mingw-w64 project.
  5. This license has been certified as open source. It has also been designated
  6. as GPL compatible by the Free Software Foundation (FSF).
  7. Redistribution and use in source and binary forms, with or without
  8. modification, are permitted provided that the following conditions are met:
  9. 1. Redistributions in source code must retain the accompanying copyright
  10. notice, this list of conditions, and the following disclaimer.
  11. 2. Redistributions in binary form must reproduce the accompanying
  12. copyright notice, this list of conditions, and the following disclaimer
  13. in the documentation and/or other materials provided with the
  14. distribution.
  15. 3. Names of the copyright holders must not be used to endorse or promote
  16. products derived from this software without prior written permission
  17. from the copyright holders.
  18. 4. The right to distribute this software or to use it for any purpose does
  19. not give you the right to use Servicemarks (sm) or Trademarks (tm) of
  20. the copyright holders. Use of them is covered by separate agreement
  21. with the copyright holders.
  22. 5. If any files are modified, you must cause the modified files to carry
  23. prominent notices stating that you changed the files and the date of
  24. any change.
  25. Disclaimer
  26. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
  27. OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  28. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  29. EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
  30. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  31. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  32. OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  33. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  34. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  35. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  36. */
  37. #ifndef __WINUSBIO_H
  38. #define __WINUSBIO_H
  39. #include <winapifamily.h>
  40. #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
  41. #include <windows.h>
  42. #include <usb.h> /* for USBD_PIPE_TYPE */
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. typedef struct _WINUSB_PIPE_INFORMATION {
  47. USBD_PIPE_TYPE PipeType;
  48. UCHAR PipeId;
  49. USHORT MaximumPacketSize;
  50. UCHAR Interval;
  51. } WINUSB_PIPE_INFORMATION, *PWINUSB_PIPE_INFORMATION;
  52. typedef struct _WINUSB_PIPE_INFORMATION_EX {
  53. USBD_PIPE_TYPE PipeType;
  54. UCHAR PipeId;
  55. USHORT MaximumPacketSize;
  56. UCHAR Interval;
  57. ULONG MaximumBytesPerInterval;
  58. } WINUSB_PIPE_INFORMATION_EX, *PWINUSB_PIPE_INFORMATION_EX;
  59. /* constants for WinUsb_Get/SetPipePolicy. */
  60. #define SHORT_PACKET_TERMINATE 0x01
  61. #define AUTO_CLEAR_STALL 0x02
  62. #define PIPE_TRANSFER_TIMEOUT 0x03
  63. #define IGNORE_SHORT_PACKETS 0x04
  64. #define ALLOW_PARTIAL_READS 0x05
  65. #define AUTO_FLUSH 0x06
  66. #define RAW_IO 0x07
  67. #define MAXIMUM_TRANSFER_SIZE 0x08
  68. #define RESET_PIPE_ON_RESUME 0x09
  69. /* constants for WinUsb_Get/SetPowerPolicy. */
  70. #define AUTO_SUSPEND 0x81
  71. #define ENABLE_WAKE 0x82
  72. #define SUSPEND_DELAY 0x83
  73. /* constants for WinUsb_QueryDeviceInformation. */
  74. #define DEVICE_SPEED 0x01
  75. #define LowSpeed 0x01
  76. #define FullSpeed 0x02
  77. #define HighSpeed 0x03
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #include <initguid.h>
  82. DEFINE_GUID (WinUSB_TestGuid, 0xda812bff, 0x12c3, 0x46a2, 0x8e, 0x2b, 0xdb, 0xd3, 0xb7, 0x83, 0x4c, 0x43);
  83. #endif
  84. #endif /* __WINUSBIO_H */