简体   繁体   中英

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.

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

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

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.

Any suggestions?

This is not answer. This is advice only.

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 look like this:

日志

And logs helped me a lot of times to find problems in my code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM