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

Wrong status returned attempting to open image section with CREATE_ALWAYS or DELETE_ON_CLOSE

    XMLWordPrintable

Details

    Description

      In kernel32:file wine test there exists this test: 

      /* try CREATE_ALWAYS over an existing mapping */
      SetLastError(0xdeadbeef);
      h2 = CreateFileA( filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
                                       NULL, CREATE_ALWAYS, 0, 0 );
      ret = GetLastError();
      if (mapping_modes[a1].dw & SEC_IMAGE)
      {
          ok( h2 == INVALID_HANDLE_VALUE, "create succeeded for map %s\n", mapping_modes[a1].str );
          ok( ret == ERROR_SHARING_VIOLATION, "wrong error code %d for %s\n", ret, mapping_modes[a1].str );
      }
      

       The result is this:

      (ntoskrnl/mm/section.c:4736) ERROR: File can't be truncated because it has an image section

      file.c:2468: Test failed: wrong error code 1224 for SEC_IMAGE | PAGE_WRITECOPY

      this might be related to this section in fastfat

      https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/drivers/filesystems/fastfat/create.c;hb=53ab55f03be769caa89362c5aa59d34b4b362987#l812

      This seemingly correct code is disabled by USE_ROS_CC_AND_FS precompiler check, I searched for this in JIRA and came up with nothing.

      Currently it seems we reach all the way into VfatSetInformation or some such and attempt to truncate the file and return STATUS_USER_MAPPED_FILE. 

      Attachments

        Activity

          People

            bug zilla Bug Zilla
            encoded encoded
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: