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

◆ GetSessionInfo()

unsafe void System.Diagnostics.Tracing.EventProvider.GetSessionInfo ( SessionInfoCallback action,
ref List< SessionInfo > sessionList )
inlineprivateinherited

Definition at line 336 of file EventProvider.cs.

337 {
338 int ReturnLength = 256;
339 byte* ptr = stackalloc byte[(int)(uint)ReturnLength];
340 byte* ptr2 = ptr;
341 try
342 {
343 while (true)
344 {
345 int num = 0;
347 {
349 }
350 switch (num)
351 {
352 default:
353 return;
354 case 122:
355 if (ptr2 != ptr)
356 {
357 byte* ptr7 = ptr2;
358 ptr2 = null;
359 Marshal.FreeHGlobal((IntPtr)ptr7);
360 }
361 break;
362 case 0:
363 {
367 for (int i = 0; i < ptr3->InstanceCount; i++)
368 {
369 if (ptr4->Pid == currentProcessId)
370 {
372 for (int j = 0; j < ptr4->EnableCount; j++)
373 {
375 }
376 }
377 if (ptr4->NextOffset == 0)
378 {
379 break;
380 }
381 byte* ptr6 = (byte*)ptr4;
383 }
384 return;
385 }
386 }
387 ptr2 = (byte*)(void*)Marshal.AllocHGlobal(ReturnLength);
388 }
389 }
390 finally
391 {
392 if (ptr2 != null && ptr2 != ptr)
393 {
394 Marshal.FreeHGlobal((IntPtr)ptr2);
395 }
396 }
397 }
static unsafe int EnumerateTraceGuidsEx(TRACE_QUERY_INFO_CLASS TraceQueryInfoClass, void *InBuffer, int InBufferSize, void *OutBuffer, int OutBufferSize, out int ReturnLength)
static uint GetCurrentProcessId()
static void FreeHGlobal(IntPtr hglobal)
Definition Marshal.cs:1680
static IntPtr AllocHGlobal(int cb)
Definition Marshal.cs:625

References System.action, System.Runtime.InteropServices.Marshal.AllocHGlobal(), Interop.Advapi32.EnumerateTraceGuidsEx(), System.Runtime.InteropServices.Marshal.FreeHGlobal(), Interop.Kernel32.GetCurrentProcessId(), System.Diagnostics.Tracing.EventProvider.m_providerId, and System.Diagnostics.Tracing.EventProvider.MatchAllKeyword.

Referenced by System.Diagnostics.Tracing.EventProvider.GetSessions().