chrome/browser/system_monitor/portable_device_watcher_win.cc
// Wrapper function to get an instance of portable device manager. On success,
// returns true and fills in |portable_device_mgr|. On failure, returns false.
Wrapper function to get an instance of portable device manager. On success,
returns true and fills in |portable_device_mgr|. On failure, returns false.
Wrapper function to get an instance of portable device manager . On success returns true and fills in |portable_device_mgr| . On failure returns false .
bool GetPortableDeviceManager(
  base::win::ScopedComPtr<IPortableDeviceManager>* portable_device_mgr) {
  DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
  HRESULT hr = portable_device_mgr->CreateInstance(
      __uuidof(PortableDeviceManager), NULL, CLSCTX_INPROC_SERVER);
  if (SUCCEEDED(hr))
    return true;
  DCHECK_NE(CO_E_NOTINITIALIZED, hr);
  return false;
}
bool GetPortableDeviceManager ( base :: win :: ScopedComPtr < IPortableDeviceManager > * portable_device_mgr ) { DCHECK ( content :: BrowserThread :: GetBlockingPool ( ) -> RunsTasksOnCurrentThread ( ) ) ; HRESULT hr = portable_device_mgr -> CreateInstance ( __uuidof ( PortableDeviceManager ) , NULL , CLSCTX_INPROC_SERVER ) ; if ( SUCCEEDED ( hr ) ) return true ; DCHECK_NE ( CO_E_NOTINITIALIZED , hr ) ; return false ; }
Wrapper function to get an instance of portable device manager.
Wrapper function to get an instance of portable device manager .
// Either there is no portable device support (Windows XP with old versions of // Media Player) or the thread does not have COM initialized.