GetFileBandwidthReservation function

Retrieves the bandwidth reservation properties of the volume on which the specified file resides.

Syntax

BOOL GetFileBandwidthReservation(
  HANDLE  hFile,
  LPDWORD lpPeriodMilliseconds,
  LPDWORD lpBytesPerPeriod,
  LPBOOL  pDiscardable,
  LPDWORD lpTransferSize,
  LPDWORD lpNumOutstandingRequests
);

Parameters

hFile

A handle to the file.

lpPeriodMilliseconds

A pointer to a variable that receives the period of the reservation, in milliseconds. The period is the time from which the I/O is issued to the kernel until the time the I/O should be completed. If no bandwidth has been reserved for this handle, then the value returned is the minimum reservation period supported for this volume.

lpBytesPerPeriod

A pointer to a variable that receives the maximum number of bytes per period that can be reserved on the volume. If no bandwidth has been reserved for this handle, then the value returned is the maximum number of bytes per period supported for the volume.

pDiscardable

TRUE if I/O should be completed with an error if a driver is unable to satisfy an I/O operation before the period expires. FALSE if the underlying subsystem does not support failing in this manner.

lpTransferSize

The minimum size of any individual I/O request that may be issued by the application. All I/O requests should be multiples of TransferSize. If no bandwidth has been reserved for this handle, then the value returned is the minimum transfer size supported for this volume.

lpNumOutstandingRequests

The number of TransferSize chunks allowed to be outstanding with the operating system.

Return Value

Returns nonzero if successful or zero otherwise.

To get extended error information, call GetLastError.

Remarks

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported
Server Message Block (SMB) 3.0 protocol No
SMB 3.0 Transparent Failover (TFO) No
SMB 3.0 with Scale-out File Shares (SO) No
Cluster Shared Volume File System (CsvFS) No
Resilient File System (ReFS) Yes

Requirements

   
Windows version Windows Vista [desktop apps only] Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

File Management Functions

SetFileBandwidthReservation