From 353d796476ef9ed3646da387f77e9f80ab59f421 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 12 Jan 2023 10:54:04 +0100 Subject: [PATCH] [proxy,modules] update demo plugin --- server/proxy/modules/demo/demo.cpp | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/server/proxy/modules/demo/demo.cpp b/server/proxy/modules/demo/demo.cpp index de6ca9643..dd308ce5b 100644 --- a/server/proxy/modules/demo/demo.cpp +++ b/server/proxy/modules/demo/demo.cpp @@ -21,6 +21,8 @@ #include +#include +#include #include #define TAG MODULE_TAG("demo") @@ -323,6 +325,42 @@ static BOOL demo_server_peer_logon(proxyPlugin* plugin, proxyData* pdata, void* return TRUE; } +static BOOL demo_dyn_channel_intercept_list(proxyPlugin* plugin, proxyData* pdata, void* arg) +{ + auto data = static_cast(arg); + + WINPR_ASSERT(plugin); + WINPR_ASSERT(pdata); + WINPR_ASSERT(data); + + WLog_INFO(TAG, "%s", __FUNCTION__); + return TRUE; +} + +static BOOL demo_static_channel_intercept_list(proxyPlugin* plugin, proxyData* pdata, void* arg) +{ + auto data = static_cast(arg); + + WINPR_ASSERT(plugin); + WINPR_ASSERT(pdata); + WINPR_ASSERT(data); + + WLog_INFO(TAG, "%s", __FUNCTION__); + return TRUE; +} + +static BOOL demo_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata, void* arg) +{ + auto data = static_cast(arg); + + WINPR_ASSERT(plugin); + WINPR_ASSERT(pdata); + WINPR_ASSERT(data); + + WLog_INFO(TAG, "%s", __FUNCTION__); + return TRUE; +} + #ifdef __cplusplus extern "C" { @@ -363,6 +401,11 @@ BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userda plugin.DynamicChannelCreate = demo_dynamic_channel_create; plugin.ServerFetchTargetAddr = demo_server_fetch_target_addr; plugin.ServerPeerLogon = demo_server_peer_logon; + + plugin.StaticChannelToIntercept = demo_static_channel_intercept_list; + plugin.DynChannelToIntercept = demo_dyn_channel_intercept_list; + plugin.DynChannelIntercept = demo_dyn_channel_intercept; + plugin.userdata = userdata; custom = new (struct demo_custom_data);