diff --git a/server/proxy/modules/bitmap-filter/bitmap-filter.cpp b/server/proxy/modules/bitmap-filter/bitmap-filter.cpp index a2fb77f95..02c499ec3 100644 --- a/server/proxy/modules/bitmap-filter/bitmap-filter.cpp +++ b/server/proxy/modules/bitmap-filter/bitmap-filter.cpp @@ -387,8 +387,11 @@ static BOOL filter_dyn_channel_intercept(proxyPlugin* plugin, proxyData* pdata, if (state->skip()) { - if (!state->skip(inputDataLength)) + if (state->skip(inputDataLength)) + { + WLog_WARN(TAG, "skipping data, but %" PRIuz " bytes left", state->remaining()); return FALSE; + } if (state->drop()) { @@ -481,8 +484,8 @@ extern "C" return int_proxy_module_entry_point(plugins_manager, userdata); } #else -FREERDP_API BOOL demo_proxy_module_entry_point(proxyPluginsManager* plugins_manager, - void* userdata); +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) { return int_proxy_module_entry_point(plugins_manager, userdata); diff --git a/server/proxy/pf_modules.c b/server/proxy/pf_modules.c index 2879dc3bb..d87ae746a 100644 --- a/server/proxy/pf_modules.c +++ b/server/proxy/pf_modules.c @@ -70,6 +70,12 @@ static const char* pf_modules_get_filter_type_string(PF_FILTER_TYPE result) return "FILTER_TYPE_SERVER_PEER_LOGON"; case FILTER_TYPE_CLIENT_PASSTHROUGH_CHANNEL_CREATE: return "FILTER_TYPE_CLIENT_PASSTHROUGH_CHANNEL_CREATE"; + case FILTER_TYPE_STATIC_INTERCEPT_LIST: + return "FILTER_TYPE_STATIC_INTERCEPT_LIST"; + case FILTER_TYPE_DYN_INTERCEPT_LIST: + return "FILTER_TYPE_DYN_INTERCEPT_LIST"; + case FILTER_TYPE_INTERCEPT_CHANNEL: + return "FILTER_TYPE_INTERCEPT_CHANNEL"; case FILTER_LAST: return "FILTER_LAST"; default: @@ -484,7 +490,7 @@ static BOOL pf_modules_load_static_module(const char* module_name, proxyModule* { WINPR_ASSERT(module); - HANDLE handle = LoadLibraryX(NULL); + HANDLE handle = GetModuleHandleA(NULL); if (handle == NULL) { diff --git a/winpr/libwinpr/library/library.c b/winpr/libwinpr/library/library.c index 0714696df..31147c87d 100644 --- a/winpr/libwinpr/library/library.c +++ b/winpr/libwinpr/library/library.c @@ -109,14 +109,14 @@ BOOL SetDefaultDllDirectories(WINPR_ATTR_UNUSED DWORD DirectoryFlags) HMODULE LoadLibraryA(LPCSTR lpLibFileName) { + if (!lpLibFileName) + return NULL; + #if defined(_UWP) int status; HMODULE hModule = NULL; WCHAR* filenameW = NULL; - if (!lpLibFileName) - return NULL; - filenameW = ConvertUtf8ToWCharAlloc(lpLibFileName, NULL); if (filenameW) return NULL; @@ -125,8 +125,7 @@ HMODULE LoadLibraryA(LPCSTR lpLibFileName) free(filenameW); return hModule; #else - HMODULE library = NULL; - library = dlopen(lpLibFileName, RTLD_LOCAL | RTLD_LAZY); + HMODULE library = dlopen(lpLibFileName, RTLD_LOCAL | RTLD_LAZY); if (!library) { @@ -208,20 +207,19 @@ BOOL FreeLibrary(HMODULE hLibModule) return TRUE; } -HMODULE GetModuleHandleA(WINPR_ATTR_UNUSED LPCSTR lpModuleName) +HMODULE GetModuleHandleA(LPCSTR lpModuleName) { - /* TODO: Implement */ - WLog_ERR(TAG, "not implemented"); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return NULL; + return dlopen(lpModuleName, RTLD_NOLOAD | RTLD_LOCAL | RTLD_LAZY); } -HMODULE GetModuleHandleW(WINPR_ATTR_UNUSED LPCWSTR lpModuleName) +HMODULE GetModuleHandleW(LPCWSTR lpModuleName) { - /* TODO: Implement */ - WLog_ERR(TAG, "not implemented"); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return NULL; + char* name = NULL; + if (lpModuleName) + name = ConvertWCharToUtf8Alloc(lpModuleName, NULL); + HANDLE hdl = GetModuleHandleA(name); + free(name); + return hdl; } /**