Esempio n. 1
0
 public static extern bool DeviceIoControl(
     SafeFileHandle hDevice,
     EIOControlCode IoControlCode,
     IntPtr InBuffer,
     uint nInBufferSize,
     ref DISK_GEOMETRY OutBuffer,
     uint nOutBufferSize,
     out uint pBytesReturned,
     IntPtr Overlapped
     );
Esempio n. 2
0
		public static extern bool DeviceIoControl(
				SafeFileHandle hDevice,
				EIOControlCode IoControlCode,
				IntPtr InBuffer,
				uint nInBufferSize,
				ref DISK_GEOMETRY OutBuffer,
				uint nOutBufferSize,
				out uint pBytesReturned,
				IntPtr Overlapped
				);
Esempio n. 3
0
		public static ulong GetDiskSize(SafeFileHandle handle) {
			uint dummy;
			DISK_GEOMETRY diskGeo = new DISK_GEOMETRY();
			Win32.DeviceIoControl(handle, EIOControlCode.DiskGetDriveGeometry, IntPtr.Zero, 0,
								ref diskGeo, (uint)Marshal.SizeOf(typeof(DISK_GEOMETRY)), out dummy, IntPtr.Zero);
			return (ulong)((DISK_GEOMETRY)diskGeo).DiskSize;
		}