hi all ,
i am trying to use fileindex parameter of IRP_MJ_DIRECTORYCONTROL i filter the IRP_MJ_DIRECTORYCONTROL and generate my own irp i specify SL_INDEX_SPECIFIED in the callback data i process 10 files at a time i want to know how does the IRP_MJ_DIRECTORYCONTROL know that the request has been serviced for 10 and it has to take care of files after the index value.`
This seems to confuse two issues - first, what are index values and how are they used and second, how does the FSD remember where you are in an iterative enumeration.
Index values are arbitrary values assigned by the FSD to a specific entry. If someone wishes to perform enumeration from a specific entry forward, they pass in the index value. This is a VERY rarely used mechanism (the native API call doesn’t support it) but it is used by VDM (e.g., 16-bit MS-DOS) and is available via the IRP interface. If you specify an index value, the FSD looks through the list of entries and starts searching at the given index value. The index value is RETURNED in the directory entry, which is how the caller gets it in the first place.
Enumeration context is generally stored by the FSD in an FSD-defined data structure found via the FsContext2 pointer. Since that is normally bound to the specific open instance (FILE_OBJECT) it isn’t shared between open instances of the directory. Sometimes you will hear people call this the “CCB” but that name is really arbitrary.
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
Thanks a lot Tony,
Actually what i have tried regarding fileindex didnt work out.what i was doing was incrementing fileindex after processing one file and i was processing 10 files at a time but what i saw was when the next request came in it started from the initial fileindex set .so finally i had to suspend this approach .now the condition with me is as follows…
what i actually do is that i get a directory buffer of IRP_MJ_DIRECTORYCONTROL (querydirectory.buffer) filled with names of files i am going to display to the user the size of this system buffer i s 4096 bytes and what i do is that i am required to change the filled names(they are actually short names, our convention of names physically stored onto disk to be particular) in the buffer with the actual names that is to be displayed to user.the names inside a directory are quite large and i am processing 10 files at a time ,the point at which the system buffer gets filled i break out of the loop in order to avoid system crash i am looking for a way to either accomadate these large names or something else that is feasible.
Thanks
Sankalp
hi ,
i have one more query can the enumeration context maintained by FSD manipulated ,like in my case i process 10 files at a time and suppose in next go i can process only 5 more before the system buffer got filled , but files were actually 10 in the next batch can i notify this info to the FSD and context can be manipulated so that next request comes from the 6 th file and not for the whole lot of 10 files while i am processing the next 10 files batch.