├── .gitattributes
├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── COPYING
├── KeePass
└── README.md
├── KeePassRDP.sln
├── KeePassRDP.ver
├── KeePassRDP.ver.gz
├── KeePassRDP
├── Commands
│ ├── Command.cs
│ ├── CommandArgumentAttribute.cs
│ ├── CustomCommand.cs
│ ├── FreeRdpCommand.cs
│ └── MstscCommand.cs
├── Extensions.cs
├── GaussianBlur.cs
├── Generator
│ ├── KprRdpFileForm.Designer.cs
│ ├── KprRdpFileForm.cs
│ ├── KprRdpFileForm.resx
│ ├── RdpFile.cs
│ ├── RdpFile_JsonSerializer.cs
│ ├── RdpFile_Settings.cs
│ ├── RdpSettingAttribute.cs
│ ├── RdpSignscopeAttribute.cs
│ └── SelfSignedCertificate.cs
├── KeePassRDP.cs
├── KeePassRDP.csproj
├── KeePassRDPexe.tt
├── KprConfig.cs
├── KprConfig_Executable.cs
├── KprConfig_Integration.cs
├── KprConfig_Picker.cs
├── KprConnectionManager.cs
├── KprCredential.cs
├── KprCredentialManager.cs
├── KprCredentialPicker.cs
├── KprCredentialPickerForm.Designer.cs
├── KprCredentialPickerForm.cs
├── KprCredentialPickerForm.resx
├── KprEntrySettings.cs
├── KprEntrySettingsTab.Designer.cs
├── KprEntrySettingsTab.cs
├── KprEntrySettingsTab.resx
├── KprHotkeyBox.cs
├── KprImageList.cs
├── KprMenu.cs
├── KprOptionsForm.Designer.cs
├── KprOptionsForm.cs
├── KprOptionsForm.resx
├── KprOptionsForm_Executable.cs
├── KprOptionsForm_Integration.cs
├── KprOptionsForm_Picker.cs
├── KprOptionsForm_Vault.cs
├── KprPictureBox.Designer.cs
├── KprPictureBox.cs
├── KprResourceManager.cs
├── KprSecureBackgroundForm.cs
├── KprSecureDesktopAppBar.cs
├── KprSecureDesktopToolBar.Designer.cs
├── KprSecureDesktopToolBar.cs
├── KprSecureDesktopToolBar.resx
├── KprSecureLockScreen.cs
├── KprSecureShellWindow.cs
├── KprSessionListForm.Designer.cs
├── KprSessionListForm.cs
├── KprSessionListForm.resx
├── KprSettingsControl.Designer.cs
├── KprSettingsControl.cs
├── KprSettingsControl.resx
├── KprToolStripDropDownButton.cs
├── KprToolTip.cs
├── KprVersion.tt
├── MessageFilter.cs
├── NativeCredentials.cs
├── NativeMethods.cs
├── Properties
│ └── AssemblyInfo.cs
├── ReadOnlySet.cs
├── SecureDesktop.cs
├── SecureProcess.cs
├── ShadowSession.cs
└── Utils.cs
├── KeePassRDPResources
├── KeePassRDPResources.csproj
├── Properties
│ └── AssemblyInfo.cs
├── Resources.de.resx
├── Resources.resx
└── Resources
│ ├── Add.png
│ ├── Cancel.png
│ ├── Certificate.png
│ ├── Checkmark.png
│ ├── Disconnect.png
│ ├── Expander.png
│ ├── FileDestination.png
│ ├── KeyVault.png
│ ├── ListMembers.png
│ ├── LoginScreen.png
│ ├── ModalPopup.png
│ ├── OpenFile.png
│ ├── PowerShellProject.png
│ ├── Refresh.png
│ ├── RemoteDesktop.png
│ ├── Remove.png
│ ├── StatusHelpOutline.png
│ ├── SwitchSourceOrTarget.png
│ ├── User.png
│ ├── UserFeedback.png
│ └── Visual Studio 2022 Image Library EULA.rtf
├── KeePassRDPResourcesWriter
├── KeePassRDPResourcesWriter.csproj
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── KeePassRDPSetup
├── KeePassRDPSetup.csproj
├── Setup.cs
├── WixUI_de-de.wxl
├── WixUI_en-us.wxl
└── winget
│ ├── KeePassRDP.KeePassRDP.installer.tt
│ ├── KeePassRDP.KeePassRDP.locale.en-US.tt
│ └── KeePassRDP.KeePassRDP.tt
├── KeePassRDPUnmanaged
├── 32.ico
├── KeePassRDPUnmanaged.cpp
├── KeePassRDPUnmanaged.filters
├── KeePassRDPUnmanaged.rc
├── KeePassRDPUnmanaged.vcxproj
├── framework.h
├── pch.cpp
├── pch.h
└── resource.h
├── README.md
├── doc
├── build_project.jpg
├── context_menu.jpg
├── credential_picker.jpg
├── credential_picker_regex.jpg
├── credential_picker_settings.jpg
├── credential_settings.jpg
├── customer_entries.jpg
├── db_structure.jpg
├── entry_settings.jpg
├── executable_settings.jpg
├── jumphost_entry.jpg
├── keyboard_shortcuts.jpg
├── rdp_file.jpg
├── rdp_subgroup.jpg
├── rdp_subgroup_entries.jpg
├── secure_desktop.jpg
├── self_signing.jpg
├── session_shadowing.jpg
└── visibility_settings.jpg
├── make_release.ps1
└── make_winget.ps1
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | *.rtf linguist-documentation
7 |
8 | *.sln text eol=crlf
9 | *.csproj text eol=crlf
10 | *.vbproj text eol=crlf
11 | *.vcxproj text eol=crlf
12 | *.vcproj text eol=crlf
13 | *.dbproj text eol=crlf
14 | *.fsproj text eol=crlf
15 | *.lsproj text eol=crlf
16 | *.wixproj text eol=crlf
17 | *.modelproj text eol=crlf
18 | *.sqlproj text eol=crlf
19 | *.wwaproj text eol=crlf
20 |
21 | *.xproj text eol=crlf
22 | *.props text eol=crlf
23 | *.filters text eol=crlf
24 | *.vcxitems text eol=crlf
25 |
26 | *.ps1 text eol=crlf
27 | *.ps1x text eol=crlf
28 | *.psm1 text eol=crlf
29 | *.psd1 text eol=crlf
30 | *.ps1xml text eol=crlf
31 | *.pssc text eol=crlf
32 | *.psrc text eol=crlf
33 | *.cdxml text eol=crlf
34 |
35 | COPYING text eol=crlf
36 |
37 | ###############################################################################
38 | # Set default behavior for command prompt diff.
39 | #
40 | # This is need for earlier builds of msysgit that does not have it on by
41 | # default for csharp files.
42 | # Note: This is only used by command line
43 | ###############################################################################
44 | #*.cs diff=csharp
45 |
46 | ###############################################################################
47 | # Set the merge driver for project and solution files
48 | #
49 | # Merging from the command prompt will add diff markers to the files if there
50 | # are conflicts (Merging from VS is not affected by the settings below, in VS
51 | # the diff markers are never inserted). Diff markers may cause the following
52 | # file extensions to fail to load in VS. An alternative would be to treat
53 | # these files as binary and thus will always conflict and require user
54 | # intervention with every merge. To do so, just uncomment the entries below
55 | ###############################################################################
56 | #*.sln merge=binary
57 | #*.csproj merge=binary
58 | #*.vbproj merge=binary
59 | #*.vcxproj merge=binary
60 | #*.vcproj merge=binary
61 | #*.dbproj merge=binary
62 | #*.fsproj merge=binary
63 | #*.lsproj merge=binary
64 | #*.wixproj merge=binary
65 | #*.modelproj merge=binary
66 | #*.sqlproj merge=binary
67 | #*.wwaproj merge=binary
68 |
69 | ###############################################################################
70 | # behavior for image files
71 | #
72 | # image files are treated as binary by default.
73 | ###############################################################################
74 | #*.jpg binary
75 | #*.png binary
76 | #*.gif binary
77 |
78 | ###############################################################################
79 | # diff behavior for common document formats
80 | #
81 | # Convert binary document formats to text before diffing them. This feature
82 | # is only available from the command line. Turn it on by uncommenting the
83 | # entries below.
84 | ###############################################################################
85 | #*.doc diff=astextplain
86 | #*.DOC diff=astextplain
87 | #*.docx diff=astextplain
88 | #*.DOCX diff=astextplain
89 | #*.dot diff=astextplain
90 | #*.DOT diff=astextplain
91 | #*.pdf diff=astextplain
92 | #*.PDF diff=astextplain
93 | #*.rtf diff=astextplain
94 | #*.RTF diff=astextplain
95 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Additional context**
27 | Add any other context about the problem here.
28 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore generated content.
2 | /KeePassRDP/KeePassRDPexe.SED
3 | /KeePassRDP/KprVersion.cs
4 | /KeePassRDPResources/Resources.Designer.cs
5 | /KeePassRDPSetup/winget/KeePassRDP.KeePassRDP.installer.yaml
6 | /KeePassRDPSetup/winget/KeePassRDP.KeePassRDP.locale.en-US.yaml
7 | /KeePassRDPSetup/winget/KeePassRDP.KeePassRDP.yaml
8 | README.tt
9 |
10 | # Ignore version signing key.
11 | KeePassRDP.ver.private
12 | KeePassRDP.ver.public
13 |
14 | # Ignore files not needed for rebuilding.
15 | *.snk
16 | *.exe
17 | *.kdbx
18 | *.plgx
19 | *.zip
20 | *.msi
21 | /KeePass/KeePass.exe
22 |
23 | ## Ignore Visual Studio temporary files, build results, and
24 | ## files generated by popular Visual Studio add-ons.
25 |
26 | # Auto-generated files
27 | *.g.wxs
28 |
29 | # User-specific files
30 | *.suo
31 | *.user
32 | *.userosscache
33 | *.sln.docstates
34 |
35 | # User-specific files (MonoDevelop/Xamarin Studio)
36 | *.userprefs
37 |
38 | # Build results
39 | [Dd]ebug/
40 | [Dd]ebugPublic/
41 | [Rr]elease/
42 | [Rr]eleases/
43 | x64/
44 | x86/
45 | bld/
46 | [Bb]in/
47 | [Oo]bj/
48 | [Ll]og/
49 |
50 | # Visual Studio 2015 cache/options directory
51 | .vs/
52 | # Uncomment if you have tasks that create the project's static files in wwwroot
53 | #wwwroot/
54 |
55 | # MSTest test Results
56 | [Tt]est[Rr]esult*/
57 | [Bb]uild[Ll]og.*
58 |
59 | # NUNIT
60 | *.VisualState.xml
61 | TestResult.xml
62 |
63 | # Build Results of an ATL Project
64 | [Dd]ebugPS/
65 | [Rr]eleasePS/
66 | dlldata.c
67 |
68 | # DNX
69 | project.lock.json
70 | project.fragment.lock.json
71 | artifacts/
72 |
73 | *_i.c
74 | *_p.c
75 | *_i.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.pch
80 | *.pdb
81 | *.pgc
82 | *.pgd
83 | *.rsp
84 | *.sbr
85 | *.tlb
86 | *.tli
87 | *.tlh
88 | *.tmp
89 | *.tmp_proj
90 | *.log
91 | *.vspscc
92 | *.vssscc
93 | .builds
94 | *.pidb
95 | *.svclog
96 | *.scc
97 |
98 | # Chutzpah Test files
99 | _Chutzpah*
100 |
101 | # Visual C++ cache files
102 | ipch/
103 | *.aps
104 | *.ncb
105 | *.opendb
106 | *.opensdf
107 | *.sdf
108 | *.cachefile
109 | *.VC.db
110 | *.VC.VC.opendb
111 |
112 | # Visual Studio profiler
113 | *.psess
114 | *.vsp
115 | *.vspx
116 | *.sap
117 |
118 | # TFS 2012 Local Workspace
119 | $tf/
120 |
121 | # Guidance Automation Toolkit
122 | *.gpState
123 |
124 | # ReSharper is a .NET coding add-in
125 | _ReSharper*/
126 | *.[Rr]e[Ss]harper
127 | *.DotSettings.user
128 |
129 | # JustCode is a .NET coding add-in
130 | .JustCode
131 |
132 | # TeamCity is a build add-in
133 | _TeamCity*
134 |
135 | # DotCover is a Code Coverage Tool
136 | *.dotCover
137 |
138 | # NCrunch
139 | _NCrunch_*
140 | .*crunch*.local.xml
141 | nCrunchTemp_*
142 |
143 | # MightyMoose
144 | *.mm.*
145 | AutoTest.Net/
146 |
147 | # Web workbench (sass)
148 | .sass-cache/
149 |
150 | # Installshield output folder
151 | [Ee]xpress/
152 |
153 | # DocProject is a documentation generator add-in
154 | DocProject/buildhelp/
155 | DocProject/Help/*.HxT
156 | DocProject/Help/*.HxC
157 | DocProject/Help/*.hhc
158 | DocProject/Help/*.hhk
159 | DocProject/Help/*.hhp
160 | DocProject/Help/Html2
161 | DocProject/Help/html
162 |
163 | # Click-Once directory
164 | publish/
165 |
166 | # Publish Web Output
167 | *.[Pp]ublish.xml
168 | *.azurePubxml
169 | # TODO: Comment the next line if you want to checkin your web deploy settings
170 | # but database connection strings (with potential passwords) will be unencrypted
171 | #*.pubxml
172 | *.publishproj
173 |
174 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
175 | # checkin your Azure Web App publish settings, but sensitive information contained
176 | # in these scripts will be unencrypted
177 | PublishScripts/
178 |
179 | # NuGet Packages
180 | *.nupkg
181 | # The packages folder can be ignored because of Package Restore
182 | **/packages/*
183 | # except build/, which is used as an MSBuild target.
184 | !**/packages/build/
185 | # Uncomment if necessary however generally it will be regenerated when needed
186 | #!**/packages/repositories.config
187 | # NuGet v3's project.json files produces more ignoreable files
188 | *.nuget.props
189 | *.nuget.targets
190 |
191 | # Microsoft Azure Build Output
192 | csx/
193 | *.build.csdef
194 |
195 | # Microsoft Azure Emulator
196 | ecf/
197 | rcf/
198 |
199 | # Windows Store app package directories and files
200 | AppPackages/
201 | BundleArtifacts/
202 | Package.StoreAssociation.xml
203 | _pkginfo.txt
204 |
205 | # Visual Studio cache files
206 | # files ending in .cache can be ignored
207 | *.[Cc]ache
208 | # but keep track of directories ending in .cache
209 | !*.[Cc]ache/
210 |
211 | # Others
212 | ClientBin/
213 | ~$*
214 | *~
215 | *.dbmdl
216 | *.dbproj.schemaview
217 | *.jfm
218 | *.pfx
219 | *.publishsettings
220 | node_modules/
221 | orleans.codegen.cs
222 |
223 | # Since there are multiple workflows, uncomment next line to ignore bower_components
224 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
225 | #bower_components/
226 |
227 | # RIA/Silverlight projects
228 | Generated_Code/
229 |
230 | # Backup & report files from converting an old project file
231 | # to a newer Visual Studio version. Backup files are not needed,
232 | # because we have git ;-)
233 | _UpgradeReport_Files/
234 | Backup*/
235 | UpgradeLog*.XML
236 | UpgradeLog*.htm
237 |
238 | # SQL Server files
239 | *.mdf
240 | *.ldf
241 |
242 | # Business Intelligence projects
243 | *.rdl.data
244 | *.bim.layout
245 | *.bim_*.settings
246 |
247 | # Microsoft Fakes
248 | FakesAssemblies/
249 |
250 | # GhostDoc plugin setting file
251 | *.GhostDoc.xml
252 |
253 | # Node.js Tools for Visual Studio
254 | .ntvs_analysis.dat
255 |
256 | # Visual Studio 6 build log
257 | *.plg
258 |
259 | # Visual Studio 6 workspace options file
260 | *.opt
261 |
262 | # Visual Studio LightSwitch build output
263 | **/*.HTMLClient/GeneratedArtifacts
264 | **/*.DesktopClient/GeneratedArtifacts
265 | **/*.DesktopClient/ModelManifest.xml
266 | **/*.Server/GeneratedArtifacts
267 | **/*.Server/ModelManifest.xml
268 | _Pvt_Extensions
269 |
270 | # Paket dependency manager
271 | .paket/paket.exe
272 | paket-files/
273 |
274 | # FAKE - F# Make
275 | .fake/
276 |
277 | # JetBrains Rider
278 | .idea/
279 | *.sln.iml
280 |
281 | # CodeRush
282 | .cr/
283 |
284 | # Python Tools for Visual Studio (PTVS)
285 | __pycache__/
286 | *.pyc
287 |
--------------------------------------------------------------------------------
/KeePass/README.md:
--------------------------------------------------------------------------------
1 | Place a copy of KeePass.exe here before building KeePassRDP.
--------------------------------------------------------------------------------
/KeePassRDP.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.3.32929.385
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeePassRDP", "KeePassRDP\KeePassRDP.csproj", "{CD6E2D26-2B40-4433-879D-2B07D159356C}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1} = {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}
9 | EndProjectSection
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeePassRDPResources", "KeePassRDPResources\KeePassRDPResources.csproj", "{8286969C-231B-4E96-98AC-E95E13B09DF0}"
12 | ProjectSection(ProjectDependencies) = postProject
13 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3} = {F4890E0E-3F01-4B34-87FB-A260A324B7C3}
14 | EndProjectSection
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeePassRDPResourcesWriter", "KeePassRDPResourcesWriter\KeePassRDPResourcesWriter.csproj", "{F4890E0E-3F01-4B34-87FB-A260A324B7C3}"
17 | EndProject
18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeePassRDPUnmanaged", "KeePassRDPUnmanaged\KeePassRDPUnmanaged.vcxproj", "{64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}"
19 | EndProject
20 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KeePassRDPSetup", "KeePassRDPSetup\KeePassRDPSetup.csproj", "{AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}"
21 | EndProject
22 | Global
23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
24 | Debug|Any CPU = Debug|Any CPU
25 | Debug|x64 = Debug|x64
26 | Debug|x86 = Debug|x86
27 | DebugPLGX|Any CPU = DebugPLGX|Any CPU
28 | DebugPLGX|x64 = DebugPLGX|x64
29 | DebugPLGX|x86 = DebugPLGX|x86
30 | Release|Any CPU = Release|Any CPU
31 | Release|x64 = Release|x64
32 | Release|x86 = Release|x86
33 | EndGlobalSection
34 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
35 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Debug|Any CPU.Build.0 = Debug|Any CPU
37 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Debug|x64.ActiveCfg = Debug|Any CPU
38 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Debug|x64.Build.0 = Debug|Any CPU
39 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Debug|x86.ActiveCfg = Debug|Any CPU
40 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Debug|x86.Build.0 = Debug|Any CPU
41 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.DebugPLGX|Any CPU.ActiveCfg = DebugPLGX|Any CPU
42 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.DebugPLGX|Any CPU.Build.0 = DebugPLGX|Any CPU
43 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.DebugPLGX|x64.ActiveCfg = DebugPLGX|Any CPU
44 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.DebugPLGX|x64.Build.0 = DebugPLGX|Any CPU
45 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.DebugPLGX|x86.ActiveCfg = DebugPLGX|Any CPU
46 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.DebugPLGX|x86.Build.0 = DebugPLGX|Any CPU
47 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Release|Any CPU.ActiveCfg = Release|Any CPU
48 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Release|Any CPU.Build.0 = Release|Any CPU
49 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Release|x64.ActiveCfg = Release|Any CPU
50 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Release|x64.Build.0 = Release|Any CPU
51 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Release|x86.ActiveCfg = Release|Any CPU
52 | {CD6E2D26-2B40-4433-879D-2B07D159356C}.Release|x86.Build.0 = Release|Any CPU
53 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
55 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Debug|x64.ActiveCfg = Debug|Any CPU
56 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Debug|x64.Build.0 = Debug|Any CPU
57 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Debug|x86.ActiveCfg = Debug|Any CPU
58 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Debug|x86.Build.0 = Debug|Any CPU
59 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.DebugPLGX|Any CPU.ActiveCfg = Debug|Any CPU
60 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.DebugPLGX|Any CPU.Build.0 = Debug|Any CPU
61 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.DebugPLGX|x64.ActiveCfg = Debug|Any CPU
62 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.DebugPLGX|x64.Build.0 = Debug|Any CPU
63 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.DebugPLGX|x86.ActiveCfg = Debug|Any CPU
64 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.DebugPLGX|x86.Build.0 = Debug|Any CPU
65 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
66 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Release|Any CPU.Build.0 = Release|Any CPU
67 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Release|x64.ActiveCfg = Release|Any CPU
68 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Release|x64.Build.0 = Release|Any CPU
69 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Release|x86.ActiveCfg = Release|Any CPU
70 | {8286969C-231B-4E96-98AC-E95E13B09DF0}.Release|x86.Build.0 = Release|Any CPU
71 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
73 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Debug|x64.ActiveCfg = Debug|Any CPU
74 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Debug|x64.Build.0 = Debug|Any CPU
75 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Debug|x86.ActiveCfg = Debug|Any CPU
76 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Debug|x86.Build.0 = Debug|Any CPU
77 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.DebugPLGX|Any CPU.ActiveCfg = Debug|Any CPU
78 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.DebugPLGX|Any CPU.Build.0 = Debug|Any CPU
79 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.DebugPLGX|x64.ActiveCfg = Debug|Any CPU
80 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.DebugPLGX|x64.Build.0 = Debug|Any CPU
81 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.DebugPLGX|x86.ActiveCfg = Debug|Any CPU
82 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.DebugPLGX|x86.Build.0 = Debug|Any CPU
83 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
84 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Release|Any CPU.Build.0 = Release|Any CPU
85 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Release|x64.ActiveCfg = Release|Any CPU
86 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Release|x64.Build.0 = Release|Any CPU
87 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Release|x86.ActiveCfg = Release|Any CPU
88 | {F4890E0E-3F01-4B34-87FB-A260A324B7C3}.Release|x86.Build.0 = Release|Any CPU
89 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Debug|Any CPU.ActiveCfg = Debug|x64
90 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Debug|Any CPU.Build.0 = Debug|x64
91 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Debug|x64.ActiveCfg = Debug|x64
92 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Debug|x64.Build.0 = Debug|x64
93 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Debug|x86.ActiveCfg = Debug|Win32
94 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Debug|x86.Build.0 = Debug|Win32
95 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.DebugPLGX|Any CPU.ActiveCfg = Debug|x64
96 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.DebugPLGX|Any CPU.Build.0 = Debug|x64
97 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.DebugPLGX|x64.ActiveCfg = Debug|x64
98 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.DebugPLGX|x64.Build.0 = Debug|x64
99 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.DebugPLGX|x86.ActiveCfg = Debug|Win32
100 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.DebugPLGX|x86.Build.0 = Debug|Win32
101 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Release|Any CPU.ActiveCfg = Release|x64
102 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Release|Any CPU.Build.0 = Release|x64
103 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Release|x64.ActiveCfg = Release|x64
104 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Release|x64.Build.0 = Release|x64
105 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Release|x86.ActiveCfg = Release|Win32
106 | {64E5239E-4E0E-4C9A-BA76-FC1775B22CC1}.Release|x86.Build.0 = Release|Win32
107 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
108 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Debug|Any CPU.Build.0 = Debug|Any CPU
109 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Debug|x64.ActiveCfg = Debug|Any CPU
110 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Debug|x64.Build.0 = Debug|Any CPU
111 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Debug|x86.ActiveCfg = Debug|Any CPU
112 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Debug|x86.Build.0 = Debug|Any CPU
113 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.DebugPLGX|Any CPU.ActiveCfg = Debug|Any CPU
114 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.DebugPLGX|Any CPU.Build.0 = Debug|Any CPU
115 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.DebugPLGX|x64.ActiveCfg = Debug|Any CPU
116 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.DebugPLGX|x64.Build.0 = Debug|Any CPU
117 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.DebugPLGX|x86.ActiveCfg = Debug|Any CPU
118 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.DebugPLGX|x86.Build.0 = Debug|Any CPU
119 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Release|Any CPU.ActiveCfg = Release|Any CPU
120 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Release|Any CPU.Build.0 = Release|Any CPU
121 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Release|x64.ActiveCfg = Release|Any CPU
122 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Release|x64.Build.0 = Release|Any CPU
123 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Release|x86.ActiveCfg = Release|Any CPU
124 | {AF1F7F12-A267-4D94-9AD3-C16C6D2D5F99}.Release|x86.Build.0 = Release|Any CPU
125 | EndGlobalSection
126 | GlobalSection(SolutionProperties) = preSolution
127 | HideSolutionNode = FALSE
128 | EndGlobalSection
129 | GlobalSection(ExtensibilityGlobals) = postSolution
130 | SolutionGuid = {4766F9A5-4040-4C80-9F70-632299622F5A}
131 | EndGlobalSection
132 | EndGlobal
133 |
--------------------------------------------------------------------------------
/KeePassRDP.ver:
--------------------------------------------------------------------------------
1 | :
2 | KeePassRDP:2.3
3 | :
--------------------------------------------------------------------------------
/KeePassRDP.ver.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iSnackyCracky/KeePassRDP/df0bf061e26efb6239014dc7ca98557a5b8cbfee/KeePassRDP.ver.gz
--------------------------------------------------------------------------------
/KeePassRDP/Commands/Command.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using KeePassRDP.Extensions;
22 | using System;
23 | using System.Collections.Concurrent;
24 | using System.Collections.ObjectModel;
25 | using System.IO;
26 | using System.Linq;
27 | using System.Reflection;
28 | using System.Text;
29 |
30 | namespace KeePassRDP.Commands
31 | {
32 | internal interface ICommand
33 | {
34 | string Executable { get; }
35 | string ToString();
36 | }
37 |
38 | internal abstract class Command : ICommand
39 | {
40 | private static readonly ConcurrentDictionary _fileExistsCache = new ConcurrentDictionary(2, 0);
41 | private static readonly ConcurrentDictionary>> _propertyCache = new ConcurrentDictionary>>(2, 0);
42 |
43 | internal static ICommand CreateInstance(string inputString)
44 | {
45 | var commandString = inputString.Split(new[] { ':' }, 2);
46 | var typeName = commandString.FirstOrDefault();
47 |
48 | if (IsKnownCommand(typeName))
49 | {
50 | var commandType = Type.GetType(string.Format("{0}.{1}", typeof(Command).Namespace, typeName));
51 | var icommand = Activator.CreateInstance(commandType, new[] { commandString.Skip(1).FirstOrDefault() }) as ICommand;
52 |
53 | if (icommand is CustomCommand)
54 | icommand = (icommand as CustomCommand).Command;
55 |
56 | return icommand;
57 | }
58 |
59 | return null;
60 | }
61 |
62 | protected static bool IsKnownCommand(string typeName)
63 | {
64 | switch (typeName)
65 | {
66 | case "MstscCommand":
67 | case "FreeRdpCommand":
68 | case "CustomCommand":
69 | return true;
70 | }
71 |
72 | return false;
73 | }
74 |
75 | public virtual string Executable { get { return _executable; } }
76 |
77 | protected readonly string _executable;
78 |
79 | protected Command(string executable)
80 | {
81 | if (string.IsNullOrWhiteSpace(executable))
82 | throw new ArgumentNullException("Command");
83 |
84 | if (IsKnownCommand(executable))
85 | {
86 | _executable = string.Empty;
87 | return;
88 | }
89 |
90 | if (!_fileExistsCache.AddOrUpdate(Path.GetFullPath(Environment.ExpandEnvironmentVariables(executable)), x => File.Exists(x), (x, y) => y ? y : File.Exists(x)))
91 | throw new FileNotFoundException(executable);
92 |
93 | _executable = executable;
94 | }
95 |
96 | public override string ToString()
97 | {
98 | var argumentsBuilder = new StringBuilder();
99 |
100 | foreach (var prop in _propertyCache.GetOrAdd(GetType(), t => t
101 | .GetProperties(BindingFlags.Instance | BindingFlags.Public)
102 | .Select(x =>
103 | {
104 | var commandArgumentAttribute = x.GetCustomAttributes(false).OfType().FirstOrDefault();
105 | if (commandArgumentAttribute == null)
106 | return null;
107 | return new Tuple(x, commandArgumentAttribute);
108 | })
109 | .Where(x => x != null && x.Item2 != null)
110 | .OrderBy(x => x.Item2.Position)
111 | .ToArray()
112 | .AsReadOnly())
113 | .Select(x => new { Value = x.Item1.GetValue(this, null), Attribute = x.Item2 })
114 | .Where(x => x.Value != null))
115 | {
116 | var value = prop.Value;
117 | var attribute = prop.Attribute;
118 |
119 | if (value != null && (!(value is bool) || (bool)value == true))
120 | {
121 | if (!string.IsNullOrEmpty(attribute.Parameter))
122 | {
123 | argumentsBuilder.Append(attribute.Prefix);
124 | argumentsBuilder.Append(attribute.Parameter);
125 | if (attribute.Delimiter != char.MinValue)
126 | {
127 | var stringValue = value.ToString();
128 | if (!string.IsNullOrEmpty(stringValue))
129 | {
130 | argumentsBuilder.Append(attribute.Delimiter);
131 | argumentsBuilder.Append(stringValue);
132 | }
133 | }
134 | argumentsBuilder.Append(' ');
135 | }
136 | else
137 | {
138 | var stringValue = value.ToString();
139 | if (!string.IsNullOrEmpty(stringValue))
140 | {
141 | argumentsBuilder.Append('"');
142 | argumentsBuilder.Append(stringValue);
143 | argumentsBuilder.Append('"');
144 | argumentsBuilder.Append(' ');
145 | }
146 | }
147 | }
148 | }
149 |
150 | return argumentsBuilder.Length > 0 ? argumentsBuilder.ToString() : string.Empty;
151 | }
152 | }
153 |
154 | internal abstract class Command : Command where T : new()
155 | {
156 | protected Command(string executable) : base(executable)
157 | {
158 | }
159 | }
160 | }
161 |
--------------------------------------------------------------------------------
/KeePassRDP/Commands/CommandArgumentAttribute.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using System;
22 |
23 | namespace KeePassRDP.Commands
24 | {
25 | [AttributeUsage(AttributeTargets.Property)]
26 | internal class CommandArgumentAttribute : Attribute
27 | {
28 | public int Position { get; set; }
29 | public string Parameter { get; set; }
30 | public char Delimiter { get; set; }
31 | public char Prefix { get; set; }
32 |
33 | public CommandArgumentAttribute() : this('/') { }
34 |
35 | public CommandArgumentAttribute(char prefix)
36 | {
37 | Position = int.MaxValue;
38 | Parameter = string.Empty;
39 | Delimiter = char.MinValue;
40 | Prefix = prefix;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/KeePassRDP/Commands/CustomCommand.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.IO;
24 | using System.Linq;
25 |
26 | namespace KeePassRDP.Commands
27 | {
28 | internal class CustomCommand : Command
29 | {
30 | public override string Executable { get { return Path.GetFullPath(Environment.ExpandEnvironmentVariables(_executable)); } }
31 |
32 | public ICommand Command { get { return _command; } }
33 |
34 | private readonly ICommand _command;
35 |
36 | public CustomCommand(string inputString) : this(inputString.Split(new[] { ':' }, 3).Skip(1))
37 | {
38 | }
39 |
40 | private CustomCommand(IEnumerable commandString) : base(commandString.FirstOrDefault())
41 | {
42 | _command = CreateInstance(string.Join(":", commandString)) ?? this;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/KeePassRDP/Commands/FreeRdpCommand.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using KeePass.App.Configuration;
22 | using System.IO;
23 |
24 | namespace KeePassRDP.Commands
25 | {
26 | internal class FreeRdpCommand : Command, IMstscCommand
27 | {
28 | [CommandArgument(Position = 1)]
29 | public string Filename { get; set; }
30 |
31 | [CommandArgument(Parameter = "v", Delimiter = ':')]
32 | public string HostPort { get; set; }
33 |
34 | [CommandArgument(Parameter = "gateway:g", Delimiter = ':')]
35 | public string Gateway { get; set; }
36 |
37 | [CommandArgument(Parameter = "admin", Prefix = '+')]
38 | public bool? Admin { get; set; }
39 |
40 | [CommandArgument(Parameter = "f", Prefix = '+')]
41 | public bool? Fullscreen { get; set; }
42 |
43 | [CommandArgument(Parameter = "w", Delimiter = ':')]
44 | public int? Width { get; set; }
45 |
46 | [CommandArgument(Parameter = "h", Delimiter = ':')]
47 | public int? Height { get; set; }
48 |
49 | [CommandArgument(Parameter = "span", Prefix = '+')]
50 | public bool? Span { get; set; }
51 |
52 | [CommandArgument(Parameter = "multimon")]
53 | public bool? Multimon { get; set; }
54 |
55 | [CommandArgument(Parameter = "restricted-admin", Prefix = '+')]
56 | public bool? RestrictedAdmin { get; set; }
57 |
58 | public bool? Public { get; set; }
59 | public bool? RemoteGuard { get; set; }
60 | public string Shadow { get; set; }
61 | public bool? Control { get; set; }
62 | public bool? NoConsentPrompt { get; set; }
63 |
64 | public FreeRdpCommand() : this(null)
65 | {
66 | }
67 |
68 | public FreeRdpCommand(string executable) : base(string.IsNullOrWhiteSpace(executable) ? Path.Combine(AppConfigSerializer.AppDataDirectory, "wfreerdp.exe") : executable)
69 | {
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/KeePassRDP/Commands/MstscCommand.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | namespace KeePassRDP.Commands
22 | {
23 | interface IMstscCommand
24 | {
25 | string Filename { get; set; }
26 | string HostPort { get; set; }
27 | string Gateway { get; set; }
28 | bool? Admin { get; set; }
29 | bool? Fullscreen { get; set; }
30 | int? Width { get; set; }
31 | int? Height { get; set; }
32 | bool? Public { get; set; }
33 | bool? Span { get; set; }
34 | bool? Multimon { get; set; }
35 | bool? RestrictedAdmin { get; set; }
36 | bool? RemoteGuard { get; set; }
37 | string Shadow { get; set; }
38 | bool? Control { get; set; }
39 | bool? NoConsentPrompt { get; set; }
40 | }
41 |
42 | internal class MstscCommand : Command, IMstscCommand
43 | {
44 | [CommandArgument(Position = 1)]
45 | public string Filename { get; set; }
46 |
47 | [CommandArgument(Parameter = "v", Delimiter = ':')]
48 | public string HostPort { get; set; }
49 |
50 | [CommandArgument(Parameter = "g", Delimiter = ':')]
51 | public string Gateway { get; set; }
52 |
53 | [CommandArgument(Parameter = "admin")]
54 | public bool? Admin { get; set; }
55 |
56 | [CommandArgument(Parameter = "f")]
57 | public bool? Fullscreen { get; set; }
58 |
59 | [CommandArgument(Parameter = "w", Delimiter = ':')]
60 | public int? Width { get; set; }
61 |
62 | [CommandArgument(Parameter = "h", Delimiter = ':')]
63 | public int? Height { get; set; }
64 |
65 | [CommandArgument(Parameter = "public")]
66 | public bool? Public { get; set; }
67 |
68 | [CommandArgument(Parameter = "span")]
69 | public bool? Span { get; set; }
70 |
71 | [CommandArgument(Parameter = "multimon")]
72 | public bool? Multimon { get; set; }
73 |
74 | [CommandArgument(Parameter = "restrictedAdmin")]
75 | public bool? RestrictedAdmin { get; set; }
76 |
77 | [CommandArgument(Parameter = "remoteGuard")]
78 | public bool? RemoteGuard { get; set; }
79 |
80 | [CommandArgument(Parameter = "shadow", Delimiter = ':')]
81 | public string Shadow { get; set; }
82 |
83 | [CommandArgument(Parameter = "control")]
84 | public bool? Control { get; set; }
85 |
86 | [CommandArgument(Parameter = "noConsentPrompt")]
87 | public bool? NoConsentPrompt { get; set; }
88 |
89 | public MstscCommand() : this(null)
90 | {
91 | }
92 |
93 | public MstscCommand(string executable) : base(string.IsNullOrWhiteSpace(executable) ? KeePassRDPExt.MstscPath : executable)
94 | {
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/KeePassRDP/GaussianBlur.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using System;
22 | using System.Drawing;
23 | using System.Drawing.Imaging;
24 | using System.Runtime.CompilerServices;
25 | using System.Runtime.InteropServices;
26 | using System.Threading;
27 | using System.Threading.Tasks;
28 |
29 | namespace KeePassRDP
30 | {
31 | public static class GaussianBlur
32 | {
33 | private static readonly ParallelOptions _pOptions = new ParallelOptions
34 | {
35 | MaxDegreeOfParallelism = 16,
36 | TaskScheduler = TaskScheduler.Default
37 | };
38 |
39 | // Based on https://github.com/mdymel/superfastblur
40 | public static void Process(Image image, int radial = 4, CancellationToken? cancellationToken = null)
41 | {
42 | var bitmap = image as Bitmap;
43 | if (bitmap == null)
44 | return;
45 |
46 | _pOptions.CancellationToken = cancellationToken ?? CancellationToken.None;
47 |
48 | var rct = new Rectangle(Point.Empty, bitmap.Size);
49 | var width = rct.Width;
50 | var height = rct.Height;
51 | var wh = width * height;
52 |
53 | var data = new int[wh];
54 | var bits = bitmap.LockBits(rct, ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
55 | Marshal.Copy(bits.Scan0, data, 0, data.Length);
56 |
57 | var alpha = new int[wh];
58 | var red = new int[wh];
59 | var green = new int[wh];
60 | var blue = new int[wh];
61 |
62 | Parallel.For(0, data.Length, _pOptions, i =>
63 | {
64 | alpha[i] = (int)((data[i] & 0xff000000) >> 24);
65 | red[i] = (data[i] & 0xff0000) >> 16;
66 | green[i] = (data[i] & 0x00ff00) >> 8;
67 | blue[i] = (data[i] & 0x0000ff);
68 | });
69 |
70 | int[] newAlpha = null, newRed = null, newGreen = null, newBlue = null;
71 |
72 | Parallel.Invoke(
73 | _pOptions,
74 | () => GaussBlur_4(ref alpha, out newAlpha, width, height, radial),
75 | () => GaussBlur_4(ref red, out newRed, width, height, radial),
76 | () => GaussBlur_4(ref green, out newGreen, width, height, radial),
77 | () => GaussBlur_4(ref blue, out newBlue, width, height, radial));
78 |
79 | Parallel.For(0, data.Length, _pOptions, i =>
80 | {
81 | var iAlpha = Math.Max(0, Math.Min(255, newAlpha[i]));
82 | var iRed = Math.Max(0, Math.Min(255, newRed[i]));
83 | var iGreen = Math.Max(0, Math.Min(255, newGreen[i]));
84 | var iBlue = Math.Max(0, Math.Min(255, newBlue[i]));
85 |
86 | data[i] = (int)((uint)(iAlpha << 24) | (uint)(iRed << 16) | (uint)(iGreen << 8) | (uint)iBlue);
87 | });
88 |
89 | newAlpha = newRed = newGreen = newBlue = null;
90 |
91 | Marshal.Copy(data, 0, bits.Scan0, data.Length);
92 | bitmap.UnlockBits(bits);
93 |
94 | data = null;
95 |
96 | GC.Collect(GC.MaxGeneration);
97 | }
98 |
99 | [MethodImpl(256)] //MethodImplOptions.AggressiveInlining
100 | private static void GaussBlur_4(ref int[] source, out int [] dest, int w, int h, int r)
101 | {
102 | dest = new int[w * h];
103 |
104 | var bxs = BoxesForGauss(r, 3);
105 | BoxBlur_4(ref source, ref dest, w, h, (bxs[0] - 1) / 2);
106 | BoxBlur_4(ref dest, ref source, w, h, (bxs[1] - 1) / 2);
107 | BoxBlur_4(ref source, ref dest, w, h, (bxs[2] - 1) / 2);
108 | }
109 |
110 | [MethodImpl(256)] //MethodImplOptions.AggressiveInlining
111 | private static int[] BoxesForGauss(int sigma, int n)
112 | {
113 | var ss = Math.Pow(sigma, 2);
114 | var wIdeal = Math.Sqrt((12d * ss / n) + 1d);
115 | var wl = (int)Math.Floor(wIdeal);
116 | //if (wl % 2 == 0) wl--;
117 | if ((wl & 1) == 0) wl--;
118 | var wu = wl + 2;
119 |
120 | var nwl = n * wl;
121 | var mIdeal = (12d * ss - nwl * wl - 4d * nwl - 3d * n) / (-4d * wl - 4d);
122 | var m = Math.Round(mIdeal);
123 |
124 | var sizes = new int[n];
125 | for (var i = 0; i < n; i++)
126 | sizes[i] = i < m ? wl : wu;
127 | return sizes;
128 | }
129 |
130 | [MethodImpl(256)] //MethodImplOptions.AggressiveInlining
131 | private static void BoxBlur_4(ref int[] source, ref int[] dest, int w, int h, int r)
132 | {
133 | Buffer.BlockCopy(source, 0, dest, 0, source.Length * sizeof(int));
134 | BoxBlurH_4(dest, source, w, h, r);
135 | BoxBlurT_4(source, dest, w, h, r);
136 | }
137 |
138 | [MethodImpl(256)] //MethodImplOptions.AggressiveInlining
139 | private static void BoxBlurH_4(int[] source, int[] dest, int w, int h, int r)
140 | {
141 | var iar = 1d / (r + r + 1);
142 | Parallel.For(0, h, _pOptions, i =>
143 | {
144 | var ti = i * w;
145 | var li = ti;
146 | var ri = ti + r;
147 | var fv = source[ti];
148 | var lv = source[ti + w - 1];
149 | var val = (r + 1) * fv;
150 | for (var j = 0; j < r; j++) val += source[ti + j];
151 | for (var j = 0; j <= r; j++)
152 | {
153 | val += source[ri++] - fv;
154 | dest[ti++] = (int)Math.Round(val * iar);
155 | }
156 | for (int j = r + 1, k = w - r; j < k; j++)
157 | {
158 | val += source[ri++] - source[li++];
159 | dest[ti++] = (int)Math.Round(val * iar);
160 | }
161 | for (var j = w - r; j < w; j++)
162 | {
163 | val += lv - source[li++];
164 | dest[ti++] = (int)Math.Round(val * iar);
165 | }
166 | });
167 | }
168 |
169 | [MethodImpl(256)] //MethodImplOptions.AggressiveInlining
170 | private static void BoxBlurT_4(int[] source, int[] dest, int w, int h, int r)
171 | {
172 | var iar = (double)1 / (r + r + 1);
173 | Parallel.For(0, w, _pOptions, i =>
174 | {
175 | var ti = i;
176 | var li = ti;
177 | var ri = ti + r * w;
178 | var fv = source[ti];
179 | var lv = source[ti + w * (h - 1)];
180 | var val = (r + 1) * fv;
181 | for (var j = 0; j < r; j++)
182 | val += source[ti + j * w];
183 | for (var j = 0; j <= r; j++)
184 | {
185 | val += source[ri] - fv;
186 | dest[ti] = (int)Math.Round(val * iar);
187 | ri += w;
188 | ti += w;
189 | }
190 | for (int j = r + 1, k = h - r; j < k; j++)
191 | {
192 | val += source[ri] - source[li];
193 | dest[ti] = (int)Math.Round(val * iar);
194 | li += w;
195 | ri += w;
196 | ti += w;
197 | }
198 | for (var j = h - r; j < h; j++)
199 | {
200 | val += lv - source[li];
201 | dest[ti] = (int)Math.Round(val * iar);
202 | li += w;
203 | ti += w;
204 | }
205 | });
206 | }
207 | }
208 | }
--------------------------------------------------------------------------------
/KeePassRDP/Generator/KprRdpFileForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 128, 17
122 |
123 |
124 | 250, 17
125 |
126 |
127 | 352, 17
128 |
129 |
--------------------------------------------------------------------------------
/KeePassRDP/Generator/RdpSettingAttribute.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using System;
22 |
23 | namespace KeePassRDP.Generator
24 | {
25 | [AttributeUsage(AttributeTargets.Property)]
26 | public class RdpSettingAttribute : Attribute
27 | {
28 | public string Template { get; private set; }
29 | public SettingCategory Category { get; set; }
30 |
31 | public RdpSettingAttribute(string template)
32 | {
33 | Template = template;
34 | Category = SettingCategory.General;
35 | }
36 |
37 | public enum SettingCategory
38 | {
39 | General = 0,
40 | Authentication,
41 | Network,
42 | Display,
43 | Redirect,
44 | AudioVideo,
45 | RemoteApp
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/KeePassRDP/Generator/RdpSignscopeAttribute.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using System;
22 |
23 | namespace KeePassRDP.Generator
24 | {
25 | [AttributeUsage(AttributeTargets.Property)]
26 | public class RdpSignscopeAttribute : Attribute
27 | {
28 | public string Scope { get; private set; }
29 |
30 | public RdpSignscopeAttribute(string scope)
31 | {
32 | Scope = scope;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/KeePassRDP/KeePassRDPexe.tt:
--------------------------------------------------------------------------------
1 | <#@ template compilerOptions="optimize+" hostspecific="true" language="C#" #>
2 | <#@ output extension=".SED" encoding="us-ascii" #>
3 | <#@ assembly name="EnvDTE" #>
4 | <#@ import namespace="Microsoft.VisualStudio.TextTemplating" #>
5 | <#@ import namespace="System.IO" #>
6 | <#@ import namespace="System.Text" #>
7 | <#@ import namespace="System.Text.RegularExpressions" #>
8 | <#
9 | var directory = Path.GetDirectoryName(Host.TemplateFile);
10 | var className = Path.GetFileNameWithoutExtension(Host.TemplateFile);
11 | var namespaceString = Path.GetFileNameWithoutExtension(directory);
12 | var parent = Directory.GetParent(directory).FullName;
13 |
14 | var buildDate = DateTime.UtcNow;
15 | var informationalVersion = string.Empty;
16 | var assemblyVersion = string.Empty;
17 | var copyright = string.Empty;
18 |
19 | var assemblyInfo = File.ReadAllText(Path.Combine(directory, @"Properties\AssemblyInfo.cs"));
20 | var match = Regex.Match(assemblyInfo, "\\[assembly: AssemblyInformationalVersion\\(\"([^\"]+)\"\\)\\]");
21 | if (match.Success)
22 | informationalVersion = match.Groups[1].Value;
23 |
24 | match = Regex.Match(assemblyInfo, "\\[assembly: AssemblyVersion\\(\"([^\"]+)\"\\)\\]");
25 | if (match.Success)
26 | {
27 | assemblyVersion = match.Groups[1].Value;
28 | if (string.IsNullOrEmpty(informationalVersion))
29 | informationalVersion = assemblyVersion;
30 | }
31 |
32 | /*
33 | // Build time.
34 | var configName = Host.ResolveParameterValue("-", "-", "Configuration");
35 | if (string.IsNullOrWhiteSpace(configName))
36 | {
37 | try
38 | {
39 | // Design time.
40 | var serviceProvider = (IServiceProvider)Host;
41 | var dte = (EnvDTE.DTE)serviceProvider.GetService(typeof(EnvDTE.DTE));
42 | configName = dte.Solution.SolutionBuild.ActiveConfiguration.Name;
43 | }
44 | catch (Exception ex)
45 | {
46 | configName = ex.Message;
47 | }
48 | }
49 |
50 | if (configName == "Debug")
51 | informationalVersion = informationalVersion + ".debug";
52 | */
53 |
54 | var configName = "Release";
55 | var sourceFiles = Path.Combine(directory, "bin", configName);
56 | #>
57 | [Version]
58 | Class=IEXPRESS
59 | SEDVersion=3
60 | [Options]
61 | PackagePurpose=ExtractOnly
62 | ShowInstallProgramWindow=0
63 | HideExtractAnimation=0
64 | UseLongFileName=1
65 | InsideCompressed=0
66 | CAB_FixedSize=0
67 | CAB_ResvCodeSigning=0
68 | RebootMode=N
69 | InstallPrompt=%InstallPrompt%
70 | DisplayLicense=%DisplayLicense%
71 | FinishMessage=%FinishMessage%
72 | TargetName=%TargetName%
73 | FriendlyName=%FriendlyName%
74 | AppLaunched=%AppLaunched%
75 | PostInstallCmd=%PostInstallCmd%
76 | AdminQuietInstCmd=%AdminQuietInstCmd%
77 | UserQuietInstCmd=%UserQuietInstCmd%
78 | SourceFiles=SourceFiles
79 | VersionInfo=VersionInfo
80 | [Strings]
81 | InstallPrompt=
82 | DisplayLicense=<#= parent #>\COPYING
83 | FinishMessage=
84 | TargetName=<#= parent #>\KeePassRDP_v<#= informationalVersion #>.exe
85 | FriendlyName=KeePassRDP v<#= informationalVersion #>
86 | AppLaunched=
87 | PostInstallCmd=
88 | AdminQuietInstCmd=
89 | UserQuietInstCmd=
90 | FILE0="KeePassRDP.plgx"
91 | [SourceFiles]
92 | SourceFiles0=<#= sourceFiles #>\
93 | [SourceFiles0]
94 | %FILE0%=
95 | [VersionInfo]
96 | FromFile=<#= sourceFiles #>\KeePassRDP.dll
--------------------------------------------------------------------------------
/KeePassRDP/KprCredential.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using KeePass.Resources;
22 | using KeePass.UI;
23 | using KeePassLib.Security;
24 | using KeePassRDP.Utils;
25 | using System;
26 | using System.Collections.Generic;
27 | using System.ComponentModel;
28 | using System.Security;
29 |
30 | namespace KeePassRDP
31 | {
32 | ///
33 | /// Extends for consumption by
34 | ///
35 | internal sealed class KprCredential : NativeCredentials.Credential, IKprCredential
36 | {
37 | public const string CredentialComment = Util.KeePassRDP;
38 |
39 | public Guid GUID { get { return _guid; } }
40 | //public DateTimeOffset ValidUntil { get { return _validUntil; } }
41 | public bool IsValid { get { return _validUntil + _increase >= DateTimeOffset.UtcNow; } }
42 |
43 | private readonly Guid _guid;
44 | private readonly TimeSpan _ttl;
45 | private TimeSpan _increase;
46 | private DateTimeOffset _validUntil;
47 |
48 | internal KprCredential(ProtectedString username, SecureString password, string targetName, NativeCredentials.CRED_TYPE type, int ttl = 0) : base()
49 | {
50 | if (string.IsNullOrEmpty(targetName))
51 | throw new ArgumentNullException("targetName");
52 |
53 | _guid = Guid.NewGuid();
54 | _ttl = ttl > 0 ? TimeSpan.FromSeconds(ttl) : TimeSpan.Zero;
55 | _increase = TimeSpan.Zero;
56 | _validUntil = _ttl.TotalMilliseconds > 0 ? DateTimeOffset.UtcNow + _ttl : DateTimeOffset.MaxValue;
57 |
58 | var usernameString = string.Empty;
59 | if (!username.IsEmpty)
60 | {
61 | var usernameChars = username.ReadChars();
62 | usernameString = new string(usernameChars);
63 | MemoryUtil.SecureZeroMemory(usernameChars);
64 | }
65 |
66 | Type = type;
67 | TargetName = targetName;
68 | UserName = usernameString;
69 | //CredentialBlob = password.IsEmpty ? string.Empty : new string(password.ReadChars());
70 | CredentialBlob = password.Copy();
71 | Persist = NativeCredentials.CRED_PERSIST.SESSION;
72 | Attributes = new Dictionary
73 | {
74 | { "ValidUntil", _validUntil }
75 | };
76 | Comment = CredentialComment;
77 | }
78 |
79 | internal KprCredential(NativeCredentials.Credential credential) : base()
80 | {
81 | _guid = Guid.NewGuid();
82 | _ttl = TimeSpan.Zero;
83 | _increase = TimeSpan.Zero;
84 | if (credential.Attributes.ContainsKey("ValidUntil"))
85 | _validUntil = (DateTimeOffset)credential.Attributes["ValidUntil"];
86 |
87 | Flags = credential.Flags;
88 | Type = credential.Type;
89 | TargetName = credential.TargetName;
90 | UserName = credential.UserName;
91 | CredentialBlob = credential.CredentialBlob != null && credential.CredentialBlob.Length > 0 ? credential.CredentialBlob.Copy() : null;
92 | Persist = credential.Persist;
93 | Attributes = credential.Attributes;
94 | Comment = credential.Comment;
95 | }
96 |
97 | public void IncreaseTTL(TimeSpan ttl)
98 | {
99 | if (ttl == TimeSpan.MaxValue)
100 | {
101 | _increase = TimeSpan.Zero;
102 | _validUntil = DateTimeOffset.MaxValue;
103 |
104 | return;
105 | }
106 |
107 | if (ttl.TotalMilliseconds > 0)
108 | _increase += ttl;
109 | }
110 |
111 | public void IncreaseTTL(int seconds)
112 | {
113 | if (seconds > 0)
114 | IncreaseTTL(TimeSpan.FromSeconds(seconds));
115 | }
116 |
117 | public void DecreaseTTL(TimeSpan ttl)
118 | {
119 | if (ttl == TimeSpan.MaxValue)
120 | {
121 | _increase = TimeSpan.Zero;
122 | _validUntil = DateTimeOffset.MinValue;
123 |
124 | return;
125 | }
126 |
127 | if (ttl.TotalMilliseconds > 0)
128 | _increase -= ttl;
129 | }
130 |
131 | public void DecreaseTTL(int seconds)
132 | {
133 | if (seconds > 0)
134 | DecreaseTTL(TimeSpan.FromSeconds(seconds));
135 | }
136 |
137 | public void ResetTTL()
138 | {
139 | _increase = TimeSpan.Zero;
140 | }
141 |
142 | public void ResetValidUntil()
143 | {
144 | _validUntil = _ttl.TotalMilliseconds > 0 ? DateTimeOffset.UtcNow + _ttl : DateTimeOffset.MaxValue;
145 | ResetTTL();
146 | }
147 |
148 | ///
149 | /// Writes to Windows vault.
150 | ///
151 | /// Force overwriting of existing credentials.
152 | public void Write(bool force = false)
153 | {
154 | NativeCredentials.Credential cred = null;
155 |
156 | try
157 | {
158 | if (force ||
159 | !NativeCredentials.CredRead(TargetName, Type, out cred) ||
160 | cred == null ||
161 | (cred.Persist == Persist &&
162 | cred.Comment == Comment &&
163 | (DateTimeOffset)cred.Attributes["ValidUntil"] < _validUntil))
164 | NativeCredentials.CredWrite(this);
165 | }
166 | catch (Win32Exception ex)
167 | {
168 | VistaTaskDialog.ShowMessageBoxEx(
169 | string.Format(KprResourceManager.Instance["Failed to store credentials in vault: {0}"], ex.Message),
170 | null,
171 | Util.KeePassRDP + " - " + KPRes.Warning,
172 | VtdIcon.Warning,
173 | null, null, 0, null, 0);
174 | }
175 | finally
176 | {
177 | if (cred != null)
178 | cred.ZeroMemory();
179 | }
180 | }
181 |
182 | public void Dispose()
183 | {
184 | NativeCredentials.Credential cred = null;
185 |
186 | try
187 | {
188 | if (NativeCredentials.CredRead(TargetName, Type, out cred) &&
189 | cred != null &&
190 | cred.Persist == Persist &&
191 | cred.Comment == Comment &&
192 | (DateTimeOffset)cred.Attributes["ValidUntil"] == _validUntil)
193 | NativeCredentials.CredDelete(TargetName, Type);
194 | }
195 | catch (Win32Exception) { }
196 |
197 | if (cred != null)
198 | cred.ZeroMemory();
199 |
200 | ZeroMemory();
201 |
202 | if (CredentialBlob != null)
203 | CredentialBlob.Dispose();
204 |
205 | _validUntil = DateTimeOffset.MinValue;
206 | ResetTTL();
207 | }
208 | }
209 |
210 | public interface IKprCredential : IDisposable
211 | {
212 | Guid GUID { get; }
213 | bool IsValid { get; }
214 | void Write(bool force = false);
215 | void ZeroMemory();
216 | }
217 | }
--------------------------------------------------------------------------------
/KeePassRDP/KprCredentialManager.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using KeePass.Resources;
22 | using KeePass.UI;
23 | using KeePassRDP.Utils;
24 | using System;
25 | using System.Collections;
26 | using System.Collections.Generic;
27 | using System.ComponentModel;
28 | using System.Linq;
29 | using System.Timers;
30 |
31 | namespace KeePassRDP
32 | {
33 | ///
34 | /// Manager for adding and removing from Windows vault.
35 | ///
36 | ///
37 | /// Type of managed credentials. Needs to implement .
38 | ///
39 | internal class KprCredentialManager : IList where T : IKprCredential
40 | {
41 | private const int _interval = 1000;
42 |
43 | private enum Action : byte
44 | {
45 | Add,
46 | Remove
47 | }
48 |
49 | ///
50 | /// Interval in milliseconds to check for and remove invalid credentials.
51 | ///
52 | public double Interval
53 | {
54 | get { return _timer.Interval; }
55 | set { _timer.Interval = value; }
56 | }
57 |
58 | ///
59 | /// Switch to enable/disable checking for invalid credentials.
60 | ///
61 | public bool Enabled
62 | {
63 | get { return _timer.Enabled; }
64 | set { _timer.Enabled = value; }
65 | }
66 |
67 | ///
68 | public int Count
69 | {
70 | get { return _credentials.Count; }
71 | }
72 |
73 | ///
74 | public bool IsReadOnly
75 | {
76 | get { return false; }
77 | }
78 |
79 | ///
80 | public T this[int index]
81 | {
82 | get
83 | {
84 | return _credentials[index];
85 | }
86 |
87 | set
88 | {
89 | throw new NotImplementedException();
90 | }
91 | }
92 |
93 | private readonly List _credentials;
94 | private readonly Timer _timer;
95 | private readonly KprConfig _config;
96 |
97 | public KprCredentialManager(KprConfig config) : this(null, config)
98 | {
99 | }
100 |
101 | public KprCredentialManager(IEnumerable credentials, KprConfig config)
102 | {
103 | _config = config;
104 | _credentials = credentials == null ? new List() : new List(credentials);
105 | _timer = new Timer(_interval);
106 | _timer.Elapsed += OnTimer_Elapsed;
107 |
108 | if (!NativeCredentials.CredCanPersist(_config.CredVaultUseWindows ? NativeCredentials.CRED_TYPE.DOMAIN_PASSWORD : NativeCredentials.CRED_TYPE.GENERIC))
109 | VistaTaskDialog.ShowMessageBoxEx(
110 | KprResourceManager.Instance["Unable to persist credentials in Windows vault."],
111 | null,
112 | string.Format("{0} - {1}", Util.KeePassRDP, KPRes.Error),
113 | VtdIcon.Error,
114 | null, null, 0, null, 0);
115 |
116 | try
117 | {
118 | NativeCredentials.Credential[] ncredentials;
119 | if (NativeCredentials.CredEnumerate(null, out ncredentials) && ncredentials.Length > 0)
120 | {
121 | _credentials.AddRange(ncredentials.Where(cred => cred.Comment == KprCredential.CredentialComment).Select(cred => new KprCredential(cred)).Cast());
122 | foreach (var ncred in ncredentials.Where(cred => cred.Comment != KprCredential.CredentialComment))
123 | ncred.ZeroMemory();
124 | }
125 | }
126 | catch (Win32Exception) { } // Do not fail when vault is empty.
127 |
128 | if (_credentials.Count > 0)
129 | ManageTimer(Action.Add);
130 | }
131 |
132 | ///
133 | public void Add(T credential)
134 | {
135 | credential.Write(_config.CredVaultOverwriteExisting);
136 | credential.ZeroMemory();
137 |
138 | _credentials.Add(credential);
139 |
140 | ManageTimer(Action.Add);
141 | }
142 |
143 | ///
144 | public void Insert(int index, T credential)
145 | {
146 | credential.Write(_config.CredVaultOverwriteExisting);
147 | credential.ZeroMemory();
148 |
149 | _credentials.Insert(index, credential);
150 |
151 | ManageTimer(Action.Add);
152 | }
153 |
154 | ///
155 | public void AddRange(IEnumerable credentials)
156 | {
157 | if (!credentials.Any())
158 | return;
159 |
160 | foreach (var credential in credentials)
161 | {
162 | credential.Write(_config.CredVaultOverwriteExisting);
163 | credential.ZeroMemory();
164 | _credentials.Add(credential);
165 | }
166 |
167 | ManageTimer(Action.Add);
168 | }
169 |
170 | ///
171 | public bool Remove(Guid credentialGuid)
172 | {
173 | var result = false;
174 |
175 | foreach (var credential in _credentials.FindAll(x => x.GUID == credentialGuid))
176 | using (credential)
177 | if (_credentials.Remove(credential))
178 | result = true;
179 |
180 | if (result)
181 | ManageTimer(Action.Remove);
182 |
183 | return result;
184 | }
185 |
186 | ///
187 | public bool Remove(T credential)
188 | {
189 | using (credential)
190 | if (_credentials.Remove(credential))
191 | {
192 | ManageTimer(Action.Remove);
193 | return true;
194 | }
195 |
196 | return false;
197 | }
198 |
199 | ///
200 | public int RemoveAll(Predicate match)
201 | {
202 | var count = 0;
203 |
204 | foreach (var credential in _credentials.FindAll(match))
205 | {
206 | using (credential)
207 | if (_credentials.Remove(credential))
208 | count++;
209 | }
210 |
211 | if (count > 0)
212 | ManageTimer(Action.Remove);
213 |
214 | return count;
215 | }
216 |
217 | ///
218 | public void RemoveAt(int index)
219 | {
220 | using (_credentials[index])
221 | _credentials.RemoveAt(index);
222 |
223 | ManageTimer(Action.Remove);
224 | }
225 |
226 | ///
227 | public void Clear()
228 | {
229 | foreach (var credential in _credentials)
230 | credential.Dispose();
231 |
232 | _credentials.Clear();
233 |
234 | ManageTimer(Action.Remove);
235 | }
236 |
237 | ///
238 | public int IndexOf(T item)
239 | {
240 | return _credentials.IndexOf(item);
241 | }
242 |
243 | ///
244 | public bool Contains(T item)
245 | {
246 | return _credentials.Contains(item);
247 | }
248 |
249 | ///
250 | public List FindAll(Predicate match)
251 | {
252 | return _credentials.FindAll(match);
253 | }
254 |
255 | ///
256 | public void CopyTo(T[] array, int arrayIndex)
257 | {
258 | _credentials.CopyTo(array, arrayIndex);
259 | }
260 |
261 | ///
262 | public IEnumerator GetEnumerator()
263 | {
264 | return _credentials.GetEnumerator();
265 | }
266 |
267 | ///
268 | IEnumerator IEnumerable.GetEnumerator()
269 | {
270 | return GetEnumerator();
271 | }
272 |
273 | private void OnTimer_Elapsed(object sender, ElapsedEventArgs e)
274 | {
275 | RemoveAll(x => !x.IsValid);
276 | }
277 |
278 | private void ManageTimer(Action action)
279 | {
280 | Enabled = action == Action.Add || Count > 0;
281 | }
282 | }
283 | }
--------------------------------------------------------------------------------
/KeePassRDP/KprCredentialPickerForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 412, 17
122 |
123 |
124 | 128, 17
125 |
126 |
127 | 250, 17
128 |
129 |
--------------------------------------------------------------------------------
/KeePassRDP/KprEntrySettings.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using KeePassRDP.Extensions;
22 | using KeePassRDP.Generator;
23 | using KeePassRDP.Utils;
24 | using Newtonsoft.Json;
25 | using System;
26 | using System.Collections.Generic;
27 | using System.ComponentModel;
28 | using System.Text.RegularExpressions;
29 | using System.Windows.Forms;
30 |
31 | namespace KeePassRDP
32 | {
33 | ///
34 | /// KeePassRDP settings for a single .
35 | ///
36 | public class KprEntrySettings : IDisposable
37 | {
38 | public static readonly KprEntrySettings Empty = new KprEntrySettings(true);
39 |
40 | public enum Inheritance
41 | {
42 | // Hide all settings from children
43 | Hide = CheckState.Unchecked,
44 | // Force all settings on children
45 | Force = CheckState.Checked,
46 | // Allow inheritance from parent settings
47 | Default = CheckState.Indeterminate
48 | }
49 |
50 | [JsonIgnore]
51 | public bool IsReadOnly { get { return _isReadOnly; } }
52 |
53 | [DefaultValue(false)]
54 | public bool Ignore { get { return _ignore; } set { if (_isReadOnly) throw new InvalidOperationException(); _ignore = value; } }
55 |
56 | [DefaultValue(true)]
57 | public bool UseCredpicker { get { return _useCredpicker; } set { if (_isReadOnly) throw new InvalidOperationException(); _useCredpicker = value; } }
58 |
59 | [DefaultValue(null)]
60 | public RdpFile RdpFile { get { return _rdpFile; } set { if (_isReadOnly) throw new InvalidOperationException(); _rdpFile = value; } }
61 | public bool ShouldSerializeRdpFile() { return _rdpFile != null && !_rdpFile.IsEmpty; }
62 |
63 | [DefaultValue(true)]
64 | public bool CpRecurseGroups { get { return _cpRecurseGroups; } set { if (_isReadOnly) throw new InvalidOperationException(); _cpRecurseGroups = value; } }
65 |
66 | [DefaultValue(true)]
67 | public bool CpIncludeDefaultRegex { get { return _cpIncludeDefaultRegex; } set { if (_isReadOnly) throw new InvalidOperationException(); _cpIncludeDefaultRegex = value; } }
68 |
69 | [DefaultValue(true)]
70 | public bool IncludeDefaultParameters { get { return _includeDefaultParameters; } set { if (_isReadOnly) throw new InvalidOperationException(); _includeDefaultParameters = value; } }
71 |
72 | [DefaultValue(false)]
73 | public bool ForceLocalUser { get { return _forceLocalUser; } set { if (_isReadOnly) throw new InvalidOperationException(); _forceLocalUser = value; } }
74 |
75 | [DefaultValue(false)]
76 | public bool ForceUpn { get { return _forceUpn; } set { if (_isReadOnly) throw new InvalidOperationException(); _forceUpn = value; } }
77 |
78 | [DefaultValue(false)]
79 | public bool RetryOnce { get { return _retryOnce; } set { if (_isReadOnly) throw new InvalidOperationException(); _retryOnce = value; } }
80 |
81 | [DefaultValue(Inheritance.Default)]
82 | public Inheritance Inherit { get { return _inherit; } set { if (_isReadOnly) throw new InvalidOperationException(); _inherit = value; } }
83 |
84 | public ICollection CpGroupUUIDs
85 | {
86 | get { return _isReadOnly && !_cpGroupUUIDs.IsReadOnly ? _cpGroupUUIDs.AsReadOnly() : _cpGroupUUIDs; }
87 | set { if (_isReadOnly) throw new InvalidOperationException(); _cpGroupUUIDs = new HashSet(value, StringComparer.OrdinalIgnoreCase); }
88 | }
89 |
90 | public ICollection CpExcludedGroupUUIDs
91 | {
92 | get { return _isReadOnly && !_cpExcludedGroupUUIDs.IsReadOnly ? _cpExcludedGroupUUIDs.AsReadOnly() : _cpExcludedGroupUUIDs; }
93 | set { if (_isReadOnly) throw new InvalidOperationException(); _cpGroupUUIDs = new HashSet(value, StringComparer.OrdinalIgnoreCase); }
94 | }
95 |
96 | public ICollection CpRegExPatterns
97 | {
98 | get { return _isReadOnly && !_cpRegExPatterns.IsReadOnly ? _cpRegExPatterns.AsReadOnly() : _cpRegExPatterns; }
99 | set { if (_isReadOnly) throw new InvalidOperationException(); _cpRegExPatterns = new List(value); }
100 | }
101 |
102 | public ICollection MstscParameters
103 | {
104 | get { return _isReadOnly && !_mstscParameters.IsReadOnly ? _mstscParameters.AsReadOnly() : _mstscParameters; }
105 | set { if (_isReadOnly) throw new InvalidOperationException(); _mstscParameters = new List(value); }
106 | }
107 |
108 | public bool ShouldSerializeCpGroupUUIDs() { return _cpGroupUUIDs != null && _cpGroupUUIDs.Count > 0; }
109 | public bool ShouldSerializeCpExcludedGroupUUIDs() { return _cpExcludedGroupUUIDs != null && _cpExcludedGroupUUIDs.Count > 0; }
110 | public bool ShouldSerializeCpRegExPatterns() { return _cpRegExPatterns != null && _cpRegExPatterns.Count > 0; }
111 | public bool ShouldSerializeMstscParameters() { return _mstscParameters != null && _mstscParameters.Count > 0; }
112 |
113 | private ISet _cpGroupUUIDs;
114 | private ISet _cpExcludedGroupUUIDs;
115 | private IList _cpRegExPatterns;
116 | private IList _mstscParameters;
117 |
118 | private bool _isReadOnly;
119 | private bool _ignore;
120 | private bool _useCredpicker;
121 | private RdpFile _rdpFile;
122 | private bool _cpRecurseGroups;
123 | private bool _cpIncludeDefaultRegex;
124 | private bool _includeDefaultParameters;
125 | private bool _forceLocalUser;
126 | private bool _forceUpn;
127 | private bool _retryOnce;
128 | private Inheritance _inherit;
129 |
130 | public KprEntrySettings()
131 | {
132 | _isReadOnly = false;
133 | _cpGroupUUIDs = new HashSet(StringComparer.OrdinalIgnoreCase);
134 | _cpExcludedGroupUUIDs = new HashSet(StringComparer.OrdinalIgnoreCase);
135 | _cpRegExPatterns = new List();
136 | _mstscParameters = new List();
137 | _ignore = false;
138 | _useCredpicker = true;
139 | _rdpFile = null;
140 | _cpRecurseGroups = true;
141 | _cpIncludeDefaultRegex = true;
142 | _includeDefaultParameters = true;
143 | _forceLocalUser = false;
144 | _forceUpn = false;
145 | _retryOnce = false;
146 | _inherit = Inheritance.Default;
147 | }
148 |
149 | private KprEntrySettings(bool readOnly) : this()
150 | {
151 | if (readOnly)
152 | {
153 | _isReadOnly = true;
154 | _cpGroupUUIDs = _cpGroupUUIDs.AsReadOnly();
155 | _cpExcludedGroupUUIDs = _cpExcludedGroupUUIDs.AsReadOnly();
156 | _cpRegExPatterns = _cpRegExPatterns.AsReadOnly();
157 | _mstscParameters = _mstscParameters.AsReadOnly();
158 | }
159 | }
160 |
161 | internal KprEntrySettings(KprEntrySettings kprEntrySettings, bool readOnly = false)
162 | {
163 | _isReadOnly = readOnly;
164 | _cpGroupUUIDs = new HashSet(kprEntrySettings._cpGroupUUIDs, StringComparer.OrdinalIgnoreCase);
165 | _cpExcludedGroupUUIDs = new HashSet(kprEntrySettings._cpExcludedGroupUUIDs, StringComparer.OrdinalIgnoreCase);
166 | _cpRegExPatterns = new List(kprEntrySettings._cpRegExPatterns);
167 | _mstscParameters = new List(kprEntrySettings._mstscParameters);
168 | if (readOnly)
169 | {
170 | _cpGroupUUIDs = _cpGroupUUIDs.AsReadOnly();
171 | _cpExcludedGroupUUIDs = _cpExcludedGroupUUIDs.AsReadOnly();
172 | _cpRegExPatterns = _cpRegExPatterns.AsReadOnly();
173 | _mstscParameters = _mstscParameters.AsReadOnly();
174 | }
175 | _ignore = kprEntrySettings._ignore;
176 | _useCredpicker = kprEntrySettings._useCredpicker;
177 | _rdpFile = kprEntrySettings._rdpFile;
178 | _cpRecurseGroups = kprEntrySettings._cpRecurseGroups;
179 | _cpIncludeDefaultRegex = kprEntrySettings._cpIncludeDefaultRegex;
180 | _includeDefaultParameters = kprEntrySettings._includeDefaultParameters;
181 | _forceLocalUser = kprEntrySettings._forceLocalUser;
182 | _forceUpn = kprEntrySettings._forceUpn;
183 | _retryOnce = kprEntrySettings._retryOnce;
184 | _inherit = kprEntrySettings._inherit;
185 | }
186 |
187 | public KprEntrySettings AsReadOnly()
188 | {
189 | if (_isReadOnly)
190 | return this;
191 | return new KprEntrySettings(this, true);
192 | }
193 |
194 | public void Clear()
195 | {
196 | if (!_cpGroupUUIDs.IsReadOnly)
197 | _cpGroupUUIDs.Clear();
198 | if (!_cpExcludedGroupUUIDs.IsReadOnly)
199 | _cpExcludedGroupUUIDs.Clear();
200 | if (!_cpRegExPatterns.IsReadOnly)
201 | _cpRegExPatterns.Clear();
202 | if (!_mstscParameters.IsReadOnly)
203 | _mstscParameters.Clear();
204 | }
205 |
206 | public void Dispose()
207 | {
208 | Clear();
209 | if (_rdpFile != null)
210 | _rdpFile.Dispose();
211 | }
212 |
213 | public override string ToString()
214 | {
215 | if (_rdpFile != null && _rdpFile.IsEmpty)
216 | {
217 | using (_rdpFile)
218 | _rdpFile = null;
219 | }
220 |
221 | return Regex.Replace(
222 | JsonConvert.SerializeObject(this, Util.JsonSerializerSettings),
223 | "^{}$",
224 | string.Empty,
225 | RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
226 | }
227 |
228 | public static implicit operator string(KprEntrySettings kprEntrySettings)
229 | {
230 | return kprEntrySettings.ToString();
231 | }
232 | }
233 | }
--------------------------------------------------------------------------------
/KeePassRDP/KprEntrySettingsTab.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
124 | False
125 |
126 |
127 | 250, 17
128 |
129 |
130 | 128, 17
131 |
132 |
133 | False
134 |
135 |
136 | False
137 |
138 |
139 | False
140 |
141 |
142 | 352, 17
143 |
144 |
145 | 479, 17
146 |
147 |
--------------------------------------------------------------------------------
/KeePassRDP/KprMenu.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 - 2025 iSnackyCracky, NETertainer
3 | *
4 | * This file is part of KeePassRDP.
5 | *
6 | * KeePassRDP is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * KeePassRDP is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with KeePassRDP. If not, see .
18 | *
19 | */
20 |
21 | using System;
22 | using System.Collections.ObjectModel;
23 | using System.Linq;
24 | using System.Windows.Forms;
25 |
26 | namespace KeePassRDP
27 | {
28 | public static class KprMenu
29 | {
30 | #region Constants
31 | public const Keys DefaultOpenRdpConnectionShortcut = Keys.Control | Keys.M; //131149;
32 | public const Keys DefaultOpenRdpConnectionAdminShortcut = Keys.Control | Keys.Shift | Keys.M; //393293;
33 |
34 | public const MenuItem DefaultToolbarItems = MenuItem.OpenRdpConnection | MenuItem.OpenRdpConnectionNoCred;
35 | //public const MenuItem DefaultContextMenuItems = DefaultToolbarItems | MenuItem.OpenRdpConnectionAdmin | MenuItem.OpenRdpConnectionNoCredAdmin | MenuItem.IgnoreCredentials;
36 | public const MenuItem DefaultContextMenuItems = DefaultToolbarItems | MenuItem.ShadowSession | MenuItem.IgnoreCredentials;
37 | #endregion
38 |
39 | internal static readonly ReadOnlyCollection