Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ RegisterNativeToManagedCallbackImpl()

unsafe int Microsoft.Xna.Framework.WindowsManagedCallbackHandler.RegisterNativeToManagedCallbackImpl ( void * waitForThisHandle,
delegate *< void *, void *, ManagedCallType *, uint *, bool *, int > eventSignalledFunc,
void * pContext )
inlineprivate

Definition at line 326 of file WindowsManagedCallbackHandler.cs.

327 {
328 if (waitForThisHandle != null && eventSignalledFunc != (delegate*<void*, void*, ManagedCallType*, uint*, bool*, int>)null)
329 {
330 void* ptr = null;
331 int num = ((global::_003CModule_003E.DuplicateHandle(global::_003CModule_003E.GetCurrentProcess(), waitForThisHandle, global::_003CModule_003E.GetCurrentProcess(), &ptr, 0u, 0, 2u) == 0) ? (-2147467259) : 0);
332 int num2 = num;
333 if (num < 0)
334 {
335 if (ptr != null && ptr != (void*)(-1))
336 {
337 global::_003CModule_003E.CloseHandle(ptr);
338 }
339 return num;
340 }
341 bool lockTaken = false;
342 try
343 {
346 if (num2 >= 0)
347 {
350 if (global::_003CModule_003E.SetEvent(_newCallbackRegistered) == 0)
351 {
352 uint lastError = global::_003CModule_003E.GetLastError();
353 num2 = (((int)lastError > 0) ? ((int)(lastError & 0xFFFF) | -2147024896) : ((int)lastError));
354 }
355 if (num2 < 0)
356 {
358 }
359 }
360 }
361 finally
362 {
363 if (lockTaken)
364 {
366 }
367 }
368 return num2;
369 }
370 return -2147024809;
371 }
void RemoveAt(int index)
Definition List.cs:824
static void Exit(object obj)
static void Enter(object obj)

References Microsoft.Xna.Framework.WindowsManagedCallbackHandler._newCallbackRegistered, System.Collections.Generic.List< T >.Add(), System.Collections.Generic.List< T >.Count, System.Threading.Monitor.Enter(), System.Threading.Monitor.Exit(), Microsoft.Xna.Framework.WindowsManagedCallbackHandler.HasRoomForAnotherWaitHandle(), System.item, Microsoft.Xna.Framework.WindowsManagedCallbackHandler.nativeToManagedCallbacks, and System.Collections.Generic.List< T >.RemoveAt().