Example #1
0
 public static extern int DeviceIoControl(
     FileSafeHandle device,
     IoControlCode dwIoControlCode,
     IntPtr inBuffer,
     int inBufferSize,
     IntPtr outBuffer,
     uint outBufferSize,
     ref uint bytesReturned,
     IntPtr overlapped
     );
Example #2
0
 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
     );
Example #3
0
 public static extern Boolean DeviceIoControl(
     FileSafeHandle hDevice,
     IoControlCode dwIoControlCode,
     ref GrowPartition lpInBuffer,
     int nInBufferSize,
     IntPtr lpOutBuffer,
     Int32 nOutBufferSize,
     ref Int32 lpBytesReturned,
     IntPtr lpOverlapped
     );
Example #4
0
 public DriveLayout(string diskName)
 {
     ExecuteNativeActionAndCheckLastError(() =>
     {
         handle = NativeMethods.CreateFile(
             diskName,
             NativeMethods.AccessRights.GENERIC_READ,
             0, IntPtr.Zero,
             NativeMethods.FileCreationDisposition.OPEN_EXISTING,
             0, IntPtr.Zero
             );
     });
 }
Example #5
0
 public static extern Boolean ReadFile(FileSafeHandle hFile, Byte[] lpBuffer, UInt32 nNumberOfBytesToRead, ref UInt32 lpNumberOfBytesRead, ref NativeOverlapped lpOverlapped);
Example #6
0
 public static extern Boolean PeekNamedPipe(FileSafeHandle hNamedPipe, Byte[] lpBuffer, UInt32 nBufferSize, ref UInt32 lpBytesRead, ref UInt32 lpTotalBytesAvail, ref UInt32 lpBytesLeftThisMessage);
Example #7
0
 public static extern Boolean FlushFileBuffers(FileSafeHandle hNamedPipe);
Example #8
0
 public static extern Boolean DisconnectNamedPipe(FileSafeHandle hNamedPipe);
Example #9
0
 public static extern Boolean ConnectNamedPipe(FileSafeHandle hNamedPipe, IntPtr lpOverlapped);
Example #10
0
 public static extern Boolean ConnectNamedPipe(FileSafeHandle hNamedPipe, IntPtr lpOverlapped);
Example #11
0
 public static extern Boolean WriteFile(FileSafeHandle hFile, Byte[] lpBuffer, UInt32 nNumberOfBytesToWrite, ref UInt32 lpNumberOfBytesWritten, ref NativeOverlapped lpOverlapped);
Example #12
0
 public static extern Boolean ReadFile(FileSafeHandle hFile, Byte[] lpBuffer, UInt32 nNumberOfBytesToRead, ref UInt32 lpNumberOfBytesRead, ref NativeOverlapped lpOverlapped);
Example #13
0
 public static extern Boolean PeekNamedPipe(FileSafeHandle hNamedPipe, Byte[] lpBuffer, UInt32 nBufferSize, ref UInt32 lpBytesRead, ref UInt32 lpTotalBytesAvail, ref UInt32 lpBytesLeftThisMessage);
Example #14
0
 public static extern Boolean FlushFileBuffers(FileSafeHandle hNamedPipe);
Example #15
0
 public static extern Boolean DisconnectNamedPipe(FileSafeHandle hNamedPipe);
Example #16
0
 public static extern Boolean WriteFile(FileSafeHandle hFile, Byte[] lpBuffer, UInt32 nNumberOfBytesToWrite, ref UInt32 lpNumberOfBytesWritten, ref NativeOverlapped lpOverlapped);
Example #17
0
 public static extern bool WriteFile(FileSafeHandle hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, ref uint lpNumberOfBytesWritten, ref NativeOverlapped lpOverlapped);
Example #18
0
 public static extern bool WriteFile(FileSafeHandle hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, ref uint lpNumberOfBytesWritten, ref NativeOverlapped lpOverlapped);