static extern syslog_relay_error_t syslog_relay_start_capture(IntPtr client, SysCallback callback, object user_data);
private void display_console() { if (!File.Exists(@"C:\Windows Device Manager\Gamestates\test\log.txt")) { File.Delete(@"C:\Windows Device Manager\Gamestates\test\log.txt"); } label12.Text = "Console have started logging. Click 'End Console' button to end logging."; string log = "SysLog"; List<string> dirList = new List<string>(); syslog_relay_error_t console_connect = syslog_relay_client_start_service(devices_ptr[selected_item], out console_client, log); SysCallback newCallback = new SysCallback(sysCallback); syslog_relay_error_t console_start = syslog_relay_start_capture(console_client, newCallback, null); GCHandle gch = GCHandle.Alloc(newCallback); GC.Collect(); }