Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1238 lines
55 KiB

  1. <html xmlns:o="urn:schemas-microsoft-com:office:office"
  2. xmlns:w="urn:schemas-microsoft-com:office:word"
  3. xmlns="http://www.w3.org/TR/REC-html40">
  4. <head>
  5. <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  6. <meta name=ProgId content=Word.Document>
  7. <meta name=Generator content="Microsoft Word 10">
  8. <meta name=Originator content="Microsoft Word 10">
  9. <link rel=File-List href="usrGuide_files/filelist.xml">
  10. <title>FileSpy Documentation</title>
  11. <w:WordDocument>
  12. <w:SpellingState>Clean</w:SpellingState>
  13. <w:GrammarState>Clean</w:GrammarState>
  14. <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  15. </w:WordDocument>
  16. </xml><![endif]-->
  17. <style>
  18. <!--
  19. /* Font Definitions */
  20. @font-face
  21. {font-family:Wingdings;
  22. panose-1:5 0 0 0 0 0 0 0 0 0;
  23. mso-font-charset:2;
  24. mso-generic-font-family:auto;
  25. mso-font-pitch:variable;
  26. mso-font-signature:0 268435456 0 0 -2147483648 0;}
  27. /* Style Definitions */
  28. p.MsoNormal, li.MsoNormal, div.MsoNormal
  29. {mso-style-parent:"";
  30. margin-top:0in;
  31. margin-right:0in;
  32. margin-bottom:12.0pt;
  33. margin-left:0in;
  34. mso-pagination:widow-orphan;
  35. font-size:12.0pt;
  36. font-family:"Times New Roman";
  37. mso-fareast-font-family:"Times New Roman";}
  38. h1
  39. {mso-style-next:Normal;
  40. margin-top:12.0pt;
  41. margin-right:0in;
  42. margin-bottom:3.0pt;
  43. margin-left:0in;
  44. mso-pagination:widow-orphan;
  45. page-break-after:avoid;
  46. mso-outline-level:1;
  47. font-size:16.0pt;
  48. font-family:Arial;
  49. mso-font-kerning:16.0pt;}
  50. h2
  51. {mso-style-next:Normal;
  52. margin-top:12.0pt;
  53. margin-right:0in;
  54. margin-bottom:3.0pt;
  55. margin-left:0in;
  56. mso-pagination:widow-orphan;
  57. page-break-after:avoid;
  58. mso-outline-level:2;
  59. font-size:14.0pt;
  60. font-family:Arial;
  61. font-style:italic;}
  62. h3
  63. {mso-style-next:Normal;
  64. margin-top:12.0pt;
  65. margin-right:0in;
  66. margin-bottom:3.0pt;
  67. margin-left:0in;
  68. mso-pagination:widow-orphan;
  69. page-break-after:avoid;
  70. mso-outline-level:3;
  71. font-size:13.0pt;
  72. font-family:Arial;}
  73. h4
  74. {mso-style-next:Normal;
  75. margin-top:0in;
  76. margin-right:0in;
  77. margin-bottom:12.0pt;
  78. margin-left:0in;
  79. mso-pagination:widow-orphan;
  80. page-break-after:avoid;
  81. mso-outline-level:4;
  82. font-size:12.0pt;
  83. font-family:"Times New Roman";
  84. font-style:italic;}
  85. h5
  86. {mso-style-next:Normal;
  87. margin-top:0in;
  88. margin-right:0in;
  89. margin-bottom:12.0pt;
  90. margin-left:0in;
  91. mso-pagination:widow-orphan;
  92. page-break-after:avoid;
  93. mso-outline-level:5;
  94. font-size:12.0pt;
  95. font-family:"Times New Roman";
  96. font-weight:normal;
  97. font-style:italic;}
  98. p.MsoList, li.MsoList, div.MsoList
  99. {margin-top:0in;
  100. margin-right:0in;
  101. margin-bottom:12.0pt;
  102. margin-left:.25in;
  103. text-indent:-.25in;
  104. mso-pagination:widow-orphan;
  105. font-size:12.0pt;
  106. font-family:"Times New Roman";
  107. mso-fareast-font-family:"Times New Roman";}
  108. p.MsoListBullet, li.MsoListBullet, div.MsoListBullet
  109. {mso-style-update:auto;
  110. margin-top:0in;
  111. margin-right:0in;
  112. margin-bottom:12.0pt;
  113. margin-left:.25in;
  114. text-indent:-.25in;
  115. mso-pagination:widow-orphan;
  116. mso-list:l1 level1 lfo2;
  117. tab-stops:list .25in;
  118. font-size:12.0pt;
  119. font-family:"Times New Roman";
  120. mso-fareast-font-family:"Times New Roman";}
  121. p.MsoListNumber, li.MsoListNumber, div.MsoListNumber
  122. {margin-top:0in;
  123. margin-right:0in;
  124. margin-bottom:12.0pt;
  125. margin-left:.25in;
  126. text-indent:-.25in;
  127. mso-pagination:widow-orphan;
  128. mso-list:l0 level1 lfo1;
  129. tab-stops:list .25in;
  130. font-size:12.0pt;
  131. font-family:"Times New Roman";
  132. mso-fareast-font-family:"Times New Roman";}
  133. p.MsoTitle, li.MsoTitle, div.MsoTitle
  134. {margin-top:12.0pt;
  135. margin-right:0in;
  136. margin-bottom:3.0pt;
  137. margin-left:0in;
  138. text-align:center;
  139. mso-pagination:widow-orphan;
  140. mso-outline-level:1;
  141. font-size:16.0pt;
  142. font-family:Arial;
  143. mso-fareast-font-family:"Times New Roman";
  144. mso-font-kerning:14.0pt;
  145. font-weight:bold;}
  146. p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle
  147. {margin-top:0in;
  148. margin-right:0in;
  149. margin-bottom:3.0pt;
  150. margin-left:0in;
  151. text-align:center;
  152. mso-pagination:widow-orphan;
  153. mso-outline-level:2;
  154. font-size:12.0pt;
  155. font-family:Arial;
  156. mso-fareast-font-family:"Times New Roman";}
  157. span.SpellE
  158. {mso-style-name:"";
  159. mso-spl-e:yes;}
  160. span.GramE
  161. {mso-style-name:"";
  162. mso-gram-e:yes;}
  163. @page Section1
  164. {size:8.5in 11.0in;
  165. margin:1.0in 1.25in 1.0in 1.25in;
  166. mso-header-margin:.5in;
  167. mso-footer-margin:.5in;
  168. mso-paper-source:0;}
  169. div.Section1
  170. {page:Section1;}
  171. /* List Definitions */
  172. @list l0
  173. {mso-list-id:-120;
  174. mso-list-type:simple;
  175. mso-list-template-ids:-1758042056;}
  176. @list l0:level1
  177. {mso-level-style-link:"List Number";
  178. mso-level-tab-stop:.25in;
  179. mso-level-number-position:left;
  180. margin-left:.25in;
  181. text-indent:-.25in;}
  182. @list l1
  183. {mso-list-id:-119;
  184. mso-list-type:simple;
  185. mso-list-template-ids:51275690;}
  186. @list l1:level1
  187. {mso-level-number-format:bullet;
  188. mso-level-style-link:"List Bullet";
  189. mso-level-text:\F0B7;
  190. mso-level-tab-stop:.25in;
  191. mso-level-number-position:left;
  192. margin-left:.25in;
  193. text-indent:-.25in;
  194. font-family:Symbol;}
  195. @list l2
  196. {mso-list-id:199903965;
  197. mso-list-type:hybrid;
  198. mso-list-template-ids:-1574410710 67698693 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
  199. @list l2:level1
  200. {mso-level-number-format:bullet;
  201. mso-level-text:\F0A7;
  202. mso-level-tab-stop:.5in;
  203. mso-level-number-position:left;
  204. text-indent:-.25in;
  205. font-family:Wingdings;}
  206. @list l3
  207. {mso-list-id:209002705;
  208. mso-list-type:hybrid;
  209. mso-list-template-ids:1497250904 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
  210. @list l3:level1
  211. {mso-level-number-format:bullet;
  212. mso-level-text:\F0B7;
  213. mso-level-tab-stop:.25in;
  214. mso-level-number-position:left;
  215. margin-left:.25in;
  216. text-indent:-.25in;
  217. font-family:Symbol;}
  218. @list l4
  219. {mso-list-id:395669747;
  220. mso-list-type:hybrid;
  221. mso-list-template-ids:-718649080 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
  222. @list l4:level1
  223. {mso-level-number-format:bullet;
  224. mso-level-text:\F0B7;
  225. mso-level-tab-stop:.5in;
  226. mso-level-number-position:left;
  227. text-indent:-.25in;
  228. font-family:Symbol;}
  229. @list l5
  230. {mso-list-id:831259755;
  231. mso-list-type:hybrid;
  232. mso-list-template-ids:1497250904 67698703 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
  233. @list l5:level1
  234. {mso-level-tab-stop:.25in;
  235. mso-level-number-position:left;
  236. margin-left:.25in;
  237. text-indent:-.25in;}
  238. @list l6
  239. {mso-list-id:859125810;
  240. mso-list-type:hybrid;
  241. mso-list-template-ids:765208850 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
  242. @list l6:level1
  243. {mso-level-number-format:bullet;
  244. mso-level-text:\F0B7;
  245. mso-level-tab-stop:.5in;
  246. mso-level-number-position:left;
  247. text-indent:-.25in;
  248. font-family:Symbol;}
  249. @list l7
  250. {mso-list-id:1931545850;
  251. mso-list-type:hybrid;
  252. mso-list-template-ids:-42197664 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
  253. @list l7:level1
  254. {mso-level-number-format:bullet;
  255. mso-level-text:\F0B7;
  256. mso-level-tab-stop:39.0pt;
  257. mso-level-number-position:left;
  258. margin-left:39.0pt;
  259. text-indent:-.25in;
  260. font-family:Symbol;}
  261. ol
  262. {margin-bottom:0in;}
  263. ul
  264. {margin-bottom:0in;}
  265. -->
  266. </style>
  267. <!--[if gte mso 10]>
  268. <style>
  269. /* Style Definitions */
  270. table.MsoNormalTable
  271. {mso-style-name:"Table Normal";
  272. mso-tstyle-rowband-size:0;
  273. mso-tstyle-colband-size:0;
  274. mso-style-noshow:yes;
  275. mso-style-parent:"";
  276. mso-padding-alt:0in 5.4pt 0in 5.4pt;
  277. mso-para-margin:0in;
  278. mso-para-margin-bottom:.0001pt;
  279. mso-pagination:widow-orphan;
  280. font-size:10.0pt;
  281. font-family:"Times New Roman";}
  282. </style>
  283. <![endif]-->
  284. </head>
  285. <body lang=EN-US style='tab-interval:.5in'>
  286. <div class=Section1>
  287. <p class=MsoTitle>FileSpy Project</p>
  288. <p class=MsoTitle>User Guide</p>
  289. <p class=MsoTitle>Last updated: <!--[if supportFields]><span style='mso-element:
  290. field-begin'></span><span style='mso-spacerun:yes'></span>TIME \@ &quot;MMMM
  291. d, yyyy&quot; <span style='mso-element:field-separator'></span><![endif]--><span
  292. style='mso-no-proof:yes'>April 6, 2001</span><!--[if supportFields]><span
  293. style='mso-element:field-end'></span><![endif]--></p>
  294. <p class=MsoTitle><o:p>&nbsp;</o:p></p>
  295. <h1>Overview</h1>
  296. <p class=MsoNormal>FileSpy is a tool that aids Installable File System (IFS)
  297. filter driver writers in understanding the I/O that is occurring in the
  298. system.<span style='mso-spacerun:yes'></span>It allows the user to monitor
  299. both local and network drives to see what types of IRP and Fast I/O operation
  300. are executing in the system.</p>
  301. <p class=MsoNormal>FileSpy was also developed as a useful example of how to
  302. write an IFS filter driver.<span style='mso-spacerun:yes'></span>This driver
  303. sits in the I/O stack and records the relevant information for the I/O
  304. operations that are happening, such as the starting time, the completion time,
  305. return status, etc.<span style='mso-spacerun:yes'></span>The filter driver
  306. was developed using the <span class=SpellE>sfilter</span> example code as a
  307. base, so you should see some similarity in their structure.<span
  308. style='mso-spacerun:yes'>� </span>The main differences between these two
  309. example filters are:</p>
  310. <p class=MsoListNumber><![if !supportLists]><span style='mso-list:Ignore'>1.<span
  311. style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>The
  312. <span class=SpellE>sfilter</span> example consists of only a kernel mode
  313. driver.<span style='mso-spacerun:yes'></span>FileSpy has both user mode and
  314. kernel mode components.<span style='mso-spacerun:yes'></span>The kernel mode
  315. driver watches and records the meaningful I/O activity and then passes up to
  316. the user mode application when data is requests.<span
  317. style='mso-spacerun:yes'>� </span>The user mode application then displays this
  318. data to the user through the screen or by writing the log data to a file.</p>
  319. <p class=MsoListNumber><![if !supportLists]><span style='mso-list:Ignore'>2.<span
  320. style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>Sfilter
  321. connects to all devices in the system as soon as the device is created and stay
  322. connected for as long as the system is running.<span style='mso-spacerun:yes'>
  323. </span>FileSpy connects to a device only when directed to by the user
  324. application or through a parameter in the registry.<span
  325. style='mso-spacerun:yes'>� </span>It disconnects from the device when told to
  326. do so by the I/O Manager.<span style='mso-spacerun:yes'></span>Do to the
  327. design of the I/O architecture, the user cannot directly tell the FileSpy
  328. driver to detach from the device.<span style='mso-spacerun:yes'></span>When
  329. the kernel driver receives the command to disconnect, it just stops logging
  330. information for that device.<span style='mso-spacerun:yes'></span>FileSpy can
  331. only truly detach from a device when commanded to do so by the I/O Manager.</p>
  332. <p class=MsoListNumber><![if !supportLists]><span style='mso-list:Ignore'>3.<span
  333. style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]><span
  334. class=SpellE>Sfilter</span> doesn�t actually do anything � it just shows a
  335. driver writer how to hook into all the possible places to watch IRP and Fast
  336. I/O communication.<span style='mso-spacerun:yes'></span>FileSpy logs the I/O
  337. communication traffic in the system while trying to minimize its affect on the
  338. performance of the system.<span style='mso-spacerun:yes'></span>The user
  339. application works with the kernel mode driver to display the I/O traffic to the
  340. user.</p>
  341. <h1>Code Structure</h1>
  342. <h2>Overview</h2>
  343. <p class=MsoNormal>The FileSpy project can be broken down into four components:</p>
  344. <p class=MsoListNumber style='margin-bottom:0in;margin-bottom:.0001pt;
  345. mso-list:l0 level1 lfo3'><![if !supportLists]><span style='mso-list:Ignore'>1.<span
  346. style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>Kernel-mode
  347. filter driver, <span class=SpellE><span style='font-family:"Courier New"'>FileSpy.sys</span></span></p>
  348. <p class=MsoListNumber style='margin-bottom:0in;margin-bottom:.0001pt;
  349. mso-list:l0 level1 lfo3'><![if !supportLists]><span style='mso-list:Ignore'>2.<span
  350. style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>User-mode
  351. application, <span style='font-family:"Courier New"'>FileSpy.exe</span></p>
  352. <p class=MsoListNumber style='margin-bottom:0in;margin-bottom:.0001pt;
  353. mso-list:l0 level1 lfo3'><![if !supportLists]><span style='mso-list:Ignore'>3.<span
  354. style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>Install
  355. method, <span class=SpellE><span style='font-family:"Courier New"'>FileSpy.inf</span></span></p>
  356. <h2>Kernel-mode Filter Driver</h2>
  357. <p class=MsoNormal style='page-break-after:avoid'>The kernel-mode filter driver
  358. is responsible for monitoring all the activity in the I/O subsystem and
  359. recording information on the activity along the IRP and Fast I/O paths for
  360. specified devices.<span style='mso-spacerun:yes'></span>The filter driver
  361. maintains a list of log records for each of the I/O operations it sees and
  362. then, at the request of the user <span class=GramE>application,</span> passes
  363. the log data up to the user application.</p>
  364. <p class=MsoNormal style='page-break-after:avoid'>The filter driver consists of
  365. the following files:</p>
  366. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
  367. style='border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt'>
  368. <tr style='mso-yfti-irow:0'>
  369. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  370. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  371. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>FileSpy.h</span></span><span
  372. style='font-family:"Courier New"'><o:p></o:p></span></p>
  373. </td>
  374. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  375. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  376. page-break-after:avoid'>Contains all the structures, types and constant
  377. definitions that are shared between the kernel mode driver, <span
  378. class=SpellE><span style='font-family:"Courier New"'>FileSpy.sys</span></span>,
  379. and the user mode executable, <span style='font-family:"Courier New"'>FileSpy.exe</span>.</p>
  380. </td>
  381. </tr>
  382. <tr style='mso-yfti-irow:1'>
  383. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  384. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  385. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>FspyKern.h</span></span><span
  386. style='font-family:"Courier New"'><o:p></o:p></span></p>
  387. </td>
  388. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  389. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  390. page-break-after:avoid'>Contains all the structures, types, constants, global
  391. variables, and function prototypes that are only visible within the kernel
  392. mode driver.</p>
  393. </td>
  394. </tr>
  395. <tr style='mso-yfti-irow:2'>
  396. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  397. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  398. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>FileSpy.c</span></span><span
  399. style='font-family:"Courier New"'><o:p></o:p></span></p>
  400. </td>
  401. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  402. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  403. page-break-after:avoid'>Contains the implementation for the driver entry
  404. point and all the callback routines this driver registers so that it is
  405. notified of I/O activity while the system is running.</p>
  406. </td>
  407. </tr>
  408. <tr style='mso-yfti-irow:3'>
  409. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  410. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  411. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>FSpyLib.c</span></span><span
  412. style='font-family:"Courier New"'><o:p></o:p></span></p>
  413. </td>
  414. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  415. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  416. widow-orphan lines-together;page-break-after:avoid'>Contains the
  417. implementation for the FileSpy helper routines.<span
  418. style='mso-spacerun:yes'>� </span>The routines provide the functionality of:</p>
  419. <p class=MsoListBullet style='margin-bottom:0in;margin-bottom:.0001pt'><![if !supportLists]><span
  420. style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
  421. Symbol'><span style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  422. </span></span></span><![endif]>Attaching to a device</p>
  423. <p class=MsoListBullet style='margin-bottom:0in;margin-bottom:.0001pt'><![if !supportLists]><span
  424. style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
  425. Symbol'><span style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  426. </span></span></span><![endif]>Detaching from a device</p>
  427. <p class=MsoListBullet style='margin-bottom:0in;margin-bottom:.0001pt'><![if !supportLists]><span
  428. style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
  429. Symbol'><span style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  430. </span></span></span><![endif]>Listing all the devices we are currently
  431. monitoring</p>
  432. <p class=MsoListBullet style='margin-bottom:0in;margin-bottom:.0001pt'><![if !supportLists]><span
  433. style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
  434. Symbol'><span style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  435. </span></span></span><![endif]>Manage the cache of filenames we keep while
  436. the system is monitoring I/O activity.</p>
  437. <p class=MsoListBullet style='margin-bottom:6.0pt'><![if !supportLists]><span
  438. style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
  439. Symbol'><span style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  440. </span></span></span><![endif]>Create, pass up and delete log records
  441. containing relevant information on the I/O activity seen.</p>
  442. </td>
  443. </tr>
  444. <tr style='mso-yfti-irow:4'>
  445. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  446. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  447. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>makefile</span></span><span
  448. style='font-family:"Courier New"'>,<br>
  449. sources<o:p></o:p></span></p>
  450. </td>
  451. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  452. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  453. page-break-after:avoid'>Files used to tell the build tool how to create <span
  454. class=SpellE><span style='font-family:"Courier New"'>FileSpy.sys</span></span>.</p>
  455. </td>
  456. </tr>
  457. <tr style='mso-yfti-irow:5;mso-yfti-lastrow:yes'>
  458. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  459. <p class=MsoNormal style='mso-pagination:widow-orphan lines-together;
  460. page-break-after:avoid'><span style='font-family:"Courier New"'>params.txt<o:p></o:p></span></p>
  461. </td>
  462. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  463. <p class=MsoNormal style='mso-pagination:widow-orphan lines-together;
  464. page-break-after:avoid'>Input file for <span style='font-family:"Courier New"'>regini.exe</span>
  465. to set the registry settings appropriately for communicating application
  466. parameters to the kernel mode driver.</p>
  467. </td>
  468. </tr>
  469. </table>
  470. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  471. <h2>User-mode Application</h2>
  472. <p class=MsoNormal style='mso-pagination:widow-orphan lines-together;
  473. page-break-after:avoid'>The user-mode application is responsible for
  474. controlling the kernel-mode filter driver and translating the log records that
  475. are returned by the driver to the user in a human-readable way (either to the
  476. screen or to a file).<span style='mso-spacerun:yes'></span>The user
  477. application uses a simple command shell to allow the user to communicate he/her
  478. directions to the driver.</p>
  479. <p class=MsoNormal style='mso-pagination:widow-orphan lines-together;
  480. page-break-after:avoid'>The user application consists of the following files:</p>
  481. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
  482. style='border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt'>
  483. <tr style='mso-yfti-irow:0;page-break-inside:avoid'>
  484. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  485. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  486. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>fSpyLog.h</span></span><span
  487. style='font-family:"Courier New"'><o:p></o:p></span></p>
  488. </td>
  489. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  490. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  491. page-break-after:avoid'>Contains the structures, prototypes and constant
  492. definitions that are visible only to the user application.</p>
  493. </td>
  494. </tr>
  495. <tr style='mso-yfti-irow:1;page-break-inside:avoid'>
  496. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  497. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  498. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>fSpyLog.c</span></span><span
  499. style='font-family:"Courier New"'><o:p></o:p></span></p>
  500. </td>
  501. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  502. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  503. page-break-after:avoid'>Contains the implementation for retrieving the log
  504. records from the kernel driver and displaying the log records to the user
  505. either through the screen or through a file.</p>
  506. </td>
  507. </tr>
  508. <tr style='mso-yfti-irow:2;page-break-inside:avoid'>
  509. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  510. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  511. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>FSpyUser.c</span></span><span
  512. style='font-family:"Courier New"'><o:p></o:p></span></p>
  513. </td>
  514. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  515. <p class=MsoNormal style='margin-bottom:6.0pt;mso-pagination:widow-orphan lines-together;
  516. page-break-after:avoid'>Contains the implementation for the main function of
  517. the user application that opens the FileSpy device, starts up the thread that
  518. continually queries the kernel mode driver for new log records, and
  519. interprets the user�s commands to the application.</p>
  520. </td>
  521. </tr>
  522. <tr style='mso-yfti-irow:3;mso-yfti-lastrow:yes;page-break-inside:avoid'>
  523. <td width=115 valign=top style='width:1.2in;padding:0in 5.4pt 0in 5.4pt'>
  524. <p class=MsoNormal style='mso-pagination:widow-orphan lines-together;
  525. page-break-after:avoid'><span class=SpellE><span style='font-family:"Courier New"'>makefile</span></span><span
  526. style='font-family:"Courier New"'>,<br>
  527. sources<o:p></o:p></span></p>
  528. </td>
  529. <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  530. <p class=MsoNormal>Files used to tell the build tool how to create <span
  531. style='font-family:"Courier New"'>FileSpy.exe</span>.</p>
  532. </td>
  533. </tr>
  534. </table>
  535. <h3>Running the user-mode application</h3>
  536. <p class=MsoNormal>To run the user application:</p>
  537. <p class=MsoListBullet style='margin-bottom:6.0pt'><![if !supportLists]><span
  538. style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
  539. Symbol'><span style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  540. </span></span></span><![endif]>Build the user application�s executable, <span
  541. style='font-family:"Courier New"'>FileSpy.exe</span>.</p>
  542. <p class=MsoListBullet style='margin-bottom:6.0pt'><![if !supportLists]><span
  543. style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
  544. Symbol'><span style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  545. </span></span></span><![endif]>The application has to modes, running mode and
  546. command mode.<span style='mso-spacerun:yes'></span>In running mode, the
  547. application prints any log output that it has collected to the screen if it is
  548. supposed to be outputting information to the screen.<span
  549. style='mso-spacerun:yes'>� </span>In command mode, the user is able to direct
  550. the behavior of the kernel driver through a series of command switches defined
  551. below.<span style='mso-spacerun:yes'></span>When the application begins, it
  552. is in running mode.<span style='mso-spacerun:yes'></span>To change to command
  553. mode when currently in running mode, hit <span style='font-family:"Courier New"'>Enter</span>.<span
  554. style='mso-spacerun:yes'>� </span>A <span style='font-family:"Courier New"'>&gt;</span>
  555. prompt should appear to signify the application is in command mode.</p>
  556. <p class=MsoListBullet style='mso-pagination:widow-orphan lines-together;
  557. page-break-after:avoid'><![if !supportLists]><span style='font-family:Symbol;
  558. mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
  559. style='mso-list:Ignore'>�<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  560. </span></span></span><![endif]>The following commands are available at the
  561. command line or in command mode.</p>
  562. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=552
  563. style='width:5.75in;margin-left:23.4pt;border-collapse:collapse;mso-padding-alt:
  564. 0in 5.4pt 0in 5.4pt'>
  565. <tr style='mso-yfti-irow:0'>
  566. <td width=163 valign=top style='width:1.7in;padding:0in 5.4pt 0in 5.4pt'>
  567. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  568. widow-orphan lines-together;page-break-after:avoid'><span style='font-family:
  569. "Courier New"'>/a &lt;drive&gt;<o:p></o:p></span></p>
  570. </td>
  571. <td width=389 valign=top style='width:4.05in;padding:0in 5.4pt 0in 5.4pt'>
  572. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  573. widow-orphan lines-together;page-break-after:avoid'>Attaches monitor to <span
  574. style='font-family:"Courier New"'>&lt;drive&gt;</span>, where <span
  575. style='font-family:"Courier New"'>&lt;drive&gt;</span> is a valid drive
  576. letter in the system (e.g., <span class=GramE><span style='font-family:"Courier New"'>C:</span></span>).</p>
  577. </td>
  578. </tr>
  579. <tr style='mso-yfti-irow:1'>
  580. <td width=163 valign=top style='width:1.7in;padding:0in 5.4pt 0in 5.4pt'>
  581. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  582. widow-orphan lines-together;page-break-after:avoid'><span style='font-family:
  583. "Courier New"'>/d &lt;drive&gt;<o:p></o:p></span></p>
  584. </td>
  585. <td width=389 valign=top style='width:4.05in;padding:0in 5.4pt 0in 5.4pt'>
  586. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  587. widow-orphan lines-together;page-break-after:avoid'>Detaches monitor to <span
  588. style='font-family:"Courier New"'>&lt;drive&gt;</span>, where <span
  589. style='font-family:"Courier New"'>&lt;drive&gt;</span> is a valid drive
  590. letter in the system (e.g., <span class=GramE><span style='font-family:"Courier New"'>C:</span></span>)
  591. that the monitor has previously attached to.</p>
  592. </td>
  593. </tr>
  594. <tr style='mso-yfti-irow:2;page-break-inside:avoid'>
  595. <td width=552 colspan=2 valign=top style='width:5.75in;padding:0in 5.4pt 0in 5.4pt'>
  596. <p class=MsoNormal style='margin-top:0in;margin-right:0in;margin-bottom:0in;
  597. margin-left:.5in;margin-bottom:.0001pt;mso-pagination:widow-orphan lines-together;
  598. page-break-after:avoid'><i>Note:</i><span style='mso-spacerun:yes'>
  599. </span>The monitor may not truly detach from the device when it receives the <span
  600. style='font-family:"Courier New"'>/d</span> command because a filter driver
  601. can only detach from a device when it can guarantee that it is on the top of
  602. the I/O stack.<span style='mso-spacerun:yes'></span>This is only going to
  603. occur when the filter driver receives the detach command from the I/O Manager.<span
  604. style='mso-spacerun:yes'>� </span>When the user application tells the kernel
  605. driver to detach from a device, the kernel monitor stops logging the data for
  606. that device.</p>
  607. <p class=MsoNormal style='margin-top:0in;margin-right:0in;margin-bottom:0in;
  608. margin-left:.5in;margin-bottom:.0001pt;mso-pagination:widow-orphan lines-together;
  609. page-break-after:avoid'><i>Also note:</i><span style='mso-spacerun:yes'>
  610. </span>Shutting down the user application does <i>not</i> cause the kernel
  611. monitor to detach from all the drives.<span style='mso-spacerun:yes'>
  612. </span>The kernel driver will stop logging the I/O operations that it is
  613. seeing, but if the user restarts the user application, the kernel monitor
  614. will continue logging to the devices that it was attached to when the user
  615. application last stopped.<span style='mso-spacerun:yes'></span>The kernel
  616. driver will only reset these attachments to system devices when the system is
  617. rebooted.</p>
  618. </td>
  619. </tr>
  620. <tr style='mso-yfti-irow:3'>
  621. <td width=163 valign=top style='width:1.7in;padding:0in 5.4pt 0in 5.4pt'>
  622. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  623. widow-orphan lines-together;page-break-after:avoid'><span style='font-family:
  624. "Courier New"'>/h<o:p></o:p></span></p>
  625. </td>
  626. <td width=389 valign=top style='width:4.05in;padding:0in 5.4pt 0in 5.4pt'>
  627. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  628. widow-orphan lines-together;page-break-after:avoid'>Lists statistics on hash
  629. table used to store file names.</p>
  630. </td>
  631. </tr>
  632. <tr style='mso-yfti-irow:4'>
  633. <td width=163 valign=top style='width:1.7in;padding:0in 5.4pt 0in 5.4pt'>
  634. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  635. widow-orphan lines-together;page-break-after:avoid'><span style='font-family:
  636. "Courier New"'>/l<o:p></o:p></span></p>
  637. </td>
  638. <td width=389 valign=top style='width:4.05in;padding:0in 5.4pt 0in 5.4pt'>
  639. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  640. widow-orphan lines-together;page-break-after:avoid'>Lists all the drives that
  641. the kernel driver is monitoring.</p>
  642. </td>
  643. </tr>
  644. <tr style='mso-yfti-irow:5'>
  645. <td width=163 valign=top style='width:1.7in;padding:0in 5.4pt 0in 5.4pt'>
  646. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  647. widow-orphan lines-together;page-break-after:avoid'><span style='font-family:
  648. "Courier New"'>/s<o:p></o:p></span></p>
  649. </td>
  650. <td width=389 valign=top style='width:4.05in;padding:0in 5.4pt 0in 5.4pt'>
  651. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  652. widow-orphan lines-together;page-break-after:avoid'>Toggles on and off
  653. showing the logging output to the screen.<span style='mso-spacerun:yes'>
  654. </span>When the application is started, the default behavior is to show
  655. logging output to the screen.</p>
  656. </td>
  657. </tr>
  658. <tr style='mso-yfti-irow:6'>
  659. <td width=163 valign=top style='width:1.7in;padding:0in 5.4pt 0in 5.4pt'>
  660. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  661. widow-orphan lines-together;page-break-after:avoid'><span style='font-family:
  662. "Courier New"'>/f [&lt;filename&gt;]<o:p></o:p></span></p>
  663. </td>
  664. <td width=389 valign=top style='width:4.05in;padding:0in 5.4pt 0in 5.4pt'>
  665. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  666. widow-orphan lines-together;page-break-after:avoid'>Toggles on and off
  667. writing the logging output to a file.<span style='mso-spacerun:yes'>
  668. </span>If issuing the <span style='font-family:"Courier New";mso-bidi-font-family:
  669. "Times New Roman"'>/f</span> command will toggle on writing output to a file,
  670. the required <span style='font-family:"Courier New"'>&lt;filename&gt;</span>
  671. specifies the output file name.<span style='mso-spacerun:yes'></span>If the
  672. <span style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>/f</span>
  673. command will toggle off the writing output to a file, the <span
  674. style='font-family:"Courier New"'>&lt;filename&gt;</span> is ignored and not
  675. required.<span style='mso-spacerun:yes'></span>By default, the logging
  676. output is <i>not</i> stored to a file.</p>
  677. </td>
  678. </tr>
  679. <tr style='mso-yfti-irow:7'>
  680. <td width=163 valign=top style='width:1.7in;padding:0in 5.4pt 0in 5.4pt'>
  681. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  682. widow-orphan lines-together;page-break-after:avoid'><span class=SpellE><span
  683. style='font-family:"Courier New"'>go|g</span></span><span style='font-family:
  684. "Courier New"'><o:p></o:p></span></p>
  685. </td>
  686. <td width=389 valign=top style='width:4.05in;padding:0in 5.4pt 0in 5.4pt'>
  687. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;mso-pagination:
  688. widow-orphan lines-together;page-break-after:avoid'>Exits the user from
  689. command mode and will allow the user application to show logging output on
  690. the screen again if the program is set to do so.</p>
  691. </td>
  692. </tr>
  693. <tr style='mso-yfti-irow:8;mso-yfti-lastrow:yes'>
  694. <td width=163 valign=top style='width:1.7in;padding:0in 5.4pt 0in 5.4pt'>
  695. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'><span
  696. style='font-family:"Courier New"'>Exit<o:p></o:p></span></p>
  697. </td>
  698. <td width=389 valign=top style='width:4.05in;padding:0in 5.4pt 0in 5.4pt'>
  699. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>Shuts down
  700. the user application.</p>
  701. </td>
  702. </tr>
  703. </table>
  704. <h3>Logging Output Format</h3>
  705. <p class=MsoNormal>The logging information that is output either to the screen
  706. and/or to a file (as specified by the user commands) is the same.<span
  707. style='mso-spacerun:yes'>� </span>(<i>Note:<span style='mso-spacerun:yes'>
  708. </span></i>We do log different information for I/O operations along the Irp
  709. path versus I/O operations along the Fast I/O path.)<span
  710. style='mso-spacerun:yes'>� </span>The only difference is that the fields are
  711. tab-delimited when writing to file to make the data easier to analyze.<span
  712. style='mso-spacerun:yes'>� </span>The data written to the screen has been
  713. compacted to make it easier to read (although you still want your Command
  714. Window to be extra wide).</p>
  715. <p class=MsoNormal>If the memory limit is hit when logging I/O operations, a
  716. message saying that the system is out of memory will appear in the log.<span
  717. style='mso-spacerun:yes'>� </span>The user can see how many I/O operations were
  718. not logged by looking at the sequence numbers of the log records once the
  719. memory pressure has been relieved.</p>
  720. <p class=MsoNormal>The exact format of the data output in each case is
  721. described below:</p>
  722. <h4>Output Format for Irp Operations</h4>
  723. <p class=MsoNormal style='page-break-after:avoid'>These fields appear from left
  724. to right, across the screen.</p>
  725. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
  726. style='border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt'>
  727. <tr style='mso-yfti-irow:0'>
  728. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  729. <p class=MsoNormal style='page-break-after:avoid'>I</p>
  730. </td>
  731. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  732. <p class=MsoNormal style='page-break-after:avoid'>Designates that this is an
  733. I/O operation along the Irp path.</p>
  734. </td>
  735. </tr>
  736. <tr style='mso-yfti-irow:1'>
  737. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  738. <h5>Sequence Number</h5>
  739. </td>
  740. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  741. <p class=MsoNormal style='page-break-after:avoid'>The sequence number for
  742. this operation.</p>
  743. </td>
  744. </tr>
  745. <tr style='mso-yfti-irow:2'>
  746. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  747. <h5>Originating Time</h5>
  748. </td>
  749. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  750. <p class=MsoNormal style='page-break-after:avoid'>The time this I/O operation
  751. began.</p>
  752. </td>
  753. </tr>
  754. <tr style='mso-yfti-irow:3'>
  755. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  756. <h5>Completion Time</h5>
  757. </td>
  758. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  759. <p class=MsoNormal style='page-break-after:avoid'>The time this I/O operation
  760. ended.</p>
  761. </td>
  762. </tr>
  763. <tr style='mso-yfti-irow:4'>
  764. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  765. <h5>Processes Id and Thread Id</h5>
  766. </td>
  767. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  768. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  769. process and thread id for the thread that originated this I/O operation.<span
  770. style='mso-spacerun:yes'>� </span>These values are in <span class=SpellE><i>processId.threaded</i></span><i>
  771. </i>format.</p>
  772. </td>
  773. </tr>
  774. <tr style='mso-yfti-irow:5'>
  775. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  776. <h5>Irp Major Code and Irp Minor Code Names</h5>
  777. </td>
  778. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  779. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  780. name of the Irp major code for this operation.<span
  781. style='mso-spacerun:yes'>� </span>The name of the Irp minor code for this
  782. operation, if there is one (the screen display has this on a separate line).</p>
  783. </td>
  784. </tr>
  785. <tr style='mso-yfti-irow:6'>
  786. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  787. <h5>DeviceObject</h5>
  788. </td>
  789. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  790. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  791. pointer value representing the Device Object for this operation.</p>
  792. </td>
  793. </tr>
  794. <tr style='mso-yfti-irow:7'>
  795. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  796. <h5><span class=SpellE>FileObject</span></h5>
  797. </td>
  798. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  799. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  800. pointer value representing the File Object for this operation.</p>
  801. </td>
  802. </tr>
  803. <tr style='mso-yfti-irow:8'>
  804. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  805. <h5>Return Status and Information</h5>
  806. </td>
  807. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  808. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  809. numeric values for both the return status and return Information fields (look
  810. in <span class=SpellE>ntstatus.h</span> to see the description for the return
  811. value).<span style='mso-spacerun:yes'></span>These values are in the <span
  812. class=SpellE><i>status<span class=GramE>:information</span></i></span>
  813. format.</p>
  814. </td>
  815. </tr>
  816. <tr style='mso-yfti-irow:9'>
  817. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  818. <h5>Irp Flags</h5>
  819. </td>
  820. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  821. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  822. numeric value for the Irp flags</p>
  823. </td>
  824. </tr>
  825. <tr style='mso-yfti-irow:10'>
  826. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  827. <h5>Interpretation of Common Irp flags</h5>
  828. </td>
  829. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  830. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>Four
  831. columns with either a letter or a �-� to designate different Irp flags being
  832. set;</p>
  833. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;page-break-after:
  834. avoid'>N � <span class=SpellE>NoCache</span> flag was set</p>
  835. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;page-break-after:
  836. avoid'>P � Paging IO flag was set</p>
  837. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;page-break-after:
  838. avoid'>S � Synchronous <span class=SpellE>Api</span> flag was set</p>
  839. <p class=MsoNormal style='page-break-after:avoid'>Y � Synchronous Paging IO
  840. flag was set</p>
  841. </td>
  842. </tr>
  843. <tr style='mso-yfti-irow:11;mso-yfti-lastrow:yes'>
  844. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  845. <h5 style='page-break-after:auto'>Name</h5>
  846. </td>
  847. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  848. <p class=MsoNormal style='margin-bottom:6.0pt'>If available, the name of the
  849. file.</p>
  850. </td>
  851. </tr>
  852. </table>
  853. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  854. <h4>Output Format for Fast I/O Operations</h4>
  855. <p class=MsoNormal style='page-break-after:avoid'>These fields appear from left
  856. to right, across the screen.</p>
  857. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
  858. style='border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt'>
  859. <tr style='mso-yfti-irow:0'>
  860. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  861. <p class=MsoNormal style='page-break-after:avoid'>F</p>
  862. </td>
  863. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  864. <p class=MsoNormal style='page-break-after:avoid'>Designates that this is an
  865. I/O operation along the FastIO path.</p>
  866. </td>
  867. </tr>
  868. <tr style='mso-yfti-irow:1'>
  869. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  870. <h5>Sequence Number</h5>
  871. </td>
  872. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  873. <p class=MsoNormal style='page-break-after:avoid'>The sequence number for
  874. this operation.</p>
  875. </td>
  876. </tr>
  877. <tr style='mso-yfti-irow:2'>
  878. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  879. <h5>Originating Time</h5>
  880. </td>
  881. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  882. <p class=MsoNormal style='page-break-after:avoid'>The time this I/O operation
  883. began.</p>
  884. </td>
  885. </tr>
  886. <tr style='mso-yfti-irow:3'>
  887. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  888. <h5>Completion Time</h5>
  889. </td>
  890. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  891. <p class=MsoNormal style='page-break-after:avoid'>The time this I/O operation
  892. ended.</p>
  893. </td>
  894. </tr>
  895. <tr style='mso-yfti-irow:4'>
  896. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  897. <h5>Processes Id and Thread Id</h5>
  898. </td>
  899. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  900. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  901. process and thread id for the thread that originated this I/O operation.<span
  902. style='mso-spacerun:yes'>� </span>These values are shown in the format <span
  903. class=SpellE><i>processId.threadId</i></span>.</p>
  904. </td>
  905. </tr>
  906. <tr style='mso-yfti-irow:5'>
  907. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  908. <h5>Fast I/O Operation Name</h5>
  909. </td>
  910. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  911. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  912. name type of Fast I/O operation.</p>
  913. </td>
  914. </tr>
  915. <tr style='mso-yfti-irow:6'>
  916. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  917. <h5>DeviceObject</h5>
  918. </td>
  919. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  920. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>If
  921. available, the pointer value representing the Device Object for this
  922. operation.</p>
  923. </td>
  924. </tr>
  925. <tr style='mso-yfti-irow:7'>
  926. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  927. <h5><span class=SpellE>FileObject</span></h5>
  928. </td>
  929. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  930. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>If
  931. available, the pointer value representing the File Object for this operation.</p>
  932. </td>
  933. </tr>
  934. <tr style='mso-yfti-irow:8'>
  935. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  936. <h5>Return Status</h5>
  937. </td>
  938. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  939. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  940. numeric value for the return status for this operation (look in <span
  941. class=SpellE>ntstatus.h</span> to see the description for the return value).</p>
  942. </td>
  943. </tr>
  944. <tr style='mso-yfti-irow:9'>
  945. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  946. <h5>Wait</h5>
  947. </td>
  948. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  949. <p class=MsoNormal style='page-break-after:avoid'>If available, �T� if this
  950. Fast I/O operation was called with the <i>Wait</i> parameter set to <span
  951. class=GramE>TRUE, and �F�</span> if the <i>wait</i> parameter was set to
  952. FALSE.</p>
  953. </td>
  954. </tr>
  955. <tr style='mso-yfti-irow:10'>
  956. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  957. <h5>Length</h5>
  958. </td>
  959. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  960. <p class=MsoNormal style='page-break-after:avoid'>If available, the number of
  961. bytes in the operation.</p>
  962. </td>
  963. </tr>
  964. <tr style='mso-yfti-irow:11'>
  965. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  966. <h5>File Offset</h5>
  967. </td>
  968. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  969. <p class=MsoNormal style='page-break-after:avoid'>If available, the offset
  970. into the file for this operation.</p>
  971. </td>
  972. </tr>
  973. <tr style='mso-yfti-irow:12;mso-yfti-lastrow:yes'>
  974. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  975. <h5 style='page-break-after:auto'>Name</h5>
  976. </td>
  977. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  978. <p class=MsoNormal style='margin-bottom:6.0pt'>If available, the name of the
  979. file.</p>
  980. </td>
  981. </tr>
  982. </table>
  983. <h4>Output Format for <span class=SpellE>FsFilter</span> Operations</h4>
  984. <p class=MsoNormal style='page-break-after:avoid'>These fields appear from left
  985. to right, across the screen.</p>
  986. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
  987. style='border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt'>
  988. <tr style='mso-yfti-irow:0'>
  989. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  990. <p class=MsoNormal style='page-break-after:avoid'>O</p>
  991. </td>
  992. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  993. <p class=MsoNormal style='page-break-after:avoid'>Designates that this is an
  994. operation along the <span class=SpellE>FsFilter</span> Operation path.</p>
  995. </td>
  996. </tr>
  997. <tr style='mso-yfti-irow:1'>
  998. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  999. <h5>Sequence Number</h5>
  1000. </td>
  1001. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1002. <p class=MsoNormal style='page-break-after:avoid'>The sequence number for
  1003. this operation.</p>
  1004. </td>
  1005. </tr>
  1006. <tr style='mso-yfti-irow:2'>
  1007. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1008. <h5>Originating Time</h5>
  1009. </td>
  1010. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1011. <p class=MsoNormal style='page-break-after:avoid'>The time this I/O operation
  1012. began.</p>
  1013. </td>
  1014. </tr>
  1015. <tr style='mso-yfti-irow:3'>
  1016. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1017. <h5>Completion Time</h5>
  1018. </td>
  1019. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1020. <p class=MsoNormal style='page-break-after:avoid'>The time this I/O operation
  1021. ended.</p>
  1022. </td>
  1023. </tr>
  1024. <tr style='mso-yfti-irow:4'>
  1025. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1026. <h5>Processes Id and Thread Id</h5>
  1027. </td>
  1028. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1029. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  1030. process and thread id for the thread that originated this I/O operation.<span
  1031. style='mso-spacerun:yes'>� </span>These values are shown in the format <span
  1032. class=SpellE><i>processId.threadId</i></span>.</p>
  1033. </td>
  1034. </tr>
  1035. <tr style='mso-yfti-irow:5'>
  1036. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1037. <h5><span class=SpellE>FsFilter</span> Operation Name</h5>
  1038. </td>
  1039. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1040. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  1041. name type of <span class=SpellE>FsFilter</span> operation.</p>
  1042. </td>
  1043. </tr>
  1044. <tr style='mso-yfti-irow:6'>
  1045. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1046. <h5>DeviceObject</h5>
  1047. </td>
  1048. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1049. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>If
  1050. available, the pointer value representing the Device Object for this
  1051. operation.</p>
  1052. </td>
  1053. </tr>
  1054. <tr style='mso-yfti-irow:7'>
  1055. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1056. <h5><span class=SpellE>FileObject</span></h5>
  1057. </td>
  1058. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1059. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>If
  1060. available, the pointer value representing the File Object for this operation.</p>
  1061. </td>
  1062. </tr>
  1063. <tr style='mso-yfti-irow:8'>
  1064. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1065. <h5>Return Status</h5>
  1066. </td>
  1067. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1068. <p class=MsoNormal style='margin-bottom:6.0pt;page-break-after:avoid'>The
  1069. numeric value for the return status for this operation (look in <span
  1070. class=SpellE>ntstatus.h</span> to see the description for the return value).</p>
  1071. </td>
  1072. </tr>
  1073. <tr style='mso-yfti-irow:9;mso-yfti-lastrow:yes'>
  1074. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1075. <h5 style='page-break-after:auto'>Name</h5>
  1076. </td>
  1077. <td width=295 valign=top style='width:221.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1078. <p class=MsoNormal style='margin-bottom:6.0pt'>If available, the name of the
  1079. file.</p>
  1080. </td>
  1081. </tr>
  1082. </table>
  1083. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  1084. <h2>Filter Driver Install Program</h2>
  1085. <p class=MsoNormal>FileSpy now comes with an INF that will install the filter
  1086. driver and the user mode control program.<span style='mso-spacerun:yes'>
  1087. </span>To install, do the following:</p>
  1088. <ul style='margin-top:0in' type=square>
  1089. <li class=MsoNormal style='margin-bottom:6.0pt;mso-list:l2 level1 lfo9;
  1090. tab-stops:list .5in'>Make sure that <span style='font-family:"Courier New"'>filespy.exe</span>,
  1091. <span class=SpellE><span style='font-family:"Courier New";mso-bidi-font-family:
  1092. "Times New Roman"'>filespy.sys</span></span> and <span class=SpellE><span
  1093. style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>filespy.inf</span></span>
  1094. are all in the same directory.</li>
  1095. <li class=MsoNormal style='margin-bottom:6.0pt;mso-list:l2 level1 lfo9;
  1096. tab-stops:list .5in'>Right-click on the <span class=SpellE><span
  1097. style='font-family:"Courier New"'>filespy.inf</span></span> through
  1098. Explorer.</li>
  1099. <li class=MsoNormal style='mso-list:l2 level1 lfo9;tab-stops:list .5in'>Select
  1100. the Install option.</li>
  1101. </ul>
  1102. <p class=MsoNormal>This will make the necessary registry updates to register
  1103. the FileSpy service, place <span class=SpellE><span style='font-family:"Courier New";
  1104. mso-bidi-font-family:"Times New Roman"'>filespy.sys</span></span> in the <span
  1105. style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>%SystemRoot%\system32\drivers</span>
  1106. directory, place <span style='font-family:"Courier New";mso-bidi-font-family:
  1107. "Times New Roman"'>filespy.exe</span> in <span style='font-family:"Courier New";
  1108. mso-bidi-font-family:"Times New Roman"'>%<span class=SpellE>SystemRoot%\filespy</span></span>
  1109. directory and add the following registry entries:</p>
  1110. <p class=MsoNormal><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  1111. font-family:"Courier New"'>[HKEY_LOCAL_MACHINE]\System\<span class=SpellE>CurrentControlSet\Services\FileSpy</span><o:p></o:p></span></p>
  1112. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
  1113. style='border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt'>
  1114. <tr style='mso-yfti-irow:0'>
  1115. <td width=139 valign=top style='width:1.45in;padding:0in 5.4pt 0in 5.4pt'>
  1116. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'><span
  1117. class=SpellE><span style='font-family:"Courier New"'>MaxRecords</span></span><span
  1118. style='font-family:"Courier New"'><o:p></o:p></span></p>
  1119. </td>
  1120. <td width=108 valign=top style='width:81.0pt;padding:0in 5.4pt 0in 5.4pt'>
  1121. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'><span
  1122. style='font-family:"Courier New"'>DWORD<o:p></o:p></span></p>
  1123. </td>
  1124. <td width=343 valign=top style='width:257.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1125. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>The
  1126. maximum number of log records to have outstanding at any one time.<span
  1127. style='mso-spacerun:yes'>� </span>Default=500.</p>
  1128. </td>
  1129. </tr>
  1130. <tr style='mso-yfti-irow:1'>
  1131. <td width=139 valign=top style='width:1.45in;padding:0in 5.4pt 0in 5.4pt'>
  1132. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'><span
  1133. class=SpellE><span style='font-family:"Courier New"'>MaxNames</span></span><span
  1134. style='font-family:"Courier New"'><o:p></o:p></span></p>
  1135. </td>
  1136. <td width=108 valign=top style='width:81.0pt;padding:0in 5.4pt 0in 5.4pt'>
  1137. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'><span
  1138. style='font-family:"Courier New"'>DWORD<o:p></o:p></span></p>
  1139. </td>
  1140. <td width=343 valign=top style='width:257.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1141. <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>The
  1142. maximum number of name buffers to have outstanding at any one time.<span
  1143. style='mso-spacerun:yes'>� </span>Default=500.</p>
  1144. </td>
  1145. </tr>
  1146. <tr style='mso-yfti-irow:2;mso-yfti-lastrow:yes'>
  1147. <td width=139 valign=top style='width:1.45in;padding:0in 5.4pt 0in 5.4pt'>
  1148. <p class=MsoNormal><span class=SpellE><span style='font-family:"Courier New"'>AttachMode</span></span><span
  1149. style='font-family:"Courier New"'><o:p></o:p></span></p>
  1150. </td>
  1151. <td width=108 valign=top style='width:81.0pt;padding:0in 5.4pt 0in 5.4pt'>
  1152. <p class=MsoNormal><span style='font-family:"Courier New"'>DWORD<o:p></o:p></span></p>
  1153. </td>
  1154. <td width=343 valign=top style='width:257.4pt;padding:0in 5.4pt 0in 5.4pt'>
  1155. <p class=MsoNormal>Specify how you want FileSpy to attach to volumes.</p>
  1156. <p class=MsoList style='mso-list:l5 level1 lfo8;tab-stops:list .25in'><![if !supportLists]><span
  1157. style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1158. </span></span><![endif]>Attach on demand.</p>
  1159. <p class=MsoList style='mso-list:l5 level1 lfo8;tab-stops:list .25in'><![if !supportLists]><span
  1160. style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1161. </span></span><![endif]>Attach to ALL volumes when the filter loads.<span
  1162. style='mso-spacerun:yes'>� </span>This does <b>not</b> mean that volumes are
  1163. being logged, that happens when a user explicitly requests it.<span
  1164. style='mso-spacerun:yes'>� </span>This is used to control attachment order
  1165. with other filters.</p>
  1166. <p class=MsoNormal>Default=2</p>
  1167. </td>
  1168. </tr>
  1169. </table>
  1170. <h2>Filter Driver Uninstall</h2>
  1171. <p class=MsoNormal>To uninstall the kernel-mode driver for FileSpy, you need to
  1172. run �<b>sc delete <span class=SpellE>filespy</span></b>�.<span
  1173. style='mso-spacerun:yes'>� </span>This will remove the service from the
  1174. system.<span style='mso-spacerun:yes'></span>After running this program, you
  1175. will need to reboot the machine to complete the removal of FileSpy.</p>
  1176. </div>
  1177. </body>
  1178. </html>