My filter driver is monitoring folder A and backup file that modified.
I want to trap IRP_MJ_WRITE and backup origin file to folder B.
But I fail re-opening the source file in the folder A before i send to
irp down to lower device.
I have modified the shareaccess flag. shareaccess |=FILE_SHARE_READ
Can anyone give me hands?
–
No one knows what tomorrow would be,
but I’ll do my best.
You could read the OSR IFS FAQ. ZwCreateFile with SYNCHRONIZE for
DesiredAcces and all the ShareAccess flags; roll your own IRP to read or
memory map.
Cheers
Lyndon
“Abc” wrote in message news:xxxxx@ntfsd…
> My filter driver is monitoring folder A and backup file that modified.
> I want to trap IRP_MJ_WRITE and backup origin file to folder B.
> But I fail re-opening the source file in the folder A before i send to
> irp down to lower device.
> I have modified the shareaccess flag. shareaccess |=FILE_SHARE_READ
>
> Can anyone give me hands?
>
> –
> No one knows what tomorrow would be,
> but I’ll do my best.
>
>
>
>
>
I’ve got a error when i try to open the file to read in my mj_create
routine.
STATUS_SHARING_VIOLATION. I try to change the shareaccess :
ntStatus=IoCheckShareAccess(FILE_READ_DATA|SYNCHRONIZE,
FILE_SHARE_READ,
IrpSp->FileObject,
&Access,
FALSE);
still, I got the same status code.
–
No one knows what tomorrow would be,
but I’ll do my best.
“Lyndon J Clarke” дÈëÏûÏ¢ÐÂÎÅ:xxxxx@ntfsd…
> You could read the OSR IFS FAQ. ZwCreateFile with SYNCHRONIZE for
> DesiredAcces and all the ShareAccess flags; roll your own IRP to read or
> memory map.
>
> Cheers
> Lyndon
>
> “Abc” wrote in message news:xxxxx@ntfsd…
> > My filter driver is monitoring folder A and backup file that modified.
> > I want to trap IRP_MJ_WRITE and backup origin file to folder B.
> > But I fail re-opening the source file in the folder A before i send to
> > irp down to lower device.
> > I have modified the shareaccess flag. shareaccess |=FILE_SHARE_READ
> >
> > Can anyone give me hands?
> >
> > –
> > No one knows what tomorrow would be,
> > but I’ll do my best.
> >
> >
> >
> >
> >
>
>
>
Did you ZwCreateFile like this?
status = ZwCreateFile(
&FileHandle,
SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_OPEN,
0,
NULL,
0);
“Abc” wrote in message news:xxxxx@ntfsd…
> I’ve got a error when i try to open the file to read in my mj_create
> routine.
> STATUS_SHARING_VIOLATION. I try to change the shareaccess :
> ntStatus=IoCheckShareAccess(FILE_READ_DATA|SYNCHRONIZE,
> FILE_SHARE_READ,
> IrpSp->FileObject,
> &Access,
> FALSE);
> still, I got the same status code.
>
> –
> No one knows what tomorrow would be,
> but I’ll do my best.
> “Lyndon J Clarke” дÈëÏûÏ¢ÐÂÎÅ:xxxxx@ntfsd…
> > You could read the OSR IFS FAQ. ZwCreateFile with SYNCHRONIZE for
> > DesiredAcces and all the ShareAccess flags; roll your own IRP to read or
> > memory map.
> >
> > Cheers
> > Lyndon
> >
> > “Abc” wrote in message news:xxxxx@ntfsd…
> > > My filter driver is monitoring folder A and backup file that
modified.
> > > I want to trap IRP_MJ_WRITE and backup origin file to folder B.
> > > But I fail re-opening the source file in the folder A before i send to
> > > irp down to lower device.
> > > I have modified the shareaccess flag. shareaccess |=FILE_SHARE_READ
> > >
> > > Can anyone give me hands?
> > >
> > > –
> > > No one knows what tomorrow would be,
> > > but I’ll do my best.
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
This is dumb. If the file is not openable owing to sharing violations, doing
a backup is not going to guarantee that the file is consistent.
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abc
Sent: Friday, April 16, 2004 5:13 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Monitoring a folder & Backuping
I’ve got a error when i try to open the file to read in my mj_create
routine.
STATUS_SHARING_VIOLATION. I try to change the shareaccess :
ntStatus=IoCheckShareAccess(FILE_READ_DATA|SYNCHRONIZE,
FILE_SHARE_READ,
IrpSp->FileObject,
&Access,
FALSE);
still, I got the same status code.
–
No one knows what tomorrow would be,
but I’ll do my best.
“Lyndon J Clarke” д???Ϣ???:xxxxx@ntfsd…
> You could read the OSR IFS FAQ. ZwCreateFile with SYNCHRONIZE for
> DesiredAcces and all the ShareAccess flags; roll your own IRP to read or
> memory map.
>
> Cheers
> Lyndon
>
> “Abc” wrote in message news:xxxxx@ntfsd…
> > My filter driver is monitoring folder A and backup file that modified.
> > I want to trap IRP_MJ_WRITE and backup origin file to folder B.
> > But I fail re-opening the source file in the folder A before i send to
> > irp down to lower device.
> > I have modified the shareaccess flag. shareaccess |=FILE_SHARE_READ
> >
> > Can anyone give me hands?
> >
> > –
> > No one knows what tomorrow would be,
> > but I’ll do my best.
> >
> >
> >
> >
> >
>
>
>
—
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
Consistent with what …? Hmm … different questions …
“Jamey Kirby” wrote in message news:xxxxx@ntfsd…
This is dumb. If the file is not openable owing to sharing violations, doing
a backup is not going to guarantee that the file is consistent.
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abc
Sent: Friday, April 16, 2004 5:13 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Monitoring a folder & Backuping
I’ve got a error when i try to open the file to read in my mj_create
routine.
STATUS_SHARING_VIOLATION. I try to change the shareaccess :
ntStatus=IoCheckShareAccess(FILE_READ_DATA|SYNCHRONIZE,
FILE_SHARE_READ,
IrpSp->FileObject,
&Access,
FALSE);
still, I got the same status code.
–
No one knows what tomorrow would be,
but I’ll do my best.
“Lyndon J Clarke” дÈëÏûÏ¢ÐÂÎÅ:xxxxx@ntfsd…
> You could read the OSR IFS FAQ. ZwCreateFile with SYNCHRONIZE for
> DesiredAcces and all the ShareAccess flags; roll your own IRP to read or
> memory map.
>
> Cheers
> Lyndon
>
> “Abc” wrote in message news:xxxxx@ntfsd…
> > My filter driver is monitoring folder A and backup file that modified.
> > I want to trap IRP_MJ_WRITE and backup origin file to folder B.
> > But I fail re-opening the source file in the folder A before i send to
> > irp down to lower device.
> > I have modified the shareaccess flag. shareaccess |=FILE_SHARE_READ
> >
> > Can anyone give me hands?
> >
> > –
> > No one knows what tomorrow would be,
> > but I’ll do my best.
> >
> >
> >
> >
> >
>
>
>
—
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
Well, if someone has the file open for exclusive access, this means that
they may be updating the file. So, let’s say you bypass the sharing and
allow your filter to open the file so you can back it up…
- Backup application reads first 10000 bytes of the file
- Other application writes to the last 10000 bytes of the file
- Backup application backs up the last 10000 bytes of the file
Now, the file is not consistent. The state of the file has changed while you
are backing it up. This is the whole reason Microsoft created ShadowCopy
(VSS).
If it were possible to do what you wanted to do reliably, don’t you think
all backup applications would do this to subvert protection? Subversion is
the key here. You can not simply subvert sharing and locking to make hot
backups. It is far more complex than that.
Have a look at products like:
- Open File Manager (www.stbernard.com)
- Volume Snapshot (www.storagecraft.com)
- Open Transaction Manager (www.cdp.com)
- Microsoft’s Shadow Copy architecture (www.microsoft.com)
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Lyndon J Clarke
Sent: Friday, April 16, 2004 11:38 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Monitoring a folder & Backuping
Consistent with what …? Hmm … different questions …
“Jamey Kirby” wrote in message news:xxxxx@ntfsd…
This is dumb. If the file is not openable owing to sharing violations, doing
a backup is not going to guarantee that the file is consistent.
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abc
Sent: Friday, April 16, 2004 5:13 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Monitoring a folder & Backuping
I’ve got a error when i try to open the file to read in my mj_create
routine.
STATUS_SHARING_VIOLATION. I try to change the shareaccess :
ntStatus=IoCheckShareAccess(FILE_READ_DATA|SYNCHRONIZE,
FILE_SHARE_READ,
IrpSp->FileObject,
&Access,
FALSE);
still, I got the same status code.
–
No one knows what tomorrow would be,
but I’ll do my best.
“Lyndon J Clarke” д???Ϣ???:xxxxx@ntfsd…
> You could read the OSR IFS FAQ. ZwCreateFile with SYNCHRONIZE for
> DesiredAcces and all the ShareAccess flags; roll your own IRP to read or
> memory map.
>
> Cheers
> Lyndon
>
> “Abc” wrote in message news:xxxxx@ntfsd…
> > My filter driver is monitoring folder A and backup file that modified.
> > I want to trap IRP_MJ_WRITE and backup origin file to folder B.
> > But I fail re-opening the source file in the folder A before i send to
> > irp down to lower device.
> > I have modified the shareaccess flag. shareaccess |=FILE_SHARE_READ
> >
> > Can anyone give me hands?
> >
> > –
> > No one knows what tomorrow would be,
> > but I’ll do my best.
> >
> >
> >
> >
> >
>
>
>
—
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
—
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
Jamey
I am well eough aware of all of these issues working in similar space!
It is of course possible for the file to be open for read just read but not
‘shared’. It seems to be quite a normal situation. I think the ‘backup’ is
then consistent as described. In addition its not always essential for the
‘backup’ to be consistent as described.
The OP asked a narrow question I hope we gave a useful narrow answer and
pointers to the broader picture.
Cheers
Lyndon
“Jamey Kirby” wrote in message news:xxxxx@ntfsd…
Well, if someone has the file open for exclusive access, this means that
they may be updating the file. So, let’s say you bypass the sharing and
allow your filter to open the file so you can back it up…
- Backup application reads first 10000 bytes of the file
- Other application writes to the last 10000 bytes of the file
- Backup application backs up the last 10000 bytes of the file
Now, the file is not consistent. The state of the file has changed while you
are backing it up. This is the whole reason Microsoft created ShadowCopy
(VSS).
If it were possible to do what you wanted to do reliably, don’t you think
all backup applications would do this to subvert protection? Subversion is
the key here. You can not simply subvert sharing and locking to make hot
backups. It is far more complex than that.
Have a look at products like:
- Open File Manager (www.stbernard.com)
- Volume Snapshot (www.storagecraft.com)
- Open Transaction Manager (www.cdp.com)
- Microsoft’s Shadow Copy architecture (www.microsoft.com)
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Lyndon J Clarke
Sent: Friday, April 16, 2004 11:38 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Monitoring a folder & Backuping
Consistent with what …? Hmm … different questions …
“Jamey Kirby” wrote in message news:xxxxx@ntfsd…
This is dumb. If the file is not openable owing to sharing violations, doing
a backup is not going to guarantee that the file is consistent.
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abc
Sent: Friday, April 16, 2004 5:13 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Monitoring a folder & Backuping
I’ve got a error when i try to open the file to read in my mj_create
routine.
STATUS_SHARING_VIOLATION. I try to change the shareaccess :
ntStatus=IoCheckShareAccess(FILE_READ_DATA|SYNCHRONIZE,
FILE_SHARE_READ,
IrpSp->FileObject,
&Access,
FALSE);
still, I got the same status code.
–
No one knows what tomorrow would be,
but I’ll do my best.
“Lyndon J Clarke” дÈëÏûÏ¢ÐÂÎÅ:xxxxx@ntfsd…
> You could read the OSR IFS FAQ. ZwCreateFile with SYNCHRONIZE for
> DesiredAcces and all the ShareAccess flags; roll your own IRP to read or
> memory map.
>
> Cheers
> Lyndon
>
> “Abc” wrote in message news:xxxxx@ntfsd…
> > My filter driver is monitoring folder A and backup file that modified.
> > I want to trap IRP_MJ_WRITE and backup origin file to folder B.
> > But I fail re-opening the source file in the folder A before i send to
> > irp down to lower device.
> > I have modified the shareaccess flag. shareaccess |=FILE_SHARE_READ
> >
> > Can anyone give me hands?
> >
> > –
> > No one knows what tomorrow would be,
> > but I’ll do my best.
> >
> >
> >
> >
> >
>
>
>
—
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
—
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