[DISCUSSION] Windows 10 termsrv.dll Patching

[DISCUSSION] Windows 10 termsrv.dll Patching Хостинг

All desktop Windows versions (including Win 10 and 11) have a number of restrictions on the Remote Desktop Service usage:

Let’s consider two ways on how to allow simultaneous RDP connections on Windows 10 and 11: using the RDP Wrapper tool or patching the termsrv.dll system file.

Note. System modifications described in the article are considered as a violation of the Microsoft License Agreement  and you may perform them at your own risk.

Enable Multiple RDP Sessions on Windows

The RDP Wrapper Library OpenSource project allows you to enable multiple RDP sessions on Windows 10 without replacing the termsrv.dll file. This tool works as a layer between SCM (Service Control Manager) and the Remote Desktop Services. RDPWrap allows you to enable not only support for multiple simultaneous RDP connections but also to build an RDP server on Windows Home editions. RDP Wrapper doesn’t make any changes to the termsrv.dll file, it’s just loading termsrv library with the changed parameters.

Thus, the RDPWrap will work even in the case of termsrv.dll file update. It allows you not to be afraid of Windows updates.

Important. Before installing RDP Wrapper, it is important to make that you are using the original (unpatched) version of the termsrv.dll file. Otherwise, RDP Wrapper may become unstable or not start at all.

You can download the RDP Wrapper from the GitHub repository https://github.com/binarymaster/rdpwrap/releases (the latest available version of the RDP Wrapper Library is v1.6.2). The project hasn’t been updated since 2017, but it can be used in all new builds of Windows 10 and even Windows 11.

The RDPWrap-v1.6.2.zip archive contains some files:

  • RDPWinst.exe — an RDP Wrapper Library install/uninstall the program;
  • RDPConf.exe — an RDP Wrapper configuration tool;
  • RDPCheck.exe —an RDP check utility (Local RDP Checker);
  • install.bat, uninstall.bat, update.bat — batch files to install, uninstall, and update RDP Wrapper.

[DISCUSSION] Windows 10 termsrv.dll Patching

[DISCUSSION] Windows 10 termsrv.dll Patching

[DISCUSSION] Windows 10 termsrv.dll Patching

The fact is that for each version of Windows 10 there must be a description in the rdpwrap.ini configuration file. Your config file simply doesn’t have any settings for your Windows 10 build.

Manually copy the contents of this page to the “C:Program FilesRDP Wrapper
dpwrap.ini” file. Or download the file using the PowerShell cmdlet Invoke-WebRequest (you must first stop the Remote Desktop service):

[DISCUSSION] Windows 10 termsrv.dll Patching

[DISCUSSION] Windows 10 termsrv.dll Patching

[DISCUSSION] Windows 10 termsrv.dll Patching

The RDPWrap tool is supported in all Windows editions, so you can build your own terminal (RDS) server on any Windows device.

Also, RDP Wrapper allows to:

  • Enable Remote Desktop;
  • RDP Port — you can change the Remote Desktop port number from TCP 3389 to any other;
  • In the Session Shadowing Mode section, you can configure the remote control (shadow) connection mode to RDP sessions.

RDP Wrapper Not Working on Windows 10

In some cases, the RDP Wrapper tool doesn’t work as expected and you cannot to your Windows host using multiple RDP sessions.

Читайте также:  Изучение того, что, почему и как работает с клиентом VNC

If the RDP Wrapper doesn’t work after updating the rdpwrap.ini file, try opening the rdpwrap.ini file and looking for a description section for your Windows version. How to know if there is support for your version of Windows in the rdpwrapper config file?

The screenshot below shows that for my version of Windows 10 (10.0.19041.1320) there are two description sections:

[DISCUSSION] Windows 10 termsrv.dll Patching

If there is no section in the config file for your version of Windows, try using Google to search for the rdpwrap.ini strings for your Windows build. Add the lines you find to the end of the file.

If after installing security updates or upgrading the Windows 10 build, RDP Wrapper doesn’t work correctly, check if the “Listener state: ” is displayed in the Diagnostics section.

[DISCUSSION] Windows 10 termsrv.dll Patching

Try updating the rdpwrap.ini file, and then reinstalling the service:

rdpwinst.exe -u
rdpwinst.exe -i

[DISCUSSION] Windows 10 termsrv.dll Patching

[DISCUSSION] Windows 10 termsrv.dll Patching

Restart your computer to update the GPO and apply the settings.

Modify the Termsrv. dll to Enable Multiple RDP Sessions

Before you edit or replace the termsrv.dll file, it is advisable to create its backup copy. This will help you to revert to the original version of the file if necessary. Open the elevated command prompt and run the command:

