Incompatibility in Kernel32
Hans Leidekker
hans at codeweavers.com
Thu Jun 21 04:03:21 CDT 2012
On Thu, 2012-06-21 at 16:03 +0900, Dmitry Timoshkov wrote:
> > Shall I file a bug report?
>
> Try to add a test case to dlls/kenel32/tests/file.c,test_file_sharing().
>
> > HANDLE h2 = CreateFileA(filename, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
> > assert (h2 != 0);
> >
> > if (!DeleteFile(filename)) {
> > r = GetLastError();
> > fprintf(stderr, "This only happens in Wine. I got error: %d\n", r);
> > assert(0);
> > }
>
> 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.
More information about the wine-devel
mailing list