diff --git a/bin/RDPConf.exe b/bin/RDPConf.exe new file mode 100644 index 0000000..6e38978 Binary files /dev/null and b/bin/RDPConf.exe differ diff --git a/bin/install.bat b/bin/install.bat index e9f4f78..e33e2f8 100644 --- a/bin/install.bat +++ b/bin/install.bat @@ -1,7 +1,8 @@ @echo off RDPWInst -i -echo ______________________________________________________ +echo ______________________________________________________________ echo. echo You can check RDP functionality with RDPCheck program. +echo Also you can configure advanced settings with RDPConf program. echo. pause diff --git a/src-rdpconfig/MainUnit.dcu b/src-rdpconfig/MainUnit.dcu new file mode 100644 index 0000000..2e2f289 Binary files /dev/null and b/src-rdpconfig/MainUnit.dcu differ diff --git a/src-rdpconfig/MainUnit.dfm b/src-rdpconfig/MainUnit.dfm new file mode 100644 index 0000000..887995d --- /dev/null +++ b/src-rdpconfig/MainUnit.dfm @@ -0,0 +1,112 @@ +object MainForm: TMainForm + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'Remote Desktop Protocol Configuration' + ClientHeight = 245 + ClientWidth = 326 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poDesktopCenter + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object lRDPPort: TLabel + Left = 203 + Top = 22 + Width = 47 + Height = 13 + Caption = 'RDP Port:' + end + object bOK: TButton + Left = 45 + Top = 212 + Width = 75 + Height = 25 + Caption = 'OK' + ModalResult = 1 + TabOrder = 0 + OnClick = bOKClick + end + object bCancel: TButton + Left = 126 + Top = 212 + Width = 75 + Height = 25 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + OnClick = bCancelClick + end + object bApply: TButton + Left = 207 + Top = 212 + Width = 75 + Height = 25 + Caption = 'Apply' + Enabled = False + TabOrder = 2 + OnClick = bApplyClick + end + object cbSingleSessionPerUser: TCheckBox + Left = 8 + Top = 31 + Width = 130 + Height = 17 + Caption = 'Single Session Per User' + TabOrder = 3 + OnClick = cbAllowTSConnectionsClick + end + object rgNLA: TRadioGroup + Left = 8 + Top = 54 + Width = 310 + Height = 73 + Caption = 'Security Mode' + Items.Strings = ( + 'Disable Security (not recommended)' + 'Default Authentication (compatibility with older clients)' + 'Network Level Authentication (best)') + TabOrder = 4 + OnClick = cbAllowTSConnectionsClick + end + object cbAllowTSConnections: TCheckBox + Left = 8 + Top = 8 + Width = 174 + Height = 17 + Caption = 'Enable Remote Desktop Protocol' + TabOrder = 5 + OnClick = cbAllowTSConnectionsClick + end + object rgShadow: TRadioGroup + Left = 8 + Top = 133 + Width = 310 + Height = 73 + Caption = 'Session Shadowing Mode' + Items.Strings = ( + 'Disable Shadowing' + 'Shadowing will request user permission' + 'Shadowing sessions immediately') + TabOrder = 6 + OnClick = cbAllowTSConnectionsClick + end + object seRDPPort: TSpinEdit + Left = 256 + Top = 19 + Width = 62 + Height = 22 + MaxValue = 65535 + MinValue = 0 + TabOrder = 7 + Value = 0 + OnChange = seRDPPortChange + end +end diff --git a/src-rdpconfig/MainUnit.pas b/src-rdpconfig/MainUnit.pas new file mode 100644 index 0000000..5d7a033 --- /dev/null +++ b/src-rdpconfig/MainUnit.pas @@ -0,0 +1,202 @@ +unit MainUnit; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, Spin, ExtCtrls, Registry; + +type + TMainForm = class(TForm) + bOK: TButton; + bCancel: TButton; + bApply: TButton; + cbSingleSessionPerUser: TCheckBox; + rgNLA: TRadioGroup; + cbAllowTSConnections: TCheckBox; + rgShadow: TRadioGroup; + seRDPPort: TSpinEdit; + lRDPPort: TLabel; + procedure FormCreate(Sender: TObject); + procedure cbAllowTSConnectionsClick(Sender: TObject); + procedure seRDPPortChange(Sender: TObject); + procedure bApplyClick(Sender: TObject); + procedure bCancelClick(Sender: TObject); + procedure bOKClick(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + private + { Private declarations } + public + { Public declarations } + procedure ReadSettings; + procedure WriteSettings; + end; + +var + MainForm: TMainForm; + Ready: Boolean = False; + +implementation + +{$R *.dfm} +{$R manifest.res} + +procedure TMainForm.ReadSettings; +var + Reg: TRegistry; + SecurityLayer, UserAuthentication: Integer; +begin + Reg := TRegistry.Create; + Reg.RootKey := HKEY_LOCAL_MACHINE; + Reg.OpenKeyReadOnly('\SYSTEM\CurrentControlSet\Control\Terminal Server'); + try + cbAllowTSConnections.Checked := not Reg.ReadBool('fDenyTSConnections'); + except + + end; + try + cbSingleSessionPerUser.Checked := Reg.ReadBool('fSingleSessionPerUser'); + except + + end; + Reg.CloseKey; + + Reg.OpenKeyReadOnly('\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp'); + seRDPPort.Value := 3389; + try + seRDPPort.Value := Reg.ReadInteger('PortNumber'); + except + + end; + SecurityLayer := 0; + UserAuthentication := 0; + try + SecurityLayer := Reg.ReadInteger('SecurityLayer'); + UserAuthentication := Reg.ReadInteger('UserAuthentication'); + except + + end; + if (SecurityLayer = 0) and (UserAuthentication = 0) then + rgNLA.ItemIndex := 0; + if (SecurityLayer = 1) and (UserAuthentication = 0) then + rgNLA.ItemIndex := 1; + if (SecurityLayer = 2) and (UserAuthentication = 1) then + rgNLA.ItemIndex := 2; + try + rgShadow.ItemIndex := Reg.ReadInteger('Shadow'); + except + + end; + Reg.CloseKey; + Reg.Free; +end; + +procedure TMainForm.WriteSettings; +var + Reg: TRegistry; + SecurityLayer, UserAuthentication: Integer; +begin + Reg := TRegistry.Create; + Reg.RootKey := HKEY_LOCAL_MACHINE; + Reg.OpenKey('\SYSTEM\CurrentControlSet\Control\Terminal Server', True); + try + Reg.WriteBool('fDenyTSConnections', not cbAllowTSConnections.Checked); + except + + end; + try + Reg.WriteBool('fSingleSessionPerUser', cbSingleSessionPerUser.Checked); + except + + end; + Reg.CloseKey; + + Reg.OpenKey('\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp', True); + try + Reg.WriteInteger('PortNumber', seRDPPort.Value); + except + + end; + case rgNLA.ItemIndex of + 0: begin + SecurityLayer := 0; + UserAuthentication := 0; + end; + 1: begin + SecurityLayer := 1; + UserAuthentication := 0; + end; + 2: begin + SecurityLayer := 2; + UserAuthentication := 1; + end; + else begin + SecurityLayer := -1; + UserAuthentication := -1; + end; + end; + if SecurityLayer >= 0 then begin + try + Reg.WriteInteger('SecurityLayer', SecurityLayer); + Reg.WriteInteger('UserAuthentication', UserAuthentication); + except + + end; + end; + if rgShadow.ItemIndex >= 0 then begin + try + Reg.WriteInteger('Shadow', rgShadow.ItemIndex); + except + + end; + end; + Reg.CloseKey; + Reg.Free; +end; + +procedure TMainForm.cbAllowTSConnectionsClick(Sender: TObject); +begin + if Ready then + bApply.Enabled := True; +end; + +procedure TMainForm.seRDPPortChange(Sender: TObject); +begin + if Ready then + bApply.Enabled := True; +end; + +procedure TMainForm.FormCreate(Sender: TObject); +begin + ReadSettings; + Ready := True; +end; + +procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + if bApply.Enabled then + CanClose := MessageBox(Handle, 'Settings are not saved. Do you want to exit?', + 'Warning', mb_IconWarning or mb_YesNo) = mrYes; +end; + +procedure TMainForm.bOKClick(Sender: TObject); +begin + if bApply.Enabled then begin + WriteSettings; + bApply.Enabled := False; + end; + Close; +end; + +procedure TMainForm.bCancelClick(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.bApplyClick(Sender: TObject); +begin + WriteSettings; + bApply.Enabled := False; +end; + +end. diff --git a/src-rdpconfig/RDPConf.dpr b/src-rdpconfig/RDPConf.dpr new file mode 100644 index 0000000..2076e60 --- /dev/null +++ b/src-rdpconfig/RDPConf.dpr @@ -0,0 +1,15 @@ +program RDPConf; + +uses + Forms, + MainUnit in 'MainUnit.pas' {MainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.MainFormOnTaskbar := True; + Application.Title := 'Remote Desktop Protocol Configuration'; + Application.CreateForm(TMainForm, MainForm); + Application.Run; +end. diff --git a/src-rdpconfig/RDPConf.dproj b/src-rdpconfig/RDPConf.dproj new file mode 100644 index 0000000..e333e60 --- /dev/null +++ b/src-rdpconfig/RDPConf.dproj @@ -0,0 +1,107 @@ + + + {A7CB4C30-85F5-4D96-B510-6F0CDCF7C2DA} + 12.0 + RDPConf.dpr + Debug + DCC32 + + + true + + + true + Base + true + + + true + Base + true + + + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias) + RDPConf.exe + 00400000 + x86 + + + false + RELEASE;$(DCC_Define) + 0 + false + + + DEBUG;$(DCC_Define) + + + + MainSource + + +
MainForm
+
+ + Base + + + Cfg_2 + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + + + + + RDPConf.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + Stas'M Corp. + RDP Configuration Program + 1.0.0.0 + RDPConf + Copyright © Stas'M Corp. 2014 + Stas'M Corp. + RDPConf.exe + RDP Host Support + 1.4.0.0 + http://stascorp.com + + + Embarcadero C++Builder Office 2000 Servers Package + Embarcadero C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + 12 + +
diff --git a/src-rdpconfig/RDPConf.res b/src-rdpconfig/RDPConf.res new file mode 100644 index 0000000..db065ef Binary files /dev/null and b/src-rdpconfig/RDPConf.res differ diff --git a/src-rdpconfig/manifest.res b/src-rdpconfig/manifest.res new file mode 100644 index 0000000..82e8f47 Binary files /dev/null and b/src-rdpconfig/manifest.res differ