mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
Merge pull request #12330 from akallabeth/shadow-fix
[server,shadow] fix return and parameter checks
This commit is contained in:
@@ -44,7 +44,7 @@ static constexpr char plugin_name[] = "bitmap-filter";
|
||||
static constexpr char plugin_desc[] =
|
||||
"this plugin deactivates and filters persistent bitmap cache.";
|
||||
|
||||
static const std::vector<std::string>& plugin_static_intercept()
|
||||
[[nodiscard]] static const std::vector<std::string>& plugin_static_intercept()
|
||||
{
|
||||
static std::vector<std::string> vec;
|
||||
if (vec.empty())
|
||||
@@ -52,7 +52,7 @@ static const std::vector<std::string>& plugin_static_intercept()
|
||||
return vec;
|
||||
}
|
||||
|
||||
static const std::vector<std::string>& plugin_dyn_intercept()
|
||||
[[nodiscard]] static const std::vector<std::string>& plugin_dyn_intercept()
|
||||
{
|
||||
static std::vector<std::string> vec;
|
||||
if (vec.empty())
|
||||
@@ -120,9 +120,9 @@ class DynChannelState
|
||||
uint32_t _channelId = 0;
|
||||
};
|
||||
|
||||
static BOOL filter_client_pre_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
[[nodiscard]] static BOOL filter_client_pre_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
@@ -135,9 +135,9 @@ static BOOL filter_client_pre_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
return freerdp_settings_set_bool(settings, FreeRDP_BitmapCachePersistEnabled, FALSE);
|
||||
}
|
||||
|
||||
static BOOL filter_dyn_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* arg)
|
||||
[[nodiscard]] static BOOL filter_dyn_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* arg)
|
||||
{
|
||||
auto data = static_cast<proxyChannelToInterceptData*>(arg);
|
||||
|
||||
@@ -152,9 +152,9 @@ static BOOL filter_dyn_channel_intercept_list([[maybe_unused]] proxyPlugin* plug
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL filter_static_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* arg)
|
||||
[[nodiscard]] static BOOL filter_static_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* arg)
|
||||
{
|
||||
auto data = static_cast<proxyChannelToInterceptData*>(arg);
|
||||
|
||||
@@ -169,7 +169,7 @@ static BOOL filter_static_channel_intercept_list([[maybe_unused]] proxyPlugin* p
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static size_t drdynvc_cblen_to_bytes(UINT8 cbLen)
|
||||
[[nodiscard]] static size_t drdynvc_cblen_to_bytes(UINT8 cbLen)
|
||||
{
|
||||
switch (cbLen)
|
||||
{
|
||||
@@ -184,7 +184,7 @@ static size_t drdynvc_cblen_to_bytes(UINT8 cbLen)
|
||||
}
|
||||
}
|
||||
|
||||
static UINT32 drdynvc_read_variable_uint(wStream* s, UINT8 cbLen)
|
||||
[[nodiscard]] static UINT32 drdynvc_read_variable_uint(wStream* s, UINT8 cbLen)
|
||||
{
|
||||
UINT32 val = 0;
|
||||
|
||||
@@ -206,7 +206,7 @@ static UINT32 drdynvc_read_variable_uint(wStream* s, UINT8 cbLen)
|
||||
return val;
|
||||
}
|
||||
|
||||
static BOOL drdynvc_try_read_header(wStream* s, uint32_t& channelId, size_t& length)
|
||||
[[nodiscard]] static BOOL drdynvc_try_read_header(wStream* s, uint32_t& channelId, size_t& length)
|
||||
{
|
||||
UINT8 value = 0;
|
||||
Stream_SetPosition(s, 0);
|
||||
@@ -245,7 +245,7 @@ static BOOL drdynvc_try_read_header(wStream* s, uint32_t& channelId, size_t& len
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static DynChannelState* filter_get_plugin_data(proxyPlugin* plugin, proxyData* pdata)
|
||||
[[nodiscard]] static DynChannelState* filter_get_plugin_data(proxyPlugin* plugin, proxyData* pdata)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
@@ -257,7 +257,8 @@ static DynChannelState* filter_get_plugin_data(proxyPlugin* plugin, proxyData* p
|
||||
return static_cast<DynChannelState*>(mgr->GetPluginData(mgr, plugin_name, pdata));
|
||||
}
|
||||
|
||||
static BOOL filter_set_plugin_data(proxyPlugin* plugin, proxyData* pdata, DynChannelState* data)
|
||||
[[nodiscard]] static BOOL filter_set_plugin_data(proxyPlugin* plugin, proxyData* pdata,
|
||||
DynChannelState* data)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
@@ -270,7 +271,7 @@ static BOOL filter_set_plugin_data(proxyPlugin* plugin, proxyData* pdata, DynCha
|
||||
}
|
||||
|
||||
#if defined(REPLY_WITH_EMPTY_OFFER)
|
||||
static UINT8 drdynvc_value_to_cblen(UINT32 value)
|
||||
[[nodiscard]] static UINT8 drdynvc_value_to_cblen(UINT32 value)
|
||||
{
|
||||
if (value <= 0xFF)
|
||||
return 0;
|
||||
@@ -279,7 +280,7 @@ static UINT8 drdynvc_value_to_cblen(UINT32 value)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static BOOL drdynvc_write_variable_uint(wStream* s, UINT32 value, UINT8 cbLen)
|
||||
[[nodiscard]] static BOOL drdynvc_write_variable_uint(wStream* s, UINT32 value, UINT8 cbLen)
|
||||
{
|
||||
switch (cbLen)
|
||||
{
|
||||
@@ -299,7 +300,7 @@ static BOOL drdynvc_write_variable_uint(wStream* s, UINT32 value, UINT8 cbLen)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL drdynvc_write_header(wStream* s, UINT32 channelId)
|
||||
[[nodiscard]] static BOOL drdynvc_write_header(wStream* s, UINT32 channelId)
|
||||
{
|
||||
const UINT8 cbChId = drdynvc_value_to_cblen(channelId);
|
||||
const UINT8 value = (DATA_PDU << 4) | cbChId;
|
||||
@@ -312,8 +313,9 @@ static BOOL drdynvc_write_header(wStream* s, UINT32 channelId)
|
||||
return drdynvc_write_variable_uint(s, value, cbChId);
|
||||
}
|
||||
|
||||
static BOOL filter_forward_empty_offer(const char* sessionID, proxyDynChannelInterceptData* data,
|
||||
size_t startPosition, UINT32 channelId)
|
||||
[[nodiscard]] static BOOL filter_forward_empty_offer(const char* sessionID,
|
||||
proxyDynChannelInterceptData* data,
|
||||
size_t startPosition, UINT32 channelId)
|
||||
{
|
||||
WINPR_ASSERT(data);
|
||||
|
||||
@@ -333,7 +335,8 @@ static BOOL filter_forward_empty_offer(const char* sessionID, proxyDynChannelInt
|
||||
}
|
||||
#endif
|
||||
|
||||
static BOOL filter_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata, void* arg)
|
||||
[[nodiscard]] static BOOL filter_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata,
|
||||
void* arg)
|
||||
{
|
||||
auto data = static_cast<proxyDynChannelInterceptData*>(arg);
|
||||
|
||||
@@ -420,7 +423,8 @@ static BOOL filter_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL filter_server_session_started(proxyPlugin* plugin, proxyData* pdata, void* /*unused*/)
|
||||
[[nodiscard]] static BOOL filter_server_session_started(proxyPlugin* plugin, proxyData* pdata,
|
||||
void* /*unused*/)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
@@ -438,18 +442,19 @@ static BOOL filter_server_session_started(proxyPlugin* plugin, proxyData* pdata,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL filter_server_session_end(proxyPlugin* plugin, proxyData* pdata, void* /*unused*/)
|
||||
[[nodiscard]] static BOOL filter_server_session_end(proxyPlugin* plugin, proxyData* pdata,
|
||||
void* /*unused*/)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
|
||||
auto state = filter_get_plugin_data(plugin, pdata);
|
||||
delete state;
|
||||
filter_set_plugin_data(plugin, pdata, nullptr);
|
||||
return TRUE;
|
||||
return filter_set_plugin_data(plugin, pdata, nullptr);
|
||||
}
|
||||
|
||||
static BOOL int_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
[[nodiscard]] static BOOL int_proxy_module_entry_point(proxyPluginsManager* plugins_manager,
|
||||
void* userdata)
|
||||
{
|
||||
proxyPlugin plugin = {};
|
||||
|
||||
@@ -478,6 +483,7 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
#if defined(BUILD_SHARED_LIBS)
|
||||
[[nodiscard]]
|
||||
FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata);
|
||||
|
||||
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
@@ -485,6 +491,7 @@ extern "C"
|
||||
return int_proxy_module_entry_point(plugins_manager, userdata);
|
||||
}
|
||||
#else
|
||||
[[nodiscard]]
|
||||
FREERDP_API BOOL bitmap_filter_proxy_module_entry_point(proxyPluginsManager* plugins_manager,
|
||||
void* userdata);
|
||||
BOOL bitmap_filter_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
|
||||
@@ -36,6 +36,7 @@ struct demo_custom_data
|
||||
static constexpr char plugin_name[] = "demo";
|
||||
static constexpr char plugin_desc[] = "this is a test plugin";
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_plugin_unload([[maybe_unused]] proxyPlugin* plugin)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
@@ -49,6 +50,7 @@ static BOOL demo_plugin_unload([[maybe_unused]] proxyPlugin* plugin)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_init_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -61,6 +63,7 @@ static BOOL demo_client_init_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_uninit_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -73,6 +76,7 @@ static BOOL demo_client_uninit_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_pre_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -85,6 +89,7 @@ static BOOL demo_client_pre_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_post_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -97,6 +102,7 @@ static BOOL demo_client_post_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_post_disconnect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -109,6 +115,7 @@ static BOOL demo_client_post_disconnect([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_x509_certificate([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -121,6 +128,7 @@ static BOOL demo_client_x509_certificate([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_login_failure([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -133,6 +141,7 @@ static BOOL demo_client_login_failure([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_end_paint([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata, [[maybe_unused]] void* custom)
|
||||
{
|
||||
@@ -144,6 +153,7 @@ static BOOL demo_client_end_paint([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_redirect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata, [[maybe_unused]] void* custom)
|
||||
{
|
||||
@@ -155,6 +165,7 @@ static BOOL demo_client_redirect([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_server_post_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -167,6 +178,7 @@ static BOOL demo_server_post_connect([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_server_peer_activate([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -179,6 +191,7 @@ static BOOL demo_server_peer_activate([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_server_channels_init([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -191,6 +204,7 @@ static BOOL demo_server_channels_init([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_server_channels_free([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -203,6 +217,7 @@ static BOOL demo_server_channels_free([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_server_session_end([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* custom)
|
||||
@@ -215,6 +230,7 @@ static BOOL demo_server_session_end([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_filter_keyboard_event([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* param)
|
||||
@@ -242,6 +258,7 @@ static BOOL demo_filter_keyboard_event([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_filter_unicode_event([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* param)
|
||||
@@ -269,6 +286,7 @@ static BOOL demo_filter_unicode_event([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_mouse_event([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata, [[maybe_unused]] void* param)
|
||||
{
|
||||
@@ -282,6 +300,7 @@ static BOOL demo_mouse_event([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_mouse_ex_event([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata, [[maybe_unused]] void* param)
|
||||
{
|
||||
@@ -295,6 +314,7 @@ static BOOL demo_mouse_ex_event([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_client_channel_data([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* param)
|
||||
@@ -310,6 +330,7 @@ static BOOL demo_client_channel_data([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_server_channel_data([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* param)
|
||||
@@ -325,6 +346,7 @@ static BOOL demo_server_channel_data([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_dynamic_channel_create([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* param)
|
||||
@@ -339,6 +361,7 @@ static BOOL demo_dynamic_channel_create([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_server_fetch_target_addr([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* param)
|
||||
@@ -353,6 +376,7 @@ static BOOL demo_server_fetch_target_addr([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_server_peer_logon([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata, [[maybe_unused]] void* param)
|
||||
{
|
||||
@@ -366,6 +390,7 @@ static BOOL demo_server_peer_logon([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_dyn_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* arg)
|
||||
@@ -380,6 +405,7 @@ static BOOL demo_dyn_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_static_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* arg)
|
||||
@@ -394,6 +420,7 @@ static BOOL demo_static_channel_intercept_list([[maybe_unused]] proxyPlugin* plu
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL demo_dyn_channel_intercept([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
[[maybe_unused]] void* arg)
|
||||
@@ -408,6 +435,7 @@ static BOOL demo_dyn_channel_intercept([[maybe_unused]] proxyPlugin* plugin,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static BOOL int_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
{
|
||||
struct demo_custom_data* custom = nullptr;
|
||||
@@ -464,6 +492,7 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
#if defined(BUILD_SHARED_LIBS)
|
||||
[[nodiscard]]
|
||||
FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata);
|
||||
|
||||
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
@@ -471,6 +500,7 @@ extern "C"
|
||||
return int_proxy_module_entry_point(plugins_manager, userdata);
|
||||
}
|
||||
#else
|
||||
[[nodiscard]]
|
||||
FREERDP_API BOOL demo_proxy_module_entry_point(proxyPluginsManager* plugins_manager,
|
||||
void* userdata);
|
||||
BOOL demo_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
|
||||
@@ -57,7 +57,7 @@ static constexpr char plugin_name[] = "dyn-channel-dump";
|
||||
static constexpr char plugin_desc[] =
|
||||
"This plugin dumps configurable dynamic channel data to a file.";
|
||||
|
||||
static const std::vector<std::string>& plugin_static_intercept()
|
||||
[[nodiscard]] static const std::vector<std::string>& plugin_static_intercept()
|
||||
{
|
||||
static std::vector<std::string> vec;
|
||||
if (vec.empty())
|
||||
@@ -204,7 +204,7 @@ class ChannelData
|
||||
uint64_t _session_id;
|
||||
};
|
||||
|
||||
static PluginData* dump_get_plugin_data(proxyPlugin* plugin)
|
||||
[[nodiscard]] static PluginData* dump_get_plugin_data(proxyPlugin* plugin)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
|
||||
@@ -213,7 +213,7 @@ static PluginData* dump_get_plugin_data(proxyPlugin* plugin)
|
||||
return plugindata;
|
||||
}
|
||||
|
||||
static ChannelData* dump_get_plugin_data(proxyPlugin* plugin, proxyData* pdata)
|
||||
[[nodiscard]] static ChannelData* dump_get_plugin_data(proxyPlugin* plugin, proxyData* pdata)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
@@ -228,7 +228,8 @@ static ChannelData* dump_get_plugin_data(proxyPlugin* plugin, proxyData* pdata)
|
||||
return static_cast<ChannelData*>(mgr->GetPluginData(mgr, plugin_name, pdata));
|
||||
}
|
||||
|
||||
static BOOL dump_set_plugin_data(proxyPlugin* plugin, proxyData* pdata, ChannelData* data)
|
||||
[[nodiscard]] static BOOL dump_set_plugin_data(proxyPlugin* plugin, proxyData* pdata,
|
||||
ChannelData* data)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
@@ -246,7 +247,8 @@ static BOOL dump_set_plugin_data(proxyPlugin* plugin, proxyData* pdata, ChannelD
|
||||
return mgr->SetPluginData(mgr, plugin_name, pdata, data);
|
||||
}
|
||||
|
||||
static bool dump_channel_enabled(proxyPlugin* plugin, proxyData* pdata, const std::string& name)
|
||||
[[nodiscard]] static bool dump_channel_enabled(proxyPlugin* plugin, proxyData* pdata,
|
||||
const std::string& name)
|
||||
{
|
||||
auto config = dump_get_plugin_data(plugin, pdata);
|
||||
if (!config)
|
||||
@@ -257,7 +259,8 @@ static bool dump_channel_enabled(proxyPlugin* plugin, proxyData* pdata, const st
|
||||
return config->dump_enabled(name);
|
||||
}
|
||||
|
||||
static BOOL dump_dyn_channel_intercept_list(proxyPlugin* plugin, proxyData* pdata, void* arg)
|
||||
[[nodiscard]] static BOOL dump_dyn_channel_intercept_list(proxyPlugin* plugin, proxyData* pdata,
|
||||
void* arg)
|
||||
{
|
||||
auto data = static_cast<proxyChannelToInterceptData*>(arg);
|
||||
|
||||
@@ -285,8 +288,9 @@ static BOOL dump_dyn_channel_intercept_list(proxyPlugin* plugin, proxyData* pdat
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL dump_static_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata, void* arg)
|
||||
[[nodiscard]] static BOOL dump_static_channel_intercept_list([[maybe_unused]] proxyPlugin* plugin,
|
||||
[[maybe_unused]] proxyData* pdata,
|
||||
void* arg)
|
||||
{
|
||||
auto data = static_cast<proxyChannelToInterceptData*>(arg);
|
||||
|
||||
@@ -305,7 +309,8 @@ static BOOL dump_static_channel_intercept_list([[maybe_unused]] proxyPlugin* plu
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL dump_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata, void* arg)
|
||||
[[nodiscard]] static BOOL dump_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata,
|
||||
void* arg)
|
||||
{
|
||||
auto data = static_cast<proxyDynChannelInterceptData*>(arg);
|
||||
|
||||
@@ -352,7 +357,8 @@ static BOOL dump_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata, vo
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static std::vector<std::string> split(const std::string& input, const std::string& regex)
|
||||
[[nodiscard]] static std::vector<std::string> split(const std::string& input,
|
||||
const std::string& regex)
|
||||
{
|
||||
// passing -1 as the submatch index parameter performs splitting
|
||||
std::regex re(regex);
|
||||
@@ -361,7 +367,8 @@ static std::vector<std::string> split(const std::string& input, const std::strin
|
||||
return { first, last };
|
||||
}
|
||||
|
||||
static BOOL dump_session_started(proxyPlugin* plugin, proxyData* pdata, void* /*unused*/)
|
||||
[[nodiscard]] static BOOL dump_session_started(proxyPlugin* plugin, proxyData* pdata,
|
||||
void* /*unused*/)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
@@ -397,13 +404,14 @@ static BOOL dump_session_started(proxyPlugin* plugin, proxyData* pdata, void* /*
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dump_set_plugin_data(plugin, pdata, cfg);
|
||||
if (!dump_set_plugin_data(plugin, pdata, cfg))
|
||||
return FALSE;
|
||||
|
||||
WLog_DBG(TAG, "starting session dump %" PRIu64, cfg->session());
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL dump_session_end(proxyPlugin* plugin, proxyData* pdata, void* /*unused*/)
|
||||
[[nodiscard]] static BOOL dump_session_end(proxyPlugin* plugin, proxyData* pdata, void* /*unused*/)
|
||||
{
|
||||
WINPR_ASSERT(plugin);
|
||||
WINPR_ASSERT(pdata);
|
||||
@@ -411,11 +419,10 @@ static BOOL dump_session_end(proxyPlugin* plugin, proxyData* pdata, void* /*unus
|
||||
auto cfg = dump_get_plugin_data(plugin, pdata);
|
||||
if (cfg)
|
||||
WLog_DBG(TAG, "ending session dump %" PRIu64, cfg->session());
|
||||
dump_set_plugin_data(plugin, pdata, nullptr);
|
||||
return TRUE;
|
||||
return dump_set_plugin_data(plugin, pdata, nullptr);
|
||||
}
|
||||
|
||||
static BOOL dump_unload(proxyPlugin* plugin)
|
||||
[[nodiscard]] static BOOL dump_unload(proxyPlugin* plugin)
|
||||
{
|
||||
if (!plugin)
|
||||
return TRUE;
|
||||
@@ -423,7 +430,8 @@ static BOOL dump_unload(proxyPlugin* plugin)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL int_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
[[nodiscard]] static BOOL int_proxy_module_entry_point(proxyPluginsManager* plugins_manager,
|
||||
void* userdata)
|
||||
{
|
||||
proxyPlugin plugin = {};
|
||||
|
||||
@@ -451,6 +459,7 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
#if defined(BUILD_SHARED_LIBS)
|
||||
[[nodiscard]]
|
||||
FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata);
|
||||
|
||||
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
@@ -458,6 +467,7 @@ extern "C"
|
||||
return int_proxy_module_entry_point(plugins_manager, userdata);
|
||||
}
|
||||
#else
|
||||
[[nodiscard]]
|
||||
FREERDP_API BOOL dyn_channel_dump_proxy_module_entry_point(proxyPluginsManager* plugins_manager,
|
||||
void* userdata);
|
||||
BOOL dyn_channel_dump_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
|
||||
|
||||
@@ -1170,8 +1170,11 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, const BYTE*
|
||||
|
||||
if (client->first_frame)
|
||||
{
|
||||
if (!rfx_context_reset(encoder->rfx, nWidth, nHeight))
|
||||
return FALSE;
|
||||
if (encoder->rfx)
|
||||
{
|
||||
if (!rfx_context_reset(encoder->rfx, nWidth, nHeight))
|
||||
return FALSE;
|
||||
}
|
||||
client->first_frame = FALSE;
|
||||
}
|
||||
|
||||
@@ -2501,7 +2504,8 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg)
|
||||
{
|
||||
if (WaitForSingleObject(gfxevent, 0) == WAIT_OBJECT_0)
|
||||
{
|
||||
if (!rdpgfx_server_handle_messages(client->rdpgfx))
|
||||
const UINT error = rdpgfx_server_handle_messages(client->rdpgfx);
|
||||
if (error != CHANNEL_RC_OK)
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user