CcinitialiseCacheMap

hello,
I have a problem that when i call CcinitialiseCacheMap() function in mini-filter driver control goes to pre operation of IRP_MJ_CLOSE. Why it is so? I m not getting it.

Also what is purpose of user defined functions in structure CACHE_MANAGER_CALLBACK? I know they are used for synchronisation purpose by lazy writer but what this means exactly?
Thanking in advance.

Hi Varun,

I have a problem that when i call CcinitialiseCacheMap() function
in mini-filter driver control goes to pre operation of IRP_MJ_CLOSE.
Why it is so? I m not getting it.

Is it coming for the same file object for which you are calling CcInitializeCacheMap. I don’t think it should.
However, it can come for some other file object.
Consider a situation in which you decide to cache a file by calling CcInitializeCacheMap. The cache manager tries to optimize the memory usage and hence decides to stop the caching of an old file which does not have any handle opened. When this happens, you will see a Close for this file object in your minifilter.

Regards,
Ayush Gupta

> I have a problem that when i call CcinitialiseCacheMap() function in

mini-filter driver control goes to pre operation of IRP_MJ_CLOSE.
I m not getting it.

The answer is - the last shared cache map was closed and the file object
used for backing the cache was dereferenced, this was the last reference and
the system sent the CLOSE request. That is all.
You decided to play with the cache in the filter and made the system
behaviour unpredictable.


Slava Imameyev, xxxxx@hotmail.com

wrote in message news:xxxxx@ntfsd…
> hello,
> I have a problem that when i call CcinitialiseCacheMap() function in
> mini-filter driver control goes to pre operation of IRP_MJ_CLOSE. Why it
> is so? I m not getting it.
>
> Also what is purpose of user defined functions in structure
> CACHE_MANAGER_CALLBACK? I know they are used for synchronisation purpose
> by lazy writer but what this means exactly?
> Thanking in advance.
>

> The answer is - the last shared cache map was closed

“Last private”. Shared cache map is 1 and only 1 per FCB.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com