572 Commits

Author SHA1 Message Date
Pete Batard 34582d44ac fixed possible buffer overflow in windows_error_str()
* also added removal of CR/LF
pbr299
2010-08-19 16:27:08 +01:00
Pete Batard d981c21632 added full support for filter drivers
* precedence is driver > upper filter > lower filter and defined
  in struct driver_lookup lookup from set_device_paths()
2010-08-19 16:18:25 +01:00
Pete Batard e68165152f added limited support for filter drivers
* first lower filter driver only
* driver currently has precedence over filter driver
pbr298
2010-08-18 21:25:05 +01:00
Pete Batard 443ee055b2 removed root from list of DDK include paths
* fixes an issue where DDK would use the config.h from MinGW/cygwin in root instead of using msvc's
pbr297
2010-08-17 16:26:14 +01:00
Pete Batard 02043e6e0e removed _debug suffix for debug DLL 2010-08-17 15:49:14 +01:00
Pete Batard bff90e0aa9 fixed errcode shadow warning in MinGW-w64 (windows backend) pbr296 2010-08-17 13:40:23 +01:00
Pete Batard ebe4dbd2ef fixed errcode shadow warning in MinGW-w64 (core) 2010-08-17 13:35:44 +01:00
Pete Batard da2cf62775 restrict scope of previous workaround and return error when possible 2010-08-17 13:33:01 +01:00
Pete Batard 2ffa5342c4 only apply previous workaround for 32 bit builds pbr295 2010-08-16 23:48:00 +01:00
Pete Batard 3cbb8af874 added Workaround for MinGW-w64 multilib bug
* current MinGW-w64 32 bit headers (winbase.h) are missing the WINAPI qualifier on Interlocked### calls
* this results in missing decorations on symbols and failed linking as a result
* this workaround hooks into kernel32.dll for these function calls to alleviate the issue
2010-08-15 21:44:13 +01:00
Pete Batard 689d78a063 remove unneeded sanity check in cache_config_descriptors
* issue reported by Benjamin Dobell (with additional input from Tim Roberts)
* unlike interface numbers, bConfigurationValue are not required to be in order
* also produces actual bConfigurationValue in debug output
* small whitespace fix in windows_usb.h
pbr294
2010-08-10 19:46:59 +01:00
Pete Batard d059be54ca removed WinUsb_QueryInterfaceSettings() call in winusb_claim_interface
* issue reported by Benjamin Dobell
* WinUsb_QueryInterfaceSettings does not work on any other interface but the first one (WinUSB limitation)
* this change should allow the use of WinUSB in lieu of usbccgp
* also improvements to core readability
2010-08-10 19:46:56 +01:00
Pete Batard 9daf8200f0 VS 2008 project files now use default for most options
* also fixed DLL generation that was set to MT(d) to using MD(d)
2010-08-06 18:55:17 +01:00
Nathan Hjelm e2e354d519 Darwin: Cache device configuration value
Cache device configuration value to bring the Darwin backend more in
line with the libusb spec. To handle buggy devices GetConfiguration is
not called unless the device has more than one configuration.
2010-08-05 11:08:38 +01:00
Pete Batard f901e14356 [INTERNAL - NOT FOR RELEASE] bm.sh improvements
added -m32 LDFLAGS
added DLLTOOLFLAGS for 32 bit multilib generation
2010-08-05 01:35:50 +01:00
Pete Batard 30b42bc654 creates MinGW and MS DLLs that are fully interchangeable
1. because we use WINAPI, the def file MUST have the @n aliases - there's no way around as MinGW's .o use decoration always for __stdcall, and this can't be turned off
2. our "dumb" autogen create_def() script simply creates the whole range of aliases (we might improve on this in the future)
3. dlltool must be called manually to create the import lib from the def, *with the --kill-at option*
4. a CREATE_IMPORT_LIB autotools variable is introduced to selectively run dlltool or not
pbr293
2010-08-05 01:33:49 +01:00
Pete Batard d91b872c4c more safe string macros improvements pbr292 2010-08-03 11:50:22 +01:00
Pete Batard f5e41f3b7b fixed bad .def directory for MSVC6 DLL project file 2010-08-03 01:44:20 +01:00
Pete Batard fce997a8c6 [INTERNAL - NOT FOR RELEASE] include .def in binary snapshot 2010-08-02 23:17:36 +01:00
Pete Batard 7f4f7bd753 reverted to using a (generated) .def file for DLL exports
added libusb-1.0.def (plus reference in MS projects)
removed LIBUSB_EXP/__declspec(dllexport) from libusb.h
removed LIBUSB_DLL_BUILD macros
added -Wl,--add-stdcall-alias linker option for MinGW/cygwin for DLL generation
added sed script in autogen to update the libusb-1.0.def
pbr291
2010-08-02 23:13:17 +01:00
Pete Batard c9b0a3b82e minor improvements
cast pointer to void* for safe_free
always use safe_strlen in lieu of strlen
avoid the use of a strlen parameter in a macro
don't feed negative values to min() in safe_strncat
set uninitialized DLL functions to NULL
2010-08-02 12:40:24 +01:00
Pete Batard 8b5f31e568 fixed bad cleanup in winusb_release_interface()
also minor fixes (whitespace, debug output)
pbr290
2010-08-01 23:31:20 +01:00
Pete Batard 8c3473b0ca fixed mishandling of null terminators in safe_strncpy() 2010-08-01 22:09:29 +01:00
Pete Batard 48ce4304c8 fixed bad string duplication for WinUSB paths pbr289 2010-07-31 01:54:21 +01:00
Pete Batard b5820d34ad enforce proper line terminators for MSVC and .sh files 2010-07-31 01:03:39 +01:00
Pete Batard 972106d2c8 more residuals from official: samples pbr288 2010-07-30 00:02:18 +01:00
Pete Batard b315c285a1 more residuals from official: core 2010-07-30 00:02:02 +01:00
Pete Batard 543371cc8f more residuals from official: core 2010-07-29 23:38:26 +01:00
Pete Batard 5eb857963e fixed residuals from official: autogen.sh 2010-07-29 23:05:17 +01:00
Pete Batard 92c7e620a7 fix -Wshadow warnings for cywgin
does so by setting gcc to -std=c99 instead -std=gnu99 for MinGW/cygwin
pbr287
2010-07-29 22:50:00 +01:00
Pete Batard b92d19b89b fix missing linefeeds at the end of windows_usb.c/h 2010-07-29 22:47:59 +01:00
Pete Batard c700fff1b0 removed double entry in AUTHORS 2010-07-29 20:10:47 +01:00
Pete Batard b9da60b4d5 fixed residuals from official for autoconf/automake 2010-07-29 20:08:18 +01:00
Pete Batard f3360dd288 fixed -Wshadow compilation errors when using cygwin
NB: this only fixes -Wshadow errors, not -Wshadow warnings
2010-07-29 20:08:15 +01:00
Pete Batard 48e1898980 fixed residuals from official for core files 2010-07-29 20:08:12 +01:00
Pete Batard 84d996b482 fixed residuals from official for Darwin 2010-07-29 20:08:09 +01:00
Pete Batard 7659e6b1b2 [INTERNAL - NOT FOR RELEASE] added MinGW64 to "daily" builds 2010-07-29 15:53:52 +01:00
Xiaofan Chen 9a515b7da4 fixed inconsistencies between prototypes and declarations pbr286 2010-07-29 13:30:48 +01:00
Michael Plante f0c40ad811 merged backend integration changes from official branch 2010-07-29 13:11:49 +01:00
Aurelien Jarno 96cd678c93 fix bashisms 2010-07-29 12:45:30 +01:00
Daniel Drake 435760539e bring autoconf/automake in line with official 2010-07-29 12:42:25 +01:00
Daniel Drake 1867c7103b Add reference counting to default context
Michael Plante pointed out that if 2 users call libusb_init(NULL) within
a process, we end up creating 2 default contexts, one of which is lost.

