Exemplo n.º 1
0
 public DiskExGet(SafeFileHandle diskHandle)
 {
     dge  = null;
     pie  = null;
     dlie = null;
     da   = null;
     sddp = null;
     try
     {
         DiskDeviceWrapper diskDeviceWrapper = new DiskDeviceWrapper(diskHandle, false);
         try
         {
             dge = diskDeviceWrapper.DiskGetDriveGeometryEx();
         }
         catch (Exception e)
         {
             Log.Warn(e);
         }
         try
         {
             pie = diskDeviceWrapper.DiskGetPartitionInfoEx();
         }
         catch (Exception e)
         {
             Log.Warn(e);
         }
         try
         {
             dlie = diskDeviceWrapper.DiskGetDriveLayoutEx();
         }
         catch (Exception e)
         {
             Log.Warn(e);
         }
         try
         {
             vip = diskDeviceWrapper.DiskGetSmartVersion();     // <- PCIE SSD's and Raid controllers can have this disabled thus throwing an exception
         }
         catch (Exception e)
         {
             Log.Warn(e);
         }
         try
         {
             //DISK_CACHE_INFORMATION dci = diskDeviceWrapper.DiskGetCacheInformation();
         }
         catch (Exception e)
         {
             Log.Warn(e);
         }
         try
         {
             da = diskDeviceWrapper.DiskGetDiskAttributes();
         }
         catch (Exception e)
         {
             Log.Warn(e);
         }
         try
         {
             // Some drives do not return data.
             StorageDeviceWrapperEx sdw = new StorageDeviceWrapperEx(diskHandle, false);
             sddp = sdw.StorageGetDeviceProperty();
         }
         catch (Exception e)
         {
             Log.Warn(e);
         }
         //MountManagerWrapper mmw = new MountManagerWrapper(disk.DiskHandle, false);
         //List<MountPoint> mps = mmw.MountQueryPoints();
     }
     catch (Exception e)
     {
         Log.Warn(e);
     }
 }