How can I Get Value of SPDRP_LEGACYBUSTYPE ?
-
Hello Friends I am using SetupDigetRegistryProperty to access USB Devices. So,regarding that I was trying to access Property SPDRP_LEGACYBUSTYPE which is described like this
Quote:
SPDRP_LEGACYBUSTYPE The function retrieves the device's legacy bus type as an INTERFACE_TYPE value (defined in Wdm.h and Ntddk.h).
I tried to get this value in char ,it returns some special character. I tried to catch in DWORD,it returns some number.
DWORD DataT; LPTSTR buffer = NULL; DWORD buffersize = 0;
SetupDiGetDeviceRegistryProperty(
hDevInfoSet,
&DeviceInfoData,
SPDRP_LEGACYBUSTYPE,
&DataT,
(PBYTE)buffer,
buffersize,
&buffersize)Any Ideas? Regards Y
-
Hello Friends I am using SetupDigetRegistryProperty to access USB Devices. So,regarding that I was trying to access Property SPDRP_LEGACYBUSTYPE which is described like this
Quote:
SPDRP_LEGACYBUSTYPE The function retrieves the device's legacy bus type as an INTERFACE_TYPE value (defined in Wdm.h and Ntddk.h).
I tried to get this value in char ,it returns some special character. I tried to catch in DWORD,it returns some number.
DWORD DataT; LPTSTR buffer = NULL; DWORD buffersize = 0;
SetupDiGetDeviceRegistryProperty(
hDevInfoSet,
&DeviceInfoData,
SPDRP_LEGACYBUSTYPE,
&DataT,
(PBYTE)buffer,
buffersize,
&buffersize)Any Ideas? Regards Y
See DEVPKEY_Device_LegacyBusType[^] and INTERFACE_TYPE[^]. The property is of type DEVPROP_TYPE_INT32[^] requiring a buffer size of at least
sizeof(LONG)
. -
See DEVPKEY_Device_LegacyBusType[^] and INTERFACE_TYPE[^]. The property is of type DEVPROP_TYPE_INT32[^] requiring a buffer size of at least
sizeof(LONG)
.Thanks jochen for your Reply. I tried ur way but it is not the value that I was looking For. May be you can give more Ideas. here is what I want. When I right Click on USB Device from Device manager,it open up properties Dialog where we can select property and its value. Here, I found one property "bus relation" which I am trying to get using SetupDi calls. Bus relation value is showing like this : USBPRINT\CANONIP4200\6&19ACF&0&USB001 This is the device Instance Id. But when I tried to get same using SetDiGetDeviceInstanceId,it gives me like USB\VID_04A9&PID_10A2\C34BBD How can I get USBPRINT\CANONIP4200\6&19ACF&0&USB001 ? Regards Y
-
See DEVPKEY_Device_LegacyBusType[^] and INTERFACE_TYPE[^]. The property is of type DEVPROP_TYPE_INT32[^] requiring a buffer size of at least
sizeof(LONG)
.Thanks jochen for your Reply. I tried ur way but it is not the value that I was looking For. May be you can give more Ideas. here is what I want. When I right Click on USB Device from Device manager,it open up properties Dialog where we can select property and its value. Here, I found one property "bus relation" Bus relation value is showing like this : USBPRINT\CANONIP4200\6&19ACF&0&USB001 This is the device Instance Id. But when I tried to get same using SetDiGetDeviceInstanceId,it gives me like USB\VID_04A9&PID_10A2\C34BBD How can I get USBPRINT\CANONIP4200\6&19ACF&0&USB001 ? Regards Y
-
Thanks jochen for your Reply. I tried ur way but it is not the value that I was looking For. May be you can give more Ideas. here is what I want. When I right Click on USB Device from Device manager,it open up properties Dialog where we can select property and its value. Here, I found one property "bus relation" which I am trying to get using SetupDi calls. Bus relation value is showing like this : USBPRINT\CANONIP4200\6&19ACF&0&USB001 This is the device Instance Id. But when I tried to get same using SetDiGetDeviceInstanceId,it gives me like USB\VID_04A9&PID_10A2\C34BBD How can I get USBPRINT\CANONIP4200\6&19ACF&0&USB001 ? Regards Y
At first you may read Retrieving Device Relations[^] for some background on device relations. Some googling found this site http://www.techtalkz.com/microsoft-device-drivers/262178-getting-bus-relations-device.html[^] which may help you.
-
At first you may read Retrieving Device Relations[^] for some background on device relations. Some googling found this site http://www.techtalkz.com/microsoft-device-drivers/262178-getting-bus-relations-device.html[^] which may help you.
-
Thanks A Lot jochen I followed your post and get succeed in getting Bus Relation value[Device Id] which gives me Printer name. Thank you Very Much Again. Regards Y
Nice to hear that you solved the problem and thank you for the feedback.