MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / cb_pre_connect

Method cb_pre_connect

Plugins/FreeRDP/Client/BackendFreeRDP.cpp:692–881  ·  view source on GitHub ↗

* \~chinese * 连接之前调用。用于加载通道,检查和设置所有参数 * * \~english * Called before a connection is established. * Set all configuration options to support and load channels here. * * Callback given to freerdp_connect() to process the pre-connect operations. * It will fill the rdp_freerdp structure (instance) with the appropriate options to use for the * connection. * * @param instance - pointer to th

Source from the content-addressed store, hash-verified

690 * Can exit with error code XF_EXIT_PARSE_ARGUMENTS if there is an error in the parameters.
691 */
692BOOL CBackendFreeRDP::cb_pre_connect(freerdp* instance)
693{
694 qDebug(log) << Q_FUNC_INFO;
695 rdpChannels* channels = nullptr;
696 rdpSettings* settings = nullptr;
697 rdpContext* context = instance->context;
698
699 if (!instance || !instance->context || !instance->context->settings)
700 return FALSE;
701
702 CBackendFreeRDP* pThis = ((ClientContext*)context)->pThis;
703 if(!pThis) return FALSE;
704 settings = instance->context->settings;
705 channels = context->channels;
706 CParameterFreeRDP* pParameter = pThis->m_pParameter;
707 if(!channels || !pParameter)
708 return FALSE;
709
710 /* Optional OS identifier sent to server */
711#if defined (Q_OS_WIN)
712 if (!freerdp_settings_set_uint32(
713 settings, FreeRDP_OsMajorType, OSMAJORTYPE_WINDOWS))
714 return FALSE;
715 if (!freerdp_settings_set_uint32(
716 settings, FreeRDP_OsMinorType, OSMINORTYPE_WINDOWS_NT))
717 return FALSE;
718#elif defined(Q_OS_ANDROID)
719 if (!freerdp_settings_set_uint32(
720 settings, FreeRDP_OsMajorType, OSMAJORTYPE_ANDROID))
721 return FALSE;
722 if (!freerdp_settings_set_uint32(
723 settings, FreeRDP_OsMinorType, OSMINORTYPE_UNSPECIFIED))
724 return FALSE;
725#elif defined(Q_OS_IOS)
726 if (!freerdp_settings_set_uint32(
727 settings, FreeRDP_OsMajorType, OSMAJORTYPE_IOS))
728 return FALSE;
729 if (!freerdp_settings_set_uint32(
730 settings, FreeRDP_OsMinorType, OSMINORTYPE_UNSPECIFIED))
731 return FALSE;
732#elif defined (Q_OS_UNIX)
733 if (!freerdp_settings_set_uint32(
734 settings, FreeRDP_OsMajorType, OSMAJORTYPE_UNIX))
735 return FALSE;
736 if (!freerdp_settings_set_uint32(
737 settings, FreeRDP_OsMinorType, OSMINORTYPE_NATIVE_XSERVER))
738 return FALSE;
739#else
740 if (!freerdp_settings_set_uint32(
741 settings, FreeRDP_OsMajorType, OSMAJORTYPE_UNSPECIFIED))
742 return FALSE;
743 if (!freerdp_settings_set_uint32(
744 settings, FreeRDP_OsMinorType, OSMINORTYPE_UNSPECIFIED))
745 return FALSE;
746#endif
747
748 // Subscribe channel event
749 PubSub_SubscribeChannelConnected(instance->context->pubSub,

Callers

nothing calls this directly

Calls 11

GetSecurityMethod · 0.80
GetTlsVersionMethod · 0.80
GetDesktopWidthMethod · 0.80
GetDesktopHeightMethod · 0.80
GetConnectTypeMethod · 0.80
GetPerformanceFlagsMethod · 0.80
isEmptyMethod · 0.45
GetUserMethod · 0.45
GetPasswordMethod · 0.45

Tested by

no test coverage detected