Device name for CreateFile()

Hi!
In order to use DeviceIoControl we should call CreateFile with the name of
device as the first parameter. Is there any standard way or any API to get
the device name or should I somehow to extract it from the registry? Is the
registry the only place where the device name can be found?

thx
RG


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

For NT4.0, you can use like \\.\physicaldriver0, to open the harddisk.
\\.\cd-rom to open the CD. So on…

In Win2K, seems you need use SetupDixxx functions. Don’t know the details,
but you can look for SetupDixxx in MSDN.

Please refer:
HOWTO: Enumerate Hardware Devices by Using SetupDi Calls
http://support.microsoft.com/support/kb/articles/Q259/6/95.ASP

Jian

----- Original Message -----
From: “Roman Geller”
To: “NT Developers Interest List”
Sent: Thursday, June 21, 2001 9:39 AM
Subject: [ntdev] Device name for CreateFile()

> Hi!
> In order to use DeviceIoControl we should call CreateFile with the name of
> device as the first parameter. Is there any standard way or any API to get
> the device name or should I somehow to extract it from the registry? Is
the
> registry the only place where the device name can be found?
>
> thx
> RG
>
> —
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Jian,
I need to get the device name for a net card. On Win2000 SetupDixx helps
here as I can get the device name due to the discription attribute of the
device using SetupDiEnumDeviceInfo. But what shall we do on NT4.0? Any
ideas?

thx
RG

-----Original Message-----
From: Jian [mailto:xxxxx@yahoo.com]
Sent: Thursday, June 21, 2001 6:06 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Device name for CreateFile()

For NT4.0, you can use like \\.\physicaldriver0, to open the harddisk.
\\.\cd-rom to open the CD. So on…

In Win2K, seems you need use SetupDixxx functions. Don’t know the details,
but you can look for SetupDixxx in MSDN.

Please refer:
HOWTO: Enumerate Hardware Devices by Using SetupDi Calls
http://support.microsoft.com/support/kb/articles/Q259/6/95.ASP

Jian

----- Original Message -----
From: “Roman Geller”
To: “NT Developers Interest List”
Sent: Thursday, June 21, 2001 9:39 AM
Subject: [ntdev] Device name for CreateFile()

> Hi!
> In order to use DeviceIoControl we should call CreateFile with the name of
> device as the first parameter. Is there any standard way or any API to get
> the device name or should I somehow to extract it from the registry? Is
the
> registry the only place where the device name can be found?
>
> thx
> RG
>
> —
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


You are currently subscribed to ntdev as: xxxxx@envara.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

In WinNT 4.0, the device name is make by CreateDeviceSymbolicName() in
driver code.

If you can see the source code…

And, I find that there is a devcie named \\.\ndis, maybe you can try
this.

BTW, you can use winobj.exe to see all the name of devices under
subdirecotor named “DosDevice” or “??” in win2K.

Jian

----- Original Message -----
From: “Roman Geller”
To: “NT Developers Interest List”
Sent: Thursday, June 21, 2001 10:26 AM
Subject: [ntdev] Re: Device name for CreateFile()

> Jian,
> I need to get the device name for a net card. On Win2000 SetupDixx helps
> here as I can get the device name due to the discription attribute of the
> device using SetupDiEnumDeviceInfo. But what shall we do on NT4.0? Any
> ideas?
>
> thx
> RG
>
> -----Original Message-----
> From: Jian [mailto:xxxxx@yahoo.com]
> Sent: Thursday, June 21, 2001 6:06 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Device name for CreateFile()
>
>
> For NT4.0, you can use like \\.\physicaldriver0, to open the harddisk.
> \\.\cd-rom to open the CD. So on…
>
> In Win2K, seems you need use SetupDixxx functions. Don’t know the details,
> but you can look for SetupDixxx in MSDN.
>
> Please refer:
> HOWTO: Enumerate Hardware Devices by Using SetupDi Calls
> http://support.microsoft.com/support/kb/articles/Q259/6/95.ASP
>
>
> Jian
>
>
>
> ----- Original Message -----
> From: “Roman Geller”
> To: “NT Developers Interest List”
> Sent: Thursday, June 21, 2001 9:39 AM
> Subject: [ntdev] Device name for CreateFile()
>
>
> > Hi!
> > In order to use DeviceIoControl we should call CreateFile with the name
of
> > device as the first parameter. Is there any standard way or any API to
get
> > the device name or should I somehow to extract it from the registry? Is
> the
> > registry the only place where the device name can be found?
> >
> > thx
> > RG
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@yahoo.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>
>
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@envara.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com



Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You talk to the driver writer and ask him, or her, what they passed to
IoCreateSymbolicLink, or what the interface GUID is that they registered.
Given that, the documentation should tell you what to pass to CreateFile. I
know the documentation that I provide for my drivers does.

Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@Broadstor.com
xxxxx@inland.net

-----Original Message-----
From: Roman Geller [mailto:xxxxx@envara.com]
Sent: Thursday, June 21, 2001 9:40 AM
To: NT Developers Interest List
Subject: [ntdev] Device name for CreateFile()

Hi!
In order to use DeviceIoControl we should call CreateFile with the name of
device as the first parameter. Is there any standard way or any API to get
the device name or should I somehow to extract it from the registry? Is the
registry the only place where the device name can be found?

thx
RG


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Drivers make their devices available to user app in one of the following
ways (or both):

  1. create a symbolic link to the device using
    IoCreateSymbolicLink() usually in the DriverEntry, where the win32
    device name is linked to the internal NT name. For example, the serial
    port COM1 is accessed as \.\COM1 and represented as ??\COM1 in the
    Object Manager (winobj.exe) and has an internal name of \Device\Serial0.
    Usually this approach is used by legacy drivers. The user must use the
    Win32 name given by the driver writer to access the device. (please look
    at the samples in NT4 DDK e.g. portio).

  2. PnP drivers call IoRegisterDeviceInterface to setup a symbolic
    link. Pass the returned symbolic link to IoSetDeviceInterfaceState() in
    the start_device when enabling this interface. To access the device, use
    the SetupDixxx apis to get the device interface path that can be passed
    to CreateFile. (see the DDK\src\general\toaster\exe\toast.c sample)

Khalid

-----Original Message-----
From: Gary Little [mailto:xxxxx@Broadstor.com]
Sent: Thursday, June 21, 2001 8:48 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Device name for CreateFile()

You talk to the driver writer and ask him, or her, what they passed to
IoCreateSymbolicLink, or what the interface GUID is that they
registered. Given that, the documentation should tell you what to pass
to CreateFile. I know the documentation that I provide for my drivers
does.
Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@Broadstor.com
xxxxx@inland.net

-----Original Message-----
From: Roman Geller [mailto:xxxxx@envara.com]
Sent: Thursday, June 21, 2001 9:40 AM
To: NT Developers Interest List
Subject: [ntdev] Device name for CreateFile()

Hi!
In order to use DeviceIoControl we should call CreateFile with the name
of
device as the first parameter. Is there any standard way or any API to
get
the device name or should I somehow to extract it from the registry? Is
the
registry the only place where the device name can be found?
thx
RG

You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> In order to use DeviceIoControl we should call CreateFile with the name of

device as the first parameter. Is there any standard way or any API to get
the device name or should I somehow to extract it from the registry? Is
the

PnP APIs will return you the device name from the device class GUID and an
ordinal number.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com