mirror of https://github.com/dahall/Vanara.git
Removed unnecessary handling of 'shell::' prefixed paths in GetShellItemForPath. Determined that `SHCreateItemFromParsingName` already does this.
parent
44f0afe732
commit
aa6cbf204f
|
@ -81,16 +81,16 @@ namespace Vanara.PInvoke
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// Handle case of a 'shell' URI and convert GUID to known folder
|
// Handle case of a 'shell' URI and convert GUID to known folder
|
||||||
if (path.StartsWith("shell:::", StringComparison.InvariantCultureIgnoreCase))
|
//if (path.StartsWith("shell:::", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
//{
|
||||||
path = path.Substring(8);
|
// path = path.Substring(8);
|
||||||
var separatorIndex = path.IndexOf('/');
|
// var separatorIndex = path.IndexOf('/');
|
||||||
var kf = new Guid(separatorIndex == -1 ? path : path.Substring(0, separatorIndex));
|
// var kf = new Guid(separatorIndex == -1 ? path : path.Substring(0, separatorIndex));
|
||||||
var fullPath = GetPathForKnownFolder(kf);
|
// var fullPath = GetPathForKnownFolder(kf);
|
||||||
if (separatorIndex != -1)
|
// if (separatorIndex != -1)
|
||||||
fullPath += path.Substring(separatorIndex).Replace('/', '\\');
|
// fullPath += path.Substring(separatorIndex).Replace('/', '\\');
|
||||||
path = fullPath;
|
// path = fullPath;
|
||||||
}
|
//}
|
||||||
|
|
||||||
var hr = SHCreateItemFromParsingName(path, null, typeof(IShellItem).GUID, out var unk);
|
var hr = SHCreateItemFromParsingName(path, null, typeof(IShellItem).GUID, out var unk);
|
||||||
if (hr == (HRESULT)Win32Error.ERROR_FILE_NOT_FOUND)
|
if (hr == (HRESULT)Win32Error.ERROR_FILE_NOT_FOUND)
|
||||||
|
|
Loading…
Reference in New Issue