Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EventProvider.cs
Go to the documentation of this file.
5using System.Text;
7
9
10internal class EventProvider : IDisposable
11{
12 public struct EventData
13 {
14 internal ulong Ptr;
15
16 internal uint Size;
17
18 internal uint Reserved;
19 }
20
21 public struct SessionInfo
22 {
23 internal int sessionIdBit;
24
25 internal int etwSessionId;
26
32 }
33
35 {
36 NoError,
41 Other
42 }
43
45
46 private struct EightObjects
47 {
48 internal object _arg0;
49
50 private object _arg1;
51
52 private object _arg2;
53
54 private object _arg3;
55
56 private object _arg4;
57
58 private object _arg5;
59
60 private object _arg6;
61
62 private object _arg7;
63 }
64
66
67 private Interop.Advapi32.EtwEnableCallback m_etwCallback;
68
69 private long m_regHandle;
70
71 private byte m_level;
72
73 private long m_anyKeywordMask;
74
75 private long m_allKeywordMask;
76
78
79 private bool m_enabled;
80
81 private string m_providerName;
82
84
85 internal bool m_disposed;
86
89
90 private const int BasicTypeAllocationBufferSize = 16;
91
92 private const int EtwMaxNumberArguments = 128;
93
94 private const int EtwAPIMaxRefObjCount = 8;
95
96 private const int TraceEventMaximumSize = 65482;
97
98 private static bool m_setInformationMissing;
99
101 {
102 get
103 {
104 return (EventLevel)m_level;
105 }
106 set
107 {
108 m_level = (byte)value;
109 }
110 }
111
113 {
114 get
115 {
117 }
118 set
119 {
120 m_anyKeywordMask = (long)value;
121 }
122 }
123
125 {
126 get
127 {
129 }
130 set
131 {
132 m_allKeywordMask = (long)value;
133 }
134 }
135
137 {
139 {
140 EventProviderType.ETW => new EtwEventProvider(),
141 EventProviderType.EventPipe => new EventPipeEventProvider(),
142 _ => new NoOpEventProvider(),
143 };
144 }
145
146 internal unsafe void Register(EventSource eventSource)
147 {
149 uint num = EventRegister(eventSource, m_etwCallback);
150 if (num != 0)
151 {
152 throw new ArgumentException(Interop.Kernel32.GetMessage((int)num));
153 }
154 }
155
156 public void Dispose()
157 {
158 Dispose(disposing: true);
159 GC.SuppressFinalize(this);
160 }
161
162 protected virtual void Dispose(bool disposing)
163 {
164 if (m_disposed)
165 {
166 return;
167 }
168 m_enabled = false;
169 long num = 0L;
171 {
172 if (m_disposed)
173 {
174 return;
175 }
176 num = m_regHandle;
177 m_regHandle = 0L;
178 m_disposed = true;
179 }
180 if (num != 0L)
181 {
182 EventUnregister(num);
183 }
184 }
185
186 public virtual void Close()
187 {
188 Dispose();
189 }
190
192 {
193 Dispose(disposing: false);
194 }
195
197 {
198 try
199 {
202 bool flag = false;
203 switch (controlCode)
204 {
205 case 1:
206 {
207 m_enabled = true;
212 if (sessions.Count == 0)
213 {
215 }
217 {
218 int sessionIdBit = item.Key.sessionIdBit;
219 int etwSessionId = item.Key.etwSessionId;
220 bool value = item.Value;
221 flag = true;
222 dictionary = null;
223 if (sessions.Count > 1)
224 {
225 filterData = null;
226 }
227 if (value && GetDataFromController(etwSessionId, filterData, out command, out var data, out var dataStart))
228 {
230 if (data != null)
231 {
232 while (dataStart < data.Length)
233 {
234 int num = FindNull(data, dataStart);
235 int num2 = num + 1;
236 int num3 = FindNull(data, num2);
237 if (num3 < data.Length)
238 {
239 string @string = Encoding.UTF8.GetString(data, dataStart, num - dataStart);
240 string string2 = Encoding.UTF8.GetString(data, num2, num3 - num2);
242 }
243 dataStart = num3 + 1;
244 }
245 }
246 }
247 OnControllerCommand(command, dictionary, value ? sessionIdBit : (-sessionIdBit), etwSessionId);
248 }
249 break;
250 }
251 case 0:
252 m_enabled = false;
253 m_level = 0;
256 m_liveSessions = null;
257 break;
258 case 2:
259 command = ControllerCommand.SendManifest;
260 break;
261 default:
262 return;
263 }
264 if (!flag)
265 {
267 }
268 }
269 catch
270 {
271 }
272 }
273
275 {
276 }
277
278 private static int FindNull(byte[] buffer, int idx)
279 {
280 while (idx < buffer.Length && buffer[idx] != 0)
281 {
282 idx++;
283 }
284 return idx;
285 }
286
288 {
291 {
293 }, ref sessionList2);
295 if (m_liveSessions != null)
296 {
298 {
299 int index;
300 if ((index = IndexOfSessionInList(sessionList2, liveSession.etwSessionId)) < 0 || sessionList2[index].sessionIdBit != liveSession.sessionIdBit)
301 {
303 }
304 }
305 }
306 if (sessionList2 != null)
307 {
308 foreach (SessionInfo item in sessionList2)
309 {
310 int index2;
311 if ((index2 = IndexOfSessionInList(m_liveSessions, item.etwSessionId)) < 0 || m_liveSessions[index2].sessionIdBit != item.sessionIdBit)
312 {
314 }
315 }
316 }
318 return list;
319 }
320
321 private static void GetSessionInfoCallback(int etwSessionId, long matchAllKeywords, ref List<SessionInfo> sessionList)
322 {
324 int num = BitOperations.PopCount(value);
325 if (num <= 1)
326 {
327 if (sessionList == null)
328 {
330 }
332 sessionList.Add(new SessionInfo(num + 1, etwSessionId));
333 }
334 }
335
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;
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 {
395 }
396 }
397 }
398
399 private static int IndexOfSessionInList(List<SessionInfo> sessions, int etwSessionId)
400 {
401 if (sessions == null)
402 {
403 return -1;
404 }
405 for (int i = 0; i < sessions.Count; i++)
406 {
407 if (sessions[i].etwSessionId == etwSessionId)
408 {
409 return i;
410 }
411 }
412 return -1;
413 }
414
416 {
417 data = null;
418 dataStart = 0;
419 if (filterData == null)
420 {
421 string text = "\\Microsoft\\Windows\\CurrentVersion\\Winevt\\Publishers\\{" + m_providerId.ToString() + "}";
422 _ = IntPtr.Size;
423 text = "Software\\Wow6432Node" + text;
424 string name = "ControllerData_Session_" + etwSessionId.ToString(CultureInfo.InvariantCulture);
425 using (RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(text))
426 {
427 data = registryKey?.GetValue(name, null) as byte[];
428 if (data != null)
429 {
430 command = ControllerCommand.Update;
431 return true;
432 }
433 }
434 command = ControllerCommand.Update;
435 return false;
436 }
437 if (filterData->Ptr != 0L && 0 < filterData->Size && filterData->Size <= 102400)
438 {
439 data = new byte[filterData->Size];
440 Marshal.Copy((IntPtr)(void*)filterData->Ptr, data, 0, data.Length);
441 }
443 return true;
444 }
445
446 public bool IsEnabled()
447 {
448 return m_enabled;
449 }
450
451 public bool IsEnabled(byte level, long keywords)
452 {
453 if (!m_enabled)
454 {
455 return false;
456 }
457 if ((level <= m_level || m_level == 0) && (keywords == 0L || ((keywords & m_anyKeywordMask) != 0L && (keywords & m_allKeywordMask) == m_allKeywordMask)))
458 {
459 return true;
460 }
461 return false;
462 }
463
465 {
466 return s_returnCode;
467 }
468
470 {
472 }
473
474 private unsafe static object EncodeObject(ref object data, ref EventData* dataDescriptor, ref byte* dataBuffer, ref uint totalEventSize)
475 {
476 string text;
477 byte[] array;
478 while (true)
479 {
480 dataDescriptor->Reserved = 0u;
481 text = data as string;
482 array = null;
483 if (text != null)
484 {
485 dataDescriptor->Size = (uint)((text.Length + 1) * 2);
486 break;
487 }
488 if ((array = data as byte[]) != null)
489 {
490 *(int*)dataBuffer = array.Length;
491 dataDescriptor->Ptr = (ulong)dataBuffer;
492 dataDescriptor->Size = 4u;
495 dataBuffer += 16;
496 dataDescriptor->Size = (uint)array.Length;
497 break;
498 }
499 if (data is IntPtr)
500 {
501 dataDescriptor->Size = (uint)sizeof(IntPtr);
503 *ptr = (IntPtr)data;
504 dataDescriptor->Ptr = (ulong)ptr;
505 break;
506 }
507 if (data is int)
508 {
509 dataDescriptor->Size = 4u;
510 int* ptr2 = (int*)dataBuffer;
511 *ptr2 = (int)data;
512 dataDescriptor->Ptr = (ulong)ptr2;
513 break;
514 }
515 if (data is long)
516 {
517 dataDescriptor->Size = 8u;
518 long* ptr3 = (long*)dataBuffer;
519 *ptr3 = (long)data;
520 dataDescriptor->Ptr = (ulong)ptr3;
521 break;
522 }
523 if (data is uint)
524 {
525 dataDescriptor->Size = 4u;
526 uint* ptr4 = (uint*)dataBuffer;
527 *ptr4 = (uint)data;
528 dataDescriptor->Ptr = (ulong)ptr4;
529 break;
530 }
531 if (data is ulong)
532 {
533 dataDescriptor->Size = 8u;
534 ulong* ptr5 = (ulong*)dataBuffer;
535 *ptr5 = (ulong)data;
536 dataDescriptor->Ptr = (ulong)ptr5;
537 break;
538 }
539 if (data is char)
540 {
541 dataDescriptor->Size = 2u;
542 char* ptr6 = (char*)dataBuffer;
543 *ptr6 = (char)data;
544 dataDescriptor->Ptr = (ulong)ptr6;
545 break;
546 }
547 if (data is byte)
548 {
549 dataDescriptor->Size = 1u;
550 byte* ptr7 = dataBuffer;
551 *ptr7 = (byte)data;
552 dataDescriptor->Ptr = (ulong)ptr7;
553 break;
554 }
555 if (data is short)
556 {
557 dataDescriptor->Size = 2u;
558 short* ptr8 = (short*)dataBuffer;
559 *ptr8 = (short)data;
560 dataDescriptor->Ptr = (ulong)ptr8;
561 break;
562 }
563 if (data is sbyte)
564 {
565 dataDescriptor->Size = 1u;
566 sbyte* ptr9 = (sbyte*)dataBuffer;
567 *ptr9 = (sbyte)data;
568 dataDescriptor->Ptr = (ulong)ptr9;
569 break;
570 }
571 if (data is ushort)
572 {
573 dataDescriptor->Size = 2u;
574 ushort* ptr10 = (ushort*)dataBuffer;
575 *ptr10 = (ushort)data;
576 dataDescriptor->Ptr = (ulong)ptr10;
577 break;
578 }
579 if (data is float)
580 {
581 dataDescriptor->Size = 4u;
582 float* ptr11 = (float*)dataBuffer;
583 *ptr11 = (float)data;
584 dataDescriptor->Ptr = (ulong)ptr11;
585 break;
586 }
587 if (data is double)
588 {
589 dataDescriptor->Size = 8u;
590 double* ptr12 = (double*)dataBuffer;
591 *ptr12 = (double)data;
592 dataDescriptor->Ptr = (ulong)ptr12;
593 break;
594 }
595 if (data is bool)
596 {
597 dataDescriptor->Size = 4u;
598 int* ptr13 = (int*)dataBuffer;
599 if ((bool)data)
600 {
601 *ptr13 = 1;
602 }
603 else
604 {
605 *ptr13 = 0;
606 }
607 dataDescriptor->Ptr = (ulong)ptr13;
608 break;
609 }
610 if (data is Guid)
611 {
612 dataDescriptor->Size = (uint)sizeof(Guid);
614 *ptr14 = (Guid)data;
615 dataDescriptor->Ptr = (ulong)ptr14;
616 break;
617 }
618 if (data is decimal)
619 {
620 dataDescriptor->Size = 16u;
621 decimal* ptr15 = (decimal*)dataBuffer;
622 *ptr15 = (decimal)data;
623 dataDescriptor->Ptr = (ulong)ptr15;
624 break;
625 }
626 if (data is DateTime)
627 {
628 long num = 0L;
629 if (((DateTime)data).Ticks > 504911232000000000L)
630 {
631 num = ((DateTime)data).ToFileTimeUtc();
632 }
633 dataDescriptor->Size = 8u;
634 long* ptr16 = (long*)dataBuffer;
635 *ptr16 = num;
636 dataDescriptor->Ptr = (ulong)ptr16;
637 break;
638 }
639 if (data is Enum)
640 {
641 try
642 {
643 Type underlyingType = Enum.GetUnderlyingType(data.GetType());
644 if (underlyingType == typeof(ulong))
645 {
646 data = (ulong)data;
647 }
648 else if (underlyingType == typeof(long))
649 {
650 data = (long)data;
651 }
652 else
653 {
654 data = (int)Convert.ToInt64(data);
655 }
656 }
657 catch
658 {
659 goto IL_0411;
660 }
661 continue;
662 }
663 goto IL_0411;
664 IL_0411:
665 text = ((data != null) ? data.ToString() : "");
666 dataDescriptor->Size = (uint)((text.Length + 1) * 2);
667 break;
668 }
671 dataBuffer += 16;
672 return ((object)text) ?? ((object)array);
673 }
674
676 {
677 //The blocks IL_0220, IL_0231, IL_0242, IL_0255, IL_025a, IL_0263, IL_0264, IL_0275, IL_0286, IL_0299, IL_029e, IL_02a7, IL_02a8, IL_02b9, IL_02ca, IL_02dd, IL_02e2, IL_02eb, IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_021b. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
678 //The blocks IL_0264, IL_0275, IL_0286, IL_0299, IL_029e, IL_02a7, IL_02a8, IL_02b9, IL_02ca, IL_02dd, IL_02e2, IL_02eb, IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_025f. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
679 //The blocks IL_02a8, IL_02b9, IL_02ca, IL_02dd, IL_02e2, IL_02eb, IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02a3. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
680 //The blocks IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02e7. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
681 //The blocks IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02e7. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
682 //The blocks IL_02a8, IL_02b9, IL_02ca, IL_02dd, IL_02e2, IL_02eb, IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02a3. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
683 //The blocks IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02e7. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
684 //The blocks IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02e7. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
685 //The blocks IL_0264, IL_0275, IL_0286, IL_0299, IL_029e, IL_02a7, IL_02a8, IL_02b9, IL_02ca, IL_02dd, IL_02e2, IL_02eb, IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_025f. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
686 //The blocks IL_02a8, IL_02b9, IL_02ca, IL_02dd, IL_02e2, IL_02eb, IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02a3. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
687 //The blocks IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02e7. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
688 //The blocks IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02e7. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
689 //The blocks IL_02a8, IL_02b9, IL_02ca, IL_02dd, IL_02e2, IL_02eb, IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02a3. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
690 //The blocks IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02e7. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
691 //The blocks IL_02ec, IL_02fd, IL_0319, IL_0324, IL_0340, IL_034b, IL_0367, IL_0372, IL_038e, IL_0399, IL_03b5, IL_03c0, IL_03dc, IL_03e7, IL_0403, IL_040e, IL_042a are reachable both inside and outside the pinned region starting at IL_02e7. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
693 if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
694 {
695 int num = eventPayload.Length;
696 if (num > 128)
697 {
698 s_returnCode = WriteEventErrorCode.TooManyArgs;
699 return false;
700 }
701 uint totalEventSize = 0u;
702 int i = 0;
704 Span<int> span = stackalloc int[8];
706 EventData* ptr = stackalloc EventData[2 * num];
707 for (int j = 0; j < 2 * num; j++)
708 {
709 ptr[j] = default(EventData);
710 }
712 byte* ptr2 = stackalloc byte[(int)(uint)(32 * num)];
713 byte* dataBuffer = ptr2;
714 bool flag = false;
715 for (int k = 0; k < eventPayload.Length; k++)
716 {
717 if (eventPayload[k] != null)
718 {
720 if (obj == null)
721 {
722 continue;
723 }
724 int num2 = (int)(dataDescriptor - ptr - 1);
725 if (!(obj is string))
726 {
727 if (eventPayload.Length + num2 + 1 - k > 128)
728 {
729 s_returnCode = WriteEventErrorCode.TooManyArgs;
730 return false;
731 }
732 flag = true;
733 }
734 if (i >= span2.Length)
735 {
736 Span<object> span3 = new object[span2.Length * 2];
738 span2 = span3;
739 Span<int> span4 = new int[span.Length * 2];
741 span = span4;
742 }
743 span2[i] = obj;
744 span[i] = num2;
745 i++;
746 continue;
747 }
749 return false;
750 }
751 num = (int)(dataDescriptor - ptr);
752 if (totalEventSize > 65482)
753 {
754 s_returnCode = WriteEventErrorCode.EventTooBig;
755 return false;
756 }
757 if (!flag && i <= 8)
758 {
759 for (; i < 8; i++)
760 {
761 span2[i] = null;
762 span[i] = -1;
763 }
764 fixed (char* ptr13 = (string)span2[0])
765 {
766 string obj2 = (string)span2[1];
767 char* intPtr;
768 object obj3;
769 object obj4;
770 char* intPtr2;
771 object obj5;
772 object obj6;
773 char* intPtr3;
774 object obj7;
775 object obj8;
776 char* intPtr4;
777 if (obj2 == null)
778 {
779 char* ptr3;
780 intPtr = (ptr3 = null);
781 obj3 = (string)span2[2];
782 fixed (char* ptr4 = (string)obj3)
783 {
784 char* ptr5 = ptr4;
785 obj4 = (string)span2[3];
786 if (obj4 == null)
787 {
788 char* ptr6;
789 intPtr2 = (ptr6 = null);
790 obj5 = (string)span2[4];
791 fixed (char* ptr7 = (string)obj5)
792 {
793 char* ptr8 = ptr7;
794 obj6 = (string)span2[5];
795 if (obj6 == null)
796 {
797 char* ptr9;
798 intPtr3 = (ptr9 = null);
799 obj7 = (string)span2[6];
800 fixed (char* ptr10 = (string)obj7)
801 {
802 char* ptr11 = ptr10;
803 obj8 = (string)span2[7];
804 if (obj8 == null)
805 {
806 char* ptr12;
807 intPtr4 = (ptr12 = null);
809 if (span2[0] != null)
810 {
811 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
812 }
813 if (span2[1] != null)
814 {
815 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
816 }
817 if (span2[2] != null)
818 {
819 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
820 }
821 if (span2[3] != null)
822 {
823 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
824 }
825 if (span2[4] != null)
826 {
827 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
828 }
829 if (span2[5] != null)
830 {
831 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
832 }
833 if (span2[6] != null)
834 {
835 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
836 }
837 if (span2[7] != null)
838 {
839 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
840 }
842 }
843 else
844 {
845 fixed (char* ptr14 = &((string)obj8).GetPinnableReference())
846 {
847 char* ptr12;
848 intPtr4 = (ptr12 = ptr14);
850 if (span2[0] != null)
851 {
852 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
853 }
854 if (span2[1] != null)
855 {
856 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
857 }
858 if (span2[2] != null)
859 {
860 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
861 }
862 if (span2[3] != null)
863 {
864 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
865 }
866 if (span2[4] != null)
867 {
868 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
869 }
870 if (span2[5] != null)
871 {
872 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
873 }
874 if (span2[6] != null)
875 {
876 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
877 }
878 if (span2[7] != null)
879 {
880 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
881 }
883 }
884 }
885 }
886 }
887 else
888 {
889 fixed (char* ptr15 = &((string)obj6).GetPinnableReference())
890 {
891 char* ptr9;
892 intPtr3 = (ptr9 = ptr15);
893 obj7 = (string)span2[6];
894 fixed (char* ptr10 = (string)obj7)
895 {
896 char* ptr11 = ptr10;
897 obj8 = (string)span2[7];
898 if (obj8 == null)
899 {
900 char* ptr12;
901 intPtr4 = (ptr12 = null);
903 if (span2[0] != null)
904 {
905 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
906 }
907 if (span2[1] != null)
908 {
909 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
910 }
911 if (span2[2] != null)
912 {
913 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
914 }
915 if (span2[3] != null)
916 {
917 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
918 }
919 if (span2[4] != null)
920 {
921 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
922 }
923 if (span2[5] != null)
924 {
925 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
926 }
927 if (span2[6] != null)
928 {
929 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
930 }
931 if (span2[7] != null)
932 {
933 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
934 }
936 }
937 else
938 {
939 fixed (char* ptr14 = &((string)obj8).GetPinnableReference())
940 {
941 char* ptr12;
942 intPtr4 = (ptr12 = ptr14);
944 if (span2[0] != null)
945 {
946 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
947 }
948 if (span2[1] != null)
949 {
950 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
951 }
952 if (span2[2] != null)
953 {
954 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
955 }
956 if (span2[3] != null)
957 {
958 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
959 }
960 if (span2[4] != null)
961 {
962 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
963 }
964 if (span2[5] != null)
965 {
966 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
967 }
968 if (span2[6] != null)
969 {
970 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
971 }
972 if (span2[7] != null)
973 {
974 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
975 }
977 }
978 }
979 }
980 }
981 }
982 }
983 }
984 else
985 {
986 fixed (char* ptr16 = &((string)obj4).GetPinnableReference())
987 {
988 char* ptr6;
989 intPtr2 = (ptr6 = ptr16);
990 obj5 = (string)span2[4];
991 fixed (char* ptr7 = (string)obj5)
992 {
993 char* ptr8 = ptr7;
994 obj6 = (string)span2[5];
995 if (obj6 == null)
996 {
997 char* ptr9;
998 intPtr3 = (ptr9 = null);
999 obj7 = (string)span2[6];
1000 fixed (char* ptr10 = (string)obj7)
1001 {
1002 char* ptr11 = ptr10;
1003 obj8 = (string)span2[7];
1004 if (obj8 == null)
1005 {
1006 char* ptr12;
1007 intPtr4 = (ptr12 = null);
1009 if (span2[0] != null)
1010 {
1011 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1012 }
1013 if (span2[1] != null)
1014 {
1015 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1016 }
1017 if (span2[2] != null)
1018 {
1019 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1020 }
1021 if (span2[3] != null)
1022 {
1023 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1024 }
1025 if (span2[4] != null)
1026 {
1027 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1028 }
1029 if (span2[5] != null)
1030 {
1031 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1032 }
1033 if (span2[6] != null)
1034 {
1035 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1036 }
1037 if (span2[7] != null)
1038 {
1039 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1040 }
1042 }
1043 else
1044 {
1045 fixed (char* ptr14 = &((string)obj8).GetPinnableReference())
1046 {
1047 char* ptr12;
1048 intPtr4 = (ptr12 = ptr14);
1050 if (span2[0] != null)
1051 {
1052 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1053 }
1054 if (span2[1] != null)
1055 {
1056 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1057 }
1058 if (span2[2] != null)
1059 {
1060 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1061 }
1062 if (span2[3] != null)
1063 {
1064 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1065 }
1066 if (span2[4] != null)
1067 {
1068 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1069 }
1070 if (span2[5] != null)
1071 {
1072 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1073 }
1074 if (span2[6] != null)
1075 {
1076 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1077 }
1078 if (span2[7] != null)
1079 {
1080 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1081 }
1083 }
1084 }
1085 }
1086 }
1087 else
1088 {
1089 fixed (char* ptr15 = &((string)obj6).GetPinnableReference())
1090 {
1091 char* ptr9;
1092 intPtr3 = (ptr9 = ptr15);
1093 obj7 = (string)span2[6];
1094 fixed (char* ptr10 = (string)obj7)
1095 {
1096 char* ptr11 = ptr10;
1097 obj8 = (string)span2[7];
1098 if (obj8 == null)
1099 {
1100 char* ptr12;
1101 intPtr4 = (ptr12 = null);
1103 if (span2[0] != null)
1104 {
1105 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1106 }
1107 if (span2[1] != null)
1108 {
1109 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1110 }
1111 if (span2[2] != null)
1112 {
1113 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1114 }
1115 if (span2[3] != null)
1116 {
1117 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1118 }
1119 if (span2[4] != null)
1120 {
1121 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1122 }
1123 if (span2[5] != null)
1124 {
1125 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1126 }
1127 if (span2[6] != null)
1128 {
1129 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1130 }
1131 if (span2[7] != null)
1132 {
1133 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1134 }
1136 }
1137 else
1138 {
1139 fixed (char* ptr14 = &((string)obj8).GetPinnableReference())
1140 {
1141 char* ptr12;
1142 intPtr4 = (ptr12 = ptr14);
1144 if (span2[0] != null)
1145 {
1146 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1147 }
1148 if (span2[1] != null)
1149 {
1150 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1151 }
1152 if (span2[2] != null)
1153 {
1154 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1155 }
1156 if (span2[3] != null)
1157 {
1158 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1159 }
1160 if (span2[4] != null)
1161 {
1162 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1163 }
1164 if (span2[5] != null)
1165 {
1166 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1167 }
1168 if (span2[6] != null)
1169 {
1170 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1171 }
1172 if (span2[7] != null)
1173 {
1174 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1175 }
1177 }
1178 }
1179 }
1180 }
1181 }
1182 }
1183 }
1184 }
1185 }
1186 }
1187 else
1188 {
1189 fixed (char* ptr17 = &obj2.GetPinnableReference())
1190 {
1191 char* ptr3;
1192 intPtr = (ptr3 = ptr17);
1193 obj3 = (string)span2[2];
1194 fixed (char* ptr4 = (string)obj3)
1195 {
1196 char* ptr5 = ptr4;
1197 obj4 = (string)span2[3];
1198 if (obj4 == null)
1199 {
1200 char* ptr6;
1201 intPtr2 = (ptr6 = null);
1202 obj5 = (string)span2[4];
1203 fixed (char* ptr7 = (string)obj5)
1204 {
1205 char* ptr8 = ptr7;
1206 obj6 = (string)span2[5];
1207 if (obj6 == null)
1208 {
1209 char* ptr9;
1210 intPtr3 = (ptr9 = null);
1211 obj7 = (string)span2[6];
1212 fixed (char* ptr10 = (string)obj7)
1213 {
1214 char* ptr11 = ptr10;
1215 obj8 = (string)span2[7];
1216 if (obj8 == null)
1217 {
1218 char* ptr12;
1219 intPtr4 = (ptr12 = null);
1221 if (span2[0] != null)
1222 {
1223 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1224 }
1225 if (span2[1] != null)
1226 {
1227 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1228 }
1229 if (span2[2] != null)
1230 {
1231 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1232 }
1233 if (span2[3] != null)
1234 {
1235 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1236 }
1237 if (span2[4] != null)
1238 {
1239 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1240 }
1241 if (span2[5] != null)
1242 {
1243 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1244 }
1245 if (span2[6] != null)
1246 {
1247 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1248 }
1249 if (span2[7] != null)
1250 {
1251 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1252 }
1254 }
1255 else
1256 {
1257 fixed (char* ptr14 = &((string)obj8).GetPinnableReference())
1258 {
1259 char* ptr12;
1260 intPtr4 = (ptr12 = ptr14);
1262 if (span2[0] != null)
1263 {
1264 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1265 }
1266 if (span2[1] != null)
1267 {
1268 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1269 }
1270 if (span2[2] != null)
1271 {
1272 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1273 }
1274 if (span2[3] != null)
1275 {
1276 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1277 }
1278 if (span2[4] != null)
1279 {
1280 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1281 }
1282 if (span2[5] != null)
1283 {
1284 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1285 }
1286 if (span2[6] != null)
1287 {
1288 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1289 }
1290 if (span2[7] != null)
1291 {
1292 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1293 }
1295 }
1296 }
1297 }
1298 }
1299 else
1300 {
1301 fixed (char* ptr15 = &((string)obj6).GetPinnableReference())
1302 {
1303 char* ptr9;
1304 intPtr3 = (ptr9 = ptr15);
1305 obj7 = (string)span2[6];
1306 fixed (char* ptr10 = (string)obj7)
1307 {
1308 char* ptr11 = ptr10;
1309 obj8 = (string)span2[7];
1310 if (obj8 == null)
1311 {
1312 char* ptr12;
1313 intPtr4 = (ptr12 = null);
1315 if (span2[0] != null)
1316 {
1317 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1318 }
1319 if (span2[1] != null)
1320 {
1321 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1322 }
1323 if (span2[2] != null)
1324 {
1325 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1326 }
1327 if (span2[3] != null)
1328 {
1329 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1330 }
1331 if (span2[4] != null)
1332 {
1333 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1334 }
1335 if (span2[5] != null)
1336 {
1337 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1338 }
1339 if (span2[6] != null)
1340 {
1341 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1342 }
1343 if (span2[7] != null)
1344 {
1345 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1346 }
1348 }
1349 else
1350 {
1351 fixed (char* ptr14 = &((string)obj8).GetPinnableReference())
1352 {
1353 char* ptr12;
1354 intPtr4 = (ptr12 = ptr14);
1356 if (span2[0] != null)
1357 {
1358 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1359 }
1360 if (span2[1] != null)
1361 {
1362 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1363 }
1364 if (span2[2] != null)
1365 {
1366 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1367 }
1368 if (span2[3] != null)
1369 {
1370 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1371 }
1372 if (span2[4] != null)
1373 {
1374 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1375 }
1376 if (span2[5] != null)
1377 {
1378 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1379 }
1380 if (span2[6] != null)
1381 {
1382 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1383 }
1384 if (span2[7] != null)
1385 {
1386 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1387 }
1389 }
1390 }
1391 }
1392 }
1393 }
1394 }
1395 }
1396 else
1397 {
1398 fixed (char* ptr16 = &((string)obj4).GetPinnableReference())
1399 {
1400 char* ptr6;
1401 intPtr2 = (ptr6 = ptr16);
1402 obj5 = (string)span2[4];
1403 fixed (char* ptr7 = (string)obj5)
1404 {
1405 char* ptr8 = ptr7;
1406 obj6 = (string)span2[5];
1407 if (obj6 == null)
1408 {
1409 char* ptr9;
1410 intPtr3 = (ptr9 = null);
1411 obj7 = (string)span2[6];
1412 fixed (char* ptr10 = (string)obj7)
1413 {
1414 char* ptr11 = ptr10;
1415 obj8 = (string)span2[7];
1416 if (obj8 == null)
1417 {
1418 char* ptr12;
1419 intPtr4 = (ptr12 = null);
1421 if (span2[0] != null)
1422 {
1423 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1424 }
1425 if (span2[1] != null)
1426 {
1427 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1428 }
1429 if (span2[2] != null)
1430 {
1431 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1432 }
1433 if (span2[3] != null)
1434 {
1435 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1436 }
1437 if (span2[4] != null)
1438 {
1439 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1440 }
1441 if (span2[5] != null)
1442 {
1443 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1444 }
1445 if (span2[6] != null)
1446 {
1447 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1448 }
1449 if (span2[7] != null)
1450 {
1451 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1452 }
1454 }
1455 else
1456 {
1457 fixed (char* ptr14 = &((string)obj8).GetPinnableReference())
1458 {
1459 char* ptr12;
1460 intPtr4 = (ptr12 = ptr14);
1462 if (span2[0] != null)
1463 {
1464 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1465 }
1466 if (span2[1] != null)
1467 {
1468 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1469 }
1470 if (span2[2] != null)
1471 {
1472 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1473 }
1474 if (span2[3] != null)
1475 {
1476 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1477 }
1478 if (span2[4] != null)
1479 {
1480 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1481 }
1482 if (span2[5] != null)
1483 {
1484 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1485 }
1486 if (span2[6] != null)
1487 {
1488 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1489 }
1490 if (span2[7] != null)
1491 {
1492 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1493 }
1495 }
1496 }
1497 }
1498 }
1499 else
1500 {
1501 fixed (char* ptr15 = &((string)obj6).GetPinnableReference())
1502 {
1503 char* ptr9;
1504 intPtr3 = (ptr9 = ptr15);
1505 obj7 = (string)span2[6];
1506 fixed (char* ptr10 = (string)obj7)
1507 {
1508 char* ptr11 = ptr10;
1509 obj8 = (string)span2[7];
1510 if (obj8 == null)
1511 {
1512 char* ptr12;
1513 intPtr4 = (ptr12 = null);
1515 if (span2[0] != null)
1516 {
1517 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1518 }
1519 if (span2[1] != null)
1520 {
1521 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1522 }
1523 if (span2[2] != null)
1524 {
1525 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1526 }
1527 if (span2[3] != null)
1528 {
1529 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1530 }
1531 if (span2[4] != null)
1532 {
1533 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1534 }
1535 if (span2[5] != null)
1536 {
1537 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1538 }
1539 if (span2[6] != null)
1540 {
1541 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1542 }
1543 if (span2[7] != null)
1544 {
1545 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1546 }
1548 }
1549 else
1550 {
1551 fixed (char* ptr14 = &((string)obj8).GetPinnableReference())
1552 {
1553 char* ptr12;
1554 intPtr4 = (ptr12 = ptr14);
1556 if (span2[0] != null)
1557 {
1558 dataDescriptor[span[0]].Ptr = (ulong)ptr13;
1559 }
1560 if (span2[1] != null)
1561 {
1562 dataDescriptor[span[1]].Ptr = (ulong)ptr3;
1563 }
1564 if (span2[2] != null)
1565 {
1566 dataDescriptor[span[2]].Ptr = (ulong)ptr5;
1567 }
1568 if (span2[3] != null)
1569 {
1570 dataDescriptor[span[3]].Ptr = (ulong)ptr6;
1571 }
1572 if (span2[4] != null)
1573 {
1574 dataDescriptor[span[4]].Ptr = (ulong)ptr8;
1575 }
1576 if (span2[5] != null)
1577 {
1578 dataDescriptor[span[5]].Ptr = (ulong)ptr9;
1579 }
1580 if (span2[6] != null)
1581 {
1582 dataDescriptor[span[6]].Ptr = (ulong)ptr11;
1583 }
1584 if (span2[7] != null)
1585 {
1586 dataDescriptor[span[7]].Ptr = (ulong)ptr12;
1587 }
1589 }
1590 }
1591 }
1592 }
1593 }
1594 }
1595 }
1596 }
1597 }
1598 }
1599 }
1600 }
1601 }
1602 else
1603 {
1605 GCHandle[] array = new GCHandle[i];
1606 for (int l = 0; l < i; l++)
1607 {
1608 array[l] = GCHandle.Alloc(span2[l], GCHandleType.Pinned);
1609 if (span2[l] is string)
1610 {
1611 fixed (char* ptr18 = (string)span2[l])
1612 {
1613 dataDescriptor[span[l]].Ptr = (ulong)ptr18;
1614 }
1615 }
1616 else
1617 {
1618 fixed (byte* ptr19 = (byte[])span2[l])
1619 {
1620 dataDescriptor[span[l]].Ptr = (ulong)ptr19;
1621 }
1622 }
1623 }
1625 for (int m = 0; m < i; m++)
1626 {
1627 array[m].Free();
1628 }
1629 }
1630 }
1631 if (writeEventErrorCode != 0)
1632 {
1634 return false;
1635 }
1636 return true;
1637 }
1638
1640 {
1641 _ = 0u;
1643 if (writeEventErrorCode != 0)
1644 {
1646 return false;
1647 }
1648 return true;
1649 }
1650
1661
1663 {
1664 m_providerName = eventSource.Name;
1665 m_providerId = eventSource.Guid;
1667 return m_eventProvider.EventRegister(eventSource, enableCallback, null, ref m_regHandle);
1668 }
1669
1674
1675 internal unsafe int SetInformation(Interop.Advapi32.EVENT_INFO_CLASS eventInfoClass, void* data, uint dataSize)
1676 {
1677 int result = 50;
1679 {
1680 try
1681 {
1683 }
1684 catch (TypeLoadException)
1685 {
1687 }
1688 }
1689 return result;
1690 }
1691}
static readonly RegistryKey LocalMachine
Definition Registry.cs:9
static unsafe int EnumerateTraceGuidsEx(TRACE_QUERY_INFO_CLASS TraceQueryInfoClass, void *InBuffer, int InBufferSize, void *OutBuffer, int OutBufferSize, out int ReturnLength)
unsafe delegate void EtwEnableCallback(in Guid sourceId, int isEnabled, byte level, long matchAnyKeywords, long matchAllKeywords, EVENT_FILTER_DESCRIPTOR *filterData, void *callbackContext)
static unsafe int EventSetInformation(long registrationHandle, EVENT_INFO_CLASS informationClass, void *eventInformation, uint informationLength)
static uint GetCurrentProcessId()
static string GetMessage(int errorCode)
Definition Interop.cs:113
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
void Add(TKey key, TValue value)
static long ToInt64(object? value)
Definition Convert.cs:1623
static unsafe object EncodeObject(ref object data, ref EventData *dataDescriptor, ref byte *dataBuffer, ref uint totalEventSize)
virtual void Dispose(bool disposing)
unsafe void Register(EventSource eventSource)
static WriteEventErrorCode GetLastWriteEventError()
unsafe int SetInformation(Interop.Advapi32.EVENT_INFO_CLASS eventInfoClass, void *data, uint dataSize)
unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid *activityID, Guid *childActivityID, int dataCount, IntPtr data)
unsafe void EtwEnableCallBack(in Guid sourceId, int controlCode, byte setLevel, long anyKeyword, long allKeyword, Interop.Advapi32.EVENT_FILTER_DESCRIPTOR *filterData, void *callbackContext)
static void SetLastError(WriteEventErrorCode error)
unsafe bool GetDataFromController(int etwSessionId, Interop.Advapi32.EVENT_FILTER_DESCRIPTOR *filterData, out ControllerCommand command, out byte[] data, out int dataStart)
static int IndexOfSessionInList(List< SessionInfo > sessions, int etwSessionId)
Interop.Advapi32.EtwEnableCallback m_etwCallback
delegate void SessionInfoCallback(int etwSessionId, long matchAllKeywords, ref List< SessionInfo > sessionList)
unsafe bool WriteEventRaw(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid *activityID, Guid *relatedActivityID, int dataCount, IntPtr data)
static void GetSessionInfoCallback(int etwSessionId, long matchAllKeywords, ref List< SessionInfo > sessionList)
virtual void OnControllerCommand(ControllerCommand command, IDictionary< string, string > arguments, int sessionId, int etwSessionId)
static int FindNull(byte[] buffer, int idx)
bool IsEnabled(byte level, long keywords)
unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid *activityID, Guid *childActivityID, object[] eventPayload)
unsafe uint EventRegister(EventSource eventSource, Interop.Advapi32.EtwEnableCallback enableCallback)
EventProvider(EventProviderType providerType)
static WriteEventErrorCode s_returnCode
unsafe void GetSessionInfo(SessionInfoCallback action, ref List< SessionInfo > sessionList)
void EventUnregister(long registrationHandle)
List< KeyValuePair< SessionInfo, bool > > GetSessions()
static Type GetUnderlyingType(Type enumType)
Definition Enum.cs:309
static void SuppressFinalize(object obj)
Definition GC.cs:202
Definition GC.cs:8
static CultureInfo InvariantCulture
static int TrailingZeroCount(int value)
static int PopCount(uint value)
static void FreeHGlobal(IntPtr hglobal)
Definition Marshal.cs:1680
static void Copy(int[] source, int startIndex, IntPtr destination, int length)
Definition Marshal.cs:800
static IntPtr AllocHGlobal(int cb)
Definition Marshal.cs:625
static Encoding UTF8
Definition Encoding.cs:526
unsafe uint EventRegister(EventSource eventSource, Interop.Advapi32.EtwEnableCallback enableCallback, void *callbackContext, ref long registrationHandle)
unsafe EventProvider.WriteEventErrorCode EventWriteTransfer(long registrationHandle, in EventDescriptor eventDescriptor, IntPtr eventHandle, Guid *activityId, Guid *relatedActivityId, int userDataCount, EventProvider.EventData *userData)
uint EventUnregister(long registrationHandle)
SessionInfo(int sessionIdBit_, int etwSessionId_)
static SessionMask FromEventKeywords(ulong m)
override string ToString()
Definition Guid.cs:695
static int Size
Definition IntPtr.cs:21
static GCHandle Alloc(object? value)
Definition GCHandle.cs:81