On 21/06/2012 7:11 PM, Dmitry Timoshkov wrote:
Hans Leidekker hans@codeweavers.com wrote:
Is there any reason that you call DeleteFile() on a still being opened file?
That's the whole point of this test. The observed behavior is that you can pass a filename to MsiRecordSetStream, successfully delete the file, and keep on using the stream.
We currently implement MsiRecordSetStream by creating an in-memory copy of the stream. As Robert noticed, this will fail if the stream is too large.
The idea is to move to an implementation on top of a file handle, but it should still allow DeleteFile to succeed while the file is in use.
Thanks, I see. Removing GENERIC_WRITE from flags passed to NtCreateFile by DeleteFile makes the test I just sent for that behaviour pass (and that's most like a correct fix), but that leads to some other test failures. This needs further investigation.
server/fd.c:open_fd() doesn't check that the read-only bit is unset (i.e. the file is writable) when the DELETE access flag is set. Thus DeleteFile() succeeding when the tests expect it to fail.