Esempio n. 1
0
        public static bool SetDeviceBufferSize(IntPtr handle, uint size)
        {
            var set_ok     = false;
            var ioctl_size = new USBPCAP_IOCTL_SIZE();

            ioctl_size.size = size;

            if (!set_ok)
            {
                set_ok = WinAPI.DeviceIoControl(handle, IOCTL_USBPCAP_SETUP_BUFFER_1100, ioctl_size, null, true);
            }

            if (!set_ok)
            {
                set_ok = WinAPI.DeviceIoControl(handle, IOCTL_USBPCAP_SETUP_BUFFER_1007, ioctl_size, null, true);
            }

            return(set_ok);
        }
Esempio n. 2
0
        public static bool SetDeviceSnapLength(IntPtr handle, uint size)
        {
            var set_ok     = false;
            var ioctl_size = new USBPCAP_IOCTL_SIZE();

            ioctl_size.size = size;

            if (!set_ok)
            {
                set_ok = WinAPI.DeviceIoControl(handle, IOCTL_USBPCAP_SET_SNAPLEN_SIZE_1100, ioctl_size, null, true);
            }

            if (!set_ok)
            {
                set_ok = WinAPI.DeviceIoControl(handle, IOCTL_USBPCAP_SET_SNAPLEN_SIZE_1007, ioctl_size, null, true);
            }

            return(set_ok);
        }