Details
-
Bug
-
Resolution: Fixed
-
Major
-
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.