caiyuqing
驱动牛犊
驱动牛犊
  • 注册日期2009-03-09
  • 最后登录2016-09-02
  • 粉丝0
  • 关注0
  • 积分18分
  • 威望121点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1470回复:0

关于流文件对象

楼主#
更多 发布于:2009-04-10 11:28
来这里问了几个问题,得不到解决,只好上OSR上问,感兴趣的朋友瞧瞧,希望跟我有同样困惑的朋友能得到帮助
http://www.osronline.com/cf.cfm?PageURL=showlists.CFM?list=NTFSD  标题是:questions about the stream file object

08 Apr 09 22:46  
cai yuqing
xxxxxx@21cn.com Join Date: 08 Apr 2009
Posts To This List: 4
  
questions about the stream file object
--------------------------------------------------------------------------------
Hi,Dear all :)
I have some questions about the stream file object,hope somebody can help me....
1. In what situation that system will create a stream file object? Does it mean
when user application use C++'s iostream operation will cause this happen?
2. what's the different between a stream file object and a normal file object?
3. MSDN mention that when a stream file object created, It does not send a
IRP_MJ_CREATE IRP but a IRP_MJ_CLEANUP IRP,in this case,how do we catch this
file create operation in our filter?
  
  Message 2 of 8   Yesterday 08:44  
Peter Scott
xxxxxx@KernelDrivers.com Join Date: 14 Jan 2002
Posts To This List: 333
  
Re: questions about the stream file object
--------------------------------------------------------------------------------
xxxxx@21cn.com wrote:
> Hi,Dear all :)
>
> I have some questions about the stream file object,hope somebody can help
me....
>
> 1. In what situation that system will create a stream file object? Does it
mean when user application use C++'s iostream operation will cause this happen?
Other kernel mode components can use stream file objects in a wide range
of designs. NTFS uses SFO's for cache map initialization, hence you see
paging coming in against a SFO.
> 2. what's the different between a stream file object and a normal file object?
The difference is that you have not seen an IRP_MJ_CREATE for the file
object and the FO_STREAM_FILE_OBJECT Flag is set. Other than that they
can be used for any operation that comes through the file system stack.
> 3. MSDN mention that when a stream file object created, It does not send a
IRP_MJ_CREATE IRP but a IRP_MJ_CLEANUP IRP,in this case,how do we catch this
file create operation in our filter?
>
You can not capture the creation of these through standard mechanisms.
You do need to recognize the tear down of these during IRP_MJ_CLEANUP
and CLOSE processing though. Have you read the reference counting
article at OSR Online? This discusses how to make sure your counts are
correct. Of course, with Filter Manager you don't need to worry about
them from the perspective of reference counting.
Pete
> ---
> 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
--
Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295
  
  Message 3 of 8   Yesterday 09:44  
cai yuqing
xxxxxx@21cn.com Join Date: 08 Apr 2009
Posts To This List: 4
  
RE: questions about the stream file object
--------------------------------------------------------------------------------
Pete,thanks for your reply: )
I am a new guy in filter developing,can you give me the link about the reference
counting article at OSR Online?
  
  Message 4 of 8   Yesterday 09:51  
MM
xxxxxx@evitechnology.com Join Date: 28 May 2005
Posts To This List: 260
  
Re: questions about the stream file object
--------------------------------------------------------------------------------
I imagine that this is it:
http://www.osronline.com/article.cfm?id=102

xxxxx@21cn.com wrote:
> Pete,thanks for your reply: )
> I am a new guy in filter developing,can you give me the link about the
reference counting article at OSR Online?
>
>
  
  Message 5 of 8   Yesterday 09:58  
cai yuqing
xxxxxx@21cn.com Join Date: 08 Apr 2009
Posts To This List: 4
  
RE: questions about the stream file object
--------------------------------------------------------------------------------
by the way Pete,can you give me links about stream file object, I should learn
more about it, thanks
  
  Message 6 of 8   Yesterday 10:25  
Peter Scott
xxxxxx@KernelDrivers.com Join Date: 14 Jan 2002
Posts To This List: 333
  
Re: questions about the stream file object
--------------------------------------------------------------------------------
xxxxx@21cn.com wrote:
> by the way Pete,can you give me links about stream file object, I should learn
more about it, thanks
>
I would read up on the WDK docs about the IoCreateStreamFileObject(),
IoCreateStreamFileObjectEx() and IoCreateStreamFileObjectLite(). They
each offer slightly different functionality but do give information on
what they can be used for. Other than that, search for the APIs in the
FAT source code and follow how they are used.
Pete
> ---
> 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
--
Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295
  
  Message 7 of 8   Yesterday 11:02  
cai yuqing
xxxxxx@21cn.com Join Date: 08 Apr 2009
Posts To This List: 4
  
RE: questions about the stream file object
--------------------------------------------------------------------------------
copy that~:)
  
  Message 8 of 8   Yesterday 17:32  
Maxim S. Shatskih
xxxxxx@storagecraft.com Join Date: 23 Feb 2000
Posts To This List: 3136
  
Re: questions about the stream file object
--------------------------------------------------------------------------------
> 1. In what situation that system will create a stream file object? Does it
mean when user application
>use C++'s iostream operation will cause this happen?
No for sure.
C++ streams are the wrappers around the CRT's read/write/open/creat/close, and
they are - in Windows - in turn wrappers over kernel32!CreateFile/ReadFile,
which are in turn wrappers over ntdll!NtCreateFile/NtReadFile syscalls going
down to the kernel.
Stream file object is the file object handicrafted _by the FSD itself_ without
going thru the usual kernel's IoCreateFile path.
The purpose of such file objects are at FSD's developer will, but usually they
are used to create the cache maps and thus cache some metadata. For instance,
FASTFAT uses such object to cache FAT and the FAT12/16 root dir.
--
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
 
游客

返回顶部