chrome/browser/system_monitor/portable_device_watcher_win.cc
// On success, returns true and updates |client_info| with a reference to an
// IPortableDeviceValues interface that holds information about the
// application that communicates with the device.
On success, returns true and updates |client_info| with a reference to an
IPortableDeviceValues interface that holds information about the
application that communicates with the device.
On success returns true and updates |client_info| with a reference to an IPortableDeviceValues interface that holds information about the application that communicates with the device .
bool GetClientInformation(
    base::win::ScopedComPtr<IPortableDeviceValues>* client_info) {
  HRESULT hr = client_info->CreateInstance(__uuidof(PortableDeviceValues),
                                           NULL, CLSCTX_INPROC_SERVER);
  if (FAILED(hr)) {
    DPLOG(ERROR) << "Failed to create an instance of IPortableDeviceValues";
    return false;
  }
  (*client_info)->SetStringValue(WPD_CLIENT_NAME, kClientName);
  (*client_info)->SetUnsignedIntegerValue(WPD_CLIENT_MAJOR_VERSION, 0);
  (*client_info)->SetUnsignedIntegerValue(WPD_CLIENT_MINOR_VERSION, 0);
  (*client_info)->SetUnsignedIntegerValue(WPD_CLIENT_REVISION, 0);
  (*client_info)->SetUnsignedIntegerValue(
      WPD_CLIENT_SECURITY_QUALITY_OF_SERVICE, SECURITY_IMPERSONATION);
  (*client_info)->SetUnsignedIntegerValue(WPD_CLIENT_DESIRED_ACCESS,
                                          GENERIC_READ);
  return true;
}
bool GetClientInformation ( base :: win :: ScopedComPtr < IPortableDeviceValues > * client_info ) { HRESULT hr = client_info -> CreateInstance ( __uuidof ( PortableDeviceValues ) , NULL , CLSCTX_INPROC_SERVER ) ; if ( FAILED ( hr ) ) { DPLOG ( ERROR ) << " " ; return false ; } ( * client_info ) -> SetStringValue ( WPD_CLIENT_NAME , kClientName ) ; ( * client_info ) -> SetUnsignedIntegerValue ( WPD_CLIENT_MAJOR_VERSION , 0 ) ; ( * client_info ) -> SetUnsignedIntegerValue ( WPD_CLIENT_MINOR_VERSION , 0 ) ; ( * client_info ) -> SetUnsignedIntegerValue ( WPD_CLIENT_REVISION , 0 ) ; ( * client_info ) -> SetUnsignedIntegerValue ( WPD_CLIENT_SECURITY_QUALITY_OF_SERVICE , SECURITY_IMPERSONATION ) ; ( * client_info ) -> SetUnsignedIntegerValue ( WPD_CLIENT_DESIRED_ACCESS , GENERIC_READ ) ; return true ; }
On success, returns true and updates |client_info| with a reference to an
IPortableDeviceValues interface that holds information about the
application that communicates with the device.
On success returns true and updates |client_info| with a reference to an IPortableDeviceValues interface that holds information about the application that communicates with the device .
// Attempt to set client details.