Skip to content

Commit a4450d6

Browse files
committed
Update
1 parent 14e859d commit a4450d6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Files.App.Storage/Storables/WindowsStorage/WindowsStorable.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using System.Runtime.CompilerServices;
5+
using System.Runtime.InteropServices;
56
using Windows.Win32;
67
using Windows.Win32.Foundation;
78
using Windows.Win32.System.SystemServices;
@@ -39,7 +40,14 @@ public IContextMenu* ContextMenu
3940
IShellItem* pShellItem = null;
4041

4142
fixed (char* pszPath = szPath)
42-
hr = PInvoke.SHCreateItemFromParsingName(pszPath, null, IID.IID_IShellItem, (void**)&pShellItem).ThrowOnFailure();
43+
{
44+
hr = PInvoke.SHCreateItemFromParsingName(pszPath, null, IID.IID_IShellItem, (void**)&pShellItem);
45+
46+
if (hr.Failed)
47+
{
48+
throw new COMException($"{(nint)pszPath}, {(nint)IID.IID_IShellItem}, {(nint)pShellItem}");
49+
}
50+
}
4351

4452
if (pShellItem is null)
4553
return null;

0 commit comments

Comments
 (0)