From: Maxim S. Shatskih [maxim@storagecraft.com] Sent: Sunday, June 04, 2000 6:18 PM To: NT Developers Interest List Subject: [ntdev] Re: ZWwriteFile Try: - creating a file with preallocated size from ZwCreateFile or user mode CreateFile + MoveFilePointer + SetEndOfFile. - then use FSCTL_GET_RETRIEVAL_POINTERS to get the disk sector numbers covered by the file. - then work with the disk driver directly, bypassing the FSD. Note that FSCTL_GET_RETRIEVAL_POINTERS cannot be called from kmode directly - at least on NT4. The filesystems use ProbeForWrite function to test the IOCTL's buffer - and this function will fail if this buffer will be in the kmode address space. You can use a trick to bypass it: - ZwCreateSection not based on any file (pagefile-based). - ZwMapViewOfSection for this section while being in a System process context (you can use, for instance, ExQueueWorkItem callbacks - they are executed in System process). - this will allocate memory _in System process's usermode address space_. This memory is accessible from kmode - you can reference it directly and even without try/catch blocks provided you have specified the valid address - this memory is private for your driver and nobody else knows on it. BTW - this is a good way if you want to allocate several megabytes of pageable memory in your driver. Max ----- Original Message ----- From: To: NT Developers Interest List Sent: Wednesday, May 31, 2000 1:59 PM Subject: [ntdev] ZWwriteFile > Hi > I need write to file data 10 Mbit/s from PCI card. Data is 32 bit numbers and i > want write those numbers to HD. Can anybody tell what is a efficient way to do > this. Is there other/better ways than ZWwriteFile to do this operation. > > > Best regards > > Mika Piirainen > Patria Oy > > > > --- > You are currently subscribed to ntdev as: maxim@storagecraft.com > To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com > --- You are currently subscribed to ntdev as: GlennEverhart@FirstUSA.com To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com