网站首页  词典首页

请输入您要查询的函数:

 

术语 setfilebandwidthreservation
释义 SetFileBandwidthReservation
语法:
C++
BOOL WINAPI SetFileBandwidthReservation(
__in HANDLE hFile,
__in DWORD nPeriodMilliseconds,
__in DWORD nBytesPerPeriod,
__in BOOL bDiscardable,
__out LPDWORD lpTransferSize,
__out LPDWORD lpNumOutstandingRequests
);
SetFileBandwidthReservation功能
要求在指定的文件流的带宽预留。这项保留被指定为一个字节在毫秒之内人数的I /指定的文件句柄O请求。
参数
hFile [in]
阿处理该文件。
nPeriodMilliseconds [in]
在保留期,以毫秒为单位。这一时期是从其中的I / O发出的时间,直到内核的I / O应该完成的时间。最低支持文件流值可以在通过lpPeriodMilliseconds参数来GetFileBandwidthReservation函数的返回值来确定的,在处理已没有保留的带宽设置。
nBytesPerPeriod [in]
在保留的带宽,在每个时期字节。最高支持文件流值可以在通过lpBytesPerPeriod参数来GetFileBandwidthReservation函数的返回值来确定的,在处理已没有保留的带宽设置。
bDiscardable [in]
指示是否的I / O应该是完成了一个错误,如果司机不能期满之前,以满足一个I / O操作。如果指定的文件流的动力之一不支持此功能,这个功能可能会返回成功,而忽略标志。要验证是否设置将得到尊重,调用GetFileBandwidthReservation函数使用相同的hFile处理和研究* pDiscarable返回值。
lpTransferSize [out]
一个变量,它接收任何个人我最小尺寸/ O请求可能由应用程序发出的指针。所有的I / O请求应TransferSize倍数。
lpNumOutstandingRequests [out]
一个变量,它接收的TransferSize块数,应用程序应允许与操作系统的未决指针。这使得存储堆栈保持忙碌,并允许设备的最大吞吐量。
返回值
如果成功则返回非零或否则为0。
保留可能会失败,如果没有足够的带宽,因为现有保留的批量上市,在这种情况下ERROR_NO_SYSTEM_RESOURCES返回。
为了获得更多错误信息,调用GetLastError。
备注
所要求的带宽保留必须大于或等于每间包。最低时期,以毫秒为单位,每个字节的最高期限和最低转让大小,以字节为特定卷返回通过lpPeriodMilliseconds,lpBytesPerPeriod,并lpTransferSize一个句柄没有在给SetFileBandwidthReservation调用中使用参数GetFileBandwidthReservation 。换句话说:
1≤(nBytesPerPeriod)×(* lpPeriodMilliseconds)/(* lpTransferSize)/(nPeriodMilliseconds)
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinBase.h
LibraryKernel32.lib
DLLKernel32.dll
参见
文件管理函数
GetFileBandwidthReservation
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==SetFileBandwidthReservation Function
Requests that bandwidth for the specified file stream be reserved. The reservation is specified as a number of bytes in a period of milliseconds for I/O requests on the specified file handle.
Syntax
C++
BOOL WINAPI SetFileBandwidthReservation(
__in HANDLE hFile,
__in DWORD nPeriodMilliseconds,
__in DWORD nBytesPerPeriod,
__in BOOL bDiscardable,
__out LPDWORD lpTransferSize,
__out LPDWORD lpNumOutstandingRequests
);
Parameters
hFile [in]
A handle to the file.
nPeriodMilliseconds [in]
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. The minimum supported value for the file stream can be determined by looking at the value returned through the lpPeriodMilliseconds parameter to the GetFileBandwidthReservation function, on a handle that has not had a bandwidth reservation set.
nBytesPerPeriod [in]
The bandwidth to reserve, in bytes per period. The maximum supported value for the file stream can be determined by looking at the value returned through the lpBytesPerPeriod parameter to the GetFileBandwidthReservation function, on a handle that has not had a bandwidth reservation set.
bDiscardable [in]
Indicates whether I/O should be completed with an error if a driver is unable to satisfy an I/O operation before the period expires. If one of the drivers for the specified file stream does not support this functionality, this function may return success and ignore the flag. To verify whether the setting will be honored, call the GetFileBandwidthReservation function using the same hFile handle and examine the *pDiscarable return value.
lpTransferSize [out]
A pointer to a variable that receives 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.
lpNumOutstandingRequests [out]
A pointer to a variable that receives the number of TransferSize chunks the application should allow to be outstanding with the operating system. This allows the storage stack to keep the device busy and allows maximum throughput.
Return Value
Returns nonzero if successful or zero otherwise.
A reservation can fail if there is not enough bandwidth available on the volume because of existing reservations; in this case ERROR_NO_SYSTEM_RESOURCES is returned.
To get extended error information, call GetLastError .
Remarks
The requested bandwidth reservation must be greater than or equal to one packet per period. The minimum period, in milliseconds, maximum bytes per period, and minimum transfer size, in bytes, for a specific volume are returned through the lpPeriodMilliseconds, lpBytesPerPeriod, and lpTransferSize parameters to GetFileBandwidthReservation on a handle that has not been used in a call to SetFileBandwidthReservation. In other words:
1 ≤ (nBytesPerPeriod)×(*lpPeriodMilliseconds)/(*lpTransferSize)/(nPeriodMilliseconds)
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinBase.h
LibraryKernel32.lib
DLLKernel32.dll
See Also
File Management Functions
GetFileBandwidthReservation
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365537(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:26:42