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

Review/Update NtReadFile()/NtWriteFile() calls wrt ByteOffset param use

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 0.4.8
    • Component/s: None
    • Labels:
      None

      Description

      While working on CORE-12672, I noticed some code like:

      FileOffset.QuadPart = 0ULL;
      Status = NtReadFile(FileHandle,
                          NULL,
                          NULL,
                          NULL,
                          &IoStatusBlock,
                          OrigBootSector,
                          SECTORSIZE,
                          NULL,   // (default/missing) ByteOffset parameter.
                          NULL);

      So I asked:

      We may want to check current code for missing param uses or superfluous '0' init+uses...

      And hbelusca replied:

      It is always better to specify where to start to read, before doing the operation (especially when these are unbuffered reads as I think they are there).

      Then, the current issue is to improve such cases.
      And maybe standalone NULL too, if/where not needed to be.

      NtReadFile grep
      NtWriteFile grep
      ZwReadFile grep
      ZwWriteFile grep

        Attachments

          Activity

            People

            • Assignee:
              bug zilla Bug Zilla
              Reporter:
              Serge Gautherie Serge Gautherie
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: