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.
Not sure I understand what you mean. AFAIK the sharing violation happens because it's not allowed to use CreateFileW to open a file read only that was opened read/write shared, which is how windows behaves as well.