[英]Explorer is re-navigating to the root folder of my namespace extension
In my namespace extension, I have folders that doesn't actually exist in the file system. 在我的命名空间扩展中,我拥有文件系统中实际上不存在的文件夹。
Sometimes, when browsing my namespace extension, Explorer simply re-navigates the user back to the root folder. 有时,在浏览我的名称空间扩展时,资源管理器只是将用户重新导航回到根文件夹。
For example, navigating to 例如,导航到
C:\root\folder\subfolder
I'm redirected back to 我被重定向回
C:\root
This happens in unclear scenarios, but keeps reproducing. 在不清楚的情况下会发生这种情况,但会不断复制。
I'm trying to debug it and identify what messes with Explorer, but I can't find the right tool. 我正在尝试调试它,并确定与Explorer混淆的地方,但是我找不到合适的工具。
I've tried ProcMon
and DbgView
of sysinternals
, but couldn't find any relevant data. 我已经尝试了sysinternals
ProcMon
和DbgView
,但是找不到任何相关数据。
I've added traces to any explicit calls I make to ShchangeNotify
, but none are executed at the relevant time. 我已经在对ShchangeNotify
进行的所有显式调用中添加了跟踪,但是在相关时间没有执行任何跟踪。
I've also tried to add traces to my implementation of IShellFolderViewCB.MessageSFVCB()
. 我还尝试向我的IShellFolderViewCB.MessageSFVCB()
实现中添加跟踪。 Again, no logs printed in the relevant timestamps. 同样,在相关的时间戳中没有打印日志。
I assume no one would be able to help my case without further information, but that applies to me as well. 我想如果没有进一步的信息,谁也无法帮助我的案子,但这也适用于我。 I need some better tool to catch the explorer events and identify what goes wrong. 我需要一些更好的工具来捕获资源管理器事件并找出问题所在。
Any suggestions? 有什么建议么?
This is not answer. 这不是答案。 This is advice only. 这仅是建议。
In my NSE I use logging. 在我的NSE中,我使用日志记录。 I see EVERY call of EVERY function of my NSE in realtime. 我可以实时看到NSE的每个函数的每次调用。 I see all in and all out parameters. 我看到了全部输入和全部输出参数。 Every function in my sources looks like this: 我的资源中的每个函数如下所示:
function TdecShellNamespaceFolder.IShellFolder_ParseDisplayName(AWnd: HWND; ABindCtx: Pointer; ADisplayName: POLESTR; out AEaten: ULONG; out AItemIDList: PItemIDList; var AAttributes: ULONG): HRESULT;
var
{$IFDEF USE_LOGS}
CurrentMethod: string;
{$ENDIF}
Eaten: DWORD;
Attr: TdecFileShellAttributes;
begin
{$IFDEF USE_LOGS}
CurrentMethod := 'IShellFolder.ParseDisplayName';
LogSendEnter(CurrentMethod);
LogSendInHWND(CurrentMethod, 'AOwner', AWnd);
LogSendInBindCtx(CurrentMethod, 'ABindCtx', IBindCtx(ABindCtx));
LogSendInParam(CurrentMethod, 'ADisplayName', ADisplayName);
LogSendInNil(CurrentMethod, '@AEaten', @AEaten);
LogSendInNil(CurrentMethod, '@AItemIDList', @AItemIDList);
if Assigned(@AAttributes) then
LogSendInParam(CurrentMethod, 'AAttributes', SFGAOToString(AAttributes))
else
LogSendInNil(CurrentMethod, '@AAttributes');
Result := E_FAIL;
try
{$ENDIF}
try
// FUNCTION BODY
except
on E: Exception do
begin
{$IFDEF USE_LOGS}
LogSendException(CurrentMethod, E);
{$ENDIF}
Result := HResultFromException(E);
end;
end;
{$IFDEF USE_LOGS}
finally
if Result = S_OK then
begin
if Assigned(@AEaten) then
LogSendOutParam(CurrentMethod, 'AEaten', IntToStr(AEaten));
LogSendOutItemIDList(CurrentMethod, 'AItemIDList', AItemIDList);
if Assigned(@AAttributes) then
LogSendOutParam(CurrentMethod, 'AAttributes', SFGAOToString(AAttributes));
end;
LogSendResult(CurrentMethod, Result);
LogSendExit(CurrentMethod);
end;
{$ENDIF}
end;
And logs look like this: 日志如下所示:
And logs helped me a lot of times to find problems in my code. 日志帮助我很多次在代码中发现问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.