chrome/browser/system_monitor/portable_device_watcher_win.cc
// Gets the description of the device specified by the |pnp_device_id|. On
// success, returns true and fills in |description|.
Gets the description of the device specified by the |pnp_device_id|. On
success, returns true and fills in |description|.
Gets the description of the device specified by the |pnp_device_id| . On success returns true and fills in |description| .
bool GetDeviceDescription(const string16& pnp_device_id,
                          IPortableDeviceManager* device_manager,
                          string16* description) {
  DCHECK(device_manager);
  DCHECK(description);
  DWORD desc_len = 0;
  HRESULT hr = device_manager->GetDeviceDescription(pnp_device_id.c_str(), NULL,
                                                    &desc_len);
  if (FAILED(hr))
    return false;
  hr = device_manager->GetDeviceDescription(pnp_device_id.c_str(),
                                            WriteInto(description, desc_len),
                                            &desc_len);
  return (SUCCEEDED(hr) && !description->empty());
}
bool GetDeviceDescription ( const string16 & pnp_device_id , IPortableDeviceManager * device_manager , string16 * description ) { DCHECK ( device_manager ) ; DCHECK ( description ) ; DWORD desc_len = 0 ; HRESULT hr = device_manager -> GetDeviceDescription ( pnp_device_id . c_str ( ) , NULL , & desc_len ) ; if ( FAILED ( hr ) ) return false ; hr = device_manager -> GetDeviceDescription ( pnp_device_id . c_str ( ) , WriteInto ( description , desc_len ) , & desc_len ) ; return ( SUCCEEDED ( hr ) && ! description -> empty ( ) ) ; }
Gets the description of the device specified by the |pnp_device_id|.
Gets the description of the device specified by the |pnp_device_id| .