Move ResetEvent() call before ReadFile().
authorEtienne Dechamps <etienne@edechamps.fr>
Wed, 17 Jan 2018 19:37:53 +0000 (19:37 +0000)
committerEtienne Dechamps <etienne@edechamps.fr>
Wed, 17 Jan 2018 19:48:12 +0000 (19:48 +0000)
Commit 313a752 changed the Windows device code such that ResetEvent() is
called on the read OVERLAPPED structure before GetOverlappedResult(), as
opposed to before ReadFile(). In [1] Guus pointed out that this doesn't
make a ton of sense, and I agree with him; it must have been an
oversight on my part when I wrote this code.

Surprisingly, none of this makes any difference in my testing, at least
with the standard TAP 9.0.0.9 driver. Nevertheless, this code is
probably wrong and fixing it will make me sleep better at night.

[1]: https://www.tinc-vpn.org/pipermail/tinc/2018-January/005091.html


No differences found