As i explained in my previous posts, i’ve to copy a file in a pre-rename
op.
I’ve decided to use a (NT) FileCopy from a service (my minifilter send
it the source file name an the destination), but when the FileCopy try
to open the source file, filemon tell me that this return a sharing
violation error.
There is a way to change the source fileobject’s sharing permission in
order to open the file from FileCopy?
If I open the file from user space with FILE_SHARE_READ |
FILE_SHARE_WRITE | FILE_SHARE_DELETE I get a valid handle.
Thank’s a lot
It’s because during the rename, the file is already open
by the renaming API.
L.
----- Original Message -----
From: Gian-luca Tenti
To: Windows File Systems Devs Interest List
Sent: Monday, May 15, 2006 9:32 AM
Subject: [ntfsd] Change Sharing status of a file object
As i explained in my previous posts, i’ve to copy a file in a pre-rename op.
I’ve decided to use a (NT) FileCopy from a service (my minifilter send it the source file name an the destination), but when the FileCopy try to open the source file, filemon tell me that this return a sharing violation error.
There is a way to change the source fileobject’s sharing permission in order to open the file from FileCopy?
If I open the file from user space with FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE I get a valid handle.
Thank’s a lot
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Ok,
Now I’m able to copy the file :
-
before send the request of copy to the service, I insert into a list the name of the source file
-
In the precreate I check if the open is made from the service and if so, I check the list to find the file name that’s is being open.
-
If item exist (so the FileCopy is opening the source file) I change the sharing permission and I set the SHARE_DELETE flag)
-
When the call to the service return I free the list from the item createn at 1
This works fine but I’l prefer to change (temporally) the source file object’s sharing permission from the driver.
There’s no way to do this?
PS: the FileCopy API (win2003) open the source file first with FILE_SHARED_READ then (if the first fail) with (FILE_SHARED_READ | FILE_SHARED_WRITE) but not with FILE_SHARED_DELETE (and this is the problem)
Thank’s Ladislav
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: luned? 15 maggio 2006 9.58
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Change Sharing status of a file object
It’s because during the rename, the file is already open
by the renaming API.
L.
----- Original Message -----
From: Gian-luca Tenti mailto:xxxxx
To: Windows File Systems Devs Interest List mailto:xxxxx
Sent: Monday, May 15, 2006 9:32 AM
Subject: [ntfsd] Change Sharing status of a file object
As i explained in my previous posts, i’ve to copy a file in a pre-rename op.
I’ve decided to use a (NT) FileCopy from a service (my minifilter send it the source file name an the destination), but when the FileCopy try to open the source file, filemon tell me that this return a sharing violation error.
There is a way to change the source fileobject’s sharing permission in order to open the file from FileCopy?
If I open the file from user space with FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE I get a valid handle.
Thank’s a lot
—
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com</mailto:xxxxx></mailto:xxxxx>