CreateFile access/sharing problem

Vitaliy Margolen wine-devel at kievinfo.com
Mon Oct 3 23:41:00 CDT 2005


Monday, October 3, 2005, 10:08:24 PM, Dmitry Timoshkov wrote:
> "Michael Ost" <most at museresearch.com> 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
> STANDARD_RIGHTS_ALL ==
> (DELETE|READ_CONTROL|WRITE_DAC|WRITE_OWNER|SYNCHRONIZE).
> 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.
It is an additional flags to the rest of the file flags because they are
transferred all the way to the kernel. And being translated into specific access
rights by an object manager according to the object type. It has array of the
generic attributes mappings.

Vitaliy






More information about the wine-devel mailing list