sybolic link name problem

Hello ,
I’m developing a Windows 2000 pnp function driver . In the AddDevice routine
I use IoRegisterDeviceInterface() API which returns the symbolic link name
for my driver. Thus I get the symbolic name in the driver. But the problem
is that how to inform this name to my application .
I want to get the handle of the driver from my application to call IOCTL
functions. I use CreateFile() call which needs Symbolic name for the driver.
How should I get the symbolic name ?
Initially I hardcoded the symbolic name. However as I change the PCI slot of
the card for which I’m writing the driver, the symbolic name changes. So
there should be some appropriate way to get the symbolic name.
Your suggestions will be helpful,
Thanks in advance,
Aparna

Use SetupDiGetDeviceInterfaceDetail() to get the symbolic name of ur device,
from the guid.
Look at the other arguments to this function in DDK.
HTH,
Sajeev.

-----Original Message-----
From: Aparna Argade [SMTP:xxxxx@nital.stpp.soft.net]
Sent: Wednesday, March 15, 2000 4:21 PM
To: NT Developers Interest List
Subject: [ntdev] sybolic link name problem

Hello ,
I’m developing a Windows 2000 pnp function driver . In the AddDevice
routine
I use IoRegisterDeviceInterface() API which returns the symbolic link name
for my driver. Thus I get the symbolic name in the driver. But the
problem
is that how to inform this name to my application .
I want to get the handle of the driver from my application to call IOCTL
functions. I use CreateFile() call which needs Symbolic name for the
driver.
How should I get the symbolic name ?
Initially I hardcoded the symbolic name. However as I change the PCI slot
of
the card for which I’m writing the driver, the symbolic name changes. So
there should be some appropriate way to get the symbolic name.
Your suggestions will be helpful,
Thanks in advance,
Aparna


You are currently subscribed to ntdev as: xxxxx@amiindia.co.in
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Aparna,

As the saying goes: RTFM

"Device Interfaces

Device drivers provide a uniform and extensible way for applications and the
system to interact with them programmatically, known as a device interface.
Drivers expose, register, and enable device interfaces. A driver can expose
zero, one, or more than one interface for a particular device. A device
interface is represented by a GUID.

Each device interface is a member of a device interface class. A device
interface class is a group of device interfaces with the same functionality.
For example, all the joysticks on a system could be members of the joystick
device interface class. A device interface class is identified by a class
GUID.

When an application must communicate with a device, it searches for a device
that exports the required interface. To perform the search, use the
following steps.

Call the SetupDiGetClassDevs or SetupDiGetClassDevsEx function to obtain a
list of all devices in a specified device class. This list is known as a
device information set.
Call the SetupDiEnumDeviceInterfaces function to enumerate all devices of
the specified class that export the interface.
To communicate with the device, call the SetupDiGetDeviceInterfaceDetail
function. This function returns device information in an
SP_DEVICE_INTERFACE_DETAIL_DATA structure. The DevicePath member provides
the symbolic link name, which can be used in the CreateFile function to
access the device.

Built on Wednesday, November 10, 1999"

The Platform SDK.

It would of course be much easier to name your own symbolic link and open
that name in your application. But I suppose that somehow this would be
WRONG. If you aren’t at the top of a stack it would in fact be mildly
inappropriate.

=
Mark Roddy

Windows 2000/Windows NT Consulting:

xxxxx@hollistech.com
www.hollistech.com

=

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Aparna Argade
Sent: Wednesday, March 15, 2000 5:51 AM
To: NT Developers Interest List
Subject: [ntdev] sybolic link name problem

Hello ,
I’m developing a Windows 2000 pnp function driver . In the
AddDevice routine
I use IoRegisterDeviceInterface() API which returns the symbolic link name
for my driver. Thus I get the symbolic name in the driver. But
the problem
is that how to inform this name to my application .
I want to get the handle of the driver from my application to call IOCTL
functions. I use CreateFile() call which needs Symbolic name for
the driver.
How should I get the symbolic name ?
Initially I hardcoded the symbolic name. However as I change the
PCI slot of
the card for which I’m writing the driver, the symbolic name changes. So
there should be some appropriate way to get the symbolic name.
Your suggestions will be helpful,
Thanks in advance,
Aparna


You are currently subscribed to ntdev as: xxxxx@wattanuck.mv.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

> functions. I use CreateFile() call which needs Symbolic name for the
driver.

How should I get the symbolic name ?

AFAIK PnP sends a Windows message when the device interface arrives or
removes.

Max