hamham
驱动牛犊
驱动牛犊
  • 注册日期2001-08-03
  • 最后登录2004-12-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:992回复:1

如何判断打开的文件方式?(只读?读写?)

楼主#
更多 发布于:2002-10-31 07:37
可以从IRP里看出吗?
水, 生命之源...
blue
驱动大牛
驱动大牛
  • 注册日期2001-04-25
  • 最后登录2010-10-15
  • 粉丝0
  • 关注0
  • 积分55分
  • 威望12点
  • 贡献值0点
  • 好评度4点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2002-10-31 13:32
你是指文件的打开方式而不是设备吧。
对于文件,你可查看IRP_MJ_CREATE
IrpSp=IoGetCurrentIrpStackLocation(Irp);
IrpSp->Parameters.Create.SecurityContext->DesiredAccess
这是个 ACCESS_MASK 结构,表明了对此文件的权限。
此结构详细内容如下:

DELETE The file can be deleted.
FILE_READ_DATA Data can be read from the file.
FILE_READ_ATTRIBUTES FileAttributes flags, described later, can be read.
FILE_READ_EA Extended attributes associated with the file can be read. This flag is irrelevant to device and intermediate drivers.
READ_CONTROL The access control list (ACL) and ownership information associated with the file can be read.
FILE_WRITE_DATA  Data can be written to the file.
FILE_WRITE_ATTRIBUTES FileAttributes flags can be written.
FILE_WRITE_EA Extended attributes (EAs) associated with the file can be written. This flag is irrelevant to device and intermediate drivers.
FILE_APPEND_DATA Data can be appended to the file.
WRITE_DAC  The discretionary access control list (DACL) associated with the file can be written.
WRITE_OWNER  Ownership information associated with the file can be written.
SYNCHRONIZE The returned FileHandle can be waited on to synchronize with the completion of an I/O operation.
FILE_EXECUTE Data can be read into memory from the file using system paging I/O. This flag is irrelevant to device and intermediate drivers.
游客

返回顶部