Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-10503

fastfat fails to move file to the root directory

    XMLWordPrintable

Details

    Description

      shell32_winetest:shlfolder does something like:

      MoveFile("C:\\Documents and Settings\\Administrator\\My Documents\\winetest\\winetest", "C:\\winetest");

      When VfatSetRenameInformation prepares the NewName for this case, it goes through this code path (line 653):

              else if (TargetFileObject != NULL)
              {
                  /* Here, copy first path name and then append filename */
                  RtlCopyUnicodeString(&NewName, &((PVFATFCB)TargetFileObject->FsContext)->PathNameU);
                  NewName.Buffer[NewName.Length / sizeof(WCHAR)] = L'\\';
                  NewName.Length += sizeof(WCHAR);
                  RtlAppendUnicodeStringToString(&NewName, &RenameInfoString);
              }

      Because TargetFileObject refers to the root directory, for which PathNameU is L"\\", this ends up creating "\\\\winetest" with two leading backslashes as the file name, which gets rejected as invalid.

      cc heis spiter

      Attachments

        Activity

          People

            Heis Spiter Pierre Schweitzer
            ThFabba ThFabba
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: