components/storage_monitor/portable_device_watcher_win.cc
// Returns true if |data| represents a class of portable devices.
Returns true if |data| represents a class of portable devices.
Returns true if |data| represents a class of portable devices .
bool IsPortableDeviceStructure(LPARAM data) {
  DEV_BROADCAST_HDR* broadcast_hdr =
      reinterpret_cast<DEV_BROADCAST_HDR*>(data);
  if (!broadcast_hdr ||
      (broadcast_hdr->dbch_devicetype != DBT_DEVTYP_DEVICEINTERFACE)) {
    return false;
  }
  GUID guidDevInterface = GUID_NULL;
  if (FAILED(CLSIDFromString(kWPDDevInterfaceGUID, &guidDevInterface)))
    return false;
  DEV_BROADCAST_DEVICEINTERFACE* dev_interface =
      reinterpret_cast<DEV_BROADCAST_DEVICEINTERFACE*>(data);
  return (IsEqualGUID(dev_interface->dbcc_classguid, guidDevInterface) != 0);
}
bool IsPortableDeviceStructure ( LPARAM data ) { DEV_BROADCAST_HDR * broadcast_hdr = reinterpret_cast < DEV_BROADCAST_HDR * > ( data ) ; if ( ! broadcast_hdr || ( broadcast_hdr -> dbch_devicetype != DBT_DEVTYP_DEVICEINTERFACE ) ) { return false ; } GUID guidDevInterface = GUID_NULL ; if ( FAILED ( CLSIDFromString ( kWPDDevInterfaceGUID , & guidDevInterface ) ) ) return false ; DEV_BROADCAST_DEVICEINTERFACE * dev_interface = reinterpret_cast < DEV_BROADCAST_DEVICEINTERFACE * > ( data ) ; return ( IsEqualGUID ( dev_interface -> dbcc_classguid , guidDevInterface ) != 0 ) ; }
Returns true if |data| represents a class of portable devices.
Returns true if |data| represents a class of portable devices .