diff --git a/Core/InteropServices/CorrespondingTypeAttribute.cs b/Core/InteropServices/CorrespondingTypeAttribute.cs index 66a6b926..8e497ebb 100644 --- a/Core/InteropServices/CorrespondingTypeAttribute.cs +++ b/Core/InteropServices/CorrespondingTypeAttribute.cs @@ -183,7 +183,7 @@ namespace Vanara.InteropServices protected static IEnumerable GetAttrForEnum(TEnum value, CorrespondingAction action = (CorrespondingAction)0xf) where TEnum : System.Enum { var valueType = value.GetType(); - var attr = valueType.GetField(value.ToString()).GetCustomAttributes(false, a => a.Action.HasFlag(action)); + var attr = valueType.GetField(value.ToString()).GetCustomAttributes(false, a => (a.Action & action) > 0); if (attr.Any(a => a.Action == CorrespondingAction.Exception)) throw new Exception(); //if (!attr.Any()) return new CorrespondingTypeAttribute[0]; return attr;