| 62 | #include "Channel.h" |
| 63 | |
| 64 | static Q_LOGGING_CATEGORY(log, "FreeRDP.Connect") |
| 65 | static Q_LOGGING_CATEGORY(logKey, "FreeRDP.Connect.Key") |
| 66 | static Q_LOGGING_CATEGORY(logMouse, "FreeRDP.Connect.Mouse") |
| 67 | |
| 68 | CBackendFreeRDP::CBackendFreeRDP(COperateFreeRDP *pOperate) |
| 69 | : CBackendDesktop(pOperate) |
| 70 | , m_pOperate(pOperate) |
| 71 | , m_pContext(nullptr) |
| 72 | , m_pParameter(nullptr) |
| 73 | , m_ClipBoard(this) |
| 74 | , m_Cursor(this) |
| 75 | , m_writeEvent(nullptr) |
| 76 | #if FREERDP_VERSION_MAJOR >= 3 |
| 77 | , m_pConnectLayer(nullptr) |
| 78 | #endif |
| 79 | #ifdef HAVE_LIBSSH |
| 80 | , m_pThreadSSH(nullptr) |
| 81 | #endif |
| 82 | { |
| 83 | qDebug(log) << Q_FUNC_INFO; |
| 84 | m_pParameter = qobject_cast<CParameterFreeRDP*>(pOperate->GetParameter()); |
| 85 | Q_ASSERT(m_pParameter); |
| 86 | } |
| 87 | |
| 88 | CBackendFreeRDP::~CBackendFreeRDP() |
| 89 | { |
| 90 | qDebug(log) << Q_FUNC_INFO; |
| 91 | } |
| 92 | |
| 93 | /* |
| 94 | * \return |
| 95 | * \li OnInitReturnValue::Fail: error |
| 96 | * \li OnInitReturnValue::UseOnProcess: Use OnProcess (non-Qt event loop) |
| 97 | * \li OnInitReturnValue::NotUseOnProcess: Don't use OnProcess (qt event loop) |
| 98 | */ |
| 99 | CBackendFreeRDP::OnInitReturnValue CBackendFreeRDP::OnInit() |
| 100 | { |
| 101 | qDebug(log) << Q_FUNC_INFO; |
| 102 | int nRet = 0; |
| 103 | |
| 104 | m_writeEvent = CreateEvent(NULL, TRUE, FALSE, NULL); |
| 105 | if(!m_writeEvent) { |
| 106 | qCritical(log) << "CreateEvent failed"; |
| 107 | return OnInitReturnValue::Fail; |
| 108 | } |
| 109 | ZeroMemory(&m_ClientEntryPoints, sizeof(RDP_CLIENT_ENTRY_POINTS)); |
| 110 | m_ClientEntryPoints.Version = RDP_CLIENT_INTERFACE_VERSION; |
| 111 | m_ClientEntryPoints.Size = sizeof(RDP_CLIENT_ENTRY_POINTS); |
| 112 | //m_ClientEntryPoints.settings = m_pParameter->m_pSettings; |
| 113 | m_ClientEntryPoints.GlobalInit = cbGlobalInit; |
| 114 | m_ClientEntryPoints.GlobalUninit = cbGlobalUninit; |
| 115 | m_ClientEntryPoints.ClientNew = cbClientNew; |
| 116 | m_ClientEntryPoints.ClientFree = cbClientFree; |
| 117 | m_ClientEntryPoints.ClientStart = cbClientStart; |
| 118 | m_ClientEntryPoints.ClientStop = cbClientStop; |
| 119 | m_ClientEntryPoints.ContextSize = sizeof(ClientContext); |
| 120 | |
| 121 | auto pRdpContext = freerdp_client_context_new(&m_ClientEntryPoints); |
nothing calls this directly
no test coverage detected