Public Shared Function WaitForMultipleObjects(ByVal count As Integer, ByVal handle() As IntPtr, ByVal waitAll As Boolean, ByVal milliseconds As Integer) As Integer
.
Dim val As Integer = WaitHandles.WaitForMultipleObjects(waitEvents.Length, handlePointers, waitAll, millisecondsTimeout)
Declare Function WaitForMultipleObjects Lib "coredll.dll" (ByVal nCount As Integer, ByVal lpHandles() As IntPtr, ByVal fWaitAll As Boolean, ByVal dwMilliseconds As Integer) As Integer
.
Int32 result = WaitForMultipleObjects((UInt32)handles.Length, handles, false, INFINITE);