Hi all,
My application need to move large buffers (512 KB) to a SCSI device using
predefined IOCTL_SCSI_xxx and DeviceIOControl calls. However, there is a
device-dependant constraint on the alignment of the buffer to provide with
the IOCTL. Unfortunatly, I have no control over the allocation of the data
buffer to be passed down to the device; so if it is not properly aligned, I
see two options to provide and aligned buffer with the IOCTL:
-
copy the application data to a properly aligned, temporary buffer. I do
not like this because it consumes time, CPU and memory. -
create a new aligned virtual address and, somehow, associate it to the
provided buffer.
Can this be done by a Win32 (NT) application ? VirtualAlloc() could be used
to do half the job, which is to reserve 512KB of virtual memory in the
process space. Then, we still need to “commit” this VA to the provided
buffer.
Any ideas ?
Thanks,
Alain