Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12732

CreateFileMapping returns NULL if failed, but mistakenly tested with INVALID_HANDLE_VALUE in the source code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.1
    • 4.6.0, 4.6.1, 4.6.2, 4.6.3, 4.7.0
    • Core: I/O
    • None
    • 7829343dc9e12befd6c471cc72d00139bad5d42b

    Description

      1968
      // first create the file mapping handle
      1969
      DWORD protection = (openMode & QIODevice::WriteOnly) ? PAGE_READWRITE : PAGE_READONLY;
      1970
      mapHandle = ::CreateFileMapping(handle, 0, protection, 0, 0, 0);
      1971
      if (mapHandle == INVALID_HANDLE_VALUE) {
      1972
      q->setError(QFile::PermissionsError, qt_error_string());

      According to MSDN http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx
      CreateFileMapping
      If the function fails, the return value is NULL...

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cduclos Carlos Duclos (Inactive)
            bi11 Yuxin Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes