Changeset 2196 for trunk/eraser/Eraser.Util/PhysicalDriveInfo.cs
- Timestamp:
- 6/19/2010 1:29:09 AM (2 years ago)
- File:
-
- 1 edited
-
trunk/eraser/Eraser.Util/PhysicalDriveInfo.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.Util/PhysicalDriveInfo.cs
r2191 r2196 149 149 150 150 /// <summary> 151 /// Destroys all partitioning information on the drive. 152 /// </summary> 153 public void DeleteDriveLayout() 154 { 155 //Open the drive for read/write access 156 using (SafeFileHandle handle = OpenHandle(FileAccess.ReadWrite, FileShare.ReadWrite, 157 FileOptions.None)) 158 { 159 //Issue the IOCTL_DISK_DELETE_DRIVE_LAYOUT control code 160 uint returnSize = 0; 161 if (!NativeMethods.DeviceIoControl(handle, 162 NativeMethods.IOCTL_DISK_DELETE_DRIVE_LAYOUT, IntPtr.Zero, 0, IntPtr.Zero, 163 0, out returnSize, IntPtr.Zero)) 164 { 165 throw Win32ErrorCode.GetExceptionForWin32Error(Marshal.GetLastWin32Error()); 166 } 167 } 168 } 169 170 /// <summary> 151 171 /// Opens a file with read, write, or read/write access. 152 172 /// </summary>
Note: See TracChangeset
for help on using the changeset viewer.
