How stascorp/rdpwrap works
1. This repository is a Windows-only RDP enablement toolkit centered on a wrapper DLL. The wrapper sits between Service Control Manager and Terminal Services so termsrv.dll stays untouched while the system behaves like it supports Remote Desktop Host and concurrent sessions.
2. The main runtime component is the wrapper library itself. There are two implementation lines:
- src-x86-binarymaster for the Delphi x86 build
- src-x86-x64-Fusix for the C++ x86/x64 port
Both are focused on the low-level hooking/wrapping logic and ship as the core binary used by the rest of the tools.
3. Version-specific behavior is externalized into INI-based configuration, not hardcoded in the DLL. The files under res/ — especially rdpwrap.ini and rdpwrap-arm-kb.ini — act as the support matrix and patch/offset database for specific termsrv.dll builds. This is the key data boundary in the system.
4. src-installer is the packaging and deployment layer. It builds RDPWInst.exe, which handles installation, uninstall, updates, and unattended deployment. The repo also includes WiX source in res/RDPWInst.wxs, indicating an MSI packaging path in addition to the executable installer.
5. The top-level batch scripts in bin/ are operational entry points for users and automation:
- install.bat
- uninstall.bat
- update.bat
These are thin wrappers around the installer workflow and are meant for admin execution on the target machine.
6. src-rdpconfig is the configuration UI. RDPConf.exe provides a GUI for checking wrapper status and changing supported settings such as session behavior and related policy values. The presence of LicenseUnit and the main form units suggests a classic Delphi desktop app with bundled diagnostics and configuration editing.
7. src-rdpcheck is a minimal test client. RDPCheck.exe is not a full-featured remote desktop client; it exists to verify that loopback RDP works locally. The README notes it uses 127.0.0.2 and is intentionally limited compared with mstsc.exe.
8. The runtime data flow is: installer deploys the wrapper and supporting files, then the wrapper consults the local INI to determine whether the current termsrv.dll build is supported and which offsets/settings to use. If the build is unknown, the system shows [not supported] until the INI is updated.
9. Update flow is separate from installation. The repo supports an “online mode” where the installer can fetch the latest INI from GitHub, and update.bat refreshes support data without rebuilding binaries. This makes the INI repository the main mutable compatibility layer.
10. The config tool and checker are operational consumers of the same underlying wrapper state. RDPConf reads status and exposes diagnostics; RDPCheck validates local connection behavior; both depend on the wrapper being installed and configured correctly.
11. Build/tooling is split by language and target:
- Delphi projects (.dpr, .dproj) for the installer, checker, config tool, and the x86 wrapper
- Visual Studio C++ solution/project files for the x86/x64 wrapper port
- WiX source for MSI packaging
This repo is therefore a multi-toolchain Windows desktop codebase, not a single unified build system.
12. Architecturally, the important boundaries are:
- low-level wrapper code vs. version data in INI
- installer/deployment vs. runtime wrapper
- diagnostics/configuration UI vs. functional test client
- local machine state vs. online compatibility updates from GitHub
That separation is what makes the project maintainable across many Windows builds without changing the core DLL every time.
Main entry points: RDPWInst.dpr Installer · rdpwrap.dpr RDPWrap DLL · RDPWrap.cpp RDPWrap C++ · rdpwrap.ini RDP INI
Components 17
Core runtime
Wrapper DLL implementations and their support-data boundary.
- RDPWrap DLL · Delphi x86 wrapper implementation that mediates between SCM and Terminal Services.
src-x86-binarymaster/rdpwrap.dpr - RDPWrap C++ · C++ x86/x64 wrapper port with low-level hooking and export surface.
src-x86-x64-Fusix/RDPWrap.cpp
Tools
Installer, configuration UI, and test client.
- Installer · RDPWInst.exe installs, uninstalls, updates, and supports unattended deployment.
src-installer/RDPWInst.dpr - RDPConf · Desktop UI for wrapper status, diagnostics, and supported settings.
src-rdpconfig/RDPConf.dpr - RDPCheck · Minimal loopback RDP validation client using local host behavior.
src-rdpcheck/RDPCheck.dpr
Packaging
Batch entry points and MSI/WiX packaging assets.
- install.bat · Thin entry point for installation workflow.
bin/install.bat - uninstall.bat · Thin entry point for removal workflow.
bin/uninstall.bat - update.bat · Thin entry point for refreshing support data.
bin/update.bat - RDPWInst.wxs · MSI packaging definition for the installer path.
res/RDPWInst.wxs
Compatibility data
INI support matrix and build-specific metadata.
- RDP INI · Build matrix and patch/offset database for supported termsrv.dll versions.
res/rdpwrap.ini - ARM KB INI · Supplemental compatibility entries for ARM and KB-specific cases.
res/rdpwrap-arm-kb.ini
Build systems
Language- and target-specific project files.
- Installer proj · Delphi project files for the installer executable.
src-installer/RDPWInst.dproj - Config proj · Delphi project files for the configuration UI.
src-rdpconfig/RDPConf.dproj - Check proj · Delphi project files for the validation client.
src-rdpcheck/RDPCheck.dproj - x86 wrapper proj · Delphi project files for the x86 wrapper build.
src-x86-binarymaster/rdpwrap.dproj - C++ solution · Visual Studio solution for the x86/x64 wrapper port.
src-x86-x64-Fusix/RDPWrap.sln - C++ project · Visual C++ project and filters for the wrapper port.
src-x86-x64-Fusix/RDPWrap.vcxproj
Connections 22
- RDPWrap DLL → RDP INI: reads support data · Uses the INI matrix to map termsrv.dll versions and offsets.
- RDPWrap DLL → ARM KB INI: reads variants · Consults supplemental compatibility entries where needed.
- RDPWrap C++ → RDP INI: reads support data · Uses the same version/offset database for build-specific behavior.
- RDPWrap C++ → ARM KB INI: reads variants · Consumes supplemental compatibility entries.
- Installer → RDPWrap DLL: deploys · Packages and installs the wrapper runtime.
- Installer → RDPWrap C++: deploys · Can deploy the wrapper port artifacts.
- Installer → RDP INI: installs · Places compatibility data on the target machine.
- Installer → ARM KB INI: installs · Places supplemental compatibility data on the target machine.
- Installer → RDPWInst.wxs: packages · Uses WiX source for MSI packaging.
- install.bat → Installer: invokes · Admin wrapper for installation workflow.
- uninstall.bat → Installer: invokes · Admin wrapper for uninstall workflow.
- update.bat → Installer: invokes · Admin wrapper for update workflow.
- update.bat → RDP INI: refreshes · Updates support data without rebuilding binaries.
- RDPConf → RDPWrap DLL: checks status · Reads wrapper state and exposed configuration.
- RDPConf → RDPWrap C++: checks status · Reads wrapper state for the selected runtime.
- RDPCheck → RDPWrap DLL: validates · Exercises local loopback RDP behavior through the installed wrapper.
- RDPCheck → RDPWrap C++: validates · Exercises local loopback RDP behavior through the installed wrapper.
- Installer proj → Installer: builds · Delphi project produces the installer executable.
- Config proj → RDPConf: builds · Delphi project produces the configuration UI.
- Check proj → RDPCheck: builds · Delphi project produces the loopback test client.
- x86 wrapper proj → RDPWrap DLL: builds · Delphi project produces the x86 wrapper binary.
- C++ solution → C++ project: contains · Visual Studio solution contains the C++ wrapper project.