copy c:WindowsSystem32 ermsrv.dll termsrv.dll_backup

takeown /F c:WindowsSystem32 ermsrv.dll /A

processed file: c:WindowsSystem32 ermsrv.dll Successfully processed 1 files; Failed processing 0 files.

[DISCUSSION] Windows 10 termsrv.dll Patching

After that, stop the Remote Desktop service (TermService) using the services.msc console or from the command prompt:

Net stop TermService

[DISCUSSION] Windows 10 termsrv.dll Patching

Before moving on, you need to find out your version (build number) of Windows 10. Open the PowerShell console and run the command:

In my case, Windows 10 build 21H1 is installed.

Then open the termsrv.dll file using any HEX editor (for example, Tiny Hexer). Depending on your Windows build, you need to find and replace the string according to the table below:

Tiny Hexer editor cannot edit termsvr.dll file directly from system32 folder. Copy it to your desktop, and after modification replace the original file.

For example, my build of Windows 10 x64 is 21H1 (19043.1320) with the termsrv.dll file version 10.0.19041.1320. Open the termsrv.dll file in Tiny Hexer, then find the text:

39 81 3C 06 00 00 0F 84 2B 5F 01 00

and replace it with:

B8 00 01 00 00 89 81 38 06 00 00 90

[DISCUSSION] Windows 10 termsrv.dll Patching

Save the file and run the TermService.

If something goes wrong and you experience some problems with the Remote Desktop service, stop the service and replace the modified termsrv.dll file with the original version:

copy termsrv.dll_backup c:WindowsSystem32 ermsrv.dll

Patching Termsrv. dll on Windows Using PowerShell

The complete script code is available in my GitHub repository at https://github.com/maxbakhub/winposh/blob/main/termsrv_rdp_patch.ps1

To execute the script, download it to your computer. Change the PowerShell execution policy settings for the current session:

Set-ExecutionPolicy Bypass -Scope Process -Force

And run the script:

[DISCUSSION] Windows 10 termsrv.dll Patching

The script can be run after installing Windows updates to immediately make changes to the termsrv.dll file (you don’t have to modify the termsrv.dll file in the HEX editor after each update installation).

Читайте также:  Free PDF Hosting and PDF File Sharing. No software to download. Just click and go!

The main drawback is that you will have to manually edit the termsrv.dll file each time you upgrade the Windows 10 build (or when updating the version of the termsrv.dll file during the installation of monthly cumulative updates). And if you are using RDPWrapper, you will also need to update the rdpwrap.ini file after installing Windows updates.

Что делают файлы DLL

Как и говорилось ранее, файлы DLL — это специальные библиотеки которые участвуют в работе многих процессов. Отсутствующие файлы DLL способны создавать сбои в работе программ, приложений и утилит, что не даёт пользователю насладится работой или геймингом. Исправить ошибки очень просто, однако необходимо знать от чего они возникают, чтобы избежать дальнейших проблем.

Во-первых, ошибки могут возникать в следствии отсутствия некоторых исполняемых пакетов Windows. Зачастую на ПК может отсутствовать DirectX, Net Framework и так далее. Внимательно читайте требования к игре или устанавливаемой программе при её установке в Windows. При возникновении ошибки найдите конкретный DLL файл на нашем сайте и прочтите статью о том, что установить для исправления ошибок с ним.

Во-вторых, деятельность вирусов и антивирусов может вызывать проблемы с библиотеками. Вирусы могут заразить любую библиотеку, а антивирус может поместить библиотеку в карантин или вовсе удалить с компьютера. В этом случае стоит проверить карантин, а также отсканировать компьютер на вирусы. Взломанные игры и программы могут модифицировать DLL библиотеки, обязательно вносите их в исключения антивируса и стандартных средств защиты Windows.

Бывают случаи, когда установка DLL библиотеки в систему провоцирует только новые ошибки. В таком случае требуется полная переустановка какого-либо пакета или запускаемого приложения.

Чтобы убрать ограничение на количество RDP подключений пользователей в Windows 10 можно изменить файл termsrv.dll. Это файл библиотеки, которая используется службой Remote Desktop Services. Файл находится в каталоге C:WindowsSystem32.

Прежде, чем править или заменять файл termsrv.dll желательно создать его резервную копию. Это поможет вам в случае необходимости вернуться к исходной версии файла. Запустите командную строку с правами администратора и выполните команду:

Прежде чем править файл termsrv.dll, вам нужно стать его владельцем и предоставить группе администраторов полные права на него. Проще всего это сделать из командной строки. Чтобы сменить владельца файла с TrustedInstaller на группу локальных администраторов с помощью команды:

Теперь предоставим группе локальных администраторов полные права на файл termsrv.dll (Full Control):

