public static extern int DeviceIoControl( FileSafeHandle device, IoControlCode dwIoControlCode, IntPtr inBuffer, int inBufferSize, IntPtr outBuffer, uint outBufferSize, ref uint bytesReturned, IntPtr overlapped );
public static extern Boolean DeviceIoControl( FileSafeHandle hDevice, IoControlCode dwIoControlCode, ref DRIVE_LAYOUT_INFORMATION_EX lpInBuffer, int nInBufferSize, IntPtr lpOutBuffer, Int32 nOutBufferSize, ref Int32 lpBytesReturned, IntPtr lpOverlapped );
public static extern Boolean DeviceIoControl( FileSafeHandle hDevice, IoControlCode dwIoControlCode, ref GrowPartition lpInBuffer, int nInBufferSize, IntPtr lpOutBuffer, Int32 nOutBufferSize, ref Int32 lpBytesReturned, IntPtr lpOverlapped );
public DriveLayout(string diskName) { ExecuteNativeActionAndCheckLastError(() => { handle = NativeMethods.CreateFile( diskName, NativeMethods.AccessRights.GENERIC_READ, 0, IntPtr.Zero, NativeMethods.FileCreationDisposition.OPEN_EXISTING, 0, IntPtr.Zero ); }); }
public static extern Boolean ReadFile(FileSafeHandle hFile, Byte[] lpBuffer, UInt32 nNumberOfBytesToRead, ref UInt32 lpNumberOfBytesRead, ref NativeOverlapped lpOverlapped);
public static extern Boolean PeekNamedPipe(FileSafeHandle hNamedPipe, Byte[] lpBuffer, UInt32 nBufferSize, ref UInt32 lpBytesRead, ref UInt32 lpTotalBytesAvail, ref UInt32 lpBytesLeftThisMessage);
public static extern Boolean FlushFileBuffers(FileSafeHandle hNamedPipe);
public static extern Boolean DisconnectNamedPipe(FileSafeHandle hNamedPipe);
public static extern Boolean ConnectNamedPipe(FileSafeHandle hNamedPipe, IntPtr lpOverlapped);
public static extern Boolean WriteFile(FileSafeHandle hFile, Byte[] lpBuffer, UInt32 nNumberOfBytesToWrite, ref UInt32 lpNumberOfBytesWritten, ref NativeOverlapped lpOverlapped);
public static extern bool WriteFile(FileSafeHandle hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, ref uint lpNumberOfBytesWritten, ref NativeOverlapped lpOverlapped);