From 76429f97980e900fb423891115498a0c3353187d Mon Sep 17 00:00:00 2001 From: David Hall Date: Mon, 17 Jun 2024 12:19:19 -0400 Subject: [PATCH] Added implicit conversion from IntPtr to BOOL --- Core/InteropServices/BOOL.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/InteropServices/BOOL.cs b/Core/InteropServices/BOOL.cs index 1576e8c6..c1bae4ef 100644 --- a/Core/InteropServices/BOOL.cs +++ b/Core/InteropServices/BOOL.cs @@ -61,6 +61,11 @@ public struct BOOL : IComparable, IComparable, IComparable, IConvert /// The result of the conversion. public static implicit operator IntPtr(BOOL value) => (IntPtr)(int)value; + /// Performs an explicit conversion from to . + /// The value. + /// The result of the conversion. + public static implicit operator BOOL(IntPtr value) => value != IntPtr.Zero; + /// Indicates whether two instances are not equal. /// The first integral size to compare. /// The second integral size to compare.