wintun: fix ringbuffer registration call
From: Lev Stipakov <[email protected]...>
As MS documentation says:
Quoted 1 line
If lpOverlapped is NULL, lpBytesReturned cannot be NULL
While on Windows 10 passing NULL works by accident, on Windows 7 it crashes.
Reported-by kitsune1
Signed-off-by Lev Stipakov <[email protected]...>
--- src/openvpn/ring_buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/openvpn/ring_buffer.c +3 -1
@@ -35,6 +35,7 @@ register_ring_buffers(HANDLE device, {struct tun_register_rings rr;BOOL res; +DWORD bytes_returned;ZeroMemory (&rr,sizeof (rr));
@@ -46,7 +47,8 @@ register_ring_buffers(HANDLE device, rr.receive.ring_size =sizeof (receive_ring->data); rr.receive.tail_moved = receive_tail_moved; - res =DeviceIoControl (device,TUN_IOCTL_REGISTER_RINGS , &rr,sizeof (rr),NULL ,0 ,NULL ,NULL ); + res =DeviceIoControl (device,TUN_IOCTL_REGISTER_RINGS , &rr,sizeof (rr), +NULL ,0 , &bytes_returned,NULL );return res == TRUE; }
Signature · 1 line
2.17.1
Please disregard this patch - I made it as a fix to "wintun: ring buffers based I/O", which was resent as v5.
ti 19. marrask. 2019 klo 21.10 Lev Stipakov ([email protected]...) kirjoitti:
Quoted 43 lines
From: Lev Stipakov <[email protected]...>
As MS documentation says:
Quoted 1 line
If lpOverlapped is NULL, lpBytesReturned cannot be NULL
While on Windows 10 passing NULL works by accident, on Windows 7 it crashes.
Reported-by kitsune1Signed-off-by Lev Stipakov <[email protected]...>--- src/openvpn/ring_buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)src/openvpn/ring_buffer.c +3
-1@@ -35,6 +35,7 @@ register_ring_buffers(HANDLE device, {struct tun_register_rings rr;BOOL res; +DWORD bytes_returned;ZeroMemory (&rr,sizeof (rr));@@ -46,7 +47,8 @@ register_ring_buffers(HANDLE device, rr.receive.ring_size =sizeof (receive_ring->data); rr.receive.tail_moved = receive_tail_moved; - res =DeviceIoControl (device,TUN_IOCTL_REGISTER_RINGS , &rr, sizeof(rr), NULL, 0, NULL, NULL); + res =DeviceIoControl (device,TUN_IOCTL_REGISTER_RINGS , &rr,sizeof (rr), +NULL ,0 , &bytes_returned,NULL );return res == TRUE;}
--
2.17.1
Signature · 1 line
-Lev