

@flow.StateHandler(next_state='ProcessListDirectory')
def ListDeviceDirectories(self, responses):
    if (not responses.success):
        raise flow.FlowError('Unable to query Volume Shadow Copy information.')
    for response in responses:
        device_object = response.GetItem('DeviceObject', '')
        global_root = '\\\\?\\GLOBALROOT\\Device'
        if device_object.startswith(global_root):
            device_object = ('\\\\.' + device_object[len(global_root):])
            path_spec = rdf_paths.PathSpec(path=device_object, pathtype=rdf_paths.PathSpec.PathType.OS)
            path_spec.Append(path='/', pathtype=rdf_paths.PathSpec.PathType.TSK)
            response.Log('Listing Volume Shadow Copy device: %s.', device_object)
            self.CallClient('ListDirectory', pathspec=path_spec, next_state='ProcessListDirectory')
            self.state.raw_device = aff4.AFF4Object.VFSGRRClient.PathspecToURN(path_spec, self.client_id).Dirname()
            self.state.shadows.append(aff4.AFF4Object.VFSGRRClient.PathspecToURN(path_spec, self.client_id))

dataset/ETHPy150Open google/grr/grr/lib/flows/general/windows_vsc.py ListVolumeShadowCopies.ListDeviceDirectories/VarMisuse@128/201 `self`->`response`