4
1
Fork
You've already forked libusb
1
A cross-platform library to access USB devices https://libusb.info
  • C 90.4%
  • C++ 4.8%
  • Meson 1.7%
  • M4 1.3%
  • Makefile 1.1%
  • Other 0.6%
Maciej Nowak badc836c75
Windows: lazily open device handle (CreateFile call)
Windows manages each sub-device of composite device as separate device -
each one requires separate call to CreateFile to obtain dev_handle.
Opening all sub-devices eagerly prevents other applications for
accessing any sub-device even if application that opened the device is
not using them.
This commit modifies WinUSB backend to call CreateFile lazily, so device
handle is opened when necessary (by claiming the interface) and release as
soon as possible (by releasing the interface).
Implementation details:
* winusbx_open becomes essentially no-operation
* winusbx_claim_interface ensures that device handle is opened
* interface used to initialize WinUSB handle has associated counter of
 claimed interfaces
* claiming and releasing interfaces modifies ref-counter accordingly
* when counter reaches zero on releasing interface, device handle is
 closed
Signed-off-by: Maciej Nowak <maciejt.nowak@gmail.com>
2024年08月08日 14:26:35 +01:00
.github CI: Add Linux and MSYS build with logging disabled 2023年12月03日 11:43:20 +01:00
.private Replace all http://libusb.info/ with https 2024年01月19日 21:53:20 +01:00
android android: Fix typo and syntax in comments 2022年03月18日 19:16:27 +01:00
doc meson: Defined an option to control if things will get installed or not 2024年03月04日 20:58:31 +00:00
examples meson: Added an option to control what kind of build will be done when in a cross-build environment 2024年03月04日 20:44:02 +00:00
libusb Windows: lazily open device handle (CreateFile call) 2024年08月08日 14:26:35 +01:00
meson meson: Add licensing information 2024年03月04日 20:00:32 +00:00
msvc meson: Added an option to control what kind of build will be done when in a cross-build environment 2024年03月04日 20:44:02 +00:00
tests meson: Added an option to control what kind of build will be done when in a cross-build environment 2024年03月04日 20:44:02 +00:00
Xcode xcode: Add files from other backends into the Xcode project 2024年01月20日 12:10:53 +01:00
.codespellrc Correct some spelling and add codespell config file 2024年01月20日 12:09:35 +01:00
.gitattributes Windows: Remove support for WinCE and Visual Studio older than 2013 2020年01月20日 18:02:19 -08:00
.gitignore .gitignore: Ignore test binaries and logs 2023年12月09日 10:38:56 +01:00
.travis.yml travis: Turn off Homebrew updates 2020年12月19日 13:29:38 -08:00
appveyor.yml msvc: Rework msbuild files 2022年06月26日 17:09:14 +02:00
AUTHORS libusb 1.0.27-rc1 2023年12月10日 17:33:32 +01:00
autogen.sh autogen: Support being called from external build dir 2021年04月14日 16:51:09 +02:00
bootstrap.sh autogen: Support being called from external build dir 2021年04月14日 16:51:09 +02:00
ChangeLog libusb 1.0.27 2024年01月31日 23:11:14 +01:00
configure.ac configure.ac: Bump libtool library version 2024年01月31日 23:07:43 +01:00
COPYING Initial commit 2007年12月02日 22:54:59 +00:00
HACKING Add HACKING file with hints on proper commits 2023年11月05日 14:36:28 +01:00
INSTALL_WIN.txt msvc: Rework msbuild files 2022年06月26日 17:09:14 +02:00
libusb-1.0.pc.in Solaris backend 2016年07月24日 20:00:00 -06:00
LICENSE.meson.txt meson: Add licensing information 2024年03月04日 20:00:32 +00:00
Makefile.am Makefiles: Remove target-specific variables 2020年04月09日 12:30:57 -07:00
meson.build meson: Fix cross build on macOS 2024年06月21日 20:29:20 +00:00
meson_options.txt meson: Defined an option to control if things will get installed or not 2024年03月04日 20:58:31 +00:00
NEWS Replace all http://libusb.info/ with https 2024年01月19日 21:53:20 +01:00
PORTING Misc: Revert all references to libusb/libusb.info 2014年01月08日 23:51:01 +00:00
README Replace all http://libusb.info/ with https 2024年01月19日 21:53:20 +01:00
README.git Correct some spelling and add codespell config file 2024年01月20日 12:09:35 +01:00
README.md Exchange README.md and README 2020年08月23日 17:32:06 +02:00
TODO Updated TODO link 2016年07月24日 20:02:31 -06:00

libusb

Build Status Build Status Coverity Scan Build Status

libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD, Haiku, Solaris userspace, and WebAssembly via WebUSB. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (see COPYING).

libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. Please see the PORTING file for more information.

libusb homepage: https://libusb.info/

Developers will wish to consult the API documentation: http://api.libusb.info

Use the mailing list for questions, comments, etc: http://mailing-list.libusb.info

(Please use the mailing list rather than mailing developers directly)