Re: Read/Write to storage class device using sector/block addresses
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Thu, 24 Apr 2008 08:58:14 -0500
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!
.
- Follow-Ups:
- References:
- Read/Write to storage class device using sector/block addresses
- From: Arnie
- Re: Read/Write to storage class device using sector/block addresses
- From: Don Burn
- Re: Read/Write to storage class device using sector/block addresses
- From: Waleri Todorov
- Read/Write to storage class device using sector/block addresses
- Prev by Date: Re: How to dump system service dispatch table?
- Next by Date: Re: How can I check that if a process is running or not ?
- Previous by thread: Re: Read/Write to storage class device using sector/block addresses
- Next by thread: Re: Read/Write to storage class device using sector/block addresses
- Index(es):
Relevant Pages
|