commit b3dbf35d5164d1c874ac90cc4d98320df6e83efd Author: Harald Wolff-Thobaben Date: Fri Sep 24 22:49:31 2021 +0200 Initial Commit from codeplex archive diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f05287e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.[oa] +*~ diff --git a/.idea/.idea.RDPAddins/.idea/.gitignore b/.idea/.idea.RDPAddins/.idea/.gitignore new file mode 100644 index 0000000..f9895ae --- /dev/null +++ b/.idea/.idea.RDPAddins/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/contentModel.xml +/projectSettingsUpdater.xml +/modules.xml +/.idea.RDPAddins.iml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/.idea.RDPAddins/.idea/encodings.xml b/.idea/.idea.RDPAddins/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.RDPAddins/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.RDPAddins/.idea/indexLayout.xml b/.idea/.idea.RDPAddins/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.RDPAddins/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.RDPAddins/.idea/vcs.xml b/.idea/.idea.RDPAddins/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.RDPAddins/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BuildProcessTemplates/DefaultTemplate.11.1.xaml b/BuildProcessTemplates/DefaultTemplate.11.1.xaml new file mode 100644 index 0000000..bf54edf --- /dev/null +++ b/BuildProcessTemplates/DefaultTemplate.11.1.xaml @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings()] + [False] + [New Microsoft.TeamFoundation.Build.Workflow.Activities.TestSpecList(New Microsoft.TeamFoundation.Build.Workflow.Activities.AgileTestPlatformSpec("**\*test*.dll"))] + ["$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)"] + [False] + [True] + [True] + [Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.All] + + + + [Microsoft.TeamFoundation.Build.Workflow.Activities.CodeAnalysisOption.AsConfigured] + [True] + [Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto] + [True] + [New Microsoft.TeamFoundation.Build.Workflow.Activities.SourceAndSymbolServerSettings(True, Nothing)] + [True] + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }] + [Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal] + + + + + + + All + 11.0 + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BuildProcessTemplates/LabDefaultTemplate.11.xaml b/BuildProcessTemplates/LabDefaultTemplate.11.xaml new file mode 100644 index 0000000..9e1fb0b --- /dev/null +++ b/BuildProcessTemplates/LabDefaultTemplate.11.xaml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + 11.0 + + + + + + 920,3702 + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + True + + + + + + + [LabWorkflowParameters.BuildDetails.BuildUri] + + + [ChildBuildDetail.Uri] + + + + + + + + + + + + [BuildLocation] + + + [If(LabWorkflowParameters.BuildDetails.Configuration Is Nothing, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsEmpty Or (SelectedBuildDetail.Information.GetNodesByType(Microsoft.TeamFoundation.Build.Common.InformationTypes.ConfigurationSummary, True)).Count = 1, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsPlatformEmptyOrAnyCpu, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Platform + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration)))] + + + + + + + + + + + + [LabEnvironmentUri] + + + [LabWorkflowParameters.EnvironmentDetails.LabEnvironmentUri.ToString()] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [PostDeploymentSnapshotName] + + + [If(LabWorkflowParameters.BuildDetails.IsTeamSystemBuild = True,String.Format("{0}_{1}_{2}", LabWorkflowParameters.DeploymentDetails.PostDeploymentSnapshotName, BuildNumber,BuildDetail.BuildNumber),String.Format("{0}_{1}", LabWorkflowParameters.DeploymentDetails.PostDeploymentSnapshotName, BuildDetail.BuildNumber))] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [BuildStatus] + + + [Microsoft.TeamFoundation.Build.Client.BuildStatus.PartiallySucceeded] + + + + + + + [BuildStatus] + + + [Microsoft.TeamFoundation.Build.Client.BuildStatus.Failed] + + + + + + + + + + + + \ No newline at end of file diff --git a/BuildProcessTemplates/UpgradeTemplate.xaml b/BuildProcessTemplates/UpgradeTemplate.xaml new file mode 100644 index 0000000..b3ee07f --- /dev/null +++ b/BuildProcessTemplates/UpgradeTemplate.xaml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }] + + + + [Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto] + [False] + [False] + + + + + + + + + + [Microsoft.TeamFoundation.VersionControl.Client.RecursionType.OneLevel] + [Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal] + + + + All + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FileTransfer/FileTransferAddin/FileTransferAddin.Designer.cs b/FileTransfer/FileTransferAddin/FileTransferAddin.Designer.cs new file mode 100644 index 0000000..b289614 --- /dev/null +++ b/FileTransfer/FileTransferAddin/FileTransferAddin.Designer.cs @@ -0,0 +1,163 @@ +namespace FileTransfer +{ + partial class FileTransferAddin + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FileTransferAddin)); + this.lvMain = new System.Windows.Forms.ListView(); + this.chTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chFile = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.mnuLVContext = new System.Windows.Forms.ContextMenu(); + this.mnuLVCOpen = new System.Windows.Forms.MenuItem(); + this.mnuLVCSaveAs = new System.Windows.Forms.MenuItem(); + this.ilMain = new System.Windows.Forms.ImageList(this.components); + this.mnuHolder = new System.Windows.Forms.ContextMenu(); + this.mnuHSend = new System.Windows.Forms.MenuItem(); + this.pbMain = new System.Windows.Forms.ProgressBar(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); + this.btSend = new System.Windows.Forms.Button(); + this.mnuHAuto = new System.Windows.Forms.MenuItem(); + this.SuspendLayout(); + // + // lvMain + // + this.lvMain.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chTime, + this.chFile}); + this.lvMain.ContextMenu = this.mnuLVContext; + resources.ApplyResources(this.lvMain, "lvMain"); + this.lvMain.FullRowSelect = true; + this.lvMain.Name = "lvMain"; + this.lvMain.SmallImageList = this.ilMain; + this.lvMain.UseCompatibleStateImageBehavior = false; + this.lvMain.View = System.Windows.Forms.View.Details; + this.lvMain.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvMain_MouseDoubleClick); + // + // chTime + // + resources.ApplyResources(this.chTime, "chTime"); + // + // chFile + // + resources.ApplyResources(this.chFile, "chFile"); + // + // mnuLVContext + // + this.mnuLVContext.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.mnuLVCOpen, + this.mnuLVCSaveAs}); + // + // mnuLVCOpen + // + this.mnuLVCOpen.Index = 0; + resources.ApplyResources(this.mnuLVCOpen, "mnuLVCOpen"); + this.mnuLVCOpen.Click += new System.EventHandler(this.mnuLVCOpen_Click); + // + // mnuLVCSaveAs + // + this.mnuLVCSaveAs.Index = 1; + resources.ApplyResources(this.mnuLVCSaveAs, "mnuLVCSaveAs"); + this.mnuLVCSaveAs.Click += new System.EventHandler(this.mnuLVCSaveAs_Click); + // + // ilMain + // + this.ilMain.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; + resources.ApplyResources(this.ilMain, "ilMain"); + this.ilMain.TransparentColor = System.Drawing.Color.Transparent; + // + // mnuHolder + // + this.mnuHolder.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.mnuHAuto, + this.mnuHSend}); + // + // mnuHSend + // + this.mnuHSend.Index = 1; + resources.ApplyResources(this.mnuHSend, "mnuHSend"); + this.mnuHSend.Click += new System.EventHandler(this.mnuHSend_Click); + // + // pbMain + // + resources.ApplyResources(this.pbMain, "pbMain"); + this.pbMain.Maximum = 10000; + this.pbMain.Name = "pbMain"; + // + // openFileDialog + // + resources.ApplyResources(this.openFileDialog, "openFileDialog"); + // + // saveFileDialog + // + resources.ApplyResources(this.saveFileDialog, "saveFileDialog"); + // + // btSend + // + resources.ApplyResources(this.btSend, "btSend"); + this.btSend.Name = "btSend"; + this.btSend.UseVisualStyleBackColor = true; + this.btSend.Click += new System.EventHandler(this.mnuHSend_Click); + // + // mnuHAuto + // + this.mnuHAuto.Index = 0; + resources.ApplyResources(this.mnuHAuto, "mnuHAuto"); + this.mnuHAuto.Click += new System.EventHandler(this.mnuHAuto_Click); + // + // FileTransferAddin + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lvMain); + this.Controls.Add(this.btSend); + this.Controls.Add(this.pbMain); + this.Name = "FileTransferAddin"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView lvMain; + private System.Windows.Forms.ColumnHeader chTime; + private System.Windows.Forms.ColumnHeader chFile; + public System.Windows.Forms.ProgressBar pbMain; + private System.Windows.Forms.ContextMenu mnuLVContext; + private System.Windows.Forms.ContextMenu mnuHolder; + private System.Windows.Forms.MenuItem mnuLVCOpen; + private System.Windows.Forms.MenuItem mnuLVCSaveAs; + internal System.Windows.Forms.ImageList ilMain; + private System.Windows.Forms.OpenFileDialog openFileDialog; + private System.Windows.Forms.SaveFileDialog saveFileDialog; + private System.Windows.Forms.MenuItem mnuHSend; + private System.Windows.Forms.Button btSend; + private System.Windows.Forms.MenuItem mnuHAuto; + } +} diff --git a/FileTransfer/FileTransferAddin/FileTransferAddin.cs b/FileTransfer/FileTransferAddin/FileTransferAddin.cs new file mode 100644 index 0000000..2c89561 --- /dev/null +++ b/FileTransfer/FileTransferAddin/FileTransferAddin.cs @@ -0,0 +1,267 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using RDPAddins.Common; +using System.IO; +using System.IO.Compression; +using System.Threading.Tasks; +using System.ComponentModel.Composition; +using System.Diagnostics; +using System.Threading; + +namespace FileTransfer +{ + + [AddinMetadata("File transfer", "FTFTA1", + ChannelOptions.Compress | ChannelOptions.PriorityLow)] + public partial class FileTransferAddin : UserControl, IAddin + { + public void Initialize(IChannel Channel) + { + this.Channel = Channel; + Channel.Connected += new EventHandler(FileTransferAddin_Connected); + Channel.Disconnected += new EventHandler(Channel_Disconnected); + Channel.UI.BalloonTipClicked += new BalloonTipClickedHandler((ui, context) => StartFile((string)context)); + Channel.UI.MenuCreating += new MenuCreatingHandler(ui => mnuHolder); + Channel.UI.IconCreating += new IconCreatingHandler(ui => Properties.Resources.AddinIcon); + Channel.UI.ControlCreating += new ControlCreatingHandler(ui => this); + } + + void Channel_Disconnected(object sender, EventArgs e) + { + if (stopWaiting != null) + { + stopWaiting.Cancel(); + stopWaiting = null; + } + } + + + protected FileTransferAddin() + { + InitializeComponent(); + } + + IChannel Channel; + CancellationTokenSource stopWaiting; + + void FileTransferAddin_Connected(object sender, EventArgs e) + { + stopWaiting = new CancellationTokenSource(); + Task.Factory.StartNew(token => + { + while (true) + { + try + { + string file = WaitForFile((CancellationToken)token); + NewFile(file); + } + catch (OperationCanceledException) { break; } + catch { } + } + }, stopWaiting.Token, stopWaiting.Token); + } + + private void lvMain_MouseDoubleClick(object sender, MouseEventArgs e) + { + if (lvMain.SelectedItems.Count > 0) + { + StartFile(lvMain.SelectedItems[0].SubItems[1].Text); + } + } + + void StartFile(string filename) + { + if (!string.IsNullOrWhiteSpace(filename)) + Task.Factory.StartNew(() => + { + try { System.Diagnostics.Process.Start(filename); } + catch { } + }); + } + + private void mnuLVCSaveAs_Click(object sender, EventArgs e) + { + if (lvMain.SelectedItems.Count > 0) + { + string fileSavePath = string.Empty; + if (saveFileDialog.ShowDialog() == DialogResult.OK) + { + fileSavePath = saveFileDialog.FileName; + try + { + System.IO.File.Copy(lvMain.SelectedItems[0].SubItems[1].Text, fileSavePath, true); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } + + private void mnuLVCOpen_Click(object sender, EventArgs e) + { + lvMain_MouseDoubleClick(null, null); + } + + Dictionary icons = new Dictionary(); + + int GetIconIndex(string filename, bool upload) + { + string ext = (upload ? "u" : "d") + Path.GetExtension(filename); + int iconindex = 0; + if (icons.ContainsKey(ext)) + iconindex = icons[ext]; + else + { + using (var icon = System.Drawing.Icon.ExtractAssociatedIcon(filename)) + { + var bmp = icon.ToBitmap(); + using (var gr = Graphics.FromImage(bmp)) + { + using (var img = upload ? Properties.Resources.Uploaded : Properties.Resources.Downloaded) + { + gr.DrawImage(img, 0, 19, 12, 12); + } + } + ilMain.Images.Add(bmp); + iconindex = ilMain.Images.Count - 1; + if (!ext.Contains("exe")) + icons[ext] = iconindex; + } + } + return iconindex; + } + + + public void NewFile(string filename) + { + Channel.UI.DoOnUIThread(() => lvMain.Items.Add(new ListViewItem(new string[] { DateTime.Now.ToString(), filename }, GetIconIndex(filename, false)))); + System.Media.SystemSounds.Exclamation.Play(); + if (Properties.Settings.Default.AutoOpen) + StartFile(filename); + else + Channel.UI.ShowBalloonTip(2000, Channel.Metadata.AddinName, filename, ToolTipIcon.Info, filename); + } + + public string WaitForFile(CancellationToken token) + { + byte[] buffer = new byte[0x1000]; + int toreadhead = 12; + int readedonce = 0; + int readed = 0; + while (toreadhead > 0) + { + readedonce = Channel.Read(buffer, readed, toreadhead); + { + if (readedonce > 0) + { + readed += readedonce; + toreadhead -= readedonce; + } + } + token.ThrowIfCancellationRequested(); + Thread.Sleep(100); + } + long toread = BitConverter.ToInt64(buffer, 0); + int toreadname = BitConverter.ToInt32(buffer, 8); + readed = 0; + while (toreadname > 0) + { + + readedonce = Channel.Read(buffer, readed, toreadname); + if (readedonce > 0) + { + readed += readedonce; + toreadname -= readedonce; + } + token.ThrowIfCancellationRequested(); + } + long maxread = toread; + Channel.UI.DoOnUIThread(() => + { + pbMain.Value = 0; + pbMain.Visible = true; + }); + string filename = Path.Combine(Path.GetTempPath(), System.Text.Encoding.UTF8.GetString(buffer, 0, readed)); + using (FileStream fs = File.OpenWrite(filename)) + { + while (toread > 0) + { + readedonce = Channel.Read(buffer, 0, buffer.Length); + if (readedonce > 0) + { + fs.Write(buffer, 0, readedonce); + toread -= readedonce; + Channel.UI.DoOnUIThread(()=> pbMain.Value = (int)(pbMain.Maximum * (maxread - toread) / (double)maxread)); + } + token.ThrowIfCancellationRequested(); + } + } + Channel.UI.DoOnUIThread(() => pbMain.Visible = false); + return filename; + } + + private void mnuHSend_Click(object sender, EventArgs e) + { + btSend.Visible = false; + mnuHSend.Enabled = false; + string fileOpenPath = string.Empty; + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + fileOpenPath = openFileDialog.FileName; + byte[] filename = System.Text.Encoding.UTF8.GetBytes(Path.GetFileName(fileOpenPath)); + Task.Factory.StartNew(() => + { + byte[] buffer = new byte[1600]; + int bytesRead = 0; + using (FileStream fs = File.OpenRead(fileOpenPath)) + { + long readed = 0, maxread = fs.Length; + Channel.Write(BitConverter.GetBytes(maxread), 0, 8); + Channel.Write(BitConverter.GetBytes(filename.Length), 0, 4); + Channel.Write(filename, 0, filename.Length); + Channel.UI.DoOnUIThread(() => + { + pbMain.Value = 0; + pbMain.Visible = true; + }); + while ((bytesRead = fs.Read(buffer, 0, buffer.Length)) != 0) + { + Channel.Write(buffer, 0, bytesRead); + readed += bytesRead; + Channel.UI.DoOnUIThread(() => pbMain.Value = (int)(pbMain.Maximum * readed / (double)maxread)); + } + Channel.UI.DoOnUIThread(() => pbMain.Visible = false); + } + Channel.UI.DoOnUIThread(() => + { + lvMain.Items.Add(new ListViewItem(new string[] { DateTime.Now.ToString(), fileOpenPath }, GetIconIndex(fileOpenPath, true))); + btSend.Visible = true; + mnuHSend.Enabled = true; + }); + }); + } + else + { + btSend.Visible = true; + mnuHSend.Enabled = true; + } + } + + private void mnuHAuto_Click(object sender, EventArgs e) + { + var menu = (MenuItem)sender; + menu.Checked = !menu.Checked; + Properties.Settings.Default.AutoOpen = mnuHAuto.Checked; + Properties.Settings.Default.Save(); + } + } +} diff --git a/FileTransfer/FileTransferAddin/FileTransferAddin.csproj b/FileTransfer/FileTransferAddin/FileTransferAddin.csproj new file mode 100644 index 0000000..216198f --- /dev/null +++ b/FileTransfer/FileTransferAddin/FileTransferAddin.csproj @@ -0,0 +1,105 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {68857642-A724-46A4-85B3-DAE2BD80498E} + Library + Properties + FileTransfer + FileTransfer + v4.0 + SAK + SAK + SAK + SAK + + + true + full + false + ..\..\bin\Debug\Plugins\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\bin\Release\Plugins\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + UserControl + + + FileTransferAddin.cs + + + + True + True + Resources.resx + + + True + True + Settings.settings + + + + + FileTransferAddin.cs + Designer + + + FileTransferAddin.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + {EC8481C3-F82F-4F3C-84E2-6732750B6542} + RDPAddins.Common + + + + + \ No newline at end of file diff --git a/FileTransfer/FileTransferAddin/FileTransferAddin.csproj.vspscc b/FileTransfer/FileTransferAddin/FileTransferAddin.csproj.vspscc new file mode 100644 index 0000000..b6d3289 --- /dev/null +++ b/FileTransfer/FileTransferAddin/FileTransferAddin.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/FileTransfer/FileTransferAddin/FileTransferAddin.pl-PL.resx b/FileTransfer/FileTransferAddin/FileTransferAddin.pl-PL.resx new file mode 100644 index 0000000..9ef24a0 --- /dev/null +++ b/FileTransfer/FileTransferAddin/FileTransferAddin.pl-PL.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Czas + + + Plik + + + Otwórz + + + Zapisz jako... + + + Autootwieranie + + + Wyślij plik... + + + Wszystkie pliki|*.* + + + Plik do wysłania... + + + Wszystkie pliki|*.* + + + Zapisz jako... + + + Wyślij plik... + + \ No newline at end of file diff --git a/FileTransfer/FileTransferAddin/FileTransferAddin.resx b/FileTransfer/FileTransferAddin/FileTransferAddin.resx new file mode 100644 index 0000000..39f910f --- /dev/null +++ b/FileTransfer/FileTransferAddin/FileTransferAddin.resx @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Time + + + + 130 + + + File + + + 320 + + + 215, 17 + + + + Fill + + + + 0, 0 + + + 474, 119 + + + 130, 17 + + + 32, 32 + + + 6 + + + lvMain + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Open + + + Save As... + + + 17, 17 + + + Send file... + + + Bottom + + + 0, 142 + + + 474, 23 + + + 7 + + + False + + + pbMain + + + System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 347, 17 + + + All files|*.* + + + File to send... + + + 480, 17 + + + All files|*.* + + + Save As... + + + Bottom + + + 0, 119 + + + 474, 23 + + + 8 + + + Send file... + + + btSend + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Auto-open + + + pl-PL + + + True + + + 6, 13 + + + 474, 165 + + + chTime + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + chFile + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mnuLVContext + + + System.Windows.Forms.ContextMenu, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mnuLVCOpen + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mnuLVCSaveAs + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ilMain + + + System.Windows.Forms.ImageList, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mnuHolder + + + System.Windows.Forms.ContextMenu, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mnuHSend + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + openFileDialog + + + System.Windows.Forms.OpenFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + saveFileDialog + + + System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mnuHAuto + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + FileTransferControl + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FileTransfer/FileTransferAddin/Properties/AssemblyInfo.cs b/FileTransfer/FileTransferAddin/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..498bda3 --- /dev/null +++ b/FileTransfer/FileTransferAddin/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("FileTransferAddin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RDPAddin")] +[assembly: AssemblyCopyright("© Selvin 2011. All rights reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b9af866a-cc59-46bd-8842-404c08e00a96")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/FileTransfer/FileTransferAddin/Properties/Resources.Designer.cs b/FileTransfer/FileTransferAddin/Properties/Resources.Designer.cs new file mode 100644 index 0000000..6ae9263 --- /dev/null +++ b/FileTransfer/FileTransferAddin/Properties/Resources.Designer.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FileTransfer.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileTransfer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap AddinIcon { + get { + object obj = ResourceManager.GetObject("AddinIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Downloaded { + get { + object obj = ResourceManager.GetObject("Downloaded", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Uploaded { + get { + object obj = ResourceManager.GetObject("Uploaded", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/FileTransfer/FileTransferAddin/Properties/Resources.resx b/FileTransfer/FileTransferAddin/Properties/Resources.resx new file mode 100644 index 0000000..d1c5383 --- /dev/null +++ b/FileTransfer/FileTransferAddin/Properties/Resources.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\resources\addinicon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\downloaded.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\uploaded.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/FileTransfer/FileTransferAddin/Properties/Settings.Designer.cs b/FileTransfer/FileTransferAddin/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6bb4581 --- /dev/null +++ b/FileTransfer/FileTransferAddin/Properties/Settings.Designer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FileTransfer.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool AutoOpen { + get { + return ((bool)(this["AutoOpen"])); + } + set { + this["AutoOpen"] = value; + } + } + } +} diff --git a/FileTransfer/FileTransferAddin/Properties/Settings.settings b/FileTransfer/FileTransferAddin/Properties/Settings.settings new file mode 100644 index 0000000..c4eafc1 --- /dev/null +++ b/FileTransfer/FileTransferAddin/Properties/Settings.settings @@ -0,0 +1,9 @@ + + + + + + False + + + \ No newline at end of file diff --git a/FileTransfer/FileTransferAddin/Resources/AddinIcon.png b/FileTransfer/FileTransferAddin/Resources/AddinIcon.png new file mode 100644 index 0000000..0be81b3 Binary files /dev/null and b/FileTransfer/FileTransferAddin/Resources/AddinIcon.png differ diff --git a/FileTransfer/FileTransferAddin/Resources/Downloaded.png b/FileTransfer/FileTransferAddin/Resources/Downloaded.png new file mode 100644 index 0000000..3ac360a Binary files /dev/null and b/FileTransfer/FileTransferAddin/Resources/Downloaded.png differ diff --git a/FileTransfer/FileTransferAddin/Resources/Uploaded.png b/FileTransfer/FileTransferAddin/Resources/Uploaded.png new file mode 100644 index 0000000..a701c1f Binary files /dev/null and b/FileTransfer/FileTransferAddin/Resources/Uploaded.png differ diff --git a/FileTransfer/FileTransferAddin/app.config b/FileTransfer/FileTransferAddin/app.config new file mode 100644 index 0000000..e67ba87 --- /dev/null +++ b/FileTransfer/FileTransferAddin/app.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + False + + + + \ No newline at end of file diff --git a/FileTransfer/FileTransferAddin/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs b/FileTransfer/FileTransferAddin/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs new file mode 100644 index 0000000..5d01041 --- /dev/null +++ b/FileTransfer/FileTransferAddin/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] diff --git a/FileTransfer/FileTransferAddin/obj/Debug/FileTransfer.FileTransferAddin.pl-PL.resources b/FileTransfer/FileTransferAddin/obj/Debug/FileTransfer.FileTransferAddin.pl-PL.resources new file mode 100644 index 0000000..b75137e Binary files /dev/null and b/FileTransfer/FileTransferAddin/obj/Debug/FileTransfer.FileTransferAddin.pl-PL.resources differ diff --git a/FileTransfer/FileTransferAddin/obj/Debug/FileTransfer.FileTransferAddin.resources b/FileTransfer/FileTransferAddin/obj/Debug/FileTransfer.FileTransferAddin.resources new file mode 100644 index 0000000..0eaa0f2 Binary files /dev/null and b/FileTransfer/FileTransferAddin/obj/Debug/FileTransfer.FileTransferAddin.resources differ diff --git a/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csproj.FileListAbsolute.txt b/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..3b9fb86 --- /dev/null +++ b/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csproj.FileListAbsolute.txt @@ -0,0 +1,4 @@ +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csprojAssemblyReference.cache +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferAddin/obj/Debug/FileTransfer.FileTransferAddin.resources +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferAddin/obj/Debug/FileTransfer.FileTransferAddin.pl-PL.resources +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csproj.GenerateResource.cache diff --git a/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csproj.GenerateResource.cache b/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csproj.GenerateResource.cache new file mode 100644 index 0000000..6a1bf10 Binary files /dev/null and b/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csproj.GenerateResource.cache differ diff --git a/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csprojAssemblyReference.cache b/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csprojAssemblyReference.cache new file mode 100644 index 0000000..4770e0e Binary files /dev/null and b/FileTransfer/FileTransferAddin/obj/Debug/FileTransferAddin.csprojAssemblyReference.cache differ diff --git a/FileTransfer/FileTransferServer/FileTransferServer.csproj b/FileTransfer/FileTransferServer/FileTransferServer.csproj new file mode 100644 index 0000000..3021dbd --- /dev/null +++ b/FileTransfer/FileTransferServer/FileTransferServer.csproj @@ -0,0 +1,67 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {DB1D00FA-A8A4-4F01-931E-52686F51265E} + WinExe + Properties + FileTransfer + FileTransfer + v4.0 + SAK + SAK + SAK + SAK + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + Form + + + frmMain.cs + + + + + Designer + frmMain.cs + + + + + + + + + + + \ No newline at end of file diff --git a/FileTransfer/FileTransferServer/FileTransferServer.csproj.vspscc b/FileTransfer/FileTransferServer/FileTransferServer.csproj.vspscc new file mode 100644 index 0000000..b6d3289 --- /dev/null +++ b/FileTransfer/FileTransferServer/FileTransferServer.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/FileTransfer/FileTransferServer/Program.cs b/FileTransfer/FileTransferServer/Program.cs new file mode 100644 index 0000000..a7cbaed --- /dev/null +++ b/FileTransfer/FileTransferServer/Program.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using System.Threading; + +namespace FileTransfer +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); + Application.Run(new frmMain()); + //Thread.Sleep(10000); + } + + static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + MessageBox.Show(e.ExceptionObject.ToString()); + } + } +} \ No newline at end of file diff --git a/FileTransfer/FileTransferServer/Properties/AssemblyInfo.cs b/FileTransfer/FileTransferServer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d32901f --- /dev/null +++ b/FileTransfer/FileTransferServer/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("FileTransferServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("FileTransferServer")] +[assembly: AssemblyCopyright("© Selvin 2011. All rights reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("043fcaf1-e05c-4364-b530-5693f273b6fa")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/FileTransfer/FileTransferServer/WtsApi32.cs b/FileTransfer/FileTransferServer/WtsApi32.cs new file mode 100644 index 0000000..bd09de9 --- /dev/null +++ b/FileTransfer/FileTransferServer/WtsApi32.cs @@ -0,0 +1,33 @@ +using System; +using System.Runtime.InteropServices; + +namespace FileTransfer +{ + class WtsApi32 + { + + [DllImport("Wtsapi32.dll", SetLastError = true)] + public static extern bool WTSVirtualChannelWrite(IntPtr channelHandle, byte[] data, int length, ref int bytesWritten); + + [DllImport("Wtsapi32.dll", SetLastError = true)] + public static extern bool WTSVirtualChannelRead(IntPtr channelHandle, uint TimeOut, byte[] data, int length, ref int bytesReaded); + + [DllImport("Wtsapi32.dll")] + public static extern IntPtr WTSVirtualChannelOpen(IntPtr server, int sessionId, [MarshalAs(UnmanagedType.LPStr)] string virtualName); + + [DllImport("Wtsapi32.dll")] + public static extern bool WTSVirtualChannelClose(IntPtr channelHandle); + + public enum VirtualClass + { + ClientData, + FileHandle + }; + + [DllImport("Wtsapi32.dll", SetLastError = true)] + public static extern bool WTSVirtualChannelQuery(IntPtr channelHandle, VirtualClass virtualClass, out IntPtr buffer, ref uint bytesReturned); + + [DllImport("Wtsapi32.dll", SetLastError = true)] + public static extern void WTSFreeMemory(IntPtr memory); + } +} diff --git a/FileTransfer/FileTransferServer/bin/Debug/FileTransfer.exe b/FileTransfer/FileTransferServer/bin/Debug/FileTransfer.exe new file mode 100644 index 0000000..fbf79ad Binary files /dev/null and b/FileTransfer/FileTransferServer/bin/Debug/FileTransfer.exe differ diff --git a/FileTransfer/FileTransferServer/bin/Debug/FileTransfer.pdb b/FileTransfer/FileTransferServer/bin/Debug/FileTransfer.pdb new file mode 100644 index 0000000..938f575 Binary files /dev/null and b/FileTransfer/FileTransferServer/bin/Debug/FileTransfer.pdb differ diff --git a/FileTransfer/FileTransferServer/frmMain.Designer.cs b/FileTransfer/FileTransferServer/frmMain.Designer.cs new file mode 100644 index 0000000..72911a7 --- /dev/null +++ b/FileTransfer/FileTransferServer/frmMain.Designer.cs @@ -0,0 +1,71 @@ +namespace FileTransfer +{ + partial class frmMain + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btLoadAndSend = new System.Windows.Forms.Button(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.SuspendLayout(); + // + // btLoadAndSend + // + this.btLoadAndSend.Location = new System.Drawing.Point(12, 12); + this.btLoadAndSend.Name = "btLoadAndSend"; + this.btLoadAndSend.Size = new System.Drawing.Size(147, 37); + this.btLoadAndSend.TabIndex = 0; + this.btLoadAndSend.Text = "Load && Send"; + this.btLoadAndSend.UseVisualStyleBackColor = true; + this.btLoadAndSend.Click += new System.EventHandler(this.btLoadAndSend_Click); + // + // openFileDialog + // + this.openFileDialog.Filter = "All files|*.*"; + // + // frmMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(174, 60); + this.Controls.Add(this.btLoadAndSend); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "frmMain"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "FileTransfer"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmMain_FormClosed); + this.Load += new System.EventHandler(this.frmMain_Load); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button btLoadAndSend; + private System.Windows.Forms.OpenFileDialog openFileDialog; + } +} + diff --git a/FileTransfer/FileTransferServer/frmMain.cs b/FileTransfer/FileTransferServer/frmMain.cs new file mode 100644 index 0000000..0e943a4 --- /dev/null +++ b/FileTransfer/FileTransferServer/frmMain.cs @@ -0,0 +1,165 @@ +using System; +using System.IO; +using System.Windows.Forms; +using System.IO.Compression; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.Threading; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace FileTransfer +{ + public partial class frmMain : Form + { + public frmMain() + { + InitializeComponent(); + } + IntPtr handle = IntPtr.Zero; + FileStream fileStream = null; + private void btLoadAndSend_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + try + { + var fileOpenPath = openFileDialog.FileName; + btLoadAndSend.Enabled = false; + Task.Factory.StartNew(() => + { + byte[] filename = System.Text.Encoding.UTF8.GetBytes(Path.GetFileName(fileOpenPath)); + using (FileStream fs = File.OpenRead(fileOpenPath)) + { + fileStream.Write(BitConverter.GetBytes(fs.Length), 0, 8); + fileStream.Write(BitConverter.GetBytes(filename.Length), 0, 4); + fileStream.Write(filename, 0, filename.Length); + fs.CopyTo(fileStream); + fileStream.Flush(); + } + }).ContinueWith(task => { btLoadAndSend.Enabled = true; }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Current); + } + catch (Exception ex) + { + btLoadAndSend.Enabled = true; + MessageBox.Show("Somethings gone wrong:\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + static void StartFile(string filename) + { + Task.Factory.StartNew(() => + { + try + { + System.Diagnostics.Process.Start(filename); + } + catch { } + }); + } + + private void frmMain_Load(object sender, EventArgs e) + { + handle = WtsApi32.WTSVirtualChannelOpen(IntPtr.Zero, -1, "FTFTA1"); + Task.Factory.StartNew(() => + { + IntPtr tempPointer = IntPtr.Zero; + uint pointerLen = 0; + if (WtsApi32.WTSVirtualChannelQuery(handle, WtsApi32.VirtualClass.FileHandle, out tempPointer, ref pointerLen)) + { + IntPtr realPointer = Marshal.ReadIntPtr(tempPointer); + WtsApi32.WTSFreeMemory(tempPointer); + var fileHandle = new SafeFileHandle(realPointer, false); + fileStream = new FileStream(fileHandle, FileAccess.ReadWrite, 0x640, true); + var os = new ObjectState(); + os.RDPStream = fileStream; + var iar = fileStream.BeginRead(os.Buffer, 0, 8, CallBack, os); + } + else + Close(); + }); + } + + + private void frmMain_FormClosed(object sender, FormClosedEventArgs e) + { + fileStream.Dispose(); + bool ret = WtsApi32.WTSVirtualChannelClose(handle); + } + + + enum FileDownloadStatus + { + Length, + NameLength, + Name, + Body, + } + + class ObjectState + { + public int NameLength = 0; + public string Name = string.Empty; + public long Length = 0; + public FileDownloadStatus State = FileDownloadStatus.Length; + public byte[] Buffer = new byte[0x640]; + public FileStream File = null; + public FileStream RDPStream = null; + } + + + static void CallBack(IAsyncResult iar) + { + if (iar.IsCompleted || iar.CompletedSynchronously) + { + var os = iar.AsyncState as ObjectState; + int readed = 0; + try + { + readed = os.RDPStream.EndRead(iar); + } + catch (IOException ex) { MessageBox.Show(ex.Message); } + if (readed != 0) + { + switch (os.State) + { + case FileDownloadStatus.Length: + os.Length = BitConverter.ToInt64(os.Buffer, 0); + os.State = FileDownloadStatus.NameLength; + os.RDPStream.BeginRead(os.Buffer, 0, 4, CallBack, os); + break; + case FileDownloadStatus.NameLength: + os.NameLength = BitConverter.ToInt32(os.Buffer, 0); + os.State = FileDownloadStatus.Name; + os.RDPStream.BeginRead(os.Buffer, 0, os.NameLength, CallBack, os); + break; + case FileDownloadStatus.Name: + os.Name = Path.Combine(Path.GetTempPath(), System.Text.Encoding.UTF8.GetString(os.Buffer, 0, readed)); + os.File = File.OpenWrite(os.Name); + os.State = FileDownloadStatus.Body; + os.RDPStream.BeginRead(os.Buffer, 0, Math.Min(os.Buffer.Length, (int)os.Length), CallBack, os); + break; + case FileDownloadStatus.Body: + os.Length -= readed; + os.File.Write(os.Buffer, 0, readed); + if (os.Length == 0) + { + os.File.Dispose(); + StartFile(os.Name); + var newos = new ObjectState(); + newos.RDPStream = os.RDPStream; + os.RDPStream.BeginRead(newos.Buffer, 0, 8, CallBack, newos); + } + else + { + if (!os.RDPStream.SafeFileHandle.IsInvalid) + os.RDPStream.BeginRead(os.Buffer, 0, Math.Min(os.Buffer.Length, (int)os.Length), CallBack, os); + } + break; + } + } + } + } + } +} \ No newline at end of file diff --git a/FileTransfer/FileTransferServer/frmMain.resx b/FileTransfer/FileTransferServer/frmMain.resx new file mode 100644 index 0000000..f003e42 --- /dev/null +++ b/FileTransfer/FileTransferServer/frmMain.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/FileTransfer/FileTransferServer/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs b/FileTransfer/FileTransferServer/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs new file mode 100644 index 0000000..5d01041 --- /dev/null +++ b/FileTransfer/FileTransferServer/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] diff --git a/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.exe b/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.exe new file mode 100644 index 0000000..fbf79ad Binary files /dev/null and b/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.exe differ diff --git a/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.frmMain.resources b/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.frmMain.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.frmMain.resources differ diff --git a/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.pdb b/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.pdb new file mode 100644 index 0000000..938f575 Binary files /dev/null and b/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.pdb differ diff --git a/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.CoreCompileInputs.cache b/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..dea9efd --- /dev/null +++ b/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +2deac5ab15653598329ce4791b68dd03874120cf diff --git a/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.FileListAbsolute.txt b/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..c4e649d --- /dev/null +++ b/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.FileListAbsolute.txt @@ -0,0 +1,8 @@ +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferServer/bin/Debug/FileTransfer.exe +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferServer/bin/Debug/FileTransfer.pdb +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csprojAssemblyReference.cache +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.frmMain.resources +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.GenerateResource.cache +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.CoreCompileInputs.cache +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.exe +/home/haraldwolff/src/dotnet/RDPAddins/FileTransfer/FileTransferServer/obj/Debug/FileTransfer.pdb diff --git a/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.GenerateResource.cache b/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.GenerateResource.cache new file mode 100644 index 0000000..85cc91b Binary files /dev/null and b/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csproj.GenerateResource.cache differ diff --git a/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csprojAssemblyReference.cache b/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csprojAssemblyReference.cache new file mode 100644 index 0000000..c3df060 Binary files /dev/null and b/FileTransfer/FileTransferServer/obj/Debug/FileTransferServer.csprojAssemblyReference.cache differ diff --git a/Installer/RDPAddins.iss b/Installer/RDPAddins.iss new file mode 100644 index 0000000..12260e0 --- /dev/null +++ b/Installer/RDPAddins.iss @@ -0,0 +1,85 @@ +#define AppName "RDPAddins" +#define AppVersion GetFileVersion(AddBackslash(SourcePath) + "..\bin\Release\RDPAddins.Core.dll") + +[Setup] +AppName={#AppName} +AppVerName={#AppName} {#AppVersion} +DefaultGroupName={#AppName} +AppPublisher=Selvin +AppVersion={#AppVersion} +AllowNoIcons=false +AppCopyright=Copyright © Selvin 2006-2010. All rights reserved. +PrivilegesRequired=admin +OutputBaseFilename={#AppName} {#AppVersion} +OutputDir=/ +DefaultDirName={pf}\{#AppName} +ArchitecturesInstallIn64BitMode=x64 +Compression=lzma2/ultra +InternalCompressLevel=ultra +SolidCompression=yes +VersionInfoVersion={#AppVersion} +VersionInfoCompany=Selvin +VersionInfoDescription={#AppName} +AppID={{9172FF56-431B-4836-AEB8-A1A12C96B293} +DisableDirPage=true +UsePreviousAppDir=false +AllowUNCPath=false +DisableProgramGroupPage=true +AppendDefaultGroupName=false + + + +[Dirs] +Name: {app}\Plugins; Flags: uninsalwaysuninstall + +[Files] +Source: ..\bin\Release\RDPAddins.Core.dll; DestDir: {app}; Components: Dll; Flags: ignoreversion; Check: not Is64BitInstallMode +Source: ..\bin\x64\Release\RDPAddins.Core.dll; DestDir: {app}; Components: Dll; Flags: ignoreversion; Check: Is64BitInstallMode +;Source: bin\Release\RDPAddins.Common.dll; DestDir: {app}; Components: Dll; Flags: ignoreversion gacinstall; StrongAssemblyName: RDPAddins.Common +Source: ..\bin\Release\RDPAddins.Common.dll; DestDir: {app}; Components: Dll; Flags: ignoreversion +Source: ..\bin\Release\RDPAddins.Common.xml; DestDir: {app}; Components: Dll +Source: ..\bin\Release\RDPAddins.exe; DestDir: {app}; Components: Dll; Flags: ignoreversion +Source: ..\bin\Release\pl-PL\RDPAddins.resources.dll; DestDir: {app}\pl-PL; Components: Dll; Flags: ignoreversion +Source: ..\bin\Release\Plugins\FileTransfer.dll; DestDir: {app}\Plugins; Components: FTP; Flags: ignoreversion +Source: ..\bin\Release\Plugins\pl-PL\FileTransfer.resources.dll; DestDir: {app}\Plugins\pl-PL; Components: FTP; Flags: ignoreversion + +[Icons] +Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe} + +[Languages] +Name: Polski; MessagesFile: compiler:Languages\Polish.isl +Name: English; MessagesFile: compiler:Default.isl + +[Registry] +Root: HKCU; Subkey: Software\Microsoft\Terminal Server Client\Default\AddIns\RDPAddins; Flags: uninsdeletekey noerror; ValueName: Name; ValueData: {app}\RDPAddins.Core.dll; ValueType: string + +[Components] +Name: Dll; Description: {cm:DllDescription}; Flags: fixed; Languages: ; Types: custom compact full +Name: FTP; Description: {cm:FTPDescription}; Languages: ; Types: custom full + +[CustomMessages] +Polski.dotnetmissing=Ten program wymaga .NET Framework v4.0. Proszê zainstalowaæ .NET Framework v4.0 i uruchomiæ instalator ponownie. +English.dotnetmissing=This setup requires the .NET Framework v4.0. Please install the .NET Framework v4.0 and run this setup again. +Polski.DllDescription=Instaluje wszystkie potrzebne biblioteki +English.DllDescription=Install all required libraries +Polski.FTPDescription=Instaluje dodatek do transferu plików z i do serwera terminali +English.FTPDescription=Install addins which will transfer files from and to terminal server + +[Code] +function InitializeSetup(): Boolean; +var + NetFrameWorkInstalled : Boolean; +begin + NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v4.0'); + if NetFrameWorkInstalled =true then + begin + Result := true; + end; + + if NetFrameWorkInstalled =false then + begin + MsgBox(ExpandConstant('{cm:dotnetmissing}'), mbError, MB_OK); + Result:=false; + end; +end; + diff --git a/Installer/RDPAddinsC.iss b/Installer/RDPAddinsC.iss new file mode 100644 index 0000000..a31cde6 --- /dev/null +++ b/Installer/RDPAddinsC.iss @@ -0,0 +1,85 @@ +#define AppName "RDPAddins" +#define AppVersion GetFileVersion(AddBackslash(SourcePath) + "..\bin\Release\RDPAddins.Core.dll") + +[Setup] +AppName={#AppName} +AppVerName={#AppName} {#AppVersion} +DefaultGroupName={#AppName} +AppPublisher=Selvin +AppVersion={#AppVersion} +AllowNoIcons=false +AppCopyright=Copyright © Selvin 2006-2010. All rights reserved. +PrivilegesRequired=admin +OutputBaseFilename={#AppName} {#AppVersion} +OutputDir=/ +DefaultDirName={pf}\{#AppName} +ArchitecturesInstallIn64BitMode=x64 +Compression=lzma2/ultra +InternalCompressLevel=ultra +SolidCompression=yes +VersionInfoVersion={#AppVersion} +VersionInfoCompany=Selvin +VersionInfoDescription={#AppName} +AppID={{9172FF56-431B-4836-AEB8-A1A12C96B293} +DisableDirPage=true +UsePreviousAppDir=false +AllowUNCPath=false +DisableProgramGroupPage=true +AppendDefaultGroupName=false + + + +[Dirs] +Name: {app}\Plugins; Flags: uninsalwaysuninstall + +[Files] +Source: ..\bin\Release\RDPAddins.CoreC.dll; DestDir: {app}; Components: Dll; Flags: ignoreversion; Check: not Is64BitInstallMode +Source: ..\bin\x64\Release\RDPAddins.CoreC.dll; DestDir: {app}; Components: Dll; Flags: ignoreversion; Check: Is64BitInstallMode +;Source: bin\Release\RDPAddins.Common.dll; DestDir: {app}; Components: Dll; Flags: ignoreversion gacinstall; StrongAssemblyName: RDPAddins.Common +Source: ..\bin\Release\RDPAddins.Common.dll; DestDir: {app}; Components: Dll; Flags: ignoreversion +Source: ..\bin\Release\RDPAddins.Common.xml; DestDir: {app}; Components: Dll +Source: ..\bin\Release\RDPAddins.exe; DestDir: {app}; Components: Dll; Flags: ignoreversion +Source: ..\bin\Release\pl-PL\RDPAddins.resources.dll; DestDir: {app}\pl-PL; Components: Dll; Flags: ignoreversion +Source: ..\bin\Release\Plugins\FileTransfer.dll; DestDir: {app}\Plugins; Components: FTP; Flags: ignoreversion +Source: ..\bin\Release\Plugins\pl-PL\FileTransfer.resources.dll; DestDir: {app}\Plugins\pl-PL; Components: FTP; Flags: ignoreversion + +[Icons] +Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe} + +[Languages] +Name: Polski; MessagesFile: compiler:Languages\Polish.isl +Name: English; MessagesFile: compiler:Default.isl + +[Registry] +Root: HKCU; Subkey: Software\Microsoft\Terminal Server Client\Default\AddIns\RDPAddins; Flags: uninsdeletekey noerror; ValueName: Name; ValueData: {app}\RDPAddins.CoreC.dll; ValueType: string + +[Components] +Name: Dll; Description: {cm:DllDescription}; Flags: fixed; Languages: ; Types: custom compact full +Name: FTP; Description: {cm:FTPDescription}; Languages: ; Types: custom full + +[CustomMessages] +Polski.dotnetmissing=Ten program wymaga .NET Framework v4.0. Proszê zainstalowaæ .NET Framework v4.0 i uruchomiæ instalator ponownie. +English.dotnetmissing=This setup requires the .NET Framework v4.0. Please install the .NET Framework v4.0 and run this setup again. +Polski.DllDescription=Instaluje wszystkie potrzebne biblioteki +English.DllDescription=Install all required libraries +Polski.FTPDescription=Instaluje dodatek do transferu plików z i do serwera terminali +English.FTPDescription=Install addins which will transfer files from and to terminal server + +[Code] +function InitializeSetup(): Boolean; +var + NetFrameWorkInstalled : Boolean; +begin + NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v4.0'); + if NetFrameWorkInstalled =true then + begin + Result := true; + end; + + if NetFrameWorkInstalled =false then + begin + MsgBox(ExpandConstant('{cm:dotnetmissing}'), mbError, MB_OK); + Result:=false; + end; +end; + diff --git a/RDPAddins.Common/AddinMetadata.cs b/RDPAddins.Common/AddinMetadata.cs new file mode 100644 index 0000000..b78bd2c --- /dev/null +++ b/RDPAddins.Common/AddinMetadata.cs @@ -0,0 +1,113 @@ +using System; +using System.Drawing; +using System.ComponentModel.Composition; + +namespace RDPAddins.Common +{ + /// + /// Provides addin's metadata + /// + public interface IAddinMetadata + { + /// + /// Gets addin name + /// + string AddinName { get; } + + /// + /// Get addin channel name + /// + string ChannelName { get; } + + /// + /// Gets channel options + /// + ChannelOptions ChannelOptions { get; } + } + + /// + /// Inherited from System.ComponentModel.Composition.ExportAttribute. + /// Every addins should have one as an addin description. + /// + [MetadataAttribute] + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] + public class AddinMetadataAttribute : ExportAttribute + { + /// + /// Initializes a new instance of the AddinMetadataAttribute class, exporting the type or member marked with this attribute with the specified name, channel name and channel options. + /// + /// Name of the addin. + /// !!! should be less than 7 chars !!! Channel name. + /// Specified channel's options + public AddinMetadataAttribute(string AddinName, string ChannelName, ChannelOptions ChannelOptions) + : base(typeof(IAddin)) + { + this.AddinName = AddinName; + this.ChannelName = ChannelName; + this.ChannelOptions = ChannelOptions; + } + + /// + /// Gets addin name + /// + public string AddinName { get; private set; } + + /// + /// Get addin channel name + /// + public string ChannelName { get; private set; } + + /// + /// Gets channel options + /// + public ChannelOptions ChannelOptions { get; private set; } + } + + /// + /// Specifies the options for this virtual channel. + /// + [Flags] + public enum ChannelOptions : uint + { + /// + /// The channel is initialized. + /// + Initialized = 0x80000000, + /// + /// Encrypt client-to-server data. + /// + EncryptRDP = 0x40000000, + /// + /// Encrypt server-to-client data. + /// + EncryptSC = 0x20000000, + /// + /// Encrypt client-to-server data. + /// + EncryptCS = 0x10000000, + /// + /// Channel data should be sent with high Multipoint Communications Services (MCS) priority. + /// + PriorityHigh = 0x08000000, + /// + /// Channel data should be sent with medium MCS priority. + /// + PriorityMedium = 0x04000000, + /// + /// Channel data should be sent with low MCS priority. + /// + PriorityLow = 0x02000000, + /// + /// Virtual channel data should be compressed if RDP data is being compressed. + /// + CompressRDP = 0x00800000, + /// + /// Virtual channel data should be compressed, regardless of Remote Desktop Protocol (RDP) compression. + /// + Compress = 0x00400000, + /// + /// Affects how data sent by the IChannel.Write function is received at the server end. If this value is set, each data block is preceded by a CHANNEL_PDU_HEADER structure. If this value is not set, the data block includes only the data specified to IChannel.Write. + /// + ShowProtocol = 0x00200000 + } +} diff --git a/RDPAddins.Common/IAddin.cs b/RDPAddins.Common/IAddin.cs new file mode 100644 index 0000000..4eddf9f --- /dev/null +++ b/RDPAddins.Common/IAddin.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace RDPAddins.Common +{ + /// + /// Defines an addin interface. + /// + public interface IAddin + { + /// + /// Initializing addin with specific channel + /// + /// Channel created for this addin. + void Initialize(IChannel Channel); + } +} diff --git a/RDPAddins.Common/IChannel.cs b/RDPAddins.Common/IChannel.cs new file mode 100644 index 0000000..e4f9fe6 --- /dev/null +++ b/RDPAddins.Common/IChannel.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace RDPAddins.Common +{ + /// + /// Represents RDS Channel + /// + public interface IChannel + { + /// + /// Occurs when VirtualChannelInitEventProc(VirtualChannelInitEvent in RDS API) was called with ChannelEvents.Initialized(CHANNEL_EVENT_INITIALIZED in RDS API) + /// + event EventHandler Initialized; + + /// + /// Occurs when VirtualChannelInitEventProc(VirtualChannelInitEvent in RDS API) was called with ChannelEvents.Connected(CHANNEL_EVENT_CONNECTED in RDS API) + /// + event EventHandler Connected; + + /// + /// Occurs when VirtualChannelInitEventProc(VirtualChannelInitEvent in RDS API) was called with ChannelEvents.Disconnected(CHANNEL_EVENT_DISCONNECTED in RDS API) + /// + event EventHandler Disconnected; + + /// + /// Occurs when VirtualChannelInitEventProc(VirtualChannelInitEvent in RDS API) was called with ChannelEvents.Terminated(CHANNEL_EVENT_TERMINATED in RDS API) + /// + event EventHandler Terminated; + + /// + /// Occurs when VirtualChannelOpenEvent(VirtualChannelOpenEvent in RDS API) was called with ChannelEvents.DataRecived(CHANNEL_EVENT_DATA_RECEIVED in RDS API) + /// + event DataArrivedHandler DataArrived; + + /// + /// Works similar to System.IO.Stream.Read + /// + /// An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the channel. + /// The zero-based byte offset in buffer at which to begin storing the data read from the channel. + /// The maximum number of bytes to be read from the channel. + /// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available(including 0). + int Read(byte[] buffer, int offset, int count); + + /// + /// Works similar to System.IO.Stream.Write + /// + /// An array of bytes. This method sends bytes from buffer through channel. + /// The zero-based byte offset in buffer at which to begin sending bytes through channel. + /// The number of bytes to be sent through channel. + void Write(byte[] data, int offset, int count); + + /// + /// Creataes and returns stream. Stream is disposed when Disconnect event occurs. + /// + /// Retuns stream + Stream GetStream(); + + /// + /// Gets Addin metadata + /// + IAddinMetadata Metadata { get; } + + /// + /// Get IUI interface + /// + IUI UI { get; } + } + /// + /// Represents the method that will handle the DataArrived event of a IChannel. + /// + /// Specifies the size, in bytes, of the data. Use Read method of IChannel to read the data. + /// Specifies the total size, in bytes, of the data written by a single write operation to the server end of the virtual channel. + /// Provides information about the chunk of data being received. + public delegate void DataArrivedHandler(uint dataLength, uint totalLength, DataParts dataFlags); + + /// + /// Specifies constants that define which part of data chunk was sent. + /// + public enum DataParts + { + /// + /// The chunk is the beginning of the data written by a single write operation. + /// + First = 0x01, + /// + /// The chunk is the end of the data written by a single write operation. + /// + Last = 0x02, + /// + /// The chunk is in the middle of a block of data written by a single write operation. + /// + Middle = 0, + /// + /// Combines the DataParts.First and DataParts.Last values. The chunk contains all the data from a single write operation. + /// + Only = First | Last, + + } +} diff --git a/RDPAddins.Common/IUI.cs b/RDPAddins.Common/IUI.cs new file mode 100644 index 0000000..d001977 --- /dev/null +++ b/RDPAddins.Common/IUI.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Drawing; + +namespace RDPAddins.Common +{ + /// + /// Represents UI parts of the IChannel + /// + public interface IUI + { + /// + /// Occurs when the balloon tip is clicked. + /// + event BalloonTipClickedHandler BalloonTipClicked; + + /// + /// Occurs when the hannel is trying create addin's control. If not hooked addin will not have control. + /// + event ControlCreatingHandler ControlCreating; + + /// + /// Occurs when Channel is trying create addin's menu. If not hooked addin will not have menu. + /// + event MenuCreatingHandler MenuCreating; + + /// + /// Occurs when Channel is trying create addin's tray menu. If not hooked addin will not have tray menu. + /// + event MenuCreatingHandler TrayMenuCreating; + + /// + /// Occurs when Channel is trying to get addin's icon. Only appears when addin has control. If not hooked addin and addin has control then addin will have default icon. + /// + event IconCreatingHandler IconCreating; + + /// + /// Get UI's channel + /// + IChannel Parent { get; } + + /// + /// Displays the balloon tip in the taskbar. + /// + /// The time period, in milliseconds, the balloon tip should display. + /// The title to display on the balloon tip. + /// The text to display on the balloon tip. + /// One of the System.Windows.Forms.ToolTipIcon values. + /// This object will sent to BalloonTipClicked event. + void ShowBalloonTip(int timeout, string tipTitle, string tipText, ToolTipIcon tipIcon, object context); + + /// + /// Shows main form and selct tab with addin's control(if exists). + /// + void ShowControl(); + + /// + /// Executes a action on the UI thread. (It calls System.Windows.Forms.Form.Invoke). + /// + /// The action delegate. + void DoOnUIThread(Action action); + + /// + /// Gets or sets visibility of addin's control(if exists). + /// + bool Visible { get; set; } + } + /// + /// Represents the method that will handle the BalloonTipClicked event of a IUI. + /// + /// The source of the event. + /// Parameter sent by IUI.ShowBalloonTip method. + public delegate void BalloonTipClickedHandler(IUI sender, object context); + + /// + /// Represents the method that will handle the ControlCreating event of a IUI. + /// + /// The source of the event. + /// Should returns addin's control if needed. + public delegate Control ControlCreatingHandler(IUI sender); + + /// + /// Represents the method that will handle the MenuCreating and TrayMenuCreating event of a IUI. + /// + /// The source of the event. + /// Should returns addin's menu or tray menu if needed. + public delegate Menu MenuCreatingHandler(IUI sender); + + /// + /// Represents the method that will handle the IconCreating event of a IUI. + /// + /// The source of the event. + /// Should returns addin's icon if needed. + public delegate Image IconCreatingHandler(IUI sender); +} diff --git a/RDPAddins.Common/Properties/AssemblyInfo.cs b/RDPAddins.Common/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9e6c373 --- /dev/null +++ b/RDPAddins.Common/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("RDPAddins.Common")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RDPAddins")] +[assembly: AssemblyCopyright("© Selvin 2011. All rights reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("275b6dd3-a087-4b86-a815-18c884480564")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.2.1.0")] +[assembly: AssemblyFileVersion("0.2.1.0")] diff --git a/RDPAddins.Common/RDPAddins.Common.csproj b/RDPAddins.Common/RDPAddins.Common.csproj new file mode 100644 index 0000000..da75a84 --- /dev/null +++ b/RDPAddins.Common/RDPAddins.Common.csproj @@ -0,0 +1,79 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {EC8481C3-F82F-4F3C-84E2-6732750B6542} + Library + Properties + RDPAddins.Common + RDPAddins.Common + v4.0 + SAK + SAK + SAK + SAK + + + true + full + false + ..\bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\bin\Debug\RDPAddins.Common.xml + + + pdbonly + true + ..\bin\Release\ + TRACE + prompt + 4 + ..\bin\Release\RDPAddins.Common.xml + + + true + + + ..\RDPAddins.snk + + + OnOutputUpdated + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RDPAddins.Common/RDPAddins.Common.csproj.vspscc b/RDPAddins.Common/RDPAddins.Common.csproj.vspscc new file mode 100644 index 0000000..b6d3289 --- /dev/null +++ b/RDPAddins.Common/RDPAddins.Common.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/RDPAddins.Common/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs b/RDPAddins.Common/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs new file mode 100644 index 0000000..5d01041 --- /dev/null +++ b/RDPAddins.Common/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] diff --git a/RDPAddins.Common/obj/Debug/RDPAddins.Common.csproj.CoreCompileInputs.cache b/RDPAddins.Common/obj/Debug/RDPAddins.Common.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..1f6abd5 --- /dev/null +++ b/RDPAddins.Common/obj/Debug/RDPAddins.Common.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +1d31ddd67b4711a4859baa021df55aa8e9aadba8 diff --git a/RDPAddins.Common/obj/Debug/RDPAddins.Common.csproj.FileListAbsolute.txt b/RDPAddins.Common/obj/Debug/RDPAddins.Common.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..fed55db --- /dev/null +++ b/RDPAddins.Common/obj/Debug/RDPAddins.Common.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +/home/haraldwolff/src/dotnet/RDPAddins/bin/Debug/RDPAddins.Common.xml +/home/haraldwolff/src/dotnet/RDPAddins/bin/Debug/RDPAddins.Common.dll +/home/haraldwolff/src/dotnet/RDPAddins/bin/Debug/RDPAddins.Common.pdb +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Common/obj/Debug/RDPAddins.Common.csprojAssemblyReference.cache +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Common/obj/Debug/RDPAddins.Common.csproj.CoreCompileInputs.cache +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Common/obj/Debug/RDPAddins.Common.dll +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Common/obj/Debug/RDPAddins.Common.pdb diff --git a/RDPAddins.Common/obj/Debug/RDPAddins.Common.csprojAssemblyReference.cache b/RDPAddins.Common/obj/Debug/RDPAddins.Common.csprojAssemblyReference.cache new file mode 100644 index 0000000..418d558 Binary files /dev/null and b/RDPAddins.Common/obj/Debug/RDPAddins.Common.csprojAssemblyReference.cache differ diff --git a/RDPAddins.Common/obj/Debug/RDPAddins.Common.dll b/RDPAddins.Common/obj/Debug/RDPAddins.Common.dll new file mode 100644 index 0000000..7d673f5 Binary files /dev/null and b/RDPAddins.Common/obj/Debug/RDPAddins.Common.dll differ diff --git a/RDPAddins.Common/obj/Debug/RDPAddins.Common.pdb b/RDPAddins.Common/obj/Debug/RDPAddins.Common.pdb new file mode 100644 index 0000000..d7261ed Binary files /dev/null and b/RDPAddins.Common/obj/Debug/RDPAddins.Common.pdb differ diff --git a/RDPAddins.Core/EntryPoint.cs b/RDPAddins.Core/EntryPoint.cs new file mode 100644 index 0000000..63bafa3 --- /dev/null +++ b/RDPAddins.Core/EntryPoint.cs @@ -0,0 +1,49 @@ +using System; +using System.Reflection; +using System.Threading; +using System.IO; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace RDPAddins.Core +{ + class EntryPoint + { + static readonly string AssemblyName = "RDPAddins.exe"; + static readonly string AssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + static readonly string AssemblyFullPath = Path.Combine(AssemblyPath, AssemblyName); + static readonly string ConfigFileFullPath = string.Format("{0}.config", AssemblyFullPath); + + [ExportDll("VirtualChannelEntry", CallingConvention.StdCall)] + public static bool VirtualChannelEntry(IntPtr entry) + { + try + { + ManualResetEvent wait = new ManualResetEvent(false); + AppDomain app = null; + var thread = new Thread(() => + { + + app = AppDomain.CreateDomain(AssemblyName, null, + new AppDomainSetup() + { + ApplicationBase = AssemblyName, + ApplicationName = AssemblyPath, + ConfigurationFile = ConfigFileFullPath + }); + app.SetData("entry", entry); + app.SetData("event", wait); + app.ExecuteAssembly(AssemblyFullPath); + }); + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); + wait.WaitOne(); + return (bool)app.GetData("ret"); + } + catch (Exception ex) + { + return false; + } + } + } +} \ No newline at end of file diff --git a/RDPAddins.Core/Properties/AssemblyInfo.cs b/RDPAddins.Core/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f47cc5e --- /dev/null +++ b/RDPAddins.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("RDPAddins.Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RDPAddins")] +[assembly: AssemblyCopyright("© Selvin 2011. All rights reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c5571e1f-2df8-490c-9ed0-6a3d9ca518bc")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.2.1.0")] +[assembly: AssemblyFileVersion("0.2.1.0")] diff --git a/RDPAddins.Core/RDPAddins.Core.csproj b/RDPAddins.Core/RDPAddins.Core.csproj new file mode 100644 index 0000000..58b2e20 --- /dev/null +++ b/RDPAddins.Core/RDPAddins.Core.csproj @@ -0,0 +1,85 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {7017A40B-F535-4E3F-972D-BB89F3A44640} + Library + Properties + RDPAddins.Core + RDPAddins.Core + v4.0 + SAK + SAK + SAK + SAK + + + true + full + false + ..\bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\bin\Release\ + TRACE + prompt + 4 + + + true + ..\bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + + + ..\bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + false + false + false + + + OnBuildSuccess + + + true + + + ..\RDPAddins.snk + + + + ..\Tools\ExportDllAttribute.dll + + + + + + + + + "$(SolutionDir)Tools\ExportDll.exe" "$(TargetPath)" /$(ConfigurationName) /$(PlatformName) +"$(FrameworkSDKDir)Bin\sn.exe" -R "$(TargetPath)" "$(ProjectDir)..\RDPAddins.snk" + + + \ No newline at end of file diff --git a/RDPAddins.Core/RDPAddins.Core.csproj.vspscc b/RDPAddins.Core/RDPAddins.Core.csproj.vspscc new file mode 100644 index 0000000..b6d3289 --- /dev/null +++ b/RDPAddins.Core/RDPAddins.Core.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/RDPAddins.Core/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs b/RDPAddins.Core/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs new file mode 100644 index 0000000..5d01041 --- /dev/null +++ b/RDPAddins.Core/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] diff --git a/RDPAddins.Core/obj/Debug/RDPAddins.Core.csprojAssemblyReference.cache b/RDPAddins.Core/obj/Debug/RDPAddins.Core.csprojAssemblyReference.cache new file mode 100644 index 0000000..3e83088 Binary files /dev/null and b/RDPAddins.Core/obj/Debug/RDPAddins.Core.csprojAssemblyReference.cache differ diff --git a/RDPAddins.Core/obj/x64/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs b/RDPAddins.Core/obj/x64/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs new file mode 100644 index 0000000..5d01041 --- /dev/null +++ b/RDPAddins.Core/obj/x64/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] diff --git a/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.CopyComplete b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.CoreCompileInputs.cache b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7924fe2 --- /dev/null +++ b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +1f0e69ff174c1a04a91442210a793ab6eeb80766 diff --git a/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.FileListAbsolute.txt b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..a6679a8 --- /dev/null +++ b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +/home/haraldwolff/src/dotnet/RDPAddins/bin/x64/Debug/RDPAddins.Core.dll +/home/haraldwolff/src/dotnet/RDPAddins/bin/x64/Debug/RDPAddins.Core.pdb +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csprojAssemblyReference.cache +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.CoreCompileInputs.cache +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csproj.CopyComplete +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.dll +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.pdb diff --git a/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csprojAssemblyReference.cache b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csprojAssemblyReference.cache new file mode 100644 index 0000000..f26df13 Binary files /dev/null and b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.csprojAssemblyReference.cache differ diff --git a/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.dll b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.dll new file mode 100644 index 0000000..15fec74 Binary files /dev/null and b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.dll differ diff --git a/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.pdb b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.pdb new file mode 100644 index 0000000..dab8510 Binary files /dev/null and b/RDPAddins.Core/obj/x64/Debug/RDPAddins.Core.pdb differ diff --git a/RDPAddins.CoreC/RDPAddins.CoreC.cpp b/RDPAddins.CoreC/RDPAddins.CoreC.cpp new file mode 100644 index 0000000..c8d218b --- /dev/null +++ b/RDPAddins.CoreC/RDPAddins.CoreC.cpp @@ -0,0 +1,90 @@ +#define _WIN32_WINNT 0x501 +#include +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include + +static HINSTANCE hDynImageBase = NULL; +WCHAR clrversion[] = L"v4.0.30319"; +WCHAR dllname[] = L"RDPAddins.exe"; +WCHAR classname[] = L"RDPAddins.Program"; +WCHAR functionname[] = L"MainC"; +TCHAR path[MAX_PATH]; +ICLRRuntimeHost* runtimeHost = NULL; +ICLRRuntimeInfo* runtimeInfo = NULL; +ICLRMetaHost* metaHost = NULL; + +BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints) +{ + + HRESULT hr = CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (LPVOID*)&metaHost); + if(SUCCEEDED(hr)) + { + hr = metaHost->GetRuntime(clrversion, IID_ICLRRuntimeInfo,(LPVOID*)&runtimeInfo); + if (SUCCEEDED(hr)) + { + + hr = runtimeInfo->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (LPVOID*) &runtimeHost); + if (SUCCEEDED(hr)) + { + hr = runtimeHost->Start(); + if (SUCCEEDED(hr)) + { + DWORD retCode = 0; + WCHAR entry[255]; + unsigned int r = (unsigned int)pEntryPoints; + int c = -1; + do + { + entry[++c] = r % 10 + 48; + r = r / 10; + } + while(r > 0); + entry[++c] = L'\0'; + GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCWSTR)&hDynImageBase, &hDynImageBase); + DWORD ret = GetModuleFileName(hDynImageBase, path, MAX_PATH); + while(path[ret] != L'\\') + ret--; + c = -1; + do + { + path[++ret] = dllname[++c]; + } + while(dllname[c]); + path[++ret] = L'\0'; + hr = runtimeHost->ExecuteInDefaultAppDomain(path, classname, functionname, entry, &retCode); + if(SUCCEEDED(hr)) + return retCode; + } + } + } + } + return FALSE; +} + +extern "C" BOOL WINAPI _DllMainCRTStartup(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + break; + case DLL_PROCESS_DETACH: + if(runtimeHost != NULL) + { + runtimeHost->Stop(); + runtimeHost->Release(); + } + if(runtimeInfo!= NULL) + runtimeInfo->Release(); + if(metaHost!=NULL) + metaHost->Release(); + break; + } + return TRUE; +} + + diff --git a/RDPAddins.CoreC/RDPAddins.CoreC.def b/RDPAddins.CoreC/RDPAddins.CoreC.def new file mode 100644 index 0000000..db9fccd --- /dev/null +++ b/RDPAddins.CoreC/RDPAddins.CoreC.def @@ -0,0 +1,3 @@ +LIBRARY +EXPORTS + VirtualChannelEntry diff --git a/RDPAddins.CoreC/RDPAddins.CoreC.rc b/RDPAddins.CoreC/RDPAddins.CoreC.rc new file mode 100644 index 0000000..5c69673 Binary files /dev/null and b/RDPAddins.CoreC/RDPAddins.CoreC.rc differ diff --git a/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj b/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj new file mode 100644 index 0000000..c568da9 --- /dev/null +++ b/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj @@ -0,0 +1,178 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {EE62637C-C9C7-42ED-A13D-92076B41B494} + SAK + SAK + SAK + SAK + Win32Proj + RDPAddinsCoreC + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + false + $(SolutionDir)bin\$(Configuration)\ + false + + + false + $(SolutionDir)bin\$(Configuration)\ + false + + + false + false + $(SolutionDir)bin\$(Configuration)\ + + + false + false + $(SolutionDir)bin\x64\$(Configuration)\ + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;RDPADDINSCOREC_EXPORTS;%(PreprocessorDefinitions) + false + Default + + + Windows + true + RDPAddins.CoreC.def + mscoree.lib;%(AdditionalDependencies) + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;RDPADDINSCOREC_EXPORTS;%(PreprocessorDefinitions) + false + Default + + + Windows + true + RDPAddins.CoreC.def + mscoree.lib;%(AdditionalDependencies) + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;RDPADDINSCOREC_EXPORTS;%(PreprocessorDefinitions) + false + + + Windows + false + true + true + RDPAddins.CoreC.def + mscoree.lib;%(AdditionalDependencies) + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;RDPADDINSCOREC_EXPORTS;%(PreprocessorDefinitions) + false + + + Windows + false + true + true + RDPAddins.CoreC.def + mscoree.lib;%(AdditionalDependencies) + true + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj.filters b/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj.filters new file mode 100644 index 0000000..799a82d --- /dev/null +++ b/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj.filters @@ -0,0 +1,37 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + + + Source Files + + + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj.vspscc b/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj.vspscc new file mode 100644 index 0000000..b6d3289 --- /dev/null +++ b/RDPAddins.CoreC/RDPAddins.CoreC.vcxproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/RDPAddins.CoreC/resource.h b/RDPAddins.CoreC/resource.h new file mode 100644 index 0000000..bed3151 --- /dev/null +++ b/RDPAddins.CoreC/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by RDPAddins.CoreC.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/RDPAddins.sln b/RDPAddins.sln new file mode 100644 index 0000000..02776e0 --- /dev/null +++ b/RDPAddins.sln @@ -0,0 +1,174 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RDPAddins.Core", "RDPAddins.Core\RDPAddins.Core.csproj", "{7017A40B-F535-4E3F-972D-BB89F3A44640}" + ProjectSection(ProjectDependencies) = postProject + {EC8481C3-F82F-4F3C-84E2-6732750B6542} = {EC8481C3-F82F-4F3C-84E2-6732750B6542} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RDPAddins.Common", "RDPAddins.Common\RDPAddins.Common.csproj", "{EC8481C3-F82F-4F3C-84E2-6732750B6542}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RDPAddins", "RDPAddins\RDPAddins.csproj", "{4345A357-B6D6-49A8-98CD-7D0D6708AC17}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FileTransfer", "FileTransfer", "{BDBFE621-A03E-4887-8E5A-516C35595AAB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{73B5FCE1-65EB-4B1E-BC5B-43FDCE94DECC}" + ProjectSection(SolutionItems) = preProject + Tools\ExportDll.exe = Tools\ExportDll.exe + Tools\ExportDll.exe.config = Tools\ExportDll.exe.config + Tools\ExportDllAttribute.dll = Tools\ExportDllAttribute.dll + Tools\README.txt = Tools\README.txt + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileTransferAddin", "FileTransfer\FileTransferAddin\FileTransferAddin.csproj", "{68857642-A724-46A4-85B3-DAE2BD80498E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileTransferServer", "FileTransfer\FileTransferServer\FileTransferServer.csproj", "{DB1D00FA-A8A4-4F01-931E-52686F51265E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installer", "Installer", "{FDCEC69D-3E1B-4EA1-BADE-30228114087D}" + ProjectSection(SolutionItems) = preProject + Installer\RDPAddins.iss = Installer\RDPAddins.iss + Installer\RDPAddinsC.iss = Installer\RDPAddinsC.iss + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{63EFA535-ACBB-4265-9241-7BECB3989B1E}" + ProjectSection(SolutionItems) = preProject + RDPAddins.snk = RDPAddins.snk + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RDPAddins.CoreC", "RDPAddins.CoreC\RDPAddins.CoreC.vcxproj", "{EE62637C-C9C7-42ED-A13D-92076B41B494}" +EndProject +Global + GlobalSection(TeamFoundationVersionControl) = preSolution + SccNumberOfProjects = 7 + SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} + SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs21 + SccLocalPath0 = . + SccProjectUniqueName1 = FileTransfer\\FileTransferAddin\\FileTransferAddin.csproj + SccProjectTopLevelParentUniqueName1 = RDPAddins.sln + SccProjectName1 = FileTransfer/FileTransferAddin + SccLocalPath1 = FileTransfer\\FileTransferAddin + SccProjectUniqueName2 = FileTransfer\\FileTransferServer\\FileTransferServer.csproj + SccProjectTopLevelParentUniqueName2 = RDPAddins.sln + SccProjectName2 = FileTransfer/FileTransferServer + SccLocalPath2 = FileTransfer\\FileTransferServer + SccProjectUniqueName3 = RDPAddins.Common\\RDPAddins.Common.csproj + SccProjectName3 = RDPAddins.Common + SccLocalPath3 = RDPAddins.Common + SccProjectUniqueName4 = RDPAddins.Core\\RDPAddins.Core.csproj + SccProjectName4 = RDPAddins.Core + SccLocalPath4 = RDPAddins.Core + SccProjectUniqueName5 = RDPAddins\\RDPAddins.csproj + SccProjectName5 = RDPAddins + SccLocalPath5 = RDPAddins + SccProjectUniqueName6 = RDPAddins.CoreC\\RDPAddins.CoreC.vcxproj + SccProjectName6 = RDPAddins.CoreC + SccLocalPath6 = RDPAddins.CoreC + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Debug|Mixed Platforms.Build.0 = Debug|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Debug|Win32.ActiveCfg = Debug|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Debug|Win32.Build.0 = Debug|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Debug|x64.ActiveCfg = Debug|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Debug|x64.Build.0 = Debug|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Release|Any CPU.Build.0 = Release|Any CPU + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Release|Mixed Platforms.Build.0 = Release|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Release|Win32.ActiveCfg = Release|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Release|x64.ActiveCfg = Release|x64 + {7017A40B-F535-4E3F-972D-BB89F3A44640}.Release|x64.Build.0 = Release|x64 + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Debug|Win32.ActiveCfg = Debug|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Debug|Win32.Build.0 = Debug|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Debug|x64.ActiveCfg = Debug|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Debug|x64.Build.0 = Debug|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Release|Any CPU.Build.0 = Release|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Release|Win32.ActiveCfg = Release|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Release|x64.ActiveCfg = Release|Any CPU + {EC8481C3-F82F-4F3C-84E2-6732750B6542}.Release|x64.Build.0 = Release|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Debug|Win32.ActiveCfg = Debug|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Debug|Win32.Build.0 = Debug|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Debug|x64.ActiveCfg = Debug|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Debug|x64.Build.0 = Debug|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Release|Any CPU.Build.0 = Release|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Release|Win32.ActiveCfg = Release|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Release|x64.ActiveCfg = Release|Any CPU + {4345A357-B6D6-49A8-98CD-7D0D6708AC17}.Release|x64.Build.0 = Release|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Debug|Win32.Build.0 = Debug|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Debug|x64.ActiveCfg = Debug|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Debug|x64.Build.0 = Debug|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Release|Any CPU.Build.0 = Release|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Release|Win32.ActiveCfg = Release|Any CPU + {68857642-A724-46A4-85B3-DAE2BD80498E}.Release|x64.ActiveCfg = Release|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Debug|Win32.Build.0 = Debug|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Debug|x64.ActiveCfg = Debug|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Debug|x64.Build.0 = Debug|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Release|Any CPU.Build.0 = Release|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Release|Win32.ActiveCfg = Release|Any CPU + {DB1D00FA-A8A4-4F01-931E-52686F51265E}.Release|x64.ActiveCfg = Release|Any CPU + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Debug|Any CPU.Build.0 = Debug|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Debug|Win32.ActiveCfg = Debug|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Debug|Win32.Build.0 = Debug|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Debug|x64.ActiveCfg = Debug|x64 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Debug|x64.Build.0 = Debug|x64 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Release|Any CPU.ActiveCfg = Release|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Release|Any CPU.Build.0 = Release|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Release|Mixed Platforms.Build.0 = Release|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Release|Win32.ActiveCfg = Release|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Release|Win32.Build.0 = Release|Win32 + {EE62637C-C9C7-42ED-A13D-92076B41B494}.Release|x64.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {68857642-A724-46A4-85B3-DAE2BD80498E} = {BDBFE621-A03E-4887-8E5A-516C35595AAB} + {DB1D00FA-A8A4-4F01-931E-52686F51265E} = {BDBFE621-A03E-4887-8E5A-516C35595AAB} + EndGlobalSection +EndGlobal diff --git a/RDPAddins.sln.DotSettings.user b/RDPAddins.sln.DotSettings.user new file mode 100644 index 0000000..d68f017 --- /dev/null +++ b/RDPAddins.sln.DotSettings.user @@ -0,0 +1,3 @@ + + True + True \ No newline at end of file diff --git a/RDPAddins.snk b/RDPAddins.snk new file mode 100644 index 0000000..889b724 Binary files /dev/null and b/RDPAddins.snk differ diff --git a/RDPAddins.vssscc b/RDPAddins.vssscc new file mode 100644 index 0000000..6cb031b --- /dev/null +++ b/RDPAddins.vssscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT" +} diff --git a/RDPAddins/About.Designer.cs b/RDPAddins/About.Designer.cs new file mode 100644 index 0000000..8a0e69e --- /dev/null +++ b/RDPAddins/About.Designer.cs @@ -0,0 +1,86 @@ +namespace RDPAddins +{ + partial class frmAbout + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmAbout)); + this.btOK = new System.Windows.Forms.Button(); + this.lblName = new System.Windows.Forms.Label(); + this.lblRights = new System.Windows.Forms.Label(); + this.lblWer = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // btOK + // + this.btOK.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.btOK, "btOK"); + this.btOK.Name = "btOK"; + // + // lblName + // + resources.ApplyResources(this.lblName, "lblName"); + this.lblName.Name = "lblName"; + // + // lblRights + // + resources.ApplyResources(this.lblRights, "lblRights"); + this.lblRights.Name = "lblRights"; + // + // lblWer + // + resources.ApplyResources(this.lblWer, "lblWer"); + this.lblWer.Name = "lblWer"; + // + // frmAbout + // + this.CancelButton = this.btOK; + resources.ApplyResources(this, "$this"); + this.Controls.Add(this.btOK); + this.Controls.Add(this.lblWer); + this.Controls.Add(this.lblRights); + this.Controls.Add(this.lblName); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "frmAbout"; + this.ShowInTaskbar = false; + this.TopMost = true; + this.Load += new System.EventHandler(this.frmAbout_Load); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label lblName; + private System.Windows.Forms.Label lblRights; + private System.Windows.Forms.Label lblWer; + private System.Windows.Forms.Button btOK; + } +} \ No newline at end of file diff --git a/RDPAddins/About.cs b/RDPAddins/About.cs new file mode 100644 index 0000000..ef43011 --- /dev/null +++ b/RDPAddins/About.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace RDPAddins +{ + partial class frmAbout : Form + { + public frmAbout() + { + InitializeComponent(); + } + + private void frmAbout_Load(object sender, System.EventArgs e) + { + this.lblWer.Text += System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + } +} \ No newline at end of file diff --git a/RDPAddins/About.pl-PL.resx b/RDPAddins/About.pl-PL.resx new file mode 100644 index 0000000..39afd27 --- /dev/null +++ b/RDPAddins/About.pl-PL.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + © 2010 Selvin. Wszelkie prawa zastrzeżone. + + + Wersja: + + + O programie..... + + \ No newline at end of file diff --git a/RDPAddins/About.resx b/RDPAddins/About.resx new file mode 100644 index 0000000..27201d3 --- /dev/null +++ b/RDPAddins/About.resx @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 208, 9 + + + 75, 23 + + + + 0 + + + OK + + + btOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 12, 9 + + + 120, 16 + + + 3 + + + RDPAddins Framework + + + lblName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 12, 41 + + + 283, 16 + + + 2 + + + © 2010 Selvin. All right reserved. + + + lblRights + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 12, 25 + + + 128, 16 + + + 1 + + + Version: + + + lblWer + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + 303, 70 + + + + CenterParent + + + About... + + + frmAbout + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RDPAddins/Channel.cs b/RDPAddins/Channel.cs new file mode 100644 index 0000000..4e29981 --- /dev/null +++ b/RDPAddins/Channel.cs @@ -0,0 +1,318 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.Drawing; +using Win32.WtsApi32; +using System.Threading; +using System.ComponentModel; +using RDPAddins.Common; + +namespace RDPAddins +{ + internal class Channel: IChannel, IUI + { + uint openChannel = 0; + ChannelOpenEventDelegate channelOpenEventDelegate; + ManualResetEvent write = new ManualResetEvent(true); + internal object tooltipconext = null; + Queue buffers = new Queue(); + object readlock = new object(); + + public event EventHandler Connected; + public event EventHandler Disconnected; + public event EventHandler Terminated; + public event DataArrivedHandler DataArrived; + public event BalloonTipClickedHandler BalloonTipClicked; + public Lazy Addin; + + public Channel(RDPClient client, Lazy addin) + { + Client = client; + Addin = addin; + Addin.Value.Initialize(this); + ChannelDef = new ChannelDef(){name = Metadata.ChannelName, options = Metadata.ChannelOptions }; + channelOpenEventDelegate = new ChannelOpenEventDelegate(VirtualChannelOpenEvent); + } + + internal ChannelDef ChannelDef; + + public IChannel Parent { get { return this; } } + + public bool Visible + { + get + { + if (Page != null) + return TabCtrl.TabPages.Contains(Page); + return false; + } + set + { + if (Page != null) + { + if (value) + { + if (!TabCtrl.TabPages.Contains(Page)) + TabCtrl.TabPages.Add(Page); + + } + else + { + if (TabCtrl.TabPages.Contains(Page)) + TabCtrl.TabPages.Remove(Page); + } + } + } + } + + private void VirtualChannelOpenEvent(uint openHandle, ChannelEvents openEvent, byte[] data, uint dataLength, uint totalLength, ChannelFlags dataFlags) + { + switch (openEvent) + { + case ChannelEvents.DataRecived: + int flag = (int)(dataFlags & ChannelFlags.Only); + WriteCore(data, dataLength); + OnDataArrived(dataLength, totalLength, (DataParts)flag); + break; + case ChannelEvents.WriteComplete: + write.Set(); + break; + } + } + + void WriteCore(byte[] data, uint count) + { + var mem = AllocateMemoryChunk(count); + Buffer.BlockCopy(data, 0, mem.Buffer, 0, (int)count); + lock (readlock) + { + buffers.Enqueue(mem); + AvailableDataLength += count; + } + } + + + + public void Write(byte[] data, int offset, int count) + { + byte[] buff = data; + if (offset != 0) + { + buff = new byte[count]; + Buffer.BlockCopy(data, offset, buff, 0, count); + } + write.Reset(); + ChannelReturnCodes ret = Client.EntryPoint.VirtualChannelWrite(openChannel, buff, (uint)count, IntPtr.Zero); + write.WaitOne(); + } + + + public int Read(byte[] buffer, int offset, int count) + { + if (AvailableDataLength > 0) + { + int toread = 0; + lock (readlock) + { + + if (buffers.Count != 0) + { + var buf = buffers.Peek(); + toread = buf.Buffer.Length - buf.Offset; + int off = buf.Offset; + if (count >= toread) + buffers.Dequeue(); + else + { + toread = count; + buf.Offset += toread; + } + Buffer.BlockCopy(buf.Buffer, off, buffer, offset, toread); + AvailableDataLength -= (uint)toread; + } + return toread; + } + } + return 0; + } + + + TabPage Page = null; + TabControl TabCtrl = null; + RDPClient Client = null; + + + public uint AvailableDataLength { get; private set; } + + + internal ChannelReturnCodes ConnectedInternal(IntPtr Handle) + { + ChannelReturnCodes ret = Client.EntryPoint.VirtualChannelOpen(Handle, ref openChannel, Addin.Metadata.ChannelName, channelOpenEventDelegate); + if (ret == ChannelReturnCodes.Ok) + OnConnected(this, new EventArgs()); + return ret; + } + + internal void DisconnectedInternal() + { + openChannel = 0; + OnDisconnected(this, new EventArgs()); + if (Stream != null) + { + Stream.Dispose(); + Stream = null; + } + } + + protected virtual void OnConnected(object sender, EventArgs e) + { + if (Connected != null) + DoOnUIThread(() => Connected(sender, e)); + } + + protected virtual void OnDisconnected(object sender, EventArgs e) + { + if (Disconnected != null) + DoOnUIThread(() => Disconnected(sender, e)); + } + + protected virtual void OnTerminated(object sender, EventArgs e) + { + if (Terminated != null) + DoOnUIThread(() => Terminated(sender, e)); + } + + internal void TerminatedInternal() + { + OnTerminated(this, new EventArgs()); + } + + protected virtual void OnInitialized(object sender, EventArgs e) + { + if (Initialized != null) + DoOnUIThread(() => Initialized(sender, e)); + } + + internal void InitializedInternal() + { + OnInitialized(this, new EventArgs()); + } + + public void ShowControl() + { + if (Page != null) + { + Client.MainForm.Visible = true; + Client.MainForm.Tab.SelectTab(Page); + } + } + + public void DoOnUIThread(Action action) + { + if (Client.MainForm.InvokeRequired) + Client.MainForm.Invoke(action); + else + action(); + } + + public void ShowBalloonTip(int timeout, string tipTitle, string tipText, ToolTipIcon tipIcon, object context) + { + tooltipconext = context; + Client.MainForm.ShowToolTip(timeout, tipTitle, tipText, tipIcon, this); + } + + protected virtual void OnDataArrived(uint dataLength, uint totalLength, DataParts dataFlags) + { + if (DataArrived != null) + DoOnUIThread(() => DataArrived(dataLength, totalLength, dataFlags)); + } + + internal protected virtual void OnBalloonTipClicked(object sender, EventArgs e) + { + if (BalloonTipClicked != null) + DoOnUIThread(() => BalloonTipClicked(this, tooltipconext)); + } + + private MemoryChunk AllocateMemoryChunk(uint newSize) + { + MemoryChunk chunk = new MemoryChunk(newSize); + return chunk; + } + + ChannelStream Stream = null; + + private class MemoryChunk + { + internal byte[] Buffer; + internal int Offset = 0; + internal MemoryChunk(uint bufferSize) + { + Buffer = new byte[bufferSize]; + Offset = 0; + } + } + + + public event EventHandler Initialized; + + public Stream GetStream() + { + Stream = Stream ?? new ChannelStream(this); + return Stream; + } + + public IAddinMetadata Metadata { get { return Addin.Metadata; } } + + public IUI UI { get { return this; } } + + + public event ControlCreatingHandler ControlCreating; + public event MenuCreatingHandler MenuCreating; + public event MenuCreatingHandler TrayMenuCreating; + public event IconCreatingHandler IconCreating; + + internal void CreateUI() + { + if (ControlCreating != null) + { + var control = ControlCreating(this); + if (control != null) + { + Page = new TabPage(Metadata.AddinName); + TabCtrl = Page.Parent as TabControl; + control.Dock = DockStyle.Fill; + Page.Controls.Add(control); + Client.MainForm.Tab.TabPages.Add(Page); + Image icon = null; + if (IconCreating != null) + icon = IconCreating(this); + Page.ImageIndex = Client.MainForm.AddImage(icon); + } + } + if (MenuCreating != null) + { + var menu = MenuCreating(this); + if (menu != null) + { + var parentmenu = new MenuItem(Metadata.AddinName); + parentmenu.MenuItems.AddRange(menu.MenuItems.Cast().ToArray()); + Client.MainForm.MenuAddins.MenuItems.Add(parentmenu); + } + } + if (TrayMenuCreating != null) + { + var menu = TrayMenuCreating(this); + if (menu != null) + { + var parentmenu = new MenuItem(Metadata.AddinName); + parentmenu.MenuItems.AddRange(menu.MenuItems.Cast().ToArray()); + Client.MainForm.mnuAddinsContext.MenuItems.Add(parentmenu); + } + } + } + } +} + diff --git a/RDPAddins/ChannelStream.cs b/RDPAddins/ChannelStream.cs new file mode 100644 index 0000000..1b8c7b8 --- /dev/null +++ b/RDPAddins/ChannelStream.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using RDPAddins.Common; +using System.Runtime; + +namespace RDPAddins +{ + internal class ChannelStream: Stream + { + public ChannelStream(IChannel channel) : base() { Channel = channel; } + IChannel Channel; + public override bool CanRead { get { return true; } } + public override bool CanSeek { get { return false; } } + public override bool CanWrite { get { return true; } } + public override void Flush() { } + public override long Length { get { throw new NotImplementedException(); } } + public override long Seek(long offset, SeekOrigin origin) { throw new NotImplementedException(); } + public override void SetLength(long value) { throw new NotImplementedException(); } + [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] + public override int Read(byte[] buffer, int offset, int count) { return Channel.Read(buffer, offset, count); } + [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] + public override void Write(byte[] buffer, int offset, int count) { Channel.Write(buffer, offset, count); } + public override long Position + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + } +} diff --git a/RDPAddins/MasterMode.Designer.cs b/RDPAddins/MasterMode.Designer.cs new file mode 100644 index 0000000..b8aba80 --- /dev/null +++ b/RDPAddins/MasterMode.Designer.cs @@ -0,0 +1,74 @@ +namespace RDPAddins +{ + partial class MasterMode + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(114, 66); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(139, 13); + this.label1.TabIndex = 0; + this.label1.Text = "some day it will be a setup..."; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(267, 141); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 1; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(545, 358); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; + } +} + diff --git a/RDPAddins/MasterMode.cs b/RDPAddins/MasterMode.cs new file mode 100644 index 0000000..b9819cc --- /dev/null +++ b/RDPAddins/MasterMode.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace RDPAddins +{ + internal partial class MasterMode : Form + { + public MasterMode() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/RDPAddins/MasterMode.resx b/RDPAddins/MasterMode.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RDPAddins/MasterMode.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RDPAddins/Program.cs b/RDPAddins/Program.cs new file mode 100644 index 0000000..6c10867 --- /dev/null +++ b/RDPAddins/Program.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using System.Security.Principal; +using System.Diagnostics; +using System.ComponentModel; +using Win32.WtsApi32; +using System.Reflection; +using System.Threading; +using System.IO; + +namespace RDPAddins +{ + public class Program + { + static System.Configuration.Configuration Configuration = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None); + /// + /// The main entry point for the application. + /// + [STAThread] + public static void Main(string[] args) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + var entry = AppDomain.CurrentDomain.GetData("entry"); + if (entry != null) + { + var Client = new RDPClient(); + Client.MainForm = new SlaveMode(Client); + Client.MainForm.Load += new EventHandler((sender, e) => + { + ChannelReturnCodes ret = Client.Initialize(Assembly.GetExecutingAssembly().Location, (IntPtr)entry); + AppDomain.CurrentDomain.SetData("ret", ret == ChannelReturnCodes.Ok); + ((ManualResetEvent)AppDomain.CurrentDomain.GetData("event")).Set(); + if (ret != ChannelReturnCodes.Ok) + { + MessageBox.Show("VirtualChannelInit error.\n" + ret.ToString(), "RDPAddins", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + } + }); + Application.Run(Client.MainForm); + } + else + { + //WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); + //if (!pricipal.IsInRole(WindowsBuiltInRole.Administrator)) + //{ + // ProcessStartInfo processInfo = new ProcessStartInfo(); + // processInfo.Verb = "runas"; + // processInfo.Arguments = string.Join(" ", args); + // processInfo.FileName = Application.ExecutablePath; + // try + // { + // Process.Start(processInfo); + // } + // catch (Win32Exception) + // { + // } + //} + //else + Application.Run(new MasterMode()); + } + } + [STAThread] + public static int MainC(string args) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + var entry = new IntPtr(long.Parse(new string(args.Reverse().ToArray()))); + ManualResetEvent wait = new ManualResetEvent(false); + int mainret = 1; + var thread = new Thread(() => + { + var Client = new RDPClient(); + Client.MainForm = new SlaveMode(Client); + Client.MainForm.Load += new EventHandler((sender, e) => + { + + ChannelReturnCodes ret = Client.Initialize(Assembly.GetExecutingAssembly().Location, entry); + wait.Set(); + if (ret != ChannelReturnCodes.Ok) + { + mainret = 0; + MessageBox.Show("VirtualChannelInit error.\n" + ret.ToString(), "RDPAddins", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + } + }); + Application.Run(Client.MainForm); + }); + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); + wait.WaitOne(); + return mainret; + } + } +} diff --git a/RDPAddins/Properties/AssemblyInfo.cs b/RDPAddins/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..79b9aa6 --- /dev/null +++ b/RDPAddins/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("RDPAddins")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RDPAddins")] +[assembly: AssemblyCopyright("© Selvin 2011. All rights reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4a49ae38-0071-4836-b31d-a6009d719495")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.2.1.0")] +[assembly: AssemblyFileVersion("0.2.1.0")] diff --git a/RDPAddins/Properties/Resources.Designer.cs b/RDPAddins/Properties/Resources.Designer.cs new file mode 100644 index 0000000..19be017 --- /dev/null +++ b/RDPAddins/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace RDPAddins.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RDPAddins.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/RDPAddins/Properties/Resources.resx b/RDPAddins/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/RDPAddins/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RDPAddins/RDPAddins.csproj b/RDPAddins/RDPAddins.csproj new file mode 100644 index 0000000..d71a7f1 --- /dev/null +++ b/RDPAddins/RDPAddins.csproj @@ -0,0 +1,122 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {4345A357-B6D6-49A8-98CD-7D0D6708AC17} + WinExe + Properties + RDPAddins + RDPAddins + v4.0 + + + 512 + SAK + SAK + SAK + SAK + + + AnyCPU + ..\bin\Debug\ + + + AnyCPU + ..\bin\Release\ + + + true + + + ..\RDPAddins.snk + + + + + + + + + + + + + + + + + + Form + + + MasterMode.cs + + + Form + + + About.cs + + + Form + + + SlaveMode.cs + + + + + + + MasterMode.cs + Designer + + + About.cs + Designer + + + About.cs + Designer + + + SlaveMode.cs + Designer + + + SlaveMode.cs + Designer + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + + + {EC8481C3-F82F-4F3C-84E2-6732750B6542} + RDPAddins.Common + + + + + + + + \ No newline at end of file diff --git a/RDPAddins/RDPAddins.csproj.vspscc b/RDPAddins/RDPAddins.csproj.vspscc new file mode 100644 index 0000000..b6d3289 --- /dev/null +++ b/RDPAddins/RDPAddins.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/RDPAddins/RDPClient.cs b/RDPAddins/RDPClient.cs new file mode 100644 index 0000000..0692b45 --- /dev/null +++ b/RDPAddins/RDPClient.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Win32.WtsApi32; +using System.Windows.Forms; +using System.ComponentModel.Composition.Hosting; +using System.ComponentModel.Composition; +using System.IO; +using System.Runtime.InteropServices; +using System.Drawing; +using RDPAddins.Common; + +namespace RDPAddins +{ + class RDPClient + { + IntPtr initHandle = IntPtr.Zero; + ChannelInitEventDelegate channelInitEventDelegate; + + [ImportMany(typeof(IAddin))] + IEnumerable> Addins { get; set; } + + List Channels; + public ChannelEntryPoints EntryPoint { get; private set; } + + internal SlaveMode MainForm { get; set; } + + RDPClient Client; + + public ChannelReturnCodes Initialize(string Path, IntPtr entry) + { + Client = this; + var pluginspath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Path), "Plugins"); + try + { + if (Directory.Exists(pluginspath)) + { + EntryPoint = (ChannelEntryPoints)Marshal.PtrToStructure(entry, typeof(ChannelEntryPoints)); + channelInitEventDelegate = new ChannelInitEventDelegate(VirtualChannelInitEventProc); + var batch = new CompositionBatch(); + batch.AddPart(this); + var catalog = new DirectoryCatalog(pluginspath); + var container = new CompositionContainer(catalog); + container.Compose(batch); + Channels = Addins.Select(addin => + { + return new Channel(this, addin); + }).ToList(); + Channels.ForEach(channel => + { + MainForm.Invoke(new Action(() => + { + channel.CreateUI(); + })); + }); + var cds = Channels.Select(channel => channel.ChannelDef).ToArray(); + return EntryPoint.VirtualChannelInit(ref initHandle, cds, cds.Length, 1, channelInitEventDelegate); + } + } + catch (Exception ex) { MessageBox.Show(ex.Message, "RDPAddins", MessageBoxButtons.OK, MessageBoxIcon.Error); } + return ChannelReturnCodes.NullData; + } + + void ChannelsInitialized() + { + MainForm.Invoke(new Action(() => + { + if (MainForm.Opacity == 0) + { + MainForm.Hide(); + MainForm.Opacity = 100; + } + })); + } + + void VirtualChannelInitEventProc(IntPtr initHandle, ChannelEvents initEvent, byte[] data, uint dataLength) + { + switch (initEvent) + { + case ChannelEvents.Initialized: + ChannelsInitialized(); + Client.Channels.ForEach(channel => channel.InitializedInternal()); + break; + case ChannelEvents.Connected: + string server = System.Text.Encoding.Unicode.GetString(data); + server = server.Substring(0, server.IndexOf('\0')); + Client.Channels.ForEach(channel => + { + ChannelReturnCodes ret = channel.ConnectedInternal(initHandle); + if (ret != ChannelReturnCodes.Ok) + { + MessageBox.Show(string.Format("{0}: VirtualChannelOpen error: {1}", channel.Metadata.ChannelName, ret), "RDPAddins", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + }); + MainForm.Invoke(new Action(() => + { + MainForm.Text = "RDPAddnins: " + server; + })); + + break; + case ChannelEvents.V1Connected: + MessageBox.Show("Bad RDP server version.", "RDPAddins", MessageBoxButtons.OK, MessageBoxIcon.Error); + break; + case ChannelEvents.Disconnected: + MainForm.Invoke(new Action(() => MainForm.Text = "RDPAddnins")); + Channels.ForEach(channel => channel.DisconnectedInternal()); + GC.Collect(); + GC.WaitForPendingFinalizers(); + break; + case ChannelEvents.Terminated: + Channels.ForEach(channel => channel.TerminatedInternal()); + MainForm.RealClosing = true; + MainForm.Invoke(new Action(() => MainForm.Close())); + break; + } + } + + + } +} \ No newline at end of file diff --git a/RDPAddins/Resources/AddinIcon.png b/RDPAddins/Resources/AddinIcon.png new file mode 100644 index 0000000..0be81b3 Binary files /dev/null and b/RDPAddins/Resources/AddinIcon.png differ diff --git a/RDPAddins/SlaveMode.Designer.cs b/RDPAddins/SlaveMode.Designer.cs new file mode 100644 index 0000000..0c32dc6 --- /dev/null +++ b/RDPAddins/SlaveMode.Designer.cs @@ -0,0 +1,166 @@ +namespace RDPAddins +{ + partial class SlaveMode + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SlaveMode)); + this.ilMain = new System.Windows.Forms.ImageList(this.components); + this.mnuNIContext = new System.Windows.Forms.ContextMenu(); + this.mnuNICShow = new System.Windows.Forms.MenuItem(); + this.mnuNICHide = new System.Windows.Forms.MenuItem(); + this.mnuAddinsContext = new System.Windows.Forms.MenuItem(); + this.mnuNICSeparator = new System.Windows.Forms.MenuItem(); + this.mnuNICAbout = new System.Windows.Forms.MenuItem(); + this.niMain = new System.Windows.Forms.NotifyIcon(this.components); + this.mnuMain = new System.Windows.Forms.MainMenu(this.components); + this.mnuAddins = new System.Windows.Forms.MenuItem(); + this.mnuHelp = new System.Windows.Forms.MenuItem(); + this.mnuAbout = new System.Windows.Forms.MenuItem(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.SuspendLayout(); + // + // ilMain + // + this.ilMain.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilMain.ImageStream"))); + this.ilMain.TransparentColor = System.Drawing.Color.Transparent; + this.ilMain.Images.SetKeyName(0, "niMain.Icon.ico"); + // + // mnuNIContext + // + this.mnuNIContext.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.mnuNICShow, + this.mnuNICHide, + this.mnuAddinsContext, + this.mnuNICSeparator, + this.mnuNICAbout}); + resources.ApplyResources(this.mnuNIContext, "mnuNIContext"); + // + // mnuNICShow + // + this.mnuNICShow.DefaultItem = true; + resources.ApplyResources(this.mnuNICShow, "mnuNICShow"); + this.mnuNICShow.Index = 0; + this.mnuNICShow.Click += new System.EventHandler(this.ShowMe); + // + // mnuNICHide + // + this.mnuNICHide.DefaultItem = true; + resources.ApplyResources(this.mnuNICHide, "mnuNICHide"); + this.mnuNICHide.Index = 1; + this.mnuNICHide.Click += new System.EventHandler(this.ShowMe); + // + // mnuAddinsContext + // + resources.ApplyResources(this.mnuAddinsContext, "mnuAddinsContext"); + this.mnuAddinsContext.Index = 2; + // + // mnuNICSeparator + // + resources.ApplyResources(this.mnuNICSeparator, "mnuNICSeparator"); + this.mnuNICSeparator.Index = 3; + // + // mnuNICAbout + // + resources.ApplyResources(this.mnuNICAbout, "mnuNICAbout"); + this.mnuNICAbout.Index = 4; + this.mnuNICAbout.Click += new System.EventHandler(this.mnuAbout_Click); + // + // niMain + // + resources.ApplyResources(this.niMain, "niMain"); + this.niMain.ContextMenu = this.mnuNIContext; + this.niMain.BalloonTipClicked += new System.EventHandler(this.niMain_BalloonTipClicked); + this.niMain.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.niMain_MouseDoubleClick); + // + // mnuMain + // + this.mnuMain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.mnuAddins, + this.mnuHelp}); + resources.ApplyResources(this.mnuMain, "mnuMain"); + // + // mnuAddins + // + resources.ApplyResources(this.mnuAddins, "mnuAddins"); + this.mnuAddins.Index = 0; + // + // mnuHelp + // + resources.ApplyResources(this.mnuHelp, "mnuHelp"); + this.mnuHelp.Index = 1; + this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.mnuAbout}); + // + // mnuAbout + // + resources.ApplyResources(this.mnuAbout, "mnuAbout"); + this.mnuAbout.Index = 0; + this.mnuAbout.Click += new System.EventHandler(this.mnuAbout_Click); + // + // tabControl + // + resources.ApplyResources(this.tabControl, "tabControl"); + this.tabControl.ImageList = this.ilMain; + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + // + // frmMain + // + resources.ApplyResources(this, "$this"); + this.Controls.Add(this.tabControl); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Menu = this.mnuMain; + this.Name = "frmMain"; + this.Opacity = 0D; + this.ShowInTaskbar = false; + this.TopMost = true; + this.Activated += new System.EventHandler(this.frmMain_Activated); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing); + this.VisibleChanged += new System.EventHandler(this.frmMain_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ImageList ilMain; + private System.Windows.Forms.ContextMenu mnuNIContext; + private System.Windows.Forms.MenuItem mnuNICShow; + private System.Windows.Forms.MenuItem mnuNICSeparator; + private System.Windows.Forms.MenuItem mnuNICAbout; + private System.Windows.Forms.NotifyIcon niMain; + private System.Windows.Forms.MainMenu mnuMain; + private System.Windows.Forms.MenuItem mnuHelp; + private System.Windows.Forms.MenuItem mnuAbout; + internal System.Windows.Forms.TabControl tabControl; + internal System.Windows.Forms.MenuItem mnuAddinsContext; + internal System.Windows.Forms.MenuItem mnuAddins; + private System.Windows.Forms.MenuItem mnuNICHide; + } +} \ No newline at end of file diff --git a/RDPAddins/SlaveMode.cs b/RDPAddins/SlaveMode.cs new file mode 100644 index 0000000..5442a03 --- /dev/null +++ b/RDPAddins/SlaveMode.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using RDPAddins.Common; + +namespace RDPAddins +{ + internal partial class SlaveMode : Form + { + public RDPClient Client; + + public SlaveMode() + { + InitializeComponent(); + } + + public SlaveMode(RDPClient Client) + { + this.Client = Client; + InitializeComponent(); + } + + private void frmMain_FormClosing(object sender, FormClosingEventArgs e) + { + if (!RealClosing) + { + e.Cancel = true; + Visible = false; + } + } + + public bool RealClosing { get; internal set; } + + public void ShowMe(object sender, EventArgs e) + { + Visible = !Visible; + } + + public delegate void Void(); + + + private void frmMain_VisibleChanged(object sender, EventArgs e) + { + mnuNICHide.Visible = Visible; + mnuNICShow.Visible = !Visible; + } + + Channel lastaddin = null; + + public int AddImage(Image image) + { + if (image == null) + return 0; + ilMain.Images.Add(image); + return ilMain.Images.Count - 1; + } + + public void ShowToolTip(int timeout, string tipTitle, string tipText, ToolTipIcon tipIcon, Channel addin) + { + lastaddin = addin; + niMain.ShowBalloonTip(timeout, tipTitle, tipText, tipIcon); + } + + private void mnuAbout_Click(object sender, EventArgs e) + { + (new frmAbout()).ShowDialog(this); + } + + private void niMain_MouseDoubleClick(object sender, MouseEventArgs e) + { + ShowMe(null, null); + } + + public override string Text + { + get + { + return base.Text; + } + set + { + base.Text = value; + niMain.Text = value; + } + } + + + private void frmMain_Activated(object sender, EventArgs e) + { + Bounds = new System.Drawing.Rectangle(Screen.PrimaryScreen.WorkingArea.Right - Width, Screen.PrimaryScreen.WorkingArea.Bottom - Height, Width, Height); + } + + private void niMain_BalloonTipClicked(object sender, EventArgs e) + { + if (lastaddin != null) + lastaddin.OnBalloonTipClicked(sender, e); + } + + public TabControl Tab + { + get { return tabControl; } + } + + public Menu MenuAddins + { + get { return mnuAddins; } + } + } +} \ No newline at end of file diff --git a/RDPAddins/SlaveMode.pl-PL.resx b/RDPAddins/SlaveMode.pl-PL.resx new file mode 100644 index 0000000..77c75ed --- /dev/null +++ b/RDPAddins/SlaveMode.pl-PL.resx @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAo + BAAAAk1TRnQBSQFMAwEBAAE8AQABPAEAARABAAEQAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABQAMA + ARADAAEBAQABIAYAARAiAAMEAQYDDgETAw4BEwMSARkDEgEZAxABFgMLAQ8DBAEG2AADBAEGAx0BKQMj + ATMDIwEzAyMBMwMjATMDIwEzAyMBMwMjATMDIwEzAx0BKQMEAQbMAAMWAR8DIwEzA0EBcgNVAbIDWQHM + A14B5QMtAf8DLQH/A1kB8gNXAb8DVQGyA0EBcgMjATMDFgEfxAADEAEWAzYBWQNVAbIDMgH/A1oB/wNf + Af8DNwH/A5AB/wOQAf8DPAH/A1oB/wNaAf8DMgH/A1UBsgM2AVkDEAEWwAADNgRZAfIDUAH/A1AB/wOQ + Af8DkAH/A4wB/wOQAf8DkAH/A4wB/wOQAf8DkAH/A1AB/wNLAf8DWQHyAzYBWcAAA1kBzANQAf8DkAH/ + A5AB/wOQAf8DkAH/A5AB/wOiAf8DogH/A5AB/wOQAf8DkAH/A5AB/wOQAf8DUAH/A1kBzMAAAy0B/wNn + Af8DkAH/A5oB/wPDAf8DywH/A6cB/wPYAf8D2AH/A6wB/wPLAf8DywH/A5oB/wOQAf8DZwH/Ay0B/8AA + Ay0B/wOVAf8DwgH/A7QB/wPZAf8D3QH/A90B/wPdAf8D3QH/A90B/wPdAf8D2QH/A7gB/wPCAf8DlQH/ + Ay0B/8AAAy0B/wOlAf8D2AH/A+MB/wPjAf8D0wH/A4sB/wNiAf8DYgH/A4EB/wPOAf8D4wH/A+MB/wPd + Af8DqgH/Ay0B/8AAA1oB/wPTAf8D2AH/A+gB/wPdAf8DlgH/A5AB/wOBAf8DgQH/A5AB/wOQAf8D3QH/ + A+gB/wPYAf8D0wH/A1cB/8AAA50B/wPHAf8D3wH/A+4B/wPjAf8DkAH/A5AB/wOQAf8DkAH/A5AB/wOQ + Af8D3QH/A+4B/wPfAf8DxwH/A50B/8AAA2IB7wPBAf8D8wH/A/MB/wPzAf8D1QH/A6QB/wOQAf8DkAH/ + A6QB/wPVAf8D8wH/A/MB/wPzAf8DwQH/A2IB78AAAyABLwNiAe8D1AH/A8sB/wPwAf8D+AH/A/QB/wP4 + Af8D+AH/A/QB/wP4Af8D8wH/A8sB/wPQAf8DYgHvAyABL8QAAyABLwNcAc8DxwH/A+UB/wPoAf8DywH/ + A/0B/wP9Af8DzgH/A+QB/wPlAf8DxwH/A2IB7wMgAS/QAAMgAS8DTAGPA1kBvwNcBM8B/wPPAf8DzwH/ + A1QBrwNRAZ8DMQFP5AADFgEfAykBPwMpAT8DIAEv2AABQgFNAT4HAAE+AwABKAMAAUADAAEQAwABAQEA + AQEFAAGAFwAD/wEAAfABDwYAAcABAwYAAYABAVYAAYABAQYAAeABBwYAAfwBPwYACw== + + + + Pokaż + + + Ukryj + + + Dodatki + + + O programie... + + + + + AAABAAIAEBAAAAEACABoBQAAJgAAABAQAAABACAAaAQAAI4FAAAoAAAAEAAAACAAAAABAAgAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAALGwEAGJr/wBQV/8AKy//AAcI/wB0f/8AGRv/AD1D/wCFk/8A3vHeAJHQ + kQA3iAAAndadAOr26gDX19cANoYAAC1wBACq26oAyt7CANHr0QCv0qcAKmcFAPDw8ABJUOAAcHBwAMLC + wgAvdAMA3d3dAFxcXADR0dEAAACqAAAArwAAAJEAvb29AAAAwQD3/PcAAACLAAAAvgD29vYAhMuEAAAA + tAAAAJ8AAACVAMXFxQAjVQgAxsbGAGu3XQAhTwkA5OTkAFKhMABvu2MAt7e3AGRkZACcnJwAQJARAMvL + ywA7jAcANoUAAMTExAA1hAAAk5OTAN7u2wDS0tIAjo6OAChjBgCpqakAhYWFAERERAAeSAoA8vLyAP39 + /QDDw8MA4ODgALi4uAAlWgcA2dnZAGZmZgB8fHwAMXkCAJWVlQA0ggAAioqKAM3NzQAnXgcAYmJiAOrq + 6gC2trYAIlQIACFRCQBFfyIALGsEAKenpwDe7dgANHoIAEV+NgA0gQEAbLVcACNUCAA/exwA7e3tAExM + TAAjUQ0AQYQjACBOCQBEkBoAHkkKAElQ1ABJUMUASVDZAJeXlwA5ggsA39/fAElQyAB2vmwAerNqAIjE + fwAuXRYA8fHxAD6AFwCOvnMArceoAER/MwA/ixIAnp6eAK7PmQCLy4gAgb51AEqBLABknz0ArcmhAHp6 + egDMzMwASVDKAElQzwBdp0QAR4UlAJbQkwAyfAEAxuPEAHG5ZABJUNcAaGhoAEGLDwCew5IASEhIAIaG + hgDU69EA1tbWADSCAQB6vG4AmZmZADN9AQAnYAYAJFcHAElQ3gBPgzoAx8fHAFSeMwBYWFgAIE0JAKys + rADBwcEAtMerAH/GfACDv3cAAADCAEBAQACAgIAAAACFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKmpqampqampqampqampqampqampqampqampqampqampqampqaam + pqampqamqampqamppkM0jZCnp2Q0NEOmqampphwcp6dNp6dNp6ccnqapphynp6enpzw8p6enp6ccpqYY + p1FJGZYdHXsZGVGnGKamQjNbPg4ODg4ODj6gM0Kmpm0dGxs3gkxMGCsbGw41plQ3HTAOkacYGKenDjAd + N1Q/IUtVG6enp6enp5NVSyE/NVYWFhZST6enT1IWFhZWNalBgxljJkUmJkUmdRmcQampqTMhSDChRkYr + b0ghSampqampqUc6Ky0tLTpHqampqampqampqampqampqampqan//wAA//8AAPAPAADAAwAAgAEAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAAwAMAAPAPAAD//wAAKAAAABAAAAAgAAAAAQAgAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAEwAAABMAAAAZAAAAGQAA + ABYAAAAPAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAApAAAAMwAAADMAAAAzAAAAMwAA + ADMAAAAzAAAAMwAAADMAAAApAAAABgAAAAAAAAAAAAAAAAAAAB8AAAAzMTExcj09PbI/Pz/MQUFB5UND + Q/9DQ0P/QkJC8j4+Pr89PT2yMTExcgAAADMAAAAfAAAAAAAAABYoKChZPT09skhISP9wcHD/dXV1/01N + Tf+QkJD/kJCQ/1JSUv9wcHD/cHBw/0hISP89PT2yKCgoWQAAABYoKChZQkJC8mZmZv9mZmb/kJCQ/5CQ + kP+MjIz/kJCQ/5CQkP+MjIz/kJCQ/5CQkP9mZmb/YWFh/0JCQvIoKChZPz8/zGZmZv+QkJD/kJCQ/5CQ + kP+QkJD/kJCQ/6Kiov+ioqL/kJCQ/5CQkP+QkJD/kJCQ/5CQkP9mZmb/Pz8/zENDQ/99fX3/kJCQ/5qa + mv/Dw8P/y8vL/6enp//Y2Nj/2NjY/6ysrP/Ly8v/y8vL/5qamv+QkJD/fX19/0NDQ/9DQ0P/lZWV/8LC + wv+0tLT/2dnZ/93d3f/d3d3/3d3d/93d3f/d3d3/3d3d/9nZ2f+4uLj/wsLC/5WVlf9DQ0P/Q0ND/6Wl + pf/Y2Nj/4+Pj/+Pj4//T09P/i4uL/3h4eP94eHj/gYGB/87Ozv/j4+P/4+Pj/93d3f+qqqr/Q0ND/3Bw + cP/T09P/2NjY/+jo6P/d3d3/lpaW/5CQkP+BgYH/gYGB/5CQkP+QkJD/3d3d/+jo6P/Y2Nj/09PT/21t + bf+dnZ3/x8fH/9/f3//u7u7/4+Pj/5CQkP+QkJD/kJCQ/5CQkP+QkJD/kJCQ/93d3f/u7u7/39/f/8fH + x/+dnZ3/qqqq78HBwf/z8/P/8/Pz//Pz8//V1dX/pKSk/5CQkP+QkJD/pKSk/9XV1f/z8/P/8/Pz//Pz + 8//BwcH/qqqq77Ozsy+2trbv1NTU/8vLy//w8PD/+Pj4//T09P/4+Pj/+Pj4//T09P/4+Pj/8/Pz/8vL + y//Q0ND/tra277Ozsy8AAAAAv7+/L8LCws/Hx8f/5eXl/+jo6P/Ly8v//f39//39/f/Ozs7/5OTk/+Xl + 5f/Hx8f/w8PD77+/vy8AAAAAAAAAAAAAAAAAAAAAy8vLL8zMzI/Nzc2/zs7Oz8/Pz//Pz8//z8/P/83N + za/MzMyfy8vLTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANTU1B/U1NQ/1NTUP9TU + 1C8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwD6mpwAOpqYABqakAAKmpAACpqQAAqakAAKmpAACpqQAA + qakAAKamAACmpgAAqakAAKZDgAGQp+AHNDT8P6mp + + + + Dodatki + + + O programie... + + + Pomoc + + \ No newline at end of file diff --git a/RDPAddins/SlaveMode.resx b/RDPAddins/SlaveMode.resx new file mode 100644 index 0000000..81847c5 --- /dev/null +++ b/RDPAddins/SlaveMode.resx @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + About... + + + + 0, 0 + + + mnuNICShow + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + About... + + + Hide + + + tabControl + + + mnuAbout + + + 474, 165 + + + ilMain + + + System.Windows.Forms.ImageList, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mnuNICSeparator + + + System.Windows.Forms.ContextMenu, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 474, 165 + + + 0 + + + mnuNICAbout + + + mnuNICHide + + + - + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAq + BAAAAk1TRnQBSQFMAwEBAAEEAQABIAEAARABAAEQAQAE/wEhARAI/wFCAU0BNgcAATYDAAEoAwABQAMA + ARADAAEBAQABIAYAARAiAAMEAQYDDgETAw4BEwMSARkDEgEZAxABFgMLAQ8DBAEG2AADBAEGAx0BKQMj + ATMDIwEzAyMBMwMjATMDIwEzAyMBMwMjATMDIwEzAx0BKQMEAQbMAAMWAR8DIwEzA0EBcgNVAbIDWQHM + A14B5QM2Af8DNgH/A1UB8gNXAb8DVQGyA0EBcgMjATMDFgEfxAADEAEWAzYBWQNVAbIDOwH/A2MB/wNo + Af8DQAH/A5AB/wOQAf8DRQH/A2MB/wNjAf8DOwH/A1UBsgM2AVkDEAEWwAADNgFZA1UB8gNZAf8DWQH/ + A5AB/wOQAf8DjAH/A5AB/wOQAf8DjAH/A5AB/wOQAf8DWQH/A1QB/wNVAfIDNgFZwAADWQHMA1kB/wOQ + Af8DkAH/A5AB/wOQAf8DkAH/A6IB/wOiAf8DkAH/A5AB/wOQAf8DkAH/A5AB/wNZAf8DWQHMwAADNgH/ + A3AB/wOQAf8DmgH/A8MB/wPLAf8DpwH/A9gB/wPYAf8DrAH/A8sB/wPLAf8DmgH/A5AB/wNwAf8DNgH/ + wAADNgH/A5UB/wPCAf8DtAH/A9kB/wPdAf8D3QH/A90B/wPdAf8D3QH/A90B/wPZAf8DuAH/A8IB/wOV + Af8DNgH/wAADNgH/A6UB/wPYAf8D4wH/A+MB/wPTAf8DiwH/A2sB/wNrAf8DgQH/A84B/wPjAf8D4wH/ + A90B/wOqAf8DNgH/wAADYwH/A9MB/wPYAf8D6AH/A90B/wOWAf8DkAH/A4EB/wOBAf8DkAH/A5AB/wPd + Af8D6AH/A9gB/wPTAf8DYAH/wAADnQH/A8cB/wPfAf8D7gH/A+MB/wOQAf8DkAH/A5AB/wOQAf8DkAH/ + A5AB/wPdAf8D7gH/A98B/wPHAf8DnQH/wAADawHvA8EB/wPzAf8D8wH/A/MB/wPVAf8DpAH/A5AB/wOQ + Af8DpAH/A9UB/wPzAf8D8wH/A/MB/wPBAf8DawHvwAADIAEvA24B7wPUAf8DywH/A/AB/wP4Af8D9AH/ + A/gB/wP4Af8D9AH/A/gB/wPzAf8DywH/A9AB/wNuAe8DIAEvxAADIAEvA1wBzwPHAf8D5QH/A+gB/wPL + Af8D/QH/A/0B/wPOAf8D5AH/A+UB/wPHAf8DcAHvAyABL9AAAyABLwNMAY8DWQG/A1wEzwH/A88B/wPP + Af8DVAGvA1EBnwMxAU/kAAMWAR8DKQE/AykBPwMgAS/YAAFCAU0BPgcAAT4DAAEoAwABQAMAARADAAEB + AQABAQUAAYAXAAP/AQAB8AEPBgABwAEDBgABgAEBVgABgAEBBgAB4AEHBgAB/AE/HAAL + + + + Addins + + + System.Windows.Forms.MainMenu, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Addins + + + mnuAddinsContext + + + mnuAddins + + + + Fill + + + Show + + + niMain + + + mnuNIContext + + + System.Windows.Forms.NotifyIcon, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + Manual + + + Help + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAABAAIAEBAAAAEACABoBQAAJgAAABAQAAABACAAaAQAAI4FAAAoAAAAEAAAACAAAAABAAgAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAALGwEAGJr/wBQV/8AKy//AAcI/wB0f/8AGRv/AD1D/wCFk/8A3vHeAJHQ + kQA3iAAAndadAOr26gDX19cANoYAAC1wBACq26oAyt7CANHr0QCv0qcAKmcFAPDw8ABJUOAAcHBwAMLC + wgAvdAMA3d3dAFxcXADR0dEAAACqAAAArwAAAJEAvb29AAAAwQD3/PcAAACLAAAAvgD29vYAhMuEAAAA + tAAAAJ8AAACVAMXFxQAjVQgAxsbGAGu3XQAhTwkA5OTkAFKhMABvu2MAt7e3AGRkZACcnJwAQJARAMvL + ywA7jAcANoUAAMTExAA1hAAAk5OTAN7u2wDS0tIAjo6OAChjBgCpqakAhYWFAERERAAeSAoA8vLyAP39 + /QDDw8MA4ODgALi4uAAlWgcA2dnZAGZmZgB8fHwAMXkCAJWVlQA0ggAAioqKAM3NzQAnXgcAYmJiAOrq + 6gC2trYAIlQIACFRCQBFfyIALGsEAKenpwDe7dgANHoIAEV+NgA0gQEAbLVcACNUCAA/exwA7e3tAExM + TAAjUQ0AQYQjACBOCQBEkBoAHkkKAElQ1ABJUMUASVDZAJeXlwA5ggsA39/fAElQyAB2vmwAerNqAIjE + fwAuXRYA8fHxAD6AFwCOvnMArceoAER/MwA/ixIAnp6eAK7PmQCLy4gAgb51AEqBLABknz0ArcmhAHp6 + egDMzMwASVDKAElQzwBdp0QAR4UlAJbQkwAyfAEAxuPEAHG5ZABJUNcAaGhoAEGLDwCew5IASEhIAIaG + hgDU69EA1tbWADSCAQB6vG4AmZmZADN9AQAnYAYAJFcHAElQ3gBPgzoAx8fHAFSeMwBYWFgAIE0JAKys + rADBwcEAtMerAH/GfACDv3cAAADCAEBAQACAgIAAAACFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKmpqampqampqampqampqampqampqampqampqampqampqampqaam + pqampqamqampqamppkM0jZCnp2Q0NEOmqampphwcp6dNp6dNp6ccnqapphynp6enpzw8p6enp6ccpqYY + p1FJGZYdHXsZGVGnGKamQjNbPg4ODg4ODj6gM0Kmpm0dGxs3gkxMGCsbGw41plQ3HTAOkacYGKenDjAd + N1Q/IUtVG6enp6enp5NVSyE/NVYWFhZST6enT1IWFhZWNalBgxljJkUmJkUmdRmcQampqTMhSDChRkYr + b0ghSampqampqUc6Ky0tLTpHqampqampqampqampqampqampqan//wAA//8AAPAPAADAAwAAgAEAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAAwAMAAPAPAAD//wAAKAAAABAAAAAgAAAAAQAgAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAEwAAABMAAAAZAAAAGQAA + ABYAAAAPAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAApAAAAMwAAADMAAAAzAAAAMwAA + ADMAAAAzAAAAMwAAADMAAAApAAAABgAAAAAAAAAAAAAAAAAAAB8AAAAzMTExcj09PbI/Pz/MQUFB5UND + Q/9DQ0P/QkJC8j4+Pr89PT2yMTExcgAAADMAAAAfAAAAAAAAABYoKChZPT09skhISP9wcHD/dXV1/01N + Tf+QkJD/kJCQ/1JSUv9wcHD/cHBw/0hISP89PT2yKCgoWQAAABYoKChZQkJC8mZmZv9mZmb/kJCQ/5CQ + kP+MjIz/kJCQ/5CQkP+MjIz/kJCQ/5CQkP9mZmb/YWFh/0JCQvIoKChZPz8/zGZmZv+QkJD/kJCQ/5CQ + kP+QkJD/kJCQ/6Kiov+ioqL/kJCQ/5CQkP+QkJD/kJCQ/5CQkP9mZmb/Pz8/zENDQ/99fX3/kJCQ/5qa + mv/Dw8P/y8vL/6enp//Y2Nj/2NjY/6ysrP/Ly8v/y8vL/5qamv+QkJD/fX19/0NDQ/9DQ0P/lZWV/8LC + wv+0tLT/2dnZ/93d3f/d3d3/3d3d/93d3f/d3d3/3d3d/9nZ2f+4uLj/wsLC/5WVlf9DQ0P/Q0ND/6Wl + pf/Y2Nj/4+Pj/+Pj4//T09P/i4uL/3h4eP94eHj/gYGB/87Ozv/j4+P/4+Pj/93d3f+qqqr/Q0ND/3Bw + cP/T09P/2NjY/+jo6P/d3d3/lpaW/5CQkP+BgYH/gYGB/5CQkP+QkJD/3d3d/+jo6P/Y2Nj/09PT/21t + bf+dnZ3/x8fH/9/f3//u7u7/4+Pj/5CQkP+QkJD/kJCQ/5CQkP+QkJD/kJCQ/93d3f/u7u7/39/f/8fH + x/+dnZ3/qqqq78HBwf/z8/P/8/Pz//Pz8//V1dX/pKSk/5CQkP+QkJD/pKSk/9XV1f/z8/P/8/Pz//Pz + 8//BwcH/qqqq77Ozsy+2trbv1NTU/8vLy//w8PD/+Pj4//T09P/4+Pj/+Pj4//T09P/4+Pj/8/Pz/8vL + y//Q0ND/tra277Ozsy8AAAAAv7+/L8LCws/Hx8f/5eXl/+jo6P/Ly8v//f39//39/f/Ozs7/5OTk/+Xl + 5f/Hx8f/w8PD77+/vy8AAAAAAAAAAAAAAAAAAAAAy8vLL8zMzI/Nzc2/zs7Oz8/Pz//Pz8//z8/P/83N + za/MzMyfy8vLTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANTU1B/U1NQ/1NTUP9TU + 1C8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwD6mpwAOpqYABqakAAKmpAACpqQAAqakAAKmpAACpqQAA + qakAAKamAACmpgAAqakAAKZDgAGQp+AHNDT8P6mp + + + + mnuHelp + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + SlaveMode + + + mnuMain + + + 5 + + + RDPAddins + + + System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pl-PL + + + 237, 17 + + + True + + + 148, 17 + + + 17, 17 + + + 341, 17 + + \ No newline at end of file diff --git a/RDPAddins/WtsApi32.cs b/RDPAddins/WtsApi32.cs new file mode 100644 index 0000000..31bd8a3 --- /dev/null +++ b/RDPAddins/WtsApi32.cs @@ -0,0 +1,90 @@ +using System; +using System.Runtime.InteropServices; +using RDPAddins.Common; + +namespace Win32 +{ + namespace WtsApi32 + { + internal delegate ChannelReturnCodes VirtualChannelInitDelegate(ref IntPtr initHandle, [MarshalAs(UnmanagedType.LPArray)] ChannelDef[] channels, int channelCount, uint versionRequested, [MarshalAs(UnmanagedType.FunctionPtr)] ChannelInitEventDelegate channelInitEventProc); + internal delegate ChannelReturnCodes VirtualChannelOpenDelegate(IntPtr initHandle, ref uint openHandle, [MarshalAs(UnmanagedType.LPStr)] string channelName, [MarshalAs(UnmanagedType.FunctionPtr)] ChannelOpenEventDelegate channelOpenEventProc); + internal delegate ChannelReturnCodes VirtualChannelCloseDelegate(uint openHandle); + internal delegate ChannelReturnCodes VirtualChannelWriteDelegate(uint openHandle, byte[] data, uint dataLength, IntPtr userData); + + internal delegate void ChannelInitEventDelegate(IntPtr initHandle, ChannelEvents initEvent, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] byte[] data, uint dataLength); + internal delegate void ChannelOpenEventDelegate(uint openHandle, ChannelEvents openEvent, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=3)] byte [] data, uint dataLength, uint totalLength, ChannelFlags dataFlags); + + [StructLayout(LayoutKind.Sequential)] + internal struct ChannelEntryPoints + { + public int Size; + public int ProtocolVersion; + [MarshalAs(UnmanagedType.FunctionPtr)] + public VirtualChannelInitDelegate VirtualChannelInit; + [MarshalAs(UnmanagedType.FunctionPtr)] + public VirtualChannelOpenDelegate VirtualChannelOpen; + [MarshalAs(UnmanagedType.FunctionPtr)] + public VirtualChannelCloseDelegate VirtualChannelClose; + [MarshalAs(UnmanagedType.FunctionPtr)] + public VirtualChannelWriteDelegate VirtualChannelWrite; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + internal struct ChannelDef + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] + public string name; + public ChannelOptions options; + void asda() + { + } + } + + internal enum ChannelEvents: uint + { + Initialized = 0, + Connected = 1, + V1Connected = 2, + Disconnected = 3, + Terminated = 4, + DataRecived = 10, + WriteComplete = 11, + WriteCanceled = 12 + } + + [Flags] + internal enum ChannelFlags + { + First = 0x01, + Last = 0x02, + Only = First | Last, + Middle = 0, + Fail = 0x100, + ShowProtocol = 0x10, + Suspend = 0x20, + Resume = 0x40 + } + + internal enum ChannelReturnCodes + { + Ok = 0, + AlreadyInitialized = 1, + NotInitialized = 2, + AlreadyConnected = 3, + NotConnected = 4, + TooManyChanels = 5, + BadChannel = 6, + BadChannelHandle = 7, + NoBuffer = 8, + BadInitHandle = 9, + NotOpen = 10, + BadProc = 11, + NoMemory = 12, + UnknownChannelName = 13, + AlreadyOpen = 14, + NotInVirtualchannelEntry = 15, + NullData = 16, + ZeroLength = 17 + } + } +} \ No newline at end of file diff --git a/RDPAddins/app.config b/RDPAddins/app.config new file mode 100644 index 0000000..a4ae2ed --- /dev/null +++ b/RDPAddins/app.config @@ -0,0 +1,3 @@ + + + diff --git a/RDPAddins/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs b/RDPAddins/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs new file mode 100644 index 0000000..5d01041 --- /dev/null +++ b/RDPAddins/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] diff --git a/RDPAddins/obj/Debug/RDPAddins.MasterMode.resources b/RDPAddins/obj/Debug/RDPAddins.MasterMode.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.MasterMode.resources differ diff --git a/RDPAddins/obj/Debug/RDPAddins.Properties.Resources.resources b/RDPAddins/obj/Debug/RDPAddins.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.Properties.Resources.resources differ diff --git a/RDPAddins/obj/Debug/RDPAddins.SlaveMode.pl-PL.resources b/RDPAddins/obj/Debug/RDPAddins.SlaveMode.pl-PL.resources new file mode 100644 index 0000000..895fe1d Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.SlaveMode.pl-PL.resources differ diff --git a/RDPAddins/obj/Debug/RDPAddins.SlaveMode.resources b/RDPAddins/obj/Debug/RDPAddins.SlaveMode.resources new file mode 100644 index 0000000..83264f9 Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.SlaveMode.resources differ diff --git a/RDPAddins/obj/Debug/RDPAddins.csproj.CopyComplete b/RDPAddins/obj/Debug/RDPAddins.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/RDPAddins/obj/Debug/RDPAddins.csproj.CoreCompileInputs.cache b/RDPAddins/obj/Debug/RDPAddins.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..3bf538d --- /dev/null +++ b/RDPAddins/obj/Debug/RDPAddins.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +edbbaf50fdba761d24d1abfc53db8176d04b3573 diff --git a/RDPAddins/obj/Debug/RDPAddins.csproj.FileListAbsolute.txt b/RDPAddins/obj/Debug/RDPAddins.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..5a37b19 --- /dev/null +++ b/RDPAddins/obj/Debug/RDPAddins.csproj.FileListAbsolute.txt @@ -0,0 +1,17 @@ +/home/haraldwolff/src/dotnet/RDPAddins/bin/Debug/RDPAddins.exe.config +/home/haraldwolff/src/dotnet/RDPAddins/bin/Debug/RDPAddins.exe +/home/haraldwolff/src/dotnet/RDPAddins/bin/Debug/RDPAddins.pdb +/home/haraldwolff/src/dotnet/RDPAddins/bin/Debug/pl-PL/RDPAddins.resources.dll +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.csprojAssemblyReference.cache +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.MasterMode.resources +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.frmAbout.resources +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.SlaveMode.resources +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.Properties.Resources.resources +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.frmAbout.pl-PL.resources +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.SlaveMode.pl-PL.resources +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.csproj.GenerateResource.cache +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.csproj.CoreCompileInputs.cache +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/pl-PL/RDPAddins.resources.dll +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.csproj.CopyComplete +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.exe +/home/haraldwolff/src/dotnet/RDPAddins/RDPAddins/obj/Debug/RDPAddins.pdb diff --git a/RDPAddins/obj/Debug/RDPAddins.csproj.GenerateResource.cache b/RDPAddins/obj/Debug/RDPAddins.csproj.GenerateResource.cache new file mode 100644 index 0000000..fb34e76 Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.csproj.GenerateResource.cache differ diff --git a/RDPAddins/obj/Debug/RDPAddins.csprojAssemblyReference.cache b/RDPAddins/obj/Debug/RDPAddins.csprojAssemblyReference.cache new file mode 100644 index 0000000..e3cefd6 Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.csprojAssemblyReference.cache differ diff --git a/RDPAddins/obj/Debug/RDPAddins.exe b/RDPAddins/obj/Debug/RDPAddins.exe new file mode 100644 index 0000000..93a1bfe Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.exe differ diff --git a/RDPAddins/obj/Debug/RDPAddins.frmAbout.pl-PL.resources b/RDPAddins/obj/Debug/RDPAddins.frmAbout.pl-PL.resources new file mode 100644 index 0000000..5e820ca Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.frmAbout.pl-PL.resources differ diff --git a/RDPAddins/obj/Debug/RDPAddins.frmAbout.resources b/RDPAddins/obj/Debug/RDPAddins.frmAbout.resources new file mode 100644 index 0000000..abcb66f Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.frmAbout.resources differ diff --git a/RDPAddins/obj/Debug/RDPAddins.pdb b/RDPAddins/obj/Debug/RDPAddins.pdb new file mode 100644 index 0000000..d1bc3b6 Binary files /dev/null and b/RDPAddins/obj/Debug/RDPAddins.pdb differ diff --git a/RDPAddins/obj/Debug/pl-PL/RDPAddins.resources.dll b/RDPAddins/obj/Debug/pl-PL/RDPAddins.resources.dll new file mode 100755 index 0000000..b888736 Binary files /dev/null and b/RDPAddins/obj/Debug/pl-PL/RDPAddins.resources.dll differ diff --git a/Tools/ExportDll.exe b/Tools/ExportDll.exe new file mode 100644 index 0000000..1a1d09e Binary files /dev/null and b/Tools/ExportDll.exe differ diff --git a/Tools/ExportDll.exe.config b/Tools/ExportDll.exe.config new file mode 100644 index 0000000..4d94931 --- /dev/null +++ b/Tools/ExportDll.exe.config @@ -0,0 +1,28 @@ + + + + +
+ + + + + + C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe + + + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ildasm.exe + + + + + + diff --git a/Tools/ExportDllAttribute.dll b/Tools/ExportDllAttribute.dll new file mode 100644 index 0000000..f848bac Binary files /dev/null and b/Tools/ExportDllAttribute.dll differ diff --git a/Tools/README.txt b/Tools/README.txt new file mode 100644 index 0000000..d7af360 --- /dev/null +++ b/Tools/README.txt @@ -0,0 +1,2 @@ +Remeber to setup "ilasmpath" and "ildasmpath" in ExportDll.exe.config +Open ExportDll.exe.config there are few setup possibilities in comments \ No newline at end of file diff --git a/bin/Debug/RDPAddins.Common.dll b/bin/Debug/RDPAddins.Common.dll new file mode 100644 index 0000000..7d673f5 Binary files /dev/null and b/bin/Debug/RDPAddins.Common.dll differ diff --git a/bin/Debug/RDPAddins.Common.pdb b/bin/Debug/RDPAddins.Common.pdb new file mode 100644 index 0000000..d7261ed Binary files /dev/null and b/bin/Debug/RDPAddins.Common.pdb differ diff --git a/bin/Debug/RDPAddins.Common.xml b/bin/Debug/RDPAddins.Common.xml new file mode 100644 index 0000000..a2e6d23 --- /dev/null +++ b/bin/Debug/RDPAddins.Common.xml @@ -0,0 +1,308 @@ + + + + RDPAddins.Common + + + + + Provides addin's metadata + + + + + Gets addin name + + + + + Get addin channel name + + + + + Gets channel options + + + + + Inherited from System.ComponentModel.Composition.ExportAttribute. + Every addins should have one as an addin description. + + + + + Initializes a new instance of the AddinMetadataAttribute class, exporting the type or member marked with this attribute with the specified name, channel name and channel options. + + Name of the addin. + !!! should be less than 7 chars !!! Channel name. + Specified channel's options + + + + Gets addin name + + + + + Get addin channel name + + + + + Gets channel options + + + + + Specifies the options for this virtual channel. + + + + + The channel is initialized. + + + + + Encrypt client-to-server data. + + + + + Encrypt server-to-client data. + + + + + Encrypt client-to-server data. + + + + + Channel data should be sent with high Multipoint Communications Services (MCS) priority. + + + + + Channel data should be sent with medium MCS priority. + + + + + Channel data should be sent with low MCS priority. + + + + + Virtual channel data should be compressed if RDP data is being compressed. + + + + + Virtual channel data should be compressed, regardless of Remote Desktop Protocol (RDP) compression. + + + + + Affects how data sent by the IChannel.Write function is received at the server end. If this value is set, each data block is preceded by a CHANNEL_PDU_HEADER structure. If this value is not set, the data block includes only the data specified to IChannel.Write. + + + + + Defines an addin interface. + + + + + Initializing addin with specific channel + + Channel created for this addin. + + + + Represents RDS Channel + + + + + Occurs when VirtualChannelInitEventProc(VirtualChannelInitEvent in RDS API) was called with ChannelEvents.Initialized(CHANNEL_EVENT_INITIALIZED in RDS API) + + + + + Occurs when VirtualChannelInitEventProc(VirtualChannelInitEvent in RDS API) was called with ChannelEvents.Connected(CHANNEL_EVENT_CONNECTED in RDS API) + + + + + Occurs when VirtualChannelInitEventProc(VirtualChannelInitEvent in RDS API) was called with ChannelEvents.Disconnected(CHANNEL_EVENT_DISCONNECTED in RDS API) + + + + + Occurs when VirtualChannelInitEventProc(VirtualChannelInitEvent in RDS API) was called with ChannelEvents.Terminated(CHANNEL_EVENT_TERMINATED in RDS API) + + + + + Occurs when VirtualChannelOpenEvent(VirtualChannelOpenEvent in RDS API) was called with ChannelEvents.DataRecived(CHANNEL_EVENT_DATA_RECEIVED in RDS API) + + + + + Works similar to System.IO.Stream.Read + + An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the channel. + The zero-based byte offset in buffer at which to begin storing the data read from the channel. + The maximum number of bytes to be read from the channel. + The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available(including 0). + + + + Works similar to System.IO.Stream.Write + + An array of bytes. This method sends bytes from buffer through channel. + The zero-based byte offset in buffer at which to begin sending bytes through channel. + The number of bytes to be sent through channel. + + + + Creataes and returns stream. Stream is disposed when Disconnect event occurs. + + Retuns stream + + + + Gets Addin metadata + + + + + Get IUI interface + + + + + Represents the method that will handle the DataArrived event of a IChannel. + + Specifies the size, in bytes, of the data. Use Read method of IChannel to read the data. + Specifies the total size, in bytes, of the data written by a single write operation to the server end of the virtual channel. + Provides information about the chunk of data being received. + + + + Specifies constants that define which part of data chunk was sent. + + + + + The chunk is the beginning of the data written by a single write operation. + + + + + The chunk is the end of the data written by a single write operation. + + + + + The chunk is in the middle of a block of data written by a single write operation. + + + + + Combines the DataParts.First and DataParts.Last values. The chunk contains all the data from a single write operation. + + + + + Represents UI parts of the IChannel + + + + + Occurs when the balloon tip is clicked. + + + + + Occurs when the hannel is trying create addin's control. If not hooked addin will not have control. + + + + + Occurs when Channel is trying create addin's menu. If not hooked addin will not have menu. + + + + + Occurs when Channel is trying create addin's tray menu. If not hooked addin will not have tray menu. + + + + + Occurs when Channel is trying to get addin's icon. Only appears when addin has control. If not hooked addin and addin has control then addin will have default icon. + + + + + Get UI's channel + + + + + Displays the balloon tip in the taskbar. + + The time period, in milliseconds, the balloon tip should display. + The title to display on the balloon tip. + The text to display on the balloon tip. + One of the System.Windows.Forms.ToolTipIcon values. + This object will sent to BalloonTipClicked event. + + + + Shows main form and selct tab with addin's control(if exists). + + + + + Executes a action on the UI thread. (It calls System.Windows.Forms.Form.Invoke). + + The action delegate. + + + + Gets or sets visibility of addin's control(if exists). + + + + + Represents the method that will handle the BalloonTipClicked event of a IUI. + + The source of the event. + Parameter sent by IUI.ShowBalloonTip method. + + + + Represents the method that will handle the ControlCreating event of a IUI. + + The source of the event. + Should returns addin's control if needed. + + + + Represents the method that will handle the MenuCreating and TrayMenuCreating event of a IUI. + + The source of the event. + Should returns addin's menu or tray menu if needed. + + + + Represents the method that will handle the IconCreating event of a IUI. + + The source of the event. + Should returns addin's icon if needed. + + + diff --git a/bin/Debug/RDPAddins.exe b/bin/Debug/RDPAddins.exe new file mode 100644 index 0000000..93a1bfe Binary files /dev/null and b/bin/Debug/RDPAddins.exe differ diff --git a/bin/Debug/RDPAddins.exe.config b/bin/Debug/RDPAddins.exe.config new file mode 100644 index 0000000..a4ae2ed --- /dev/null +++ b/bin/Debug/RDPAddins.exe.config @@ -0,0 +1,3 @@ + + + diff --git a/bin/Debug/RDPAddins.pdb b/bin/Debug/RDPAddins.pdb new file mode 100644 index 0000000..d1bc3b6 Binary files /dev/null and b/bin/Debug/RDPAddins.pdb differ diff --git a/bin/Debug/pl-PL/RDPAddins.resources.dll b/bin/Debug/pl-PL/RDPAddins.resources.dll new file mode 100755 index 0000000..b888736 Binary files /dev/null and b/bin/Debug/pl-PL/RDPAddins.resources.dll differ diff --git a/bin/x64/Debug/ExportDllAttribute.dll b/bin/x64/Debug/ExportDllAttribute.dll new file mode 100644 index 0000000..f848bac Binary files /dev/null and b/bin/x64/Debug/ExportDllAttribute.dll differ diff --git a/bin/x64/Debug/RDPAddins.Core.dll b/bin/x64/Debug/RDPAddins.Core.dll new file mode 100644 index 0000000..15fec74 Binary files /dev/null and b/bin/x64/Debug/RDPAddins.Core.dll differ diff --git a/bin/x64/Debug/RDPAddins.Core.pdb b/bin/x64/Debug/RDPAddins.Core.pdb new file mode 100644 index 0000000..dab8510 Binary files /dev/null and b/bin/x64/Debug/RDPAddins.Core.pdb differ