Doron
Fri Oct 12 09:57:42 PDT 2007
you appending to the link name and accessing a device's private namespace.
most drivers ignore namespace strings when processing the creation of
handles which is why this works (for instnace you could open "\\.\com1\FOO"
and it would still open COM1
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.
"zonhai.won" <zonhai.won@gmail.com> wrote in message
news:u$rwjpODIHA.4296@TK2MSFTNGP04.phx.gbl...
> Hi,
> Sorry, I forget one thing about the symbolicname, the
> symbolicname like
> \??\USB#Vid_xx&Pid_xx#x&xx&x&x#{xxx..}
> then,
> I declare a new device path like this:
> \??\USB#Vid_xx&Pid_xx#x&xx&x&x#{xxx..}#pipe0
> or like this:
> \??\USB#Vid_xx&Pid_xx#x&xx&x&x#{xxx..}#startsdfklasdfjjs
> after the declaring the new "devicename path", I use it
> as the parameter in CreateFile, I always get the
> VALID_HANDLE, I don't know why, does it mean that
> no matter what I declare, if the symbolicname is used,
> the CreateFile will always return VALID_HANDLE?
>
>
>
>
>
> "Owen Smith" <nospam.osmith@saitek.com.nospam> wrote in message
> news:op.tz2842cu39p9aw@oas-core2...
>> Yes, if you call CreateFile with the symboliclink, you can call ReadFile,
>> WriteFile and DeviceIoControl to communicate with the driver. Some
>> devices wont let you create them (Mice and Keyboards).
>>
>> Look at the SetupDi... functions to enumerate devices for your symbolic
>> link, because it will change with different ports and on different
>> systems
>>
>> On Sat, 13 Oct 2007 01:15:17 +0100, zonhai.won <zonhai.won@gmail.com>
>> wrote:
>>
>>> hi all,
>>> During the USB device design, a problem confused me.
>>> I want to get the handle of the USB device, and the symbolicname
>>> of this USB device in register, like following:
>>> \??\USB#Vid_xx&Pid_xx#x&xx&x&x#{xxx..}
>>> somebody told me, this symbolicname can be used in
>>> CreateFile to create the handle.
>>> After some tests (by change the symbolicname into the right
>>> form), I can use the "new" symbolicname in createfile, and
>>> the return handle is VALID_HANDLE.
>>> I want to know, is this symbolicname the right parameter
>>> in CreateFile?
>>> And the handle is which handle? Can this handle be used
>>> to communicate with the USB device? If it can, how?
>>>
>>>
>>>
>>
>>
>>
>> --
>> Using Opera's revolutionary e-mail client:
http://www.opera.com/mail/
>
>