szscz
驱动牛犊
驱动牛犊
  • 注册日期2002-02-03
  • 最后登录2002-03-15
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1984回复:6

ifskit 的问题:我只想得到文件的创建信息.

楼主#
更多 发布于:2001-06-22 17:29
ifskit 的问题:我只想得到文件的创建信息.(大侠一定要帮忙)

但是由于创建和打开文件都是得到IFSFN_OPEN,我无法区分到底是
打开还是新建.

大侠帮忙.

最新喜欢:

znsoftznsoft
playguy
驱动牛犊
驱动牛犊
  • 注册日期2002-04-04
  • 最后登录2005-08-24
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2002-06-05 11:32
IOREQ->ir_options:

Value Meaning
ACTION_CREATENEW Create a new file. Fail if the file already exists.
ACTION_CREATEALWAYS Create a new file. If the file already exists open it and set its new length and attributes.
ACTION_OPENEXISTING Open an existing file. Fail if the file does not exist.
ACTION_OPENALWAYS Open an existing file. If the file does not exist, create a new file.
ACTION_REPLACEEXISTING Open an existing file and set its new length. Fail if the file does not exists.
Tom_lyd
驱动大牛
驱动大牛
  • 注册日期2001-09-02
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望1点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2002-06-05 13:36
IOREQ->ir_options:

Value Meaning
ACTION_CREATENEW Create a new file. Fail if the file already exists.
ACTION_CREATEALWAYS Create a new file. If the file already exists open it and set its new length and attributes.
ACTION_OPENEXISTING Open an existing file. Fail if the file does not exist.
ACTION_OPENALWAYS Open an existing file. If the file does not exist, create a new file.
ACTION_REPLACEEXISTING Open an existing file and set its new length. Fail if the file does not exists.
 


你是在哪时判断这些信息的?
Tom_lyd
zdhe
驱动太牛
驱动太牛
  • 注册日期2001-12-26
  • 最后登录2018-06-02
  • 粉丝0
  • 关注0
  • 积分72362分
  • 威望362260点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
地板#
发布于:2002-06-05 19:30
9x?

in create phase, check pioreq->ir_options.
the best is also check return value.

then remember it. when in read,you can peek data you hold in create phase.
guardee
驱动巨牛
驱动巨牛
  • 注册日期2002-11-08
  • 最后登录2010-05-29
  • 粉丝2
  • 关注1
  • 积分2分
  • 威望34点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2002-06-05 21:40
在DDK上面有啊!估计是没有好好看DDK的帮助了!
IRP_MJ_CREATE
When Sent
The I/O Manager sends this request when a file, device, directory, or volume is being opened or created. Normally this IRP is sent on behalf of a user-mode application that has called a Microsoft Win32? function such as CreateFile or a kernel-mode component that has called IoCreateFile, ZwCreateFile, or ZwOpenFile. If the create request is completed successfully, the application or kernel-mode component receives a handle to the file object.

Operation: File System Drivers
If the target device object is the file system\'s control device object, the file system driver\'s dispatch routine must complete the IRP and return an appropriate NTSTATUS value, after setting Irp->IoStatus.Status and Irp->IoStatus.Information to appropriate values.

Otherwise, the file system driver should process the create request.

Operation: File System Filter Drivers
If the target device object is the filter driver\'s control device object, the filter driver\'s dispatch routine must complete the IRP and return an appropriate NTSTATUS value, after setting Irp->IoStatus.Status and Irp->IoStatus.Information to appropriate values.

Otherwise, the filter driver should perform any needed processing and, depending on the nature of the filter, either complete the IRP or pass it down to the next lower driver on the stack.

Generally, filter drivers should not return STATUS_PENDING in response to IRP_MJ_CREATE. However, if a lower-level driver returns STATUS_PENDING, the filter driver should pass this status value up the driver chain.

Parameters
A file system or filter driver calls IoGetCurrentIrpStackLocation with the given IRP to get a pointer to its own stack location in the IRP, shown in the following list as IrpSp. (The IRP is shown as Irp.) The driver can use the information set in the following members of the IRP and the IRP stack location in processing a create request:

DeviceObject
Pointer to the target device object.
Irp->AssociatedIrp.SystemBuffer
Pointer to a FILE_FULL_EA_INFORMATION-structured buffer, if the file object represents a file with extended attributes. Otherwise NULL.
Irp->IoStatus
Pointer to an IO_STATUS_BLOCK structure that receives the final completion status and information about the requested operation. See the description of the IoStatusBlock parameter to ZwCreateFile for more information.
IrpSp->FileObject
Pointer to a file object that the I/O Manager creates to represent the file to be created or opened. The file system sets the FsContext and possibly FsContext2 fields(s) in this file object to values that are file system-specific.
IrpSp->Flags
One or more of the following:
SL_CASE_SENSITIVE
SL_FORCE_ACCESS_CHECK (IO_FORCE_ACCESS_CHECK)
SL_OPEN_PAGING_FILE (IO_OPEN_PAGING_FILE)
SL_OPEN_TARGET_DIRECTORY (IO_OPEN_TARGET_DIRECTORY)

See the description of the Options parameter to IoCreateFile for more information.

