Race condition at Dispatch Create

I have a race condition in my minifilter driver related to backup and restore of file and folder level.
in my precreate once i get FILE_CREATED i am setting a header to newly created file but meanwhile
in the course of writing header a FILE_OPENED is coming in which i am trying to read the file.

with the help of rich copy tool i am able to reproduce the same.tried to synchronize them using
lock like recourse and also test with event object but on multiprocessor system the copy operation
just deleting the files.

How to make synchronization b/w them any help will be greatly appreciated.

Hoping a positive response.

Thanks a lot.

try to use spinlock or fastmutex.


?H???: xxxxx@lists.osr.com ?N?? xxxxx@gmail.com
?H???: 2016?~2??4?? ?U?? 07:06
???: Windows System Software Devs Interest List
?D??: [ntdev] Race condition at Dispatch Create

I have a race condition in my minifilter driver related to backup and restore of file and folder level.
in my precreate once i get FILE_CREATED i am setting a header to newly created file but meanwhile
in the course of writing header a FILE_OPENED is coming in which i am trying to read the file.

with the help of rich copy tool i am able to reproduce the same.tried to synchronize them using
lock like recourse and also test with event object but on multiprocessor system the copy operation
just deleting the files.

How to make synchronization b/w them any help will be greatly appreciated.

Hoping a positive response.

Thanks a lot.


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>

In preCreate I doubt you can get FILE_CREATED or FILE_OPENED. I guess that
is just during PostCreate.
You can definitely sync with Resources you don’t need spinlocks or anything
like that.
Just acquire a resource that is related to a stream that you’re trying to
backup/restore.
What you are describing is just too vague to tell if that would fix it or
not, but I think it would .
BTW are you using are StreamCOntexts/StreamHandleContexts ?

Gabriel

On Thu, Feb 4, 2016 at 12:11 PM, dl CU wrote:

> try to use spinlock or fastmutex.
>
> ________________________________________
> 寄件者: xxxxx@lists.osr.com <
> xxxxx@lists.osr.com> 代表 xxxxx@gmail.com <
> xxxxx@gmail.com>
> 寄件日期: 2016年2月4日 下午 07:06
> 收件者: Windows System Software Devs Interest List
> 主旨: [ntdev] Race condition at Dispatch Create
>
> I have a race condition in my minifilter driver related to backup and
> restore of file and folder level.
> in my precreate once i get FILE_CREATED i am setting a header to newly
> created file but meanwhile
> in the course of writing header a FILE_OPENED is coming in which i am
> trying to read the file.
>
> with the help of rich copy tool i am able to reproduce the same.tried to
> synchronize them using
> lock like recourse and also test with event object but on multiprocessor
> system the copy operation
> just deleting the files.
>
> How to make synchronization b/w them any help will be greatly appreciated.
>
> Hoping a positive response.
>
> Thanks a lot.
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>


Bercea. G.</http:></http:>