how to modify open file flags in file system filter driver?

Hi All,

My filter driver needs to modify file open flags to add another flag
FILE_OPEN_REPARSE_POINT into the current IRP of IRP_MJ_CREATE. I tried the
following code:
irpSp = IoGetNextIrpStackLocation(Irp);
irpSp->Parameters.Create.Options |= FILE_OPEN_REPARSE_POINT;
IoSkipCurrentIrpStackLocation( Irp );
return IoCallDriver( ((PSFILTER_DEVICE_EXTENSION)
DeviceObject->DeviceExtension)->AttachedToDeviceObject,
Irp );
But there is no any effect in the result.
Any suggestion is appreciated.

Shangwu

Learn the IRP and stack location handling basics:-)
If you need to change a parameter, use IoCopyCurrentIrpStackLocationToNext
instead of IoSkipCurrentIrpStackLocation - the second will nullify any change
you made to the stack location of yours.

Shangwu Qi wrote:

Hi All,

My filter driver needs to modify file open flags to add another flag
FILE_OPEN_REPARSE_POINT into the current IRP of IRP_MJ_CREATE. I tried the
following code:
irpSp = IoGetNextIrpStackLocation(Irp);
irpSp->Parameters.Create.Options |= FILE_OPEN_REPARSE_POINT;
IoSkipCurrentIrpStackLocation( Irp );
return IoCallDriver( ((PSFILTER_DEVICE_EXTENSION)
DeviceObject->DeviceExtension)->AttachedToDeviceObject,
Irp );
But there is no any effect in the result.
Any suggestion is appreciated.

Shangwu


You are currently subscribed to ntfsd as: xxxxx@alfasp.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Kind regards, Dejan M. www.alfasp.com
E-mail: xxxxx@alfasp.com ICQ#: 56570367
Alfa File Monitor - File monitoring library for Win32 developers.
Alfa File Protector - File protection and hiding library for Win32 developers.

Thanks Dejan. The IFS Kit’s document misled me.

“Dejan Maksimovic” wrote in message news:xxxxx@ntfsd…
>
>
> Learn the IRP and stack location handling basics:-)
> If you need to change a parameter, use
IoCopyCurrentIrpStackLocationToNext
> instead of IoSkipCurrentIrpStackLocation - the second will nullify any
change
> you made to the stack location of yours.
>
> Shangwu Qi wrote:
>
> > Hi All,
> >
> > My filter driver needs to modify file open flags to add another flag
> > FILE_OPEN_REPARSE_POINT into the current IRP of IRP_MJ_CREATE. I tried
the
> > following code:
> > irpSp = IoGetNextIrpStackLocation(Irp);
> > irpSp->Parameters.Create.Options |= FILE_OPEN_REPARSE_POINT;
> > IoSkipCurrentIrpStackLocation( Irp );
> > return IoCallDriver( ((PSFILTER_DEVICE_EXTENSION)
> > DeviceObject->DeviceExtension)->AttachedToDeviceObject,
> > Irp );
> > But there is no any effect in the result.
> > Any suggestion is appreciated.
> >
> > Shangwu
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@alfasp.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> –
> Kind regards, Dejan M. www.alfasp.com
> E-mail: xxxxx@alfasp.com ICQ#: 56570367
> Alfa File Monitor - File monitoring library for Win32 developers.
> Alfa File Protector - File protection and hiding library for Win32
developers.
>
>
>
>
>
>
>
>

Yep, the 2K DDK is misleading on this…
See the online XP SP1 DDK Documentation at http://www.osr.com

Speaking of which the OSR’s online XP DDK site cannot display anything
over letter G in the Index section - a number of items limit maybe?


Kind regards, Dejan M. www.alfasp.com
E-mail: xxxxx@alfasp.com ICQ#: 56570367
Alfa File Monitor - File monitoring library for Win32 developers.
Alfa File Protector - File protection and hiding library for Win32 developers.