From: SMTP%"davidg@balder.com" 27-JAN-1998 16:33:29.02 To: "'basudeb'" CC: "'ntfsd@atria.com'" Subj: RE: [ntfsd] More on FSD Filter eating away resources Hi Basudeb, > -----Original Message----- > From: basudeb [SMTP:basudeb@giascl01.vsnl.net.in] > Sent: Monday, January 26, 1998 9:56 AM > To: David Goebel > Cc: ntfsd@atria.com > Subject: RE: [ntfsd] More on FSD Filter eating away resources >=20 > At 07:46 PM 1/23/98 -0800, you wrote: > >Hi, > > > >short answer: > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >Use IoBuildSynchronousFsdRequest(). It's simple, safe, and was > designed > >for exactly what you are trying to do. For an example of how to use > it > >look at FatPerformVerifyDiskRead() in fastfat\fsctrl.c. > > >=20 > As per your recommendation, I replaced my code below (Never mind the > spelling mistakes if any, the program compiles). >=20 > which gives me page fault in the very fast time !!!!!! > =09 > So, it appears that my IRP building code was better. And the feeling > that > Filter development is akin to voodoo, just refuses to leave my mind. >=20 I can appreciate your frustration, but these NT I/O routines really do work. If you are at APC level (servicing a page fault or somebody called you holding a FAST_MUTEX for some weird reason for instance), then you should use IoBuildAsynchronousFsdRequest() (see FatMarkVolumeClean() in fastfat\verfysup.c for an example and a comment describing why being at APC level is a problem). The symptom of this problem is a deadlock though, not a blue screen. What does your stack backtrace look like? > >* There are many fields missing in NewIrp that may cause problems > >in the next release (or next service pack). >=20 > Are you aware of any such field now ? >=20 Yes, but that's not the point. There may be more in the next release = or next service pack. If you use documented system services, they will continue to work from release to release. > > > >* Setting IRP_NOCACHE on a potentially cached FileObject is a bit > >on the wild side. Use at your own risk. > > >=20 > How do I avoid this, if I really want to monitor every read > and > write? I have taken care to add the appropriate Flag during = Create.... >=20 in this case the IRP_NOCACHE flag should already be set. > So, I remain where I was. Thanks for your help. I would request you, > and > others to give me a pointer or sample code, to do just what I want, > i.e. > hook FSD, like it is done in FILEMON.C, take up a READ call, read it > in own > buffer and then copy it back to user and return it to the caller. And > of > course, no caching. Is it too much of a confidential knowledge even > today? >=20 > Basudeb >=20 You can take a look at FatNonCachedNonAlignedRead() in fastfat\deviosup.c. This code is responsible for performing non-sector aligned non-cached I/O. It does this by allocating a sector of non-paged pool as a temp buffer to read with and copies this into the user's buffer. This code also takes advantage of reusing the same Irp several times since it never gets fully completed, i.e. it doesn't need a new Irp. I hope this routine helps. David -------------------------------------------- Balder Technology Group, Inc. IFS Design Consulting Services for Windows NT=AE see http://www.balder.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntfsd-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ] ================== RFC 822 Headers ================== Return-Path: owner-ntfsd@atria.com Received: by norlmn.gce.com (UCX X4.2-14, OpenVMS E7.1-1H1 Alpha); Tue, 27 Jan 1998 16:33:08 -0500 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id QAA26715 for ; Tue, 27 Jan 1998 16:28:14 -0500 (EST) Received: by gw.atria.com id Tue, 27 Jan 1998 13:23:41 -0500 Received: from ivy-balder.glitnir by gw.atria.com id Tue, 27 Jan 1998 13:23:34 -0500 Received: by gen-161-31.slip-stream.net with Internet Mail Service (5.5.1960.3) id ; Tue, 27 Jan 1998 10:17:56 -0800 Message-ID: From: David Goebel To: "'basudeb'" Cc: "'ntfsd@atria.com'" Subject: RE: [ntfsd] More on FSD Filter eating away resources Date: Tue, 27 Jan 1998 10:17:52 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.1960.3) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: owner-ntfsd@atria.com Precedence: bulk X-Majordomo-Taboo: ntfsd