diff --git a/Source/SharpDX/Win32/Variant.cs b/Source/SharpDX/Win32/Variant.cs index 409479e05..529b233e5 100644 --- a/Source/SharpDX/Win32/Variant.cs +++ b/Source/SharpDX/Win32/Variant.cs @@ -275,6 +275,20 @@ public unsafe object Value Type = VariantType.Default; if (type.GetTypeInfo().IsPrimitive) { + if (type == typeof(byte)) + { + ElementType = VariantElementType.UByte; + variantValue.byteValue = (byte)value; + return; + } + + if (type == typeof(sbyte)) + { + ElementType = VariantElementType.Byte; + variantValue.signedByteValue = (sbyte)value; + return; + } + if (type == typeof(int)) { ElementType = VariantElementType.Int;