Add reference counting so that the default context is reused and
destroyed only after the last user.
pbr285
2010-07-29 12:18:45 +01:00
Daniel Drake 30b5fbb87c Fix libusb_init() error handling
9996ccaed7 introduced a problem in that mutexes could be destroyed
in the error handling codepath before they had been created.
Pointed out by Michael Plante.
2010-07-29 11:56:55 +01:00
Hoi-Ho Chan f1cc768c9f Darwin: handle kIOReturnUnderrun
This return code indicates that the device returned a data packet
less than the max packet size. In libusb backend terms, this is
a successful transfer.
pbr284
2010-07-29 11:25:18 +01:00
Hoi-Ho Chan 8f014a89fb Darwin: write iso transfer details into correct packets 2010-07-29 11:25:11 +01:00
Nathan Hjelm 82cb50a5ab Darwin: fix interface object leak 2010-07-29 11:24:56 +01:00
Nathan Hjelm a58e3973ad Darwin: clean up some debug messages 2010-07-29 11:24:51 +01:00
Nathan Hjelm fd040e48bb Darwin: Don't open devices during scan unless we have to unsuspend 2010-07-29 11:24:44 +01:00
Peter Stuge bfd95f6a63 Linux: Handle early complete of multi-URB transfer 2010-07-29 11:24:35 +01:00
Daniel Drake db223f0879 Linux: Fix log message commit
Forgot to test this.
2010-07-29 11:20:54 +01:00