Double-check that you aren't mixing ASCII and Unicode. It's an easymistake to make. I register the interface before the PcAddAdapterDevice
Oleg Vorobiov wrote:
I have made the required changes:
1. IoCreateDevice, IoRegisterDeviceInterface, and other related things
have been removed from the DriverEntry function.
2. In the AddDevice function (after the PcAddAdapterDevice function call)
I call IoRegisterDeviceInterface and IoSetDeviceInterfaceState, as
follows:
ntStatus =
IoRegisterDeviceInterface(PhysicalDeviceObject
, static_cast<LPCGUID>(&PID_MSVAD)
, &DeviceRef
, &DeviceName);
// Where DeviceRef is "CUSTOM_DEV", DeviceName is "\\Devices\\CUSTOM_DEV".
DeviceName is an output from this function. You just pass an empty
structure.
After that, I got a symbolic link using CM_Get_Device_Interface_List:
*\\?\ROOT#MEDIA#0000#{5b722bf8-f0ab-47ee-b9c8-8d61d31375a1}\CUSTOM_DEV*
Unfortunately, I couldn't open the file via the symbolic link mentioned
above (error description: "The system cannot find the file specified").
That is the correct approach, and that's approximately the right file
name. Double-check that you aren't mixing ASCII and Unicode. It's an easy
mistake to make. I register the interface before the PcAddAdapterDevice
call, but that shouldn't make a difference.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.