ndisapi.net
ndisapi.net copied to clipboard
The Waithandle array cannot be empty
Hello, Your project is awesome, i come to try it in my windows 10 x64, and i get some error:: i added ndisapi.dll for x64 from this project: https://github.com/Detrav/WinpkFilterWrapper.
In the demo project this the error:
var t1 = Task.Factory.StartNew(() => PassThruThread(filter, waitHandles, tcpAdapters.ToArray(), waitHandlesManualResetEvents)); Task.WaitAll(t1);
And i get this Exception: Loaded driver: 0.0.0.0.
Unhandled exception: System.AggregateException: One or more errors have occurred. ---> System.ArgumentException: The Waithandle array cannot be empty.
at System.Threading.WaitHandle.WaitAny (WaitHandle [] waitHandles, Int32 millisecondsTimeout, Boolean exitContext)
to NdisApiDemo.Program.PassThruThread (NdisApi filter, WaitHandle [] waitHandles, IReadOnlyList1 networkAdapters, IReadOnlyList
1 waitHandlesManualResetEvents) in D: \ ndisapi.net-master \ ndisapi.net-master
to NdisApiDemo.Program. <> c__DisplayClass0_0. <Main> b__0 () in D: \ ndisapi.net-master \ ndisapi.net-master \ NdisApiDemo \ Program.cs: line 62
at System.Threading.Tasks.Task.Execute ()
--- End of the internal exception stack trace ---
at System.Threading.Tasks.Task.WaitAll (Task [] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll (Task [] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Task.WaitAll (Task [] tasks)
to NdisApiDemo.Program.Main () in D: \ ndisapi.net-master \ ndisapi.net-master \ NdisApiDemo \ Program.cs: line 63.
If this is still relevant, I believe it was caused by none of the network adapters being "valid", so the waitHandles
array being passed to the callback thread, and then to WaitHandle.WaitAny
leads to the System.ArgumentException: The Waithandle array cannot be empty.
exception.
You need later driver version, get it from official site.