Closed jjxtra closed 5 years ago
This might be a legitimate invalid parameter. This bit looks suspicious to me: ref uint addrLen
The addrLen
parameter of WinDivertSendEx
is a UINT
not a pointer-to-UINT
.
Checking without ref...
That was it, working great now!
I am using C# to PInvoke into WinDivert 2.0 (downloaded from https://reqrypt.org/download/WinDivert-2.0.0-rc-A.zip). I am calling WinDivertSendEx and getting an error 87 back after receiving a 997 io pending error. The low field of the send overlapped is always a large negative number. I've tried passing a null overlapped and it immediately returns an error 87.
WinDivertRecvEx seems to be working fine.
As a side note, have you considered providing PInvoke wrappers for WinDivert? Might increase your sales a bit for commercial licenses, otherwise people are forced to use buggy NuGet packages that are not kept up to date.
Any suggestions?
Here is my code: