Skip to content

Commit 15cfcdb

Browse files
committed
Compensate for CsWin32 HANDLE type change
1 parent 3305b9f commit 15cfcdb

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Microsoft.VisualStudio.Threading/NoMessagePumpSyncContext.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static SynchronizationContext Default
4747
/// <returns>
4848
/// The array index of the object that satisfied the wait.
4949
/// </returns>
50-
public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)
50+
public override unsafe int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)
5151
{
5252
Requires.NotNull(waitHandles, nameof(waitHandles));
5353

@@ -61,7 +61,10 @@ public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTim
6161
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
6262
#endif
6363
{
64-
return (int)PInvoke.WaitForMultipleObjects(MemoryMarshal.Cast<IntPtr, HANDLE>(waitHandles), waitAll, (uint)millisecondsTimeout);
64+
fixed (IntPtr* pHandles = waitHandles)
65+
{
66+
return (int)PInvoke.WaitForMultipleObjects((uint)waitHandles.Length, (HANDLE*)pHandles, waitAll, (uint)millisecondsTimeout);
67+
}
6568
}
6669
else
6770
{

0 commit comments

Comments
 (0)