How to find the symbolic link?

Hello,

I am writing a class co-installer which exports only one function with the following prototype:
DWORD CALLBACK
CoInstaller (
__in DI_FUNCTION InstallFunction,
__in HDEVINFO DeviceInfoSet,
__in PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
__inout PCOINSTALLER_CONTEXT_DATA Context
)

When a device from the same class is being installed this function will be called with different values of the InstallFunction parameter. I need to know the vendor and the symbolic link name of the device that is being installed.

How can I find this information?

Thanks a lot.

On Fri, Jul 10, 2009 at 07:45:45PM -0400, xxxxx@yahoo.com wrote:

Hello,

I am writing a class co-installer which exports only one function with
the following prototype:
DWORD CALLBACK
CoInstaller (
__in DI_FUNCTION InstallFunction,
__in HDEVINFO DeviceInfoSet,
__in PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
__inout PCOINSTALLER_CONTEXT_DATA Context
)

When a device from the same class is being installed this function
will be called with different values of the InstallFunction parameter. I
need to know the vendor and the symbolic link name of the device that
is being installed.

How can I find this information?

The symbolic link will not exist until the driver actually runs, so of
course you can't find that at installation time.

The PSP_DEVINFO_DATA should contain the plug-and-play ID for the device
being installed. That should contain enough information for you to
device whether it's a device you want or not.

Tim Roberts, xxxxx@probo.com
Providenza & Boeklheide, Inc.

Thanks for your reply,

My device is an USB printer. When it is installed it adds itself under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBPRINT

Even when the driver is installed and running I do not see the symbolic link name added to that location. I’ve seen a record of the symbolic link name under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses{28d78fad-5a12-11D1-ae5b-0000f803a8c2}

I could enumerate everything that is under …DeviceClasses{28d78fad-5a12-11D1-ae5b-0000f803a8c2} and get the PSP_DEVICE_INTERFACE_DETAIL_DATA::DevicePath but then how to know which record is the one for my printer?

Thanks

xxxxx@yahoo.com wrote:

My device is an USB printer. When it is installed it adds itself under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBPRINT

Even when the driver is installed and running I do not see the symbolic link name added to that location.

Nope. Symbolic links aren’t stored there.

I’ve seen a record of the symbolic link name under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses{28d78fad-5a12-11D1-ae5b-0000f803a8c2}

I could enumerate everything that is under …DeviceClasses{28d78fad-5a12-11D1-ae5b-0000f803a8c2} and get the PSP_DEVICE_INTERFACE_DETAIL_DATA::DevicePath but then how to know which record is the one for my printer?

Have you looked at the information in the detail data? As soon as you
find the plug-and-play ID, you should be able to pick out your device’s
information. The subkeys of the DeviceClasses keys are named using the
PnP ID, which includes the USB VID and PID. That’s pretty specific.

If you only want your co-installer to run for your printer, then why on
earth did you write a class co-installer, instead of just a device
co-installer?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.