Smart Device Functions:
[StructLayout(LayoutKind.Explicit, Size = 8)]
The documentation for the Scatter/Gather functions states that the buffer addresses used must be page aligned (not just storage aligned). Indeed, passing a managed allocation, such as a byte array, causes error 87 (Invalid Parameter). This function is asynchronous only so an use the AsyncResult and Overlapped pattern established by the FileStream.
Tips & Tricks:
It is recommended that VirtualAlloc be used to allocate an unmanaged block of memory for use with this function. The array of file segments can be effeciently constructed without heap allocation using stackalloc. You will need to get the system's page size through a call to GetSystemInfo.
// Prepares the array of file segments given an IntPtr ABuffers (only uses ACount of the buffers so that these arrays can be pooled)
Alternative Managed API:
No managed API as of the 1.1 Framework.
The WriteFileGather API
3/16/2007 1:59:07 PM - email@example.com
TODO - a short description
3/16/2007 1:52:17 PM - -22.214.171.124
The VirtualAlloc API
7/31/2010 8:29:26 PM - -126.96.36.199
The ReadFileScatter API
3/16/2007 1:57:44 PM - firstname.lastname@example.org
The ReadFile API
7/13/2012 4:30:48 PM - -188.8.131.52
Please edit this page!
Do you have...