CreateFile access/sharing problem

Dmitry Timoshkov dmitry at
Mon Oct 3 23:08:24 CDT 2005

"Michael Ost" <most at> wrote:

> A 3rd party installer program for a VST plugin is calling CreateFile
> with dwDesiredAccess = 0x1f01ff and dwSharedMode = FILE_SHARE_WRITE. It
> then calls ReadFile, which fails in Wine (error 5) but succeeds in
> WinXP.
> My "solution" (polite term) was to force GENERIC_READ|GENERIC_WRITE
> access in ntdll/NtCreateFile if the sharing type is FILE_SHARE_WRITE.

Most likely sharing mode has nothing to do with access rights. The problem is
that the app doesn't specify neither of GENERIC_xxxx flags. But it does specify
It appears that Windows treats GENERIC_xxxx rights as an addition to the
STANDARD_RIGHTS_xxx flags, and missing GENERIC_xxxx rights are normally ignored.

> I have not been able to figure out from the header files what named
> constants the program used for dwDesiredAccess, so I hard coded it with
> the values the program used in my example. 
> But I did notice that FILE_ALL_ACCESS is a different value in Wine and
> my VC98 headers from DevStudio 6. In Wine it is:
> In VC98:
> Is this a Wine bug?

Please send a patch for this.

Your test app needs to be extended to verify who is responsible for handling
the dwDesiredAccess: CreateFileW ot NtCreateFile (I think it's the latter one,
but it needs to be tested).


More information about the wine-devel mailing list