From: flashlib on
Dear all,

I'm tring to communicate with a USB device. I first enum the USB hub
and get the path of my device. Then I use CreateFile with the path to
open the device, but it always return an invalid handls. I use
GetLastError and get ERROR_FILE_NOT_FOUND.
There is another program which can communicate with the device
successfully. Can any body tell me why my CreateFile failed?
I know there is a program IRPTrace which can trace the IRP to the
device driver. I ran it and found the first IRP issued by both mine
and the program which can successfully open the device is
IRP_MJ_CREATE.
There are some different in the IRPTrace log for the program, but I
don't what those mean. Can any body help me?

Thanks and BR.
Jacky
From: Doron Holan [MSFT] on
why are you getting a path to the hub? just enumerate the instances of your
device's device interface guid

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


<flashlib(a)gmail.com> wrote in message
news:78daad28-f9a9-4c80-b215-0133441639db(a)w8g2000prd.googlegroups.com...
> Dear all,
>
> I'm tring to communicate with a USB device. I first enum the USB hub
> and get the path of my device. Then I use CreateFile with the path to
> open the device, but it always return an invalid handls. I use
> GetLastError and get ERROR_FILE_NOT_FOUND.
> There is another program which can communicate with the device
> successfully. Can any body tell me why my CreateFile failed?
> I know there is a program IRPTrace which can trace the IRP to the
> device driver. I ran it and found the first IRP issued by both mine
> and the program which can successfully open the device is
> IRP_MJ_CREATE.
> There are some different in the IRPTrace log for the program, but I
> don't what those mean. Can any body help me?
>
> Thanks and BR.
> Jacky

From: flashlib on
On 4ÔÂ10ÈÕ, ÏÂÎç12ʱ59·Ö, "Doron Holan [MSFT]" <dor....(a)online.microsoft.com>
wrote:
> why are you getting a path to the hub? just enumerate the instances of your
> device's device interface guid
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights..
>
> <flash...(a)gmail.com> wrote in message
>
> news:78daad28-f9a9-4c80-b215-0133441639db(a)w8g2000prd.googlegroups.com...
>
> > Dear all,
>
> > I'm tring to communicate with a USB device. I first enum the USB hub
> > and get the path of my device. Then I use CreateFile with the path to
> > open the device, but it always return an invalid handls. I use
> > GetLastError and get ERROR_FILE_NOT_FOUND.
> > There is another program which can communicate with the device
> > successfully. Can any body tell me why my CreateFile failed?
> > I know there is a program IRPTrace which can trace the IRP to the
> > device driver. I ran it and found the first IRP issued by both mine
> > and the program which can successfully open the device is
> > IRP_MJ_CREATE.
> > There are some different in the IRPTrace log for the program, but I
> > don't what those mean. Can any body help me?
>
> > Thanks and BR.
> > Jacky

Hi Doron,

I'm now using the way you show me, get the path by the GUID, but I
still can't createfile, why?
From: Doron Holan [MSFT] on
what fails? the CreateFile call? which device interface guid are you
trying to open?

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


<flashlib(a)gmail.com> wrote in message
news:0ed7c14a-66e5-46b2-a6b3-b20a706852ad(a)w8g2000prd.googlegroups.com...
On 4��10��, ����12ʱ59��, "Doron Holan [MSFT]" <dor...(a)online.microsoft.com>
wrote:
> why are you getting a path to the hub? just enumerate the instances of
> your
> device's device interface guid
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> <flash...(a)gmail.com> wrote in message
>
> news:78daad28-f9a9-4c80-b215-0133441639db(a)w8g2000prd.googlegroups.com...
>
> > Dear all,
>
> > I'm tring to communicate with a USB device. I first enum the USB hub
> > and get the path of my device. Then I use CreateFile with the path to
> > open the device, but it always return an invalid handls. I use
> > GetLastError and get ERROR_FILE_NOT_FOUND.
> > There is another program which can communicate with the device
> > successfully. Can any body tell me why my CreateFile failed?
> > I know there is a program IRPTrace which can trace the IRP to the
> > device driver. I ran it and found the first IRP issued by both mine
> > and the program which can successfully open the device is
> > IRP_MJ_CREATE.
> > There are some different in the IRPTrace log for the program, but I
> > don't what those mean. Can any body help me?
>
> > Thanks and BR.
> > Jacky

Hi Doron,

I'm now using the way you show me, get the path by the GUID, but I
still can't createfile, why?

From: flashlib on
On 4ÔÂ11ÈÕ, ÉÏÎç2ʱ23·Ö, "Doron Holan [MSFT]" <dor....(a)online.microsoft.com>
wrote:
> what fails? the CreateFile call? which device interface guid are you
> trying to open?
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights..
>
> <flash...(a)gmail.com> wrote in message
>
> news:0ed7c14a-66e5-46b2-a6b3-b20a706852ad(a)w8g2000prd.googlegroups.com...
> On 4ÔÂ10ÈÕ, ÏÂÎç12ʱ59·Ö, "Doron Holan [MSFT]" <dor...(a)online.microsoft.com>
> wrote:
>
>
>
> > why are you getting a path to the hub? just enumerate the instances of
> > your
> > device's device interface guid
>
> > d
>
> > --
> > Please do not send e-mail directly to this alias. this alias is for
> > newsgroup purposes only.
> > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
>
> > <flash...(a)gmail.com> wrote in message
>
> >news:78daad28-f9a9-4c80-b215-0133441639db(a)w8g2000prd.googlegroups.com...
>
> > > Dear all,
>
> > > I'm tring to communicate with a USB device. I first enum the USB hub
> > > and get the path of my device. Then I use CreateFile with the path to
> > > open the device, but it always return an invalid handls. I use
> > > GetLastError and get ERROR_FILE_NOT_FOUND.
> > > There is another program which can communicate with the device
> > > successfully. Can any body tell me why my CreateFile failed?
> > > I know there is a program IRPTrace which can trace the IRP to the
> > > device driver. I ran it and found the first IRP issued by both mine
> > > and the program which can successfully open the device is
> > > IRP_MJ_CREATE.
> > > There are some different in the IRPTrace log for the program, but I
> > > don't what those mean. Can any body help me?
>
> > > Thanks and BR.
> > > Jacky
>
> Hi Doron,
>
> I'm now using the way you show me, get the path by the GUID, but I
> still can't createfile, why?

Yes, it failed with the CreateFile call. I'm using the following GUID
to open the file:
DEFINE_GUID(USBGuid, 0xa5dcbf10,0x6530,0x11d2,0x90,0x1f,0x00,0xc0,0x4f,
0xb9,0x51,0xed);