@@ -3049,6 +3049,55 @@ BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
30493049 return TRUE;
30503050}
30513051
3052+ /***********************************************************************
3053+ * SetupDiGetDeviceInterfacePropertyW (SETUPAPI.@)
3054+ */
3055+ BOOL WINAPI SetupDiGetDeviceInterfacePropertyW (HDEVINFO devinfo , SP_DEVICE_INTERFACE_DATA * iface_data ,
3056+ const DEVPROPKEY * prop_key , DEVPROPTYPE * prop_type , BYTE * prop_buff ,
3057+ DWORD prop_buff_size , DWORD * required_size , DWORD flags ) {
3058+
3059+ // TODO: should probably use DEVPKEY_Device_InstanceId
3060+ static const DEVPROPKEY device_instanceid_key = {
3061+ {0x78c34fc8 , 0x104a , 0x4aca , {0x9e , 0xa4 , 0x52 , 0x4d , 0x52 , 0x99 , 0x6e , 0x57 }}, 256
3062+ };
3063+
3064+ TRACE ("%p, %p, (%s, %04lx), %p, %p, %ld, %p, %#lx\n" , devinfo , iface_data , wine_dbgstr_guid (& prop_key -> fmtid ), prop_key -> pid , prop_type , prop_buff , prop_buff_size ,
3065+ required_size , flags );
3066+
3067+ // Special case for InstanceID
3068+ if (IsEqualDevPropKey (* prop_key , device_instanceid_key )) {
3069+ struct device * device ;
3070+ struct device_iface * iface ;
3071+
3072+ if (!(iface = get_device_iface (devinfo , iface_data )))
3073+ return FALSE;
3074+
3075+ if (!(device = iface -> device ))
3076+ return FALSE;
3077+
3078+ TRACE ("instance ID: %s\n" , debugstr_w (device -> instanceId ));
3079+ if (prop_buff_size < lstrlenW (device -> instanceId ) + 1 )
3080+ {
3081+ SetLastError (ERROR_INSUFFICIENT_BUFFER );
3082+ if (required_size )
3083+ * required_size = lstrlenW (device -> instanceId ) + 1 ;
3084+ return FALSE;
3085+ }
3086+
3087+ lstrcpyW ((WCHAR * ) prop_buff , device -> instanceId );
3088+ if (required_size )
3089+ * required_size = lstrlenW (device -> instanceId ) + 1 ;
3090+ * prop_type = DEVPROP_TYPE_STRING ;
3091+
3092+ return TRUE;
3093+ } else {
3094+ // TODO: maybe fall back as SetupDiGetDevicePropertyW?
3095+ FIXME ("stub\n" );
3096+ }
3097+
3098+ return FALSE;
3099+ }
3100+
30523101/***********************************************************************
30533102 * SetupDiGetDeviceInterfaceDetailA (SETUPAPI.@)
30543103 */
0 commit comments