本文介绍了资源管理器正在重新导航到我的名称空间扩展的根文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

在我的名称空间扩展中,文件系统中实际上不存在文件夹.

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.

例如,导航到

C:\root\folder\subfolder

我被重定向回

C:\root

这种情况在不清楚的情况下会发生,但会不断复制.

This happens in unclear scenarios, but keeps reproducing.

我正在尝试调试它并确定与Explorer混淆的地方,但是我找不到合适的工具.

I'm trying to debug it and identify what messes with Explorer, but I can't find the right tool.

我尝试了sysinternalsProcMonDbgView,但是找不到任何相关数据.

I've tried ProcMon and DbgView of sysinternals, but couldn't find any relevant data.

我已将跟踪添加到我对ShchangeNotify进行的所有显式调用中,但在相关时间均未执行.

I've added traces to any explicit calls I make to ShchangeNotify, but none are executed at the relevant time.

我还尝试向我的IShellFolderViewCB.MessageSFVCB()实现添加跟踪.同样,在相关的时间戳记中没有打印日志.

I've also tried to add traces to my implementation of 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.

有什么建议吗?

推荐答案

这不是答案.这只是建议.

This is not answer. This is advice only.

在我的NSE中,我使用日志记录.我可以实时看到NSE的每个函数的每次调用.我看到了全部输入和全部输出参数.我的资源中的每个函数都看起来像这样:

In my NSE I use logging. I see EVERY call of EVERY function of my NSE in realtime. 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 helped me a lot of times to find problems in my code.

这篇关于资源管理器正在重新导航到我的名称空间扩展的根文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 02:03