Drag and Drop from Outook to v9.51 - errors

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
junglemarc
Junior Member
Junior Member
Posts: 3
Joined: 2021-03-22, 16:16 UTC

Drag and Drop from Outook to v9.51 - errors

Post by *junglemarc »

Hello everyone. I'd like to report a strange bug that started happening past 2 days.



We are on Windows 10, 64bit, latest updates - just not on 20H2.

Outlook 2010 32bit

Total Commander 9.51 32-bit



When we select attachments in Outlook to be dragged and dropped into Total Commander, on a network drive, we get popup saying

Access denied!
with the buttons "Ok" and "Administrator"

For the amount of attachment selected, if I keep pressing the "Ok" button, it will eventually all appear in the app.


For sake of testing, I've tried for a moment the v10 public beta 32bit. It would offer to overwrite or skip the files.. and other options. If I overwrite or skip the files, not all attachments will appear.

For now I have rolled back to 9.51 because at least I can just keep clicking "Ok" button as a workaround and it works. Clicking "Administrator" or the "X" at the popup does not help.


Just thought of dropping this here, in case other has noticed this. I find it interesting the public beta has slightly different behaviour over this.


I suspect recent updates to Windows 10 changed behaviour on drag and drop for apps other than Explorer.



This bug cannot be replicated on local drive, only on network drives.


Looking forward to the community feedback on this.

Best regards,

Marc
User avatar
Dalai
Power Member
Power Member
Posts: 9974
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Drag and Drop from Outook to v9.51 - errors

Post by *Dalai »

Do you run TC as administrator? See TC's title bar, if there's a circumflex after the user name, it runs elevated.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
petermad
Power Member
Power Member
Posts: 16034
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Drag and Drop from Outook to v9.51 - errors

Post by *petermad »

2Dalai
Do you run TC as administrator? See TC's title bar, if there's a circumflex after the user name, it runs elevated.
I think not, because junglemarc write that he get this:
Access denied!
with the buttons "Ok" and "Administrator"
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
junglemarc
Junior Member
Junior Member
Posts: 3
Joined: 2021-03-22, 16:16 UTC

Re: Drag and Drop from Outook to v9.51 - errors

Post by *junglemarc »

Well that was weird, a reboot fixed this issue. Very intermittent issue at the moment.

I'll keep you updated if it happens again.

Best regards,

Marc
junglemarc
Junior Member
Junior Member
Posts: 3
Joined: 2021-03-22, 16:16 UTC

Re: Drag and Drop from Outook to v9.51 - errors

Post by *junglemarc »

Dalai wrote: 2021-03-22, 18:13 UTC Do you run TC as administrator? See TC's title bar, if there's a circumflex after the user name, it runs elevated.

Regards
Dalai
Yes we tried running as Administrator at that moment as well.

I am clueless of what could of caused the issue in first hand. We are still committing to latest Windows updates.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50561
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Drag and Drop from Outook to v9.51 - errors

Post by *ghisler(Author) »

I'm using the function AccessCheck to determine whether the current user is allowed to write files to the drop location. The check is disabled for network drives, though. Here is the code I'm using if anyone wants to have a closer look.

Code: Select all

function WriteAccessAllowedW(pathname:pwidechar):integer;
var proctoken:thandle;
    filename,volumepathname:twdirtype;
    secdesc:pSECURITYDESCRIPTOR;
    GenericMapping:tGENERICMAPPING;
    PrivilegeSet:tPrivilegeSet;
    lengthallocated,lengthneeded,dwAccessDesired,dwPrivSetSize,dwAccessGranted:integer;
    fAccessGranted:bool;
begin
  result:=1;
  if not is_NT then exit;
  if (pathname[0]='\') or (LongGetUncDriveTypeW(pathname)=drive_remote) then exit;

  {Is it a junction?}
  wstrlcopy(filename,pathname,wdirtypemax);
  wcutlastbackslash(filename);
  if LongGetFAttrW(filename) and FILE_ATTRIBUTE_REPARSE_POINT<>0 then begin
    volumepathname[0]:=#0;
    if (GetReparsePointTargetW(filename,volumepathname,wdirtypemax,0)<>0) and
      (wstrlcomp(volumepathname,'\??\',4)=0) then begin
        if wstrlicomp(volumepathname,'\??\Volume',10)=0 then begin
          wstrcopy(filename,'\\');  {Comes as \??\Volume instead of \\?\Volume}
          wstrlcat(filename,volumepathname+2,wdirtypemax)
        end else if volumepathname[5]=':' then
          wstrlcopy(filename,volumepathname+4,wdirtypemax);
        //Messagebox(0,filename,'junction target',0);
      end;
  end;
  wcutlastbackslash(filename);
  result:=-1;
  ImpersonateSelf(SecurityImpersonation);
  if OpenThreadToken(GetCurrentThread,TOKEN_ALL_ACCESS,true,@proctoken) then begin
    lengthneeded:=0;
    if not GetFileSecurityW(filename,OWNER_SECURITY_INFORMATION or GROUP_SECURITY_INFORMATION or DACL_SECURITY_INFORMATION,
      @secdesc,0,lengthneeded) and (lengthneeded>0) then begin
      lengthallocated:=lengthneeded;
      getmem(secdesc,lengthallocated);
      if GetFileSecurityW(filename,OWNER_SECURITY_INFORMATION or GROUP_SECURITY_INFORMATION or DACL_SECURITY_INFORMATION,
        secdesc,lengthallocated,lengthneeded) then begin
          fillchar(GenericMapping, sizeof(tGENERICMAPPING),$ff);
          GenericMapping.GenericRead := FILE_READ_DATA;
          GenericMapping.GenericWrite := FILE_WRITE_DATA;
          GenericMapping.GenericExecute := FILE_EXECUTE;
          GenericMapping.GenericAll := FILE_READ_DATA or FILE_WRITE_DATA or FILE_EXECUTE;
          dwAccessDesired:=GENERIC_WRITE;
          MapGenericMask(dwAccessDesired,GenericMapping);
          dwPrivSetSize:=sizeof(tPRIVILEGESET);
          if AccessCheck(secdesc,proctoken,dwAccessDesired,GenericMapping,
              PrivilegeSet, dwPrivSetSize, dwAccessGranted,
              fAccessGranted) then begin
            if fAccessGranted then result:=1
                              else result:=0;
          end else
            if (GetLastError=5) then  {Access denied to security descriptior}
              result:=0;
      end;
      freemem(secdesc,lengthallocated);
    end;
    CloseHandle(proctoken);
  end;
  RevertToSelf;
end;
Author of Total Commander
https://www.ghisler.com
Post Reply