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

◆ GetDataFromController()

unsafe bool System.Diagnostics.Tracing.EventProvider.GetDataFromController ( int etwSessionId,
Interop::Advapi32::EVENT_FILTER_DESCRIPTOR * filterData,
out ControllerCommand command,
out byte[] data,
out int dataStart )
inlineprivateinherited

Definition at line 415 of file EventProvider.cs.

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 }
static readonly RegistryKey LocalMachine
Definition Registry.cs:9
static CultureInfo InvariantCulture
static void Copy(int[] source, int startIndex, IntPtr destination, int length)
Definition Marshal.cs:800
override string ToString()
Definition Guid.cs:695

References System.Runtime.InteropServices.Marshal.Copy(), System.Globalization.CultureInfo.InvariantCulture, System.L, Internal.Win32.Registry.LocalMachine, System.Diagnostics.Tracing.EventProvider.m_providerId, System.IntPtr.Size, System.text, and System.Guid.ToString().

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