From b10735f5749630de88e73042da18e290b74fb78a Mon Sep 17 00:00:00 2001 From: RKrom Date: Wed, 29 Oct 2014 15:25:17 +0100 Subject: [PATCH] Fix structure definition, MAX_PATH is 260 and not 256 --- GreenshotPlugin/UnmanagedHelpers/Shell32.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GreenshotPlugin/UnmanagedHelpers/Shell32.cs b/GreenshotPlugin/UnmanagedHelpers/Shell32.cs index 6c3e6397e..392aa79b5 100644 --- a/GreenshotPlugin/UnmanagedHelpers/Shell32.cs +++ b/GreenshotPlugin/UnmanagedHelpers/Shell32.cs @@ -33,7 +33,7 @@ namespace GreenshotPlugin.UnmanagedHelpers { public static extern int ExtractIconEx(string sFile, int iIndex, out IntPtr piLargeVersion, out IntPtr piSmallVersion, int amountIcons); [DllImport("shell32", CharSet = CharSet.Unicode)] internal static extern IntPtr ExtractAssociatedIcon(HandleRef hInst, StringBuilder iconPath, ref int index); - [DllImport("Shell32.dll", CharSet = CharSet.Unicode)] + [DllImport("shell32", CharSet = CharSet.Unicode)] private static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbFileInfo, uint uFlags); #region Structs @@ -66,7 +66,7 @@ namespace GreenshotPlugin.UnmanagedHelpers { public IntPtr hIcon; public int iIcon; public uint dwAttributes; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string szDisplayName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] public string szTypeName;