Exemple #1
0
 /// <summary>
 /// Write blocks to the storage unit.
 /// </summary>
 public virtual void Write(
     Byte[] Buffer,
     UInt64 BlockAddress,
     UInt32 BlockCount,
     Boolean Flush,
     ref StorageUnitStatus Status)
 {
 }
Exemple #2
0
        private static Boolean Unmap(
            IntPtr StorageUnitPtr,
            IntPtr Descriptors, UInt32 Count,
            ref StorageUnitStatus Status)
        {
            StorageUnitBase StorageUnit = (StorageUnitBase)Api.GetUserContext(StorageUnitPtr);

            UnmapDescriptor[] DescriptorArray = Api.MakeUnmapDescriptorArray(Descriptors, Count);
            try
            {
                StorageUnit.Unmap(DescriptorArray, ref Status);
            }
            catch (Exception)
            {
            }
            return(true);
        }
Exemple #3
0
        private static Boolean Flush(
            IntPtr StorageUnitPtr,
            UInt64 BlockAddress, UInt32 BlockCount,
            ref StorageUnitStatus Status)
        {
            StorageUnitBase StorageUnit = (StorageUnitBase)Api.GetUserContext(StorageUnitPtr);

            try
            {
                StorageUnit.Flush(BlockAddress, BlockCount, ref Status);
            }
            catch (Exception)
            {
                Status.SetSense(
                    StorageUnitBase.SCSI_SENSE_MEDIUM_ERROR,
                    StorageUnitBase.SCSI_ADSENSE_WRITE_ERROR);
            }
            return(true);
        }
Exemple #4
0
        /* SPD_STORAGE_UNIT_INTERFACE */
        private static Boolean Read(
            IntPtr StorageUnitPtr,
            IntPtr Buffer, UInt64 BlockAddress, UInt32 BlockCount, Boolean Flush,
            ref StorageUnitStatus Status)
        {
            StorageUnitBase StorageUnit = (StorageUnitBase)Api.GetUserContext(StorageUnitPtr);

            try
            {
                StorageUnit.Read(_ThreadBuffer, BlockAddress, BlockCount, Flush, ref Status);
            }
            catch (Exception)
            {
                Status.SetSense(
                    StorageUnitBase.SCSI_SENSE_MEDIUM_ERROR,
                    StorageUnitBase.SCSI_ADSENSE_UNRECOVERED_ERROR);
            }
            return(true);
        }
Exemple #5
0
 /// <summary>
 /// Flush cached blocks to the storage unit.
 /// </summary>
 public virtual void Flush(
     UInt64 BlockAddress,
     UInt32 BlockCount,
     ref StorageUnitStatus Status)
 {
 }
Exemple #6
0
 /// <summary>
 /// Unmap blocks from the storage unit.
 /// </summary>
 public virtual void Unmap(
     UnmapDescriptor[] Descriptors,
     ref StorageUnitStatus Status)
 {
 }