[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libusb-devel
Subject:    Re: [libusb] Detecting WinUSB.SYS
From:       "Butch Griffin" <butchg () comcast ! net>
Date:       2016-11-15 2:59:26
Message-ID: 008f01d23eec$477c5420$d674fc60$ () comcast ! net
[Download RAW message or body]

This is a multipart message in MIME format.

[Attachment #2 (multipart/alternative)]
This is a multipart message in MIME format.


Thanks for the various feedback and for others benefit …

 

I found that if I have my proprietary driver attached, the open fails if it is a \
simple device.  But, if it is a composite device, the open succeeds and I must try to \
claim an interface other than interface zero that I know exists.  This makes sense of \
source in hingsight. 

 

If I have the WinUSB.sys driver attached all of this works as expected and I can use \
libusb.

 

Fairly simple logic to get it working, but someone else may come up against the same \
thing.

 

Thanks

Jack

 

 

From: elavid@gmail.com [mailto:elavid@gmail.com] On Behalf Of David Grayson
Sent: Thursday, November 10, 2016 11:54 AM
To: Butch Griffin <butchg@comcast.net>
Cc: Libusb Mailing List <libusb-devel@lists.sourceforge.net>
Subject: Re: [libusb] Detecting WinUSB.SYS

 

Hello, Jack.

 

There is code for doing that in libusbp, in a function named \
check_driver_installation:


https://github.com/pololu/libusbp/blob/890379c54ef58de46afc60b9c3eccfe2bd66d523/src/windows/generic_interface_windows.c


I hope you find it useful!

 

--David

 

On Thu, Nov 10, 2016 at 10:45 AM, Butch Griffin <butchg@comcast.net \
<mailto:butchg@comcast.net> > wrote:

Hello,

 

I have an application that scans for USB devices that match any one of a set of \
VID/PID pairs that are managed by the application.  After detecting the device, I \
want to determine if the device is bound to WinUSB.SYS and if so, I will manage the \
device using the libusb APIs.  However, the device may also be bound to another \
proprietary driver and if it is I want to ignore the device.  

 

When I find a device that is bound to the other driver, it turns out I can open the \
device, perform control transfers for standard descriptors, etc. and it all works.  \
None of my requests fail until I do a BULK request of some type to the device.  Then, \
if the device is not bound to WinUSB.SYS, the request will fail.  While I could use \
this to determine if I am talking to a device I can manage, the bulk requests have \
side effects and I don't want to happen.

 

So, the basic question, is there a way when using libusb under windows to determine \
if a given device is bound to WinUSB.sys (or I guess any other driver that has a \
backend under windows)?

 

Thanks

Jack

 

 


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
libusb-devel mailing list
libusb-devel@lists.sourceforge.net <mailto:libusb-devel@lists.sourceforge.net> 
https://lists.sourceforge.net/lists/listinfo/libusb-devel

 


[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Thanks for the various \
feedback and for others benefit …<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>I \
found that if I have my proprietary driver attached, the open fails if it is a simple \
device.   But, if it is a composite device, the open succeeds and I must try to claim \
an interface other than interface zero that I know exists.   This makes sense of \
source in hingsight. <o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>If I \
have the WinUSB.sys driver attached all of this works as expected and I can use \
libusb.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Fairly simple logic to get \
it working, but someone else may come up against the same \
thing.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Thanks<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Jack<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><b><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'> elavid@gmail.com \
[mailto:elavid@gmail.com] <b>On Behalf Of </b>David Grayson<br><b>Sent:</b> Thursday, \
November 10, 2016 11:54 AM<br><b>To:</b> Butch Griffin \
&lt;butchg@comcast.net&gt;<br><b>Cc:</b> Libusb Mailing List \
&lt;libusb-devel@lists.sourceforge.net&gt;<br><b>Subject:</b> Re: [libusb] Detecting \
WinUSB.SYS<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p \
class=MsoNormal>Hello, Jack.<o:p></o:p></p><div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>There is code for \
doing that in libusbp, in a function named \
check_driver_installation:<o:p></o:p></p></div><div><p class=MsoNormal><br><a \
href="https://github.com/pololu/libusbp/blob/890379c54ef58de46afc60b9c3eccfe2bd66d523/ \
src/windows/generic_interface_windows.c">https://github.com/pololu/libusbp/blob/890379 \
c54ef58de46afc60b9c3eccfe2bd66d523/src/windows/generic_interface_windows.c</a><br><br>I \
hope you find it useful!<o:p></o:p></p></div><div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p \
class=MsoNormal>--David<o:p></o:p></p></div></div><div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Thu, Nov 10, 2016 at \
10:45 AM, Butch Griffin &lt;<a href="mailto:butchg@comcast.net" \
target="_blank">butchg@comcast.net</a>&gt; wrote:<o:p></o:p></p><blockquote \
style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in \
6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hello,<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have an \
application that scans for USB devices that match any one of a set of VID/PID pairs \
that are managed by the application.&nbsp; After detecting the device, I want to \
determine if the device is bound to WinUSB.SYS and if so, I will manage the device \
using the libusb APIs.&nbsp; However, the device may also be bound to another \
proprietary driver and if it is I want to ignore the device.&nbsp; <o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>When I \
find a device that is bound to the other driver, it turns out I can open the device, \
perform control transfers for standard descriptors, etc. and it all works.&nbsp; None \
of my requests fail until I do a BULK request of some type to the device.&nbsp; Then, \
if the device is not bound to WinUSB.SYS, the request will fail.&nbsp; While I could \
use this to determine if I am talking to a device I can manage, the bulk requests \
have side effects and I don't want to happen.<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>So, the \
basic question, is there a way when using libusb under windows to determine if a \
given device is bound to WinUSB.sys (or I guess any other driver that has a backend \
under windows)?<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Jack<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div></div><p \
class=MsoNormal style='margin-bottom:12.0pt'><br>------------------------------------------------------------------------------<br>Developer \
Access Program for Intel Xeon Phi Processors<br>Access to Intel Xeon Phi \
processor-based developer platforms.<br>With one year of Intel Parallel Studio \
XE.<br>Training and support from Colfax.<br>Order your platform today. <a \
href="http://sdm.link/xeonphi" \
target="_blank">http://sdm.link/xeonphi</a><br>_______________________________________________<br>libusb-devel \
mailing list<br><a href="mailto:libusb-devel@lists.sourceforge.net">libusb-devel@lists.sourceforge.net</a><br><a \
href="https://lists.sourceforge.net/lists/listinfo/libusb-devel" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/libusb-devel</a><o:p></o:p></p></blockquote></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></body></html>



------------------------------------------------------------------------------


_______________________________________________
libusb-devel mailing list
libusb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic