Skip to content

fix(rdp): guard optional native exports and define WIN32_LEAN_AND_MEAN for CxRdpBridge - #3

Closed
heartacker wants to merge 1 commit into
AtomUICommunity:masterfrom
heartacker:fix/rdp-bridge-optional-exports-and-win32-headers
Closed

heartacker wants to merge 1 commit into
AtomUICommunity:masterfrom
heartacker:fix/rdp-bridge-optional-exports-and-win32-headers

Conversation

@heartacker

Copy link
Copy Markdown
Contributor

Summary

  • Define WIN32_LEAN_AND_MEAN and NOMINMAX before <windows.h> in native/CxRdpBridge/cxrdp_bridge.cpp to prevent Windows <shellapi.h> macro NIIF_NONE from conflicting with FreeRDP 3.x <freerdp/rail.h> during MSVC builds.
  • Guard optional native bridge exports (cxrdp_set_graphics_pipeline, cxrdp_set_frame_marker_enabled, cxrdp_set_security_profile, cxrdp_set_clipboard_channel, cxrdp_set_disable_wallpaper) in Services/RdpBridgeClient.cs against EntryPointNotFoundException so a mismatched or older CxRdpBridge.dll degrades gracefully instead of aborting Connect() and leaving the UI stuck on the desktop loading overlay.

Test plan

  • dotnet test CxShell.Tests/CxShell.Tests.csproj -c Release: 727/727 passed.
  • Verified MSVC build of CxRdpBridge.dll via tools/build-rdp-bridge.ps1.

@heartacker

Copy link
Copy Markdown
Contributor Author

cxrdp_bridge.cpp

:在 <windows.h> 前定义 WIN32_LEAN_AND_MEAN 和 NOMINMAX,防止 <shellapi.h> 的 NIIF_NONE 宏与 FreeRDP 3.x <freerdp/rail.h> 冲突导致 MSVC 编译失败。

RdpBridgeClient.cs

:为可选原生桥接导出调用增加 EntryPointNotFoundException 安全降级,防止 CxRdpBridge.dll 版本不匹配时直接中断 Connect() 导致界面卡死在“正在加载远程桌面”。

@heartacker heartacker closed this Nov 24, 2026
@heartacker
heartacker deleted the fix/rdp-bridge-optional-exports-and-win32-headers branch November 24, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant