On Mon Nov 4 22:41:59 2024 +0000, Fabian Maurer wrote:
That would be something we don't have tests for then, a bit difficult to deal with. Problem is that a file that is opened read/write (shared) can't opened readonly again, but in this case it can be opened readonly. So either we need to open it readonly to begin with (current state), or maybe open it read/write and handle it as readonly internally. Not sure how to test what windows does though.
MSI_OPEN_READONLY translates to STGM_DIRECT|STGM_READ|STGM_SHARE_DENY_WRITE and MSI_OPEN_TRANSACT translates to STSTGM_TRANSACTED|STGM_READWRITE|STGM_SHARE_DENY_WRITE. The app passes NULL for szPersist (read-only) which results in a sharing violation only for the latter case (which doesn't explicitly deny read-sharing). We should check if those storage flags are implemented correctly.