FltCreateFile + STATUS_SHARING_VIOLATION + Explorer

Hello:

I am writing a mini-filter that will open a folder on a file share of a
remote machine. The creation is done from a system thread. The system thread
impersonates the local user. The local user has the privileges to access
(for read/write) the file share. I can open the folder just fine – unless
the folder is currently being displayed within Explorer. At which point
FltCreateFile fails with a STATUS_SHARE_VIOLATION. The filter is running on
WinXP, SP3

Below is the code that I am using to open the folder:

status = FltCreateFile( pFilter,
pInstance,
phRelAltDir,
FILE_WRITE_DATA | SYNCHRONIZE,
&objAttribs,
&ioStatus,
NULL,
0 ,
// File Attribs
FILE_SHARE_WRITE, // File Share Access
FILE_OPEN_IF, // Create
Disposition
FILE_DIRECTORY_FILE |
FILE_SYNCHRONOUS_IO_NONALERT, // Create Options
NULL, //
EaBuffer
0,
// EaBuffer length
IO_IGNORE_SHARE_ACCESS_CHECK); // Flags

Any ideas would be greatly appreciated.

TIA

IO_IGNORE_SHARE_ACCESS only works for local file systems. This is an artifact of the way it is implemented (“secret bits” in the file object extension - but that’s only visible on the local system.)

Tony
OSR

Well that’s good to know but… Even when I set the value to zero I have the
same problem – FltCreateFile returns STATUS_SHARE_VIOLATION.

Any other thought?

Thanks.

“Tony Mason” wrote in message news:xxxxx@ntfsd…
IO_IGNORE_SHARE_ACCESS only works for local file systems. This is an
artifact of the way it is implemented (“secret bits” in the file object
extension - but that’s only visible on the local system.)

Tony
OSR

Oh I see. I’m not setting enough share bits.
The share mask needs to be: FILE_SHARE_READ | FILE_SHARE_WRITE.
Thanks
“JimmyJ” wrote in message news:xxxxx@ntfsd…
> Well that’s good to know but… Even when I set the value to zero I have
> the same problem – FltCreateFile returns STATUS_SHARE_VIOLATION.
>
> Any other thought?
>
> Thanks.
>
>
> “Tony Mason” wrote in message news:xxxxx@ntfsd…
> IO_IGNORE_SHARE_ACCESS only works for local file systems. This is an
> artifact of the way it is implemented (“secret bits” in the file object
> extension - but that’s only visible on the local system.)
>
> Tony
> OSR
>
>
>
>