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

Potentially broken code in mountmgr

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.4.13
    • Drivers: Other
    • None

    Description

      The file is mountmgr/notify.c
      https://git.reactos.org/?p=reactos.git;a=blob;f=drivers/filters/mountmgr/notify.c;hb=c8d97709cbbfc727ccf48d799202243804c25229#l248

      Operation:

      • InterlockedCompareExchange() will atomically compare DeviceInformation->MountState to 1 and if equal, set it to 0
      • Of the exchange was done (i.e. InterlockedCompareExchange returned 1 as the old value), InterlockedDecrement(&(DeviceInformation->MountState)); will decrement the value by 1, by default resulting in a value of -1

      This seems broken, since
      1. A MountState value of -1 seems wrong (I might be wrong here myself though, since I don't know the details of how it is supposed to work)
      2. The operation doesn't make much sense, since it could directly do an InterlockedExchange with -1 (or whatever the desired value is)
      3. "This is not what Windows does" (tm)

      Should be investigated.

      Attachments

        Activity

          People

            Heis Spiter Pierre Schweitzer
            ThePhysicist Timo Kreuzer
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: