From: SMTP%"mason@osr.com" 2-DEC-1997 16:29:21.44 To: Soccorsa Le Boulaire , "'ntfsd@atria.com'" CC: Subj: Re: [ntfsd] File System synchronous notification Return-Path: owner-ntfsd@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Tue, 2 Dec 1997 16:24:51 -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 OAA10585 for ; Tue, 2 Dec 1997 14:00:03 -0500 (EST) Received: by gw.atria.com id Tue, 2 Dec 1997 11:23:29 -0500 Received: from relay4.smtp.psi.net by gw.atria.com id Tue, 2 Dec 1997 11:23:16 -0500 Received: from queball.osr.com by relay4.smtp.psi.net (8.8.3/SMI-5.4-PSI) id LAA12464; Tue, 2 Dec 1997 11:23:03 -0500 (EST) Received: from feanor.osr.com by queball.osr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.0.1457.7) id YCADLHVG; Tue, 2 Dec 1997 11:22:29 -0000 Message-Id: <3.0.3.32.19971202112037.00c0eb40@mailserver.osr.com> X-Sender: mason@mailserver.osr.com X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (32) Date: Tue, 02 Dec 1997 11:20:37 -0500 To: Soccorsa Le Boulaire , "'ntfsd@atria.com'" From: Tony Mason Subject: Re: [ntfsd] File System synchronous notification In-Reply-To: <606D09C39921D011A8AE00805F48B835010BCC12@LUL-04-MSG> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-ntfsd@atria.com Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- At 05:14 AM 12/2/97 -0800, Soccorsa Le Boulaire wrote: >Hi, > >My customer is developping a NT removable disk driver on NT 4.0. He asks me >if it is a way to notify the file system when a file has changed on his >disk? > >He knows that the file system can ask informations with >IRP_DISK_CHECK_VERIFY > and volume informations are updated when he returns STATUS_VERIFY_REQUIRED >with the flag DO_VERIFY_VOLUME. >But, How can he synchronously notify File System of changes on his media? > >Is it possible and if yes how? >I found nothing about that in NT 4.0 ddk documentation. >Thanks Actually, it is sufficient for him to just attempt to open the volume in question. Thus, he can extract the name of his physical media device object (assuming he doesn't already know what it is) and then attempt to access the device (either via IoGetDeviceObjectPointer or ZwCreateFile, both of which will cause the file system to notice that the media has changed.) This only works on file systems which support media verification, which eliminates NTFS from consideration but does solve the problem for FAT and CDFS. NTFS has limited ability to correctly handle changing media below it. This is principally because NTFS tends to cache quite a lot of information in memory. Thus "changing" the volume means that the cached information is lost. On the other hand, if you simply indicate a volume change and NTFS finds it is the same volume, the old cached information is retained. Thus, for NTFS the only "solution" I've found that works reliably is to dismount the volume and remount it (see the Win32 SDK documentation on DeviceIoControl for a description of the sequence used - locking the volume, dismounting it, unlocking it.) This approach only works if there are no files opened on the volume - well, at least not without building a file system filter driver. Having implemented a filter driver as a simple form of multi- initiator disk access previously we do know that it works correctly, but does require a fair amount of mechanism. Of course, perhaps someone else has found a better solution. Regards, Tony -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQEVAwUBNIQ1VImxeMUNM60pAQGM3wf+NxKMOOPJUjs3rrJf5MzUSz+ygvazt5k4 thbS1F9e7Cjs7dXzaZqfEoNms7afb2mhSrF6pVU4Hkfb4/ckAgyT7y4grYWRhUGl Rhy1+wnO3qX8FbxgXGibumQe9BeIctp3/S1SyI7kDI/9jQXegYOwjIUjraC8Sdbd UV4qaxZEkij6ZYdx75e0vYBHak5vIbtszFUC9jvgylPiJymJaRtEjzyXjYUjUws/ hdaxwtNIb9uH1uWzplLIXOQ6H3N+jrC7AD3SQft2L8xblOrZ7uV5gL9xT2iSnEn2 75moy3qAHATBJnAJPpQkN97lAiYlG+LEzNo7/IayjZXCVUiM47FqWg== =e9vG -----END PGP SIGNATURE----- Tony Mason Consulting Partner OSR Open Systems Resources, Inc. mason@osr.com http://www.osr.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntfsd-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]