INFO: Non-Buffered File I/O on Windows 2000

ID: Q229673

This article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this Beta product. For information about obtaining support for a Beta release, please see the documentation included with the Beta product files, or check the Web location from which you downloaded the release.
The information in this article applies to:


SUMMARY

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.


REFERENCES

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