From: siddu on
Hi all,


I opened the usermode file in my driver using zwcreatefile with
FILE_SHARE_READ
and FILE_SHARE_Write access . i mount my file as a virtual volume.
Now i want to remove FILE_SHARE_WRITE ShareAccess at run time ( on the fly ).
and i also want to set FILE_SHARE_WRITE when ever i want.

I need api or file system IOCTL or any other possible way to do it.

thanks.







From: Scott Noone on
> Now i want to remove FILE_SHARE_WRITE ShareAccess at run time ( on the
> fly ).
> and i also want to set FILE_SHARE_WRITE when ever i want.
>
> I need api or file system IOCTL or any other possible way to do it.

Strange...You need to write a file system filter driver and manage the
sharing on the file yourself. There's no way to force the FS to do what
you're asking for here.

If you tell us what you're trying to accomplish there might be an easier
solution for you.

-scott

--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com




"siddu" <siddu.khed(a)gmail.com> wrote in message
news:556A026E-3C50-47CD-BB62-8D4E74F3D137(a)microsoft.com...
> Hi all,
>
>
> I opened the usermode file in my driver using zwcreatefile with
> FILE_SHARE_READ
> and FILE_SHARE_Write access . i mount my file as a virtual volume.
> Now i want to remove FILE_SHARE_WRITE ShareAccess at run time ( on the
> fly ).
> and i also want to set FILE_SHARE_WRITE when ever i want.
>
> I need api or file system IOCTL or any other possible way to do it.
>
> thanks.
>
>
>
>
>
>
>
From: siddu on
thanks scott for reply,

i have taken sample of filedisk-17 from http://www.acc.umu.se/~bosse/
using this driver i created a file and mounted as disk or volume (eg h: as
drive letter) .

Now i have written seperate application which sends the IOCTL to the driver
in which the driver should set this H: drive in read share mode only, so
that it should disable file copying to that drive.

thanks a lot.

when i reset it user can write to the drive.


"Scott Noone" wrote:

> > Now i want to remove FILE_SHARE_WRITE ShareAccess at run time ( on the
> > fly ).
> > and i also want to set FILE_SHARE_WRITE when ever i want.
> >
> > I need api or file system IOCTL or any other possible way to do it.
>
> Strange...You need to write a file system filter driver and manage the
> sharing on the file yourself. There's no way to force the FS to do what
> you're asking for here.
>
> If you tell us what you're trying to accomplish there might be an easier
> solution for you.
>
> -scott
>
> --
> Scott Noone
> Consulting Associate
> OSR Open Systems Resources, Inc.
> http://www.osronline.com
>
>
>
>
> "siddu" <siddu.khed(a)gmail.com> wrote in message
> news:556A026E-3C50-47CD-BB62-8D4E74F3D137(a)microsoft.com...
> > Hi all,
> >
> >
> > I opened the usermode file in my driver using zwcreatefile with
> > FILE_SHARE_READ
> > and FILE_SHARE_Write access . i mount my file as a virtual volume.
> > Now i want to remove FILE_SHARE_WRITE ShareAccess at run time ( on the
> > fly ).
> > and i also want to set FILE_SHARE_WRITE when ever i want.
> >
> > I need api or file system IOCTL or any other possible way to do it.
> >
> > thanks.
> >
> >
> >
> >
> >
> >
> >