阅读:1104回复:5
CCB 结构有人用过否?
定义如下:
typedef struct _SFsdContextControlBlock { SFsdldentifier Nodeldentifier; struct _SFsdFileControlBlock *ptrFCB; LIST_ENTRY NextCCB; PFILE_OBJECT ptrFileOBject; uint32 CCBFlags; LARGE_INTEGER CurrentByteOffset; PSTRING DirectorySearchPattern; uint32 UserSpecifiedTime; }SFsdCCB, *PtrSFsdCCB; 这个参数能是及时的当前文件偏移吗? LARGE_INTEGER CurrentByteOffset; |
|
|
沙发#
发布于:2007-10-17 11:04
A FSD has its own private CCB structure defined for internal use only. I'm talking about CCB structure definition here, not instance of the structure. There's no common CCB structure defined for all FSDs. Private cache map is per file based, not per FSD. |
|
板凳#
发布于:2007-10-17 09:05
1, A FSD has its own private CCB structure defined for internal use only.
这句话好像不对吧? 每个FSD都有个有private cache map 但好像每个FileObject都对应一个CCB 2,在usermode 进程中的handle有文件偏移的概念, 到kernelmode 这个偏移为什么很难得到呢? irp无法保存的原因? Cache的原因? 上层的请请求先发送到cahce管理器, 若cache被清会引发一个页错误,这时到我们驱动 如何截获paging I/O 的偏移参数? |
|
|
地板#
发布于:2007-10-16 23:37
The SFsdContextControlBlock structure you showed here is just a sample CCB definition from the book. A FSD has its own private CCB structure defined for internal use only.
"在读操作中请求Irp中的CurrentByteOffset 值为0, 这个CCB结构与irp参数相关吗?" Most likely yes. But no Microsoft document guarantees it. "irp 与 fileobject 都不是线程相关的。这样有些线程相关的参数就无法保存, ccb的存在是不是为了补充它" I understand it in a different way. FileObject and CCB are used to keep status of file operations. When you see it from user mode, since file is operated based on file handle which is process based, it is in fact both structures keep status based on process . But this is not true when you see it from kernel mode. |
|
地下室#
发布于:2007-10-16 16:53
大家来看下我的理解, irp 与 fileobject 都不是线程相关的。这样有些线程相关的参数就无法保存, ccb的存在是不是为了补充它?
文件开发内幕有一句话: As an example, the CCB could be used t o maintain information about byte-range locks requested by a thread using particular file object! |
|
|
5楼#
发布于:2007-10-16 16:25
在读操作中请求Irp中的CurrentByteOffset 值为0, 这个CCB结构与irp参数相关吗?
|
|
|