阅读:1411回复:4
请教如何得到是新建文件还是打开文件?
新建一个文件和打开一个文件,都要发送IRP_MJ_CREATE,那么该如何区分,到底是新建了一个文件,还是打开了已有的文件呢?
初学者的问题,见笑! |
|
沙发#
发布于:2008-06-23 09:41
只有FILE_OPEN是打开文件,
其他几个可能是打开,也可能是创建。好像不是很好判断 |
|
|
板凳#
发布于:2008-06-24 23:13
根据返回的标志来判断,找找应该能发现的
|
|
地板#
发布于:2008-06-24 23:21
IoStatusBlock
Pointer to an IO_STATUS_BLOCK structure that receives the final completion status and other information about the requested operation. In particular, the Information member receives one of the following values: FILE_CREATED FILE_OPENED FILE_OVERWRITTEN FILE_SUPERSEDED FILE_EXISTS FILE_DOES_NOT_EXIST |
|
|
地下室#
发布于:2008-07-29 22:21
兄弟们,没那么复杂吧
struct IO_STACK_LOCATION { UCHAR MajorFunction; UCHAR MinorFunction; UCHAR Flags; UCHAR Control; union { // // Parameters for IRP_MJ_CREATE // struct { PIO_SECURITY_CONTEXT SecurityContext; ULONG Options; //这里就是你想知道的 USHORT POINTER_ALIGNMENT FileAttributes; USHORT ShareAccess; ULONG POINTER_ALIGNMENT EaLength; } Create; 。。。。。 } |
|