hi
I want to restrict save options for a file (e:\test.txt). so im returning
IRP_MJ_WRITE on that file as STATUS_ACCESS_DENIED.
Irp->IoStatus.Status = STATUS_ACCESS_DENIED;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_ACCESS_DENIED;
problem is when im opening the file in wordpad and trying to save the file
im getting access denied message and when i close the file and open it again
im loosing all the file data. Is there any thing i should do before
returning from write dispatch routine.
Regards,
VC
When IRP_MJ_WRITE comes, it is too late to deny it.
You must do it when IRP_MJ_CREATE with Write access
comes.
L.
thank you
so, if it is in the IRP_MJ_CREATE then i shoud check the
‘Parameters.Create.SecurityContext->DesiredAccess’ if it is opened with
write access and deny it?
“Ladislav Zezula” wrote in message news:xxxxx@ntfsd…
> When IRP_MJ_WRITE comes, it is too late to deny it.
> You must do it when IRP_MJ_CREATE with Write access
> comes.
>
> L.
>
> so, if it is in the IRP_MJ_CREATE then i shoud check the
‘Parameters.Create.SecurityContext->DesiredAccess’ if it is opened with
write access and deny it?
Exactly. It is up to you if you’ll check FILE_WRITE_DATA
only, or FILE_WRITE_EA, FILE_WRITE_ATTRIBUTES
or DELETE access too.
L.
Fail MJ_CREATE with proper DesiredAccess instead.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Vishnu P”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Monday, June 20, 2005 10:04 AM
Subject: [ntfsd] restrict IRP_MJ_WRITE
> hi
>
> I want to restrict save options for a file (e:\test.txt). so im returning
> IRP_MJ_WRITE on that file as STATUS_ACCESS_DENIED.
>
> Irp->IoStatus.Status = STATUS_ACCESS_DENIED;
> Irp->IoStatus.Information = 0;
> IoCompleteRequest( Irp, IO_NO_INCREMENT );
> return STATUS_ACCESS_DENIED;
>
> problem is when im opening the file in wordpad and trying to save the file
> im getting access denied message and when i close the file and open it again
> im loosing all the file data. Is there any thing i should do before
> returning from write dispatch routine.
>
> Regards,
> VC
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com