Help with a native Windows test program needed (CreateFileW)

Greg Geldorp ggeldorp at vmware.com
Fri Sep 11 18:30:57 CDT 2009


Hi Markus,

> From: Markus Stockhausen <markus.stockhausen at collogia.de>
>
> as I have no Windows machine and cannot test this: I'm in need for
> someone who can build a small exe that gives further hints to my
> observations in bug #9575. The following is needed:
>
> call CreateFileW( 'testfile.txt', ..., dwShareMode = 0, ...)
> call CreateFileW( 'testfile.txt', ..., dwShareMode = 0, ...)
>
> Return the result of second call. I expect it to be a valid handle on
> Windows whereas Wine will return an invalid handle.

This test program:

int main(int argc, char *argv[])
{
   HANDLE File1, File2;
   
   File1 = CreateFileW(L"test.dat", GENERIC_READ, 0, NULL, CREATE_ALWAYS, 0,
NULL);
   File2 = CreateFileW(L"test.dat", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0,
NULL);

   printf("File1 0x%x File2 0x%x error %u\n", File1, File2, GetLastError());

	return 0;
}

returns this result on Windows 2008:

File1 0x10 File2 0xffffffff error 32

so the second CreateFile fails on Windows too, with ERROR_SHARING_VIOLATION.

Ge.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3163 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090911/ee4e1d0e/attachment.bin>


More information about the wine-devel mailing list