abc13271552
驱动小牛
驱动小牛
  • 注册日期2007-08-13
  • 最后登录2023-12-05
  • 粉丝0
  • 关注0
  • 积分34分
  • 威望552点
  • 贡献值0点
  • 好评度160点
  • 原创分0分
  • 专家分0分
  • 社区居民
阅读:1104回复:5

CCB 结构有人用过否?

楼主#
更多 发布于:2007-10-16 16:21
定义如下:
 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;


 
驱网无线,快乐无限
michaelgz
论坛版主
论坛版主
  • 注册日期2005-01-26
  • 最后登录2012-10-22
  • 粉丝1
  • 关注1
  • 积分150分
  • 威望1524点
  • 贡献值1点
  • 好评度213点
  • 原创分0分
  • 专家分2分
沙发#
发布于:2007-10-17 11:04
A FSD has its own private CCB structure defined for internal use only.
   这句话好像不对吧? 每个FSD都有个有private cache map
   但好像每个FileObject都对应一个CCB


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.
abc13271552
驱动小牛
驱动小牛
  • 注册日期2007-08-13
  • 最后登录2023-12-05
  • 粉丝0
  • 关注0
  • 积分34分
  • 威望552点
  • 贡献值0点
  • 好评度160点
  • 原创分0分
  • 专家分0分
  • 社区居民
板凳#
发布于: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 的偏移参数?
驱网无线,快乐无限
michaelgz
论坛版主
论坛版主
  • 注册日期2005-01-26
  • 最后登录2012-10-22
  • 粉丝1
  • 关注1
  • 积分150分
  • 威望1524点
  • 贡献值1点
  • 好评度213点
  • 原创分0分
  • 专家分2分
地板#
发布于: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.
abc13271552
驱动小牛
驱动小牛
  • 注册日期2007-08-13
  • 最后登录2023-12-05
  • 粉丝0
  • 关注0
  • 积分34分
  • 威望552点
  • 贡献值0点
  • 好评度160点
  • 原创分0分
  • 专家分0分
  • 社区居民
地下室#
发布于: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!
驱网无线,快乐无限
abc13271552
驱动小牛
驱动小牛
  • 注册日期2007-08-13
  • 最后登录2023-12-05
  • 粉丝0
  • 关注0
  • 积分34分
  • 威望552点
  • 贡献值0点
  • 好评度160点
  • 原创分0分
  • 专家分0分
  • 社区居民
5楼#
发布于:2007-10-16 16:25
在读操作中请求Irp中的CurrentByteOffset 值为0, 这个CCB结构与irp参数相关吗?
驱网无线,快乐无限
游客

返回顶部