CancelIoEx() приватный Метод

private CancelIoEx ( IntPtr hFile, IntPtr lpOverlapped ) : bool
hFile System.IntPtr
lpOverlapped System.IntPtr
Результат bool
Пример #1
0
 public void CancelIO()
 {
     if (IsOpen)
     {
         NativeMethods.CancelIoEx(safeReadHandle.DangerousGetHandle(), IntPtr.Zero);
     }
 }
Пример #2
0
 private static void CloseDeviceIO(IntPtr handle)
 {
     if (Environment.OSVersion.Version.Major > 5)
     {
         NativeMethods.CancelIoEx(handle, IntPtr.Zero);
     }
     NativeMethods.CloseHandle(handle);
 }
Пример #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());
     }
 }
Пример #4
0
 private static void CloseDeviceIO(IntPtr handle)
 {
     NativeMethods.CancelIoEx(handle, IntPtr.Zero);
     NativeMethods.CloseHandle(handle);
 }