icacls c:WindowsSystem32 ermsrv.dll /grant Администраторы:F

Теперь нужно остановить службу Remote Desktop Service (TermService) из консоли services.msc или из командной строки:

Прежде чем идти дальше, вам нужно узнать вашу версию (билд) Windows 10. Проще всего это сделать с помощью следующей команды PowerShell:

У меня установлена Windows 10 билд 10.0.19043.1081

Затем откройте файл termsrv.dll с помощью любого HEX редактора (к примеру, Tiny Hexer). В зависимости от билда нужно найти и заменить строку:

39 81 3C 06 00 00 0F 84 DB 61 01 00

Намного проще вместо HEX редактора, использовать специальную утилиту: TermsrvPatcher

Читайте также:  Оптимизируйте общение с помощью групповых уведомлений Zabbix Telegram

В утилите TermsrvPatcher в поле «Find Pattern:» вписать, что искать в файле termsrv.dll, к примеру 39 81 3C 06 00 00 0F 84 DB 61 01 00 а в поле «Replace Pattern:» вписать B8 00 01 00 00 89 81 38 06 00 00 90 и нажать Patch, утилита сделает изменения в файле termsrv.dll

DLL-помощник (DLL-Helper) — программа для поиска, скачивания и установки библиотек DLL. Благодаря простому и понятному интерфейсу пользователям не составит труда найти требуемые файлы — достаточно лишь знать их официальные названия, данные им разработчиками. Обширное онлайн-хранилище DLL-Helper содержит сотни тысяч DLL-библиотек, используемые в самых различных программах, играх, драйверах, системных приложениях, службах и т.д.

Программа DLL-помощник предназначена для использования в ОС Windows 7, 8 и 10 (32-бит и 64-бит). Интерфейс выполнен на русском языке.

Программа DLL-Helper отличается максимально простым использованием — это одна из важных особенностей софта. Сразу после установки и первого запуска без каких-либо предварительных настроек приложение готово к эксплуатации. Чтобы найти требуемую DLL-библиотеку, пользователю достаточно выполнить несколько простых шагов:

  • Ввести или скопировать название известной библиотеки в поисковую строку основного окна программы. Имя файла указывать полностью необязательно (достаточно первых двух символов), как и расширение «.dll» после него.
  • Выполнить поиск, кликнув по соответствующей кнопке.
  • В течение 1-5 секунд (зависит от скорости интернет-соединения) программа построит список доступных для скачивания DLL-библиотек и выведет их на экран.
  • Кликнуть по названию требуемой библиотеки.
  • Во вновь открывшейся вкладке щелкнуть по кнопке «Установить».
  • Выбранная DLL-библиотека будет скачана программой самостоятельно, затем скопирована (установлена) в требуемый системный каталог.

По умолчанию программа запускается и работает в «Простом режиме». Данный режим предполагает скачивание и установки самых последних (из имеющихся на сервере в данный момент) версии файлов для 32-х и 64-разрядных систем Windows.

Более опытные пользователи оценят режим работы «Продвинутый» (включает при помощи переключателя на странице скачивания файлов библиотек). В этом режиме программа DLL-Helper выводит на экран все доступные версии и разрядности (32-bit/64-bit) выбранных библиотек, предоставляя возможность их скачивания по отдельности.

Отдельно отметим функцию программы DLL-Helper по откату ранее установленных файлов. Если библиотека по каким-либо причинам не работает, пользователь всегда сможет ее удалить. Для этого достаточно перейти во вкладку «История», затем кликнуть по кнопке «Откатить DLL» напротив названия установленной библиотеки.

Решение проблем с DLL

Нередки ситуации, когда при запуске программ или игр на экран выводится ошибка об отсутствии или неработоспособности какой-либо DLL-библиотеки. В некоторых случаях даже их установка при помощи приложения DLL-помощник не решает проблемы. Скорее всего, все дело в том, что программа/драйвер/игра, вызывающая ошибку, не видит установленную DLL. Здесь можно поступить следующим образом:

  • После завершения скачивания кликнуть по ссылке «Показать DLL в проводнике» (отобразится после завершения установки).
  • В «Проводнике Windows» откроется папка, DLL-файл будет выделен автоматически. Скопировать библиотеку.
  • Открыть папку с игрой/программой, в которой находится основной исполнимый EXE-файл. Вставить скопированную библиотеку в данную директорию. Если в каталоге с игрой/программой/драйвером уже имеется DLL с таким же названием, рекомендуем переместить его в любую другую папку.
  • Запустить игру/программу.

Если проблема не устраняется, выполняем эти же действия, но уже с другой версией DLL.

Оцените статью
Хостинги