SetParam tunes a kernel parameter on an open handle.
(h handleRaw, param uint32, value uint64)
| 163 | |
| 164 | // SetParam tunes a kernel parameter on an open handle. |
| 165 | func SetParam(h handleRaw, param uint32, value uint64) error { |
| 166 | r1, _, e1 := procWinDivertSetParam.Call( |
| 167 | uintptr(h), uintptr(param), uintptr(value)) |
| 168 | if r1 == 0 { |
| 169 | return fmt.Errorf("WinDivertSetParam(%d,%d): %w", param, value, translateErr(e1)) |
| 170 | } |
| 171 | return nil |
| 172 | } |
| 173 | |
| 174 | // Windows errno values WinDivert returns. Exposed as typed constants so |
| 175 | // callers (the backend recv loop) can recognize graceful-close without |