aasa2
驱动中牛
驱动中牛
  • 注册日期2004-04-01
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分525分
  • 威望339点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
阅读:2091回复:2

file_open_by_id

楼主#
更多 发布于:2005-03-18 14:55
在ntfs下,使用打开文件,这是我如何获得文件名呀?
技术交流:aasa2@21cn.com QQ群:10863699
zhangshengyu
驱动老牛
驱动老牛
  • 注册日期2003-10-03
  • 最后登录2016-07-26
  • 粉丝0
  • 关注0
  • 积分792分
  • 威望696点
  • 贡献值41点
  • 好评度499点
  • 原创分0分
  • 专家分0分
  • 社区居民
沙发#
发布于:2005-03-18 15:37
There doesnt have to be anything which queries the file id before the
IRP_MJ_CREATE. The application could have remembered the file id from a
previous uptime for example.

The file id for a named file can be retrieved with ZwQueryInformationFile
with FileInternalInformation class.

you can query AFTER the file is opened - you can do this during create

It is not always possible. CDFS also support open by FileID but doesn\'t
support query name for files opened by FileID.
NTFS on NT 4 doesn\'t support query file name for files opened by file id,
although W2K seems to support such requests.
Apparently the reason is that open by id bypasses directory structure so
path is unknown and need to constructed to satisfy query of the file name.


NTFS supports two different ids for a file: 64-bit that can be retrieved
by ZwQueryInformationFile and 128-bit ObjectId that can be retrived by
FSCTL_GET_OBJECT_ID or FSCTL_CREATE_OR_GET_OBJECT_ID or
ZwQueryInformationFile with FileObjectIdInformation class.
---内核开发合作或提供基础技术服务QQ:22863668 ---
gongbin_net
驱动牛犊
驱动牛犊
  • 注册日期2003-06-18
  • 最后登录2005-06-07
  • 粉丝1
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2005-03-18 17:56
看filemon的例子,那里有
游客

返回顶部