INFO: Non-Buffered File I/O on Windows 2000ID: Q229673
|
Applications that supply their own buffer for file input and output must align the buffer with device sector boundaries in memory. All Windows 2000 devices require sector alignment; some previous versions of Windows allow the underlying device to determine the requirements for buffer alignment, which may or may not be along sector boundaries.
Most sectors are 512 bytes in size, but your application can determine a volume's sector size by calling the GetDiskFreeSpace API function. One way to align buffers on integer multiples of the volume sector size is to use VirtualAlloc to allocate the buffer.
File access must begin at byte offsets within the file that are integer multiples of the volume's sector size, and must be for numbers of bytes that are integer multiples of the volume's sector size.
For more information about aligning application-supplied buffers and file I/O with non-buffered files, see the FILE_FLAG_NO_BUFFERING description in the Platform SDK CreateFile API function topic.
Additional query words: compatguidestability
Keywords : kbFileIO kbKernBase kbNTOS400 kbWinOS2000 kbSDKPlatform kbSDKWin32
Version : winnt:
Platform : winnt
Issue type : kbinfo
Last Reviewed: June 23, 1999