zhjie374
驱动小牛
驱动小牛
  • 注册日期2004-10-27
  • 最后登录2012-01-17
  • 粉丝2
  • 关注1
  • 积分17分
  • 威望144点
  • 贡献值1点
  • 好评度21点
  • 原创分0分
  • 专家分0分
阅读:1661回复:5

如何在驱动中读取、设置文件属性?

楼主#
更多 发布于:2005-06-01 13:51
比如摘要里面的版本号、作者信息等等。
如何修改,哪个IRP中哪个结构表示了这个东西?还是说,有ZW系列函数可以做这个事情?

谢谢。
idaxsy
驱动大牛
驱动大牛
  • 注册日期2004-12-09
  • 最后登录2006-03-17
  • 粉丝0
  • 关注0
  • 积分386分
  • 威望54点
  • 贡献值0点
  • 好评度8点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2005-06-28 13:37
做个索引吧。效果好象也不是太理想。
[b]万水千山总是情,回个帖子行不行?[/b]
zhjie374
驱动小牛
驱动小牛
  • 注册日期2004-10-27
  • 最后登录2012-01-17
  • 粉丝2
  • 关注1
  • 积分17分
  • 威望144点
  • 贡献值1点
  • 好评度21点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2005-06-02 13:47
借系统的标志不是一个好方法,因为1 我们要兼容所有的文件系统.2 如果用户也使用NTFS的这个特性呢?还是判断不出.

到目前看下来,对每一个目录建立一个表,把加密文件的全路径保存下来是一个可行的方法.但是就是效率问题.在处理这个问题上我没有信心..

michaelgz
论坛版主
论坛版主
  • 注册日期2005-01-26
  • 最后登录2012-10-22
  • 粉丝1
  • 关注1
  • 积分150分
  • 威望1524点
  • 贡献值1点
  • 好评度213点
  • 原创分0分
  • 专家分2分
地板#
发布于:2005-06-02 11:44
There are many ways to mark a file as encrypted. For example, under NTFS, the EFS encryption attribute flag can be borrowed. Somebody used a local database to keep file names. I remember one guy in this forum created a hash table. Unfortunatelly there isn\'t a generic way.

To append additional information to a file, either as header or trailer, is not easy. You have to change file size accordingly and make the changes transparent to user mode applications. This is one of the most difficult work in FSD development. Tony (hope you know who is this guy) used to told me he never saw a FSD changing file size correctly under all conditions. This approach is the last solution I recommend. Actually I don\'t recommend it at all.

But sometimes as developers, we don\'t have other choices, do we. :) Basically, if you really want to add additional data into a file, to my experience, trailer is a little bit easier than header. Your FSD has to intercept at least MJ_CREATE, MJ_READ, MJ_WRITE, MJ_SET_INFORMATION, MJ_QUERY_INFORMATION, MJ_QUERY_DIRECTORY_INFO. The book \"Windows NT File System Internals : A Developer\'s Guide\" is a good start. (Hope you can find this book)
zhjie374
驱动小牛
驱动小牛
  • 注册日期2004-10-27
  • 最后登录2012-01-17
  • 粉丝2
  • 关注1
  • 积分17分
  • 威望144点
  • 贡献值1点
  • 好评度21点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2005-06-02 10:03
你说的我知道了。摘要信息不太好拿出来,而且文件与文件之间的摘要结构是不一样的。
所以,现在我放弃这个想法了。

顺便问一下:在文件开头加东西是很难的,要变大小和偏移量。那么在文件最后加标记呢?是不是好一点??

谢谢
michaelgz
论坛版主
论坛版主
  • 注册日期2005-01-26
  • 最后登录2012-10-22
  • 粉丝1
  • 关注1
  • 积分150分
  • 威望1524点
  • 贡献值1点
  • 好评度213点
  • 原创分0分
  • 专家分2分
5楼#
发布于:2005-06-02 00:24
Basic file attribute can be accessed using: ZwQueryInformationFile() and ZwSetInformationFile()

with following structures:
    FileAttributeTagInformation
    FileBasicInformation
    FileNameInformation
    FileStandardInformation
    ....

But the attributes such as version, author you mentioned cannot be accessed by the aboved functions and structures. They are located in a seperate named file stream: Summary Information.

游客

返回顶部