WinDivert学习文档之五-————编程API(十一)
5.11 WinDivertSetParam
BOOL WinDivertSetParam(__in HANDLE handle,__in WINDIVERT_PARAM param,__in UINT64 value); |
参数
- handle:一个由WinDivertOpen()创建的有效的WinDivert句柄。
- param:一个WinDivert参数名。
- value:参数的新值。
返回值
成功时为TRUE,发生错误时为FALSE。使用GetLastError()获取错误的原因。
讲话
设置WinDivert参数。目前,定义了以下WinDivert参数。
Parameter参数 | Description说明描述 |
---|---|
WINDIVERT_PARAM_QUEUE_LENGTH | Sets the maximum length of the packet queue for WinDivertRecv(). The default value is
|
WINDIVERT_PARAM_QUEUE_TIME | Sets the minimum time, in milliseconds, a packet can be queued before it is automatically dropped. Packets cannot be queued indefinitely, and ideally, packets should be processed by the application as soon as is possible. Note that this sets the minimum time a packet can be queued before it can be dropped. The actual time may be exceed this value. Currently the default value is 设置报文自动丢弃前的最小排队时间,单位为毫秒。数据包不能无限期地排队,理想情况下,应用程序应该尽快处理数据包。请注意,这设置了数据包在被丢弃之前可以排队的最小时间。实际时间可能会超过此值。目前默认值是WINDIVERT_PARAM_QUEUE_TIME_DEFAULT,最小值是WINDIVERT_PARAM_QUEUE_TIME_MIN,最大值是WINDIVERT_PARAM_QUEUE_TIME_MAX。 |
WINDIVERT_PARAM_QUEUE_SIZE | Sets the maximum number of bytes that can be stored in the packet queue for WinDivertRecv(). Currently the default value is 为WinDivertRecv()设置可存储在数据包队列中的最大字节数。目前默认值是WINDIVERT_PARAM_QUEUE_SIZE_DEFAULT,最小值是WINDIVERT_PARAM_QUEUE_SIZE_MIN,最大值是WINDIVERT_PARAM_QUEUE_SIZE_MAX。 |