IrpSp->MajorFunction
Specifies IRP_MJ_CREATE.
IrpSp->Parameters.Create.EaLength
Size in bytes of the buffer at Irp->AssociatedIrp.SystemBuffer. If the value of Irp->AssociatedIrp.SystemBuffer is NULL, this member must be zero.
IrpSp->Parameters.Create.Options
Bitmask of the options to be applied when creating or opening the file. See the description of the CreateOptions parameter to ZwCreateFile for more information.
IrpSp->Parameters.Create.SecurityContext->AccessState
Pointer to the ACCESS_STATE structure to be modified.
IrpSp->Parameters.Create.SecurityContext->DesiredAccess
ACCESS_MASK structure specifying access rights requested for the file. See the description of the DesiredAccess parameter to ZwCreateFile for more information.
IrpSp->Parameters.Create.ShareAccess
Bitmask of share access rights requested for the file. If this member is zero, exclusive access is being requested. See the description of the ShareAccess parameter to ZwCreateFile for more information.
Tom_lyd
驱动大牛
驱动大牛
  • 注册日期2001-09-02
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望1点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2002-06-06 08:15
在DDK上面有啊!估计是没有好好看DDK的帮助了!
IRP_MJ_CREATE
When Sent
The I/O Manager sends this request when a file, device, directory, or volume is being opened or created. Normally this IRP is sent on behalf of a user-mode application that has called a Microsoft Win32? function such as CreateFile or a kernel-mode component that has called IoCreateFile, ZwCreateFile, or ZwOpenFile. If the create request is completed successfully, the application or kernel-mode component receives a handle to the file object.

Operation: File System Drivers
If the target device object is the file system\'s control device object, the file system driver\'s dispatch routine must complete the IRP and return an appropriate NTSTATUS value, after setting Irp->IoStatus.Status and Irp->IoStatus.Information to appropriate values.

Otherwise, the file system driver should process the create request.

Operation: File System Filter Drivers
If the target device object is the filter driver\'s control device object, the filter driver\'s dispatch routine must complete the IRP and return an appropriate NTSTATUS value, after setting Irp->IoStatus.Status and Irp->IoStatus.Information to appropriate values.

Otherwise, the filter driver should perform any needed processing and, depending on the nature of the filter, either complete the IRP or pass it down to the next lower driver on the stack.

Generally, filter drivers should not return STATUS_PENDING in response to IRP_MJ_CREATE. However, if a lower-level driver returns STATUS_PENDING, the filter driver should pass this status value up the driver chain.

Parameters
A file system or filter driver calls IoGetCurrentIrpStackLocation with the given IRP to get a pointer to its own stack location in the IRP, shown in the following list as IrpSp. (The IRP is shown as Irp.) The driver can use the information set in the following members of the IRP and the IRP stack location in processing a create request:

DeviceObject
Pointer to the target device object.
Irp->AssociatedIrp.SystemBuffer
Pointer to a FILE_FULL_EA_INFORMATION-structured buffer, if the file object represents a file with extended attributes. Otherwise NULL.
Irp->IoStatus
Pointer to an IO_STATUS_BLOCK structure that receives the final completion status and information about the requested operation. See the description of the IoStatusBlock parameter to ZwCreateFile for more information.
IrpSp->FileObject
Pointer to a file object that the I/O Manager creates to represent the file to be created or opened. The file system sets the FsContext and possibly FsContext2 fields(s) in this file object to values that are file system-specific.
IrpSp->Flags
One or more of the following:
SL_CASE_SENSITIVE
SL_FORCE_ACCESS_CHECK (IO_FORCE_ACCESS_CHECK)
SL_OPEN_PAGING_FILE (IO_OPEN_PAGING_FILE)
SL_OPEN_TARGET_DIRECTORY (IO_OPEN_TARGET_DIRECTORY)

See the description of the Options parameter to IoCreateFile for more information.

IrpSp->MajorFunction
Specifies IRP_MJ_CREATE.
IrpSp->Parameters.Create.EaLength
Size in bytes of the buffer at Irp->AssociatedIrp.SystemBuffer. If the value of Irp->AssociatedIrp.SystemBuffer is NULL, this member must be zero.
IrpSp->Parameters.Create.Options
Bitmask of the options to be applied when creating or opening the file. See the description of the CreateOptions parameter to ZwCreateFile for more information.
IrpSp->Parameters.Create.SecurityContext->AccessState
Pointer to the ACCESS_STATE structure to be modified.
IrpSp->Parameters.Create.SecurityContext->DesiredAccess
ACCESS_MASK structure specifying access rights requested for the file. See the description of the DesiredAccess parameter to ZwCreateFile for more information.
IrpSp->Parameters.Create.ShareAccess
Bitmask of share access rights requested for the file. If this member is zero, exclusive access is being requested. See the description of the ShareAccess parameter to ZwCreateFile for more information.
 

你的DDK是什么版本的?我的怎么没有这么详细的帮助?我的是2KDDK的。
Tom_lyd
Tom_lyd
驱动大牛
驱动大牛
  • 注册日期2001-09-02
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望1点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2002-06-06 08:23
哦,原来在IFSDDK中
Tom_lyd
游客

返回顶部