How PrivateCacheMap of FILE_OBJECT looks like?

Hi dear all,
I’m not sure how to setup PrivateCacheMap member of _FILE_OBJECT. Does it has any system implied requirements on it ? I mean something like that FCB must be started with a FSRTL_ADVANCED_FCB_HEADER. Many thanks!

You set up SectionObjectPointers (along with FsContext, FsContext2) and you call CcInitalizeCacheMap at the appropriate time. Cc worries about all the rest.

The FAT example shows how to do all this

thank you. I’ll try it. This doc confused me which states that this field is setup by FSD.

@yu_shang said:
thank you. I’ll try it. This doc confused me which states that this field is setup by FSD.

You didn’t specify what type of driver you have, but the file system does own the FsContext, FsContext2, SOP, etc. If you have a normal filter (i.e. not a layered file system in a filter) then you shouldn’t be setting these fields. As Rod pointed out, FAT does this, but of course it is a file system.

You didn’t specify what type of driver you have
If in the context of FSD, does this mean FSD must set PrivateCacheMap up ? how ?
BTW I’ve reviewed the fastfat example , found no where it will setup PrivateCacheMap.

CcInitializeCacheMap set that field.

@“Scott_Noone_(OSR)” said:
CcInitializeCacheMap set that field.

Thank you. To be a proficient driver developer. I have to debug a lot. It’s really boring :smiley: .

A Windows file system is a significant undertaking (years not months). Patience is key and assume that anything you write in the first 6-9 months will probably be just a learning exercise. Good luck!