Re: [Openvpn-devel] [PATCH 8/7] wintun: fix ringbuffer registration call

2019-11-20 Thread Lev Stipakov
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 (lstipa...@gmail.com) kirjoitti:

> From: Lev Stipakov 
>
> As MS documentation says:
>
>  > 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 
> ---
>  src/openvpn/ring_buffer.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/openvpn/ring_buffer.c b/src/openvpn/ring_buffer.c
> index 482e3336..d384f497 100644
> --- a/src/openvpn/ring_buffer.c
> +++ b/src/openvpn/ring_buffer.c
> @@ -35,6 +35,7 @@ register_ring_buffers(HANDLE device,
>  {
>  struct tun_register_rings rr;
>  BOOL res;
> +DWORD bytes_returned;
>
>  ZeroMemory(, 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, ,
> sizeof(rr), NULL, 0, NULL, NULL);
> +res = DeviceIoControl(device, TUN_IOCTL_REGISTER_RINGS, ,
> sizeof(rr),
> +NULL, 0, _returned, NULL);
>
>  return res == TRUE;
>  }
> --
> 2.17.1
>
>

-- 
-Lev
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH 8/7] wintun: fix ringbuffer registration call

2019-11-19 Thread Lev Stipakov
From: Lev Stipakov 

As MS documentation says:

 > 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 
---
 src/openvpn/ring_buffer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/openvpn/ring_buffer.c b/src/openvpn/ring_buffer.c
index 482e3336..d384f497 100644
--- a/src/openvpn/ring_buffer.c
+++ b/src/openvpn/ring_buffer.c
@@ -35,6 +35,7 @@ register_ring_buffers(HANDLE device,
 {
 struct tun_register_rings rr;
 BOOL res;
+DWORD bytes_returned;
 
 ZeroMemory(, 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, , sizeof(rr), 
NULL, 0, NULL, NULL);
+res = DeviceIoControl(device, TUN_IOCTL_REGISTER_RINGS, , sizeof(rr),
+NULL, 0, _returned, NULL);
 
 return res == TRUE;
 }
-- 
2.17.1



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel