Skip to content

Commit 5fe63ea

Browse files
committed
Bug fixed in ShellProperty
1 parent 06b6ab9 commit 5fe63ea

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ COMNative 3.0
117117
- Removals:
118118
- Some 'ref' keywords in native PortableDevices interfaces. These keywords have been removed for interface type parameters because they was redundant.
119119

120+
## 07/2022 2.12.0.2
121+
122+
Bug fixed in ShellProperty: an exception was thrown (truncation error), even if no truncation were made.
123+
120124
## 07/2022 2.12
121125

122126
- New constants.

source/WindowsAPICodePack/2.x/Shell.2.x/Shell.2.x.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<Copyright>Copyright © Microsoft 2010, Copyright © Pierre Sprimont 2022</Copyright>
88
<Description>WindowsAPICodePack for Shell</Description>
99
<DefineConstants>WAPICP2;$(DefineConstants)</DefineConstants>
10-
<VersionPrefix>2.12.0.1</VersionPrefix>
11-
<AssemblyVersion>2.12.0.1</AssemblyVersion>
12-
<FileVersion>2.12.0.1</FileVersion>
10+
<VersionPrefix>2.12.0.2</VersionPrefix>
11+
<AssemblyVersion>2.12.0.2</AssemblyVersion>
12+
<FileVersion>2.12.0.2</FileVersion>
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1414
<UseWindowsForms>true</UseWindowsForms>
1515
<UseWPF>true</UseWPF>

source/WindowsAPICodePack/3.x/Shell/Shell.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<Copyright>Copyright © Microsoft 2010, Copyright © Pierre Sprimont 2022</Copyright>
88
<Description>WindowsAPICodePack for Shell</Description>
99
<DefineConstants>WAPICP3;$(DefineConstants)</DefineConstants>
10-
<VersionPrefix>3.11</VersionPrefix>
10+
<VersionPrefix>3.11.0.1</VersionPrefix>
1111
<VersionSuffix>preview</VersionSuffix>
12-
<AssemblyVersion>3.11</AssemblyVersion>
13-
<FileVersion>3.11</FileVersion>
12+
<AssemblyVersion>3.11.0.1</AssemblyVersion>
13+
<FileVersion>3.11.0.1</FileVersion>
1414
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1515
<UseWindowsForms>true</UseWindowsForms>
1616
<UseWPF>true</UseWPF>

source/WindowsAPICodePack/Shared/Shell.Shared/Common/Shell/ShellLink.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public string Comments
114114

115115
set
116116
{
117-
if (value == null? throw new ArgumentNullException(nameof(value)) : NativeShellItem2 != null)
117+
if (value == null ? throw new ArgumentNullException(nameof(value)) : NativeShellItem2 != null)
118118
{
119119
Properties.System.Comment.Value = value;
120120

@@ -125,10 +125,7 @@ public string Comments
125125
#endregion Public Properties
126126

127127
#region Constructors
128-
internal ShellLink(in IShellItem2 shellItem) : base(shellItem)
129-
{
130-
// Left empty.
131-
}
128+
internal ShellLink(in IShellItem2 shellItem) : base(shellItem) { /* Left empty. */ }
132129

133130
#if WAPICP3
134131
private ShellLink(in IShellItem2 shellItem, in string sourcePath) : base(shellItem) => TargetLocation = sourcePath;

source/WindowsAPICodePack/Shared/Shell.Shared/PropertySystem/ShellProperty.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private void StorePropVariantValue(PropVariant propVar)
100100
#endif
101101
(hr));
102102

103-
_ = AllowSetTruncatedValue && result == HResult.InPlaceStringTruncated ? CoreErrorHelper.Succeeded(result) ? writablePropStore.Commit() : throw new PropertySystemException(LocalizedMessages.ShellPropertySetValue, Marshal.GetExceptionForHR((int)result)) : throw new ArgumentOutOfRangeException(nameof(propVar), LocalizedMessages.ShellPropertyValueTruncated);
103+
_ = result != HResult.InPlaceStringTruncated || AllowSetTruncatedValue ? CoreErrorHelper.Succeeded(result) ? writablePropStore.Commit() : throw new PropertySystemException(LocalizedMessages.ShellPropertySetValue, Marshal.GetExceptionForHR((int)result)) : throw new ArgumentOutOfRangeException(nameof(propVar), LocalizedMessages.ShellPropertyValueTruncated);
104104
}
105105

106106
catch (InvalidComObjectException e)

0 commit comments

Comments
 (0)