📄 windows 文件过滤驱动经验总结 - 驱动开发 - 私のウェブサイト.htm
字号:
<TD>
<SCRIPT
src="Windows 文件过滤驱动经验总结 - 驱动开发 - 私のウェブサイト.files/tree.js"></SCRIPT>
<DIV id=lefttree
style="SCROLLBAR-FACE-COLOR: #eeeeee; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; OVERFLOW: auto; SCROLLBAR-SHADOW-COLOR: #cccccc; SCROLLBAR-3DLIGHT-COLOR: #d1d7dc; SCROLLBAR-ARROW-COLOR: #006699; SCROLLBAR-TRACK-COLOR: #cccccc; SCROLLBAR-DARKSHADOW-COLOR: #eedfe7"></DIV>
<SCRIPT language=javascript>ContentsTree = new CTree("ContentsTree");ContentsTree.bAutoClose = false;ContentsTree.stTarget = "";a0 = ContentsTree.AddNode(null, "我的文章分类", "article.html");i0 = ContentsTree.AddNode(null, "我导入的文章", "myimport.html");a0.bOpen=true;p0 = ContentsTree.AddNode(null, "我的图片分类", "photo.html");p0.bOpen=true;f0 = ContentsTree.AddNode(null, "我的链接分类", "links.html");f0.bOpen=true;m0 = ContentsTree.AddNode(null, "我的音乐分类", "music.html");m0.bOpen=true;a34190 = ContentsTree.AddNode(a0, "WEB开发", "article_34190.html");a39155 = ContentsTree.AddNode(a34190, "Struts", "article_39155.html");a39156 = ContentsTree.AddNode(a34190, "JSF", "article_39156.html");a34187 = ContentsTree.AddNode(a34190, "Jsp精华", "article_34187.html");a34191 = ContentsTree.AddNode(a34190, "Java精华", "article_34191.html");a34189 = ContentsTree.AddNode(a34190, "Asp精华", "article_34189.html");a40050 = ContentsTree.AddNode(a34190, "Lotus Domino", "article_40050.html");a43030 = ContentsTree.AddNode(a34190, "Php精华", "article_43030.html");a44885 = ContentsTree.AddNode(a34190, "JavaScript", "article_44885.html");a47104 = ContentsTree.AddNode(a0, "桌面开发", "article_47104.html");a47106 = ContentsTree.AddNode(a47104, "Qt开发", "article_47106.html");a47107 = ContentsTree.AddNode(a47104, "Perl", "article_47107.html");a47108 = ContentsTree.AddNode(a47104, "Python", "article_47108.html");a47109 = ContentsTree.AddNode(a47104, "Gtk", "article_47109.html");a51996 = ContentsTree.AddNode(a47104, "Delphi", "article_51996.html");a48848 = ContentsTree.AddNode(a47104, "VC++", "article_48848.html");a54547 = ContentsTree.AddNode(a47104, "JAVA", "article_54547.html");a54567 = ContentsTree.AddNode(a47104, "Linux_C", "article_54567.html");a54959 = ContentsTree.AddNode(a47104, "Visual Basic", "article_54959.html");a55026 = ContentsTree.AddNode(a47104, "CSharp", "article_55026.html");a88323 = ContentsTree.AddNode(a47104, "VB", "article_88323.html");a89754 = ContentsTree.AddNode(a47104, "wxWidgets", "article_89754.html");a76974 = ContentsTree.AddNode(a0, "驱动开发", "article_76974.html");a76974.bOpen=true;var pm=a76974;while(pm=pm.pParent){pm.bOpen=true;}a48858 = ContentsTree.AddNode(a0, "嵌入式开发", "article_48858.html");a50076 = ContentsTree.AddNode(a48858, "汇编语言", "article_50076.html");a43513 = ContentsTree.AddNode(a48858, "C&C++精华", "article_43513.html");a54548 = ContentsTree.AddNode(a48858, "J2ME", "article_54548.html");a46830 = ContentsTree.AddNode(a0, "Unix", "article_46830.html");a40047 = ContentsTree.AddNode(a46830, "FreeBSD", "article_40047.html");a47312 = ContentsTree.AddNode(a40047, "FreeBSD架设管理与应用", "article_47312.html");a40048 = ContentsTree.AddNode(a46830, "Solaris", "article_40048.html");a47232 = ContentsTree.AddNode(a46830, "Nexenta", "article_47232.html");a48889 = ContentsTree.AddNode(a46830, "Sco Unix", "article_48889.html");a40049 = ContentsTree.AddNode(a46830, "AIX", "article_40049.html");a34192 = ContentsTree.AddNode(a0, "Linux", "article_34192.html");a40045 = ContentsTree.AddNode(a34192, "RedHat Linux", "article_40045.html");a40046 = ContentsTree.AddNode(a34192, "Debian", "article_40046.html");a47103 = ContentsTree.AddNode(a34192, "ArchLinux", "article_47103.html");a47105 = ContentsTree.AddNode(a34192, "Gentoo", "article_47105.html");a47609 = ContentsTree.AddNode(a34192, "Cent OS", "article_47609.html");a48859 = ContentsTree.AddNode(a34192, "Ubuntu", "article_48859.html");a48860 = ContentsTree.AddNode(a34192, "SuseLinux", "article_48860.html");a48861 = ContentsTree.AddNode(a34192, "LFS", "article_48861.html");a48862 = ContentsTree.AddNode(a34192, "RedFlag", "article_48862.html");a48863 = ContentsTree.AddNode(a34192, "MagicLinux", "article_48863.html");a89753 = ContentsTree.AddNode(a34192, "Fedora", "article_89753.html");a46831 = ContentsTree.AddNode(a0, "Windows", "article_46831.html");a36187 = ContentsTree.AddNode(a0, "数据库", "article_36187.html");a36188 = ContentsTree.AddNode(a36187, "Oracle", "article_36188.html");a36189 = ContentsTree.AddNode(a36187, "MSSql", "article_36189.html");a36190 = ContentsTree.AddNode(a36187, "MySql", "article_36190.html");a36191 = ContentsTree.AddNode(a36187, "PostgreSql", "article_36191.html");a37219 = ContentsTree.AddNode(a36187, "SQL技巧", "article_37219.html");a39838 = ContentsTree.AddNode(a0, "中间件", "article_39838.html");a39839 = ContentsTree.AddNode(a39838, "weblogic", "article_39839.html");a39840 = ContentsTree.AddNode(a39838, "tomcat", "article_39840.html");a47863 = ContentsTree.AddNode(a0, "路由", "article_47863.html");a54495 = ContentsTree.AddNode(a0, "算法大全", "article_54495.html");a54502 = ContentsTree.AddNode(a54495, "Delphi", "article_54502.html");a54550 = ContentsTree.AddNode(a54495, "C", "article_54550.html");a58056 = ContentsTree.AddNode(a54495, "Visual C++", "article_58056.html");a58117 = ContentsTree.AddNode(a0, "Com技术", "article_58117.html");a58353 = ContentsTree.AddNode(a0, "软件工程", "article_58353.html");a58355 = ContentsTree.AddNode(a58353, "UML", "article_58355.html");a58356 = ContentsTree.AddNode(a58353, "设计模式", "article_58356.html");a58586 = ContentsTree.AddNode(a0, "心情日记", "article_58586.html");a84044 = ContentsTree.AddNode(a0, "汉化破解", "article_84044.html");a101427 = ContentsTree.AddNode(a0, "Mobile开发", "article_101427.html"); p3428 = ContentsTree.AddNode(p0, "GG收藏", "photo_3428.html"); f10642 = ContentsTree.AddNode(f0, "Linux下载大全", "links_10642.html");f7671 = ContentsTree.AddNode(f0, "音乐娱乐影视", "links_7671.html");f7672 = ContentsTree.AddNode(f0, "java精华站点", "links_7672.html");f9939 = ContentsTree.AddNode(f0, "ONLINE手册", "links_9939.html");f10693 = ContentsTree.AddNode(f0, "EBooks下载", "links_10693.html");f7729 = ContentsTree.AddNode(f0, "blog地址", "links_7729.html");f7668 = ContentsTree.AddNode(f0, "视频下载链接", "links_7668.html");f10709 = ContentsTree.AddNode(f0, "VC++ study websites", "links_10709.html");f10871 = ContentsTree.AddNode(f0, "汇编语言学习站点", "links_10871.html");f12315 = ContentsTree.AddNode(f0, "软件下载", "links_12315.html");f12474 = ContentsTree.AddNode(f0, "北京生活", "links_12474.html");f13021 = ContentsTree.AddNode(f0, "日语学习网站", "links_13021.html");f13536 = ContentsTree.AddNode(f0, "软件外包", "links_13536.html");f14823 = ContentsTree.AddNode(f0, "图片", "links_14823.html"); //document.write(ContentsTree.GetHTMLCode());document.getElementById("lefttree").innerHTML=ContentsTree.GetHTMLCode();</SCRIPT>
</TD></TR>
<TR>
<TD height=5></TD></TR></TBODY></TABLE><BR><A
href="http://blog.chinaunix.net/u/rss.php?id=21790"><IMG alt=""
src="Windows 文件过滤驱动经验总结 - 驱动开发 - 私のウェブサイト.files/xmlrss.gif" border=0></A>
<BR><BR></TD>
<TD width=10></TD>
<TD vAlign=top width=685>
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0
width="100%" align=center border=0>
<TBODY>
<TR>
<TD align=middle bgColor=#bbf0ff><BR><FONT style="FONT-SIZE: 14pt"
color=#000066><B>Windows 文件过滤驱动经验总结</B></FONT> </TD>
<TR>
<TD>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#bbf0ff
cellSpacing=1 cellPadding=0 width="100%" border=1>
<TBODY>
<TR>
<TD align=middle>
<TABLE
style="BORDER-COLLAPSE: collapse; WORD-WRAP: break-word"
cellSpacing=0 cellPadding=0 width=650 border=0>
<TBODY>
<TR>
<TD align=middle>
<TABLE
style="BORDER-COLLAPSE: collapse; WORD-WRAP: break-word"
cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=650>
<DIV id=art style="MARGIN: 15px">
<DIV>
<P align=center><STRONG>Windows
文件过滤驱动经验总结</STRONG><BR>作者:ai3000</P>
<P>本文转载自<A
href="http://bbs.driverdevelop.com/index.php"
target=_blank><FONT
color=#810081>驱动开发网</FONT></A><BR><BR>看了
ChuKuangRen 的第二版<A
href="http://www.vckbase.com/tools/viewtools.asp?id=202"
target=_blank><FONT
color=#0000ff>《文件过滤驱动开发教程》</FONT></A>后,颇有感触。我想,交流都是建立在平等的基础上,在抱怨氛围和环境不好的同时应该先想一想自己究竟付出了多少?只知索取不愿付出的人也就不用抱怨了,要怪也只能怪自己。发自己心得的人无非是两种目的,一是引发一些讨论,好纠正自己错误的认识,以便从中获取更多的知识使自己进步的更快。二是做一份备忘,当自己遗忘的时候能够马上找到相关资料。我这里也总结了近几年做文件过滤驱动时所积累下来的一些小小经验,这分笔记也是看了
ChuKuangRen
的教程后,临时想到的一小部分而已,是想到哪写到哪,不是很全,如果以后再回想起什么也会不断补充。因其工作原因,近段时间在
SOLARIS 驱动与 Linux 内核方面投入的精力比较多,Windows
下的文件过滤驱动一直也没有怎么去碰,所以最后还是那句老话 FIXME。</P>
<P><IMG height=16
src="Windows 文件过滤驱动经验总结 - 驱动开发 - 私のウェブサイト.files/paragraph.gif"
width=14 align=absMiddle> 1、获得文件全路径以及判断时机</P>
<P>除在所有 IRP_MJ_XXX 之前自己从头创建 IRP
发送到下层设备查询全路径外,不要尝试在 IRP_MJ_CREATE 以外的地方获得全路径,因为只有在
IRP_MJ_CREATE<BR>中才会使用 ObCreateObject() 来建立一个有效的
FILE_OBJECT。而在 IRP_READ IRP_WRITE 中它们是直接操作 FCB
(File Control Block)的。<BR></P>
<P><IMG height=16
src="Windows 文件过滤驱动经验总结 - 驱动开发 - 私のウェブサイト.files/paragraph.gif"
width=14 align=absMiddle> 2、从头建立 IRP 发送关注点</P>
<P>无论你建立什么样的 IRP,是 IRP_MJ_CREATE 也好还是
IRP_MJ_DIRECTORY_CONTROL也罢,最要提醒的就是一些标志。不同的标志会代来不同的结果,有些结果是直接返回失败。这里指的标志不光是
IRP->Flags,还要考虑
IO_STACK_LOCATION->Flags还有其它等等。尤其是你要达到一些特殊目的,这时候更需要注意,如
IRP_MN_QUERY_DIRECTORY,不同的标志结果有很大的不同。<BR></P>
<P><IMG height=16
src="Windows 文件过滤驱动经验总结 - 驱动开发 - 私のウェブサイト.files/paragraph.gif"
width=14 align=absMiddle> 3、从头建立 IRP 获取全路径注意点</P>
<P>自己从头建立一个 IRP_MJ_QUERY_INFORMATION 的 IRP
获取全路径时需要注意,不仅在 IRP_MJ_CREATE 要做区别处理,在 IRP_MJ_CLOSE
也要做同样的处理,否则如果目标是 NTFS 文件系统的话可能产生 deadlock。如果是 NTFS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -