From: Tim Roberts on
flashlib(a)gmail.com wrote:
>
>Alghouh I don't if there is any problem in my code( It succeed when I
>install EZUSB driver to my device, but failed with the custom driver
>which is written by other people), I post it here for a deep discuss:

Do you not have source code for this driver?

>DEFINE_GUID(CameraClassGuid, 0xa5dcbf10,0x6530,0x11d2,0x90,0x1f,
>0x00,0xc0,0x4f,0xb9,0x51,0xed);// ??usb device

That is NOT "CameraClassGuid". That is GUID_DEVINTERFACE_USB_DEVICE. It
is assigned to your PDO by the USB hub driver. In fact, it is assigned to
EVERY device PDO by the USB hub driver.

>In fact, this code works for many device. And for this device I want
>to open, it works with the EZUSB driver but failed with the custom
>drier. Is it possible that there is a authorization in the driver when
>proccess the IRP_MJ_CREAT?

Sure, it's possible. Remember that the device's driver (for the FDO) did
not register this device interface. It didn't expect you to use it.
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.
From: flashlib on
Thanks very much Tim!
I get a little now! Do you mean, if a device's FDO driver didn't
register the IRP_MJ_CREATE(or other), I can't use it at all?
From: Tim Roberts on
flashlib(a)gmail.com wrote:
>
>Thanks very much Tim!
>I get a little now! Do you mean, if a device's FDO driver didn't
>register the IRP_MJ_CREATE(or other), I can't use it at all?

What kind of device is this? Most devices handle IRP_MJ_CREATE, but it
might have certain restrictions, depending on the type of device.
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.
From: Ben Voigt [C++ MVP] on
flashlib(a)gmail.com wrote:
> On 4?17?, ??11?02?, "Ben Voigt [C++ MVP]" <r...(a)nospam.nospam> wrote:
>> flash...(a)gmail.com wrote:
>>> On 4��16��, ����9ʱ26��, chris.aselt...(a)gmail.com wrote:
>>>> On Apr 13, 10:21 pm, flash...(a)gmail.com wrote:
>>
>>>>> hDeviceHandle=CreateFile(
>>>>> szDevicePath[i],
>>>>> GENERIC_READ | GENERIC_WRITE,
>>>>> 0,//FILE_SHARE_READ |
>>>>> FILE_SHARE_WRITE, NULL,
>>>>> OPEN_EXISTING,
>>>>> FILE_FLAG_OVERLAPPED |
>>>>> FILE_ATTRIBUTE_NORMAL, NULL
>>>>> );
>>
>>>>> /////////////////////////////////////////////// // it failed here,
>>>>> always return ERROR_FILE_NOT_FOUND
>>>>> ///////////////////////////////////////////////
>>
>>>> For every case that you get ERROR_NOT_FILE_FOUND, give us a dump of
>>>> szDevicePath[i] please. My guess is that you've mangled it
>>>> somehow.
>>
>>> Hi Chris,
>>
>>> Thanks for your attention! The szDevicePath[i] is as following:
>>> "\\?
>>> \usb#vid_abcd&pid_1234#5&25c045bb&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"
>>
>> Check UNICODE vs single byte?
>>
>>
>>
>>> Thanks.
>
> Hi Ben,
>
> I tried both Unicode and single byte, the result is the same. Any more
> suggestion would be greate appreciated!

Just that I've only seen the "\\?\" prefix discussed with the Unicode
version, CreateFileW. But your variable naming suggested you are using
single byte characters.


From: flashlib on
On 4ÔÂ20ÈÕ, ÉÏÎç8ʱ11·Ö, Tim Roberts <t...(a)probo.com> wrote:
> flash...(a)gmail.com wrote:
>
> >Thanks very much Tim!
> >I get a little now! Do you mean, if a device's FDO driver didn't
> >register the IRP_MJ_CREATE(or other), I can't use it at all?
>
> What kind of device is this? Most devices handle IRP_MJ_CREATE, but it
> might have certain restrictions, depending on the type of device.
> --
> Tim Roberts, t...(a)probo.com
> Providenza & Boekelheide, Inc.

It's a usb video device, I also tried to use the class GUID of
DEFINE_GUID(CameraClassGuid, 0x6bdd1fc6, 0x810f, 0x11d0, 0xbe, 0xc7,
0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f); // image camera
But the result is the same!