sharpshell icon indicating copy to clipboard operation
sharpshell copied to clipboard

NameSpaceExtension Cannot show subfolder in folderview

Open FormatD opened this issue 6 years ago • 6 comments

Version of SharpShell used: 2.x.y 2.7.1.0 Related type(s) of SharpShell-Server: Any DefaultNamespaceFolderView OS:Win10 1803 17134.472

Thanks for your great job.

When i run the sample namespace reproduct steps: 1.install sample RegistryNamespaceExtension 2.select any folder under Registry,such as:HKEY_LOCAL_MACHINE 3.i expect the folderview will show the items in HKEY_LOCAL_MACHINE but the folderview always show the root registry items

and the logs shows tim20190101221857

I found that this problem may have been fixed according to the issue #125

I am not sure if I only have this problem.

Thanks again.

FormatD avatar Jan 01 '19 14:01 FormatD

+1 I can reproduce this on my PC as well.

Also I get an error message when I click on anything below the first generation of children in the tree saying "Wrong Parameter".

I found that this problem may have been fixed according to the issue #125

Don't think so as issue #125 didn't fix anything really.

Visual: image

Countryen avatar Jan 01 '19 15:01 Countryen

Thanks for the info on this issue, I'll take a look into it shortly!

dwmkerr avatar Jan 18 '19 21:01 dwmkerr

Hi @dwmkerr Will this issure be fixed in the near future? I can't open subfolder when I run every sample of NamespaceExtension,and no error logs. My project need NamespaceExtension feture, I hope for your help.Thanks

MatriQ avatar Jul 24 '19 16:07 MatriQ

The issue is still there as of 01/11/2020. The call to Shell32.SHCreateShellFolderView(ref createInfo, out view) in DefaultNamespaceFolderView.CreateShellView(...) failed with error code 0x80070057 (The parameter is incorrect).

In addition the Registry namespace extension sample shows in Shell Debugger's left pane (see screenshot below), but not in Windows Explorer's left pane.

image

Windows Explorer image

isafeguard2 avatar Jan 11 '20 17:01 isafeguard2

I've spent a lot of time trying to fix the exception and really am struggling to get to the root cause. It is possible that the icon missing from the left-hand side is good clue though, it might indicate that something is not implemented properly...

dwmkerr avatar Jan 22 '20 15:01 dwmkerr

@dwmkerr It appears that all you need is to bind the absolute pidl to the subfolder and it works. Here's what I did (too many changes locally so I can't really create a merge request):

In BindToObject() ...

if (childItem is IShellNamespaceFolder subFolder)
{
	var current = proxyFolder.GetDisplayName(DisplayNameContext.Normal);
	var subFolderProxy = new ShellFolderImpl(namespaceExtension, subFolder);
	
	ppv = Marshal.GetComInterfaceForObject(subFolderProxy,
		riid == typeof(IShellFolder).GUID ? typeof(IShellFolder) : typeof(IShellFolder2));

	// attach the absolute pidl
	var fullList = IdList.Create(idListAbsolute.Ids.Concat(idList.Ids).ToList());
	var fullPidl = PidlManager.IdListToPidl(fullList);
	((IPersistFolder)subFolderProxy).Initialize(fullPidl);

	// notify the item that it's being bound so it can perform custom action
	subFolder.OnBinding();

	return WinError.S_OK;
}

The thing is that the sub folder IShellFolder won't have ids when asked by the system and this is why SHCreateShellFolderView is failing.

Cheers

P.S.

Forgot to mention that there are still artifacts like

  • path displayed in explorer
  • Id displayed in title bar instead of displayname

But these are next steps for me.

stanislav-peichev avatar Nov 29 '22 15:11 stanislav-peichev