Re: [ntfsd] Re: [ntfsd] File size doesn't change in explore.

Thank you very much!
I got the solution.
It was in my dispatch routine of IRP_MJ_DIRECTORY_CONTROL.
I set the file size to 0 when it is a regular file. So the file size is
always 0.
Your advices help me much.
I use cmd to do the test. And I find that the IRP_MJ_DIRECTORY_CONTROL
was captured by filespy but IRP_MJ_QUERY_INFORMATION was not.
So there’s must be some problem with the dispatch routine of
IRP_MJ_DIRECTORY_CONTROL. And then I got it.

----- 原始邮件 ----
发件人: Rod Widdowson
收件人: Windows File Systems Devs Interest List
发送日期: 2009/11/16 (周一) 10:46:21 下午
主 题: [ntfsd] Re: 回复: [ntfsd] File size doesn’t change in explore.

> 1) When the file size is changed(request such as
> IRP_MJ_SET_INFORMATION, IRP_MJ_WRITE, etc),
> I call FsRtlNotifyFullReportChange with Filter:FILE_NOTIFY_CHANGE_SIZE.

That sounds reasonable.

> 2) I didn’t find the IRP_MJ_NETWORK_QUERY_OPEN major function
> code in my driver. Is it essential?

Ah sorry, you are an FSD aren’t you. In this case it is the FastIoQueryOpen path.

Rod

发件人: Rod Widdowson
收件人: Windows File Systems Devs Interest List
发送日期: 2009/11/14 (周六) 5:28:20 下午
主 题: Re:[ntfsd] File size doesn’t change in explore.

These things are often due to either

1) Not changing the size in IRP_MJ_DIRECTORY_CONTROL
2) Not changing the size in IRP_MJ_NETWORK_QUERY_OPEN

If I might also be so bold: try starting with a test application which is less “challenging” than explorer. Ladislav’s (free) Filetest (http://www.zezula.net/) is awesome for discovering what is happening and you only ever see one IRP at a time.

Good luck

Rod

“光凯 张” wrote in message news:xxxxx@ntfsd…
Hi, guys

First of all, sorry for my poor english.

I got a problem about the file size.
In my file system driver, I handle the IRP_MJ_FILE_INFORMATION request.
And it passes the right value to me(I use filetest to do NtQueryInformation).
But the explorer shows that the file size is 0 bytes. I just don’t know why?
When the file size need to be changed, I set the FO_FILE_MODIFIED flag on
the FileObject, and report the change to the directory. Just hope someone can
give me a hint. Thanks.

Here is my dispatch route to handle IRP_MJ_FILE_INFORMATION:

NTSTATUS
EnfsQueryFileInformation(
IN PENFS_IRP_CONTEXT IrpContext
)
{
//do some check…
switch (FileInformationClass) {
case FileBasicInformation:
{ // Process it and break…
}
case FileStandardInformation:
{ // Process it and break…
}
case FileInternalInformation:
{ // Process it and break…
}
case FileEaInformation:
{ // Process it and break…
}
case FileNameInformation:
{ // Process it and break…
}
case FilePostionInformation:
{ // Process it and break…
}
case FileAllInformation:
{ // Process it and break…
}
case FileNetworkOpenInformation:
{ // Process it and break…
}
case FileAttributeTagInformation:
{ // Process it and break…
}
default:
Status = STATUS_INVALID_PARAMETER;
}

// According to the status code, requeue it requst or complete the request
}

___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit: http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit: http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/