簡體   English   中英

資源管理器正在重新導航到我的名稱空間擴展的根文件夾

[英]Explorer is re-navigating to the root folder of my namespace extension

在我的命名空間擴展中,我擁有文件系統中實際上不存在的文件夾。

有時,在瀏覽我的名稱空間擴展時,資源管理器只是將用戶重新導航回到根文件夾。

例如,導航到

C:\root\folder\subfolder

我被重定向回

C:\root

在不清楚的情況下會發生這種情況,但會不斷復制。

我正在嘗試調試它,並確定與Explorer混淆的地方,但是我找不到合適的工具。

我已經嘗試了sysinternals ProcMonDbgView ,但是找不到任何相關數據。

我已經在對ShchangeNotify進行的所有顯式調用中添加了跟蹤,但是在相關時間沒有執行任何跟蹤。

我還嘗試向我的IShellFolderViewCB.MessageSFVCB()實現中添加跟蹤。 同樣,在相關的時間戳中沒有打印日志。

我想如果沒有進一步的信息,誰也無法幫助我的案子,但這也適用於我。 我需要一些更好的工具來捕獲資源管理器事件並找出問題所在。

有什么建議么?

這不是答案。 這僅是建議。

在我的NSE中,我使用日志記錄。 我可以實時看到NSE的每個函數的每次調用。 我看到了全部輸入和全部輸出參數。 我的資源中的每個函數如下所示:

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;

日志如下所示:

日志

日志幫助我很多次在代碼中發現問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM