File Management Functions


SetFileIoOverlappedRange Function

Associates a virtual address range with the specified file handle. This indicates that the kernel should optimize any further asynchronous I/O requests with overlapped structures inside this range. The overlapped range is locked in memory, and then unlocked when the file is closed. After a range is associated with a file handle, it cannot be disassociated.

Syntax

C++
BOOL WINAPI SetFileIoOverlappedRange(
  __in  HANDLE FileHandle,
  __in  PUCHAR OverlappedRangeStart,
  __in  ULONG Length
);

Parameters

FileHandle [in]

A handle to the file.

This file handle must be opened with FILE_READ_ATTRIBUTES access rights.

OverlappedRangeStart [in]

The starting address for the range.

Length [in]

The length of the range, in bytes.

Return Value

Returns nonzero if successful or zero otherwise.

To get extended error information, call GetLastError.

Remarks

SetFileIoOverlappedRange can be used to improve performance in an application that issues a high number of asynchronous unbuffered I/O and uses a defined range of overlapped structures. Because this range of structures is locked in memory, the kernel can avoid acquiring certain locks when updating the overlapped structures with the results of the I/O request.

SetFileIoOverlappedRange requires the caller to have the SeLockMemoryPrivilege access privilege.

This function has no effect on buffered and synchronous I/O.

To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0501 or later. For more information, see Using the Windows Headers.

Requirements

Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinBase.h
LibraryKernel32.lib
DLLKernel32.dll

See Also

File Management Functions

Send comments about this topic to Microsoft

Build date: 10/22/2009

Tags :


Community Content

Calin Iaru
_WIN32_WINNT 0x600
_WIN32_WINNT should be set to 0x600.
Tags :

Page view tracker