From c201274dbaf2a7e3e7d0119c646ad98194aac7b2 Mon Sep 17 00:00:00 2001 From: David Hall Date: Thu, 6 Jun 2024 11:09:33 -0600 Subject: [PATCH] Changed IPropertyStore.SetValue extension so value is coerced to correct type before setting. --- PInvoke/Ole/PropSys/PropSys.Interfaces.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PInvoke/Ole/PropSys/PropSys.Interfaces.cs b/PInvoke/Ole/PropSys/PropSys.Interfaces.cs index b90775de..ff7ae492 100644 --- a/PInvoke/Ole/PropSys/PropSys.Interfaces.cs +++ b/PInvoke/Ole/PropSys/PropSys.Interfaces.cs @@ -2181,6 +2181,7 @@ public static class PSExtensions public static void SetValue(this PropSys.IPropertyStore ps, in PROPERTYKEY pkey, object? value, bool commit = true) { using var pv = new PROPVARIANT(value); + pkey.CoerceToCanonicalValue(pv); ps.SetValue(pkey, pv); if (commit) ps.Commit(); }