cwindowsnetwork-programmingpassthru

WinDivert passthru example returns "warning: failed to reinject packet (1237)"


I am running Windows 7 Ultimate with SP1. I downloaded the WinDivert-1.0.5-MSVC package and ran the passthru.exe file with command "E:\lib\WinDivert-1.0.5-MSVC\x86>passthru.exe true 1". Then it gave me the error: "warning: failed to reinject packet (1237)". And the network got broken, too. Can anybody tell me why? Thx.

E:\lib\WinDivert-1.0.5-MSVC\x86>passthru.exe "true" 1
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
warning: failed to reinject packet (1237)
^C
E:\lib\WinDivert-1.0.5-MSVC\x86>

Solution

  • 1237 = ERROR_RETRY according to Microsoft's documentation. The description of the error code is not very helpful, i.e. "The operation could not be completed. A retry should be performed." The underlying cause of this error message is not clear to me.

    WinDivert essentially passes the packets to the underlying Windows Filtering Platform (WFP) packet injection functions, and returns the result to the user if an error occurs. Perhaps there is a WFP expert that can help?

    This person also had the same problem, and it was apparently caused by some other software installed on the system. When the offending software was removed, the error message was also resolved.