CancelIoEx() private méthode

private CancelIoEx ( IntPtr hFile, IntPtr lpOverlapped ) : bool
hFile System.IntPtr
lpOverlapped System.IntPtr
Résultat bool
Exemple #1
0
 public void CancelIO()
 {
     if (IsOpen)
     {
         NativeMethods.CancelIoEx(safeReadHandle.DangerousGetHandle(), IntPtr.Zero);
     }
 }
Exemple #2
0
 private static void CloseDeviceIO(IntPtr handle)
 {
     if (Environment.OSVersion.Version.Major > 5)
     {
         NativeMethods.CancelIoEx(handle, IntPtr.Zero);
     }
     NativeMethods.CloseHandle(handle);
 }
Exemple #3
0
 private void DeviceEventMonitorRemoved()
 {
     if (IsOpen)
     {
         lock (this)
         {
             idleTicks = 100;
         }
         MonitorDeviceEvents = false;
         Console.WriteLine("Cancelling IO");
         NativeMethods.CancelIoEx(safeReadHandle.DangerousGetHandle(), IntPtr.Zero);
         Console.WriteLine("Cancelled IO");
         CloseDevice();
         Console.WriteLine("Device is closed.");
     }
     if (Removed != null)
     {
         Removed();
     }
     if (Remove != null)
     {
         Remove(this, new EventArgs());
     }
 }
Exemple #4
0
 private static void CloseDeviceIO(IntPtr handle)
 {
     NativeMethods.CancelIoEx(handle, IntPtr.Zero);
     NativeMethods.CloseHandle(handle);
 }