Fix generation of a `ShareAccess` mode given a `DesiredAccess` mask
Fix generation of a `ShareAccess` mode given a `DesiredAccess` mask

The `required_share` method returns invalid generated `ShareAccess` modes. They
don’t allow to open a second handler to a file to access its attributes when the
first handle is opened with a `ShareAccess` field set to 0. Experiments with
calls to `CreateFile` on Windows show that it should be possible. An open
implementation of a Windows kernel’s `IoCheckShareAccess` routine from ReactOS
backs this idea, too.

A sample case to replicate a problem is to open an image file in MS Paint. Paint
calls the `CreateFile` method with the `ShareAccess` parameter set to 0, doesn’t
close the opened file and tries to open it again to read its attributes.

DaveWeath/dokany,DaveWeath/dokany