Re: Read/Write to storage class device using sector/block addresses



Waleri Todorov wrote:
I am not sure, whether this won't require an exclusive access to the
device (means no other I/O at all). And in any case, this would
require an administrator privileges.

Well, any time you are writing directly to the disk, I would hope that there
isn't a file system driver claiming the same space. So exclusive is a
*good* thing.

If the disk is formatted hard disk style, with a partition table, you can
open just one partition raw and have a file system driver on another.


"Don Burn" <burn@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:eztn4HUpIHA.3860@xxxxxxxxxxxxxxxxxxxxxxx
Look at the CreateFile documentation in the SDK, you can open a disk
raw and write to it bypassing a file system. Note: Vista requires
some extra work due to added secuirity.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply


"Arnie" <kzjkn3@xxxxxxxxxxx> wrote in message
news:999514b1-b117-4f50-ac52-0197cab2d566@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a storage class device (looks like a flash disk on a USB
port) and I don't want to access it with the File System. I would
like to just do reads and writes by specifying block or sector
addresses and the number of bytes to transfer.

I know this is possible using IOCTL_SCSI_PASS_THROUGH but the
warnings agains using this techinque are of concern. Specifically
"... IOCTL_SCSI_PASS_THROUGH ... are not substitutes for a SCSI
class driver and should only be used for infrequent I/O processing.
For situations in which frequent SCSI commands need to be sent to a
device, with strict error processing and high performance
requirements, the best solution is to write a SCSI class driver..."

Unfortunately, the warning does not define "infrequent" and "high
performance". My app has to write about 1K bytes once per second.
And on occasion, a sequential read of the written data must be done
while the writes still occur. The device is like a 4Mb circular
buffer of recorded events.

Does anyone know if there is another way (i.e. a better way) to
write to a storage class device using block/sector addressing but
without using IOCTL_SCSI_PASS_THROUGH?

I don't know if this is the correct group in which to post this
message. If not, kindly point me to a more appropriate group!


.



Relevant Pages

  • Re: Read/Write to storage class device using sector/block addresses
    ... Well, any time you are writing directly to the disk, I would hope that there ... If the disk is formatted hard disk style, with a partition table, you can ... open just one partition raw and have a file system driver on another. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Fast file writes without having large data flushes to disk
    ... file system driver, I assumed that it's a separate component, and the lower ... level drivers have other cache mechanisms, ... just disk activity; this is most likely an OS or disk driver ... And are there tools that can show the amount of file system ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Treads in the new 6 core CPU from Intel
    ... Why do you think six cores are "fighting" for resources? ... implications of an asymmetric I/O bus structure on file system I/O? ... Why do you think the file I/O is not taking advantage of the File System Cache? ... What, in fact, do you mean by the phrase "database ...
    (microsoft.public.vc.mfc)
  • Re: How does GetFileSize() interact with a driver?
    ... WDF is not appropriate for a file system driver. ... available for Windows other than those created by Microsoft. ...
    (microsoft.public.development.device.drivers)
  • Re: Redo logs a Quick I/O enabled file system
    ... I/O enabled file system? ... I found no reason to place redo logs on such a file system. ... I know that for a UFS file system Direct I/O should be specified ...
    (comp.databases.oracle.server)