public static void CloseHandle(IntPtr handle) { if (!Direct.CloseHandle(handle)) { throw ErrorHelper.GetIoExceptionForLastError(); } }