Hello all - Yet another newbie question:
When I get the first write Irp for a newly created file, I do a
CcInitializeCacheMap. I’m setting the pointer to CC_FILE_SIZES struct to
Fcb->Header.AllocationSize. BUT, first time through this value (and
ValidDataLength and FileSize) are set to zero.
Is this ok, or should I update these fields first with the file size about
to be written, then do the initialize?
Thanks - Greg
I think I’ve answered my own question. My FSD doesn’t use DCB’s so I
don’t know what the FirstClusterOfFile is (I have a user mode piece that
handles that and the FSD doesn’t know about it). So it looks like zero is
acceptable on the first write to the new file.
I hope this is right!
Thanks again anyway.
Greg
Hi Greg,
I don’t think you are doing it right. You should
set the allocation size (perform the actual
allocation) and then initialize the cache map.
(It doesn’t make sense to initialize the cache
map with zero allocation size, set the allocation size
in the FCB and then reset the allocation size - two
CcXXX calls instead of one.)
When ever the allocation/ file
size/ValidDataLength changes, be sure to update the
cache manager - CcSetFileSizes().
Manoj
— Greg Pearce wrote: > Hello all
- Yet another newbie question:
>
> When I get the first write Irp for a newly created
> file, I do a
> CcInitializeCacheMap. I’m setting the pointer to
> CC_FILE_SIZES struct to
> Fcb->Header.AllocationSize. BUT, first time through
> this value (and
> ValidDataLength and FileSize) are set to zero.
>
> Is this ok, or should I update these fields first
> with the file size about
> to be written, then do the initialize?
>
> Thanks - Greg
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
%%email.unsub%%
=====
-----------------------------------
Manoj Paul Joseph,
Master of Computer Applications (final year student),
School of Computer Science and Engineering,
Anna University,
Chennai (Madras),
India.
________________________________________________________________________
For live cricket scores download Yahoo! Score Tracker
at: http://in.sports.yahoo.com/cricket/tracker.html
Manoj,
Thanks for setting me straight on this. I’ve got this set up correctly
now. The problem has now progressed to an access violation after
CcCopyRead. I have another message here concerning it… if you have any
suggestions there too, I’d really appreciate it! The message is the one
that you’ve already seen about “CcCopyRead never returns”
Thanks a million - Greg