Пример #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)
 {
 }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #5
0
 /// <summary>
 /// Flush cached blocks to the storage unit.
 /// </summary>
 public virtual void Flush(
     UInt64 BlockAddress,
     UInt32 BlockCount,
     ref StorageUnitStatus Status)
 {
 }
Пример #6
0
 /// <summary>
 /// Unmap blocks from the storage unit.
 /// </summary>
 public virtual void Unmap(
     UnmapDescriptor[] Descriptors,
     ref StorageUnitStatus Status)
 {
 }