--- /dev/null
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdesktop-core", "rdesktop\rdesktop-core.vcproj", "{8620E9B2-9AF0-4F69-A5AF-C195D5F86372}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mstsc", "mstsc\mstsc.vcproj", "{1B415732-1F37-415F-957B-EA436301860D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mstscax", "mstscax\mstscax.vcproj", "{2C217E9E-9D77-4D6A-9259-216FD56BA56F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdesktop-core-tester", "porting-tools\rdesktop-core-tester\rdesktop-core-tester.vcproj", "{B172A623-E2BD-4E3F-86E6-620548FE255B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8620E9B2-9AF0-4F69-A5AF-C195D5F86372}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8620E9B2-9AF0-4F69-A5AF-C195D5F86372}.Debug|Win32.Build.0 = Debug|Win32
+ {8620E9B2-9AF0-4F69-A5AF-C195D5F86372}.Release|Win32.ActiveCfg = Release|Win32
+ {8620E9B2-9AF0-4F69-A5AF-C195D5F86372}.Release|Win32.Build.0 = Release|Win32
+ {1B415732-1F37-415F-957B-EA436301860D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1B415732-1F37-415F-957B-EA436301860D}.Debug|Win32.Build.0 = Debug|Win32
+ {1B415732-1F37-415F-957B-EA436301860D}.Release|Win32.ActiveCfg = Release|Win32
+ {1B415732-1F37-415F-957B-EA436301860D}.Release|Win32.Build.0 = Release|Win32
+ {2C217E9E-9D77-4D6A-9259-216FD56BA56F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2C217E9E-9D77-4D6A-9259-216FD56BA56F}.Debug|Win32.Build.0 = Debug|Win32
+ {2C217E9E-9D77-4D6A-9259-216FD56BA56F}.Release|Win32.ActiveCfg = Release|Win32
+ {2C217E9E-9D77-4D6A-9259-216FD56BA56F}.Release|Win32.Build.0 = Release|Win32
+ {B172A623-E2BD-4E3F-86E6-620548FE255B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B172A623-E2BD-4E3F-86E6-620548FE255B}.Debug|Win32.Build.0 = Debug|Win32
+ {B172A623-E2BD-4E3F-86E6-620548FE255B}.Release|Win32.ActiveCfg = Release|Win32
+ {B172A623-E2BD-4E3F-86E6-620548FE255B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
--- /dev/null
+#include "stdafx.h"
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ return 0;
+}
+
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="8,00"\r
+ Name="mstsc"\r
+ ProjectGUID="{1B415732-1F37-415F-957B-EA436301860D}"\r
+ RootNamespace="mstsc"\r
+ Keyword="Win32Proj"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="2"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="kernel32.lib $(NoInherit)"\r
+ LinkIncremental="2"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="2"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="kernel32.lib $(NoInherit)"\r
+ LinkIncremental="1"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath=".\mstsc.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\stdafx.cpp"\r
+ >\r
+ <FileConfiguration\r
+ Name="Debug|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="1"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="1"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ <File\r
+ RelativePath=".\stdafx.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+ >\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
--- /dev/null
+// stdafx.cpp : source file that includes just the standard includes
+// mstsc.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
--- /dev/null
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#include <stdio.h>
+#include <tchar.h>
+
+
+
+// TODO: reference additional headers your program requires here
--- /dev/null
+#include "stdafx.h"
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ return 0;
+}
+
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="8,00"\r
+ Name="mstscax"\r
+ ProjectGUID="{2C217E9E-9D77-4D6A-9259-216FD56BA56F}"\r
+ RootNamespace="mstscax"\r
+ Keyword="Win32Proj"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="2"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="kernel32.lib $(NoInherit)"\r
+ LinkIncremental="2"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="2"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="kernel32.lib $(NoInherit)"\r
+ LinkIncremental="1"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath=".\mstscax.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\stdafx.cpp"\r
+ >\r
+ <FileConfiguration\r
+ Name="Debug|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="1"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="1"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ <File\r
+ RelativePath=".\stdafx.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+ >\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
--- /dev/null
+// stdafx.cpp : source file that includes just the standard includes
+// mstscax.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
--- /dev/null
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#include <stdio.h>
+#include <tchar.h>
+
+
+
+// TODO: reference additional headers your program requires here
--- /dev/null
+#include "stdafx.h"
+
+namespace
+{
+ using namespace MSTSCLib;
+
+ typedef HRESULT (STDAPICALLTYPE * PFNDLLGETCLASSOBJECT)(IN REFCLSID rclsid, IN REFIID riid, OUT LPVOID FAR * ppv);
+ typedef HRESULT (STDAPICALLTYPE * PFNDLLCANUNLOADNOW)(void);
+ typedef ULONG (STDAPICALLTYPE * PFNDLLGETTSCCTLVER)(void);
+
+ PFNDLLGETCLASSOBJECT pfnDllGetClassObject = NULL;
+ PFNDLLCANUNLOADNOW pfnDllCanUnloadNow = NULL;
+ PFNDLLGETTSCCTLVER pfnDllGetTscCtlVer = NULL;
+
+ HMODULE hmMstscax = NULL;
+
+ extern "C" char __ImageBase;
+ static const HMODULE hmSelf = reinterpret_cast<HMODULE>(&__ImageBase);
+
+ void init()
+ {
+ if(hmMstscax)
+ return;
+
+ TCHAR szFileName[MAX_PATH + 1];
+ GetModuleFileName(hmSelf, szFileName, MAX_PATH);
+
+ std::basic_string<TCHAR> strFileName(&szFileName[0]);
+ std::reverse_iterator<std::basic_string<TCHAR>::const_iterator > begin(strFileName.end());
+ std::reverse_iterator<std::basic_string<TCHAR>::const_iterator > end(strFileName.begin());
+ std::basic_string<TCHAR>::const_iterator endPath = std::find(begin, end, TEXT('\\')).base();
+
+ std::basic_string<TCHAR> strPath(strFileName.begin(), endPath);
+ strPath.append(TEXT("original\\mstscax.dll"));
+
+ hmMstscax = LoadLibrary(strPath.c_str());
+ pfnDllGetClassObject = (PFNDLLGETCLASSOBJECT)GetProcAddress(hmMstscax, "DllGetClassObject");
+ pfnDllCanUnloadNow = (PFNDLLCANUNLOADNOW)GetProcAddress(hmMstscax, "DllCanUnloadNow");
+ pfnDllGetTscCtlVer = (PFNDLLGETTSCCTLVER)GetProcAddress(hmMstscax, "DllGetTscCtlVer");
+ }
+
+ void dbgprintf(LPCTSTR fmt, ...)
+ {
+ TCHAR buf[0x1000];
+
+ va_list args;
+ va_start(args, fmt);
+ StringCbVPrintf(buf, sizeof(buf), fmt, args);
+ va_end(args);
+
+ StringCbCat(buf, sizeof(buf), TEXT("\n"));
+
+ OutputDebugString(buf);
+ }
+
+#if 0
+ const IID MsTscAxIIDs[] =
+ {
+ IID_IMsRdpClient,
+ IID_IMsTscAx,
+ //IID_IMsTscAxEvents,
+ IID_IMsTscNonScriptable,
+ IID_IMsRdpClientNonScriptable,
+ };
+
+ const IID MsRdpClient[] =
+ {
+ IID_IMsRdpClient,
+ IID_IMsTscAx,
+ //IID_IMsTscAxEvents,
+ IID_IMsTscNonScriptable,
+ IID_IMsRdpClientNonScriptable,
+ };
+
+ const IID MsRdpClient2[] =
+ {
+ IID_IMsRdpClient2,
+ IID_IMsRdpClient,
+ IID_IMsTscAx,
+ //IID_IMsTscAxEvents,
+ IID_IMsTscNonScriptable,
+ IID_IMsRdpClientNonScriptable,
+ };
+
+ const IID MsRdpClient3[] =
+ {
+ IID_IMsRdpClient3,
+ IID_IMsRdpClient2,
+ IID_IMsRdpClient,
+ IID_IMsTscAx,
+ //IID_IMsTscAxEvents,
+ IID_IMsTscNonScriptable,
+ IID_IMsRdpClientNonScriptable,
+ };
+
+ const IID MsRdpClient4[] =
+ {
+ IID_IMsRdpClient4,
+ IID_IMsRdpClient3,
+ IID_IMsRdpClient2,
+ IID_IMsRdpClient,
+ IID_IMsTscAx,
+ //IID_IMsTscAxEvents,
+ IID_IMsTscNonScriptable,
+ IID_IMsRdpClientNonScriptable,
+ IID_IMsRdpClientNonScriptable2,
+ };
+#endif
+
+ std::wstring UUIDToString(const UUID& uuid)
+ {
+ std::wstring s;
+ LPOLESTR str;
+ StringFromCLSID(uuid, &str);
+ s += str;
+ CoTaskMemFree(str);
+ return s;
+ }
+
+ std::wstring MonikerToString(IMoniker * pmk)
+ {
+ LPOLESTR pszName = NULL;
+
+ if(SUCCEEDED(pmk->GetDisplayName(NULL, NULL, &pszName)))
+ {
+ std::wstring s(pszName);
+ CoTaskMemFree(pszName);
+ return s;
+ }
+ else
+ return std::wstring(L"<error>");
+ }
+
+ std::basic_string<TCHAR> RectToString(const RECT& rc)
+ {
+ if(&rc == NULL)
+ return TEXT("<null>");
+
+ std::basic_ostringstream<TCHAR> o;
+ o << "{" << " left:" << rc.left << " top:" << rc.top << " right:" << rc.right << " bottom:" << rc.bottom << " }";
+ return o.str();
+ }
+
+ std::basic_string<TCHAR> RectToString(const RECTL& rc)
+ {
+ if(&rc == NULL)
+ return TEXT("<null>");
+
+ std::basic_ostringstream<TCHAR> o;
+ o << "{" << " left:" << rc.left << " top:" << rc.top << " right:" << rc.right << " bottom:" << rc.bottom << " }";
+ return o.str();
+ }
+
+ std::basic_string<TCHAR> SizeToString(const SIZE& sz)
+ {
+ if(&sz == NULL)
+ return TEXT("<null>");
+
+ std::basic_ostringstream<TCHAR> o;
+ o << "{ " << " cx:" << sz.cx << " cy:" << sz.cy << " }";
+ return o.str();
+ }
+
+ template<class T> LPCTSTR BooleanToString(const T& X)
+ {
+ return X ? TEXT("true") : TEXT("false");
+ }
+
+ std::basic_string<TCHAR> VariantToString(const VARIANT& var)
+ {
+ std::basic_ostringstream<TCHAR> o;
+
+ switch(var.vt & VT_TYPEMASK)
+ {
+ case VT_EMPTY: o << "<empty>"; break;
+ case VT_NULL: o << "<null>"; break;
+ case VT_I2: o << "short"; break;
+ case VT_I4: o << "long"; break;
+ case VT_R4: o << "float"; break;
+ case VT_R8: o << "double"; break;
+ case VT_CY: o << "CURRENCY"; break;
+ case VT_DATE: o << "DATE"; break;
+ case VT_BSTR: o << "string"; break;
+ case VT_DISPATCH: o << "IDispatch *"; break;
+ case VT_ERROR: o << "SCODE"; break;
+ case VT_BOOL: o << "bool"; break;
+ case VT_VARIANT: o << "VARIANT *"; break;
+ case VT_UNKNOWN: o << "IUnknown *"; break;
+ case VT_DECIMAL: o << "DECIMAL"; break;
+ case VT_I1: o << "char"; break;
+ case VT_UI1: o << "unsigned char"; break;
+ case VT_UI2: o << "unsigned short"; break;
+ case VT_UI4: o << "unsigned long"; break;
+ case VT_I8: o << "long long"; break;
+ case VT_UI8: o << "unsigned long long"; break;
+ case VT_INT: o << "int"; break;
+ case VT_UINT: o << "unsigned int"; break;
+ case VT_VOID: o << "void"; break;
+ case VT_HRESULT: o << "HRESULT"; break;
+ case VT_PTR: o << "void *"; break;
+ case VT_SAFEARRAY: o << "SAFEARRAY *"; break;
+ case VT_LPSTR: o << "LPSTR"; break;
+ case VT_LPWSTR: o << "LPWSTR"; break;
+ case VT_RECORD: o << "struct { }"; break;
+ case VT_INT_PTR: o << "intptr_t"; break;
+ case VT_UINT_PTR: o << "uintptr_t"; break;
+ case VT_FILETIME: o << "FILETIME"; break;
+ default: o << "???"; break;
+ }
+
+ if(var.vt & VT_ARRAY)
+ o << "[]";
+ else if(var.vt & VT_BYREF)
+ o << " *";
+ else
+ {
+ switch(var.vt & VT_TYPEMASK)
+ {
+ case VT_EMPTY:
+ case VT_NULL:
+ case VT_RECORD:
+ case VT_VOID:
+
+ // TODO
+ case VT_CY:
+ case VT_DATE:
+ case VT_DECIMAL:
+ case VT_FILETIME:
+ break;
+
+ default:
+ o << " = ";
+ }
+
+ switch(var.vt & VT_TYPEMASK)
+ {
+ case VT_I2: o << var.iVal; break;
+ case VT_I4: o << var.lVal; break;
+ case VT_R4: o << var.fltVal; break;
+ case VT_R8: o << var.dblVal; break;
+ case VT_BSTR: o << std::wstring(var.bstrVal, var.bstrVal + SysStringLen(var.bstrVal)); break;
+ case VT_BOOL: o << var.boolVal ? "true" : "false"; break;
+ case VT_I1: o << int(var.cVal); break;
+ case VT_UI1: o << unsigned int(var.bVal); break;
+ case VT_UI2: o << var.uiVal; break;
+ case VT_UI4: o << var.ulVal; break;
+ case VT_I8: o << var.llVal; break;
+ case VT_UI8: o << var.ullVal; break;
+ case VT_INT: o << var.intVal; break;
+ case VT_UINT: o << var.uintVal; break;
+ case VT_LPSTR: o << LPSTR(var.byref); break;
+ case VT_LPWSTR: o << LPWSTR(var.byref); break;
+ case VT_INT_PTR: o << var.intVal; break; // BUGBUG
+ case VT_UINT_PTR: o << var.uintVal; break; // BUGBUG
+
+ case VT_DISPATCH:
+ case VT_VARIANT:
+ case VT_UNKNOWN:
+ case VT_PTR:
+ case VT_SAFEARRAY:
+ case VT_RECORD:
+ o << var.byref; break;
+
+ case VT_ERROR:
+ case VT_HRESULT:
+ o << std::hex << var.ulVal; break;
+
+ case VT_EMPTY:
+ case VT_NULL:
+ case VT_VOID:
+ break;
+
+ default:
+ assert(0);
+ }
+ }
+
+ return o.str();
+ }
+
+#pragma warning(disable:4584)
+
+ IConnectionPointContainer * HookIConnectionPointContainer(IConnectionPointContainer * p);
+ IEnumConnectionPoints * HookIEnumConnectionPoints(IEnumConnectionPoints * p);
+ IConnectionPoint * HookIConnectionPoint(IConnectionPoint * p);
+ IEnumConnections * HookIEnumConnections(IEnumConnections * p);
+
+ class CConnectionPointContainer: public IConnectionPointContainer
+ {
+ private:
+ LONG m_refCount;
+ IConnectionPointContainer * m_IConnectionPointContainer;
+
+ public:
+ CConnectionPointContainer(IConnectionPointContainer * pIConnectionPointContainer):
+ m_refCount(1),
+ m_IConnectionPointContainer(pIConnectionPointContainer)
+ { }
+
+ ~CConnectionPointContainer() { m_IConnectionPointContainer->Release(); }
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ HRESULT hr = S_OK;
+
+ dbgprintf(TEXT("CConnectionPointContainer::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject);
+
+ if(riid == IID_IUnknown || riid == IID_IConnectionPointContainer)
+ *ppvObject = this;
+ else
+ {
+ *ppvObject = NULL;
+ hr = E_NOINTERFACE;
+ }
+
+ dbgprintf(TEXT("CConnectionPointContainer::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject);
+ return hr;
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef(void)
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release(void)
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE EnumConnectionPoints(IEnumConnectionPoints ** ppEnum)
+ {
+ dbgprintf(TEXT("CConnectionPointContainer::EnumConnectionPoints(%p)"), ppEnum);
+ HRESULT hr = m_IConnectionPointContainer->EnumConnectionPoints(ppEnum);
+ dbgprintf(TEXT("CConnectionPointContainer::EnumConnectionPoints -> %08X, pEnum = %p"), hr, *ppEnum);
+
+ if(SUCCEEDED(hr))
+ *ppEnum = HookIEnumConnectionPoints(*ppEnum);
+
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE FindConnectionPoint(REFIID riid, IConnectionPoint ** ppCP)
+ {
+ dbgprintf(TEXT("CConnectionPointContainer::FindConnectionPoint(%ls, %p)"), UUIDToString(riid).c_str(), ppCP);
+ HRESULT hr = m_IConnectionPointContainer->FindConnectionPoint(riid, ppCP);
+ dbgprintf(TEXT("CConnectionPointContainer::FindConnectionPoint -> %08X, pCP = %p"), hr, *ppCP);
+
+ if(SUCCEEDED(hr))
+ *ppCP = HookIConnectionPoint(*ppCP);
+
+ return hr;
+ }
+ };
+
+ class CEnumConnectionPoints: public IEnumConnectionPoints
+ {
+ private:
+ LONG m_refCount;
+ IEnumConnectionPoints * m_IEnumConnectionPoints;
+
+ public:
+ CEnumConnectionPoints(IEnumConnectionPoints * pIEnumConnectionPoints):
+ m_refCount(1),
+ m_IEnumConnectionPoints(pIEnumConnectionPoints)
+ { }
+
+ ~CEnumConnectionPoints() { m_IEnumConnectionPoints->Release(); }
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ HRESULT hr = S_OK;
+
+ dbgprintf(TEXT("CEnumConnectionPoints::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject);
+
+ if(riid == IID_IUnknown || riid == IID_IEnumConnectionPoints)
+ *ppvObject = this;
+ else
+ {
+ *ppvObject = NULL;
+ hr = E_NOINTERFACE;
+ }
+
+ dbgprintf(TEXT("CEnumConnectionPoints::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject);
+ return hr;
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef(void)
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release(void)
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Next(ULONG cConnections, LPCONNECTIONPOINT * ppCP, ULONG * pcFetched)
+ {
+ dbgprintf(TEXT("CEnumConnectionPoints::Next(%lu, %p, %p)"), cConnections, ppCP, pcFetched);
+ HRESULT hr = m_IEnumConnectionPoints->Next(cConnections, ppCP, pcFetched);
+ dbgprintf(TEXT("CEnumConnectionPoints:: -> %08X, pCP = %p, cFetched = %lu"), hr, *ppCP, *pcFetched);
+
+ if(SUCCEEDED(hr))
+ *ppCP = HookIConnectionPoint(*ppCP);
+
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Skip(ULONG cConnections)
+ {
+ dbgprintf(TEXT("CEnumConnectionPoints::Skip(%lu)"), cConnections);
+ HRESULT hr = m_IEnumConnectionPoints->Skip(cConnections);
+ dbgprintf(TEXT("CEnumConnectionPoints:: -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(void)
+ {
+ dbgprintf(TEXT("CEnumConnectionPoints::Reset()"));
+ HRESULT hr = m_IEnumConnectionPoints->Reset();
+ dbgprintf(TEXT("CEnumConnectionPoints:: -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Clone(IEnumConnectionPoints ** ppEnum)
+ {
+ dbgprintf(TEXT("CEnumConnectionPoints::Clone(%p)"), ppEnum);
+ HRESULT hr = m_IEnumConnectionPoints->Clone(ppEnum);
+ dbgprintf(TEXT("CEnumConnectionPoints:: -> %08X, pEnum"), hr, *ppEnum);
+
+ if(SUCCEEDED(hr))
+ *ppEnum = HookIEnumConnectionPoints(*ppEnum);
+
+ return hr;
+ }
+ };
+
+ class CConnectionPoint: public IConnectionPoint
+ {
+ private:
+ LONG m_refCount;
+ IConnectionPoint * m_IConnectionPoint;
+
+ public:
+ CConnectionPoint(IConnectionPoint * pIConnectionPoint):
+ m_refCount(1),
+ m_IConnectionPoint(pIConnectionPoint)
+ { }
+
+ ~CConnectionPoint() { m_IConnectionPoint->Release(); }
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ HRESULT hr = S_OK;
+
+ dbgprintf(TEXT("CConnectionPoint::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject);
+
+ if(riid == IID_IUnknown || riid == IID_IConnectionPoint)
+ *ppvObject = this;
+ else
+ {
+ *ppvObject = NULL;
+ hr = E_NOINTERFACE;
+ }
+
+ dbgprintf(TEXT("CConnectionPoint::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject);
+ return hr;
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef(void)
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release(void)
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetConnectionInterface(IID * pIID)
+ {
+ dbgprintf(TEXT("CConnectionPoint::GetConnectionInterface(%p)"), pIID);
+ HRESULT hr = m_IConnectionPoint->GetConnectionInterface(pIID);
+ dbgprintf(TEXT("CConnectionPoint::GetConnectionInterface -> %08X, IID = %ls"), hr, UUIDToString(*pIID).c_str());
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetConnectionPointContainer(IConnectionPointContainer ** ppCPC)
+ {
+ dbgprintf(TEXT("CConnectionPoint::GetConnectionPointContainer(%p)"), ppCPC);
+ HRESULT hr = m_IConnectionPoint->GetConnectionPointContainer(ppCPC);
+ dbgprintf(TEXT("CConnectionPoint::GetConnectionPointContainer -> %08X, pCPC = %p"), hr, *ppCPC);
+
+ if(SUCCEEDED(hr))
+ *ppCPC = HookIConnectionPointContainer(*ppCPC);
+
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Advise(IUnknown * pUnkSink, DWORD * pdwCookie)
+ {
+ dbgprintf(TEXT("CConnectionPoint::Advise(%p, %p)"), pUnkSink, pdwCookie);
+ HRESULT hr = m_IConnectionPoint->Advise(pUnkSink, pdwCookie);
+ dbgprintf(TEXT("CConnectionPoint::Advise -> %08X, dwCookie = %lu"), hr, *pdwCookie);
+ // TODO: hook sink
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Unadvise(DWORD dwCookie)
+ {
+ dbgprintf(TEXT("CConnectionPoint::Unadvise(%lu)"), dwCookie);
+ HRESULT hr = m_IConnectionPoint->Unadvise(dwCookie);
+ dbgprintf(TEXT("CConnectionPoint::Unadvise -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE EnumConnections(IEnumConnections ** ppEnum)
+ {
+ dbgprintf(TEXT("CConnectionPoint::EnumConnections(%p)"), ppEnum);
+ HRESULT hr = m_IConnectionPoint->EnumConnections(ppEnum);
+ dbgprintf(TEXT("CConnectionPoint::EnumConnections -> %08X, pEnum = %p"), hr, *ppEnum);
+
+ if(SUCCEEDED(hr))
+ *ppEnum = HookIEnumConnections(*ppEnum);
+
+ return hr;
+ }
+ };
+
+ class CEnumConnections: public IEnumConnections
+ {
+ private:
+ LONG m_refCount;
+ IEnumConnections * m_IEnumConnections;
+
+ public:
+ CEnumConnections(IEnumConnections * pIEnumConnections):
+ m_refCount(1),
+ m_IEnumConnections(pIEnumConnections)
+ { }
+
+ ~CEnumConnections() { m_IEnumConnections->Release(); }
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ HRESULT hr = S_OK;
+
+ dbgprintf(TEXT("CEnumConnections::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject);
+
+ if(riid == IID_IUnknown || riid == IID_IEnumConnections)
+ *ppvObject = this;
+ else
+ {
+ *ppvObject = NULL;
+ hr = E_NOINTERFACE;
+ }
+
+ dbgprintf(TEXT("CEnumConnections::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject);
+ return hr;
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef(void)
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release(void)
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Next(ULONG cConnections, LPCONNECTDATA pCD, ULONG * pcFetched)
+ {
+ dbgprintf(TEXT("CEnumConnections::Next(%lu, %p, %p)"), cConnections, pCD, pcFetched);
+ HRESULT hr = m_IEnumConnections->Next(cConnections, pCD, pcFetched);
+ dbgprintf(TEXT("CEnumConnections:: -> %08X, CD = { pUnk = %p, dwCookie = %lu }, cFetched = %lu"), hr, pCD->pUnk, pCD->dwCookie, *pcFetched);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Skip(ULONG cConnections)
+ {
+ dbgprintf(TEXT("CEnumConnections::Skip(%lu)"), cConnections);
+ HRESULT hr = m_IEnumConnections->Skip(cConnections);
+ dbgprintf(TEXT("CEnumConnections:: -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(void)
+ {
+ dbgprintf(TEXT("CEnumConnections::Reset()"));
+ HRESULT hr = m_IEnumConnections->Reset();
+ dbgprintf(TEXT("CEnumConnections:: -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Clone(IEnumConnections ** ppEnum)
+ {
+ dbgprintf(TEXT("CEnumConnections::Clone(%p)"), ppEnum);
+ HRESULT hr = m_IEnumConnections->Clone(ppEnum);
+ dbgprintf(TEXT("CEnumConnections:: -> %08X, pEnum"), hr, *ppEnum);
+
+ if(SUCCEEDED(hr))
+ *ppEnum = HookIEnumConnections(*ppEnum);
+
+ return hr;
+ }
+ };
+
+ IConnectionPointContainer * HookIConnectionPointContainer(IConnectionPointContainer * p)
+ {
+ return new CConnectionPointContainer(p);
+ }
+
+ IEnumConnectionPoints * HookIEnumConnectionPoints(IEnumConnectionPoints * p)
+ {
+ return new CEnumConnectionPoints(p);
+ }
+
+ IConnectionPoint * HookIConnectionPoint(IConnectionPoint * p)
+ {
+ return new CConnectionPoint(p);
+ }
+
+ IEnumConnections * HookIEnumConnections(IEnumConnections * p)
+ {
+ return new CEnumConnections(p);
+ }
+
+ class CAdvancedSettings: public IMsRdpClientAdvancedSettings4
+ {
+ private:
+ LONG m_refCount;
+ IUnknown * m_IUnknown;
+ IDispatch * m_IDispatch;
+ IMsTscAdvancedSettings * m_IMsTscAdvancedSettings;
+ IMsRdpClientAdvancedSettings * m_IMsRdpClientAdvancedSettings;
+ IMsRdpClientAdvancedSettings2 * m_IMsRdpClientAdvancedSettings2;
+ IMsRdpClientAdvancedSettings3 * m_IMsRdpClientAdvancedSettings3;
+ IMsRdpClientAdvancedSettings4 * m_IMsRdpClientAdvancedSettings4;
+
+ IDispatch * getIDispatch()
+ {
+ assert(m_IDispatch);
+ return m_IDispatch;
+ }
+
+ IMsTscAdvancedSettings * getIMsTscAdvancedSettings()
+ {
+ if(m_IMsTscAdvancedSettings)
+ return m_IMsTscAdvancedSettings;
+ else if(m_IMsRdpClientAdvancedSettings)
+ m_IMsTscAdvancedSettings = m_IMsRdpClientAdvancedSettings;
+ else if(m_IMsRdpClientAdvancedSettings2)
+ m_IMsTscAdvancedSettings = m_IMsRdpClientAdvancedSettings2;
+ else if(m_IMsRdpClientAdvancedSettings3)
+ m_IMsTscAdvancedSettings = m_IMsRdpClientAdvancedSettings3;
+ else if(m_IMsRdpClientAdvancedSettings4)
+ m_IMsTscAdvancedSettings = m_IMsRdpClientAdvancedSettings4;
+
+ if(m_IMsTscAdvancedSettings)
+ {
+ m_IMsTscAdvancedSettings->AddRef();
+ return m_IMsTscAdvancedSettings;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsTscAdvancedSettings);
+ return m_IMsTscAdvancedSettings;
+ }
+
+ IMsRdpClientAdvancedSettings * getIMsRdpClientAdvancedSettings()
+ {
+ if(m_IMsRdpClientAdvancedSettings)
+ return m_IMsRdpClientAdvancedSettings;
+ else if(m_IMsRdpClientAdvancedSettings2)
+ m_IMsRdpClientAdvancedSettings = m_IMsRdpClientAdvancedSettings2;
+ else if(m_IMsRdpClientAdvancedSettings3)
+ m_IMsRdpClientAdvancedSettings = m_IMsRdpClientAdvancedSettings3;
+ else if(m_IMsRdpClientAdvancedSettings4)
+ m_IMsRdpClientAdvancedSettings = m_IMsRdpClientAdvancedSettings4;
+
+ if(m_IMsRdpClientAdvancedSettings)
+ {
+ m_IMsRdpClientAdvancedSettings->AddRef();
+ return m_IMsRdpClientAdvancedSettings;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClientAdvancedSettings);
+ return m_IMsRdpClientAdvancedSettings;
+ }
+
+ IMsRdpClientAdvancedSettings2 * getIMsRdpClientAdvancedSettings2()
+ {
+ if(m_IMsRdpClientAdvancedSettings2)
+ return m_IMsRdpClientAdvancedSettings2;
+ else if(m_IMsRdpClientAdvancedSettings3)
+ m_IMsRdpClientAdvancedSettings2 = m_IMsRdpClientAdvancedSettings3;
+ else if(m_IMsRdpClientAdvancedSettings4)
+ m_IMsRdpClientAdvancedSettings2 = m_IMsRdpClientAdvancedSettings4;
+
+ if(m_IMsRdpClientAdvancedSettings2)
+ {
+ m_IMsRdpClientAdvancedSettings2->AddRef();
+ return m_IMsRdpClientAdvancedSettings2;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClientAdvancedSettings2);
+ return m_IMsRdpClientAdvancedSettings2;
+ }
+
+ IMsRdpClientAdvancedSettings3 * getIMsRdpClientAdvancedSettings3()
+ {
+ if(m_IMsRdpClientAdvancedSettings3)
+ return m_IMsRdpClientAdvancedSettings3;
+ else if(m_IMsRdpClientAdvancedSettings4)
+ m_IMsRdpClientAdvancedSettings3 = m_IMsRdpClientAdvancedSettings4;
+
+ if(m_IMsRdpClientAdvancedSettings3)
+ {
+ m_IMsRdpClientAdvancedSettings3->AddRef();
+ return m_IMsRdpClientAdvancedSettings3;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClientAdvancedSettings3);
+ return m_IMsRdpClientAdvancedSettings3;
+ }
+
+ IMsRdpClientAdvancedSettings4 * getIMsRdpClientAdvancedSettings4()
+ {
+ if(m_IMsRdpClientAdvancedSettings4)
+ return m_IMsRdpClientAdvancedSettings4;
+
+ if(m_IMsRdpClientAdvancedSettings4)
+ {
+ m_IMsRdpClientAdvancedSettings4->AddRef();
+ return m_IMsRdpClientAdvancedSettings4;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClientAdvancedSettings4);
+ return m_IMsRdpClientAdvancedSettings4;
+ }
+
+ ~CAdvancedSettings()
+ {
+ m_IUnknown->Release();
+ m_IDispatch->Release();
+
+ if(m_IMsTscAdvancedSettings)
+ m_IMsTscAdvancedSettings->Release();
+
+ if(m_IMsRdpClientAdvancedSettings)
+ m_IMsRdpClientAdvancedSettings->Release();
+
+ if(m_IMsRdpClientAdvancedSettings2)
+ m_IMsRdpClientAdvancedSettings2->Release();
+
+ if(m_IMsRdpClientAdvancedSettings3)
+ m_IMsRdpClientAdvancedSettings3->Release();
+
+ if(m_IMsRdpClientAdvancedSettings4)
+ m_IMsRdpClientAdvancedSettings4->Release();
+ }
+
+ void Init(IMsTscAdvancedSettings * p)
+ {
+ m_IMsTscAdvancedSettings = p;
+ }
+
+ void Init(IMsRdpClientAdvancedSettings * p)
+ {
+ m_IMsRdpClientAdvancedSettings = p;
+ }
+
+ void Init(IMsRdpClientAdvancedSettings2 * p)
+ {
+ m_IMsRdpClientAdvancedSettings2 = p;
+ }
+
+ void Init(IMsRdpClientAdvancedSettings3 * p)
+ {
+ m_IMsRdpClientAdvancedSettings3 = p;
+ }
+
+ void Init(IMsRdpClientAdvancedSettings4 * p)
+ {
+ m_IMsRdpClientAdvancedSettings4 = p;
+ }
+
+ public:
+ template<class Interface> CAdvancedSettings(Interface * p):
+ m_refCount(1),
+ m_IUnknown(p),
+ m_IDispatch(p),
+ m_IMsTscAdvancedSettings(NULL),
+ m_IMsRdpClientAdvancedSettings(NULL),
+ m_IMsRdpClientAdvancedSettings2(NULL),
+ m_IMsRdpClientAdvancedSettings3(NULL),
+ m_IMsRdpClientAdvancedSettings4(NULL)
+ {
+ assert(p);
+ p->AddRef();
+ p->AddRef();
+ Init(p);
+ }
+
+ /* IUnknown */
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ HRESULT hr;
+ IUnknown * pvObject;
+
+ dbgprintf(TEXT("CAdvancedSettings::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject);
+
+#define QIBEGIN() \
+ if(riid == IID_IUnknown) \
+ { \
+ hr = S_OK; \
+ pvObject = (IUnknown *)(this); \
+ }
+
+#define QI(I) \
+ else if(riid == IID_ ## I) \
+ { \
+ if(m_ ## I) \
+ { \
+ m_ ## I->AddRef(); \
+ hr = S_OK; \
+ } \
+ else \
+ { \
+ hr = m_IUnknown->QueryInterface(&m_ ## I); \
+ } \
+ \
+ if(SUCCEEDED(hr)) \
+ pvObject = static_cast<I *>(this); \
+ }
+
+#define QIEND() \
+ else \
+ { \
+ hr = E_NOINTERFACE; \
+ pvObject = NULL; \
+ }
+
+ QIBEGIN()
+ QI(IDispatch)
+ QI(IMsTscAdvancedSettings)
+ QI(IMsRdpClientAdvancedSettings)
+ QI(IMsRdpClientAdvancedSettings2)
+ QI(IMsRdpClientAdvancedSettings3)
+ QI(IMsRdpClientAdvancedSettings4)
+ QIEND()
+
+#undef QIBEGIN
+#undef QIEND
+#undef QI
+
+ if(SUCCEEDED(hr))
+ {
+ assert(pvObject);
+ pvObject->AddRef();
+ }
+ else
+ {
+ assert(pvObject == NULL);
+ }
+
+ *ppvObject = pvObject;
+
+ dbgprintf(TEXT("CAdvancedSettings::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject);
+ return hr;
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef(void)
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release(void)
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ /* IDispatch */
+ /*
+ * p = get();
+ dbgprintf(TEXT("CAdvancedSettings::()"), );
+ HRESULT hr = p->();
+ dbgprintf(TEXT("CAdvancedSettings:: -> %08X, "), hr, );
+ return hr;
+ */
+ virtual STDMETHODIMP IDispatch::GetTypeInfoCount(UINT * pctinfo)
+ {
+ IDispatch * pIDispatch = getIDispatch();
+ dbgprintf(TEXT("CAdvancedSettings::GetTypeInfoCount(%p)"), pctinfo);
+ HRESULT hr = pIDispatch->GetTypeInfoCount(pctinfo);
+ dbgprintf(TEXT("CAdvancedSettings::GetTypeInfoCount -> %08X, ctinfo = %u"), hr, *pctinfo);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IDispatch::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo)
+ {
+ IDispatch * pIDispatch = getIDispatch();
+ dbgprintf(TEXT("CAdvancedSettings::GetTypeInfo(%u, %lu, %p)"), iTInfo, lcid, ppTInfo);
+ HRESULT hr = pIDispatch->GetTypeInfo(iTInfo, lcid, ppTInfo);
+ dbgprintf(TEXT("CAdvancedSettings::GetTypeInfo -> %08X, pTInfo = %p"), hr, *ppTInfo);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IDispatch::GetIDsOfNames(REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId)
+ {
+ IDispatch * pIDispatch = getIDispatch();
+ dbgprintf(TEXT("CAdvancedSettings::GetIDsOfNames(%ls, %ls, %d, %lu, %p)"), UUIDToString(riid).c_str(), *rgszNames, cNames, lcid, rgDispId);
+ HRESULT hr = pIDispatch->GetIDsOfNames(riid, rgszNames, cNames, lcid, rgDispId);
+ dbgprintf(TEXT("CAdvancedSettings::GetIDsOfNames -> %08X, rgDispId = %ld"), hr, *rgDispId);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IDispatch::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr)
+ {
+ // TODO
+ IDispatch * pIDispatch = getIDispatch();
+ dbgprintf(TEXT("CAdvancedSettings::Invoke()")/*, */);
+ HRESULT hr = pIDispatch->Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+ dbgprintf(TEXT("CAdvancedSettings::Invoke -> %08X, "), hr/*, */);
+ return hr;
+ }
+
+ /* IMsTscAdvancedSettings */
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_Compress(long pcompress)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_Compress(%ld)"), pcompress);
+ HRESULT hr = pIMsTscAdvancedSettings->put_Compress(pcompress);
+ dbgprintf(TEXT("CAdvancedSettings::put_Compress -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_Compress(long * pcompress)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_Compress(%p)"), pcompress);
+ HRESULT hr = pIMsTscAdvancedSettings->get_Compress(pcompress);
+ dbgprintf(TEXT("CAdvancedSettings::get_Compress -> %08X, compress = %ld"), hr, *pcompress);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_BitmapPeristence(long pbitmapPeristence)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapPeristence(%ld)"), pbitmapPeristence);
+ HRESULT hr = pIMsTscAdvancedSettings->put_BitmapPeristence(pbitmapPeristence);
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapPeristence -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_BitmapPeristence(long * pbitmapPeristence)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapPeristence(%p)"), pbitmapPeristence);
+ HRESULT hr = pIMsTscAdvancedSettings->get_BitmapPeristence(pbitmapPeristence);
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapPeristence -> %08X, bitmapPeristence = %ld"), hr, *pbitmapPeristence);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_allowBackgroundInput(long pallowBackgroundInput)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_allowBackgroundInput(%ld)"), pallowBackgroundInput);
+ HRESULT hr = pIMsTscAdvancedSettings->put_allowBackgroundInput(pallowBackgroundInput);
+ dbgprintf(TEXT("CAdvancedSettings::put_allowBackgroundInput -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_allowBackgroundInput(long * pallowBackgroundInput)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_allowBackgroundInput(%p)"), pallowBackgroundInput);
+ HRESULT hr = pIMsTscAdvancedSettings->get_allowBackgroundInput(pallowBackgroundInput);
+ dbgprintf(TEXT("CAdvancedSettings::get_allowBackgroundInput -> %08X, allowBackgroundInput = %ld"), hr, *pallowBackgroundInput);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_KeyBoardLayoutStr(BSTR rhs)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_KeyBoardLayoutStr(%ls)"), rhs);
+ HRESULT hr = pIMsTscAdvancedSettings->put_KeyBoardLayoutStr(rhs);
+ dbgprintf(TEXT("CAdvancedSettings::put_KeyBoardLayoutStr -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_PluginDlls(BSTR rhs)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_PluginDlls(%ls)"), rhs);
+ HRESULT hr = pIMsTscAdvancedSettings->put_PluginDlls(rhs);
+ dbgprintf(TEXT("CAdvancedSettings::put_PluginDlls -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_IconFile(BSTR rhs)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_IconFile(%ls)"), rhs);
+ HRESULT hr = pIMsTscAdvancedSettings->put_IconFile(rhs);
+ dbgprintf(TEXT("CAdvancedSettings::put_IconFile -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_IconIndex(long rhs)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_IconIndex(%ld)"), rhs);
+ HRESULT hr = pIMsTscAdvancedSettings->put_IconIndex(rhs);
+ dbgprintf(TEXT("CAdvancedSettings::put_IconIndex -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_ContainerHandledFullScreen(long pContainerHandledFullScreen)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_ContainerHandledFullScreen(%ld)"), pContainerHandledFullScreen);
+ HRESULT hr = pIMsTscAdvancedSettings->put_ContainerHandledFullScreen(pContainerHandledFullScreen);
+ dbgprintf(TEXT("CAdvancedSettings::put_ContainerHandledFullScreen -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_ContainerHandledFullScreen(long * pContainerHandledFullScreen)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_ContainerHandledFullScreen(%p)"), pContainerHandledFullScreen);
+ HRESULT hr = pIMsTscAdvancedSettings->get_ContainerHandledFullScreen(pContainerHandledFullScreen);
+ dbgprintf(TEXT("CAdvancedSettings::get_ContainerHandledFullScreen -> %08X, ContainerHandledFullScreen = %ld"), hr, *pContainerHandledFullScreen);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_DisableRdpdr(long pDisableRdpdr)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_DisableRdpdr(%ld)"), pDisableRdpdr);
+ HRESULT hr = pIMsTscAdvancedSettings->put_DisableRdpdr(pDisableRdpdr);
+ dbgprintf(TEXT("CAdvancedSettings::put_DisableRdpdr -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_DisableRdpdr(long * pDisableRdpdr)
+ {
+ IMsTscAdvancedSettings * pIMsTscAdvancedSettings = getIMsTscAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_DisableRdpdr(%p)"), pDisableRdpdr);
+ HRESULT hr = pIMsTscAdvancedSettings->get_DisableRdpdr(pDisableRdpdr);
+ dbgprintf(TEXT("CAdvancedSettings::get_DisableRdpdr -> %08X, DisableRdpdr = %ld"), hr, *pDisableRdpdr);
+ return hr;
+ }
+
+ /* IMsRdpClientAdvancedSettings */
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_SmoothScroll(long psmoothScroll)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_SmoothScroll(%ld)"), psmoothScroll);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_SmoothScroll(psmoothScroll);
+ dbgprintf(TEXT("CAdvancedSettings::put_SmoothScroll -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_SmoothScroll(long * psmoothScroll)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_SmoothScroll(%p)"), psmoothScroll);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_SmoothScroll(psmoothScroll);
+ dbgprintf(TEXT("CAdvancedSettings::get_SmoothScroll -> %08X, smoothScroll = %ld"), hr, *psmoothScroll);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_AcceleratorPassthrough(long pacceleratorPassthrough)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_AcceleratorPassthrough(%ld)"), pacceleratorPassthrough);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_AcceleratorPassthrough(pacceleratorPassthrough);
+ dbgprintf(TEXT("CAdvancedSettings::put_AcceleratorPassthrough -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_AcceleratorPassthrough(long * pacceleratorPassthrough)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_AcceleratorPassthrough(%p)"), pacceleratorPassthrough);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_AcceleratorPassthrough(pacceleratorPassthrough);
+ dbgprintf(TEXT("CAdvancedSettings::get_AcceleratorPassthrough -> %08X, acceleratorPassthrough = %ld"), hr, *pacceleratorPassthrough);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ShadowBitmap(long pshadowBitmap)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_ShadowBitmap(%ld)"), pshadowBitmap);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_ShadowBitmap(pshadowBitmap);
+ dbgprintf(TEXT("CAdvancedSettings::put_ShadowBitmap -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_ShadowBitmap(long * pshadowBitmap)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_ShadowBitmap(%p)"), pshadowBitmap);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_ShadowBitmap(pshadowBitmap);
+ dbgprintf(TEXT("CAdvancedSettings::get_ShadowBitmap -> %08X, shadowBitmap = %ld"), hr, *pshadowBitmap);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_TransportType(long ptransportType)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_TransportType(%ld)"), ptransportType);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_TransportType(ptransportType);
+ dbgprintf(TEXT("CAdvancedSettings::put_TransportType -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_TransportType(long * ptransportType)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_TransportType(%p)"), ptransportType);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_TransportType(ptransportType);
+ dbgprintf(TEXT("CAdvancedSettings::get_TransportType -> %08X, transportType = %ld"), hr, *ptransportType);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_SasSequence(long psasSequence)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_SasSequence(%ld)"), psasSequence);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_SasSequence(psasSequence);
+ dbgprintf(TEXT("CAdvancedSettings::put_SasSequence -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_SasSequence(long * psasSequence)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_SasSequence(%p)"), psasSequence);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_SasSequence(psasSequence);
+ dbgprintf(TEXT("CAdvancedSettings::get_SasSequence -> %08X, sasSequence = %ld"), hr, *psasSequence);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_EncryptionEnabled(long pencryptionEnabled)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_EncryptionEnabled(%ld)"), pencryptionEnabled);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_EncryptionEnabled(pencryptionEnabled);
+ dbgprintf(TEXT("CAdvancedSettings::put_EncryptionEnabled -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_EncryptionEnabled(long * pencryptionEnabled)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_EncryptionEnabled(%p)"), pencryptionEnabled);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_EncryptionEnabled(pencryptionEnabled);
+ dbgprintf(TEXT("CAdvancedSettings::get_EncryptionEnabled -> %08X, encryptionEnabled = %ld"), hr, *pencryptionEnabled);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_DedicatedTerminal(long pdedicatedTerminal)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_DedicatedTerminal(%ld)"), pdedicatedTerminal);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_DedicatedTerminal(pdedicatedTerminal);
+ dbgprintf(TEXT("CAdvancedSettings::put_DedicatedTerminal -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_DedicatedTerminal(long * pdedicatedTerminal)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_DedicatedTerminal(%p)"), pdedicatedTerminal);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_DedicatedTerminal(pdedicatedTerminal);
+ dbgprintf(TEXT("CAdvancedSettings::get_DedicatedTerminal -> %08X, dedicatedTerminal = %ld"), hr, *pdedicatedTerminal);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RDPPort(long prdpPort)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_RDPPort(%ld)"), prdpPort);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_RDPPort(prdpPort);
+ dbgprintf(TEXT("CAdvancedSettings::put_RDPPort -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RDPPort(long * prdpPort)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_RDPPort(%p)"), prdpPort);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_RDPPort(prdpPort);
+ dbgprintf(TEXT("CAdvancedSettings::get_RDPPort -> %08X, rdpPort = %ld"), hr, *prdpPort);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_EnableMouse(long penableMouse)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_EnableMouse(%ld)"), penableMouse);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_EnableMouse(penableMouse);
+ dbgprintf(TEXT("CAdvancedSettings::put_EnableMouse -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_EnableMouse(long * penableMouse)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_EnableMouse(%p)"), penableMouse);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_EnableMouse(penableMouse);
+ dbgprintf(TEXT("CAdvancedSettings::get_EnableMouse -> %08X, enableMouse = %ld"), hr, *penableMouse);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_DisableCtrlAltDel(long pdisableCtrlAltDel)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_DisableCtrlAltDel(%ld)"), pdisableCtrlAltDel);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_DisableCtrlAltDel(pdisableCtrlAltDel);
+ dbgprintf(TEXT("CAdvancedSettings::put_DisableCtrlAltDel -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_DisableCtrlAltDel(long * pdisableCtrlAltDel)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_DisableCtrlAltDel(%p)"), pdisableCtrlAltDel);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_DisableCtrlAltDel(pdisableCtrlAltDel);
+ dbgprintf(TEXT("CAdvancedSettings::get_DisableCtrlAltDel -> %08X, disableCtrlAltDel = %ld"), hr, *pdisableCtrlAltDel);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_EnableWindowsKey(long penableWindowsKey)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_EnableWindowsKey(%ld)"), penableWindowsKey);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_EnableWindowsKey(penableWindowsKey);
+ dbgprintf(TEXT("CAdvancedSettings::put_EnableWindowsKey -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_EnableWindowsKey(long * penableWindowsKey)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_EnableWindowsKey(%p)"), penableWindowsKey);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_EnableWindowsKey(penableWindowsKey);
+ dbgprintf(TEXT("CAdvancedSettings::get_EnableWindowsKey -> %08X, enableWindowsKey = %ld"), hr, *penableWindowsKey);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_DoubleClickDetect(long pdoubleClickDetect)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_DoubleClickDetect(%ld)"), pdoubleClickDetect);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_DoubleClickDetect(pdoubleClickDetect);
+ dbgprintf(TEXT("CAdvancedSettings::put_DoubleClickDetect -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_DoubleClickDetect(long * pdoubleClickDetect)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_DoubleClickDetect(%p)"), pdoubleClickDetect);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_DoubleClickDetect(pdoubleClickDetect);
+ dbgprintf(TEXT("CAdvancedSettings::get_DoubleClickDetect -> %08X, doubleClickDetect = %ld"), hr, *pdoubleClickDetect);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_MaximizeShell(long pmaximizeShell)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_MaximizeShell(%ld)"), pmaximizeShell);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_MaximizeShell(pmaximizeShell);
+ dbgprintf(TEXT("CAdvancedSettings::put_MaximizeShell -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_MaximizeShell(long * pmaximizeShell)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_MaximizeShell(%p)"), pmaximizeShell);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_MaximizeShell(pmaximizeShell);
+ dbgprintf(TEXT("CAdvancedSettings::get_MaximizeShell -> %08X, maximizeShell = %ld"), hr, *pmaximizeShell);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyFullScreen(long photKeyFullScreen)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyFullScreen(%ld)"), photKeyFullScreen);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_HotKeyFullScreen(photKeyFullScreen);
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyFullScreen -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyFullScreen(long * photKeyFullScreen)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyFullScreen(%p)"), photKeyFullScreen);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_HotKeyFullScreen(photKeyFullScreen);
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyFullScreen -> %08X, hotKeyFullScreen = %ld"), hr, *photKeyFullScreen);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyCtrlEsc(long photKeyCtrlEsc)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyCtrlEsc(%ld)"), photKeyCtrlEsc);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_HotKeyCtrlEsc(photKeyCtrlEsc);
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyCtrlEsc -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyCtrlEsc(long * photKeyCtrlEsc)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyCtrlEsc(%p)"), photKeyCtrlEsc);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_HotKeyCtrlEsc(photKeyCtrlEsc);
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyCtrlEsc -> %08X, hotKeyCtrlEsc = %ld"), hr, *photKeyCtrlEsc);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyAltEsc(long photKeyAltEsc)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyAltEsc(%ld)"), photKeyAltEsc);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_HotKeyAltEsc(photKeyAltEsc);
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyAltEsc -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyAltEsc(long * photKeyAltEsc)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyAltEsc(%p)"), photKeyAltEsc);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_HotKeyAltEsc(photKeyAltEsc);
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyAltEsc -> %08X, hotKeyAltEsc = %ld"), hr, *photKeyAltEsc);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyAltTab(long photKeyAltTab)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyAltTab(%ld)"), photKeyAltTab);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_HotKeyAltTab(photKeyAltTab);
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyAltTab -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyAltTab(long * photKeyAltTab)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyAltTab(%p)"), photKeyAltTab);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_HotKeyAltTab(photKeyAltTab);
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyAltTab -> %08X, hotKeyAltTab = %ld"), hr, *photKeyAltTab);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyAltShiftTab(long photKeyAltShiftTab)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyAltShiftTab(%ld)"), photKeyAltShiftTab);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_HotKeyAltShiftTab(photKeyAltShiftTab);
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyAltShiftTab -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyAltShiftTab(long * photKeyAltShiftTab)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyAltShiftTab(%p)"), photKeyAltShiftTab);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_HotKeyAltShiftTab(photKeyAltShiftTab);
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyAltShiftTab -> %08X, hotKeyAltShiftTab = %ld"), hr, *photKeyAltShiftTab);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyAltSpace(long photKeyAltSpace)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyAltSpace(%ld)"), photKeyAltSpace);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_HotKeyAltSpace(photKeyAltSpace);
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyAltSpace -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyAltSpace(long * photKeyAltSpace)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyAltSpace(%p)"), photKeyAltSpace);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_HotKeyAltSpace(photKeyAltSpace);
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyAltSpace -> %08X, hotKeyAltSpace = %ld"), hr, *photKeyAltSpace);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyCtrlAltDel(long photKeyCtrlAltDel)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyCtrlAltDel(%ld)"), photKeyCtrlAltDel);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_HotKeyCtrlAltDel(photKeyCtrlAltDel);
+ dbgprintf(TEXT("CAdvancedSettings::put_HotKeyCtrlAltDel -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyCtrlAltDel(long * photKeyCtrlAltDel)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyCtrlAltDel(%p)"), photKeyCtrlAltDel);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_HotKeyCtrlAltDel(photKeyCtrlAltDel);
+ dbgprintf(TEXT("CAdvancedSettings::get_HotKeyCtrlAltDel -> %08X, hotKeyCtrlAltDel = %ld"), hr, *photKeyCtrlAltDel);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_orderDrawThreshold(long porderDrawThreshold)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_orderDrawThreshold(%ld)"), porderDrawThreshold);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_orderDrawThreshold(porderDrawThreshold);
+ dbgprintf(TEXT("CAdvancedSettings::put_orderDrawThreshold -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_orderDrawThreshold(long * porderDrawThreshold)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_orderDrawThreshold(%p)"), porderDrawThreshold);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_orderDrawThreshold(porderDrawThreshold);
+ dbgprintf(TEXT("CAdvancedSettings::get_orderDrawThreshold -> %08X, orderDrawThreshold = %ld"), hr, *porderDrawThreshold);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapCacheSize(long pbitmapCacheSize)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapCacheSize(%ld)"), pbitmapCacheSize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_BitmapCacheSize(pbitmapCacheSize);
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapCacheSize -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapCacheSize(long * pbitmapCacheSize)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapCacheSize(%p)"), pbitmapCacheSize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_BitmapCacheSize(pbitmapCacheSize);
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapCacheSize -> %08X, bitmapCacheSize = %ld"), hr, *pbitmapCacheSize);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapVirtualCacheSize(long pbitmapVirtualCacheSize)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapVirtualCacheSize(%ld)"), pbitmapVirtualCacheSize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_BitmapVirtualCacheSize(pbitmapVirtualCacheSize);
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapVirtualCacheSize -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapVirtualCacheSize(long * pbitmapVirtualCacheSize)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapVirtualCacheSize(%p)"), pbitmapVirtualCacheSize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_BitmapVirtualCacheSize(pbitmapVirtualCacheSize);
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapVirtualCacheSize -> %08X, bitmapVirtualCacheSize = %ld"), hr, *pbitmapVirtualCacheSize);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ScaleBitmapCachesByBPP(long pbScale)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_ScaleBitmapCachesByBPP(%ld)"), pbScale);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_ScaleBitmapCachesByBPP(pbScale);
+ dbgprintf(TEXT("CAdvancedSettings::put_ScaleBitmapCachesByBPP -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_ScaleBitmapCachesByBPP(long * pbScale)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_ScaleBitmapCachesByBPP(%p)"), pbScale);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_ScaleBitmapCachesByBPP(pbScale);
+ dbgprintf(TEXT("CAdvancedSettings::get_ScaleBitmapCachesByBPP -> %08X, bScale = %ld"), hr, *pbScale);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_NumBitmapCaches(long pnumBitmapCaches)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_NumBitmapCaches(%ld)"), pnumBitmapCaches);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_NumBitmapCaches(pnumBitmapCaches);
+ dbgprintf(TEXT("CAdvancedSettings::put_NumBitmapCaches -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_NumBitmapCaches(long * pnumBitmapCaches)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_NumBitmapCaches(%p)"), pnumBitmapCaches);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_NumBitmapCaches(pnumBitmapCaches);
+ dbgprintf(TEXT("CAdvancedSettings::get_NumBitmapCaches -> %08X, numBitmapCaches = %ld"), hr, *pnumBitmapCaches);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_CachePersistenceActive(long pcachePersistenceActive)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_CachePersistenceActive(%ld)"), pcachePersistenceActive);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_CachePersistenceActive(pcachePersistenceActive);
+ dbgprintf(TEXT("CAdvancedSettings::put_CachePersistenceActive -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_CachePersistenceActive(long * pcachePersistenceActive)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_CachePersistenceActive(%p)"), pcachePersistenceActive);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_CachePersistenceActive(pcachePersistenceActive);
+ dbgprintf(TEXT("CAdvancedSettings::get_CachePersistenceActive -> %08X, cachePersistenceActive = %ld"), hr, *pcachePersistenceActive);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_PersistCacheDirectory(BSTR rhs)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_PersistCacheDirectory(%ls)"), rhs);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_PersistCacheDirectory(rhs);
+ dbgprintf(TEXT("CAdvancedSettings::put_PersistCacheDirectory -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_brushSupportLevel(long pbrushSupportLevel)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_brushSupportLevel(%ld)"), pbrushSupportLevel);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_brushSupportLevel(pbrushSupportLevel);
+ dbgprintf(TEXT("CAdvancedSettings::put_brushSupportLevel -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_brushSupportLevel(long * pbrushSupportLevel)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_brushSupportLevel(%p)"), pbrushSupportLevel);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_brushSupportLevel(pbrushSupportLevel);
+ dbgprintf(TEXT("CAdvancedSettings::get_brushSupportLevel -> %08X, brushSupportLevel = %ld"), hr, *pbrushSupportLevel);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_minInputSendInterval(long pminInputSendInterval)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_minInputSendInterval(%ld)"), pminInputSendInterval);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_minInputSendInterval(pminInputSendInterval);
+ dbgprintf(TEXT("CAdvancedSettings::put_minInputSendInterval -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_minInputSendInterval(long * pminInputSendInterval)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_minInputSendInterval(%p)"), pminInputSendInterval);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_minInputSendInterval(pminInputSendInterval);
+ dbgprintf(TEXT("CAdvancedSettings::get_minInputSendInterval -> %08X, minInputSendInterval = %ld"), hr, *pminInputSendInterval);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_InputEventsAtOnce(long pinputEventsAtOnce)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_InputEventsAtOnce(%ld)"), pinputEventsAtOnce);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_InputEventsAtOnce(pinputEventsAtOnce);
+ dbgprintf(TEXT("CAdvancedSettings::put_InputEventsAtOnce -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_InputEventsAtOnce(long * pinputEventsAtOnce)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_InputEventsAtOnce(%p)"), pinputEventsAtOnce);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_InputEventsAtOnce(pinputEventsAtOnce);
+ dbgprintf(TEXT("CAdvancedSettings::get_InputEventsAtOnce -> %08X, inputEventsAtOnce = %ld"), hr, *pinputEventsAtOnce);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_maxEventCount(long pmaxEventCount)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_maxEventCount(%ld)"), pmaxEventCount);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_maxEventCount(pmaxEventCount);
+ dbgprintf(TEXT("CAdvancedSettings::put_maxEventCount -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_maxEventCount(long * pmaxEventCount)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_maxEventCount(%p)"), pmaxEventCount);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_maxEventCount(pmaxEventCount);
+ dbgprintf(TEXT("CAdvancedSettings::get_maxEventCount -> %08X, maxEventCount = %ld"), hr, *pmaxEventCount);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_keepAliveInterval(long pkeepAliveInterval)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_keepAliveInterval(%ld)"), pkeepAliveInterval);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_keepAliveInterval(pkeepAliveInterval);
+ dbgprintf(TEXT("CAdvancedSettings::put_keepAliveInterval -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_keepAliveInterval(long * pkeepAliveInterval)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_keepAliveInterval(%p)"), pkeepAliveInterval);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_keepAliveInterval(pkeepAliveInterval);
+ dbgprintf(TEXT("CAdvancedSettings::get_keepAliveInterval -> %08X, keepAliveInterval = %ld"), hr, *pkeepAliveInterval);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_shutdownTimeout(long pshutdownTimeout)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_shutdownTimeout(%ld)"), pshutdownTimeout);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_shutdownTimeout(pshutdownTimeout);
+ dbgprintf(TEXT("CAdvancedSettings::put_shutdownTimeout -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_shutdownTimeout(long * pshutdownTimeout)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_shutdownTimeout(%p)"), pshutdownTimeout);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_shutdownTimeout(pshutdownTimeout);
+ dbgprintf(TEXT("CAdvancedSettings::get_shutdownTimeout -> %08X, shutdownTimeout = %ld"), hr, *pshutdownTimeout);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_overallConnectionTimeout(long poverallConnectionTimeout)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_overallConnectionTimeout(%ld)"), poverallConnectionTimeout);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_overallConnectionTimeout(poverallConnectionTimeout);
+ dbgprintf(TEXT("CAdvancedSettings::put_overallConnectionTimeout -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_overallConnectionTimeout(long * poverallConnectionTimeout)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_overallConnectionTimeout(%p)"), poverallConnectionTimeout);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_overallConnectionTimeout(poverallConnectionTimeout);
+ dbgprintf(TEXT("CAdvancedSettings::get_overallConnectionTimeout -> %08X, overallConnectionTimeout = %ld"), hr, *poverallConnectionTimeout);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_singleConnectionTimeout(long psingleConnectionTimeout)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_singleConnectionTimeout(%ld)"), psingleConnectionTimeout);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_singleConnectionTimeout(psingleConnectionTimeout);
+ dbgprintf(TEXT("CAdvancedSettings::put_singleConnectionTimeout -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_singleConnectionTimeout(long * psingleConnectionTimeout)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_singleConnectionTimeout(%p)"), psingleConnectionTimeout);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_singleConnectionTimeout(psingleConnectionTimeout);
+ dbgprintf(TEXT("CAdvancedSettings::get_singleConnectionTimeout -> %08X, singleConnectionTimeout = %ld"), hr, *psingleConnectionTimeout);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_KeyboardType(long pkeyboardType)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_KeyboardType(%ld)"), pkeyboardType);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_KeyboardType(pkeyboardType);
+ dbgprintf(TEXT("CAdvancedSettings::put_KeyboardType -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_KeyboardType(long * pkeyboardType)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_KeyboardType(%p)"), pkeyboardType);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_KeyboardType(pkeyboardType);
+ dbgprintf(TEXT("CAdvancedSettings::get_KeyboardType -> %08X, keyboardType = %ld"), hr, *pkeyboardType);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_KeyboardSubType(long pkeyboardSubType)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_KeyboardSubType(%ld)"), pkeyboardSubType);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_KeyboardSubType(pkeyboardSubType);
+ dbgprintf(TEXT("CAdvancedSettings::put_KeyboardSubType -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_KeyboardSubType(long * pkeyboardSubType)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_KeyboardSubType(%p)"), pkeyboardSubType);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_KeyboardSubType(pkeyboardSubType);
+ dbgprintf(TEXT("CAdvancedSettings::get_KeyboardSubType -> %08X, keyboardSubType = %ld"), hr, *pkeyboardSubType);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_KeyboardFunctionKey(long pkeyboardFunctionKey)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_KeyboardFunctionKey(%ld)"), pkeyboardFunctionKey);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_KeyboardFunctionKey(pkeyboardFunctionKey);
+ dbgprintf(TEXT("CAdvancedSettings::put_KeyboardFunctionKey -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_KeyboardFunctionKey(long * pkeyboardFunctionKey)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_KeyboardFunctionKey(%p)"), pkeyboardFunctionKey);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_KeyboardFunctionKey(pkeyboardFunctionKey);
+ dbgprintf(TEXT("CAdvancedSettings::get_KeyboardFunctionKey -> %08X, keyboardFunctionKey = %ld"), hr, *pkeyboardFunctionKey);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_WinceFixedPalette(long pwinceFixedPalette)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_WinceFixedPalette(%ld)"), pwinceFixedPalette);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_WinceFixedPalette(pwinceFixedPalette);
+ dbgprintf(TEXT("CAdvancedSettings::put_WinceFixedPalette -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_WinceFixedPalette(long * pwinceFixedPalette)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_WinceFixedPalette(%p)"), pwinceFixedPalette);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_WinceFixedPalette(pwinceFixedPalette);
+ dbgprintf(TEXT("CAdvancedSettings::get_WinceFixedPalette -> %08X, winceFixedPalette = %ld"), hr, *pwinceFixedPalette);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ConnectToServerConsole(VARIANT_BOOL pConnectToConsole)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_ConnectToServerConsole(%s)"), BooleanToString(pConnectToConsole));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_ConnectToServerConsole(pConnectToConsole);
+ dbgprintf(TEXT("CAdvancedSettings::put_ConnectToServerConsole -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_ConnectToServerConsole(VARIANT_BOOL * pConnectToConsole)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_ConnectToServerConsole(%p)"), pConnectToConsole);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_ConnectToServerConsole(pConnectToConsole);
+ dbgprintf(TEXT("CAdvancedSettings::get_ConnectToServerConsole -> %08X, ConnectToConsole = %s"), hr, BooleanToString(*pConnectToConsole));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapPersistence(long pbitmapPersistence)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapPersistence(%ld)"), pbitmapPersistence);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_BitmapPersistence(pbitmapPersistence);
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapPersistence -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapPersistence(long * pbitmapPersistence)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapPersistence(%p)"), pbitmapPersistence);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_BitmapPersistence(pbitmapPersistence);
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapPersistence -> %08X, bitmapPersistence = %ld"), hr, *pbitmapPersistence);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_MinutesToIdleTimeout(long pminutesToIdleTimeout)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_MinutesToIdleTimeout(%ld)"), pminutesToIdleTimeout);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_MinutesToIdleTimeout(pminutesToIdleTimeout);
+ dbgprintf(TEXT("CAdvancedSettings::put_MinutesToIdleTimeout -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_MinutesToIdleTimeout(long * pminutesToIdleTimeout)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_MinutesToIdleTimeout(%p)"), pminutesToIdleTimeout);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_MinutesToIdleTimeout(pminutesToIdleTimeout);
+ dbgprintf(TEXT("CAdvancedSettings::get_MinutesToIdleTimeout -> %08X, minutesToIdleTimeout = %ld"), hr, *pminutesToIdleTimeout);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_SmartSizing(VARIANT_BOOL pfSmartSizing)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_SmartSizing(%s)"), BooleanToString(pfSmartSizing));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_SmartSizing(pfSmartSizing);
+ dbgprintf(TEXT("CAdvancedSettings::put_SmartSizing -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_SmartSizing(VARIANT_BOOL * pfSmartSizing)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_SmartSizing(%p)"), pfSmartSizing);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_SmartSizing(pfSmartSizing);
+ dbgprintf(TEXT("CAdvancedSettings::get_SmartSizing -> %08X, fSmartSizing = %s"), hr, BooleanToString(*pfSmartSizing));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RdpdrLocalPrintingDocName(BSTR pLocalPrintingDocName)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_RdpdrLocalPrintingDocName(%ls)"), pLocalPrintingDocName);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_RdpdrLocalPrintingDocName(pLocalPrintingDocName);
+ dbgprintf(TEXT("CAdvancedSettings::put_RdpdrLocalPrintingDocName -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RdpdrLocalPrintingDocName(BSTR * pLocalPrintingDocName)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_RdpdrLocalPrintingDocName(%p)"), pLocalPrintingDocName);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_RdpdrLocalPrintingDocName(pLocalPrintingDocName);
+ dbgprintf(TEXT("CAdvancedSettings::get_RdpdrLocalPrintingDocName -> %08X, LocalPrintingDocName = %ls"), hr, *pLocalPrintingDocName);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RdpdrClipCleanTempDirString(BSTR clipCleanTempDirString)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_RdpdrClipCleanTempDirString(%ls)"), clipCleanTempDirString);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_RdpdrClipCleanTempDirString(clipCleanTempDirString);
+ dbgprintf(TEXT("CAdvancedSettings::put_RdpdrClipCleanTempDirString -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RdpdrClipCleanTempDirString(BSTR * clipCleanTempDirString)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_RdpdrClipCleanTempDirString(%p)"), clipCleanTempDirString);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_RdpdrClipCleanTempDirString(clipCleanTempDirString);
+ dbgprintf(TEXT("CAdvancedSettings::get_RdpdrClipCleanTempDirString -> %08X, clipCleanTempDirString = %ls"), hr, *clipCleanTempDirString);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RdpdrClipPasteInfoString(BSTR clipPasteInfoString)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_RdpdrClipPasteInfoString(%ls)"), clipPasteInfoString);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_RdpdrClipPasteInfoString(clipPasteInfoString);
+ dbgprintf(TEXT("CAdvancedSettings::put_RdpdrClipPasteInfoString -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RdpdrClipPasteInfoString(BSTR * clipPasteInfoString)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_RdpdrClipPasteInfoString(%p)"), clipPasteInfoString);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_RdpdrClipPasteInfoString(clipPasteInfoString);
+ dbgprintf(TEXT("CAdvancedSettings::get_RdpdrClipPasteInfoString -> %08X, clipPasteInfoString = %ls"), hr, *clipPasteInfoString);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ClearTextPassword(BSTR rhs)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_ClearTextPassword(%ls)"), rhs);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_ClearTextPassword(rhs);
+ dbgprintf(TEXT("CAdvancedSettings::put_ClearTextPassword -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_DisplayConnectionBar(VARIANT_BOOL pDisplayConnectionBar)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_DisplayConnectionBar(%s)"), BooleanToString(pDisplayConnectionBar));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_DisplayConnectionBar(pDisplayConnectionBar);
+ dbgprintf(TEXT("CAdvancedSettings::put_DisplayConnectionBar -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_DisplayConnectionBar(VARIANT_BOOL * pDisplayConnectionBar)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_DisplayConnectionBar(%p)"), pDisplayConnectionBar);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_DisplayConnectionBar(pDisplayConnectionBar);
+ dbgprintf(TEXT("CAdvancedSettings::get_DisplayConnectionBar -> %08X, DisplayConnectionBar = %s"), hr, BooleanToString(*pDisplayConnectionBar));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_PinConnectionBar(VARIANT_BOOL pPinConnectionBar)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_PinConnectionBar(%s)"), BooleanToString(pPinConnectionBar));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_PinConnectionBar(pPinConnectionBar);
+ dbgprintf(TEXT("CAdvancedSettings::put_PinConnectionBar -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_PinConnectionBar(VARIANT_BOOL * pPinConnectionBar)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_PinConnectionBar(%p)"), pPinConnectionBar);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_PinConnectionBar(pPinConnectionBar);
+ dbgprintf(TEXT("CAdvancedSettings::get_PinConnectionBar -> %08X, PinConnectionBar = %s"), hr, BooleanToString(*pPinConnectionBar));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_GrabFocusOnConnect(VARIANT_BOOL pfGrabFocusOnConnect)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_GrabFocusOnConnect(%s)"), BooleanToString(pfGrabFocusOnConnect));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_GrabFocusOnConnect(pfGrabFocusOnConnect);
+ dbgprintf(TEXT("CAdvancedSettings::put_GrabFocusOnConnect -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_GrabFocusOnConnect(VARIANT_BOOL * pfGrabFocusOnConnect)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_GrabFocusOnConnect(%p)"), pfGrabFocusOnConnect);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_GrabFocusOnConnect(pfGrabFocusOnConnect);
+ dbgprintf(TEXT("CAdvancedSettings::get_GrabFocusOnConnect -> %08X, fGrabFocusOnConnect = %s"), hr, BooleanToString(*pfGrabFocusOnConnect));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_LoadBalanceInfo(BSTR pLBInfo)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_LoadBalanceInfo(%ls)"), pLBInfo);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_LoadBalanceInfo(pLBInfo);
+ dbgprintf(TEXT("CAdvancedSettings::put_LoadBalanceInfo -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_LoadBalanceInfo(BSTR * pLBInfo)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_LoadBalanceInfo(%p)"), pLBInfo);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_LoadBalanceInfo(pLBInfo);
+ dbgprintf(TEXT("CAdvancedSettings::get_LoadBalanceInfo -> %08X, LBInfo = %ls"), hr, *pLBInfo);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RedirectDrives(VARIANT_BOOL pRedirectDrives)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_RedirectDrives(%s)"), BooleanToString(pRedirectDrives));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_RedirectDrives(pRedirectDrives);
+ dbgprintf(TEXT("CAdvancedSettings::put_RedirectDrives -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RedirectDrives(VARIANT_BOOL * pRedirectDrives)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_RedirectDrives(%p)"), pRedirectDrives);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_RedirectDrives(pRedirectDrives);
+ dbgprintf(TEXT("CAdvancedSettings::get_RedirectDrives -> %08X, RedirectDrives = %s"), hr, BooleanToString(*pRedirectDrives));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RedirectPrinters(VARIANT_BOOL pRedirectPrinters)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_RedirectPrinters(%s)"), BooleanToString(pRedirectPrinters));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_RedirectPrinters(pRedirectPrinters);
+ dbgprintf(TEXT("CAdvancedSettings::put_RedirectPrinters -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RedirectPrinters(VARIANT_BOOL * pRedirectPrinters)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_RedirectPrinters(%p)"), pRedirectPrinters);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_RedirectPrinters(pRedirectPrinters);
+ dbgprintf(TEXT("CAdvancedSettings::get_RedirectPrinters -> %08X, RedirectPrinters = %s"), hr, BooleanToString(*pRedirectPrinters));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RedirectPorts(VARIANT_BOOL pRedirectPorts)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_RedirectPorts(%s)"), BooleanToString(pRedirectPorts));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_RedirectPorts(pRedirectPorts);
+ dbgprintf(TEXT("CAdvancedSettings::put_RedirectPorts -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RedirectPorts(VARIANT_BOOL * pRedirectPorts)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_RedirectPorts(%p)"), pRedirectPorts);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_RedirectPorts(pRedirectPorts);
+ dbgprintf(TEXT("CAdvancedSettings::get_RedirectPorts -> %08X, RedirectPorts = %s"), hr, BooleanToString(*pRedirectPorts));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RedirectSmartCards(VARIANT_BOOL pRedirectSmartCards)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_RedirectSmartCards(%s)"), BooleanToString(pRedirectSmartCards));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_RedirectSmartCards(pRedirectSmartCards);
+ dbgprintf(TEXT("CAdvancedSettings::put_RedirectSmartCards -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RedirectSmartCards(VARIANT_BOOL * pRedirectSmartCards)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_RedirectSmartCards(%p)"), pRedirectSmartCards);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_RedirectSmartCards(pRedirectSmartCards);
+ dbgprintf(TEXT("CAdvancedSettings::get_RedirectSmartCards -> %08X, RedirectSmartCards = %s"), hr, BooleanToString(*pRedirectSmartCards));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapVirtualCache16BppSize(long pBitmapVirtualCache16BppSize)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapVirtualCache16BppSize(%ld)"), pBitmapVirtualCache16BppSize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_BitmapVirtualCache16BppSize(pBitmapVirtualCache16BppSize);
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapVirtualCache16BppSize -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapVirtualCache16BppSize(long * pBitmapVirtualCache16BppSize)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapVirtualCache16BppSize(%p)"), pBitmapVirtualCache16BppSize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_BitmapVirtualCache16BppSize(pBitmapVirtualCache16BppSize);
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapVirtualCache16BppSize -> %08X, BitmapVirtualCache16BppSize = %ld"), hr, *pBitmapVirtualCache16BppSize);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapVirtualCache24BppSize(long pBitmapVirtualCache24BppSize)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapVirtualCache24BppSize(%ld)"), pBitmapVirtualCache24BppSize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_BitmapVirtualCache24BppSize(pBitmapVirtualCache24BppSize);
+ dbgprintf(TEXT("CAdvancedSettings::put_BitmapVirtualCache24BppSize -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapVirtualCache24BppSize(long * pBitmapVirtualCache24BppSize)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapVirtualCache24BppSize(%p)"), pBitmapVirtualCache24BppSize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_BitmapVirtualCache24BppSize(pBitmapVirtualCache24BppSize);
+ dbgprintf(TEXT("CAdvancedSettings::get_BitmapVirtualCache24BppSize -> %08X, BitmapVirtualCache24BppSize = %ld"), hr, *pBitmapVirtualCache24BppSize);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_PerformanceFlags(long pDisableList)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_PerformanceFlags(%ld)"), pDisableList);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_PerformanceFlags(pDisableList);
+ dbgprintf(TEXT("CAdvancedSettings::put_PerformanceFlags -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_PerformanceFlags(long * pDisableList)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_PerformanceFlags(%p)"), pDisableList);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_PerformanceFlags(pDisableList);
+ dbgprintf(TEXT("CAdvancedSettings::get_PerformanceFlags -> %08X, DisableList = %ld"), hr, *pDisableList);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ConnectWithEndpoint(VARIANT * rhs)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_ConnectWithEndpoint(%s)"), VariantToString(*rhs).c_str());
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_ConnectWithEndpoint(rhs);
+ dbgprintf(TEXT("CAdvancedSettings::put_ConnectWithEndpoint -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_NotifyTSPublicKey(VARIANT_BOOL pfNotify)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::put_NotifyTSPublicKey(%s)"), BooleanToString(pfNotify));
+ HRESULT hr = pIMsRdpClientAdvancedSettings->put_NotifyTSPublicKey(pfNotify);
+ dbgprintf(TEXT("CAdvancedSettings::put_NotifyTSPublicKey -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_NotifyTSPublicKey(VARIANT_BOOL * pfNotify)
+ {
+ IMsRdpClientAdvancedSettings * pIMsRdpClientAdvancedSettings = getIMsRdpClientAdvancedSettings();
+ dbgprintf(TEXT("CAdvancedSettings::get_NotifyTSPublicKey(%p)"), pfNotify);
+ HRESULT hr = pIMsRdpClientAdvancedSettings->get_NotifyTSPublicKey(pfNotify);
+ dbgprintf(TEXT("CAdvancedSettings::get_NotifyTSPublicKey -> %08X, fNotify = %s"), hr, BooleanToString(*pfNotify));
+ return hr;
+ }
+
+ /* IMsRdpClientAdvancedSettings2 */
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::get_CanAutoReconnect(VARIANT_BOOL * pfCanAutoReconnect)
+ {
+ IMsRdpClientAdvancedSettings2 * pIMsRdpClientAdvancedSettings2 = getIMsRdpClientAdvancedSettings2();
+ dbgprintf(TEXT("CAdvancedSettings::get_CanAutoReconnect(%p)"), pfCanAutoReconnect);
+ HRESULT hr = pIMsRdpClientAdvancedSettings2->get_CanAutoReconnect(pfCanAutoReconnect);
+ dbgprintf(TEXT("CAdvancedSettings::get_CanAutoReconnect -> %08X, fCanAutoReconnect = %s"), hr, BooleanToString(*pfCanAutoReconnect));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::put_EnableAutoReconnect(VARIANT_BOOL pfEnableAutoReconnect)
+ {
+ IMsRdpClientAdvancedSettings2 * pIMsRdpClientAdvancedSettings2 = getIMsRdpClientAdvancedSettings2();
+ dbgprintf(TEXT("CAdvancedSettings::put_EnableAutoReconnect(%s)"), BooleanToString(pfEnableAutoReconnect));
+ HRESULT hr = pIMsRdpClientAdvancedSettings2->put_EnableAutoReconnect(pfEnableAutoReconnect);
+ dbgprintf(TEXT("CAdvancedSettings::put_EnableAutoReconnect -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::get_EnableAutoReconnect(VARIANT_BOOL * pfEnableAutoReconnect)
+ {
+ IMsRdpClientAdvancedSettings2 * pIMsRdpClientAdvancedSettings2 = getIMsRdpClientAdvancedSettings2();
+ dbgprintf(TEXT("CAdvancedSettings::get_EnableAutoReconnect(%p)"), pfEnableAutoReconnect);
+ HRESULT hr = pIMsRdpClientAdvancedSettings2->get_EnableAutoReconnect(pfEnableAutoReconnect);
+ dbgprintf(TEXT("CAdvancedSettings::get_EnableAutoReconnect -> %08X, fEnableAutoReconnect = %s"), hr, BooleanToString(*pfEnableAutoReconnect));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::put_MaxReconnectAttempts(long pMaxReconnectAttempts)
+ {
+ IMsRdpClientAdvancedSettings2 * pIMsRdpClientAdvancedSettings2 = getIMsRdpClientAdvancedSettings2();
+ dbgprintf(TEXT("CAdvancedSettings::put_MaxReconnectAttempts(%ld)"), pMaxReconnectAttempts);
+ HRESULT hr = pIMsRdpClientAdvancedSettings2->put_MaxReconnectAttempts(pMaxReconnectAttempts);
+ dbgprintf(TEXT("CAdvancedSettings::put_MaxReconnectAttempts -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::get_MaxReconnectAttempts(long * pMaxReconnectAttempts)
+ {
+ IMsRdpClientAdvancedSettings2 * pIMsRdpClientAdvancedSettings2 = getIMsRdpClientAdvancedSettings2();
+ dbgprintf(TEXT("CAdvancedSettings::get_MaxReconnectAttempts(%p)"), pMaxReconnectAttempts);
+ HRESULT hr = pIMsRdpClientAdvancedSettings2->get_MaxReconnectAttempts(pMaxReconnectAttempts);
+ dbgprintf(TEXT("CAdvancedSettings::get_MaxReconnectAttempts -> %08X, MaxReconnectAttempts = %ld"), hr, *pMaxReconnectAttempts);
+ return hr;
+ }
+
+ /* IMsRdpClientAdvancedSettings3 */
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings3::put_ConnectionBarShowMinimizeButton(VARIANT_BOOL pfShowMinimize)
+ {
+ IMsRdpClientAdvancedSettings3 * pIMsRdpClientAdvancedSettings3 = getIMsRdpClientAdvancedSettings3();
+ dbgprintf(TEXT("CAdvancedSettings::put_ConnectionBarShowMinimizeButton(%s)"), BooleanToString(pfShowMinimize));
+ HRESULT hr = pIMsRdpClientAdvancedSettings3->put_ConnectionBarShowMinimizeButton(pfShowMinimize);
+ dbgprintf(TEXT("CAdvancedSettings::put_ConnectionBarShowMinimizeButton -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings3::get_ConnectionBarShowMinimizeButton(VARIANT_BOOL * pfShowMinimize)
+ {
+ IMsRdpClientAdvancedSettings3 * pIMsRdpClientAdvancedSettings3 = getIMsRdpClientAdvancedSettings3();
+ dbgprintf(TEXT("CAdvancedSettings::get_ConnectionBarShowMinimizeButton(%p)"), pfShowMinimize);
+ HRESULT hr = pIMsRdpClientAdvancedSettings3->get_ConnectionBarShowMinimizeButton(pfShowMinimize);
+ dbgprintf(TEXT("CAdvancedSettings::get_ConnectionBarShowMinimizeButton -> %08X, fShowMinimize = %s"), hr, BooleanToString(*pfShowMinimize));
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings3::put_ConnectionBarShowRestoreButton(VARIANT_BOOL pfShowRestore)
+ {
+ IMsRdpClientAdvancedSettings3 * pIMsRdpClientAdvancedSettings3 = getIMsRdpClientAdvancedSettings3();
+ dbgprintf(TEXT("CAdvancedSettings::put_ConnectionBarShowRestoreButton(%s)"), BooleanToString(pfShowRestore));
+ HRESULT hr = pIMsRdpClientAdvancedSettings3->put_ConnectionBarShowRestoreButton(pfShowRestore);
+ dbgprintf(TEXT("CAdvancedSettings::put_ConnectionBarShowRestoreButton -> %08X"), hr);
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings3::get_ConnectionBarShowRestoreButton(VARIANT_BOOL * pfShowRestore)
+ {
+ IMsRdpClientAdvancedSettings3 * pIMsRdpClientAdvancedSettings3 = getIMsRdpClientAdvancedSettings3();
+ dbgprintf(TEXT("CAdvancedSettings::get_ConnectionBarShowRestoreButton(%p)"), pfShowRestore);
+ HRESULT hr = pIMsRdpClientAdvancedSettings3->get_ConnectionBarShowRestoreButton(pfShowRestore);
+ dbgprintf(TEXT("CAdvancedSettings::get_ConnectionBarShowRestoreButton -> %08X, fShowRestore = %s"), hr, BooleanToString(*pfShowRestore));
+ return hr;
+ }
+
+ /* IMsRdpClientAdvancedSettings4 */
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings4::put_AuthenticationLevel(unsigned int puiAuthLevel)
+ {
+ IMsRdpClientAdvancedSettings4 * pIMsRdpClientAdvancedSettings4 = getIMsRdpClientAdvancedSettings4();
+ dbgprintf(TEXT("CAdvancedSettings::put_AuthenticationLevel(%u)"), puiAuthLevel);
+ HRESULT hr = pIMsRdpClientAdvancedSettings4->put_AuthenticationLevel(puiAuthLevel);
+ dbgprintf(TEXT("CAdvancedSettings::put_AuthenticationLevel -> %08X"), hr);
+ return hr;
+ }
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings4::get_AuthenticationLevel(unsigned int * puiAuthLevel)
+ {
+ IMsRdpClientAdvancedSettings4 * pIMsRdpClientAdvancedSettings4 = getIMsRdpClientAdvancedSettings4();
+ dbgprintf(TEXT("CAdvancedSettings::get_AuthenticationLevel(%p)"), puiAuthLevel);
+ HRESULT hr = pIMsRdpClientAdvancedSettings4->get_AuthenticationLevel(puiAuthLevel);
+ dbgprintf(TEXT("CAdvancedSettings::get_AuthenticationLevel -> %08X, uiAuthLevel = %ld"), hr, *puiAuthLevel);
+ return hr;
+ }
+ };
+
+ class CoClass:
+ /* Standard interfaces */
+ public IUnknown,
+ public IDispatch,
+ public IConnectionPointContainer,
+ public IDataObject,
+ public IObjectSafety,
+ public IOleControl,
+ public IOleInPlaceActiveObject,
+ public IOleInPlaceObject,
+ public IOleObject,
+ public IOleWindow,
+ public IPersist,
+ public IPersistPropertyBag,
+ public IPersistStorage,
+ public IPersistStreamInit,
+ public IProvideClassInfo,
+ public IProvideClassInfo2,
+ public IQuickActivate,
+ public ISpecifyPropertyPages,
+ public IViewObject,
+ public IViewObject2,
+
+ /* RDP client interfaces */
+ public IMsRdpClient4,
+ public IMsRdpClientNonScriptable2
+ {
+ private:
+ LONG m_refCount;
+
+ IUnknown * m_IUnknown;
+
+ IDispatch * m_IDispatch;
+ IConnectionPointContainer * m_IConnectionPointContainer;
+ IDataObject * m_IDataObject;
+ IObjectSafety * m_IObjectSafety;
+ IOleControl * m_IOleControl;
+ IOleInPlaceActiveObject * m_IOleInPlaceActiveObject;
+ IOleInPlaceObject * m_IOleInPlaceObject;
+ IOleObject * m_IOleObject;
+ IOleWindow * m_IOleWindow;
+ IPersist * m_IPersist;
+ IPersistPropertyBag * m_IPersistPropertyBag;
+ IPersistStorage * m_IPersistStorage;
+ IPersistStreamInit * m_IPersistStreamInit;
+ IProvideClassInfo * m_IProvideClassInfo;
+ IProvideClassInfo2 * m_IProvideClassInfo2;
+ IQuickActivate * m_IQuickActivate;
+ ISpecifyPropertyPages * m_ISpecifyPropertyPages;
+ IViewObject * m_IViewObject;
+ IViewObject2 * m_IViewObject2;
+
+ IMsRdpClient * m_IMsRdpClient;
+ IMsRdpClient2 * m_IMsRdpClient2;
+ IMsRdpClient3 * m_IMsRdpClient3;
+ IMsRdpClient4 * m_IMsRdpClient4;
+ IMsTscAx * m_IMsTscAx;
+ IMsTscNonScriptable * m_IMsTscNonScriptable;
+ IMsRdpClientNonScriptable * m_IMsRdpClientNonScriptable;
+ IMsRdpClientNonScriptable2 * m_IMsRdpClientNonScriptable2;
+
+ IDispatch * getIDispatch()
+ {
+ if(m_IDispatch)
+ return m_IDispatch;
+
+ if(m_IMsRdpClient)
+ m_IDispatch = m_IMsRdpClient;
+ else if(m_IMsRdpClient2)
+ m_IDispatch = m_IMsRdpClient2;
+ else if(m_IMsRdpClient3)
+ m_IDispatch = m_IMsRdpClient3;
+ else if(m_IMsRdpClient4)
+ m_IDispatch = m_IMsRdpClient4;
+ else if(m_IMsTscAx)
+ m_IDispatch = m_IMsTscAx;
+
+ if(m_IDispatch)
+ {
+ m_IDispatch->AddRef();
+ return m_IDispatch;
+ }
+
+ if(SUCCEEDED(m_IUnknown->QueryInterface(&m_IDispatch)))
+ return m_IDispatch;
+
+ return NULL;
+ }
+
+ IConnectionPointContainer * getIConnectionPointContainer()
+ {
+ if(m_IConnectionPointContainer)
+ return m_IConnectionPointContainer;
+
+ m_IUnknown->QueryInterface(&m_IConnectionPointContainer);
+ return m_IConnectionPointContainer;
+
+ }
+
+ IDataObject * getIDataObject()
+ {
+ if(m_IDataObject)
+ return m_IDataObject;
+
+ m_IUnknown->QueryInterface(&m_IDataObject);
+ return m_IDataObject;
+ }
+
+ IObjectSafety * getIObjectSafety()
+ {
+ if(m_IObjectSafety)
+ return m_IObjectSafety;
+
+ m_IUnknown->QueryInterface(&m_IObjectSafety);
+ return m_IObjectSafety;
+ }
+
+ IOleControl * getIOleControl()
+ {
+ if(m_IOleControl)
+ return m_IOleControl;
+
+ m_IUnknown->QueryInterface(&m_IOleControl);
+ return m_IOleControl;
+ }
+
+ IOleInPlaceActiveObject * getIOleInPlaceActiveObject()
+ {
+ if(m_IOleInPlaceActiveObject)
+ return m_IOleInPlaceActiveObject;
+
+ m_IUnknown->QueryInterface(&m_IOleInPlaceActiveObject);
+ return m_IOleInPlaceActiveObject;
+ }
+
+ IOleInPlaceObject * getIOleInPlaceObject()
+ {
+ if(m_IOleInPlaceObject)
+ return m_IOleInPlaceObject;
+
+ m_IUnknown->QueryInterface(&m_IOleInPlaceObject);
+ return m_IOleInPlaceObject;
+ }
+
+ IOleObject * getIOleObject()
+ {
+ if(m_IOleObject)
+ return m_IOleObject;
+
+ m_IUnknown->QueryInterface(&m_IOleObject);
+ return m_IOleObject;
+ }
+
+ IOleWindow * getIOleWindow()
+ {
+ if(m_IOleWindow)
+ return m_IOleWindow;
+
+ if(m_IOleInPlaceActiveObject)
+ m_IOleWindow = m_IOleInPlaceActiveObject;
+
+ if(m_IOleWindow)
+ {
+ m_IOleWindow->AddRef();
+ return m_IOleWindow;
+ }
+
+ m_IUnknown->QueryInterface(&m_IOleWindow);
+ return m_IOleWindow;
+ }
+
+ IPersist * getIPersist()
+ {
+ if(m_IPersist)
+ return m_IPersist;
+
+ if(m_IPersistPropertyBag)
+ m_IPersist = m_IPersistPropertyBag;
+ else if(m_IPersistStorage)
+ m_IPersist = m_IPersistStorage;
+ else if(m_IPersistStreamInit)
+ m_IPersist = m_IPersistStreamInit;
+
+ if(m_IPersist)
+ {
+ m_IPersist->AddRef();
+ return m_IPersist;
+ }
+
+ m_IUnknown->QueryInterface(&m_IPersist);
+ return m_IPersist;
+ }
+
+ IPersistPropertyBag * getIPersistPropertyBag()
+ {
+ if(m_IPersistPropertyBag)
+ return m_IPersistPropertyBag;
+
+ m_IUnknown->QueryInterface(&m_IPersistPropertyBag);
+ return m_IPersistPropertyBag;
+ }
+
+ IPersistStorage * getIPersistStorage()
+ {
+ if(m_IPersistStorage)
+ return m_IPersistStorage;
+
+ m_IUnknown->QueryInterface(&m_IPersistStorage);
+ return m_IPersistStorage;
+ }
+
+ IPersistStreamInit * getIPersistStreamInit()
+ {
+ if(m_IPersistStreamInit)
+ return m_IPersistStreamInit;
+
+ m_IUnknown->QueryInterface(&m_IPersistStreamInit);
+ return m_IPersistStreamInit;
+ }
+
+ IProvideClassInfo * getIProvideClassInfo()
+ {
+ if(m_IProvideClassInfo)
+ return m_IProvideClassInfo;
+
+ if(m_IProvideClassInfo2)
+ m_IProvideClassInfo = m_IProvideClassInfo2;
+
+ if(m_IProvideClassInfo)
+ {
+ m_IProvideClassInfo->AddRef();
+ return m_IProvideClassInfo;
+ }
+
+ m_IUnknown->QueryInterface(&m_IProvideClassInfo);
+ return m_IProvideClassInfo;
+ }
+
+ IProvideClassInfo2 * getIProvideClassInfo2()
+ {
+ if(m_IProvideClassInfo2)
+ return m_IProvideClassInfo2;
+
+ m_IUnknown->QueryInterface(&m_IProvideClassInfo2);
+ return m_IProvideClassInfo2;
+ }
+
+ IQuickActivate * getIQuickActivate()
+ {
+ if(m_IQuickActivate)
+ return m_IQuickActivate;
+
+ m_IUnknown->QueryInterface(&m_IQuickActivate);
+ return m_IQuickActivate;
+ }
+
+ ISpecifyPropertyPages * getISpecifyPropertyPages()
+ {
+ if(m_ISpecifyPropertyPages)
+ return m_ISpecifyPropertyPages;
+
+ m_IUnknown->QueryInterface(&m_ISpecifyPropertyPages);
+ return m_ISpecifyPropertyPages;
+ }
+
+ IViewObject * getIViewObject()
+ {
+ if(m_IViewObject)
+ return m_IViewObject;
+
+ if(m_IViewObject2)
+ m_IViewObject = m_IViewObject2;
+
+ if(m_IViewObject)
+ {
+ m_IViewObject->AddRef();
+ return m_IViewObject;
+ }
+
+ m_IUnknown->QueryInterface(&m_IViewObject);
+ return m_IViewObject;
+ }
+
+ IViewObject2 * getIViewObject2()
+ {
+ if(m_IViewObject2)
+ return m_IViewObject2;
+
+ m_IUnknown->QueryInterface(&m_IViewObject2);
+ return m_IViewObject2;
+ }
+
+ IMsRdpClient * getIMsRdpClient()
+ {
+ if(m_IMsRdpClient)
+ return m_IMsRdpClient;
+
+ if(m_IMsRdpClient2)
+ m_IMsRdpClient = m_IMsRdpClient2;
+ else if(m_IMsRdpClient3)
+ m_IMsRdpClient = m_IMsRdpClient3;
+ else if(m_IMsRdpClient4)
+ m_IMsRdpClient = m_IMsRdpClient4;
+
+ if(m_IMsRdpClient)
+ {
+ m_IMsRdpClient->AddRef();
+ return m_IMsRdpClient;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClient);
+ return m_IMsRdpClient;
+ }
+
+ IMsRdpClient2 * getIMsRdpClient2()
+ {
+ if(m_IMsRdpClient2)
+ return m_IMsRdpClient2;
+
+ if(m_IMsRdpClient3)
+ m_IMsRdpClient2 = m_IMsRdpClient3;
+ else if(m_IMsRdpClient4)
+ m_IMsRdpClient2 = m_IMsRdpClient4;
+
+ if(m_IMsRdpClient2)
+ {
+ m_IMsRdpClient2->AddRef();
+ return m_IMsRdpClient2;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClient2);
+ return m_IMsRdpClient2;
+ }
+
+ IMsRdpClient3 * getIMsRdpClient3()
+ {
+ if(m_IMsRdpClient3)
+ return m_IMsRdpClient3;
+
+ if(m_IMsRdpClient4)
+ m_IMsRdpClient3 = m_IMsRdpClient4;
+
+ if(m_IMsRdpClient3)
+ {
+ m_IMsRdpClient3->AddRef();
+ return m_IMsRdpClient3;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClient3);
+ return m_IMsRdpClient3;
+ }
+
+ IMsRdpClient4 * getIMsRdpClient4()
+ {
+ if(m_IMsRdpClient4)
+ return m_IMsRdpClient4;
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClient4);
+ return m_IMsRdpClient4;
+ }
+
+ IMsTscAx * getIMsTscAx()
+ {
+ if(m_IMsTscAx)
+ return m_IMsTscAx;
+
+ if(m_IMsRdpClient)
+ m_IMsTscAx = m_IMsRdpClient;
+ else if(m_IMsRdpClient2)
+ m_IMsTscAx = m_IMsRdpClient2;
+ else if(m_IMsRdpClient3)
+ m_IMsTscAx = m_IMsRdpClient3;
+ else if(m_IMsRdpClient4)
+ m_IMsTscAx = m_IMsRdpClient4;
+
+ if(m_IMsTscAx)
+ {
+ m_IMsTscAx->AddRef();
+ return m_IMsTscAx;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsTscAx);
+ return m_IMsTscAx;
+ }
+
+ IMsTscNonScriptable * getIMsTscNonScriptable()
+ {
+ if(m_IMsTscNonScriptable)
+ return m_IMsTscNonScriptable;
+
+ if(m_IMsRdpClientNonScriptable)
+ m_IMsTscNonScriptable = m_IMsRdpClientNonScriptable;
+ else if(m_IMsRdpClientNonScriptable2)
+ m_IMsTscNonScriptable = m_IMsRdpClientNonScriptable2;
+
+ if(m_IMsTscNonScriptable)
+ {
+ m_IMsTscNonScriptable->AddRef();
+ return m_IMsTscNonScriptable;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsTscNonScriptable);
+ return m_IMsTscNonScriptable;
+ }
+
+ IMsRdpClientNonScriptable * getIMsRdpClientNonScriptable()
+ {
+ if(m_IMsRdpClientNonScriptable)
+ return m_IMsRdpClientNonScriptable;
+
+ if(m_IMsRdpClientNonScriptable2)
+ m_IMsRdpClientNonScriptable = m_IMsRdpClientNonScriptable2;
+
+ if(m_IMsRdpClientNonScriptable)
+ {
+ m_IMsRdpClientNonScriptable->AddRef();
+ return m_IMsRdpClientNonScriptable;
+ }
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClientNonScriptable);
+ return m_IMsRdpClientNonScriptable;
+ }
+
+ IMsRdpClientNonScriptable2 * getIMsRdpClientNonScriptable2()
+ {
+ if(m_IMsRdpClientNonScriptable2)
+ return m_IMsRdpClientNonScriptable2;
+
+ m_IUnknown->QueryInterface(&m_IMsRdpClientNonScriptable2);
+ return m_IMsRdpClientNonScriptable2;
+ }
+
+ private:
+ IUnknown * m_outer;
+
+ HRESULT queryInterface(REFIID riid, void ** ppvObject)
+ {
+ HRESULT hr;
+ IUnknown * pvObject = NULL;
+
+ dbgprintf(TEXT("IUnknown::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject);
+
+#define QIBEGIN() \
+ if(riid == IID_IUnknown) \
+ { \
+ assert(0); \
+ }
+
+#define QI(I) \
+ else if(riid == IID_ ## I) \
+ { \
+ if(m_ ## I) \
+ { \
+ m_ ## I->AddRef(); \
+ hr = S_OK; \
+ } \
+ else \
+ { \
+ hr = m_IUnknown->QueryInterface(&m_ ## I); \
+ } \
+ \
+ if(SUCCEEDED(hr)) \
+ pvObject = static_cast<I *>(this); \
+ }
+
+#define QIEND() \
+ else \
+ { \
+ hr = E_NOINTERFACE; \
+ pvObject = NULL; \
+ }
+
+ QIBEGIN()
+
+ /* Standard interfaces */
+ QI(IDispatch)
+ QI(IConnectionPointContainer)
+ QI(IDataObject)
+ QI(IObjectSafety)
+ QI(IOleControl)
+ QI(IOleInPlaceActiveObject)
+ QI(IOleInPlaceObject)
+ QI(IOleObject)
+ QI(IOleWindow)
+ QI(IPersist)
+ QI(IPersistPropertyBag)
+ QI(IPersistStorage)
+ QI(IPersistStreamInit)
+ QI(IProvideClassInfo)
+ QI(IProvideClassInfo2)
+ QI(IQuickActivate)
+ QI(ISpecifyPropertyPages)
+ QI(IViewObject)
+ QI(IViewObject2)
+
+ /* Terminal services client */
+ QI(IMsRdpClient)
+ QI(IMsRdpClient2)
+ QI(IMsRdpClient3)
+ QI(IMsRdpClient4)
+ QI(IMsTscAx)
+ QI(IMsTscNonScriptable)
+ QI(IMsRdpClientNonScriptable)
+ QI(IMsRdpClientNonScriptable2)
+ QIEND()
+
+#undef QIBEGIN
+#undef QIEND
+#undef QI
+
+ if(SUCCEEDED(hr))
+ {
+ assert(pvObject);
+ pvObject->AddRef();
+ }
+ else
+ {
+ assert(pvObject == NULL);
+ }
+
+ *ppvObject = pvObject;
+
+ dbgprintf(TEXT("IUnknown::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject);
+ return hr;
+ }
+
+ ULONG addRef()
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ ULONG release()
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ friend class CoClassInner;
+
+ class CoClassInner: public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ if(riid == IID_IUnknown)
+ {
+ AddRef();
+ *ppvObject = this;
+ return S_OK;
+ }
+
+ return InnerToOuter(this)->queryInterface(riid, ppvObject);
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef()
+ {
+ return InnerToOuter(this)->addRef();
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release()
+ {
+ return InnerToOuter(this)->release();
+ }
+ }
+ m_inner;
+
+ static CoClass * InnerToOuter(CoClassInner * inner)
+ {
+ return CONTAINING_RECORD(inner, CoClass, m_inner);
+ }
+
+ private:
+ CoClass(IUnknown * pUnknw, IUnknown * pUnkOuter):
+ m_refCount(1),
+ m_outer(pUnkOuter),
+ m_IUnknown(pUnknw),
+ m_IDispatch(NULL),
+ m_IConnectionPointContainer(NULL),
+ m_IDataObject(NULL),
+ m_IObjectSafety(NULL),
+ m_IOleControl(NULL),
+ m_IOleInPlaceActiveObject(NULL),
+ m_IOleInPlaceObject(NULL),
+ m_IOleObject(NULL),
+ m_IOleWindow(NULL),
+ m_IPersist(NULL),
+ m_IPersistPropertyBag(NULL),
+ m_IPersistStorage(NULL),
+ m_IPersistStreamInit(NULL),
+ m_IProvideClassInfo(NULL),
+ m_IProvideClassInfo2(NULL),
+ m_IQuickActivate(NULL),
+ m_ISpecifyPropertyPages(NULL),
+ m_IViewObject(NULL),
+ m_IViewObject2(NULL),
+ m_IMsRdpClient(NULL),
+ m_IMsRdpClient2(NULL),
+ m_IMsRdpClient3(NULL),
+ m_IMsRdpClient4(NULL),
+ m_IMsTscAx(NULL),
+ m_IMsTscNonScriptable(NULL),
+ m_IMsRdpClientNonScriptable(NULL),
+ m_IMsRdpClientNonScriptable2(NULL)
+ {
+ if(m_outer == NULL)
+ m_outer = &m_inner;
+ }
+
+ public:
+ static HRESULT CreateInstance(IUnknown * pUnknw, IUnknown * pUnkOuter, REFIID riid, void ** ppvObject)
+ {
+ HRESULT hr = S_OK;
+
+ if(pUnkOuter && riid != IID_IUnknown)
+ hr = CLASS_E_NOAGGREGATION;
+ else
+ {
+ CoClass * p = new CoClass(pUnknw, pUnkOuter);
+
+ if(p == NULL)
+ hr = E_OUTOFMEMORY;
+ else
+ {
+ hr = p->m_inner.QueryInterface(riid, ppvObject);
+
+ if(FAILED(hr))
+ delete p;
+ else
+ p->m_inner.Release();
+ }
+ }
+
+ if(FAILED(hr))
+ pUnknw->Release();
+
+ return hr;
+ }
+
+ private:
+ ~CoClass()
+ {
+ if(m_IUnknown)
+ m_IUnknown->Release();
+
+ if(m_IDispatch)
+ m_IDispatch->Release();
+
+ if(m_IConnectionPointContainer)
+ m_IConnectionPointContainer->Release();
+
+ if(m_IDataObject)
+ m_IDataObject->Release();
+
+ if(m_IObjectSafety)
+ m_IObjectSafety->Release();
+
+ if(m_IOleControl)
+ m_IOleControl->Release();
+
+ if(m_IOleInPlaceActiveObject)
+ m_IOleInPlaceActiveObject->Release();
+
+ if(m_IOleInPlaceObject)
+ m_IOleInPlaceObject->Release();
+
+ if(m_IOleObject)
+ m_IOleObject->Release();
+
+ if(m_IOleWindow)
+ m_IOleWindow->Release();
+
+ if(m_IPersist)
+ m_IPersist->Release();
+
+ if(m_IPersistPropertyBag)
+ m_IPersistPropertyBag->Release();
+
+ if(m_IPersistStorage)
+ m_IPersistStorage->Release();
+
+ if(m_IPersistStreamInit)
+ m_IPersistStreamInit->Release();
+
+ if(m_IProvideClassInfo)
+ m_IProvideClassInfo->Release();
+
+ if(m_IProvideClassInfo2)
+ m_IProvideClassInfo2->Release();
+
+ if(m_IQuickActivate)
+ m_IQuickActivate->Release();
+
+ if(m_ISpecifyPropertyPages)
+ m_ISpecifyPropertyPages->Release();
+
+ if(m_IViewObject)
+ m_IViewObject->Release();
+
+ if(m_IViewObject2)
+ m_IViewObject2->Release();
+
+ if(m_IMsRdpClient)
+ m_IMsRdpClient->Release();
+
+ if(m_IMsRdpClient2)
+ m_IMsRdpClient2->Release();
+
+ if(m_IMsRdpClient3)
+ m_IMsRdpClient3->Release();
+
+ if(m_IMsRdpClient4)
+ m_IMsRdpClient4->Release();
+
+ if(m_IMsTscAx)
+ m_IMsTscAx->Release();
+
+ if(m_IMsTscNonScriptable)
+ m_IMsTscNonScriptable->Release();
+
+ if(m_IMsRdpClientNonScriptable)
+ m_IMsRdpClientNonScriptable->Release();
+
+ if(m_IMsRdpClientNonScriptable2)
+ m_IMsRdpClientNonScriptable2->Release();
+ }
+
+ /* IUnknown */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ return m_outer->QueryInterface(riid, ppvObject);
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef(void)
+ {
+ return m_outer->AddRef();
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release(void)
+ {
+ return m_outer->Release();
+ }
+
+ /* IDispatch */
+ private:
+ static void FreeExcepInfo(const EXCEPINFO& excepInfo)
+ {
+ if(excepInfo.bstrSource)
+ SysFreeString(excepInfo.bstrSource);
+
+ if(excepInfo.bstrDescription)
+ SysFreeString(excepInfo.bstrDescription);
+
+ if(excepInfo.bstrHelpFile)
+ SysFreeString(excepInfo.bstrHelpFile);
+ }
+
+ static std::basic_string<TCHAR> ExcepInfoToString(const EXCEPINFO& excepInfo)
+ {
+ std::basic_ostringstream<TCHAR> o;
+
+ o << "{";
+ o << " code: " << excepInfo.wCode << " from: " << std::basic_string<OLECHAR>(excepInfo.bstrSource, excepInfo.bstrSource + SysStringLen(excepInfo.bstrSource));
+
+ BSTR bstrDescription = NULL;
+
+ if(excepInfo.bstrDescription)
+ bstrDescription = excepInfo.bstrDescription;
+ else if(excepInfo.pfnDeferredFillIn)
+ {
+ EXCEPINFO excepInfoCopy = excepInfo;
+
+ if(SUCCEEDED(excepInfoCopy.pfnDeferredFillIn(&excepInfoCopy)) && excepInfoCopy.bstrDescription)
+ {
+ bstrDescription = excepInfoCopy.bstrDescription;
+ excepInfoCopy.bstrDescription = NULL;
+ }
+
+ if(excepInfoCopy.bstrSource == excepInfo.bstrSource)
+ excepInfoCopy.bstrSource = NULL;
+
+ if(excepInfoCopy.bstrHelpFile == excepInfo.bstrDescription)
+ excepInfoCopy.bstrDescription = NULL;
+
+ FreeExcepInfo(excepInfoCopy);
+ }
+
+ if(bstrDescription)
+ {
+ o << " msg: " << std::basic_string<OLECHAR>(bstrDescription, bstrDescription + SysStringLen(bstrDescription));
+
+ if(excepInfo.bstrDescription == NULL)
+ SysFreeString(bstrDescription);
+ }
+
+ o << " }";
+
+ return o.str().c_str();
+ }
+
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT * pctinfo)
+ {
+ IDispatch * pIDispatch = getIDispatch();
+ dbgprintf(TEXT("IDispatch::GetTypeInfoCount(%p)"), pctinfo);
+ HRESULT hr = pIDispatch->GetTypeInfoCount(pctinfo);
+ dbgprintf(TEXT("IDispatch::GetTypeInfoCount -> %08X, ctinfo = %lu"), hr, *pctinfo);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo)
+ {
+ IDispatch * pIDispatch = getIDispatch();
+ dbgprintf(TEXT("IDispatch::GetTypeInfo(%lu, %08X, %p)"), iTInfo, lcid, ppTInfo);
+ HRESULT hr = pIDispatch->GetTypeInfo(iTInfo, lcid, ppTInfo);
+ dbgprintf(TEXT("IDispatch::GetTypeInfo -> %08X, pTInfo = %p"), hr, *ppTInfo);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId)
+ {
+ IDispatch * pIDispatch = getIDispatch();
+ std::wstring strtemp;
+
+ std::wostringstream strtempo;
+
+ strtemp.resize(0);
+ strtemp += L"[ ";
+
+ for(UINT i = 0; i < cNames; ++ i)
+ {
+ if(i)
+ strtemp += L", ";
+
+ strtemp += rgszNames[i];
+ }
+
+ strtemp += L" ]";
+
+ dbgprintf(TEXT("IDispatch::GetIDsOfNames(%ls, %ls, %lu, %08X, %p)"), UUIDToString(riid).c_str(), strtemp.c_str(), cNames, lcid, rgDispId);
+ HRESULT hr = pIDispatch->GetIDsOfNames(riid, rgszNames, cNames, lcid, rgDispId);
+
+ strtemp.resize(0);
+ strtempo.str(strtemp);
+
+ strtempo << L"[ ";
+
+ for(UINT i = 0; i < cNames; ++ i)
+ {
+ if(i)
+ strtempo << L", ";
+
+ strtempo << rgDispId[i];
+ }
+
+ strtempo << L" ]";
+
+ dbgprintf(TEXT("IDispatch::GetIDsOfNames -> %08X, rgDispId = %ls"), hr, strtempo.str().c_str());
+
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr)
+ {
+ IDispatch * pIDispatch = getIDispatch();
+
+ std::basic_ostringstream<TCHAR> strtempo;
+
+ strtempo << L"{";
+
+ for(unsigned int i = pDispParams->cArgs, j = pDispParams->cNamedArgs; j < pDispParams->cArgs; -- i, ++ j)
+ {
+ strtempo << L" ";
+ strtempo << VariantToString(pDispParams->rgvarg[i - 1]);
+ strtempo << L",";
+ }
+
+ for(unsigned int i = pDispParams->cArgs - pDispParams->cNamedArgs; i > 0; -- i)
+ {
+ strtempo << L" ";
+ strtempo << L"["; strtempo << pDispParams->rgdispidNamedArgs[i - 1]; strtempo << L"] => ";
+ strtempo << VariantToString(pDispParams->rgvarg[i - 1]);
+ strtempo << L",";
+ }
+
+ strtempo << L" }";
+
+ dbgprintf(TEXT("IDispatch::Invoke(%ld, %ls, %08X, %04X, %s, %p, %p, %p)"), dispIdMember, UUIDToString(riid).c_str(), lcid, wFlags, strtempo.str().c_str(), pVarResult, pExcepInfo, puArgErr);
+
+ VARIANT VarResult = { };
+ EXCEPINFO ExcepInfo = { };
+
+ if(pVarResult == NULL)
+ pVarResult = &VarResult;
+
+ if(pExcepInfo == NULL)
+ pExcepInfo = &ExcepInfo;
+
+ HRESULT hr = pIDispatch->Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+
+ dbgprintf(TEXT("IDispatch::Invoke -> %08X, returns %s, throws %s"), hr, VariantToString(*pVarResult).c_str(), ExcepInfoToString(*pExcepInfo).c_str());
+
+ FreeExcepInfo(ExcepInfo);
+
+ return hr;
+ }
+
+ /* IConnectionPointContainer */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE EnumConnectionPoints(IEnumConnectionPoints ** ppEnum)
+ {
+ IConnectionPointContainer * pIConnectionPointContainer = getIConnectionPointContainer();
+ dbgprintf(TEXT("IConnectionPointContainer::EnumConnectionPoints(%p)"), ppEnum);
+ HRESULT hr = pIConnectionPointContainer->EnumConnectionPoints(ppEnum);
+ dbgprintf(TEXT("IConnectionPointContainer::EnumConnectionPoints -> %08X, pEnum = %p"), hr, *ppEnum);
+
+ if(SUCCEEDED(hr))
+ *ppEnum = HookIEnumConnectionPoints(*ppEnum);
+
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE FindConnectionPoint(REFIID riid, IConnectionPoint ** ppCP)
+ {
+ IConnectionPointContainer * pIConnectionPointContainer = getIConnectionPointContainer();
+ dbgprintf(TEXT("IConnectionPointContainer::FindConnectionPoint(%ls, %p)"), UUIDToString(riid).c_str(), ppCP);
+ HRESULT hr = pIConnectionPointContainer->FindConnectionPoint(riid, ppCP);
+ dbgprintf(TEXT("IConnectionPointContainer::FindConnectionPoint -> %08X, pCP = %p"), hr, *ppCP);
+
+ if(SUCCEEDED(hr))
+ *ppCP = HookIConnectionPoint(*ppCP);
+
+ return hr;
+ }
+
+ /* IDataObject */
+ private:
+ static std::basic_string<TCHAR> TargetDeviceToString(const DVTARGETDEVICE& targetdev)
+ {
+ if(&targetdev == NULL)
+ return TEXT("<null>");
+
+ std::basic_ostringstream<TCHAR> o;
+
+ o << "{";
+ o << LPCWSTR(targetdev.tdData[targetdev.tdDriverNameOffset]);
+
+ if(targetdev.tdDeviceNameOffset)
+ {
+ o << ",";
+ o << LPCWSTR(targetdev.tdData[targetdev.tdDeviceNameOffset]);
+ }
+
+ if(targetdev.tdPortNameOffset)
+ {
+ o << ",";
+ o << LPCWSTR(targetdev.tdData[targetdev.tdPortNameOffset]);
+ }
+
+ o << " }";
+
+ return o.str();
+ }
+
+ static LPCTSTR AspectToString(DWORD aspect)
+ {
+ switch(aspect)
+ {
+ case DVASPECT_CONTENT: return TEXT("content");
+ case DVASPECT_THUMBNAIL: return TEXT("thumbnail");
+ case DVASPECT_ICON: return TEXT("icon");
+ case DVASPECT_DOCPRINT: return TEXT("printable");
+ default: return TEXT("<unknown>");
+ }
+ }
+
+ static LPCTSTR TymedToString(DWORD tymed)
+ {
+ switch(tymed)
+ {
+ case TYMED_HGLOBAL: return TEXT("memory");
+ case TYMED_FILE: return TEXT("file");
+ case TYMED_ISTREAM: return TEXT("IStream");
+ case TYMED_ISTORAGE: return TEXT("IStorage");
+ case TYMED_GDI: return TEXT("bitmap");
+ case TYMED_MFPICT: return TEXT("metafile");
+ case TYMED_ENHMF: return TEXT("enhanced metafile");
+ case TYMED_NULL: return TEXT("<no data>");
+ default: return TEXT("<unknown>");
+ }
+ }
+
+ static std::basic_string<TCHAR> FormatEtcToString(const FORMATETC& formatetc)
+ {
+ std::basic_ostringstream<TCHAR> o;
+
+ o << "{";
+
+ // cfFormat
+ o << " format: ";
+
+ switch(formatetc.cfFormat)
+ {
+ case CF_TEXT: o << "ANSI text"; break;
+ case CF_BITMAP: o << "bitmap"; break;
+ case CF_METAFILEPICT: o << "metafile"; break;
+ case CF_SYLK: o << "symlink"; break;
+ case CF_DIF: o << "DIF"; break;
+ case CF_TIFF: o << "TIFF"; break;
+ case CF_OEMTEXT: o << "OEM text"; break;
+ case CF_DIB: o << "DIBv4"; break;
+ case CF_PALETTE: o << "palette"; break;
+ case CF_PENDATA: o << "pen data"; break;
+ case CF_RIFF: o << "RIFF"; break;
+ case CF_WAVE: o << "WAV"; break;
+ case CF_UNICODETEXT: o << "Unicode text"; break;
+ case CF_ENHMETAFILE: o << "enhanced metafile"; break;
+ case CF_HDROP: o << "list of files"; break;
+ case CF_LOCALE: o << "LCID"; break;
+ case CF_DIBV5: o << "DIBv5"; break;
+ case CF_OWNERDISPLAY: o << "<owner displayed>"; break;
+ case CF_DSPTEXT: o << "<display text>"; break;
+ case CF_DSPBITMAP: o << "<display bitmap>"; break;
+ case CF_DSPMETAFILEPICT: o << "<display metafile>"; break;
+ case CF_DSPENHMETAFILE: o << "<display enhanced metafile>"; break;
+
+ default:
+ o << "<";
+
+ if(formatetc.cfFormat >= CF_PRIVATEFIRST && formatetc.cfFormat <= CF_PRIVATELAST)
+ o << "private";
+ else if(formatetc.cfFormat >= CF_GDIOBJFIRST && formatetc.cfFormat <= CF_GDIOBJLAST)
+ o << "GDI object";
+ else
+ o << "unknown";
+
+ o << " " << std::hex << formatetc.cfFormat << std::dec << ">";
+ }
+
+ // ptd
+ if(formatetc.ptd)
+ o << " device: " << TargetDeviceToString(*formatetc.ptd);
+
+ // dwAspect
+ o << " aspect: " << AspectToString(formatetc.dwAspect);
+
+ // lindex
+ if(formatetc.dwAspect == DVASPECT_CONTENT || formatetc.dwAspect == DVASPECT_DOCPRINT)
+ o << " page split: " << formatetc.lindex;
+
+ // tymed
+ o << " medium: " << TymedToString(formatetc.tymed);
+
+ return o.str();
+ }
+
+ static std::basic_string<TCHAR> MediumToString(const STGMEDIUM& medium)
+ {
+ std::basic_ostringstream<TCHAR> o;
+
+ o << "{ ";
+ o << TymedToString(medium.tymed);
+ o << " }";
+
+ return o.str();
+ }
+
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetData(FORMATETC * pformatetcIn, STGMEDIUM * pmedium)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::GetData(%s, %p)"), FormatEtcToString(*pformatetcIn).c_str(), pmedium);
+ HRESULT hr = pIDataObject->GetData(pformatetcIn, pmedium);
+ dbgprintf(TEXT("IDataObject::GetData -> %08X, %s"), hr, MediumToString(*pmedium).c_str());
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetDataHere(FORMATETC * pformatetc, STGMEDIUM * pmedium)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::GetDataHere(%s, %p)"), FormatEtcToString(*pformatetc).c_str(), pmedium);
+ HRESULT hr = pIDataObject->GetDataHere(pformatetc, pmedium);
+ dbgprintf(TEXT("IDataObject::GetDataHere -> %08X, medium = %s"), hr, MediumToString(*pmedium).c_str());
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE QueryGetData(FORMATETC * pformatetc)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::QueryGetData(%s)"), FormatEtcToString(*pformatetc).c_str());
+ HRESULT hr = pIDataObject->QueryGetData(pformatetc);
+ dbgprintf(TEXT("IDataObject::QueryGetData -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc(FORMATETC * pformatectIn, FORMATETC * pformatetcOut)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::GetCanonicalFormatEtc(%s, %p)"), FormatEtcToString(*pformatectIn).c_str(), pformatetcOut);
+ HRESULT hr = pIDataObject->GetCanonicalFormatEtc(pformatectIn, pformatetcOut);
+ dbgprintf(TEXT("IDataObject::GetCanonicalFormatEtc -> %08X, formatetcOut = %s"), hr, FormatEtcToString(*pformatetcOut).c_str());
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SetData(FORMATETC * pformatetc, STGMEDIUM * pmedium, BOOL fRelease)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::SetData(%s, %p, %s)"), FormatEtcToString(*pformatetc).c_str(), MediumToString(*pmedium).c_str(), fRelease ? TEXT("true") : TEXT("false"));
+ HRESULT hr = pIDataObject->SetData(pformatetc, pmedium, fRelease);
+ dbgprintf(TEXT("IDataObject::SetData -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC ** ppenumFormatEtc)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::EnumFormatEtc(%lu, %p)"), dwDirection, ppenumFormatEtc);
+ HRESULT hr = pIDataObject->EnumFormatEtc(dwDirection, ppenumFormatEtc);
+ dbgprintf(TEXT("IDataObject::EnumFormatEtc -> %08X, penumFormatEtc = %p"), hr, *ppenumFormatEtc);
+ // TODO: hook
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE DAdvise(FORMATETC * pformatetc, DWORD advf, IAdviseSink * pAdvSink, DWORD * pdwConnection)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::DAdvise(%s, %lu, %p, %p)"), FormatEtcToString(*pformatetc).c_str(), advf, pAdvSink, pdwConnection);
+ HRESULT hr = pIDataObject->DAdvise(pformatetc, advf, pAdvSink, pdwConnection);
+ dbgprintf(TEXT("IDataObject::DAdvise -> %08X, dwConnection = %lu"), hr, *pdwConnection);
+ // TODO: hook
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE DUnadvise(DWORD dwConnection)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::DUnadvise(%lu)"), dwConnection);
+ HRESULT hr = pIDataObject->DUnadvise(dwConnection);
+ dbgprintf(TEXT("IDataObject::DUnadvise -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE EnumDAdvise(IEnumSTATDATA ** ppenumAdvise)
+ {
+ IDataObject * pIDataObject = getIDataObject();
+ dbgprintf(TEXT("IDataObject::EnumDAdvise(%p)"), ppenumAdvise);
+ HRESULT hr = pIDataObject->EnumDAdvise(ppenumAdvise);
+ dbgprintf(TEXT("IDataObject::EnumDAdvise -> %08X, penumAdvise = %p"), hr, *ppenumAdvise);
+ // TODO: hook
+ return hr;
+ }
+
+ /* IObjectSafety */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IObjectSafety::GetInterfaceSafetyOptions(REFIID riid, DWORD * pdwSupportedOptions, DWORD * pdwEnabledOptions)
+ {
+ IObjectSafety * pIObjectSafety = getIObjectSafety();
+ dbgprintf(TEXT("IObjectSafety::GetInterfaceSafetyOptions(%ls, %p, %p)"), UUIDToString(riid).c_str(), pdwSupportedOptions, pdwEnabledOptions);
+ HRESULT hr = pIObjectSafety->GetInterfaceSafetyOptions(riid, pdwSupportedOptions, pdwEnabledOptions);
+ dbgprintf(TEXT("IObjectSafety::GetInterfaceSafetyOptions -> %08X, dwSupportedOptions = %08X, dwEnabledOptions = %08X"), hr, *pdwSupportedOptions, *pdwEnabledOptions);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IObjectSafety::SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
+ {
+ IObjectSafety * pIObjectSafety = getIObjectSafety();
+ dbgprintf(TEXT("IObjectSafety::SetInterfaceSafetyOptions(%ls, %08X, %08X)"), UUIDToString(riid).c_str(), dwOptionSetMask, dwEnabledOptions);
+ HRESULT hr = pIObjectSafety->SetInterfaceSafetyOptions(riid, dwOptionSetMask, dwEnabledOptions);
+ dbgprintf(TEXT("IObjectSafety::SetInterfaceSafetyOptions -> %08X"), hr);
+ return hr;
+ }
+
+ /* IOleControl */
+ private:
+ std::basic_string<TCHAR> ControlInfoToString(const CONTROLINFO& ci)
+ {
+ std::basic_ostringstream<TCHAR> o;
+
+ int firstdone = 0;
+
+ o << "{ ";
+
+ if(ci.cAccel && ci.hAccel)
+ {
+ LPACCEL pAccel = static_cast<LPACCEL>(GlobalLock(ci.hAccel));
+
+ if(pAccel)
+ {
+ for(USHORT i = 0; i < ci.cAccel; ++ i)
+ {
+ if(i)
+ o << ", ";
+
+ if(pAccel[i].fVirt & FSHIFT)
+ o << "SHIFT + ";
+
+ if(pAccel[i].fVirt & FCONTROL)
+ o << "CONTROL + ";
+
+ if(pAccel[i].fVirt & FALT)
+ o << "ALT + ";
+
+ if(pAccel[i].fVirt & FVIRTKEY)
+ o << "<vkey:" << std::hex << pAccel[i].key << std::dec << ">";
+ else
+ o << wchar_t(pAccel[i].key);
+
+ o << " " << std::hex << pAccel[i].cmd << std::dec;
+ }
+
+ firstdone = ci.cAccel;
+
+ GlobalUnlock(pAccel);
+ }
+ }
+
+ if(ci.dwFlags & CTRLINFO_EATS_RETURN)
+ {
+ if(!firstdone)
+ {
+ o << ", ";
+ ++ firstdone;
+ }
+
+ o << "ENTER";
+ }
+
+ if(ci.dwFlags & CTRLINFO_EATS_ESCAPE)
+ {
+ if(!firstdone)
+ {
+ o << ", ";
+ ++ firstdone;
+ }
+
+ o << "ESC";
+ }
+
+ if(firstdone)
+ o << " ";
+
+ o << "}";
+
+ return o.str();
+ }
+
+ std::basic_string<TCHAR> MnemonicToString(const MSG& msg)
+ {
+ std::basic_ostringstream<TCHAR> o;
+
+ o << "[";
+
+ switch(msg.message)
+ {
+ case WM_SYSKEYDOWN:
+ o << "ALT + ";
+
+ case WM_KEYDOWN:
+ TCHAR sz[1024];
+ GetKeyNameText(LONG(msg.lParam), sz, ARRAYSIZE(sz));
+ o << sz;
+
+ default:
+ o << "<unknown message " << std::hex << msg.message << std::dec << ">";
+ }
+
+ o << "]";
+
+ return o.str();
+ }
+
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetControlInfo(CONTROLINFO * pCI)
+ {
+ IOleControl * pIOleControl = getIOleControl();
+ dbgprintf(TEXT("IOleControl::GetControlInfo(%p)"), pCI);
+ HRESULT hr = pIOleControl->GetControlInfo(pCI);
+ dbgprintf(TEXT("IOleControl::GetControlInfo -> %08X, %s"), hr, ControlInfoToString(*pCI).c_str());
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE OnMnemonic(MSG * pMsg)
+ {
+ IOleControl * pIOleControl = getIOleControl();
+ dbgprintf(TEXT("IOleControl::OnMnemonic(%s)"), MnemonicToString(*pMsg).c_str());
+ HRESULT hr = pIOleControl->OnMnemonic(pMsg);
+ dbgprintf(TEXT("IOleControl::OnMnemonic -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE OnAmbientPropertyChange(DISPID dispID)
+ {
+ IOleControl * pIOleControl = getIOleControl();
+ dbgprintf(TEXT("IOleControl::OnAmbientPropertyChange(%08X)"), dispID);
+ HRESULT hr = pIOleControl->OnAmbientPropertyChange(dispID);
+ dbgprintf(TEXT("IOleControl::OnAmbientPropertyChange -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE FreezeEvents(BOOL bFreeze)
+ {
+ IOleControl * pIOleControl = getIOleControl();
+ dbgprintf(TEXT("IOleControl::FreezeEvents(%s)"), BooleanToString(bFreeze));
+ HRESULT hr = pIOleControl->FreezeEvents(bFreeze);
+ dbgprintf(TEXT("IOleControl::FreezeEvents -> %08X"), hr);
+ return hr;
+ }
+
+ /* IOleInPlaceActiveObject */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(LPMSG lpmsg)
+ {
+ IOleInPlaceActiveObject * pIOleInPlaceActiveObject = getIOleInPlaceActiveObject();
+ dbgprintf(TEXT("IOleInPlaceActiveObject::TranslateAccelerator(%s)"), MnemonicToString(*lpmsg).c_str());
+ HRESULT hr = pIOleInPlaceActiveObject->TranslateAccelerator(lpmsg);
+ dbgprintf(TEXT("IOleInPlaceActiveObject::TranslateAccelerator -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE OnFrameWindowActivate(BOOL fActivate)
+ {
+ IOleInPlaceActiveObject * pIOleInPlaceActiveObject = getIOleInPlaceActiveObject();
+ dbgprintf(TEXT("IOleInPlaceActiveObject::OnFrameWindowActivate(%s)"), BooleanToString(fActivate));
+ HRESULT hr = pIOleInPlaceActiveObject->OnFrameWindowActivate(fActivate);
+ dbgprintf(TEXT("IOleInPlaceActiveObject::OnFrameWindowActivate -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE OnDocWindowActivate(BOOL fActivate)
+ {
+ IOleInPlaceActiveObject * pIOleInPlaceActiveObject = getIOleInPlaceActiveObject();
+ dbgprintf(TEXT("IOleInPlaceActiveObject::OnDocWindowActivate(%s)"), BooleanToString(fActivate));
+ HRESULT hr = pIOleInPlaceActiveObject->OnDocWindowActivate(fActivate);
+ dbgprintf(TEXT("IOleInPlaceActiveObject::OnDocWindowActivate -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow * pUIWindow, BOOL fFrameWindow)
+ {
+ // TODO: hook pUIWindow
+ IOleInPlaceActiveObject * pIOleInPlaceActiveObject = getIOleInPlaceActiveObject();
+ dbgprintf(TEXT("IOleInPlaceActiveObject::ResizeBorder(%s)"), RectToString(*prcBorder).c_str(), pUIWindow, BooleanToString(fFrameWindow));
+ HRESULT hr = pIOleInPlaceActiveObject->ResizeBorder(prcBorder, pUIWindow, fFrameWindow);
+ dbgprintf(TEXT("IOleInPlaceActiveObject::ResizeBorder -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE EnableModeless(BOOL fEnable)
+ {
+ IOleInPlaceActiveObject * pIOleInPlaceActiveObject = getIOleInPlaceActiveObject();
+ dbgprintf(TEXT("IOleInPlaceActiveObject::EnableModeless(%s)"), BooleanToString(fEnable));
+ HRESULT hr = pIOleInPlaceActiveObject->EnableModeless(fEnable);
+ dbgprintf(TEXT("IOleInPlaceActiveObject::EnableModeless -> %08X"), hr);
+ return hr;
+ }
+
+ /* IOleInPlaceObject */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE InPlaceDeactivate(void)
+ {
+ IOleInPlaceObject * pIOleInPlaceObject = getIOleInPlaceObject();
+ dbgprintf(TEXT("IOleInPlaceObject::InPlaceDeactivate()"));
+ HRESULT hr = pIOleInPlaceObject->InPlaceDeactivate();
+ dbgprintf(TEXT("IOleInPlaceObject::InPlaceDeactivate -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE UIDeactivate(void)
+ {
+ IOleInPlaceObject * pIOleInPlaceObject = getIOleInPlaceObject();
+ dbgprintf(TEXT("IOleInPlaceObject::UIDeactivate()"));
+ HRESULT hr = pIOleInPlaceObject->UIDeactivate();
+ dbgprintf(TEXT("IOleInPlaceObject::UIDeactivate -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect)
+ {
+ IOleInPlaceObject * pIOleInPlaceObject = getIOleInPlaceObject();
+ dbgprintf(TEXT("IOleInPlaceObject::SetObjectRects(%s, %s)"), RectToString(*lprcPosRect).c_str(), RectToString(*lprcClipRect).c_str());
+ HRESULT hr = pIOleInPlaceObject->SetObjectRects(lprcPosRect, lprcClipRect);
+ dbgprintf(TEXT("IOleInPlaceObject::SetObjectRects -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE ReactivateAndUndo(void)
+ {
+ IOleInPlaceObject * pIOleInPlaceObject = getIOleInPlaceObject();
+ dbgprintf(TEXT("IOleInPlaceObject::ReactivateAndUndo()"));
+ HRESULT hr = pIOleInPlaceObject->ReactivateAndUndo();
+ dbgprintf(TEXT("IOleInPlaceObject::ReactivateAndUndo -> %08X"), hr);
+ return hr;
+ }
+
+ /* IOleWindow */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND * phwnd)
+ {
+ IOleWindow * pIOleWindow = getIOleWindow();
+ dbgprintf(TEXT("IOleWindow::GetWindow(%p)"), phwnd);
+ HRESULT hr = pIOleWindow->GetWindow(phwnd);
+ dbgprintf(TEXT("IOleWindow::GetWindow -> %08X, hwnd = %X"), hr, *phwnd);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
+ {
+ IOleWindow * pIOleWindow = getIOleWindow();
+ dbgprintf(TEXT("IOleWindow::ContextSensitiveHelp(%s)"), BooleanToString(fEnterMode));
+ HRESULT hr = pIOleWindow->ContextSensitiveHelp(fEnterMode);
+ dbgprintf(TEXT("IOleWindow::ContextSensitiveHelp -> %08X"), hr);
+ return hr;
+ }
+
+ /* IOleObject */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetClientSite(IOleClientSite * pClientSite)
+ {
+ // TODO: hook pClientSite
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::SetClientSite(%p)"), pClientSite);
+ HRESULT hr = pIOleObject->SetClientSite(pClientSite);
+ dbgprintf(TEXT("IOleObject::SetClientSite -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetClientSite(IOleClientSite ** ppClientSite)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::GetClientSite(%s)"), ppClientSite);
+ HRESULT hr = pIOleObject->GetClientSite(ppClientSite);
+ dbgprintf(TEXT("IOleObject::GetClientSite -> %08X"), hr, ppClientSite);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SetHostNames(LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::SetHostNames(%ls, %ls)"), szContainerApp, szContainerObj);
+ HRESULT hr = pIOleObject->SetHostNames(szContainerApp, szContainerObj);
+ dbgprintf(TEXT("IOleObject::SetHostNames -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Close(DWORD dwSaveOption)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::Close(%lu)"), dwSaveOption);
+ HRESULT hr = pIOleObject->Close(dwSaveOption);
+ dbgprintf(TEXT("IOleObject::Close -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SetMoniker(DWORD dwWhichMoniker, IMoniker * pmk)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::SetMoniker(%lu, %p)"), dwWhichMoniker, MonikerToString(pmk).c_str());
+ HRESULT hr = pIOleObject->SetMoniker(dwWhichMoniker, pmk);
+ dbgprintf(TEXT("IOleObject::SetMoniker -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker ** ppmk)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::GetMoniker(%lu, %lu, %p)"), dwAssign, dwWhichMoniker, ppmk);
+ HRESULT hr = pIOleObject->GetMoniker(dwAssign, dwWhichMoniker, ppmk);
+ dbgprintf(TEXT("IOleObject::GetMoniker -> %08X, pmk = %s"), hr, SUCCEEDED(hr) ? MonikerToString(*ppmk).c_str() : TEXT("<null>"));
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE InitFromData(IDataObject * pDataObject, BOOL fCreation, DWORD dwReserved)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::InitFromData(%p, %s, %lu)"), pDataObject, BooleanToString(fCreation), dwReserved);
+ HRESULT hr = pIOleObject->InitFromData(pDataObject, fCreation, dwReserved);
+ dbgprintf(TEXT("IOleObject::InitFromData -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetClipboardData(DWORD dwReserved, IDataObject ** ppDataObject)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::GetClipboardData(%lu, %p)"), dwReserved, ppDataObject);
+ HRESULT hr = pIOleObject->GetClipboardData(dwReserved, ppDataObject);
+ dbgprintf(TEXT("IOleObject::GetClipboardData -> %08X, pDataObject = %p"), hr, *ppDataObject);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE DoVerb(LONG iVerb, LPMSG lpmsg, IOleClientSite * pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::DoVerb(%ld, %p, %p, %ld, %p, %s)"), iVerb, lpmsg, pActiveSite, lindex, hwndParent, RectToString(*lprcPosRect).c_str());
+ HRESULT hr = pIOleObject->DoVerb(iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect);
+ dbgprintf(TEXT("IOleObject::DoVerb -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE EnumVerbs(IEnumOLEVERB ** ppEnumOleVerb)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::EnumVerbs(%p)"), ppEnumOleVerb);
+ HRESULT hr = pIOleObject->EnumVerbs(ppEnumOleVerb);
+ dbgprintf(TEXT("IOleObject::EnumVerbs -> %08X, pEnumOleVerb = %p"), hr, *ppEnumOleVerb);
+ // TODO: hook
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Update(void)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::Update(%s)"));
+ HRESULT hr = pIOleObject->Update();
+ dbgprintf(TEXT("IOleObject::Update -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IsUpToDate(void)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::IsUpToDate(%s)"));
+ HRESULT hr = pIOleObject->IsUpToDate();
+ dbgprintf(TEXT("IOleObject::IsUpToDate -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetUserClassID(CLSID * pClsid)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::GetUserClassID(%p)"), pClsid);
+ HRESULT hr = pIOleObject->GetUserClassID(pClsid);
+ dbgprintf(TEXT("IOleObject::GetUserClassID -> %08X, Clsid = %ls"), hr, UUIDToString(*pClsid).c_str());
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetUserType(DWORD dwFormOfType, LPOLESTR * pszUserType)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::GetUserType(%lu, %p)"), dwFormOfType, pszUserType);
+ HRESULT hr = pIOleObject->GetUserType(dwFormOfType, pszUserType);
+ dbgprintf(TEXT("IOleObject::GetUserType -> %08X, szUserType = %s"), hr, *pszUserType);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SetExtent(DWORD dwDrawAspect, SIZEL * psizel)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::SetExtent(%lu, %s)"), dwDrawAspect, SizeToString(*psizel).c_str());
+ HRESULT hr = pIOleObject->SetExtent(dwDrawAspect, psizel);
+ dbgprintf(TEXT("IOleObject::SetExtent -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetExtent(DWORD dwDrawAspect, SIZEL * psizel)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::GetExtent(%lu, %p)"), dwDrawAspect, psizel);
+ HRESULT hr = pIOleObject->GetExtent(dwDrawAspect, psizel);
+ dbgprintf(TEXT("IOleObject::GetExtent -> %08X"), hr, SizeToString(*psizel).c_str());
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Advise(IAdviseSink * pAdvSink, DWORD * pdwConnection)
+ {
+ // TODO: hook pAdvSink
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::Advise(%p, %p)"), pAdvSink, pdwConnection);
+ HRESULT hr = pIOleObject->Advise(pAdvSink, pdwConnection);
+ dbgprintf(TEXT("IOleObject::Advise -> %08X, dwConnection = %lu"), hr, *pdwConnection);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Unadvise(DWORD dwConnection)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::Unadvise(%lu)"), dwConnection);
+ HRESULT hr = pIOleObject->Unadvise(dwConnection);
+ dbgprintf(TEXT("IOleObject::Unadvise -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE EnumAdvise(IEnumSTATDATA ** ppenumAdvise)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::EnumAdvise(%p)"), ppenumAdvise);
+ HRESULT hr = pIOleObject->EnumAdvise(ppenumAdvise);
+ dbgprintf(TEXT("IOleObject::EnumAdvise -> %08X, penumAdvise = %p"), hr, *ppenumAdvise);
+ // TODO: hook
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetMiscStatus(DWORD dwAspect, DWORD * pdwStatus)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::GetMiscStatus(%lu, %p)"), dwAspect, pdwStatus);
+ HRESULT hr = pIOleObject->GetMiscStatus(dwAspect, pdwStatus);
+ dbgprintf(TEXT("IOleObject::GetMiscStatus -> %08X, dwStatus = %08X"), hr, *pdwStatus);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SetColorScheme(LOGPALETTE * pLogpal)
+ {
+ IOleObject * pIOleObject = getIOleObject();
+ dbgprintf(TEXT("IOleObject::SetColorScheme(%p)"), pLogpal);
+ HRESULT hr = pIOleObject->SetColorScheme(pLogpal);
+ dbgprintf(TEXT("IOleObject::SetColorScheme -> %08X"), hr);
+ return hr;
+ }
+
+ /* IPersist */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID * pClassID)
+ {
+ IPersist * pIPersist = getIPersist();
+ dbgprintf(TEXT("IPersist::GetClassID(%p)"), pClassID);
+ HRESULT hr = pIPersist->GetClassID(pClassID);
+ dbgprintf(TEXT("IPersist::GetClassID -> %08X, ClassId = %ls"), hr, UUIDToString(*pClassID).c_str());
+ return hr;
+ }
+
+ /* IPersistPropertyBag */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE InitNew(void)
+ {
+ IPersistPropertyBag * pIPersistPropertyBag = getIPersistPropertyBag();
+ dbgprintf(TEXT("IPersistPropertyBag::InitNew()"));
+ HRESULT hr = pIPersistPropertyBag->InitNew();
+ dbgprintf(TEXT("IPersistPropertyBag::InitNew -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Load(IPropertyBag * pPropBag, IErrorLog * pErrorLog)
+ {
+ // TODO: hook pPropBag, pErrorLog
+ IPersistPropertyBag * pIPersistPropertyBag = getIPersistPropertyBag();
+ dbgprintf(TEXT("IPersistPropertyBag::Load(%p, %p)"), pPropBag, pErrorLog);
+ HRESULT hr = pIPersistPropertyBag->Load(pPropBag, pErrorLog);
+ dbgprintf(TEXT("IPersistPropertyBag::Load -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Save(IPropertyBag * pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
+ {
+ // TODO: hook pPropBag
+ IPersistPropertyBag * pIPersistPropertyBag = getIPersistPropertyBag();
+ dbgprintf(TEXT("IPersistPropertyBag::Save(%p, %s, %s)"), pPropBag, BooleanToString(fClearDirty), BooleanToString(fSaveAllProperties));
+ HRESULT hr = pIPersistPropertyBag->Save(pPropBag, fClearDirty, fSaveAllProperties);
+ dbgprintf(TEXT("IPersistPropertyBag::Save -> %08X"), hr);
+ return hr;
+ }
+
+ /* IPersistStorage */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IPersistStorage::IsDirty(void)
+ {
+ IPersistStorage * pIPersistStorage = getIPersistStorage();
+ dbgprintf(TEXT("IPersistStorage::IsDirty()"));
+ HRESULT hr = pIPersistStorage->IsDirty();
+ dbgprintf(TEXT("IPersistStorage::IsDirty -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IPersistStorage::InitNew(IStorage * pStg)
+ {
+ IPersistStorage * pIPersistStorage = getIPersistStorage();
+ dbgprintf(TEXT("IPersistStorage::InitNew(%p)"), pStg);
+ HRESULT hr = pIPersistStorage->InitNew(pStg);
+ dbgprintf(TEXT("IPersistStorage::InitNew -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IPersistStorage::Load(IStorage * pStg)
+ {
+ IPersistStorage * pIPersistStorage = getIPersistStorage();
+ dbgprintf(TEXT("IPersistStorage::Load(%p)"), pStg);
+ HRESULT hr = pIPersistStorage->Load(pStg);
+ dbgprintf(TEXT("IPersistStorage::Load -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IPersistStorage::Save(IStorage * pStgSave, BOOL fSameAsLoad)
+ {
+ IPersistStorage * pIPersistStorage = getIPersistStorage();
+ dbgprintf(TEXT("IPersistStorage::Save(%p, %s)"), pStgSave, BooleanToString(fSameAsLoad));
+ HRESULT hr = pIPersistStorage->Save(pStgSave, fSameAsLoad);
+ dbgprintf(TEXT("IPersistStorage::Save -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE SaveCompleted(IStorage * pStgNew)
+ {
+ IPersistStorage * pIPersistStorage = getIPersistStorage();
+ dbgprintf(TEXT("IPersistStorage::SaveCompleted(%p)"), pStgNew);
+ HRESULT hr = pIPersistStorage->SaveCompleted(pStgNew);
+ dbgprintf(TEXT("IPersistStorage::SaveCompleted -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE HandsOffStorage(void)
+ {
+ IPersistStorage * pIPersistStorage = getIPersistStorage();
+ dbgprintf(TEXT("IPersistStorage::HandsOffStorage()"));
+ HRESULT hr = pIPersistStorage->HandsOffStorage();
+ dbgprintf(TEXT("IPersistStorage::HandsOffStorage -> %08X"), hr);
+ return hr;
+ }
+
+ /* IPersistStreamInit */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IPersistStreamInit::IsDirty(void)
+ {
+ IPersistStreamInit * pIPersistStreamInit = getIPersistStreamInit();
+ dbgprintf(TEXT("IPersistStreamInit::IsDirty()"));
+ HRESULT hr = pIPersistStreamInit->IsDirty();
+ dbgprintf(TEXT("IPersistStreamInit::IsDirty -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IPersistStreamInit::Load(LPSTREAM pStm)
+ {
+ IPersistStreamInit * pIPersistStreamInit = getIPersistStreamInit();
+ dbgprintf(TEXT("IPersistStreamInit::Load(%p)"), pStm);
+ HRESULT hr = pIPersistStreamInit->Load(pStm);
+ dbgprintf(TEXT("IPersistStreamInit::Load -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IPersistStreamInit::Save(LPSTREAM pStm, BOOL fClearDirty)
+ {
+ IPersistStreamInit * pIPersistStreamInit = getIPersistStreamInit();
+ dbgprintf(TEXT("IPersistStreamInit::Save(%p, %s)"), pStm, BooleanToString(fClearDirty));
+ HRESULT hr = pIPersistStreamInit->Save(pStm, fClearDirty);
+ dbgprintf(TEXT("IPersistStreamInit::Save -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IPersistStreamInit::GetSizeMax(ULARGE_INTEGER * pCbSize)
+ {
+ IPersistStreamInit * pIPersistStreamInit = getIPersistStreamInit();
+ dbgprintf(TEXT("IPersistStreamInit::GetSizeMax(%p)"), pCbSize);
+ HRESULT hr = pIPersistStreamInit->GetSizeMax(pCbSize);
+ dbgprintf(TEXT("IPersistStreamInit::GetSizeMax -> %08X, CbSize = %llu"), hr, pCbSize->QuadPart);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IPersistStreamInit::InitNew(void)
+ {
+ IPersistStreamInit * pIPersistStreamInit = getIPersistStreamInit();
+ dbgprintf(TEXT("IPersistStreamInit::InitNew()"));
+ HRESULT hr = pIPersistStreamInit->InitNew();
+ dbgprintf(TEXT("IPersistStreamInit::InitNew -> %08X"), hr);
+ return hr;
+ }
+
+ /* IProvideClassInfo */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetClassInfo(ITypeInfo ** ppTI)
+ {
+ IProvideClassInfo * pIProvideClassInfo = getIProvideClassInfo();
+ dbgprintf(TEXT("IProvideClassInfo::GetClassInfo(%p)"), ppTI);
+ HRESULT hr = pIProvideClassInfo->GetClassInfo(ppTI);
+ dbgprintf(TEXT("IProvideClassInfo::GetClassInfo -> %08X, pTI = %p"), hr, *ppTI);
+ return hr;
+ }
+
+ /* IProvideClassInfo2 */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IProvideClassInfo2::GetGUID(DWORD dwGuidKind, GUID * pGUID)
+ {
+ IProvideClassInfo2 * pIProvideClassInfo2 = getIProvideClassInfo2();
+ dbgprintf(TEXT("IProvideClassInfo2::GetGUID(%lu, %p)"), dwGuidKind, pGUID);
+ HRESULT hr = pIProvideClassInfo2->GetGUID(dwGuidKind, pGUID);
+ dbgprintf(TEXT("IProvideClassInfo2::GetGUID -> %08X, GUID = %ls"), hr, UUIDToString(*pGUID).c_str());
+ return hr;
+ }
+
+ /* IQuickActivate */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IQuickActivate::QuickActivate(QACONTAINER * pQaContainer, QACONTROL * pQaControl) // TODO
+ {
+ IQuickActivate * pIQuickActivate = getIQuickActivate();
+
+ std::basic_stringstream<TCHAR> o1;
+
+ o1 << "{ ";
+ o1 << "pClientSite = " << (void *)pQaContainer->pClientSite << ", ";
+ o1 << "pAdviseSink = " << (void *)pQaContainer->pAdviseSink << ", ";
+ o1 << "pPropertyNotifySink = " << (void *)pQaContainer->pPropertyNotifySink << ", ";
+ o1 << "pUnkEventSink = " << (void *)pQaContainer->pUnkEventSink << ", ";
+
+ o1 << std::hex;
+ o1 << "dwAmbientFlags = " << pQaContainer->dwAmbientFlags << ", ";
+ o1 << "colorFore = " << pQaContainer->colorFore << ", ";
+ o1 << "colorBack = " << pQaContainer->colorBack << ", ";
+ o1 << std::dec;
+
+ o1 << "pFont = " << (void *)pQaContainer->pFont << ", ";
+ o1 << "pUndoMgr = " << (void *)pQaContainer->pUndoMgr << ", ";
+
+ o1 << std::hex;
+ o1 << "dwAppearance = " << pQaContainer->dwAppearance << ", ";
+ o1 << "lcid = " << pQaContainer->lcid << ", ";
+ o1 << std::dec;
+
+ o1 << "hpal = " << (void *)pQaContainer->hpal << ", ";
+ o1 << "pBindHost = " << (void *)pQaContainer->pBindHost << ", ";
+ o1 << "pOleControlSite = " << (void *)pQaContainer->pOleControlSite << ", ";
+ o1 << "pServiceProvider = " << (void *)pQaContainer->pServiceProvider << ", ";
+ o1 << "}";
+
+ dbgprintf(TEXT("IQuickActivate::QuickActivate(%s, %p)"), o1.str().c_str(), pQaControl);
+
+ HRESULT hr = pIQuickActivate->QuickActivate(pQaContainer, pQaControl);
+
+ std::basic_stringstream<TCHAR> o2;
+
+ o2 << "{ ";
+ o2 << std::hex;
+ o2 << "dwMiscStatus = " << pQaControl->dwMiscStatus << ", ";
+ o2 << "dwViewStatus = " << pQaControl->dwViewStatus << ", ";
+ o2 << "dwEventCookie = " << pQaControl->dwEventCookie << ", ";
+ o2 << "dwPropNotifyCookie = " << pQaControl->dwPropNotifyCookie << ", ";
+ o2 << "dwPointerActivationPolicy = " << pQaControl->dwPointerActivationPolicy << ", ";
+ o2 << std::dec;
+ o2 << "}";
+
+ dbgprintf(TEXT("IQuickActivate::QuickActivate -> %08X, QaControl = %s"), hr, o2.str().c_str());
+
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IQuickActivate::SetContentExtent(LPSIZEL pSizel)
+ {
+ IQuickActivate * pIQuickActivate = getIQuickActivate();
+ dbgprintf(TEXT("IQuickActivate::SetContentExtent(%s)"), SizeToString(*pSizel).c_str());
+ HRESULT hr = pIQuickActivate->SetContentExtent(pSizel);
+ dbgprintf(TEXT("IQuickActivate::SetContentExtent -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IQuickActivate::GetContentExtent(LPSIZEL pSizel)
+ {
+ IQuickActivate * pIQuickActivate = getIQuickActivate();
+ dbgprintf(TEXT("IQuickActivate::GetContentExtent(%p)"), pSizel);
+ HRESULT hr = pIQuickActivate->GetContentExtent(pSizel);
+ dbgprintf(TEXT("IQuickActivate::GetContentExtent -> %08X, Sizel = %s"), hr, SizeToString(*pSizel).c_str());
+ return hr;
+ }
+
+ /* ISpecifyPropertyPages */
+ private:
+ std::basic_string<TCHAR> CauuidToString(const CAUUID& cauuid)
+ {
+ std::basic_ostringstream<TCHAR> o;
+
+ o << "{";
+
+ for(ULONG i = 0; i < cauuid.cElems; ++ i)
+ {
+ if(i)
+ o << ", ";
+ else
+ o << " ";
+
+ o << UUIDToString(cauuid.pElems[i]);
+ }
+
+ o << " }";
+
+ return o.str();
+ }
+
+ public:
+ virtual HRESULT STDMETHODCALLTYPE ISpecifyPropertyPages::GetPages(CAUUID * pPages)
+ {
+ ISpecifyPropertyPages * pISpecifyPropertyPages = getISpecifyPropertyPages();
+ dbgprintf(TEXT("ISpecifyPropertyPages::GetPages(%p)"), pPages);
+ HRESULT hr = pISpecifyPropertyPages->GetPages(pPages);
+ dbgprintf(TEXT("ISpecifyPropertyPages::GetPages -> %08X, Pages = %s"), hr, CauuidToString(*pPages).c_str());
+ return hr;
+ }
+
+ /* IViewObject */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IViewObject::Draw(DWORD dwDrawAspect, LONG lindex, void * pvAspect, DVTARGETDEVICE * ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL (STDMETHODCALLTYPE * pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue)
+ {
+ IViewObject * pIViewObject = getIViewObject();
+ dbgprintf(TEXT("IViewObject::Draw(%s, %ld, %p, %s, %p, %p, %s, %s, %p, %p)"), AspectToString(dwDrawAspect), lindex, pvAspect, TargetDeviceToString(*ptd).c_str(), hdcTargetDev, hdcDraw, RectToString(*lprcBounds).c_str(), RectToString(*lprcWBounds).c_str(), pfnContinue, dwContinue);
+ HRESULT hr = pIViewObject->Draw(dwDrawAspect, lindex, pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue);
+ dbgprintf(TEXT("IViewObject::Draw -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IViewObject::GetColorSet(DWORD dwDrawAspect, LONG lindex, void * pvAspect, DVTARGETDEVICE * ptd, HDC hicTargetDev, LOGPALETTE ** ppColorSet)
+ {
+ IViewObject * pIViewObject = getIViewObject();
+ dbgprintf(TEXT("IViewObject::GetColorSet(%s, %ld, %p, %s, %p, %p)"), AspectToString(dwDrawAspect), lindex, pvAspect, TargetDeviceToString(*ptd).c_str(), hicTargetDev, ppColorSet);
+ HRESULT hr = pIViewObject->GetColorSet(dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet);
+ dbgprintf(TEXT("IViewObject::GetColorSet -> %08X, pColorSet = %p"), hr, *ppColorSet);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IViewObject::Freeze(DWORD dwDrawAspect, LONG lindex, void * pvAspect, DWORD * pdwFreeze)
+ {
+ IViewObject * pIViewObject = getIViewObject();
+ dbgprintf(TEXT("IViewObject::Freeze(%s, %ld, %p, %p)"), AspectToString(dwDrawAspect), lindex, pvAspect, pdwFreeze);
+ HRESULT hr = pIViewObject->Freeze(dwDrawAspect, lindex, pvAspect, pdwFreeze);
+ dbgprintf(TEXT("IViewObject::Freeze -> %08X, dwFreeze = %08X"), hr, *pdwFreeze);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IViewObject::Unfreeze(DWORD dwFreeze)
+ {
+ IViewObject * pIViewObject = getIViewObject();
+ dbgprintf(TEXT("IViewObject::Unfreeze(%08X)"), dwFreeze);
+ HRESULT hr = pIViewObject->Unfreeze(dwFreeze);
+ dbgprintf(TEXT("IViewObject::Unfreeze -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IViewObject::SetAdvise(DWORD aspects, DWORD advf, IAdviseSink * pAdvSink)
+ {
+ IViewObject * pIViewObject = getIViewObject();
+ dbgprintf(TEXT("IViewObject::SetAdvise(%s, %08X, %p)"), AspectToString(aspects), advf, pAdvSink);
+ HRESULT hr = pIViewObject->SetAdvise(aspects, advf, pAdvSink);
+ dbgprintf(TEXT("IViewObject::SetAdvise -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE IViewObject::GetAdvise(DWORD * pAspects, DWORD * pAdvf, IAdviseSink ** ppAdvSink)
+ {
+ IViewObject * pIViewObject = getIViewObject();
+ dbgprintf(TEXT("IViewObject::GetAdvise(%p, %p, %p)"), pAspects, pAdvf, ppAdvSink);
+ HRESULT hr = pIViewObject->GetAdvise(pAspects, pAdvf, ppAdvSink);
+ dbgprintf(TEXT("IViewObject::GetAdvise -> %08X, aspects = %s, advf = %08X, pAdvSink %p"), hr, AspectToString(*pAspects), *pAdvf, *ppAdvSink);
+ return hr;
+ }
+
+ /* IViewObject2 */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IViewObject2::GetExtent(DWORD dwDrawAspect, LONG lindex, DVTARGETDEVICE * ptd, LPSIZEL lpsizel)
+ {
+ IViewObject2 * pIViewObject2 = getIViewObject2();
+ dbgprintf(TEXT("IViewObject2::GetExtent(%s, %ld, %s, %p)"), AspectToString(dwDrawAspect), lindex, TargetDeviceToString(*ptd).c_str(), lpsizel);
+ HRESULT hr = pIViewObject2->GetExtent(dwDrawAspect, lindex, ptd, lpsizel);
+ dbgprintf(TEXT("IViewObject2::GetExtent -> %08X, sizel = %s"), hr, SizeToString(*lpsizel).c_str());
+ return hr;
+ }
+
+ /* IMsTscAx */
+ public:
+ virtual HRESULT __stdcall put_Server(BSTR pServer)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_Server(%ls)"), pServer);
+ HRESULT hr = pIMsTscAx->put_Server(pServer);
+ dbgprintf(TEXT("IMsTscAx::put_Server -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_Server(BSTR * pServer)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_Server()"), pServer);
+ HRESULT hr = pIMsTscAx->get_Server(pServer);
+ dbgprintf(TEXT("IMsTscAx::get_Server -> %08X, server = %ls"), hr, *pServer);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_Domain(BSTR pDomain)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_Domain(%ls)"), pDomain);
+ HRESULT hr = pIMsTscAx->put_Domain(pDomain);
+ dbgprintf(TEXT("IMsTscAx::put_Domain -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_Domain(BSTR * pDomain)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_Domain(%p)"), pDomain);
+ HRESULT hr = pIMsTscAx->get_Domain(pDomain);
+ dbgprintf(TEXT("IMsTscAx::get_Domain -> %08X, Domain = %ls"), hr, *pDomain);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_UserName(BSTR pUserName)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_UserName(%ls)"), pUserName);
+ HRESULT hr = pIMsTscAx->put_UserName(pUserName);
+ dbgprintf(TEXT("IMsTscAx::put_UserName -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_UserName(BSTR * pUserName)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_UserName(%p)"), pUserName);
+ HRESULT hr = pIMsTscAx->get_UserName(pUserName);
+ dbgprintf(TEXT("IMsTscAx::get_UserName -> %08X, UserName = %ls"), hr, *pUserName);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_DisconnectedText(BSTR pDisconnectedText)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_DisconnectedText(%ls)"), pDisconnectedText);
+ HRESULT hr = pIMsTscAx->put_DisconnectedText(pDisconnectedText);
+ dbgprintf(TEXT("IMsTscAx::put_DisconnectedText -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_DisconnectedText(BSTR * pDisconnectedText)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_DisconnectedText(%p)"), pDisconnectedText);
+ HRESULT hr = pIMsTscAx->get_DisconnectedText(pDisconnectedText);
+ dbgprintf(TEXT("IMsTscAx::get_DisconnectedText -> %08X, DisconnectedText = %ls"), hr, *pDisconnectedText);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_ConnectingText(BSTR pConnectingText)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_ConnectingText(%ls)"), pConnectingText);
+ HRESULT hr = pIMsTscAx->put_ConnectingText(pConnectingText);
+ dbgprintf(TEXT("IMsTscAx::put_ConnectingText -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_ConnectingText(BSTR * pConnectingText)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_ConnectingText(%p)"), pConnectingText);
+ HRESULT hr = pIMsTscAx->get_ConnectingText(pConnectingText);
+ dbgprintf(TEXT("IMsTscAx::get_ConnectingText -> %08X, ConnectingText = %ls"), hr, *pConnectingText);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_Connected(short * pIsConnected)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_Connected(%p)"), pIsConnected);
+ HRESULT hr = pIMsTscAx->get_Connected(pIsConnected);
+ dbgprintf(TEXT("IMsTscAx::get_Connected -> %08X, IsConnected = %s"), hr, BooleanToString(*pIsConnected));
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_DesktopWidth(long pVal)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_DesktopWidth(%ld)"), pVal);
+ HRESULT hr = pIMsTscAx->put_DesktopWidth(pVal);
+ dbgprintf(TEXT("IMsTscAx::put_DesktopWidth -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_DesktopWidth(long * pVal)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_DesktopWidth(%p)"), pVal);
+ HRESULT hr = pIMsTscAx->get_DesktopWidth(pVal);
+ dbgprintf(TEXT("IMsTscAx::get_DesktopWidth -> %08X, Val = %lu"), hr, *pVal);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_DesktopHeight(long pVal)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_DesktopHeight(%ld)"), pVal);
+ HRESULT hr = pIMsTscAx->put_DesktopHeight(pVal);
+ dbgprintf(TEXT("IMsTscAx::put_DesktopHeight -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_DesktopHeight(long * pVal)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_DesktopHeight(%p)"), pVal);
+ HRESULT hr = pIMsTscAx->get_DesktopHeight(pVal);
+ dbgprintf(TEXT("IMsTscAx::get_DesktopHeight -> %08X, Val = %lu"), hr, *pVal);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_StartConnected(long pfStartConnected)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_StartConnected(%s)"), BooleanToString(pfStartConnected));
+ HRESULT hr = pIMsTscAx->put_StartConnected(pfStartConnected);
+ dbgprintf(TEXT("IMsTscAx::put_StartConnected -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_StartConnected(long * pfStartConnected)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_StartConnected(%p)"), pfStartConnected);
+ HRESULT hr = pIMsTscAx->get_StartConnected(pfStartConnected);
+ dbgprintf(TEXT("IMsTscAx::get_StartConnected -> %08X, fStartConnected = %s"), hr, BooleanToString(*pfStartConnected));
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_HorizontalScrollBarVisible(long * pfHScrollVisible)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_HorizontalScrollBarVisible(%p)"), pfHScrollVisible);
+ HRESULT hr = pIMsTscAx->get_HorizontalScrollBarVisible(pfHScrollVisible);
+ dbgprintf(TEXT("IMsTscAx::get_HorizontalScrollBarVisible -> %08X, fHScrollVisible = %s"), hr, BooleanToString(*pfHScrollVisible));
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_VerticalScrollBarVisible(long * pfVScrollVisible)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_VerticalScrollBarVisible(%p)"), pfVScrollVisible);
+ HRESULT hr = pIMsTscAx->get_VerticalScrollBarVisible(pfVScrollVisible);
+ dbgprintf(TEXT("IMsTscAx::get_VerticalScrollBarVisible -> %08X, fVScrollVisible"), hr, *pfVScrollVisible);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_FullScreenTitle(BSTR _arg1)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::put_FullScreenTitle(%ls)"), _arg1);
+ HRESULT hr = pIMsTscAx->put_FullScreenTitle(_arg1);
+ dbgprintf(TEXT("IMsTscAx::put_FullScreenTitle -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_CipherStrength(long * pCipherStrength)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_CipherStrength(%p)"), pCipherStrength);
+ HRESULT hr = pIMsTscAx->get_CipherStrength(pCipherStrength);
+ dbgprintf(TEXT("IMsTscAx::get_CipherStrength -> %08X, CipherStrength = %ld"), hr, *pCipherStrength);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_Version(BSTR * pVersion)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_Version(%p)"), pVersion);
+ HRESULT hr = pIMsTscAx->get_Version(pVersion);
+ dbgprintf(TEXT("IMsTscAx::get_Version -> %08X, Version = %ls"), hr, *pVersion);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_SecuredSettingsEnabled(long * pSecuredSettingsEnabled)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_SecuredSettingsEnabled(%p)"), pSecuredSettingsEnabled);
+ HRESULT hr = pIMsTscAx->get_SecuredSettingsEnabled(pSecuredSettingsEnabled);
+ dbgprintf(TEXT("IMsTscAx::get_SecuredSettingsEnabled -> %08X, SecuredSettingsEnabled = %s"), hr, BooleanToString(*pSecuredSettingsEnabled));
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_SecuredSettings(IMsTscSecuredSettings ** ppSecuredSettings)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_SecuredSettings(%p)"), ppSecuredSettings);
+ HRESULT hr = pIMsTscAx->get_SecuredSettings(ppSecuredSettings);
+ dbgprintf(TEXT("IMsTscAx::get_SecuredSettings -> %08X, pSecuredSettings = %p"), hr, *ppSecuredSettings);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_AdvancedSettings(IMsTscAdvancedSettings ** ppAdvSettings)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_AdvancedSettings(%p)"), ppAdvSettings);
+ HRESULT hr = pIMsTscAx->get_AdvancedSettings(ppAdvSettings);
+ dbgprintf(TEXT("IMsTscAx::get_AdvancedSettings -> %08X, pAdvSettings = %p"), hr, *ppAdvSettings);
+
+ if(SUCCEEDED(hr))
+ *ppAdvSettings = new CAdvancedSettings(*ppAdvSettings);
+
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_Debugger(IMsTscDebug ** ppDebugger)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::get_Debugger(%p)"), ppDebugger);
+ HRESULT hr = pIMsTscAx->get_Debugger(ppDebugger);
+ dbgprintf(TEXT("IMsTscAx::get_Debugger -> %08X, pDebugger = %p"), hr, *ppDebugger);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall Connect()
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::Connect()"));
+ HRESULT hr = pIMsTscAx->Connect();
+ dbgprintf(TEXT("IMsTscAx::Connect -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall Disconnect()
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::Disconnect()"));
+ HRESULT hr = pIMsTscAx->Disconnect();
+ dbgprintf(TEXT("IMsTscAx::Disconnect -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall CreateVirtualChannels(BSTR newVal)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::CreateVirtualChannels(%ls)"), newVal);
+ HRESULT hr = pIMsTscAx->CreateVirtualChannels(newVal);
+ dbgprintf(TEXT("IMsTscAx::CreateVirtualChannels -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall SendOnVirtualChannel(BSTR chanName, BSTR ChanData)
+ {
+ IMsTscAx * pIMsTscAx = getIMsTscAx();
+ dbgprintf(TEXT("IMsTscAx::SendOnVirtualChannel(%ls, %p)"), chanName, ChanData);
+ HRESULT hr = pIMsTscAx->SendOnVirtualChannel(chanName, ChanData);
+ dbgprintf(TEXT("IMsTscAx::SendOnVirtualChannel -> %08X"), hr);
+ return hr;
+ }
+
+ /* IMsRdpClient */
+ public:
+ virtual HRESULT __stdcall put_ColorDepth(long pcolorDepth)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::put_ColorDepth(%ld)"), pcolorDepth);
+ HRESULT hr = pIMsRdpClient->put_ColorDepth(pcolorDepth);
+ dbgprintf(TEXT("IMsRdpClient::put_ColorDepth -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_ColorDepth(long * pcolorDepth)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::get_ColorDepth(%p)"), pcolorDepth);
+ HRESULT hr = pIMsRdpClient->get_ColorDepth(pcolorDepth);
+ dbgprintf(TEXT("IMsRdpClient::get_ColorDepth -> %08X, colorDepth = %ld"), hr, *pcolorDepth);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_AdvancedSettings2(IMsRdpClientAdvancedSettings ** ppAdvSettings)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::get_AdvancedSettings2(%p)"), ppAdvSettings);
+ HRESULT hr = pIMsRdpClient->get_AdvancedSettings2(ppAdvSettings);
+ dbgprintf(TEXT("IMsRdpClient::get_AdvancedSettings2 -> %08X, pAdvSettings = %p"), hr, *ppAdvSettings);
+
+ if(SUCCEEDED(hr))
+ *ppAdvSettings = new CAdvancedSettings(*ppAdvSettings);
+
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_SecuredSettings2(IMsRdpClientSecuredSettings ** ppSecuredSettings)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::get_SecuredSettings2(%p)"), ppSecuredSettings);
+ HRESULT hr = pIMsRdpClient->get_SecuredSettings2(ppSecuredSettings);
+ dbgprintf(TEXT("IMsRdpClient::get_SecuredSettings2 -> %08X, pSecuredSettings = %p"), hr, *ppSecuredSettings);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_ExtendedDisconnectReason(ExtendedDisconnectReasonCode * pExtendedDisconnectReason)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::get_ExtendedDisconnectReason(%p)"), pExtendedDisconnectReason);
+ HRESULT hr = pIMsRdpClient->get_ExtendedDisconnectReason(pExtendedDisconnectReason);
+ dbgprintf(TEXT("IMsRdpClient::get_ExtendedDisconnectReason -> %08X, ExtendedDisconnectReason = %u"), hr, *pExtendedDisconnectReason);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_FullScreen(VARIANT_BOOL pfFullScreen)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::put_FullScreen(%s)"), BooleanToString(pfFullScreen));
+ HRESULT hr = pIMsRdpClient->put_FullScreen(pfFullScreen);
+ dbgprintf(TEXT("IMsRdpClient::put_FullScreen -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_FullScreen(VARIANT_BOOL * pfFullScreen)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::get_FullScreen(%p)"), pfFullScreen);
+ HRESULT hr = pIMsRdpClient->get_FullScreen(pfFullScreen);
+ dbgprintf(TEXT("IMsRdpClient::get_FullScreen -> %08X, pfFullScreen = %s"), hr, BooleanToString(*pfFullScreen));
+ return hr;
+ }
+
+ virtual HRESULT __stdcall SetVirtualChannelOptions(BSTR chanName, long chanOptions)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::SetVirtualChannelOptions(%ls, %08X)"), chanName, chanOptions);
+ HRESULT hr = pIMsRdpClient->SetVirtualChannelOptions(chanName, chanOptions);
+ dbgprintf(TEXT("IMsRdpClient::SetVirtualChannelOptions -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall GetVirtualChannelOptions(BSTR chanName, long * pChanOptions)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::GetVirtualChannelOptions(%ls, %p)"), chanName, pChanOptions);
+ HRESULT hr = pIMsRdpClient->GetVirtualChannelOptions(chanName, pChanOptions);
+ dbgprintf(TEXT("IMsRdpClient::GetVirtualChannelOptions -> %08X, ChanOptions = %08X"), hr, *pChanOptions);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall RequestClose(ControlCloseStatus * pCloseStatus)
+ {
+ IMsRdpClient * pIMsRdpClient = getIMsRdpClient();
+ dbgprintf(TEXT("IMsRdpClient::RequestClose(%p)"), pCloseStatus);
+ HRESULT hr = pIMsRdpClient->RequestClose(pCloseStatus);
+ dbgprintf(TEXT("IMsRdpClient::RequestClose -> %08X, CloseStatus = %ld"), hr, *pCloseStatus);
+ return hr;
+ }
+
+ /* IMsRdpClient2 */
+ public:
+ virtual HRESULT __stdcall get_AdvancedSettings3(IMsRdpClientAdvancedSettings2 ** ppAdvSettings)
+ {
+ IMsRdpClient2 * pIMsRdpClient2 = getIMsRdpClient2();
+ dbgprintf(TEXT("IMsRdpClient2::get_AdvancedSettings3(%p)"), ppAdvSettings);
+ HRESULT hr = pIMsRdpClient2->get_AdvancedSettings3(ppAdvSettings);
+ dbgprintf(TEXT("IMsRdpClient2::get_AdvancedSettings3 -> %08X, pAdvSettings = %p"), hr, *ppAdvSettings);
+
+ if(SUCCEEDED(hr))
+ *ppAdvSettings = new CAdvancedSettings(*ppAdvSettings);
+
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_ConnectedStatusText(BSTR pConnectedStatusText)
+ {
+ IMsRdpClient2 * pIMsRdpClient2 = getIMsRdpClient2();
+ dbgprintf(TEXT("IMsRdpClient2::put_ConnectedStatusText(%ls)"), pConnectedStatusText);
+ HRESULT hr = pIMsRdpClient2->put_ConnectedStatusText(pConnectedStatusText);
+ dbgprintf(TEXT("IMsRdpClient2::put_ConnectedStatusText -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_ConnectedStatusText(BSTR * pConnectedStatusText)
+ {
+ IMsRdpClient2 * pIMsRdpClient2 = getIMsRdpClient2();
+ dbgprintf(TEXT("IMsRdpClient2::get_ConnectedStatusText(%p)"), pConnectedStatusText);
+ HRESULT hr = pIMsRdpClient2->get_ConnectedStatusText(pConnectedStatusText);
+ dbgprintf(TEXT("IMsRdpClient2::get_ConnectedStatusText -> %08X, ConnectedStatusText = %ls"), hr, *pConnectedStatusText);
+ return hr;
+ }
+
+ /* IMsRdpClient3 */
+ public:
+ virtual HRESULT __stdcall get_AdvancedSettings4(IMsRdpClientAdvancedSettings3 ** ppAdvSettings)
+ {
+ IMsRdpClient3 * pIMsRdpClient3 = getIMsRdpClient3();
+ dbgprintf(TEXT("IMsRdpClient3::get_AdvancedSettings4(%p)"), ppAdvSettings);
+ HRESULT hr = pIMsRdpClient3->get_AdvancedSettings4(ppAdvSettings);
+ dbgprintf(TEXT("IMsRdpClient3::get_AdvancedSettings4 -> %08X, pAdvSettings = %p"), hr, *ppAdvSettings);
+
+ if(SUCCEEDED(hr))
+ *ppAdvSettings = new CAdvancedSettings(*ppAdvSettings);
+
+ return hr;
+ }
+
+ /* IMsRdpClient4 */
+ public:
+ virtual HRESULT __stdcall get_AdvancedSettings5(IMsRdpClientAdvancedSettings4 ** ppAdvSettings5)
+ {
+ IMsRdpClient4 * pIMsRdpClient4 = getIMsRdpClient4();
+ dbgprintf(TEXT("IMsRdpClient4::get_AdvancedSettings5(%p)"), ppAdvSettings5);
+ HRESULT hr = pIMsRdpClient4->get_AdvancedSettings5(ppAdvSettings5);
+ dbgprintf(TEXT("IMsRdpClient4::get_AdvancedSettings5 -> %08X, pAdvSettings5 = %p"), hr, *ppAdvSettings5);
+
+ if(SUCCEEDED(hr))
+ *ppAdvSettings5 = new CAdvancedSettings(*ppAdvSettings5);
+
+ return hr;
+ }
+
+ /* IMsTscNonScriptable */
+ public:
+ virtual HRESULT __stdcall put_ClearTextPassword(BSTR _arg1)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::put_ClearTextPassword(%ls)"), _arg1);
+ HRESULT hr = pIMsTscNonScriptable->put_ClearTextPassword(_arg1);
+ dbgprintf(TEXT("IMsTscNonScriptable::put_ClearTextPassword -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_PortablePassword(BSTR pPortablePass)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::put_PortablePassword(%ls)"), pPortablePass);
+ HRESULT hr = pIMsTscNonScriptable->put_PortablePassword(pPortablePass);
+ dbgprintf(TEXT("IMsTscNonScriptable::put_PortablePassword -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_PortablePassword(BSTR * pPortablePass)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::get_PortablePassword(%p)"), pPortablePass);
+ HRESULT hr = pIMsTscNonScriptable->get_PortablePassword(pPortablePass);
+ dbgprintf(TEXT("IMsTscNonScriptable::get_PortablePassword -> %08X, PortablePass = %ls"), hr, *pPortablePass);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_PortableSalt(BSTR pPortableSalt)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::put_PortableSalt(%ls)"), pPortableSalt);
+ HRESULT hr = pIMsTscNonScriptable->put_PortableSalt(pPortableSalt);
+ dbgprintf(TEXT("IMsTscNonScriptable::put_PortableSalt -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_PortableSalt(BSTR * pPortableSalt)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::get_PortableSalt()"), pPortableSalt);
+ HRESULT hr = pIMsTscNonScriptable->get_PortableSalt(pPortableSalt);
+ dbgprintf(TEXT("IMsTscNonScriptable::get_PortableSalt -> %08X, PortableSalt = %ls"), hr, *pPortableSalt);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_BinaryPassword(BSTR pBinaryPassword)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::put_BinaryPassword(%p)"), pBinaryPassword);
+ HRESULT hr = pIMsTscNonScriptable->put_BinaryPassword(pBinaryPassword);
+ dbgprintf(TEXT("IMsTscNonScriptable::put_BinaryPassword -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_BinaryPassword(BSTR * pBinaryPassword)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::get_BinaryPassword()"), pBinaryPassword);
+ HRESULT hr = pIMsTscNonScriptable->get_BinaryPassword(pBinaryPassword);
+ dbgprintf(TEXT("IMsTscNonScriptable::get_BinaryPassword -> %08X, BinaryPassword = %ls"), hr, *pBinaryPassword);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall put_BinarySalt(BSTR pSalt)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::put_BinarySalt(%p)"), pSalt);
+ HRESULT hr = pIMsTscNonScriptable->put_BinarySalt(pSalt);
+ dbgprintf(TEXT("IMsTscNonScriptable::put_BinarySalt -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall get_BinarySalt(BSTR * pSalt)
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::get_BinarySalt()"), pSalt);
+ HRESULT hr = pIMsTscNonScriptable->get_BinarySalt(pSalt);
+ dbgprintf(TEXT("IMsTscNonScriptable::get_BinarySalt -> %08X, pSalt = %ls"), hr, *pSalt);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall ResetPassword()
+ {
+ IMsTscNonScriptable * pIMsTscNonScriptable = getIMsTscNonScriptable();
+ dbgprintf(TEXT("IMsTscNonScriptable::ResetPassword()"));
+ HRESULT hr = pIMsTscNonScriptable->ResetPassword();
+ dbgprintf(TEXT("IMsTscNonScriptable::ResetPassword -> %08X"), hr);
+ return hr;
+ }
+
+
+ /* IMsRdpClientNonScriptable */
+ public:
+ virtual HRESULT __stdcall IMsRdpClientNonScriptable::NotifyRedirectDeviceChange(UINT_PTR wParam, LONG_PTR lParam)
+ {
+ IMsRdpClientNonScriptable * pIMsRdpClientNonScriptable = getIMsRdpClientNonScriptable();
+ dbgprintf(TEXT("IMsRdpClientNonScriptable::NotifyRedirectDeviceChange(%p, %p)"), wParam, lParam);
+ HRESULT hr = pIMsRdpClientNonScriptable->NotifyRedirectDeviceChange(wParam, lParam);
+ dbgprintf(TEXT("IMsRdpClientNonScriptable::NotifyRedirectDeviceChange -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall IMsRdpClientNonScriptable::SendKeys(long numKeys, VARIANT_BOOL * pbArrayKeyUp, long * plKeyData) // TBD
+ {
+ IMsRdpClientNonScriptable * pIMsRdpClientNonScriptable = getIMsRdpClientNonScriptable();
+ dbgprintf(TEXT("IMsRdpClientNonScriptable::SendKeys(%ld, %p, %p)"), numKeys, pbArrayKeyUp, plKeyData);
+ HRESULT hr = pIMsRdpClientNonScriptable->SendKeys(numKeys, pbArrayKeyUp, plKeyData);
+ dbgprintf(TEXT("IMsRdpClientNonScriptable::SendKeys -> %08X"), hr);
+ return hr;
+ }
+
+ /* IMsRdpClientNonScriptable2 */
+ public:
+ virtual HRESULT __stdcall IMsRdpClientNonScriptable2::put_UIParentWindowHandle(wireHWND phwndUIParentWindowHandle)
+ {
+ IMsRdpClientNonScriptable2 * pIMsRdpClientNonScriptable2 = getIMsRdpClientNonScriptable2();
+ dbgprintf(TEXT("IMsRdpClientNonScriptable2::put_UIParentWindowHandle(%p)"), phwndUIParentWindowHandle);
+ HRESULT hr = pIMsRdpClientNonScriptable2->put_UIParentWindowHandle(phwndUIParentWindowHandle);
+ dbgprintf(TEXT("IMsRdpClientNonScriptable2::put_UIParentWindowHandle -> %08X"), hr);
+ return hr;
+ }
+
+ virtual HRESULT __stdcall IMsRdpClientNonScriptable2::get_UIParentWindowHandle(wireHWND * phwndUIParentWindowHandle)
+ {
+ IMsRdpClientNonScriptable2 * pIMsRdpClientNonScriptable2 = getIMsRdpClientNonScriptable2();
+ dbgprintf(TEXT("IMsRdpClientNonScriptable2::get_UIParentWindowHandle(%p)"), phwndUIParentWindowHandle);
+ HRESULT hr = pIMsRdpClientNonScriptable2->get_UIParentWindowHandle(phwndUIParentWindowHandle);
+ dbgprintf(TEXT("IMsRdpClientNonScriptable2::get_UIParentWindowHandle -> %08X, hwndUIParentWindowHandle = %p"), hr, *phwndUIParentWindowHandle);
+ return hr;
+ }
+
+ /*
+ {
+ * p = m_;
+ dbgprintf(TEXT("::()"), );
+ HRESULT hr = p->();
+ dbgprintf(TEXT(":: -> %08X, "), hr, );
+ return hr;
+ }
+ */
+ };
+
+ class ClassFactory: public IClassFactory2
+ {
+ private:
+ LONG m_refCount;
+ IUnknown * m_IUnknown;
+ IClassFactory * m_IClassFactory;
+ IClassFactory2 * m_IClassFactory2;
+
+ IClassFactory * getIClassFactory()
+ {
+ if(m_IClassFactory)
+ return m_IClassFactory;
+
+ if(m_IClassFactory2)
+ m_IClassFactory = m_IClassFactory2;
+
+ if(m_IClassFactory)
+ {
+ m_IClassFactory->AddRef();
+ return m_IClassFactory;
+ }
+
+ m_IUnknown->QueryInterface(&m_IClassFactory);
+ return m_IClassFactory;
+ }
+
+ IClassFactory2 * getIClassFactory2()
+ {
+ if(m_IClassFactory2)
+ return m_IClassFactory2;
+
+ m_IUnknown->QueryInterface(&m_IClassFactory2);
+ return m_IClassFactory2;
+ }
+
+ public:
+ ClassFactory(IUnknown * pUnknwn):
+ m_refCount(1),
+ m_IUnknown(pUnknwn),
+ m_IClassFactory(NULL),
+ m_IClassFactory2(NULL)
+ {
+ m_IUnknown->AddRef();
+ }
+
+ ~ClassFactory()
+ {
+ if(m_IUnknown)
+ m_IUnknown->Release();
+
+ if(m_IClassFactory)
+ m_IClassFactory->Release();
+
+ if(m_IClassFactory2)
+ m_IClassFactory2->Release();
+ }
+
+ /* IUnknown */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ HRESULT hr;
+ IUnknown * pvObject = NULL;
+
+ dbgprintf(TEXT("IUnknown::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject);
+
+#define QIBEGIN() \
+ if(riid == IID_IUnknown) \
+ { \
+ hr = S_OK; \
+ pvObject = (IUnknown *)(this); \
+ }
+
+#define QI(I) \
+ else if(riid == IID_ ## I) \
+ { \
+ if(m_ ## I) \
+ { \
+ m_ ## I->AddRef(); \
+ hr = S_OK; \
+ } \
+ else \
+ { \
+ hr = m_IUnknown->QueryInterface(&m_ ## I); \
+ } \
+ \
+ if(SUCCEEDED(hr)) \
+ pvObject = static_cast<I *>(this); \
+ }
+
+#define QIEND() \
+ else \
+ { \
+ hr = E_NOINTERFACE; \
+ pvObject = NULL; \
+ }
+
+ QIBEGIN()
+ QI(IClassFactory)
+ QI(IClassFactory2)
+ QIEND()
+
+#undef QIBEGIN
+#undef QIEND
+#undef QI
+
+ if(SUCCEEDED(hr))
+ {
+ assert(pvObject);
+ pvObject->AddRef();
+ }
+ else
+ {
+ assert(pvObject == NULL);
+ }
+
+ *ppvObject = pvObject;
+
+ dbgprintf(TEXT("IUnknown::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject);
+ return hr;
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef(void)
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release(void)
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ /* IClassFactory */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateInstance(IUnknown * pUnkOuter, REFIID riid, void ** ppvObject)
+ {
+ IClassFactory * pIClassFactory = getIClassFactory();
+ dbgprintf(TEXT("IClassFactory::CreateInstance(%p, %ls, %p)"), pUnkOuter, UUIDToString(riid).c_str(), ppvObject);
+ HRESULT hr = pIClassFactory->CreateInstance(NULL, riid, ppvObject);
+ dbgprintf(TEXT("IClassFactory::CreateInstance -> %08X, pvObject = %p"), hr, *ppvObject);
+ return CoClass::CreateInstance((IUnknown *)*ppvObject, pUnkOuter, riid, ppvObject);
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock)
+ {
+ IClassFactory * pIClassFactory = getIClassFactory();
+ dbgprintf(TEXT("IClassFactory::LockServer(%s)"), BooleanToString(fLock));
+ HRESULT hr = pIClassFactory->LockServer(fLock);
+ dbgprintf(TEXT("IClassFactory::LockServer -> %08X"), hr);
+ return hr;
+ }
+
+ /* IClassFactory2 */
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetLicInfo(LICINFO * pLicInfo)
+ {
+ IClassFactory2 * pIClassFactory2 = getIClassFactory2();
+ dbgprintf(TEXT("IClassFactory2::GetLicInfo(%p)"), pLicInfo);
+ HRESULT hr = pIClassFactory2->GetLicInfo(pLicInfo);
+ dbgprintf(TEXT("IClassFactory2::GetLicInfo -> %08X, LicInfo = %p"), hr, pLicInfo);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE RequestLicKey(DWORD dwReserved, BSTR * pBstrKey)
+ {
+ IClassFactory2 * pIClassFactory2 = getIClassFactory2();
+ dbgprintf(TEXT("IClassFactory2::RequestLicKey(%lu, %p)"), dwReserved, pBstrKey);
+ HRESULT hr = pIClassFactory2->RequestLicKey(dwReserved, pBstrKey);
+ dbgprintf(TEXT("IClassFactory2::RequestLicKey -> %08X, bstrKey = %ls"), hr, *pBstrKey);
+ return hr;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE CreateInstanceLic(IUnknown * pUnkOuter, IUnknown * pUnkReserved, REFIID riid, BSTR bstrKey, PVOID * ppvObj)
+ {
+ IClassFactory2 * pIClassFactory2 = getIClassFactory2();
+ dbgprintf(TEXT("IClassFactory2::CreateInstanceLic(%p, %p, %ls, %ls, %p)"), pUnkOuter, pUnkReserved, UUIDToString(riid).c_str(), bstrKey, ppvObj);
+ HRESULT hr = pIClassFactory2->CreateInstanceLic(NULL, pUnkReserved, riid, bstrKey, ppvObj);
+ dbgprintf(TEXT("IClassFactory2::CreateInstanceLic -> %08X, pvObj = %p"), hr, *ppvObj);
+ return CoClass::CreateInstance((IUnknown *)*ppvObj, pUnkOuter, riid, ppvObj);
+ }
+ };
+
+ STDAPI DllGetClassObject(IN REFCLSID rclsid, IN REFIID riid, OUT LPVOID * ppv)
+ {
+ init();
+
+ dbgprintf(TEXT("DllGetClassObject(%ls, %ls, %p)"), UUIDToString(rclsid).c_str(), UUIDToString(riid).c_str(), ppv);
+ HRESULT hr = pfnDllGetClassObject(rclsid, IID_IUnknown, ppv);
+ dbgprintf(TEXT("DllGetClassObject -> %08X, pv = %p"), hr, *ppv);
+
+ IUnknown * pv = NULL;
+
+ if(SUCCEEDED(hr))
+ {
+ IUnknown * punk = (IUnknown *)*ppv;
+
+ if(rclsid == CLSID_MsTscAx || rclsid == CLSID_MsRdpClient || rclsid == CLSID_MsRdpClient2 || rclsid == CLSID_MsRdpClient3 || rclsid == CLSID_MsRdpClient4)
+ pv = new ClassFactory(punk);
+ else
+ hr = CLASS_E_CLASSNOTAVAILABLE;
+
+ punk->Release();
+ }
+
+ if(pv)
+ {
+ hr = pv->QueryInterface(riid, ppv);
+
+ if(FAILED(hr))
+ pv->Release();
+ }
+
+ return hr;
+ }
+
+ STDAPI DllCanUnloadNow(void)
+ {
+ init();
+
+ dbgprintf(TEXT("DllCanUnloadNow()"));
+ HRESULT hr = pfnDllCanUnloadNow();
+ dbgprintf(TEXT("DllCanUnloadNow -> %08X"), hr);
+
+ return hr;
+ }
+
+ STDAPI_(ULONG) DllGetTscCtlVer(void)
+ {
+ init();
+
+ dbgprintf(TEXT("DllGetTscCtlVer()"));
+ ULONG ul = pfnDllGetTscCtlVer();
+ dbgprintf(TEXT("DllGetTscCtlVer-> %08X"), ul);
+
+ return ul;
+ }
+}
+
+// EOF
--- /dev/null
+LIBRARY mstscax.dll
+
+EXPORTS
+ ; OLE inproc server
+ DllGetClassObject PRIVATE
+ DllCanUnloadNow PRIVATE
+
+ ; OLE self-registration
+ ; TODO
+
+ ; Private APIs
+ DllGetTscCtlVer
+
+; EOF
--- /dev/null
+\r
+Microsoft Visual Studio Solution File, Format Version 9.00\r
+# Visual C++ Express 2005\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mstscax", "mstscax.vcproj", "{933B2293-F12F-4B01-98B4-BF635B8B4F36}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Win32 = Debug|Win32\r
+ Release|Win32 = Release|Win32\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {933B2293-F12F-4B01-98B4-BF635B8B4F36}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {933B2293-F12F-4B01-98B4-BF635B8B4F36}.Debug|Win32.Build.0 = Debug|Win32\r
+ {933B2293-F12F-4B01-98B4-BF635B8B4F36}.Release|Win32.ActiveCfg = Release|Win32\r
+ {933B2293-F12F-4B01-98B4-BF635B8B4F36}.Release|Win32.Build.0 = Release|Win32\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="8,00"\r
+ Name="mstscax"\r
+ ProjectGUID="{933B2293-F12F-4B01-98B4-BF635B8B4F36}"\r
+ RootNamespace="mstscax"\r
+ Keyword="Win32Proj"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="2"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="kernel32.lib ole32.lib $(NoInherit)"\r
+ LinkIncremental="2"\r
+ ModuleDefinitionFile="$(ProjectDir)/mstscax.def"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="2"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="kernel32.lib ole32.lib $(NoInherit)"\r
+ LinkIncremental="1"\r
+ ModuleDefinitionFile="$(ProjectDir)/mstscax.def"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath=".\mstscax.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\mstscax.def"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\stdafx.cpp"\r
+ >\r
+ <FileConfiguration\r
+ Name="Debug|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="1"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="1"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ <File\r
+ RelativePath=".\stdafx.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+ >\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
--- /dev/null
+#include "stdafx.h"
--- /dev/null
+#pragma once
+
+#include <stdarg.h>
+#include <tchar.h>
+#include <stdio.h>
+
+#include <string>
+#include <sstream>
+#include <algorithm>
+#include <iterator>
+
+#define WIN32_LEAN_AND_MEAN
+#define STRICT
+#define NOMINMAX
+
+#include <windows.h>
+#include <objbase.h>
+#include <objsafe.h>
+
+#include <ocidl.h>
+
+#include <strsafe.h>
+
+#import "./rdesktop-core-tester.tlb" \
+ exclude("LONG_PTR", "UINT_PTR", "wireHWND", "_RemotableHandle", "__MIDL_IWinTypes_0009") \
+ named_guids \
+ no_implementation \
+ no_smart_pointers \
+ raw_dispinterfaces \
+ raw_interfaces_only \
+ raw_native_types
+
+// EOF
--- /dev/null
+#include "stdafx.h"
+
+namespace MSTSCLib
+{
+#include "mstsclib_h.h"
+};
+
+namespace MSTSCLib_Redist
+{
+// extremely ew, but actually the cleanest way to import the alternate UUIDs
+#include "mstsclib_redist_i.c"
+};
+
+#include "rdesktop/rdesktop.h"
+#include "rdesktop/proto.h"
+
+namespace
+{
+#ifdef _MSC_VER
+extern "C" char __ImageBase;
+#endif
+
+HMODULE GetCurrentModule()
+{
+ return reinterpret_cast<HMODULE>(&__ImageBase);
+}
+
+}
+
+namespace
+{
+
+LONG g_moduleRefCount = 0;
+
+void lockServer()
+{
+ InterlockedIncrement(&g_moduleRefCount);
+}
+
+void unlockServer()
+{
+ InterlockedDecrement(&g_moduleRefCount);
+}
+
+bool canUnloadServer()
+{
+ return g_moduleRefCount == 0;
+}
+
+}
+
+namespace
+{
+
+void FreeLpsz(LPSTR lpsz)
+{
+ if(lpsz)
+ delete[] lpsz;
+}
+
+LPSTR AllocLpsz(const CHAR * lpsz, size_t cb)
+{
+ LPSTR lpszNew = new CHAR[cb + 1];
+
+ if(lpszNew == NULL)
+ return NULL;
+
+ CopyMemory(lpszNew, lpsz, cb);
+ lpszNew[cb] = 0;
+
+ return lpszNew;
+}
+
+LPSTR AllocLpsz(const WCHAR * lpwsz, int cchIn)
+{
+ int cch = WideCharToMultiByte(CP_ACP, 0, lpwsz, cchIn, NULL, 0, NULL, NULL);
+
+ if(cch <= 0)
+ return NULL;
+
+ LPSTR lpsz = new CHAR[cch];
+
+ if(lpsz == NULL)
+ return NULL;
+
+ cch = WideCharToMultiByte(CP_ACP, 0, lpwsz, cchIn, lpsz, cch, NULL, NULL);
+
+ if(cch <= 0)
+ {
+ FreeLpsz(lpsz);
+ return NULL;
+ }
+
+ return lpsz;
+}
+
+LPSTR BstrToLpsz(BSTR bstr)
+{
+ return AllocLpsz(bstr, SysStringLen(bstr));
+}
+
+BSTR LpszToBstr(LPSTR lpsz)
+{
+ int cch = MultiByteToWideChar(CP_ACP, 0, lpsz, -1, NULL, 0);
+
+ if(cch <= 0)
+ return NULL;
+
+ BSTR bstr = SysAllocStringLen(NULL, cch);
+
+ if(bstr == NULL)
+ return NULL;
+
+ cch = MultiByteToWideChar(CP_ACP, 0, lpsz, -1, bstr, cch);
+
+ if(cch <= 0)
+ {
+ SysFreeString(bstr);
+ return NULL;
+ }
+
+ return bstr;
+}
+
+}
+
+namespace
+{
+
+template<class T, class U> T aligndown(const T& X, const U& align)
+{
+ return X & ~(T(align) - 1);
+}
+
+template<class T, class U> T alignup(const T& X, const U& align)
+{
+ return aligndown(X + (align - 1), align);
+}
+
+/* Convert between bitmap formats */
+uint8 * win32_convert_scanlines(int width, int height, int bitcount, int fromalign, int toalign, const uint8 * data, uint8 ** buffer)
+{
+ // TBD: profile & optimize the most common cases
+ assert(width > 0);
+ assert(height);
+ assert(bitcount && bitcount <= 32);
+ assert(fromalign <= toalign);
+ assert(data);
+ assert(buffer);
+
+ bool flipped = height < 0;
+
+ if(flipped)
+ height = - height;
+
+ int bytesperrow = alignup(width * bitcount, 8) / 8;
+ int fromstride = alignup(bytesperrow, fromalign);
+ int tostride = alignup(bytesperrow, toalign);
+ assert(fromstride <= tostride);
+
+ int datasize = tostride * height;
+
+ uint8 * dibits = new uint8[datasize];
+
+ const uint8 * src = data;
+ uint8 * dest = dibits;
+
+ const int pad = tostride - fromstride;
+
+ assert(pad < 4);
+ __assume(pad < 4);
+
+ if(flipped)
+ {
+ dest += (height - 1) * tostride;
+ tostride = - tostride;
+ }
+
+ for(int i = 0; i < height; ++ i)
+ {
+ memcpy(dest, src, fromstride);
+ memset(dest + fromstride, 0, pad);
+ src += fromstride;
+ dest += tostride;
+ }
+
+ *buffer = dibits;
+ return dibits;
+}
+
+/* Creates bitmaps */
+HBITMAP win32_create_dib(LONG width, LONG height, WORD bitcount, const BYTE * data)
+{
+ struct b_
+ {
+ BITMAPINFO bmi;
+ RGBQUAD colormap[256 - ARRAYSIZE(RTL_FIELD_TYPE(BITMAPINFO, bmiColors))];
+ }
+ b;
+
+ b.bmi.bmiHeader.biSize = sizeof(b.bmi.bmiHeader);
+ b.bmi.bmiHeader.biWidth = width;
+ b.bmi.bmiHeader.biHeight = height;
+ b.bmi.bmiHeader.biPlanes = 1;
+ b.bmi.bmiHeader.biBitCount = bitcount;
+ b.bmi.bmiHeader.biCompression = BI_RGB;
+ b.bmi.bmiHeader.biSizeImage = 0;
+ b.bmi.bmiHeader.biXPelsPerMeter = 0;
+ b.bmi.bmiHeader.biYPelsPerMeter = 0;
+
+ if(bitcount > 8)
+ {
+ b.bmi.bmiHeader.biClrUsed = 0;
+ b.bmi.bmiHeader.biClrImportant = 0;
+ }
+ else
+ {
+ b.bmi.bmiHeader.biClrUsed = 2 << bitcount;
+ b.bmi.bmiHeader.biClrImportant = 2 << bitcount;
+
+ // TODO: palette
+ }
+
+ // FIXME: beyond ugly
+ HDC hdc = CreateCompatibleDC(NULL);
+
+ if(hdc == NULL)
+ return NULL;
+
+ HBITMAP hbm = CreateDIBitmap(hdc, &b.bmi.bmiHeader, CBM_INIT, data, &b.bmi, DIB_RGB_COLORS);
+
+ if(hbm == NULL)
+ error("CreateDIBitmap %dx%dx%d failed\n", width, height, bitcount);
+
+ DeleteDC(hdc);
+ return hbm;
+}
+
+/* Creates brushes */
+HBRUSH win32_create_brush(BRUSH * brush, COLORREF fgcolour)
+{
+ if(brush == NULL)
+ return (HBRUSH)GetStockObject(NULL_BRUSH);
+
+ switch(brush->style)
+ {
+ case BS_SOLID:
+ case BS_NULL:
+ case BS_HATCHED:
+ case BS_PATTERN:
+ case BS_PATTERN8X8:
+ break;
+
+ default:
+ return NULL;
+ }
+
+ switch(brush->style)
+ {
+ case BS_SOLID:
+ return CreateSolidBrush(fgcolour);
+
+ case BS_HATCHED:
+ return CreateHatchBrush(brush->pattern[0], fgcolour);
+
+ case BS_NULL:
+ return (HBRUSH)GetStockObject(NULL_BRUSH);
+
+ case BS_PATTERN:
+ case BS_PATTERN8X8:
+ {
+ uint16 pattern[8];
+
+ for(size_t i = 0; i < 8; ++ i)
+ pattern[i] = brush->pattern[i];
+
+ HBITMAP hpattern = CreateBitmap(8, 8, 1, 1, pattern);
+ HBRUSH hbr = CreatePatternBrush(hpattern);
+ DeleteObject(hpattern);
+ return hbr;
+ }
+
+ DEFAULT_UNREACHABLE;
+ }
+}
+};
+
+/*
+ "sealed" can improve optimizations by asserting a class cannot be derived
+ from, optimizing out accesses to the v-table from inside the class
+*/
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+#define SEALED_ sealed
+#else
+#define SEALED_
+#endif
+
+
+/* Class that implements the RDP client GUI */
+class RdpClientUI
+{
+public:
+ // TODO: pass the client settings relevant to the GUI here
+ HRESULT Initialize(HWND hwndParent)
+ {
+ // TODO: create the various windows
+ // TODO: create display window thread
+ // TODO: create input thread
+ return E_FAIL;
+ }
+
+public:
+ static BOOL Startup()
+ {
+ WNDCLASSEX wcexUI = { sizeof(wcexUI) };
+ WNDCLASSEX wcexConsole = { sizeof(wcexConsole) };
+ WNDCLASSEX wcexDisplay = { sizeof(wcexDisplay) };
+ WNDCLASSEX wcexInput = { sizeof(wcexInput) };
+
+ HBRUSH nullBrush = (HBRUSH)GetStockObject(HOLLOW_BRUSH);
+
+ wcexUI.lpfnWndProc = NULL; // TODO
+ wcexUI.hInstance = GetCurrentModule();
+ wcexUI.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcexUI.hbrBackground = nullBrush;
+ wcexUI.lpszClassName = TEXT("MissTosca_UI");
+
+ wcexConsole.style = CS_VREDRAW | CS_HREDRAW;
+ wcexConsole.lpfnWndProc = NULL; // TODO
+ wcexConsole.hInstance = GetCurrentModule();
+ wcexConsole.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcexConsole.hbrBackground = nullBrush;
+ wcexConsole.lpszClassName = TEXT("MissTosca_Console");
+
+ wcexDisplay.style = CS_VREDRAW | CS_HREDRAW;
+ wcexDisplay.lpfnWndProc = NULL; // TODO
+ wcexDisplay.hInstance = GetCurrentModule();
+ wcexDisplay.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcexDisplay.hbrBackground = nullBrush;
+ wcexDisplay.lpszClassName = TEXT("MissTosca_Display");
+
+ wcexInput.style = CS_VREDRAW | CS_HREDRAW;
+ wcexInput.lpfnWndProc = NULL; // TODO
+ wcexInput.hInstance = GetCurrentModule();
+ wcexInput.hCursor = NULL;
+ wcexInput.hbrBackground = nullBrush;
+ wcexInput.lpszClassName = TEXT("MissTosca_Input");
+
+ return
+ RegisterClassEx(&wcexUI) &&
+ RegisterClassEx(&wcexConsole) &&
+ RegisterClassEx(&wcexDisplay) &&
+ RegisterClassEx(&wcexInput);
+ }
+
+ static void Shutdown()
+ {
+ // TODO
+ }
+
+ /*
+ This is the main UI window. It's the direct child of the control
+ window, it fills its whole extent and it contains the scrollbars.
+ When activated, it will move keyboard focus to the input window
+ */
+private:
+ HWND m_uiWindow;
+ LONG m_scrollHPos;
+ LONG m_scrollVPos;
+
+ LRESULT UIWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
+ {
+ switch(uMsg)
+ {
+ // Keep the keyboard focus on the input window
+ case WM_ACTIVATE:
+ switch(LOWORD(wParam))
+ {
+ case WA_INACTIVE:
+ break;
+
+ case WA_ACTIVE:
+ case WA_CLICKACTIVE:
+ if(!HIWORD(wParam))
+ SetFocus(m_inputWindow);
+ }
+
+ return 0;
+
+ // Resized: rearrange children windows, adjust scrollbars
+ case WM_SIZE:
+ {
+ if(IsIconic(m_uiWindow))
+ break;
+
+ RECT rcClient;
+ GetWindowRect(m_uiWindow, &rcClient);
+
+ if(m_smartSizing)
+ {
+ // we are not supposed to maintain aspect ratio. Container has to do that
+ m_consoleX = 0;
+ m_consoleY = 0;
+ m_consoleWidth = rcClient.right;
+ m_consoleHeight = rcClient.bottom;
+ }
+ else
+ {
+ // center horizontally, no horizontal scrollbar
+ if(rcClient.right >= m_consoleWidth)
+ m_consoleX = (m_consoleWidth - rcClient.right) / 2;
+
+ // center vertically, no vertical scrollbar
+ if(rcClient.bottom >= m_consoleHeight)
+ m_consoleY = (m_consoleHeight - rcClient.right) / 2;
+ }
+
+ SCROLLINFO scroll = { sizeof(scroll), SIF_ALL, 0 };
+
+ // update the horizontal scrollbar
+ scroll.nMax = m_consoleWidth;
+ scroll.nPage = rcClient.right;
+ scroll.nPos = 0 - m_consoleX;
+ SetScrollInfo(m_uiWindow, SB_HORZ, &scroll, TRUE);
+
+ // update the vertical scrollbar
+ scroll.nMax = m_consoleHeight;
+ scroll.nPage = rcClient.bottom;
+ scroll.nPos = 0 - m_consoleY;
+ SetScrollInfo(m_uiWindow, SB_VERT, &scroll, TRUE);
+
+ // move/resize the console window
+ MoveWindow(m_consoleWindow, m_consoleX, m_consoleY, m_consoleWidth, m_consoleHeight, TRUE);
+ }
+
+ return 0;
+
+ case WM_HSCROLL:
+ {
+ SCROLLINFO scroll = { sizeof(scroll), SIF_TRACKPOS };
+ GetScrollInfo(m_uiWindow, SB_HORZ, &scroll);
+ m_consoleX = - scroll.nTrackPos;
+ MoveWindow(m_consoleWindow, m_consoleX, m_consoleY, m_consoleWidth, m_consoleHeight, TRUE);
+ }
+
+ return 0;
+
+ case WM_VSCROLL:
+ {
+ SCROLLINFO scroll = { sizeof(scroll), SIF_TRACKPOS };
+ GetScrollInfo(m_uiWindow, SB_VERT, &scroll);
+ m_consoleY = - scroll.nTrackPos;
+ MoveWindow(m_consoleWindow, m_consoleX, m_consoleY, m_consoleWidth, m_consoleHeight, TRUE);
+ }
+
+ return 0;
+
+ default:
+ break;
+ }
+
+ return DefWindowProc(m_uiWindow, uMsg, wParam, lParam);
+ }
+
+ /*
+ This is the full-screen title bar. It's displayed at the top of the
+ main UI window while in full-screen mode, and it contains two toolbars
+ with the pin, minimize, restore and close buttons
+ */
+ HWND m_fullScreenBarWindow;
+
+ /*
+ This is the console window. It has the same extent as the display on
+ the remote computer, or it fills the UI window in smart resizing mode,
+ and it contains the input and display windows
+ */
+private:
+ HWND m_consoleWindow;
+ LONG m_consoleX;
+ LONG m_consoleY;
+ LONG m_consoleWidth;
+ LONG m_consoleHeight;
+ bool m_smartSizing;
+
+ LRESULT ConsoleWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
+ {
+ switch(uMsg)
+ {
+ case WM_SIZE:
+ {
+ RECT rcClient;
+ GetClientRect(m_consoleWindow, &rcClient);
+
+ MoveWindow(m_inputWindow, 0, 0, rcClient.right, rcClient.bottom, TRUE);
+ MoveWindow(m_displayWindow, 0, 0, rcClient.right, rcClient.bottom, TRUE);
+ }
+
+ return 0;
+
+ default:
+ break;
+ }
+
+ return DefWindowProc(m_consoleWindow, uMsg, wParam, lParam);
+ }
+
+ /*
+ This is the display window. It represents the virtual display of the
+ remote computer. It completely fills its parent, the console window,
+ and it runs in its own thread for performance reasons
+ */
+private:
+ HWND m_displayWindow;
+ LONG m_displayBufferWidth;
+ LONG m_displayBufferHeight;
+ HDC m_displayBuffer;
+ void * m_displayBufferRaw;
+ int m_displayBufferSave;
+ int m_displayBufferBitDepth;
+ int m_displayBufferByteDepth;
+ int m_displayBufferStride;
+ RECT m_displayBufferClip;
+ CRITICAL_SECTION m_displayBufferMutex;
+
+ LRESULT DisplayWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
+ {
+ switch(uMsg)
+ {
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ return 0;
+
+ case WM_PRINTCLIENT:
+ if(wParam == 0)
+ break;
+
+ case WM_PAINT:
+ {
+ HDC hdc = (HDC)wParam;
+
+ EnterCriticalSection(&m_displayBufferMutex);
+
+ if(hdc)
+ {
+ RECT rc;
+ GetClientRect(m_displayWindow, &rc);
+ BitBlt(hdc, 0, 0, rc.right, rc.bottom, m_displayBuffer, 0, 0, SRCCOPY);
+ }
+ else
+ {
+ PAINTSTRUCT ps;
+ hdc = BeginPaint(m_displayWindow, &ps);
+
+ if(!m_smartSizing)
+ {
+ BitBlt
+ (
+ hdc,
+ ps.rcPaint.left,
+ ps.rcPaint.top,
+ ps.rcPaint.right - ps.rcPaint.left,
+ ps.rcPaint.bottom - ps.rcPaint.top,
+ m_displayBuffer,
+ ps.rcPaint.left,
+ ps.rcPaint.top,
+ SRCCOPY
+ );
+ }
+ else
+ {
+ // bleh. There has to be a better way
+ SetStretchBltMode(hdc, HALFTONE);
+
+ StretchBlt
+ (
+ hdc,
+ 0,
+ 0,
+ m_consoleWidth,
+ m_consoleHeight,
+ m_displayBuffer,
+ 0,
+ 0,
+ m_displayBufferWidth,
+ m_displayBufferHeight,
+ SRCCOPY
+ );
+ }
+
+ EndPaint(m_displayWindow, &ps);
+ }
+
+ LeaveCriticalSection(&m_displayBufferMutex);
+ }
+
+ return 0;
+
+ default:
+ break;
+ }
+
+ return DefWindowProc(m_displayWindow, uMsg, wParam, lParam);
+ }
+
+ /* Screen repainting */
+ void Display_RepaintRect(const RECT * lprc)
+ {
+ if(m_smartSizing)
+ return Display_RepaintAll();
+
+ RECT rcDamage;
+ IntersectRect(&rcDamage, lprc, &m_displayBufferClip);
+ InvalidateRect(m_displayWindow, &rcDamage, FALSE);
+ }
+
+ void Display_RepaintArea(int x, int y, int cx, int cy)
+ {
+ if(m_smartSizing)
+ return Display_RepaintAll();
+
+ RECT rcDamage;
+ rcDamage.left = x;
+ rcDamage.top = y;
+ rcDamage.right = x + cx;
+ rcDamage.bottom = y + cy;
+ Display_RepaintRect(&rcDamage);
+ }
+
+ void Display_RepaintPolygon(POINT * point, int npoints, int linewidth)
+ {
+ if(m_smartSizing)
+ return Display_RepaintAll();
+
+ RECT rcDamage;
+
+ rcDamage.left = MAXLONG;
+ rcDamage.top = MAXLONG;
+ rcDamage.right = 0;
+ rcDamage.bottom = 0;
+
+ for(int i = 0; i < npoints; ++ i)
+ {
+ if(point[i].x < rcDamage.left)
+ rcDamage.left = point[i].x;
+
+ if(point[i].y < rcDamage.top)
+ rcDamage.top = point[i].y;
+
+ if(point[i].x > rcDamage.right)
+ rcDamage.right = point[i].x;
+
+ if(point[i].y > rcDamage.bottom)
+ rcDamage.bottom = point[i].y;
+ }
+
+ InflateRect(&rcDamage, linewidth, linewidth);
+ Display_RepaintRect(&rcDamage);
+ }
+
+ void Display_RepaintAll()
+ {
+ InvalidateRgn(m_displayWindow, NULL, FALSE);
+ }
+
+public:
+ void Display_SetClip(int x, int y, int cx, int cy)
+ {
+ m_displayBufferClip.left = x;
+ m_displayBufferClip.top = y;
+ m_displayBufferClip.right = x + cx + 1;
+ m_displayBufferClip.bottom = y + cy + 1;
+
+ HRGN hrgn = CreateRectRgnIndirect(&m_displayBufferClip);
+ SelectClipRgn(m_displayBuffer, hrgn);
+ DeleteObject(hrgn);
+ }
+
+ void Display_ResetClip()
+ {
+ m_displayBufferClip.left = 0;
+ m_displayBufferClip.top = 0;
+ m_displayBufferClip.right = m_displayBufferWidth;
+ m_displayBufferClip.bottom = m_displayBufferHeight;
+ SelectClipRgn(m_displayBuffer, NULL);
+ }
+
+ void Display_PaintBitmap(int x, int y, int cx, int cy, int width, int height, uint8 * data)
+ {
+ GdiFlush();
+
+ int fromstride = alignup(width * m_displayBufferByteDepth, 4);
+ int sizex = cx * m_displayBufferByteDepth;
+
+ const uint8 * src = data;
+
+ uint8 * dst =
+ (uint8 *)m_displayBufferRaw +
+ (m_displayBufferHeight - y - cy) * m_displayBufferStride +
+ x * m_displayBufferByteDepth;
+
+ for(int i = 0; i < cy; ++ i)
+ {
+ memcpy(dst, src, sizex);
+ src += fromstride;
+ dst += m_displayBufferStride;
+ }
+
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ void Display_DestBlt(uint8 opcode, int x, int y, int cx, int cy)
+ {
+ int dcsave = SaveDC(m_displayBuffer);
+ SelectObject(m_displayBuffer, GetStockObject(BLACK_BRUSH));
+ PatBlt(m_displayBuffer, x, y, cx, cy, MAKELONG(0, opcode));
+ RestoreDC(m_displayBuffer, dcsave);
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ void Display_PatBlt(uint8 opcode, int x, int y, int cx, int cy, BRUSH * brush, int bgcolour, int fgcolour)
+ {
+ HBRUSH hbr = win32_create_brush(brush, fgcolour);
+
+ int dcsave = SaveDC(m_displayBuffer);
+
+ SetBkColor(m_displayBuffer, bgcolour);
+ SetTextColor(m_displayBuffer, fgcolour);
+ SetBrushOrgEx(m_displayBuffer, brush->xorigin, brush->yorigin, NULL);
+ SelectObject(m_displayBuffer, hbr);
+
+ PatBlt(m_displayBuffer, x, y, cx, cy, MAKELONG(0, opcode));
+
+ RestoreDC(m_displayBuffer, dcsave);
+
+ DeleteObject(hbr);
+
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ void Display_ScreenBlt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
+ {
+ BitBlt(m_displayBuffer, x, y, cx, cy, m_displayBuffer, srcx, srcy, MAKELONG(0, opcode));
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ void Display_MemBlt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy)
+ {
+ HDC hdcSrc = CreateCompatibleDC(m_displayBuffer);
+ HGDIOBJ hOld = SelectObject(hdcSrc, src);
+
+ BitBlt(m_displayBuffer, x, y, cx, cy, hdcSrc, srcx, srcy, MAKELONG(0, opcode));
+
+ SelectObject(hdcSrc, hOld);
+ DeleteDC(hdcSrc);
+
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ void Display_TriBlt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy, BRUSH * brush, int bgcolour, int fgcolour)
+ {
+ // TODO
+ HDC hdcSrc = CreateCompatibleDC(m_displayBuffer);
+ HGDIOBJ hOld = SelectObject(hdcSrc, src);
+
+ //SELECT_BRUSH(brush, bgcolour, fgcolour);
+
+ BitBlt(m_displayBuffer, x, y, cx, cy, hdcSrc, srcx, srcy, MAKELONG(0, opcode));
+
+ //RESET_BRUSH();
+
+ SelectObject(hdcSrc, hOld);
+ DeleteDC(hdcSrc);
+
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ void Display_Line(uint8 opcode, int startx, int starty, int endx, int endy, PEN * pen)
+ {
+ HPEN hpen = CreatePen(pen->style, pen->width, pen->colour);
+
+ int dcsave = SaveDC(m_displayBuffer);
+
+ SetROP2(m_displayBuffer, opcode);
+ SelectObject(m_displayBuffer, hpen);
+ MoveToEx(m_displayBuffer, startx, starty, NULL);
+
+ LineTo(m_displayBuffer, endx, endy);
+
+ RestoreDC(m_displayBuffer, dcsave);
+
+ DeleteObject(hpen);
+
+ RECT rcDamage;
+
+ if(startx < endx)
+ {
+ rcDamage.left = startx;
+ rcDamage.right = endx;
+ }
+ else
+ {
+ rcDamage.left = endx;
+ rcDamage.right = startx;
+ }
+
+ if(starty < endy)
+ {
+ rcDamage.top = starty;
+ rcDamage.bottom = endy;
+ }
+ else
+ {
+ rcDamage.top = endy;
+ rcDamage.bottom = starty;
+ }
+
+ InflateRect(&rcDamage, pen->width, pen->width);
+ Display_RepaintRect(&rcDamage);
+ }
+
+ void Display_Rect(int x, int y, int cx, int cy, int colour)
+ {
+ HBRUSH hbr = CreateSolidBrush(colour);
+
+ int dcsave = SaveDC(m_displayBuffer);
+
+ SelectObject(m_displayBuffer, hbr);
+ SelectObject(m_displayBuffer, GetStockObject(NULL_PEN));
+
+ Rectangle(m_displayBuffer, x, y, x + cx + 1, y + cy + 1);
+
+ RestoreDC(m_displayBuffer, dcsave);
+
+ DeleteObject(hbr);
+
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ void Display_Polygon(uint8 opcode, uint8 fillmode, POINT * point, int npoints, BRUSH * brush, int bgcolour, int fgcolour)
+ {
+ HBRUSH hbr = win32_create_brush(brush, fgcolour);
+
+ int dcsave = SaveDC(m_displayBuffer);
+
+ SetBkColor(m_displayBuffer, bgcolour);
+ SetTextColor(m_displayBuffer, fgcolour);
+ SetPolyFillMode(m_displayBuffer, fillmode);
+ SelectObject(m_displayBuffer, hbr);
+
+ Polygon(m_displayBuffer, point, npoints);
+
+ RestoreDC(m_displayBuffer, dcsave);
+
+ Display_RepaintPolygon(point, npoints, 0);
+ }
+
+ void Display_Polyline(uint8 opcode, POINT * points, int npoints, PEN * pen)
+ {
+ POINT last = points[0];
+
+ for(int i = 1; i < npoints; ++ i)
+ {
+ points[i].x += last.x;
+ points[i].y += last.y;
+ last = points[i];
+ }
+
+ HPEN hpen = CreatePen(pen->style, pen->width, pen->colour);
+
+ int dcsave = SaveDC(m_displayBuffer);
+
+ SetROP2(m_displayBuffer, opcode);
+ SelectObject(m_displayBuffer, hpen);
+
+ Polyline(m_displayBuffer, points, npoints);
+
+ RestoreDC(m_displayBuffer, dcsave);
+
+ DeleteObject(hpen);
+
+ Display_RepaintPolygon(points, npoints, pen->width);
+ }
+
+ void Display_Ellypse(uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH * brush, int bgcolour, int fgcolour)
+ {
+ // TODO
+
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ // TBD: optimize text drawing
+ void Display_DrawGlyph(int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy, int bgcolour, int fgcolour)
+ {
+ HBITMAP hbmGlyph = (HBITMAP)glyph;
+ HDC hdcGlyph = CreateCompatibleDC(m_displayBuffer);
+ HGDIOBJ hOld = SelectObject(hdcGlyph, hbmGlyph);
+
+ int dcsave = SaveDC(m_displayBuffer);
+
+ switch(mixmode)
+ {
+ case MIX_TRANSPARENT:
+ {
+ /*
+ ROP is DSPDxax:
+ - where the glyph (S) is white, D is set to the foreground color (P)
+ - where the glyph (S) is black, D is left untouched
+
+ This paints a transparent glyph in the specified color
+ */
+ HBRUSH hbr = CreateSolidBrush(fgcolour);
+ SelectObject(m_displayBuffer, hbr);
+ BitBlt(m_displayBuffer, x, y, cx, cy, hdcGlyph, srcx, srcy, MAKELONG(0, 0xe2));
+ DeleteObject(hbr);
+ }
+
+ break;
+
+ case MIX_OPAQUE:
+ {
+ /* Curiously, glyphs are inverted (white-on-black) */
+ SetBkColor(m_displayBuffer, fgcolour);
+ SetTextColor(m_displayBuffer, bgcolour);
+ BitBlt(m_displayBuffer, x, y, cx, cy, hdcGlyph, srcx, srcy, SRCCOPY);
+ }
+
+ break;
+ }
+
+ RestoreDC(m_displayBuffer, dcsave);
+
+ SelectObject(hdcGlyph, hOld);
+ DeleteDC(hdcGlyph);
+
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+ void Display_DoGlyph(uint8 font, uint8 flags, int mixmode, int& x, int& y, int bgcolour, int fgcolour, const uint8 * ttext, int& idx)
+ {
+ FONTGLYPH * glyph;
+
+ glyph = cache_get_font(/*This*/NULL, font, ttext[idx]);
+
+ if(!(flags & TEXT2_IMPLICIT_X))
+ {
+ int xyoffset = ttext[++ idx];
+
+ if((xyoffset & 0x80))
+ {
+ if (flags & TEXT2_VERTICAL)
+ y += ttext[idx + 1] | (ttext[idx + 2] << 8);
+ else
+ x += ttext[idx + 1] | (ttext[idx + 2] << 8);
+
+ idx += 2;
+ }
+ else
+ {
+ if (flags & TEXT2_VERTICAL)
+ y += xyoffset;
+ else
+ x += xyoffset;
+ }
+ }
+
+ if(glyph)
+ {
+ Display_DrawGlyph
+ (
+ mixmode,
+ x + (short)glyph->offset,
+ y + (short)glyph->baseline,
+ glyph->width,
+ glyph->height,
+ glyph->pixmap,
+ 0,
+ 0,
+ bgcolour,
+ fgcolour
+ );
+
+ if(flags & TEXT2_IMPLICIT_X)
+ x += glyph->width;
+ }
+ }
+
+ void Display_DrawText
+ (
+ uint8 font,
+ uint8 flags,
+ uint8 opcode,
+ int mixmode,
+ int x,
+ int y,
+ int clipx,
+ int clipy,
+ int clipcx,
+ int clipcy,
+ int boxx,
+ int boxy,
+ int boxcx,
+ int boxcy,
+ BRUSH * brush,
+ int bgcolour,
+ int fgcolour,
+ uint8 * text,
+ uint8 length
+ )
+ {
+ int i, j;
+ DATABLOB *entry;
+
+ HBRUSH hbr = CreateSolidBrush(bgcolour);
+ HGDIOBJ holdbrush = SelectObject(m_displayBuffer, hbr);
+ HGDIOBJ holdpen = SelectObject(m_displayBuffer, GetStockObject(NULL_PEN));
+
+ if (boxcx > 1)
+ Rectangle(m_displayBuffer, boxx, boxy, boxx + boxcx + 1, boxy + boxcy + 1);
+ else if (mixmode == MIX_OPAQUE)
+ Rectangle(m_displayBuffer, clipx, clipy, clipx + clipcx + 1, clipy + clipcy + 1);
+
+ SelectObject(m_displayBuffer, holdpen);
+ SelectObject(m_displayBuffer, holdbrush);
+
+ DeleteObject(hbr);
+
+ if(boxcx > 1)
+ Display_RepaintArea(boxx, boxy, boxcx, boxcy);
+ else
+ Display_RepaintArea(clipx, clipy, clipcx, clipcy);
+
+ /* Paint text, character by character */
+ for (i = 0; i < length;)
+ {
+ switch (text[i])
+ {
+ case 0xff:
+ /* At least two bytes needs to follow */
+ if (i + 3 > length)
+ {
+ warning("Skipping short 0xff command:");
+ for (j = 0; j < length; j++)
+ fprintf(stderr, "%02x ", text[j]);
+ fprintf(stderr, "\n");
+ i = length = 0;
+ break;
+ }
+ cache_put_text(NULL /* TODO */, text[i + 1], text, text[i + 2]);
+ i += 3;
+ length -= i;
+ /* this will move pointer from start to first character after FF command */
+ text = &(text[i]);
+ i = 0;
+ break;
+
+ case 0xfe:
+ /* At least one byte needs to follow */
+ if (i + 2 > length)
+ {
+ warning("Skipping short 0xfe command:");
+ for (j = 0; j < length; j++)
+ fprintf(stderr, "%02x ", text[j]);
+ fprintf(stderr, "\n");
+ i = length = 0;
+ break;
+ }
+ entry = cache_get_text(/*This*/NULL, text[i + 1]);
+ if (entry->data != NULL)
+ {
+ if ((((uint8 *) (entry->data))[1] == 0)
+ && (!(flags & TEXT2_IMPLICIT_X)) && (i + 2 < length))
+ {
+ if (flags & TEXT2_VERTICAL)
+ y += text[i + 2];
+ else
+ x += text[i + 2];
+ }
+ for (j = 0; j < entry->size; j++)
+ Display_DoGlyph(font, flags, mixmode, x, y, bgcolour, fgcolour, ((uint8 *) (entry->data)), j);
+ }
+ if (i + 2 < length)
+ i += 3;
+ else
+ i += 2;
+ length -= i;
+ /* this will move pointer from start to first character after FE command */
+ text = &(text[i]);
+ i = 0;
+ break;
+
+ default:
+ Display_DoGlyph(font, flags, mixmode, x, y, bgcolour, fgcolour, text, i);
+ i++;
+ break;
+ }
+ }
+ }
+
+ void Display_SaveDesktop(uint32 offset, int x, int y, int cx, int cy)
+ {
+ GdiFlush();
+
+ uint8 * data =
+ (uint8 *)m_displayBufferRaw +
+ x * m_displayBufferByteDepth +
+ (m_displayBufferHeight - y - cy) * m_displayBufferStride;
+
+ cache_put_desktop
+ (
+ /*This*/NULL,
+ offset * m_displayBufferByteDepth,
+ cx,
+ cy,
+ m_displayBufferStride,
+ m_displayBufferByteDepth,
+ data
+ );
+ }
+
+ void Display_RestoreDesktop(uint32 offset, int x, int y, int cx, int cy)
+ {
+ int fromstride = cx * m_displayBufferByteDepth;
+
+ const uint8 * src = cache_get_desktop(/*This*/NULL, offset, cx, cy, m_displayBufferByteDepth);
+
+ uint8 * dst =
+ (uint8 *)m_displayBufferRaw +
+ x * m_displayBufferByteDepth +
+ (m_displayBufferHeight - y - cy) * m_displayBufferStride;
+
+ GdiFlush();
+
+ for(int i = 0; i < cy; ++ i)
+ {
+ memcpy(dst, src, fromstride);
+ src += fromstride;
+ dst += m_displayBufferStride;
+ }
+
+ Display_RepaintArea(x, y, cx, cy);
+ }
+
+
+ void Display_BeginUpdate()
+ {
+ EnterCriticalSection(&m_displayBufferMutex);
+ m_displayBufferSave = SaveDC(m_displayBuffer);
+ }
+
+ void Display_EndUpdate()
+ {
+ RestoreDC(m_displayBuffer, m_displayBufferSave);
+ LeaveCriticalSection(&m_displayBufferMutex);
+ }
+
+ /*
+ This is the input window. It receives the keyboard and mouse input from
+ the user, and it's the only window that can receive the keyboard focus.
+ It completely fills its parent, the console window, and it runs in its
+ own thread for performance reasons and because of technical reasons
+ involving keyboard hooks in full-screen mode
+ */
+ HWND m_inputWindow;
+ HCURSOR m_inputCursor;
+
+ LRESULT InputWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
+ {
+ switch(uMsg)
+ {
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ return 0;
+
+ /* Keyboard stuff */
+ // TODO: we need a good way to post output cross-thread
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_SCANCODE, RDP_KEYPRESS | (lparam & 0x1000000 ? KBD_FLAG_EXT : 0), LOBYTE(HIWORD(lparam)), 0);
+ break;
+
+ case WM_SYSKEYUP:
+ case WM_KEYUP:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_SCANCODE, RDP_KEYRELEASE | (lparam & 0x1000000 ? KBD_FLAG_EXT : 0), LOBYTE(HIWORD(lparam)), 0);
+ break;
+
+ /* Mouse stuff */
+ // Cursor shape
+ case WM_SETCURSOR:
+ if(LOWORD(lParam) == HTCLIENT)
+ {
+ SetCursor(m_inputCursor);
+ return TRUE;
+ }
+
+ break;
+
+ // Movement
+ case WM_MOUSEMOVE:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ // Buttons
+ // TODO: X buttons
+ case WM_LBUTTONDOWN:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_RBUTTONDOWN:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_MBUTTONDOWN:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_LBUTTONUP:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_RBUTTONUP:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_MBUTTONUP:
+ //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ // Wheel
+ case WM_MOUSEWHEEL:
+ //mstsc_mousewheel(This, (SHORT)HIWORD(wparam), lparam);
+ break;
+ }
+
+ return DefWindowProc(m_inputWindow, uMsg, wParam, lParam);
+ }
+
+public:
+};
+
+#pragma warning(push)
+#pragma warning(disable: 4584)
+
+/* The ActiveX control */
+class RdpClient SEALED_:
+ /* COM basics */
+ public IUnknown,
+ public IDispatch,
+
+ /* ActiveX stuff */
+ public IConnectionPointContainer,
+ public IDataObject,
+ public IObjectSafety,
+ public IOleControl,
+ public IOleInPlaceActiveObject,
+ public IOleInPlaceObject,
+ public IOleObject,
+ public IOleWindow,
+ public IPersist,
+ public IPersistPropertyBag,
+ public IPersistStorage,
+ public IPersistStreamInit,
+ public IProvideClassInfo,
+ public IProvideClassInfo2,
+ public IQuickActivate,
+ public IViewObject,
+ public IViewObject2,
+
+ // NOTE: the original has a vestigial, non-functional implementation of this, which we omit
+ // ISpecifyPropertyPages
+
+ // Hidden interfaces, not available through QueryInterface
+ public IConnectionPoint,
+
+ /* RDP client interface */
+ public MSTSCLib::IMsRdpClient4,
+ public MSTSCLib::IMsRdpClientNonScriptable2
+
+ // NOTE: implemented by inner classes due to requiring distinct IDispatch implementations
+ // IMsRdpClientAdvancedSettings4
+ // IMsRdpClientSecuredSettings
+{
+private:
+ /* An endless amount of COM glue */
+ // Reference counting
+ LONG m_refCount;
+
+#ifdef _DEBUG
+ DWORD m_apartmentThreadId;
+
+ bool InsideApartment() const
+ {
+ return GetCurrentThreadId() == m_apartmentThreadId;
+ }
+#endif
+
+ // Aggregation support
+ IUnknown * m_punkOuter;
+
+ class RdpClientInner: public IUnknown
+ {
+ private:
+ RdpClient * Outer()
+ {
+ return InnerToOuter(this);
+ }
+
+ public:
+ virtual STDMETHODIMP IUnknown::QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ return Outer()->queryInterface(riid, ppvObject);
+ }
+
+ virtual STDMETHODIMP_(ULONG) IUnknown::AddRef()
+ {
+ return Outer()->addRef();
+ }
+
+ virtual STDMETHODIMP_(ULONG) IUnknown::Release()
+ {
+ return Outer()->release();
+ }
+
+ }
+ m_inner;
+
+ // Persistence support
+ CLSID m_classId;
+
+ // Late binding support
+ unsigned m_typeLibIndex;
+ ITypeLib * m_typeLib;
+ ITypeInfo * m_dispTypeInfo;
+
+ // Event sinks
+ size_t m_EventSinksCount;
+
+ union
+ {
+ MSTSCLib::IMsTscAxEvents * m_EventSinksStatic[1];
+ MSTSCLib::IMsTscAxEvents ** m_EventSinks;
+ };
+
+ // OLE control glue
+ HWND m_controlWindow;
+ IOleClientSite * m_clientSite;
+ IOleInPlaceSite * m_inPlaceSite;
+ IOleAdviseHolder * m_adviseHolder;
+ LONG m_freezeEvents;
+ bool m_uiActive;
+
+ // UrlMon security
+ DWORD m_SafetyOptions;
+
+ bool IsSafeForScripting() const
+ {
+ return m_SafetyOptions & INTERFACESAFE_FOR_UNTRUSTED_CALLER;
+ }
+
+ /* Glue to interface to rdesktop-core */
+ RdpClientUI * m_clientUI;
+ RDPCLIENT m_protocolState;
+ HANDLE m_protocolThread;
+ HANDLE m_protocolThreadWaitingReconnection;
+ bool m_reconnectAborted;
+ bool m_actuallyConnected;
+ bool m_loggedIn;
+
+ /* Properties */
+ // Storage fields
+ // NOTE: keep sorted by alignment (pointers and handles, integers, enumerations, booleans)
+ BSTR m_Domain;
+ BSTR m_UserName;
+ BSTR m_DisconnectedText;
+ BSTR m_ConnectingText;
+ BSTR m_FullScreenTitle;
+ BSTR m_StartProgram;
+ BSTR m_WorkDir;
+ BSTR m_ConnectedStatusText;
+ BSTR m_ClearTextPassword; // FIXME! dangerous, shouldn't store in cleartext!
+ BSTR m_RdpdrLocalPrintingDocName;
+ BSTR m_RdpdrClipCleanTempDirString;
+ BSTR m_RdpdrClipPasteInfoString;
+ BSTR m_KeyboardLayoutString;
+ LPSTR m_Server;
+ LPSTR m_LoadBalanceInfo;
+ // TODO: plugin DLLs
+ HWND m_UIParentWindowHandle;
+ long m_DesktopWidth;
+ long m_DesktopHeight;
+ long m_StartConnected;
+ long m_ColorDepth;
+ long m_KeyboardHookMode;
+ long m_AudioRedirectionMode;
+ long m_TransportType;
+ long m_SasSequence;
+ long m_RDPPort;
+ long m_HotKeyFullScreen;
+ long m_HotKeyAltEsc;
+ long m_HotKeyAltShiftTab;
+ long m_HotKeyAltSpace;
+ long m_HotKeyAltTab;
+ long m_HotKeyCtrlAltDel;
+ long m_HotKeyCtrlEsc;
+ long m_orderDrawThresold;
+ long m_BitmapCacheSize;
+ long m_BitmapVirtualCacheSize;
+ long m_NumBitmapCaches;
+ long m_brushSupportLevel;
+ long m_minInputSendInterval;
+ long m_InputEventsAtOnce;
+ long m_maxEventCount;
+ long m_keepAliveInternal;
+ long m_shutdownTimeout;
+ long m_overallConnectionTimeout;
+ long m_singleConnectionTimeout;
+ long m_MinutesToIdleTimeout;
+ long m_BitmapVirtualCache16BppSize;
+ long m_BitmapVirtualCache24BppSize;
+ long m_PerformanceFlags;
+ long m_MaxReconnectAttempts;
+ unsigned int m_AuthenticationLevel;
+
+ MSTSCLib::ExtendedDisconnectReasonCode m_ExtendedDisconnectReason;
+
+ bool m_Connected;
+ bool m_Compress;
+ bool m_BitmapPersistence;
+ bool m_allowBackgroundInput;
+ bool m_ContainerHandledFullScreen;
+ bool m_DisableRdpdr;
+ bool m_SecuredSettingsEnabled;
+ bool m_FullScreen;
+ bool m_AcceleratorPassthrough;
+ bool m_ShadowBitmap;
+ bool m_EncryptionEnabled;
+ bool m_DedicatedTerminal;
+ bool m_DisableCtrlAltDel;
+ bool m_EnableWindowsKey;
+ bool m_DoubleClickDetect;
+ bool m_MaximizeShell;
+ bool m_ScaleBitmapCachesByBpp;
+ bool m_CachePersistenceActive;
+ bool m_ConnectToServerConsole;
+ bool m_SmartSizing; // FIXME: this can be set while the control is connected
+ bool m_DisplayConnectionBar;
+ bool m_PinConnectionBar;
+ bool m_GrabFocusOnConnect;
+ bool m_RedirectDrives;
+ bool m_RedirectPrinters;
+ bool m_RedirectPorts;
+ bool m_RedirectSmartCards;
+ bool m_NotifyTSPublicKey;
+ bool m_CanAutoReconnect;
+ bool m_EnableAutoReconnect;
+ bool m_ConnectionBarShowMinimizeButton;
+ bool m_ConnectionBarShowRestoreButton;
+
+ // Generic getters/setters
+ HRESULT GetProperty(BSTR& prop, BSTR * retVal) const
+ {
+ assert(InsideApartment());
+
+ if(retVal == NULL)
+ return E_POINTER;
+
+ *retVal = SysAllocStringLen(prop, SysStringLen(prop));
+
+ if(*retVal == NULL)
+ return E_OUTOFMEMORY;
+
+ return S_OK;
+ }
+
+ HRESULT GetProperty(LPSTR& prop, BSTR * retVal) const
+ {
+ assert(InsideApartment());
+
+ if(retVal == NULL)
+ return E_POINTER;
+
+ *retVal = LpszToBstr(prop);
+
+ if(*retVal == NULL)
+ return E_OUTOFMEMORY;
+
+ return S_OK;
+ }
+
+ HRESULT SetProperty(BSTR& prop, BSTR newValue)
+ {
+ assert(InsideApartment());
+
+ if(m_Connected)
+ return E_FAIL;
+
+ SysFreeString(prop);
+
+ UINT len = SysStringLen(newValue);
+
+ if(len)
+ {
+ // no embedded NULs, please
+ if(len != lstrlenW(newValue))
+ return E_INVALIDARG;
+
+ prop = SysAllocStringLen(newValue, len);
+
+ if(prop == NULL)
+ return E_OUTOFMEMORY;
+ }
+ else
+ prop = NULL;
+
+ return S_OK;
+ }
+
+ HRESULT ReplaceProperty(BSTR& prop, BSTR newValue)
+ {
+ assert(InsideApartment());
+ assert((prop == NULL && newValue == NULL) || prop != newValue);
+
+ SysFreeString(prop);
+ prop = newValue;
+ return S_OK;
+ }
+
+ HRESULT SetProperty(LPSTR& prop, BSTR newValue)
+ {
+ assert(InsideApartment());
+
+ if(m_Connected)
+ return E_FAIL;
+
+ delete[] prop;
+
+ if(SysStringLen(newValue))
+ {
+ prop = BstrToLpsz(newValue);
+
+ if(prop == NULL)
+ return E_OUTOFMEMORY;
+ }
+ else
+ prop = NULL;
+
+ return S_OK;
+ }
+
+ HRESULT ReplaceProperty(LPSTR& prop, LPSTR newValue)
+ {
+ assert(InsideApartment());
+ assert((prop == NULL && newValue == NULL) || prop != newValue);
+
+ if(prop)
+ delete[] prop;
+
+ prop = newValue;
+ return S_OK;
+ }
+
+ template<class Type> HRESULT SetProperty(bool& prop, const Type& newValue)
+ {
+ assert(InsideApartment());
+
+ if(m_Connected)
+ return E_FAIL;
+
+ prop = !!newValue;
+ return S_OK;
+ }
+
+ template<class Type> HRESULT SetProperty(Type& prop, const Type& newValue)
+ {
+ assert(InsideApartment());
+
+ if(m_Connected)
+ return E_FAIL;
+
+ prop = newValue;
+ return S_OK;
+ }
+
+ template<class Type> HRESULT GetProperty(const bool& prop, Type * retVal) const
+ {
+ assert(InsideApartment());
+
+ if(retVal == NULL)
+ return E_POINTER;
+
+ *retVal = prop ? VARIANT_TRUE : VARIANT_FALSE;
+ return S_OK;
+ }
+
+ template<class Type> HRESULT GetProperty(const Type& prop, Type * retVal) const
+ {
+ assert(InsideApartment());
+
+ if(retVal == NULL)
+ return E_POINTER;
+
+ *retVal = prop;
+ return S_OK;
+ }
+
+ /* Events */
+ MSTSCLib::IMsTscAxEvents ** GetSinks() const
+ {
+ if(m_EventSinksCount > 1)
+ return m_EventSinks;
+ else
+ return const_cast<MSTSCLib::IMsTscAxEvents **>(m_EventSinksStatic);
+ }
+
+ // Event freezing
+ void UnfreezeEvents()
+ {
+ // Just in case
+ }
+
+ // Generic event riser & helpers
+ void InvokeSinks(DISPID eventId, VARIANTARG rgvarg[], unsigned int cArgs, VARIANTARG * retval)
+ {
+ assert(InsideApartment());
+
+ DISPPARAMS params;
+
+ params.rgvarg = rgvarg;
+ params.rgdispidNamedArgs = NULL;
+ params.cArgs = cArgs;
+ params.cNamedArgs = 0;
+
+ MSTSCLib::IMsTscAxEvents ** sinks = GetSinks();
+
+ for(size_t i = 0; i < m_EventSinksCount; ++ i)
+ sinks[i]->Invoke(eventId, IID_NULL, 0, DISPATCH_METHOD, ¶ms, retval, NULL, NULL);
+ }
+
+ typedef void (RdpClient::* AsyncEventCallback)
+ (
+ DISPID eventId,
+ VARIANTARG * rgvarg,
+ unsigned int cArgs,
+ VARIANTARG * retVal
+ );
+
+ void CleanupEventArgumentsCallback
+ (
+ DISPID eventId,
+ VARIANTARG * rgvarg,
+ unsigned int cArgs,
+ VARIANTARG * retVal
+ )
+ {
+ assert((rgvarg == NULL) == (cArgs == 0));
+
+ for(unsigned int i = 0; i < cArgs; ++ i)
+ VariantClear(&rgvarg[i]);
+
+ if(retVal)
+ VariantClear(retVal);
+ }
+
+ // synchronous call from inside the apartment that owns the object
+ void FireEventInsideApartment
+ (
+ DISPID eventId,
+ VARIANTARG * rgvarg = NULL,
+ unsigned int cArgs = 0,
+ VARIANTARG * retval = NULL,
+ AsyncEventCallback callback = NULL
+ )
+ {
+ assert(InsideApartment());
+
+ if(retval == NULL && callback)
+ {
+ VARIANTARG localRetval = { };
+ retval = &localRetval;
+ }
+
+ InvokeSinks(eventId, rgvarg, cArgs, retval);
+
+ if(callback)
+ (this->*callback)(eventId, rgvarg, cArgs, retval);
+ }
+
+ struct EventArguments
+ {
+ DISPID eventId;
+ VARIANTARG * rgvarg;
+ unsigned int cArgs;
+ VARIANTARG * retval;
+ AsyncEventCallback callback;
+ };
+
+ struct RedirectArguments
+ {
+ uint32 flags;
+ uint32 server_len;
+ wchar_t * server;
+ uint32 cookie_len;
+ char * cookie;
+ uint32 username_len;
+ wchar_t * username;
+ uint32 domain_len;
+ wchar_t * domain;
+ uint32 password_len;
+ wchar_t * password;
+ };
+
+ enum
+ {
+ RDPC_WM_ = WM_USER,
+ RDPC_WM_SYNC_EVENT,
+ RDPC_WM_ASYNC_EVENT,
+ RDPC_WM_DISCONNECT,
+ RDPC_WM_REQUEST_CLOSE,
+ RDPC_WM_REDIRECT,
+ };
+
+ static VOID CALLBACK DisconnectAPC(ULONG_PTR)
+ {
+ // no need to do anything. The interruption will be enough
+ }
+
+ bool HandleEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result)
+ {
+ result = 0;
+
+ switch(uMsg)
+ {
+ /* Regular event to be dispatched to the container's sink */
+ case RDPC_WM_SYNC_EVENT:
+ assert(InSendMessage());
+
+ case RDPC_WM_ASYNC_EVENT:
+ {
+ const EventArguments * eventArgs = reinterpret_cast<EventArguments *>(lParam);
+ assert(eventArgs);
+
+ FireEventInsideApartment
+ (
+ eventArgs->eventId,
+ eventArgs->rgvarg,
+ eventArgs->cArgs,
+ eventArgs->retval,
+ eventArgs->callback
+ );
+
+ if(uMsg == RDPC_WM_ASYNC_EVENT)
+ delete eventArgs;
+ }
+
+ break;
+
+ /* The protocol thread is about to die: prepare for disconnection */
+ case RDPC_WM_DISCONNECT:
+ {
+ assert(m_Connected);
+ assert(InsideApartment());
+ assert(InSendMessage());
+
+ // Unblock the protocol thread and wait for it to terminate
+ ReplyMessage(0);
+ JoinProtocolThread();
+
+ // Finish disconnecting
+ PerformDisconnect(static_cast<long>(wParam));
+ }
+
+ break;
+
+ case RDPC_WM_REDIRECT:
+ {
+ assert(InSendMessage());
+ assert(lParam);
+ assert(m_Connected);
+ assert(m_protocolState.redirect);
+
+ RedirectArguments * redirectArgs = reinterpret_cast<RedirectArguments *>(lParam);
+
+ // BUGBUG: this is extremely messy and more prone to out-of-memory than it should be
+ LPSTR lpszNewServer = NULL;
+ LPSTR lpszNewCookie = NULL;
+ BSTR strNewUsername = NULL;
+ BSTR strNewDomain = NULL;
+ BSTR strNewPassword = NULL;
+ HRESULT hr = S_OK;
+
+ for(;;)
+ {
+ // Allocate the new properties
+ hr = E_OUTOFMEMORY;
+
+ // FIXME: convert the hostname to Punycode, not the ANSI codepage
+ lpszNewServer = AllocLpsz(redirectArgs->server, redirectArgs->server_len / sizeof(OLECHAR));
+
+ if(lpszNewServer == NULL && redirectArgs->server_len)
+ break;
+
+ lpszNewCookie = AllocLpsz(redirectArgs->cookie, redirectArgs->cookie_len);
+
+ if(lpszNewCookie == NULL && redirectArgs->cookie_len)
+ break;
+
+ strNewUsername = SysAllocStringLen(redirectArgs->username, redirectArgs->username_len / sizeof(OLECHAR));
+
+ if(strNewUsername == NULL && redirectArgs->username_len)
+ break;
+
+ strNewDomain = SysAllocStringLen(redirectArgs->domain, redirectArgs->domain_len / sizeof(OLECHAR));
+
+ if(strNewDomain == NULL && redirectArgs->domain_len)
+ break;
+
+ strNewPassword = SysAllocStringLen(redirectArgs->password, redirectArgs->password_len / sizeof(OLECHAR));
+
+ if(strNewPassword == NULL && redirectArgs->password_len)
+ break;
+
+ hr = S_OK;
+ break;
+ }
+
+ // Success
+ if(SUCCEEDED(hr))
+ {
+ // set the new properties
+ ReplaceProperty(m_Server, lpszNewServer);
+ ReplaceProperty(m_LoadBalanceInfo, lpszNewCookie);
+ ReplaceProperty(m_UserName, strNewUsername);
+ ReplaceProperty(m_Domain, strNewDomain);
+ ReplaceProperty(m_ClearTextPassword, strNewPassword);
+ }
+ // Failure
+ else
+ {
+ // free the buffers
+ FreeLpsz(lpszNewServer);
+ FreeLpsz(lpszNewCookie);
+ SysFreeString(strNewUsername);
+ SysFreeString(strNewDomain);
+ SysFreeString(strNewPassword);
+
+ // signal the error
+ m_protocolState.disconnect_reason = 262;
+ m_protocolState.redirect = False;
+ result = -1;
+ }
+ }
+
+ break;
+
+ // BUGBUG: this could potentially disconnect an unrelated connection established later...
+ case RDPC_WM_REQUEST_CLOSE:
+ {
+ assert(!InSendMessage());
+
+ if(m_Connected)
+ {
+ // Ask confirmation to the container in case we are logged in
+ if(m_loggedIn && !FireConfirmClose())
+ break;
+
+ // For reentrancy (OnConfirmClose could deviously call Disconnect)
+ if(m_protocolThread == NULL)
+ break;
+
+ // Terminate the protocol thread. It will fire the Disconnected event on exit
+ TerminateProtocolThread();
+ }
+ }
+
+ break;
+
+ default:
+ return false;
+ }
+
+ // If the calling thread is blocked, unblock it ASAP
+ if(InSendMessage())
+ ReplyMessage(result);
+
+ return true;
+ }
+
+ // synchronous call from outside the apartment
+ void FireEventOutsideApartment
+ (
+ DISPID eventId,
+ VARIANTARG * rgvarg = NULL,
+ unsigned int cArgs = 0,
+ VARIANTARG * retval = NULL,
+ AsyncEventCallback callback = NULL
+ )
+ {
+ assert(!InsideApartment());
+ EventArguments syncEvent = { eventId, rgvarg, cArgs, retval, callback };
+ SendMessage(m_controlWindow, RDPC_WM_SYNC_EVENT, 0, reinterpret_cast<LPARAM>(&syncEvent));
+ }
+
+ // asynchronous call from outside the apartment
+ HRESULT FireEventOutsideApartmentAsync
+ (
+ DISPID eventId,
+ VARIANTARG * rgvarg = NULL,
+ unsigned int cArgs = 0,
+ VARIANTARG * retval = NULL,
+ AsyncEventCallback callback = NULL
+ )
+ {
+ assert(!InsideApartment());
+
+ EventArguments * asyncEvent = new EventArguments();
+
+ if(asyncEvent == NULL)
+ return E_OUTOFMEMORY;
+
+ asyncEvent->eventId = eventId;
+ asyncEvent->rgvarg = rgvarg;
+ asyncEvent->cArgs = cArgs;
+ asyncEvent->retval = NULL;
+
+ if(!PostMessage(m_controlWindow, RDPC_WM_ASYNC_EVENT, 0, reinterpret_cast<LPARAM>(asyncEvent)))
+ {
+ delete asyncEvent;
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ return S_OK;
+ }
+
+ // Specific events
+ void FireConnecting()
+ {
+ // Source: protocol
+ FireEventOutsideApartment(1);
+ }
+
+ void FireConnected()
+ {
+ // Source: protocol
+ FireEventOutsideApartment(2);
+ }
+
+ void FireLoginComplete()
+ {
+ // Source: protocol
+ FireEventOutsideApartment(3);
+ }
+
+ void FireDisconnected(long reason)
+ {
+ // Source: protocol. Special handling
+ SendMessage(m_controlWindow, RDPC_WM_DISCONNECT, reason, 0);
+ }
+
+ void FireEnterFullScreenMode()
+ {
+ // Source: UI window
+ FireEventInsideApartment(5);
+ }
+
+ void FireLeaveFullScreenMode()
+ {
+ // Source: UI window
+ FireEventInsideApartment(6);
+ }
+
+ HRESULT FireChannelReceivedData(char (& chanName)[CHANNEL_NAME_LEN + 1], void * chanData, unsigned int chanDataSize)
+ {
+ // BUGBUG: what to do when we run out of memory?
+
+ OLECHAR wchanName[ARRAYSIZE(chanName)];
+ std::copy(chanName + 0, chanName + ARRAYSIZE(chanName), wchanName);
+
+ BSTR bstrChanName = SysAllocString(wchanName);
+
+ if(bstrChanName == NULL)
+ return E_OUTOFMEMORY;
+
+ BSTR bstrChanData = SysAllocStringByteLen(NULL, chanDataSize);
+
+ if(bstrChanData == NULL)
+ {
+ SysFreeString(bstrChanName);
+ return E_OUTOFMEMORY;
+ }
+
+ CopyMemory(bstrChanData, chanData, chanDataSize);
+
+ VARIANTARG args[2] = { };
+
+ args[1].vt = VT_BSTR;
+ args[1].bstrVal = bstrChanName;
+
+ args[0].vt = VT_BSTR;
+ args[0].bstrVal = bstrChanData;
+
+ // Source: protocol
+ HRESULT hr = FireEventOutsideApartmentAsync(7, args, ARRAYSIZE(args), NULL, &RdpClient::CleanupEventArgumentsCallback);
+
+ if(FAILED(hr))
+ CleanupEventArgumentsCallback(7, args, ARRAYSIZE(args), NULL);
+
+ return hr;
+ }
+
+ void FireRequestGoFullScreen()
+ {
+ // Source: UI window
+ FireEventInsideApartment(8);
+ }
+
+ void FireRequestLeaveFullScreen()
+ {
+ // Source: UI window
+ FireEventInsideApartment(9);
+ }
+
+ void FireFatalError(long errorCode)
+ {
+ VARIANTARG arg = { };
+
+ arg.vt = VT_I4;
+ arg.lVal = errorCode;
+
+ // Source: protocol
+ FireEventOutsideApartment(10, &arg, 1);
+ }
+
+ void FireFatalErrorFromApartment(long errorCode)
+ {
+ VARIANTARG arg = { };
+
+ arg.vt = VT_I4;
+ arg.lVal = errorCode;
+
+ // Source: control
+ FireEventInsideApartment(10, &arg, 1);
+ }
+
+ void FireWarning(long warningCode)
+ {
+ VARIANTARG arg = { };
+
+ arg.vt = VT_I4;
+ arg.lVal = warningCode;
+
+ // Source: protocol
+ FireEventOutsideApartment(11, &arg, 1);
+ }
+
+ void FireRemoteDesktopSizeChange(long width, long height)
+ {
+ VARIANTARG args[2] = { };
+
+ args[1].vt = VT_I4;
+ args[1].lVal = width;
+
+ args[0].vt = VT_I4;
+ args[0].lVal = height;
+
+ // Source: UI window
+ FireEventInsideApartment(12, args, ARRAYSIZE(args));
+ }
+
+ void FireIdleTimeoutNotification()
+ {
+ // Source: input thread
+ FireEventOutsideApartment(13);
+ }
+
+ void FireRequestContainerMinimize()
+ {
+ // Source: UI window
+ FireEventInsideApartment(14);
+ }
+
+ bool FireConfirmClose()
+ {
+ VARIANTARG retval = { };
+ VARIANT_BOOL allowClose = VARIANT_TRUE;
+
+ retval.vt = VT_BYREF | VT_BOOL;
+ retval.pboolVal = &allowClose;
+
+ // Source: control
+ FireEventInsideApartment(15, NULL, 0, &retval);
+
+ return allowClose != VARIANT_FALSE;
+ }
+
+ HRESULT FireReceivedTSPublicKey(void * publicKey, unsigned int publicKeyLength)
+ {
+ assert(m_Connected);
+
+ if(!m_NotifyTSPublicKey)
+ return S_OK;
+
+ BSTR bstrPublicKey = SysAllocStringByteLen(NULL, publicKeyLength);
+
+ if(bstrPublicKey == NULL)
+ return E_OUTOFMEMORY;
+
+ CopyMemory(bstrPublicKey, publicKey, publicKeyLength);
+
+ VARIANT_BOOL continueLogon = VARIANT_TRUE;
+ VARIANTARG arg = { };
+ VARIANTARG retval = { };
+
+ arg.vt = VT_BSTR;
+ arg.bstrVal = bstrPublicKey;
+
+ retval.vt = VT_BYREF | VT_BOOL;
+ retval.pboolVal = &continueLogon;
+
+ // Source: protocol
+ FireEventOutsideApartment(16, &arg, 1, &retval);
+
+ return continueLogon ? S_OK : S_FALSE;
+ }
+
+ LONG FireAutoReconnecting(long disconnectReason, long attemptCount)
+ {
+ LONG continueStatus = MSTSCLib::autoReconnectContinueAutomatic;
+ VARIANTARG args[2] = { };
+ VARIANTARG retval = { };
+
+ args[1].vt = VT_I4;
+ args[1].lVal = disconnectReason;
+
+ args[0].vt = VT_I4;
+ args[0].lVal = attemptCount;
+
+ retval.vt = VT_BYREF | VT_I4;
+ retval.plVal = &continueStatus;
+
+ // Source: protocol
+ FireEventOutsideApartment(17, args, ARRAYSIZE(args), &retval);
+
+ return continueStatus;
+ }
+
+ void FireAuthenticationWarningDisplayed()
+ {
+ // Source: protocol
+ FireEventOutsideApartment(18);
+ }
+
+ void FireAuthenticationWarningDismissed()
+ {
+ // Source: protocol
+ FireEventOutsideApartment(19);
+ }
+
+ /* Actual IUnknown implementation */
+ HRESULT queryInterface(REFIID riid, void ** ppvObject)
+ {
+ IUnknown * pvObject = NULL;
+
+ using namespace MSTSCLib;
+
+ if(riid == IID_IUnknown)
+ pvObject = static_cast<IUnknown *>(&m_inner);
+ else if(riid == IID_IConnectionPointContainer)
+ pvObject = static_cast<IConnectionPointContainer *>(this);
+ else if(riid == IID_IDataObject)
+ pvObject = static_cast<IDataObject *>(this);
+ else if(riid == IID_IObjectSafety)
+ pvObject = static_cast<IObjectSafety *>(this);
+ else if(riid == IID_IOleControl)
+ pvObject = static_cast<IOleControl *>(this);
+ else if(riid == IID_IOleInPlaceActiveObject)
+ pvObject = static_cast<IOleInPlaceActiveObject *>(this);
+ else if(riid == IID_IOleInPlaceObject)
+ pvObject = static_cast<IOleInPlaceObject *>(this);
+ else if(riid == IID_IOleObject)
+ pvObject = static_cast<IOleObject *>(this);
+ else if(riid == IID_IOleWindow)
+ pvObject = static_cast<IOleWindow *>(this);
+ else if(riid == IID_IPersist)
+ pvObject = static_cast<IPersist *>(this);
+ else if(riid == IID_IPersistPropertyBag)
+ pvObject = static_cast<IPersistPropertyBag *>(this);
+ else if(riid == IID_IPersistStorage)
+ pvObject = static_cast<IPersistStorage *>(this);
+ else if(riid == IID_IPersistStreamInit)
+ pvObject = static_cast<IPersistStreamInit *>(this);
+ else if(riid == IID_IQuickActivate)
+ pvObject = static_cast<IQuickActivate *>(this);
+ else if(riid == IID_IViewObject)
+ pvObject = static_cast<IViewObject *>(this);
+ else if(riid == IID_IViewObject2)
+ pvObject = static_cast<IViewObject2 *>(this);
+ else if(riid == IID_IMsTscAx || riid == MSTSCLib_Redist::IID_IMsTscAx)
+ pvObject = static_cast<IMsTscAx *>(this);
+ else if(riid == IID_IMsRdpClient)
+ pvObject = static_cast<IMsRdpClient *>(this);
+ else if(riid == IID_IMsRdpClient2)
+ pvObject = static_cast<IMsRdpClient2 *>(this);
+ else if(riid == IID_IMsRdpClient3)
+ pvObject = static_cast<IMsRdpClient3 *>(this);
+ else if(riid == IID_IMsRdpClient4)
+ pvObject = static_cast<IMsRdpClient4 *>(this);
+ else if(riid == IID_IMsTscNonScriptable)
+ pvObject = static_cast<IMsTscNonScriptable *>(this);
+ else if(riid == IID_IMsRdpClientNonScriptable)
+ pvObject = static_cast<IMsRdpClientNonScriptable *>(this);
+ else if(riid == IID_IMsRdpClientNonScriptable2)
+ pvObject = static_cast<IMsRdpClientNonScriptable2 *>(this);
+
+ *ppvObject = pvObject;
+
+ if(pvObject)
+ {
+ pvObject->AddRef();
+ return S_OK;
+ }
+
+ return E_NOINTERFACE;
+ }
+
+ ULONG addRef()
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ ULONG release()
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ /* Constructor */
+ RdpClient(REFCLSID classId, unsigned libIndex, IUnknown * punkOuter):
+ // COM/OLE internals
+ m_refCount(0),
+ m_punkOuter(punkOuter),
+ m_classId(classId),
+ m_typeLibIndex(libIndex),
+ m_typeLib(),
+ m_dispTypeInfo(),
+ m_controlWindow(NULL),
+ m_clientSite(),
+ m_inPlaceSite(),
+ m_adviseHolder(),
+ m_freezeEvents(0),
+ m_uiActive(false),
+ m_SafetyOptions(),
+
+#ifdef _DEBUG
+ m_apartmentThreadId(GetCurrentThreadId()),
+#endif
+
+ // rdesktop-core interface
+ m_protocolState(),
+ m_protocolThread(),
+
+ // Properties
+ m_Server(),
+ m_Domain(),
+ m_UserName(),
+ m_DisconnectedText(),
+ m_ConnectingText(),
+ m_FullScreenTitle(),
+ m_StartProgram(),
+ m_WorkDir(),
+ m_LoadBalanceInfo(),
+ m_ConnectedStatusText(),
+ m_ClearTextPassword(),
+ m_RdpdrLocalPrintingDocName(),
+ m_RdpdrClipCleanTempDirString(),
+ m_RdpdrClipPasteInfoString(),
+ m_UIParentWindowHandle(),
+ m_DesktopWidth(),
+ m_DesktopHeight(),
+ m_StartConnected(),
+ m_ColorDepth(16),
+ m_KeyboardHookMode(2),
+ m_AudioRedirectionMode(0),
+ m_TransportType(1), // BUGBUG: ??? what's this ???
+ m_SasSequence(0xAA03), // BUGBUG: ??? what's this ???
+ m_RDPPort(3389),
+ m_HotKeyFullScreen(VK_CANCEL),
+ m_HotKeyAltEsc(VK_INSERT),
+ m_HotKeyAltShiftTab(VK_NEXT),
+ m_HotKeyAltSpace(VK_DELETE),
+ m_HotKeyAltTab(VK_PRIOR),
+ m_HotKeyCtrlAltDel(VK_END),
+ m_HotKeyCtrlEsc(VK_HOME),
+ m_orderDrawThresold(0),
+ m_BitmapCacheSize(1500),
+ m_BitmapVirtualCacheSize(10),
+ m_brushSupportLevel(),
+ m_minInputSendInterval(),
+ m_InputEventsAtOnce(),
+ m_maxEventCount(),
+ m_keepAliveInternal(0),
+ m_shutdownTimeout(10),
+ m_overallConnectionTimeout(120),
+ m_singleConnectionTimeout(30),
+ m_MinutesToIdleTimeout(0),
+ m_BitmapVirtualCache16BppSize(20),
+ m_BitmapVirtualCache24BppSize(30),
+ m_PerformanceFlags(),
+ m_MaxReconnectAttempts(20),
+ m_AuthenticationLevel(0),
+ m_ExtendedDisconnectReason(MSTSCLib::exDiscReasonNoInfo),
+ m_Connected(false),
+ m_Compress(true),
+ m_BitmapPersistence(true),
+ m_allowBackgroundInput(false),
+ m_ContainerHandledFullScreen(false),
+ m_DisableRdpdr(false),
+ m_SecuredSettingsEnabled(true),
+ m_FullScreen(false),
+ m_AcceleratorPassthrough(true),
+ m_ShadowBitmap(true),
+ m_EncryptionEnabled(true),
+ m_DedicatedTerminal(false),
+ m_DisableCtrlAltDel(true),
+ m_EnableWindowsKey(true),
+ m_DoubleClickDetect(false),
+ m_MaximizeShell(true),
+ m_ScaleBitmapCachesByBpp(false),
+ m_CachePersistenceActive(false),
+ m_ConnectToServerConsole(false),
+ m_SmartSizing(false),
+ m_DisplayConnectionBar(true),
+ m_PinConnectionBar(true),
+ m_GrabFocusOnConnect(true),
+ m_RedirectDrives(false),
+ m_RedirectPrinters(false),
+ m_RedirectPorts(false),
+ m_RedirectSmartCards(false),
+ m_NotifyTSPublicKey(false),
+ m_CanAutoReconnect(false),
+ m_EnableAutoReconnect(true),
+ m_ConnectionBarShowMinimizeButton(true),
+ m_ConnectionBarShowRestoreButton(true)
+ {
+ if(m_punkOuter == NULL)
+ m_punkOuter = &m_inner;
+ }
+
+ /* Destructor */
+ ~RdpClient()
+ {
+ assert(m_refCount == 0);
+
+ if(m_Connected)
+ {
+ // Terminate the protocol thread
+ TerminateProtocolThread();
+
+ // Dispatch the RDPC_WM_DISCONNECT message sent by the dying thread
+ MSG msg;
+ PeekMessage(&msg, m_controlWindow, 0, 0, PM_NOREMOVE);
+
+ assert(!m_Connected);
+ }
+
+ DestroyControlWindow();
+
+ if(m_typeLib)
+ m_typeLib->Release();
+
+ if(m_dispTypeInfo)
+ m_dispTypeInfo->Release();
+
+ MSTSCLib::IMsTscAxEvents ** sinks = GetSinks();
+
+ for(size_t i = 0; i < m_EventSinksCount; ++ i)
+ sinks[i]->Release();
+
+ if(m_EventSinksCount > 1)
+ delete[] m_EventSinks;
+
+ if(m_clientSite)
+ m_clientSite->Release();
+
+ if(m_inPlaceSite)
+ m_inPlaceSite->Release();
+
+ if(m_adviseHolder)
+ m_adviseHolder->Release();
+
+ SysFreeString(m_Domain);
+ SysFreeString(m_UserName);
+ SysFreeString(m_DisconnectedText);
+ SysFreeString(m_DisconnectedText);
+ SysFreeString(m_FullScreenTitle);
+ SysFreeString(m_StartProgram);
+ SysFreeString(m_WorkDir);
+ SysFreeString(m_ConnectedStatusText);
+ SysFreeString(m_ClearTextPassword);
+ SysFreeString(m_RdpdrLocalPrintingDocName);
+ SysFreeString(m_RdpdrClipCleanTempDirString);
+ SysFreeString(m_RdpdrClipPasteInfoString);
+
+ FreeLpsz(m_LoadBalanceInfo);
+ FreeLpsz(m_Server);
+
+ unlockServer();
+ }
+
+ /* Advanced settings wrapper */
+ friend class AdvancedSettings;
+
+ class AdvancedSettings SEALED_: public MSTSCLib::IMsRdpClientAdvancedSettings4
+ {
+ private:
+ RdpClient * Outer()
+ {
+ return InnerToOuter(this);
+ }
+
+ const RdpClient * Outer() const
+ {
+ return InnerToOuter(this);
+ }
+
+ /* IDispatch type information */
+ ITypeInfo * m_dispTypeInfo;
+
+ HRESULT LoadDispTypeInfo()
+ {
+ if(m_dispTypeInfo)
+ return S_OK;
+
+ HRESULT hr = Outer()->LoadTypeLibrary();
+
+ if(FAILED(hr))
+ return hr;
+
+ assert(MSTSCLib::IID_IMsRdpClientAdvancedSettings4 == MSTSCLib_Redist::IID_IMsRdpClientAdvancedSettings4);
+
+ hr = Outer()->m_typeLib->GetTypeInfoOfGuid(MSTSCLib::IID_IMsRdpClientAdvancedSettings4, &m_dispTypeInfo);
+
+ if(FAILED(hr))
+ return hr;
+
+ assert(m_dispTypeInfo);
+ return S_OK;
+ }
+
+ HRESULT AcquireDispTypeInfo(ITypeInfo ** ppTI)
+ {
+ HRESULT hr = LoadDispTypeInfo();
+
+ if(FAILED(hr))
+ return hr;
+
+ m_dispTypeInfo->AddRef();
+ *ppTI = m_dispTypeInfo;
+ return S_OK;
+ }
+
+ public:
+ ~AdvancedSettings()
+ {
+ if(m_dispTypeInfo)
+ m_dispTypeInfo->Release();
+ }
+
+ /* IUnknown */
+ virtual STDMETHODIMP IUnknown::QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ using namespace MSTSCLib;
+
+ if
+ (
+ riid == IID_IUnknown ||
+ riid == IID_IDispatch ||
+ riid == IID_IMsTscAdvancedSettings ||
+ riid == IID_IMsRdpClientAdvancedSettings ||
+ riid == IID_IMsRdpClientAdvancedSettings2 ||
+ riid == IID_IMsRdpClientAdvancedSettings3 ||
+ riid == IID_IMsRdpClientAdvancedSettings4
+ )
+ {
+ *ppvObject = this;
+ Outer()->addRef();
+ return S_OK;
+ }
+ else
+ {
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+ }
+
+ virtual STDMETHODIMP_(ULONG) IUnknown::AddRef()
+ {
+ return Outer()->addRef();
+ }
+
+ virtual STDMETHODIMP_(ULONG) IUnknown::Release()
+ {
+ return Outer()->release();
+ }
+
+ /* IDispatch */
+ virtual STDMETHODIMP IDispatch::GetTypeInfoCount(UINT * pctinfo)
+ {
+ *pctinfo = 1;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IDispatch::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo)
+ {
+ if(iTInfo != 0)
+ return DISP_E_BADINDEX;
+
+ return AcquireDispTypeInfo(ppTInfo);
+ }
+
+ virtual STDMETHODIMP IDispatch::GetIDsOfNames(REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId)
+ {
+ HRESULT hr = LoadDispTypeInfo();
+
+ if(FAILED(hr))
+ return hr;
+
+ return m_dispTypeInfo->GetIDsOfNames(rgszNames, cNames, rgDispId);
+ }
+
+ virtual STDMETHODIMP IDispatch::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr)
+ {
+ return m_dispTypeInfo->Invoke
+ (
+ static_cast<MSTSCLib::IMsRdpClientAdvancedSettings4 *>(this),
+ dispIdMember,
+ wFlags,
+ pDispParams,
+ pVarResult,
+ pExcepInfo,
+ puArgErr
+ );
+ }
+
+ /* IMsTscAdvancedSettings */
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_Compress(long pcompress)
+ {
+ return Outer()->SetProperty(Outer()->m_Compress, pcompress);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_Compress(long * pcompress) const
+ {
+ return Outer()->GetProperty(Outer()->m_Compress, pcompress);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_BitmapPeristence(long pbitmapPeristence)
+ {
+ return Outer()->SetProperty(Outer()->m_BitmapPersistence, pbitmapPeristence);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_BitmapPeristence(long * pbitmapPeristence) const
+ {
+ return Outer()->GetProperty(Outer()->m_BitmapPersistence, pbitmapPeristence);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_allowBackgroundInput(long pallowBackgroundInput)
+ {
+ if(Outer()->IsSafeForScripting())
+ return S_FALSE;
+
+ return Outer()->SetProperty(Outer()->m_allowBackgroundInput, pallowBackgroundInput);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_allowBackgroundInput(long * pallowBackgroundInput) const
+ {
+ return Outer()->GetProperty(Outer()->m_allowBackgroundInput, pallowBackgroundInput);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_KeyBoardLayoutStr(BSTR rhs)
+ {
+ return Outer()->SetProperty(Outer()->m_KeyboardLayoutString, rhs);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_PluginDlls(BSTR rhs)
+ {
+ // TODO: split rhs into an array
+
+ // Control marked safe for scripting: only allow filenames
+ if(Outer()->IsSafeForScripting())
+ {
+ // TODO: validate entries
+ // TODO: replace each entry with a full path based on the Virtual Channel DLL path
+ }
+
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_IconFile(BSTR rhs)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_IconIndex(long rhs)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_ContainerHandledFullScreen(long pContainerHandledFullScreen)
+ {
+ if(Outer()->IsSafeForScripting())
+ return S_FALSE;
+
+ return Outer()->SetProperty(Outer()->m_ContainerHandledFullScreen, pContainerHandledFullScreen);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_ContainerHandledFullScreen(long * pContainerHandledFullScreen) const
+ {
+ return Outer()->GetProperty(Outer()->m_ContainerHandledFullScreen, pContainerHandledFullScreen);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::put_DisableRdpdr(long pDisableRdpdr)
+ {
+ return Outer()->SetProperty(Outer()->m_DisableRdpdr, pDisableRdpdr);
+ }
+
+ virtual STDMETHODIMP IMsTscAdvancedSettings::get_DisableRdpdr(long * pDisableRdpdr) const
+ {
+ return Outer()->GetProperty(Outer()->m_DisableRdpdr, pDisableRdpdr);
+ }
+
+ /* IMsRdpClientAdvancedSettings */
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_SmoothScroll(long psmoothScroll)
+ {
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_SmoothScroll(long * psmoothScroll) const
+ {
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_AcceleratorPassthrough(long pacceleratorPassthrough)
+ {
+ return Outer()->SetProperty(Outer()->m_AcceleratorPassthrough, pacceleratorPassthrough);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_AcceleratorPassthrough(long * pacceleratorPassthrough) const
+ {
+ return Outer()->GetProperty(Outer()->m_AcceleratorPassthrough, pacceleratorPassthrough);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ShadowBitmap(long pshadowBitmap)
+ {
+ return Outer()->SetProperty(Outer()->m_ShadowBitmap, pshadowBitmap);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_ShadowBitmap(long * pshadowBitmap) const
+ {
+ return Outer()->GetProperty(Outer()->m_ShadowBitmap, pshadowBitmap);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_TransportType(long ptransportType)
+ {
+ // Reserved
+ return Outer()->SetProperty(Outer()->m_TransportType, ptransportType);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_TransportType(long * ptransportType) const
+ {
+ // Reserved
+ return Outer()->GetProperty(Outer()->m_TransportType, ptransportType);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_SasSequence(long psasSequence)
+ {
+ // Reserved
+ return Outer()->SetProperty(Outer()->m_SasSequence, psasSequence);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_SasSequence(long * psasSequence) const
+ {
+ // Reserved
+ return Outer()->GetProperty(Outer()->m_SasSequence, psasSequence);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_EncryptionEnabled(long pencryptionEnabled)
+ {
+ return Outer()->SetProperty(Outer()->m_EncryptionEnabled, pencryptionEnabled);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_EncryptionEnabled(long * pencryptionEnabled) const
+ {
+ return Outer()->GetProperty(Outer()->m_EncryptionEnabled, pencryptionEnabled);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_DedicatedTerminal(long pdedicatedTerminal)
+ {
+ return Outer()->SetProperty(Outer()->m_DedicatedTerminal, pdedicatedTerminal);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_DedicatedTerminal(long * pdedicatedTerminal) const
+ {
+ return Outer()->GetProperty(Outer()->m_DedicatedTerminal, pdedicatedTerminal);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RDPPort(long prdpPort)
+ {
+ if(prdpPort == 0 || prdpPort > 65535)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_RDPPort, prdpPort);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RDPPort(long * prdpPort) const
+ {
+ return Outer()->GetProperty(Outer()->m_RDPPort, prdpPort);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_EnableMouse(long penableMouse)
+ {
+ return S_FALSE; // TBD? implement?
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_EnableMouse(long * penableMouse) const
+ {
+ return S_FALSE; // TBD? implement?
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_DisableCtrlAltDel(long pdisableCtrlAltDel)
+ {
+ return Outer()->SetProperty(Outer()->m_DisableCtrlAltDel, pdisableCtrlAltDel);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_DisableCtrlAltDel(long * pdisableCtrlAltDel) const
+ {
+ return Outer()->GetProperty(Outer()->m_DisableCtrlAltDel, pdisableCtrlAltDel);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_EnableWindowsKey(long penableWindowsKey)
+ {
+ return Outer()->SetProperty(Outer()->m_EnableWindowsKey, penableWindowsKey);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_EnableWindowsKey(long * penableWindowsKey) const
+ {
+ return Outer()->GetProperty(Outer()->m_EnableWindowsKey, penableWindowsKey);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_DoubleClickDetect(long pdoubleClickDetect)
+ {
+ return Outer()->SetProperty(Outer()->m_DoubleClickDetect, pdoubleClickDetect);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_DoubleClickDetect(long * pdoubleClickDetect) const
+ {
+ return Outer()->GetProperty(Outer()->m_DoubleClickDetect, pdoubleClickDetect);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_MaximizeShell(long pmaximizeShell)
+ {
+ return Outer()->SetProperty(Outer()->m_MaximizeShell, pmaximizeShell);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_MaximizeShell(long * pmaximizeShell) const
+ {
+ return Outer()->GetProperty(Outer()->m_MaximizeShell, pmaximizeShell);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyFullScreen(long photKeyFullScreen)
+ {
+ return Outer()->SetProperty(Outer()->m_HotKeyFullScreen, photKeyFullScreen);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyFullScreen(long * photKeyFullScreen) const
+ {
+ return Outer()->GetProperty(Outer()->m_HotKeyFullScreen, photKeyFullScreen);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyCtrlEsc(long photKeyCtrlEsc)
+ {
+ return Outer()->SetProperty(Outer()->m_HotKeyCtrlEsc, photKeyCtrlEsc);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyCtrlEsc(long * photKeyCtrlEsc) const
+ {
+ return Outer()->GetProperty(Outer()->m_HotKeyCtrlEsc, photKeyCtrlEsc);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyAltEsc(long photKeyAltEsc)
+ {
+ return Outer()->SetProperty(Outer()->m_HotKeyAltEsc, photKeyAltEsc);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyAltEsc(long * photKeyAltEsc) const
+ {
+ return Outer()->GetProperty(Outer()->m_HotKeyAltEsc, photKeyAltEsc);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyAltTab(long photKeyAltTab)
+ {
+ return Outer()->SetProperty(Outer()->m_HotKeyAltTab, photKeyAltTab);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyAltTab(long * photKeyAltTab) const
+ {
+ return Outer()->GetProperty(Outer()->m_HotKeyAltTab, photKeyAltTab);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyAltShiftTab(long photKeyAltShiftTab)
+ {
+ return Outer()->SetProperty(Outer()->m_HotKeyAltShiftTab, photKeyAltShiftTab);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyAltShiftTab(long * photKeyAltShiftTab) const
+ {
+ return Outer()->GetProperty(Outer()->m_HotKeyAltShiftTab, photKeyAltShiftTab);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyAltSpace(long photKeyAltSpace)
+ {
+ return Outer()->SetProperty(Outer()->m_HotKeyAltSpace, photKeyAltSpace);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyAltSpace(long * photKeyAltSpace) const
+ {
+ return Outer()->GetProperty(Outer()->m_HotKeyAltSpace, photKeyAltSpace);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_HotKeyCtrlAltDel(long photKeyCtrlAltDel)
+ {
+ return Outer()->SetProperty(Outer()->m_HotKeyCtrlAltDel, photKeyCtrlAltDel);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_HotKeyCtrlAltDel(long * photKeyCtrlAltDel) const
+ {
+ return Outer()->GetProperty(Outer()->m_HotKeyCtrlAltDel, photKeyCtrlAltDel);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_orderDrawThreshold(long porderDrawThreshold)
+ {
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_orderDrawThreshold(long * porderDrawThreshold) const
+ {
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapCacheSize(long pbitmapCacheSize)
+ {
+ // NOTE: the upper bound of "32" for a field with a default value of 1500 seems to be a bug
+ if(pbitmapCacheSize < 0 || pbitmapCacheSize > 32)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_BitmapCacheSize, pbitmapCacheSize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapCacheSize(long * pbitmapCacheSize) const
+ {
+ return Outer()->GetProperty(Outer()->m_BitmapCacheSize, pbitmapCacheSize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapVirtualCacheSize(long pbitmapVirtualCacheSize)
+ {
+ if(pbitmapVirtualCacheSize < 0 || pbitmapVirtualCacheSize > 32)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_BitmapVirtualCacheSize, pbitmapVirtualCacheSize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapVirtualCacheSize(long * pbitmapVirtualCacheSize) const
+ {
+ return Outer()->GetProperty(Outer()->m_BitmapVirtualCacheSize, pbitmapVirtualCacheSize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ScaleBitmapCachesByBPP(long pbScale)
+ {
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_ScaleBitmapCachesByBPP(long * pbScale) const
+ {
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_NumBitmapCaches(long pnumBitmapCaches)
+ {
+ return Outer()->SetProperty(Outer()->m_NumBitmapCaches, pnumBitmapCaches);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_NumBitmapCaches(long * pnumBitmapCaches) const
+ {
+ return Outer()->GetProperty(Outer()->m_NumBitmapCaches, pnumBitmapCaches);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_CachePersistenceActive(long pcachePersistenceActive)
+ {
+ return Outer()->SetProperty(Outer()->m_CachePersistenceActive, pcachePersistenceActive);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_CachePersistenceActive(long * pcachePersistenceActive) const
+ {
+ return Outer()->GetProperty(Outer()->m_CachePersistenceActive, pcachePersistenceActive);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_PersistCacheDirectory(BSTR rhs)
+ {
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_brushSupportLevel(long pbrushSupportLevel)
+ {
+ return Outer()->SetProperty(Outer()->m_brushSupportLevel, pbrushSupportLevel);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_brushSupportLevel(long * pbrushSupportLevel) const
+ {
+ return Outer()->GetProperty(Outer()->m_brushSupportLevel, pbrushSupportLevel);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_minInputSendInterval(long pminInputSendInterval)
+ {
+ // TODO
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_minInputSendInterval(long * pminInputSendInterval) const
+ {
+ // TODO
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_InputEventsAtOnce(long pinputEventsAtOnce)
+ {
+ // TODO
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_InputEventsAtOnce(long * pinputEventsAtOnce) const
+ {
+ // TODO
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_maxEventCount(long pmaxEventCount)
+ {
+ // TODO
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_maxEventCount(long * pmaxEventCount) const
+ {
+ // TODO
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_keepAliveInterval(long pkeepAliveInterval)
+ {
+ if(pkeepAliveInterval && pkeepAliveInterval < 10)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_keepAliveInternal, pkeepAliveInterval);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_keepAliveInterval(long * pkeepAliveInterval) const
+ {
+ return Outer()->GetProperty(Outer()->m_keepAliveInternal, pkeepAliveInterval);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_shutdownTimeout(long pshutdownTimeout)
+ {
+ if(pshutdownTimeout >= 600)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_shutdownTimeout, pshutdownTimeout);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_shutdownTimeout(long * pshutdownTimeout) const
+ {
+ return Outer()->GetProperty(Outer()->m_shutdownTimeout, pshutdownTimeout);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_overallConnectionTimeout(long poverallConnectionTimeout)
+ {
+ if(poverallConnectionTimeout < 0 || poverallConnectionTimeout >= 600)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_overallConnectionTimeout, poverallConnectionTimeout);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_overallConnectionTimeout(long * poverallConnectionTimeout) const
+ {
+ return Outer()->GetProperty(Outer()->m_overallConnectionTimeout, poverallConnectionTimeout);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_singleConnectionTimeout(long psingleConnectionTimeout)
+ {
+ if(psingleConnectionTimeout >= 600)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_singleConnectionTimeout, psingleConnectionTimeout);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_singleConnectionTimeout(long * psingleConnectionTimeout) const
+ {
+ return Outer()->GetProperty(Outer()->m_singleConnectionTimeout, psingleConnectionTimeout);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_KeyboardType(long pkeyboardType)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_KeyboardType(long * pkeyboardType) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_KeyboardSubType(long pkeyboardSubType)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_KeyboardSubType(long * pkeyboardSubType) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_KeyboardFunctionKey(long pkeyboardFunctionKey)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_KeyboardFunctionKey(long * pkeyboardFunctionKey) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_WinceFixedPalette(long pwinceFixedPalette)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_WinceFixedPalette(long * pwinceFixedPalette) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ConnectToServerConsole(VARIANT_BOOL pConnectToConsole)
+ {
+ return Outer()->SetProperty(Outer()->m_ConnectToServerConsole, pConnectToConsole);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_ConnectToServerConsole(VARIANT_BOOL * pConnectToConsole) const
+ {
+ return Outer()->GetProperty(Outer()->m_ConnectToServerConsole, pConnectToConsole);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapPersistence(long pbitmapPersistence)
+ {
+ return put_BitmapPeristence(pbitmapPersistence);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapPersistence(long * pbitmapPersistence) const
+ {
+ return get_BitmapPeristence(pbitmapPersistence);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_MinutesToIdleTimeout(long pminutesToIdleTimeout)
+ {
+ if(pminutesToIdleTimeout > 240)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_MinutesToIdleTimeout, pminutesToIdleTimeout);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_MinutesToIdleTimeout(long * pminutesToIdleTimeout) const
+ {
+ return Outer()->GetProperty(Outer()->m_MinutesToIdleTimeout, pminutesToIdleTimeout);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_SmartSizing(VARIANT_BOOL pfSmartSizing)
+ {
+ return Outer()->SetProperty(Outer()->m_SmartSizing, pfSmartSizing);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_SmartSizing(VARIANT_BOOL * pfSmartSizing) const
+ {
+ return Outer()->GetProperty(Outer()->m_SmartSizing, pfSmartSizing);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RdpdrLocalPrintingDocName(BSTR pLocalPrintingDocName)
+ {
+ return Outer()->SetProperty(Outer()->m_RdpdrLocalPrintingDocName, pLocalPrintingDocName);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RdpdrLocalPrintingDocName(BSTR * pLocalPrintingDocName) const
+ {
+ return Outer()->GetProperty(Outer()->m_RdpdrLocalPrintingDocName, pLocalPrintingDocName);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RdpdrClipCleanTempDirString(BSTR clipCleanTempDirString)
+ {
+ return Outer()->SetProperty(Outer()->m_RdpdrClipCleanTempDirString, clipCleanTempDirString);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RdpdrClipCleanTempDirString(BSTR * clipCleanTempDirString) const
+ {
+ return Outer()->GetProperty(Outer()->m_RdpdrClipCleanTempDirString, clipCleanTempDirString);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RdpdrClipPasteInfoString(BSTR clipPasteInfoString)
+ {
+ return Outer()->SetProperty(Outer()->m_RdpdrClipPasteInfoString, clipPasteInfoString);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RdpdrClipPasteInfoString(BSTR * clipPasteInfoString) const
+ {
+ return Outer()->GetProperty(Outer()->m_RdpdrClipPasteInfoString, clipPasteInfoString);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ClearTextPassword(BSTR rhs)
+ {
+ return Outer()->put_ClearTextPassword(rhs);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_DisplayConnectionBar(VARIANT_BOOL pDisplayConnectionBar)
+ {
+ if(!pDisplayConnectionBar && Outer()->IsSafeForScripting())
+ return E_FAIL;
+
+ return Outer()->SetProperty(Outer()->m_DisplayConnectionBar, pDisplayConnectionBar);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_DisplayConnectionBar(VARIANT_BOOL * pDisplayConnectionBar) const
+ {
+ return Outer()->GetProperty(Outer()->m_DisplayConnectionBar, pDisplayConnectionBar);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_PinConnectionBar(VARIANT_BOOL pPinConnectionBar)
+ {
+ if(Outer()->IsSafeForScripting())
+ return E_NOTIMPL;
+
+ return Outer()->SetProperty(Outer()->m_PinConnectionBar, pPinConnectionBar);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_PinConnectionBar(VARIANT_BOOL * pPinConnectionBar) const
+ {
+ return Outer()->GetProperty(Outer()->m_PinConnectionBar, pPinConnectionBar);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_GrabFocusOnConnect(VARIANT_BOOL pfGrabFocusOnConnect)
+ {
+ return Outer()->SetProperty(Outer()->m_GrabFocusOnConnect, pfGrabFocusOnConnect);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_GrabFocusOnConnect(VARIANT_BOOL * pfGrabFocusOnConnect) const
+ {
+ return Outer()->GetProperty(Outer()->m_GrabFocusOnConnect, pfGrabFocusOnConnect);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_LoadBalanceInfo(BSTR pLBInfo)
+ {
+ return Outer()->SetProperty(Outer()->m_LoadBalanceInfo, pLBInfo);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_LoadBalanceInfo(BSTR * pLBInfo) const
+ {
+ return Outer()->GetProperty(Outer()->m_LoadBalanceInfo, pLBInfo);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RedirectDrives(VARIANT_BOOL pRedirectDrives)
+ {
+ return Outer()->SetProperty(Outer()->m_RedirectDrives, pRedirectDrives);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RedirectDrives(VARIANT_BOOL * pRedirectDrives) const
+ {
+ return Outer()->GetProperty(Outer()->m_RedirectDrives, pRedirectDrives);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RedirectPrinters(VARIANT_BOOL pRedirectPrinters)
+ {
+ return Outer()->SetProperty(Outer()->m_RedirectPrinters, pRedirectPrinters);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RedirectPrinters(VARIANT_BOOL * pRedirectPrinters) const
+ {
+ return Outer()->GetProperty(Outer()->m_RedirectPrinters, pRedirectPrinters);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RedirectPorts(VARIANT_BOOL pRedirectPorts)
+ {
+ return Outer()->SetProperty(Outer()->m_RedirectPorts, pRedirectPorts);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RedirectPorts(VARIANT_BOOL * pRedirectPorts) const
+ {
+ return Outer()->GetProperty(Outer()->m_RedirectPorts, pRedirectPorts);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_RedirectSmartCards(VARIANT_BOOL pRedirectSmartCards)
+ {
+ return Outer()->SetProperty(Outer()->m_RedirectSmartCards, pRedirectSmartCards);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_RedirectSmartCards(VARIANT_BOOL * pRedirectSmartCards) const
+ {
+ return Outer()->GetProperty(Outer()->m_RedirectSmartCards, pRedirectSmartCards);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapVirtualCache16BppSize(long pBitmapVirtualCache16BppSize)
+ {
+ if(pBitmapVirtualCache16BppSize < 0 || pBitmapVirtualCache16BppSize > 32)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_BitmapVirtualCache16BppSize, pBitmapVirtualCache16BppSize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapVirtualCache16BppSize(long * pBitmapVirtualCache16BppSize) const
+ {
+ return Outer()->GetProperty(Outer()->m_BitmapVirtualCache16BppSize, pBitmapVirtualCache16BppSize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_BitmapVirtualCache24BppSize(long pBitmapVirtualCache24BppSize)
+ {
+ if(pBitmapVirtualCache24BppSize < 0 || pBitmapVirtualCache24BppSize > 32)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_BitmapVirtualCache24BppSize, pBitmapVirtualCache24BppSize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_BitmapVirtualCache24BppSize(long * pBitmapVirtualCache24BppSize) const
+ {
+ return Outer()->GetProperty(Outer()->m_BitmapVirtualCache24BppSize, pBitmapVirtualCache24BppSize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_PerformanceFlags(long pDisableList)
+ {
+ return Outer()->SetProperty(Outer()->m_PerformanceFlags, pDisableList);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_PerformanceFlags(long * pDisableList) const
+ {
+ return Outer()->GetProperty(Outer()->m_PerformanceFlags, pDisableList);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_ConnectWithEndpoint(VARIANT * rhs)
+ {
+ // TBD? the Microsoft client implements this, but what does it mean?
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::put_NotifyTSPublicKey(VARIANT_BOOL pfNotify)
+ {
+ return Outer()->SetProperty(Outer()->m_NotifyTSPublicKey, pfNotify);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings::get_NotifyTSPublicKey(VARIANT_BOOL * pfNotify) const
+ {
+ return Outer()->GetProperty(Outer()->m_NotifyTSPublicKey, pfNotify);
+ }
+
+ /* IMsRdpClientAdvancedSettings2 */
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::get_CanAutoReconnect(VARIANT_BOOL * pfCanAutoReconnect) const
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::put_EnableAutoReconnect(VARIANT_BOOL pfEnableAutoReconnect)
+ {
+ return Outer()->SetProperty(Outer()->m_EnableAutoReconnect, pfEnableAutoReconnect);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::get_EnableAutoReconnect(VARIANT_BOOL * pfEnableAutoReconnect) const
+ {
+ return Outer()->GetProperty(Outer()->m_EnableAutoReconnect, pfEnableAutoReconnect);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::put_MaxReconnectAttempts(long pMaxReconnectAttempts)
+ {
+ if(pMaxReconnectAttempts < 0 || pMaxReconnectAttempts > 200)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_MaxReconnectAttempts, pMaxReconnectAttempts);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings2::get_MaxReconnectAttempts(long * pMaxReconnectAttempts) const
+ {
+ return Outer()->GetProperty(Outer()->m_MaxReconnectAttempts, pMaxReconnectAttempts);
+ }
+
+ /* IMsRdpClientAdvancedSettings3 */
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings3::put_ConnectionBarShowMinimizeButton(VARIANT_BOOL pfShowMinimize)
+ {
+ return Outer()->SetProperty(Outer()->m_ConnectionBarShowMinimizeButton, pfShowMinimize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings3::get_ConnectionBarShowMinimizeButton(VARIANT_BOOL * pfShowMinimize) const
+ {
+ return Outer()->GetProperty(Outer()->m_ConnectionBarShowMinimizeButton, pfShowMinimize);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings3::put_ConnectionBarShowRestoreButton(VARIANT_BOOL pfShowRestore)
+ {
+ return Outer()->SetProperty(Outer()->m_ConnectionBarShowRestoreButton, pfShowRestore);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings3::get_ConnectionBarShowRestoreButton(VARIANT_BOOL * pfShowRestore) const
+ {
+ return Outer()->GetProperty(Outer()->m_ConnectionBarShowRestoreButton, pfShowRestore);
+ }
+
+ /* IMsRdpClientAdvancedSettings4 */
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings4::put_AuthenticationLevel(unsigned int puiAuthLevel)
+ {
+ // TODO: this isn't implemented in rdesktop yet...
+ return Outer()->SetProperty(Outer()->m_AuthenticationLevel, puiAuthLevel);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientAdvancedSettings4::get_AuthenticationLevel(unsigned int * puiAuthLevel) const
+ {
+ return Outer()->GetProperty(Outer()->m_AuthenticationLevel, puiAuthLevel);
+ }
+ }
+ m_advancedSettings;
+
+ template<class Interface> HRESULT GetAdvancedSettings(Interface ** ppAdvSettings)
+ {
+ addRef();
+ *ppAdvSettings = &m_advancedSettings;
+ return S_OK;
+ }
+
+ /* Secured settings wrapper */
+ friend class SecuredSettings;
+
+ class SecuredSettings SEALED_: public MSTSCLib::IMsRdpClientSecuredSettings
+ {
+ private:
+ RdpClient * Outer()
+ {
+ return InnerToOuter(this);
+ }
+
+ const RdpClient * Outer() const
+ {
+ return InnerToOuter(this);
+ }
+
+ /* IDispatch type information */
+ ITypeInfo * m_dispTypeInfo;
+
+ HRESULT LoadDispTypeInfo()
+ {
+ if(m_dispTypeInfo)
+ return S_OK;
+
+ HRESULT hr = Outer()->LoadTypeLibrary();
+
+ if(FAILED(hr))
+ return hr;
+
+ assert(MSTSCLib::IID_IMsRdpClientSecuredSettings == MSTSCLib_Redist::IID_IMsRdpClientSecuredSettings);
+
+ hr = Outer()->m_typeLib->GetTypeInfoOfGuid(MSTSCLib::IID_IMsRdpClientSecuredSettings, &m_dispTypeInfo);
+
+ if(FAILED(hr))
+ return hr;
+
+ assert(m_dispTypeInfo);
+ return S_OK;
+ }
+
+ HRESULT AcquireDispTypeInfo(ITypeInfo ** ppTI)
+ {
+ HRESULT hr = LoadDispTypeInfo();
+
+ if(FAILED(hr))
+ return hr;
+
+ m_dispTypeInfo->AddRef();
+ *ppTI = m_dispTypeInfo;
+ return S_OK;
+ }
+
+ public:
+ ~SecuredSettings()
+ {
+ if(m_dispTypeInfo)
+ m_dispTypeInfo->Release();
+ }
+
+ /* IUnknown */
+ virtual STDMETHODIMP IUnknown::QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ using namespace MSTSCLib;
+
+ if
+ (
+ riid == IID_IUnknown ||
+ riid == IID_IDispatch ||
+ riid == IID_IMsTscSecuredSettings ||
+ riid == IID_IMsRdpClientSecuredSettings
+ )
+ {
+ *ppvObject = this;
+ Outer()->addRef();
+ return S_OK;
+ }
+ else
+ {
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+ }
+
+ virtual STDMETHODIMP_(ULONG) IUnknown::AddRef()
+ {
+ return Outer()->addRef();
+ }
+
+ virtual STDMETHODIMP_(ULONG) IUnknown::Release()
+ {
+ return Outer()->release();
+ }
+
+ /* IDispatch */
+ virtual STDMETHODIMP IDispatch::GetTypeInfoCount(UINT * pctinfo)
+ {
+ *pctinfo = 1;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IDispatch::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo)
+ {
+ if(iTInfo != 0)
+ return DISP_E_BADINDEX;
+
+ return AcquireDispTypeInfo(ppTInfo);
+ }
+
+ virtual STDMETHODIMP IDispatch::GetIDsOfNames(REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId)
+ {
+ HRESULT hr = LoadDispTypeInfo();
+
+ if(FAILED(hr))
+ return hr;
+
+ return m_dispTypeInfo->GetIDsOfNames(rgszNames, cNames, rgDispId);
+ }
+
+ virtual STDMETHODIMP IDispatch::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr)
+ {
+ return m_dispTypeInfo->Invoke
+ (
+ static_cast<MSTSCLib::IMsRdpClientSecuredSettings *>(this),
+ dispIdMember,
+ wFlags,
+ pDispParams,
+ pVarResult,
+ pExcepInfo,
+ puArgErr
+ );
+ }
+
+ /* IMsTscSecuredSettings */
+ virtual STDMETHODIMP IMsTscSecuredSettings::put_StartProgram(BSTR pStartProgram)
+ {
+ return Outer()->SetProperty(Outer()->m_StartProgram, pStartProgram);
+ }
+
+ virtual STDMETHODIMP IMsTscSecuredSettings::get_StartProgram(BSTR * pStartProgram) const
+ {
+ return Outer()->GetProperty(Outer()->m_StartProgram, pStartProgram);
+ }
+
+ virtual STDMETHODIMP IMsTscSecuredSettings::put_WorkDir(BSTR pWorkDir)
+ {
+ return Outer()->SetProperty(Outer()->m_WorkDir, pWorkDir);
+ }
+
+ virtual STDMETHODIMP IMsTscSecuredSettings::get_WorkDir(BSTR * pWorkDir) const
+ {
+ return Outer()->GetProperty(Outer()->m_WorkDir, pWorkDir);
+ }
+
+ virtual STDMETHODIMP IMsTscSecuredSettings::put_FullScreen(long pfFullScreen)
+ {
+ return Outer()->put_FullScreen(!!pfFullScreen);
+ }
+
+ virtual STDMETHODIMP IMsTscSecuredSettings::get_FullScreen(long * pfFullScreen) const
+ {
+ return Outer()->GetProperty(Outer()->m_FullScreen, pfFullScreen);
+ }
+
+ /* IMsRdpClientSecuredSettings */
+ virtual STDMETHODIMP IMsRdpClientSecuredSettings::put_KeyboardHookMode(long pkeyboardHookMode)
+ {
+ if(pkeyboardHookMode < 0 || pkeyboardHookMode > 2)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_KeyboardHookMode, pkeyboardHookMode);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientSecuredSettings::get_KeyboardHookMode(long * pkeyboardHookMode) const
+ {
+ return Outer()->GetProperty(Outer()->m_KeyboardHookMode, pkeyboardHookMode);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientSecuredSettings::put_AudioRedirectionMode(long pAudioRedirectionMode)
+ {
+ if(pAudioRedirectionMode < 0 || pAudioRedirectionMode > 2)
+ return E_INVALIDARG;
+
+ return Outer()->SetProperty(Outer()->m_AudioRedirectionMode, pAudioRedirectionMode);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientSecuredSettings::get_AudioRedirectionMode(long * pAudioRedirectionMode) const
+ {
+ return Outer()->GetProperty(Outer()->m_AudioRedirectionMode, pAudioRedirectionMode);
+ }
+ }
+ m_securedSettings;
+
+ template<class Interface> HRESULT GetSecuredSettings(Interface ** ppSecuredSettings)
+ {
+ if(!m_SecuredSettingsEnabled)
+ return E_FAIL;
+
+ addRef();
+ *ppSecuredSettings = &m_securedSettings;
+ return S_OK;
+ }
+
+ /* Type library loading */
+ HRESULT LoadTypeLibrary()
+ {
+ if(m_typeLib)
+ return S_OK;
+
+ // Get the DLL name of the ActiveX control
+ WCHAR szPath[MAX_PATH + 1];
+ DWORD cchPathLen = GetModuleFileNameW(GetCurrentModule(), szPath, ARRAYSIZE(szPath) - 1);
+
+ if(cchPathLen == 0)
+ return HRESULT_FROM_WIN32(GetLastError());
+
+ if(cchPathLen > ((ARRAYSIZE(szPath) - 1) - 2))
+ return E_FAIL;
+
+ // Append the resource id of the type library
+ assert(m_typeLibIndex < 10);
+
+ szPath[cchPathLen + 0] = L'\\';
+ szPath[cchPathLen + 1] = static_cast<WCHAR>(L'0' + m_typeLibIndex);
+ szPath[cchPathLen + 2] = 0;
+
+ // Load the type library
+ HRESULT hr = LoadTypeLibEx(szPath, REGKIND_NONE, &m_typeLib);
+
+ if(FAILED(hr))
+ return hr;
+
+ assert(m_typeLib);
+ return S_OK;
+ }
+
+ /* IDispatch type information */
+ HRESULT LoadDispTypeInfo()
+ {
+ if(m_dispTypeInfo)
+ return S_OK;
+
+ HRESULT hr = LoadTypeLibrary();
+
+ if(FAILED(hr))
+ return hr;
+
+ assert(MSTSCLib::IID_IMsRdpClient4 == MSTSCLib_Redist::IID_IMsRdpClient4);
+
+ hr = m_typeLib->GetTypeInfoOfGuid(MSTSCLib::IID_IMsRdpClient4, &m_dispTypeInfo);
+
+ if(FAILED(hr))
+ return hr;
+
+ assert(m_dispTypeInfo);
+ return S_OK;
+ }
+
+ HRESULT AcquireDispTypeInfo(ITypeInfo ** ppTI)
+ {
+ HRESULT hr = LoadDispTypeInfo();
+
+ if(FAILED(hr))
+ return hr;
+
+ m_dispTypeInfo->AddRef();
+ *ppTI = m_dispTypeInfo;
+ return S_OK;
+ }
+
+public:
+ /* Helpers for our various embedded children */
+ static RdpClient * InnerToOuter(RdpClientInner * innerThis)
+ {
+ return CONTAINING_RECORD(innerThis, RdpClient, m_inner);
+ }
+
+ static RdpClient * InnerToOuter(AdvancedSettings * innerThis)
+ {
+ return CONTAINING_RECORD(innerThis, RdpClient, m_advancedSettings);
+ }
+
+ static RdpClient * InnerToOuter(SecuredSettings * innerThis)
+ {
+ return CONTAINING_RECORD(innerThis, RdpClient, m_securedSettings);
+ }
+
+ static RdpClient * InnerToOuter(RDPCLIENT * innerThis)
+ {
+ return CONTAINING_RECORD(innerThis, RdpClient, m_protocolState);
+ }
+
+ static const RdpClient * InnerToOuter(const RdpClientInner * innerThis)
+ {
+ return CONTAINING_RECORD(innerThis, RdpClient, m_inner);
+ }
+
+ static const RdpClient * InnerToOuter(const AdvancedSettings * innerThis)
+ {
+ return CONTAINING_RECORD(innerThis, RdpClient, m_advancedSettings);
+ }
+
+ static const RdpClient * InnerToOuter(const SecuredSettings * innerThis)
+ {
+ return CONTAINING_RECORD(innerThis, RdpClient, m_securedSettings);
+ }
+
+ static const RdpClient * InnerToOuter(const RDPCLIENT * innerThis)
+ {
+ return CONTAINING_RECORD(innerThis, RdpClient, m_protocolState);
+ }
+
+ RdpClientUI * GetUI() const
+ {
+ assert(m_clientUI);
+ return m_clientUI;
+ }
+
+ /* Glue for rdesktop-core */
+public:
+ static bool OnPublicKey(RDPCLIENT * This, unsigned char * key, unsigned int key_size)
+ {
+ return InnerToOuter(This)->OnPublicKey(key, key_size);
+ }
+
+ static void OnLogon(RDPCLIENT * This)
+ {
+ return InnerToOuter(This)->OnLogon();
+ }
+
+ static bool OnRedirect
+ (
+ RDPCLIENT * This,
+ uint32 flags,
+ uint32 server_len,
+ wchar_t * server,
+ uint32 cookie_len,
+ char * cookie,
+ uint32 username_len,
+ wchar_t * username,
+ uint32 domain_len,
+ wchar_t * domain,
+ uint32 password_len,
+ wchar_t * password
+ )
+ {
+ return InnerToOuter(This)->OnRedirect
+ (
+ flags,
+ server_len,
+ server,
+ cookie_len,
+ cookie,
+ username_len,
+ username,
+ domain_len,
+ domain,
+ password_len,
+ password
+ );
+ }
+
+private:
+ bool OnPublicKey(unsigned char * key, unsigned int key_size)
+ {
+ HRESULT hr = FireReceivedTSPublicKey(key, key_size);
+
+ if(FAILED(hr))
+ {
+ m_protocolState.disconnect_reason = 262;
+ return false;
+ }
+
+ return hr == S_OK;
+ }
+
+ void OnLogon()
+ {
+ m_loggedIn = true;
+ FireLoginComplete();
+ }
+
+ bool OnRedirect
+ (
+ uint32 flags,
+ uint32 server_len,
+ wchar_t * server,
+ uint32 cookie_len,
+ char * cookie,
+ uint32 username_len,
+ wchar_t * username,
+ uint32 domain_len,
+ wchar_t * domain,
+ uint32 password_len,
+ wchar_t * password
+ )
+ {
+ assert(m_Connected);
+ assert(!InsideApartment());
+ assert(IsWindow(m_controlWindow));
+
+ RedirectArguments redirectArgs =
+ {
+ flags,
+ server_len,
+ server,
+ cookie_len,
+ cookie,
+ username_len,
+ username,
+ domain_len,
+ domain,
+ password_len,
+ password
+ };
+
+ return SendMessage(m_controlWindow, RDPC_WM_REDIRECT, 0, reinterpret_cast<LPARAM>(&redirectArgs)) == 0;
+ }
+
+private:
+ static DWORD WINAPI ProtocolLoopThreadProc(LPVOID lpParam)
+ {
+ static_cast<RdpClient *>(lpParam)->ProtocolLoop();
+ return 0;
+ }
+
+ static VOID CALLBACK ConnectionTimerAPC(LPVOID, DWORD, DWORD)
+ {
+ }
+
+ // FIXME: various potential inconsistencies due to lack of detailed documentation of expected semantics
+ void ProtocolLoop()
+ {
+ HANDLE waitingReconnection = NULL;
+
+ // Retrieve the local hostname to be passed to the server
+ WCHAR hostname[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD hostnameLen = ARRAYSIZE(hostname);
+
+ if(!GetComputerNameW(hostname, &hostnameLen))
+ hostname[0] = 0;
+
+ // Set some connection flags
+ uint32 flags = RDP_LOGON_NORMAL;
+
+ if(m_Compress)
+ flags |= RDP_LOGON_COMPRESSION | RDP_LOGON_COMPRESSION2;
+
+ if(m_AudioRedirectionMode == 1)
+ flags |= RDP_LOGON_LEAVE_AUDIO;
+
+ if(m_ClearTextPassword)
+ flags |= RDP_LOGON_AUTO;
+
+ // Notify the container that the connection process is beginning now
+ FireConnecting();
+
+ // Set the overall connection timer, if a timeout is set
+ // BUGBUG: the timeout semantics are ambiguous and have been most probably misinterpreted
+ HANDLE overallConnectionTimer = NULL;
+ LARGE_INTEGER overallTimeout;
+
+ if(m_overallConnectionTimeout)
+ {
+ overallTimeout.QuadPart = - ((m_overallConnectionTimeout * 1000 * 1000 * 1000) / 100);
+
+ overallConnectionTimer = CreateWaitableTimer(NULL, FALSE, NULL);
+
+ if(overallConnectionTimer == NULL)
+ goto l_Disconnect;
+ }
+
+ if(overallConnectionTimer)
+ SetWaitableTimer(overallConnectionTimer, &overallTimeout, 0, ConnectionTimerAPC, NULL, FALSE);
+
+ // Initial connection
+ BOOL disconnected = rdp_connect
+ (
+ &m_protocolState,
+ m_Server,
+ flags,
+ m_UserName,
+ m_Domain,
+ m_ClearTextPassword,
+ m_StartProgram,
+ m_WorkDir,
+ hostname,
+ m_LoadBalanceInfo
+ );
+
+ if(overallConnectionTimer)
+ CancelWaitableTimer(overallConnectionTimer);
+
+ if(disconnected)
+ goto l_Disconnect;
+
+ // TODO: set the disconnect reason for every instance in which we abort the loop
+ for(;;)
+ {
+ BOOL deactivated = False;
+ uint32 extendedDisconnectReason = 0;
+
+ m_actuallyConnected = true;
+
+ // Notify the container of the successful connection
+ FireConnected();
+
+ // Main protocol loop
+ m_loggedIn = false;
+ rdp_main_loop(&m_protocolState, &deactivated, &extendedDisconnectReason);
+ rdp_disconnect(&m_protocolState);
+
+ m_actuallyConnected = false;
+
+ // Redirection
+ // BUGBUG: redirection is very messy and probably this implementation is not "canonical"
+ if(m_protocolState.redirect)
+ {
+ m_protocolState.redirect = False;
+ rdp_reset_state(&m_protocolState);
+
+ // TODO: reset connection parameters
+ // This has to be done in the main thread, so use SendMessage on the control window
+
+ flags |= RDP_LOGON_AUTO;
+
+ // retry
+ continue;
+ }
+
+ // Disconnection
+ m_ExtendedDisconnectReason = static_cast<MSTSCLib::ExtendedDisconnectReasonCode>(extendedDisconnectReason);
+
+ // Clean disconnection
+ if(deactivated)
+ break;
+
+ BOOL success;
+
+ long autoReconnections = 0;
+ long totalReconnections = 0;
+
+ // Reconnection
+ // BUGBUG: reconnection semantics may not be entirely accurate
+ do
+ {
+ ++ totalReconnections;
+
+ // ask the container whether we should reconnect
+ long reconnectMode = FireAutoReconnecting(m_protocolState.disconnect_reason, totalReconnections);
+
+ // do not reconnect
+ if(reconnectMode == MSTSCLib::autoReconnectContinueStop)
+ goto l_Disconnect;
+
+ // the container will reconnect or abort manually
+ if(reconnectMode == MSTSCLib::autoReconnectContinueManual)
+ {
+ assert(!m_reconnectAborted);
+ assert(m_protocolThreadWaitingReconnection == NULL);
+
+ if(waitingReconnection == NULL)
+ {
+ waitingReconnection = CreateEvent(NULL, TRUE, FALSE, NULL);
+
+ if(waitingReconnection == NULL)
+ // TODO: fatal error
+ goto l_Disconnect;
+ }
+
+ m_protocolThreadWaitingReconnection = waitingReconnection;
+
+ WaitForSingleObject(waitingReconnection, INFINITE);
+
+ m_protocolThreadWaitingReconnection = NULL;
+
+ if(m_reconnectAborted)
+ {
+ // FIXME? do we set the disconnection status here?
+ goto l_Disconnect;
+ }
+ }
+ // reconnect automatically
+ else
+ {
+ // automatic reconnection is disabled
+ if(m_EnableAutoReconnect)
+ break;
+
+ // too many consecutive automatic reconnections
+ if(autoReconnections == m_MaxReconnectAttempts)
+ break;
+
+ ++ autoReconnections;
+ }
+
+ if(overallConnectionTimer)
+ SetWaitableTimer(overallConnectionTimer, &overallTimeout, 0, ConnectionTimerAPC, NULL, FALSE);
+
+ // Reconnection
+ success = rdp_reconnect
+ (
+ &m_protocolState,
+ m_Server,
+ flags,
+ m_UserName,
+ m_Domain,
+ m_ClearTextPassword,
+ m_StartProgram,
+ m_WorkDir,
+ hostname,
+ m_LoadBalanceInfo
+ );
+
+ if(overallConnectionTimer)
+ CancelWaitableTimer(overallConnectionTimer);
+ }
+ while(!success);
+ }
+
+l_Disconnect:
+ // Disconnected
+ FireDisconnected(m_protocolState.disconnect_reason);
+
+ if(overallConnectionTimer)
+ CloseHandle(overallConnectionTimer);
+ }
+
+ void JoinProtocolThread()
+ {
+ assert(m_protocolThread);
+ WaitForSingleObject(m_protocolThread, INFINITE);
+ CloseHandle(m_protocolThread);
+ m_protocolThread = NULL;
+ }
+
+ void TerminateProtocolThread()
+ {
+ assert(m_protocolThread);
+
+ // wake it up if it's waiting for a manual reconnection
+ if(m_protocolThreadWaitingReconnection)
+ {
+ assert(!m_reconnectAborted);
+ m_reconnectAborted = true;
+ SetEvent(m_protocolThreadWaitingReconnection);
+ }
+ // otherwise, attempt to interrupt any current blocking operation
+ else
+ {
+ // shutdown(m_protocolState.tcp.sock, SD_BOTH); // TBD: maybe in the future?
+ QueueUserAPC(DisconnectAPC, m_protocolThread, 0);
+ }
+
+ assert(m_protocolThreadWaitingReconnection == NULL);
+ }
+
+ void PerformDisconnect(long reason)
+ {
+ assert(InsideApartment());
+ assert(m_Connected);
+
+ // TODO: notify virtual channels
+
+ // TODO: do any other disconnection work here...
+
+ // Put the control in the disconnected state
+ m_Connected = false;
+ m_loggedIn = false;
+
+ // Notify the container
+ VARIANTARG arg = { };
+
+ arg.vt = VT_I4;
+ arg.lVal = reason;
+
+ FireEventInsideApartment(4, &arg, 1);
+ }
+
+public:
+ /* Startup initialization */
+ static BOOL Startup()
+ {
+ if(!RdpClientUI::Startup())
+ return FALSE;
+
+ WNDCLASSEX wcex = { sizeof(wcex) };
+
+ wcex.style = CS_HREDRAW | CS_VREDRAW;
+ wcex.lpfnWndProc = ControlWindowProc;
+ wcex.hInstance = GetCurrentModule();
+ wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
+ wcex.lpszClassName = TEXT("MissTosca_Control");
+
+ return RegisterClassEx(&wcex);
+ }
+
+ static void Shutdown()
+ {
+ UnregisterClass(TEXT("MissTosca_Control"), GetCurrentModule());
+ }
+
+ /* Class factory */
+ static HRESULT CreateInstance(REFCLSID rclsid, unsigned libIndex, IUnknown * punkOuter, REFIID riid, void ** ppObj)
+ {
+ RdpClient * obj = new RdpClient(rclsid, libIndex, punkOuter);
+
+ if(obj == NULL)
+ return E_OUTOFMEMORY;
+
+ HRESULT hr = obj->m_inner.QueryInterface(riid, ppObj);
+
+ if(FAILED(hr))
+ {
+ delete obj;
+ return hr;
+ }
+
+ assert(obj->m_refCount == 1);
+ assert(*ppObj != NULL);
+
+ return S_OK;
+ }
+
+private:
+ /* Connection point enumerator */
+ class CEnumConnectionPoints: public IEnumConnectionPoints
+ {
+ private:
+ LONG m_refCount;
+ IConnectionPoint * m_cp;
+ bool m_done;
+
+ public:
+ CEnumConnectionPoints(IConnectionPoint * cp): m_refCount(1), m_cp(cp), m_done(false)
+ {
+ assert(m_cp);
+ m_cp->AddRef();
+ }
+
+ CEnumConnectionPoints(const CEnumConnectionPoints& ecp): m_refCount(1), m_cp(ecp.m_cp), m_done(ecp.m_done)
+ {
+ assert(m_cp);
+ m_cp->AddRef();
+ }
+
+ ~CEnumConnectionPoints()
+ {
+ assert(m_cp);
+ m_cp->Release();
+ }
+
+ virtual STDMETHODIMP QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ if(riid == IID_IUnknown || riid == IID_IEnumConnectionPoints)
+ {
+ *ppvObject = this;
+ return S_OK;
+ }
+ else
+ {
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+ }
+
+ virtual STDMETHODIMP_(ULONG) AddRef()
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ virtual STDMETHODIMP_(ULONG) Release()
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ virtual STDMETHODIMP Next(ULONG cConnections, LPCONNECTIONPOINT * ppCP, ULONG * pcFetched)
+ {
+ if(cConnections == 0 || m_done)
+ return S_FALSE;
+
+ m_done = true;
+ m_cp->AddRef();
+ *ppCP = m_cp;
+ *pcFetched = 1;
+
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP Skip(ULONG cConnections)
+ {
+ if(cConnections == 0)
+ return S_OK;
+
+ if(cConnections == 1 && !m_done)
+ {
+ m_done = true;
+ return S_OK;
+ }
+
+ assert(cConnections > 1 || m_done);
+
+ return S_FALSE;
+ }
+
+ virtual STDMETHODIMP Reset()
+ {
+ m_done = false;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP Clone(IEnumConnectionPoints ** ppEnum)
+ {
+ if(ppEnum == NULL)
+ return E_POINTER;
+
+ *ppEnum = new CEnumConnectionPoints(*this);
+
+ if(*ppEnum == NULL)
+ return E_OUTOFMEMORY;
+
+ return S_OK;
+ }
+ };
+
+ /* Pay no attention, ActiveX glue... */
+ LRESULT ControlWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
+ {
+ switch(uMsg)
+ {
+ case WM_SIZE:
+ {
+ // TODO: resize UI
+ }
+
+ return 0;
+
+ case WM_PAINT:
+ {
+ LPCWSTR text = NULL;
+
+ if(!m_Connected)
+ text = m_DisconnectedText;
+ else if(m_actuallyConnected)
+ text = m_ConnectedStatusText;
+ else
+ text = m_ConnectingText;
+
+ RECT clientRect;
+ GetClientRect(m_controlWindow, &clientRect);
+
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(m_controlWindow, &ps);
+
+ SetBkColor(hdc, GetSysColor(COLOR_WINDOW));
+ SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
+ SelectObject(hdc, GetStockObject(SYSTEM_FONT));
+
+ RECT textRect = clientRect;
+
+ DrawTextW
+ (
+ hdc,
+ text,
+ -1,
+ &textRect,
+ DT_CENTER | DT_EDITCONTROL | DT_END_ELLIPSIS | DT_NOPREFIX | DT_WORDBREAK | DT_CALCRECT
+ );
+
+ if(textRect.right > clientRect.right)
+ textRect.right = clientRect.right;
+
+ if(textRect.bottom > clientRect.bottom)
+ textRect.bottom = clientRect.bottom;
+
+ textRect.left = (clientRect.right - textRect.right) / 2;
+ textRect.right += textRect.left;
+ textRect.top = (clientRect.bottom - textRect.bottom) / 2;
+ textRect.bottom += textRect.top;
+
+ DrawTextW
+ (
+ hdc,
+ text,
+ -1,
+ &textRect,
+ DT_CENTER | DT_EDITCONTROL | DT_END_ELLIPSIS | DT_NOPREFIX | DT_WORDBREAK
+ );
+
+ EndPaint(m_controlWindow, &ps);
+ }
+
+ return 0;
+
+ default:
+ {
+ LRESULT result;
+
+ if(HandleEvent(uMsg, wParam, lParam, result))
+ return result;
+ }
+
+ break;
+ }
+
+ return DefWindowProc(m_controlWindow, uMsg, wParam, lParam);
+ }
+
+ static LRESULT CALLBACK ControlWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+ {
+ if(uMsg == WM_CREATE)
+ {
+ SetWindowLongPtr
+ (
+ hwnd,
+ GWLP_USERDATA,
+ (LONG_PTR)reinterpret_cast<LPCREATESTRUCT>(lParam)->lpCreateParams
+ );
+ }
+
+ RdpClient * Self = reinterpret_cast<RdpClient *>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
+ assert(Self);
+
+ return Self->ControlWindowProc(uMsg, wParam, lParam);
+ }
+
+ HRESULT CreateControlWindow(HWND hwndParent)
+ {
+ m_controlWindow = CreateWindow
+ (
+ TEXT("MissTosca_Control"),
+ NULL,
+ WS_CHILD | WS_CLIPCHILDREN,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ hwndParent,
+ NULL,
+ GetCurrentModule(),
+ this
+ );
+
+ if(m_controlWindow == NULL)
+ return HRESULT_FROM_WIN32(GetLastError());
+
+ m_UIParentWindowHandle = m_controlWindow;
+ return S_OK;
+ }
+
+ HRESULT DestroyControlWindow()
+ {
+ if(m_controlWindow == NULL)
+ return S_FALSE;
+
+ HWND controlWindow = NULL;
+ std::swap(controlWindow, m_controlWindow);
+ DestroyWindow(controlWindow);
+ return S_OK;
+ }
+
+ HRESULT Activate(LONG iVerb, IOleClientSite * pActiveSite, HWND hwndParent, LPCRECT lprcPosRect)
+ {
+ if(pActiveSite == NULL)
+ pActiveSite = m_clientSite;
+
+ if(pActiveSite == NULL)
+ return E_FAIL;
+
+ // TODO: store this until we are closed or deactivated
+ IOleInPlaceSite * site;
+
+ HRESULT hr = pActiveSite->QueryInterface(&site);
+
+ if(FAILED(hr))
+ return hr;
+
+ IOleInPlaceFrame * frame = NULL;
+ IOleInPlaceUIWindow * uiWindow = NULL;
+
+ for(;;)
+ {
+ hr = site->CanInPlaceActivate();
+
+ if(hr == S_FALSE)
+ hr = E_FAIL;
+
+ if(FAILED(hr))
+ break;
+
+ site->OnInPlaceActivate();
+
+ if(hwndParent == NULL)
+ {
+ hr = site->GetWindow(&hwndParent);
+
+ if(FAILED(hr))
+ break;
+ }
+
+ RECT rcPos;
+ RECT rcClip;
+ OLEINPLACEFRAMEINFO frameInfo = { sizeof(frameInfo) };
+
+ site->GetWindowContext(&frame, &uiWindow, &rcPos, &rcClip, &frameInfo);
+
+ if(lprcPosRect == NULL)
+ lprcPosRect = &rcPos;
+
+ if(m_controlWindow)
+ ShowWindow(m_controlWindow, SW_SHOW);
+ else
+ {
+ hr = CreateControlWindow(hwndParent);
+
+ if(FAILED(hr))
+ break;
+ }
+
+ SetObjectRects(lprcPosRect, &rcClip);
+
+ // UI activation
+ if((iVerb == OLEIVERB_PRIMARY || iVerb == OLEIVERB_UIACTIVATE) && !m_uiActive)
+ {
+ m_uiActive = true;
+
+ hr = site->OnUIActivate();
+
+ if(FAILED(hr))
+ break;
+
+ SetWindowPos
+ (
+ m_controlWindow,
+ NULL,
+ lprcPosRect->left,
+ lprcPosRect->top,
+ lprcPosRect->right - lprcPosRect->left,
+ lprcPosRect->bottom - lprcPosRect->top,
+ SWP_SHOWWINDOW
+ );
+
+ if(frame)
+ {
+ frame->SetActiveObject(this, NULL);
+ frame->SetBorderSpace(NULL);
+ }
+
+ if(uiWindow)
+ {
+ uiWindow->SetActiveObject(this, NULL);
+ uiWindow->SetBorderSpace(NULL);
+ }
+ }
+
+ break;
+ }
+
+ if(uiWindow)
+ uiWindow->Release();
+
+ if(frame)
+ frame->Release();
+
+ site->Release();
+
+ if(SUCCEEDED(hr))
+ pActiveSite->ShowObject();
+
+ return hr;
+ }
+
+public:
+ /* IUnknown */
+ /*
+ NOTE: this is the delegating implementation, to support aggregation. The actual
+ implementation is RdpClientInner, above
+ */
+ virtual STDMETHODIMP IUnknown::QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ return m_punkOuter->QueryInterface(riid, ppvObject);
+ }
+
+ virtual STDMETHODIMP_(ULONG) IUnknown::AddRef()
+ {
+ return m_punkOuter->AddRef();
+ }
+
+ virtual STDMETHODIMP_(ULONG) IUnknown::Release()
+ {
+ return m_punkOuter->Release();
+ }
+
+ /* IDispatch */
+ virtual STDMETHODIMP IDispatch::GetTypeInfoCount(UINT * pctinfo)
+ {
+ *pctinfo = 1;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IDispatch::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo)
+ {
+ if(iTInfo != 0)
+ return DISP_E_BADINDEX;
+
+ return AcquireDispTypeInfo(ppTInfo);
+ }
+
+ virtual STDMETHODIMP IDispatch::GetIDsOfNames(REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId)
+ {
+ HRESULT hr = LoadDispTypeInfo();
+
+ if(FAILED(hr))
+ return hr;
+
+ return m_dispTypeInfo->GetIDsOfNames(rgszNames, cNames, rgDispId);
+ }
+
+ virtual STDMETHODIMP IDispatch::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr)
+ {
+ HRESULT hr = LoadDispTypeInfo();
+
+ if(FAILED(hr))
+ return hr;
+
+ return m_dispTypeInfo->Invoke
+ (
+ static_cast<MSTSCLib::IMsRdpClient4 *>(this),
+ dispIdMember,
+ wFlags,
+ pDispParams,
+ pVarResult,
+ pExcepInfo,
+ puArgErr
+ );
+ }
+
+ /* IConnectionPoint */
+ virtual STDMETHODIMP GetConnectionInterface(IID * pIID)
+ {
+ if(pIID == NULL)
+ return E_POINTER;
+
+ *pIID = MSTSCLib::DIID_IMsTscAxEvents;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP GetConnectionPointContainer(IConnectionPointContainer ** ppCPC)
+ {
+ if(ppCPC == NULL)
+ return E_POINTER;
+
+ addRef();
+ *ppCPC = this;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP Advise(IUnknown * pUnkSink, DWORD * pdwCookie)
+ {
+ MSTSCLib::IMsTscAxEvents * sink;
+
+ if(FAILED(pUnkSink->QueryInterface(&sink)))
+ return CONNECT_E_CANNOTCONNECT;
+
+ MSTSCLib::IMsTscAxEvents ** sinks = GetSinks();
+ DWORD cookie = 0;
+
+ if(m_EventSinksCount)
+ {
+ bool found = false;
+
+ for(size_t i = 0; i < m_EventSinksCount; ++ i)
+ {
+ found = (sinks[i] == NULL);
+
+ if(found)
+ {
+ cookie = static_cast<DWORD>(i);
+ break;
+ }
+ }
+
+ if(!found)
+ {
+ MSTSCLib::IMsTscAxEvents ** newSinks = new MSTSCLib::IMsTscAxEvents *[m_EventSinksCount + 1];
+
+ if(newSinks == NULL)
+ {
+ sink->Release();
+ return E_OUTOFMEMORY;
+ }
+
+ std::copy(sinks, sinks + m_EventSinksCount, newSinks);
+
+ m_EventSinks = newSinks;
+ sinks = newSinks;
+
+ cookie = static_cast<DWORD>(m_EventSinksCount);
+ }
+ }
+
+ sinks[cookie] = sink;
+ *pdwCookie = cookie;
+
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP Unadvise(DWORD dwCookie)
+ {
+ MSTSCLib::IMsTscAxEvents ** sinks = GetSinks();
+
+ if(dwCookie >= m_EventSinksCount || sinks[dwCookie] == NULL)
+ return CONNECT_E_NOCONNECTION;
+
+ sinks[dwCookie]->Release();
+ sinks[dwCookie] = NULL;
+
+ // BUGBUG: the array currently grows forever. Trim it whenever possible
+
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP EnumConnections(IEnumConnections ** ppEnum)
+ {
+ // I see no real value in this
+ return E_NOTIMPL;
+ }
+
+ /* IConnectionPointContainer */
+ virtual STDMETHODIMP IConnectionPointContainer::EnumConnectionPoints(IEnumConnectionPoints ** ppEnum)
+ {
+ *ppEnum = new CEnumConnectionPoints(this);
+
+ if(*ppEnum == NULL)
+ return E_OUTOFMEMORY;
+
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IConnectionPointContainer::FindConnectionPoint(REFIID riid, IConnectionPoint ** ppCP)
+ {
+ if(riid != MSTSCLib::DIID_IMsTscAxEvents)
+ return CONNECT_E_NOCONNECTION;
+
+ addRef();
+ *ppCP = this;
+
+ return S_OK;
+ }
+
+ /* IDataObject */ // 0/9
+ virtual STDMETHODIMP IDataObject::GetData(FORMATETC * pformatetcIn, STGMEDIUM * pmedium)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IDataObject::GetDataHere(FORMATETC * pformatetc, STGMEDIUM * pmedium)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IDataObject::QueryGetData(FORMATETC * pformatetc)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IDataObject::GetCanonicalFormatEtc(FORMATETC * pformatectIn, FORMATETC * pformatetcOut)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IDataObject::SetData(FORMATETC * pformatetc, STGMEDIUM * pmedium, BOOL fRelease)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC ** ppenumFormatEtc)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IDataObject::DAdvise(FORMATETC * pformatetc, DWORD advf, IAdviseSink * pAdvSink, DWORD * pdwConnection)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IDataObject::DUnadvise(DWORD dwConnection)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IDataObject::EnumDAdvise(IEnumSTATDATA ** ppenumAdvise)
+ {
+ return E_NOTIMPL;
+ }
+
+ /* IObjectSafety */
+ virtual STDMETHODIMP IObjectSafety::GetInterfaceSafetyOptions(REFIID riid, DWORD * pdwSupportedOptions, DWORD * pdwEnabledOptions)
+ {
+ if(pdwSupportedOptions == NULL || pdwEnabledOptions == NULL)
+ return E_POINTER;
+
+ if(riid != IID_IDispatch)
+ return E_NOINTERFACE;
+
+ *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
+ *pdwEnabledOptions = m_SafetyOptions;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IObjectSafety::SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
+ {
+ if(riid != IID_IDispatch)
+ return E_NOINTERFACE;
+
+ m_SafetyOptions = dwEnabledOptions & (dwOptionSetMask & INTERFACESAFE_FOR_UNTRUSTED_CALLER);
+ return S_OK;
+ }
+
+ /* IOleControl */ // 3/4
+ virtual STDMETHODIMP IOleControl::GetControlInfo(CONTROLINFO * pCI)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleControl::OnMnemonic(MSG * pMsg)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleControl::OnAmbientPropertyChange(DISPID dispID)
+ {
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleControl::FreezeEvents(BOOL bFreeze)
+ {
+ if(bFreeze)
+ InterlockedIncrement(&m_freezeEvents);
+ else if(InterlockedDecrement(&m_freezeEvents) == 0)
+ UnfreezeEvents();
+
+ return S_OK;
+ }
+
+ /* IOleInPlaceActiveObject */ // 3/5
+ virtual STDMETHODIMP IOleInPlaceActiveObject::TranslateAccelerator(LPMSG lpmsg)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleInPlaceActiveObject::OnFrameWindowActivate(BOOL fActivate)
+ {
+ // TODO
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleInPlaceActiveObject::OnDocWindowActivate(BOOL fActivate)
+ {
+ // TODO
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleInPlaceActiveObject::ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow * pUIWindow, BOOL fFrameWindow)
+ {
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleInPlaceActiveObject::EnableModeless(BOOL fEnable)
+ {
+ return S_OK;
+ }
+
+ /* IOleInPlaceObject */ // 1/4
+ virtual STDMETHODIMP IOleInPlaceObject::InPlaceDeactivate()
+ {
+ // TODO: UIDeactivate, destroy window, inplacesite->OnInPlaceDeactivate
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleInPlaceObject::UIDeactivate()
+ {
+ // TODO
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleInPlaceObject::SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect)
+ {
+ if(m_controlWindow == NULL)
+ return E_FAIL;
+
+ MoveWindow
+ (
+ m_controlWindow,
+ lprcPosRect->left,
+ lprcPosRect->top,
+ lprcPosRect->right - lprcPosRect->left,
+ lprcPosRect->bottom - lprcPosRect->top,
+ TRUE
+ );
+
+ SetWindowRgn(m_controlWindow, CreateRectRgnIndirect(lprcClipRect), TRUE);
+
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleInPlaceObject::ReactivateAndUndo()
+ {
+ return E_NOTIMPL;
+ }
+
+ /* IOleObject */ // 18/21
+ virtual STDMETHODIMP IOleObject::SetClientSite(IOleClientSite * pClientSite)
+ {
+ if(m_clientSite)
+ m_clientSite->Release();
+
+ m_clientSite = pClientSite;
+
+ if(m_clientSite)
+ m_clientSite->AddRef();
+
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleObject::GetClientSite(IOleClientSite ** ppClientSite)
+ {
+ if(ppClientSite == NULL)
+ return E_POINTER;
+
+ if(m_clientSite)
+ m_clientSite->AddRef();
+
+ *ppClientSite = m_clientSite;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleObject::SetHostNames(LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
+ {
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleObject::Close(DWORD dwSaveOption)
+ {
+ // TODO: deactivate, destroy window, release in-place site, release advise sink
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IOleObject::SetMoniker(DWORD dwWhichMoniker, IMoniker * pmk)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleObject::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker ** ppmk)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleObject::InitFromData(IDataObject * pDataObject, BOOL fCreation, DWORD dwReserved)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleObject::GetClipboardData(DWORD dwReserved, IDataObject ** ppDataObject)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleObject::DoVerb(LONG iVerb, LPMSG lpmsg, IOleClientSite * pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
+ {
+ HRESULT hr;
+
+ switch(iVerb)
+ {
+ case OLEIVERB_PRIMARY:
+ case OLEIVERB_SHOW:
+ case OLEIVERB_UIACTIVATE:
+ case OLEIVERB_INPLACEACTIVATE:
+ hr = S_OK;
+ break;
+
+ default:
+ if(iVerb > 0)
+ hr = OLEOBJ_S_INVALIDVERB;
+ else
+ hr = E_NOTIMPL;
+ }
+
+ if(FAILED(hr))
+ return hr;
+
+ HRESULT hrActivate = Activate(iVerb, pActiveSite, hwndParent, lprcPosRect);
+
+ if(FAILED(hrActivate))
+ hr = hrActivate;
+
+ return hr;
+ }
+
+ virtual STDMETHODIMP IOleObject::EnumVerbs(IEnumOLEVERB ** ppEnumOleVerb)
+ {
+ return OleRegEnumVerbs(m_classId, ppEnumOleVerb);
+ }
+
+ virtual STDMETHODIMP IOleObject::Update()
+ {
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleObject::IsUpToDate()
+ {
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleObject::GetUserClassID(CLSID * pClsid)
+ {
+ *pClsid = m_classId;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleObject::GetUserType(DWORD dwFormOfType, LPOLESTR * pszUserType)
+ {
+ return OleRegGetUserType(m_classId, dwFormOfType, pszUserType);
+ }
+
+ virtual STDMETHODIMP IOleObject::SetExtent(DWORD dwDrawAspect, SIZEL * psizel)
+ {
+ // TODO: resize
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IOleObject::GetExtent(DWORD dwDrawAspect, SIZEL * psizel)
+ {
+ // TODO: return size
+ return E_NOTIMPL;
+ }
+
+ HRESULT NeedAdviseHolder()
+ {
+ if(m_adviseHolder)
+ return S_OK;
+
+ return CreateOleAdviseHolder(&m_adviseHolder);
+ }
+
+ virtual STDMETHODIMP IOleObject::Advise(IAdviseSink * pAdvSink, DWORD * pdwConnection)
+ {
+ HRESULT hr = NeedAdviseHolder();
+
+ if(FAILED(hr))
+ return hr;
+
+ return m_adviseHolder->Advise(pAdvSink, pdwConnection);
+ }
+
+ virtual STDMETHODIMP IOleObject::Unadvise(DWORD dwConnection)
+ {
+ HRESULT hr = NeedAdviseHolder();
+
+ if(FAILED(hr))
+ return hr;
+
+ return m_adviseHolder->Unadvise(dwConnection);
+ }
+
+ virtual STDMETHODIMP IOleObject::EnumAdvise(IEnumSTATDATA ** ppenumAdvise)
+ {
+ HRESULT hr = NeedAdviseHolder();
+
+ if(FAILED(hr))
+ return hr;
+
+ return m_adviseHolder->EnumAdvise(ppenumAdvise);
+ }
+
+ virtual STDMETHODIMP IOleObject::GetMiscStatus(DWORD dwAspect, DWORD * pdwStatus)
+ {
+ return OleRegGetMiscStatus(m_classId, dwAspect, pdwStatus);
+ }
+
+ virtual STDMETHODIMP IOleObject::SetColorScheme(LOGPALETTE * pLogpal)
+ {
+ return E_NOTIMPL;
+ }
+
+ /* IOleWindow */
+ virtual STDMETHODIMP IOleWindow::GetWindow(HWND * phwnd)
+ {
+ if(phwnd == NULL)
+ return E_POINTER;
+
+ if(m_controlWindow == NULL)
+ return E_FAIL;
+
+ *phwnd = m_controlWindow;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IOleWindow::ContextSensitiveHelp(BOOL fEnterMode)
+ {
+ return E_NOTIMPL;
+ }
+
+ /* IPersist */
+ virtual STDMETHODIMP IPersist::GetClassID(CLSID * pClassID)
+ {
+ *pClassID = m_classId;
+ return S_OK;
+ }
+
+ /* IPersistPropertyBag */ // 0/3
+ virtual STDMETHODIMP IPersistPropertyBag::InitNew()
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistPropertyBag::Load(IPropertyBag * pPropBag, IErrorLog * pErrorLog)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistPropertyBag::Save(IPropertyBag * pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
+ {
+ return E_NOTIMPL;
+ }
+
+ /* IPersistStorage */ // 0/6
+ virtual STDMETHODIMP IPersistStorage::IsDirty()
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStorage::InitNew(IStorage * pStg)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStorage::Load(IStorage * pStg)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStorage::Save(IStorage * pStgSave, BOOL fSameAsLoad)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStorage::SaveCompleted(IStorage * pStgNew)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStorage::HandsOffStorage()
+ {
+ return E_NOTIMPL;
+ }
+
+ /* IPersistStreamInit */ // 0/5
+ virtual STDMETHODIMP IPersistStreamInit::IsDirty()
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStreamInit::Load(LPSTREAM pStm)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStreamInit::Save(LPSTREAM pStm, BOOL fClearDirty)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStreamInit::GetSizeMax(ULARGE_INTEGER * pCbSize)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IPersistStreamInit::InitNew()
+ {
+ return E_NOTIMPL;
+ }
+
+ /* IProvideClassInfo */
+ virtual STDMETHODIMP IProvideClassInfo::GetClassInfo(ITypeInfo ** ppTI)
+ {
+ HRESULT hr = LoadTypeLibrary();
+
+ if(FAILED(hr))
+ return hr;
+
+ return m_typeLib->GetTypeInfoOfGuid(m_classId, ppTI);
+ }
+
+ /* IProvideClassInfo2 */
+ virtual STDMETHODIMP IProvideClassInfo2::GetGUID(DWORD dwGuidKind, GUID * pGUID)
+ {
+ if(dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID)
+ return E_INVALIDARG;
+
+ *pGUID = MSTSCLib::DIID_IMsTscAxEvents;
+ return S_OK;
+ }
+
+ /* IQuickActivate */
+ virtual STDMETHODIMP IQuickActivate::QuickActivate(QACONTAINER * pQaContainer, QACONTROL * pQaControl)
+ {
+ if(pQaContainer == NULL || pQaControl == NULL)
+ return E_POINTER;
+
+ if(pQaContainer->cbSize < sizeof(*pQaContainer) || pQaControl->cbSize < sizeof(*pQaControl))
+ return E_INVALIDARG;
+
+ ULONG cb = pQaControl->cbSize;
+ ZeroMemory(pQaControl, cb);
+ pQaControl->cbSize = cb;
+
+ SetClientSite(pQaContainer->pClientSite);
+
+ if(pQaContainer->pAdviseSink)
+ SetAdvise(DVASPECT_CONTENT, 0, pQaContainer->pAdviseSink);
+
+ if(pQaContainer->pUnkEventSink)
+ Advise(pQaContainer->pUnkEventSink, &pQaControl->dwEventCookie);
+
+ GetMiscStatus(DVASPECT_CONTENT, &pQaControl->dwMiscStatus);
+
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IQuickActivate::SetContentExtent(LPSIZEL pSizel)
+ {
+ return SetExtent(DVASPECT_CONTENT, pSizel);
+ }
+
+ virtual STDMETHODIMP IQuickActivate::GetContentExtent(LPSIZEL pSizel)
+ {
+ return GetExtent(DVASPECT_CONTENT, pSizel);
+ }
+
+ /* IViewObject */ // 3/6
+ virtual STDMETHODIMP IViewObject::Draw(DWORD dwDrawAspect, LONG lindex, void * pvAspect, DVTARGETDEVICE * ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL (STDMETHODCALLTYPE * pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue)
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IViewObject::GetColorSet(DWORD dwDrawAspect, LONG lindex, void * pvAspect, DVTARGETDEVICE * ptd, HDC hicTargetDev, LOGPALETTE ** ppColorSet)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IViewObject::Freeze(DWORD dwDrawAspect, LONG lindex, void * pvAspect, DWORD * pdwFreeze)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IViewObject::Unfreeze(DWORD dwFreeze)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IViewObject::SetAdvise(DWORD aspects, DWORD advf, IAdviseSink * pAdvSink)
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IViewObject::GetAdvise(DWORD * pAspects, DWORD * pAdvf, IAdviseSink ** ppAdvSink)
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ /* IViewObject2 */ // 0/1
+ virtual STDMETHODIMP IViewObject2::GetExtent(DWORD dwDrawAspect, LONG lindex, DVTARGETDEVICE * ptd, LPSIZEL lpsizel)
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ /* IMsTscAx */ // 23/30
+ virtual STDMETHODIMP IMsTscAx::put_Server(BSTR pServer)
+ {
+ // FIXME: convert the hostname to Punycode, not the ANSI codepage
+ return SetProperty(m_Server, pServer);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_Server(BSTR * pServer) const
+ {
+ return GetProperty(m_Server, pServer);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::put_Domain(BSTR pDomain)
+ {
+ return SetProperty(m_Domain, pDomain);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_Domain(BSTR * pDomain) const
+ {
+ return GetProperty(m_Domain, pDomain);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::put_UserName(BSTR pUserName)
+ {
+ return SetProperty(m_UserName, pUserName);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_UserName(BSTR * pUserName) const
+ {
+ return GetProperty(m_UserName, pUserName);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::put_DisconnectedText(BSTR pDisconnectedText)
+ {
+ return SetProperty(m_DisconnectedText, pDisconnectedText);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_DisconnectedText(BSTR * pDisconnectedText) const
+ {
+ return GetProperty(m_DisconnectedText, pDisconnectedText);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::put_ConnectingText(BSTR pConnectingText)
+ {
+ return SetProperty(m_ConnectingText, pConnectingText);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_ConnectingText(BSTR * pConnectingText) const
+ {
+ return GetProperty(m_ConnectingText, pConnectingText);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_Connected(short * pIsConnected) const
+ {
+ return GetProperty(m_Connected, pIsConnected);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::put_DesktopWidth(long pVal)
+ {
+ if(pVal < 200 || pVal > 1600)
+ return E_INVALIDARG;
+
+ return SetProperty(m_DesktopWidth, pVal);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_DesktopWidth(long * pVal) const
+ {
+ return GetProperty(m_DesktopWidth, pVal);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::put_DesktopHeight(long pVal)
+ {
+ if(pVal < 200 || pVal > 1200)
+ return E_INVALIDARG;
+
+ return SetProperty(m_DesktopHeight, pVal);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_DesktopHeight(long * pVal) const
+ {
+ return GetProperty(m_DesktopHeight, pVal);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::put_StartConnected(long pfStartConnected)
+ {
+ return SetProperty(m_StartConnected, pfStartConnected);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_StartConnected(long * pfStartConnected) const
+ {
+ return GetProperty(m_StartConnected, pfStartConnected);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_HorizontalScrollBarVisible(long * pfHScrollVisible) const
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_VerticalScrollBarVisible(long * pfVScrollVisible) const
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IMsTscAx::put_FullScreenTitle(BSTR rhs)
+ {
+ // TODO
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_CipherStrength(long * pCipherStrength) const
+ {
+ if(pCipherStrength == NULL)
+ return E_INVALIDARG;
+
+ *pCipherStrength = 128; // BUGBUG: a later version may change this. Use a compile-time constant
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_Version(BSTR * pVersion) const
+ {
+ if(pVersion == NULL)
+ return E_INVALIDARG;
+
+ BSTR version = SysAllocString(L"5.2.3790.1830"); // BUGBUG: don't use hardcoded string
+
+ if(version == NULL)
+ return E_OUTOFMEMORY;
+
+ *pVersion = version;
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_SecuredSettingsEnabled(long * pSecuredSettingsEnabled) const
+ {
+ // TODO: initialize m_SecuredSettingsEnabled as soon as we have an OLE client site
+ return GetProperty(m_SecuredSettingsEnabled, pSecuredSettingsEnabled);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_SecuredSettings(MSTSCLib::IMsTscSecuredSettings ** ppSecuredSettings) const
+ {
+ return GetSecuredSettings(ppSecuredSettings);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_AdvancedSettings(MSTSCLib::IMsTscAdvancedSettings ** ppAdvSettings) const
+ {
+ return GetAdvancedSettings(ppAdvSettings);
+ }
+
+ virtual STDMETHODIMP IMsTscAx::get_Debugger(MSTSCLib::IMsTscDebug ** ppDebugger) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscAx::Connect()
+ {
+ if(m_Connected)
+ {
+ // Protocol thread waiting for a manual reconnection: wake it up
+ if(m_protocolThreadWaitingReconnection)
+ {
+ SetEvent(m_protocolThreadWaitingReconnection);
+ return S_OK;
+ }
+
+ return E_FAIL;
+ }
+
+ m_Connected = true;
+
+ HRESULT hr;
+
+ if(m_controlWindow == NULL)
+ {
+ hr = CreateControlWindow(NULL);
+
+ if(FAILED(hr))
+ return hr;
+ }
+
+ for(;;)
+ {
+ // TODO: initialize plugin DLLs/channels
+
+ m_clientUI = new RdpClientUI();
+
+ if(m_clientUI == NULL)
+ {
+ hr = E_OUTOFMEMORY;
+ break;
+ }
+
+ m_clientUI->Initialize(m_controlWindow);
+
+ m_protocolState.licence_username = BstrToLpsz(m_UserName);
+
+ if(m_protocolState.licence_username == NULL)
+ {
+ hr = E_OUTOFMEMORY;
+ break;
+ }
+
+ DWORD dwSize = ARRAYSIZE(m_protocolState.licence_hostname);
+
+ if(!GetComputerNameA(m_protocolState.licence_hostname, &dwSize))
+ {
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ break;
+ }
+
+ // Keyboard layout
+ // BUGBUG: not too sure about the semantics
+ long keyboardLayout = -1;
+ WCHAR * endPtr = NULL;
+
+ if(m_KeyboardLayoutString)
+ keyboardLayout = wcstol(m_KeyboardLayoutString, &endPtr, 0);
+
+ // no keyboard layout specified or invalid keyboard layout: use current keyboard layout
+ if(endPtr == NULL || *endPtr == 0 || keyboardLayout == -1)
+ keyboardLayout = PtrToLong(GetKeyboardLayout(0)); // FIXME? use LOWORD()?
+
+ m_protocolState.keylayout = keyboardLayout;
+
+ // in case of failure, assume English (US)
+ if(m_protocolState.keylayout == 0)
+ m_protocolState.keylayout = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
+
+ // Physical keyboard information
+ m_protocolState.keyboard_type = GetKeyboardType(0);
+ m_protocolState.keyboard_subtype = GetKeyboardType(1);
+ m_protocolState.keyboard_functionkeys = GetKeyboardType(2);
+
+ // in case of failure, assume an IBM Enhanced keyboard with 12 function keys
+ if(m_protocolState.keyboard_type == 0 || m_protocolState.keyboard_functionkeys == 0)
+ {
+ m_protocolState.keyboard_type = 4;
+ m_protocolState.keyboard_subtype = 0;
+ m_protocolState.keyboard_functionkeys = 12;
+ }
+
+ // More initialization
+ m_protocolState.width = m_DesktopWidth;
+ m_protocolState.height = m_DesktopHeight;
+ m_protocolState.server_depth = m_ColorDepth;
+ m_protocolState.bitmap_compression = m_Compress ? TRUE : FALSE;
+ m_protocolState.bitmap_cache = True; // TODO
+ m_protocolState.bitmap_cache_persist_enable = False; // TODO
+ m_protocolState.bitmap_cache_precache = True; // FIXME?
+ m_protocolState.encryption = m_EncryptionEnabled ? TRUE : FALSE; // TBD: detect automatically
+ m_protocolState.packet_encryption = m_EncryptionEnabled ? TRUE : FALSE;
+ m_protocolState.desktop_save = True; // FIXME? tie to bitmap cache setting?
+ m_protocolState.polygon_ellipse_orders = True;
+ m_protocolState.use_rdp5 = True; // TBD: detect automatically
+ m_protocolState.console_session = m_ConnectToServerConsole ? TRUE : FALSE;
+ m_protocolState.rdp5_performanceflags = m_PerformanceFlags;
+ m_protocolState.tcp_port_rdp = m_RDPPort;
+ m_protocolState.rdp.current_status = 1;
+
+ // TODO: cache tuning based on the provided parameters
+
+ m_protocolState.cache.bmpcache_lru[0] = -1;
+ m_protocolState.cache.bmpcache_lru[1] = -1;
+ m_protocolState.cache.bmpcache_lru[2] = -1;
+ m_protocolState.cache.bmpcache_mru[0] = -1;
+ m_protocolState.cache.bmpcache_mru[1] = -1;
+ m_protocolState.cache.bmpcache_mru[2] = -1;
+
+ DWORD dwIgnore;
+ m_protocolThread = CreateThread(NULL, 0, ProtocolLoopThreadProc, this, 0, &dwIgnore);
+
+ hr = S_OK;
+ break;
+ }
+
+ if(FAILED(hr))
+ m_Connected = false;
+
+ return hr;
+ }
+
+ virtual STDMETHODIMP IMsTscAx::Disconnect()
+ {
+ if(!m_Connected)
+ return E_FAIL;
+
+ // Terminate the protocol thread. On exit, it will fire the Disconnected event
+ TerminateProtocolThread();
+ return S_OK;
+ }
+
+ virtual STDMETHODIMP IMsTscAx::CreateVirtualChannels(BSTR newVal)
+ {
+ UINT strLength = SysStringLen(newVal);
+
+ if(strLength < 1 || strLength > 300)
+ return E_INVALIDARG;
+
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IMsTscAx::SendOnVirtualChannel(BSTR chanName, BSTR ChanData)
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ /* IMsRdpClient */ // 6/10
+ virtual STDMETHODIMP IMsRdpClient::put_ColorDepth(long pcolorDepth)
+ {
+ switch(pcolorDepth)
+ {
+ case 8:
+ case 15:
+ case 16:
+ case 24:
+ case 32:
+ break;
+
+ default:
+ return E_INVALIDARG;
+ }
+
+ return SetProperty(m_ColorDepth, pcolorDepth);
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::get_ColorDepth(long * pcolorDepth) const
+ {
+ return GetProperty(m_ColorDepth, pcolorDepth);
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::get_AdvancedSettings2(MSTSCLib::IMsRdpClientAdvancedSettings ** ppAdvSettings) const
+ {
+ return GetAdvancedSettings(ppAdvSettings);
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::get_SecuredSettings2(MSTSCLib::IMsRdpClientSecuredSettings ** ppSecuredSettings) const
+ {
+ return GetSecuredSettings(ppSecuredSettings);
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::get_ExtendedDisconnectReason(MSTSCLib::ExtendedDisconnectReasonCode * pExtendedDisconnectReason) const
+ {
+ return GetProperty(m_ExtendedDisconnectReason, pExtendedDisconnectReason);
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::put_FullScreen(VARIANT_BOOL pfFullScreen)
+ {
+ if(!m_Connected)
+ return E_FAIL;
+
+ if(pfFullScreen && !m_SecuredSettingsEnabled)
+ return E_FAIL;
+
+ // TODO
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::get_FullScreen(VARIANT_BOOL * pfFullScreen) const
+ {
+ return GetProperty(m_FullScreen, pfFullScreen);
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::SetVirtualChannelOptions(BSTR chanName, long chanOptions)
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::GetVirtualChannelOptions(BSTR chanName, long * pChanOptions)
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IMsRdpClient::RequestClose(MSTSCLib::ControlCloseStatus * pCloseStatus)
+ {
+ if(pCloseStatus == NULL)
+ return E_POINTER;
+
+ if(!m_Connected)
+ {
+ *pCloseStatus = MSTSCLib::controlCloseCanProceed;
+ return S_OK;
+ }
+
+ *pCloseStatus = MSTSCLib::controlCloseWaitForEvents;
+
+ if(!PostMessage(m_controlWindow, RDPC_WM_REQUEST_CLOSE, 0, 0))
+ return HRESULT_FROM_WIN32(GetLastError());
+
+ return S_OK;
+ }
+
+ /* IMsRdpClient2 */
+ virtual STDMETHODIMP IMsRdpClient2::get_AdvancedSettings3(MSTSCLib::IMsRdpClientAdvancedSettings2 ** ppAdvSettings) const
+ {
+ return GetAdvancedSettings(ppAdvSettings);
+ }
+
+ virtual STDMETHODIMP IMsRdpClient2::put_ConnectedStatusText(BSTR pConnectedStatusText)
+ {
+ return SetProperty(m_ConnectedStatusText, pConnectedStatusText);
+ }
+
+ virtual STDMETHODIMP IMsRdpClient2::get_ConnectedStatusText(BSTR * pConnectedStatusText) const
+ {
+ return GetProperty(m_ConnectedStatusText, pConnectedStatusText);
+ }
+
+ /* IMsRdpClient3 */
+ virtual STDMETHODIMP IMsRdpClient3::get_AdvancedSettings4(MSTSCLib::IMsRdpClientAdvancedSettings3 ** ppAdvSettings) const
+ {
+ return GetAdvancedSettings(ppAdvSettings);
+ }
+
+ /* IMsRdpClient4 */
+ virtual STDMETHODIMP IMsRdpClient4::get_AdvancedSettings5(MSTSCLib::IMsRdpClientAdvancedSettings4 ** ppAdvSettings5) const
+ {
+ return GetAdvancedSettings(ppAdvSettings5);
+ }
+
+ /* IMsTscNonScriptable */
+ virtual STDMETHODIMP IMsTscNonScriptable::put_ClearTextPassword(BSTR rhs)
+ {
+ return SetProperty(m_ClearTextPassword, rhs);
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::put_PortablePassword(BSTR pPortablePass)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::get_PortablePassword(BSTR * pPortablePass) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::put_PortableSalt(BSTR pPortableSalt)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::get_PortableSalt(BSTR * pPortableSalt) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::put_BinaryPassword(BSTR pBinaryPassword)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::get_BinaryPassword(BSTR * pBinaryPassword) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::put_BinarySalt(BSTR pSalt)
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::get_BinarySalt(BSTR * pSalt) const
+ {
+ return E_NOTIMPL;
+ }
+
+ virtual STDMETHODIMP IMsTscNonScriptable::ResetPassword()
+ {
+ return SetProperty(m_ClearTextPassword, NULL);
+ }
+
+ /* IMsRdpClientNonScriptable */ // 0/2
+ virtual STDMETHODIMP IMsRdpClientNonScriptable::NotifyRedirectDeviceChange(MSTSCLib::UINT_PTR wParam, MSTSCLib::LONG_PTR lParam)
+ {
+ return E_NOTIMPL; // TODO
+ }
+
+ virtual STDMETHODIMP IMsRdpClientNonScriptable::SendKeys(long numKeys, VARIANT_BOOL * pbArrayKeyUp, long * plKeyData)
+ {
+ // NOTE: the keys must be sent in a single, atomic sequence
+ // TODO: acquire the write lock
+ return E_NOTIMPL; // TODO
+ }
+
+ /* IMsRdpClientNonScriptable2 */
+ virtual STDMETHODIMP IMsRdpClientNonScriptable2::put_UIParentWindowHandle(HWND phwndUIParentWindowHandle)
+ {
+ return SetProperty(m_UIParentWindowHandle, phwndUIParentWindowHandle);
+ }
+
+ virtual STDMETHODIMP IMsRdpClientNonScriptable2::get_UIParentWindowHandle(HWND * phwndUIParentWindowHandle) const
+ {
+ return GetProperty(m_UIParentWindowHandle, phwndUIParentWindowHandle);
+ }
+};
+
+#pragma warning(pop)
+
+/* More glue to interface to the rdesktop code */
+extern "C"
+{
+
+/* Orders */
+/* support routines */
+void ui_begin_update(RDPCLIENT * This)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_BeginUpdate();
+}
+
+void ui_end_update(RDPCLIENT * This)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_EndUpdate();
+}
+
+void ui_set_clip(RDPCLIENT * This, int x, int y, int cx, int cy)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_SetClip(x, y, cx, cy);
+}
+
+void ui_reset_clip(RDPCLIENT * This)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_ResetClip();
+}
+
+/* blits */
+void ui_destblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_DestBlt(opcode, x, y, cx, cy);
+}
+
+void ui_memblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_MemBlt(opcode, x, y, cx, cy, src, srcx, srcy);
+}
+
+void ui_patblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy, BRUSH * brush, int bgcolour, int fgcolour)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_PatBlt(opcode, x, y, cx, cy, brush, bgcolour, fgcolour);
+}
+
+void ui_screenblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_ScreenBlt(opcode, x, y, cx, cy, srcx, srcy);
+}
+
+void ui_triblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy, BRUSH * brush, int bgcolour, int fgcolour)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_TriBlt(opcode, x, y, cx, cy, src, srcx, srcy, brush, bgcolour, fgcolour);
+}
+
+void ui_paint_bitmap(RDPCLIENT * This, int x, int y, int cx, int cy, int width, int height, uint8 * data)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_PaintBitmap(x, y, cx, cy, width, height, data);
+}
+
+/* shapes */
+void ui_ellipse(RDPCLIENT * This, uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH * brush, int bgcolour, int fgcolour)
+{
+ // TODO
+// RdpClient::InnerToOuter(This)->GetUI()->Display_Ellipse(opcode, fillmode, x, y, cx, cy, brush, bgcolour, fgcolour);
+}
+
+void ui_line(RDPCLIENT * This, uint8 opcode, int startx, int starty, int endx, int endy, PEN * pen)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_Line(opcode, startx, starty, endx, endy, pen);
+}
+
+void ui_polygon(RDPCLIENT * This, uint8 opcode, uint8 fillmode, POINT * point, int npoints, BRUSH * brush, int bgcolour, int fgcolour)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_Polygon(opcode, fillmode, point, npoints, brush, bgcolour, fgcolour);
+}
+
+void ui_polyline(RDPCLIENT * This, uint8 opcode, POINT * points, int npoints, PEN * pen)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_Polyline(opcode, points, npoints, pen);
+}
+
+void ui_rect(RDPCLIENT * This, int x, int y, int cx, int cy, int colour)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_Rect(x, y, cx, cy, colour);
+}
+
+/* text */
+void ui_draw_text
+(
+ RDPCLIENT * This,
+ uint8 font,
+ uint8 flags,
+ uint8 opcode,
+ int mixmode,
+ int x,
+ int y,
+ int clipx,
+ int clipy,
+ int clipcx,
+ int clipcy,
+ int boxx,
+ int boxy,
+ int boxcx,
+ int boxcy,
+ BRUSH * brush,
+ int bgcolour,
+ int fgcolour,
+ uint8 * text,
+ uint8 length
+)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_DrawText
+ (
+ font,
+ flags,
+ opcode,
+ mixmode,
+ x,
+ y,
+ clipx,
+ clipy,
+ clipcx,
+ clipcy,
+ boxx,
+ boxy,
+ boxcx,
+ boxcy,
+ brush,
+ bgcolour,
+ fgcolour,
+ text,
+ length
+ );
+}
+
+/* desktop save/restore */
+void ui_desktop_save(RDPCLIENT * This, uint32 offset, int x, int y, int cx, int cy)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_SaveDesktop(offset, x, y, cx, cy);
+}
+
+void ui_desktop_restore(RDPCLIENT * This, uint32 offset, int x, int y, int cx, int cy)
+{
+ RdpClient::InnerToOuter(This)->GetUI()->Display_RestoreDesktop(offset, x, y, cx, cy);
+}
+
+/* Resources */
+/* bitmaps */
+HBITMAP ui_create_bitmap(RDPCLIENT * This, int width, int height, uint8 * data)
+{
+ return win32_create_dib(width, height, This->server_depth, data);
+}
+
+void ui_destroy_bitmap(RDPCLIENT *, HBITMAP bmp)
+{
+ DeleteObject(bmp);
+}
+
+/* palettes */
+HCOLOURMAP ui_create_colourmap(RDPCLIENT *, COLOURMAP * colours)
+{
+ return NULL;
+}
+
+void ui_set_colourmap(RDPCLIENT * This, HCOLOURMAP map)
+{
+ // TODO
+}
+
+/* cursors */
+HCURSOR ui_create_cursor(RDPCLIENT * This, unsigned int x, unsigned int y, int width, int height, uint8 * andmask, uint8 * xormask)
+{
+ uint8 * andbuf = NULL;
+ uint8 * xorbuf = NULL;
+
+ uint8 * andbits = win32_convert_scanlines(width, - height, 1, 2, 4, andmask, &andbuf);
+ uint8 * xorbits = win32_convert_scanlines(width, height, 24, 2, 4, xormask, &xorbuf);
+
+ HBITMAP hbmMask = CreateBitmap(width, height, 1, 1, andbits);
+ HBITMAP hbmColor = win32_create_dib(width, height, 24, xorbits);
+
+ ICONINFO iconinfo;
+ iconinfo.fIcon = FALSE;
+ iconinfo.xHotspot = x;
+ iconinfo.yHotspot = y;
+ iconinfo.hbmMask = hbmMask;
+ iconinfo.hbmColor = hbmColor;
+
+ HICON icon = CreateIconIndirect(&iconinfo);
+
+ if(icon == NULL)
+ error("CreateIconIndirect %dx%d failed\n", width, height);
+
+ if(andbuf)
+ delete[] andbuf;
+
+ if(xorbuf)
+ delete[] xorbuf;
+
+ DeleteObject(hbmMask);
+ DeleteObject(hbmColor);
+
+ return icon;
+}
+
+void ui_destroy_cursor(RDPCLIENT *, HCURSOR cursor)
+{
+ DestroyIcon(cursor);
+}
+
+/* glyphs */
+HGLYPH ui_create_glyph(RDPCLIENT * This, int width, int height, const uint8 * data)
+{
+ uint8 * databuf = NULL;
+ uint8 * databits = win32_convert_scanlines(width, height, 1, 1, 2, data, &databuf);
+
+ HBITMAP hbm = CreateBitmap(width, height, 1, 1, databits);
+
+ if(databuf)
+ delete[] databuf;
+
+ const uint8 * p = data;
+ int stride = alignup(alignup(width, 8) / 8, 1);
+
+#ifdef _DEBUG
+ printf("glyph %p\n", hbm);
+
+ for(int i = 0; i < height; ++ i, p += stride)
+ {
+ for(int j = 0; j < width; ++ j)
+ {
+ int B = p[j / 8];
+ int b = 8 - j % 8 - 1;
+
+ if(B & (1 << b))
+ fputs("##", stdout);
+ else
+ fputs("..", stdout);
+ }
+
+ fputc('\n', stdout);
+ }
+
+ fputc('\n', stdout);
+#endif
+
+ return hbm;
+}
+
+void ui_destroy_glyph(RDPCLIENT *, HGLYPH glyph)
+{
+ DeleteObject(glyph);
+}
+
+/* Input window */
+void ui_move_pointer(RDPCLIENT * This, int x, int y)
+{
+ // TODO
+}
+
+void ui_set_cursor(RDPCLIENT * This, HCURSOR cursor)
+{
+ // TODO
+}
+
+void ui_set_null_cursor(RDPCLIENT * This)
+{
+ // TODO
+}
+
+/* Miscellaneous */
+void ui_resize_window(RDPCLIENT * This)
+{
+}
+
+void ui_bell(RDPCLIENT *)
+{
+ MessageBeep(0);
+}
+
+int ui_select(RDPCLIENT * This, SOCKET rdp_socket)
+{
+ return SleepEx(0, TRUE) == WAIT_IO_COMPLETION;
+}
+
+/* Events */
+BOOL event_pubkey(RDPCLIENT * This, unsigned char * key, unsigned int key_size)
+{
+ if(!RdpClient::OnPublicKey(This, key, key_size))
+ return FALSE;
+ else
+ return TRUE;
+}
+
+void event_logon(RDPCLIENT * This)
+{
+ RdpClient::OnLogon(This);
+}
+
+BOOL event_redirect(RDPCLIENT * This, uint32 flags, uint32 server_len, wchar_t * server, uint32 cookie_len, char * cookie, uint32 username_len, wchar_t * username, uint32 domain_len, wchar_t * domain, uint32 password_len, wchar_t * password)
+{
+ if
+ (
+ !RdpClient::OnRedirect
+ (
+ This,
+ flags,
+ server_len,
+ server,
+ cookie_len,
+ cookie,
+ username_len,
+ username,
+ domain_len,
+ domain,
+ password_len,
+ password
+ )
+ )
+ return FALSE;
+ else
+ return TRUE;
+}
+
+}
+
+class ClassFactory: public IClassFactory
+{
+private:
+ LONG m_refCount;
+ CLSID m_classId;
+ unsigned m_libIndex;
+
+public:
+ ClassFactory(REFCLSID rclsid, unsigned libIndex):
+ m_refCount(1),
+ m_classId(rclsid)
+ {
+ lockServer();
+ }
+
+ ~ClassFactory()
+ {
+ unlockServer();
+ }
+
+ virtual STDMETHODIMP QueryInterface(REFIID riid, void ** ppvObject)
+ {
+ if(riid == IID_IUnknown || riid == IID_IClassFactory)
+ {
+ *ppvObject = this;
+ return S_OK;
+ }
+ else
+ {
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+ }
+
+ virtual STDMETHODIMP_(ULONG) AddRef()
+ {
+ return InterlockedIncrement(&m_refCount);
+ }
+
+ virtual STDMETHODIMP_(ULONG) Release()
+ {
+ LONG n = InterlockedDecrement(&m_refCount);
+
+ if(n == 0)
+ delete this;
+
+ return n;
+ }
+
+ virtual STDMETHODIMP CreateInstance(IUnknown * pUnkOuter, REFIID riid, void ** ppvObject)
+ {
+ if(pUnkOuter && riid != IID_IUnknown)
+ return CLASS_E_NOAGGREGATION;
+
+ return RdpClient::CreateInstance(m_classId, m_libIndex, pUnkOuter, riid, ppvObject);
+ }
+
+ virtual STDMETHODIMP LockServer(BOOL fLock)
+ {
+ if(fLock)
+ lockServer();
+ else
+ unlockServer();
+
+ return S_OK;
+ }
+};
+
+extern "C"
+{
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv)
+{
+ unsigned libindex;
+
+ if
+ (
+ rclsid == MSTSCLib::CLSID_MsTscAx ||
+ rclsid == MSTSCLib::CLSID_MsRdpClient ||
+ rclsid == MSTSCLib::CLSID_MsRdpClient2 ||
+ rclsid == MSTSCLib::CLSID_MsRdpClient3 ||
+ rclsid == MSTSCLib::CLSID_MsRdpClient4
+ )
+ libindex = 1;
+ else if
+ (
+ rclsid == MSTSCLib_Redist::CLSID_MsTscAx ||
+ rclsid == MSTSCLib_Redist::CLSID_MsRdpClient ||
+ rclsid == MSTSCLib_Redist::CLSID_MsRdpClient2 ||
+ rclsid == MSTSCLib_Redist::CLSID_MsRdpClient3 // ||
+ // rclsid != MSTSCLib::CLSID_MsRdpClient4
+ )
+ libindex = 2;
+ else
+ return CLASS_E_CLASSNOTAVAILABLE;
+
+ ClassFactory * p = new ClassFactory(rclsid, libindex);
+
+ if(p == NULL)
+ return E_OUTOFMEMORY;
+
+ HRESULT hr = p->QueryInterface(riid, ppv);
+
+ p->Release();
+
+ if(FAILED(hr))
+ return hr;
+
+ return S_OK;
+}
+
+STDAPI DllCanUnloadNow(void)
+{
+ return canUnloadServer() ? S_OK : S_FALSE;
+}
+
+STDAPI_(ULONG) DllGetTscCtlVer(void)
+{
+ // BUGBUG: don't hardcode this
+ return 0x05020ECE; // 5.2.3790
+}
+
+DWORD WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
+{
+ assert(hInstance == GetCurrentModule());
+
+ switch(fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ {
+ DisableThreadLibraryCalls(hInstance);
+
+ if(!RdpClient::Startup())
+ return FALSE;
+ }
+
+ break;
+
+ case DLL_PROCESS_DETACH:
+ {
+ // Process is terminating, no need to clean up
+ if(lpvReserved)
+ break;
+
+ RdpClient::Shutdown();
+ }
+
+ break;
+ }
+
+ return TRUE;
+}
+
+}
+
+// EOF
--- /dev/null
+[
+#ifdef MSTSCLIB_REDIST_
+ uuid(AF586AAE-B62A-420E-B796-294E7EE64C70),
+#else
+ uuid(8C11EFA1-92C3-11D1-BC1E-00C04FA31489),
+#endif
+ version(1.0)
+]
+library MSTSCLib
+{
+ importlib("stdole32.tlb");
+
+ dispinterface IMsTscAxEvents;
+
+ interface IMsTscAx;
+ interface IMsRdpClient;
+ interface IMsRdpClient2;
+ interface IMsRdpClient3;
+ interface IMsRdpClient4;
+
+ interface IMsTscNonScriptable;
+ interface IMsRdpClientNonScriptable;
+ interface IMsRdpClientNonScriptable2;
+
+ interface IMsTscAdvancedSettings;
+ interface IMsRdpClientAdvancedSettings;
+ interface IMsRdpClientAdvancedSettings2;
+ interface IMsRdpClientAdvancedSettings3;
+ interface IMsRdpClientAdvancedSettings4;
+
+ interface IMsTscSecuredSettings;
+ interface IMsRdpClientSecuredSettings;
+
+ interface IMsTscDebug;
+
+ typedef [public] enum __MIDL___MIDL_itf_mstsax_0275_0001
+ {
+ autoReconnectContinueAutomatic = 0,
+ autoReconnectContinueStop = 1,
+ autoReconnectContinueManual = 2
+ }
+ AutoReconnectContinueState;
+
+ typedef [public] enum __MIDL_IMsRdpClient_0001
+ {
+ exDiscReasonNoInfo = 0,
+ exDiscReasonAPIInitiatedDisconnect = 1,
+ exDiscReasonAPIInitiatedLogoff = 2,
+ exDiscReasonServerIdleTimeout = 3,
+ exDiscReasonServerLogonTimeout = 4,
+ exDiscReasonReplacedByOtherConnection = 5,
+ exDiscReasonOutOfMemory = 6,
+ exDiscReasonServerDeniedConnection = 7,
+ exDiscReasonServerDeniedConnectionFips = 8,
+ exDiscReasonLicenseInternal = 256,
+ exDiscReasonLicenseNoLicenseServer = 257,
+ exDiscReasonLicenseNoLicense = 258,
+ exDiscReasonLicenseErrClientMsg = 259,
+ exDiscReasonLicenseHwidDoesntMatchLicense = 260,
+ exDiscReasonLicenseErrClientLicense = 261,
+ exDiscReasonLicenseCantFinishProtocol = 262,
+ exDiscReasonLicenseClientEndedProtocol = 263,
+ exDiscReasonLicenseErrClientEncryption = 264,
+ exDiscReasonLicenseCantUpgradeLicense = 265,
+ exDiscReasonLicenseNoRemoteConnections = 266,
+ exDiscReasonProtocolRangeStart = 4096,
+ exDiscReasonProtocolRangeEnd = 32767
+ }
+ ExtendedDisconnectReasonCode;
+
+ typedef [public] enum __MIDL_IMsRdpClient_0002
+ {
+ controlCloseCanProceed = 0,
+ controlCloseWaitForEvents = 1
+ }
+ ControlCloseStatus;
+
+ typedef [public] unsigned __int3264 UINT_PTR;
+ typedef [public] __int3264 LONG_PTR;
+
+ [uuid(336D5562-EFA8-482E-8CB3-C5C0FC7A7DB6)]
+ dispinterface IMsTscAxEvents
+ {
+ properties:
+
+ methods:
+ [id(0x00000001)] void OnConnecting();
+ [id(0x00000002)] void OnConnected();
+ [id(0x00000003)] void OnLoginComplete();
+ [id(0x00000004)] void OnDisconnected([in] long discReason);
+ [id(0x00000005)] void OnEnterFullScreenMode();
+ [id(0x00000006)] void OnLeaveFullScreenMode();
+ [id(0x00000007)] void OnChannelReceivedData([in] BSTR chanName, [in] BSTR data);
+ [id(0x00000008)] void OnRequestGoFullScreen();
+ [id(0x00000009)] void OnRequestLeaveFullScreen();
+ [id(0x0000000a)] void OnFatalError([in] long errorCode);
+ [id(0x0000000b)] void OnWarning([in] long warningCode);
+ [id(0x0000000c)] void OnRemoteDesktopSizeChange([in] long width, [in] long height);
+ [id(0x0000000d)] void OnIdleTimeoutNotification();
+ [id(0x0000000e)] void OnRequestContainerMinimize();
+ [id(0x0000000f)] void OnConfirmClose([out, retval] VARIANT_BOOL * pfAllowClose);
+ [id(0x00000010)] void OnReceivedTSPublicKey([in] BSTR publicKey, [out, retval] VARIANT_BOOL * pfContinueLogon);
+ [id(0x00000011)] void OnAutoReconnecting([in] long disconnectReason, [in] long attemptCount, [out, retval] AutoReconnectContinueState * pArcContinueStatus);
+ [id(0x00000012)] void OnAuthenticationWarningDisplayed();
+ [id(0x00000013)] void OnAuthenticationWarningDismissed();
+ };
+
+ [
+#ifdef MSTSCLIB_REDIST_
+ uuid(327BB5CD-834E-4400-AEF2-B30E15E5D682),
+#else
+ uuid(8C11EFAE-92C3-11D1-BC1E-00C04FA31489),
+#endif
+ dual,
+ oleautomation
+ ]
+ interface IMsTscAx: IDispatch
+ {
+ [id(0x00000001), propput] HRESULT Server([in] BSTR pServer);
+ [id(0x00000001), propget] HRESULT Server([out, retval] BSTR * pServer);
+ [id(0x00000002), propput] HRESULT Domain([in] BSTR pDomain);
+ [id(0x00000002), propget] HRESULT Domain([out, retval] BSTR * pDomain);
+ [id(0x00000003), propput] HRESULT UserName([in] BSTR pUserName);
+ [id(0x00000003), propget] HRESULT UserName([out, retval] BSTR * pUserName);
+ [id(0x00000004), propput] HRESULT DisconnectedText([in] BSTR pDisconnectedText);
+ [id(0x00000004), propget] HRESULT DisconnectedText([out, retval] BSTR * pDisconnectedText);
+ [id(0x00000005), propput] HRESULT ConnectingText([in] BSTR pConnectingText);
+ [id(0x00000005), propget] HRESULT ConnectingText([out, retval] BSTR * pConnectingText);
+ [id(0x00000006), propget] HRESULT Connected([out, retval] short * pIsConnected);
+ [id(0x0000000c), propput] HRESULT DesktopWidth([in] long pVal);
+ [id(0x0000000c), propget] HRESULT DesktopWidth([out, retval] long * pVal);
+ [id(0x0000000d), propput] HRESULT DesktopHeight([in] long pVal);
+ [id(0x0000000d), propget] HRESULT DesktopHeight([out, retval] long * pVal);
+ [id(0x00000010), propput] HRESULT StartConnected([in] long pfStartConnected);
+ [id(0x00000010), propget] HRESULT StartConnected([out, retval] long * pfStartConnected);
+ [id(0x00000011), propget] HRESULT HorizontalScrollBarVisible([out, retval] long * pfHScrollVisible);
+ [id(0x00000012), propget] HRESULT VerticalScrollBarVisible([out, retval] long * pfVScrollVisible);
+ [id(0x00000013), propput] HRESULT FullScreenTitle([in] BSTR rhs);
+ [id(0x00000014), propget] HRESULT CipherStrength([out, retval] long * pCipherStrength);
+ [id(0x00000015), propget] HRESULT Version([out, retval] BSTR * pVersion);
+ [id(0x00000016), propget] HRESULT SecuredSettingsEnabled([out, retval] long * pSecuredSettingsEnabled);
+ [id(0x00000061), propget] HRESULT SecuredSettings([out, retval] IMsTscSecuredSettings ** ppSecuredSettings);
+ [id(0x00000062), propget] HRESULT AdvancedSettings([out, retval] IMsTscAdvancedSettings ** ppAdvSettings);
+ [id(0x00000063), propget, hidden] HRESULT Debugger([out, retval] IMsTscDebug ** ppDebugger);
+ [id(0x0000001e)] HRESULT Connect();
+ [id(0x0000001f)] HRESULT Disconnect();
+ [id(0x00000021)] HRESULT CreateVirtualChannels([in] BSTR newVal);
+ [id(0x00000022)] HRESULT SendOnVirtualChannel([in] BSTR chanName, [in] BSTR ChanData);
+ };
+
+ [
+ uuid(92B4A539-7115-4B7C-A5A9-E5D9EFC2780A),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClient: IMsTscAx
+ {
+ [id(0x00000064), propput] HRESULT ColorDepth([in] long pcolorDepth);
+ [id(0x00000064), propget] HRESULT ColorDepth([out, retval] long * pcolorDepth);
+ [id(0x00000065), propget] HRESULT AdvancedSettings2([out, retval] IMsRdpClientAdvancedSettings ** ppAdvSettings);
+ [id(0x00000066), propget] HRESULT SecuredSettings2([out, retval] IMsRdpClientSecuredSettings ** ppSecuredSettings);
+ [id(0x00000067), propget] HRESULT ExtendedDisconnectReason([out, retval] ExtendedDisconnectReasonCode * pExtendedDisconnectReason);
+ [id(0x00000068), propput] HRESULT FullScreen([in] VARIANT_BOOL pfFullScreen);
+ [id(0x00000068), propget] HRESULT FullScreen([out, retval] VARIANT_BOOL * pfFullScreen);
+ [id(0x00000023)] HRESULT SetVirtualChannelOptions([in] BSTR chanName, [in] long chanOptions);
+ [id(0x00000024)] HRESULT GetVirtualChannelOptions([in] BSTR chanName, [out, retval] long * pChanOptions);
+ [id(0x00000025)] HRESULT RequestClose([out, retval] ControlCloseStatus * pCloseStatus);
+ };
+
+ [
+ uuid(E7E17DC4-3B71-4BA7-A8E6-281FFADCA28F),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClient2: IMsRdpClient
+ {
+ [id(0x000000c8), propget] HRESULT AdvancedSettings3([out, retval] IMsRdpClientAdvancedSettings2 ** ppAdvSettings);
+ [id(0x000000c9), propput] HRESULT ConnectedStatusText([in] BSTR pConnectedStatusText);
+ [id(0x000000c9), propget] HRESULT ConnectedStatusText([out, retval] BSTR * pConnectedStatusText);
+ };
+
+ [
+ uuid(91B7CBC5-A72E-4FA0-9300-D647D7E897FF),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClient3: IMsRdpClient2
+ {
+ [id(0x0000012c), propget] HRESULT AdvancedSettings4([out, retval] IMsRdpClientAdvancedSettings3 ** ppAdvSettings);
+ };
+
+ [
+ uuid(095E0738-D97D-488B-B9F6-DD0E8D66C0DE),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClient4: IMsRdpClient3
+ {
+ [id(0x00000190), propget] HRESULT AdvancedSettings5([out, retval] IMsRdpClientAdvancedSettings4 ** ppAdvSettings5);
+ };
+
+ [uuid(C1E6743A-41C1-4A74-832A-0DD06C1C7A0E)]
+ interface IMsTscNonScriptable: IUnknown
+ {
+ [propput] HRESULT ClearTextPassword([in] BSTR rhs);
+ [propput] HRESULT PortablePassword([in] BSTR pPortablePass);
+ [propget] HRESULT PortablePassword([out, retval] BSTR * pPortablePass);
+ [propput] HRESULT PortableSalt([in] BSTR pPortableSalt);
+ [propget] HRESULT PortableSalt([out, retval] BSTR * pPortableSalt);
+ [propput] HRESULT BinaryPassword([in] BSTR pBinaryPassword);
+ [propget] HRESULT BinaryPassword([out, retval] BSTR * pBinaryPassword);
+ [propput] HRESULT BinarySalt([in] BSTR pSalt);
+ [propget] HRESULT BinarySalt([out, retval] BSTR * pSalt);
+ HRESULT ResetPassword();
+ };
+
+ [uuid(2F079C4C-87B2-4AFD-97AB-20CDB43038AE)]
+ interface IMsRdpClientNonScriptable: IMsTscNonScriptable
+ {
+ HRESULT NotifyRedirectDeviceChange([in] UINT_PTR wParam, [in] LONG_PTR lParam);
+ HRESULT SendKeys([in] long numKeys, [in] VARIANT_BOOL * pbArrayKeyUp, [in] long * plKeyData);
+ };
+
+ [uuid(17A5E535-4072-4FA4-AF32-C8D0D47345E9)]
+ interface IMsRdpClientNonScriptable2: IMsRdpClientNonScriptable
+ {
+ [propput] HRESULT UIParentWindowHandle([in] HWND phwndUIParentWindowHandle);
+ [propget] HRESULT UIParentWindowHandle([out, retval] HWND * phwndUIParentWindowHandle);
+ };
+
+ [
+ uuid(809945CC-4B3B-4A92-A6B0-DBF9B5F2EF2D),
+ dual,
+ oleautomation
+ ]
+ interface IMsTscAdvancedSettings: IDispatch
+ {
+ [id(0x00000079), propput] HRESULT Compress([in] long pcompress);
+ [id(0x00000079), propget] HRESULT Compress([out, retval] long * pcompress);
+ [id(0x0000007a), propput] HRESULT BitmapPeristence([in] long pbitmapPeristence);
+ [id(0x0000007a), propget] HRESULT BitmapPeristence([out, retval] long * pbitmapPeristence);
+ [id(0x000000a1), propput] HRESULT allowBackgroundInput([in] long pallowBackgroundInput);
+ [id(0x000000a1), propget] HRESULT allowBackgroundInput([out, retval] long * pallowBackgroundInput);
+ [id(0x000000a2), propput] HRESULT KeyBoardLayoutStr([in] BSTR rhs);
+ [id(0x000000aa), propput] HRESULT PluginDlls([in] BSTR rhs);
+ [id(0x000000ab), propput] HRESULT IconFile([in] BSTR rhs);
+ [id(0x000000ac), propput] HRESULT IconIndex([in] long rhs);
+ [id(0x000000ad), propput] HRESULT ContainerHandledFullScreen([in] long pContainerHandledFullScreen);
+ [id(0x000000ad), propget] HRESULT ContainerHandledFullScreen([out, retval] long * pContainerHandledFullScreen);
+ [id(0x000000ae), propput] HRESULT DisableRdpdr([in] long pDisableRdpdr);
+ [id(0x000000ae), propget] HRESULT DisableRdpdr([out, retval] long * pDisableRdpdr);
+ };
+
+ [
+ uuid(3C65B4AB-12B3-465B-ACD4-B8DAD3BFF9E2),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClientAdvancedSettings: IMsTscAdvancedSettings
+ {
+ [id(0x00000065), propput] HRESULT SmoothScroll([in] long psmoothScroll);
+ [id(0x00000065), propget] HRESULT SmoothScroll([out, retval] long * psmoothScroll);
+ [id(0x00000066), propput] HRESULT AcceleratorPassthrough([in] long pacceleratorPassthrough);
+ [id(0x00000066), propget] HRESULT AcceleratorPassthrough([out, retval] long * pacceleratorPassthrough);
+ [id(0x00000067), propput] HRESULT ShadowBitmap([in] long pshadowBitmap);
+ [id(0x00000067), propget] HRESULT ShadowBitmap([out, retval] long * pshadowBitmap);
+ [id(0x00000068), propput] HRESULT TransportType([in] long ptransportType);
+ [id(0x00000068), propget] HRESULT TransportType([out, retval] long * ptransportType);
+ [id(0x00000069), propput] HRESULT SasSequence([in] long psasSequence);
+ [id(0x00000069), propget] HRESULT SasSequence([out, retval] long * psasSequence);
+ [id(0x0000006a), propput] HRESULT EncryptionEnabled([in] long pencryptionEnabled);
+ [id(0x0000006a), propget] HRESULT EncryptionEnabled([out, retval] long * pencryptionEnabled);
+ [id(0x0000006b), propput] HRESULT DedicatedTerminal([in] long pdedicatedTerminal);
+ [id(0x0000006b), propget] HRESULT DedicatedTerminal([out, retval] long * pdedicatedTerminal);
+ [id(0x0000006c), propput] HRESULT RDPPort([in] long prdpPort);
+ [id(0x0000006c), propget] HRESULT RDPPort([out, retval] long * prdpPort);
+ [id(0x0000006d), propput] HRESULT EnableMouse([in] long penableMouse);
+ [id(0x0000006d), propget] HRESULT EnableMouse([out, retval] long * penableMouse);
+ [id(0x0000006e), propput] HRESULT DisableCtrlAltDel([in] long pdisableCtrlAltDel);
+ [id(0x0000006e), propget] HRESULT DisableCtrlAltDel([out, retval] long * pdisableCtrlAltDel);
+ [id(0x0000006f), propput] HRESULT EnableWindowsKey([in] long penableWindowsKey);
+ [id(0x0000006f), propget] HRESULT EnableWindowsKey([out, retval] long * penableWindowsKey);
+ [id(0x00000070), propput] HRESULT DoubleClickDetect([in] long pdoubleClickDetect);
+ [id(0x00000070), propget] HRESULT DoubleClickDetect([out, retval] long * pdoubleClickDetect);
+ [id(0x00000071), propput] HRESULT MaximizeShell([in] long pmaximizeShell);
+ [id(0x00000071), propget] HRESULT MaximizeShell([out, retval] long * pmaximizeShell);
+ [id(0x00000072), propput] HRESULT HotKeyFullScreen([in] long photKeyFullScreen);
+ [id(0x00000072), propget] HRESULT HotKeyFullScreen([out, retval] long * photKeyFullScreen);
+ [id(0x00000073), propput] HRESULT HotKeyCtrlEsc([in] long photKeyCtrlEsc);
+ [id(0x00000073), propget] HRESULT HotKeyCtrlEsc([out, retval] long * photKeyCtrlEsc);
+ [id(0x00000074), propput] HRESULT HotKeyAltEsc([in] long photKeyAltEsc);
+ [id(0x00000074), propget] HRESULT HotKeyAltEsc([out, retval] long * photKeyAltEsc);
+ [id(0x00000075), propput] HRESULT HotKeyAltTab([in] long photKeyAltTab);
+ [id(0x00000075), propget] HRESULT HotKeyAltTab([out, retval] long * photKeyAltTab);
+ [id(0x00000076), propput] HRESULT HotKeyAltShiftTab([in] long photKeyAltShiftTab);
+ [id(0x00000076), propget] HRESULT HotKeyAltShiftTab([out, retval] long * photKeyAltShiftTab);
+ [id(0x00000077), propput] HRESULT HotKeyAltSpace([in] long photKeyAltSpace);
+ [id(0x00000077), propget] HRESULT HotKeyAltSpace([out, retval] long * photKeyAltSpace);
+ [id(0x00000078), propput] HRESULT HotKeyCtrlAltDel([in] long photKeyCtrlAltDel);
+ [id(0x00000078), propget] HRESULT HotKeyCtrlAltDel([out, retval] long * photKeyCtrlAltDel);
+ [id(0x0000007b), propput] HRESULT orderDrawThreshold([in] long porderDrawThreshold);
+ [id(0x0000007b), propget] HRESULT orderDrawThreshold([out, retval] long * porderDrawThreshold);
+ [id(0x0000007c), propput] HRESULT BitmapCacheSize([in] long pbitmapCacheSize);
+ [id(0x0000007c), propget] HRESULT BitmapCacheSize([out, retval] long * pbitmapCacheSize);
+ [id(0x0000007d), propput] HRESULT BitmapVirtualCacheSize([in] long pbitmapVirtualCacheSize);
+ [id(0x0000007d), propget] HRESULT BitmapVirtualCacheSize([out, retval] long * pbitmapVirtualCacheSize);
+ [id(0x000000af), propput] HRESULT ScaleBitmapCachesByBPP([in] long pbScale);
+ [id(0x000000af), propget] HRESULT ScaleBitmapCachesByBPP([out, retval] long * pbScale);
+ [id(0x0000007e), propput] HRESULT NumBitmapCaches([in] long pnumBitmapCaches);
+ [id(0x0000007e), propget] HRESULT NumBitmapCaches([out, retval] long * pnumBitmapCaches);
+ [id(0x0000007f), propput] HRESULT CachePersistenceActive([in] long pcachePersistenceActive);
+ [id(0x0000007f), propget] HRESULT CachePersistenceActive([out, retval] long * pcachePersistenceActive);
+ [id(0x0000008a), propput] HRESULT PersistCacheDirectory([in] BSTR rhs);
+ [id(0x0000009c), propput] HRESULT brushSupportLevel([in] long pbrushSupportLevel);
+ [id(0x0000009c), propget] HRESULT brushSupportLevel([out, retval] long * pbrushSupportLevel);
+ [id(0x0000009d), propput] HRESULT minInputSendInterval([in] long pminInputSendInterval);
+ [id(0x0000009d), propget] HRESULT minInputSendInterval([out, retval] long * pminInputSendInterval);
+ [id(0x0000009e), propput] HRESULT InputEventsAtOnce([in] long pinputEventsAtOnce);
+ [id(0x0000009e), propget] HRESULT InputEventsAtOnce([out, retval] long * pinputEventsAtOnce);
+ [id(0x0000009f), propput] HRESULT maxEventCount([in] long pmaxEventCount);
+ [id(0x0000009f), propget] HRESULT maxEventCount([out, retval] long * pmaxEventCount);
+ [id(0x000000a0), propput] HRESULT keepAliveInterval([in] long pkeepAliveInterval);
+ [id(0x000000a0), propget] HRESULT keepAliveInterval([out, retval] long * pkeepAliveInterval);
+ [id(0x000000a3), propput] HRESULT shutdownTimeout([in] long pshutdownTimeout);
+ [id(0x000000a3), propget] HRESULT shutdownTimeout([out, retval] long * pshutdownTimeout);
+ [id(0x000000a4), propput] HRESULT overallConnectionTimeout([in] long poverallConnectionTimeout);
+ [id(0x000000a4), propget] HRESULT overallConnectionTimeout([out, retval] long * poverallConnectionTimeout);
+ [id(0x000000a5), propput] HRESULT singleConnectionTimeout([in] long psingleConnectionTimeout);
+ [id(0x000000a5), propget] HRESULT singleConnectionTimeout([out, retval] long * psingleConnectionTimeout);
+ [id(0x000000a6), propput] HRESULT KeyboardType([in] long pkeyboardType);
+ [id(0x000000a6), propget] HRESULT KeyboardType([out, retval] long * pkeyboardType);
+ [id(0x000000a7), propput] HRESULT KeyboardSubType([in] long pkeyboardSubType);
+ [id(0x000000a7), propget] HRESULT KeyboardSubType([out, retval] long * pkeyboardSubType);
+ [id(0x000000a8), propput] HRESULT KeyboardFunctionKey([in] long pkeyboardFunctionKey);
+ [id(0x000000a8), propget] HRESULT KeyboardFunctionKey([out, retval] long * pkeyboardFunctionKey);
+ [id(0x000000a9), propput] HRESULT WinceFixedPalette([in] long pwinceFixedPalette);
+ [id(0x000000a9), propget] HRESULT WinceFixedPalette([out, retval] long * pwinceFixedPalette);
+ [id(0x000000b2), propput] HRESULT ConnectToServerConsole([in] VARIANT_BOOL pConnectToConsole);
+ [id(0x000000b2), propget] HRESULT ConnectToServerConsole([out, retval] VARIANT_BOOL * pConnectToConsole);
+ [id(0x000000b6), propput] HRESULT BitmapPersistence([in] long pbitmapPersistence);
+ [id(0x000000b6), propget] HRESULT BitmapPersistence([out, retval] long * pbitmapPersistence);
+ [id(0x000000b7), propput] HRESULT MinutesToIdleTimeout([in] long pminutesToIdleTimeout);
+ [id(0x000000b7), propget] HRESULT MinutesToIdleTimeout([out, retval] long * pminutesToIdleTimeout);
+ [id(0x000000b8), propput] HRESULT SmartSizing([in] VARIANT_BOOL pfSmartSizing);
+ [id(0x000000b8), propget] HRESULT SmartSizing([out, retval] VARIANT_BOOL * pfSmartSizing);
+ [id(0x000000b9), propput] HRESULT RdpdrLocalPrintingDocName([in] BSTR pLocalPrintingDocName);
+ [id(0x000000b9), propget] HRESULT RdpdrLocalPrintingDocName([out, retval] BSTR * pLocalPrintingDocName);
+ [id(0x000000c9), propput] HRESULT RdpdrClipCleanTempDirString([in] BSTR clipCleanTempDirString);
+ [id(0x000000c9), propget] HRESULT RdpdrClipCleanTempDirString([out, retval] BSTR * clipCleanTempDirString);
+ [id(0x000000ca), propput] HRESULT RdpdrClipPasteInfoString([in] BSTR clipPasteInfoString);
+ [id(0x000000ca), propget] HRESULT RdpdrClipPasteInfoString([out, retval] BSTR * clipPasteInfoString);
+ [id(0x000000ba), propput] HRESULT ClearTextPassword([in] BSTR rhs);
+ [id(0x000000bb), propput] HRESULT DisplayConnectionBar([in] VARIANT_BOOL pDisplayConnectionBar);
+ [id(0x000000bb), propget] HRESULT DisplayConnectionBar([out, retval] VARIANT_BOOL * pDisplayConnectionBar);
+ [id(0x000000bc), propput] HRESULT PinConnectionBar([in] VARIANT_BOOL pPinConnectionBar);
+ [id(0x000000bc), propget] HRESULT PinConnectionBar([out, retval] VARIANT_BOOL * pPinConnectionBar);
+ [id(0x000000bd), propput] HRESULT GrabFocusOnConnect([in] VARIANT_BOOL pfGrabFocusOnConnect);
+ [id(0x000000bd), propget] HRESULT GrabFocusOnConnect([out, retval] VARIANT_BOOL * pfGrabFocusOnConnect);
+ [id(0x000000be), propput] HRESULT LoadBalanceInfo([in] BSTR pLBInfo);
+ [id(0x000000be), propget] HRESULT LoadBalanceInfo([out, retval] BSTR * pLBInfo);
+ [id(0x000000bf), propput] HRESULT RedirectDrives([in] VARIANT_BOOL pRedirectDrives);
+ [id(0x000000bf), propget] HRESULT RedirectDrives([out, retval] VARIANT_BOOL * pRedirectDrives);
+ [id(0x000000c0), propput] HRESULT RedirectPrinters([in] VARIANT_BOOL pRedirectPrinters);
+ [id(0x000000c0), propget] HRESULT RedirectPrinters([out, retval] VARIANT_BOOL * pRedirectPrinters);
+ [id(0x000000c1), propput] HRESULT RedirectPorts([in] VARIANT_BOOL pRedirectPorts);
+ [id(0x000000c1), propget] HRESULT RedirectPorts([out, retval] VARIANT_BOOL * pRedirectPorts);
+ [id(0x000000c2), propput] HRESULT RedirectSmartCards([in] VARIANT_BOOL pRedirectSmartCards);
+ [id(0x000000c2), propget] HRESULT RedirectSmartCards([out, retval] VARIANT_BOOL * pRedirectSmartCards);
+ [id(0x000000c3), propput] HRESULT BitmapVirtualCache16BppSize([in] long pBitmapVirtualCache16BppSize);
+ [id(0x000000c3), propget] HRESULT BitmapVirtualCache16BppSize([out, retval] long * pBitmapVirtualCache16BppSize);
+ [id(0x000000c4), propput] HRESULT BitmapVirtualCache24BppSize([in] long pBitmapVirtualCache24BppSize);
+ [id(0x000000c4), propget] HRESULT BitmapVirtualCache24BppSize([out, retval] long * pBitmapVirtualCache24BppSize);
+ [id(0x000000c8), propput] HRESULT PerformanceFlags([in] long pDisableList);
+ [id(0x000000c8), propget] HRESULT PerformanceFlags([out, retval] long * pDisableList);
+ [id(0x000000cb), propput] HRESULT ConnectWithEndpoint([in] VARIANT * rhs);
+ [id(0x000000cc), propput] HRESULT NotifyTSPublicKey([in] VARIANT_BOOL pfNotify);
+ [id(0x000000cc), propget] HRESULT NotifyTSPublicKey([out, retval] VARIANT_BOOL * pfNotify);
+ };
+
+ [
+ uuid(9AC42117-2B76-4320-AA44-0E616AB8437B),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClientAdvancedSettings2: IMsRdpClientAdvancedSettings
+ {
+ [id(0x000000cd), propget] HRESULT CanAutoReconnect([out, retval] VARIANT_BOOL * pfCanAutoReconnect);
+ [id(0x000000ce), propput] HRESULT EnableAutoReconnect([in] VARIANT_BOOL pfEnableAutoReconnect);
+ [id(0x000000ce), propget] HRESULT EnableAutoReconnect([out, retval] VARIANT_BOOL * pfEnableAutoReconnect);
+ [id(0x000000cf), propput] HRESULT MaxReconnectAttempts([in] long pMaxReconnectAttempts);
+ [id(0x000000cf), propget] HRESULT MaxReconnectAttempts([out, retval] long * pMaxReconnectAttempts);
+ };
+
+ [
+ uuid(19CD856B-C542-4C53-ACEE-F127E3BE1A59),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClientAdvancedSettings3: IMsRdpClientAdvancedSettings2
+ {
+ [id(0x000000d2), propput] HRESULT ConnectionBarShowMinimizeButton([in] VARIANT_BOOL pfShowMinimize);
+ [id(0x000000d2), propget] HRESULT ConnectionBarShowMinimizeButton([out, retval] VARIANT_BOOL * pfShowMinimize);
+ [id(0x000000d3), propput] HRESULT ConnectionBarShowRestoreButton([in] VARIANT_BOOL pfShowRestore);
+ [id(0x000000d3), propget] HRESULT ConnectionBarShowRestoreButton([out, retval] VARIANT_BOOL * pfShowRestore);
+ };
+
+ [
+ uuid(FBA7F64E-7345-4405-AE50-FA4A763DC0DE),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClientAdvancedSettings4: IMsRdpClientAdvancedSettings3
+ {
+ [id(0x000000d4), propput] HRESULT AuthenticationLevel([in] unsigned int puiAuthLevel);
+ [id(0x000000d4), propget] HRESULT AuthenticationLevel([out, retval] unsigned int * puiAuthLevel);
+ };
+
+ [
+ uuid(C9D65442-A0F9-45B2-8F73-D61D2DB8CBB6),
+ dual,
+ oleautomation
+ ]
+ interface IMsTscSecuredSettings: IDispatch
+ {
+ [id(0x00000001), propput] HRESULT StartProgram([in] BSTR pStartProgram);
+ [id(0x00000001), propget] HRESULT StartProgram([out, retval] BSTR * pStartProgram);
+ [id(0x00000002), propput] HRESULT WorkDir([in] BSTR pWorkDir);
+ [id(0x00000002), propget] HRESULT WorkDir([out, retval] BSTR * pWorkDir);
+ [id(0x00000003), propput] HRESULT FullScreen([in] long pfFullScreen);
+ [id(0x00000003), propget] HRESULT FullScreen([out, retval] long * pfFullScreen);
+ };
+
+ [
+ uuid(605BEFCF-39C1-45CC-A811-068FB7BE346D),
+ dual,
+ oleautomation
+ ]
+ interface IMsRdpClientSecuredSettings: IMsTscSecuredSettings
+ {
+ [id(0x00000004), propput] HRESULT KeyboardHookMode([in] long pkeyboardHookMode);
+ [id(0x00000004), propget] HRESULT KeyboardHookMode([out, retval] long * pkeyboardHookMode);
+ [id(0x00000005), propput] HRESULT AudioRedirectionMode([in] long pAudioRedirectionMode);
+ [id(0x00000005), propget] HRESULT AudioRedirectionMode([out, retval] long * pAudioRedirectionMode);
+ };
+
+ [
+ uuid(209D0EB9-6254-47B1-9033-A98DAE55BB27),
+ hidden,
+ dual,
+ oleautomation
+ ]
+ interface IMsTscDebug: IDispatch
+ {
+ [id(0x000000c8), propput] HRESULT HatchBitmapPDU([in] long phatchBitmapPDU);
+ [id(0x000000c8), propget] HRESULT HatchBitmapPDU([out, retval] long * phatchBitmapPDU);
+ [id(0x000000c9), propput] HRESULT HatchSSBOrder([in] long phatchSSBOrder);
+ [id(0x000000c9), propget] HRESULT HatchSSBOrder([out, retval] long * phatchSSBOrder);
+ [id(0x000000ca), propput] HRESULT HatchMembltOrder([in] long phatchMembltOrder);
+ [id(0x000000ca), propget] HRESULT HatchMembltOrder([out, retval] long * phatchMembltOrder);
+ [id(0x000000cb), propput] HRESULT HatchIndexPDU([in] long phatchIndexPDU);
+ [id(0x000000cb), propget] HRESULT HatchIndexPDU([out, retval] long * phatchIndexPDU);
+ [id(0x000000cc), propput] HRESULT LabelMemblt([in] long plabelMemblt);
+ [id(0x000000cc), propget] HRESULT LabelMemblt([out, retval] long * plabelMemblt);
+ [id(0x000000cd), propput] HRESULT BitmapCacheMonitor([in] long pbitmapCacheMonitor);
+ [id(0x000000cd), propget] HRESULT BitmapCacheMonitor([out, retval] long * pbitmapCacheMonitor);
+ [id(0x000000ce), propput] HRESULT MallocFailuresPercent([in] long pmallocFailuresPercent);
+ [id(0x000000ce), propget] HRESULT MallocFailuresPercent([out, retval] long * pmallocFailuresPercent);
+ [id(0x000000cf), propput] HRESULT MallocHugeFailuresPercent([in] long pmallocHugeFailuresPercent);
+ [id(0x000000cf), propget] HRESULT MallocHugeFailuresPercent([out, retval] long * pmallocHugeFailuresPercent);
+ [id(0x000000d0), propput] HRESULT NetThroughput([in] long NetThroughput);
+ [id(0x000000d0), propget] HRESULT NetThroughput([out, retval] long * NetThroughput);
+ [id(0x000000d1), propput] HRESULT CLXCmdLine([in] BSTR pCLXCmdLine);
+ [id(0x000000d1), propget] HRESULT CLXCmdLine([out, retval] BSTR * pCLXCmdLine);
+ [id(0x000000d2), propput] HRESULT CLXDll([in] BSTR pCLXDll);
+ [id(0x000000d2), propget] HRESULT CLXDll([out, retval] BSTR * pCLXDll);
+ };
+
+ [
+#ifdef MSTSCLIB_REDIST_
+ uuid(1FB464C8-09BB-4017-A2F5-EB742F04392F)
+#else
+ uuid(A41A4187-5A86-4E26-B40A-856F9035D9CB)
+#endif
+ ]
+ coclass MsTscAx
+ {
+ interface IMsRdpClient;
+ [default] interface IMsTscAx;
+ [default, source] dispinterface IMsTscAxEvents;
+ interface IMsTscNonScriptable;
+ interface IMsRdpClientNonScriptable;
+ };
+
+ [
+#ifdef MSTSCLIB_REDIST_
+ uuid(791FA017-2DE3-492E-ACC5-53C67A2B94D0)
+#else
+ uuid(7CACBD7B-0D99-468F-AC33-22E495C0AFE5)
+#endif
+ ]
+ coclass MsRdpClient
+ {
+ [default] interface IMsRdpClient;
+ interface IMsTscAx;
+ [default, source] dispinterface IMsTscAxEvents;
+ interface IMsTscNonScriptable;
+ interface IMsRdpClientNonScriptable;
+ };
+
+ [
+#ifdef MSTSCLIB_REDIST_
+ uuid(9059F30F-4EB1-4BD2-9FDC-36F43A218F4A)
+#else
+ uuid(3523C2FB-4031-44E4-9A3B-F1E94986EE7F)
+#endif
+ ]
+ coclass MsRdpClient2
+ {
+ [default] interface IMsRdpClient2;
+ interface IMsRdpClient;
+ interface IMsTscAx;
+ [default, source] dispinterface IMsTscAxEvents;
+ interface IMsTscNonScriptable;
+ interface IMsRdpClientNonScriptable;
+ };
+
+ [
+#ifdef MSTSCLIB_REDIST_
+ uuid(7584C670-2274-4EFB-B00B-D6AABA6D3850)
+#else
+ uuid(ACE575FD-1FCF-4074-9401-EBAB990FA9DE)
+#endif
+ ]
+ coclass MsRdpClient3
+ {
+ [default] interface IMsRdpClient3;
+ interface IMsRdpClient2;
+ interface IMsRdpClient;
+ interface IMsTscAx;
+ [default, source] dispinterface IMsTscAxEvents;
+ interface IMsTscNonScriptable;
+ interface IMsRdpClientNonScriptable;
+ };
+
+ [uuid(6AE29350-321B-42BE-BBE5-12FB5270C0DE)]
+ coclass MsRdpClient4
+ {
+ [default] interface IMsRdpClient4;
+ interface IMsRdpClient3;
+ interface IMsRdpClient2;
+ interface IMsRdpClient;
+ interface IMsTscAx;
+ [default, source] dispinterface IMsTscAxEvents;
+ interface IMsTscNonScriptable;
+ interface IMsRdpClientNonScriptable;
+ interface IMsRdpClientNonScriptable2;
+ };
+
+};
+
+// EOF
--- /dev/null
+#define TYPELIB_RESOURCEID__ 1
+#include "./typelib.rh"
+// EOF
--- /dev/null
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 7.00.0493 */
+/* at Sun Aug 13 16:46:06 2006
+ */
+/* Compiler settings for .\mstsclib.idl:
+ Oicf, W1, Zp8, env=Win32 (32b run)
+ protocol : dce , ms_ext, c_ext, robust
+ error checks: allocation ref bounds_check enum stub_data
+ VC __declspec() decoration level:
+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
+ DECLSPEC_UUID(), MIDL_INTERFACE()
+*/
+//@@MIDL_FILE_HEADING( )
+
+#pragma warning( disable: 4049 ) /* more than 64k source lines */
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif // __RPCNDR_H_VERSION__
+
+
+#ifndef __mstsclib_h_h__
+#define __mstsclib_h_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IMsTscAxEvents_FWD_DEFINED__
+#define __IMsTscAxEvents_FWD_DEFINED__
+typedef interface IMsTscAxEvents IMsTscAxEvents;
+#endif /* __IMsTscAxEvents_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscAx_FWD_DEFINED__
+#define __IMsTscAx_FWD_DEFINED__
+typedef interface IMsTscAx IMsTscAx;
+#endif /* __IMsTscAx_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClient_FWD_DEFINED__
+#define __IMsRdpClient_FWD_DEFINED__
+typedef interface IMsRdpClient IMsRdpClient;
+#endif /* __IMsRdpClient_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClient2_FWD_DEFINED__
+#define __IMsRdpClient2_FWD_DEFINED__
+typedef interface IMsRdpClient2 IMsRdpClient2;
+#endif /* __IMsRdpClient2_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClient3_FWD_DEFINED__
+#define __IMsRdpClient3_FWD_DEFINED__
+typedef interface IMsRdpClient3 IMsRdpClient3;
+#endif /* __IMsRdpClient3_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClient4_FWD_DEFINED__
+#define __IMsRdpClient4_FWD_DEFINED__
+typedef interface IMsRdpClient4 IMsRdpClient4;
+#endif /* __IMsRdpClient4_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscNonScriptable_FWD_DEFINED__
+#define __IMsTscNonScriptable_FWD_DEFINED__
+typedef interface IMsTscNonScriptable IMsTscNonScriptable;
+#endif /* __IMsTscNonScriptable_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientNonScriptable_FWD_DEFINED__
+#define __IMsRdpClientNonScriptable_FWD_DEFINED__
+typedef interface IMsRdpClientNonScriptable IMsRdpClientNonScriptable;
+#endif /* __IMsRdpClientNonScriptable_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientNonScriptable2_FWD_DEFINED__
+#define __IMsRdpClientNonScriptable2_FWD_DEFINED__
+typedef interface IMsRdpClientNonScriptable2 IMsRdpClientNonScriptable2;
+#endif /* __IMsRdpClientNonScriptable2_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscAdvancedSettings_FWD_DEFINED__
+#define __IMsTscAdvancedSettings_FWD_DEFINED__
+typedef interface IMsTscAdvancedSettings IMsTscAdvancedSettings;
+#endif /* __IMsTscAdvancedSettings_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings_FWD_DEFINED__
+#define __IMsRdpClientAdvancedSettings_FWD_DEFINED__
+typedef interface IMsRdpClientAdvancedSettings IMsRdpClientAdvancedSettings;
+#endif /* __IMsRdpClientAdvancedSettings_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings2_FWD_DEFINED__
+#define __IMsRdpClientAdvancedSettings2_FWD_DEFINED__
+typedef interface IMsRdpClientAdvancedSettings2 IMsRdpClientAdvancedSettings2;
+#endif /* __IMsRdpClientAdvancedSettings2_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings3_FWD_DEFINED__
+#define __IMsRdpClientAdvancedSettings3_FWD_DEFINED__
+typedef interface IMsRdpClientAdvancedSettings3 IMsRdpClientAdvancedSettings3;
+#endif /* __IMsRdpClientAdvancedSettings3_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings4_FWD_DEFINED__
+#define __IMsRdpClientAdvancedSettings4_FWD_DEFINED__
+typedef interface IMsRdpClientAdvancedSettings4 IMsRdpClientAdvancedSettings4;
+#endif /* __IMsRdpClientAdvancedSettings4_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscSecuredSettings_FWD_DEFINED__
+#define __IMsTscSecuredSettings_FWD_DEFINED__
+typedef interface IMsTscSecuredSettings IMsTscSecuredSettings;
+#endif /* __IMsTscSecuredSettings_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientSecuredSettings_FWD_DEFINED__
+#define __IMsRdpClientSecuredSettings_FWD_DEFINED__
+typedef interface IMsRdpClientSecuredSettings IMsRdpClientSecuredSettings;
+#endif /* __IMsRdpClientSecuredSettings_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscDebug_FWD_DEFINED__
+#define __IMsTscDebug_FWD_DEFINED__
+typedef interface IMsTscDebug IMsTscDebug;
+#endif /* __IMsTscDebug_FWD_DEFINED__ */
+
+
+#ifndef __MsTscAx_FWD_DEFINED__
+#define __MsTscAx_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsTscAx MsTscAx;
+#else
+typedef struct MsTscAx MsTscAx;
+#endif /* __cplusplus */
+
+#endif /* __MsTscAx_FWD_DEFINED__ */
+
+
+#ifndef __MsRdpClient_FWD_DEFINED__
+#define __MsRdpClient_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsRdpClient MsRdpClient;
+#else
+typedef struct MsRdpClient MsRdpClient;
+#endif /* __cplusplus */
+
+#endif /* __MsRdpClient_FWD_DEFINED__ */
+
+
+#ifndef __MsRdpClient2_FWD_DEFINED__
+#define __MsRdpClient2_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsRdpClient2 MsRdpClient2;
+#else
+typedef struct MsRdpClient2 MsRdpClient2;
+#endif /* __cplusplus */
+
+#endif /* __MsRdpClient2_FWD_DEFINED__ */
+
+
+#ifndef __MsRdpClient3_FWD_DEFINED__
+#define __MsRdpClient3_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsRdpClient3 MsRdpClient3;
+#else
+typedef struct MsRdpClient3 MsRdpClient3;
+#endif /* __cplusplus */
+
+#endif /* __MsRdpClient3_FWD_DEFINED__ */
+
+
+#ifndef __MsRdpClient4_FWD_DEFINED__
+#define __MsRdpClient4_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsRdpClient4 MsRdpClient4;
+#else
+typedef struct MsRdpClient4 MsRdpClient4;
+#endif /* __cplusplus */
+
+#endif /* __MsRdpClient4_FWD_DEFINED__ */
+
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+
+#ifndef __MSTSCLib_LIBRARY_DEFINED__
+#define __MSTSCLib_LIBRARY_DEFINED__
+
+/* library MSTSCLib */
+/* [version][uuid] */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef /* [public][public][public] */
+enum __MIDL___MIDL_itf_mstsax_0275_0001
+ { autoReconnectContinueAutomatic = 0,
+ autoReconnectContinueStop = 1,
+ autoReconnectContinueManual = 2
+ } AutoReconnectContinueState;
+
+typedef /* [public][public][public] */
+enum __MIDL_IMsRdpClient_0001
+ { exDiscReasonNoInfo = 0,
+ exDiscReasonAPIInitiatedDisconnect = 1,
+ exDiscReasonAPIInitiatedLogoff = 2,
+ exDiscReasonServerIdleTimeout = 3,
+ exDiscReasonServerLogonTimeout = 4,
+ exDiscReasonReplacedByOtherConnection = 5,
+ exDiscReasonOutOfMemory = 6,
+ exDiscReasonServerDeniedConnection = 7,
+ exDiscReasonServerDeniedConnectionFips = 8,
+ exDiscReasonLicenseInternal = 256,
+ exDiscReasonLicenseNoLicenseServer = 257,
+ exDiscReasonLicenseNoLicense = 258,
+ exDiscReasonLicenseErrClientMsg = 259,
+ exDiscReasonLicenseHwidDoesntMatchLicense = 260,
+ exDiscReasonLicenseErrClientLicense = 261,
+ exDiscReasonLicenseCantFinishProtocol = 262,
+ exDiscReasonLicenseClientEndedProtocol = 263,
+ exDiscReasonLicenseErrClientEncryption = 264,
+ exDiscReasonLicenseCantUpgradeLicense = 265,
+ exDiscReasonLicenseNoRemoteConnections = 266,
+ exDiscReasonProtocolRangeStart = 4096,
+ exDiscReasonProtocolRangeEnd = 32767
+ } ExtendedDisconnectReasonCode;
+
+typedef /* [public][public][public] */
+enum __MIDL_IMsRdpClient_0002
+ { controlCloseCanProceed = 0,
+ controlCloseWaitForEvents = 1
+ } ControlCloseStatus;
+
+typedef /* [custom][public] */ unsigned __int3264 UINT_PTR;
+
+typedef /* [custom][public] */ __int3264 LONG_PTR;
+
+
+EXTERN_C const IID LIBID_MSTSCLib;
+
+#ifndef __IMsTscAxEvents_DISPINTERFACE_DEFINED__
+#define __IMsTscAxEvents_DISPINTERFACE_DEFINED__
+
+/* dispinterface IMsTscAxEvents */
+/* [uuid] */
+
+
+EXTERN_C const IID DIID_IMsTscAxEvents;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("336D5562-EFA8-482E-8CB3-C5C0FC7A7DB6")
+ IMsTscAxEvents : public IDispatch
+ {
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscAxEventsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscAxEvents * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscAxEvents * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscAxEvents * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscAxEvents * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscAxEvents * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscAxEvents * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscAxEvents * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ END_INTERFACE
+ } IMsTscAxEventsVtbl;
+
+ interface IMsTscAxEvents
+ {
+ CONST_VTBL struct IMsTscAxEventsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscAxEvents_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscAxEvents_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscAxEvents_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscAxEvents_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscAxEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscAxEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscAxEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+#endif /* __IMsTscAxEvents_DISPINTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscAx_INTERFACE_DEFINED__
+#define __IMsTscAx_INTERFACE_DEFINED__
+
+/* interface IMsTscAx */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscAx;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("8C11EFAE-92C3-11D1-BC1E-00C04FA31489")
+ IMsTscAx : public IDispatch
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Server(
+ /* [in] */ BSTR pServer) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Server(
+ /* [retval][out] */ BSTR *pServer) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Domain(
+ /* [in] */ BSTR pDomain) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Domain(
+ /* [retval][out] */ BSTR *pDomain) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_UserName(
+ /* [in] */ BSTR pUserName) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_UserName(
+ /* [retval][out] */ BSTR *pUserName) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisconnectedText(
+ /* [in] */ BSTR pDisconnectedText) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisconnectedText(
+ /* [retval][out] */ BSTR *pDisconnectedText) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectingText(
+ /* [in] */ BSTR pConnectingText) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectingText(
+ /* [retval][out] */ BSTR *pConnectingText) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Connected(
+ /* [retval][out] */ short *pIsConnected) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopWidth(
+ /* [in] */ long pVal) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopWidth(
+ /* [retval][out] */ long *pVal) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopHeight(
+ /* [in] */ long pVal) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopHeight(
+ /* [retval][out] */ long *pVal) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartConnected(
+ /* [in] */ long pfStartConnected) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartConnected(
+ /* [retval][out] */ long *pfStartConnected) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HorizontalScrollBarVisible(
+ /* [retval][out] */ long *pfHScrollVisible) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_VerticalScrollBarVisible(
+ /* [retval][out] */ long *pfVScrollVisible) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreenTitle(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CipherStrength(
+ /* [retval][out] */ long *pCipherStrength) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Version(
+ /* [retval][out] */ BSTR *pVersion) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettingsEnabled(
+ /* [retval][out] */ long *pSecuredSettingsEnabled) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings(
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings(
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings) = 0;
+
+ virtual /* [hidden][propget][id] */ HRESULT STDMETHODCALLTYPE get_Debugger(
+ /* [retval][out] */ IMsTscDebug **ppDebugger) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE Connect( void) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE Disconnect( void) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE CreateVirtualChannels(
+ /* [in] */ BSTR newVal) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendOnVirtualChannel(
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscAxVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscAx * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscAx * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscAx * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscAx * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscAx * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscAx * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscAx * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsTscAx * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsTscAx * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsTscAx * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsTscAx * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsTscAx * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsTscAx * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsTscAx * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsTscAx * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsTscAx * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsTscAx * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsTscAx * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsTscAx * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ END_INTERFACE
+ } IMsTscAxVtbl;
+
+ interface IMsTscAx
+ {
+ CONST_VTBL struct IMsTscAxVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscAx_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscAx_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscAx_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscAx_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscAx_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscAx_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscAx_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsTscAx_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsTscAx_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsTscAx_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsTscAx_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsTscAx_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsTscAx_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsTscAx_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsTscAx_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsTscAx_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsTscAx_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsTscAx_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsTscAx_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsTscAx_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsTscAx_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsTscAx_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsTscAx_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsTscAx_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsTscAx_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsTscAx_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsTscAx_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsTscAx_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsTscAx_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsTscAx_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsTscAx_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsTscAx_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsTscAx_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsTscAx_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsTscAx_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsTscAx_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsTscAx_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscAx_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClient_INTERFACE_DEFINED__
+#define __IMsRdpClient_INTERFACE_DEFINED__
+
+/* interface IMsRdpClient */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClient;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("92B4A539-7115-4B7C-A5A9-E5D9EFC2780A")
+ IMsRdpClient : public IMsTscAx
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ColorDepth(
+ /* [in] */ long pcolorDepth) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ColorDepth(
+ /* [retval][out] */ long *pcolorDepth) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings2(
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings2(
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ExtendedDisconnectReason(
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen(
+ /* [in] */ VARIANT_BOOL pfFullScreen) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen(
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE SetVirtualChannelOptions(
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE GetVirtualChannelOptions(
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE RequestClose(
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClient * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClient * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClient * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClient * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClient * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClient * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClient * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsRdpClient * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsRdpClient * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsRdpClient * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsRdpClient * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsRdpClient * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsRdpClient * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )(
+ IMsRdpClient * This,
+ /* [in] */ long pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )(
+ IMsRdpClient * This,
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClient * This,
+ /* [in] */ VARIANT_BOOL pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClient * This,
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )(
+ IMsRdpClient * This,
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus);
+
+ END_INTERFACE
+ } IMsRdpClientVtbl;
+
+ interface IMsRdpClient
+ {
+ CONST_VTBL struct IMsRdpClientVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClient_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClient_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClient_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClient_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClient_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClient_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClient_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClient_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsRdpClient_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsRdpClient_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsRdpClient_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsRdpClient_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsRdpClient_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsRdpClient_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsRdpClient_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsRdpClient_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsRdpClient_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsRdpClient_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsRdpClient_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsRdpClient_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsRdpClient_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsRdpClient_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsRdpClient_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsRdpClient_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsRdpClient_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsRdpClient_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsRdpClient_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+
+#define IMsRdpClient_put_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient_get_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient_get_AdvancedSettings2(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) )
+
+#define IMsRdpClient_get_SecuredSettings2(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) )
+
+#define IMsRdpClient_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \
+ ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) )
+
+#define IMsRdpClient_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient_SetVirtualChannelOptions(This,chanName,chanOptions) \
+ ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) )
+
+#define IMsRdpClient_GetVirtualChannelOptions(This,chanName,pChanOptions) \
+ ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) )
+
+#define IMsRdpClient_RequestClose(This,pCloseStatus) \
+ ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClient_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClient2_INTERFACE_DEFINED__
+#define __IMsRdpClient2_INTERFACE_DEFINED__
+
+/* interface IMsRdpClient2 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClient2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("E7E17DC4-3B71-4BA7-A8E6-281FFADCA28F")
+ IMsRdpClient2 : public IMsRdpClient
+ {
+ public:
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings3(
+ /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectedStatusText(
+ /* [in] */ BSTR pConnectedStatusText) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectedStatusText(
+ /* [retval][out] */ BSTR *pConnectedStatusText) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClient2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClient2 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClient2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClient2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClient2 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClient2 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClient2 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClient2 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsRdpClient2 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsRdpClient2 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsRdpClient2 * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsRdpClient2 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsRdpClient2 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )(
+ IMsRdpClient2 * This,
+ /* [in] */ long pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClient2 * This,
+ /* [in] */ VARIANT_BOOL pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pConnectedStatusText);
+
+ END_INTERFACE
+ } IMsRdpClient2Vtbl;
+
+ interface IMsRdpClient2
+ {
+ CONST_VTBL struct IMsRdpClient2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClient2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClient2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClient2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClient2_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClient2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClient2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClient2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClient2_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsRdpClient2_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsRdpClient2_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsRdpClient2_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsRdpClient2_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsRdpClient2_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsRdpClient2_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient2_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient2_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient2_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient2_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsRdpClient2_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient2_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient2_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient2_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient2_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient2_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient2_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsRdpClient2_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsRdpClient2_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsRdpClient2_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsRdpClient2_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsRdpClient2_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsRdpClient2_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsRdpClient2_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsRdpClient2_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsRdpClient2_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsRdpClient2_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsRdpClient2_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsRdpClient2_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+
+#define IMsRdpClient2_put_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient2_get_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient2_get_AdvancedSettings2(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) )
+
+#define IMsRdpClient2_get_SecuredSettings2(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) )
+
+#define IMsRdpClient2_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \
+ ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) )
+
+#define IMsRdpClient2_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient2_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient2_SetVirtualChannelOptions(This,chanName,chanOptions) \
+ ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) )
+
+#define IMsRdpClient2_GetVirtualChannelOptions(This,chanName,pChanOptions) \
+ ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) )
+
+#define IMsRdpClient2_RequestClose(This,pCloseStatus) \
+ ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) )
+
+
+#define IMsRdpClient2_get_AdvancedSettings3(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) )
+
+#define IMsRdpClient2_put_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) )
+
+#define IMsRdpClient2_get_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClient2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClient3_INTERFACE_DEFINED__
+#define __IMsRdpClient3_INTERFACE_DEFINED__
+
+/* interface IMsRdpClient3 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClient3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("91B7CBC5-A72E-4FA0-9300-D647D7E897FF")
+ IMsRdpClient3 : public IMsRdpClient2
+ {
+ public:
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings4(
+ /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClient3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClient3 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClient3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClient3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClient3 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClient3 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClient3 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClient3 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsRdpClient3 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsRdpClient3 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsRdpClient3 * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsRdpClient3 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsRdpClient3 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )(
+ IMsRdpClient3 * This,
+ /* [in] */ long pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClient3 * This,
+ /* [in] */ VARIANT_BOOL pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings);
+
+ END_INTERFACE
+ } IMsRdpClient3Vtbl;
+
+ interface IMsRdpClient3
+ {
+ CONST_VTBL struct IMsRdpClient3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClient3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClient3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClient3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClient3_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClient3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClient3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClient3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClient3_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsRdpClient3_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsRdpClient3_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsRdpClient3_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsRdpClient3_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsRdpClient3_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsRdpClient3_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient3_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient3_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient3_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient3_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsRdpClient3_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient3_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient3_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient3_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient3_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient3_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient3_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsRdpClient3_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsRdpClient3_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsRdpClient3_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsRdpClient3_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsRdpClient3_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsRdpClient3_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsRdpClient3_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsRdpClient3_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsRdpClient3_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsRdpClient3_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsRdpClient3_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsRdpClient3_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+
+#define IMsRdpClient3_put_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient3_get_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient3_get_AdvancedSettings2(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) )
+
+#define IMsRdpClient3_get_SecuredSettings2(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) )
+
+#define IMsRdpClient3_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \
+ ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) )
+
+#define IMsRdpClient3_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient3_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient3_SetVirtualChannelOptions(This,chanName,chanOptions) \
+ ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) )
+
+#define IMsRdpClient3_GetVirtualChannelOptions(This,chanName,pChanOptions) \
+ ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) )
+
+#define IMsRdpClient3_RequestClose(This,pCloseStatus) \
+ ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) )
+
+
+#define IMsRdpClient3_get_AdvancedSettings3(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) )
+
+#define IMsRdpClient3_put_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) )
+
+#define IMsRdpClient3_get_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) )
+
+
+#define IMsRdpClient3_get_AdvancedSettings4(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClient3_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClient4_INTERFACE_DEFINED__
+#define __IMsRdpClient4_INTERFACE_DEFINED__
+
+/* interface IMsRdpClient4 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClient4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("095E0738-D97D-488B-B9F6-DD0E8D66C0DE")
+ IMsRdpClient4 : public IMsRdpClient3
+ {
+ public:
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings5(
+ /* [retval][out] */ IMsRdpClientAdvancedSettings4 **ppAdvSettings5) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClient4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClient4 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClient4 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClient4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClient4 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClient4 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClient4 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClient4 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsRdpClient4 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsRdpClient4 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsRdpClient4 * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsRdpClient4 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsRdpClient4 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )(
+ IMsRdpClient4 * This,
+ /* [in] */ long pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClient4 * This,
+ /* [in] */ VARIANT_BOOL pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings5 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings4 **ppAdvSettings5);
+
+ END_INTERFACE
+ } IMsRdpClient4Vtbl;
+
+ interface IMsRdpClient4
+ {
+ CONST_VTBL struct IMsRdpClient4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClient4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClient4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClient4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClient4_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClient4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClient4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClient4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClient4_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsRdpClient4_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsRdpClient4_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsRdpClient4_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsRdpClient4_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsRdpClient4_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsRdpClient4_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient4_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient4_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient4_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient4_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsRdpClient4_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient4_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient4_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient4_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient4_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient4_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient4_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsRdpClient4_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsRdpClient4_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsRdpClient4_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsRdpClient4_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsRdpClient4_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsRdpClient4_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsRdpClient4_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsRdpClient4_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsRdpClient4_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsRdpClient4_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsRdpClient4_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsRdpClient4_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+
+#define IMsRdpClient4_put_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient4_get_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient4_get_AdvancedSettings2(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) )
+
+#define IMsRdpClient4_get_SecuredSettings2(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) )
+
+#define IMsRdpClient4_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \
+ ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) )
+
+#define IMsRdpClient4_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient4_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient4_SetVirtualChannelOptions(This,chanName,chanOptions) \
+ ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) )
+
+#define IMsRdpClient4_GetVirtualChannelOptions(This,chanName,pChanOptions) \
+ ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) )
+
+#define IMsRdpClient4_RequestClose(This,pCloseStatus) \
+ ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) )
+
+
+#define IMsRdpClient4_get_AdvancedSettings3(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) )
+
+#define IMsRdpClient4_put_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) )
+
+#define IMsRdpClient4_get_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) )
+
+
+#define IMsRdpClient4_get_AdvancedSettings4(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) )
+
+
+#define IMsRdpClient4_get_AdvancedSettings5(This,ppAdvSettings5) \
+ ( (This)->lpVtbl -> get_AdvancedSettings5(This,ppAdvSettings5) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClient4_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscNonScriptable_INTERFACE_DEFINED__
+#define __IMsTscNonScriptable_INTERFACE_DEFINED__
+
+/* interface IMsTscNonScriptable */
+/* [object][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscNonScriptable;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("C1E6743A-41C1-4A74-832A-0DD06C1C7A0E")
+ IMsTscNonScriptable : public IUnknown
+ {
+ public:
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortablePassword(
+ /* [in] */ BSTR pPortablePass) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortablePassword(
+ /* [retval][out] */ BSTR *pPortablePass) = 0;
+
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortableSalt(
+ /* [in] */ BSTR pPortableSalt) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortableSalt(
+ /* [retval][out] */ BSTR *pPortableSalt) = 0;
+
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinaryPassword(
+ /* [in] */ BSTR pBinaryPassword) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinaryPassword(
+ /* [retval][out] */ BSTR *pBinaryPassword) = 0;
+
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinarySalt(
+ /* [in] */ BSTR pSalt) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinarySalt(
+ /* [retval][out] */ BSTR *pSalt) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ResetPassword( void) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscNonScriptableVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscNonScriptable * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscNonScriptable * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscNonScriptable * This);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR pPortablePass);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )(
+ IMsTscNonScriptable * This,
+ /* [retval][out] */ BSTR *pPortablePass);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR pPortableSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )(
+ IMsTscNonScriptable * This,
+ /* [retval][out] */ BSTR *pPortableSalt);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR pBinaryPassword);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )(
+ IMsTscNonScriptable * This,
+ /* [retval][out] */ BSTR *pBinaryPassword);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR pSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )(
+ IMsTscNonScriptable * This,
+ /* [retval][out] */ BSTR *pSalt);
+
+ HRESULT ( STDMETHODCALLTYPE *ResetPassword )(
+ IMsTscNonScriptable * This);
+
+ END_INTERFACE
+ } IMsTscNonScriptableVtbl;
+
+ interface IMsTscNonScriptable
+ {
+ CONST_VTBL struct IMsTscNonScriptableVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscNonScriptable_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscNonScriptable_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscNonScriptable_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscNonScriptable_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsTscNonScriptable_put_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) )
+
+#define IMsTscNonScriptable_get_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) )
+
+#define IMsTscNonScriptable_put_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) )
+
+#define IMsTscNonScriptable_get_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) )
+
+#define IMsTscNonScriptable_put_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsTscNonScriptable_get_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsTscNonScriptable_put_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) )
+
+#define IMsTscNonScriptable_get_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) )
+
+#define IMsTscNonScriptable_ResetPassword(This) \
+ ( (This)->lpVtbl -> ResetPassword(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscNonScriptable_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientNonScriptable_INTERFACE_DEFINED__
+#define __IMsRdpClientNonScriptable_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientNonScriptable */
+/* [object][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientNonScriptable;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("2F079C4C-87B2-4AFD-97AB-20CDB43038AE")
+ IMsRdpClientNonScriptable : public IMsTscNonScriptable
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE NotifyRedirectDeviceChange(
+ /* [in] */ UINT_PTR wParam,
+ /* [in] */ LONG_PTR lParam) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SendKeys(
+ /* [in] */ long numKeys,
+ /* [in] */ VARIANT_BOOL *pbArrayKeyUp,
+ /* [in] */ long *plKeyData) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientNonScriptableVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientNonScriptable * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientNonScriptable * This);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR pPortablePass);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [retval][out] */ BSTR *pPortablePass);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR pPortableSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )(
+ IMsRdpClientNonScriptable * This,
+ /* [retval][out] */ BSTR *pPortableSalt);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR pBinaryPassword);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [retval][out] */ BSTR *pBinaryPassword);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR pSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )(
+ IMsRdpClientNonScriptable * This,
+ /* [retval][out] */ BSTR *pSalt);
+
+ HRESULT ( STDMETHODCALLTYPE *ResetPassword )(
+ IMsRdpClientNonScriptable * This);
+
+ HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ UINT_PTR wParam,
+ /* [in] */ LONG_PTR lParam);
+
+ HRESULT ( STDMETHODCALLTYPE *SendKeys )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ long numKeys,
+ /* [in] */ VARIANT_BOOL *pbArrayKeyUp,
+ /* [in] */ long *plKeyData);
+
+ END_INTERFACE
+ } IMsRdpClientNonScriptableVtbl;
+
+ interface IMsRdpClientNonScriptable
+ {
+ CONST_VTBL struct IMsRdpClientNonScriptableVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientNonScriptable_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientNonScriptable_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientNonScriptable_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientNonScriptable_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientNonScriptable_put_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) )
+
+#define IMsRdpClientNonScriptable_get_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) )
+
+#define IMsRdpClientNonScriptable_put_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) )
+
+#define IMsRdpClientNonScriptable_get_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) )
+
+#define IMsRdpClientNonScriptable_put_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsRdpClientNonScriptable_get_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsRdpClientNonScriptable_put_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) )
+
+#define IMsRdpClientNonScriptable_get_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) )
+
+#define IMsRdpClientNonScriptable_ResetPassword(This) \
+ ( (This)->lpVtbl -> ResetPassword(This) )
+
+
+#define IMsRdpClientNonScriptable_NotifyRedirectDeviceChange(This,wParam,lParam) \
+ ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) )
+
+#define IMsRdpClientNonScriptable_SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) \
+ ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClientNonScriptable_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientNonScriptable2_INTERFACE_DEFINED__
+#define __IMsRdpClientNonScriptable2_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientNonScriptable2 */
+/* [object][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientNonScriptable2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("17A5E535-4072-4FA4-AF32-C8D0D47345E9")
+ IMsRdpClientNonScriptable2 : public IMsRdpClientNonScriptable
+ {
+ public:
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_UIParentWindowHandle(
+ /* [in] */ HWND phwndUIParentWindowHandle) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_UIParentWindowHandle(
+ /* [retval][out] */ HWND *phwndUIParentWindowHandle) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientNonScriptable2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientNonScriptable2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientNonScriptable2 * This);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR pPortablePass);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ BSTR *pPortablePass);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR pPortableSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ BSTR *pPortableSalt);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR pBinaryPassword);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ BSTR *pBinaryPassword);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR pSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ BSTR *pSalt);
+
+ HRESULT ( STDMETHODCALLTYPE *ResetPassword )(
+ IMsRdpClientNonScriptable2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ UINT_PTR wParam,
+ /* [in] */ LONG_PTR lParam);
+
+ HRESULT ( STDMETHODCALLTYPE *SendKeys )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ long numKeys,
+ /* [in] */ VARIANT_BOOL *pbArrayKeyUp,
+ /* [in] */ long *plKeyData);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_UIParentWindowHandle )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ HWND phwndUIParentWindowHandle);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_UIParentWindowHandle )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ HWND *phwndUIParentWindowHandle);
+
+ END_INTERFACE
+ } IMsRdpClientNonScriptable2Vtbl;
+
+ interface IMsRdpClientNonScriptable2
+ {
+ CONST_VTBL struct IMsRdpClientNonScriptable2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientNonScriptable2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientNonScriptable2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientNonScriptable2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientNonScriptable2_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientNonScriptable2_put_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) )
+
+#define IMsRdpClientNonScriptable2_get_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) )
+
+#define IMsRdpClientNonScriptable2_put_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) )
+
+#define IMsRdpClientNonScriptable2_get_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) )
+
+#define IMsRdpClientNonScriptable2_put_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsRdpClientNonScriptable2_get_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsRdpClientNonScriptable2_put_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) )
+
+#define IMsRdpClientNonScriptable2_get_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) )
+
+#define IMsRdpClientNonScriptable2_ResetPassword(This) \
+ ( (This)->lpVtbl -> ResetPassword(This) )
+
+
+#define IMsRdpClientNonScriptable2_NotifyRedirectDeviceChange(This,wParam,lParam) \
+ ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) )
+
+#define IMsRdpClientNonScriptable2_SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) \
+ ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) )
+
+
+#define IMsRdpClientNonScriptable2_put_UIParentWindowHandle(This,phwndUIParentWindowHandle) \
+ ( (This)->lpVtbl -> put_UIParentWindowHandle(This,phwndUIParentWindowHandle) )
+
+#define IMsRdpClientNonScriptable2_get_UIParentWindowHandle(This,phwndUIParentWindowHandle) \
+ ( (This)->lpVtbl -> get_UIParentWindowHandle(This,phwndUIParentWindowHandle) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClientNonScriptable2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscAdvancedSettings_INTERFACE_DEFINED__
+#define __IMsTscAdvancedSettings_INTERFACE_DEFINED__
+
+/* interface IMsTscAdvancedSettings */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscAdvancedSettings;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("809945CC-4B3B-4A92-A6B0-DBF9B5F2EF2D")
+ IMsTscAdvancedSettings : public IDispatch
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Compress(
+ /* [in] */ long pcompress) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Compress(
+ /* [retval][out] */ long *pcompress) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPeristence(
+ /* [in] */ long pbitmapPeristence) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPeristence(
+ /* [retval][out] */ long *pbitmapPeristence) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_allowBackgroundInput(
+ /* [in] */ long pallowBackgroundInput) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_allowBackgroundInput(
+ /* [retval][out] */ long *pallowBackgroundInput) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyBoardLayoutStr(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PluginDlls(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconFile(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconIndex(
+ /* [in] */ long rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ContainerHandledFullScreen(
+ /* [in] */ long pContainerHandledFullScreen) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ContainerHandledFullScreen(
+ /* [retval][out] */ long *pContainerHandledFullScreen) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableRdpdr(
+ /* [in] */ long pDisableRdpdr) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableRdpdr(
+ /* [retval][out] */ long *pDisableRdpdr) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscAdvancedSettingsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscAdvancedSettings * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscAdvancedSettings * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscAdvancedSettings * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ END_INTERFACE
+ } IMsTscAdvancedSettingsVtbl;
+
+ interface IMsTscAdvancedSettings
+ {
+ CONST_VTBL struct IMsTscAdvancedSettingsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscAdvancedSettings_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscAdvancedSettings_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscAdvancedSettings_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscAdvancedSettings_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscAdvancedSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscAdvancedSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscAdvancedSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsTscAdvancedSettings_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsTscAdvancedSettings_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsTscAdvancedSettings_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsTscAdvancedSettings_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsTscAdvancedSettings_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsTscAdvancedSettings_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsTscAdvancedSettings_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsTscAdvancedSettings_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsTscAdvancedSettings_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsTscAdvancedSettings_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsTscAdvancedSettings_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsTscAdvancedSettings_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsTscAdvancedSettings_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsTscAdvancedSettings_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscAdvancedSettings_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings_INTERFACE_DEFINED__
+#define __IMsRdpClientAdvancedSettings_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientAdvancedSettings */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientAdvancedSettings;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("3C65B4AB-12B3-465B-ACD4-B8DAD3BFF9E2")
+ IMsRdpClientAdvancedSettings : public IMsTscAdvancedSettings
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmoothScroll(
+ /* [in] */ long psmoothScroll) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmoothScroll(
+ /* [retval][out] */ long *psmoothScroll) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AcceleratorPassthrough(
+ /* [in] */ long pacceleratorPassthrough) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AcceleratorPassthrough(
+ /* [retval][out] */ long *pacceleratorPassthrough) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ShadowBitmap(
+ /* [in] */ long pshadowBitmap) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ShadowBitmap(
+ /* [retval][out] */ long *pshadowBitmap) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_TransportType(
+ /* [in] */ long ptransportType) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_TransportType(
+ /* [retval][out] */ long *ptransportType) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SasSequence(
+ /* [in] */ long psasSequence) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SasSequence(
+ /* [retval][out] */ long *psasSequence) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EncryptionEnabled(
+ /* [in] */ long pencryptionEnabled) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EncryptionEnabled(
+ /* [retval][out] */ long *pencryptionEnabled) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DedicatedTerminal(
+ /* [in] */ long pdedicatedTerminal) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DedicatedTerminal(
+ /* [retval][out] */ long *pdedicatedTerminal) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RDPPort(
+ /* [in] */ long prdpPort) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RDPPort(
+ /* [retval][out] */ long *prdpPort) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableMouse(
+ /* [in] */ long penableMouse) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableMouse(
+ /* [retval][out] */ long *penableMouse) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableCtrlAltDel(
+ /* [in] */ long pdisableCtrlAltDel) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableCtrlAltDel(
+ /* [retval][out] */ long *pdisableCtrlAltDel) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableWindowsKey(
+ /* [in] */ long penableWindowsKey) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableWindowsKey(
+ /* [retval][out] */ long *penableWindowsKey) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DoubleClickDetect(
+ /* [in] */ long pdoubleClickDetect) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DoubleClickDetect(
+ /* [retval][out] */ long *pdoubleClickDetect) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaximizeShell(
+ /* [in] */ long pmaximizeShell) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaximizeShell(
+ /* [retval][out] */ long *pmaximizeShell) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyFullScreen(
+ /* [in] */ long photKeyFullScreen) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyFullScreen(
+ /* [retval][out] */ long *photKeyFullScreen) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlEsc(
+ /* [in] */ long photKeyCtrlEsc) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlEsc(
+ /* [retval][out] */ long *photKeyCtrlEsc) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltEsc(
+ /* [in] */ long photKeyAltEsc) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltEsc(
+ /* [retval][out] */ long *photKeyAltEsc) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltTab(
+ /* [in] */ long photKeyAltTab) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltTab(
+ /* [retval][out] */ long *photKeyAltTab) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltShiftTab(
+ /* [in] */ long photKeyAltShiftTab) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltShiftTab(
+ /* [retval][out] */ long *photKeyAltShiftTab) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltSpace(
+ /* [in] */ long photKeyAltSpace) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltSpace(
+ /* [retval][out] */ long *photKeyAltSpace) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlAltDel(
+ /* [in] */ long photKeyCtrlAltDel) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlAltDel(
+ /* [retval][out] */ long *photKeyCtrlAltDel) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_orderDrawThreshold(
+ /* [in] */ long porderDrawThreshold) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_orderDrawThreshold(
+ /* [retval][out] */ long *porderDrawThreshold) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheSize(
+ /* [in] */ long pbitmapCacheSize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheSize(
+ /* [retval][out] */ long *pbitmapCacheSize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCacheSize(
+ /* [in] */ long pbitmapVirtualCacheSize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCacheSize(
+ /* [retval][out] */ long *pbitmapVirtualCacheSize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ScaleBitmapCachesByBPP(
+ /* [in] */ long pbScale) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ScaleBitmapCachesByBPP(
+ /* [retval][out] */ long *pbScale) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NumBitmapCaches(
+ /* [in] */ long pnumBitmapCaches) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NumBitmapCaches(
+ /* [retval][out] */ long *pnumBitmapCaches) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CachePersistenceActive(
+ /* [in] */ long pcachePersistenceActive) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CachePersistenceActive(
+ /* [retval][out] */ long *pcachePersistenceActive) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PersistCacheDirectory(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_brushSupportLevel(
+ /* [in] */ long pbrushSupportLevel) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_brushSupportLevel(
+ /* [retval][out] */ long *pbrushSupportLevel) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_minInputSendInterval(
+ /* [in] */ long pminInputSendInterval) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minInputSendInterval(
+ /* [retval][out] */ long *pminInputSendInterval) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_InputEventsAtOnce(
+ /* [in] */ long pinputEventsAtOnce) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_InputEventsAtOnce(
+ /* [retval][out] */ long *pinputEventsAtOnce) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_maxEventCount(
+ /* [in] */ long pmaxEventCount) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxEventCount(
+ /* [retval][out] */ long *pmaxEventCount) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_keepAliveInterval(
+ /* [in] */ long pkeepAliveInterval) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_keepAliveInterval(
+ /* [retval][out] */ long *pkeepAliveInterval) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_shutdownTimeout(
+ /* [in] */ long pshutdownTimeout) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_shutdownTimeout(
+ /* [retval][out] */ long *pshutdownTimeout) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_overallConnectionTimeout(
+ /* [in] */ long poverallConnectionTimeout) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_overallConnectionTimeout(
+ /* [retval][out] */ long *poverallConnectionTimeout) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_singleConnectionTimeout(
+ /* [in] */ long psingleConnectionTimeout) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_singleConnectionTimeout(
+ /* [retval][out] */ long *psingleConnectionTimeout) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardType(
+ /* [in] */ long pkeyboardType) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardType(
+ /* [retval][out] */ long *pkeyboardType) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardSubType(
+ /* [in] */ long pkeyboardSubType) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardSubType(
+ /* [retval][out] */ long *pkeyboardSubType) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardFunctionKey(
+ /* [in] */ long pkeyboardFunctionKey) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardFunctionKey(
+ /* [retval][out] */ long *pkeyboardFunctionKey) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WinceFixedPalette(
+ /* [in] */ long pwinceFixedPalette) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WinceFixedPalette(
+ /* [retval][out] */ long *pwinceFixedPalette) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectToServerConsole(
+ /* [in] */ VARIANT_BOOL pConnectToConsole) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectToServerConsole(
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPersistence(
+ /* [in] */ long pbitmapPersistence) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPersistence(
+ /* [retval][out] */ long *pbitmapPersistence) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MinutesToIdleTimeout(
+ /* [in] */ long pminutesToIdleTimeout) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MinutesToIdleTimeout(
+ /* [retval][out] */ long *pminutesToIdleTimeout) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmartSizing(
+ /* [in] */ VARIANT_BOOL pfSmartSizing) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmartSizing(
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrLocalPrintingDocName(
+ /* [in] */ BSTR pLocalPrintingDocName) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrLocalPrintingDocName(
+ /* [retval][out] */ BSTR *pLocalPrintingDocName) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipCleanTempDirString(
+ /* [in] */ BSTR clipCleanTempDirString) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipCleanTempDirString(
+ /* [retval][out] */ BSTR *clipCleanTempDirString) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipPasteInfoString(
+ /* [in] */ BSTR clipPasteInfoString) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipPasteInfoString(
+ /* [retval][out] */ BSTR *clipPasteInfoString) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisplayConnectionBar(
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisplayConnectionBar(
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PinConnectionBar(
+ /* [in] */ VARIANT_BOOL pPinConnectionBar) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PinConnectionBar(
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_GrabFocusOnConnect(
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_GrabFocusOnConnect(
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LoadBalanceInfo(
+ /* [in] */ BSTR pLBInfo) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LoadBalanceInfo(
+ /* [retval][out] */ BSTR *pLBInfo) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectDrives(
+ /* [in] */ VARIANT_BOOL pRedirectDrives) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectDrives(
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPrinters(
+ /* [in] */ VARIANT_BOOL pRedirectPrinters) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPrinters(
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPorts(
+ /* [in] */ VARIANT_BOOL pRedirectPorts) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPorts(
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectSmartCards(
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectSmartCards(
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache16BppSize(
+ /* [in] */ long pBitmapVirtualCache16BppSize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache16BppSize(
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache24BppSize(
+ /* [in] */ long pBitmapVirtualCache24BppSize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache24BppSize(
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PerformanceFlags(
+ /* [in] */ long pDisableList) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PerformanceFlags(
+ /* [retval][out] */ long *pDisableList) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectWithEndpoint(
+ /* [in] */ VARIANT *rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NotifyTSPublicKey(
+ /* [in] */ VARIANT_BOOL pfNotify) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NotifyTSPublicKey(
+ /* [retval][out] */ VARIANT_BOOL *pfNotify) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientAdvancedSettingsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientAdvancedSettings * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientAdvancedSettings * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long psmoothScroll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *psmoothScroll);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pacceleratorPassthrough);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pacceleratorPassthrough);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pshadowBitmap);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pshadowBitmap);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long ptransportType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *ptransportType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long psasSequence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *psasSequence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pencryptionEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pencryptionEnabled);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pdedicatedTerminal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pdedicatedTerminal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long prdpPort);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *prdpPort);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long penableMouse);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *penableMouse);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pdisableCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pdisableCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long penableWindowsKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *penableWindowsKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pdoubleClickDetect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pdoubleClickDetect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pmaximizeShell);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pmaximizeShell);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyCtrlEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyCtrlEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyAltEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyAltEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyAltTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyAltTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyAltShiftTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyAltShiftTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyAltSpace);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyAltSpace);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long porderDrawThreshold);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *porderDrawThreshold);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbitmapCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbitmapVirtualCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapVirtualCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbScale);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbScale);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pnumBitmapCaches);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pnumBitmapCaches);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pcachePersistenceActive);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pcachePersistenceActive);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbrushSupportLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbrushSupportLevel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pminInputSendInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pminInputSendInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pinputEventsAtOnce);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pinputEventsAtOnce);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pmaxEventCount);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pmaxEventCount);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pkeepAliveInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pkeepAliveInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pshutdownTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pshutdownTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long poverallConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *poverallConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long psingleConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *psingleConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pkeyboardType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pkeyboardType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pkeyboardSubType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pkeyboardSubType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pkeyboardFunctionKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pkeyboardFunctionKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pwinceFixedPalette);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pwinceFixedPalette);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pConnectToConsole);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbitmapPersistence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapPersistence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pminutesToIdleTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pminutesToIdleTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pfSmartSizing);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR pLocalPrintingDocName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ BSTR *pLocalPrintingDocName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR clipCleanTempDirString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ BSTR *clipCleanTempDirString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR clipPasteInfoString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ BSTR *clipPasteInfoString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pPinConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR pLBInfo);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ BSTR *pLBInfo);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pRedirectDrives);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pRedirectPrinters);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pRedirectPorts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pDisableList);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pDisableList);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT *rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+ END_INTERFACE
+ } IMsRdpClientAdvancedSettingsVtbl;
+
+ interface IMsRdpClientAdvancedSettings
+ {
+ CONST_VTBL struct IMsRdpClientAdvancedSettingsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientAdvancedSettings_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientAdvancedSettings_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientAdvancedSettings_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientAdvancedSettings_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientAdvancedSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientAdvancedSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientAdvancedSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientAdvancedSettings_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsRdpClientAdvancedSettings_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+
+#define IMsRdpClientAdvancedSettings_put_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings_get_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings_put_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings_get_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings_put_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> put_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings_get_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> get_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings_put_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings_get_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings_put_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings_get_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings_put_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings_get_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings_put_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings_get_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings_put_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings_get_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings_put_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings_get_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings_put_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings_get_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings_put_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings_get_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings_put_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings_get_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings_put_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings_get_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings_put_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings_get_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings_put_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings_get_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings_put_PersistCacheDirectory(This,rhs) \
+ ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings_get_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings_put_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings_get_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings_put_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings_get_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings_put_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings_get_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings_put_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings_get_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings_put_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings_get_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings_put_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings_get_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings_put_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings_get_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings_put_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings_get_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings_put_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings_get_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings_put_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings_get_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings_put_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings_get_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings_put_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings_get_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings_get_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings_put_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings_get_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings_put_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings_get_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings_put_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings_get_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings_put_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings_get_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings_put_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings_get_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings_put_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings_get_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings_put_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings_get_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint(This,rhs) \
+ ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) )
+
+#define IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_PerformanceFlags_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pDisableList);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_PerformanceFlags_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_PerformanceFlags_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pDisableList);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_PerformanceFlags_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT *rhs);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IMsRdpClientAdvancedSettings_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings2_INTERFACE_DEFINED__
+#define __IMsRdpClientAdvancedSettings2_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientAdvancedSettings2 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("9AC42117-2B76-4320-AA44-0E616AB8437B")
+ IMsRdpClientAdvancedSettings2 : public IMsRdpClientAdvancedSettings
+ {
+ public:
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CanAutoReconnect(
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableAutoReconnect(
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableAutoReconnect(
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaxReconnectAttempts(
+ /* [in] */ long pMaxReconnectAttempts) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaxReconnectAttempts(
+ /* [retval][out] */ long *pMaxReconnectAttempts) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientAdvancedSettings2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientAdvancedSettings2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientAdvancedSettings2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long psmoothScroll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *psmoothScroll);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pacceleratorPassthrough);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pacceleratorPassthrough);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pshadowBitmap);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pshadowBitmap);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long ptransportType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *ptransportType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long psasSequence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *psasSequence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pencryptionEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pencryptionEnabled);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pdedicatedTerminal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pdedicatedTerminal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long prdpPort);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *prdpPort);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long penableMouse);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *penableMouse);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pdisableCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pdisableCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long penableWindowsKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *penableWindowsKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pdoubleClickDetect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pdoubleClickDetect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pmaximizeShell);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pmaximizeShell);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyCtrlEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyCtrlEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyAltEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyAltEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyAltTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyAltTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyAltShiftTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyAltShiftTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyAltSpace);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyAltSpace);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long porderDrawThreshold);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *porderDrawThreshold);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbitmapCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbitmapCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbitmapVirtualCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbitmapVirtualCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbScale);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbScale);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pnumBitmapCaches);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pnumBitmapCaches);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pcachePersistenceActive);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pcachePersistenceActive);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbrushSupportLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbrushSupportLevel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pminInputSendInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pminInputSendInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pinputEventsAtOnce);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pinputEventsAtOnce);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pmaxEventCount);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pmaxEventCount);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pkeepAliveInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pkeepAliveInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pshutdownTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pshutdownTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long poverallConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *poverallConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long psingleConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *psingleConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pkeyboardType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pkeyboardType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pkeyboardSubType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pkeyboardSubType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pkeyboardFunctionKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pkeyboardFunctionKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pwinceFixedPalette);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pwinceFixedPalette);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pConnectToConsole);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbitmapPersistence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbitmapPersistence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pminutesToIdleTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pminutesToIdleTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfSmartSizing);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR pLocalPrintingDocName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ BSTR *pLocalPrintingDocName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR clipCleanTempDirString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ BSTR *clipCleanTempDirString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR clipPasteInfoString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ BSTR *clipPasteInfoString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pPinConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR pLBInfo);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ BSTR *pLBInfo);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pRedirectDrives);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPrinters);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPorts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pDisableList);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pDisableList);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT *rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pMaxReconnectAttempts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pMaxReconnectAttempts);
+
+ END_INTERFACE
+ } IMsRdpClientAdvancedSettings2Vtbl;
+
+ interface IMsRdpClientAdvancedSettings2
+ {
+ CONST_VTBL struct IMsRdpClientAdvancedSettings2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientAdvancedSettings2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientAdvancedSettings2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientAdvancedSettings2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientAdvancedSettings2_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientAdvancedSettings2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientAdvancedSettings2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientAdvancedSettings2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientAdvancedSettings2_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings2_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings2_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings2_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings2_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings2_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings2_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsRdpClientAdvancedSettings2_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+
+#define IMsRdpClientAdvancedSettings2_put_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings2_get_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings2_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings2_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings2_put_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings2_get_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings2_put_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> put_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings2_get_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> get_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings2_put_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings2_get_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings2_put_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings2_get_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings2_put_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings2_get_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings2_put_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings2_get_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings2_put_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings2_get_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings2_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings2_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings2_put_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings2_get_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings2_put_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings2_get_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings2_put_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings2_get_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings2_put_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings2_get_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings2_put_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings2_get_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings2_put_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings2_get_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings2_put_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings2_get_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings2_put_PersistCacheDirectory(This,rhs) \
+ ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings2_get_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings2_put_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings2_get_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings2_put_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings2_get_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings2_put_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings2_get_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings2_put_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings2_get_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings2_put_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_get_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_put_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_get_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_put_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_get_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_put_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings2_get_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings2_put_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings2_get_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings2_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings2_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings2_put_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings2_get_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings2_put_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings2_get_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings2_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_put_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings2_get_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings2_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings2_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings2_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings2_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings2_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings2_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings2_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings2_get_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings2_put_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings2_get_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings2_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings2_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings2_put_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings2_get_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings2_put_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings2_get_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings2_put_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings2_get_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings2_put_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings2_get_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings2_put_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings2_get_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings2_put_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings2_get_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings2_put_ConnectWithEndpoint(This,rhs) \
+ ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) )
+
+#define IMsRdpClientAdvancedSettings2_get_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) )
+
+
+#define IMsRdpClientAdvancedSettings2_get_CanAutoReconnect(This,pfCanAutoReconnect) \
+ ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+#define IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pMaxReconnectAttempts);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pMaxReconnectAttempts);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IMsRdpClientAdvancedSettings2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings3_INTERFACE_DEFINED__
+#define __IMsRdpClientAdvancedSettings3_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientAdvancedSettings3 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("19CD856B-C542-4C53-ACEE-F127E3BE1A59")
+ IMsRdpClientAdvancedSettings3 : public IMsRdpClientAdvancedSettings2
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowMinimizeButton(
+ /* [in] */ VARIANT_BOOL pfShowMinimize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowMinimizeButton(
+ /* [retval][out] */ VARIANT_BOOL *pfShowMinimize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowRestoreButton(
+ /* [in] */ VARIANT_BOOL pfShowRestore) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowRestoreButton(
+ /* [retval][out] */ VARIANT_BOOL *pfShowRestore) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientAdvancedSettings3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientAdvancedSettings3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientAdvancedSettings3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long psmoothScroll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *psmoothScroll);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pacceleratorPassthrough);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pacceleratorPassthrough);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pshadowBitmap);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pshadowBitmap);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long ptransportType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *ptransportType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long psasSequence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *psasSequence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pencryptionEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pencryptionEnabled);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pdedicatedTerminal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pdedicatedTerminal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long prdpPort);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *prdpPort);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long penableMouse);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *penableMouse);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pdisableCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pdisableCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long penableWindowsKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *penableWindowsKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pdoubleClickDetect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pdoubleClickDetect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pmaximizeShell);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pmaximizeShell);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyCtrlEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyCtrlEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyAltEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyAltEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyAltTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyAltTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyAltShiftTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyAltShiftTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyAltSpace);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyAltSpace);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long porderDrawThreshold);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *porderDrawThreshold);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbitmapCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbitmapCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbitmapVirtualCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbitmapVirtualCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbScale);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbScale);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pnumBitmapCaches);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pnumBitmapCaches);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pcachePersistenceActive);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pcachePersistenceActive);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbrushSupportLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbrushSupportLevel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pminInputSendInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pminInputSendInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pinputEventsAtOnce);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pinputEventsAtOnce);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pmaxEventCount);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pmaxEventCount);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pkeepAliveInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pkeepAliveInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pshutdownTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pshutdownTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long poverallConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *poverallConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long psingleConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *psingleConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pkeyboardType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pkeyboardType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pkeyboardSubType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pkeyboardSubType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pkeyboardFunctionKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pkeyboardFunctionKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pwinceFixedPalette);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pwinceFixedPalette);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pConnectToConsole);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbitmapPersistence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbitmapPersistence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pminutesToIdleTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pminutesToIdleTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfSmartSizing);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR pLocalPrintingDocName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ BSTR *pLocalPrintingDocName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR clipCleanTempDirString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ BSTR *clipCleanTempDirString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR clipPasteInfoString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ BSTR *clipPasteInfoString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pPinConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR pLBInfo);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ BSTR *pLBInfo);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pRedirectDrives);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPrinters);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPorts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pDisableList);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pDisableList);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT *rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pMaxReconnectAttempts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pMaxReconnectAttempts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfShowMinimize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowMinimize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfShowRestore);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowRestore);
+
+ END_INTERFACE
+ } IMsRdpClientAdvancedSettings3Vtbl;
+
+ interface IMsRdpClientAdvancedSettings3
+ {
+ CONST_VTBL struct IMsRdpClientAdvancedSettings3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientAdvancedSettings3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientAdvancedSettings3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientAdvancedSettings3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientAdvancedSettings3_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientAdvancedSettings3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientAdvancedSettings3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientAdvancedSettings3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientAdvancedSettings3_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings3_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings3_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings3_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings3_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings3_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings3_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsRdpClientAdvancedSettings3_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+
+#define IMsRdpClientAdvancedSettings3_put_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings3_get_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings3_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings3_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings3_put_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings3_get_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings3_put_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> put_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings3_get_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> get_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings3_put_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings3_get_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings3_put_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings3_get_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings3_put_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings3_get_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings3_put_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings3_get_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings3_put_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings3_get_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings3_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings3_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings3_put_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings3_get_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings3_put_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings3_get_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings3_put_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings3_get_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings3_put_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings3_get_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings3_put_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings3_get_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings3_put_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings3_get_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings3_put_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings3_get_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings3_put_PersistCacheDirectory(This,rhs) \
+ ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings3_get_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings3_put_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings3_get_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings3_put_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings3_get_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings3_put_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings3_get_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings3_put_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings3_get_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings3_put_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_get_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_put_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_get_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_put_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_get_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_put_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings3_get_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings3_put_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings3_get_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings3_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings3_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings3_put_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings3_get_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings3_put_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings3_get_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings3_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_put_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings3_get_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings3_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings3_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings3_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings3_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings3_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings3_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings3_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings3_get_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings3_put_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings3_get_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings3_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings3_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings3_put_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings3_get_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings3_put_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings3_get_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings3_put_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings3_get_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings3_put_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings3_get_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings3_put_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings3_get_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings3_put_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings3_get_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings3_put_ConnectWithEndpoint(This,rhs) \
+ ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) )
+
+#define IMsRdpClientAdvancedSettings3_get_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) )
+
+
+#define IMsRdpClientAdvancedSettings3_get_CanAutoReconnect(This,pfCanAutoReconnect) \
+ ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings3_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings3_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings3_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+#define IMsRdpClientAdvancedSettings3_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+
+#define IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \
+ ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) )
+
+#define IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \
+ ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) )
+
+#define IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton(This,pfShowRestore) \
+ ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) )
+
+#define IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton(This,pfShowRestore) \
+ ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton_Proxy(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfShowMinimize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton_Proxy(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowMinimize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton_Proxy(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfShowRestore);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton_Proxy(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowRestore);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IMsRdpClientAdvancedSettings3_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings4_INTERFACE_DEFINED__
+#define __IMsRdpClientAdvancedSettings4_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientAdvancedSettings4 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("FBA7F64E-7345-4405-AE50-FA4A763DC0DE")
+ IMsRdpClientAdvancedSettings4 : public IMsRdpClientAdvancedSettings3
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AuthenticationLevel(
+ /* [in] */ unsigned int puiAuthLevel) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AuthenticationLevel(
+ /* [retval][out] */ unsigned int *puiAuthLevel) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientAdvancedSettings4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientAdvancedSettings4 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientAdvancedSettings4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long psmoothScroll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *psmoothScroll);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pacceleratorPassthrough);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pacceleratorPassthrough);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pshadowBitmap);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pshadowBitmap);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long ptransportType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *ptransportType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long psasSequence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *psasSequence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pencryptionEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pencryptionEnabled);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pdedicatedTerminal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pdedicatedTerminal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long prdpPort);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *prdpPort);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long penableMouse);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *penableMouse);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pdisableCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pdisableCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long penableWindowsKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *penableWindowsKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pdoubleClickDetect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pdoubleClickDetect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pmaximizeShell);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pmaximizeShell);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyCtrlEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyCtrlEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyAltEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyAltEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyAltTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyAltTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyAltShiftTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyAltShiftTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyAltSpace);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyAltSpace);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long porderDrawThreshold);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *porderDrawThreshold);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbitmapCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbitmapCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbitmapVirtualCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbitmapVirtualCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbScale);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbScale);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pnumBitmapCaches);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pnumBitmapCaches);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pcachePersistenceActive);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pcachePersistenceActive);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbrushSupportLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbrushSupportLevel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pminInputSendInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pminInputSendInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pinputEventsAtOnce);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pinputEventsAtOnce);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pmaxEventCount);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pmaxEventCount);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pkeepAliveInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pkeepAliveInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pshutdownTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pshutdownTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long poverallConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *poverallConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long psingleConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *psingleConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pkeyboardType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pkeyboardType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pkeyboardSubType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pkeyboardSubType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pkeyboardFunctionKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pkeyboardFunctionKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pwinceFixedPalette);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pwinceFixedPalette);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pConnectToConsole);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbitmapPersistence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbitmapPersistence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pminutesToIdleTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pminutesToIdleTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfSmartSizing);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR pLocalPrintingDocName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ BSTR *pLocalPrintingDocName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR clipCleanTempDirString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ BSTR *clipCleanTempDirString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR clipPasteInfoString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ BSTR *clipPasteInfoString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pPinConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR pLBInfo);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ BSTR *pLBInfo);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pRedirectDrives);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPrinters);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPorts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pDisableList);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pDisableList);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT *rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pMaxReconnectAttempts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pMaxReconnectAttempts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfShowMinimize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowMinimize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfShowRestore);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowRestore);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AuthenticationLevel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ unsigned int puiAuthLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AuthenticationLevel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ unsigned int *puiAuthLevel);
+
+ END_INTERFACE
+ } IMsRdpClientAdvancedSettings4Vtbl;
+
+ interface IMsRdpClientAdvancedSettings4
+ {
+ CONST_VTBL struct IMsRdpClientAdvancedSettings4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientAdvancedSettings4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientAdvancedSettings4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientAdvancedSettings4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientAdvancedSettings4_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientAdvancedSettings4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientAdvancedSettings4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientAdvancedSettings4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientAdvancedSettings4_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings4_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings4_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings4_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings4_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings4_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings4_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsRdpClientAdvancedSettings4_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+
+#define IMsRdpClientAdvancedSettings4_put_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings4_get_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings4_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings4_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings4_put_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings4_get_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings4_put_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> put_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings4_get_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> get_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings4_put_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings4_get_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings4_put_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings4_get_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings4_put_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings4_get_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings4_put_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings4_get_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings4_put_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings4_get_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings4_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings4_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings4_put_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings4_get_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings4_put_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings4_get_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings4_put_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings4_get_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings4_put_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings4_get_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings4_put_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings4_get_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings4_put_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings4_get_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings4_put_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings4_get_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings4_put_PersistCacheDirectory(This,rhs) \
+ ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings4_get_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings4_put_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings4_get_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings4_put_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings4_get_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings4_put_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings4_get_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings4_put_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings4_get_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings4_put_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_get_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_put_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_get_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_put_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_get_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_put_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings4_get_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings4_put_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings4_get_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings4_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings4_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings4_put_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings4_get_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings4_put_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings4_get_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings4_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_put_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings4_get_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings4_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings4_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings4_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings4_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings4_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings4_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings4_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings4_get_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings4_put_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings4_get_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings4_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings4_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings4_put_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings4_get_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings4_put_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings4_get_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings4_put_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings4_get_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings4_put_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings4_get_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings4_put_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings4_get_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings4_put_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings4_get_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings4_put_ConnectWithEndpoint(This,rhs) \
+ ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) )
+
+#define IMsRdpClientAdvancedSettings4_get_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) )
+
+
+#define IMsRdpClientAdvancedSettings4_get_CanAutoReconnect(This,pfCanAutoReconnect) \
+ ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings4_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings4_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings4_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+#define IMsRdpClientAdvancedSettings4_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+
+#define IMsRdpClientAdvancedSettings4_put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \
+ ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) )
+
+#define IMsRdpClientAdvancedSettings4_get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \
+ ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) )
+
+#define IMsRdpClientAdvancedSettings4_put_ConnectionBarShowRestoreButton(This,pfShowRestore) \
+ ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) )
+
+#define IMsRdpClientAdvancedSettings4_get_ConnectionBarShowRestoreButton(This,pfShowRestore) \
+ ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) )
+
+
+#define IMsRdpClientAdvancedSettings4_put_AuthenticationLevel(This,puiAuthLevel) \
+ ( (This)->lpVtbl -> put_AuthenticationLevel(This,puiAuthLevel) )
+
+#define IMsRdpClientAdvancedSettings4_get_AuthenticationLevel(This,puiAuthLevel) \
+ ( (This)->lpVtbl -> get_AuthenticationLevel(This,puiAuthLevel) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Proxy(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ unsigned int puiAuthLevel);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Proxy(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ unsigned int *puiAuthLevel);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IMsRdpClientAdvancedSettings4_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscSecuredSettings_INTERFACE_DEFINED__
+#define __IMsTscSecuredSettings_INTERFACE_DEFINED__
+
+/* interface IMsTscSecuredSettings */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscSecuredSettings;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("C9D65442-A0F9-45B2-8F73-D61D2DB8CBB6")
+ IMsTscSecuredSettings : public IDispatch
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartProgram(
+ /* [in] */ BSTR pStartProgram) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartProgram(
+ /* [retval][out] */ BSTR *pStartProgram) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WorkDir(
+ /* [in] */ BSTR pWorkDir) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WorkDir(
+ /* [retval][out] */ BSTR *pWorkDir) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen(
+ /* [in] */ long pfFullScreen) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen(
+ /* [retval][out] */ long *pfFullScreen) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscSecuredSettingsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscSecuredSettings * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscSecuredSettings * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscSecuredSettings * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ BSTR pStartProgram);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )(
+ IMsTscSecuredSettings * This,
+ /* [retval][out] */ BSTR *pStartProgram);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ BSTR pWorkDir);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )(
+ IMsTscSecuredSettings * This,
+ /* [retval][out] */ BSTR *pWorkDir);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ long pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsTscSecuredSettings * This,
+ /* [retval][out] */ long *pfFullScreen);
+
+ END_INTERFACE
+ } IMsTscSecuredSettingsVtbl;
+
+ interface IMsTscSecuredSettings
+ {
+ CONST_VTBL struct IMsTscSecuredSettingsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscSecuredSettings_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscSecuredSettings_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscSecuredSettings_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscSecuredSettings_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscSecuredSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscSecuredSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscSecuredSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsTscSecuredSettings_put_StartProgram(This,pStartProgram) \
+ ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) )
+
+#define IMsTscSecuredSettings_get_StartProgram(This,pStartProgram) \
+ ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) )
+
+#define IMsTscSecuredSettings_put_WorkDir(This,pWorkDir) \
+ ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) )
+
+#define IMsTscSecuredSettings_get_WorkDir(This,pWorkDir) \
+ ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) )
+
+#define IMsTscSecuredSettings_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsTscSecuredSettings_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscSecuredSettings_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientSecuredSettings_INTERFACE_DEFINED__
+#define __IMsRdpClientSecuredSettings_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientSecuredSettings */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientSecuredSettings;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("605BEFCF-39C1-45CC-A811-068FB7BE346D")
+ IMsRdpClientSecuredSettings : public IMsTscSecuredSettings
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardHookMode(
+ /* [in] */ long pkeyboardHookMode) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardHookMode(
+ /* [retval][out] */ long *pkeyboardHookMode) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AudioRedirectionMode(
+ /* [in] */ long pAudioRedirectionMode) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AudioRedirectionMode(
+ /* [retval][out] */ long *pAudioRedirectionMode) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientSecuredSettingsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientSecuredSettings * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientSecuredSettings * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientSecuredSettings * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ BSTR pStartProgram);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ BSTR *pStartProgram);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ BSTR pWorkDir);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ BSTR *pWorkDir);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ long pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ long *pfFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardHookMode )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ long pkeyboardHookMode);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardHookMode )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ long *pkeyboardHookMode);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AudioRedirectionMode )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ long pAudioRedirectionMode);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AudioRedirectionMode )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ long *pAudioRedirectionMode);
+
+ END_INTERFACE
+ } IMsRdpClientSecuredSettingsVtbl;
+
+ interface IMsRdpClientSecuredSettings
+ {
+ CONST_VTBL struct IMsRdpClientSecuredSettingsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientSecuredSettings_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientSecuredSettings_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientSecuredSettings_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientSecuredSettings_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientSecuredSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientSecuredSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientSecuredSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientSecuredSettings_put_StartProgram(This,pStartProgram) \
+ ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) )
+
+#define IMsRdpClientSecuredSettings_get_StartProgram(This,pStartProgram) \
+ ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) )
+
+#define IMsRdpClientSecuredSettings_put_WorkDir(This,pWorkDir) \
+ ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) )
+
+#define IMsRdpClientSecuredSettings_get_WorkDir(This,pWorkDir) \
+ ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) )
+
+#define IMsRdpClientSecuredSettings_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClientSecuredSettings_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+
+#define IMsRdpClientSecuredSettings_put_KeyboardHookMode(This,pkeyboardHookMode) \
+ ( (This)->lpVtbl -> put_KeyboardHookMode(This,pkeyboardHookMode) )
+
+#define IMsRdpClientSecuredSettings_get_KeyboardHookMode(This,pkeyboardHookMode) \
+ ( (This)->lpVtbl -> get_KeyboardHookMode(This,pkeyboardHookMode) )
+
+#define IMsRdpClientSecuredSettings_put_AudioRedirectionMode(This,pAudioRedirectionMode) \
+ ( (This)->lpVtbl -> put_AudioRedirectionMode(This,pAudioRedirectionMode) )
+
+#define IMsRdpClientSecuredSettings_get_AudioRedirectionMode(This,pAudioRedirectionMode) \
+ ( (This)->lpVtbl -> get_AudioRedirectionMode(This,pAudioRedirectionMode) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClientSecuredSettings_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscDebug_INTERFACE_DEFINED__
+#define __IMsTscDebug_INTERFACE_DEFINED__
+
+/* interface IMsTscDebug */
+/* [object][oleautomation][dual][hidden][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscDebug;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("209D0EB9-6254-47B1-9033-A98DAE55BB27")
+ IMsTscDebug : public IDispatch
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchBitmapPDU(
+ /* [in] */ long phatchBitmapPDU) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchBitmapPDU(
+ /* [retval][out] */ long *phatchBitmapPDU) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchSSBOrder(
+ /* [in] */ long phatchSSBOrder) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchSSBOrder(
+ /* [retval][out] */ long *phatchSSBOrder) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchMembltOrder(
+ /* [in] */ long phatchMembltOrder) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchMembltOrder(
+ /* [retval][out] */ long *phatchMembltOrder) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchIndexPDU(
+ /* [in] */ long phatchIndexPDU) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchIndexPDU(
+ /* [retval][out] */ long *phatchIndexPDU) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LabelMemblt(
+ /* [in] */ long plabelMemblt) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LabelMemblt(
+ /* [retval][out] */ long *plabelMemblt) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheMonitor(
+ /* [in] */ long pbitmapCacheMonitor) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheMonitor(
+ /* [retval][out] */ long *pbitmapCacheMonitor) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocFailuresPercent(
+ /* [in] */ long pmallocFailuresPercent) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocFailuresPercent(
+ /* [retval][out] */ long *pmallocFailuresPercent) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocHugeFailuresPercent(
+ /* [in] */ long pmallocHugeFailuresPercent) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocHugeFailuresPercent(
+ /* [retval][out] */ long *pmallocHugeFailuresPercent) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NetThroughput(
+ /* [in] */ long NetThroughput) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NetThroughput(
+ /* [retval][out] */ long *NetThroughput) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXCmdLine(
+ /* [in] */ BSTR pCLXCmdLine) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXCmdLine(
+ /* [retval][out] */ BSTR *pCLXCmdLine) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXDll(
+ /* [in] */ BSTR pCLXDll) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXDll(
+ /* [retval][out] */ BSTR *pCLXDll) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscDebugVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscDebug * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscDebug * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscDebug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscDebug * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscDebug * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscDebug * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscDebug * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchBitmapPDU )(
+ IMsTscDebug * This,
+ /* [in] */ long phatchBitmapPDU);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchBitmapPDU )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *phatchBitmapPDU);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchSSBOrder )(
+ IMsTscDebug * This,
+ /* [in] */ long phatchSSBOrder);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchSSBOrder )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *phatchSSBOrder);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchMembltOrder )(
+ IMsTscDebug * This,
+ /* [in] */ long phatchMembltOrder);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchMembltOrder )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *phatchMembltOrder);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchIndexPDU )(
+ IMsTscDebug * This,
+ /* [in] */ long phatchIndexPDU);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchIndexPDU )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *phatchIndexPDU);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LabelMemblt )(
+ IMsTscDebug * This,
+ /* [in] */ long plabelMemblt);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LabelMemblt )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *plabelMemblt);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheMonitor )(
+ IMsTscDebug * This,
+ /* [in] */ long pbitmapCacheMonitor);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheMonitor )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *pbitmapCacheMonitor);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocFailuresPercent )(
+ IMsTscDebug * This,
+ /* [in] */ long pmallocFailuresPercent);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocFailuresPercent )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *pmallocFailuresPercent);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocHugeFailuresPercent )(
+ IMsTscDebug * This,
+ /* [in] */ long pmallocHugeFailuresPercent);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocHugeFailuresPercent )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *pmallocHugeFailuresPercent);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NetThroughput )(
+ IMsTscDebug * This,
+ /* [in] */ long NetThroughput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NetThroughput )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *NetThroughput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXCmdLine )(
+ IMsTscDebug * This,
+ /* [in] */ BSTR pCLXCmdLine);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXCmdLine )(
+ IMsTscDebug * This,
+ /* [retval][out] */ BSTR *pCLXCmdLine);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXDll )(
+ IMsTscDebug * This,
+ /* [in] */ BSTR pCLXDll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXDll )(
+ IMsTscDebug * This,
+ /* [retval][out] */ BSTR *pCLXDll);
+
+ END_INTERFACE
+ } IMsTscDebugVtbl;
+
+ interface IMsTscDebug
+ {
+ CONST_VTBL struct IMsTscDebugVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscDebug_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscDebug_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscDebug_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscDebug_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscDebug_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscDebug_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscDebug_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsTscDebug_put_HatchBitmapPDU(This,phatchBitmapPDU) \
+ ( (This)->lpVtbl -> put_HatchBitmapPDU(This,phatchBitmapPDU) )
+
+#define IMsTscDebug_get_HatchBitmapPDU(This,phatchBitmapPDU) \
+ ( (This)->lpVtbl -> get_HatchBitmapPDU(This,phatchBitmapPDU) )
+
+#define IMsTscDebug_put_HatchSSBOrder(This,phatchSSBOrder) \
+ ( (This)->lpVtbl -> put_HatchSSBOrder(This,phatchSSBOrder) )
+
+#define IMsTscDebug_get_HatchSSBOrder(This,phatchSSBOrder) \
+ ( (This)->lpVtbl -> get_HatchSSBOrder(This,phatchSSBOrder) )
+
+#define IMsTscDebug_put_HatchMembltOrder(This,phatchMembltOrder) \
+ ( (This)->lpVtbl -> put_HatchMembltOrder(This,phatchMembltOrder) )
+
+#define IMsTscDebug_get_HatchMembltOrder(This,phatchMembltOrder) \
+ ( (This)->lpVtbl -> get_HatchMembltOrder(This,phatchMembltOrder) )
+
+#define IMsTscDebug_put_HatchIndexPDU(This,phatchIndexPDU) \
+ ( (This)->lpVtbl -> put_HatchIndexPDU(This,phatchIndexPDU) )
+
+#define IMsTscDebug_get_HatchIndexPDU(This,phatchIndexPDU) \
+ ( (This)->lpVtbl -> get_HatchIndexPDU(This,phatchIndexPDU) )
+
+#define IMsTscDebug_put_LabelMemblt(This,plabelMemblt) \
+ ( (This)->lpVtbl -> put_LabelMemblt(This,plabelMemblt) )
+
+#define IMsTscDebug_get_LabelMemblt(This,plabelMemblt) \
+ ( (This)->lpVtbl -> get_LabelMemblt(This,plabelMemblt) )
+
+#define IMsTscDebug_put_BitmapCacheMonitor(This,pbitmapCacheMonitor) \
+ ( (This)->lpVtbl -> put_BitmapCacheMonitor(This,pbitmapCacheMonitor) )
+
+#define IMsTscDebug_get_BitmapCacheMonitor(This,pbitmapCacheMonitor) \
+ ( (This)->lpVtbl -> get_BitmapCacheMonitor(This,pbitmapCacheMonitor) )
+
+#define IMsTscDebug_put_MallocFailuresPercent(This,pmallocFailuresPercent) \
+ ( (This)->lpVtbl -> put_MallocFailuresPercent(This,pmallocFailuresPercent) )
+
+#define IMsTscDebug_get_MallocFailuresPercent(This,pmallocFailuresPercent) \
+ ( (This)->lpVtbl -> get_MallocFailuresPercent(This,pmallocFailuresPercent) )
+
+#define IMsTscDebug_put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) \
+ ( (This)->lpVtbl -> put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) )
+
+#define IMsTscDebug_get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) \
+ ( (This)->lpVtbl -> get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) )
+
+#define IMsTscDebug_put_NetThroughput(This,NetThroughput) \
+ ( (This)->lpVtbl -> put_NetThroughput(This,NetThroughput) )
+
+#define IMsTscDebug_get_NetThroughput(This,NetThroughput) \
+ ( (This)->lpVtbl -> get_NetThroughput(This,NetThroughput) )
+
+#define IMsTscDebug_put_CLXCmdLine(This,pCLXCmdLine) \
+ ( (This)->lpVtbl -> put_CLXCmdLine(This,pCLXCmdLine) )
+
+#define IMsTscDebug_get_CLXCmdLine(This,pCLXCmdLine) \
+ ( (This)->lpVtbl -> get_CLXCmdLine(This,pCLXCmdLine) )
+
+#define IMsTscDebug_put_CLXDll(This,pCLXDll) \
+ ( (This)->lpVtbl -> put_CLXDll(This,pCLXDll) )
+
+#define IMsTscDebug_get_CLXDll(This,pCLXDll) \
+ ( (This)->lpVtbl -> get_CLXDll(This,pCLXDll) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscDebug_INTERFACE_DEFINED__ */
+
+
+EXTERN_C const CLSID CLSID_MsTscAx;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("A41A4187-5A86-4E26-B40A-856F9035D9CB")
+MsTscAx;
+#endif
+
+EXTERN_C const CLSID CLSID_MsRdpClient;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("7CACBD7B-0D99-468F-AC33-22E495C0AFE5")
+MsRdpClient;
+#endif
+
+EXTERN_C const CLSID CLSID_MsRdpClient2;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("3523C2FB-4031-44E4-9A3B-F1E94986EE7F")
+MsRdpClient2;
+#endif
+
+EXTERN_C const CLSID CLSID_MsRdpClient3;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("ACE575FD-1FCF-4074-9401-EBAB990FA9DE")
+MsRdpClient3;
+#endif
+
+EXTERN_C const CLSID CLSID_MsRdpClient4;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("6AE29350-321B-42BE-BBE5-12FB5270C0DE")
+MsRdpClient4;
+#endif
+#endif /* __MSTSCLib_LIBRARY_DEFINED__ */
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
--- /dev/null
+
+
+/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
+
+/* link this file in with the server and any clients */
+
+
+ /* File created by MIDL compiler version 7.00.0493 */
+/* at Sun Aug 13 16:46:06 2006
+ */
+/* Compiler settings for .\mstsclib.idl:
+ Oicf, W1, Zp8, env=Win32 (32b run)
+ protocol : dce , ms_ext, c_ext, robust
+ error checks: allocation ref bounds_check enum stub_data
+ VC __declspec() decoration level:
+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
+ DECLSPEC_UUID(), MIDL_INTERFACE()
+*/
+//@@MIDL_FILE_HEADING( )
+
+#pragma warning( disable: 4049 ) /* more than 64k source lines */
+
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifdef _MIDL_USE_GUIDDEF_
+
+#ifndef INITGUID
+#define INITGUID
+#include <guiddef.h>
+#undef INITGUID
+#else
+#include <guiddef.h>
+#endif
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
+
+#else // !_MIDL_USE_GUIDDEF_
+
+#ifndef __IID_DEFINED__
+#define __IID_DEFINED__
+
+typedef struct _IID
+{
+ unsigned long x;
+ unsigned short s1;
+ unsigned short s2;
+ unsigned char c[8];
+} IID;
+
+#endif // __IID_DEFINED__
+
+#ifndef CLSID_DEFINED
+#define CLSID_DEFINED
+typedef IID CLSID;
+#endif // CLSID_DEFINED
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+
+#endif !_MIDL_USE_GUIDDEF_
+
+MIDL_DEFINE_GUID(IID, LIBID_MSTSCLib,0x8C11EFA1,0x92C3,0x11D1,0xBC,0x1E,0x00,0xC0,0x4F,0xA3,0x14,0x89);
+
+
+MIDL_DEFINE_GUID(IID, DIID_IMsTscAxEvents,0x336D5562,0xEFA8,0x482E,0x8C,0xB3,0xC5,0xC0,0xFC,0x7A,0x7D,0xB6);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscAx,0x8C11EFAE,0x92C3,0x11D1,0xBC,0x1E,0x00,0xC0,0x4F,0xA3,0x14,0x89);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClient,0x92B4A539,0x7115,0x4B7C,0xA5,0xA9,0xE5,0xD9,0xEF,0xC2,0x78,0x0A);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClient2,0xE7E17DC4,0x3B71,0x4BA7,0xA8,0xE6,0x28,0x1F,0xFA,0xDC,0xA2,0x8F);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClient3,0x91B7CBC5,0xA72E,0x4FA0,0x93,0x00,0xD6,0x47,0xD7,0xE8,0x97,0xFF);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClient4,0x095E0738,0xD97D,0x488B,0xB9,0xF6,0xDD,0x0E,0x8D,0x66,0xC0,0xDE);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscNonScriptable,0xC1E6743A,0x41C1,0x4A74,0x83,0x2A,0x0D,0xD0,0x6C,0x1C,0x7A,0x0E);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientNonScriptable,0x2F079C4C,0x87B2,0x4AFD,0x97,0xAB,0x20,0xCD,0xB4,0x30,0x38,0xAE);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientNonScriptable2,0x17A5E535,0x4072,0x4FA4,0xAF,0x32,0xC8,0xD0,0xD4,0x73,0x45,0xE9);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscAdvancedSettings,0x809945CC,0x4B3B,0x4A92,0xA6,0xB0,0xDB,0xF9,0xB5,0xF2,0xEF,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientAdvancedSettings,0x3C65B4AB,0x12B3,0x465B,0xAC,0xD4,0xB8,0xDA,0xD3,0xBF,0xF9,0xE2);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientAdvancedSettings2,0x9AC42117,0x2B76,0x4320,0xAA,0x44,0x0E,0x61,0x6A,0xB8,0x43,0x7B);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientAdvancedSettings3,0x19CD856B,0xC542,0x4C53,0xAC,0xEE,0xF1,0x27,0xE3,0xBE,0x1A,0x59);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientAdvancedSettings4,0xFBA7F64E,0x7345,0x4405,0xAE,0x50,0xFA,0x4A,0x76,0x3D,0xC0,0xDE);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscSecuredSettings,0xC9D65442,0xA0F9,0x45B2,0x8F,0x73,0xD6,0x1D,0x2D,0xB8,0xCB,0xB6);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientSecuredSettings,0x605BEFCF,0x39C1,0x45CC,0xA8,0x11,0x06,0x8F,0xB7,0xBE,0x34,0x6D);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscDebug,0x209D0EB9,0x6254,0x47B1,0x90,0x33,0xA9,0x8D,0xAE,0x55,0xBB,0x27);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsTscAx,0xA41A4187,0x5A86,0x4E26,0xB4,0x0A,0x85,0x6F,0x90,0x35,0xD9,0xCB);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsRdpClient,0x7CACBD7B,0x0D99,0x468F,0xAC,0x33,0x22,0xE4,0x95,0xC0,0xAF,0xE5);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsRdpClient2,0x3523C2FB,0x4031,0x44E4,0x9A,0x3B,0xF1,0xE9,0x49,0x86,0xEE,0x7F);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsRdpClient3,0xACE575FD,0x1FCF,0x4074,0x94,0x01,0xEB,0xAB,0x99,0x0F,0xA9,0xDE);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsRdpClient4,0x6AE29350,0x321B,0x42BE,0xBB,0xE5,0x12,0xFB,0x52,0x70,0xC0,0xDE);
+
+#undef MIDL_DEFINE_GUID
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
--- /dev/null
+#define MSTSCLIB_REDIST_
+#include "./mstsclib.idl"
+// EOF
--- /dev/null
+#define TYPELIB_RESOURCEID__ 2
+#include "./typelib.rh"
+// EOF
--- /dev/null
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 7.00.0493 */
+/* at Sun Aug 13 16:46:05 2006
+ */
+/* Compiler settings for .\mstsclib_redist.idl:
+ Oicf, W1, Zp8, env=Win32 (32b run)
+ protocol : dce , ms_ext, c_ext, robust
+ error checks: allocation ref bounds_check enum stub_data
+ VC __declspec() decoration level:
+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
+ DECLSPEC_UUID(), MIDL_INTERFACE()
+*/
+//@@MIDL_FILE_HEADING( )
+
+#pragma warning( disable: 4049 ) /* more than 64k source lines */
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif // __RPCNDR_H_VERSION__
+
+
+#ifndef __mstsclib_redist_h_h__
+#define __mstsclib_redist_h_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IMsTscAxEvents_FWD_DEFINED__
+#define __IMsTscAxEvents_FWD_DEFINED__
+typedef interface IMsTscAxEvents IMsTscAxEvents;
+#endif /* __IMsTscAxEvents_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscAx_FWD_DEFINED__
+#define __IMsTscAx_FWD_DEFINED__
+typedef interface IMsTscAx IMsTscAx;
+#endif /* __IMsTscAx_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClient_FWD_DEFINED__
+#define __IMsRdpClient_FWD_DEFINED__
+typedef interface IMsRdpClient IMsRdpClient;
+#endif /* __IMsRdpClient_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClient2_FWD_DEFINED__
+#define __IMsRdpClient2_FWD_DEFINED__
+typedef interface IMsRdpClient2 IMsRdpClient2;
+#endif /* __IMsRdpClient2_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClient3_FWD_DEFINED__
+#define __IMsRdpClient3_FWD_DEFINED__
+typedef interface IMsRdpClient3 IMsRdpClient3;
+#endif /* __IMsRdpClient3_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClient4_FWD_DEFINED__
+#define __IMsRdpClient4_FWD_DEFINED__
+typedef interface IMsRdpClient4 IMsRdpClient4;
+#endif /* __IMsRdpClient4_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscNonScriptable_FWD_DEFINED__
+#define __IMsTscNonScriptable_FWD_DEFINED__
+typedef interface IMsTscNonScriptable IMsTscNonScriptable;
+#endif /* __IMsTscNonScriptable_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientNonScriptable_FWD_DEFINED__
+#define __IMsRdpClientNonScriptable_FWD_DEFINED__
+typedef interface IMsRdpClientNonScriptable IMsRdpClientNonScriptable;
+#endif /* __IMsRdpClientNonScriptable_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientNonScriptable2_FWD_DEFINED__
+#define __IMsRdpClientNonScriptable2_FWD_DEFINED__
+typedef interface IMsRdpClientNonScriptable2 IMsRdpClientNonScriptable2;
+#endif /* __IMsRdpClientNonScriptable2_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscAdvancedSettings_FWD_DEFINED__
+#define __IMsTscAdvancedSettings_FWD_DEFINED__
+typedef interface IMsTscAdvancedSettings IMsTscAdvancedSettings;
+#endif /* __IMsTscAdvancedSettings_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings_FWD_DEFINED__
+#define __IMsRdpClientAdvancedSettings_FWD_DEFINED__
+typedef interface IMsRdpClientAdvancedSettings IMsRdpClientAdvancedSettings;
+#endif /* __IMsRdpClientAdvancedSettings_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings2_FWD_DEFINED__
+#define __IMsRdpClientAdvancedSettings2_FWD_DEFINED__
+typedef interface IMsRdpClientAdvancedSettings2 IMsRdpClientAdvancedSettings2;
+#endif /* __IMsRdpClientAdvancedSettings2_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings3_FWD_DEFINED__
+#define __IMsRdpClientAdvancedSettings3_FWD_DEFINED__
+typedef interface IMsRdpClientAdvancedSettings3 IMsRdpClientAdvancedSettings3;
+#endif /* __IMsRdpClientAdvancedSettings3_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings4_FWD_DEFINED__
+#define __IMsRdpClientAdvancedSettings4_FWD_DEFINED__
+typedef interface IMsRdpClientAdvancedSettings4 IMsRdpClientAdvancedSettings4;
+#endif /* __IMsRdpClientAdvancedSettings4_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscSecuredSettings_FWD_DEFINED__
+#define __IMsTscSecuredSettings_FWD_DEFINED__
+typedef interface IMsTscSecuredSettings IMsTscSecuredSettings;
+#endif /* __IMsTscSecuredSettings_FWD_DEFINED__ */
+
+
+#ifndef __IMsRdpClientSecuredSettings_FWD_DEFINED__
+#define __IMsRdpClientSecuredSettings_FWD_DEFINED__
+typedef interface IMsRdpClientSecuredSettings IMsRdpClientSecuredSettings;
+#endif /* __IMsRdpClientSecuredSettings_FWD_DEFINED__ */
+
+
+#ifndef __IMsTscDebug_FWD_DEFINED__
+#define __IMsTscDebug_FWD_DEFINED__
+typedef interface IMsTscDebug IMsTscDebug;
+#endif /* __IMsTscDebug_FWD_DEFINED__ */
+
+
+#ifndef __MsTscAx_FWD_DEFINED__
+#define __MsTscAx_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsTscAx MsTscAx;
+#else
+typedef struct MsTscAx MsTscAx;
+#endif /* __cplusplus */
+
+#endif /* __MsTscAx_FWD_DEFINED__ */
+
+
+#ifndef __MsRdpClient_FWD_DEFINED__
+#define __MsRdpClient_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsRdpClient MsRdpClient;
+#else
+typedef struct MsRdpClient MsRdpClient;
+#endif /* __cplusplus */
+
+#endif /* __MsRdpClient_FWD_DEFINED__ */
+
+
+#ifndef __MsRdpClient2_FWD_DEFINED__
+#define __MsRdpClient2_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsRdpClient2 MsRdpClient2;
+#else
+typedef struct MsRdpClient2 MsRdpClient2;
+#endif /* __cplusplus */
+
+#endif /* __MsRdpClient2_FWD_DEFINED__ */
+
+
+#ifndef __MsRdpClient3_FWD_DEFINED__
+#define __MsRdpClient3_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsRdpClient3 MsRdpClient3;
+#else
+typedef struct MsRdpClient3 MsRdpClient3;
+#endif /* __cplusplus */
+
+#endif /* __MsRdpClient3_FWD_DEFINED__ */
+
+
+#ifndef __MsRdpClient4_FWD_DEFINED__
+#define __MsRdpClient4_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class MsRdpClient4 MsRdpClient4;
+#else
+typedef struct MsRdpClient4 MsRdpClient4;
+#endif /* __cplusplus */
+
+#endif /* __MsRdpClient4_FWD_DEFINED__ */
+
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+
+#ifndef __MSTSCLib_LIBRARY_DEFINED__
+#define __MSTSCLib_LIBRARY_DEFINED__
+
+/* library MSTSCLib */
+/* [version][uuid] */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef /* [public][public][public] */
+enum __MIDL___MIDL_itf_mstsax_0275_0001
+ { autoReconnectContinueAutomatic = 0,
+ autoReconnectContinueStop = 1,
+ autoReconnectContinueManual = 2
+ } AutoReconnectContinueState;
+
+typedef /* [public][public][public] */
+enum __MIDL_IMsRdpClient_0001
+ { exDiscReasonNoInfo = 0,
+ exDiscReasonAPIInitiatedDisconnect = 1,
+ exDiscReasonAPIInitiatedLogoff = 2,
+ exDiscReasonServerIdleTimeout = 3,
+ exDiscReasonServerLogonTimeout = 4,
+ exDiscReasonReplacedByOtherConnection = 5,
+ exDiscReasonOutOfMemory = 6,
+ exDiscReasonServerDeniedConnection = 7,
+ exDiscReasonServerDeniedConnectionFips = 8,
+ exDiscReasonLicenseInternal = 256,
+ exDiscReasonLicenseNoLicenseServer = 257,
+ exDiscReasonLicenseNoLicense = 258,
+ exDiscReasonLicenseErrClientMsg = 259,
+ exDiscReasonLicenseHwidDoesntMatchLicense = 260,
+ exDiscReasonLicenseErrClientLicense = 261,
+ exDiscReasonLicenseCantFinishProtocol = 262,
+ exDiscReasonLicenseClientEndedProtocol = 263,
+ exDiscReasonLicenseErrClientEncryption = 264,
+ exDiscReasonLicenseCantUpgradeLicense = 265,
+ exDiscReasonLicenseNoRemoteConnections = 266,
+ exDiscReasonProtocolRangeStart = 4096,
+ exDiscReasonProtocolRangeEnd = 32767
+ } ExtendedDisconnectReasonCode;
+
+typedef /* [public][public][public] */
+enum __MIDL_IMsRdpClient_0002
+ { controlCloseCanProceed = 0,
+ controlCloseWaitForEvents = 1
+ } ControlCloseStatus;
+
+typedef /* [custom][public] */ unsigned __int3264 UINT_PTR;
+
+typedef /* [custom][public] */ __int3264 LONG_PTR;
+
+
+EXTERN_C const IID LIBID_MSTSCLib;
+
+#ifndef __IMsTscAxEvents_DISPINTERFACE_DEFINED__
+#define __IMsTscAxEvents_DISPINTERFACE_DEFINED__
+
+/* dispinterface IMsTscAxEvents */
+/* [uuid] */
+
+
+EXTERN_C const IID DIID_IMsTscAxEvents;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("336D5562-EFA8-482E-8CB3-C5C0FC7A7DB6")
+ IMsTscAxEvents : public IDispatch
+ {
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscAxEventsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscAxEvents * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscAxEvents * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscAxEvents * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscAxEvents * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscAxEvents * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscAxEvents * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscAxEvents * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ END_INTERFACE
+ } IMsTscAxEventsVtbl;
+
+ interface IMsTscAxEvents
+ {
+ CONST_VTBL struct IMsTscAxEventsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscAxEvents_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscAxEvents_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscAxEvents_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscAxEvents_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscAxEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscAxEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscAxEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+#endif /* __IMsTscAxEvents_DISPINTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscAx_INTERFACE_DEFINED__
+#define __IMsTscAx_INTERFACE_DEFINED__
+
+/* interface IMsTscAx */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscAx;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("327BB5CD-834E-4400-AEF2-B30E15E5D682")
+ IMsTscAx : public IDispatch
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Server(
+ /* [in] */ BSTR pServer) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Server(
+ /* [retval][out] */ BSTR *pServer) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Domain(
+ /* [in] */ BSTR pDomain) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Domain(
+ /* [retval][out] */ BSTR *pDomain) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_UserName(
+ /* [in] */ BSTR pUserName) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_UserName(
+ /* [retval][out] */ BSTR *pUserName) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisconnectedText(
+ /* [in] */ BSTR pDisconnectedText) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisconnectedText(
+ /* [retval][out] */ BSTR *pDisconnectedText) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectingText(
+ /* [in] */ BSTR pConnectingText) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectingText(
+ /* [retval][out] */ BSTR *pConnectingText) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Connected(
+ /* [retval][out] */ short *pIsConnected) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopWidth(
+ /* [in] */ long pVal) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopWidth(
+ /* [retval][out] */ long *pVal) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopHeight(
+ /* [in] */ long pVal) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopHeight(
+ /* [retval][out] */ long *pVal) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartConnected(
+ /* [in] */ long pfStartConnected) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartConnected(
+ /* [retval][out] */ long *pfStartConnected) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HorizontalScrollBarVisible(
+ /* [retval][out] */ long *pfHScrollVisible) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_VerticalScrollBarVisible(
+ /* [retval][out] */ long *pfVScrollVisible) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreenTitle(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CipherStrength(
+ /* [retval][out] */ long *pCipherStrength) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Version(
+ /* [retval][out] */ BSTR *pVersion) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettingsEnabled(
+ /* [retval][out] */ long *pSecuredSettingsEnabled) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings(
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings(
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings) = 0;
+
+ virtual /* [hidden][propget][id] */ HRESULT STDMETHODCALLTYPE get_Debugger(
+ /* [retval][out] */ IMsTscDebug **ppDebugger) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE Connect( void) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE Disconnect( void) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE CreateVirtualChannels(
+ /* [in] */ BSTR newVal) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendOnVirtualChannel(
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscAxVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscAx * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscAx * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscAx * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscAx * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscAx * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscAx * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscAx * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsTscAx * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsTscAx * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsTscAx * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsTscAx * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsTscAx * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsTscAx * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsTscAx * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsTscAx * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsTscAx * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsTscAx * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsTscAx * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsTscAx * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsTscAx * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsTscAx * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsTscAx * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ END_INTERFACE
+ } IMsTscAxVtbl;
+
+ interface IMsTscAx
+ {
+ CONST_VTBL struct IMsTscAxVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscAx_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscAx_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscAx_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscAx_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscAx_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscAx_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscAx_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsTscAx_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsTscAx_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsTscAx_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsTscAx_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsTscAx_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsTscAx_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsTscAx_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsTscAx_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsTscAx_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsTscAx_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsTscAx_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsTscAx_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsTscAx_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsTscAx_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsTscAx_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsTscAx_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsTscAx_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsTscAx_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsTscAx_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsTscAx_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsTscAx_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsTscAx_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsTscAx_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsTscAx_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsTscAx_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsTscAx_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsTscAx_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsTscAx_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsTscAx_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsTscAx_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscAx_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClient_INTERFACE_DEFINED__
+#define __IMsRdpClient_INTERFACE_DEFINED__
+
+/* interface IMsRdpClient */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClient;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("92B4A539-7115-4B7C-A5A9-E5D9EFC2780A")
+ IMsRdpClient : public IMsTscAx
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ColorDepth(
+ /* [in] */ long pcolorDepth) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ColorDepth(
+ /* [retval][out] */ long *pcolorDepth) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings2(
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings2(
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ExtendedDisconnectReason(
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen(
+ /* [in] */ VARIANT_BOOL pfFullScreen) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen(
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE SetVirtualChannelOptions(
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE GetVirtualChannelOptions(
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions) = 0;
+
+ virtual /* [id] */ HRESULT STDMETHODCALLTYPE RequestClose(
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClient * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClient * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClient * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClient * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClient * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClient * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClient * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsRdpClient * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsRdpClient * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsRdpClient * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsRdpClient * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsRdpClient * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsRdpClient * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsRdpClient * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )(
+ IMsRdpClient * This,
+ /* [in] */ long pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )(
+ IMsRdpClient * This,
+ /* [retval][out] */ long *pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )(
+ IMsRdpClient * This,
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )(
+ IMsRdpClient * This,
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClient * This,
+ /* [in] */ VARIANT_BOOL pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClient * This,
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )(
+ IMsRdpClient * This,
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )(
+ IMsRdpClient * This,
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus);
+
+ END_INTERFACE
+ } IMsRdpClientVtbl;
+
+ interface IMsRdpClient
+ {
+ CONST_VTBL struct IMsRdpClientVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClient_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClient_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClient_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClient_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClient_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClient_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClient_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClient_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsRdpClient_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsRdpClient_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsRdpClient_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsRdpClient_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsRdpClient_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsRdpClient_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsRdpClient_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsRdpClient_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsRdpClient_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsRdpClient_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsRdpClient_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsRdpClient_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsRdpClient_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsRdpClient_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsRdpClient_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsRdpClient_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsRdpClient_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsRdpClient_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsRdpClient_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+
+#define IMsRdpClient_put_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient_get_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient_get_AdvancedSettings2(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) )
+
+#define IMsRdpClient_get_SecuredSettings2(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) )
+
+#define IMsRdpClient_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \
+ ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) )
+
+#define IMsRdpClient_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient_SetVirtualChannelOptions(This,chanName,chanOptions) \
+ ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) )
+
+#define IMsRdpClient_GetVirtualChannelOptions(This,chanName,pChanOptions) \
+ ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) )
+
+#define IMsRdpClient_RequestClose(This,pCloseStatus) \
+ ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClient_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClient2_INTERFACE_DEFINED__
+#define __IMsRdpClient2_INTERFACE_DEFINED__
+
+/* interface IMsRdpClient2 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClient2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("E7E17DC4-3B71-4BA7-A8E6-281FFADCA28F")
+ IMsRdpClient2 : public IMsRdpClient
+ {
+ public:
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings3(
+ /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectedStatusText(
+ /* [in] */ BSTR pConnectedStatusText) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectedStatusText(
+ /* [retval][out] */ BSTR *pConnectedStatusText) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClient2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClient2 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClient2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClient2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClient2 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClient2 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClient2 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClient2 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsRdpClient2 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsRdpClient2 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsRdpClient2 * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsRdpClient2 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsRdpClient2 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )(
+ IMsRdpClient2 * This,
+ /* [in] */ long pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ long *pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClient2 * This,
+ /* [in] */ VARIANT_BOOL pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )(
+ IMsRdpClient2 * This,
+ /* [in] */ BSTR pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )(
+ IMsRdpClient2 * This,
+ /* [retval][out] */ BSTR *pConnectedStatusText);
+
+ END_INTERFACE
+ } IMsRdpClient2Vtbl;
+
+ interface IMsRdpClient2
+ {
+ CONST_VTBL struct IMsRdpClient2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClient2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClient2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClient2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClient2_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClient2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClient2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClient2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClient2_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsRdpClient2_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsRdpClient2_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsRdpClient2_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsRdpClient2_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsRdpClient2_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsRdpClient2_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient2_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient2_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient2_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient2_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsRdpClient2_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient2_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient2_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient2_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient2_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient2_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient2_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsRdpClient2_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsRdpClient2_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsRdpClient2_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsRdpClient2_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsRdpClient2_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsRdpClient2_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsRdpClient2_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsRdpClient2_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsRdpClient2_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsRdpClient2_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsRdpClient2_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsRdpClient2_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+
+#define IMsRdpClient2_put_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient2_get_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient2_get_AdvancedSettings2(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) )
+
+#define IMsRdpClient2_get_SecuredSettings2(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) )
+
+#define IMsRdpClient2_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \
+ ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) )
+
+#define IMsRdpClient2_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient2_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient2_SetVirtualChannelOptions(This,chanName,chanOptions) \
+ ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) )
+
+#define IMsRdpClient2_GetVirtualChannelOptions(This,chanName,pChanOptions) \
+ ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) )
+
+#define IMsRdpClient2_RequestClose(This,pCloseStatus) \
+ ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) )
+
+
+#define IMsRdpClient2_get_AdvancedSettings3(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) )
+
+#define IMsRdpClient2_put_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) )
+
+#define IMsRdpClient2_get_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClient2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClient3_INTERFACE_DEFINED__
+#define __IMsRdpClient3_INTERFACE_DEFINED__
+
+/* interface IMsRdpClient3 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClient3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("91B7CBC5-A72E-4FA0-9300-D647D7E897FF")
+ IMsRdpClient3 : public IMsRdpClient2
+ {
+ public:
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings4(
+ /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClient3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClient3 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClient3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClient3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClient3 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClient3 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClient3 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClient3 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsRdpClient3 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsRdpClient3 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsRdpClient3 * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsRdpClient3 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsRdpClient3 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )(
+ IMsRdpClient3 * This,
+ /* [in] */ long pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ long *pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClient3 * This,
+ /* [in] */ VARIANT_BOOL pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )(
+ IMsRdpClient3 * This,
+ /* [in] */ BSTR pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ BSTR *pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )(
+ IMsRdpClient3 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings);
+
+ END_INTERFACE
+ } IMsRdpClient3Vtbl;
+
+ interface IMsRdpClient3
+ {
+ CONST_VTBL struct IMsRdpClient3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClient3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClient3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClient3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClient3_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClient3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClient3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClient3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClient3_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsRdpClient3_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsRdpClient3_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsRdpClient3_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsRdpClient3_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsRdpClient3_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsRdpClient3_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient3_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient3_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient3_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient3_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsRdpClient3_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient3_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient3_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient3_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient3_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient3_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient3_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsRdpClient3_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsRdpClient3_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsRdpClient3_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsRdpClient3_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsRdpClient3_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsRdpClient3_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsRdpClient3_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsRdpClient3_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsRdpClient3_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsRdpClient3_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsRdpClient3_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsRdpClient3_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+
+#define IMsRdpClient3_put_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient3_get_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient3_get_AdvancedSettings2(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) )
+
+#define IMsRdpClient3_get_SecuredSettings2(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) )
+
+#define IMsRdpClient3_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \
+ ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) )
+
+#define IMsRdpClient3_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient3_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient3_SetVirtualChannelOptions(This,chanName,chanOptions) \
+ ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) )
+
+#define IMsRdpClient3_GetVirtualChannelOptions(This,chanName,pChanOptions) \
+ ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) )
+
+#define IMsRdpClient3_RequestClose(This,pCloseStatus) \
+ ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) )
+
+
+#define IMsRdpClient3_get_AdvancedSettings3(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) )
+
+#define IMsRdpClient3_put_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) )
+
+#define IMsRdpClient3_get_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) )
+
+
+#define IMsRdpClient3_get_AdvancedSettings4(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClient3_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClient4_INTERFACE_DEFINED__
+#define __IMsRdpClient4_INTERFACE_DEFINED__
+
+/* interface IMsRdpClient4 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClient4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("095E0738-D97D-488B-B9F6-DD0E8D66C0DE")
+ IMsRdpClient4 : public IMsRdpClient3
+ {
+ public:
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings5(
+ /* [retval][out] */ IMsRdpClientAdvancedSettings4 **ppAdvSettings5) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClient4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClient4 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClient4 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClient4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClient4 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClient4 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClient4 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClient4 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pServer);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pServer);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pDomain);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pDomain);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pUserName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pUserName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pDisconnectedText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pDisconnectedText);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pConnectingText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ short *pIsConnected);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )(
+ IMsRdpClient4 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )(
+ IMsRdpClient4 * This,
+ /* [in] */ long pVal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pVal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )(
+ IMsRdpClient4 * This,
+ /* [in] */ long pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pfStartConnected);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pfHScrollVisible);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pfVScrollVisible);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pCipherStrength);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pVersion);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pSecuredSettingsEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings);
+
+ /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsTscDebug **ppDebugger);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )(
+ IMsRdpClient4 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )(
+ IMsRdpClient4 * This);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR newVal);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ BSTR ChanData);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )(
+ IMsRdpClient4 * This,
+ /* [in] */ long pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ long *pcolorDepth);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClient4 * This,
+ /* [in] */ VARIANT_BOOL pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfFullScreen);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR chanName,
+ /* [in] */ long chanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR chanName,
+ /* [retval][out] */ long *pChanOptions);
+
+ /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ ControlCloseStatus *pCloseStatus);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )(
+ IMsRdpClient4 * This,
+ /* [in] */ BSTR pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ BSTR *pConnectedStatusText);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings5 )(
+ IMsRdpClient4 * This,
+ /* [retval][out] */ IMsRdpClientAdvancedSettings4 **ppAdvSettings5);
+
+ END_INTERFACE
+ } IMsRdpClient4Vtbl;
+
+ interface IMsRdpClient4
+ {
+ CONST_VTBL struct IMsRdpClient4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClient4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClient4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClient4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClient4_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClient4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClient4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClient4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClient4_put_Server(This,pServer) \
+ ( (This)->lpVtbl -> put_Server(This,pServer) )
+
+#define IMsRdpClient4_get_Server(This,pServer) \
+ ( (This)->lpVtbl -> get_Server(This,pServer) )
+
+#define IMsRdpClient4_put_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> put_Domain(This,pDomain) )
+
+#define IMsRdpClient4_get_Domain(This,pDomain) \
+ ( (This)->lpVtbl -> get_Domain(This,pDomain) )
+
+#define IMsRdpClient4_put_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> put_UserName(This,pUserName) )
+
+#define IMsRdpClient4_get_UserName(This,pUserName) \
+ ( (This)->lpVtbl -> get_UserName(This,pUserName) )
+
+#define IMsRdpClient4_put_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient4_get_DisconnectedText(This,pDisconnectedText) \
+ ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) )
+
+#define IMsRdpClient4_put_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient4_get_ConnectingText(This,pConnectingText) \
+ ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) )
+
+#define IMsRdpClient4_get_Connected(This,pIsConnected) \
+ ( (This)->lpVtbl -> get_Connected(This,pIsConnected) )
+
+#define IMsRdpClient4_put_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient4_get_DesktopWidth(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) )
+
+#define IMsRdpClient4_put_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient4_get_DesktopHeight(This,pVal) \
+ ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) )
+
+#define IMsRdpClient4_put_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient4_get_StartConnected(This,pfStartConnected) \
+ ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) )
+
+#define IMsRdpClient4_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \
+ ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) )
+
+#define IMsRdpClient4_get_VerticalScrollBarVisible(This,pfVScrollVisible) \
+ ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) )
+
+#define IMsRdpClient4_put_FullScreenTitle(This,rhs) \
+ ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) )
+
+#define IMsRdpClient4_get_CipherStrength(This,pCipherStrength) \
+ ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) )
+
+#define IMsRdpClient4_get_Version(This,pVersion) \
+ ( (This)->lpVtbl -> get_Version(This,pVersion) )
+
+#define IMsRdpClient4_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \
+ ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) )
+
+#define IMsRdpClient4_get_SecuredSettings(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) )
+
+#define IMsRdpClient4_get_AdvancedSettings(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) )
+
+#define IMsRdpClient4_get_Debugger(This,ppDebugger) \
+ ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) )
+
+#define IMsRdpClient4_Connect(This) \
+ ( (This)->lpVtbl -> Connect(This) )
+
+#define IMsRdpClient4_Disconnect(This) \
+ ( (This)->lpVtbl -> Disconnect(This) )
+
+#define IMsRdpClient4_CreateVirtualChannels(This,newVal) \
+ ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) )
+
+#define IMsRdpClient4_SendOnVirtualChannel(This,chanName,ChanData) \
+ ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) )
+
+
+#define IMsRdpClient4_put_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient4_get_ColorDepth(This,pcolorDepth) \
+ ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) )
+
+#define IMsRdpClient4_get_AdvancedSettings2(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) )
+
+#define IMsRdpClient4_get_SecuredSettings2(This,ppSecuredSettings) \
+ ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) )
+
+#define IMsRdpClient4_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \
+ ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) )
+
+#define IMsRdpClient4_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient4_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClient4_SetVirtualChannelOptions(This,chanName,chanOptions) \
+ ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) )
+
+#define IMsRdpClient4_GetVirtualChannelOptions(This,chanName,pChanOptions) \
+ ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) )
+
+#define IMsRdpClient4_RequestClose(This,pCloseStatus) \
+ ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) )
+
+
+#define IMsRdpClient4_get_AdvancedSettings3(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) )
+
+#define IMsRdpClient4_put_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) )
+
+#define IMsRdpClient4_get_ConnectedStatusText(This,pConnectedStatusText) \
+ ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) )
+
+
+#define IMsRdpClient4_get_AdvancedSettings4(This,ppAdvSettings) \
+ ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) )
+
+
+#define IMsRdpClient4_get_AdvancedSettings5(This,ppAdvSettings5) \
+ ( (This)->lpVtbl -> get_AdvancedSettings5(This,ppAdvSettings5) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClient4_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscNonScriptable_INTERFACE_DEFINED__
+#define __IMsTscNonScriptable_INTERFACE_DEFINED__
+
+/* interface IMsTscNonScriptable */
+/* [object][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscNonScriptable;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("C1E6743A-41C1-4A74-832A-0DD06C1C7A0E")
+ IMsTscNonScriptable : public IUnknown
+ {
+ public:
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortablePassword(
+ /* [in] */ BSTR pPortablePass) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortablePassword(
+ /* [retval][out] */ BSTR *pPortablePass) = 0;
+
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortableSalt(
+ /* [in] */ BSTR pPortableSalt) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortableSalt(
+ /* [retval][out] */ BSTR *pPortableSalt) = 0;
+
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinaryPassword(
+ /* [in] */ BSTR pBinaryPassword) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinaryPassword(
+ /* [retval][out] */ BSTR *pBinaryPassword) = 0;
+
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinarySalt(
+ /* [in] */ BSTR pSalt) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinarySalt(
+ /* [retval][out] */ BSTR *pSalt) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ResetPassword( void) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscNonScriptableVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscNonScriptable * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscNonScriptable * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscNonScriptable * This);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR pPortablePass);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )(
+ IMsTscNonScriptable * This,
+ /* [retval][out] */ BSTR *pPortablePass);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR pPortableSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )(
+ IMsTscNonScriptable * This,
+ /* [retval][out] */ BSTR *pPortableSalt);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR pBinaryPassword);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )(
+ IMsTscNonScriptable * This,
+ /* [retval][out] */ BSTR *pBinaryPassword);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )(
+ IMsTscNonScriptable * This,
+ /* [in] */ BSTR pSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )(
+ IMsTscNonScriptable * This,
+ /* [retval][out] */ BSTR *pSalt);
+
+ HRESULT ( STDMETHODCALLTYPE *ResetPassword )(
+ IMsTscNonScriptable * This);
+
+ END_INTERFACE
+ } IMsTscNonScriptableVtbl;
+
+ interface IMsTscNonScriptable
+ {
+ CONST_VTBL struct IMsTscNonScriptableVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscNonScriptable_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscNonScriptable_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscNonScriptable_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscNonScriptable_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsTscNonScriptable_put_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) )
+
+#define IMsTscNonScriptable_get_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) )
+
+#define IMsTscNonScriptable_put_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) )
+
+#define IMsTscNonScriptable_get_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) )
+
+#define IMsTscNonScriptable_put_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsTscNonScriptable_get_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsTscNonScriptable_put_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) )
+
+#define IMsTscNonScriptable_get_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) )
+
+#define IMsTscNonScriptable_ResetPassword(This) \
+ ( (This)->lpVtbl -> ResetPassword(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscNonScriptable_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientNonScriptable_INTERFACE_DEFINED__
+#define __IMsRdpClientNonScriptable_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientNonScriptable */
+/* [object][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientNonScriptable;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("2F079C4C-87B2-4AFD-97AB-20CDB43038AE")
+ IMsRdpClientNonScriptable : public IMsTscNonScriptable
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE NotifyRedirectDeviceChange(
+ /* [in] */ UINT_PTR wParam,
+ /* [in] */ LONG_PTR lParam) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SendKeys(
+ /* [in] */ long numKeys,
+ /* [in] */ VARIANT_BOOL *pbArrayKeyUp,
+ /* [in] */ long *plKeyData) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientNonScriptableVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientNonScriptable * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientNonScriptable * This);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR pPortablePass);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [retval][out] */ BSTR *pPortablePass);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR pPortableSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )(
+ IMsRdpClientNonScriptable * This,
+ /* [retval][out] */ BSTR *pPortableSalt);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR pBinaryPassword);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )(
+ IMsRdpClientNonScriptable * This,
+ /* [retval][out] */ BSTR *pBinaryPassword);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ BSTR pSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )(
+ IMsRdpClientNonScriptable * This,
+ /* [retval][out] */ BSTR *pSalt);
+
+ HRESULT ( STDMETHODCALLTYPE *ResetPassword )(
+ IMsRdpClientNonScriptable * This);
+
+ HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ UINT_PTR wParam,
+ /* [in] */ LONG_PTR lParam);
+
+ HRESULT ( STDMETHODCALLTYPE *SendKeys )(
+ IMsRdpClientNonScriptable * This,
+ /* [in] */ long numKeys,
+ /* [in] */ VARIANT_BOOL *pbArrayKeyUp,
+ /* [in] */ long *plKeyData);
+
+ END_INTERFACE
+ } IMsRdpClientNonScriptableVtbl;
+
+ interface IMsRdpClientNonScriptable
+ {
+ CONST_VTBL struct IMsRdpClientNonScriptableVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientNonScriptable_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientNonScriptable_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientNonScriptable_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientNonScriptable_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientNonScriptable_put_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) )
+
+#define IMsRdpClientNonScriptable_get_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) )
+
+#define IMsRdpClientNonScriptable_put_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) )
+
+#define IMsRdpClientNonScriptable_get_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) )
+
+#define IMsRdpClientNonScriptable_put_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsRdpClientNonScriptable_get_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsRdpClientNonScriptable_put_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) )
+
+#define IMsRdpClientNonScriptable_get_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) )
+
+#define IMsRdpClientNonScriptable_ResetPassword(This) \
+ ( (This)->lpVtbl -> ResetPassword(This) )
+
+
+#define IMsRdpClientNonScriptable_NotifyRedirectDeviceChange(This,wParam,lParam) \
+ ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) )
+
+#define IMsRdpClientNonScriptable_SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) \
+ ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClientNonScriptable_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientNonScriptable2_INTERFACE_DEFINED__
+#define __IMsRdpClientNonScriptable2_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientNonScriptable2 */
+/* [object][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientNonScriptable2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("17A5E535-4072-4FA4-AF32-C8D0D47345E9")
+ IMsRdpClientNonScriptable2 : public IMsRdpClientNonScriptable
+ {
+ public:
+ virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_UIParentWindowHandle(
+ /* [in] */ HWND phwndUIParentWindowHandle) = 0;
+
+ virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_UIParentWindowHandle(
+ /* [retval][out] */ HWND *phwndUIParentWindowHandle) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientNonScriptable2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientNonScriptable2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientNonScriptable2 * This);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR pPortablePass);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ BSTR *pPortablePass);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR pPortableSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ BSTR *pPortableSalt);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR pBinaryPassword);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ BSTR *pBinaryPassword);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ BSTR pSalt);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ BSTR *pSalt);
+
+ HRESULT ( STDMETHODCALLTYPE *ResetPassword )(
+ IMsRdpClientNonScriptable2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ UINT_PTR wParam,
+ /* [in] */ LONG_PTR lParam);
+
+ HRESULT ( STDMETHODCALLTYPE *SendKeys )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ long numKeys,
+ /* [in] */ VARIANT_BOOL *pbArrayKeyUp,
+ /* [in] */ long *plKeyData);
+
+ /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_UIParentWindowHandle )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [in] */ HWND phwndUIParentWindowHandle);
+
+ /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_UIParentWindowHandle )(
+ IMsRdpClientNonScriptable2 * This,
+ /* [retval][out] */ HWND *phwndUIParentWindowHandle);
+
+ END_INTERFACE
+ } IMsRdpClientNonScriptable2Vtbl;
+
+ interface IMsRdpClientNonScriptable2
+ {
+ CONST_VTBL struct IMsRdpClientNonScriptable2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientNonScriptable2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientNonScriptable2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientNonScriptable2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientNonScriptable2_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientNonScriptable2_put_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) )
+
+#define IMsRdpClientNonScriptable2_get_PortablePassword(This,pPortablePass) \
+ ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) )
+
+#define IMsRdpClientNonScriptable2_put_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) )
+
+#define IMsRdpClientNonScriptable2_get_PortableSalt(This,pPortableSalt) \
+ ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) )
+
+#define IMsRdpClientNonScriptable2_put_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsRdpClientNonScriptable2_get_BinaryPassword(This,pBinaryPassword) \
+ ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) )
+
+#define IMsRdpClientNonScriptable2_put_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) )
+
+#define IMsRdpClientNonScriptable2_get_BinarySalt(This,pSalt) \
+ ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) )
+
+#define IMsRdpClientNonScriptable2_ResetPassword(This) \
+ ( (This)->lpVtbl -> ResetPassword(This) )
+
+
+#define IMsRdpClientNonScriptable2_NotifyRedirectDeviceChange(This,wParam,lParam) \
+ ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) )
+
+#define IMsRdpClientNonScriptable2_SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) \
+ ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) )
+
+
+#define IMsRdpClientNonScriptable2_put_UIParentWindowHandle(This,phwndUIParentWindowHandle) \
+ ( (This)->lpVtbl -> put_UIParentWindowHandle(This,phwndUIParentWindowHandle) )
+
+#define IMsRdpClientNonScriptable2_get_UIParentWindowHandle(This,phwndUIParentWindowHandle) \
+ ( (This)->lpVtbl -> get_UIParentWindowHandle(This,phwndUIParentWindowHandle) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClientNonScriptable2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscAdvancedSettings_INTERFACE_DEFINED__
+#define __IMsTscAdvancedSettings_INTERFACE_DEFINED__
+
+/* interface IMsTscAdvancedSettings */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscAdvancedSettings;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("809945CC-4B3B-4A92-A6B0-DBF9B5F2EF2D")
+ IMsTscAdvancedSettings : public IDispatch
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Compress(
+ /* [in] */ long pcompress) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Compress(
+ /* [retval][out] */ long *pcompress) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPeristence(
+ /* [in] */ long pbitmapPeristence) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPeristence(
+ /* [retval][out] */ long *pbitmapPeristence) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_allowBackgroundInput(
+ /* [in] */ long pallowBackgroundInput) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_allowBackgroundInput(
+ /* [retval][out] */ long *pallowBackgroundInput) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyBoardLayoutStr(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PluginDlls(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconFile(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconIndex(
+ /* [in] */ long rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ContainerHandledFullScreen(
+ /* [in] */ long pContainerHandledFullScreen) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ContainerHandledFullScreen(
+ /* [retval][out] */ long *pContainerHandledFullScreen) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableRdpdr(
+ /* [in] */ long pDisableRdpdr) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableRdpdr(
+ /* [retval][out] */ long *pDisableRdpdr) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscAdvancedSettingsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscAdvancedSettings * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscAdvancedSettings * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscAdvancedSettings * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsTscAdvancedSettings * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsTscAdvancedSettings * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ END_INTERFACE
+ } IMsTscAdvancedSettingsVtbl;
+
+ interface IMsTscAdvancedSettings
+ {
+ CONST_VTBL struct IMsTscAdvancedSettingsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscAdvancedSettings_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscAdvancedSettings_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscAdvancedSettings_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscAdvancedSettings_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscAdvancedSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscAdvancedSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscAdvancedSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsTscAdvancedSettings_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsTscAdvancedSettings_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsTscAdvancedSettings_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsTscAdvancedSettings_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsTscAdvancedSettings_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsTscAdvancedSettings_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsTscAdvancedSettings_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsTscAdvancedSettings_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsTscAdvancedSettings_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsTscAdvancedSettings_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsTscAdvancedSettings_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsTscAdvancedSettings_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsTscAdvancedSettings_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsTscAdvancedSettings_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscAdvancedSettings_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings_INTERFACE_DEFINED__
+#define __IMsRdpClientAdvancedSettings_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientAdvancedSettings */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientAdvancedSettings;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("3C65B4AB-12B3-465B-ACD4-B8DAD3BFF9E2")
+ IMsRdpClientAdvancedSettings : public IMsTscAdvancedSettings
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmoothScroll(
+ /* [in] */ long psmoothScroll) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmoothScroll(
+ /* [retval][out] */ long *psmoothScroll) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AcceleratorPassthrough(
+ /* [in] */ long pacceleratorPassthrough) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AcceleratorPassthrough(
+ /* [retval][out] */ long *pacceleratorPassthrough) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ShadowBitmap(
+ /* [in] */ long pshadowBitmap) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ShadowBitmap(
+ /* [retval][out] */ long *pshadowBitmap) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_TransportType(
+ /* [in] */ long ptransportType) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_TransportType(
+ /* [retval][out] */ long *ptransportType) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SasSequence(
+ /* [in] */ long psasSequence) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SasSequence(
+ /* [retval][out] */ long *psasSequence) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EncryptionEnabled(
+ /* [in] */ long pencryptionEnabled) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EncryptionEnabled(
+ /* [retval][out] */ long *pencryptionEnabled) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DedicatedTerminal(
+ /* [in] */ long pdedicatedTerminal) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DedicatedTerminal(
+ /* [retval][out] */ long *pdedicatedTerminal) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RDPPort(
+ /* [in] */ long prdpPort) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RDPPort(
+ /* [retval][out] */ long *prdpPort) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableMouse(
+ /* [in] */ long penableMouse) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableMouse(
+ /* [retval][out] */ long *penableMouse) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableCtrlAltDel(
+ /* [in] */ long pdisableCtrlAltDel) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableCtrlAltDel(
+ /* [retval][out] */ long *pdisableCtrlAltDel) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableWindowsKey(
+ /* [in] */ long penableWindowsKey) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableWindowsKey(
+ /* [retval][out] */ long *penableWindowsKey) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DoubleClickDetect(
+ /* [in] */ long pdoubleClickDetect) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DoubleClickDetect(
+ /* [retval][out] */ long *pdoubleClickDetect) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaximizeShell(
+ /* [in] */ long pmaximizeShell) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaximizeShell(
+ /* [retval][out] */ long *pmaximizeShell) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyFullScreen(
+ /* [in] */ long photKeyFullScreen) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyFullScreen(
+ /* [retval][out] */ long *photKeyFullScreen) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlEsc(
+ /* [in] */ long photKeyCtrlEsc) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlEsc(
+ /* [retval][out] */ long *photKeyCtrlEsc) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltEsc(
+ /* [in] */ long photKeyAltEsc) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltEsc(
+ /* [retval][out] */ long *photKeyAltEsc) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltTab(
+ /* [in] */ long photKeyAltTab) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltTab(
+ /* [retval][out] */ long *photKeyAltTab) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltShiftTab(
+ /* [in] */ long photKeyAltShiftTab) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltShiftTab(
+ /* [retval][out] */ long *photKeyAltShiftTab) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltSpace(
+ /* [in] */ long photKeyAltSpace) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltSpace(
+ /* [retval][out] */ long *photKeyAltSpace) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlAltDel(
+ /* [in] */ long photKeyCtrlAltDel) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlAltDel(
+ /* [retval][out] */ long *photKeyCtrlAltDel) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_orderDrawThreshold(
+ /* [in] */ long porderDrawThreshold) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_orderDrawThreshold(
+ /* [retval][out] */ long *porderDrawThreshold) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheSize(
+ /* [in] */ long pbitmapCacheSize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheSize(
+ /* [retval][out] */ long *pbitmapCacheSize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCacheSize(
+ /* [in] */ long pbitmapVirtualCacheSize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCacheSize(
+ /* [retval][out] */ long *pbitmapVirtualCacheSize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ScaleBitmapCachesByBPP(
+ /* [in] */ long pbScale) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ScaleBitmapCachesByBPP(
+ /* [retval][out] */ long *pbScale) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NumBitmapCaches(
+ /* [in] */ long pnumBitmapCaches) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NumBitmapCaches(
+ /* [retval][out] */ long *pnumBitmapCaches) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CachePersistenceActive(
+ /* [in] */ long pcachePersistenceActive) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CachePersistenceActive(
+ /* [retval][out] */ long *pcachePersistenceActive) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PersistCacheDirectory(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_brushSupportLevel(
+ /* [in] */ long pbrushSupportLevel) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_brushSupportLevel(
+ /* [retval][out] */ long *pbrushSupportLevel) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_minInputSendInterval(
+ /* [in] */ long pminInputSendInterval) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minInputSendInterval(
+ /* [retval][out] */ long *pminInputSendInterval) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_InputEventsAtOnce(
+ /* [in] */ long pinputEventsAtOnce) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_InputEventsAtOnce(
+ /* [retval][out] */ long *pinputEventsAtOnce) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_maxEventCount(
+ /* [in] */ long pmaxEventCount) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxEventCount(
+ /* [retval][out] */ long *pmaxEventCount) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_keepAliveInterval(
+ /* [in] */ long pkeepAliveInterval) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_keepAliveInterval(
+ /* [retval][out] */ long *pkeepAliveInterval) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_shutdownTimeout(
+ /* [in] */ long pshutdownTimeout) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_shutdownTimeout(
+ /* [retval][out] */ long *pshutdownTimeout) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_overallConnectionTimeout(
+ /* [in] */ long poverallConnectionTimeout) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_overallConnectionTimeout(
+ /* [retval][out] */ long *poverallConnectionTimeout) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_singleConnectionTimeout(
+ /* [in] */ long psingleConnectionTimeout) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_singleConnectionTimeout(
+ /* [retval][out] */ long *psingleConnectionTimeout) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardType(
+ /* [in] */ long pkeyboardType) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardType(
+ /* [retval][out] */ long *pkeyboardType) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardSubType(
+ /* [in] */ long pkeyboardSubType) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardSubType(
+ /* [retval][out] */ long *pkeyboardSubType) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardFunctionKey(
+ /* [in] */ long pkeyboardFunctionKey) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardFunctionKey(
+ /* [retval][out] */ long *pkeyboardFunctionKey) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WinceFixedPalette(
+ /* [in] */ long pwinceFixedPalette) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WinceFixedPalette(
+ /* [retval][out] */ long *pwinceFixedPalette) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectToServerConsole(
+ /* [in] */ VARIANT_BOOL pConnectToConsole) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectToServerConsole(
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPersistence(
+ /* [in] */ long pbitmapPersistence) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPersistence(
+ /* [retval][out] */ long *pbitmapPersistence) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MinutesToIdleTimeout(
+ /* [in] */ long pminutesToIdleTimeout) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MinutesToIdleTimeout(
+ /* [retval][out] */ long *pminutesToIdleTimeout) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmartSizing(
+ /* [in] */ VARIANT_BOOL pfSmartSizing) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmartSizing(
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrLocalPrintingDocName(
+ /* [in] */ BSTR pLocalPrintingDocName) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrLocalPrintingDocName(
+ /* [retval][out] */ BSTR *pLocalPrintingDocName) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipCleanTempDirString(
+ /* [in] */ BSTR clipCleanTempDirString) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipCleanTempDirString(
+ /* [retval][out] */ BSTR *clipCleanTempDirString) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipPasteInfoString(
+ /* [in] */ BSTR clipPasteInfoString) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipPasteInfoString(
+ /* [retval][out] */ BSTR *clipPasteInfoString) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword(
+ /* [in] */ BSTR rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisplayConnectionBar(
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisplayConnectionBar(
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PinConnectionBar(
+ /* [in] */ VARIANT_BOOL pPinConnectionBar) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PinConnectionBar(
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_GrabFocusOnConnect(
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_GrabFocusOnConnect(
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LoadBalanceInfo(
+ /* [in] */ BSTR pLBInfo) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LoadBalanceInfo(
+ /* [retval][out] */ BSTR *pLBInfo) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectDrives(
+ /* [in] */ VARIANT_BOOL pRedirectDrives) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectDrives(
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPrinters(
+ /* [in] */ VARIANT_BOOL pRedirectPrinters) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPrinters(
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPorts(
+ /* [in] */ VARIANT_BOOL pRedirectPorts) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPorts(
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectSmartCards(
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectSmartCards(
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache16BppSize(
+ /* [in] */ long pBitmapVirtualCache16BppSize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache16BppSize(
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache24BppSize(
+ /* [in] */ long pBitmapVirtualCache24BppSize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache24BppSize(
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PerformanceFlags(
+ /* [in] */ long pDisableList) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PerformanceFlags(
+ /* [retval][out] */ long *pDisableList) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectWithEndpoint(
+ /* [in] */ VARIANT *rhs) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NotifyTSPublicKey(
+ /* [in] */ VARIANT_BOOL pfNotify) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NotifyTSPublicKey(
+ /* [retval][out] */ VARIANT_BOOL *pfNotify) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientAdvancedSettingsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientAdvancedSettings * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientAdvancedSettings * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long psmoothScroll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *psmoothScroll);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pacceleratorPassthrough);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pacceleratorPassthrough);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pshadowBitmap);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pshadowBitmap);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long ptransportType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *ptransportType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long psasSequence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *psasSequence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pencryptionEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pencryptionEnabled);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pdedicatedTerminal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pdedicatedTerminal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long prdpPort);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *prdpPort);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long penableMouse);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *penableMouse);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pdisableCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pdisableCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long penableWindowsKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *penableWindowsKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pdoubleClickDetect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pdoubleClickDetect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pmaximizeShell);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pmaximizeShell);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyCtrlEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyCtrlEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyAltEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyAltEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyAltTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyAltTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyAltShiftTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyAltShiftTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyAltSpace);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyAltSpace);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long photKeyCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *photKeyCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long porderDrawThreshold);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *porderDrawThreshold);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbitmapCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbitmapVirtualCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapVirtualCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbScale);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbScale);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pnumBitmapCaches);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pnumBitmapCaches);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pcachePersistenceActive);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pcachePersistenceActive);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbrushSupportLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbrushSupportLevel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pminInputSendInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pminInputSendInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pinputEventsAtOnce);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pinputEventsAtOnce);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pmaxEventCount);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pmaxEventCount);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pkeepAliveInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pkeepAliveInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pshutdownTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pshutdownTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long poverallConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *poverallConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long psingleConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *psingleConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pkeyboardType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pkeyboardType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pkeyboardSubType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pkeyboardSubType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pkeyboardFunctionKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pkeyboardFunctionKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pwinceFixedPalette);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pwinceFixedPalette);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pConnectToConsole);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pbitmapPersistence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pbitmapPersistence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pminutesToIdleTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pminutesToIdleTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pfSmartSizing);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR pLocalPrintingDocName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ BSTR *pLocalPrintingDocName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR clipCleanTempDirString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ BSTR *clipCleanTempDirString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR clipPasteInfoString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ BSTR *clipPasteInfoString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pPinConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ BSTR pLBInfo);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ BSTR *pLBInfo);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pRedirectDrives);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pRedirectPrinters);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pRedirectPorts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pDisableList);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pDisableList);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT *rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+ END_INTERFACE
+ } IMsRdpClientAdvancedSettingsVtbl;
+
+ interface IMsRdpClientAdvancedSettings
+ {
+ CONST_VTBL struct IMsRdpClientAdvancedSettingsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientAdvancedSettings_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientAdvancedSettings_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientAdvancedSettings_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientAdvancedSettings_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientAdvancedSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientAdvancedSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientAdvancedSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientAdvancedSettings_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsRdpClientAdvancedSettings_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+
+#define IMsRdpClientAdvancedSettings_put_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings_get_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings_put_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings_get_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings_put_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> put_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings_get_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> get_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings_put_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings_get_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings_put_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings_get_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings_put_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings_get_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings_put_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings_get_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings_put_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings_get_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings_put_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings_get_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings_put_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings_get_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings_put_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings_get_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings_put_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings_get_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings_put_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings_get_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings_put_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings_get_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings_put_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings_get_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings_put_PersistCacheDirectory(This,rhs) \
+ ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings_get_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings_put_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings_get_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings_put_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings_get_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings_put_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings_get_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings_put_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings_get_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings_put_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings_get_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings_put_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings_get_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings_put_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings_get_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings_put_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings_get_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings_put_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings_get_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings_put_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings_get_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings_put_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings_get_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings_put_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings_get_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings_get_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings_put_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings_get_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings_put_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings_get_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings_put_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings_get_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings_put_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings_get_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings_put_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings_get_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings_put_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings_get_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings_put_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings_get_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint(This,rhs) \
+ ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) )
+
+#define IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_PerformanceFlags_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ long pDisableList);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_PerformanceFlags_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_PerformanceFlags_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ long *pDisableList);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_PerformanceFlags_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT *rhs);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Proxy(
+ IMsRdpClientAdvancedSettings * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IMsRdpClientAdvancedSettings_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings2_INTERFACE_DEFINED__
+#define __IMsRdpClientAdvancedSettings2_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientAdvancedSettings2 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("9AC42117-2B76-4320-AA44-0E616AB8437B")
+ IMsRdpClientAdvancedSettings2 : public IMsRdpClientAdvancedSettings
+ {
+ public:
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CanAutoReconnect(
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableAutoReconnect(
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableAutoReconnect(
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaxReconnectAttempts(
+ /* [in] */ long pMaxReconnectAttempts) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaxReconnectAttempts(
+ /* [retval][out] */ long *pMaxReconnectAttempts) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientAdvancedSettings2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientAdvancedSettings2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientAdvancedSettings2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long psmoothScroll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *psmoothScroll);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pacceleratorPassthrough);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pacceleratorPassthrough);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pshadowBitmap);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pshadowBitmap);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long ptransportType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *ptransportType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long psasSequence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *psasSequence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pencryptionEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pencryptionEnabled);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pdedicatedTerminal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pdedicatedTerminal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long prdpPort);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *prdpPort);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long penableMouse);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *penableMouse);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pdisableCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pdisableCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long penableWindowsKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *penableWindowsKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pdoubleClickDetect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pdoubleClickDetect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pmaximizeShell);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pmaximizeShell);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyCtrlEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyCtrlEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyAltEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyAltEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyAltTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyAltTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyAltShiftTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyAltShiftTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyAltSpace);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyAltSpace);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long photKeyCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *photKeyCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long porderDrawThreshold);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *porderDrawThreshold);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbitmapCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbitmapCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbitmapVirtualCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbitmapVirtualCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbScale);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbScale);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pnumBitmapCaches);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pnumBitmapCaches);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pcachePersistenceActive);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pcachePersistenceActive);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbrushSupportLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbrushSupportLevel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pminInputSendInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pminInputSendInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pinputEventsAtOnce);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pinputEventsAtOnce);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pmaxEventCount);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pmaxEventCount);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pkeepAliveInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pkeepAliveInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pshutdownTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pshutdownTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long poverallConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *poverallConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long psingleConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *psingleConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pkeyboardType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pkeyboardType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pkeyboardSubType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pkeyboardSubType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pkeyboardFunctionKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pkeyboardFunctionKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pwinceFixedPalette);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pwinceFixedPalette);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pConnectToConsole);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pbitmapPersistence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pbitmapPersistence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pminutesToIdleTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pminutesToIdleTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfSmartSizing);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR pLocalPrintingDocName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ BSTR *pLocalPrintingDocName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR clipCleanTempDirString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ BSTR *clipCleanTempDirString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR clipPasteInfoString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ BSTR *clipPasteInfoString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pPinConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ BSTR pLBInfo);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ BSTR *pLBInfo);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pRedirectDrives);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPrinters);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPorts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pDisableList);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pDisableList);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT *rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pMaxReconnectAttempts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pMaxReconnectAttempts);
+
+ END_INTERFACE
+ } IMsRdpClientAdvancedSettings2Vtbl;
+
+ interface IMsRdpClientAdvancedSettings2
+ {
+ CONST_VTBL struct IMsRdpClientAdvancedSettings2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientAdvancedSettings2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientAdvancedSettings2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientAdvancedSettings2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientAdvancedSettings2_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientAdvancedSettings2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientAdvancedSettings2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientAdvancedSettings2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientAdvancedSettings2_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings2_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings2_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings2_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings2_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings2_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings2_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsRdpClientAdvancedSettings2_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+
+#define IMsRdpClientAdvancedSettings2_put_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings2_get_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings2_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings2_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings2_put_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings2_get_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings2_put_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> put_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings2_get_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> get_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings2_put_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings2_get_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings2_put_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings2_get_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings2_put_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings2_get_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings2_put_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings2_get_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings2_put_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings2_get_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings2_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings2_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings2_put_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings2_get_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings2_put_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings2_get_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings2_put_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings2_get_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings2_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings2_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings2_put_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings2_get_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings2_put_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings2_get_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings2_put_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings2_get_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings2_put_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings2_get_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings2_put_PersistCacheDirectory(This,rhs) \
+ ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings2_get_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings2_put_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings2_get_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings2_put_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings2_get_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings2_put_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings2_get_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings2_put_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings2_get_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings2_put_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_get_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_put_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_get_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_put_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_get_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_put_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings2_get_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings2_put_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings2_get_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings2_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings2_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings2_put_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings2_get_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings2_put_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings2_get_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings2_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings2_put_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings2_get_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings2_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings2_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings2_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings2_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings2_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings2_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings2_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings2_get_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings2_put_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings2_get_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings2_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings2_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings2_put_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings2_get_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings2_put_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings2_get_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings2_put_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings2_get_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings2_put_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings2_get_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings2_put_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings2_get_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings2_put_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings2_get_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings2_put_ConnectWithEndpoint(This,rhs) \
+ ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings2_put_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) )
+
+#define IMsRdpClientAdvancedSettings2_get_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) )
+
+
+#define IMsRdpClientAdvancedSettings2_get_CanAutoReconnect(This,pfCanAutoReconnect) \
+ ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+#define IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [in] */ long pMaxReconnectAttempts);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Proxy(
+ IMsRdpClientAdvancedSettings2 * This,
+ /* [retval][out] */ long *pMaxReconnectAttempts);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IMsRdpClientAdvancedSettings2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings3_INTERFACE_DEFINED__
+#define __IMsRdpClientAdvancedSettings3_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientAdvancedSettings3 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("19CD856B-C542-4C53-ACEE-F127E3BE1A59")
+ IMsRdpClientAdvancedSettings3 : public IMsRdpClientAdvancedSettings2
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowMinimizeButton(
+ /* [in] */ VARIANT_BOOL pfShowMinimize) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowMinimizeButton(
+ /* [retval][out] */ VARIANT_BOOL *pfShowMinimize) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowRestoreButton(
+ /* [in] */ VARIANT_BOOL pfShowRestore) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowRestoreButton(
+ /* [retval][out] */ VARIANT_BOOL *pfShowRestore) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientAdvancedSettings3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientAdvancedSettings3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientAdvancedSettings3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long psmoothScroll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *psmoothScroll);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pacceleratorPassthrough);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pacceleratorPassthrough);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pshadowBitmap);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pshadowBitmap);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long ptransportType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *ptransportType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long psasSequence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *psasSequence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pencryptionEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pencryptionEnabled);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pdedicatedTerminal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pdedicatedTerminal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long prdpPort);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *prdpPort);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long penableMouse);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *penableMouse);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pdisableCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pdisableCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long penableWindowsKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *penableWindowsKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pdoubleClickDetect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pdoubleClickDetect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pmaximizeShell);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pmaximizeShell);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyCtrlEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyCtrlEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyAltEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyAltEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyAltTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyAltTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyAltShiftTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyAltShiftTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyAltSpace);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyAltSpace);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long photKeyCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *photKeyCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long porderDrawThreshold);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *porderDrawThreshold);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbitmapCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbitmapCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbitmapVirtualCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbitmapVirtualCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbScale);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbScale);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pnumBitmapCaches);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pnumBitmapCaches);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pcachePersistenceActive);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pcachePersistenceActive);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbrushSupportLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbrushSupportLevel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pminInputSendInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pminInputSendInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pinputEventsAtOnce);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pinputEventsAtOnce);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pmaxEventCount);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pmaxEventCount);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pkeepAliveInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pkeepAliveInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pshutdownTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pshutdownTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long poverallConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *poverallConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long psingleConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *psingleConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pkeyboardType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pkeyboardType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pkeyboardSubType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pkeyboardSubType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pkeyboardFunctionKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pkeyboardFunctionKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pwinceFixedPalette);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pwinceFixedPalette);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pConnectToConsole);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pbitmapPersistence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pbitmapPersistence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pminutesToIdleTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pminutesToIdleTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfSmartSizing);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR pLocalPrintingDocName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ BSTR *pLocalPrintingDocName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR clipCleanTempDirString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ BSTR *clipCleanTempDirString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR clipPasteInfoString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ BSTR *clipPasteInfoString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pPinConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ BSTR pLBInfo);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ BSTR *pLBInfo);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pRedirectDrives);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPrinters);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPorts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pDisableList);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pDisableList);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT *rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ long pMaxReconnectAttempts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ long *pMaxReconnectAttempts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfShowMinimize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowMinimize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfShowRestore);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowRestore);
+
+ END_INTERFACE
+ } IMsRdpClientAdvancedSettings3Vtbl;
+
+ interface IMsRdpClientAdvancedSettings3
+ {
+ CONST_VTBL struct IMsRdpClientAdvancedSettings3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientAdvancedSettings3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientAdvancedSettings3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientAdvancedSettings3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientAdvancedSettings3_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientAdvancedSettings3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientAdvancedSettings3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientAdvancedSettings3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientAdvancedSettings3_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings3_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings3_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings3_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings3_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings3_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings3_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsRdpClientAdvancedSettings3_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+
+#define IMsRdpClientAdvancedSettings3_put_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings3_get_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings3_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings3_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings3_put_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings3_get_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings3_put_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> put_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings3_get_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> get_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings3_put_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings3_get_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings3_put_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings3_get_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings3_put_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings3_get_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings3_put_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings3_get_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings3_put_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings3_get_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings3_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings3_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings3_put_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings3_get_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings3_put_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings3_get_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings3_put_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings3_get_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings3_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings3_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings3_put_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings3_get_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings3_put_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings3_get_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings3_put_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings3_get_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings3_put_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings3_get_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings3_put_PersistCacheDirectory(This,rhs) \
+ ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings3_get_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings3_put_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings3_get_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings3_put_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings3_get_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings3_put_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings3_get_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings3_put_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings3_get_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings3_put_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_get_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_put_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_get_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_put_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_get_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_put_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings3_get_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings3_put_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings3_get_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings3_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings3_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings3_put_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings3_get_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings3_put_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings3_get_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings3_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings3_put_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings3_get_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings3_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings3_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings3_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings3_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings3_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings3_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings3_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings3_get_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings3_put_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings3_get_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings3_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings3_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings3_put_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings3_get_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings3_put_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings3_get_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings3_put_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings3_get_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings3_put_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings3_get_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings3_put_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings3_get_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings3_put_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings3_get_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings3_put_ConnectWithEndpoint(This,rhs) \
+ ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings3_put_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) )
+
+#define IMsRdpClientAdvancedSettings3_get_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) )
+
+
+#define IMsRdpClientAdvancedSettings3_get_CanAutoReconnect(This,pfCanAutoReconnect) \
+ ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings3_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings3_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings3_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+#define IMsRdpClientAdvancedSettings3_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+
+#define IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \
+ ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) )
+
+#define IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \
+ ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) )
+
+#define IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton(This,pfShowRestore) \
+ ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) )
+
+#define IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton(This,pfShowRestore) \
+ ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton_Proxy(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfShowMinimize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton_Proxy(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowMinimize);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton_Proxy(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [in] */ VARIANT_BOOL pfShowRestore);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton_Proxy(
+ IMsRdpClientAdvancedSettings3 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowRestore);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IMsRdpClientAdvancedSettings3_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientAdvancedSettings4_INTERFACE_DEFINED__
+#define __IMsRdpClientAdvancedSettings4_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientAdvancedSettings4 */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("FBA7F64E-7345-4405-AE50-FA4A763DC0DE")
+ IMsRdpClientAdvancedSettings4 : public IMsRdpClientAdvancedSettings3
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AuthenticationLevel(
+ /* [in] */ unsigned int puiAuthLevel) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AuthenticationLevel(
+ /* [retval][out] */ unsigned int *puiAuthLevel) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientAdvancedSettings4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientAdvancedSettings4 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientAdvancedSettings4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pcompress);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pcompress);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbitmapPeristence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbitmapPeristence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pallowBackgroundInput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pallowBackgroundInput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pContainerHandledFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pContainerHandledFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pDisableRdpdr);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pDisableRdpdr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long psmoothScroll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *psmoothScroll);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pacceleratorPassthrough);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pacceleratorPassthrough);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pshadowBitmap);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pshadowBitmap);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long ptransportType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *ptransportType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long psasSequence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *psasSequence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pencryptionEnabled);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pencryptionEnabled);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pdedicatedTerminal);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pdedicatedTerminal);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long prdpPort);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *prdpPort);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long penableMouse);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *penableMouse);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pdisableCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pdisableCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long penableWindowsKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *penableWindowsKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pdoubleClickDetect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pdoubleClickDetect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pmaximizeShell);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pmaximizeShell);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyCtrlEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyCtrlEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyAltEsc);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyAltEsc);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyAltTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyAltTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyAltShiftTab);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyAltShiftTab);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyAltSpace);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyAltSpace);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long photKeyCtrlAltDel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *photKeyCtrlAltDel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long porderDrawThreshold);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *porderDrawThreshold);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbitmapCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbitmapCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbitmapVirtualCacheSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbitmapVirtualCacheSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbScale);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbScale);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pnumBitmapCaches);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pnumBitmapCaches);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pcachePersistenceActive);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pcachePersistenceActive);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbrushSupportLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbrushSupportLevel);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pminInputSendInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pminInputSendInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pinputEventsAtOnce);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pinputEventsAtOnce);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pmaxEventCount);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pmaxEventCount);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pkeepAliveInterval);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pkeepAliveInterval);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pshutdownTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pshutdownTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long poverallConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *poverallConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long psingleConnectionTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *psingleConnectionTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pkeyboardType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pkeyboardType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pkeyboardSubType);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pkeyboardSubType);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pkeyboardFunctionKey);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pkeyboardFunctionKey);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pwinceFixedPalette);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pwinceFixedPalette);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pConnectToConsole);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pConnectToConsole);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pbitmapPersistence);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pbitmapPersistence);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pminutesToIdleTimeout);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pminutesToIdleTimeout);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfSmartSizing);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfSmartSizing);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR pLocalPrintingDocName);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ BSTR *pLocalPrintingDocName);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR clipCleanTempDirString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ BSTR *clipCleanTempDirString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR clipPasteInfoString);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ BSTR *clipPasteInfoString);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pDisplayConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pPinConnectionBar);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ BSTR pLBInfo);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ BSTR *pLBInfo);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pRedirectDrives);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectDrives);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPrinters);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pRedirectPorts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectPorts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pRedirectSmartCards);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pBitmapVirtualCache16BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache16BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pBitmapVirtualCache24BppSize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pBitmapVirtualCache24BppSize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pDisableList);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pDisableList);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT *rhs);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfNotify);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfEnableAutoReconnect);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ long pMaxReconnectAttempts);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ long *pMaxReconnectAttempts);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfShowMinimize);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowMinimize);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ VARIANT_BOOL pfShowRestore);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ VARIANT_BOOL *pfShowRestore);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AuthenticationLevel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ unsigned int puiAuthLevel);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AuthenticationLevel )(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ unsigned int *puiAuthLevel);
+
+ END_INTERFACE
+ } IMsRdpClientAdvancedSettings4Vtbl;
+
+ interface IMsRdpClientAdvancedSettings4
+ {
+ CONST_VTBL struct IMsRdpClientAdvancedSettings4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientAdvancedSettings4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientAdvancedSettings4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientAdvancedSettings4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientAdvancedSettings4_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientAdvancedSettings4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientAdvancedSettings4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientAdvancedSettings4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientAdvancedSettings4_put_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> put_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings4_get_Compress(This,pcompress) \
+ ( (This)->lpVtbl -> get_Compress(This,pcompress) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapPeristence(This,pbitmapPeristence) \
+ ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) )
+
+#define IMsRdpClientAdvancedSettings4_put_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings4_get_allowBackgroundInput(This,pallowBackgroundInput) \
+ ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) )
+
+#define IMsRdpClientAdvancedSettings4_put_KeyBoardLayoutStr(This,rhs) \
+ ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_PluginDlls(This,rhs) \
+ ( (This)->lpVtbl -> put_PluginDlls(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_IconFile(This,rhs) \
+ ( (This)->lpVtbl -> put_IconFile(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_IconIndex(This,rhs) \
+ ( (This)->lpVtbl -> put_IconIndex(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings4_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \
+ ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) )
+
+#define IMsRdpClientAdvancedSettings4_put_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) )
+
+#define IMsRdpClientAdvancedSettings4_get_DisableRdpdr(This,pDisableRdpdr) \
+ ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) )
+
+
+#define IMsRdpClientAdvancedSettings4_put_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings4_get_SmoothScroll(This,psmoothScroll) \
+ ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) )
+
+#define IMsRdpClientAdvancedSettings4_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings4_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \
+ ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) )
+
+#define IMsRdpClientAdvancedSettings4_put_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings4_get_ShadowBitmap(This,pshadowBitmap) \
+ ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) )
+
+#define IMsRdpClientAdvancedSettings4_put_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> put_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings4_get_TransportType(This,ptransportType) \
+ ( (This)->lpVtbl -> get_TransportType(This,ptransportType) )
+
+#define IMsRdpClientAdvancedSettings4_put_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings4_get_SasSequence(This,psasSequence) \
+ ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) )
+
+#define IMsRdpClientAdvancedSettings4_put_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings4_get_EncryptionEnabled(This,pencryptionEnabled) \
+ ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) )
+
+#define IMsRdpClientAdvancedSettings4_put_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings4_get_DedicatedTerminal(This,pdedicatedTerminal) \
+ ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) )
+
+#define IMsRdpClientAdvancedSettings4_put_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings4_get_RDPPort(This,prdpPort) \
+ ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) )
+
+#define IMsRdpClientAdvancedSettings4_put_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings4_get_EnableMouse(This,penableMouse) \
+ ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) )
+
+#define IMsRdpClientAdvancedSettings4_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings4_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \
+ ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings4_put_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings4_get_EnableWindowsKey(This,penableWindowsKey) \
+ ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) )
+
+#define IMsRdpClientAdvancedSettings4_put_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings4_get_DoubleClickDetect(This,pdoubleClickDetect) \
+ ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) )
+
+#define IMsRdpClientAdvancedSettings4_put_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings4_get_MaximizeShell(This,pmaximizeShell) \
+ ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyFullScreen(This,photKeyFullScreen) \
+ ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyAltEsc(This,photKeyAltEsc) \
+ ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyAltTab(This,photKeyAltTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \
+ ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyAltSpace(This,photKeyAltSpace) \
+ ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) )
+
+#define IMsRdpClientAdvancedSettings4_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings4_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \
+ ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) )
+
+#define IMsRdpClientAdvancedSettings4_put_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings4_get_orderDrawThreshold(This,porderDrawThreshold) \
+ ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapCacheSize(This,pbitmapCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) )
+
+#define IMsRdpClientAdvancedSettings4_put_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings4_get_ScaleBitmapCachesByBPP(This,pbScale) \
+ ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) )
+
+#define IMsRdpClientAdvancedSettings4_put_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings4_get_NumBitmapCaches(This,pnumBitmapCaches) \
+ ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) )
+
+#define IMsRdpClientAdvancedSettings4_put_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings4_get_CachePersistenceActive(This,pcachePersistenceActive) \
+ ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) )
+
+#define IMsRdpClientAdvancedSettings4_put_PersistCacheDirectory(This,rhs) \
+ ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings4_get_brushSupportLevel(This,pbrushSupportLevel) \
+ ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) )
+
+#define IMsRdpClientAdvancedSettings4_put_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings4_get_minInputSendInterval(This,pminInputSendInterval) \
+ ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) )
+
+#define IMsRdpClientAdvancedSettings4_put_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings4_get_InputEventsAtOnce(This,pinputEventsAtOnce) \
+ ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) )
+
+#define IMsRdpClientAdvancedSettings4_put_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings4_get_maxEventCount(This,pmaxEventCount) \
+ ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) )
+
+#define IMsRdpClientAdvancedSettings4_put_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings4_get_keepAliveInterval(This,pkeepAliveInterval) \
+ ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) )
+
+#define IMsRdpClientAdvancedSettings4_put_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_get_shutdownTimeout(This,pshutdownTimeout) \
+ ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_put_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_get_overallConnectionTimeout(This,poverallConnectionTimeout) \
+ ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_put_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_get_singleConnectionTimeout(This,psingleConnectionTimeout) \
+ ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_put_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings4_get_KeyboardType(This,pkeyboardType) \
+ ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) )
+
+#define IMsRdpClientAdvancedSettings4_put_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings4_get_KeyboardSubType(This,pkeyboardSubType) \
+ ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) )
+
+#define IMsRdpClientAdvancedSettings4_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings4_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \
+ ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) )
+
+#define IMsRdpClientAdvancedSettings4_put_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings4_get_WinceFixedPalette(This,pwinceFixedPalette) \
+ ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) )
+
+#define IMsRdpClientAdvancedSettings4_put_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings4_get_ConnectToServerConsole(This,pConnectToConsole) \
+ ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapPersistence(This,pbitmapPersistence) \
+ ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) )
+
+#define IMsRdpClientAdvancedSettings4_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \
+ ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) )
+
+#define IMsRdpClientAdvancedSettings4_put_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings4_get_SmartSizing(This,pfSmartSizing) \
+ ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) )
+
+#define IMsRdpClientAdvancedSettings4_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings4_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \
+ ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) )
+
+#define IMsRdpClientAdvancedSettings4_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings4_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \
+ ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) )
+
+#define IMsRdpClientAdvancedSettings4_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings4_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \
+ ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) )
+
+#define IMsRdpClientAdvancedSettings4_put_ClearTextPassword(This,rhs) \
+ ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings4_get_DisplayConnectionBar(This,pDisplayConnectionBar) \
+ ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings4_put_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings4_get_PinConnectionBar(This,pPinConnectionBar) \
+ ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) )
+
+#define IMsRdpClientAdvancedSettings4_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings4_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \
+ ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) )
+
+#define IMsRdpClientAdvancedSettings4_put_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings4_get_LoadBalanceInfo(This,pLBInfo) \
+ ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) )
+
+#define IMsRdpClientAdvancedSettings4_put_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings4_get_RedirectDrives(This,pRedirectDrives) \
+ ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) )
+
+#define IMsRdpClientAdvancedSettings4_put_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings4_get_RedirectPrinters(This,pRedirectPrinters) \
+ ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) )
+
+#define IMsRdpClientAdvancedSettings4_put_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings4_get_RedirectPorts(This,pRedirectPorts) \
+ ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) )
+
+#define IMsRdpClientAdvancedSettings4_put_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings4_get_RedirectSmartCards(This,pRedirectSmartCards) \
+ ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) )
+
+#define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \
+ ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) )
+
+#define IMsRdpClientAdvancedSettings4_put_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings4_get_PerformanceFlags(This,pDisableList) \
+ ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) )
+
+#define IMsRdpClientAdvancedSettings4_put_ConnectWithEndpoint(This,rhs) \
+ ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) )
+
+#define IMsRdpClientAdvancedSettings4_put_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) )
+
+#define IMsRdpClientAdvancedSettings4_get_NotifyTSPublicKey(This,pfNotify) \
+ ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) )
+
+
+#define IMsRdpClientAdvancedSettings4_get_CanAutoReconnect(This,pfCanAutoReconnect) \
+ ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings4_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings4_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \
+ ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) )
+
+#define IMsRdpClientAdvancedSettings4_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+#define IMsRdpClientAdvancedSettings4_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \
+ ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) )
+
+
+#define IMsRdpClientAdvancedSettings4_put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \
+ ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) )
+
+#define IMsRdpClientAdvancedSettings4_get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \
+ ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) )
+
+#define IMsRdpClientAdvancedSettings4_put_ConnectionBarShowRestoreButton(This,pfShowRestore) \
+ ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) )
+
+#define IMsRdpClientAdvancedSettings4_get_ConnectionBarShowRestoreButton(This,pfShowRestore) \
+ ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) )
+
+
+#define IMsRdpClientAdvancedSettings4_put_AuthenticationLevel(This,puiAuthLevel) \
+ ( (This)->lpVtbl -> put_AuthenticationLevel(This,puiAuthLevel) )
+
+#define IMsRdpClientAdvancedSettings4_get_AuthenticationLevel(This,puiAuthLevel) \
+ ( (This)->lpVtbl -> get_AuthenticationLevel(This,puiAuthLevel) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Proxy(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [in] */ unsigned int puiAuthLevel);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Proxy(
+ IMsRdpClientAdvancedSettings4 * This,
+ /* [retval][out] */ unsigned int *puiAuthLevel);
+
+
+void __RPC_STUB IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IMsRdpClientAdvancedSettings4_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscSecuredSettings_INTERFACE_DEFINED__
+#define __IMsTscSecuredSettings_INTERFACE_DEFINED__
+
+/* interface IMsTscSecuredSettings */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscSecuredSettings;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("C9D65442-A0F9-45B2-8F73-D61D2DB8CBB6")
+ IMsTscSecuredSettings : public IDispatch
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartProgram(
+ /* [in] */ BSTR pStartProgram) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartProgram(
+ /* [retval][out] */ BSTR *pStartProgram) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WorkDir(
+ /* [in] */ BSTR pWorkDir) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WorkDir(
+ /* [retval][out] */ BSTR *pWorkDir) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen(
+ /* [in] */ long pfFullScreen) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen(
+ /* [retval][out] */ long *pfFullScreen) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscSecuredSettingsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscSecuredSettings * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscSecuredSettings * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscSecuredSettings * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ BSTR pStartProgram);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )(
+ IMsTscSecuredSettings * This,
+ /* [retval][out] */ BSTR *pStartProgram);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ BSTR pWorkDir);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )(
+ IMsTscSecuredSettings * This,
+ /* [retval][out] */ BSTR *pWorkDir);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsTscSecuredSettings * This,
+ /* [in] */ long pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsTscSecuredSettings * This,
+ /* [retval][out] */ long *pfFullScreen);
+
+ END_INTERFACE
+ } IMsTscSecuredSettingsVtbl;
+
+ interface IMsTscSecuredSettings
+ {
+ CONST_VTBL struct IMsTscSecuredSettingsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscSecuredSettings_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscSecuredSettings_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscSecuredSettings_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscSecuredSettings_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscSecuredSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscSecuredSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscSecuredSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsTscSecuredSettings_put_StartProgram(This,pStartProgram) \
+ ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) )
+
+#define IMsTscSecuredSettings_get_StartProgram(This,pStartProgram) \
+ ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) )
+
+#define IMsTscSecuredSettings_put_WorkDir(This,pWorkDir) \
+ ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) )
+
+#define IMsTscSecuredSettings_get_WorkDir(This,pWorkDir) \
+ ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) )
+
+#define IMsTscSecuredSettings_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsTscSecuredSettings_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscSecuredSettings_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsRdpClientSecuredSettings_INTERFACE_DEFINED__
+#define __IMsRdpClientSecuredSettings_INTERFACE_DEFINED__
+
+/* interface IMsRdpClientSecuredSettings */
+/* [object][oleautomation][dual][uuid] */
+
+
+EXTERN_C const IID IID_IMsRdpClientSecuredSettings;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("605BEFCF-39C1-45CC-A811-068FB7BE346D")
+ IMsRdpClientSecuredSettings : public IMsTscSecuredSettings
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardHookMode(
+ /* [in] */ long pkeyboardHookMode) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardHookMode(
+ /* [retval][out] */ long *pkeyboardHookMode) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AudioRedirectionMode(
+ /* [in] */ long pAudioRedirectionMode) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AudioRedirectionMode(
+ /* [retval][out] */ long *pAudioRedirectionMode) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsRdpClientSecuredSettingsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsRdpClientSecuredSettings * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsRdpClientSecuredSettings * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsRdpClientSecuredSettings * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ BSTR pStartProgram);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ BSTR *pStartProgram);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ BSTR pWorkDir);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ BSTR *pWorkDir);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ long pfFullScreen);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ long *pfFullScreen);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardHookMode )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ long pkeyboardHookMode);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardHookMode )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ long *pkeyboardHookMode);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AudioRedirectionMode )(
+ IMsRdpClientSecuredSettings * This,
+ /* [in] */ long pAudioRedirectionMode);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AudioRedirectionMode )(
+ IMsRdpClientSecuredSettings * This,
+ /* [retval][out] */ long *pAudioRedirectionMode);
+
+ END_INTERFACE
+ } IMsRdpClientSecuredSettingsVtbl;
+
+ interface IMsRdpClientSecuredSettings
+ {
+ CONST_VTBL struct IMsRdpClientSecuredSettingsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsRdpClientSecuredSettings_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsRdpClientSecuredSettings_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsRdpClientSecuredSettings_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsRdpClientSecuredSettings_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsRdpClientSecuredSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsRdpClientSecuredSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsRdpClientSecuredSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsRdpClientSecuredSettings_put_StartProgram(This,pStartProgram) \
+ ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) )
+
+#define IMsRdpClientSecuredSettings_get_StartProgram(This,pStartProgram) \
+ ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) )
+
+#define IMsRdpClientSecuredSettings_put_WorkDir(This,pWorkDir) \
+ ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) )
+
+#define IMsRdpClientSecuredSettings_get_WorkDir(This,pWorkDir) \
+ ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) )
+
+#define IMsRdpClientSecuredSettings_put_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) )
+
+#define IMsRdpClientSecuredSettings_get_FullScreen(This,pfFullScreen) \
+ ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) )
+
+
+#define IMsRdpClientSecuredSettings_put_KeyboardHookMode(This,pkeyboardHookMode) \
+ ( (This)->lpVtbl -> put_KeyboardHookMode(This,pkeyboardHookMode) )
+
+#define IMsRdpClientSecuredSettings_get_KeyboardHookMode(This,pkeyboardHookMode) \
+ ( (This)->lpVtbl -> get_KeyboardHookMode(This,pkeyboardHookMode) )
+
+#define IMsRdpClientSecuredSettings_put_AudioRedirectionMode(This,pAudioRedirectionMode) \
+ ( (This)->lpVtbl -> put_AudioRedirectionMode(This,pAudioRedirectionMode) )
+
+#define IMsRdpClientSecuredSettings_get_AudioRedirectionMode(This,pAudioRedirectionMode) \
+ ( (This)->lpVtbl -> get_AudioRedirectionMode(This,pAudioRedirectionMode) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsRdpClientSecuredSettings_INTERFACE_DEFINED__ */
+
+
+#ifndef __IMsTscDebug_INTERFACE_DEFINED__
+#define __IMsTscDebug_INTERFACE_DEFINED__
+
+/* interface IMsTscDebug */
+/* [object][oleautomation][dual][hidden][uuid] */
+
+
+EXTERN_C const IID IID_IMsTscDebug;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("209D0EB9-6254-47B1-9033-A98DAE55BB27")
+ IMsTscDebug : public IDispatch
+ {
+ public:
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchBitmapPDU(
+ /* [in] */ long phatchBitmapPDU) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchBitmapPDU(
+ /* [retval][out] */ long *phatchBitmapPDU) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchSSBOrder(
+ /* [in] */ long phatchSSBOrder) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchSSBOrder(
+ /* [retval][out] */ long *phatchSSBOrder) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchMembltOrder(
+ /* [in] */ long phatchMembltOrder) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchMembltOrder(
+ /* [retval][out] */ long *phatchMembltOrder) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchIndexPDU(
+ /* [in] */ long phatchIndexPDU) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchIndexPDU(
+ /* [retval][out] */ long *phatchIndexPDU) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LabelMemblt(
+ /* [in] */ long plabelMemblt) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LabelMemblt(
+ /* [retval][out] */ long *plabelMemblt) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheMonitor(
+ /* [in] */ long pbitmapCacheMonitor) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheMonitor(
+ /* [retval][out] */ long *pbitmapCacheMonitor) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocFailuresPercent(
+ /* [in] */ long pmallocFailuresPercent) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocFailuresPercent(
+ /* [retval][out] */ long *pmallocFailuresPercent) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocHugeFailuresPercent(
+ /* [in] */ long pmallocHugeFailuresPercent) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocHugeFailuresPercent(
+ /* [retval][out] */ long *pmallocHugeFailuresPercent) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NetThroughput(
+ /* [in] */ long NetThroughput) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NetThroughput(
+ /* [retval][out] */ long *NetThroughput) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXCmdLine(
+ /* [in] */ BSTR pCLXCmdLine) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXCmdLine(
+ /* [retval][out] */ BSTR *pCLXCmdLine) = 0;
+
+ virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXDll(
+ /* [in] */ BSTR pCLXDll) = 0;
+
+ virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXDll(
+ /* [retval][out] */ BSTR *pCLXDll) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IMsTscDebugVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IMsTscDebug * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IMsTscDebug * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IMsTscDebug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ IMsTscDebug * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ IMsTscDebug * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ IMsTscDebug * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IMsTscDebug * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchBitmapPDU )(
+ IMsTscDebug * This,
+ /* [in] */ long phatchBitmapPDU);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchBitmapPDU )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *phatchBitmapPDU);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchSSBOrder )(
+ IMsTscDebug * This,
+ /* [in] */ long phatchSSBOrder);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchSSBOrder )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *phatchSSBOrder);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchMembltOrder )(
+ IMsTscDebug * This,
+ /* [in] */ long phatchMembltOrder);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchMembltOrder )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *phatchMembltOrder);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchIndexPDU )(
+ IMsTscDebug * This,
+ /* [in] */ long phatchIndexPDU);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchIndexPDU )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *phatchIndexPDU);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LabelMemblt )(
+ IMsTscDebug * This,
+ /* [in] */ long plabelMemblt);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LabelMemblt )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *plabelMemblt);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheMonitor )(
+ IMsTscDebug * This,
+ /* [in] */ long pbitmapCacheMonitor);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheMonitor )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *pbitmapCacheMonitor);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocFailuresPercent )(
+ IMsTscDebug * This,
+ /* [in] */ long pmallocFailuresPercent);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocFailuresPercent )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *pmallocFailuresPercent);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocHugeFailuresPercent )(
+ IMsTscDebug * This,
+ /* [in] */ long pmallocHugeFailuresPercent);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocHugeFailuresPercent )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *pmallocHugeFailuresPercent);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NetThroughput )(
+ IMsTscDebug * This,
+ /* [in] */ long NetThroughput);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NetThroughput )(
+ IMsTscDebug * This,
+ /* [retval][out] */ long *NetThroughput);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXCmdLine )(
+ IMsTscDebug * This,
+ /* [in] */ BSTR pCLXCmdLine);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXCmdLine )(
+ IMsTscDebug * This,
+ /* [retval][out] */ BSTR *pCLXCmdLine);
+
+ /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXDll )(
+ IMsTscDebug * This,
+ /* [in] */ BSTR pCLXDll);
+
+ /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXDll )(
+ IMsTscDebug * This,
+ /* [retval][out] */ BSTR *pCLXDll);
+
+ END_INTERFACE
+ } IMsTscDebugVtbl;
+
+ interface IMsTscDebug
+ {
+ CONST_VTBL struct IMsTscDebugVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IMsTscDebug_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IMsTscDebug_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IMsTscDebug_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IMsTscDebug_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IMsTscDebug_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IMsTscDebug_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IMsTscDebug_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IMsTscDebug_put_HatchBitmapPDU(This,phatchBitmapPDU) \
+ ( (This)->lpVtbl -> put_HatchBitmapPDU(This,phatchBitmapPDU) )
+
+#define IMsTscDebug_get_HatchBitmapPDU(This,phatchBitmapPDU) \
+ ( (This)->lpVtbl -> get_HatchBitmapPDU(This,phatchBitmapPDU) )
+
+#define IMsTscDebug_put_HatchSSBOrder(This,phatchSSBOrder) \
+ ( (This)->lpVtbl -> put_HatchSSBOrder(This,phatchSSBOrder) )
+
+#define IMsTscDebug_get_HatchSSBOrder(This,phatchSSBOrder) \
+ ( (This)->lpVtbl -> get_HatchSSBOrder(This,phatchSSBOrder) )
+
+#define IMsTscDebug_put_HatchMembltOrder(This,phatchMembltOrder) \
+ ( (This)->lpVtbl -> put_HatchMembltOrder(This,phatchMembltOrder) )
+
+#define IMsTscDebug_get_HatchMembltOrder(This,phatchMembltOrder) \
+ ( (This)->lpVtbl -> get_HatchMembltOrder(This,phatchMembltOrder) )
+
+#define IMsTscDebug_put_HatchIndexPDU(This,phatchIndexPDU) \
+ ( (This)->lpVtbl -> put_HatchIndexPDU(This,phatchIndexPDU) )
+
+#define IMsTscDebug_get_HatchIndexPDU(This,phatchIndexPDU) \
+ ( (This)->lpVtbl -> get_HatchIndexPDU(This,phatchIndexPDU) )
+
+#define IMsTscDebug_put_LabelMemblt(This,plabelMemblt) \
+ ( (This)->lpVtbl -> put_LabelMemblt(This,plabelMemblt) )
+
+#define IMsTscDebug_get_LabelMemblt(This,plabelMemblt) \
+ ( (This)->lpVtbl -> get_LabelMemblt(This,plabelMemblt) )
+
+#define IMsTscDebug_put_BitmapCacheMonitor(This,pbitmapCacheMonitor) \
+ ( (This)->lpVtbl -> put_BitmapCacheMonitor(This,pbitmapCacheMonitor) )
+
+#define IMsTscDebug_get_BitmapCacheMonitor(This,pbitmapCacheMonitor) \
+ ( (This)->lpVtbl -> get_BitmapCacheMonitor(This,pbitmapCacheMonitor) )
+
+#define IMsTscDebug_put_MallocFailuresPercent(This,pmallocFailuresPercent) \
+ ( (This)->lpVtbl -> put_MallocFailuresPercent(This,pmallocFailuresPercent) )
+
+#define IMsTscDebug_get_MallocFailuresPercent(This,pmallocFailuresPercent) \
+ ( (This)->lpVtbl -> get_MallocFailuresPercent(This,pmallocFailuresPercent) )
+
+#define IMsTscDebug_put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) \
+ ( (This)->lpVtbl -> put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) )
+
+#define IMsTscDebug_get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) \
+ ( (This)->lpVtbl -> get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) )
+
+#define IMsTscDebug_put_NetThroughput(This,NetThroughput) \
+ ( (This)->lpVtbl -> put_NetThroughput(This,NetThroughput) )
+
+#define IMsTscDebug_get_NetThroughput(This,NetThroughput) \
+ ( (This)->lpVtbl -> get_NetThroughput(This,NetThroughput) )
+
+#define IMsTscDebug_put_CLXCmdLine(This,pCLXCmdLine) \
+ ( (This)->lpVtbl -> put_CLXCmdLine(This,pCLXCmdLine) )
+
+#define IMsTscDebug_get_CLXCmdLine(This,pCLXCmdLine) \
+ ( (This)->lpVtbl -> get_CLXCmdLine(This,pCLXCmdLine) )
+
+#define IMsTscDebug_put_CLXDll(This,pCLXDll) \
+ ( (This)->lpVtbl -> put_CLXDll(This,pCLXDll) )
+
+#define IMsTscDebug_get_CLXDll(This,pCLXDll) \
+ ( (This)->lpVtbl -> get_CLXDll(This,pCLXDll) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IMsTscDebug_INTERFACE_DEFINED__ */
+
+
+EXTERN_C const CLSID CLSID_MsTscAx;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("1FB464C8-09BB-4017-A2F5-EB742F04392F")
+MsTscAx;
+#endif
+
+EXTERN_C const CLSID CLSID_MsRdpClient;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("791FA017-2DE3-492E-ACC5-53C67A2B94D0")
+MsRdpClient;
+#endif
+
+EXTERN_C const CLSID CLSID_MsRdpClient2;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("9059F30F-4EB1-4BD2-9FDC-36F43A218F4A")
+MsRdpClient2;
+#endif
+
+EXTERN_C const CLSID CLSID_MsRdpClient3;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("7584C670-2274-4EFB-B00B-D6AABA6D3850")
+MsRdpClient3;
+#endif
+
+EXTERN_C const CLSID CLSID_MsRdpClient4;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("6AE29350-321B-42BE-BBE5-12FB5270C0DE")
+MsRdpClient4;
+#endif
+#endif /* __MSTSCLib_LIBRARY_DEFINED__ */
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
--- /dev/null
+
+
+/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
+
+/* link this file in with the server and any clients */
+
+
+ /* File created by MIDL compiler version 7.00.0493 */
+/* at Sun Aug 13 16:46:05 2006
+ */
+/* Compiler settings for .\mstsclib_redist.idl:
+ Oicf, W1, Zp8, env=Win32 (32b run)
+ protocol : dce , ms_ext, c_ext, robust
+ error checks: allocation ref bounds_check enum stub_data
+ VC __declspec() decoration level:
+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
+ DECLSPEC_UUID(), MIDL_INTERFACE()
+*/
+//@@MIDL_FILE_HEADING( )
+
+#pragma warning( disable: 4049 ) /* more than 64k source lines */
+
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifdef _MIDL_USE_GUIDDEF_
+
+#ifndef INITGUID
+#define INITGUID
+#include <guiddef.h>
+#undef INITGUID
+#else
+#include <guiddef.h>
+#endif
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
+
+#else // !_MIDL_USE_GUIDDEF_
+
+#ifndef __IID_DEFINED__
+#define __IID_DEFINED__
+
+typedef struct _IID
+{
+ unsigned long x;
+ unsigned short s1;
+ unsigned short s2;
+ unsigned char c[8];
+} IID;
+
+#endif // __IID_DEFINED__
+
+#ifndef CLSID_DEFINED
+#define CLSID_DEFINED
+typedef IID CLSID;
+#endif // CLSID_DEFINED
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+
+#endif !_MIDL_USE_GUIDDEF_
+
+MIDL_DEFINE_GUID(IID, LIBID_MSTSCLib,0xAF586AAE,0xB62A,0x420E,0xB7,0x96,0x29,0x4E,0x7E,0xE6,0x4C,0x70);
+
+
+MIDL_DEFINE_GUID(IID, DIID_IMsTscAxEvents,0x336D5562,0xEFA8,0x482E,0x8C,0xB3,0xC5,0xC0,0xFC,0x7A,0x7D,0xB6);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscAx,0x327BB5CD,0x834E,0x4400,0xAE,0xF2,0xB3,0x0E,0x15,0xE5,0xD6,0x82);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClient,0x92B4A539,0x7115,0x4B7C,0xA5,0xA9,0xE5,0xD9,0xEF,0xC2,0x78,0x0A);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClient2,0xE7E17DC4,0x3B71,0x4BA7,0xA8,0xE6,0x28,0x1F,0xFA,0xDC,0xA2,0x8F);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClient3,0x91B7CBC5,0xA72E,0x4FA0,0x93,0x00,0xD6,0x47,0xD7,0xE8,0x97,0xFF);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClient4,0x095E0738,0xD97D,0x488B,0xB9,0xF6,0xDD,0x0E,0x8D,0x66,0xC0,0xDE);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscNonScriptable,0xC1E6743A,0x41C1,0x4A74,0x83,0x2A,0x0D,0xD0,0x6C,0x1C,0x7A,0x0E);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientNonScriptable,0x2F079C4C,0x87B2,0x4AFD,0x97,0xAB,0x20,0xCD,0xB4,0x30,0x38,0xAE);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientNonScriptable2,0x17A5E535,0x4072,0x4FA4,0xAF,0x32,0xC8,0xD0,0xD4,0x73,0x45,0xE9);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscAdvancedSettings,0x809945CC,0x4B3B,0x4A92,0xA6,0xB0,0xDB,0xF9,0xB5,0xF2,0xEF,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientAdvancedSettings,0x3C65B4AB,0x12B3,0x465B,0xAC,0xD4,0xB8,0xDA,0xD3,0xBF,0xF9,0xE2);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientAdvancedSettings2,0x9AC42117,0x2B76,0x4320,0xAA,0x44,0x0E,0x61,0x6A,0xB8,0x43,0x7B);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientAdvancedSettings3,0x19CD856B,0xC542,0x4C53,0xAC,0xEE,0xF1,0x27,0xE3,0xBE,0x1A,0x59);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientAdvancedSettings4,0xFBA7F64E,0x7345,0x4405,0xAE,0x50,0xFA,0x4A,0x76,0x3D,0xC0,0xDE);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscSecuredSettings,0xC9D65442,0xA0F9,0x45B2,0x8F,0x73,0xD6,0x1D,0x2D,0xB8,0xCB,0xB6);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsRdpClientSecuredSettings,0x605BEFCF,0x39C1,0x45CC,0xA8,0x11,0x06,0x8F,0xB7,0xBE,0x34,0x6D);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMsTscDebug,0x209D0EB9,0x6254,0x47B1,0x90,0x33,0xA9,0x8D,0xAE,0x55,0xBB,0x27);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsTscAx,0x1FB464C8,0x09BB,0x4017,0xA2,0xF5,0xEB,0x74,0x2F,0x04,0x39,0x2F);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsRdpClient,0x791FA017,0x2DE3,0x492E,0xAC,0xC5,0x53,0xC6,0x7A,0x2B,0x94,0xD0);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsRdpClient2,0x9059F30F,0x4EB1,0x4BD2,0x9F,0xDC,0x36,0xF4,0x3A,0x21,0x8F,0x4A);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsRdpClient3,0x7584C670,0x2274,0x4EFB,0xB0,0x0B,0xD6,0xAA,0xBA,0x6D,0x38,0x50);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_MsRdpClient4,0x6AE29350,0x321B,0x42BE,0xBB,0xE5,0x12,0xFB,0x52,0x70,0xC0,0xDE);
+
+#undef MIDL_DEFINE_GUID
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
--- /dev/null
+#include "stdafx.h"
+
+#include <zmouse.h>
+
+#include "rdesktop/rdesktop.h"
+#include "rdesktop/proto.h"
+
+extern "C"
+{
+ /* ==== BEGIN POOP ==== */
+ // Temporary implementations of stuff we totally positively need to make the Real Thing happy
+ /* produce a hex dump */
+ void
+ hexdump(unsigned char *p, unsigned int len)
+ {
+ unsigned char *line = p;
+ int i, thisline;
+ unsigned int offset = 0;
+
+ while (offset < len)
+ {
+ printf("%04x ", offset);
+ thisline = len - offset;
+ if (thisline > 16)
+ thisline = 16;
+
+ for (i = 0; i < thisline; i++)
+ printf("%02x ", line[i]);
+
+ for (; i < 16; i++)
+ printf(" ");
+
+ for (i = 0; i < thisline; i++)
+ printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');
+
+ printf("\n");
+ offset += thisline;
+ line += thisline;
+ }
+ }
+
+ void generate_random(uint8 * random)
+ {
+ memcpy(random, "12345678901234567890123456789012", 32);
+ }
+
+ /* report an error */
+ void
+ error(char *format, ...)
+ {
+ va_list ap;
+
+ fprintf(stderr, "ERROR: ");
+
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ }
+
+ /* report a warning */
+ void
+ warning(char *format, ...)
+ {
+ va_list ap;
+
+ fprintf(stderr, "WARNING: ");
+
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ }
+
+ /* report an unimplemented protocol feature */
+ void
+ unimpl(char *format, ...)
+ {
+ va_list ap;
+
+ fprintf(stderr, "NOT IMPLEMENTED: ");
+
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ }
+
+ /* Create the bitmap cache directory */
+ BOOL
+ rd_pstcache_mkdir(void)
+ {
+ char *home;
+ char bmpcache_dir[256];
+
+ home = getenv("HOME");
+
+ if (home == NULL)
+ return False;
+
+ sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop");
+
+ if ((_mkdir(bmpcache_dir) == -1) && errno != EEXIST)
+ {
+ perror(bmpcache_dir);
+ return False;
+ }
+
+ sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop/cache");
+
+ if ((_mkdir(bmpcache_dir) == -1) && errno != EEXIST)
+ {
+ perror(bmpcache_dir);
+ return False;
+ }
+
+ return True;
+ }
+
+ /* open a file in the .rdesktop directory */
+ int
+ rd_open_file(char *filename)
+ {
+ char *home;
+ char fn[256];
+ int fd;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ return -1;
+ sprintf(fn, "%s/.rdesktop/%s", home, filename);
+ fd = _open(fn, _O_RDWR | _O_CREAT, 0);
+ if (fd == -1)
+ perror(fn);
+ return fd;
+ }
+
+ /* close file */
+ void
+ rd_close_file(int fd)
+ {
+ _close(fd);
+ }
+
+ /* read from file*/
+ int
+ rd_read_file(int fd, void *ptr, int len)
+ {
+ return _read(fd, ptr, len);
+ }
+
+ /* write to file */
+ int
+ rd_write_file(int fd, void *ptr, int len)
+ {
+ return _write(fd, ptr, len);
+ }
+
+ /* move file pointer */
+ int
+ rd_lseek_file(int fd, int offset)
+ {
+ return _lseek(fd, offset, SEEK_SET);
+ }
+
+ /* do a write lock on a file */
+ BOOL
+ rd_lock_file(int fd, int start, int len)
+ {
+ // TODOOO...
+ return False;
+ }
+
+ int
+ load_licence(RDPCLIENT * This, unsigned char **data)
+ {
+ return -1;
+ }
+
+ void
+ save_licence(RDPCLIENT * This, unsigned char *data, int length)
+ {
+ }
+
+ /* ==== END POOP ==== */
+
+ /* ==== UI ==== */
+ // Globals are totally teh evil, but cut me some slack here
+ HWND hwnd;
+ HBITMAP hbmBuffer;
+ PVOID pBuffer;
+ HDC hdcBuffer;
+ UINT wmZMouseWheel;
+
+};
+
+static
+void
+mstsc_mousewheel(RDPCLIENT * This, int value, LPARAM lparam)
+{
+ uint16 button;
+
+ if(value < 0)
+ button = MOUSE_FLAG_BUTTON5;
+ else
+ button = MOUSE_FLAG_BUTTON4;
+
+ if(value < 0)
+ value = - value;
+
+ for(int click = 0; click < value; click += WHEEL_DELTA)
+ rdp_send_input(This, GetTickCount(), RDP_INPUT_MOUSE, button | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
+}
+
+static
+LRESULT
+CALLBACK
+mstsc_WndProc(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
+{
+ // BUGBUG: LongToPtr & PtrToLong will break on Win64
+
+ RDPCLIENT * This = reinterpret_cast<RDPCLIENT *>(LongToPtr(GetWindowLongPtr(hwnd, GWLP_USERDATA)));
+
+ switch(uMsg)
+ {
+ case WM_CLOSE:
+ DestroyWindow(hwnd);
+ break;
+
+ // FIXME: temporary
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+
+ /* Initialization */
+ case WM_CREATE:
+ This = static_cast<RDPCLIENT *>(reinterpret_cast<LPCREATESTRUCT>(lparam)->lpCreateParams);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, PtrToLong(This));
+ break;
+
+ /* Painting */
+ case WM_PRINTCLIENT:
+ if(wparam == 0)
+ break;
+
+ case WM_PAINT:
+ {
+ HDC hdc = (HDC)wparam;
+
+ // A DC was provided: print the whole client area into it
+ if(hdc)
+ {
+ RECT rc;
+ GetClientRect(hwnd, &rc);
+ BitBlt(hdc, 0, 0, rc.right, rc.bottom, hdcBuffer, 0, 0, SRCCOPY);
+ }
+ // Otherwise, we're refreshing to screen
+ else
+ {
+ PAINTSTRUCT ps;
+ hdc = BeginPaint(hwnd, &ps);
+
+ BitBlt
+ (
+ hdc,
+ ps.rcPaint.left,
+ ps.rcPaint.top,
+ ps.rcPaint.right - ps.rcPaint.left,
+ ps.rcPaint.bottom - ps.rcPaint.top,
+ hdcBuffer,
+ ps.rcPaint.left,
+ ps.rcPaint.top,
+ SRCCOPY
+ );
+
+ EndPaint(hwnd, &ps);
+ }
+ }
+
+ break;
+
+ /* Keyboard stuff */
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_SCANCODE, RDP_KEYPRESS | (lparam & 0x1000000 ? KBD_FLAG_EXT : 0), LOBYTE(HIWORD(lparam)), 0);
+ break;
+
+ case WM_SYSKEYUP:
+ case WM_KEYUP:
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_SCANCODE, RDP_KEYRELEASE | (lparam & 0x1000000 ? KBD_FLAG_EXT : 0), LOBYTE(HIWORD(lparam)), 0);
+ break;
+
+ /* Mouse stuff */
+ // Cursor shape
+ case WM_SETCURSOR:
+ if(LOWORD(lparam) == HTCLIENT)
+ {
+ //SetCursor(hcursor);
+ return TRUE;
+ }
+
+ break;
+
+ // Movement
+ case WM_MOUSEMOVE:
+ //if(This->sendmotion || wparam & (MK_LBUTTON | MK_RBUTTON | MK_MBUTTON | MK_XBUTTON1 | MK_XBUTTON2))
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE, LOWORD(lparam), HIWORD(lparam));
+
+ break;
+
+ // Buttons
+ // TODO: X buttons
+ case WM_LBUTTONDOWN:
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_RBUTTONDOWN:
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_MBUTTONDOWN:
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_LBUTTONUP:
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_RBUTTONUP:
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ case WM_MBUTTONUP:
+ rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3, LOWORD(lparam), HIWORD(lparam));
+ break;
+
+ // Wheel
+ case WM_MOUSEWHEEL:
+ mstsc_mousewheel(This, (SHORT)HIWORD(wparam), lparam);
+ break;
+
+ default:
+ /* Registered messages */
+ // Z-Mouse wheel support - you know, just in case
+ if(uMsg == wmZMouseWheel)
+ {
+ mstsc_mousewheel(This, (int)wparam, lparam);
+ break;
+ }
+
+ /* Unhandled messages */
+ return DefWindowProc(hwnd, uMsg, wparam, lparam);
+ }
+
+ return 0;
+}
+
+static
+DWORD
+WINAPI
+mstsc_ProtocolIOThread
+(
+ LPVOID lpArgument
+)
+{
+ RDPCLIENT * This = static_cast<RDPCLIENT *>(lpArgument);
+
+ WCHAR hostname[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD dw = ARRAYSIZE(hostname);
+ GetComputerNameW(hostname, &dw);
+
+ uint32 flags = RDP_LOGON_NORMAL | RDP_LOGON_COMPRESSION | RDP_LOGON_COMPRESSION2;
+
+ rdp_connect(This, "10.0.0.3", flags, L"Administrator", L"", L"", L"", L"", hostname, "");
+ //rdp_connect(This, "192.168.7.232", flags, "", "", "", "");
+
+ hdcBuffer = CreateCompatibleDC(NULL);
+
+ BITMAPINFO bmi;
+ bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);
+ bmi.bmiHeader.biWidth = This->width;
+ bmi.bmiHeader.biHeight = This->height;
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biBitCount = This->server_depth;
+ bmi.bmiHeader.biCompression = BI_RGB;
+ bmi.bmiHeader.biSizeImage = 0;
+ bmi.bmiHeader.biXPelsPerMeter = 0;
+ bmi.bmiHeader.biYPelsPerMeter = 0;
+ bmi.bmiHeader.biClrUsed = 0; // TODO! palette displays
+ bmi.bmiHeader.biClrImportant = 0; // TODO! palette displays
+
+ hbmBuffer = CreateDIBSection(hdcBuffer, &bmi, DIB_RGB_COLORS, &pBuffer, NULL, 0);
+
+ SelectObject(hdcBuffer, hbmBuffer);
+
+#if 0
+ rcClip.left = 0;
+ rcClip.top = 0;
+ rcClip.right = This->width + 1;
+ rcClip.bottom = This->height + 1;
+#endif
+
+ BOOL deactivated;
+ uint32 ext_disc_reason;
+
+ rdp_main_loop(This, &deactivated, &ext_disc_reason);
+ // TODO: handle redirection
+ // EVENT: OnDisconnect
+
+ SendMessage(hwnd, WM_CLOSE, 0, 0);
+
+ return 0;
+}
+
+/* Virtual channel stuff */
+extern "C" void channel_process(RDPCLIENT * This, STREAM s, uint16 mcs_channel)
+{
+}
+
+DWORD tlsIndex;
+
+typedef struct CHANNEL_HANDLE_
+{
+ RDPCLIENT * client;
+ int channel;
+}
+CHANNEL_HANDLE;
+
+static
+UINT
+VCAPITYPE
+VirtualChannelInit
+(
+ LPVOID * ppInitHandle,
+ PCHANNEL_DEF pChannel,
+ INT channelCount,
+ ULONG versionRequested,
+ PCHANNEL_INIT_EVENT_FN pChannelInitEventProc
+)
+{
+ if(channelCount <= 0)
+ return CHANNEL_RC_BAD_CHANNEL;
+
+ if(ppInitHandle == NULL)
+ return CHANNEL_RC_BAD_INIT_HANDLE;
+
+ if(pChannel == NULL)
+ return CHANNEL_RC_BAD_CHANNEL;
+
+ if(pChannelInitEventProc == NULL)
+ return CHANNEL_RC_BAD_PROC;
+
+ RDPCLIENT * This = (RDPCLIENT *)TlsGetValue(tlsIndex);
+
+ if(This == NULL)
+ return CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY;
+
+ if(This->num_channels + channelCount > CHANNEL_MAX_COUNT)
+ return CHANNEL_RC_TOO_MANY_CHANNELS;
+
+ for(INT i = 0; i < channelCount; ++ i)
+ {
+ if(strlen(pChannel[i].name) > CHANNEL_NAME_LEN)
+ return CHANNEL_RC_BAD_CHANNEL;
+ }
+
+ memcpy(This->channel_defs + This->num_channels, pChannel, sizeof(*pChannel) * channelCount);
+
+#if 0 // TODO
+ for(INT i = 0; i < channelCount; ++ i)
+ {
+ pChannel[i].options |= CHANNEL_OPTION_INITIALIZED;
+
+ int j = This->num_channels + i;
+ This->channel_data[j].opened = 0;
+ This->channel_data[j].pChannelInitEventProc = pChannelInitEventProc;
+ This->channel_data[j].pChannelOpenEventProc = NULL;
+ }
+#endif
+
+ This->num_channels += channelCount;
+
+ *ppInitHandle = This;
+
+ return CHANNEL_RC_OK;
+}
+
+UINT
+VCAPITYPE
+VirtualChannelOpen
+(
+ LPVOID pInitHandle,
+ LPDWORD pOpenHandle,
+ PCHAR pChannelName,
+ PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc
+)
+{
+ if(pInitHandle == NULL)
+ return CHANNEL_RC_BAD_INIT_HANDLE;
+
+ if(pOpenHandle == NULL)
+ return CHANNEL_RC_BAD_CHANNEL_HANDLE;
+
+ if(pChannelName == NULL)
+ return CHANNEL_RC_UNKNOWN_CHANNEL_NAME;
+
+ if(pChannelOpenEventProc == NULL)
+ return CHANNEL_RC_BAD_PROC;
+
+ RDPCLIENT * This = (RDPCLIENT *)pInitHandle;
+
+#if 0 // TODO
+ for(unsigned i = 0; i < This->num_channels; ++ i)
+ {
+ if(strcmp(pChannelName, This->channel_defs[i].name) == 0)
+ {
+ if(This->channel_data[i].opened)
+ return CHANNEL_RC_ALREADY_OPEN;
+
+ This->channel_data[i].opened = 1;
+ This->channel_data[i].pChannelOpenEventProc = pChannelOpenEventProc;
+
+ // TODO: allocate a handle here
+ *pOpenHandle = 0;
+
+ break;
+ }
+ }
+#endif
+
+ return CHANNEL_RC_OK;
+}
+
+UINT VCAPITYPE VirtualChannelClose
+(
+ DWORD openHandle
+)
+{
+ // TODO: channel handle management
+ return CHANNEL_RC_BAD_CHANNEL_HANDLE;
+}
+
+UINT VCAPITYPE VirtualChannelWrite
+(
+ DWORD openHandle,
+ LPVOID pData,
+ ULONG dataLength,
+ LPVOID pUserData
+)
+{
+ // TODO
+ return CHANNEL_RC_BAD_CHANNEL_HANDLE;
+}
+
+int wmain()
+{
+ WSADATA wsd;
+ WSAStartup(MAKEWORD(2, 2), &wsd);
+
+ static RDPCLIENT This_; // NOTE: this is HUGE and would overflow the stack!
+ ZeroMemory(&This_, sizeof(This_));
+
+ RDPCLIENT * This = &This_;
+
+ /*
+ Threading model for MissTosca:
+ - main thread is the GUI thread. Message loop maintained by caller
+ - protocol I/O is handled in an I/O thread (or thread pool)
+ - extra threads maintained by virtual channel handlers. Virtual channel writes are thread-neutral
+
+ How we handle drawing: at the moment just an off-screen buffer we dump on-screen when asked to.
+ Still considering how to draw on-screen directly and *then* buffering off-screen (for example,
+ when running inside another remote session)
+ */
+
+ // FIXME: keyboard mess
+ This->keylayout = 0x409;
+ This->keyboard_type = 0x4;
+ This->keyboard_subtype = 0x0;
+ This->keyboard_functionkeys = 0xc;
+ This->width = 800;
+ This->height = 600;
+ This->server_depth = 24;
+ This->bitmap_compression = True;
+ //This->sendmotion = True;
+ This->bitmap_cache = True;
+ This->bitmap_cache_persist_enable = False;
+ This->bitmap_cache_precache = True;
+ This->encryption = True;
+ This->packet_encryption = True;
+ This->desktop_save = True;
+ This->polygon_ellipse_orders = False; // = True;
+ //This->fullscreen = False;
+ //This->grab_keyboard = True;
+ //This->hide_decorations = False;
+ This->use_rdp5 = True;
+ //This->rdpclip = True;
+ This->console_session = False;
+ //This->numlock_sync = False;
+ //This->seamless_rdp = False;
+ This->rdp5_performanceflags = RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | RDP5_NO_MENUANIMATIONS;
+ This->tcp_port_rdp = TCP_PORT_RDP;
+
+#define NOT_SET -1
+ This->cache.bmpcache_lru[0] = NOT_SET;
+ This->cache.bmpcache_lru[1] = NOT_SET;
+ This->cache.bmpcache_lru[2] = NOT_SET;
+ This->cache.bmpcache_mru[0] = NOT_SET;
+ This->cache.bmpcache_mru[1] = NOT_SET;
+ This->cache.bmpcache_mru[2] = NOT_SET;
+
+ This->rdp.current_status = 1;
+
+ //hcursor = NULL;
+
+ WNDCLASS wc;
+ ZeroMemory(&wc, sizeof(wc));
+
+ wc.lpfnWndProc = mstsc_WndProc;
+ wc.hbrBackground = static_cast<HBRUSH>(GetStockObject(HOLLOW_BRUSH));
+ wc.lpszClassName = TEXT("MissTosca_Desktop");
+
+ wmZMouseWheel = RegisterWindowMessage(MSH_MOUSEWHEEL);
+
+ ATOM a = RegisterClass(&wc);
+
+ hwnd = CreateWindow
+ (
+ MAKEINTATOM(a),
+ NULL,
+ WS_POPUP | WS_VISIBLE,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ This->width,
+ This->height,
+ NULL,
+ NULL,
+ NULL,
+ This
+ );
+
+ // The righ time to start the protocol thread
+ DWORD dwThreadId;
+ HANDLE hThread = CreateThread(NULL, 0, mstsc_ProtocolIOThread, This, 0, &dwThreadId);
+
+ // Your standard, garden variety message loop
+ MSG msg;
+
+ while(GetMessage(&msg, NULL, 0, 0))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+}
+
+// EOF
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="rdesktop-core-tester"
+ ProjectGUID="{B172A623-E2BD-4E3F-86E6-620548FE255B}"
+ RootNamespace="rdesktopcoretester"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ WarningLevel="1"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""$(SolutionDir)";"C:\Documents and Settings\All Users\Documenti\openssl-0.9.8b\inc32""
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib user32.lib gdi32.lib ws2_32.lib libeay32.lib advapi32.lib msimg32.lib ole32.lib oleaut32.lib comctl32.lib $(NoInherit)"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""C:\Documents and Settings\All Users\Documenti\openssl-0.9.8b\out32""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ WarningLevel="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""$(SolutionDir)";"C:\Documents and Settings\All Users\Documenti\openssl-0.9.8b\inc32""
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib user32.lib gdi32.lib ws2_32.lib libeay32.lib advapi32.lib msimg32.lib ole32.lib oleaut32.lib comctl32.lib $(NoInherit)"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""C:\Documents and Settings\All Users\Documenti\openssl-0.9.8b\out32""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ <ProjectReference
+ ReferencedProjectIdentifier="{8620E9B2-9AF0-4F69-A5AF-C195D5F86372}"
+ RelativePathToProject=".\rdesktop\rdesktop-core.vcproj"
+ />
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\activex.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\rdesktop-core-tester.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\stdafx.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <Filter
+ Name="MIDL"
+ >
+ <File
+ RelativePath=".\mstsclib.idl"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)/$(InputName).tlb"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)/$(InputName).tlb"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\mstsclib.rc"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="TYPELIB_PATH__=$(IntDir)/$(InputName).tlb"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="TYPELIB_PATH__=$(IntDir)/$(InputName).tlb"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\mstsclib_h.h"
+ >
+ </File>
+ <File
+ RelativePath=".\mstsclib_i.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_MIDL_USE_GUIDDEF_"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_MIDL_USE_GUIDDEF_"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\mstsclib_redist.idl"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)/$(InputName).tlb"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)/$(InputName).tlb"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\mstsclib_redist.rc"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="TYPELIB_PATH__=$(IntDir)/$(InputName).tlb"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="TYPELIB_PATH__=$(IntDir)/$(InputName).tlb"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\mstsclib_redist_h.h"
+ >
+ </File>
+ <File
+ RelativePath=".\mstsclib_redist_i.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_MIDL_USE_GUIDDEF_"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_MIDL_USE_GUIDDEF_"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\typelib.rh"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
--- /dev/null
+#include "stdafx.h"
+
+// EOF
--- /dev/null
+#pragma once
+
+#define _CRT_SECURE_NO_DEPRECATE
+#define _SECURE_SCL 0
+
+#include <new>
+#include <algorithm>
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <direct.h>
+#include <io.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winsock2.h>
+
+#include <objbase.h>
+#include <oleauto.h>
+#include <olectl.h>
+#include <ocidl.h>
+#include <objsafe.h>
+
+#include <commctrl.h>
+
+// EOF
--- /dev/null
+#define TOSTRING_(X) #X
+#define TOSTRING(X) TOSTRING_(X)
+
+LANGUAGE 0, 0
+
+#ifndef TYPELIB_PATH__
+#error TYPELIB_PATH__ not defined
+#endif
+
+#ifndef TYPELIB_RESOURCEID__
+#error TYPELIB_RESOURCEID__ not defined
+#endif
+
+/*
+ NOTE:
+ TYPELIB_PATH__ is defined on the command line (-D TYPELIB_PATH__=<path>)
+ TYPELIB_RESOURCEID__ is defined before this file is included
+*/
+TYPELIB_RESOURCEID__ TYPELIB TOSTRING(TYPELIB_PATH__)
+
+// EOF
--- /dev/null
+This software is released under the GNU General Public License
+(reproduced below) with the additional exemption that compiling,
+linking, and/or using OpenSSL together with this software is
+allowed.
+
+---
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
--- /dev/null
+#
+# rdesktop: A Remote Desktop Protocol client
+# Makefile.in
+# Copyright (C) Matthew Chapman 1999-2005
+#
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+mandir = @mandir@
+datadir = @datadir@
+
+VERSION = @PACKAGE_VERSION@
+KEYMAP_PATH = $(datadir)/rdesktop/keymaps/
+
+CC = @CC@
+INSTALL = @INSTALL@
+CFLAGS = @CFLAGS@ @X_CFLAGS@ @DEFS@ -DKEYMAP_PATH=\"$(KEYMAP_PATH)\"
+LDFLAGS = @LDFLAGS@ @LIBS@ @X_LIBS@ @X_EXTRA_LIBS@
+STRIP = @STRIP@
+
+TARGETS = rdesktop @RDP2VNCTARGET@
+VNCINC = @VNCINC@
+LDVNC = @LDVNC@
+VNCLINK = @VNCLINK@
+SOUNDOBJ = @SOUNDOBJ@
+
+RDPOBJ = tcp.o iso.o mcs.o secure.o licence.o rdp.o orders.o bitmap.o cache.o rdp5.o channels.o rdpdr.o serial.o printer.o disk.o parallel.o printercache.o mppc.o pstcache.o lspci.o seamless.o
+X11OBJ = rdesktop.o xwin.o xkeymap.o ewmhints.o xclip.o cliprdr.o
+VNCOBJ = vnc/rdp2vnc.o vnc/vnc.o vnc/xkeymap.o vnc/x11stubs.o
+
+.PHONY: all
+all: $(TARGETS)
+
+rdesktop: $(X11OBJ) $(SOUNDOBJ) $(RDPOBJ)
+ $(CC) $(CFLAGS) -o rdesktop $(X11OBJ) $(SOUNDOBJ) $(RDPOBJ) $(LDFLAGS) -lX11
+
+rdp2vnc: $(VNCOBJ) $(SOUNDOBJ) $(RDPOBJ)
+ $(VNCLINK) $(CFLAGS) -o rdp2vnc $(VNCOBJ) $(SOUNDOBJ) $(RDPOBJ) $(LDFLAGS) $(LDVNC)
+
+vnc/rdp2vnc.o: rdesktop.c
+ $(CC) $(CFLAGS) $(VNCINC) -DRDP2VNC -o vnc/rdp2vnc.o -c rdesktop.c
+
+vnc/vnc.o: vnc/vnc.c
+ $(CC) $(CFLAGS) $(VNCINC) -DRDP2VNC -o vnc/vnc.o -c vnc/vnc.c
+
+vnc/xkeymap.o: xkeymap.c
+ $(CC) $(CFLAGS) $(VNCINC) -DRDP2VNC -o vnc/xkeymap.o -c xkeymap.c
+
+vnc/x11stubs.o: vnc/x11stubs.c
+ $(CC) $(CFLAGS) $(VNCINC) -o vnc/x11stubs.o -c vnc/x11stubs.c
+
+.PHONY: install
+install: installbin installkeymaps installman
+
+.PHONY: installbin
+installbin: rdesktop
+ mkdir -p $(DESTDIR)$(bindir)
+ $(INSTALL) rdesktop $(DESTDIR)$(bindir)
+ $(STRIP) $(DESTDIR)$(bindir)/rdesktop
+ chmod 755 $(DESTDIR)$(bindir)/rdesktop
+
+.PHONY: installman
+installman: doc/rdesktop.1
+ mkdir -p $(DESTDIR)$(mandir)/man1
+ cp doc/rdesktop.1 $(DESTDIR)$(mandir)/man1
+ chmod 644 $(DESTDIR)$(mandir)/man1/rdesktop.1
+
+.PHONY: installkeymaps
+installkeymaps:
+ mkdir -p $(DESTDIR)$(KEYMAP_PATH)
+# Prevent copying the CVS directory
+ cp keymaps/?? keymaps/??-?? $(DESTDIR)$(KEYMAP_PATH)
+ cp keymaps/common $(DESTDIR)$(KEYMAP_PATH)
+ cp keymaps/modifiers $(DESTDIR)$(KEYMAP_PATH)
+ chmod 644 $(DESTDIR)$(KEYMAP_PATH)/*
+
+.PHONY: proto
+proto:
+ cat proto.head > proto.h
+ cproto -DMAKE_PROTO \
+ bitmap.c cache.c channels.c cliprdr.c disk.c mppc.c ewmhints.c \
+ iso.c licence.c mcs.c orders.c parallel.c printer.c printercache.c \
+ pstcache.c rdesktop.c rdp5.c rdp.c rdpdr.c rdpsnd.c rdpsnd_oss.c \
+ secure.c serial.c tcp.c xclip.c xkeymap.c xwin.c lspci.c seamless.c >> proto.h
+ cat proto.tail >> proto.h
+
+.PHONY: clean
+clean:
+ rm -f *.o *~ vnc/*.o vnc/*~ rdesktop rdp2vnc
+
+.PHONY: distclean
+distclean: clean
+ rm -rf autom4te.cache config.log config.status Makefile
+
+.PHONY: dist
+dist: rdesktop-$(VERSION).tar.gz
+
+rdesktop-$(VERSION).tar.gz: Makefile configure
+ mkdir -p /tmp/rdesktop-make-dist-dir
+ ln -sf `pwd` /tmp/rdesktop-make-dist-dir/rdesktop-$(VERSION)
+ (cd /tmp/rdesktop-make-dist-dir; \
+ tar zcvf rdesktop-$(VERSION)/rdesktop-$(VERSION).tar.gz \
+ rdesktop-$(VERSION)/COPYING \
+ rdesktop-$(VERSION)/README \
+ rdesktop-$(VERSION)/configure \
+ rdesktop-$(VERSION)/configure.ac \
+ rdesktop-$(VERSION)/config.sub \
+ rdesktop-$(VERSION)/config.guess \
+ rdesktop-$(VERSION)/bootstrap \
+ rdesktop-$(VERSION)/install-sh \
+ rdesktop-$(VERSION)/Makefile.in \
+ rdesktop-$(VERSION)/rdesktop.spec \
+ rdesktop-$(VERSION)/*.c \
+ rdesktop-$(VERSION)/*.h \
+ rdesktop-$(VERSION)/proto.head \
+ rdesktop-$(VERSION)/proto.tail \
+ rdesktop-$(VERSION)/keymaps/?? \
+ rdesktop-$(VERSION)/keymaps/??-?? \
+ rdesktop-$(VERSION)/keymaps/common \
+ rdesktop-$(VERSION)/keymaps/modifiers \
+ rdesktop-$(VERSION)/keymaps/convert-map \
+ rdesktop-$(VERSION)/doc/HACKING \
+ rdesktop-$(VERSION)/doc/AUTHORS \
+ rdesktop-$(VERSION)/doc/TODO \
+ rdesktop-$(VERSION)/doc/ChangeLog \
+ rdesktop-$(VERSION)/doc/keymapping.txt \
+ rdesktop-$(VERSION)/doc/keymap-names.txt \
+ rdesktop-$(VERSION)/doc/ipv6.txt \
+ rdesktop-$(VERSION)/doc/licensing.txt \
+ rdesktop-$(VERSION)/doc/patches.txt \
+ rdesktop-$(VERSION)/doc/redirection.txt \
+ rdesktop-$(VERSION)/doc/rdesktop.1 )
+ rm -rf /tmp/rdesktop-make-dist-dir
+
+.PHONY: dist-noversion
+dist-noversion: rdesktop.tar.gz
+
+rdesktop.tar.gz: rdesktop-$(VERSION).tar.gz
+ mkdir -p /tmp/rdesktop-make-dist-dir
+ tar zxvf $< -C /tmp/rdesktop-make-dist-dir
+ mv /tmp/rdesktop-make-dist-dir/rdesktop-$(VERSION) /tmp/rdesktop-make-dist-dir/rdesktop
+ ls /tmp/rdesktop-make-dist-dir/rdesktop
+ tar zcvf $@ -C /tmp/rdesktop-make-dist-dir rdesktop
+ rm -rf /tmp/rdesktop-make-dist-dir
+
+Makefile: Makefile.in configure
+ ./config.status
+
+configure: configure.ac
+ ./bootstrap
+
+.SUFFIXES:
+.SUFFIXES: .c .o
+
+.c.o:
+ $(CC) $(CFLAGS) -o $@ -c $<
+
--- /dev/null
+===========================================
+rdesktop: A Remote Desktop Protocol client.
+===========================================
+
+rdesktop is a client for Microsoft Windows NT Terminal Server, Windows 2000
+Terminal Services, Windows 2003 Terminal Services/Remote Desktop, Windows XP
+Remote Desktop, and possibly other Terminal Services products.
+rdesktop currently implements the RDP version 4 and 5 protocols.
+
+Installation
+------------
+rdesktop uses a typical GNU-style build procedure:
+
+ % ./configure [options]
+ % make
+ % make install
+
+where documentation for [options] can be found by running "./configure --help".
+Usually no options are necessary. The default is to install under /usr/local,
+this can be changed with --prefix=directory.
+
+Invocation
+----------
+
+ % rdesktop [options] server
+
+where server is the name of the Terminal Services machine. Note: if you
+receive "Connection refused", this probably means that the server does not have
+Terminal Services enabled, or there is a firewall blocking access.
+
+The rdesktop manual page lists the possible options ("man rdesktop").
+
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Bitmap decompression routines
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+/* three seperate function for speed when decompressing the bitmaps */
+/* when modifing one function make the change in the others */
+/* comment out #define BITMAP_SPEED_OVER_SIZE below for one slower function */
+/* j@american-data.com */
+
+#define BITMAP_SPEED_OVER_SIZE
+
+/* indent is confused by this file */
+/* *INDENT-OFF* */
+
+#include "rdesktop.h"
+
+#define CVAL(p) (*(p++))
+#ifdef NEED_ALIGN
+#ifdef L_ENDIAN
+#define CVAL2(p, v) { v = (*(p++)); v |= (*(p++)) << 8; }
+#else
+#define CVAL2(p, v) { v = (*(p++)) << 8; v |= (*(p++)); }
+#endif /* L_ENDIAN */
+#else
+#define CVAL2(p, v) { v = (*((uint16*)p)); p += 2; }
+#endif /* NEED_ALIGN */
+
+#define UNROLL8(exp) { exp exp exp exp exp exp exp exp }
+
+#define REPEAT(statement) \
+{ \
+ while((count & ~0x7) && ((x+8) < width)) \
+ UNROLL8( statement; count--; x++; ); \
+ \
+ while((count > 0) && (x < width)) \
+ { \
+ statement; \
+ count--; \
+ x++; \
+ } \
+}
+
+#define MASK_UPDATE() \
+{ \
+ mixmask <<= 1; \
+ if (mixmask == 0) \
+ { \
+ mask = fom_mask ? fom_mask : CVAL(input); \
+ mixmask = 1; \
+ } \
+}
+
+#ifdef BITMAP_SPEED_OVER_SIZE
+
+/* 1 byte bitmap decompress */
+static BOOL
+bitmap_decompress1(uint8 * output, int width, int height, uint8 * input, int size)
+{
+ uint8 *end = input + size;
+ uint8 *prevline = NULL;
+ int opcode, count, offset, isfillormix;
+ int lastopcode = -1, insertmix = False, bicolour = False;
+ uint8 code;
+ uint8 colour1 = 0, colour2 = 0;
+ uint8 mixmask, mask = 0;
+ uint8 mix = 0xff;
+ int fom_mask = 0;
+#if 0
+ uint8 *line = NULL;
+ int x = width;
+#else
+ uint8 *line = output;
+ int x = 0;
+ int y = 0;
+#endif
+
+ while (input < end)
+ {
+ fom_mask = 0;
+ code = CVAL(input);
+ opcode = code >> 4;
+ /* Handle different opcode forms */
+ switch (opcode)
+ {
+ case 0xc:
+ case 0xd:
+ case 0xe:
+ opcode -= 6;
+ count = code & 0xf;
+ offset = 16;
+ break;
+ case 0xf:
+ opcode = code & 0xf;
+ if (opcode < 9)
+ {
+ count = CVAL(input);
+ count |= CVAL(input) << 8;
+ }
+ else
+ {
+ count = (opcode < 0xb) ? 8 : 1;
+ }
+ offset = 0;
+ break;
+ default:
+ opcode >>= 1;
+ count = code & 0x1f;
+ offset = 32;
+ break;
+ }
+ /* Handle strange cases for counts */
+ if (offset != 0)
+ {
+ isfillormix = ((opcode == 2) || (opcode == 7));
+ if (count == 0)
+ {
+ if (isfillormix)
+ count = CVAL(input) + 1;
+ else
+ count = CVAL(input) + offset;
+ }
+ else if (isfillormix)
+ {
+ count <<= 3;
+ }
+ }
+ /* Read preliminary data */
+ switch (opcode)
+ {
+ case 0: /* Fill */
+ if ((lastopcode == opcode) && !((x == width) && (prevline == NULL)))
+ insertmix = True;
+ break;
+ case 8: /* Bicolour */
+ colour1 = CVAL(input);
+ case 3: /* Colour */
+ colour2 = CVAL(input);
+ break;
+ case 6: /* SetMix/Mix */
+ case 7: /* SetMix/FillOrMix */
+ mix = CVAL(input);
+ opcode -= 5;
+ break;
+ case 9: /* FillOrMix_1 */
+ mask = 0x03;
+ opcode = 0x02;
+ fom_mask = 3;
+ break;
+ case 0x0a: /* FillOrMix_2 */
+ mask = 0x05;
+ opcode = 0x02;
+ fom_mask = 5;
+ break;
+ }
+ lastopcode = opcode;
+ mixmask = 0;
+ /* Output body */
+ while (count > 0)
+ {
+ if (x >= width)
+ {
+#if 0
+ if (height <= 0)
+#else
+ if (y >= height)
+#endif
+ return False;
+ x = 0;
+
+#if 0
+ height--;
+#else
+ y ++;
+#endif
+
+ prevline = line;
+
+#if 0
+ line = output + height * width;
+#else
+ line = output + y * width;
+#endif
+ }
+ switch (opcode)
+ {
+ case 0: /* Fill */
+ if (insertmix)
+ {
+ if (prevline == NULL)
+ line[x] = mix;
+ else
+ line[x] = prevline[x] ^ mix;
+ insertmix = False;
+ count--;
+ x++;
+ }
+ if (prevline == NULL)
+ {
+ REPEAT(line[x] = 0)
+ }
+ else
+ {
+ REPEAT(line[x] = prevline[x])
+ }
+ break;
+ case 1: /* Mix */
+ if (prevline == NULL)
+ {
+ REPEAT(line[x] = mix)
+ }
+ else
+ {
+ REPEAT(line[x] = prevline[x] ^ mix)
+ }
+ break;
+ case 2: /* Fill or Mix */
+ if (prevline == NULL)
+ {
+ REPEAT
+ (
+ MASK_UPDATE();
+ if (mask & mixmask)
+ line[x] = mix;
+ else
+ line[x] = 0;
+ )
+ }
+ else
+ {
+ REPEAT
+ (
+ MASK_UPDATE();
+ if (mask & mixmask)
+ line[x] = prevline[x] ^ mix;
+ else
+ line[x] = prevline[x];
+ )
+ }
+ break;
+ case 3: /* Colour */
+ REPEAT(line[x] = colour2)
+ break;
+ case 4: /* Copy */
+ REPEAT(line[x] = CVAL(input))
+ break;
+ case 8: /* Bicolour */
+ REPEAT
+ (
+ if (bicolour)
+ {
+ line[x] = colour2;
+ bicolour = False;
+ }
+ else
+ {
+ line[x] = colour1;
+ bicolour = True; count++;
+ }
+ )
+ break;
+ case 0xd: /* White */
+ REPEAT(line[x] = 0xff)
+ break;
+ case 0xe: /* Black */
+ REPEAT(line[x] = 0)
+ break;
+ default:
+ unimpl("bitmap opcode 0x%x\n", opcode);
+ return False;
+ }
+ }
+ }
+ return True;
+}
+
+/* 2 byte bitmap decompress */
+static BOOL
+bitmap_decompress2(uint8 * output, int width, int height, uint8 * input, int size)
+{
+ uint8 *end = input + size;
+ uint16 *prevline = NULL;
+ int opcode, count, offset, isfillormix;
+ int lastopcode = -1, insertmix = False, bicolour = False;
+ uint8 code;
+ uint16 colour1 = 0, colour2 = 0;
+ uint8 mixmask, mask = 0;
+ uint16 mix = 0xffff;
+ int fom_mask = 0;
+#if 0
+ uint8 *line = NULL;
+ int x = width;
+#else
+ uint8 *line = output;
+ int x = 0;
+ int y = 0;
+#endif
+
+ while (input < end)
+ {
+ fom_mask = 0;
+ code = CVAL(input);
+ opcode = code >> 4;
+ /* Handle different opcode forms */
+ switch (opcode)
+ {
+ case 0xc:
+ case 0xd:
+ case 0xe:
+ opcode -= 6;
+ count = code & 0xf;
+ offset = 16;
+ break;
+ case 0xf:
+ opcode = code & 0xf;
+ if (opcode < 9)
+ {
+ count = CVAL(input);
+ count |= CVAL(input) << 8;
+ }
+ else
+ {
+ count = (opcode < 0xb) ? 8 : 1;
+ }
+ offset = 0;
+ break;
+ default:
+ opcode >>= 1;
+ count = code & 0x1f;
+ offset = 32;
+ break;
+ }
+ /* Handle strange cases for counts */
+ if (offset != 0)
+ {
+ isfillormix = ((opcode == 2) || (opcode == 7));
+ if (count == 0)
+ {
+ if (isfillormix)
+ count = CVAL(input) + 1;
+ else
+ count = CVAL(input) + offset;
+ }
+ else if (isfillormix)
+ {
+ count <<= 3;
+ }
+ }
+ /* Read preliminary data */
+ switch (opcode)
+ {
+ case 0: /* Fill */
+ if ((lastopcode == opcode) && !((x == width) && (prevline == NULL)))
+ insertmix = True;
+ break;
+ case 8: /* Bicolour */
+ CVAL2(input, colour1);
+ case 3: /* Colour */
+ CVAL2(input, colour2);
+ break;
+ case 6: /* SetMix/Mix */
+ case 7: /* SetMix/FillOrMix */
+ CVAL2(input, mix);
+ opcode -= 5;
+ break;
+ case 9: /* FillOrMix_1 */
+ mask = 0x03;
+ opcode = 0x02;
+ fom_mask = 3;
+ break;
+ case 0x0a: /* FillOrMix_2 */
+ mask = 0x05;
+ opcode = 0x02;
+ fom_mask = 5;
+ break;
+ }
+ lastopcode = opcode;
+ mixmask = 0;
+ /* Output body */
+ while (count > 0)
+ {
+ if (x >= width)
+ {
+#if 0
+ if (height <= 0)
+#else
+ if (y >= height)
+#endif
+ return False;
+ x = 0;
+
+#if 0
+ height--;
+#else
+ y ++;
+#endif
+
+ prevline = line;
+
+#if 0
+ line = ((uint16 *) output) + height * width;
+#else
+ line = ((uint16 *) output) + y * width;
+#endif
+ }
+ switch (opcode)
+ {
+ case 0: /* Fill */
+ if (insertmix)
+ {
+ if (prevline == NULL)
+ line[x] = mix;
+ else
+ line[x] = prevline[x] ^ mix;
+ insertmix = False;
+ count--;
+ x++;
+ }
+ if (prevline == NULL)
+ {
+ REPEAT(line[x] = 0)
+ }
+ else
+ {
+ REPEAT(line[x] = prevline[x])
+ }
+ break;
+ case 1: /* Mix */
+ if (prevline == NULL)
+ {
+ REPEAT(line[x] = mix)
+ }
+ else
+ {
+ REPEAT(line[x] = prevline[x] ^ mix)
+ }
+ break;
+ case 2: /* Fill or Mix */
+ if (prevline == NULL)
+ {
+ REPEAT
+ (
+ MASK_UPDATE();
+ if (mask & mixmask)
+ line[x] = mix;
+ else
+ line[x] = 0;
+ )
+ }
+ else
+ {
+ REPEAT
+ (
+ MASK_UPDATE();
+ if (mask & mixmask)
+ line[x] = prevline[x] ^ mix;
+ else
+ line[x] = prevline[x];
+ )
+ }
+ break;
+ case 3: /* Colour */
+ REPEAT(line[x] = colour2)
+ break;
+ case 4: /* Copy */
+ REPEAT(CVAL2(input, line[x]))
+ break;
+ case 8: /* Bicolour */
+ REPEAT
+ (
+ if (bicolour)
+ {
+ line[x] = colour2;
+ bicolour = False;
+ }
+ else
+ {
+ line[x] = colour1;
+ bicolour = True;
+ count++;
+ }
+ )
+ break;
+ case 0xd: /* White */
+ REPEAT(line[x] = 0xffff)
+ break;
+ case 0xe: /* Black */
+ REPEAT(line[x] = 0)
+ break;
+ default:
+ unimpl("bitmap opcode 0x%x\n", opcode);
+ return False;
+ }
+ }
+ }
+ return True;
+}
+
+/* 3 byte bitmap decompress */
+static BOOL
+bitmap_decompress3(uint8 * output, int width, int height, uint8 * input, int size)
+{
+ uint8 *end = input + size;
+ uint8 *prevline = NULL;
+ int opcode, count, offset, isfillormix;
+ int lastopcode = -1, insertmix = False, bicolour = False;
+ uint8 code;
+ uint8 colour1[3] = {0, 0, 0}, colour2[3] = {0, 0, 0};
+ uint8 mixmask, mask = 0;
+ uint8 mix[3] = {0xff, 0xff, 0xff};
+ int fom_mask = 0;
+#if 0
+ uint8 *line = NULL;
+ int x = width;
+#else
+ uint8 *line = output;
+ int x = 0;
+ int y = 0;
+#endif
+
+ while (input < end)
+ {
+ fom_mask = 0;
+ code = CVAL(input);
+ opcode = code >> 4;
+ /* Handle different opcode forms */
+ switch (opcode)
+ {
+ case 0xc:
+ case 0xd:
+ case 0xe:
+ opcode -= 6;
+ count = code & 0xf;
+ offset = 16;
+ break;
+ case 0xf:
+ opcode = code & 0xf;
+ if (opcode < 9)
+ {
+ count = CVAL(input);
+ count |= CVAL(input) << 8;
+ }
+ else
+ {
+ count = (opcode <
+ 0xb) ? 8 : 1;
+ }
+ offset = 0;
+ break;
+ default:
+ opcode >>= 1;
+ count = code & 0x1f;
+ offset = 32;
+ break;
+ }
+ /* Handle strange cases for counts */
+ if (offset != 0)
+ {
+ isfillormix = ((opcode == 2) || (opcode == 7));
+ if (count == 0)
+ {
+ if (isfillormix)
+ count = CVAL(input) + 1;
+ else
+ count = CVAL(input) + offset;
+ }
+ else if (isfillormix)
+ {
+ count <<= 3;
+ }
+ }
+ /* Read preliminary data */
+ switch (opcode)
+ {
+ case 0: /* Fill */
+ if ((lastopcode == opcode) && !((x == width) && (prevline == NULL)))
+ insertmix = True;
+ break;
+ case 8: /* Bicolour */
+ colour1[0] = CVAL(input);
+ colour1[1] = CVAL(input);
+ colour1[2] = CVAL(input);
+ case 3: /* Colour */
+ colour2[0] = CVAL(input);
+ colour2[1] = CVAL(input);
+ colour2[2] = CVAL(input);
+ break;
+ case 6: /* SetMix/Mix */
+ case 7: /* SetMix/FillOrMix */
+ mix[0] = CVAL(input);
+ mix[1] = CVAL(input);
+ mix[2] = CVAL(input);
+ opcode -= 5;
+ break;
+ case 9: /* FillOrMix_1 */
+ mask = 0x03;
+ opcode = 0x02;
+ fom_mask = 3;
+ break;
+ case 0x0a: /* FillOrMix_2 */
+ mask = 0x05;
+ opcode = 0x02;
+ fom_mask = 5;
+ break;
+ }
+ lastopcode = opcode;
+ mixmask = 0;
+ /* Output body */
+ while (count > 0)
+ {
+ if (x >= width)
+ {
+#if 0
+ if (height <= 0)
+#else
+ if (y >= height)
+#endif
+ return False;
+ x = 0;
+
+#if 0
+ height--;
+#else
+ y ++;
+#endif
+
+ prevline = line;
+
+#if 0
+ line = output + height * (width * 3);
+#else
+ line = output + y * (width * 3);
+#endif
+ }
+ switch (opcode)
+ {
+ case 0: /* Fill */
+ if (insertmix)
+ {
+ if (prevline == NULL)
+ {
+ line[x * 3] = mix[0];
+ line[x * 3 + 1] = mix[1];
+ line[x * 3 + 2] = mix[2];
+ }
+ else
+ {
+ line[x * 3] =
+ prevline[x * 3] ^ mix[0];
+ line[x * 3 + 1] =
+ prevline[x * 3 + 1] ^ mix[1];
+ line[x * 3 + 2] =
+ prevline[x * 3 + 2] ^ mix[2];
+ }
+ insertmix = False;
+ count--;
+ x++;
+ }
+ if (prevline == NULL)
+ {
+ REPEAT
+ (
+ line[x * 3] = 0;
+ line[x * 3 + 1] = 0;
+ line[x * 3 + 2] = 0;
+ )
+ }
+ else
+ {
+ REPEAT
+ (
+ line[x * 3] = prevline[x * 3];
+ line[x * 3 + 1] = prevline[x * 3 + 1];
+ line[x * 3 + 2] = prevline[x * 3 + 2];
+ )
+ }
+ break;
+ case 1: /* Mix */
+ if (prevline == NULL)
+ {
+ REPEAT
+ (
+ line[x * 3] = mix[0];
+ line[x * 3 + 1] = mix[1];
+ line[x * 3 + 2] = mix[2];
+ )
+ }
+ else
+ {
+ REPEAT
+ (
+ line[x * 3] =
+ prevline[x * 3] ^ mix[0];
+ line[x * 3 + 1] =
+ prevline[x * 3 + 1] ^ mix[1];
+ line[x * 3 + 2] =
+ prevline[x * 3 + 2] ^ mix[2];
+ )
+ }
+ break;
+ case 2: /* Fill or Mix */
+ if (prevline == NULL)
+ {
+ REPEAT
+ (
+ MASK_UPDATE();
+ if (mask & mixmask)
+ {
+ line[x * 3] = mix[0];
+ line[x * 3 + 1] = mix[1];
+ line[x * 3 + 2] = mix[2];
+ }
+ else
+ {
+ line[x * 3] = 0;
+ line[x * 3 + 1] = 0;
+ line[x * 3 + 2] = 0;
+ }
+ )
+ }
+ else
+ {
+ REPEAT
+ (
+ MASK_UPDATE();
+ if (mask & mixmask)
+ {
+ line[x * 3] =
+ prevline[x * 3] ^ mix [0];
+ line[x * 3 + 1] =
+ prevline[x * 3 + 1] ^ mix [1];
+ line[x * 3 + 2] =
+ prevline[x * 3 + 2] ^ mix [2];
+ }
+ else
+ {
+ line[x * 3] =
+ prevline[x * 3];
+ line[x * 3 + 1] =
+ prevline[x * 3 + 1];
+ line[x * 3 + 2] =
+ prevline[x * 3 + 2];
+ }
+ )
+ }
+ break;
+ case 3: /* Colour */
+ REPEAT
+ (
+ line[x * 3] = colour2 [0];
+ line[x * 3 + 1] = colour2 [1];
+ line[x * 3 + 2] = colour2 [2];
+ )
+ break;
+ case 4: /* Copy */
+ REPEAT
+ (
+ line[x * 3] = CVAL(input);
+ line[x * 3 + 1] = CVAL(input);
+ line[x * 3 + 2] = CVAL(input);
+ )
+ break;
+ case 8: /* Bicolour */
+ REPEAT
+ (
+ if (bicolour)
+ {
+ line[x * 3] = colour2[0];
+ line[x * 3 + 1] = colour2[1];
+ line[x * 3 + 2] = colour2[2];
+ bicolour = False;
+ }
+ else
+ {
+ line[x * 3] = colour1[0];
+ line[x * 3 + 1] = colour1[1];
+ line[x * 3 + 2] = colour1[2];
+ bicolour = True;
+ count++;
+ }
+ )
+ break;
+ case 0xd: /* White */
+ REPEAT
+ (
+ line[x * 3] = 0xff;
+ line[x * 3 + 1] = 0xff;
+ line[x * 3 + 2] = 0xff;
+ )
+ break;
+ case 0xe: /* Black */
+ REPEAT
+ (
+ line[x * 3] = 0;
+ line[x * 3 + 1] = 0;
+ line[x * 3 + 2] = 0;
+ )
+ break;
+ default:
+ unimpl("bitmap opcode 0x%x\n", opcode);
+ return False;
+ }
+ }
+ }
+ return True;
+}
+
+#else
+
+static uint32
+cvalx(uint8 **input, int Bpp)
+{
+ uint32 rv = 0;
+ memcpy(&rv, *input, Bpp);
+ *input += Bpp;
+ return rv;
+}
+
+static void
+setli(uint8 *input, int offset, uint32 value, int Bpp)
+{
+ input += offset * Bpp;
+ memcpy(input, &value, Bpp);
+}
+
+static uint32
+getli(uint8 *input, int offset, int Bpp)
+{
+ uint32 rv = 0;
+ input += offset * Bpp;
+ memcpy(&rv, input, Bpp);
+ return rv;
+}
+
+static BOOL
+bitmap_decompressx(uint8 *output, int width, int height, uint8 *input, int size, int Bpp)
+{
+ uint8 *end = input + size;
+ uint8 *prevline = NULL;
+ int opcode, count, offset, isfillormix;
+ int lastopcode = -1, insertmix = False, bicolour = False;
+ uint8 code;
+ uint32 colour1 = 0, colour2 = 0;
+ uint8 mixmask, mask = 0;
+ uint32 mix = 0xffffffff;
+ int fom_mask = 0;
+#if 0
+ uint8 *line = NULL;
+ int x = width;
+#else
+ uint8 *line = output;
+ int x = 0;
+ int y = 0;
+#endif
+
+ while (input < end)
+ {
+ fom_mask = 0;
+ code = CVAL(input);
+ opcode = code >> 4;
+
+ /* Handle different opcode forms */
+ switch (opcode)
+ {
+ case 0xc:
+ case 0xd:
+ case 0xe:
+ opcode -= 6;
+ count = code & 0xf;
+ offset = 16;
+ break;
+
+ case 0xf:
+ opcode = code & 0xf;
+ if (opcode < 9)
+ {
+ count = CVAL(input);
+ count |= CVAL(input) << 8;
+ }
+ else
+ {
+ count = (opcode < 0xb) ? 8 : 1;
+ }
+ offset = 0;
+ break;
+
+ default:
+ opcode >>= 1;
+ count = code & 0x1f;
+ offset = 32;
+ break;
+ }
+
+ /* Handle strange cases for counts */
+ if (offset != 0)
+ {
+ isfillormix = ((opcode == 2) || (opcode == 7));
+
+ if (count == 0)
+ {
+ if (isfillormix)
+ count = CVAL(input) + 1;
+ else
+ count = CVAL(input) + offset;
+ }
+ else if (isfillormix)
+ {
+ count <<= 3;
+ }
+ }
+
+ /* Read preliminary data */
+ switch (opcode)
+ {
+ case 0: /* Fill */
+ if ((lastopcode == opcode) && !((x == width) && (prevline == NULL)))
+ insertmix = True;
+ break;
+ case 8: /* Bicolour */
+ colour1 = cvalx(&input, Bpp);
+ case 3: /* Colour */
+ colour2 = cvalx(&input, Bpp);
+ break;
+ case 6: /* SetMix/Mix */
+ case 7: /* SetMix/FillOrMix */
+ mix = cvalx(&input, Bpp);
+ opcode -= 5;
+ break;
+ case 9: /* FillOrMix_1 */
+ mask = 0x03;
+ opcode = 0x02;
+ fom_mask = 3;
+ break;
+ case 0x0a: /* FillOrMix_2 */
+ mask = 0x05;
+ opcode = 0x02;
+ fom_mask = 5;
+ break;
+
+ }
+
+ lastopcode = opcode;
+ mixmask = 0;
+
+ /* Output body */
+ while (count > 0)
+ {
+ if (x >= width)
+ {
+#if 0
+ if (height <= 0)
+#else
+ if (y >= height)
+#endif
+ return False;
+
+ x = 0;
+
+#if 0
+ height--;
+#else
+ y ++;
+#endif
+
+ prevline = line;
+
+#if 0
+ line = output + height * width * Bpp;
+#else
+ line = output + y * width * Bpp;
+#endif
+ }
+
+ switch (opcode)
+ {
+ case 0: /* Fill */
+ if (insertmix)
+ {
+ if (prevline == NULL)
+ setli(line, x, mix, Bpp);
+ else
+ setli(line, x,
+ getli(prevline, x, Bpp) ^ mix, Bpp);
+
+ insertmix = False;
+ count--;
+ x++;
+ }
+
+ if (prevline == NULL)
+ {
+ REPEAT(setli(line, x, 0, Bpp))}
+ else
+ {
+ REPEAT(setli
+ (line, x, getli(prevline, x, Bpp), Bpp));
+ }
+ break;
+
+ case 1: /* Mix */
+ if (prevline == NULL)
+ {
+ REPEAT(setli(line, x, mix, Bpp));
+ }
+ else
+ {
+ REPEAT(setli
+ (line, x, getli(prevline, x, Bpp) ^ mix,
+ Bpp));
+ }
+ break;
+
+ case 2: /* Fill or Mix */
+ if (prevline == NULL)
+ {
+ REPEAT(MASK_UPDATE();
+ if (mask & mixmask) setli(line, x, mix, Bpp);
+ else
+ setli(line, x, 0, Bpp););
+ }
+ else
+ {
+ REPEAT(MASK_UPDATE();
+ if (mask & mixmask)
+ setli(line, x, getli(prevline, x, Bpp) ^ mix,
+ Bpp);
+ else
+ setli(line, x, getli(prevline, x, Bpp),
+ Bpp););
+ }
+ break;
+
+ case 3: /* Colour */
+ REPEAT(setli(line, x, colour2, Bpp));
+ break;
+
+ case 4: /* Copy */
+ REPEAT(setli(line, x, cvalx(&input, Bpp), Bpp));
+ break;
+
+ case 8: /* Bicolour */
+ REPEAT(if (bicolour)
+ {
+ setli(line, x, colour2, Bpp); bicolour = False;}
+ else
+ {
+ setli(line, x, colour1, Bpp); bicolour = True;
+ count++;}
+ );
+ break;
+
+ case 0xd: /* White */
+ REPEAT(setli(line, x, 0xffffffff, Bpp));
+ break;
+
+ case 0xe: /* Black */
+ REPEAT(setli(line, x, 0, Bpp));
+ break;
+
+ default:
+ unimpl("bitmap opcode 0x%x\n", opcode);
+ return False;
+ }
+ }
+ }
+
+ return True;
+}
+
+#endif
+
+/* main decompress function */
+BOOL
+bitmap_decompress(uint8 * output, int width, int height, uint8 * input, int size, int Bpp)
+{
+#ifdef BITMAP_SPEED_OVER_SIZE
+ BOOL rv = False;
+ switch (Bpp)
+ {
+ case 1:
+ rv = bitmap_decompress1(output, width, height, input, size);
+ break;
+ case 2:
+ rv = bitmap_decompress2(output, width, height, input, size);
+ break;
+ case 3:
+ rv = bitmap_decompress3(output, width, height, input, size);
+ break;
+ }
+#else
+ BOOL rv;
+ rv = bitmap_decompressx(output, width, height, input, size, Bpp);
+#endif
+ return rv;
+}
+
+/* *INDENT-ON* */
--- /dev/null
+#!/bin/sh
+rm -rf autom4te.cache
+autoreconf -i
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Cache routines
+ Copyright (C) Matthew Chapman 1999-2005
+ Copyright (C) Jeroen Meijer 2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+#undef IS_SET // !!!FIXME!!!
+
+/* BITMAP CACHE */
+#define NUM_ELEMENTS(array) (sizeof(array) / sizeof(array[0]))
+#define IS_PERSISTENT(id) (This->pstcache_fd[id] > 0)
+#define TO_TOP -1
+#define NOT_SET -1
+#define IS_SET(idx) (idx >= 0)
+
+/*
+ * TODO: Test for optimal value of BUMP_COUNT. TO_TOP gives lowest cpu utilisation but using
+ * a positive value will hopefully result in less frequently used bitmaps having a greater chance
+ * of being evicted from the cache, and therby reducing the need to load bitmaps from disk.
+ * (Jeroen)
+ */
+#define BUMP_COUNT 40
+
+/* Setup the bitmap cache lru/mru linked list */
+void
+cache_rebuild_bmpcache_linked_list(RDPCLIENT * This, uint8 id, sint16 * idx, int count)
+{
+ int n = count, c = 0;
+ sint16 n_idx;
+
+ /* find top, skip evicted bitmaps */
+ while (--n >= 0 && This->cache.bmpcache[id][idx[n]].bitmap == NULL);
+ if (n < 0)
+ {
+ This->cache.bmpcache_mru[id] = This->cache.bmpcache_lru[id] = NOT_SET;
+ return;
+ }
+
+ This->cache.bmpcache_mru[id] = idx[n];
+ This->cache.bmpcache[id][idx[n]].next = NOT_SET;
+ n_idx = idx[n];
+ c++;
+
+ /* link list */
+ while (n >= 0)
+ {
+ /* skip evicted bitmaps */
+ while (--n >= 0 && This->cache.bmpcache[id][idx[n]].bitmap == NULL);
+
+ if (n < 0)
+ break;
+
+ This->cache.bmpcache[id][n_idx].previous = idx[n];
+ This->cache.bmpcache[id][idx[n]].next = n_idx;
+ n_idx = idx[n];
+ c++;
+ }
+
+ This->cache.bmpcache[id][n_idx].previous = NOT_SET;
+ This->cache.bmpcache_lru[id] = n_idx;
+
+ if (c != This->cache.bmpcache_count[id])
+ {
+ error("Oops. %d in bitmap cache linked list, %d in ui cache...\n", c,
+ This->cache.bmpcache_count[id]);
+ exit(1);
+ }
+}
+
+/* Move a bitmap to a new position in the linked list. */
+void
+cache_bump_bitmap(RDPCLIENT * This, uint8 id, uint16 idx, int bump)
+{
+ int p_idx, n_idx, n;
+
+ if (!IS_PERSISTENT(id))
+ return;
+
+ if (This->cache.bmpcache_mru[id] == idx)
+ return;
+
+ DEBUG_RDP5(("bump bitmap: id=%d, idx=%d, bump=%d\n", id, idx, bump));
+
+ n_idx = This->cache.bmpcache[id][idx].next;
+ p_idx = This->cache.bmpcache[id][idx].previous;
+
+ if (IS_SET(n_idx))
+ {
+ /* remove */
+ --This->cache.bmpcache_count[id];
+ if (IS_SET(p_idx))
+ This->cache.bmpcache[id][p_idx].next = n_idx;
+ else
+ This->cache.bmpcache_lru[id] = n_idx;
+ if (IS_SET(n_idx))
+ This->cache.bmpcache[id][n_idx].previous = p_idx;
+ else
+ This->cache.bmpcache_mru[id] = p_idx;
+ }
+ else
+ {
+ p_idx = NOT_SET;
+ n_idx = This->cache.bmpcache_lru[id];
+ }
+
+ if (bump >= 0)
+ {
+ for (n = 0; n < bump && IS_SET(n_idx); n++)
+ {
+ p_idx = n_idx;
+ n_idx = This->cache.bmpcache[id][p_idx].next;
+ }
+ }
+ else
+ {
+ p_idx = This->cache.bmpcache_mru[id];
+ n_idx = NOT_SET;
+ }
+
+ /* insert */
+ ++This->cache.bmpcache_count[id];
+ This->cache.bmpcache[id][idx].previous = p_idx;
+ This->cache.bmpcache[id][idx].next = n_idx;
+
+ if (p_idx >= 0)
+ This->cache.bmpcache[id][p_idx].next = idx;
+ else
+ This->cache.bmpcache_lru[id] = idx;
+
+ if (n_idx >= 0)
+ This->cache.bmpcache[id][n_idx].previous = idx;
+ else
+ This->cache.bmpcache_mru[id] = idx;
+}
+
+/* Evict the least-recently used bitmap from the cache */
+void
+cache_evict_bitmap(RDPCLIENT * This, uint8 id)
+{
+ uint16 idx;
+ int n_idx;
+
+ if (!IS_PERSISTENT(id))
+ return;
+
+ idx = This->cache.bmpcache_lru[id];
+ n_idx = This->cache.bmpcache[id][idx].next;
+ DEBUG_RDP5(("evict bitmap: id=%d idx=%d n_idx=%d bmp=0x%x\n", id, idx, n_idx,
+ This->cache.bmpcache[id][idx].bitmap));
+
+ ui_destroy_bitmap(This, This->cache.bmpcache[id][idx].bitmap);
+ --This->cache.bmpcache_count[id];
+ This->cache.bmpcache[id][idx].bitmap = 0;
+
+ This->cache.bmpcache_lru[id] = n_idx;
+ This->cache.bmpcache[id][n_idx].previous = NOT_SET;
+
+ pstcache_touch_bitmap(This, id, idx, 0);
+}
+
+/* Retrieve a bitmap from the cache */
+HBITMAP
+cache_get_bitmap(RDPCLIENT * This, uint8 id, uint16 idx)
+{
+ if ((id < NUM_ELEMENTS(This->cache.bmpcache)) && (idx < NUM_ELEMENTS(This->cache.bmpcache[0])))
+ {
+ if (This->cache.bmpcache[id][idx].bitmap || pstcache_load_bitmap(This, id, idx))
+ {
+ if (IS_PERSISTENT(id))
+ cache_bump_bitmap(This, id, idx, BUMP_COUNT);
+
+ return This->cache.bmpcache[id][idx].bitmap;
+ }
+ }
+ else if ((id < NUM_ELEMENTS(This->cache.volatile_bc)) && (idx == 0x7fff))
+ {
+ return This->cache.volatile_bc[id];
+ }
+
+ error("get bitmap %d:%d\n", id, idx);
+ return NULL;
+}
+
+/* Store a bitmap in the cache */
+void
+cache_put_bitmap(RDPCLIENT * This, uint8 id, uint16 idx, HBITMAP bitmap)
+{
+ HBITMAP old;
+
+ if ((id < NUM_ELEMENTS(This->cache.bmpcache)) && (idx < NUM_ELEMENTS(This->cache.bmpcache[0])))
+ {
+ old = This->cache.bmpcache[id][idx].bitmap;
+ if (old != NULL)
+ ui_destroy_bitmap(This, old);
+ This->cache.bmpcache[id][idx].bitmap = bitmap;
+
+ if (IS_PERSISTENT(id))
+ {
+ if (old == NULL)
+ This->cache.bmpcache[id][idx].previous = This->cache.bmpcache[id][idx].next = NOT_SET;
+
+ cache_bump_bitmap(This, id, idx, TO_TOP);
+ if (This->cache.bmpcache_count[id] > BMPCACHE2_C2_CELLS)
+ cache_evict_bitmap(This, id);
+ }
+ }
+ else if ((id < NUM_ELEMENTS(This->cache.volatile_bc)) && (idx == 0x7fff))
+ {
+ old = This->cache.volatile_bc[id];
+ if (old != NULL)
+ ui_destroy_bitmap(This, old);
+ This->cache.volatile_bc[id] = bitmap;
+ }
+ else
+ {
+ error("put bitmap %d:%d\n", id, idx);
+ }
+}
+
+/* Updates the persistent bitmap cache MRU information on exit */
+void
+cache_save_state(RDPCLIENT * This)
+{
+ uint32 id = 0, t = 0;
+ int idx;
+
+ for (id = 0; id < NUM_ELEMENTS(This->cache.bmpcache); id++)
+ if (IS_PERSISTENT(id))
+ {
+ DEBUG_RDP5(("Saving cache state for bitmap cache %d...", id));
+ idx = This->cache.bmpcache_lru[id];
+ while (idx >= 0)
+ {
+ pstcache_touch_bitmap(This, id, idx, ++t);
+ idx = This->cache.bmpcache[id][idx].next;
+ }
+ DEBUG_RDP5((" %d stamps written.\n", t));
+ }
+}
+
+
+/* FONT CACHE */
+/* Retrieve a glyph from the font cache */
+FONTGLYPH *
+cache_get_font(RDPCLIENT * This, uint8 font, uint16 character)
+{
+ FONTGLYPH *glyph;
+
+ if ((font < NUM_ELEMENTS(This->cache.fontcache)) && (character < NUM_ELEMENTS(This->cache.fontcache[0])))
+ {
+ glyph = &This->cache.fontcache[font][character];
+ if (glyph->pixmap != NULL)
+ return glyph;
+ }
+
+ error("get font %d:%d\n", font, character);
+ return NULL;
+}
+
+/* Store a glyph in the font cache */
+void
+cache_put_font(RDPCLIENT * This, uint8 font, uint16 character, uint16 offset,
+ uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap)
+{
+ FONTGLYPH *glyph;
+
+ if ((font < NUM_ELEMENTS(This->cache.fontcache)) && (character < NUM_ELEMENTS(This->cache.fontcache[0])))
+ {
+ glyph = &This->cache.fontcache[font][character];
+ if (glyph->pixmap != NULL)
+ ui_destroy_glyph(This, glyph->pixmap);
+
+ glyph->offset = offset;
+ glyph->baseline = baseline;
+ glyph->width = width;
+ glyph->height = height;
+ glyph->pixmap = pixmap;
+ }
+ else
+ {
+ error("put font %d:%d\n", font, character);
+ }
+}
+
+
+/* TEXT CACHE */
+/* Retrieve a text item from the cache */
+DATABLOB *
+cache_get_text(RDPCLIENT * This, uint8 cache_id)
+{
+ DATABLOB *text;
+
+ text = &This->cache.textcache[cache_id];
+ return text;
+}
+
+/* Store a text item in the cache */
+void
+cache_put_text(RDPCLIENT * This, uint8 cache_id, void *data, int length)
+{
+ DATABLOB *text;
+ void * p = malloc(length);
+
+ if(p == NULL)
+ return;
+
+ text = &This->cache.textcache[cache_id];
+ if (text->data != NULL)
+ free(text->data);
+ text->data = p;
+ text->size = length;
+ memcpy(text->data, data, length);
+}
+
+
+/* DESKTOP CACHE */
+/* Retrieve desktop data from the cache */
+uint8 *
+cache_get_desktop(RDPCLIENT * This, uint32 offset, int cx, int cy, int bytes_per_pixel)
+{
+ int length = cx * cy * bytes_per_pixel;
+
+ if (offset > sizeof(This->cache.deskcache))
+ offset = 0;
+
+ if ((offset + length) <= sizeof(This->cache.deskcache))
+ {
+ return &This->cache.deskcache[offset];
+ }
+
+ error("get desktop %d:%d\n", offset, length);
+ return NULL;
+}
+
+/* Store desktop data in the cache */
+void
+cache_put_desktop(RDPCLIENT * This, uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel, uint8 * data)
+{
+ int length = cx * cy * bytes_per_pixel;
+
+ if (offset > sizeof(This->cache.deskcache))
+ offset = 0;
+
+ if ((offset + length) <= sizeof(This->cache.deskcache))
+ {
+ cx *= bytes_per_pixel;
+ while (cy--)
+ {
+ memcpy(&This->cache.deskcache[offset], data, cx);
+ data += scanline;
+ offset += cx;
+ }
+ }
+ else
+ {
+ error("put desktop %d:%d\n", offset, length);
+ }
+}
+
+
+/* CURSOR CACHE */
+/* Retrieve cursor from cache */
+HCURSOR
+cache_get_cursor(RDPCLIENT * This, uint16 cache_idx)
+{
+ HCURSOR cursor;
+
+ if (cache_idx < NUM_ELEMENTS(This->cache.cursorcache))
+ {
+ cursor = This->cache.cursorcache[cache_idx];
+ if (cursor != NULL)
+ return cursor;
+ }
+
+ error("get cursor %d\n", cache_idx);
+ return NULL;
+}
+
+/* Store cursor in cache */
+void
+cache_put_cursor(RDPCLIENT * This, uint16 cache_idx, HCURSOR cursor)
+{
+ HCURSOR old;
+
+ if (cache_idx < NUM_ELEMENTS(This->cache.cursorcache))
+ {
+ old = This->cache.cursorcache[cache_idx];
+ if (old != NULL)
+ ui_destroy_cursor(This, old);
+
+ This->cache.cursorcache[cache_idx] = cursor;
+ }
+ else
+ {
+ error("put cursor %d\n", cache_idx);
+ }
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - Virtual channels
+ Copyright (C) Erik Forsberg <forsberg@cendio.se> 2003
+ Copyright (C) Matthew Chapman 2003-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+// FIXME: header mess
+#if 0
+#define CHANNEL_CHUNK_LENGTH 1600
+#define CHANNEL_FLAG_FIRST 0x01
+#define CHANNEL_FLAG_LAST 0x02
+#define CHANNEL_FLAG_SHOW_PROTOCOL 0x10
+#endif
+
+/* FIXME: We should use the information in TAG_SRV_CHANNELS to map RDP5
+ channels to MCS channels.
+
+ The format of TAG_SRV_CHANNELS seems to be
+
+ global_channel_no (uint16le)
+ number_of_other_channels (uint16le)
+ ..followed by uint16les for the other channels.
+*/
+
+VCHANNEL *
+channel_register(RDPCLIENT * This, char *name, uint32 flags, void (*callback) (RDPCLIENT *, STREAM))
+{
+ VCHANNEL *channel;
+
+ if (!This->use_rdp5)
+ return NULL;
+
+ if (This->num_channels >= MAX_CHANNELS)
+ {
+ error("Channel table full, increase MAX_CHANNELS\n");
+ return NULL;
+ }
+
+ channel = &This->channels[This->num_channels];
+ channel->mcs_id = MCS_GLOBAL_CHANNEL + 1 + This->num_channels;
+ strncpy(channel->name, name, 8);
+ channel->flags = flags;
+ channel->process = callback;
+ This->num_channels++;
+ return channel;
+}
+
+STREAM
+channel_init(RDPCLIENT * This, VCHANNEL * channel, uint32 length)
+{
+ STREAM s;
+
+ s = sec_init(This, This->encryption ? SEC_ENCRYPT : 0, length + 8);
+ s_push_layer(s, channel_hdr, 8);
+ return s;
+}
+
+void
+channel_send(RDPCLIENT * This, STREAM s, VCHANNEL * channel)
+{
+ uint32 length, flags;
+ uint32 thislength, remaining;
+ uint8 *data;
+
+ /* first fragment sent in-place */
+ s_pop_layer(s, channel_hdr);
+ length = s->end - s->p - sizeof(CHANNEL_PDU_HEADER);
+
+ DEBUG_CHANNEL(("channel_send, length = %d\n", length));
+
+ thislength = MIN(length, CHANNEL_CHUNK_LENGTH);
+/* Note: In the original clipboard implementation, this number was
+ 1592, not 1600. However, I don't remember the reason and 1600 seems
+ to work so.. This applies only to *this* length, not the length of
+ continuation or ending packets. */
+ remaining = length - thislength;
+ flags = (remaining == 0) ? CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST : CHANNEL_FLAG_FIRST;
+ if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL)
+ flags |= CHANNEL_FLAG_SHOW_PROTOCOL;
+
+ out_uint32_le(s, length);
+ out_uint32_le(s, flags);
+ data = s->end = s->p + thislength;
+ DEBUG_CHANNEL(("Sending %d bytes with FLAG_FIRST\n", thislength));
+ sec_send_to_channel(This, s, This->encryption ? SEC_ENCRYPT : 0, channel->mcs_id);
+
+ /* subsequent segments copied (otherwise would have to generate headers backwards) */
+ while (remaining > 0)
+ {
+ thislength = MIN(remaining, CHANNEL_CHUNK_LENGTH);
+ remaining -= thislength;
+ flags = (remaining == 0) ? CHANNEL_FLAG_LAST : 0;
+ if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL)
+ flags |= CHANNEL_FLAG_SHOW_PROTOCOL;
+
+ DEBUG_CHANNEL(("Sending %d bytes with flags %d\n", thislength, flags));
+
+ s = sec_init(This, This->encryption ? SEC_ENCRYPT : 0, thislength + 8);
+ out_uint32_le(s, length);
+ out_uint32_le(s, flags);
+ out_uint8p(s, data, thislength);
+ s_mark_end(s);
+ sec_send_to_channel(This, s, This->encryption ? SEC_ENCRYPT : 0, channel->mcs_id);
+
+ data += thislength;
+ }
+}
+
+void
+channel_process(RDPCLIENT * This, STREAM s, uint16 mcs_channel)
+{
+ uint32 length, flags;
+ uint32 thislength;
+ VCHANNEL *channel = NULL;
+ unsigned int i;
+ STREAM in;
+
+ for (i = 0; i < This->num_channels; i++)
+ {
+ channel = &This->channels[i];
+ if (channel->mcs_id == mcs_channel)
+ break;
+ }
+
+ if (i >= This->num_channels)
+ return;
+
+ in_uint32_le(s, length);
+ in_uint32_le(s, flags);
+ if ((flags & CHANNEL_FLAG_FIRST) && (flags & CHANNEL_FLAG_LAST))
+ {
+ /* single fragment - pass straight up */
+ channel->process(This, s);
+ }
+ else
+ {
+ /* add fragment to defragmentation buffer */
+ in = &channel->in;
+ if (flags & CHANNEL_FLAG_FIRST)
+ {
+ if (length > in->size)
+ {
+ in->data = (uint8 *) xrealloc(in->data, length);
+ in->size = length;
+ }
+ in->p = in->data;
+ }
+
+ thislength = MIN(s->end - s->p, in->data + in->size - in->p);
+ memcpy(in->p, s->p, thislength);
+ in->p += thislength;
+
+ if (flags & CHANNEL_FLAG_LAST)
+ {
+ in->end = in->p;
+ in->p = in->data;
+ channel->process(This, in);
+ }
+ }
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - Clipboard functions
+ Copyright (C) Erik Forsberg <forsberg@cendio.se> 2003
+ Copyright (C) Matthew Chapman 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+#define CLIPRDR_CONNECT 1
+#define CLIPRDR_FORMAT_ANNOUNCE 2
+#define CLIPRDR_FORMAT_ACK 3
+#define CLIPRDR_DATA_REQUEST 4
+#define CLIPRDR_DATA_RESPONSE 5
+
+#define CLIPRDR_REQUEST 0
+#define CLIPRDR_RESPONSE 1
+#define CLIPRDR_ERROR 2
+
+static void
+cliprdr_send_packet(RDPCLIENT * This, uint16 type, uint16 status, uint8 * data, uint32 length)
+{
+ STREAM s;
+
+ DEBUG_CLIPBOARD(("CLIPRDR send: type=%d, status=%d, length=%d\n", type, status, length));
+
+ s = channel_init(This, This->cliprdr.channel, length + 12);
+ out_uint16_le(s, type);
+ out_uint16_le(s, status);
+ out_uint32_le(s, length);
+ out_uint8p(s, data, length);
+ out_uint32(s, 0); /* pad? */
+ s_mark_end(s);
+ channel_send(This, s, This->cliprdr.channel);
+}
+
+/* Helper which announces our readiness to supply clipboard data
+ in a single format (such as CF_TEXT) to the RDP side.
+ To announce more than one format at a time, use
+ cliprdr_send_native_format_announce.
+ */
+void
+cliprdr_send_simple_native_format_announce(RDPCLIENT * This, uint32 format)
+{
+ uint8 buffer[36];
+
+ DEBUG_CLIPBOARD(("cliprdr_send_simple_native_format_announce\n"));
+
+ buf_out_uint32(buffer, format);
+ memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */
+ cliprdr_send_native_format_announce(This, buffer, sizeof(buffer));
+}
+
+/* Announces our readiness to supply clipboard data in multiple
+ formats, each denoted by a 36-byte format descriptor of
+ [ uint32 format + 32-byte description ].
+ */
+void
+cliprdr_send_native_format_announce(RDPCLIENT * This, uint8 * formats_data, uint32 formats_data_length)
+{
+ DEBUG_CLIPBOARD(("cliprdr_send_native_format_announce\n"));
+
+ cliprdr_send_packet(This, CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, formats_data,
+ formats_data_length);
+
+ if (formats_data != This->cliprdr.last_formats)
+ {
+ if (This->cliprdr.last_formats)
+ xfree(This->cliprdr.last_formats);
+
+ This->cliprdr.last_formats = xmalloc(formats_data_length);
+ memcpy(This->cliprdr.last_formats, formats_data, formats_data_length);
+ This->cliprdr.last_formats_length = formats_data_length;
+ }
+}
+
+void
+cliprdr_send_data_request(RDPCLIENT * This, uint32 format)
+{
+ uint8 buffer[4];
+
+ DEBUG_CLIPBOARD(("cliprdr_send_data_request\n"));
+ buf_out_uint32(buffer, format);
+ cliprdr_send_packet(This, CLIPRDR_DATA_REQUEST, CLIPRDR_REQUEST, buffer, sizeof(buffer));
+}
+
+void
+cliprdr_send_data(RDPCLIENT * This, uint8 * data, uint32 length)
+{
+ DEBUG_CLIPBOARD(("cliprdr_send_data\n"));
+ cliprdr_send_packet(This, CLIPRDR_DATA_RESPONSE, CLIPRDR_RESPONSE, data, length);
+}
+
+static void
+cliprdr_process(RDPCLIENT * This, STREAM s)
+{
+ uint16 type, status;
+ uint32 length, format;
+ uint8 *data;
+
+ in_uint16_le(s, type);
+ in_uint16_le(s, status);
+ in_uint32_le(s, length);
+ data = s->p;
+
+ DEBUG_CLIPBOARD(("CLIPRDR recv: type=%d, status=%d, length=%d\n", type, status, length));
+
+ if (status == CLIPRDR_ERROR)
+ {
+ switch (type)
+ {
+ case CLIPRDR_FORMAT_ACK:
+ /* FIXME: We seem to get this when we send an announce while the server is
+ still processing a paste. Try sending another announce. */
+ cliprdr_send_native_format_announce(This, This->cliprdr.last_formats,
+ This->cliprdr.last_formats_length);
+ break;
+ case CLIPRDR_DATA_RESPONSE:
+ ui_clip_request_failed(This);
+ break;
+ default:
+ DEBUG_CLIPBOARD(("CLIPRDR error (type=%d)\n", type));
+ }
+
+ return;
+ }
+
+ switch (type)
+ {
+ case CLIPRDR_CONNECT:
+ ui_clip_sync(This);
+ break;
+ case CLIPRDR_FORMAT_ANNOUNCE:
+ ui_clip_format_announce(This, data, length);
+ cliprdr_send_packet(This, CLIPRDR_FORMAT_ACK, CLIPRDR_RESPONSE, NULL, 0);
+ return;
+ case CLIPRDR_FORMAT_ACK:
+ break;
+ case CLIPRDR_DATA_REQUEST:
+ in_uint32_le(s, format);
+ ui_clip_request_data(This, format);
+ break;
+ case CLIPRDR_DATA_RESPONSE:
+ ui_clip_handle_data(This, data, length);
+ break;
+ case 7: /* TODO: W2K3 SP1 sends this on connect with a value of 1 */
+ break;
+ default:
+ unimpl("CLIPRDR packet type %d\n", type);
+ }
+}
+
+void
+cliprdr_set_mode(RDPCLIENT * This, const char *optarg)
+{
+ ui_clip_set_mode(This, optarg);
+}
+
+BOOL
+cliprdr_init(RDPCLIENT * This)
+{
+ This->cliprdr.channel =
+ channel_register(This, "cliprdr",
+ CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP |
+ CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL,
+ cliprdr_process);
+ return (This->cliprdr.channel != NULL);
+}
--- /dev/null
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-06-17'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+## for Red Hat Linux
+if test -f /etc/redhat-release ; then
+ VENDOR=redhat ;
+else
+ VENDOR= ;
+fi
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha*:OpenVMS:*:*)
+ echo alpha-hp-vms
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ *:UNICOS/mp:*:*)
+ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-${VENDOR:-unknown}-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-${VENDOR:-unknown}-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
+ exit 0 ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-${VENDOR:-unknown}-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
--- /dev/null
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-06-18'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | msp430 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | s390 | s390x \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | msp430-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | s390-* | s390x-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
--- /dev/null
+AC_INIT(rdesktop, 1.4.1)
+
+AC_CONFIG_SRCDIR([rdesktop.c])
+
+AC_PROG_CC
+if test "$GCC" = yes; then
+ CFLAGS="$CFLAGS -Wall"
+fi
+
+AC_PROG_INSTALL
+AC_LANG_C
+AC_HEADER_STDC
+AC_C_BIGENDIAN([AC_DEFINE(B_ENDIAN)], [AC_DEFINE(L_ENDIAN)])
+AC_PATH_XTRA
+
+AC_SEARCH_LIBS(socket, socket)
+AC_SEARCH_LIBS(inet_aton, resolv)
+
+AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))
+AC_CHECK_HEADER(sys/modem.h, AC_DEFINE(HAVE_SYS_MODEM_H))
+AC_CHECK_HEADER(sys/filio.h, AC_DEFINE(HAVE_SYS_FILIO_H))
+AC_CHECK_HEADER(sys/strtio.h, AC_DEFINE(HAVE_SYS_STRTIO_H))
+AC_CHECK_HEADER(locale.h, AC_DEFINE(HAVE_LOCALE_H))
+AC_CHECK_HEADER(langinfo.h, AC_DEFINE(HAVE_LANGINFO_H))
+
+AC_CHECK_TOOL(STRIP, strip, :)
+
+rpath=""
+
+#
+# OpenSSL detection borrowed from stunnel
+#
+checkssldir() { :
+ if test -f "$1/include/openssl/ssl.h"; then
+ ssldir="$1"
+ return 0
+ fi
+ return 1
+}
+AC_MSG_CHECKING([for OpenSSL directory])
+AC_ARG_WITH(openssl,
+ [ --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib],
+ [
+ dnl Check the specified location only
+ checkssldir "$withval"
+ ],
+ [
+ dnl Search default locations of OpenSSL library
+ for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do
+ for dir in $maindir $maindir/openssl $maindir/ssl; do
+ checkssldir $dir && break 2
+ done
+ done
+ ]
+)
+if test -z "$ssldir"; then
+ AC_MSG_RESULT([Not found])
+ echo
+ echo "Couldn't find your OpenSSL library installation dir"
+ echo "Use --with-openssl option to fix this problem"
+ echo
+ exit 1
+fi
+AC_MSG_RESULT([$ssldir])
+AC_SUBST(ssldir)
+AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
+
+dnl Add OpenSSL includes and libraries
+CFLAGS="$CFLAGS -I$ssldir/include"
+AC_ARG_ENABLE(static-openssl,
+ [ --enable-static-openssl link OpenSSL statically],
+ [
+LIBS="$LIBS $ssldir/lib/libcrypto.a"
+ ],
+ [
+LIBS="$LIBS -L$ssldir/lib -lcrypto"
+rpath="$rpath:$ssldir/lib"
+ ])
+
+
+#
+# Alignment
+#
+AC_MSG_CHECKING([if architecture needs alignment])
+AC_TRY_RUN([
+#include <stdlib.h>
+#include <signal.h>
+int main(int argc, char **argv)
+{
+ unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 };
+ signal(SIGBUS, exit);
+ signal(SIGABRT, exit);
+ signal(SIGSEGV, exit);
+ if (*((unsigned int *)(test + 1)) != 0x55443322 && *((unsigned int *)(test + 1)) != 0x22334455) {
+ return 1;
+ }
+ return 0;
+}],
+ [AC_MSG_RESULT(no)],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(NEED_ALIGN)],
+ [AC_MSG_RESULT(assuming yes)
+ AC_DEFINE(NEED_ALIGN)])
+
+
+#
+# EGD
+#
+AC_ARG_WITH(egd-socket,
+ [ --with-egd-socket=PATH look for Entropy Gathering Daemon socket at PATH],
+ [EGD_SOCKET="$withval"],
+ [EGD_SOCKET="/var/run/egd-pool"]
+)
+AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
+
+
+#
+# rdp2vnc
+#
+vncserverconfig=libvncserver-config
+AC_ARG_WITH(libvncserver-config,
+ [ --with-libvncserver-config=CMD use CMD as libvncserver-config],
+ [vncserverconfig="$withval"]
+)
+AC_ARG_WITH(libvncserver,
+ [ --with-libvncserver make rdp2vnc],
+ [
+ VNCINC=`$vncserverconfig --cflags`
+ AC_SUBST(VNCINC)
+ LDVNC=`$vncserverconfig --libs`
+ AC_SUBST(LDVNC)
+ VNCLINK=`$vncserverconfig --link`
+ AC_SUBST(VNCLINK)
+ RDP2VNCTARGET="rdp2vnc"
+ AC_SUBST(RDP2VNCTARGET)
+ ]
+)
+
+#
+# sound
+#
+AC_ARG_WITH(libao,
+ [ --with-libao=DIR look for libao at DIR/include, DIR/lib],
+ [
+ CFLAGS="$CFLAGS -I$withval/include"
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LIBS="$LIBS -L$withval/lib"
+ rpath="$rpath:$withval/lib"
+ ]
+)
+
+sound="yes"
+AC_ARG_WITH(sound,
+ [ --with-sound select sound system ("oss", "sgi", "sun" or "libao") ],
+ [
+ sound="$withval"
+ ])
+if test "$sound" = yes; then
+ AC_CHECK_HEADER(ao/ao.h, [sound=libao])
+ AC_CHECK_HEADER(sys/soundcard.h, [sound=oss])
+ AC_CHECK_HEADER(dmedia/audio.h, [sound=sgi])
+ AC_CHECK_HEADER(sys/audioio.h, [sound=sun])
+fi
+if test "$sound" = no; then
+ break
+elif test "$sound" = oss; then
+ SOUNDOBJ="rdpsnd.o rdpsnd_oss.o"
+ AC_DEFINE(WITH_RDPSND)
+elif test "$sound" = sgi; then
+ SOUNDOBJ="rdpsnd.o rdpsnd_sgi.o"
+ LDFLAGS="$LDFLAGS -laudio"
+ AC_DEFINE(WITH_RDPSND)
+elif test "$sound" = sun; then
+ SOUNDOBJ="rdpsnd.o rdpsnd_sun.o"
+ AC_DEFINE(WITH_RDPSND)
+elif test "$sound" = libao; then
+ SOUNDOBJ="rdpsnd.o rdpsnd_libao.o"
+ LDFLAGS="$LDFLAGS -lao"
+ AC_DEFINE(WITH_RDPSND)
+else
+ AC_MSG_WARN([sound support disabled])
+ AC_MSG_WARN([Currently supported systems are Open Sound System (oss), SGI AL (sgi), Sun/BSD (sun) and libao])
+fi
+AC_SUBST(SOUNDOBJ)
+
+#
+# dirfd
+#
+dnl Find out how to get the file descriptor associated with an open DIR*.
+dnl From Jim Meyering
+
+AC_DEFUN([UTILS_FUNC_DIRFD],
+[
+
+ AC_HEADER_DIRENT
+ dirfd_headers='
+#if HAVE_DIRENT_H
+# include <dirent.h>
+#else /* not HAVE_DIRENT_H */
+# define dirent direct
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* HAVE_SYS_NDIR_H */
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* HAVE_SYS_DIR_H */
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif /* HAVE_NDIR_H */
+#endif /* HAVE_DIRENT_H */
+'
+ AC_CHECK_FUNCS(dirfd)
+ AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
+
+ AC_CACHE_CHECK([whether dirfd is a macro],
+ jm_cv_func_dirfd_macro,
+ [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
+#ifdef dirfd
+ dirent_header_defines_dirfd
+#endif],
+ jm_cv_func_dirfd_macro=yes,
+ jm_cv_func_dirfd_macro=no)])
+
+ # Use the replacement only if we have no function, macro,
+ # or declaration with that name.
+ if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
+ = no,no,no; then
+ AC_REPLACE_FUNCS([dirfd])
+ AC_CACHE_CHECK(
+ [how to get the file descriptor associated with an open DIR*],
+ gl_cv_sys_dir_fd_member_name,
+ [
+ dirfd_save_CFLAGS=$CFLAGS
+ for ac_expr in d_fd dd_fd; do
+
+ CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
+ AC_TRY_COMPILE(
+ [$dirfd_headers
+ ],
+ [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
+ dir_fd_found=yes
+ )
+ CFLAGS=$dirfd_save_CFLAGS
+ test "$dir_fd_found" = yes && break
+ done
+ test "$dir_fd_found" = yes || ac_expr=no_such_member
+
+ gl_cv_sys_dir_fd_member_name=$ac_expr
+ ]
+ )
+ if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
+ AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
+ $gl_cv_sys_dir_fd_member_name,
+ [the name of the file descriptor member of DIR])
+ fi
+ AH_VERBATIM(DIR_TO_FD,
+ [#ifdef DIR_FD_MEMBER_NAME
+# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
+#else
+# define DIR_TO_FD(Dir_p) -1
+#endif
+]
+ )
+ fi
+])
+
+UTILS_FUNC_DIRFD
+
+#
+# iconv
+#
+
+dnl This macros shamelessly stolen from
+dnl http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01398.html.
+dnl Written by Bruno Haible.
+
+AC_DEFUN([UTILS_FUNC_ICONV],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ AC_ARG_WITH([libiconv-prefix],
+[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
+ for dir in `echo "$withval" | tr : ' '`; do
+ if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
+ if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
+ done
+ ])
+ AC_CHECK_HEADER(iconv.h, AC_DEFINE(HAVE_ICONV_H))
+
+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_func_iconv=yes)
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS -liconv"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL(am_cv_proto_iconv, [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([$]{ac_t:-
+ }[$]am_cv_proto_iconv)
+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+ LIBICONV=
+ if test "$am_cv_lib_iconv" = yes; then
+ LIBICONV="-liconv"
+ fi
+ AC_SUBST(LIBICONV)
+])
+
+UTILS_FUNC_ICONV
+LIBS="$LIBS $LIBICONV"
+
+#
+# socklen_t
+# from curl
+
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc. So we
+dnl have to test to find something that will work.
+AC_DEFUN([TYPE_SOCKLEN_T],
+[
+ AC_CHECK_TYPE([socklen_t], ,[
+ AC_MSG_CHECKING([for socklen_t equivalent])
+ AC_CACHE_VAL([socklen_t_equiv],
+ [
+ # Systems have either "struct sockaddr *" or
+ # "void *" as the second argument to getpeername
+ socklen_t_equiv=
+ for arg2 in "struct sockaddr" void; do
+ for t in int size_t unsigned long "unsigned long"; do
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
+ int getpeername (int, $arg2 *, $t *);
+ ],[
+ $t len;
+ getpeername(0,0,&len);
+ ],[
+ socklen_t_equiv="$t"
+ break
+ ])
+ done
+ done
+
+ if test "x$socklen_t_equiv" = x; then
+ AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+ fi
+ ])
+ AC_MSG_RESULT($socklen_t_equiv)
+ AC_DEFINE_UNQUOTED(socklen_t, $socklen_t_equiv,
+ [type to use in place of socklen_t if not defined])],
+ [#include <sys/types.h>
+#include <sys/socket.h>])
+])
+
+TYPE_SOCKLEN_T
+
+#
+# statfs stuff
+#
+AC_CHECK_HEADERS(sys/vfs.h)
+AC_CHECK_HEADERS(sys/statvfs.h)
+AC_CHECK_HEADERS(sys/statfs.h)
+AC_CHECK_HEADERS(sys/param.h)
+
+mount_includes="\
+ $ac_includes_default
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ "
+
+AC_CHECK_HEADERS(sys/mount.h,,,[$mount_includes])
+
+#################################################
+# these tests are taken from the GNU fileutils package
+AC_CHECKING(how to get filesystem space usage)
+space=no
+
+# Test for statvfs64.
+if test $space = no; then
+ # SVR4
+ AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
+ [AC_TRY_RUN([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/statvfs.h>
+ main ()
+ {
+ struct statvfs64 fsd;
+ exit (statvfs64 (".", &fsd));
+ }],
+ fu_cv_sys_stat_statvfs64=yes,
+ fu_cv_sys_stat_statvfs64=no,
+ fu_cv_sys_stat_statvfs64=cross)])
+ if test $fu_cv_sys_stat_statvfs64 = yes; then
+ space=yes
+ AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
+ fi
+fi
+
+# Perform only the link test since it seems there are no variants of the
+# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
+# because that got a false positive on SCO OSR5. Adding the declaration
+# of a `struct statvfs' causes this test to fail (as it should) on such
+# systems. That system is reported to work fine with STAT_STATFS4 which
+# is what it gets when this test fails.
+if test $space = no; then
+ # SVR4
+ AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
+ [AC_TRY_LINK([#include <sys/types.h>
+#include <sys/statvfs.h>],
+ [struct statvfs fsd; statvfs (0, &fsd);],
+ fu_cv_sys_stat_statvfs=yes,
+ fu_cv_sys_stat_statvfs=no)])
+ if test $fu_cv_sys_stat_statvfs = yes; then
+ space=yes
+ AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
+ fi
+fi
+
+if test $space = no; then
+ # DEC Alpha running OSF/1
+ AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
+ AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
+ [AC_TRY_RUN([
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_fsize = 0;
+ exit (statfs (".", &fsd, sizeof (struct statfs)));
+ }],
+ fu_cv_sys_stat_statfs3_osf1=yes,
+ fu_cv_sys_stat_statfs3_osf1=no,
+ fu_cv_sys_stat_statfs3_osf1=no)])
+
+
+#C_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
+ if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
+ space=yes
+ AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
+ fi
+fi
+
+if test $space = no; then
+# AIX
+ AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
+member (AIX, 4.3BSD)])
+ AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
+ [AC_TRY_RUN([
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_bsize = 0;
+ exit (statfs (".", &fsd));
+ }],
+ fu_cv_sys_stat_statfs2_bsize=yes,
+ fu_cv_sys_stat_statfs2_bsize=no,
+ fu_cv_sys_stat_statfs2_bsize=no)])
+ AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
+ if test $fu_cv_sys_stat_statfs2_bsize = yes; then
+ space=yes
+ AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
+ fi
+fi
+
+if test $space = no; then
+# SVR3
+ AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
+ AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
+ [AC_TRY_RUN([#include <sys/types.h>
+#include <sys/statfs.h>
+ main ()
+ {
+ struct statfs fsd;
+ exit (statfs (".", &fsd, sizeof fsd, 0));
+ }],
+ fu_cv_sys_stat_statfs4=yes,
+ fu_cv_sys_stat_statfs4=no,
+ fu_cv_sys_stat_statfs4=no)])
+ AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
+ if test $fu_cv_sys_stat_statfs4 = yes; then
+ space=yes
+ AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
+ fi
+fi
+
+if test $space = no; then
+# 4.4BSD and NetBSD
+ AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
+member (4.4BSD and NetBSD)])
+ AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
+ [AC_TRY_RUN([#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_fsize = 0;
+ exit (statfs (".", &fsd));
+ }],
+ fu_cv_sys_stat_statfs2_fsize=yes,
+ fu_cv_sys_stat_statfs2_fsize=no,
+ fu_cv_sys_stat_statfs2_fsize=no)])
+ AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
+ if test $fu_cv_sys_stat_statfs2_fsize = yes; then
+ space=yes
+ AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
+ fi
+fi
+
+if test $space = no; then
+ # Ultrix
+ AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
+ AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
+ [AC_TRY_RUN([#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_FS_TYPES_H
+#include <sys/fs_types.h>
+#endif
+ main ()
+ {
+ struct fs_data fsd;
+ /* Ultrix's statfs returns 1 for success,
+ 0 for not mounted, -1 for failure. */
+ exit (statfs (".", &fsd) != 1);
+ }],
+ fu_cv_sys_stat_fs_data=yes,
+ fu_cv_sys_stat_fs_data=no,
+ fu_cv_sys_stat_fs_data=no)])
+ AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
+ if test $fu_cv_sys_stat_fs_data = yes; then
+ space=yes
+ AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
+ fi
+fi
+
+ statxfs_includes="\
+$ac_includes_default
+#if HAVE_SYS_STATVFS_H
+# include <sys/statvfs.h>
+#endif
+#if HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
+# if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
+/* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
+# include <sys/param.h>
+# include <sys/mount.h>
+# elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
+/* Ultrix 4.4 needs these for the declaration of struct statfs. */
+# include <netinet/in.h>
+# include <nfs/nfs_clnt.h>
+# include <nfs/vfs.h>
+# endif
+#endif
+"
+
+AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
+AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
+AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
+AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
+
+#
+# Large file support
+#
+AC_SYS_LARGEFILE
+
+#
+# mntent
+#
+AC_CHECK_HEADER(mntent.h, AC_DEFINE(HAVE_MNTENT_H))
+AC_CHECK_FUNCS(setmntent)
+
+#
+# IPv6
+#
+AC_ARG_WITH(ipv6,
+ [ --with-ipv6 enable IPv6-support],
+ [
+ if test $withval != "no";
+ then
+ AC_DEFINE(IPv6,1)
+ fi
+ ])
+
+
+#
+# debugging
+#
+AC_ARG_WITH(debug,
+ [ --with-debug enable protocol debugging output],
+ [
+ if test $withval != "no";
+ then
+ AC_DEFINE(WITH_DEBUG,1)
+ fi
+ ])
+
+AC_ARG_WITH(debug-kbd,
+ [ --with-debug-kbd enable debugging of keyboard handling],
+ [
+ if test $withval != "no";
+ then
+ AC_DEFINE(WITH_DEBUG_KBD,1)
+ fi
+ ])
+
+AC_ARG_WITH(debug-rdp5,
+ [ --with-debug-rdp5 enable debugging of RDP5 code],
+ [
+ if test $withval != "no";
+ then
+ AC_DEFINE(WITH_DEBUG_RDP5,1)
+ fi
+ ])
+
+AC_ARG_WITH(debug-clipboard,
+ [ --with-debug-clipboard enable debugging of clipboard code],
+ [
+ if test $withval != "no";
+ then
+ AC_DEFINE(WITH_DEBUG_CLIPBOARD,1)
+ fi
+ ])
+
+AC_ARG_WITH(debug-channel,
+ [ --with-debug-channel enable debugging of virtual channel code],
+ [
+ if test $withval != "no";
+ then
+ AC_DEFINE(WITH_DEBUG_CHANNEL,1)
+ fi
+ ])
+
+
+#
+# target-specific stuff
+#
+# strip leading colon from rpath
+rpath=`echo $rpath |sed 's/^://'`
+AC_CANONICAL_HOST
+case "$host" in
+*-*-solaris*)
+ LDFLAGS="$LDFLAGS -R$rpath"
+ ;;
+*-dec-osf*)
+ LDFLAGS="$LDFLAGS -Wl,-rpath,$rpath"
+ ;;
+*-*-hpux*)
+ CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
+ ;;
+*-*-irix6.5*)
+ LIBS="$LIBS -L$ssldir/lib32 -lcrypto"
+ CFLAGS="$CFLAGS -D__SGI_IRIX__"
+ ;;
+esac
+
+
+AC_OUTPUT(Makefile)
+
+dnl Local Variables:
+dnl comment-start: "dnl "
+dnl comment-end: ""
+dnl comment-start-skip: "\\bdnl\\b\\s *"
+dnl compile-command: "autoconf"
+dnl End:
--- /dev/null
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ Miscellaneous protocol constants
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+/* TCP port for Remote Desktop Protocol */
+#define TCP_PORT_RDP 3389
+
+#define DEFAULT_CODEPAGE "UTF-8"
+#define WINDOWS_CODEPAGE "UTF-16LE"
+
+/* ISO PDU codes */
+enum ISO_PDU_CODE
+{
+ ISO_PDU_CR = 0xE0, /* Connection Request */
+ ISO_PDU_CC = 0xD0, /* Connection Confirm */
+ ISO_PDU_DR = 0x80, /* Disconnect Request */
+ ISO_PDU_DT = 0xF0, /* Data */
+ ISO_PDU_ER = 0x70 /* Error */
+};
+
+/* MCS PDU codes */
+enum MCS_PDU_TYPE
+{
+ MCS_EDRQ = 1, /* Erect Domain Request */
+ MCS_DPUM = 8, /* Disconnect Provider Ultimatum */
+ MCS_AURQ = 10, /* Attach User Request */
+ MCS_AUCF = 11, /* Attach User Confirm */
+ MCS_CJRQ = 14, /* Channel Join Request */
+ MCS_CJCF = 15, /* Channel Join Confirm */
+ MCS_SDRQ = 25, /* Send Data Request */
+ MCS_SDIN = 26 /* Send Data Indication */
+};
+
+#define MCS_CONNECT_INITIAL 0x7f65
+#define MCS_CONNECT_RESPONSE 0x7f66
+
+#define BER_TAG_BOOLEAN 1
+#define BER_TAG_INTEGER 2
+#define BER_TAG_OCTET_STRING 4
+#define BER_TAG_RESULT 10
+#define MCS_TAG_DOMAIN_PARAMS 0x30
+
+#define MCS_GLOBAL_CHANNEL 1003
+#define MCS_USERCHANNEL_BASE 1001
+
+/* RDP secure transport constants */
+#define SEC_RANDOM_SIZE 32
+#define SEC_MODULUS_SIZE 64
+#define SEC_MAX_MODULUS_SIZE 256
+#define SEC_PADDING_SIZE 8
+#define SEC_EXPONENT_SIZE 4
+
+#define SEC_CLIENT_RANDOM 0x0001
+#define SEC_ENCRYPT 0x0008
+#define SEC_LOGON_INFO 0x0040
+#define SEC_LICENCE_NEG 0x0080
+#define SEC_REDIRECT_ENCRYPT 0x0C00
+
+#define SEC_TAG_SRV_INFO 0x0c01
+#define SEC_TAG_SRV_CRYPT 0x0c02
+#define SEC_TAG_SRV_CHANNELS 0x0c03
+
+#define SEC_TAG_CLI_INFO 0xc001
+#define SEC_TAG_CLI_CRYPT 0xc002
+#define SEC_TAG_CLI_CHANNELS 0xc003
+#define SEC_TAG_CLI_4 0xc004
+
+#define SEC_TAG_PUBKEY 0x0006
+#define SEC_TAG_KEYSIG 0x0008
+
+#define SEC_RSA_MAGIC 0x31415352 /* RSA1 */
+
+/* RDP licensing constants */
+#define LICENCE_TOKEN_SIZE 10
+#define LICENCE_HWID_SIZE 20
+#define LICENCE_SIGNATURE_SIZE 16
+
+#define LICENCE_TAG_DEMAND 0x01
+#define LICENCE_TAG_AUTHREQ 0x02
+#define LICENCE_TAG_ISSUE 0x03
+#define LICENCE_TAG_REISSUE 0x04
+#define LICENCE_TAG_PRESENT 0x12
+#define LICENCE_TAG_REQUEST 0x13
+#define LICENCE_TAG_AUTHRESP 0x15
+#define LICENCE_TAG_RESULT 0xff
+
+#define LICENCE_TAG_USER 0x000f
+#define LICENCE_TAG_HOST 0x0010
+
+/* RDP PDU codes */
+enum RDP_PDU_TYPE
+{
+ RDP_PDU_DEMAND_ACTIVE = 1,
+ RDP_PDU_CONFIRM_ACTIVE = 3,
+ RDP_PDU_REDIRECT = 4, /* MS Server 2003 Session Redirect */
+ RDP_PDU_DEACTIVATE = 6,
+ RDP_PDU_DATA = 7
+};
+
+enum RDP_DATA_PDU_TYPE
+{
+ RDP_DATA_PDU_UPDATE = 2,
+ RDP_DATA_PDU_CONTROL = 20,
+ RDP_DATA_PDU_POINTER = 27,
+ RDP_DATA_PDU_INPUT = 28,
+ RDP_DATA_PDU_SYNCHRONISE = 31,
+ RDP_DATA_PDU_BELL = 34,
+ RDP_DATA_PDU_CLIENT_WINDOW_STATUS = 35,
+ RDP_DATA_PDU_LOGON = 38,
+ RDP_DATA_PDU_FONT2 = 39,
+ RDP_DATA_PDU_KEYBOARD_INDICATORS = 41,
+ RDP_DATA_PDU_DISCONNECT = 47
+};
+
+enum RDP_CONTROL_PDU_TYPE
+{
+ RDP_CTL_REQUEST_CONTROL = 1,
+ RDP_CTL_GRANT_CONTROL = 2,
+ RDP_CTL_DETACH = 3,
+ RDP_CTL_COOPERATE = 4
+};
+
+enum RDP_UPDATE_PDU_TYPE
+{
+ RDP_UPDATE_ORDERS = 0,
+ RDP_UPDATE_BITMAP = 1,
+ RDP_UPDATE_PALETTE = 2,
+ RDP_UPDATE_SYNCHRONIZE = 3
+};
+
+enum RDP_POINTER_PDU_TYPE
+{
+ RDP_POINTER_SYSTEM = 1,
+ RDP_POINTER_MOVE = 3,
+ RDP_POINTER_COLOR = 6,
+ RDP_POINTER_CACHED = 7
+};
+
+enum RDP_SYSTEM_POINTER_TYPE
+{
+ RDP_NULL_POINTER = 0,
+ RDP_DEFAULT_POINTER = 0x7F00
+};
+
+enum RDP_INPUT_DEVICE
+{
+ RDP_INPUT_SYNCHRONIZE = 0,
+ RDP_INPUT_CODEPOINT = 1,
+ RDP_INPUT_VIRTKEY = 2,
+ RDP_INPUT_SCANCODE = 4,
+ RDP_INPUT_MOUSE = 0x8001
+};
+
+/* Device flags */
+#define KBD_FLAG_RIGHT 0x0001
+#define KBD_FLAG_EXT 0x0100
+#define KBD_FLAG_QUIET 0x1000
+#define KBD_FLAG_DOWN 0x4000
+#define KBD_FLAG_UP 0x8000
+
+/* These are for synchronization; not for keystrokes */
+#define KBD_FLAG_SCROLL 0x0001
+#define KBD_FLAG_NUMLOCK 0x0002
+#define KBD_FLAG_CAPITAL 0x0004
+
+/* See T.128 */
+#define RDP_KEYPRESS 0
+#define RDP_KEYRELEASE (KBD_FLAG_DOWN | KBD_FLAG_UP)
+
+#define MOUSE_FLAG_MOVE 0x0800
+#define MOUSE_FLAG_BUTTON1 0x1000
+#define MOUSE_FLAG_BUTTON2 0x2000
+#define MOUSE_FLAG_BUTTON3 0x4000
+#define MOUSE_FLAG_BUTTON4 0x0280
+#define MOUSE_FLAG_BUTTON5 0x0380
+#define MOUSE_FLAG_DOWN 0x8000
+
+/* Raster operation masks */
+#define ROP2_S(rop3) (rop3 & 0xf)
+#define ROP2_P(rop3) ((rop3 & 0x3) | ((rop3 & 0x30) >> 2))
+
+#define ROP2_COPY 0xc
+#define ROP2_XOR 0x6
+#define ROP2_AND 0x8
+#define ROP2_NXOR 0x9
+#define ROP2_OR 0xe
+
+#define MIX_TRANSPARENT 0
+#define MIX_OPAQUE 1
+
+#define TEXT2_VERTICAL 0x04
+#define TEXT2_IMPLICIT_X 0x20
+
+#define ALTERNATE 1
+#define WINDING 2
+
+/* RDP bitmap cache (version 2) constants */
+#define BMPCACHE2_C0_CELLS 0x78
+#define BMPCACHE2_C1_CELLS 0x78
+#define BMPCACHE2_C2_CELLS 0x150
+#define BMPCACHE2_NUM_PSTCELLS 0x9f6
+
+#define PDU_FLAG_FIRST 0x01
+#define PDU_FLAG_LAST 0x02
+
+/* RDP capabilities */
+#define RDP_CAPSET_GENERAL 1 /* Maps to generalCapabilitySet in T.128 page 138 */
+#define RDP_CAPLEN_GENERAL 0x18
+#define OS_MAJOR_TYPE_UNIX 4
+#define OS_MINOR_TYPE_XSERVER 7
+
+#define RDP_CAPSET_BITMAP 2
+#define RDP_CAPLEN_BITMAP 0x1C
+
+#define RDP_CAPSET_ORDER 3
+#define RDP_CAPLEN_ORDER 0x58
+#define ORDER_CAP_NEGOTIATE 2
+#define ORDER_CAP_NOSUPPORT 4
+
+#define RDP_CAPSET_BMPCACHE 4
+#define RDP_CAPLEN_BMPCACHE 0x28
+
+#define RDP_CAPSET_CONTROL 5
+#define RDP_CAPLEN_CONTROL 0x0C
+
+#define RDP_CAPSET_ACTIVATE 7
+#define RDP_CAPLEN_ACTIVATE 0x0C
+
+#define RDP_CAPSET_POINTER 8
+#define RDP_CAPLEN_POINTER 0x08
+
+#define RDP_CAPSET_SHARE 9
+#define RDP_CAPLEN_SHARE 0x08
+
+#define RDP_CAPSET_COLCACHE 10
+#define RDP_CAPLEN_COLCACHE 0x08
+
+#define RDP_CAPSET_BMPCACHE2 19
+#define RDP_CAPLEN_BMPCACHE2 0x28
+#define BMPCACHE2_FLAG_PERSIST ((uint32)1<<31)
+
+#define RDP_SOURCE "MSTSC"
+
+/* Logon flags */
+#define RDP_LOGON_AUTO 0x0008
+#define RDP_LOGON_NORMAL 0x0033
+#define RDP_LOGON_COMPRESSION 0x0080 /* mppc compression with 8kB histroy buffer */
+#define RDP_LOGON_BLOB 0x0100
+#define RDP_LOGON_COMPRESSION2 0x0200 /* rdp5 mppc compression with 64kB history buffer */
+#define RDP_LOGON_LEAVE_AUDIO 0x2000
+
+#define RDP5_DISABLE_NOTHING 0x00
+#define RDP5_NO_WALLPAPER 0x01
+#define RDP5_NO_FULLWINDOWDRAG 0x02
+#define RDP5_NO_MENUANIMATIONS 0x04
+#define RDP5_NO_THEMING 0x08
+#define RDP5_NO_CURSOR_SHADOW 0x20
+#define RDP5_NO_CURSORSETTINGS 0x40 /* disables cursor blinking */
+
+/* compression types */
+#define RDP_MPPC_BIG 0x01
+#define RDP_MPPC_COMPRESSED 0x20
+#define RDP_MPPC_RESET 0x40
+#define RDP_MPPC_FLUSH 0x80
+#define RDP_MPPC_DICT_SIZE 65536
+
+#define RDP5_COMPRESSED 0x80
+
+/* Keymap flags */
+#define MapRightShiftMask (1<<0)
+#define MapLeftShiftMask (1<<1)
+#define MapShiftMask (MapRightShiftMask | MapLeftShiftMask)
+
+#define MapRightAltMask (1<<2)
+#define MapLeftAltMask (1<<3)
+#define MapAltGrMask MapRightAltMask
+
+#define MapRightCtrlMask (1<<4)
+#define MapLeftCtrlMask (1<<5)
+#define MapCtrlMask (MapRightCtrlMask | MapLeftCtrlMask)
+
+#define MapRightWinMask (1<<6)
+#define MapLeftWinMask (1<<7)
+#define MapWinMask (MapRightWinMask | MapLeftWinMask)
+
+#define MapNumLockMask (1<<8)
+#define MapCapsLockMask (1<<9)
+
+#define MapLocalStateMask (1<<10)
+
+#define MapInhibitMask (1<<11)
+
+#define MASK_ADD_BITS(var, mask) (var |= mask)
+#define MASK_REMOVE_BITS(var, mask) (var &= ~mask)
+#define MASK_HAS_BITS(var, mask) ((var & mask)>0)
+#define MASK_CHANGE_BIT(var, mask, active) (var = ((var & ~mask) | (active ? mask : 0)))
+
+/* Clipboard constants, "borrowed" from GCC system headers in
+ the w32 cross compiler */
+
+#if 0
+#define CF_TEXT 1
+#define CF_BITMAP 2
+#define CF_METAFILEPICT 3
+#define CF_SYLK 4
+#define CF_DIF 5
+#define CF_TIFF 6
+#define CF_OEMTEXT 7
+#define CF_DIB 8
+#define CF_PALETTE 9
+#define CF_PENDATA 10
+#define CF_RIFF 11
+#define CF_WAVE 12
+#define CF_UNICODETEXT 13
+#define CF_ENHMETAFILE 14
+#define CF_HDROP 15
+#define CF_LOCALE 16
+#define CF_MAX 17
+#define CF_OWNERDISPLAY 128
+#define CF_DSPTEXT 129
+#define CF_DSPBITMAP 130
+#define CF_DSPMETAFILEPICT 131
+#define CF_DSPENHMETAFILE 142
+#define CF_PRIVATEFIRST 512
+#define CF_PRIVATELAST 767
+#define CF_GDIOBJFIRST 768
+#define CF_GDIOBJLAST 1023
+
+/* Sound format constants */
+#define WAVE_FORMAT_PCM 1
+#define WAVE_FORMAT_ADPCM 2
+#define WAVE_FORMAT_ALAW 6
+#define WAVE_FORMAT_MULAW 7
+
+/* Virtual channel options */
+#define CHANNEL_OPTION_INITIALIZED 0x80000000
+#define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000
+#define CHANNEL_OPTION_COMPRESS_RDP 0x00800000
+#define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000
+
+/* NT status codes for RDPDR */
+#define STATUS_SUCCESS 0x00000000
+#define STATUS_NOT_IMPLEMENTED 0x00000001
+#define STATUS_PENDING 0x00000103
+
+#define STATUS_NO_MORE_FILES 0x80000006
+#define STATUS_DEVICE_PAPER_EMPTY 0x8000000e
+#define STATUS_DEVICE_POWERED_OFF 0x8000000f
+#define STATUS_DEVICE_OFF_LINE 0x80000010
+#define STATUS_DEVICE_BUSY 0x80000011
+
+#define STATUS_INVALID_HANDLE 0xc0000008
+#define STATUS_INVALID_PARAMETER 0xc000000d
+#define STATUS_NO_SUCH_FILE 0xc000000f
+#define STATUS_INVALID_DEVICE_REQUEST 0xc0000010
+#define STATUS_ACCESS_DENIED 0xc0000022
+#define STATUS_OBJECT_NAME_COLLISION 0xc0000035
+#define STATUS_DISK_FULL 0xc000007f
+#define STATUS_FILE_IS_A_DIRECTORY 0xc00000ba
+#define STATUS_NOT_SUPPORTED 0xc00000bb
+#define STATUS_TIMEOUT 0xc0000102
+#define STATUS_NOTIFY_ENUM_DIR 0xc000010c
+#define STATUS_CANCELLED 0xc0000120
+
+/* RDPDR constants */
+#define RDPDR_MAX_DEVICES 0x10
+#define DEVICE_TYPE_SERIAL 0x01
+#define DEVICE_TYPE_PARALLEL 0x02
+#define DEVICE_TYPE_PRINTER 0x04
+#define DEVICE_TYPE_DISK 0x08
+#define DEVICE_TYPE_SCARD 0x20
+
+#define FILE_DIRECTORY_FILE 0x00000001
+#define FILE_NON_DIRECTORY_FILE 0x00000040
+#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
+#define FILE_DELETE_ON_CLOSE 0x00001000
+#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
+
+/* RDP5 disconnect PDU */
+#define exDiscReasonNoInfo 0x0000
+#define exDiscReasonAPIInitiatedDisconnect 0x0001
+#define exDiscReasonAPIInitiatedLogoff 0x0002
+#define exDiscReasonServerIdleTimeout 0x0003
+#define exDiscReasonServerLogonTimeout 0x0004
+#define exDiscReasonReplacedByOtherConnection 0x0005
+#define exDiscReasonOutOfMemory 0x0006
+#define exDiscReasonServerDeniedConnection 0x0007
+#define exDiscReasonServerDeniedConnectionFips 0x0008
+#define exDiscReasonLicenseInternal 0x0100
+#define exDiscReasonLicenseNoLicenseServer 0x0101
+#define exDiscReasonLicenseNoLicense 0x0102
+#define exDiscReasonLicenseErrClientMsg 0x0103
+#define exDiscReasonLicenseHwidDoesntMatchLicense 0x0104
+#define exDiscReasonLicenseErrClientLicense 0x0105
+#define exDiscReasonLicenseCantFinishProtocol 0x0106
+#define exDiscReasonLicenseClientEndedProtocol 0x0107
+#define exDiscReasonLicenseErrClientEncryption 0x0108
+#define exDiscReasonLicenseCantUpgradeLicense 0x0109
+#define exDiscReasonLicenseNoRemoteConnections 0x010a
+#endif
+
+#if 0
+/* SeamlessRDP constants */
+#define SEAMLESSRDP_NOTYETMAPPED -1
+#define SEAMLESSRDP_NORMAL 0
+#define SEAMLESSRDP_MINIMIZED 1
+#define SEAMLESSRDP_MAXIMIZED 2
+#define SEAMLESSRDP_POSITION_TIMER 200000
+
+#define SEAMLESSRDP_CREATE_MODAL 0x0001
+
+#define SEAMLESSRDP_HELLO_RECONNECT 0x0001
+#define SEAMLESSRDP_HELLO_HIDDEN 0x0002
+#endif
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Disk Redirection
+ Copyright (C) Jeroen Meijer 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "disk.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h> /* open, close */
+#include <dirent.h> /* opendir, closedir, readdir */
+#include <fnmatch.h>
+#include <errno.h> /* errno */
+#include <stdio.h>
+
+#include <utime.h>
+#include <time.h> /* ctime */
+
+#if (defined(HAVE_DIRFD) || (HAVE_DECL_DIRFD == 1))
+#define DIRFD(a) (dirfd(a))
+#else
+#define DIRFD(a) ((a)->DIR_FD_MEMBER_NAME)
+#endif
+
+/* TODO: Fix mntent-handling for solaris
+ * #include <sys/mntent.h> */
+#if (defined(HAVE_MNTENT_H) && defined(HAVE_SETMNTENT))
+#include <mntent.h>
+#define MNTENT_PATH "/etc/mtab"
+#define USE_SETMNTENT
+#endif
+
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+
+#include "rdesktop.h"
+
+#ifdef STAT_STATFS3_OSF1
+#define STATFS_FN(path, buf) (statfs(path,buf,sizeof(buf)))
+#define STATFS_T statfs
+#define USE_STATFS
+#endif
+
+#ifdef STAT_STATVFS
+#define STATFS_FN(path, buf) (statvfs(path,buf))
+#define STATFS_T statvfs
+#define USE_STATVFS
+#endif
+
+#ifdef STAT_STATVFS64
+#define STATFS_FN(path, buf) (statvfs64(path,buf))
+#define STATFS_T statvfs64
+#define USE_STATVFS
+#endif
+
+#if (defined(STAT_STATFS2_FS_DATA) || defined(STAT_STATFS2_BSIZE) || defined(STAT_STATFS2_FSIZE))
+#define STATFS_FN(path, buf) (statfs(path,buf))
+#define STATFS_T statfs
+#define USE_STATFS
+#endif
+
+#ifdef STAT_STATFS4
+#define STATFS_FN(path, buf) (statfs(path,buf,sizeof(buf),0))
+#define STATFS_T statfs
+#define USE_STATFS
+#endif
+
+#if ((defined(USE_STATFS) && defined(HAVE_STRUCT_STATFS_F_NAMEMAX)) || (defined(USE_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_NAMEMAX)))
+#define F_NAMELEN(buf) ((buf).f_namemax)
+#endif
+
+#if ((defined(USE_STATFS) && defined(HAVE_STRUCT_STATFS_F_NAMELEN)) || (defined(USE_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_NAMELEN)))
+#define F_NAMELEN(buf) ((buf).f_namelen)
+#endif
+
+#ifndef F_NAMELEN
+#define F_NAMELEN(buf) (255)
+#endif
+
+/* Dummy statfs fallback */
+#ifndef STATFS_T
+struct dummy_statfs_t
+{
+ long f_bfree;
+ long f_bsize;
+ long f_blocks;
+ int f_namelen;
+ int f_namemax;
+};
+
+static int
+dummy_statfs(struct dummy_statfs_t *buf)
+{
+ buf->f_blocks = 262144;
+ buf->f_bfree = 131072;
+ buf->f_bsize = 512;
+ buf->f_namelen = 255;
+ buf->f_namemax = 255;
+
+ return 0;
+}
+
+#define STATFS_T dummy_statfs_t
+#define STATFS_FN(path,buf) (dummy_statfs(buf))
+#endif
+
+typedef struct
+{
+ char name[PATH_MAX];
+ char label[PATH_MAX];
+ unsigned long serial;
+ char type[PATH_MAX];
+} FsInfoType;
+
+static NTSTATUS NotifyInfo(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, NOTIFY * p);
+
+static time_t
+get_create_time(struct stat *st)
+{
+ time_t ret, ret1;
+
+ ret = MIN(st->st_ctime, st->st_mtime);
+ ret1 = MIN(ret, st->st_atime);
+
+ if (ret1 != (time_t) 0)
+ return ret1;
+
+ return ret;
+}
+
+/* Convert seconds since 1970 to a filetime */
+static void
+seconds_since_1970_to_filetime(time_t seconds, uint32 * high, uint32 * low)
+{
+ unsigned long long ticks;
+
+ ticks = (seconds + 11644473600LL) * 10000000;
+ *low = (uint32) ticks;
+ *high = (uint32) (ticks >> 32);
+}
+
+/* Convert seconds since 1970 back to filetime */
+static time_t
+convert_1970_to_filetime(uint32 high, uint32 low)
+{
+ unsigned long long ticks;
+ time_t val;
+
+ ticks = low + (((unsigned long long) high) << 32);
+ ticks /= 10000000;
+ ticks -= 11644473600LL;
+
+ val = (time_t) ticks;
+ return (val);
+
+}
+
+/* A wrapper for ftruncate which supports growing files, even if the
+ native ftruncate doesn't. This is needed on Linux FAT filesystems,
+ for example. */
+static int
+ftruncate_growable(int fd, off_t length)
+{
+ int ret;
+ off_t pos;
+ static const char zero = 0;
+
+ /* Try the simple method first */
+ if ((ret = ftruncate(fd, length)) != -1)
+ {
+ return ret;
+ }
+
+ /*
+ * Some kind of error. Perhaps we were trying to grow. Retry
+ * in a safe way.
+ */
+
+ /* Get current position */
+ if ((pos = lseek(fd, 0, SEEK_CUR)) == -1)
+ {
+ perror("lseek");
+ return -1;
+ }
+
+ /* Seek to new size */
+ if (lseek(fd, length, SEEK_SET) == -1)
+ {
+ perror("lseek");
+ return -1;
+ }
+
+ /* Write a zero */
+ if (write(fd, &zero, 1) == -1)
+ {
+ perror("write");
+ return -1;
+ }
+
+ /* Truncate. This shouldn't fail. */
+ if (ftruncate(fd, length) == -1)
+ {
+ perror("ftruncate");
+ return -1;
+ }
+
+ /* Restore position */
+ if (lseek(fd, pos, SEEK_SET) == -1)
+ {
+ perror("lseek");
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Just like open(2), but if a open with O_EXCL fails, retry with
+ GUARDED semantics. This might be necessary because some filesystems
+ (such as NFS filesystems mounted from a unfsd server) doesn't
+ support O_EXCL. GUARDED semantics are subject to race conditions,
+ but we can live with that.
+*/
+static int
+open_weak_exclusive(const char *pathname, int flags, mode_t mode)
+{
+ int ret;
+ struct stat statbuf;
+
+ ret = open(pathname, flags, mode);
+ if (ret != -1 || !(flags & O_EXCL))
+ {
+ /* Success, or not using O_EXCL */
+ return ret;
+ }
+
+ /* An error occured, and we are using O_EXCL. In case the FS
+ doesn't support O_EXCL, some kind of error will be
+ returned. Unfortunately, we don't know which one. Linux
+ 2.6.8 seems to return 524, but I cannot find a documented
+ #define for this case. So, we'll return only on errors that
+ we know aren't related to O_EXCL. */
+ switch (errno)
+ {
+ case EACCES:
+ case EEXIST:
+ case EINTR:
+ case EISDIR:
+ case ELOOP:
+ case ENAMETOOLONG:
+ case ENOENT:
+ case ENOTDIR:
+ return ret;
+ }
+
+ /* Retry with GUARDED semantics */
+ if (stat(pathname, &statbuf) != -1)
+ {
+ /* File exists */
+ errno = EEXIST;
+ return -1;
+ }
+ else
+ {
+ return open(pathname, flags & ~O_EXCL, mode);
+ }
+}
+
+/* Enumeration of devices from rdesktop.c */
+/* returns numer of units found and initialized. */
+/* optarg looks like ':h=/mnt/floppy,b=/mnt/usbdevice1' */
+/* when it arrives to this function. */
+int
+disk_enum_devices(RDPCLIENT * This, uint32 * id, char *optarg)
+{
+ char *pos = optarg;
+ char *pos2;
+ int count = 0;
+
+ /* skip the first colon */
+ optarg++;
+ while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
+ {
+ pos2 = next_arg(optarg, '=');
+
+ strncpy(This->rdpdr_device[*id].name, optarg, sizeof(This->rdpdr_device[*id].name) - 1);
+ if (strlen(optarg) > (sizeof(This->rdpdr_device[*id].name) - 1))
+ fprintf(stderr, "share name %s truncated to %s\n", optarg,
+ This->rdpdr_device[*id].name);
+
+ This->rdpdr_device[*id].local_path = (char *) xmalloc(strlen(pos2) + 1);
+ strcpy(This->rdpdr_device[*id].local_path, pos2);
+ This->rdpdr_device[*id].device_type = DEVICE_TYPE_DISK;
+ count++;
+ (*id)++;
+
+ optarg = pos;
+ }
+ return count;
+}
+
+/* Opens or creates a file or directory */
+static NTSTATUS
+disk_create(RDPCLIENT * This, uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create_disposition,
+ uint32 flags_and_attributes, char *filename, NTHANDLE * phandle)
+{
+ NTHANDLE handle;
+ DIR *dirp;
+ int flags, mode;
+ char path[PATH_MAX];
+ struct stat filestat;
+
+ handle = 0;
+ dirp = NULL;
+ flags = 0;
+ mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
+
+ if (*filename && filename[strlen(filename) - 1] == '/')
+ filename[strlen(filename) - 1] = 0;
+ sprintf(path, "%s%s", This->rdpdr_device[device_id].local_path, filename);
+
+ switch (create_disposition)
+ {
+ case CREATE_ALWAYS:
+
+ /* Delete existing file/link. */
+ unlink(path);
+ flags |= O_CREAT;
+ break;
+
+ case CREATE_NEW:
+
+ /* If the file already exists, then fail. */
+ flags |= O_CREAT | O_EXCL;
+ break;
+
+ case OPEN_ALWAYS:
+
+ /* Create if not already exists. */
+ flags |= O_CREAT;
+ break;
+
+ case OPEN_EXISTING:
+
+ /* Default behaviour */
+ break;
+
+ case TRUNCATE_EXISTING:
+
+ /* If the file does not exist, then fail. */
+ flags |= O_TRUNC;
+ break;
+ }
+
+ /*printf("Open: \"%s\" flags: %X, accessmask: %X sharemode: %X create disp: %X\n", path, flags_and_attributes, accessmask, sharemode, create_disposition); */
+
+ /* Get information about file and set that flag ourselfs */
+ if ((stat(path, &filestat) == 0) && (S_ISDIR(filestat.st_mode)))
+ {
+ if (flags_and_attributes & FILE_NON_DIRECTORY_FILE)
+ return STATUS_FILE_IS_A_DIRECTORY;
+ else
+ flags_and_attributes |= FILE_DIRECTORY_FILE;
+ }
+
+ if (flags_and_attributes & FILE_DIRECTORY_FILE)
+ {
+ if (flags & O_CREAT)
+ {
+ mkdir(path, mode);
+ }
+
+ dirp = opendir(path);
+ if (!dirp)
+ {
+ switch (errno)
+ {
+ case EACCES:
+
+ return STATUS_ACCESS_DENIED;
+
+ case ENOENT:
+
+ return STATUS_NO_SUCH_FILE;
+
+ default:
+
+ perror("opendir");
+ return STATUS_NO_SUCH_FILE;
+ }
+ }
+ handle = DIRFD(dirp);
+ }
+ else
+ {
+
+ if (accessmask & GENERIC_ALL
+ || (accessmask & GENERIC_READ && accessmask & GENERIC_WRITE))
+ {
+ flags |= O_RDWR;
+ }
+ else if ((accessmask & GENERIC_WRITE) && !(accessmask & GENERIC_READ))
+ {
+ flags |= O_WRONLY;
+ }
+ else
+ {
+ flags |= O_RDONLY;
+ }
+
+ handle = open_weak_exclusive(path, flags, mode);
+ if (handle == -1)
+ {
+ switch (errno)
+ {
+ case EISDIR:
+
+ return STATUS_FILE_IS_A_DIRECTORY;
+
+ case EACCES:
+
+ return STATUS_ACCESS_DENIED;
+
+ case ENOENT:
+
+ return STATUS_NO_SUCH_FILE;
+ case EEXIST:
+
+ return STATUS_OBJECT_NAME_COLLISION;
+ default:
+
+ perror("open");
+ return STATUS_NO_SUCH_FILE;
+ }
+ }
+
+ /* all read and writes of files should be non blocking */
+ if (fcntl(handle, F_SETFL, O_NONBLOCK) == -1)
+ perror("fcntl");
+ }
+
+ if (handle >= MAX_OPEN_FILES)
+ {
+ error("Maximum number of open files (%s) reached. Increase MAX_OPEN_FILES!\n",
+ handle);
+ exit(1);
+ }
+
+ if (dirp)
+ This->fileinfo[handle].pdir = dirp;
+ else
+ This->fileinfo[handle].pdir = NULL;
+
+ This->fileinfo[handle].device_id = device_id;
+ This->fileinfo[handle].flags_and_attributes = flags_and_attributes;
+ This->fileinfo[handle].accessmask = accessmask;
+ strncpy(This->fileinfo[handle].path, path, PATH_MAX - 1);
+ This->fileinfo[handle].delete_on_close = False;
+ This->notify_stamp = True;
+
+ *phandle = handle;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+disk_close(RDPCLIENT * This, NTHANDLE handle)
+{
+ struct fileinfo *pfinfo;
+
+ pfinfo = &(This->fileinfo[handle]);
+
+ This->notify_stamp = True;
+
+ rdpdr_abort_io(This, handle, 0, STATUS_CANCELLED);
+
+ if (pfinfo->pdir)
+ {
+ if (closedir(pfinfo->pdir) < 0)
+ {
+ perror("closedir");
+ return STATUS_INVALID_HANDLE;
+ }
+
+ if (pfinfo->delete_on_close)
+ if (rmdir(pfinfo->path) < 0)
+ {
+ perror(pfinfo->path);
+ return STATUS_ACCESS_DENIED;
+ }
+ pfinfo->delete_on_close = False;
+ }
+ else
+ {
+ if (close(handle) < 0)
+ {
+ perror("close");
+ return STATUS_INVALID_HANDLE;
+ }
+ if (pfinfo->delete_on_close)
+ if (unlink(pfinfo->path) < 0)
+ {
+ perror(pfinfo->path);
+ return STATUS_ACCESS_DENIED;
+ }
+
+ pfinfo->delete_on_close = False;
+ }
+
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+disk_read(RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
+{
+ int n;
+
+#if 0
+ /* browsing dir ???? */
+ /* each request is 24 bytes */
+ if (This->fileinfo[handle].flags_and_attributes & FILE_DIRECTORY_FILE)
+ {
+ *result = 0;
+ return STATUS_SUCCESS;
+ }
+#endif
+
+ lseek(handle, offset, SEEK_SET);
+
+ n = read(handle, data, length);
+
+ if (n < 0)
+ {
+ *result = 0;
+ switch (errno)
+ {
+ case EISDIR:
+ /* Implement 24 Byte directory read ??
+ with STATUS_NOT_IMPLEMENTED server doesn't read again */
+ /* return STATUS_FILE_IS_A_DIRECTORY; */
+ return STATUS_NOT_IMPLEMENTED;
+ default:
+ perror("read");
+ return STATUS_INVALID_PARAMETER;
+ }
+ }
+
+ *result = n;
+
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+disk_write(RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
+{
+ int n;
+
+ lseek(handle, offset, SEEK_SET);
+
+ n = write(handle, data, length);
+
+ if (n < 0)
+ {
+ perror("write");
+ *result = 0;
+ switch (errno)
+ {
+ case ENOSPC:
+ return STATUS_DISK_FULL;
+ default:
+ return STATUS_ACCESS_DENIED;
+ }
+ }
+
+ *result = n;
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+disk_query_information(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, STREAM out)
+{
+ uint32 file_attributes, ft_high, ft_low;
+ struct stat filestat;
+ char *path, *filename;
+
+ path = This->fileinfo[handle].path;
+
+ /* Get information about file */
+ if (fstat(handle, &filestat) != 0)
+ {
+ perror("stat");
+ out_uint8(out, 0);
+ return STATUS_ACCESS_DENIED;
+ }
+
+ /* Set file attributes */
+ file_attributes = 0;
+ if (S_ISDIR(filestat.st_mode))
+ file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
+
+ filename = 1 + strrchr(path, '/');
+ if (filename && filename[0] == '.')
+ file_attributes |= FILE_ATTRIBUTE_HIDDEN;
+
+ if (!file_attributes)
+ file_attributes |= FILE_ATTRIBUTE_NORMAL;
+
+ if (!(filestat.st_mode & S_IWUSR))
+ file_attributes |= FILE_ATTRIBUTE_READONLY;
+
+ /* Return requested data */
+ switch (info_class)
+ {
+ case FileBasicInformation:
+ seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high,
+ &ft_low);
+ out_uint32_le(out, ft_low); /* create_access_time */
+ out_uint32_le(out, ft_high);
+
+ seconds_since_1970_to_filetime(filestat.st_atime, &ft_high, &ft_low);
+ out_uint32_le(out, ft_low); /* last_access_time */
+ out_uint32_le(out, ft_high);
+
+ seconds_since_1970_to_filetime(filestat.st_mtime, &ft_high, &ft_low);
+ out_uint32_le(out, ft_low); /* last_write_time */
+ out_uint32_le(out, ft_high);
+
+ seconds_since_1970_to_filetime(filestat.st_ctime, &ft_high, &ft_low);
+ out_uint32_le(out, ft_low); /* last_change_time */
+ out_uint32_le(out, ft_high);
+
+ out_uint32_le(out, file_attributes);
+ break;
+
+ case FileStandardInformation:
+
+ out_uint32_le(out, filestat.st_size); /* Allocation size */
+ out_uint32_le(out, 0);
+ out_uint32_le(out, filestat.st_size); /* End of file */
+ out_uint32_le(out, 0);
+ out_uint32_le(out, filestat.st_nlink); /* Number of links */
+ out_uint8(out, 0); /* Delete pending */
+ out_uint8(out, S_ISDIR(filestat.st_mode) ? 1 : 0); /* Directory */
+ break;
+
+ case FileObjectIdInformation:
+
+ out_uint32_le(out, file_attributes); /* File Attributes */
+ out_uint32_le(out, 0); /* Reparse Tag */
+ break;
+
+ default:
+
+ unimpl("IRP Query (File) Information class: 0x%x\n", info_class);
+ return STATUS_INVALID_PARAMETER;
+ }
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+disk_set_information(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
+{
+ uint32 length, file_attributes, ft_high, ft_low, delete_on_close;
+ char newname[PATH_MAX], fullpath[PATH_MAX];
+ struct fileinfo *pfinfo;
+ int mode;
+ struct stat filestat;
+ time_t write_time, change_time, access_time, mod_time;
+ struct utimbuf tvs;
+ struct STATFS_T stat_fs;
+
+ pfinfo = &(This->fileinfo[handle]);
+ This->notify_stamp = True;
+
+ switch (info_class)
+ {
+ case FileBasicInformation:
+ write_time = change_time = access_time = 0;
+
+ in_uint8s(in, 4); /* Handle of root dir? */
+ in_uint8s(in, 24); /* unknown */
+
+ /* CreationTime */
+ in_uint32_le(in, ft_low);
+ in_uint32_le(in, ft_high);
+
+ /* AccessTime */
+ in_uint32_le(in, ft_low);
+ in_uint32_le(in, ft_high);
+ if (ft_low || ft_high)
+ access_time = convert_1970_to_filetime(ft_high, ft_low);
+
+ /* WriteTime */
+ in_uint32_le(in, ft_low);
+ in_uint32_le(in, ft_high);
+ if (ft_low || ft_high)
+ write_time = convert_1970_to_filetime(ft_high, ft_low);
+
+ /* ChangeTime */
+ in_uint32_le(in, ft_low);
+ in_uint32_le(in, ft_high);
+ if (ft_low || ft_high)
+ change_time = convert_1970_to_filetime(ft_high, ft_low);
+
+ in_uint32_le(in, file_attributes);
+
+ if (fstat(handle, &filestat))
+ return STATUS_ACCESS_DENIED;
+
+ tvs.modtime = filestat.st_mtime;
+ tvs.actime = filestat.st_atime;
+ if (access_time)
+ tvs.actime = access_time;
+
+
+ if (write_time || change_time)
+ mod_time = MIN(write_time, change_time);
+ else
+ mod_time = write_time ? write_time : change_time;
+
+ if (mod_time)
+ tvs.modtime = mod_time;
+
+
+ if (access_time || write_time || change_time)
+ {
+#if WITH_DEBUG_RDP5
+ printf("FileBasicInformation access time %s",
+ ctime(&tvs.actime));
+ printf("FileBasicInformation modification time %s",
+ ctime(&tvs.modtime));
+#endif
+ if (utime(pfinfo->path, &tvs) && errno != EPERM)
+ return STATUS_ACCESS_DENIED;
+ }
+
+ if (!file_attributes)
+ break; /* not valid */
+
+ mode = filestat.st_mode;
+
+ if (file_attributes & FILE_ATTRIBUTE_READONLY)
+ mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
+ else
+ mode |= S_IWUSR;
+
+ mode &= 0777;
+#if WITH_DEBUG_RDP5
+ printf("FileBasicInformation set access mode 0%o", mode);
+#endif
+
+ if (fchmod(handle, mode))
+ return STATUS_ACCESS_DENIED;
+
+ break;
+
+ case FileRenameInformation:
+
+ in_uint8s(in, 4); /* Handle of root dir? */
+ in_uint8s(in, 0x1a); /* unknown */
+ in_uint32_le(in, length);
+
+ if (length && (length / 2) < 256)
+ {
+ rdp_in_unistr(This, in, newname, length);
+ convert_to_unix_filename(newname);
+ }
+ else
+ {
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ sprintf(fullpath, "%s%s", This->rdpdr_device[pfinfo->device_id].local_path,
+ newname);
+
+ if (rename(pfinfo->path, fullpath) != 0)
+ {
+ perror("rename");
+ return STATUS_ACCESS_DENIED;
+ }
+ break;
+
+ case FileDispositionInformation:
+ /* As far as I understand it, the correct
+ thing to do here is to *schedule* a delete,
+ so it will be deleted when the file is
+ closed. Subsequent
+ FileDispositionInformation requests with
+ DeleteFile set to FALSE should unschedule
+ the delete. See
+ http://www.osronline.com/article.cfm?article=245. */
+
+ in_uint32_le(in, delete_on_close);
+
+ if (delete_on_close ||
+ (pfinfo->
+ accessmask & (FILE_DELETE_ON_CLOSE | FILE_COMPLETE_IF_OPLOCKED)))
+ {
+ pfinfo->delete_on_close = True;
+ }
+
+ break;
+
+ case FileAllocationInformation:
+ /* Fall through to FileEndOfFileInformation,
+ which uses ftrunc. This is like Samba with
+ "strict allocation = false", and means that
+ we won't detect out-of-quota errors, for
+ example. */
+
+ case FileEndOfFileInformation:
+ in_uint8s(in, 28); /* unknown */
+ in_uint32_le(in, length); /* file size */
+
+ /* prevents start of writing if not enough space left on device */
+ if (STATFS_FN(This->rdpdr_device[pfinfo->device_id].local_path, &stat_fs) == 0)
+ if (stat_fs.f_bfree * stat_fs.f_bsize < length)
+ return STATUS_DISK_FULL;
+
+ if (ftruncate_growable(handle, length) != 0)
+ {
+ return STATUS_DISK_FULL;
+ }
+
+ break;
+ default:
+
+ unimpl("IRP Set File Information class: 0x%x\n", info_class);
+ return STATUS_INVALID_PARAMETER;
+ }
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+disk_check_notify(RDPCLIENT * This, NTHANDLE handle)
+{
+ struct fileinfo *pfinfo;
+ NTSTATUS status = STATUS_PENDING;
+
+ NOTIFY notify;
+
+ pfinfo = &(This->fileinfo[handle]);
+ if (!pfinfo->pdir)
+ return STATUS_INVALID_DEVICE_REQUEST;
+
+
+
+ status = NotifyInfo(This, handle, pfinfo->info_class, ¬ify);
+
+ if (status != STATUS_PENDING)
+ return status;
+
+ if (memcmp(&pfinfo->notify, ¬ify, sizeof(NOTIFY)))
+ {
+ /*printf("disk_check_notify found changed event\n"); */
+ memcpy(&pfinfo->notify, ¬ify, sizeof(NOTIFY));
+ status = STATUS_NOTIFY_ENUM_DIR;
+ }
+
+ return status;
+
+
+}
+
+NTSTATUS
+disk_create_notify(RDPCLIENT * This, NTHANDLE handle, uint32 info_class)
+{
+
+ struct fileinfo *pfinfo;
+ NTSTATUS ret = STATUS_PENDING;
+
+ /* printf("start disk_create_notify info_class %X\n", info_class); */
+
+ pfinfo = &(This->fileinfo[handle]);
+ pfinfo->info_class = info_class;
+
+ ret = NotifyInfo(This, handle, info_class, &pfinfo->notify);
+
+ if (info_class & 0x1000)
+ { /* ???? */
+ if (ret == STATUS_PENDING)
+ return STATUS_SUCCESS;
+ }
+
+ /* printf("disk_create_notify: num_entries %d\n", pfinfo->notify.num_entries); */
+
+
+ return ret;
+
+}
+
+static NTSTATUS
+NotifyInfo(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, NOTIFY * p)
+{
+ struct fileinfo *pfinfo;
+ struct stat buf;
+ struct dirent *dp;
+ char *fullname;
+ DIR *dpr;
+
+ pfinfo = &(This->fileinfo[handle]);
+ if (fstat(handle, &buf) < 0)
+ {
+ perror("NotifyInfo");
+ return STATUS_ACCESS_DENIED;
+ }
+ p->modify_time = buf.st_mtime;
+ p->status_time = buf.st_ctime;
+ p->num_entries = 0;
+ p->total_time = 0;
+
+
+ dpr = opendir(pfinfo->path);
+ if (!dpr)
+ {
+ perror("NotifyInfo");
+ return STATUS_ACCESS_DENIED;
+ }
+
+
+ while ((dp = readdir(dpr)))
+ {
+ if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
+ continue;
+ p->num_entries++;
+ fullname = (char *) xmalloc(strlen(pfinfo->path) + strlen(dp->d_name) + 2);
+ sprintf(fullname, "%s/%s", pfinfo->path, dp->d_name);
+
+ if (!stat(fullname, &buf))
+ {
+ p->total_time += (buf.st_mtime + buf.st_ctime);
+ }
+
+ xfree(fullname);
+ }
+ closedir(dpr);
+
+ return STATUS_PENDING;
+}
+
+static FsInfoType *
+FsVolumeInfo(char *fpath)
+{
+
+ static FsInfoType info;
+#ifdef USE_SETMNTENT
+ FILE *fdfs;
+ struct mntent *e;
+#endif
+
+ /* initialize */
+ memset(&info, 0, sizeof(info));
+ strcpy(info.label, "RDESKTOP");
+ strcpy(info.type, "RDPFS");
+
+#ifdef USE_SETMNTENT
+ fdfs = setmntent(MNTENT_PATH, "r");
+ if (!fdfs)
+ return &info;
+
+ while ((e = getmntent(fdfs)))
+ {
+ if (str_startswith(e->mnt_dir, fpath))
+ {
+ strcpy(info.type, e->mnt_type);
+ strcpy(info.name, e->mnt_fsname);
+ if (strstr(e->mnt_opts, "vfat") || strstr(e->mnt_opts, "iso9660"))
+ {
+ int fd = open(e->mnt_fsname, O_RDONLY);
+ if (fd >= 0)
+ {
+ unsigned char buf[512];
+ memset(buf, 0, sizeof(buf));
+ if (strstr(e->mnt_opts, "vfat"))
+ /*FAT*/
+ {
+ strcpy(info.type, "vfat");
+ read(fd, buf, sizeof(buf));
+ info.serial =
+ (buf[42] << 24) + (buf[41] << 16) +
+ (buf[40] << 8) + buf[39];
+ strncpy(info.label, buf + 43, 10);
+ info.label[10] = '\0';
+ }
+ else if (lseek(fd, 32767, SEEK_SET) >= 0) /* ISO9660 */
+ {
+ read(fd, buf, sizeof(buf));
+ strncpy(info.label, buf + 41, 32);
+ info.label[32] = '\0';
+ /* info.Serial = (buf[128]<<24)+(buf[127]<<16)+(buf[126]<<8)+buf[125]; */
+ }
+ close(fd);
+ }
+ }
+ }
+ }
+ endmntent(fdfs);
+#else
+ /* initialize */
+ memset(&info, 0, sizeof(info));
+ strcpy(info.label, "RDESKTOP");
+ strcpy(info.type, "RDPFS");
+
+#endif
+ return &info;
+}
+
+
+NTSTATUS
+disk_query_volume_information(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, STREAM out)
+{
+ struct STATFS_T stat_fs;
+ struct fileinfo *pfinfo;
+ FsInfoType *fsinfo;
+
+ pfinfo = &(This->fileinfo[handle]);
+
+ if (STATFS_FN(pfinfo->path, &stat_fs) != 0)
+ {
+ perror("statfs");
+ return STATUS_ACCESS_DENIED;
+ }
+
+ fsinfo = FsVolumeInfo(pfinfo->path);
+
+ switch (info_class)
+ {
+ case FileFsVolumeInformation:
+
+ out_uint32_le(out, 0); /* volume creation time low */
+ out_uint32_le(out, 0); /* volume creation time high */
+ out_uint32_le(out, fsinfo->serial); /* serial */
+
+ out_uint32_le(out, 2 * strlen(fsinfo->label)); /* length of string */
+
+ out_uint8(out, 0); /* support objects? */
+ rdp_out_unistr(This, out, fsinfo->label, 2 * strlen(fsinfo->label) - 2);
+ break;
+
+ case FileFsSizeInformation:
+
+ out_uint32_le(out, stat_fs.f_blocks); /* Total allocation units low */
+ out_uint32_le(out, 0); /* Total allocation high units */
+ out_uint32_le(out, stat_fs.f_bfree); /* Available allocation units */
+ out_uint32_le(out, 0); /* Available allowcation units */
+ out_uint32_le(out, stat_fs.f_bsize / 0x200); /* Sectors per allocation unit */
+ out_uint32_le(out, 0x200); /* Bytes per sector */
+ break;
+
+ case FileFsAttributeInformation:
+
+ out_uint32_le(out, FS_CASE_SENSITIVE | FS_CASE_IS_PRESERVED); /* fs attributes */
+ out_uint32_le(out, F_NAMELEN(stat_fs)); /* max length of filename */
+
+ out_uint32_le(out, 2 * strlen(fsinfo->type)); /* length of fs_type */
+ rdp_out_unistr(This, out, fsinfo->type, 2 * strlen(fsinfo->type) - 2);
+ break;
+
+ case FileFsLabelInformation:
+ case FileFsDeviceInformation:
+ case FileFsControlInformation:
+ case FileFsFullSizeInformation:
+ case FileFsObjectIdInformation:
+ case FileFsMaximumInformation:
+
+ default:
+
+ unimpl("IRP Query Volume Information class: 0x%x\n", info_class);
+ return STATUS_INVALID_PARAMETER;
+ }
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+disk_query_directory(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, char *pattern, STREAM out)
+{
+ uint32 file_attributes, ft_low, ft_high;
+ char *dirname, fullpath[PATH_MAX];
+ DIR *pdir;
+ struct dirent *pdirent;
+ struct stat fstat;
+ struct fileinfo *pfinfo;
+
+ pfinfo = &(This->fileinfo[handle]);
+ pdir = pfinfo->pdir;
+ dirname = pfinfo->path;
+ file_attributes = 0;
+
+ switch (info_class)
+ {
+ case FileBothDirectoryInformation:
+
+ /* If a search pattern is received, remember this pattern, and restart search */
+ if (pattern[0] != 0)
+ {
+ strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), PATH_MAX - 1);
+ rewinddir(pdir);
+ }
+
+ /* find next dirent matching pattern */
+ pdirent = readdir(pdir);
+ while (pdirent && fnmatch(pfinfo->pattern, pdirent->d_name, 0) != 0)
+ pdirent = readdir(pdir);
+
+ if (pdirent == NULL)
+ return STATUS_NO_MORE_FILES;
+
+ /* Get information for directory entry */
+ sprintf(fullpath, "%s/%s", dirname, pdirent->d_name);
+
+ if (stat(fullpath, &fstat))
+ {
+ switch (errno)
+ {
+ case ENOENT:
+ case ELOOP:
+ case EACCES:
+ /* These are non-fatal errors. */
+ memset(&fstat, 0, sizeof(fstat));
+ break;
+ default:
+ /* Fatal error. By returning STATUS_NO_SUCH_FILE,
+ the directory list operation will be aborted */
+ perror(fullpath);
+ out_uint8(out, 0);
+ return STATUS_NO_SUCH_FILE;
+ }
+ }
+
+ if (S_ISDIR(fstat.st_mode))
+ file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
+ if (pdirent->d_name[0] == '.')
+ file_attributes |= FILE_ATTRIBUTE_HIDDEN;
+ if (!file_attributes)
+ file_attributes |= FILE_ATTRIBUTE_NORMAL;
+ if (!(fstat.st_mode & S_IWUSR))
+ file_attributes |= FILE_ATTRIBUTE_READONLY;
+
+ /* Return requested information */
+ out_uint8s(out, 8); /* unknown zero */
+
+ seconds_since_1970_to_filetime(get_create_time(&fstat), &ft_high, &ft_low);
+ out_uint32_le(out, ft_low); /* create time */
+ out_uint32_le(out, ft_high);
+
+ seconds_since_1970_to_filetime(fstat.st_atime, &ft_high, &ft_low);
+ out_uint32_le(out, ft_low); /* last_access_time */
+ out_uint32_le(out, ft_high);
+
+ seconds_since_1970_to_filetime(fstat.st_mtime, &ft_high, &ft_low);
+ out_uint32_le(out, ft_low); /* last_write_time */
+ out_uint32_le(out, ft_high);
+
+ seconds_since_1970_to_filetime(fstat.st_ctime, &ft_high, &ft_low);
+ out_uint32_le(out, ft_low); /* change_write_time */
+ out_uint32_le(out, ft_high);
+
+ out_uint32_le(out, fstat.st_size); /* filesize low */
+ out_uint32_le(out, 0); /* filesize high */
+ out_uint32_le(out, fstat.st_size); /* filesize low */
+ out_uint32_le(out, 0); /* filesize high */
+ out_uint32_le(out, file_attributes);
+ out_uint8(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */
+ out_uint8s(out, 7); /* pad? */
+ out_uint8(out, 0); /* 8.3 file length */
+ out_uint8s(out, 2 * 12); /* 8.3 unicode length */
+ rdp_out_unistr(This, out, pdirent->d_name, 2 * strlen(pdirent->d_name));
+ break;
+
+ default:
+ /* FIXME: Support FileDirectoryInformation,
+ FileFullDirectoryInformation, and
+ FileNamesInformation */
+
+ unimpl("IRP Query Directory sub: 0x%x\n", info_class);
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ return STATUS_SUCCESS;
+}
+
+
+
+static NTSTATUS
+disk_device_control(RDPCLIENT * This, NTHANDLE handle, uint32 request, STREAM in, STREAM out)
+{
+ if (((request >> 16) != 20) || ((request >> 16) != 9))
+ return STATUS_INVALID_PARAMETER;
+
+ /* extract operation */
+ request >>= 2;
+ request &= 0xfff;
+
+ printf("DISK IOCTL %d\n", request);
+
+ switch (request)
+ {
+ case 25: /* ? */
+ case 42: /* ? */
+ default:
+ unimpl("DISK IOCTL %d\n", request);
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ return STATUS_SUCCESS;
+}
+
+DEVICE_FNS disk_fns = {
+ disk_create,
+ disk_close,
+ disk_read,
+ disk_write,
+ disk_device_control /* device_control */
+};
--- /dev/null
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ Disk Redirection definitions
+ Copyright (C) Jeroen Meijer 2003
+ Copyright (C) Peter Astrand 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#define FILE_ATTRIBUTE_READONLY 0x00000001
+#define FILE_ATTRIBUTE_HIDDEN 0x00000002
+#define FILE_ATTRIBUTE_SYSTEM 0x00000004
+#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
+#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
+#define FILE_ATTRIBUTE_DEVICE 0x00000040
+#define FILE_ATTRIBUTE_UNKNOWNXXX0 0x00000060 /* ??? ACTION i.e. 0x860 == compress this file ? */
+#define FILE_ATTRIBUTE_NORMAL 0x00000080
+#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
+#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
+#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
+#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
+#define FILE_ATTRIBUTE_OFFLINE 0x00001000
+#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
+#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
+
+#define FILE_FLAG_OPEN_NO_RECALL 0x00100000
+#define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000
+#define FILE_FLAG_POSIX_SEMANTICS 0x01000000
+#define FILE_FLAG_BACKUP_SEMANTICS 0x02000000 /* sometimes used to create a directory */
+#define FILE_FLAG_DELETE_ON_CLOSE 0x04000000
+#define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000
+#define FILE_FLAG_RANDOM_ACCESS 0x10000000
+#define FILE_FLAG_NO_BUFFERING 0x20000000
+#define FILE_FLAG_OVERLAPPED 0x40000000
+#define FILE_FLAG_WRITE_THROUGH 0x80000000
+
+#define FILE_SHARE_READ 0x01
+#define FILE_SHARE_WRITE 0x02
+#define FILE_SHARE_DELETE 0x04
+
+#define FILE_BASIC_INFORMATION 0x04
+#define FILE_STANDARD_INFORMATION 0x05
+
+#define FS_CASE_SENSITIVE 0x00000001
+#define FS_CASE_IS_PRESERVED 0x00000002
+#define FS_UNICODE_STORED_ON_DISK 0x00000004
+#define FS_PERSISTENT_ACLS 0x00000008
+#define FS_FILE_COMPRESSION 0x00000010
+#define FS_VOLUME_QUOTAS 0x00000020
+#define FS_SUPPORTS_SPARSE_FILES 0x00000040
+#define FS_SUPPORTS_REPARSE_POINTS 0x00000080
+#define FS_SUPPORTS_REMOTE_STORAGE 0X00000100
+#define FS_VOL_IS_COMPRESSED 0x00008000
+#define FILE_READ_ONLY_VOLUME 0x00080000
+
+#define OPEN_EXISTING 1
+#define CREATE_NEW 2
+#define OPEN_ALWAYS 3
+#define TRUNCATE_EXISTING 4
+#define CREATE_ALWAYS 5
+
+#define GENERIC_READ 0x80000000
+#define GENERIC_WRITE 0x40000000
+#define GENERIC_EXECUTE 0x20000000
+#define GENERIC_ALL 0x10000000
+
+#define ERROR_FILE_NOT_FOUND 2L
+#define ERROR_ALREADY_EXISTS 183L
+
+typedef enum _FILE_INFORMATION_CLASS
+{
+ FileDirectoryInformation = 1,
+ FileFullDirectoryInformation,
+ FileBothDirectoryInformation,
+ FileBasicInformation,
+ FileStandardInformation,
+ FileInternalInformation,
+ FileEaInformation,
+ FileAccessInformation,
+ FileNameInformation,
+ FileRenameInformation,
+ FileLinkInformation,
+ FileNamesInformation,
+ FileDispositionInformation,
+ FilePositionInformation,
+ FileFullEaInformation,
+ FileModeInformation,
+ FileAlignmentInformation,
+ FileAllInformation,
+ FileAllocationInformation,
+ FileEndOfFileInformation,
+ FileAlternateNameInformation,
+ FileStreamInformation,
+ FilePipeInformation,
+ FilePipeLocalInformation,
+ FilePipeRemoteInformation,
+ FileMailslotQueryInformation,
+ FileMailslotSetInformation,
+ FileCompressionInformation,
+ FileCopyOnWriteInformation,
+ FileCompletionInformation,
+ FileMoveClusterInformation,
+ FileOleClassIdInformation,
+ FileOleStateBitsInformation,
+ FileNetworkOpenInformation,
+ FileObjectIdInformation,
+ FileOleAllInformation,
+ FileOleDirectoryInformation,
+ FileContentIndexInformation,
+ FileInheritContentIndexInformation,
+ FileOleInformation,
+ FileMaximumInformation
+} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
+
+typedef enum _FSINFOCLASS
+{
+ FileFsVolumeInformation = 1,
+ FileFsLabelInformation,
+ FileFsSizeInformation,
+ FileFsDeviceInformation,
+ FileFsAttributeInformation,
+ FileFsControlInformation,
+ FileFsFullSizeInformation,
+ FileFsObjectIdInformation,
+ FileFsDriverPathInformation,
+ FileFsMaximumInformation
+} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
--- /dev/null
+This is an attempt at a list of people who have made significant
+contributions to the code. If you have been unintentionally omitted
+please let one of the team members know.
+
+Matt Chapman <matthewc@cse.unsw.edu.au>
+Peter Kallden <peter.kallden@ub.oru.se>
+Hugo Trippaers <spark@ision.nl>
+Jay Sorg <j@american-data.com>
+Peter Ã…strand <peter@cendio.se>
+Michal Mihalik <mmihalik@sme.sk>
+Norbert Federa <nob@thinstuff.com>
+Erik Forsberg <forsberg@cendio.se>
+Michael Gernoth <michael@gernoth.net>
+Jeroen Meijer <jeroen@oldambt7.com>
--- /dev/null
+rdesktop (1.?.?)
+ * SeamlessRDP - seamless windows support
+ * Keymap fixes
+ * Fix connection issues with Windows XP RTM
+ * Keyboard handling improvements and fixes
+ * SGI/Irix sound-driver fixes
+ * Support for clipboard INCR protocol
+ * Session Directory support (patch from Brian Chapeau <lheria@users.sourceforge.net>)
+ * Support for long filenames on redirected drives
+ * XOR ellipse drawing fix
+ * Clipboard unicode support (Ilya Konstantinov)
+ * Refactoring of color depth code (Ilya Konstantinov)
+
+rdesktop (1.4.1)
+ * persistent bitmap cache optimisations
+ * support for more RDP-orders (ellipse, polygon)
+ * libao sound-driver (for Mac OSX and others)
+ * Unicode support for transmitted strings/filenames
+ * Added korean keymap
+ * Xembed fixes to work with krdc correctly
+ * Portability fixes
+ * Support for RDP-compression (all bpps)
+ * process RDP recv queue if send queue is full (Debian bug #246461)
+ * SGI/Irix sound-driver fixes
+
+ -- Michael Gernoth <michael@gernoth.net> Sun, 8 May 2005 19:55:35 +0200 (CEST)
+
+rdesktop (1.4.0)
+ * Basic disk-, parallel-, printer- and serial-redirection
+ * Fix timezone-redirection
+ * Backing-store fixes
+ * Fix client-IP sent to TS
+ * XEmbed support for embedding rdesktop in other applications (KRDC)
+ * Support for setting the RDP5 experience
+ * Keyboard and keymap fixes
+ * Performance improvements
+ * Report disconnect-reason
+ * Support for RDP-compression (currently only for 8bpp)
+ * Support for persistent bitmap caching
+ * Sound-driver for SGI/Irix
+
+ -- Michael Gernoth <michael@gernoth.net> Sun, 6 Mar 2005 22:09:55 +0100 (CET)
+
+rdesktop (1.3.1)
+ * Crypto fixes for RDP5
+ * Keyboard and keymap fixes
+ * some endianess fixes for high color
+ * portability enhancements
+
+ -- Matthew Chapman <matthewc@cse.unsw.edu.au> Tue, 21 Jan 2004 20:34
+
+rdesktop (1.3.0)
+
+ * RDP5
+ * 15, 16 and 24 bit color depths
+ * Basic clipboard redirection
+ * Sound
+ * IPv6
+ * Attaching to console on Windows 2003
+
+ -- Peter Astrand <peter@cendio.se> Wed, 29 Oct 2003 16:40:58 +0100 (CET)
+
+rdesktop (1.2.0)
+
+ * new - more portable - key mapping code
+ * support for "high" (128-bit) encryption
+ * toggling out of full-screen mode with Ctrl-Alt-Enter
+ * a few extra options including host:port syntax
+ * many, many bug fixes and optimisations
+
+ -- Matthew Chapman <matthewc@cse.unsw.edu.au> Thu, 30 Jan 2003 04:29
+
+rdesktop (1.1.0)
+
+ * solves arith.c licensing issue by taking big number routines from
+ OpenSSL
+ * keyboard support not merged from unified patches yet
+ * still no manpage
+
+ -- Matthew Chapman <matthewc@cse.unsw.edu.au> Mon, 17 Sep 2001 23:14:28 +1000 (AEST)
+
+rdesktop (1.0.0)
+
+ * initial release
+
+ -- Matthew Chapman <matthewc@cse.unsw.edu.au>
--- /dev/null
+
+Code style / indentation
+------------------------
+The file indent-all.sh contains information about the current code
+style. Run this script before commits.
+
+
+Variable argument macros
+------------------------
+Variable argument macros are non-portable in general, and should be
+avoided. Either use a second set of parentheses like DEBUG, or create
+a variable argument function like error.
+
+
+Structure
+---------
+The core protocol stack should be system-independent (i.e. ANSI C
+only) so that it is easy to port. This currently applies to the
+following files:
+
+bitmap.c licence.c orders.c rdp.c rdp5.c cache.c iso.c mcs.c
+secure.c mppc.c channels.c
+rdesktop.c
+
+
+RDP resources
+-------------
+http://dev.remotenetworktechnology.com/refdata.htm
--- /dev/null
+
+* Clipboard:
+
+ * Support other data types than plain text.
+
+ * Conversion between different character sets.
+
+
+* Drive Redirection:
+
+ * Real support for file locking
+
+ * Handle reconnections correctly.
+
+ * Various deficiencies; see FIXMEs in source code.
+
+
+* Serial Port Redirection:
+
+ * More testing needed.
+
+
+* Printer Redirection:
+
+ * More testing needed.
+
+
+* Keymapping:
+
+
+* Sound redirection
+
+ * Use timestamps in audio packets.
+
+ * Add resampling to supported samplerates of audio-hardware.
+
+ * Lower CPU-usage with an audio thread.
+
+
+* Smartcard redirection
+
+ * Merge patches currently implementing sc-redirection.
+
+
+* Miscellaneous
+
+ * Clean up header files. The current "proto.h" and "xproto.h" is far
+ from optimal.
+
+ * Go through the many trackers (bugs/patches/RFEs) at SourceForge.
+
+ * More fancy homepage.
+
+ * Enhance documentation. Write a FAQ.
+
+
+* SeamlessRDP mode
+
+ * Add a client to server message for starting additional
+ applications.
+
+ * Support cmd.exe.
+
+ * Support for Input Contexts.
+
+ * Enhanced support for WM_DELETE_WINDOW: Instead of terminating
+ rdesktop, close the window on the server side.
+
+ * Systray support.
+
+ * Support for transferring the application taskbar icon.
+
+ * Better support for non-EWMH window managers.
+
+ * Support for non-rectangular windows.
+
+ * The focus handling of menus is a bit crude.
+
+ * Support for sending focus information from client to server.
+
+ * Implement something similiar to explhook.dll - support for running
+ explorer.exe in non-shell mode.
+
+ * Better compatibility with Task Manager.
+
+ * XINERAMA support.
+
+ * When enumerating windows, make sure to send info about windows
+ that are transient for other windows after the referred window.
--- /dev/null
+
+IPv6 support in rdesktop
+========================
+The IPv6 support was developed by Mike Dawson <mike@dexy.mine.nu>:
+
+ Attached is a patch to tcp.c to enable IPv6 support. Build with
+ 'IPv6' defined to enable it. It's so far only been tested on
+ Linux 2.4.21 connecting to Windows XP SP1.
+
+ Since terminal services doesn't seem to bind to the ipv6 interface
+ on XP I had to run 'netsh interface portproxy add v6tov4
+ listenport=3389 connectport=3389' from the windows command prompt
+ to get it to work.
+
+
+rdesktop now supports numeric IPv6 addresses:
+
+ It checks for two or more colons in an address to decide what it's
+ dealing with so you can now do:
+
+ rdesktop 2001:1:2:3::4
+
+ without it getting confused with an ipv4:port specification. I've
+ also followed the square bracket convention used by browsers
+ (http://www.ietf.org/rfc/rfc2732.txt) so if you want to specify a
+ non-standard port with an ipv6 address you can use the format:
+
+ rdesktop [2001:1:2:3::4]:3390
+
--- /dev/null
+
+0x0436 af Afrikaans
+0x041C sq Albanian
+0x0001 ar Arabic
+0x0401 ar-sa Arabic (Saudi Arabia)
+0x0801 ar-iq Arabic (Iraq)
+0x0C01 ar-eg Arabic (Egypt)
+0x1001 ar-ly Arabic (Libya)
+0x1401 ar-dz Arabic (Algeria)
+0x1801 ar-ma Arabic (Morocco)
+0x1C01 ar-tn Arabic (Tunisia)
+0x2001 ar-om Arabic (Oman)
+0x2401 ar-ye Arabic (Yemen)
+0x2801 ar-sy Arabic (Syria)
+0x2C01 ar-jo Arabic (Jordan)
+0x3001 ar-lb Arabic (Lebanon)
+0x3401 ar-kw Arabic (Kuwait)
+0x3801 ar-ae Arabic (U.A.E.)
+0x3C01 ar-bh Arabic (Bahrain)
+0x4001 ar-qa Arabic (Qatar)
+0x042D eu Basque
+0x0402 bg Bulgarian
+0x0423 be Belarusian
+0x0403 ca Catalan
+0x0004 zh Chinese
+0x0404 zh-tw Chinese (Taiwan)
+0x0804 zh-cn Chinese (China)
+0x0C04 zh-hk Chinese (Hong Kong SAR)
+0x1004 zh-sg Chinese (Singapore)
+0x041A hr Croatian
+0x0405 cs Czech
+0x0406 da Danish
+0x0413 nl Dutch (Netherlands)
+0x0813 nl-be Dutch (Belgium)
+0x0009 en English
+0x0409 en-us English (United States)
+0x0809 en-gb English (United Kingdom)
+0x0C09 en-au English (Australia)
+0x1009 en-ca English (Canada)
+0x1409 en-nz English (New Zealand)
+0x1809 en-ie English (Ireland)
+0x1C09 en-za English (South Africa)
+0x2009 en-jm English (Jamaica)
+0x2809 en-bz English (Belize)
+0x2C09 en-tt English (Trinidad)
+0x0425 et Estonian
+0x0438 fo Faeroese
+0x0429 fa Farsi
+0x040B fi Finnish
+0x040C fr French (France)
+0x080C fr-be French (Belgium)
+0x0C0C fr-ca French (Canada)
+0x100C fr-ch French (Switzerland)
+0x140C fr-lu French (Luxembourg)
+0x043C gd Gaelic
+0x0407 de German (Germany)
+0x0807 de-ch German (Switzerland)
+0x0C07 de-at German (Austria)
+0x1007 de-lu German (Luxembourg)
+0x1407 de-li German (Liechtenstein)
+0x0408 el Greek
+0x040D he Hebrew
+0x0439 hi Hindi
+0x040E hu Hungarian
+0x040F is Icelandic
+0x0421 in Indonesian
+0x0410 it Italian (Italy)
+0x0810 it-ch Italian (Switzerland)
+0x0411 ja Japanese
+0x0412 ko Korean
+0x0426 lv Latvian
+0x0427 lt Lithuanian
+0x042F mk FYRO Macedonian
+0x043E ms Malay (Malaysia)
+0x043A mt Maltese
+0x0414 no Norwegian (Bokmal)
+0x0814 no Norwegian (Nynorsk)
+0x0415 pl Polish
+0x0416 pt-br Portuguese (Brazil)
+0x0816 pt Portuguese (Portugal)
+0x0417 rm Rhaeto-Romanic
+0x0418 ro Romanian
+0x0818 ro-mo Romanian (Moldova)
+0x0419 ru Russian
+0x0819 ru-mo Russian (Moldova)
+0x0C1A sr Serbian (Cyrillic)
+0x081A sr Serbian (Latin)
+0x041B sk Slovak
+0x0424 sl Slovenian
+0x042E sb Sorbian
+0x040A es Spanish (Traditional Sort)
+0x080A es-mx Spanish (Mexico)
+0x0C0A es Spanish (International Sort)
+0x100A es-gt Spanish (Guatemala)
+0x140A es-cr Spanish (Costa Rica)
+0x180A es-pa Spanish (Panama)
+0x1C0A es-do Spanish (Dominican Republic)
+0x200A es-ve Spanish (Venezuela)
+0x240A es-co Spanish (Colombia)
+0x280A es-pe Spanish (Peru)
+0x2C0A es-ar Spanish (Argentina)
+0x300A es-ec Spanish (Ecuador)
+0x340A es-cl Spanish (Chile)
+0x380A es-uy Spanish (Uruguay)
+0x3C0A es-py Spanish (Paraguay)
+0x400A es-bo Spanish (Bolivia)
+0x440A es-sv Spanish (El Salvador)
+0x480A es-hn Spanish (Honduras)
+0x4C0A es-ni Spanish (Nicaragua)
+0x500A es-pr Spanish (Puerto Rico)
+0x0430 sx Sutu
+0x041D sv Swedish
+0x081D sv-fi Swedish (Finland)
+0x041E th Thai
+0x0431 ts Tsonga
+0x0432 tn Tswana
+0x041F tr Turkish
+0x0422 uk Ukrainian
+0x0420 ur Urdu
+0x042A vi Vietnamese
+0x0434 xh Xhosa
+0x043D ji Yiddish
+0x0435 zu Zulu
+
--- /dev/null
+Keyboard mapping
+================
+This release of rdesktop uses a new, portable keyboard mapping
+implementation. It should hopefully work on all X11 systems. This new
+implementation only looks at X11 keysyms: Not on (nonportable)
+keycodes or modifier status. This means that rdesktop will obey your
+local keyboard configuration. For example, if you have swapped
+CapsLock and Control, rdesktop will use this mapping.
+
+XKB is currently not used. It seems like a good idea to me, but since
+some X servers (like Xvnc) does not support XKB, we still need to use
+the plain old interface as well, at least.
+
+There are still some small problems.
+
+* CapsLock: CapsLock changes are never sent to the RDP
+ server. rdesktop does not know which keys that are modified by
+ CapsLock and which are not. So, the CapsLock indicator in Wordpad
+ etc will always be off.
+
+Composing/Multi_key is supported. For more information, see:
+
+ MIT: $SRC/xc/nls/X11/locale/Compose/iso8859-1
+ XFree86: /usr/X11R6/lib/X11/locale/*/Compose
+ Solaris' Openwin: /usr/openwin/include/X11/Suncompose.h
+ /usr/openwin/lib/locale/*/Compose
+ Irix6: compose(5)
+
+
+Keymap files
+============
+The names of the keymaps follows RFC1766.
+
+(You can find a translation from Windows keyboard layout numbers to
+keymap names by looking at
+HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MIME\Database\RFC1766 in the
+registry.)
+
+
+Contents of keymap files
+========================
+The keymaps are line based. There are four different types of lines:
+
+1) include lines
+Syntax:
+include <another-map-file>
+
+Example:
+include common
+
+
+2) map lines
+Syntax:
+map <hex-number>
+
+Example:
+map 0x41d
+
+Map-lines specifies how the remote RDP server should interpret the
+sent scancodes.
+
+
+3) Translation lines
+Syntax:
+<keysym-name> <scancode> [flags..]
+
+Example:
+onehalf 0x29 shift
+
+The scancode can be found in scancodes.h. Note: The scancode value for
+extended keys can be calculated by OR:ing with 0x80. Example: The
+Delete key have the scancode sequence 0xe0, 0x52. You can get the
+scancode value to put into the map file by running:
+
+python -c "print hex(0x80 | 0x52)"
+
+If flags are "altgr", "shift", the scancode sent for this keysym will
+be prefixed with AltGr, or Shift.
+
+If flags includes "addupper", a translation for this keysyms uppercase
+name will be added as well, in addition to the non-uppercase
+name. Example:
+
+x 2d addupper
+
+...will add an translation for "X" automatically, just like if you
+would specify:
+
+X 2d shift
+
+If flags include "localstate", the modifier to send will be determined
+by the local modifier state.
+
+If flags is "inhibit", nothing will be sent to the server.
+
+If flags is "numlock", rdesktop will make sure that the remote NumLock
+state is on before generating the key event. Otherwise, it will make
+sure NumLock is off.
+
+
+4) enable_compose
+
+If any line starts with the keyword "enable_compose", rdesktop will
+enable local Compose/Multi_key handling. Enabling this will often make
+it impossible to compose characters with dead keys (on the remote
+side). This is because when local compose support is enabled, dead
+keys will not be sent to the remote side.
+
+
+5) sequence lines
+Syntax:
+sequence <event-keysym-name> <keysym-name1> <keysym-name2> ...
+
+Examples:
+sequence eacute dead_acute e
+sequence F12 f o o at e x a m p l e period c o m
+
+Sequence lines allows you to specify that multiple scancodes should be
+sent to the RDP server, in response to one X11 keyboard event. Note:
+The sequence is sent at the X11 KeyPress event. Nothing is sent at
+KeyRelease.
+
+
+6) keyboard_type lines
+Syntax:
+keyboard_type <hex-number>
+
+keyboard_type lines specifies the keyboard type. Default value is 0x4
+(en-us 101/104 keys keyboard).
+
+
+7) keyboard_subtype lines
+Syntax:
+keyboard_subtype <hex-number>
+
+keyboard_subtype lines specifies the keyboard subtype. Default value
+is 0x0 (en-us 101/104 keys keyboard).
+
+
+8) keyboard_functionkeys lines
+Syntax:
+keyboard_functionkeys <hex-number>
+
+keyboard_functionkeys specifies the number of keyboard function
+keys. Default value is 0xc (12, for standard 101/104 keys keyboard).
+
+
+
+
+Suggested X11 keysym mapping on PCs
+===================================
+Unfortunately, there is no standard for which keysyms a given key
+should generate. If you have a PC-keyboard with Windows keys, I suggest this mapping:
+
+Keyboard keys:
+CtrlLeft WinLeft AltLeft Space AltGr WinRight Menu CtrlRight
+
+...should generate keysyms:
+Control_L Super_L Alt_L space Mode_switch Super_R Menu Control_R
+
+Additionally:
+Shift-Alt should produce Meta_L
+Shift-AltGr should produce Multi_Key.
+
+Use a modifier-map like this:
+
+shift Shift_L (0x32), Shift_R (0x3e)
+lock Caps_Lock (0x25)
+control Control_L (0x42), Control_R (0x6d)
+mod1 Alt_L (0x40)
+mod2 Num_Lock (0x4d)
+mod3 Mode_switch (0x71)
+mod4 Super_L (0x73), Super_R (0x74)
+mod5 Scroll_Lock (0x4e)
+
+
+Updating / writing keymap files
+===============================
+When writing new or updating keymap files, please use comments and
+blanks, to increase readability. The "sv" keymap is a good template.
+
+When you need to add a translation to a keymap file, do:
+
+ 1. Get the "key number" for this key, by looking at keynums.png.
+
+ 2. Take a look at scancodes.h, and look for
+ SCANCODE_KEY_<my-key-number>. The scancode value is at the end of
+ the line. If the line contains (SCANCODE_EXTENDED | 0xsomething),
+ then you should OR 0x80 to this value. For example, you can do:
+
+ python -c "print hex(0x80 | 0xsomething)"
+
+ 3. Put the scancode (from step 2) and keysym name (found in the
+ error message) into the keymap file.
+
+
+Special keys
+============
+
+* The combination Ctrl-Alt-Enter toggles between fullscreen and
+ non-fullscreen mode.
+
+* Meta, Hyper and Super are treated as windows keys. RDP4 does not
+ support the windows keys though, so if you are running RDP4, these
+ keys will translate to Ctrl-Esc.
+
+
+Links
+=====
+http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html
+
+
+Test cases
+==========
+When changing the keyboard code, make sure all these tests in Notepad
+works:
+
+1. Ctrl+f should bring up Find dialog, with CapsLock both on and off.
+
+2. Ctrl+Shift+arrows should mark text, with CapsLock both on and off.
+
+3. Test a sequence, like egrave.
+
+4. Test a char generated with AltGr, such as @ on a swedish keyboard.
+
+5. Test Ctrl-Alt-Delete.
+
+6. Ctrl-Alt-Enter should toggle fullscreen.
+
+7. Test NumLock synchronization using the -N option. Excel is able to
+ indicate the current NumLock state. Verify that the status is
+ updated correctly on reconnects.
+
+8. Test the Windows keys, standalone as well as in combination with,
+ say, E.
+
+9. Make sure the system menu (via Alt-space) cannot be accessed in
+ single app mode.
+
+10. Make sure keymaps can be loaded from ~/.rdesktop/keymaps,
+ KEYMAP_PATH, $CWD/keymaps, and from an absolute path.
+
+
--- /dev/null
+
+To be able to connect to Microsoft Windows 2000 Terminal Services (and
+probably later versions), you'll need to deal with licensing. This is
+complicated. This file is supposed to contain some information about
+how rdesktop works with Microsofts license systems.
+
+There's a lot of information on the MS web site, for example,
+http://support.microsoft.com/default.aspx?scid=kb;EN-US;287687.
+
+From the rdesktop mailing list:
+
+Peter Ã…strand <peter@cendio.se>, 2003-02-06
+
+> We are running rdesktop 1.2 on machine A and connects to a Windows 2000
+> Server (machine B). The W2K machine has 5 real licenses installed ("Windows
+> 2000 Terminal Services Client Access License", "Open" type). This can be
+> verifier by using "Terminal Services Licensing". The problem is that all
+> issued licenses have an expire-date. The expire date for the license issued
+> to A was reached today, and no more connections could be made until we
+> changed the client name (by using -n).
+>
+> We also have another similiar systems, with Linux machine C and W2K server
+> D. This server has 200 licenses installed of the type "Select". On this
+> server, the issued licenses seems to be permanent: The expire date is set
+> to "-", and we have no problem with this system.
+>
+> The question of course is why the first system issues license with
+> expiration date, while the second system issues permanent licenses.
+
+
+Darryn Capes-Davis, 2003-02-07
+
+> I have been through the problems and can tell you what is going
+> on. The main difference of Machine B (Server 1) and Machine D (Server
+> 2) is that from what I see Machine B has Service Pack 3 installed and
+> Machine D does not. You see in Service Pack 3 there was a change made
+> to TS Licencing in that Microsoft introduced a licence recovery
+> mechanism. To cut to the point (I don't know the details) rdesktop 1.2
+> with SAVE_LICENCE defined works fine. In the new lic method the
+> terminal server expects a valid licence to be presented to renew
+> it. Otherwise it just expires it - and a day later you will see it
+> actually gone (it does housekeeping once a day)! So if SAVE_LICENCE
+> code is not enabled then it just expires and you can't use the licence
+> until it cleans it away - and this is where a little gotcha is - if
+> you move from using an rdesktop without SAVE_LICENCE to one with
+> SAVE_LICENCE then it still won't recover an 'expired' licence. You
+> have to wait for the daily housekeeping to clean it up - this really
+> had me going for half a day or so! This is exactly what happened to
+> you.
+>
+> The Server pre Spk 3 has the old model where licences never expire. To
+> recover a licence that you never wanted to use again you have to call
+> the Microsoft Clearing House. That's why they introduced the new
+> method. And if you upgrade a Pre Spk3 server to Spk3 then the licences
+> granted still stay with the old method - only new licences granted
+> will use the new expiry method.
--- /dev/null
+
+Protocol overview
+=================
+
+The lspci virtual channel makes it possible for the remote RDP server
+to enumerate the local PCI devices. The protocol on this channel is
+text based and line oriented: One single line per request or
+response. UNIX-style LF line breaks are used. The maximum line length
+is 1023, newline included.
+
+rdesktop acts as a server, with only one request:
+
+ LSPCI
+
+The response is several lines with this syntax:
+
+<class>,<vendor>,<device>,<subvendor>,<subdevice>,<revision>,<progif>
+
+After the last line, a line with a single dot is sent.
+
+Example:
+
+0300,102b,0525,102b,0338,04,00
+0401,8086,24d5,1028,0174,02,8f
+.
+
+
+Usage
+=====
+
+To enable to lspci virtual channel, run rdesktop with "-r lspci".
+
+
+References
+==========
+
+http://www.microsoft.com/msj/1099/terminal/terminal.aspx
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/terminal_services_virtual_channels.asp
+
--- /dev/null
+This file documents some of all patches for rdesktop, floating around
+the net, and how they are related to the current (CVS) version of
+rdesktop. Things left to do are marked with TBD (To Be Done).
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/Makefile.diff
+Description:
+Makefile changes which makes it possible to compile rdesktop on SunOS
+and OSF1.
+Status:
+Applied (slightly modified)
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/assar_19-7-2.hostlen.patch
+Description:
+Fix for hostnames longer than 30 chars.
+Status:
+Applied (revision 1.11 of secure.c)
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/backingstore+privatecolormap-for-19-3-9.patch
+Description:
+This adds support for 1) Private color maps (useful for 8 bpp mode)
+and 2) backingstore selection.
+Status:
+1) is not needed anymore; rdesktop automatically uses Private color
+map in 8 bpp mode. 2) is, as far as I understand, also not
+need. rdesktop automatically uses a software backing store if the
+Xserver does not provide one.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/ben_xwin.c.diff
+Description:
+Fixes for CapsLock and NumLock.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/ctrl1nohang.diff
+Description:
+Fixes problem with ctrl1 hangs.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/downkeypatch.diff
+Description:
+Seems to keep track of the remote modifier status.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/fasttext2+nobackpixmap.patch
+Description:
+(From http://mail.rdesktop.org/archive/2001/msg00218.html):
+
+1) Added --no-backpixmap option to disable the ugly double drawing in
+xwin.c (I have a very robust backing storage in my X, so I don't need
+it ;)
+
+2) More optimizations to text draw (previous fast-text patch was
+included in 192-3-6-2). In text drawing with solid background the
+glyphs are drawn with stippled fill instead of XCopyPlane (runs faster
+on my S3Trio64 with XFree 3.3.6, please test it on other
+configurations to validate this). The WinTach not show any improvement
+with this change, it seems to use all transparent background text
+draws, but with a old PC Magazine Winbench (3.1) doing the scroll text
+test the speed gain is significative.
+
+3) My Previous patch to disable backing storage in fullscreen
+
+Status:
+1) is not relevant any more, since rdesktop only uses backing store if
+the Xserver does not provide backing store.
+Need to examine if 2) and 3) are still useful. TBD.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/francisco_fix_patblt.html
+Description:
+The colors in patterns drawn with "pattern blt" order was inverted (fg
+& bg). (See the background of the yellow help banners)
+Status:
+Applied (in revision 1.29, 2002/07/14)
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/frank_1linerfix.html
+Description:
+ui_create_glyph was not called with ipattern.
+Status:
+Applied (in revision 1.29, 2002/07/14).
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/frank_fasttext.patch.txt
+Description:
+Some kind of performence improvements.
+Status:
+From what I can tell, this patch is no longer necessary.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/hostname-patch
+Description:
+(From http://mail.rdesktop.org/archive/2001/msg00163.html):
+
+rdesktop uses gethostname to figure out the hostname, but gethostname
+under linux returns an error when the hostname is longer than the
+buffer. This hack gives gethostname a 64 char buffer and then strips
+the first 16 chars or upto the first '.' and puts the result in
+hostname[16].
+
+Status:
+Applied in version 1.10 of rdesktop.c.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/hove-19-7-2endian.diff
+Description:
+Includes a program for testing endianness.
+Status:
+rdesktop determines endianness at runtime. This patch is not needed
+anymore.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/mmihalik_19-7-3-keyfix-4.patch
+Description:
+Some kind of new alternative keyboard mapping imlementation.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/norbert_fullscreen.patch
+Description:
+Fullscreen mode.
+Status:
+Applied.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/norbert_percent.txt
+Description:
+Makes is possible to specify RDP geometry based a percent value of the
+current desktop size.
+Status:
+Not applied. I don't think many people will need this.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/norbert_rdp_tcp_port.diff
+Description:
+Command line tcp port argument.
+Status:
+Applied.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/patch19-7-2.xyPos.emptyPassword.patch
+Description:
+This patch adds:
+1) Support for empty passwords
+2) Support for asking for password interactively
+3) Support for +<xoff>+<yoff> geometry.
+
+Status:
+1) and 2) can be solved by the -P parameter; patch not needed.
+Functionality for 3) is currently missing.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-1.0.0-19-7-1-mmihalik-3.diff
+Description:
+Defines DO_GLYPH() etc.
+Status:
+As far as I understand, this patch is applied.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-1.0.0-mmihalik-1.diff
+Description:
+Misc drawing changes.
+Status:
+As far as I understand, this patch is applied.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-1.0.0-pl19-7-2-mmihalik-1.diff
+Description:
+Some kind of new alternative keyboard mapping implementation.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-gmp.patch
+Description:
+Use GMP for RSA crypto.
+Status:
+Not needed since rdesktop now use OpenSSL for all of the crypto.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-new_kb.patch
+Description:
+Modifies one of the old keyboard mapping implementations in some way.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-openssl.patch
+Description:
+Support for linking rdesktop with OpenSSL.
+Status:
+Not needed anymore, rdesktop can optionally use system
+OpenSSL.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop.vncviewer_patch
+Description:
+Hack for making the old (broken) keyboard mapping implementation work
+with the VNC Xserver.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop_keymap.patch
+Description:
+Some kind of new alternative keyboard mapping implementation.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdp-srvr-19-6-6.diff
+Description:
+Basic RDP server.
+Status:
+Not applied.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/scroll-to-death-patch.txt
+Description:
+Fixes scroll-to-death problem in Excel and other applications.
+Status:
+Not needed; fixed in another way in recent versions of rdesktop.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/spark-manpage-patch-19.4
+Description:
+Adds a manual page.
+Status:
+Not needed; rdesktop contains a manual page now.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/spark-manpage-patch-19.4-1
+Description:
+Adds a manual page.
+Status:
+Not needed; rdesktop contains a manual page now.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/spark_xinerama-patch2
+Description:
+Adds XINERAMA support to rdesktop.
+Status:
+Not applied yet. TBD.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/svenni_dis_wmkeybnds.patch
+Description:
+Commandline flag to disable keyboard grabbing.
+Status:
+Applied.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/svenni_disable_bs_in_x-tiny-patch
+Description:
+Disables backing store for TinyX.
+Status:
+As far as I understand, this patch is not need any longer.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/vincent_19-7-2.license.patch
+Description:
+TBD
+Status:
+Not yet examined.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/vincent_19-7-2.secure.patch
+Description:
+Fixes a problem during the connection to a French NT4 TSE (a French
+NT4 TSE doesn't use encryptation).
+Status:
+Applied.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/vincent_19-7-3_excel.patch
+Description:
+Makes matrixes appear better, such as those found in Excel/toad etc.
+Status:
+Applied.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/vincent_8bpp.patch
+Description:
+Support a 8bpp display (256 colours).
+Status:
+An enhanced version is included in rdesktop; this patch is not needed any more.
+
+
+URL:
+http://bibl4.oru.se/projects/rdesktop/patch19/patches/vpypatch.txt
+Description:
+Various changes for one of the old keyboard stuff.
+Status:
+Not needed anymore, with the new keyboard mapping implementation.
--- /dev/null
+.TH rdesktop 1 "November 2005"
+.SH NAME
+.I rdesktop
+\- Remote Desktop Protocol client
+.SH SYNOPSIS
+.B rdesktop [options] server[:port]
+.br
+.SH DESCRIPTION
+.I rdesktop
+is a client for Remote Desktop Protocol (RDP), used in a number of Microsoft
+products including Windows NT Terminal Server, Windows 2000 Server, Windows XP
+and Windows 2003 Server.
+
+.SH OPTIONS
+.TP
+.BR "-u <username>"
+Username for authentication on the server.
+.TP
+.BR "-d <domain>"
+Domain for authentication.
+.TP
+.BR "-s <shell>"
+Startup shell for the user - starts a specific application instead of Explorer.
+.TP
+.BR "-c <directory>"
+The initial working directory for the user. Often used in combination with -s
+to set up a fixed login environment.
+.TP
+.BR "-p <password>"
+The password to authenticate with. Note that this may have no effect if
+"Always prompt for password" is enabled on the server. WARNING: if you specify
+a password on the command line it may be visible to other users when they use
+tools like ps. Use -p - to make rdesktop request a password at startup (from
+standard input).
+.TP
+.BR "-n <hostname>"
+Client hostname. Normally rdesktop automatically obtains the hostname of the
+client.
+.TP
+.BR "-k <keyboard-map>"
+Keyboard layout to emulate. This requires a corresponding keymap file to be
+installed. The standard keymaps provided with rdesktop follow the RFC1766
+naming scheme: a language code followed by a country code if necessary - e.g.
+en-us, en-gb, de, fr, sv, etc.
+
+The default keyboard map depends on the current locale (LC_* and LANG
+environment variables). If the current locale is unknown, the default
+keyboard map is en-us (a US English keyboard).
+
+The keyboard maps are file names, which means that they are case
+sensitive. The standard keymaps are all in lowercase.
+
+The keyboard maps are searched relative to the directories
+$HOME/.rdesktop/keymaps, KEYMAP_PATH (specified at build time), and
+$CWD/keymaps, in this order. The keyboard-map argument can also be an
+absolute filename.
+
+The special value `none' can be used instead of a keyboard map.
+In this case, rdesktop will guess the scancodes from the X11 event key
+codes using an internal mapping method. This method only supports the
+basic alphanumeric keys and may not work properly on all platforms
+so its use is discouraged.
+.TP
+.BR "-g <geometry>"
+Desktop geometry (WxH). If geometry is the special word "workarea", the geometry
+will be fetched from the extended window manager hints property _NET_WORKAREA, from
+the root window. The geometry can also be specified as a percentage of the whole
+screen, e.g. "-g 80%".
+.TP
+.BR "-f"
+Enable fullscreen mode. This overrides the window manager and causes the
+rdesktop window to fully cover the current screen. Fullscreen mode can be
+toggled at any time using Ctrl-Alt-Enter.
+.TP
+.BR "-b"
+Force the server to send screen updates as bitmaps rather than using
+higher-level drawing operations.
+.TP
+.BR "-A"
+Enable SeamlessRDP. In this mode, rdesktop creates a X11 window for
+each window on the server side. This mode requires the SeamlessRDP
+server side component. When using this option, you should specify a
+startup shell which launches the desired application through
+SeamlessRDP. Example: rdesktop -A -s 'seamlessrdpshell notepad'.
+.TP
+.BR "-B"
+Use the BackingStore of the Xserver instead of the integrated one in
+rdesktop.
+.TP
+.BR "-e"
+Disable encryption. This option is only needed (and will only work) if you
+have a French version of NT TSE.
+.TP
+.BR "-E"
+Disable encryption from client to server. This sends an encrypted login packet,
+but everything after this is unencrypted (including interactive logins).
+.TP
+.BR "-m"
+Do not send mouse motion events. This saves bandwidth, although some Windows
+applications may rely on receiving mouse motion.
+.TP
+.BR "-C"
+Use private colourmap. This will improve colour accuracy on an 8-bit display,
+but rdesktop will appear in false colour when not focused.
+.TP
+.BR "-D"
+Hide window manager decorations, by using MWM hints.
+.TP
+.BR "-K"
+Do not override window manager key bindings. By default rdesktop attempts
+to grab all keyboard input when it is in focus.
+.TP
+.BR "-S <button size>"
+Enable single application mode. This option can be used when running a
+single, maximized application (via -s). When the minimize button of
+the windows application is pressed, the rdesktop window is minimized
+instead of the remote application. The maximize/restore button is
+disabled. For this to work, you must specify the correct button
+size, in pixels. The special word "standard" means 18 pixels.
+.TP
+.BR "-T <title>"
+Sets the window title.
+.TP
+.BR "-N"
+Enable numlock syncronization between the Xserver and the remote RDP
+session. This is useful with applications that looks at the numlock
+state, but might cause problems with some Xservers like Xvnc.
+.TP
+.BR "-X <windowid>"
+Embed rdesktop-window in another window. The windowid is expected to
+be decimal or hexadecimal (prefixed by 0x).
+.TP
+.BR "-a <bpp>"
+Sets the colour depth for the connection (8, 15, 16 or 24).
+More than 8 bpp are only supported when connecting to Windows XP
+(up to 16 bpp) or newer. Note that the colour depth may also be
+limited by the server configuration. The default value is the depth
+of the root window.
+.TP
+.BR "-z"
+Enable compression of the RDP datastream.
+.TP
+.BR "-x <experience>"
+Changes default bandwidth performance behaviour for RDP5. By default only
+theming is enabled, and all other options are disabled (corresponding
+to modem (56 Kbps)). Setting experience to b[roadband] enables menu
+animations and full window dragging. Setting experience to l[an] will
+also enable the desktop wallpaper. Setting experience to m[odem]
+disables all (including themes). Experience can also be a hexidecimal
+number containing the flags.
+.TP
+.BR "-P"
+Enable caching of bitmaps to disk (persistent bitmap caching). This generally
+improves performance (especially on low bandwidth connections) and reduces
+network traffic at the cost of slightly longer startup and some disk space.
+(10MB for 8-bit colour, 20MB for 15/16-bit colour and 30MB for 24-bit colour
+sessions)
+.TP
+.BR "-r <device>"
+Enable redirection of the specified device on the client, such
+that it appears on the server. Note that the allowed
+redirections may be restricted by the server configuration.
+
+Following devices are currently supported:
+.TP
+.BR "-r comport:<comport>=<device>,..."
+Redirects serial devices on your client to the
+server. Note that if you need to change any settings on the serial device(s),
+do so with an appropriate tool before starting rdesktop. In most
+OSes you would use stty. Bidirectional/Read support requires Windows XP or newer.
+In Windows 2000 it will create a port, but it's not seamless, most
+shell programs will not work with it.
+.TP
+.BR "-r disk:<sharename>=<path>,..."
+Redirects a path to the share \\\\tsclient\\<sharename> on the server
+(requires Windows XP or newer). The share name is limited to 8
+characters.
+.TP
+.BR "-r lptport:<lptport>=<device>,..."
+Redirects parallel devices on your client to the server.
+Bidirectional/Read support requires Windows XP or newer. In Windows 2000
+it will create a port, but it's not seamless, most shell programs will not work with
+it.
+.TP
+.BR "-r printer:<printername>[=<driver>],..."
+Redirects a printer queue on the client to the server. The <printername>
+is the name of the queue in your local system. <driver> defaults to a
+simple PS-driver unless you specify one. Keep in mind that you need a
+100% match in the server environment, or the driver will fail. The first
+printer on the command line will be set as your default printer.
+.TP
+.BR "-r sound:[local|off|remote]"
+Redirects sound generated on the server to the client. "remote" only has
+any effect when you connect to the console with the -0 option. (Requires
+Windows XP or newer).
+.TP
+.BR "-r lspci"
+Activates the lspci channel, which allows the server to enumerate the
+clients PCI devices. See the file lspci-channel.txt in the
+documentation for more information.
+.TP
+.BR "-0"
+Attach to the console of the server (requires Windows Server 2003
+or newer).
+.TP
+.BR "-4"
+Use RDP version 4.
+.TP
+.BR "-5"
+Use RDP version 5 (default).
+.PP
+.SH LINKS
+Main website of rdesktop
+.br
+\fIhttp://www.rdesktop.org/
+.LP
+.PP
--- /dev/null
+
+Syntax for configuring RDP redirection modules
+==============================================
+
+General
+-------
+
+All redirection is configured using the -r option. The general syntax
+is:
+
+-r <module>:<string>
+
+<module> is the name of the redirection module. The following names
+are valid: disk, printer, lptport, comport, clipboard, sound.
+
+<string> is interpreted by each redirection module.
+
+The redirection modules are described below.
+
+
+disk mapping
+-------------
+Multiple mappings possible: yes
+Default: no disk redirected
+Syntax: -r disk:<sharename>=<path>
+Example: -r disk:home=/home/johndoe
+
+
+printer mapping
+---------------
+Multiple mappings possible: yes
+Default: no printers redirected
+Syntax: -r printer:<printername>
+Example: -r printer:mydeskjet
+
+
+
+LPT port mapping
+----------------
+Multiple mappings possible: yes
+Default: no LPT ports redirected
+Syntax: -r lptport:<lptport>=<device>
+Example: -r lptport:LPT1=/dev/lp0
+
+
+COM port mapping
+----------------
+Multiple mappings possible: yes
+Default: no COM ports redirected
+Syntax: -r comport:<comport>=<device>
+Example: -r comport:COM1=/dev/ttyS0
+
+
+clipboard mapping
+-----------------
+Multiple mappings possible: no
+Default: yes
+Syntax: -r clipboard:[yes|no]
+Example: -r clipboard:no
+
+
+sound mapping
+-------------
+Multiple mappings possible: no
+Default: off
+Syntax: -r sound:[local|off|remote]
+
+"local" means "Bring to this computer"
+"off" means "Do not play"
+"remote" means "Leave at remote computer"
+
+Example: -r sound:remote
+
+
--- /dev/null
+TODO
+----
+
+* Command for executing new programs.
+
+* Commands for changing z order and focus.
+
+* Command for transferring icon.
+
+* Think about protocol version management
+
+* Try to assure that messages aren't repeated or are sent for hidden windows.
+
+Overview
+========
+
+The protocol is a line based protocol following this simple syntax:
+
+ OPERATION,SERIAL[,ARG1[,ARG2,[...]]]
+
+Each operation will have an increasing serial number. The initial value is
+implementation defined.
+
+The goal is to have a generic protocol that can be used for other display
+systems (e.g. VNC) as well.
+
+One line may not exceed 1024 bytes, including newline.
+
+The protocol has no concept of hidden or unmapped windows. A window does not
+exist unless it is visible. Note that a minimized window is an exception to
+this rule.
+
+The protocol has no way of indicating failure, meaning that all commands are
+expected to succeed. If a command fails, the receiving end must send a
+corresponding command back, indicating the actual state.
+
+Data types
+==========
+Window ID are written in hex, like 0x4321.
+
+Window positions can be negative. This happens when a window is moved
+outside the desktop.
+
+All integers fit inside 32 bits.
+
+Strings are sent in UTF-8 and do not contain any characters less than 0x20 or
+the character , (comma).
+
+Server to Client Operations
+===========================
+
+CREATE
+------
+
+Allocate structures for a new window.
+
+Syntax:
+ CREATE,<SERIAL>,<ID>,<GRPID>,<PARENT>,<FLAGS>
+
+Indicates that a window has appeared on the server. If PARENT is non-zero then
+the new window is a child of that window (it's transient for it). The special
+value 0xFFFFFFFF for PARENT means that the window is a popup window without a
+parent. It's commonly used for splash screens, tool tips and context menus.
+
+The group id identifies a set of windows that belong together. It is currently
+only used for modal windows and DESTROYGRP.
+
+Flags:
+ 0x0001 : Create a window that's modal with regard to the other windows
+ in the same group.
+
+Note that very little information is included in this message. Things like
+title and state will come in subsequent messages. This message should only
+be used to allocate data structures for the new window.
+
+DESTROY
+-------
+
+Remove a window.
+
+Syntax:
+ DESTROY,<SERIAL>,<ID>,<FLAGS>
+
+Remove the window and deallocate all associated structures.
+
+DESTROYGRP
+----------
+
+Destroy an entire group of windows.
+
+Syntax:
+ DESTROYGRP,<SERIAL>,<GRPID>,<FLAGS>
+
+Every window that belongs to the group GRPID should be destroyed as if they
+each got a DESTROY message.
+
+POSITION
+--------
+
+Move and/or resize a window.
+
+Syntax:
+ POSITION,<SERIAL>,<ID>,<X>,<Y>,<WIDTH>,<HEIGHT>,<FLAGS>
+
+If the window isn't visible yet (because a
+STATE hasn't been set or because it's minimized), you must store the position
+and size. A new POSITION is not guaranteed to be sent when the window changes
+state.
+
+TITLE
+-----
+
+Sets a window title.
+
+Syntax:
+ TITLE,<SERIAL>,<ID>,<TITLE>,<FLAGS>
+
+The text is guaranteed to be stripped of control characters (< 0x20).
+
+Note that this has the same requirement as POSITION, that the title needs to
+be stored for newly created windows until a STATE is sent. It is however not
+guaranteed that a TITLE will be sent before the first STATE.
+
+
+ZCHANGE
+-------
+
+The window moved in z order.
+
+Syntax:
+ ZCHANGE,<SERIAL>,<ID>,<BEHIND>,<FLAGS>
+
+The window with the id ID is behind the window with the id BEHIND. If
+BEHIND is 0, then this window should be brought to the front.
+
+STATE
+-----
+
+Changes the window's state and/or title.
+
+Syntax:
+ STATE,<SERIAL>,<ID>,<STATE>,<FLAGS>
+
+State can have one of three values:
+ 0 : "Normal" window.
+ 1 : Minimized.
+ 2 : Maximized.
+
+The initial STATE for a window will always be preceeded by one CREATE and one
+POSITION. Optionally, a TITLE may also be sent before the first STATE.
+
+DEBUG
+-----
+
+Debug output from the server component.
+
+Syntax:
+ DEBUG,<SERIAL>,<STRING>
+
+Used for debugging.
+
+SYNCBEGIN
+---------
+
+Indicates that a synchronisation has begun.
+
+Syntax:
+ SYNCBEGIN,<SERIAL>,<FLAGS>
+
+Sent when the server starts a synchronisation. The client should flush all
+information at this point.
+
+SYNCEND
+-------
+
+Indicates that a synchronisation is complete.
+
+Syntac:
+ SYNCEND,<SERIAL>,<FLAGS>
+
+Sent when the last message that is part of the synchronisation has been sent.
+This may be followed by duplicate messages and/or messages referring invalid
+windows that were queued up during the synchronisation.
+
+HELLO
+-----
+
+Initial message sent by server.
+
+Syntax:
+ HELLO,<SERIAL>,<FLAGS>
+
+The server starts each connection by sending this message. Normally the client
+will react by sending a SYNC back to the server.
+
+Flags:
+ 0x0001 : This is a reconnect to an existing session.
+ 0x0002 : The desktop is currently hidden (see HIDE).
+
+ACK
+---
+
+Acknowledgement of a request to manipulate a window.
+
+Syntax:
+ ACK,<SERIAL>,<ACKSERIAL>
+
+Whenever one of the commands POSITION, ZCHANGE, STATE or FOCUS is executed on
+the server, the server will send an ACK back to the client. The purpose of this
+is to inform the client of when the operation was actually performed, allowing
+high latencies in the channel.
+
+HIDE
+----
+
+The desktop has become hidden on the server.
+
+Syntax:
+ HIDE,<SERIAL>,<FLAGS>
+
+This message is sent when the desktop on the server is obscured by something
+that cannot be tracked. The client should remove all windows and display the
+entire desktop, allowing the user to handle whatever is blocking the view.
+
+Note that updates to windows will still be sent as the windows still exist on
+the server, they are merely not visible.
+
+UNHIDE
+------
+
+The desktop has been restored on the server.
+
+Syntax:
+ UNHIDE,<SERIAL>,<FLAGS>
+
+This message is sent some time after a HIDE, indicating that the windowed view
+has been restored. If the client has dropped all information about windows then
+it can send a SYNC to re-enumerate them.
+
+Client to Server Operations
+===========================
+
+SYNC
+----
+
+Request a synchronisation of window information.
+
+Syntax:
+ SYNC,<SERIAL>,<FLAGS>
+
+For each window, the server will send CREATE, POSITION and STATE, in that
+order, just as if the window was created. Note that a TITLE may also,
+optionally, be sent before the STATE.
+
+POSITION
+--------
+
+Identical to the command sent from server to client.
+
+TITLE
+-----
+
+Identical to the command sent from server to client.
+
+ZCHANGE
+-------
+
+Identical to the command sent from server to client.
+
+STATE
+-----
+
+Identical to the command sent from server to client.
+
+FOCUS
+-----
+
+Sets which window has input focus.
+
+Syntax:
+ FOCUS,<SERIAL>,<ID>,<FLAGS>
+
+Changes which window that will recieve the keyboard events. Note that this
+might cause the window to change z order.
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+
+ Support functions for Extended Window Manager Hints,
+ http://www.freedesktop.org/wiki/Standards_2fwm_2dspec
+
+ Copyright (C) Peter Astrand <astrand@cendio.se> 2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+#include "rdesktop.h"
+
+#define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
+#define _NET_WM_STATE_ADD 1 /* add/set property */
+#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
+
+/*
+ Get window property value (32 bit format)
+ Returns zero on success, -1 on error
+*/
+static int
+get_property_value(RDPCLIENT * This, Window wnd, char *propname, long max_length,
+ unsigned long *nitems_return, unsigned char **prop_return, int nowarn)
+{
+ int result;
+ Atom property;
+ Atom actual_type_return;
+ int actual_format_return;
+ unsigned long bytes_after_return;
+
+ property = XInternAtom(This->display, propname, True);
+ if (property == None)
+ {
+ fprintf(stderr, "Atom %s does not exist\n", propname);
+ return (-1);
+ }
+
+ result = XGetWindowProperty(This->display, wnd, property, 0, /* long_offset */
+ max_length, /* long_length */
+ False, /* delete */
+ AnyPropertyType, /* req_type */
+ &actual_type_return,
+ &actual_format_return,
+ nitems_return, &bytes_after_return, prop_return);
+
+ if (result != Success)
+ {
+ fprintf(stderr, "XGetWindowProperty failed\n");
+ return (-1);
+ }
+
+ if (actual_type_return == None || actual_format_return == 0)
+ {
+ if (!nowarn)
+ fprintf(stderr, "Window is missing property %s\n", propname);
+ return (-1);
+ }
+
+ if (bytes_after_return)
+ {
+ fprintf(stderr, "%s is too big for me\n", propname);
+ return (-1);
+ }
+
+ if (actual_format_return != 32)
+ {
+ fprintf(stderr, "%s has bad format\n", propname);
+ return (-1);
+ }
+
+ return (0);
+}
+
+/*
+ Get current desktop number
+ Returns -1 on error
+*/
+static int
+get_current_desktop(RDPCLIENT * This)
+{
+ unsigned long nitems_return;
+ unsigned char *prop_return;
+ int current_desktop;
+
+ if (get_property_value
+ (This, DefaultRootWindow(This->display), "_NET_CURRENT_DESKTOP", 1, &nitems_return,
+ &prop_return, 0) < 0)
+ return (-1);
+
+ if (nitems_return != 1)
+ {
+ fprintf(stderr, "_NET_CURRENT_DESKTOP has bad length\n");
+ return (-1);
+ }
+
+ current_desktop = *prop_return;
+ XFree(prop_return);
+ return current_desktop;
+}
+
+/*
+ Get workarea geometry
+ Returns zero on success, -1 on error
+ */
+
+int
+get_current_workarea(RDPCLIENT * This, uint32 * x, uint32 * y, uint32 * width, uint32 * height)
+{
+ int current_desktop;
+ unsigned long nitems_return;
+ unsigned char *prop_return;
+ uint32 *return_words;
+ const uint32 net_workarea_x_offset = 0;
+ const uint32 net_workarea_y_offset = 1;
+ const uint32 net_workarea_width_offset = 2;
+ const uint32 net_workarea_height_offset = 3;
+ const uint32 max_prop_length = 32 * 4; /* Max 32 desktops */
+
+ if (get_property_value
+ (This, DefaultRootWindow(This->display), "_NET_WORKAREA", max_prop_length, &nitems_return,
+ &prop_return, 0) < 0)
+ return (-1);
+
+ if (nitems_return % 4)
+ {
+ fprintf(stderr, "_NET_WORKAREA has odd length\n");
+ return (-1);
+ }
+
+ current_desktop = get_current_desktop(This);
+
+ if (current_desktop < 0)
+ return -1;
+
+ return_words = (uint32 *) prop_return;
+
+ *x = return_words[current_desktop * 4 + net_workarea_x_offset];
+ *y = return_words[current_desktop * 4 + net_workarea_y_offset];
+ *width = return_words[current_desktop * 4 + net_workarea_width_offset];
+ *height = return_words[current_desktop * 4 + net_workarea_height_offset];
+
+ XFree(prop_return);
+
+ return (0);
+
+}
+
+
+
+void
+ewmh_init(RDPCLIENT * This)
+{
+ /* FIXME: Use XInternAtoms */
+ This->ewmhints.state_maximized_vert_atom =
+ XInternAtom(This->display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
+ This->ewmhints.state_maximized_horz_atom =
+ XInternAtom(This->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+ This->ewmhints.state_hidden_atom = XInternAtom(This->display, "_NET_WM_STATE_HIDDEN", False);
+ This->ewmhints.state_skip_taskbar_atom =
+ XInternAtom(This->display, "_NET_WM_STATE_SKIP_TASKBAR", False);
+ This->ewmhints.state_skip_pager_atom = XInternAtom(This->display, "_NET_WM_STATE_SKIP_PAGER", False);
+ This->ewmhints.state_modal_atom = XInternAtom(This->display, "_NET_WM_STATE_MODAL", False);
+ This->net_wm_state_atom = XInternAtom(This->display, "_NET_WM_STATE", False);
+ This->net_wm_desktop_atom = XInternAtom(This->display, "_NET_WM_DESKTOP", False);
+ This->ewmhints.name_atom = XInternAtom(This->display, "_NET_WM_NAME", False);
+ This->ewmhints.utf8_string_atom = XInternAtom(This->display, "UTF8_STRING", False);
+}
+
+
+/*
+ Get the window state: normal/minimized/maximized.
+*/
+#ifndef MAKE_PROTO
+int
+ewmh_get_window_state(RDPCLIENT * This, Window w)
+{
+ unsigned long nitems_return;
+ unsigned char *prop_return;
+ uint32 *return_words;
+ unsigned long item;
+ BOOL maximized_vert, maximized_horz, hidden;
+
+ maximized_vert = maximized_horz = hidden = False;
+
+ if (get_property_value(This, w, "_NET_WM_STATE", 64, &nitems_return, &prop_return, 0) < 0)
+ return SEAMLESSRDP_NORMAL;
+
+ return_words = (uint32 *) prop_return;
+
+ for (item = 0; item < nitems_return; item++)
+ {
+ if (return_words[item] == This->ewmhints.state_maximized_vert_atom)
+ maximized_vert = True;
+ if (return_words[item] == This->ewmhints.state_maximized_horz_atom)
+ maximized_horz = True;
+ if (return_words[item] == This->ewmhints.state_hidden_atom)
+ hidden = True;
+ }
+
+ XFree(prop_return);
+
+ if (maximized_vert && maximized_horz)
+ return SEAMLESSRDP_MAXIMIZED;
+ else if (hidden)
+ return SEAMLESSRDP_MINIMIZED;
+ else
+ return SEAMLESSRDP_NORMAL;
+}
+
+static int
+ewmh_modify_state(RDPCLIENT * This, Window wnd, int add, Atom atom1, Atom atom2)
+{
+ Status status;
+ XEvent xevent;
+
+ int result;
+ unsigned long nitems;
+ unsigned char *props;
+ uint32 state = WithdrawnState;
+
+ /* The spec states that the window manager must respect any
+ _NET_WM_STATE attributes on a withdrawn window. In order words, we
+ modify the attributes directly for withdrawn windows and ask the WM
+ to do it for active windows. */
+ result = get_property_value(This, wnd, "WM_STATE", 64, &nitems, &props, 1);
+ if ((result >= 0) && nitems)
+ {
+ state = *(uint32 *) props;
+ XFree(props);
+ }
+
+ if (state == WithdrawnState)
+ {
+ if (add)
+ {
+ Atom atoms[2];
+
+ atoms[0] = atom1;
+ nitems = 1;
+ if (atom2)
+ {
+ atoms[1] = atom2;
+ nitems = 2;
+ }
+
+ XChangeProperty(This->display, wnd, This->net_wm_state_atom, XA_ATOM,
+ 32, PropModeAppend, (unsigned char *) atoms, nitems);
+ }
+ else
+ {
+ Atom *atoms;
+ int i;
+
+ if (get_property_value(This, wnd, "_NET_WM_STATE", 64, &nitems, &props, 1) < 0)
+ return 0;
+
+ atoms = (Atom *) props;
+
+ for (i = 0; i < nitems; i++)
+ {
+ if ((atoms[i] == atom1) || (atom2 && (atoms[i] == atom2)))
+ {
+ if (i != (nitems - 1))
+ memmove(&atoms[i], &atoms[i + 1],
+ sizeof(Atom) * (nitems - i - 1));
+ nitems--;
+ i--;
+ }
+ }
+
+ XChangeProperty(This->display, wnd, This->net_wm_state_atom, XA_ATOM,
+ 32, PropModeReplace, (unsigned char *) atoms, nitems);
+
+ XFree(props);
+ }
+
+ return 0;
+ }
+
+ xevent.type = ClientMessage;
+ xevent.xclient.window = wnd;
+ xevent.xclient.message_type = This->net_wm_state_atom;
+ xevent.xclient.format = 32;
+ if (add)
+ xevent.xclient.data.l[0] = _NET_WM_STATE_ADD;
+ else
+ xevent.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
+ xevent.xclient.data.l[1] = atom1;
+ xevent.xclient.data.l[2] = atom2;
+ xevent.xclient.data.l[3] = 0;
+ xevent.xclient.data.l[4] = 0;
+ status = XSendEvent(This->display, DefaultRootWindow(This->display), False,
+ SubstructureNotifyMask | SubstructureRedirectMask, &xevent);
+ if (!status)
+ return -1;
+
+ return 0;
+}
+
+/*
+ Set the window state: normal/minimized/maximized.
+ Returns -1 on failure.
+*/
+int
+ewmh_change_state(RDPCLIENT * This, Window wnd, int state)
+{
+ /*
+ * Deal with the max atoms
+ */
+ if (state == SEAMLESSRDP_MAXIMIZED)
+ {
+ if (ewmh_modify_state
+ (This, wnd, 1, This->ewmhints.state_maximized_vert_atom,
+ This->ewmhints.state_maximized_horz_atom) < 0)
+ return -1;
+ }
+ else
+ {
+ if (ewmh_modify_state
+ (This, wnd, 0, This->ewmhints.state_maximized_vert_atom,
+ This->ewmhints.state_maximized_horz_atom) < 0)
+ return -1;
+ }
+
+ return 0;
+}
+
+
+int
+ewmh_get_window_desktop(RDPCLIENT * This, Window wnd)
+{
+ unsigned long nitems_return;
+ unsigned char *prop_return;
+ int desktop;
+
+ if (get_property_value(This, wnd, "_NET_WM_DESKTOP", 1, &nitems_return, &prop_return, 0) < 0)
+ return (-1);
+
+ if (nitems_return != 1)
+ {
+ fprintf(stderr, "_NET_WM_DESKTOP has bad length\n");
+ return (-1);
+ }
+
+ desktop = *prop_return;
+ XFree(prop_return);
+ return desktop;
+}
+
+
+int
+ewmh_move_to_desktop(RDPCLIENT * This, Window wnd, unsigned int desktop)
+{
+ Status status;
+ XEvent xevent;
+
+ xevent.type = ClientMessage;
+ xevent.xclient.window = wnd;
+ xevent.xclient.message_type = This->net_wm_desktop_atom;
+ xevent.xclient.format = 32;
+ xevent.xclient.data.l[0] = desktop;
+ xevent.xclient.data.l[1] = 0;
+ xevent.xclient.data.l[2] = 0;
+ xevent.xclient.data.l[3] = 0;
+ xevent.xclient.data.l[4] = 0;
+ status = XSendEvent(This->display, DefaultRootWindow(This->display), False,
+ SubstructureNotifyMask | SubstructureRedirectMask, &xevent);
+ if (!status)
+ return -1;
+
+ return 0;
+}
+
+void
+ewmh_set_wm_name(RDPCLIENT * This, Window wnd, const char *title)
+{
+ int len;
+
+ len = strlen(title);
+ XChangeProperty(This->display, wnd, This->ewmhints.name_atom, This->ewmhints.utf8_string_atom,
+ 8, PropModeReplace, (unsigned char *) title, len);
+}
+
+
+int
+ewmh_set_window_popup(RDPCLIENT * This, Window wnd)
+{
+ if (ewmh_modify_state
+ (This, wnd, 1, This->ewmhints.state_skip_taskbar_atom, This->ewmhints.state_skip_pager_atom) < 0)
+ return -1;
+ return 0;
+}
+
+int
+ewmh_set_window_modal(RDPCLIENT * This, Window wnd)
+{
+ if (ewmh_modify_state(This, wnd, 1, This->ewmhints.state_modal_atom, 0) < 0)
+ return -1;
+ return 0;
+}
+
+#endif /* MAKE_PROTO */
+
+
+#if 0
+
+/* FIXME: _NET_MOVERESIZE_WINDOW is for pagers, not for
+ applications. We should implement _NET_WM_MOVERESIZE instead */
+
+int
+ewmh_net_moveresize_window(RDPCLIENT * This, Window wnd, int x, int y, int width, int height)
+{
+ Status status;
+ XEvent xevent;
+ Atom moveresize;
+
+ moveresize = XInternAtom(This->display, "_NET_MOVERESIZE_WINDOW", False);
+ if (!moveresize)
+ {
+ return -1;
+ }
+
+ xevent.type = ClientMessage;
+ xevent.xclient.window = wnd;
+ xevent.xclient.message_type = moveresize;
+ xevent.xclient.format = 32;
+ xevent.xclient.data.l[0] = StaticGravity | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11);
+ xevent.xclient.data.l[1] = x;
+ xevent.xclient.data.l[2] = y;
+ xevent.xclient.data.l[3] = width;
+ xevent.xclient.data.l[4] = height;
+
+ status = XSendEvent(This->display, DefaultRootWindow(This->display), False,
+ SubstructureNotifyMask | SubstructureRedirectMask, &xevent);
+ if (!status)
+ return -1;
+ return 0;
+}
+
+#endif
--- /dev/null
+#!/bin/sh
+indent -bli0 -i8 -cli8 -npcs -l100 *.h *.c vnc/*.h vnc/*.c
+
--- /dev/null
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ :
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=$mkdirprog
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f "$src" ] || [ -d "$src" ]
+ then
+ :
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ :
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ :
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+ '
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ :
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ :
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - ISO layer
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+/* Send a self-contained ISO PDU */
+static BOOL
+iso_send_msg(RDPCLIENT * This, uint8 code)
+{
+ STREAM s;
+
+ s = tcp_init(This, 11);
+
+ if(s == NULL)
+ return False;
+
+ out_uint8(s, 3); /* version */
+ out_uint8(s, 0); /* reserved */
+ out_uint16_be(s, 11); /* length */
+
+ out_uint8(s, 6); /* hdrlen */
+ out_uint8(s, code);
+ out_uint16(s, 0); /* dst_ref */
+ out_uint16(s, 0); /* src_ref */
+ out_uint8(s, 0); /* class */
+
+ s_mark_end(s);
+ return tcp_send(This, s);
+}
+
+static BOOL
+iso_send_connection_request(RDPCLIENT * This, char *cookie)
+{
+ STREAM s;
+ int cookielen = (int)strlen(cookie);
+ int length = 11 + cookielen;
+
+ s = tcp_init(This, length);
+
+ if(s == NULL)
+ return False;
+
+ out_uint8(s, 3); /* version */
+ out_uint8(s, 0); /* reserved */
+ out_uint16_be(s, length); /* length */
+
+ out_uint8(s, length - 5); /* hdrlen */
+ out_uint8(s, ISO_PDU_CR);
+ out_uint16(s, 0); /* dst_ref */
+ out_uint16(s, 0); /* src_ref */
+ out_uint8(s, 0); /* class */
+
+ out_uint8p(s, cookie, cookielen);
+
+ s_mark_end(s);
+ return tcp_send(This, s);
+}
+
+/* Receive a message on the ISO layer, return code */
+static STREAM
+iso_recv_msg(RDPCLIENT * This, uint8 * code, uint8 * rdpver)
+{
+ STREAM s;
+ uint16 length;
+ uint8 version;
+
+ s = tcp_recv(This, NULL, 4);
+ if (s == NULL)
+ return NULL;
+ in_uint8(s, version);
+ if (rdpver != NULL)
+ *rdpver = version;
+ if (version == 3)
+ {
+ in_uint8s(s, 1); /* pad */
+ in_uint16_be(s, length);
+ }
+ else
+ {
+ in_uint8(s, length);
+ if (length & 0x80)
+ {
+ length &= ~0x80;
+ next_be(s, length);
+ }
+ }
+ s = tcp_recv(This, s, length - 4);
+ if (s == NULL)
+ return NULL;
+ if (version != 3)
+ return s;
+ in_uint8s(s, 1); /* hdrlen */
+ in_uint8(s, *code);
+ if (*code == ISO_PDU_DT)
+ {
+ in_uint8s(s, 1); /* eot */
+ return s;
+ }
+ in_uint8s(s, 5); /* dst_ref, src_ref, class */
+ return s;
+}
+
+/* Initialise ISO transport data packet */
+STREAM
+iso_init(RDPCLIENT * This, int length)
+{
+ STREAM s;
+
+ s = tcp_init(This, length + 7);
+
+ if(s == NULL)
+ return NULL;
+
+ s_push_layer(s, iso_hdr, 7);
+
+ return s;
+}
+
+/* Send an ISO data PDU */
+BOOL
+iso_send(RDPCLIENT * This, STREAM s)
+{
+ uint16 length;
+
+ s_pop_layer(s, iso_hdr);
+ length = (uint16)(s->end - s->p);
+
+ out_uint8(s, 3); /* version */
+ out_uint8(s, 0); /* reserved */
+ out_uint16_be(s, length);
+
+ out_uint8(s, 2); /* hdrlen */
+ out_uint8(s, ISO_PDU_DT); /* code */
+ out_uint8(s, 0x80); /* eot */
+
+ return tcp_send(This, s);
+}
+
+/* Receive ISO transport data packet */
+STREAM
+iso_recv(RDPCLIENT * This, uint8 * rdpver)
+{
+ STREAM s;
+ uint8 code = 0;
+
+ s = iso_recv_msg(This, &code, rdpver);
+ if (s == NULL)
+ return NULL;
+ if (rdpver != NULL)
+ if (*rdpver != 3)
+ return s;
+ if (code != ISO_PDU_DT)
+ {
+ error("expected DT, got 0x%x\n", code);
+ return NULL;
+ }
+ return s;
+}
+
+/* Establish a connection up to the ISO layer */
+BOOL
+iso_connect(RDPCLIENT * This, char *server, char *cookie)
+{
+ uint8 code = 0;
+
+ if (!tcp_connect(This, server))
+ return False;
+
+ if (!iso_send_connection_request(This, cookie))
+ return False;
+
+ if (iso_recv_msg(This, &code, NULL) == NULL)
+ return False;
+
+ if (code != ISO_PDU_CC)
+ {
+ error("expected CC, got 0x%x\n", code);
+ tcp_disconnect(This);
+ return False;
+ }
+
+ return True;
+}
+
+/* Establish a reconnection up to the ISO layer */
+BOOL
+iso_reconnect(RDPCLIENT * This, char *server, char *cookie)
+{
+ uint8 code = 0;
+
+ if (!tcp_connect(This, server))
+ return False;
+
+ if (!iso_send_connection_request(This, cookie)) // BUGBUG should we really pass the cookie here?
+ return False;
+
+ if (iso_recv_msg(This, &code, NULL) == NULL)
+ return False;
+
+ if (code != ISO_PDU_CC)
+ {
+ error("expected CC, got 0x%x\n", code);
+ tcp_disconnect(This);
+ return False;
+ }
+
+ return True;
+}
+
+/* Disconnect from the ISO layer */
+BOOL
+iso_disconnect(RDPCLIENT * This)
+{
+ iso_send_msg(This, ISO_PDU_DR);
+ return tcp_disconnect(This);
+}
+
+/* reset the state to support reconnecting */
+void
+iso_reset_state(RDPCLIENT * This)
+{
+ tcp_reset_state(This);
+}
--- /dev/null
+# generated from XKB map ar
+include common
+map 0x401
+exclam 0x02 shift
+at 0x03 shift
+numbersign 0x04 shift
+dollar 0x05 shift
+percent 0x06 shift
+asciicircum 0x07 shift
+ampersand 0x08 shift
+asterisk 0x09 shift
+parenleft 0x0a shift
+parenright 0x0b shift
+minus 0x0c
+underscore 0x0c shift
+equal 0x0d
+plus 0x0d shift
+Arabic_dad 0x10 altgr
+Arabic_fatha 0x10 shift altgr
+Arabic_sad 0x11 altgr
+Arabic_fathatan 0x11 shift altgr
+Arabic_theh 0x12 altgr
+Arabic_damma 0x12 shift altgr
+Arabic_qaf 0x13 altgr
+Arabic_dammatan 0x13 shift altgr
+Arabic_feh 0x14 altgr
+UFEF9 0x14 shift altgr
+Arabic_ghain 0x15 altgr
+Arabic_hamzaunderalef 0x15 shift altgr
+Arabic_ain 0x16 altgr
+grave 0x16 shift altgr
+Arabic_ha 0x17 altgr
+division 0x17 shift altgr
+Arabic_khah 0x18 altgr
+multiply 0x18 shift altgr
+Arabic_hah 0x19 altgr
+Arabic_semicolon 0x19 shift altgr
+bracketleft 0x1a
+braceleft 0x1a shift
+Arabic_jeem 0x1a altgr
+bracketright 0x1b
+braceright 0x1b shift
+Arabic_dal 0x1b altgr
+Arabic_sheen 0x1e altgr
+backslash 0x1e shift altgr
+Arabic_seen 0x1f altgr
+Arabic_yeh 0x20 altgr
+bracketleft 0x20 shift altgr
+Arabic_beh 0x21 altgr
+bracketright 0x21 shift altgr
+Arabic_lam 0x22 altgr
+UFEF7 0x22 shift altgr
+Arabic_alef 0x23 altgr
+Arabic_hamzaonalef 0x23 shift altgr
+Arabic_teh 0x24 altgr
+Arabic_tatweel 0x24 shift altgr
+Arabic_noon 0x25 altgr
+Arabic_comma 0x25 shift altgr
+Arabic_meem 0x26 altgr
+slash 0x26 shift altgr
+semicolon 0x27
+colon 0x27 shift
+Arabic_kaf 0x27 altgr
+apostrophe 0x28
+quotedbl 0x28 shift
+Arabic_tah 0x28 altgr
+grave 0x29
+asciitilde 0x29 shift
+Arabic_thal 0x29 altgr
+Arabic_shadda 0x29 shift altgr
+backslash 0x2b
+bar 0x2b shift
+less 0x2b altgr
+greater 0x2b shift altgr
+Arabic_hamzaonyeh 0x2c altgr
+asciitilde 0x2c shift altgr
+Arabic_hamza 0x2d altgr
+Arabic_sukun 0x2d shift altgr
+Arabic_hamzaonwaw 0x2e altgr
+Arabic_kasra 0x2e shift altgr
+Arabic_ra 0x2f altgr
+Arabic_kasratan 0x2f shift altgr
+UFEFB 0x30 altgr
+UFEF5 0x30 shift altgr
+Arabic_alefmaksura 0x31 altgr
+Arabic_maddaonalef 0x31 shift altgr
+Arabic_tehmarbuta 0x32 altgr
+apostrophe 0x32 shift altgr
+comma 0x33
+less 0x33 shift
+Arabic_waw 0x33 altgr
+period 0x34
+greater 0x34 shift
+Arabic_zain 0x34 altgr
+slash 0x35
+question 0x35 shift
+Arabic_zah 0x35 altgr
+Arabic_question_mark 0x35 shift altgr
--- /dev/null
+include modifiers
+
+#
+# Top row
+#
+1 0x2
+2 0x3
+3 0x4
+4 0x5
+5 0x6
+6 0x7
+7 0x8
+8 0x9
+9 0xa
+0 0xb
+BackSpace 0xe
+
+#
+# QWERTY first row
+#
+Tab 0xf localstate
+ISO_Left_Tab 0xf shift
+q 0x10 addupper
+w 0x11 addupper
+e 0x12 addupper
+sequence egrave dead_grave e
+sequence Egrave dead_grave E
+sequence eacute dead_acute e
+sequence Eacute dead_acute E
+sequence ecircumflex dead_circumflex e
+sequence Ecircumflex dead_circumflex E
+sequence ediaeresis dead_diaeresis e
+sequence Ediaeresis dead_diaeresis E
+r 0x13 addupper
+t 0x14 addupper
+y 0x15 addupper
+sequence ygrave dead_grave y
+sequence Ygrave dead_grave Y
+sequence yacute dead_acute y
+sequence Yacute dead_acute Y
+sequence ycircumflex dead_circumflex y
+sequence Ycircumflex dead_circumflex Y
+sequence ydiaeresis dead_diaeresis y
+sequence Ydiaeresis dead_diaeresis Y
+u 0x16 addupper
+sequence ugrave dead_grave u
+sequence Ugrave dead_grave U
+sequence uacute dead_acute u
+sequence Uacute dead_acute U
+sequence ucircumflex dead_circumflex u
+sequence Ucircumflex dead_circumflex U
+sequence udiaeresis dead_diaeresis u
+sequence Udiaeresis dead_diaeresis U
+i 0x17 addupper
+sequence igrave dead_grave i
+sequence Igrave dead_grave I
+sequence iacute dead_acute i
+sequence Iacute dead_acute I
+sequence icircumflex dead_circumflex i
+sequence Icircumflex dead_circumflex I
+sequence idiaeresis dead_diaeresis i
+sequence Idiaeresis dead_diaeresis I
+o 0x18 addupper
+sequence ograve dead_grave o
+sequence Ograve dead_grave O
+sequence oacute dead_acute o
+sequence Oacute dead_acute O
+sequence ocircumflex dead_circumflex o
+sequence Ocircumflex dead_circumflex O
+sequence odiaeresis dead_diaeresis o
+sequence Odiaeresis dead_diaeresis O
+sequence otilde dead_tilde o
+sequence Otilde dead_tilde O
+p 0x19 addupper
+
+#
+# QWERTY second row
+#
+a 0x1e addupper
+sequence agrave dead_grave a
+sequence Agrave dead_grave A
+sequence aacute dead_acute a
+sequence Aacute dead_acute A
+sequence acircumflex dead_circumflex a
+sequence Acircumflex dead_circumflex A
+sequence adiaeresis dead_diaeresis a
+sequence Adiaeresis dead_diaeresis A
+sequence aring dead_abovering a
+sequence Aring dead_abovering A
+sequence atilde dead_tilde a
+sequence Atilde dead_tilde A
+s 0x1f addupper
+d 0x20 addupper
+f 0x21 addupper
+g 0x22 addupper
+h 0x23 addupper
+j 0x24 addupper
+k 0x25 addupper
+l 0x26 addupper
+Return 0x1c localstate
+
+#
+# QWERTY third row
+#
+z 0x2c addupper
+x 0x2d addupper
+c 0x2e addupper
+sequence ccedilla dead_cedilla c
+sequence Ccedilla dead_cedilla C
+v 0x2f addupper
+b 0x30 addupper
+n 0x31 addupper
+sequence ntilde dead_tilde n
+sequence Ntilde dead_tilde N
+m 0x32 addupper
+
+space 0x39 localstate
+
+less 0x56
+greater 0x56 shift
+bar 0x56 altgr
+brokenbar 0x56 shift altgr
+
+#
+# Translations for some other dead keys
+#
+sequence asciitilde dead_tilde space
+sequence diaeresis dead_diaeresis space
+sequence asciicircum dead_circumflex space
+sequence apostrophe dead_acute space
+sequence grave dead_grave space
+sequence acute dead_acute space
+
+#
+# Esc and Function keys
+#
+Escape 0x1 localstate
+F1 0x3b localstate
+F2 0x3c localstate
+F3 0x3d localstate
+F4 0x3e localstate
+F5 0x3f localstate
+F6 0x40 localstate
+F7 0x41 localstate
+F8 0x42 localstate
+F9 0x43 localstate
+F10 0x44 localstate
+F11 0x57 localstate
+SunF36 0x57 localstate
+F12 0x58 localstate
+SunF37 0x58 localstate
+
+# Printscreen, Scrollock and Pause
+# Printscreen really requires four scancodes (0xe0, 0x2a, 0xe0, 0x37),
+# but (0xe0, 0x37) seems to work.
+Print 0xb7 localstate
+Sys_Req 0xb7 localstate
+Execute 0xb7 localstate
+F22 0xb7 localstate
+Scroll_Lock 0x46
+F23 0x46
+
+#
+# Insert - PgDown
+#
+Insert 0xd2 localstate
+Delete 0xd3 localstate
+Home 0xc7 localstate
+End 0xcf localstate
+Page_Up 0xc9 localstate
+Page_Down 0xd1 localstate
+
+#
+# Arrow keys
+#
+Left 0xcb localstate
+Up 0xc8 localstate
+Down 0xd0 localstate
+Right 0xcd localstate
+
+#
+# Numpad
+#
+Num_Lock 0x45
+KP_Divide 0xb5 localstate
+KP_Multiply 0x37 localstate
+KP_Subtract 0x4a localstate
+KP_Add 0x4e localstate
+KP_Enter 0x9c localstate
+
+KP_Decimal 0x53 numlock
+KP_Separator 0x53 numlock
+KP_Delete 0x53
+
+KP_0 0x52 numlock
+KP_Insert 0x52 localstate
+
+KP_1 0x4f numlock
+KP_End 0x4f localstate
+
+KP_2 0x50 numlock
+KP_Down 0x50 localstate
+
+KP_3 0x51 numlock
+KP_Next 0x51 localstate
+
+KP_4 0x4b numlock
+KP_Left 0x4b localstate
+
+KP_5 0x4c numlock
+KP_Begin 0x4c localstate
+
+KP_6 0x4d numlock
+KP_Right 0x4d localstate
+
+KP_7 0x47 numlock
+KP_Home 0x47 localstate
+
+KP_8 0x48 numlock
+KP_Up 0x48 localstate
+
+KP_9 0x49 numlock
+KP_Prior 0x49 localstate
+
+#
+# Inhibited keys
+#
+Caps_Lock 0x0 inhibit
+Multi_key 0x0 inhibit
--- /dev/null
+#!/usr/bin/env python2
+# -*-Python-*-
+#
+#
+# Copyright (C) 2001 Peter Ã…strand <peter@cendio.se>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+
+def main():
+ f = open(sys.argv[1])
+ while 1:
+ line = f.readline()
+ if not line: break
+
+ if line.startswith("#") or line.startswith("include"):
+ print line,
+ continue
+
+ fields = line.split()
+
+ if line.startswith("map"):
+ print "map 0x%s" % fields[1]
+ continue
+
+ scancode = fields[0]
+ for pos in range(1, len(fields)):
+ keysym = fields[pos]
+
+ if pos == 1:
+ modifiers = ""
+ elif pos == 2:
+ modifiers = "shift"
+ elif pos == 3:
+ modifiers = "altgr"
+ elif pos == 4:
+ modifiers = "shift altgr"
+ else:
+ raise("Invalid line: %s" % line)
+
+ print "%s 0x%s %s" % (keysym, scancode, modifiers)
+
+
+
+if __name__ == "__main__":
+ if len(sys.argv) < 2:
+ print "Convert old-style keymaps to new style"
+ print "Usage: %s <old-style-keymap>" % sys.argv[0]
+ sys.exit(1)
+ else:
+ main()
--- /dev/null
+# Czech keymap
+include common
+map 0x405
+
+# AltGr
+ISO_Level3_Shift 0xb8
+
+#
+# Top row
+#
+
+# `
+grave 0x29
+asciitilde 0x29 shift
+# 1
+exclam 0x2 shift
+# 2
+at 0x3 shift
+ecaron 0x3 altgr
+# 3
+numbersign 0x4 shift
+# 4
+dollar 0x5 shift
+# 5
+percent 0x6 shift
+# 6
+asciicircum 0x7 shift
+# 7
+ampersand 0x8 shift
+# 8
+asterisk 0x9 shift
+# 9
+parenleft 0xa shift
+# 0
+parenright 0xb shift
+# -
+minus 0xc
+underscore 0xc shift
+# =
+equal 0xd
+plus 0xd shift
+
+
+#
+# QWERTZ first row
+#
+
+# q
+q 0x10 altgr
+# e
+e 0x12 altgr
+# [
+bracketleft 0x1a
+braceleft 0x1a shift
+# ]
+bracketright 0x1b
+braceright 0x1b shift
+
+#
+# QWERTZ second row
+#
+
+# ;
+semicolon 0x27
+# ;
+colon 0x27 shift
+# '
+apostrophe 0x28
+# '
+quotedbl 0x28 shift
+
+#
+# QWERTZ third row
+#
+
+# v
+v 0x2f altgr
+# ,
+comma 0x33
+less 0x33 shift
+# .
+period 0x34
+greater 0x34 shift
+# /
+slash 0x35
+question 0x35 shift
+
--- /dev/null
+# generated from XKB map dk
+include common
+map 0x406
+exclam 0x02 shift
+exclamdown 0x02 altgr
+onesuperior 0x02 shift altgr
+quotedbl 0x03 shift
+at 0x03 altgr
+twosuperior 0x03 shift altgr
+numbersign 0x04 shift
+sterling 0x04 altgr
+threesuperior 0x04 shift altgr
+currency 0x05 shift
+dollar 0x05 altgr
+onequarter 0x05 shift altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+cent 0x06 shift altgr
+ampersand 0x07 shift
+yen 0x07 altgr
+fiveeighths 0x07 shift altgr
+slash 0x08 shift
+braceleft 0x08 altgr
+division 0x08 shift altgr
+parenleft 0x09 shift
+bracketleft 0x09 altgr
+guillemotleft 0x09 shift altgr
+parenright 0x0a shift
+bracketright 0x0a altgr
+guillemotright 0x0a shift altgr
+equal 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+plus 0x0c
+question 0x0c shift
+plusminus 0x0c altgr
+questiondown 0x0c shift altgr
+dead_acute 0x0d
+dead_grave 0x0d shift
+bar 0x0d altgr
+brokenbar 0x0d shift altgr
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+cent 0x12 shift altgr
+registered 0x13 altgr
+thorn 0x14 altgr
+THORN 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oe 0x18 altgr
+OE 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+aring 0x1a
+Aring 0x1a shift
+dead_diaeresis 0x1a altgr
+dead_abovering 0x1a shift altgr
+dead_diaeresis 0x1b
+dead_circumflex 0x1b shift
+dead_tilde 0x1b altgr
+dead_caron 0x1b shift altgr
+ordfeminine 0x1e altgr
+masculine 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+ae 0x27
+AE 0x27 shift
+oslash 0x28
+Ooblique 0x28 shift
+dead_caron 0x28 shift altgr
+onehalf 0x29
+section 0x29 shift
+threequarters 0x29 altgr
+paragraph 0x29 shift altgr
+apostrophe 0x2b
+asterisk 0x2b shift
+dead_doubleacute 0x2b altgr
+multiply 0x2b shift altgr
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+copyright 0x2e altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+semicolon 0x33 shift
+dead_cedilla 0x33 altgr
+dead_ogonek 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+dead_abovedot 0x34 shift altgr
+minus 0x35
+underscore 0x35 shift
+hyphen 0x35 altgr
+macron 0x35 shift altgr
+nobreakspace 0x39 altgr
+less 0x56
+greater 0x56 shift
+backslash 0x56 altgr
+notsign 0x56 shift altgr
--- /dev/null
+# generated from XKB map de
+include common
+map 0x407
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+quotedbl 0x03 shift
+twosuperior 0x03 altgr
+oneeighth 0x03 shift altgr
+section 0x04 shift
+threesuperior 0x04 altgr
+sterling 0x04 shift altgr
+dollar 0x05 shift
+onequarter 0x05 altgr
+currency 0x05 shift altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+ampersand 0x07 shift
+threequarters 0x07 altgr
+fiveeighths 0x07 shift altgr
+slash 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+parenleft 0x09 shift
+bracketleft 0x09 altgr
+trademark 0x09 shift altgr
+parenright 0x0a shift
+bracketright 0x0a altgr
+plusminus 0x0a shift altgr
+equal 0x0b shift
+braceright 0x0b altgr
+ssharp 0x0c
+question 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+acute 0x0d
+dead_acute 0x0d
+grave 0x0d shift
+dead_grave 0x0d shift
+dead_cedilla 0x0d altgr
+dead_ogonek 0x0d shift altgr
+at 0x10 altgr
+Greek_OMEGA 0x10 shift altgr
+EuroSign 0x12 altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+z 0x15 addupper
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+udiaeresis 0x1a
+Udiaeresis 0x1a shift
+dead_diaeresis 0x1a altgr
+dead_abovering 0x1a shift altgr
+plus 0x1b
+asterisk 0x1b shift
+asciitilde 0x1b altgr
+dead_tilde 0x1b altgr
+dead_macron 0x1b shift altgr
+ae 0x1e altgr
+AE 0x1e shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+odiaeresis 0x27
+Odiaeresis 0x27 shift
+dead_doubleacute 0x27 altgr
+adiaeresis 0x28
+Adiaeresis 0x28 shift
+dead_caron 0x28 shift altgr
+asciicircum 0x29
+dead_circumflex 0x29
+degree 0x29 shift
+notsign 0x29 altgr
+numbersign 0x2b
+apostrophe 0x2b shift
+dead_breve 0x2b shift altgr
+y 0x2c addupper
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+semicolon 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+minus 0x35
+underscore 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
--- /dev/null
+# rdesktop Swiss-German (de-ch) keymap file
+# 2003-06-03 by noldi@tristar.ch
+#
+include common
+map 0x00000807
+#
+# Scan Code 1
+section 0x29
+degree 0x29 shift
+notsign 0x29 altgr inhibit
+#
+# Scan Code 2
+plus 0x2 shift
+brokenbar 0x02 altgr
+#
+# Scan Code 3
+quotedbl 0x03 shift
+at 0x03 altgr
+#
+# Scan Code 4
+asterisk 0x04 shift
+numbersign 0x04 altgr
+#
+# Scan Code 5
+ccedilla 0x05 shift
+onequarter 0x05 altgr inhibit
+#
+# Scan Code 6
+percent 0x06 shift
+onehalf 0x06 altgr inhibit
+#
+# Scan Code 7
+ampersand 0x07 shift
+notsign 0x07 altgr
+#
+# Scan Code 8
+slash 0x08 shift
+bar 0x08 altgr
+#
+# Scan Code 9
+parenleft 0x09 shift
+cent 0x09 altgr
+#
+# Scan Code 10
+parenright 0x0a shift
+#
+# Scan Code 11
+equal 0x0b shift
+braceright 0x0b altgr inhibit
+#
+# Scan Code 12
+apostrophe 0x0c
+question 0x0c shift
+dead_acute 0x0c altgr
+#
+# Scan Code 13
+dead_circumflex 0x0d
+dead_grave 0x0d shift
+dead_tilde 0x0d altgr
+#
+# Scan Code 19
+EuroSign 0x12 altgr
+#
+# Scan Code 22
+z 0x15 addupper
+#
+# Scan Code 27
+udiaeresis 0x1a
+egrave 0x1a shift
+bracketleft 0x1a altgr
+#
+# Scan Code 28
+dead_diaeresis 0x1b
+exclam 0x1b shift
+bracketright 0x1b altgr
+#
+# Scan Code 40
+odiaeresis 0x27
+eacute 0x27 shift
+#
+# Scan Code 41
+adiaeresis 0x28
+agrave 0x28 shift
+braceleft 0x28 altgr
+#
+# Scan Code 42 (only on international keyboards)
+dollar 0x2b
+sterling 0x2b shift
+braceright 0x2b altgr
+#
+# Scan Code 45 (only on international keyboards)
+backslash 0x56 altgr
+#
+# Scan Code 46
+y 0x2c addupper
+#
+# Scan Code 53
+comma 0x33
+semicolon 0x33 shift
+#
+# Scan Code 54
+period 0x34
+colon 0x34 shift
+#
+# Scan Code 55
+minus 0x35
+underscore 0x35 shift
+#
+# Suppress Windows unsupported AltGr keys
+#
+# Scan Code 17
+paragraph 0x10 altgr inhibit
+#
+# Scan Code 21
+tslash 0x14 altgr inhibit
+#
+# Scan Code 22
+leftarrow 0x15 altgr inhibit
+#
+# Scan Code 23
+downarrow 0x16 altgr inhibit
+#
+# Scan Code 24
+rightarrow 0x17 altgr inhibit
+#
+# Scan Code 25
+oslash 0x18 altgr inhibit
+#
+# Scan Code 26
+thorn 0x19 altgr inhibit
+#
+# Scan Code 31
+ae 0x1e altgr inhibit
+#
+# Scan Code 32
+ssharp 0x1f altgr inhibit
+#
+# Scan Code 33
+eth 0x20 altgr inhibit
+#
+# Scan Code 34
+dstroke 0x21 altgr inhibit
+#
+# Scan Code 35
+eng 0x22 altgr inhibit
+#
+# Scan Code 36
+hstroke 0x23 altgr inhibit
+#
+# Scan Code 38
+kra 0x25 altgr inhibit
+#
+# Scan Code 39
+lstroke 0x26 altgr inhibit
+#
+# Scan Code 46
+guillemotleft 0x2c altgr inhibit
+#
+# Scan Code 47
+guillemotright 0x2d altgr inhibit
+#
+# Scan Code 49
+leftdoublequotemark 0x2f altgr inhibit
+#
+# Scan Code 50
+rightdoublequotemark 0x30 altgr inhibit
+#
+# Scan Code 52
+mu 0x32 altgr inhibit
--- /dev/null
+# American Dvorak
+map 0x10409
+
+# Note: we are not including the common section
+include modifiers
+
+#
+# Top row
+#
+1 0x2
+2 0x3
+3 0x4
+4 0x5
+5 0x6
+6 0x7
+7 0x8
+8 0x9
+9 0xa
+0 0xb
+BackSpace 0xe
+
+#
+# QWERTY first row
+
+# QWERTY:
+# q w e r t y u i o p
+
+# Dvorak:
+# ' , . p y f g c r l
+
+Tab 0xf localstate
+ISO_Left_Tab 0xf shift
+q 0x2d addupper
+w 0x33 addupper
+e 0x20 addupper
+r 0x18 addupper
+t 0x25 addupper
+y 0x14 addupper
+u 0x21 addupper
+i 0x22 addupper
+o 0x1f addupper
+p 0x13 addupper
+
+#
+# QWERTY second row
+
+# QUERTY:
+# a s d f g h j k l
+
+# Dvorak:
+# a o e u i d h t n
+
+a 0x1e addupper
+s 0x27 addupper
+d 0x23 addupper
+f 0x15 addupper
+g 0x16 addupper
+h 0x24 addupper
+j 0x2e addupper
+k 0x2f addupper
+l 0x19 addupper
+Return 0x1c localstate
+
+#
+# QWERTY third row
+
+# QUERTY:
+# z x c v b n m
+
+# Dvorak:
+# ; q j k x b m
+
+z 0x35 addupper
+x 0x30 addupper
+c 0x17 addupper
+v 0x34 addupper
+b 0x31 addupper
+n 0x26 addupper
+m 0x32 addupper
+
+space 0x39 localstate
+
+less 0x56
+greater 0x56 shift
+bar 0x56 altgr
+brokenbar 0x56 shift altgr
+
+#
+# Esc and Function keys
+#
+Escape 0x1 localstate
+F1 0x3b localstate
+F2 0x3c localstate
+F3 0x3d localstate
+F4 0x3e localstate
+F5 0x3f localstate
+F6 0x40 localstate
+F7 0x41 localstate
+F8 0x42 localstate
+F9 0x43 localstate
+F10 0x44 localstate
+F11 0x57 localstate
+SunF36 0x57 localstate
+F12 0x58 localstate
+SunF37 0x58 localstate
+
+# Printscreen, Scrollock and Pause
+# Printscreen really requires four scancodes (0xe0, 0x2a, 0xe0, 0x37),
+# but (0xe0, 0x37) seems to work.
+Print 0xb7 localstate
+Sys_Req 0xb7 localstate
+Execute 0xb7 localstate
+F22 0xb7 localstate
+Scroll_Lock 0x46
+F23 0x46
+
+#
+# Insert - PgDown
+#
+Insert 0xd2 localstate
+Delete 0xd3 localstate
+Home 0xc7 localstate
+End 0xcf localstate
+Page_Up 0xc9 localstate
+Page_Down 0xd1 localstate
+
+#
+# Arrow keys
+#
+Left 0xcb localstate
+Up 0xc8 localstate
+Down 0xd0 localstate
+Right 0xcd localstate
+
+#
+# Numpad
+#
+Num_Lock 0x45
+KP_Divide 0xb5
+KP_Multiply 0x37
+KP_Subtract 0x4a
+KP_Add 0x4e
+KP_Enter 0x9c
+
+KP_Decimal 0x53 numlock
+KP_Separator 0x53 numlock
+KP_Delete 0x53
+
+KP_0 0x52 numlock
+KP_Insert 0x52
+
+KP_1 0x4f numlock
+KP_End 0x4f
+
+KP_2 0x50 numlock
+KP_Down 0x50
+
+KP_3 0x51 numlock
+KP_Next 0x51
+
+KP_4 0x4b numlock
+KP_Left 0x4b
+
+KP_5 0x4c numlock
+KP_Begin 0x4c
+
+KP_6 0x4d numlock
+KP_Right 0x4d
+
+KP_7 0x47 numlock
+KP_Home 0x47
+
+KP_8 0x48 numlock
+KP_Up 0x48
+
+KP_9 0x49 numlock
+KP_Prior 0x49
+
+#
+# Inhibited keys
+#
+Caps_Lock 0x0 inhibit
+Multi_key 0x0 inhibit
+
+exclam 0x02 shift
+at 0x03 shift
+numbersign 0x04 shift
+dollar 0x05 shift
+percent 0x06 shift
+asciicircum 0x07 shift
+ampersand 0x08 shift
+asterisk 0x09 shift
+parenleft 0x0a shift
+parenright 0x0b shift
+minus 0x28
+underscore 0x28 shift
+equal 0x1b
+plus 0x1b shift
+bracketleft 0x0c
+braceleft 0x0c shift
+bracketright 0x0d
+braceright 0x0d shift
+semicolon 0x2c
+colon 0x2c shift
+apostrophe 0x10
+quotedbl 0x10 shift
+grave 0x29
+asciitilde 0x29 shift
+backslash 0x2b
+bar 0x2b shift
+comma 0x11
+less 0x11 shift
+period 0x12
+greater 0x12 shift
+slash 0x1a
+question 0x1a shift
--- /dev/null
+# generated from XKB map gb
+include common
+map 0x809
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+quotedbl 0x03 shift
+twosuperior 0x03 altgr
+oneeighth 0x03 shift altgr
+sterling 0x04 shift
+threesuperior 0x04 altgr
+dollar 0x05 shift
+EuroSign 0x05 altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+asciicircum 0x07 shift
+threequarters 0x07 altgr
+fiveeighths 0x07 shift altgr
+ampersand 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+asterisk 0x09 shift
+bracketleft 0x09 altgr
+trademark 0x09 shift altgr
+parenleft 0x0a shift
+bracketright 0x0a altgr
+plusminus 0x0a shift altgr
+parenright 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+minus 0x0c
+underscore 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+equal 0x0d
+plus 0x0d shift
+dead_cedilla 0x0d altgr
+dead_ogonek 0x0d shift altgr
+at 0x10 altgr
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+bracketleft 0x1a
+braceleft 0x1a shift
+dead_diaeresis 0x1a altgr
+dead_abovering 0x1a shift altgr
+bracketright 0x1b
+braceright 0x1b shift
+dead_tilde 0x1b altgr
+dead_macron 0x1b shift altgr
+ae 0x1e altgr
+AE 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+semicolon 0x27
+colon 0x27 shift
+dead_acute 0x27 altgr
+dead_doubleacute 0x27 shift altgr
+apostrophe 0x28
+at 0x28 shift
+dead_circumflex 0x28 altgr
+dead_caron 0x28 shift altgr
+grave 0x29
+notsign 0x29 shift
+bar 0x29 altgr
+numbersign 0x2b
+asciitilde 0x2b shift
+dead_grave 0x2b altgr
+dead_breve 0x2b shift altgr
+guillemotleft 0x2c altgr
+less 0x2c shift altgr
+guillemotright 0x2d altgr
+greater 0x2d shift altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+less 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+greater 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+slash 0x35
+question 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
+backslash 0x56
+bar 0x56 shift
--- /dev/null
+# generated from XKB map us
+include common
+map 0x409
+exclam 0x02 shift
+at 0x03 shift
+numbersign 0x04 shift
+dollar 0x05 shift
+percent 0x06 shift
+asciicircum 0x07 shift
+ampersand 0x08 shift
+asterisk 0x09 shift
+parenleft 0x0a shift
+parenright 0x0b shift
+minus 0x0c
+underscore 0x0c shift
+equal 0x0d
+plus 0x0d shift
+bracketleft 0x1a
+braceleft 0x1a shift
+bracketright 0x1b
+braceright 0x1b shift
+semicolon 0x27
+colon 0x27 shift
+apostrophe 0x28
+quotedbl 0x28 shift
+grave 0x29
+asciitilde 0x29 shift
+backslash 0x2b
+bar 0x2b shift
+comma 0x33
+less 0x33 shift
+period 0x34
+greater 0x34 shift
+slash 0x35
+question 0x35 shift
--- /dev/null
+# generated from XKB map es
+include common
+map 0x40a
+exclam 0x02 shift
+bar 0x02 altgr
+quotedbl 0x03 shift
+at 0x03 altgr
+oneeighth 0x03 shift altgr
+periodcentered 0x04 shift
+numbersign 0x04 altgr
+sterling 0x04 shift altgr
+dollar 0x05 shift
+asciitilde 0x05 altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+ampersand 0x07 shift
+notsign 0x07 altgr
+fiveeighths 0x07 shift altgr
+slash 0x08 shift
+seveneighths 0x08 shift altgr
+parenleft 0x09 shift
+trademark 0x09 shift altgr
+parenright 0x0a shift
+plusminus 0x0a shift altgr
+equal 0x0b shift
+degree 0x0b shift altgr
+apostrophe 0x0c
+question 0x0c shift
+exclamdown 0x0d
+questiondown 0x0d shift
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+dead_grave 0x1a
+dead_circumflex 0x1a shift
+bracketleft 0x1a altgr
+dead_abovering 0x1a shift altgr
+plus 0x1b
+asterisk 0x1b shift
+bracketright 0x1b altgr
+dead_macron 0x1b shift altgr
+ae 0x1e altgr
+AE 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+ntilde 0x27
+Ntilde 0x27 shift
+dead_doubleacute 0x27 shift altgr
+dead_acute 0x28
+dead_diaeresis 0x28 shift
+braceleft 0x28 altgr
+masculine 0x29
+ordfeminine 0x29 shift
+backslash 0x29 altgr
+ccedilla 0x2b
+Ccedilla 0x2b shift
+braceright 0x2b altgr
+dead_breve 0x2b shift altgr
+guillemotleft 0x2c altgr
+less 0x56
+greater 0x56 shift
+guillemotright 0x2d altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+comma 0x33
+semicolon 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+division 0x34 shift altgr
+minus 0x35
+underscore 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
--- /dev/null
+map 0x00000425
+include common
+
+#
+# Top row
+#
+dead_caron 0x29
+dead_tilde 0x29 shift
+
+# 1
+exclam 0x2 shift
+
+# 2
+quotedbl 0x3 shift
+at 0x3 altgr
+
+# 3
+numbersign 0x4 shift
+sterling 0x4 altgr
+# 4
+currency 0x5 shift
+dollar 0x5 altgr
+# 5
+percent 0x6 shift
+# 6
+ampersand 0x7 shift
+# 7
+slash 0x8 shift
+braceleft 0x8 altgr
+# 8
+parenleft 0x9 shift
+bracketleft 0x9 altgr
+# 9
+parenright 0xa shift
+bracketright 0xa altgr
+# 0
+equal 0xb shift
+braceright 0xb altgr
+
+plus 0xc
+question 0xc shift
+backslash 0xc altgr
+
+acute 0xd
+dead_acute 0xd
+grave 0xd shift
+dead_grave 0xd shift
+
+#
+# QWERTY first row
+#
+EuroSign 0x12 altgr
+udiaeresis 0x1a
+Udiaeresis 0x1a shift
+otilde 0x1b
+Otilde 0x1b shift
+section 0x1b altgr
+
+#
+# QWERTY second row
+#
+scaron 0x1f altgr
+Scaron 0x1f altgr shift
+odiaeresis 0x27
+Odiaeresis 0x27 shift
+adiaeresis 0x28
+Adiaeresis 0x28 shift
+asciicircum 0x28 altgr
+apostrophe 0x2b
+asterisk 0x2b shift
+onehalf 0x2b altgr
+#
+# QWERTY third row
+#
+less 0x56
+greater 0x56 shift
+bar 0x56 altgr
+zcaron 0x2c altgr
+Zcaron 0x2c altgr shift
+comma 0x33
+semicolon 0x33 shift
+period 0x34
+colon 0x34 shift
+minus 0x35
+underscore 0x35 shift
+
--- /dev/null
+# Finnish keyboard layout
+# Originally generated from XKB map se_FI (wrong!), modified afterwards.
+
+include common
+map 0x40b
+
+exclam 0x02 shift
+exclamdown 0x02 altgr
+onesuperior 0x02 shift altgr
+quotedbl 0x03 shift
+at 0x03 altgr
+twosuperior 0x03 shift altgr
+numbersign 0x04 shift
+sterling 0x04 altgr
+threesuperior 0x04 shift altgr
+currency 0x05 shift
+dollar 0x05 altgr
+onequarter 0x05 shift altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+cent 0x06 shift altgr
+ampersand 0x07 shift
+yen 0x07 altgr
+fiveeighths 0x07 shift altgr
+slash 0x08 shift
+braceleft 0x08 altgr
+division 0x08 shift altgr
+parenleft 0x09 shift
+bracketleft 0x09 altgr
+guillemotleft 0x09 shift altgr
+parenright 0x0a shift
+bracketright 0x0a altgr
+guillemotright 0x0a shift altgr
+equal 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+plus 0x0c
+question 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+dead_acute 0x0d
+dead_grave 0x0d shift
+plusminus 0x0d altgr
+notsign 0x0d shift altgr
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+cent 0x12 shift altgr
+registered 0x13 altgr
+thorn 0x14 altgr
+THORN 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oe 0x18 altgr
+OE 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+aring 0x1a
+Aring 0x1a shift
+dead_diaeresis 0x1a altgr
+dead_abovering 0x1a shift altgr
+dead_diaeresis 0x1b
+dead_circumflex 0x1b shift
+dead_tilde 0x1b altgr
+dead_caron 0x1b shift altgr
+ordfeminine 0x1e altgr
+masculine 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+odiaeresis 0x27
+Odiaeresis 0x27 shift
+oslash 0x27 altgr
+Ooblique 0x27 shift altgr
+adiaeresis 0x28
+Adiaeresis 0x28 shift
+ae 0x28 altgr
+AE 0x28 shift altgr
+section 0x29
+onehalf 0x29 shift
+paragraph 0x29 altgr
+threequarters 0x29 shift altgr
+apostrophe 0x2b
+asterisk 0x2b shift
+acute 0x2b altgr
+multiply 0x2b shift altgr
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+copyright 0x2e altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+semicolon 0x33 shift
+dead_cedilla 0x33 altgr
+dead_ogonek 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+dead_abovedot 0x34 shift altgr
+minus 0x35
+underscore 0x35 shift
+hyphen 0x35 altgr
+macron 0x35 shift altgr
+nobreakspace 0x39 altgr
--- /dev/null
+map 0x438
+include common
+
+#
+# Top row
+#
+onehalf 0x29
+section 0x29 shift
+
+# 1
+exclam 0x2 shift
+
+# 2
+quotedbl 0x3 shift
+at 0x3 altgr
+
+# 3
+numbersign 0x4 shift
+sterling 0x4 altgr
+# 4
+currency 0x5 shift
+dollar 0x5 altgr
+# 5
+percent 0x6 shift
+# 6
+ampersand 0x7 shift
+# 7
+slash 0x8 shift
+braceleft 0x8 altgr
+# 8
+parenleft 0x9 shift
+bracketleft 0x9 altgr
+# 9
+parenright 0xa shift
+bracketright 0xa altgr
+# 0
+equal 0xb shift
+braceright 0xb altgr
+
+plus 0xc
+question 0xc shift
+plusminus 0xc altgr
+
+bar 0xd altgr
+dead_acute 0xd
+
+#
+# QWERTY first row
+#
+EuroSign 0x12 altgr
+aring 0x1a
+Aring 0x1a shift
+eth 0x1b addupper
+asciitilde 0x1b altgr
+
+#
+# QWERTY second row
+#
+ae 0x27 addupper
+oslash 0x28
+Ooblique 0x28 shift
+apostrophe 0x2b
+asterisk 0x2b shift
+
+#
+# QWERTY third row
+#
+less 0x56
+greater 0x56 shift
+backslash 0x56 altgr
+comma 0x33
+semicolon 0x33 shift
+period 0x34
+colon 0x34 shift
+minus 0x35
+underscore 0x35 shift
+
--- /dev/null
+include common
+map 0x40c
+#
+# Top row
+#
+twosuperior 0x29
+notsign 0x29 altgr
+
+ampersand 0x02
+1 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+
+eacute 0x03
+2 0x03 shift
+asciitilde 0x03 altgr
+oneeighth 0x03 shift altgr
+
+quotedbl 0x04
+3 0x04 shift
+numbersign 0x04 altgr
+
+apostrophe 0x05
+4 0x05 shift
+braceleft 0x05 altgr
+
+parenleft 0x06
+5 0x06 shift
+bracketleft 0x06 altgr
+threeeighths 0x06 shift altgr
+
+minus 0x07
+6 0x07 shift
+bar 0x07 altgr
+fiveeighths 0x07 shift altgr
+
+egrave 0x08
+7 0x08 shift
+grave 0x08 altgr
+seveneighths 0x08 shift altgr
+
+underscore 0x09
+8 0x09 shift
+backslash 0x09 altgr
+trademark 0x09 shift altgr
+
+ccedilla 0x0a
+9 0x0a shift
+asciicircum 0x0a altgr
+plusminus 0x0a shift altgr
+
+agrave 0x0b
+0 0x0b shift
+at 0x0b altgr
+
+parenright 0x0c
+degree 0x0c shift
+bracketright 0x0c altgr
+questiondown 0x0c shift altgr
+
+equal 0x0d
+plus 0x0d shift
+braceright 0x0d altgr
+dead_ogonek 0x0d shift altgr
+
+#
+# AZERTY first row
+#
+
+a 0x10 addupper
+ae 0x10 altgr
+AE 0x10 shift altgr
+
+z 0x11 addupper
+guillemotleft 0x11 altgr
+
+EuroSign 0x12 altgr
+
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+
+dead_circumflex 0x1a
+dead_diaeresis 0x1a shift
+dead_abovering 0x1a shift altgr
+
+dollar 0x1b
+sterling 0x1b shift
+currency 0x1b altgr
+dead_macron 0x1b shift altgr
+
+#
+# AZERTY second row
+#
+q 0x1e addupper
+Greek_OMEGA 0x1e shift altgr
+
+ssharp 0x1f altgr
+
+eth 0x20 altgr
+ETH 0x20 shift altgr
+
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+
+eng 0x22 altgr
+ENG 0x22 shift altgr
+
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+
+kra 0x25 altgr
+
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+
+m 0x27 addupper
+masculine 0x27 shift altgr
+
+ugrave 0x28
+percent 0x28 shift
+dead_caron 0x28 shift altgr
+
+asterisk 0x2b
+mu 0x2b shift
+dead_grave 0x2b altgr
+dead_breve 0x2b shift altgr
+
+#
+# AZERTY third row
+#
+less 0x56
+greater 0x56 shift
+
+w 0x2c addupper
+
+guillemotright 0x2d altgr
+
+cent 0x2e altgr
+copyright 0x2e shift altgr
+
+leftdoublequotemark 0x2f altgr
+
+rightdoublequotemark 0x30 altgr
+
+comma 0x32
+question 0x32 shift
+dead_acute 0x32 altgr
+dead_doubleacute 0x32 shift altgr
+
+semicolon 0x33
+period 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+
+colon 0x34
+slash 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+
+exclam 0x35
+section 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
--- /dev/null
+# generated from XKB map be
+include common
+map 0x80c
+ampersand 0x02
+1 0x02 shift
+bar 0x02 altgr
+exclamdown 0x02 shift altgr
+eacute 0x03
+2 0x03 shift
+at 0x03 altgr
+oneeighth 0x03 shift altgr
+quotedbl 0x04
+3 0x04 shift
+numbersign 0x04 altgr
+sterling 0x04 shift altgr
+apostrophe 0x05
+4 0x05 shift
+onequarter 0x05 altgr
+dollar 0x05 shift altgr
+parenleft 0x06
+5 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+section 0x07
+6 0x07 shift
+asciicircum 0x07 altgr
+fiveeighths 0x07 shift altgr
+egrave 0x08
+7 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+exclam 0x09
+8 0x09 shift
+bracketleft 0x09 altgr
+trademark 0x09 shift altgr
+ccedilla 0x0a
+9 0x0a shift
+braceleft 0x0a altgr
+plusminus 0x0a shift altgr
+agrave 0x0b
+0 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+parenright 0x0c
+degree 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+minus 0x0d
+underscore 0x0d shift
+dead_cedilla 0x0d altgr
+dead_ogonek 0x0d shift altgr
+a 0x10 addupper
+Greek_OMEGA 0x10 shift altgr
+z 0x11 addupper
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+cent 0x12 shift altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+dead_circumflex 0x1a
+dead_diaeresis 0x1a shift
+bracketleft 0x1a altgr
+dead_abovering 0x1a shift altgr
+dollar 0x1b
+asterisk 0x1b shift
+bracketright 0x1b altgr
+dead_macron 0x1b shift altgr
+q 0x1e addupper
+ae 0x1e altgr
+AE 0x1e shift altgr
+ssharp 0x1f altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+m 0x27 addupper
+dead_acute 0x27 altgr
+dead_doubleacute 0x27 shift altgr
+ugrave 0x28
+percent 0x28 shift
+dead_acute 0x28 altgr
+dead_caron 0x28 shift altgr
+twosuperior 0x29
+threesuperior 0x29 shift
+notsign 0x29 altgr
+mu 0x2b
+sterling 0x2b shift
+dead_grave 0x2b altgr
+dead_breve 0x2b shift altgr
+w 0x2c addupper
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+comma 0x32
+question 0x32 shift
+dead_cedilla 0x32 altgr
+masculine 0x32 shift altgr
+semicolon 0x33
+period 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+colon 0x34
+slash 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+equal 0x35
+plus 0x35 shift
+dead_tilde 0x35 altgr
+dead_abovedot 0x35 shift altgr
+backslash 0x56 altgr
+
--- /dev/null
+# Canadian French
+# By Simon Germain
+include common
+map 0xc0c
+
+backslash 0x29 altgr
+plusminus 0x2 altgr
+at 0x3 altgr
+sterling 0x4 altgr
+cent 0x5 altgr
+currency 0x6 altgr
+notsign 0x7 altgr
+bar 0x29 shift
+twosuperior 0x9 altgr
+threesuperior 0xa altgr
+onequarter 0xb altgr
+onehalf 0xc altgr
+threequarters 0xd altgr
+section 0x18 altgr
+paragraph 0x19 altgr
+bracketleft 0x1a altgr
+bracketright 0x1b altgr
+asciitilde 0x27 altgr
+braceleft 0x28 altgr
+braceright 0x2b altgr
+less 0x2b
+greater 0x2b shift
+guillemotleft 0x56
+guillemotright 0x56 shift
+degree 0x56 altgr
+mu 0x32 altgr
+eacute 0x35
+dead_acute 0x35 altgr
+dead_grave 0x28
+dead_circumflex 0x1a
+dead_circumflex 0x1a shift
+dead_cedilla 0x1b
+dead_diaeresis 0x1b shift
+exclam 0x2 shift
+quotedbl 0x3 shift
+slash 0x4 shift
+dollar 0x5 shift
+percent 0x6 shift
+question 0x7 shift
+ampersand 0x8 shift
+asterisk 0x9 shift
+parenleft 0xa shift
+parenright 0xb shift
+underscore 0xc shift
+plus 0xd shift
--- /dev/null
+# rdesktop suisse-french keymap file
+#
+#map 0x00000807
+map 0x0000100C
+include common
+#
+# Scan Code 1
+section 0x29
+degree 0x29 shift
+notsign 0x29 altgr inhibit
+#
+# Scan Code 2
+plus 0x2 shift
+brokenbar 0x02 altgr
+#
+# Scan Code 3
+quotedbl 0x03 shift
+at 0x03 altgr
+#
+# Scan Code 4
+asterisk 0x04 shift
+numbersign 0x04 altgr
+#
+# Scan Code 5
+ccedilla 0x05 shift
+onequarter 0x05 altgr inhibit
+#
+# Scan Code 6
+percent 0x06 shift
+onehalf 0x06 altgr inhibit
+#
+# Scan Code 7
+ampersand 0x07 shift
+notsign 0x07 altgr
+#
+# Scan Code 8
+slash 0x08 shift
+bar 0x08 altgr
+#
+# Scan Code 9
+parenleft 0x09 shift
+cent 0x09 altgr
+#
+# Scan Code 10
+parenright 0x0a shift
+#
+# Scan Code 11
+equal 0x0b shift
+braceright 0x0b altgr inhibit
+#
+# Scan Code 12
+apostrophe 0x0c
+question 0x0c shift
+dead_acute 0x0c altgr
+#
+# Scan Code 13
+dead_circumflex 0x0d
+dead_grave 0x0d shift
+dead_tilde 0x0d altgr
+#
+# Scan Code 19
+EuroSign 0x12 altgr
+#
+# Scan Code 22
+z 0x15 addupper
+#
+# Scan Code 27
+udiaeresis 0x1a shift
+egrave 0x1a
+bracketleft 0x1a altgr
+#
+# Scan Code 28
+dead_diaeresis 0x1b
+exclam 0x1b shift
+bracketright 0x1b altgr
+#
+# Scan Code 40
+odiaeresis 0x27 shift
+eacute 0x27
+#
+# Scan Code 41
+adiaeresis 0x28 shift
+agrave 0x28
+braceleft 0x28 altgr
+#
+# Scan Code 42 (only on international keyboards)
+dollar 0x2b
+sterling 0x2b shift
+braceright 0x2b altgr
+#
+# Scan Code 45 (only on international keyboards)
+backslash 0x56 altgr
+#
+# Scan Code 46
+y 0x2c addupper
+#
+# Scan Code 53
+comma 0x33
+semicolon 0x33 shift
+#
+# Scan Code 54
+period 0x34
+colon 0x34 shift
+#
+# Scan Code 55
+minus 0x35
+underscore 0x35 shift
+#
+# Suppress Windows unsupported AltGr keys
+#
+# Scan Code 17
+paragraph 0x10 altgr inhibit
+#
+# Scan Code 21
+tslash 0x14 altgr inhibit
+#
+# Scan Code 22
+leftarrow 0x15 altgr inhibit
+#
+# Scan Code 23
+downarrow 0x16 altgr inhibit
+#
+# Scan Code 24
+rightarrow 0x17 altgr inhibit
+#
+# Scan Code 25
+oslash 0x18 altgr inhibit
+#
+# Scan Code 26
+thorn 0x19 altgr inhibit
+#
+# Scan Code 31
+ae 0x1e altgr inhibit
+#
+# Scan Code 32
+ssharp 0x1f altgr inhibit
+#
+# Scan Code 33
+eth 0x20 altgr inhibit
+#
+# Scan Code 34
+dstroke 0x21 altgr inhibit
+#
+# Scan Code 35
+eng 0x22 altgr inhibit
+#
+# Scan Code 36
+hstroke 0x23 altgr inhibit
+#
+# Scan Code 38
+kra 0x25 altgr inhibit
+#
+# Scan Code 39
+lstroke 0x26 altgr inhibit
+#
+# Scan Code 46
+guillemotleft 0x2c altgr inhibit
+#
+# Scan Code 47
+guillemotright 0x2d altgr inhibit
+#
+# Scan Code 49
+leftdoublequotemark 0x2f altgr inhibit
+#
+# Scan Code 50
+rightdoublequotemark 0x30 altgr inhibit
+#
+# Scan Code 52
+mu 0x32 altgr inhibit
--- /dev/null
+# Generated by Shlomil
+# Please send your comments and corrections to <shlomister@gmail.com>
+include common
+map 0x040D
+
+
+#
+# Top row
+#
+
+slash 0x10 altgr
+apostrophe 0x11 altgr
+hebrew_qoph 0x12 altgr
+hebrew_resh 0x13 altgr
+hebrew_aleph 0x14 altgr
+hebrew_tet 0x15 altgr
+hebrew_waw 0x16 altgr
+hebrew_finalnun 0x17 altgr
+hebrew_finalmem 0x18 altgr
+hebrew_pe 0x19 altgr
+
+#
+# Second row
+#
+
+hebrew_shin 0x1e altgr
+hebrew_dalet 0x1f altgr
+hebrew_gimel 0x20 altgr
+hebrew_kaph 0x21 altgr
+hebrew_ayin 0x22 altgr
+hebrew_yod 0x23 altgr
+hebrew_chet 0x24 altgr
+hebrew_lamed 0x25 altgr
+hebrew_finalkaph 0x26 altgr
+hebrew_finalpe 0x27 altgr
+comma 0x28 altgr
+
+#
+# Third row
+#
+
+hebrew_zain 0x2c altgr
+hebrew_samech 0x2d altgr
+hebrew_bet 0x2e altgr
+hebrew_he 0x2f altgr
+hebrew_nun 0x30 altgr
+hebrew_mem 0x31 altgr
+hebrew_zade 0x32 altgr
+
+hebrew_taw 0x33 altgr
+hebrew_finalzade 0x34 altgr
+period 0x35 altgr
+
+
+#
+# en-us
+#
+
+
+exclam 0x02 shift
+at 0x03 shift
+numbersign 0x04 shift
+dollar 0x05 shift
+percent 0x06 shift
+asciicircum 0x07 shift
+ampersand 0x08 shift
+asterisk 0x09 shift
+parenleft 0x0a shift
+parenright 0x0b shift
+minus 0x0c
+underscore 0x0c shift
+equal 0x0d
+plus 0x0d shift
+bracketleft 0x1a
+braceleft 0x1a shift
+bracketright 0x1b
+braceright 0x1b shift
+semicolon 0x27
+colon 0x27 shift
+apostrophe 0x28
+quotedbl 0x28 shift
+grave 0x29
+asciitilde 0x29 shift
+backslash 0x2b
+bar 0x2b shift
+comma 0x33
+less 0x33 shift
+period 0x34
+greater 0x34 shift
+slash 0x35
+question 0x35 shift
--- /dev/null
+# generated from XKB map hr
+include common
+map 0x41a
+exclam 0x02 shift
+asciitilde 0x02 altgr
+dead_tilde 0x02 shift altgr
+quotedbl 0x03 shift
+dead_caron 0x03 altgr
+caron 0x03 shift altgr
+numbersign 0x04 shift
+asciicircum 0x04 altgr
+dead_circumflex 0x04 shift altgr
+dollar 0x05 shift
+dead_breve 0x05 altgr
+breve 0x05 shift altgr
+percent 0x06 shift
+degree 0x06 altgr
+dead_abovering 0x06 shift altgr
+ampersand 0x07 shift
+dead_ogonek 0x07 altgr
+ogonek 0x07 shift altgr
+slash 0x08 shift
+grave 0x08 altgr
+dead_grave 0x08 shift altgr
+parenleft 0x09 shift
+dead_abovedot 0x09 altgr
+abovedot 0x09 shift altgr
+parenright 0x0a shift
+dead_acute 0x0a altgr
+apostrophe 0x0a shift altgr
+equal 0x0b shift
+dead_doubleacute 0x0b altgr
+doubleacute 0x0b shift altgr
+apostrophe 0x0c
+question 0x0c shift
+dead_diaeresis 0x0c altgr
+diaeresis 0x0c shift altgr
+plus 0x0d
+asterisk 0x0d shift
+dead_cedilla 0x0d altgr
+cedilla 0x0d shift altgr
+backslash 0x10 altgr
+Greek_OMEGA 0x10 shift altgr
+bar 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+z 0x15 addupper
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+scaron 0x1a
+Scaron 0x1a shift
+division 0x1a altgr
+dead_abovering 0x1a shift altgr
+dstroke 0x1b
+Dstroke 0x1b shift
+multiply 0x1b altgr
+dead_macron 0x1b shift altgr
+ae 0x1e altgr
+AE 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+bracketleft 0x21 altgr
+ordfeminine 0x21 shift altgr
+bracketright 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+lstroke 0x25 altgr
+ampersand 0x25 shift altgr
+Lstroke 0x26 altgr
+ccaron 0x27
+Ccaron 0x27 shift
+dead_acute 0x27 altgr
+dead_doubleacute 0x27 shift altgr
+cacute 0x28
+Cacute 0x28 shift
+ssharp 0x28 altgr
+dead_caron 0x28 shift altgr
+dead_cedilla 0x29
+dead_diaeresis 0x29 shift
+notsign 0x29 altgr
+zcaron 0x2b
+Zcaron 0x2b shift
+currency 0x2b altgr
+dead_breve 0x2b shift altgr
+y 0x2c addupper
+guillemotleft 0x2c altgr
+less 0x2c shift altgr
+guillemotright 0x2d altgr
+greater 0x2d shift altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+at 0x2f altgr
+grave 0x2f shift altgr
+braceleft 0x30 altgr
+apostrophe 0x30 shift altgr
+braceright 0x31 altgr
+section 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+semicolon 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+minus 0x35
+underscore 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
--- /dev/null
+# Hungarian keyboard layout (QWERTZ)
+# Created by: The NeverGone <never@delfin.klte.hu>
+
+include common
+map 0x40e
+
+
+# AltGr keys:
+notsign 0x29 altgr
+asciitilde 0x02 altgr
+caron 0x03 altgr
+asciicircum 0x04 altgr
+breve 0x05 altgr
+degree 0x06 altgr
+ogonek 0x07 altgr
+grave 0x08 altgr
+abovedot 0x09 altgr
+acute 0x0a altgr
+doubleacute 0x0b altgr
+diaeresis 0x0c altgr
+cedilla 0x0d altgr
+backslash 0x10 altgr
+bar 0x11 altgr
+EuroSign 0x12 altgr
+Iacute 0x17 altgr
+division 0x1a altgr
+multiply 0x1b altgr
+dstroke 0x1f altgr
+Dstroke 0x20 altgr
+bracketleft 0x21 altgr
+bracketright 0x22 altgr
+iacute 0x24 altgr
+lstroke 0x25 altgr
+Lstroke 0x26 altgr
+dollar 0x27 altgr
+ssharp 0x28 altgr
+currency 0x2b altgr
+less 0x56 altgr
+greater 0x2c altgr
+numbersign 0x2d altgr
+ampersand 0x2e altgr
+at 0x2f altgr
+braceleft 0x30 altgr
+braceright 0x31 altgr
+semicolon 0x33 altgr
+asterisk 0x35 altgr
+
+
+# Shift keys:
+section 0x29 shift
+apostrophe 0x02 shift
+quotedbl 0x03 shift
+plus 0x04 shift
+exclam 0x05 shift
+percent 0x06 shift
+slash 0x07 shift
+equal 0x08 shift
+parenleft 0x09 shift
+parenright 0x0a shift
+Odiaeresis 0x0b shift
+Udiaeresis 0x0c shift
+Oacute 0x0d shift
+Z 0x15 shift
+Odoubleacute 0x1a shift
+Uacute 0x1b shift
+Eacute 0x27 shift
+Aacute 0x28 shift
+Udoubleacute 0x2b shift
+Y 0x2c shift
+question 0x33 shift
+colon 0x34 shift
+underscore 0x35 shift
+F13 0x3b shift
+F14 0x3c shift
+F15 0x3d shift
+F16 0x3e shift
+F17 0x3f shift
+F18 0x40 shift
+F19 0x41 shift
+F20 0x42 shift
+F21 0x43 shift
+F22 0x44 shift
+F23 0x57 shift
+F24 0x58 shift
+
+
+# Ctrl keys:
+F25 0x3b ctrl
+F26 0x3c ctrl
+F27 0x3d ctrl
+F28 0x3e ctrl
+F29 0x3f ctrl
+F30 0x40 ctrl
+F31 0x41 ctrl
+F32 0x42 ctrl
+F33 0x43 ctrl
+F34 0x44 ctrl
+F35 0x57 ctrl
+#NoSymbol 0x58 ctrl
+
+
+0 0x29
+odiaeresis 0x0b
+udiaeresis 0x0c
+oacute 0x0d
+z 0x15
+odoubleacute 0x1a
+uacute 0x1b
+eacute 0x27
+aacute 0x28
+udoubleacute 0x2b
+y 0x2c
+comma 0x33
+period 0x34
+minus 0x35
--- /dev/null
+# 2004-03-16 Halldór Guðmundsson and Morten Lange
+# Keyboard definition file for the Icelandic keyboard
+# to be used in rdesktop 1.3.x ( See rdesktop.org)
+# generated from XKB map de, and changed manually
+# Location for example /usr/local/share/rdesktop/keymaps/is
+include common
+map 0x40f
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+quotedbl 0x03 shift
+twosuperior 0x03 altgr
+oneeighth 0x03 shift altgr
+#section 0x04 shift
+numbersign 0x04 shift
+threesuperior 0x04 altgr
+sterling 0x04 shift altgr
+dollar 0x05 shift
+onequarter 0x05 altgr
+currency 0x05 shift altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+ampersand 0x07 shift
+threequarters 0x07 altgr
+fiveeighths 0x07 shift altgr
+slash 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+parenleft 0x09 shift
+bracketleft 0x09 altgr
+trademark 0x09 shift altgr
+parenright 0x0a shift
+bracketright 0x0a altgr
+plusminus 0x0a shift altgr
+equal 0x0b shift
+braceright 0x0b altgr
+#ssharp 0x0c
+odiaeresis 0x0c
+#question 0x0c shift
+Odiaeresis 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+#acute 0x0d
+minus 0x0d
+#dead_acute 0x0d
+#grave 0x0d shift
+#dead_grave 0x0d shift
+underscore 0x0d shift
+dead_cedilla 0x0d altgr
+dead_ogonek 0x0d shift altgr
+at 0x10 altgr
+Greek_OMEGA 0x10 shift altgr
+EuroSign 0x12 altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+#z 0x15 addupper
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+#thorn 0x19 altgr
+#THORN 0x19 shift altgr
+#udiaeresis 0x1a
+#Udiaeresis 0x1a shift
+#dead_diaeresis 0x1a altgr
+#dead_abovering 0x1a shift altgr
+eth 0x1a
+ETH 0x1a shift
+apostrophe 0x1b
+question 0x1b shift
+#plus 0x1b
+#asterisk 0x1b shift
+asciitilde 0x1b altgr
+#grave 0x1b altgr
+#dead_tilde 0x1b altgr
+#dead_macron 0x1b shift altgr
+#ae 0x1e altgr
+#AE 0x1e shift altgr
+#eth 0x20 altgr
+#eth 0x20
+#ETH 0x20 shift altgr
+#ETH 0x20 shift
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+#adiaeresis 0x27
+#Adiaeresis 0x27 shift
+ae 0x27
+AE 0x27 shift
+dead_doubleacute 0x27 altgr
+#adiaeresis 0x28
+#Adiaeresis 0x28 shift
+#dead_caron 0x28 shift altgr
+#asciicircum 0x29
+acute 0x28
+dead_acute 0x28
+#dead_circumflex 0x29
+#degree 0x29 shift
+#notsign 0x29 altgr
+plus 0x2b
+asterisk 0x2b shift
+grave 0x2b altgr
+#numbersign 0x2b
+#apostrophe 0x2b shift
+#dead_breve 0x2b shift altgr
+#y 0x2c addupper
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+semicolon 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+#minus 0x35
+#underscore 0x35 shift
+thorn 0x35
+THORN 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
+
--- /dev/null
+# generated from XKB map it
+include common
+map 0x410
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+quotedbl 0x03 shift
+twosuperior 0x03 altgr
+oneeighth 0x03 shift altgr
+sterling 0x04 shift
+threesuperior 0x04 altgr
+dollar 0x05 shift
+onequarter 0x05 altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+ampersand 0x07 shift
+threequarters 0x07 altgr
+fiveeighths 0x07 shift altgr
+slash 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+parenleft 0x09 shift
+trademark 0x09 shift altgr
+parenright 0x0a shift
+plusminus 0x0a shift altgr
+equal 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+apostrophe 0x0c
+question 0x0c shift
+grave 0x0c altgr
+questiondown 0x0c shift altgr
+igrave 0x0d
+asciicircum 0x0d shift
+asciitilde 0x0d altgr
+dead_ogonek 0x0d shift altgr
+at 0x10 altgr
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+cent 0x12 shift altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+egrave 0x1a
+eacute 0x1a shift
+bracketleft 0x1a altgr
+dead_abovering 0x1a shift altgr
+plus 0x1b
+asterisk 0x1b shift
+bracketright 0x1b altgr
+dead_macron 0x1b shift altgr
+ae 0x1e altgr
+AE 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+ograve 0x27
+ccedilla 0x27 shift
+at 0x27 altgr
+dead_doubleacute 0x27 shift altgr
+agrave 0x28
+degree 0x28 shift
+numbersign 0x28 altgr
+backslash 0x29
+bar 0x29 shift
+notsign 0x29 altgr
+ugrave 0x2b
+section 0x2b shift
+dead_grave 0x2b altgr
+dead_breve 0x2b shift altgr
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+semicolon 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+minus 0x35
+underscore 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
--- /dev/null
+# generated from XKB map jp106
+include common
+map 0xe0010411
+keyboard_type 0x7
+keyboard_subtype 0x2
+keyboard_functionkeys 0xc
+exclam 0x02 shift
+kana_NU 0x02 altgr
+quotedbl 0x03 shift
+kana_FU 0x03 altgr
+numbersign 0x04 shift
+kana_A 0x04 altgr
+kana_a 0x04 shift altgr
+dollar 0x05 shift
+kana_U 0x05 altgr
+kana_u 0x05 shift altgr
+percent 0x06 shift
+kana_E 0x06 altgr
+kana_e 0x06 shift altgr
+ampersand 0x07 shift
+kana_O 0x07 altgr
+kana_o 0x07 shift altgr
+apostrophe 0x08 shift
+kana_YA 0x08 altgr
+kana_ya 0x08 shift altgr
+parenleft 0x09 shift
+kana_YU 0x09 altgr
+kana_yu 0x09 shift altgr
+parenright 0x0a shift
+kana_YO 0x0a altgr
+kana_yo 0x0a shift altgr
+asciitilde 0x0b shift
+kana_WA 0x0b altgr
+kana_WO 0x0b shift altgr
+minus 0x0c
+equal 0x0c shift
+kana_HO 0x0c altgr
+asciicircum 0x0d
+asciitilde 0x0d shift
+kana_HE 0x0d altgr
+kana_TA 0x10 altgr
+kana_TE 0x11 altgr
+kana_I 0x12 altgr
+kana_i 0x12 shift altgr
+kana_SU 0x13 altgr
+kana_KA 0x14 altgr
+kana_N 0x15 altgr
+kana_NA 0x16 altgr
+kana_NI 0x17 altgr
+kana_RA 0x18 altgr
+kana_SE 0x19 altgr
+at 0x1a
+grave 0x1a shift
+voicedsound 0x1a altgr
+bracketleft 0x1b
+braceleft 0x1b shift
+semivoicedsound 0x1b altgr
+kana_openingbracket 0x1b shift altgr
+kana_CHI 0x1e altgr
+kana_TO 0x1f altgr
+kana_SHI 0x20 altgr
+kana_HA 0x21 altgr
+kana_KI 0x22 altgr
+kana_KU 0x23 altgr
+kana_MA 0x24 altgr
+kana_NO 0x25 altgr
+kana_RI 0x26 altgr
+semicolon 0x27
+plus 0x27 shift
+kana_RE 0x27 altgr
+colon 0x28
+asterisk 0x28 shift
+kana_KE 0x28 altgr
+Zenkaku_Hankaku 0x29
+bracketright 0x2b
+braceright 0x2b shift
+kana_MU 0x2b altgr
+kana_closingbracket 0x2b shift altgr
+kana_TSU 0x2c altgr
+kana_tsu 0x2c shift altgr
+kana_SA 0x2d altgr
+kana_SO 0x2e altgr
+kana_HI 0x2f altgr
+kana_KO 0x30 altgr
+kana_MI 0x31 altgr
+kana_MO 0x32 altgr
+comma 0x33
+less 0x33 shift
+kana_NE 0x33 altgr
+kana_comma 0x33 shift altgr
+period 0x34
+greater 0x34 shift
+kana_RU 0x34 altgr
+kana_fullstop 0x34 shift altgr
+slash 0x35
+question 0x35 shift
+kana_ME 0x35 altgr
+kana_conjunctive 0x35 shift altgr
+Eisu_toggle 0x3a shift
+Execute 0x54 shift
+Kanji 0x70
+backslash 0x73
+bar 0x7d shift
+underscore 0x73 shift
+Henkan_Mode 0x79
+Katakana 0x70
+Muhenkan 0x7b
--- /dev/null
+# generated from XKB map ko
+include common
+map 0xe0010412
+exclam 0x02 shift
+at 0x03 shift
+numbersign 0x04 shift
+dollar 0x05 shift
+percent 0x06 shift
+asciicircum 0x07 shift
+ampersand 0x08 shift
+asterisk 0x09 shift
+parenleft 0x0a shift
+parenright 0x0b shift
+minus 0x0c
+underscore 0x0c shift
+equal 0x0d
+plus 0x0d shift
+bracketleft 0x1a
+braceleft 0x1a shift
+bracketright 0x1b
+braceright 0x1b shift
+semicolon 0x27
+colon 0x27 shift
+apostrophe 0x28
+quotedbl 0x28 shift
+grave 0x29
+asciitilde 0x29 shift
+backslash 0x2b
+bar 0x2b shift
+comma 0x33
+less 0x33 shift
+period 0x34
+greater 0x34 shift
+slash 0x35
+question 0x35 shift
+Hangul 0xf2
+Hangul_Hanja 0xf1
--- /dev/null
+# generated from XKB map lt
+include common
+map 0x427
+exclam 0x02 shift
+aogonek 0x02 altgr
+Aogonek 0x02 shift altgr
+at 0x03 shift
+ccaron 0x03 altgr
+Ccaron 0x03 shift altgr
+numbersign 0x04 shift
+eogonek 0x04 altgr
+Eogonek 0x04 shift altgr
+dollar 0x05 shift
+eabovedot 0x05 altgr
+Eabovedot 0x05 shift altgr
+percent 0x06 shift
+iogonek 0x06 altgr
+Iogonek 0x06 shift altgr
+asciicircum 0x07 shift
+scaron 0x07 altgr
+Scaron 0x07 shift altgr
+ampersand 0x08 shift
+uogonek 0x08 altgr
+Uogonek 0x08 shift altgr
+asterisk 0x09 shift
+umacron 0x09 altgr
+Umacron 0x09 shift altgr
+parenleft 0x0a shift
+doublelowquotemark 0x0a altgr
+parenright 0x0b shift
+leftdoublequotemark 0x0b altgr
+minus 0x0c
+underscore 0x0c shift
+equal 0x0d
+plus 0x0d shift
+zcaron 0x0d altgr
+Zcaron 0x0d shift altgr
+bracketleft 0x1a
+braceleft 0x1a shift
+bracketright 0x1b
+braceright 0x1b shift
+semicolon 0x27
+colon 0x27 shift
+apostrophe 0x28
+quotedbl 0x28 shift
+grave 0x29
+asciitilde 0x29 shift
+backslash 0x2b
+bar 0x2b shift
+comma 0x33
+less 0x33 shift
+period 0x34
+greater 0x34 shift
+slash 0x35
+question 0x35 shift
+endash 0x56
+EuroSign 0x56 shift
--- /dev/null
+# generated from XKB map lv
+include common
+map 0x426
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+at 0x03 shift
+twosuperior 0x03 altgr
+oneeighth 0x03 shift altgr
+numbersign 0x04 shift
+threesuperior 0x04 altgr
+sterling 0x04 shift altgr
+dollar 0x05 shift
+EuroSign 0x05 altgr
+cent 0x05 shift altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+asciicircum 0x07 shift
+threequarters 0x07 altgr
+fiveeighths 0x07 shift altgr
+ampersand 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+asterisk 0x09 shift
+bracketleft 0x09 altgr
+trademark 0x09 shift altgr
+parenleft 0x0a shift
+bracketright 0x0a altgr
+plusminus 0x0a shift altgr
+parenright 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+minus 0x0c
+underscore 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+equal 0x0d
+plus 0x0d shift
+dead_cedilla 0x0d altgr
+dead_ogonek 0x0d shift altgr
+at 0x10 altgr
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+emacron 0x12 altgr
+Emacron 0x12 shift altgr
+rcedilla 0x13 altgr
+Rcedilla 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+umacron 0x16 altgr
+Umacron 0x16 shift altgr
+imacron 0x17 altgr
+Imacron 0x17 shift altgr
+omacron 0x18 altgr
+Omacron 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+bracketleft 0x1a
+braceleft 0x1a shift
+dead_diaeresis 0x1a altgr
+dead_abovering 0x1a shift altgr
+bracketright 0x1b
+braceright 0x1b shift
+dead_tilde 0x1b altgr
+dead_macron 0x1b shift altgr
+ISO_Next_Group 0x1c shift
+amacron 0x1e altgr
+Amacron 0x1e shift altgr
+scaron 0x1f altgr
+Scaron 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+gcedilla 0x22 altgr
+Gcedilla 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kcedilla 0x25 altgr
+Kcedilla 0x25 shift altgr
+lcedilla 0x26 altgr
+Lcedilla 0x26 shift altgr
+semicolon 0x27
+colon 0x27 shift
+dead_acute 0x27 altgr
+dead_doubleacute 0x27 shift altgr
+apostrophe 0x28
+quotedbl 0x28 shift
+leftdoublequotemark 0x28 altgr
+doublelowquotemark 0x28 shift altgr
+grave 0x29
+asciitilde 0x29 shift
+notsign 0x29 altgr
+backslash 0x2b
+bar 0x2b shift
+dead_grave 0x2b altgr
+dead_breve 0x2b shift altgr
+zcaron 0x2c altgr
+Zcaron 0x2c shift altgr
+guillemotright 0x2d altgr
+greater 0x2d shift altgr
+ccaron 0x2e altgr
+Ccaron 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+apostrophe 0x30 shift altgr
+ncedilla 0x31 altgr
+Ncedilla 0x31 shift altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+less 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+greater 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+slash 0x35
+question 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
+nobreakspace 0x39 altgr
--- /dev/null
+# generated from XKB map mk
+include common
+map 0x42f
+exclam 0x02 shift
+at 0x03 shift
+doublelowquotemark 0x03 shift altgr
+numbersign 0x04 shift
+leftdoublequotemark 0x04 shift altgr
+dollar 0x05 shift
+percent 0x06 shift
+asciicircum 0x07 shift
+ampersand 0x08 shift
+asterisk 0x09 shift
+parenleft 0x0a shift
+parenright 0x0b shift
+minus 0x0c
+underscore 0x0c shift
+equal 0x0d
+plus 0x0d shift
+Cyrillic_lje 0x10 altgr
+Cyrillic_LJE 0x10 shift altgr
+Cyrillic_nje 0x11 altgr
+Cyrillic_NJE 0x11 shift altgr
+Cyrillic_ie 0x12 altgr
+Cyrillic_IE 0x12 shift altgr
+Cyrillic_er 0x13 altgr
+Cyrillic_ER 0x13 shift altgr
+Cyrillic_te 0x14 altgr
+Cyrillic_TE 0x14 shift altgr
+Macedonia_dse 0x15 altgr
+Macedonia_DSE 0x15 shift altgr
+Cyrillic_u 0x16 altgr
+Cyrillic_U 0x16 shift altgr
+Cyrillic_i 0x17 altgr
+Cyrillic_I 0x17 shift altgr
+Cyrillic_o 0x18 altgr
+Cyrillic_O 0x18 shift altgr
+Cyrillic_pe 0x19 altgr
+Cyrillic_PE 0x19 shift altgr
+bracketleft 0x1a
+braceleft 0x1a shift
+Cyrillic_sha 0x1a altgr
+Cyrillic_SHA 0x1a shift altgr
+bracketright 0x1b
+braceright 0x1b shift
+Macedonia_gje 0x1b altgr
+Macedonia_GJE 0x1b shift altgr
+Cyrillic_a 0x1e altgr
+Cyrillic_A 0x1e shift altgr
+Cyrillic_es 0x1f altgr
+Cyrillic_ES 0x1f shift altgr
+Cyrillic_de 0x20 altgr
+Cyrillic_DE 0x20 shift altgr
+Cyrillic_ef 0x21 altgr
+Cyrillic_EF 0x21 shift altgr
+Cyrillic_ghe 0x22 altgr
+Cyrillic_GHE 0x22 shift altgr
+Cyrillic_ha 0x23 altgr
+Cyrillic_HA 0x23 shift altgr
+Cyrillic_je 0x24 altgr
+Cyrillic_JE 0x24 shift altgr
+Cyrillic_ka 0x25 altgr
+Cyrillic_KA 0x25 shift altgr
+Cyrillic_el 0x26 altgr
+Cyrillic_EL 0x26 shift altgr
+semicolon 0x27
+colon 0x27 shift
+Cyrillic_che 0x27 altgr
+Cyrillic_CHE 0x27 shift altgr
+apostrophe 0x28
+quotedbl 0x28 shift
+Macedonia_kje 0x28 altgr
+Macedonia_KJE 0x28 shift altgr
+grave 0x29
+asciitilde 0x29 shift
+backslash 0x2b
+bar 0x2b shift
+Cyrillic_zhe 0x2b altgr
+Cyrillic_ZHE 0x2b shift altgr
+Cyrillic_ze 0x2c altgr
+Cyrillic_ZE 0x2c shift altgr
+Cyrillic_dzhe 0x2d altgr
+Cyrillic_DZHE 0x2d shift altgr
+Cyrillic_tse 0x2e altgr
+Cyrillic_TSE 0x2e shift altgr
+Cyrillic_ve 0x2f altgr
+Cyrillic_VE 0x2f shift altgr
+Cyrillic_be 0x30 altgr
+Cyrillic_BE 0x30 shift altgr
+Cyrillic_en 0x31 altgr
+Cyrillic_EN 0x31 shift altgr
+Cyrillic_em 0x32 altgr
+Cyrillic_EM 0x32 shift altgr
+comma 0x33
+less 0x33 shift
+semicolon 0x33 shift altgr
+period 0x34
+greater 0x34 shift
+colon 0x34 shift altgr
+slash 0x35
+question 0x35 shift
--- /dev/null
+Shift_R 0x36
+Shift_L 0x2a
+
+Alt_R 0xb8
+Mode_switch 0xb8
+ISO_Level3_Shift 0xb8
+
+Alt_L 0x38
+
+Control_R 0x9d
+Control_L 0x1d
+
+# Translate Meta, Super and Hyper to Windows keys.
+# This is hardcoded. See documentation for details.
+
+# Translate Menu to the Windows Application key.
+# This one does not work either.
+Menu 0xdd
--- /dev/null
+# Dutch (Netherlands)
+include common
+map 0x413
+
+exclam 0x02 shift
+onesuperior 0x02 altgr
+quotebl 0x03 shift
+twosuperior 0x03 altgr
+numbersign 0x04 shift
+threesuperior 0x04 altgr
+dollar 0x05 shift
+onequarter 0x05 altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+ampersand 0x07 shift
+threequarters 0x07 altgr
+underscore 0x08 shift
+sterling 0x08 altgr
+parenleft 0x09 shift
+braceleft 0x09 altgr
+parenright 0x0a shift
+braceright 0x0a altgr
+apostrophe 0x0b shift
+slash 0x0c
+question 0x0c shift
+backslash 0x0c altgr
+degree 0x0d
+dead_tilde 0x0d shift
+dead_cedilla 0x0d altgr
+EuroSign 0x12 altgr
+paragraph 0x13 altgr
+dead_diaeresis 0x1a
+dead_circumflex 0x1a shift
+asterisk 0x1b
+bar 0x1b shift
+ssharp 0x1f altgr
+plus 0x27
+plusminus 0x27 shift
+dead_acute 0x28
+dead_grave 0x28 shift
+at 0x29
+section 0x29 shift
+notsign 0x29 altgr
+less 0x2b
+greater 0x2b shift
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+copyright 0x2e altgr
+mu 0x32 altgr
+comma 0x33
+semicolon 0x33 shift
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+hyphen 0x35
+equal 0x35 shift
+bracketright 0x56
+bracketleft 0x56 shift
+brokenbar 0x56 altgr
+
--- /dev/null
+# Dutch (Belgium)
+map 0x813
+include common
+ampersand 0x02
+1 0x02 shift
+bar 0x02 altgr
+exclamdown 0x02 shift altgr
+eacute 0x03
+2 0x03 shift
+at 0x03 altgr
+oneeighth 0x03 shift altgr
+quotedbl 0x04
+3 0x04 shift
+numbersign 0x04 altgr
+sterling 0x04 shift altgr
+apostrophe 0x05
+4 0x05 shift
+onequarter 0x05 altgr
+dollar 0x05 shift altgr
+parenleft 0x06
+5 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+section 0x07
+6 0x07 shift
+asciicircum 0x07 altgr
+fiveeighths 0x07 shift altgr
+egrave 0x08
+7 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+exclam 0x09
+8 0x09 shift
+bracketleft 0x09 altgr
+trademark 0x09 shift altgr
+ccedilla 0x0a
+9 0x0a shift
+braceleft 0x0a altgr
+plusminus 0x0a shift altgr
+agrave 0x0b
+0 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+parenright 0x0c
+degree 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+minus 0x0d
+underscore 0x0d shift
+dead_cedilla 0x0d altgr
+dead_ogonek 0x0d shift altgr
+a 0x10 addupper
+# at 0x10 altgr
+Greek_OMEGA 0x10 shift altgr
+z 0x11 addupper
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+cent 0x12 shift altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+dead_circumflex 0x1a
+dead_diaeresis 0x1a shift
+bracketleft 0x1a altgr
+dead_abovering 0x1a shift altgr
+dollar 0x1b
+asterisk 0x1b shift
+bracketright 0x1b altgr
+dead_macron 0x1b shift altgr
+q 0x1e addupper
+ae 0x1e altgr
+AE 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+# ampersand 0x25 shift altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+m 0x27 addupper
+dead_acute 0x27 altgr
+dead_doubleacute 0x27 shift altgr
+ugrave 0x28
+percent 0x28 shift
+dead_acute 0x28 altgr
+dead_caron 0x28 shift altgr
+twosuperior 0x29
+threesuperior 0x29 shift
+notsign 0x29 altgr
+mu 0x2b
+sterling 0x2b shift
+dead_grave 0x2b altgr
+dead_breve 0x2b shift altgr
+w 0x2c addupper
+guillemotleft 0x2c altgr
+less 0x2c shift altgr
+guillemotright 0x2d altgr
+greater 0x2d shift altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+# apostrophe 0x30 shift altgr
+comma 0x32
+question 0x32 shift
+dead_cedilla 0x32 altgr
+masculine 0x32 shift altgr
+semicolon 0x33
+period 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+colon 0x34
+slash 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+equal 0x35
+plus 0x35 shift
+dead_tilde 0x35 altgr
+dead_abovedot 0x35 shift altgr
+backslash 0x56 altgr
+less 0x56
+greater 0x56 shift
--- /dev/null
+# generated from XKB map no
+include common
+map 0x414
+exclam 0x02 shift
+exclamdown 0x02 altgr
+onesuperior 0x02 shift altgr
+quotedbl 0x03 shift
+at 0x03 altgr
+twosuperior 0x03 shift altgr
+numbersign 0x04 shift
+sterling 0x04 altgr
+threesuperior 0x04 shift altgr
+currency 0x05 shift
+dollar 0x05 altgr
+onequarter 0x05 shift altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+cent 0x06 shift altgr
+ampersand 0x07 shift
+yen 0x07 altgr
+fiveeighths 0x07 shift altgr
+slash 0x08 shift
+braceleft 0x08 altgr
+division 0x08 shift altgr
+parenleft 0x09 shift
+bracketleft 0x09 altgr
+guillemotleft 0x09 shift altgr
+parenright 0x0a shift
+bracketright 0x0a altgr
+guillemotright 0x0a shift altgr
+equal 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+plus 0x0c
+question 0x0c shift
+plusminus 0x0c altgr
+questiondown 0x0c shift altgr
+backslash 0x0d
+dead_grave 0x0d shift
+dead_acute 0x0d altgr
+notsign 0x0d shift altgr
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+cent 0x12 shift altgr
+registered 0x13 altgr
+thorn 0x14 altgr
+THORN 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oe 0x18 altgr
+OE 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+aring 0x1a
+Aring 0x1a shift
+dead_diaeresis 0x1a altgr
+dead_abovering 0x1a shift altgr
+dead_diaeresis 0x1b
+dead_circumflex 0x1b shift
+asciicircum 0x01b shift
+dead_tilde 0x1b altgr
+asciitilde 0x1b altgr
+dead_caron 0x1b shift altgr
+ordfeminine 0x1e altgr
+masculine 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+oslash 0x27
+Ooblique 0x27 shift
+dead_doubleacute 0x27 shift altgr
+ae 0x28
+AE 0x28 shift
+dead_caron 0x28 shift altgr
+bar 0x29
+section 0x29 shift
+brokenbar 0x29 altgr
+paragraph 0x29 shift altgr
+apostrophe 0x2b
+asterisk 0x2b shift
+multiply 0x2b shift altgr
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+copyright 0x2e altgr
+leftdoublequotemark 0x2f altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+semicolon 0x33 shift
+dead_cedilla 0x33 altgr
+dead_ogonek 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+dead_abovedot 0x34 shift altgr
+minus 0x35
+underscore 0x35 shift
+hyphen 0x35 altgr
+macron 0x35 shift altgr
+nobreakspace 0x39 altgr
+onehalf 0x56 altgr
+threequarters 0x56 shift altgr
--- /dev/null
+# generated from XKB map pl
+include common
+map 0x415
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+at 0x03 shift
+twosuperior 0x03 altgr
+oneeighth 0x03 shift altgr
+numbersign 0x04 shift
+threesuperior 0x04 altgr
+sterling 0x04 shift altgr
+dollar 0x05 shift
+onequarter 0x05 altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+asciicircum 0x07 shift
+threequarters 0x07 altgr
+fiveeighths 0x07 shift altgr
+ampersand 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+asterisk 0x09 shift
+bracketleft 0x09 altgr
+trademark 0x09 shift altgr
+parenleft 0x0a shift
+bracketright 0x0a altgr
+plusminus 0x0a shift altgr
+parenright 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+minus 0x0c
+underscore 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+equal 0x0d
+plus 0x0d shift
+dead_cedilla 0x0d altgr
+dead_ogonek 0x0d shift altgr
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+eogonek 0x12 altgr
+Eogonek 0x12 shift altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+EuroSign 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oacute 0x18 altgr
+Oacute 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+bracketleft 0x1a
+braceleft 0x1a shift
+dead_diaeresis 0x1a altgr
+dead_abovering 0x1a shift altgr
+bracketright 0x1b
+braceright 0x1b shift
+dead_tilde 0x1b altgr
+dead_macron 0x1b shift altgr
+aogonek 0x1e altgr
+Aogonek 0x1e shift altgr
+sacute 0x1f altgr
+Sacute 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+semicolon 0x27
+colon 0x27 shift
+dead_acute 0x27 altgr
+dead_doubleacute 0x27 shift altgr
+apostrophe 0x28
+quotedbl 0x28 shift
+dead_circumflex 0x28 altgr
+dead_caron 0x28 shift altgr
+grave 0x29
+asciitilde 0x29 shift
+notsign 0x29 altgr
+backslash 0x2b
+bar 0x2b shift
+dead_grave 0x2b altgr
+dead_breve 0x2b shift altgr
+zabovedot 0x2c altgr
+Zabovedot 0x2c shift altgr
+zacute 0x2d altgr
+Zacute 0x2d shift altgr
+cacute 0x2e altgr
+Cacute 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+nacute 0x31 altgr
+Nacute 0x31 shift altgr
+mu 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+less 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+greater 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+slash 0x35
+question 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
--- /dev/null
+# generated from XKB map pt
+include common
+map 0x816
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+quotedbl 0x03 shift
+at 0x03 altgr
+oneeighth 0x03 shift altgr
+numbersign 0x04 shift
+sterling 0x04 altgr
+dollar 0x05 shift
+section 0x05 altgr
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+ampersand 0x07 shift
+threequarters 0x07 altgr
+fiveeighths 0x07 shift altgr
+slash 0x08 shift
+braceleft 0x08 altgr
+seveneighths 0x08 shift altgr
+parenleft 0x09 shift
+bracketleft 0x09 altgr
+trademark 0x09 shift altgr
+parenright 0x0a shift
+bracketright 0x0a altgr
+plusminus 0x0a shift altgr
+equal 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+apostrophe 0x0c
+question 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+guillemotleft 0x0d
+guillemotright 0x0d shift
+dead_cedilla 0x0d altgr
+dead_ogonek 0x0d shift altgr
+Greek_OMEGA 0x10 shift altgr
+lstroke 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+cent 0x12 shift altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+plus 0x1a
+asterisk 0x1a shift
+dead_diaeresis 0x1a altgr
+dead_abovering 0x1a shift altgr
+dead_acute 0x1b
+dead_grave 0x1b shift
+dead_tilde 0x1b altgr
+dead_macron 0x1b shift altgr
+ae 0x1e altgr
+AE 0x1e shift altgr
+ssharp 0x1f altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+dstroke 0x21 altgr
+ordfeminine 0x21 shift altgr
+eng 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+kra 0x25 altgr
+lstroke 0x26 altgr
+Lstroke 0x26 shift altgr
+ccedilla 0x27
+Ccedilla 0x27 shift
+dead_doubleacute 0x27 shift altgr
+masculine 0x28
+ordfeminine 0x28 shift
+dead_circumflex 0x28 altgr
+dead_caron 0x28 shift altgr
+backslash 0x29
+bar 0x29 shift
+notsign 0x29 altgr
+dead_tilde 0x2b
+dead_circumflex 0x2b shift
+dead_breve 0x2b shift altgr
+less 0x56
+greater 0x56 shift
+cent 0x2e altgr
+copyright 0x2e shift altgr
+leftdoublequotemark 0x2f altgr
+grave 0x2f shift altgr
+rightdoublequotemark 0x30 altgr
+mu 0x32 altgr
+comma 0x33
+semicolon 0x33 shift
+horizconnector 0x33 altgr
+multiply 0x33 shift altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+minus 0x35
+underscore 0x35 shift
+dead_belowdot 0x35 altgr
+dead_abovedot 0x35 shift altgr
--- /dev/null
+# generated from XKB map br
+include common
+map 0x416
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+at 0x03 shift
+twosuperior 0x03 altgr
+onehalf 0x03 shift altgr
+numbersign 0x04 shift
+threesuperior 0x04 altgr
+threequarters 0x04 shift altgr
+dollar 0x05 shift
+sterling 0x05 altgr
+onequarter 0x05 shift altgr
+percent 0x06 shift
+cent 0x06 altgr
+dead_diaeresis 0x07 shift
+notsign 0x07 altgr
+diaeresis 0x07 shift altgr
+ampersand 0x08 shift
+braceleft 0x08 altgr
+asterisk 0x09 shift
+bracketleft 0x09 altgr
+parenleft 0x0a shift
+bracketright 0x0a altgr
+parenright 0x0b shift
+braceright 0x0b altgr
+minus 0x0c
+underscore 0x0c shift
+backslash 0x0c altgr
+equal 0x0d
+plus 0x0d shift
+section 0x0d altgr
+EuroSign 0x12 altgr
+registered 0x13 altgr
+dead_acute 0x1a
+dead_grave 0x1a shift
+acute 0x1a altgr
+grave 0x1a shift altgr
+bracketleft 0x1b
+braceleft 0x1b shift
+ordfeminine 0x1b altgr
+ccedilla 0x27
+Ccedilla 0x27 shift
+dead_tilde 0x28
+dead_circumflex 0x28 shift
+asciitilde 0x28 altgr
+asciicircum 0x28 shift altgr
+apostrophe 0x29
+quotedbl 0x29 shift
+bracketright 0x2b
+braceright 0x2b shift
+masculine 0x2b altgr
+copyright 0x2e altgr
+mu 0x32 altgr
+comma 0x33
+less 0x33 shift
+period 0x34
+greater 0x34 shift
+semicolon 0x35
+colon 0x35 shift
+comma 0x53 numlock
+backslash 0x56
+bar 0x56 shift
+slash 0x73
+question 0x73 shift
+degree 0x73 altgr
+KP_Decimal 0x34
--- /dev/null
+# generated from XKB map ru
+include common
+map 0x419
+exclam 0x02 shift
+at 0x03 shift
+quotedbl 0x03 shift altgr
+numbersign 0x04 shift
+dollar 0x05 shift
+asterisk 0x05 shift altgr
+percent 0x06 shift
+colon 0x06 shift altgr
+asciicircum 0x07 shift
+comma 0x07 shift altgr
+ampersand 0x08 shift
+period 0x08 shift altgr
+asterisk 0x09 shift
+semicolon 0x09 shift altgr
+parenleft 0x0a shift
+parenright 0x0b shift
+minus 0x0c
+underscore 0x0c shift
+equal 0x0d
+plus 0x0d shift
+Cyrillic_shorti 0x10 altgr
+Cyrillic_SHORTI 0x10 shift altgr
+Cyrillic_tse 0x11 altgr
+Cyrillic_TSE 0x11 shift altgr
+Cyrillic_u 0x12 altgr
+Cyrillic_U 0x12 shift altgr
+Cyrillic_ka 0x13 altgr
+Cyrillic_KA 0x13 shift altgr
+Cyrillic_ie 0x14 altgr
+Cyrillic_IE 0x14 shift altgr
+Cyrillic_en 0x15 altgr
+Cyrillic_EN 0x15 shift altgr
+Cyrillic_ghe 0x16 altgr
+Cyrillic_GHE 0x16 shift altgr
+Cyrillic_sha 0x17 altgr
+Cyrillic_SHA 0x17 shift altgr
+Cyrillic_shcha 0x18 altgr
+Cyrillic_SHCHA 0x18 shift altgr
+Cyrillic_ze 0x19 altgr
+Cyrillic_ZE 0x19 shift altgr
+bracketleft 0x1a
+braceleft 0x1a shift
+Cyrillic_ha 0x1a altgr
+Cyrillic_HA 0x1a shift altgr
+bracketright 0x1b
+braceright 0x1b shift
+Cyrillic_hardsign 0x1b altgr
+Cyrillic_HARDSIGN 0x1b shift altgr
+Cyrillic_ef 0x1e altgr
+Cyrillic_EF 0x1e shift altgr
+Cyrillic_yeru 0x1f altgr
+Cyrillic_YERU 0x1f shift altgr
+Cyrillic_ve 0x20 altgr
+Cyrillic_VE 0x20 shift altgr
+Cyrillic_a 0x21 altgr
+Cyrillic_A 0x21 shift altgr
+Cyrillic_pe 0x22 altgr
+Cyrillic_PE 0x22 shift altgr
+Cyrillic_er 0x23 altgr
+Cyrillic_ER 0x23 shift altgr
+Cyrillic_o 0x24 altgr
+Cyrillic_O 0x24 shift altgr
+Cyrillic_el 0x25 altgr
+Cyrillic_EL 0x25 shift altgr
+Cyrillic_de 0x26 altgr
+Cyrillic_DE 0x26 shift altgr
+semicolon 0x27
+colon 0x27 shift
+Cyrillic_zhe 0x27 altgr
+Cyrillic_ZHE 0x27 shift altgr
+apostrophe 0x28
+quotedbl 0x28 shift
+Cyrillic_e 0x28 altgr
+Cyrillic_E 0x28 shift altgr
+grave 0x29
+asciitilde 0x29 shift
+Cyrillic_io 0x29 altgr
+Cyrillic_IO 0x29 shift altgr
+backslash 0x2b
+bar 0x2b shift
+Cyrillic_ya 0x2c altgr
+Cyrillic_YA 0x2c shift altgr
+Cyrillic_che 0x2d altgr
+Cyrillic_CHE 0x2d shift altgr
+Cyrillic_es 0x2e altgr
+Cyrillic_ES 0x2e shift altgr
+Cyrillic_em 0x2f altgr
+Cyrillic_EM 0x2f shift altgr
+Cyrillic_i 0x30 altgr
+Cyrillic_I 0x30 shift altgr
+Cyrillic_te 0x31 altgr
+Cyrillic_TE 0x31 shift altgr
+Cyrillic_softsign 0x32 altgr
+Cyrillic_SOFTSIGN 0x32 shift altgr
+comma 0x33
+less 0x33 shift
+Cyrillic_be 0x33 altgr
+Cyrillic_BE 0x33 shift altgr
+period 0x34
+greater 0x34 shift
+Cyrillic_yu 0x34 altgr
+Cyrillic_YU 0x34 shift altgr
+slash 0x35
+question 0x35 shift
+slash 0x56 altgr
+bar 0x56 shift altgr
--- /dev/null
+# generated from XKB map sl
+include common
+map 0x424
+exclam 0x02 shift
+asciitilde 0x02 altgr
+dead_tilde 0x02 shift altgr
+quotedbl 0x03 shift
+dead_caron 0x03 altgr
+caron 0x03 shift altgr
+numbersign 0x04 shift
+asciicircum 0x04 altgr
+dead_circumflex 0x04 shift altgr
+dollar 0x05 shift
+dead_breve 0x05 altgr
+breve 0x05 shift altgr
+percent 0x06 shift
+degree 0x06 altgr
+dead_abovering 0x06 shift altgr
+ampersand 0x07 shift
+dead_ogonek 0x07 altgr
+ogonek 0x07 shift altgr
+slash 0x08 shift
+grave 0x08 altgr
+dead_grave 0x08 shift altgr
+parenleft 0x09 shift
+dead_abovedot 0x09 altgr
+abovedot 0x09 shift altgr
+parenright 0x0a shift
+dead_acute 0x0a altgr
+equal 0x0b shift
+dead_doubleacute 0x0b altgr
+doubleacute 0x0b shift altgr
+apostrophe 0x0c
+question 0x0c shift
+dead_diaeresis 0x0c altgr
+diaeresis 0x0c shift altgr
+plus 0x0d
+asterisk 0x0d shift
+dead_cedilla 0x0d altgr
+cedilla 0x0d shift altgr
+backslash 0x10 altgr
+Greek_OMEGA 0x10 shift altgr
+bar 0x11 altgr
+Lstroke 0x11 shift altgr
+EuroSign 0x12 altgr
+paragraph 0x13 altgr
+registered 0x13 shift altgr
+tslash 0x14 altgr
+Tslash 0x14 shift altgr
+z 0x15 addupper
+leftarrow 0x15 altgr
+yen 0x15 shift altgr
+downarrow 0x16 altgr
+uparrow 0x16 shift altgr
+rightarrow 0x17 altgr
+idotless 0x17 shift altgr
+oslash 0x18 altgr
+Ooblique 0x18 shift altgr
+thorn 0x19 altgr
+THORN 0x19 shift altgr
+scaron 0x1a
+Scaron 0x1a shift
+division 0x1a altgr
+dstroke 0x1b
+Dstroke 0x1b shift
+multiply 0x1b altgr
+dead_macron 0x1b shift altgr
+ae 0x1e altgr
+AE 0x1e shift altgr
+ssharp 0x1f altgr
+section 0x1f shift altgr
+eth 0x20 altgr
+ETH 0x20 shift altgr
+bracketleft 0x21 altgr
+ordfeminine 0x21 shift altgr
+bracketright 0x22 altgr
+ENG 0x22 shift altgr
+hstroke 0x23 altgr
+Hstroke 0x23 shift altgr
+lstroke 0x25 altgr
+Lstroke 0x26 altgr
+ccaron 0x27
+Ccaron 0x27 shift
+cacute 0x28
+Cacute 0x28 shift
+ssharp 0x28 altgr
+dead_cedilla 0x29
+notsign 0x29 altgr
+zcaron 0x2b
+Zcaron 0x2b shift
+currency 0x2b altgr
+y 0x2c addupper
+guillemotleft 0x2c altgr
+guillemotright 0x2d altgr
+cent 0x2e altgr
+copyright 0x2e shift altgr
+at 0x2f altgr
+braceleft 0x30 altgr
+braceright 0x31 altgr
+section 0x32 altgr
+masculine 0x32 shift altgr
+comma 0x33
+semicolon 0x33 shift
+horizconnector 0x33 altgr
+period 0x34
+colon 0x34 shift
+periodcentered 0x34 altgr
+minus 0x35
+underscore 0x35 shift
+dead_belowdot 0x35 altgr
--- /dev/null
+map 0x0000041d
+include common
+
+#
+# Top row
+#
+section 0x29
+onehalf 0x29 shift
+
+# 1
+exclam 0x2 shift
+
+# 2
+quotedbl 0x3 shift
+at 0x3 altgr
+
+# 3
+numbersign 0x4 shift
+sterling 0x4 altgr
+# 4
+currency 0x5 shift
+dollar 0x5 altgr
+# 5
+percent 0x6 shift
+# 6
+ampersand 0x7 shift
+# 7
+slash 0x8 shift
+braceleft 0x8 altgr
+# 8
+parenleft 0x9 shift
+bracketleft 0x9 altgr
+# 9
+parenright 0xa shift
+bracketright 0xa altgr
+# 0
+equal 0xb shift
+braceright 0xb altgr
+
+plus 0xc
+question 0xc shift
+backslash 0xc altgr
+
+dead_acute 0xd
+dead_grave 0xd shift
+
+#
+# QWERTY first row
+#
+EuroSign 0x12 altgr
+aring 0x1a
+Aring 0x1a shift
+dead_diaeresis 0x1b
+dead_circumflex 0x1b shift
+dead_tilde 0x1b altgr
+
+#
+# QWERTY second row
+#
+odiaeresis 0x27
+Odiaeresis 0x27 shift
+adiaeresis 0x28
+Adiaeresis 0x28 shift
+apostrophe 0x2b
+asterisk 0x2b shift
+
+#
+# QWERTY third row
+#
+less 0x56
+greater 0x56 shift
+bar 0x56 altgr
+mu 0x32 altgr
+comma 0x33
+semicolon 0x33 shift
+period 0x34
+colon 0x34 shift
+minus 0x35
+underscore 0x35 shift
+
--- /dev/null
+# generated from XKB map th
+include common
+map 0x41e
+exclam 0x02 shift
+Thai_lakkhangyao 0x02 altgr
+plus 0x02 shift altgr
+at 0x03 shift
+slash 0x03 altgr
+Thai_leknung 0x03 shift altgr
+numbersign 0x04 shift
+minus 0x04 altgr
+Thai_leksong 0x04 shift altgr
+dollar 0x05 shift
+Thai_phosamphao 0x05 altgr
+Thai_leksam 0x05 shift altgr
+percent 0x06 shift
+Thai_thothung 0x06 altgr
+Thai_leksi 0x06 shift altgr
+asciicircum 0x07 shift
+Thai_sarau 0x07 altgr
+Thai_sarauu 0x07 shift altgr
+ampersand 0x08 shift
+Thai_saraue 0x08 altgr
+Thai_baht 0x08 shift altgr
+asterisk 0x09 shift
+Thai_khokhwai 0x09 altgr
+Thai_lekha 0x09 shift altgr
+parenleft 0x0a shift
+Thai_totao 0x0a altgr
+Thai_lekhok 0x0a shift altgr
+parenright 0x0b shift
+Thai_chochan 0x0b altgr
+Thai_lekchet 0x0b shift altgr
+minus 0x0c
+underscore 0x0c shift
+Thai_khokhai 0x0c altgr
+Thai_lekpaet 0x0c shift altgr
+equal 0x0d
+plus 0x0d shift
+Thai_chochang 0x0d altgr
+Thai_lekkao 0x0d shift altgr
+Thai_maiyamok 0x10 altgr
+Thai_leksun 0x10 shift altgr
+Thai_saraaimaimalai 0x11 altgr
+quotedbl 0x11 shift altgr
+Thai_saraam 0x12 altgr
+Thai_dochada 0x12 shift altgr
+Thai_phophan 0x13 altgr
+Thai_thonangmontho 0x13 shift altgr
+Thai_saraa 0x14 altgr
+Thai_thothong 0x14 shift altgr
+Thai_maihanakat 0x15 altgr
+Thai_nikhahit 0x15 shift altgr
+Thai_saraii 0x16 altgr
+Thai_maitri 0x16 shift altgr
+Thai_rorua 0x17 altgr
+Thai_nonen 0x17 shift altgr
+Thai_nonu 0x18 altgr
+Thai_paiyannoi 0x18 shift altgr
+Thai_yoyak 0x19 altgr
+Thai_yoying 0x19 shift altgr
+bracketleft 0x1a
+braceleft 0x1a shift
+Thai_bobaimai 0x1a altgr
+Thai_thothan 0x1a shift altgr
+bracketright 0x1b
+braceright 0x1b shift
+Thai_loling 0x1b altgr
+comma 0x1b shift altgr
+Thai_fofan 0x1e altgr
+Thai_ru 0x1e shift altgr
+Thai_hohip 0x1f altgr
+Thai_khorakhang 0x1f shift altgr
+Thai_kokai 0x20 altgr
+Thai_topatak 0x20 shift altgr
+Thai_dodek 0x21 altgr
+Thai_sarao 0x21 shift altgr
+Thai_sarae 0x22 altgr
+Thai_chochoe 0x22 shift altgr
+Thai_maitho 0x23 altgr
+Thai_maitaikhu 0x23 shift altgr
+Thai_maiek 0x24 altgr
+Thai_maichattawa 0x24 shift altgr
+Thai_saraaa 0x25 altgr
+Thai_sorusi 0x25 shift altgr
+Thai_sosua 0x26 altgr
+Thai_sosala 0x26 shift altgr
+semicolon 0x27
+colon 0x27 shift
+Thai_wowaen 0x27 altgr
+Thai_soso 0x27 shift altgr
+apostrophe 0x28
+quotedbl 0x28 shift
+Thai_ngongu 0x28 altgr
+period 0x28 shift altgr
+grave 0x29
+asciitilde 0x29 shift
+underscore 0x29 altgr
+percent 0x29 shift altgr
+ISO_First_Group 0x2a shift
+backslash 0x2b
+bar 0x2b shift
+Thai_khokhuat 0x2b altgr
+Thai_khokhon 0x2b shift altgr
+Thai_phophung 0x2c altgr
+parenleft 0x2c shift altgr
+Thai_popla 0x2d altgr
+parenright 0x2d shift altgr
+Thai_saraae 0x2e altgr
+Thai_choching 0x2e shift altgr
+Thai_oang 0x2f altgr
+Thai_honokhuk 0x2f shift altgr
+Thai_sarai 0x30 altgr
+Thai_phinthu 0x30 shift altgr
+Thai_sarauee 0x31 altgr
+Thai_thanthakhat 0x31 shift altgr
+Thai_thothahan 0x32 altgr
+question 0x32 shift altgr
+comma 0x33
+less 0x33 shift
+Thai_moma 0x33 altgr
+Thai_thophuthao 0x33 shift altgr
+period 0x34
+greater 0x34 shift
+Thai_saraaimaimuan 0x34 altgr
+Thai_lochula 0x34 shift altgr
+slash 0x35
+question 0x35 shift
+Thai_fofa 0x35 altgr
+Thai_lu 0x35 shift altgr
+ISO_Last_Group 0x36 shift
--- /dev/null
+# rdesktop Turkish Q Keyboard Layout
+#
+# Modified by Umit Oztosun <umit@liqia.com> 20040328
+#
+# Modified from the original mapping file provided with rdesktop 1.3.1.
+# This version works correctly with the right X settings.
+
+include common
+map 0x41f
+
+# First row
+quotedbl 0x29
+eacute 0x29 shift
+backslash 0x29 altgr
+
+exclam 0x02 shift
+onesuperior 0x02 altgr
+exclamdown 0x02 shift altgr
+
+apostrophe 0x03 shift
+sterling 0x03 altgr
+twosuperior 0x03 shift altgr
+
+dead_circumflex 0x04 shift
+numbersign 0x04 altgr
+threesuperior 0x04 shift altgr
+
+plus 0x05 shift
+dollar 0x05 altgr
+onequarter 0x05 shift altgr
+
+percent 0x06 shift
+onehalf 0x06 altgr
+threeeighths 0x06 shift altgr
+
+ampersand 0x07 shift
+threequarters 0x07 altgr
+
+slash 0x08 shift
+braceleft 0x08 altgr
+
+parenleft 0x09 shift
+bracketleft 0x09 altgr
+
+parenright 0x0a shift
+bracketright 0x0a altgr
+plusminus 0x0a shift altgr
+
+equal 0x0b shift
+braceright 0x0b altgr
+degree 0x0b shift altgr
+
+asterisk 0x0c
+question 0x0c shift
+backslash 0x0c altgr
+questiondown 0x0c shift altgr
+
+minus 0x0d
+underscore 0x0d shift
+division 0x0d altgr
+
+at 0x10 altgr
+
+EuroSign 0x12 altgr
+
+trademark 0x14 altgr
+
+ucircumflex 0x16 altgr
+Ucircumflex 0x16 shift altgr
+
+idotless 0x17
+I 0x17 shift
+icircumflex 0x17 altgr
+Icircumflex 0x17 altgr shift
+
+ocircumflex 0x18 altgr
+Ocircumflex 0x18 shift altgr
+
+gbreve 0x1a
+Gbreve 0x1a shift
+
+udiaeresis 0x1b
+Udiaeresis 0x1b shift
+asciitilde 0x1b altgr
+dead_macron 0x1b shift altgr
+
+comma 0x2b
+semicolon 0x2b shift
+grave 0x2b altgr
+dead_grave 0x2b altgr shift
+
+# Second row
+
+acircumflex 0x1e altgr
+Acircumflex 0x1e shift altgr
+
+section 0x1f altgr
+
+ordfeminine 0x21 altgr
+
+scedilla 0x27
+Scedilla 0x27 shift
+acute 0x27 altgr
+dead_acute 0x27 shift altgr
+
+i 0x28
+Iabovedot 0x28 shift
+apostrophe 0x28 altgr
+dead_caron 0x28 shift altgr
+
+less 0x56
+greater 0x56 shift
+bar 0x56 altgr
+brokenbar 0x56 shift altgr
+
+cent 0x2e altgr
+copyright 0x2e shift altgr
+
+leftdoublequotemark 0x2f altgr
+
+rightdoublequotemark 0x30 altgr
+
+mu 0x32 altgr
+masculine 0x32 shift altgr
+
+odiaeresis 0x33
+Odiaeresis 0x33 shift
+multiply 0x33 altgr
+
+ccedilla 0x34
+Ccedilla 0x34 shift
+periodcentered 0x34 altgr
+division 0x34 shift altgr
+
+period 0x35
+colon 0x35 shift
+dead_abovedot 0x35 altgr
+dead_abovedot 0x35 shift altgr
+
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ RDP licensing negotiation
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+#include <openssl/rc4.h> // TODO: remove dependency on OpenSSL
+
+/* Generate a session key and RC4 keys, given client and server randoms */
+static void
+licence_generate_keys(RDPCLIENT * This, uint8 * client_random, uint8 * server_random, uint8 * pre_master_secret)
+{
+ uint8 master_secret[48];
+ uint8 key_block[48];
+
+ /* Generate master secret and then key material */
+ sec_hash_48(master_secret, pre_master_secret, client_random, server_random, 'A');
+ sec_hash_48(key_block, master_secret, server_random, client_random, 'A');
+
+ /* Store first 16 bytes of session key as MAC secret */
+ memcpy(This->licence.sign_key, key_block, 16);
+
+ /* Generate RC4 key from next 16 bytes */
+ sec_hash_16(This->licence.key, &key_block[16], client_random, server_random);
+}
+
+static void
+licence_generate_hwid(RDPCLIENT * This, uint8 * hwid)
+{
+ buf_out_uint32(hwid, 2);
+ strncpy((char *) (hwid + 4), This->licence_hostname, LICENCE_HWID_SIZE - 4);
+}
+
+/* Present an existing licence to the server */
+static BOOL
+licence_present(RDPCLIENT * This, uint8 * client_random, uint8 * rsa_data,
+ uint8 * licence_data, int licence_size, uint8 * hwid, uint8 * signature)
+{
+ uint32 sec_flags = SEC_LICENCE_NEG;
+ uint16 length =
+ 16 + SEC_RANDOM_SIZE + SEC_MODULUS_SIZE + SEC_PADDING_SIZE +
+ licence_size + LICENCE_HWID_SIZE + LICENCE_SIGNATURE_SIZE;
+ STREAM s;
+
+ s = sec_init(This, sec_flags, length + 4);
+
+ if(s == NULL)
+ return False;
+
+ out_uint8(s, LICENCE_TAG_PRESENT);
+ out_uint8(s, 2); /* version */
+ out_uint16_le(s, length);
+
+ out_uint32_le(s, 1);
+ out_uint16(s, 0);
+ out_uint16_le(s, 0x0201);
+
+ out_uint8p(s, client_random, SEC_RANDOM_SIZE);
+ out_uint16(s, 0);
+ out_uint16_le(s, (SEC_MODULUS_SIZE + SEC_PADDING_SIZE));
+ out_uint8p(s, rsa_data, SEC_MODULUS_SIZE);
+ out_uint8s(s, SEC_PADDING_SIZE);
+
+ out_uint16_le(s, 1);
+ out_uint16_le(s, licence_size);
+ out_uint8p(s, licence_data, licence_size);
+
+ out_uint16_le(s, 1);
+ out_uint16_le(s, LICENCE_HWID_SIZE);
+ out_uint8p(s, hwid, LICENCE_HWID_SIZE);
+
+ out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);
+
+ s_mark_end(s);
+ return sec_send(This, s, sec_flags);
+}
+
+/* Send a licence request packet */
+static BOOL
+licence_send_request(RDPCLIENT * This, uint8 * client_random, uint8 * rsa_data, char *user, char *host)
+{
+ uint32 sec_flags = SEC_LICENCE_NEG;
+ uint16 userlen = (uint16)strlen(user) + 1;
+ uint16 hostlen = (uint16)strlen(host) + 1;
+ uint16 length = 128 + userlen + hostlen;
+ STREAM s;
+
+ s = sec_init(This, sec_flags, length + 2);
+
+ if(s == NULL)
+ return False;
+
+ out_uint8(s, LICENCE_TAG_REQUEST);
+ out_uint8(s, 2); /* version */
+ out_uint16_le(s, length);
+
+ out_uint32_le(s, 1);
+ out_uint16(s, 0);
+ out_uint16_le(s, 0xff01);
+
+ out_uint8p(s, client_random, SEC_RANDOM_SIZE);
+ out_uint16(s, 0);
+ out_uint16_le(s, (SEC_MODULUS_SIZE + SEC_PADDING_SIZE));
+ out_uint8p(s, rsa_data, SEC_MODULUS_SIZE);
+ out_uint8s(s, SEC_PADDING_SIZE);
+
+ out_uint16_le(s, LICENCE_TAG_USER);
+ out_uint16_le(s, userlen);
+ out_uint8p(s, user, userlen);
+
+ out_uint16_le(s, LICENCE_TAG_HOST);
+ out_uint16_le(s, hostlen);
+ out_uint8p(s, host, hostlen);
+
+ s_mark_end(s);
+ return sec_send(This, s, sec_flags);
+}
+
+/* Process a licence demand packet */
+static BOOL
+licence_process_demand(RDPCLIENT * This, STREAM s)
+{
+ uint8 null_data[SEC_MODULUS_SIZE];
+ uint8 *server_random;
+ uint8 signature[LICENCE_SIGNATURE_SIZE];
+ uint8 hwid[LICENCE_HWID_SIZE];
+ uint8 *licence_data;
+ int licence_size;
+ RC4_KEY crypt_key;
+
+ /* Retrieve the server random from the incoming packet */
+ in_uint8p(s, server_random, SEC_RANDOM_SIZE);
+
+ /* We currently use null client keys. This is a bit naughty but, hey,
+ the security of licence negotiation isn't exactly paramount. */
+ memset(null_data, 0, sizeof(null_data));
+ licence_generate_keys(This, null_data, server_random, null_data);
+
+ licence_size = load_licence(This, &licence_data);
+ if (licence_size > 0)
+ {
+ /* Generate a signature for the HWID buffer */
+ licence_generate_hwid(This, hwid);
+ sec_sign(signature, 16, This->licence.sign_key, 16, hwid, sizeof(hwid));
+
+ /* Now encrypt the HWID */
+ RC4_set_key(&crypt_key, 16, This->licence.key);
+ RC4(&crypt_key, sizeof(hwid), hwid, hwid);
+
+ if(!licence_present(This, null_data, null_data, licence_data, licence_size, hwid, signature))
+ return False;
+
+ free(licence_data);
+ return True;
+ }
+
+ return licence_send_request(This, null_data, null_data, This->licence_username, This->licence_hostname);
+}
+
+/* Send an authentication response packet */
+static BOOL
+licence_send_authresp(RDPCLIENT * This, uint8 * token, uint8 * crypt_hwid, uint8 * signature)
+{
+ uint32 sec_flags = SEC_LICENCE_NEG;
+ uint16 length = 58;
+ STREAM s;
+
+ s = sec_init(This, sec_flags, length + 2);
+
+ if(s == NULL)
+ return False;
+
+ out_uint8(s, LICENCE_TAG_AUTHRESP);
+ out_uint8(s, 2); /* version */
+ out_uint16_le(s, length);
+
+ out_uint16_le(s, 1);
+ out_uint16_le(s, LICENCE_TOKEN_SIZE);
+ out_uint8p(s, token, LICENCE_TOKEN_SIZE);
+
+ out_uint16_le(s, 1);
+ out_uint16_le(s, LICENCE_HWID_SIZE);
+ out_uint8p(s, crypt_hwid, LICENCE_HWID_SIZE);
+
+ out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);
+
+ s_mark_end(s);
+ return sec_send(This, s, sec_flags);
+}
+
+/* Parse an authentication request packet */
+static BOOL
+licence_parse_authreq(STREAM s, uint8 ** token, uint8 ** signature)
+{
+ uint16 tokenlen;
+
+ in_uint8s(s, 6); /* unknown: f8 3d 15 00 04 f6 */
+
+ in_uint16_le(s, tokenlen);
+ if (tokenlen != LICENCE_TOKEN_SIZE)
+ {
+ error("token len %d\n", tokenlen);
+ return False;
+ }
+
+ in_uint8p(s, *token, tokenlen);
+ in_uint8p(s, *signature, LICENCE_SIGNATURE_SIZE);
+
+ return s_check_end(s);
+}
+
+/* Process an authentication request packet */
+static void
+licence_process_authreq(RDPCLIENT * This, STREAM s)
+{
+ uint8 *in_token, *in_sig;
+ uint8 out_token[LICENCE_TOKEN_SIZE], decrypt_token[LICENCE_TOKEN_SIZE];
+ uint8 hwid[LICENCE_HWID_SIZE], crypt_hwid[LICENCE_HWID_SIZE];
+ uint8 sealed_buffer[LICENCE_TOKEN_SIZE + LICENCE_HWID_SIZE];
+ uint8 out_sig[LICENCE_SIGNATURE_SIZE];
+ RC4_KEY crypt_key;
+
+ /* Parse incoming packet and save the encrypted token */
+ licence_parse_authreq(s, &in_token, &in_sig);
+ memcpy(out_token, in_token, LICENCE_TOKEN_SIZE);
+
+ /* Decrypt the token. It should read TEST in Unicode. */
+ RC4_set_key(&crypt_key, 16, This->licence.key);
+ RC4(&crypt_key, LICENCE_TOKEN_SIZE, in_token, decrypt_token);
+
+ /* Generate a signature for a buffer of token and HWID */
+ licence_generate_hwid(This, hwid);
+ memcpy(sealed_buffer, decrypt_token, LICENCE_TOKEN_SIZE);
+ memcpy(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE);
+ sec_sign(out_sig, 16, This->licence.sign_key, 16, sealed_buffer, sizeof(sealed_buffer));
+
+ /* Now encrypt the HWID */
+ RC4_set_key(&crypt_key, 16, This->licence.key);
+ RC4(&crypt_key, LICENCE_HWID_SIZE, hwid, crypt_hwid);
+
+ licence_send_authresp(This, out_token, crypt_hwid, out_sig);
+}
+
+/* Process an licence issue packet */
+static void
+licence_process_issue(RDPCLIENT * This, STREAM s)
+{
+ RC4_KEY crypt_key;
+ uint32 length;
+ uint16 check;
+ int i;
+
+ in_uint8s(s, 2); /* 3d 45 - unknown */
+ in_uint16_le(s, length);
+ if (!s_check_rem(s, length))
+ return;
+
+ RC4_set_key(&crypt_key, 16, This->licence.key);
+ RC4(&crypt_key, length, s->p, s->p);
+
+ in_uint16(s, check);
+ if (check != 0)
+ return;
+
+ This->licence_issued = True;
+
+ in_uint8s(s, 2); /* pad */
+
+ /* advance to fourth string */
+ length = 0;
+ for (i = 0; i < 4; i++)
+ {
+ in_uint8s(s, length);
+ in_uint32_le(s, length);
+ if (!s_check_rem(s, length))
+ return;
+ }
+
+ This->licence_issued = True;
+ save_licence(This, s->p, length);
+}
+
+/* Process a licence packet */
+void
+licence_process(RDPCLIENT * This, STREAM s)
+{
+ uint8 tag;
+
+ in_uint8(s, tag);
+ in_uint8s(s, 3); /* version, length */
+
+ switch (tag)
+ {
+ case LICENCE_TAG_DEMAND:
+ licence_process_demand(This, s);
+ break;
+
+ case LICENCE_TAG_AUTHREQ:
+ licence_process_authreq(This, s);
+ break;
+
+ case LICENCE_TAG_ISSUE:
+ licence_process_issue(This, s);
+ break;
+
+ case LICENCE_TAG_REISSUE:
+ case LICENCE_TAG_RESULT:
+ break;
+
+ default:
+ unimpl("licence tag 0x%x\n", tag);
+ }
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Support for the Matrox "lspci" channel
+ Copyright (C) 2005 Matrox Graphics Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+#include <sys/types.h>
+#include <unistd.h>
+
+static VCHANNEL *lspci_channel;
+
+typedef struct _pci_device
+{
+ uint16 klass;
+ uint16 vendor;
+ uint16 device;
+ uint16 subvendor;
+ uint16 subdevice;
+ uint8 revision;
+ uint8 progif;
+} pci_device;
+
+static pci_device current_device;
+
+static void lspci_send(RDPCLIENT * This, const char *output);
+
+
+/* Handle one line of output from the lspci subprocess */
+static BOOL
+handle_child_line(RDPCLIENT * This, const char *line, void *data)
+{
+ const char *val;
+ char buf[1024];
+
+ if (str_startswith(line, "Class:"))
+ {
+ val = line + sizeof("Class:");
+ /* Skip whitespace and second Class: occurance */
+ val += strspn(val, " \t") + sizeof("Class");
+ current_device.klass = strtol(val, NULL, 16);
+ }
+ else if (str_startswith(line, "Vendor:"))
+ {
+ val = line + sizeof("Vendor:");
+ current_device.vendor = strtol(val, NULL, 16);
+ }
+ else if (str_startswith(line, "Device:"))
+ {
+ val = line + sizeof("Device:");
+ /* Sigh, there are *two* lines tagged as Device:. We
+ are not interested in the domain/bus/slot/func */
+ if (!strchr(val, ':'))
+ current_device.device = strtol(val, NULL, 16);
+ }
+ else if (str_startswith(line, "SVendor:"))
+ {
+ val = line + sizeof("SVendor:");
+ current_device.subvendor = strtol(val, NULL, 16);
+ }
+ else if (str_startswith(line, "SDevice:"))
+ {
+ val = line + sizeof("SDevice:");
+ current_device.subdevice = strtol(val, NULL, 16);
+ }
+ else if (str_startswith(line, "Rev:"))
+ {
+ val = line + sizeof("Rev:");
+ current_device.revision = strtol(val, NULL, 16);
+ }
+ else if (str_startswith(line, "ProgIf:"))
+ {
+ val = line + sizeof("ProgIf:");
+ current_device.progif = strtol(val, NULL, 16);
+ }
+ else if (strspn(line, " \t") == strlen(line))
+ {
+ /* Blank line. Send collected information over channel */
+ snprintf(buf, sizeof(buf), "%04x,%04x,%04x,%04x,%04x,%02x,%02x\n",
+ current_device.klass, current_device.vendor,
+ current_device.device, current_device.subvendor,
+ current_device.subdevice, current_device.revision, current_device.progif);
+ lspci_send(This, buf);
+ memset(¤t_device, 0, sizeof(current_device));
+ }
+ else
+ {
+ warning("lspci: Unrecoqnized line '%s'\n", line);
+ }
+ return True;
+}
+
+
+/* Process one line of input from virtual channel */
+static BOOL
+lspci_process_line(RDPCLIENT * This, const char *line, void *data)
+{
+ char *lspci_command[5] = { "lspci", "-m", "-n", "-v", NULL };
+
+ if (!strcmp(line, "LSPCI"))
+ {
+ memset(¤t_device, 0, sizeof(current_device));
+ subprocess(This, lspci_command, handle_child_line, NULL);
+ /* Send single dot to indicate end of enumeration */
+ lspci_send(This, ".\n");
+ }
+ else
+ {
+ error("lspci protocol error: Invalid line '%s'\n", line);
+ }
+ return True;
+}
+
+
+/* Process new data from the virtual channel */
+static void
+lspci_process(RDPCLIENT * This, STREAM s)
+{
+ unsigned int pkglen;
+ static char *rest = NULL;
+ char *buf;
+
+ pkglen = s->end - s->p;
+ /* str_handle_lines requires null terminated strings */
+ buf = xmalloc(pkglen + 1);
+ STRNCPY(buf, (char *) s->p, pkglen + 1);
+#if 0
+ printf("lspci recv:\n");
+ hexdump(s->p, pkglen);
+#endif
+
+ str_handle_lines(This, buf, &rest, lspci_process_line, NULL);
+ xfree(buf);
+}
+
+/* Initialize this module: Register the lspci channel */
+BOOL
+lspci_init(RDPCLIENT * This)
+{
+ lspci_channel =
+ channel_register(This, "lspci", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
+ lspci_process);
+ return (lspci_channel != NULL);
+}
+
+/* Send data to channel */
+static void
+lspci_send(RDPCLIENT * This, const char *output)
+{
+ STREAM s;
+ size_t len;
+
+ len = strlen(output);
+ s = channel_init(This, lspci_channel, len);
+ out_uint8p(s, output, len) s_mark_end(s);
+
+#if 0
+ printf("lspci send:\n");
+ hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8);
+#endif
+
+ channel_send(This, s, lspci_channel);
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - Multipoint Communications Service
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+/* Parse an ASN.1 BER header */
+static BOOL
+ber_parse_header(STREAM s, int tagval, int *length)
+{
+ int tag, len;
+
+ if (tagval > 0xff)
+ {
+ in_uint16_be(s, tag);
+ }
+ else
+ {
+ in_uint8(s, tag)}
+
+ if (tag != tagval)
+ {
+ error("expected tag %d, got %d\n", tagval, tag);
+ return False;
+ }
+
+ in_uint8(s, len);
+
+ if (len & 0x80)
+ {
+ len &= ~0x80;
+ *length = 0;
+ while (len--)
+ next_be(s, *length);
+ }
+ else
+ *length = len;
+
+ return s_check(s);
+}
+
+/* Output an ASN.1 BER header */
+static void
+ber_out_header(STREAM s, int tagval, int length)
+{
+ if (tagval > 0xff)
+ {
+ out_uint16_be(s, tagval);
+ }
+ else
+ {
+ out_uint8(s, tagval);
+ }
+
+ if (length >= 0x80)
+ {
+ out_uint8(s, 0x82);
+ out_uint16_be(s, length);
+ }
+ else
+ out_uint8(s, length);
+}
+
+/* Output an ASN.1 BER integer */
+static void
+ber_out_integer(STREAM s, int value)
+{
+ ber_out_header(s, BER_TAG_INTEGER, 2);
+ out_uint16_be(s, value);
+}
+
+/* Output a DOMAIN_PARAMS structure (ASN.1 BER) */
+static void
+mcs_out_domain_params(STREAM s, int max_channels, int max_users, int max_tokens, int max_pdusize)
+{
+ ber_out_header(s, MCS_TAG_DOMAIN_PARAMS, 32);
+ ber_out_integer(s, max_channels);
+ ber_out_integer(s, max_users);
+ ber_out_integer(s, max_tokens);
+ ber_out_integer(s, 1); /* num_priorities */
+ ber_out_integer(s, 0); /* min_throughput */
+ ber_out_integer(s, 1); /* max_height */
+ ber_out_integer(s, max_pdusize);
+ ber_out_integer(s, 2); /* ver_protocol */
+}
+
+/* Parse a DOMAIN_PARAMS structure (ASN.1 BER) */
+static BOOL
+mcs_parse_domain_params(STREAM s)
+{
+ int length;
+
+ ber_parse_header(s, MCS_TAG_DOMAIN_PARAMS, &length);
+ in_uint8s(s, length);
+
+ return s_check(s);
+}
+
+/* Send an MCS_CONNECT_INITIAL message (ASN.1 BER) */
+static BOOL
+mcs_send_connect_initial(RDPCLIENT * This, STREAM mcs_data)
+{
+ int datalen = (uint16)(mcs_data->end - mcs_data->data);
+ int length = 9 + 3 * 34 + 4 + datalen;
+ STREAM s;
+
+ s = iso_init(This, length + 5);
+
+ if(s == NULL)
+ return False;
+
+ ber_out_header(s, MCS_CONNECT_INITIAL, length);
+ ber_out_header(s, BER_TAG_OCTET_STRING, 1); /* calling domain */
+ out_uint8(s, 1);
+ ber_out_header(s, BER_TAG_OCTET_STRING, 1); /* called domain */
+ out_uint8(s, 1);
+
+ ber_out_header(s, BER_TAG_BOOLEAN, 1);
+ out_uint8(s, 0xff); /* upward flag */
+
+ mcs_out_domain_params(s, 34, 2, 0, 0xffff); /* target params */
+ mcs_out_domain_params(s, 1, 1, 1, 0x420); /* min params */
+ mcs_out_domain_params(s, 0xffff, 0xfc17, 0xffff, 0xffff); /* max params */
+
+ ber_out_header(s, BER_TAG_OCTET_STRING, datalen);
+ out_uint8p(s, mcs_data->data, datalen);
+
+ s_mark_end(s);
+ return iso_send(This, s);
+}
+
+/* Expect a MCS_CONNECT_RESPONSE message (ASN.1 BER) */
+static BOOL
+mcs_recv_connect_response(RDPCLIENT * This, STREAM mcs_data)
+{
+ uint8 result;
+ int length;
+ STREAM s;
+
+ s = iso_recv(This, NULL);
+ if (s == NULL)
+ return False;
+
+ ber_parse_header(s, MCS_CONNECT_RESPONSE, &length);
+
+ ber_parse_header(s, BER_TAG_RESULT, &length);
+ in_uint8(s, result);
+ if (result != 0)
+ {
+ error("MCS connect: %d\n", result);
+ return False;
+ }
+
+ ber_parse_header(s, BER_TAG_INTEGER, &length);
+ in_uint8s(s, length); /* connect id */
+ mcs_parse_domain_params(s);
+
+ ber_parse_header(s, BER_TAG_OCTET_STRING, &length);
+
+ sec_process_mcs_data(This, s);
+ /*
+ if (length > mcs_data->size)
+ {
+ error("MCS data length %d, expected %d\n", length,
+ mcs_data->size);
+ length = mcs_data->size;
+ }
+
+ in_uint8a(s, mcs_data->data, length);
+ mcs_data->p = mcs_data->data;
+ mcs_data->end = mcs_data->data + length;
+ */
+ return s_check_end(s);
+}
+
+/* Send an EDrq message (ASN.1 PER) */
+static BOOL
+mcs_send_edrq(RDPCLIENT * This)
+{
+ STREAM s;
+
+ s = iso_init(This, 5);
+
+ if(s == NULL)
+ return False;
+
+ out_uint8(s, (MCS_EDRQ << 2));
+ out_uint16_be(s, 1); /* height */
+ out_uint16_be(s, 1); /* interval */
+
+ s_mark_end(s);
+ return iso_send(This, s);
+}
+
+/* Send an AUrq message (ASN.1 PER) */
+static BOOL
+mcs_send_aurq(RDPCLIENT * This)
+{
+ STREAM s;
+
+ s = iso_init(This, 1);
+
+ if(s == NULL)
+ return False;
+
+ out_uint8(s, (MCS_AURQ << 2));
+
+ s_mark_end(s);
+ return iso_send(This, s);
+}
+
+/* Expect a AUcf message (ASN.1 PER) */
+static BOOL
+mcs_recv_aucf(RDPCLIENT * This, uint16 * mcs_userid)
+{
+ uint8 opcode, result;
+ STREAM s;
+
+ s = iso_recv(This, NULL);
+ if (s == NULL)
+ return False;
+
+ in_uint8(s, opcode);
+ if ((opcode >> 2) != MCS_AUCF)
+ {
+ error("expected AUcf, got %d\n", opcode);
+ return False;
+ }
+
+ in_uint8(s, result);
+ if (result != 0)
+ {
+ error("AUrq: %d\n", result);
+ return False;
+ }
+
+ if (opcode & 2)
+ in_uint16_be(s, *mcs_userid);
+
+ return s_check_end(s);
+}
+
+/* Send a CJrq message (ASN.1 PER) */
+static BOOL
+mcs_send_cjrq(RDPCLIENT * This, uint16 chanid)
+{
+ STREAM s;
+
+ DEBUG_RDP5(("Sending CJRQ for channel #%d\n", chanid));
+
+ s = iso_init(This, 5);
+
+ if(s == NULL)
+ return False;
+
+ out_uint8(s, (MCS_CJRQ << 2));
+ out_uint16_be(s, This->mcs_userid);
+ out_uint16_be(s, chanid);
+
+ s_mark_end(s);
+ return iso_send(This, s);
+}
+
+/* Expect a CJcf message (ASN.1 PER) */
+static BOOL
+mcs_recv_cjcf(RDPCLIENT * This)
+{
+ uint8 opcode, result;
+ STREAM s;
+
+ s = iso_recv(This, NULL);
+ if (s == NULL)
+ return False;
+
+ in_uint8(s, opcode);
+ if ((opcode >> 2) != MCS_CJCF)
+ {
+ error("expected CJcf, got %d\n", opcode);
+ return False;
+ }
+
+ in_uint8(s, result);
+ if (result != 0)
+ {
+ error("CJrq: %d\n", result);
+ return False;
+ }
+
+ in_uint8s(s, 4); /* mcs_userid, req_chanid */
+ if (opcode & 2)
+ in_uint8s(s, 2); /* join_chanid */
+
+ return s_check_end(s);
+}
+
+/* Initialise an MCS transport data packet */
+STREAM
+mcs_init(RDPCLIENT * This, int length)
+{
+ STREAM s;
+
+ s = iso_init(This, length + 8);
+
+ if(s == NULL)
+ return NULL;
+
+ s_push_layer(s, mcs_hdr, 8);
+
+ return s;
+}
+
+/* Send an MCS transport data packet to a specific channel */
+BOOL
+mcs_send_to_channel(RDPCLIENT * This, STREAM s, uint16 channel)
+{
+ uint16 length;
+
+ s_pop_layer(s, mcs_hdr);
+ length = (uint16)(s->end - s->p - 8);
+ length |= 0x8000;
+
+ out_uint8(s, (MCS_SDRQ << 2));
+ out_uint16_be(s, This->mcs_userid);
+ out_uint16_be(s, channel);
+ out_uint8(s, 0x70); /* flags */
+ out_uint16_be(s, length);
+
+ return iso_send(This, s);
+}
+
+/* Send an MCS transport data packet to the global channel */
+BOOL
+mcs_send(RDPCLIENT * This, STREAM s)
+{
+ return mcs_send_to_channel(This, s, MCS_GLOBAL_CHANNEL);
+}
+
+/* Receive an MCS transport data packet */
+STREAM
+mcs_recv(RDPCLIENT * This, uint16 * channel, uint8 * rdpver)
+{
+ uint8 opcode, appid, length;
+ STREAM s;
+
+ s = iso_recv(This, rdpver);
+ if (s == NULL)
+ return NULL;
+ if (rdpver != NULL)
+ if (*rdpver != 3)
+ return s;
+ in_uint8(s, opcode);
+ appid = opcode >> 2;
+ if (appid != MCS_SDIN)
+ {
+ if (appid != MCS_DPUM)
+ {
+ error("expected data, got %d\n", opcode);
+ }
+ return NULL;
+ }
+ in_uint8s(s, 2); /* userid */
+ in_uint16_be(s, *channel);
+ in_uint8s(s, 1); /* flags */
+ in_uint8(s, length);
+ if (length & 0x80)
+ in_uint8s(s, 1); /* second byte of length */
+ return s;
+}
+
+/* Establish a connection up to the MCS layer */
+BOOL
+mcs_connect(RDPCLIENT * This, char *server, char * cookie, STREAM mcs_data)
+{
+ unsigned int i;
+
+ if (!iso_connect(This, server, cookie))
+ return False;
+
+ if (!mcs_send_connect_initial(This, mcs_data) || !mcs_recv_connect_response(This, mcs_data))
+ goto error;
+
+ if (!mcs_send_edrq(This) || !mcs_send_aurq(This))
+ goto error;
+
+ if (!mcs_recv_aucf(This, &This->mcs_userid))
+ goto error;
+
+ if (!mcs_send_cjrq(This, This->mcs_userid + MCS_USERCHANNEL_BASE) || !mcs_recv_cjcf(This))
+ goto error;
+
+ if (!mcs_send_cjrq(This, MCS_GLOBAL_CHANNEL) || !mcs_recv_cjcf(This))
+ goto error;
+
+ for (i = 0; i < This->num_channels; i++)
+ {
+ if (!mcs_send_cjrq(This, MCS_GLOBAL_CHANNEL + 1 + i) || !mcs_recv_cjcf(This))
+ goto error;
+ }
+ return True;
+
+ error:
+ iso_disconnect(This);
+ return False;
+}
+
+/* Establish a connection up to the MCS layer */
+BOOL
+mcs_reconnect(RDPCLIENT * This, char *server, char *cookie, STREAM mcs_data)
+{
+ unsigned int i;
+
+ if (!iso_reconnect(This, server, cookie))
+ return False;
+
+ if (!mcs_send_connect_initial(This, mcs_data) || !mcs_recv_connect_response(This, mcs_data))
+ goto error;
+
+ if (!mcs_send_edrq(This) || !mcs_send_aurq(This))
+ goto error;
+
+ if (!mcs_recv_aucf(This, &This->mcs_userid))
+ goto error;
+
+ if (!mcs_send_cjrq(This, This->mcs_userid + MCS_USERCHANNEL_BASE) || !mcs_recv_cjcf(This))
+ goto error;
+
+ if (!mcs_send_cjrq(This, MCS_GLOBAL_CHANNEL) || !mcs_recv_cjcf(This))
+ goto error;
+
+ for (i = 0; i < This->num_channels; i++)
+ {
+ if (!mcs_send_cjrq(This, MCS_GLOBAL_CHANNEL + 1 + i) || !mcs_recv_cjcf(This))
+ goto error;
+ }
+ return True;
+
+ error:
+ iso_disconnect(This);
+ return False;
+}
+
+/* Disconnect from the MCS layer */
+void
+mcs_disconnect(RDPCLIENT * This)
+{
+ iso_disconnect(This);
+}
+
+/* reset the state of the mcs layer */
+void
+mcs_reset_state(RDPCLIENT * This)
+{
+ This->mcs_userid = 0;
+ iso_reset_state(This);
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - RDP decompression
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "rdesktop.h"
+
+/* mppc decompression */
+/* http://www.faqs.org/rfcs/rfc2118.html */
+
+/* Contacts: */
+
+/* hifn contact mentioned in the faq is */
+/* Robert Friend rfriend at hifn dot com */
+
+/* if you have questions regarding MPPC */
+/* our contact is */
+/* Guus Dhaeze GDhaeze at hifn dot com */
+
+/* Licensing: */
+
+/* decompression is alright as long as we */
+/* don't compress data */
+
+/* Algorithm: */
+
+/* as the rfc states the algorithm seems to */
+/* be LZ77 with a sliding buffer */
+/* that is empty at init. */
+
+/* the algorithm is called LZS and is */
+/* patented for another couple of years. */
+
+/* more information is available in */
+/* http://www.ietf.org/ietf/IPR/hifn-ipr-draft-friend-tls-lzs-compression.txt */
+
+int
+mppc_expand(RDPCLIENT * This, uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen)
+{
+ int k, walker_len = 0, walker;
+ uint32 i = 0;
+ int next_offset, match_off;
+ int match_len;
+ int old_offset, match_bits;
+ BOOL big = ctype & RDP_MPPC_BIG ? True : False;
+
+ uint8 *dict = This->mppc_dict.hist;
+
+ if ((ctype & RDP_MPPC_COMPRESSED) == 0)
+ {
+ *roff = 0;
+ *rlen = clen;
+ return 0;
+ }
+
+ if ((ctype & RDP_MPPC_RESET) != 0)
+ {
+ This->mppc_dict.roff = 0;
+ }
+
+ if ((ctype & RDP_MPPC_FLUSH) != 0)
+ {
+ memset(dict, 0, RDP_MPPC_DICT_SIZE);
+ This->mppc_dict.roff = 0;
+ }
+
+ *roff = 0;
+ *rlen = 0;
+
+ walker = This->mppc_dict.roff;
+
+ next_offset = walker;
+ old_offset = next_offset;
+ *roff = old_offset;
+ if (clen == 0)
+ return 0;
+ clen += i;
+
+ do
+ {
+ if (walker_len == 0)
+ {
+ if (i >= clen)
+ break;
+ walker = data[i++] << 24;
+ walker_len = 8;
+ }
+ if (walker >= 0)
+ {
+ if (walker_len < 8)
+ {
+ if (i >= clen)
+ {
+ if (walker != 0)
+ return -1;
+ break;
+ }
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ walker_len += 8;
+ }
+ if (next_offset >= RDP_MPPC_DICT_SIZE)
+ return -1;
+ dict[next_offset++] = (((uint32) walker) >> ((uint32) 24));
+ walker <<= 8;
+ walker_len -= 8;
+ continue;
+ }
+ walker <<= 1;
+ /* fetch next 8-bits */
+ if (--walker_len == 0)
+ {
+ if (i >= clen)
+ return -1;
+ walker = data[i++] << 24;
+ walker_len = 8;
+ }
+ /* literal decoding */
+ if (walker >= 0)
+ {
+ if (walker_len < 8)
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ walker_len += 8;
+ }
+ if (next_offset >= RDP_MPPC_DICT_SIZE)
+ return -1;
+ dict[next_offset++] = (uint8) (walker >> 24 | 0x80);
+ walker <<= 8;
+ walker_len -= 8;
+ continue;
+ }
+
+ /* decode offset */
+ /* length pair */
+ walker <<= 1;
+ if (--walker_len < (big ? 3 : 2))
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ walker_len += 8;
+ }
+
+ if (big)
+ {
+ /* offset decoding where offset len is:
+ -63: 11111 followed by the lower 6 bits of the value
+ 64-319: 11110 followed by the lower 8 bits of the value ( value - 64 )
+ 320-2367: 1110 followed by lower 11 bits of the value ( value - 320 )
+ 2368-65535: 110 followed by lower 16 bits of the value ( value - 2368 )
+ */
+ switch (((uint32) walker) >> ((uint32) 29))
+ {
+ case 7: /* - 63 */
+ for (; walker_len < 9; walker_len += 8)
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ }
+ walker <<= 3;
+ match_off = ((uint32) walker) >> ((uint32) 26);
+ walker <<= 6;
+ walker_len -= 9;
+ break;
+
+ case 6: /* 64 - 319 */
+ for (; walker_len < 11; walker_len += 8)
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ }
+
+ walker <<= 3;
+ match_off = (((uint32) walker) >> ((uint32) 24)) + 64;
+ walker <<= 8;
+ walker_len -= 11;
+ break;
+
+ case 5:
+ case 4: /* 320 - 2367 */
+ for (; walker_len < 13; walker_len += 8)
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ }
+
+ walker <<= 2;
+ match_off = (((uint32) walker) >> ((uint32) 21)) + 320;
+ walker <<= 11;
+ walker_len -= 13;
+ break;
+
+ default: /* 2368 - 65535 */
+ for (; walker_len < 17; walker_len += 8)
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ }
+
+ walker <<= 1;
+ match_off = (((uint32) walker) >> ((uint32) 16)) + 2368;
+ walker <<= 16;
+ walker_len -= 17;
+ break;
+ }
+ }
+ else
+ {
+ /* offset decoding where offset len is:
+ -63: 1111 followed by the lower 6 bits of the value
+ 64-319: 1110 followed by the lower 8 bits of the value ( value - 64 )
+ 320-8191: 110 followed by the lower 13 bits of the value ( value - 320 )
+ */
+ switch (((uint32) walker) >> ((uint32) 30))
+ {
+ case 3: /* - 63 */
+ if (walker_len < 8)
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ walker_len += 8;
+ }
+ walker <<= 2;
+ match_off = ((uint32) walker) >> ((uint32) 26);
+ walker <<= 6;
+ walker_len -= 8;
+ break;
+
+ case 2: /* 64 - 319 */
+ for (; walker_len < 10; walker_len += 8)
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ }
+
+ walker <<= 2;
+ match_off = (((uint32) walker) >> ((uint32) 24)) + 64;
+ walker <<= 8;
+ walker_len -= 10;
+ break;
+
+ default: /* 320 - 8191 */
+ for (; walker_len < 14; walker_len += 8)
+ {
+ if (i >= clen)
+ return -1;
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ }
+
+ match_off = (walker >> 18) + 320;
+ walker <<= 14;
+ walker_len -= 14;
+ break;
+ }
+ }
+ if (walker_len == 0)
+ {
+ if (i >= clen)
+ return -1;
+ walker = data[i++] << 24;
+ walker_len = 8;
+ }
+
+ /* decode length of match */
+ match_len = 0;
+ if (walker >= 0)
+ { /* special case - length of 3 is in bit 0 */
+ match_len = 3;
+ walker <<= 1;
+ walker_len--;
+ }
+ else
+ {
+ /* this is how it works len of:
+ 4-7: 10 followed by 2 bits of the value
+ 8-15: 110 followed by 3 bits of the value
+ 16-31: 1110 followed by 4 bits of the value
+ 32-63: .... and so forth
+ 64-127:
+ 128-255:
+ 256-511:
+ 512-1023:
+ 1024-2047:
+ 2048-4095:
+ 4096-8191:
+
+ i.e. 4097 is encoded as: 111111111110 000000000001
+ meaning 4096 + 1...
+ */
+ match_bits = big ? 14 : 11; /* 11 or 14 bits of value at most */
+ do
+ {
+ walker <<= 1;
+ if (--walker_len == 0)
+ {
+ if (i >= clen)
+ return -1;
+ walker = data[i++] << 24;
+ walker_len = 8;
+ }
+ if (walker >= 0)
+ break;
+ if (--match_bits == 0)
+ {
+ return -1;
+ }
+ }
+ while (1);
+ match_len = (big ? 16 : 13) - match_bits;
+ walker <<= 1;
+ if (--walker_len < match_len)
+ {
+ for (; walker_len < match_len; walker_len += 8)
+ {
+ if (i >= clen)
+ {
+ return -1;
+ }
+ walker |= (data[i++] & 0xff) << (24 - walker_len);
+ }
+ }
+
+ match_bits = match_len;
+ match_len =
+ ((walker >> (32 - match_bits)) & (~(-1 << match_bits))) | (1 <<
+ match_bits);
+ walker <<= match_bits;
+ walker_len -= match_bits;
+ }
+ if (next_offset + match_len >= RDP_MPPC_DICT_SIZE)
+ {
+ return -1;
+ }
+ /* memory areas can overlap - meaning we can't use memXXX functions */
+ k = (next_offset - match_off) & (big ? 65535 : 8191);
+ do
+ {
+ dict[next_offset++] = dict[k++];
+ }
+ while (--match_len != 0);
+ }
+ while (1);
+
+ /* store history offset */
+ This->mppc_dict.roff = next_offset;
+
+ *roff = old_offset;
+ *rlen = next_offset - old_offset;
+
+ return 0;
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ RDP order processing
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+#include "orders.h"
+
+/* Read field indicating which parameters are present */
+static void
+rdp_in_present(STREAM s, uint32 * present, uint8 flags, int size)
+{
+ uint8 bits;
+ int i;
+
+ if (flags & RDP_ORDER_SMALL)
+ {
+ size--;
+ }
+
+ if (flags & RDP_ORDER_TINY)
+ {
+ if (size < 2)
+ size = 0;
+ else
+ size -= 2;
+ }
+
+ *present = 0;
+ for (i = 0; i < size; i++)
+ {
+ in_uint8(s, bits);
+ *present |= bits << (i * 8);
+ }
+}
+
+/* Read a co-ordinate (16-bit, or 8-bit delta) */
+static void
+rdp_in_coord(STREAM s, sint16 * coord, BOOL delta)
+{
+ sint8 change;
+
+ if (delta)
+ {
+ in_uint8(s, change);
+ *coord += change;
+ }
+ else
+ {
+ in_uint16_le(s, *coord);
+ }
+}
+
+/* Parse a delta co-ordinate in polyline/polygon order form */
+static int
+parse_delta(uint8 * buffer, int *offset)
+{
+ int value = buffer[(*offset)++];
+ int two_byte = value & 0x80;
+
+ if (value & 0x40) /* sign bit */
+ value |= ~0x3f;
+ else
+ value &= 0x3f;
+
+ if (two_byte)
+ value = (value << 8) | buffer[(*offset)++];
+
+ return value;
+}
+
+/* Read a colour entry */
+static void
+rdp_in_colour(STREAM s, uint32 * colour)
+{
+ uint32 i;
+ in_uint8(s, i);
+ *colour = i;
+ in_uint8(s, i);
+ *colour |= i << 8;
+ in_uint8(s, i);
+ *colour |= i << 16;
+}
+
+/* Parse bounds information */
+static BOOL
+rdp_parse_bounds(STREAM s, BOUNDS * bounds)
+{
+ uint8 present;
+
+ in_uint8(s, present);
+
+ if (present & 1)
+ rdp_in_coord(s, &bounds->left, False);
+ else if (present & 16)
+ rdp_in_coord(s, &bounds->left, True);
+
+ if (present & 2)
+ rdp_in_coord(s, &bounds->top, False);
+ else if (present & 32)
+ rdp_in_coord(s, &bounds->top, True);
+
+ if (present & 4)
+ rdp_in_coord(s, &bounds->right, False);
+ else if (present & 64)
+ rdp_in_coord(s, &bounds->right, True);
+
+ if (present & 8)
+ rdp_in_coord(s, &bounds->bottom, False);
+ else if (present & 128)
+ rdp_in_coord(s, &bounds->bottom, True);
+
+ return s_check(s);
+}
+
+/* Parse a pen */
+static BOOL
+rdp_parse_pen(STREAM s, PEN * pen, uint32 present)
+{
+ if (present & 1)
+ in_uint8(s, pen->style);
+
+ if (present & 2)
+ in_uint8(s, pen->width);
+
+ if (present & 4)
+ rdp_in_colour(s, &pen->colour);
+
+ return s_check(s);
+}
+
+/* Parse a brush */
+static BOOL
+rdp_parse_brush(STREAM s, BRUSH * brush, uint32 present)
+{
+ if (present & 1)
+ in_uint8(s, brush->xorigin);
+
+ if (present & 2)
+ in_uint8(s, brush->yorigin);
+
+ if (present & 4)
+ in_uint8(s, brush->style);
+
+ if (present & 8)
+ in_uint8(s, brush->pattern[0]);
+
+ if (present & 16)
+ in_uint8a(s, &brush->pattern[1], 7);
+
+ return s_check(s);
+}
+
+/* Process a destination blt order */
+static void
+process_destblt(RDPCLIENT * This, STREAM s, DESTBLT_ORDER * os, uint32 present, BOOL delta)
+{
+ if (present & 0x01)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x02)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x04)
+ rdp_in_coord(s, &os->cx, delta);
+
+ if (present & 0x08)
+ rdp_in_coord(s, &os->cy, delta);
+
+ if (present & 0x10)
+ in_uint8(s, os->opcode);
+
+ DEBUG(("DESTBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d)\n",
+ os->opcode, os->x, os->y, os->cx, os->cy));
+
+#if 0
+ ui_destblt(This, ROP2_S(os->opcode), os->x, os->y, os->cx, os->cy);
+#else
+ ui_destblt(This, os->opcode, os->x, os->y, os->cx, os->cy);
+#endif
+}
+
+/* Process a pattern blt order */
+static void
+process_patblt(RDPCLIENT * This, STREAM s, PATBLT_ORDER * os, uint32 present, BOOL delta)
+{
+ if (present & 0x0001)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x0002)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x0004)
+ rdp_in_coord(s, &os->cx, delta);
+
+ if (present & 0x0008)
+ rdp_in_coord(s, &os->cy, delta);
+
+ if (present & 0x0010)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x0020)
+ rdp_in_colour(s, &os->bgcolour);
+
+ if (present & 0x0040)
+ rdp_in_colour(s, &os->fgcolour);
+
+ rdp_parse_brush(s, &os->brush, present >> 7);
+
+ DEBUG(("PATBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,bs=%d,bg=0x%x,fg=0x%x)\n", os->opcode, os->x,
+ os->y, os->cx, os->cy, os->brush.style, os->bgcolour, os->fgcolour));
+
+#if 0
+ ui_patblt(This, ROP2_P(os->opcode), os->x, os->y, os->cx, os->cy,
+ &os->brush, os->bgcolour, os->fgcolour);
+#else
+ ui_patblt(This, os->opcode, os->x, os->y, os->cx, os->cy,
+ &os->brush, os->bgcolour, os->fgcolour);
+#endif
+}
+
+/* Process a screen blt order */
+static void
+process_screenblt(RDPCLIENT * This, STREAM s, SCREENBLT_ORDER * os, uint32 present, BOOL delta)
+{
+ if (present & 0x0001)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x0002)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x0004)
+ rdp_in_coord(s, &os->cx, delta);
+
+ if (present & 0x0008)
+ rdp_in_coord(s, &os->cy, delta);
+
+ if (present & 0x0010)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x0020)
+ rdp_in_coord(s, &os->srcx, delta);
+
+ if (present & 0x0040)
+ rdp_in_coord(s, &os->srcy, delta);
+
+ DEBUG(("SCREENBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,srcx=%d,srcy=%d)\n",
+ os->opcode, os->x, os->y, os->cx, os->cy, os->srcx, os->srcy));
+
+#if 0
+ ui_screenblt(This, ROP2_S(os->opcode), os->x, os->y, os->cx, os->cy, os->srcx, os->srcy);
+#else
+ ui_screenblt(This, os->opcode, os->x, os->y, os->cx, os->cy, os->srcx, os->srcy);
+#endif
+}
+
+/* Process a line order */
+static void
+process_line(RDPCLIENT * This, STREAM s, LINE_ORDER * os, uint32 present, BOOL delta)
+{
+ if (present & 0x0001)
+ in_uint16_le(s, os->mixmode);
+
+ if (present & 0x0002)
+ rdp_in_coord(s, &os->startx, delta);
+
+ if (present & 0x0004)
+ rdp_in_coord(s, &os->starty, delta);
+
+ if (present & 0x0008)
+ rdp_in_coord(s, &os->endx, delta);
+
+ if (present & 0x0010)
+ rdp_in_coord(s, &os->endy, delta);
+
+ if (present & 0x0020)
+ rdp_in_colour(s, &os->bgcolour);
+
+ if (present & 0x0040)
+ in_uint8(s, os->opcode);
+
+ rdp_parse_pen(s, &os->pen, present >> 7);
+
+ DEBUG(("LINE(op=0x%x,sx=%d,sy=%d,dx=%d,dy=%d,fg=0x%x)\n",
+ os->opcode, os->startx, os->starty, os->endx, os->endy, os->pen.colour));
+
+ if (os->opcode < 0x01 || os->opcode > 0x10)
+ {
+ error("bad ROP2 0x%x\n", os->opcode);
+ return;
+ }
+
+#if 0
+ ui_line(This, os->opcode - 1, os->startx, os->starty, os->endx, os->endy, &os->pen);
+#else
+ ui_line(This, os->opcode, os->startx, os->starty, os->endx, os->endy, &os->pen);
+#endif
+}
+
+/* Process an opaque rectangle order */
+static void
+process_rect(RDPCLIENT * This, STREAM s, RECT_ORDER * os, uint32 present, BOOL delta)
+{
+ uint32 i;
+ if (present & 0x01)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x02)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x04)
+ rdp_in_coord(s, &os->cx, delta);
+
+ if (present & 0x08)
+ rdp_in_coord(s, &os->cy, delta);
+
+ if (present & 0x10)
+ {
+ in_uint8(s, i);
+ os->colour = (os->colour & 0xffffff00) | i;
+ }
+
+ if (present & 0x20)
+ {
+ in_uint8(s, i);
+ os->colour = (os->colour & 0xffff00ff) | (i << 8);
+ }
+
+ if (present & 0x40)
+ {
+ in_uint8(s, i);
+ os->colour = (os->colour & 0xff00ffff) | (i << 16);
+ }
+
+ DEBUG(("RECT(x=%d,y=%d,cx=%d,cy=%d,fg=0x%x)\n", os->x, os->y, os->cx, os->cy, os->colour));
+
+ ui_rect(This, os->x, os->y, os->cx, os->cy, os->colour);
+}
+
+/* Process a desktop save order */
+static void
+process_desksave(RDPCLIENT * This, STREAM s, DESKSAVE_ORDER * os, uint32 present, BOOL delta)
+{
+ int width, height;
+
+ if (present & 0x01)
+ in_uint32_le(s, os->offset);
+
+ if (present & 0x02)
+ rdp_in_coord(s, &os->left, delta);
+
+ if (present & 0x04)
+ rdp_in_coord(s, &os->top, delta);
+
+ if (present & 0x08)
+ rdp_in_coord(s, &os->right, delta);
+
+ if (present & 0x10)
+ rdp_in_coord(s, &os->bottom, delta);
+
+ if (present & 0x20)
+ in_uint8(s, os->action);
+
+ DEBUG(("DESKSAVE(l=%d,t=%d,r=%d,b=%d,off=%d,op=%d)\n",
+ os->left, os->top, os->right, os->bottom, os->offset, os->action));
+
+ width = os->right - os->left + 1;
+ height = os->bottom - os->top + 1;
+
+ if (os->action == 0)
+ ui_desktop_save(This, os->offset, os->left, os->top, width, height);
+ else
+ ui_desktop_restore(This, os->offset, os->left, os->top, width, height);
+}
+
+/* Process a memory blt order */
+static void
+process_memblt(RDPCLIENT * This, STREAM s, MEMBLT_ORDER * os, uint32 present, BOOL delta)
+{
+ HBITMAP bitmap;
+
+ if (present & 0x0001)
+ {
+ in_uint8(s, os->cache_id);
+ in_uint8(s, os->colour_table);
+ }
+
+ if (present & 0x0002)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x0004)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x0008)
+ rdp_in_coord(s, &os->cx, delta);
+
+ if (present & 0x0010)
+ rdp_in_coord(s, &os->cy, delta);
+
+ if (present & 0x0020)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x0040)
+ rdp_in_coord(s, &os->srcx, delta);
+
+ if (present & 0x0080)
+ rdp_in_coord(s, &os->srcy, delta);
+
+ if (present & 0x0100)
+ in_uint16_le(s, os->cache_idx);
+
+ DEBUG(("MEMBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,id=%d,idx=%d)\n",
+ os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id, os->cache_idx));
+
+ bitmap = cache_get_bitmap(This, os->cache_id, os->cache_idx);
+ if (bitmap == NULL)
+ return;
+
+#if 0
+ ui_memblt(This, ROP2_S(os->opcode), os->x, os->y, os->cx, os->cy, bitmap, os->srcx, os->srcy);
+#else
+ ui_memblt(This, os->opcode, os->x, os->y, os->cx, os->cy, bitmap, os->srcx, os->srcy);
+#endif
+}
+
+/* Process a 3-way blt order */
+static void
+process_triblt(RDPCLIENT * This, STREAM s, TRIBLT_ORDER * os, uint32 present, BOOL delta)
+{
+ HBITMAP bitmap;
+
+ if (present & 0x000001)
+ {
+ in_uint8(s, os->cache_id);
+ in_uint8(s, os->colour_table);
+ }
+
+ if (present & 0x000002)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x000004)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x000008)
+ rdp_in_coord(s, &os->cx, delta);
+
+ if (present & 0x000010)
+ rdp_in_coord(s, &os->cy, delta);
+
+ if (present & 0x000020)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x000040)
+ rdp_in_coord(s, &os->srcx, delta);
+
+ if (present & 0x000080)
+ rdp_in_coord(s, &os->srcy, delta);
+
+ if (present & 0x000100)
+ rdp_in_colour(s, &os->bgcolour);
+
+ if (present & 0x000200)
+ rdp_in_colour(s, &os->fgcolour);
+
+ rdp_parse_brush(s, &os->brush, present >> 10);
+
+ if (present & 0x008000)
+ in_uint16_le(s, os->cache_idx);
+
+ if (present & 0x010000)
+ in_uint16_le(s, os->unknown);
+
+ DEBUG(("TRIBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,id=%d,idx=%d,bs=%d,bg=0x%x,fg=0x%x)\n",
+ os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id, os->cache_idx,
+ os->brush.style, os->bgcolour, os->fgcolour));
+
+ bitmap = cache_get_bitmap(This, os->cache_id, os->cache_idx);
+ if (bitmap == NULL)
+ return;
+
+ ui_triblt(This, os->opcode, os->x, os->y, os->cx, os->cy,
+ bitmap, os->srcx, os->srcy, &os->brush, os->bgcolour, os->fgcolour);
+}
+
+/* Process a polygon order */
+static void
+process_polygon(RDPCLIENT * This, STREAM s, POLYGON_ORDER * os, uint32 present, BOOL delta)
+{
+ int index, data, next;
+ uint8 flags = 0;
+ POINT *points;
+
+ if (present & 0x01)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x02)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x04)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x08)
+ in_uint8(s, os->fillmode);
+
+ if (present & 0x10)
+ rdp_in_colour(s, &os->fgcolour);
+
+ if (present & 0x20)
+ in_uint8(s, os->npoints);
+
+ if (present & 0x40)
+ {
+ in_uint8(s, os->datasize);
+ in_uint8a(s, os->data, os->datasize);
+ }
+
+ DEBUG(("POLYGON(x=%d,y=%d,op=0x%x,fm=%d,fg=0x%x,n=%d,sz=%d)\n",
+ os->x, os->y, os->opcode, os->fillmode, os->fgcolour, os->npoints, os->datasize));
+
+ DEBUG(("Data: "));
+
+ for (index = 0; index < os->datasize; index++)
+ DEBUG(("%02x ", os->data[index]));
+
+ DEBUG(("\n"));
+
+ if (os->opcode < 0x01 || os->opcode > 0x10)
+ {
+ error("bad ROP2 0x%x\n", os->opcode);
+ return;
+ }
+
+ points = (POINT *) malloc((os->npoints + 1) * sizeof(POINT));
+
+ if(points == NULL)
+ return;
+
+ memset(points, 0, (os->npoints + 1) * sizeof(POINT));
+
+ points[0].x = os->x;
+ points[0].y = os->y;
+
+ index = 0;
+ data = ((os->npoints - 1) / 4) + 1;
+ for (next = 1; (next <= os->npoints) && (next < 256) && (data < os->datasize); next++)
+ {
+ if ((next - 1) % 4 == 0)
+ flags = os->data[index++];
+
+ if (~flags & 0x80)
+ points[next].x = parse_delta(os->data, &data);
+
+ if (~flags & 0x40)
+ points[next].y = parse_delta(os->data, &data);
+
+ flags <<= 2;
+ }
+
+ if (next - 1 == os->npoints)
+#if 0
+ ui_polygon(This, os->opcode - 1, os->fillmode, points, os->npoints + 1, NULL, 0,
+ os->fgcolour);
+#else
+ ui_polygon(This, os->opcode, os->fillmode, points, os->npoints + 1, NULL, 0,
+ os->fgcolour);
+#endif
+ else
+ error("polygon parse error\n");
+
+ free(points);
+}
+
+/* Process a polygon2 order */
+static void
+process_polygon2(RDPCLIENT * This, STREAM s, POLYGON2_ORDER * os, uint32 present, BOOL delta)
+{
+ int index, data, next;
+ uint8 flags = 0;
+ POINT *points;
+
+ if (present & 0x0001)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x0002)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x0004)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x0008)
+ in_uint8(s, os->fillmode);
+
+ if (present & 0x0010)
+ rdp_in_colour(s, &os->bgcolour);
+
+ if (present & 0x0020)
+ rdp_in_colour(s, &os->fgcolour);
+
+ rdp_parse_brush(s, &os->brush, present >> 6);
+
+ if (present & 0x0800)
+ in_uint8(s, os->npoints);
+
+ if (present & 0x1000)
+ {
+ in_uint8(s, os->datasize);
+ in_uint8a(s, os->data, os->datasize);
+ }
+
+ DEBUG(("POLYGON2(x=%d,y=%d,op=0x%x,fm=%d,bs=%d,bg=0x%x,fg=0x%x,n=%d,sz=%d)\n",
+ os->x, os->y, os->opcode, os->fillmode, os->brush.style, os->bgcolour, os->fgcolour,
+ os->npoints, os->datasize));
+
+ DEBUG(("Data: "));
+
+ for (index = 0; index < os->datasize; index++)
+ DEBUG(("%02x ", os->data[index]));
+
+ DEBUG(("\n"));
+
+ if (os->opcode < 0x01 || os->opcode > 0x10)
+ {
+ error("bad ROP2 0x%x\n", os->opcode);
+ return;
+ }
+
+ points = (POINT *) malloc((os->npoints + 1) * sizeof(POINT));
+
+ if(points == NULL)
+ return;
+
+ memset(points, 0, (os->npoints + 1) * sizeof(POINT));
+
+ points[0].x = os->x;
+ points[0].y = os->y;
+
+ index = 0;
+ data = ((os->npoints - 1) / 4) + 1;
+ for (next = 1; (next <= os->npoints) && (next < 256) && (data < os->datasize); next++)
+ {
+ if ((next - 1) % 4 == 0)
+ flags = os->data[index++];
+
+ if (~flags & 0x80)
+ points[next].x = parse_delta(os->data, &data);
+
+ if (~flags & 0x40)
+ points[next].y = parse_delta(os->data, &data);
+
+ flags <<= 2;
+ }
+
+ if (next - 1 == os->npoints)
+#if 0
+ ui_polygon(This, os->opcode - 1, os->fillmode, points, os->npoints + 1,
+ &os->brush, os->bgcolour, os->fgcolour);
+#else
+ ui_polygon(This, os->opcode, os->fillmode, points, os->npoints + 1,
+ &os->brush, os->bgcolour, os->fgcolour);
+#endif
+ else
+ error("polygon2 parse error\n");
+
+ free(points);
+}
+
+/* Process a polyline order */
+static void
+process_polyline(RDPCLIENT * This, STREAM s, POLYLINE_ORDER * os, uint32 present, BOOL delta)
+{
+ int index, next, data;
+ uint8 flags = 0;
+ PEN pen;
+ POINT *points;
+
+ if (present & 0x01)
+ rdp_in_coord(s, &os->x, delta);
+
+ if (present & 0x02)
+ rdp_in_coord(s, &os->y, delta);
+
+ if (present & 0x04)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x10)
+ rdp_in_colour(s, &os->fgcolour);
+
+ if (present & 0x20)
+ in_uint8(s, os->lines);
+
+ if (present & 0x40)
+ {
+ in_uint8(s, os->datasize);
+ in_uint8a(s, os->data, os->datasize);
+ }
+
+ DEBUG(("POLYLINE(x=%d,y=%d,op=0x%x,fg=0x%x,n=%d,sz=%d)\n",
+ os->x, os->y, os->opcode, os->fgcolour, os->lines, os->datasize));
+
+ DEBUG(("Data: "));
+
+ for (index = 0; index < os->datasize; index++)
+ DEBUG(("%02x ", os->data[index]));
+
+ DEBUG(("\n"));
+
+ if (os->opcode < 0x01 || os->opcode > 0x10)
+ {
+ error("bad ROP2 0x%x\n", os->opcode);
+ return;
+ }
+
+ points = (POINT *) malloc((os->lines + 1) * sizeof(POINT));
+
+ if(points == NULL)
+ return;
+
+ memset(points, 0, (os->lines + 1) * sizeof(POINT));
+
+ points[0].x = os->x;
+ points[0].y = os->y;
+ pen.style = pen.width = 0;
+ pen.colour = os->fgcolour;
+
+ index = 0;
+ data = ((os->lines - 1) / 4) + 1;
+ for (next = 1; (next <= os->lines) && (data < os->datasize); next++)
+ {
+ if ((next - 1) % 4 == 0)
+ flags = os->data[index++];
+
+ if (~flags & 0x80)
+ points[next].x = parse_delta(os->data, &data);
+
+ if (~flags & 0x40)
+ points[next].y = parse_delta(os->data, &data);
+
+ flags <<= 2;
+ }
+
+ if (next - 1 == os->lines)
+#if 0
+ ui_polyline(This, os->opcode - 1, points, os->lines + 1, &pen);
+#else
+ ui_polyline(This, os->opcode, points, os->lines + 1, &pen);
+#endif
+ else
+ error("polyline parse error\n");
+
+ free(points);
+}
+
+/* Process an ellipse order */
+static void
+process_ellipse(RDPCLIENT * This, STREAM s, ELLIPSE_ORDER * os, uint32 present, BOOL delta)
+{
+ if (present & 0x01)
+ rdp_in_coord(s, &os->left, delta);
+
+ if (present & 0x02)
+ rdp_in_coord(s, &os->top, delta);
+
+ if (present & 0x04)
+ rdp_in_coord(s, &os->right, delta);
+
+ if (present & 0x08)
+ rdp_in_coord(s, &os->bottom, delta);
+
+ if (present & 0x10)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x20)
+ in_uint8(s, os->fillmode);
+
+ if (present & 0x40)
+ rdp_in_colour(s, &os->fgcolour);
+
+ DEBUG(("ELLIPSE(l=%d,t=%d,r=%d,b=%d,op=0x%x,fm=%d,fg=0x%x)\n", os->left, os->top,
+ os->right, os->bottom, os->opcode, os->fillmode, os->fgcolour));
+
+#if 0
+ ui_ellipse(This, os->opcode - 1, os->fillmode, os->left, os->top, os->right - os->left,
+ os->bottom - os->top, NULL, 0, os->fgcolour);
+#else
+ ui_ellipse(This, os->opcode, os->fillmode, os->left, os->top, os->right - os->left,
+ os->bottom - os->top, NULL, 0, os->fgcolour);
+#endif
+}
+
+/* Process an ellipse2 order */
+static void
+process_ellipse2(RDPCLIENT * This, STREAM s, ELLIPSE2_ORDER * os, uint32 present, BOOL delta)
+{
+ if (present & 0x0001)
+ rdp_in_coord(s, &os->left, delta);
+
+ if (present & 0x0002)
+ rdp_in_coord(s, &os->top, delta);
+
+ if (present & 0x0004)
+ rdp_in_coord(s, &os->right, delta);
+
+ if (present & 0x0008)
+ rdp_in_coord(s, &os->bottom, delta);
+
+ if (present & 0x0010)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x0020)
+ in_uint8(s, os->fillmode);
+
+ if (present & 0x0040)
+ rdp_in_colour(s, &os->bgcolour);
+
+ if (present & 0x0080)
+ rdp_in_colour(s, &os->fgcolour);
+
+ rdp_parse_brush(s, &os->brush, present >> 8);
+
+ DEBUG(("ELLIPSE2(l=%d,t=%d,r=%d,b=%d,op=0x%x,fm=%d,bs=%d,bg=0x%x,fg=0x%x)\n",
+ os->left, os->top, os->right, os->bottom, os->opcode, os->fillmode, os->brush.style,
+ os->bgcolour, os->fgcolour));
+
+#if 0
+ ui_ellipse(This, os->opcode - 1, os->fillmode, os->left, os->top, os->right - os->left,
+ os->bottom - os->top, &os->brush, os->bgcolour, os->fgcolour);
+#else
+ ui_ellipse(This, os->opcode, os->fillmode, os->left, os->top, os->right - os->left,
+ os->bottom - os->top, &os->brush, os->bgcolour, os->fgcolour);
+#endif
+}
+
+/* Process a text order */
+static void
+process_text2(RDPCLIENT * This, STREAM s, TEXT2_ORDER * os, uint32 present, BOOL delta)
+{
+ int i;
+
+ if (present & 0x000001)
+ in_uint8(s, os->font);
+
+ if (present & 0x000002)
+ in_uint8(s, os->flags);
+
+ if (present & 0x000004)
+ in_uint8(s, os->opcode);
+
+ if (present & 0x000008)
+ in_uint8(s, os->mixmode);
+
+ if (present & 0x000010)
+ rdp_in_colour(s, &os->fgcolour);
+
+ if (present & 0x000020)
+ rdp_in_colour(s, &os->bgcolour);
+
+ if (present & 0x000040)
+ in_uint16_le(s, os->clipleft);
+
+ if (present & 0x000080)
+ in_uint16_le(s, os->cliptop);
+
+ if (present & 0x000100)
+ in_uint16_le(s, os->clipright);
+
+ if (present & 0x000200)
+ in_uint16_le(s, os->clipbottom);
+
+ if (present & 0x000400)
+ in_uint16_le(s, os->boxleft);
+
+ if (present & 0x000800)
+ in_uint16_le(s, os->boxtop);
+
+ if (present & 0x001000)
+ in_uint16_le(s, os->boxright);
+
+ if (present & 0x002000)
+ in_uint16_le(s, os->boxbottom);
+
+ rdp_parse_brush(s, &os->brush, present >> 14);
+
+ if (present & 0x080000)
+ in_uint16_le(s, os->x);
+
+ if (present & 0x100000)
+ in_uint16_le(s, os->y);
+
+ if (present & 0x200000)
+ {
+ in_uint8(s, os->length);
+ in_uint8a(s, os->text, os->length);
+ }
+
+ DEBUG(("TEXT2(x=%d,y=%d,cl=%d,ct=%d,cr=%d,cb=%d,bl=%d,bt=%d,br=%d,bb=%d,bs=%d,bg=0x%x,fg=0x%x,font=%d,fl=0x%x,op=0x%x,mix=%d,n=%d)\n", os->x, os->y, os->clipleft, os->cliptop, os->clipright, os->clipbottom, os->boxleft, os->boxtop, os->boxright, os->boxbottom, os->brush.style, os->bgcolour, os->fgcolour, os->font, os->flags, os->opcode, os->mixmode, os->length));
+
+ DEBUG(("Text: "));
+
+ for (i = 0; i < os->length; i++)
+ DEBUG(("%02x ", os->text[i]));
+
+ DEBUG(("\n"));
+
+#if 0
+ ui_draw_text(This, os->font, os->flags, os->opcode - 1, os->mixmode, os->x, os->y,
+ os->clipleft, os->cliptop, os->clipright - os->clipleft,
+ os->clipbottom - os->cliptop, os->boxleft, os->boxtop,
+ os->boxright - os->boxleft, os->boxbottom - os->boxtop,
+ &os->brush, os->bgcolour, os->fgcolour, os->text, os->length);
+#else
+ ui_draw_text(This, os->font, os->flags, os->opcode, os->mixmode, os->x, os->y,
+ os->clipleft, os->cliptop, os->clipright - os->clipleft,
+ os->clipbottom - os->cliptop, os->boxleft, os->boxtop,
+ os->boxright - os->boxleft, os->boxbottom - os->boxtop,
+ &os->brush, os->bgcolour, os->fgcolour, os->text, os->length);
+#endif
+}
+
+/* Process a raw bitmap cache order */
+static void
+process_raw_bmpcache(RDPCLIENT * This, STREAM s)
+{
+ HBITMAP bitmap;
+ uint16 cache_idx, bufsize;
+ uint8 cache_id, width, height, bpp, Bpp;
+ uint8 *data;
+
+ in_uint8(s, cache_id);
+ in_uint8s(s, 1); /* pad */
+ in_uint8(s, width);
+ in_uint8(s, height);
+ in_uint8(s, bpp);
+ Bpp = (bpp + 7) / 8;
+ in_uint16_le(s, bufsize);
+ in_uint16_le(s, cache_idx);
+ in_uint8p(s, data, bufsize);
+
+ DEBUG(("RAW_BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx));
+#if 0
+ inverted = (uint8 *) xmalloc(width * height * Bpp);
+ for (y = 0; y < height; y++)
+ {
+ memcpy(&inverted[(height - y - 1) * (width * Bpp)], &data[y * (width * Bpp)],
+ width * Bpp);
+ }
+#endif
+
+#if 0
+ bitmap = ui_create_bitmap(This, width, height, inverted);
+ xfree(inverted);
+#else
+ bitmap = ui_create_bitmap(This, width, height, data);
+#endif
+
+ cache_put_bitmap(This, cache_id, cache_idx, bitmap);
+}
+
+/* Process a bitmap cache order */
+static void
+process_bmpcache(RDPCLIENT * This, STREAM s)
+{
+ HBITMAP bitmap;
+ uint16 cache_idx, size;
+ uint8 cache_id, width, height, bpp, Bpp;
+ uint8 *data, *bmpdata;
+ uint16 bufsize, pad2, row_size, final_size;
+ uint8 pad1;
+
+ pad2 = row_size = final_size = 0xffff; /* Shut the compiler up */
+
+ in_uint8(s, cache_id);
+ in_uint8(s, pad1); /* pad */
+ in_uint8(s, width);
+ in_uint8(s, height);
+ in_uint8(s, bpp);
+ Bpp = (bpp + 7) / 8;
+ in_uint16_le(s, bufsize); /* bufsize */
+ in_uint16_le(s, cache_idx);
+
+ if (This->use_rdp5)
+ {
+ size = bufsize;
+ }
+ else
+ {
+
+ /* Begin compressedBitmapData */
+ in_uint16_le(s, pad2); /* pad */
+ in_uint16_le(s, size);
+ /* in_uint8s(s, 4); *//* row_size, final_size */
+ in_uint16_le(s, row_size);
+ in_uint16_le(s, final_size);
+
+ }
+ in_uint8p(s, data, size);
+
+ DEBUG(("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d,bpp=%d,size=%d,pad1=%d,bufsize=%d,pad2=%d,rs=%d,fs=%d)\n", width, height, cache_id, cache_idx, bpp, size, pad1, bufsize, pad2, row_size, final_size));
+
+ bmpdata = (uint8 *) malloc(width * height * Bpp);
+
+ if(bmpdata == NULL)
+ return;
+
+ if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))
+ {
+ bitmap = ui_create_bitmap(This, width, height, bmpdata);
+ cache_put_bitmap(This, cache_id, cache_idx, bitmap);
+ }
+ else
+ {
+ DEBUG(("Failed to decompress bitmap data\n"));
+ }
+
+ free(bmpdata);
+}
+
+/* Process a bitmap cache v2 order */
+static void
+process_bmpcache2(RDPCLIENT * This, STREAM s, uint16 flags, BOOL compressed)
+{
+ HBITMAP bitmap;
+ uint8 cache_id, cache_idx_low, width, height, Bpp;
+ uint16 cache_idx, bufsize;
+ uint8 *data, *bmpdata, *bitmap_id;
+
+ bitmap_id = NULL; /* prevent compiler warning */
+ cache_id = flags & ID_MASK;
+ Bpp = ((flags & MODE_MASK) >> MODE_SHIFT) - 2;
+
+ if (flags & PERSIST)
+ {
+ in_uint8p(s, bitmap_id, 8);
+ }
+
+ if (flags & SQUARE)
+ {
+ in_uint8(s, width);
+ height = width;
+ }
+ else
+ {
+ in_uint8(s, width);
+ in_uint8(s, height);
+ }
+
+ in_uint16_be(s, bufsize);
+ bufsize &= BUFSIZE_MASK;
+ in_uint8(s, cache_idx);
+
+ if (cache_idx & LONG_FORMAT)
+ {
+ in_uint8(s, cache_idx_low);
+ cache_idx = ((cache_idx ^ LONG_FORMAT) << 8) + cache_idx_low;
+ }
+
+ in_uint8p(s, data, bufsize);
+
+ DEBUG(("BMPCACHE2(compr=%d,flags=%x,cx=%d,cy=%d,id=%d,idx=%d,Bpp=%d,bs=%d)\n",
+ compressed, flags, width, height, cache_id, cache_idx, Bpp, bufsize));
+
+ if (compressed)
+ {
+ bmpdata = (uint8 *) malloc(width * height * Bpp);
+
+ if(bmpdata == NULL)
+ return;
+
+ if (!bitmap_decompress(bmpdata, width, height, data, bufsize, Bpp))
+ {
+ DEBUG(("Failed to decompress bitmap data\n"));
+ free(bmpdata);
+ return;
+ }
+ }
+ else
+ {
+#if 0
+ for (y = 0; y < height; y++)
+ memcpy(&bmpdata[(height - y - 1) * (width * Bpp)],
+ &data[y * (width * Bpp)], width * Bpp);
+#else
+ bmpdata = data;
+#endif
+ }
+
+ bitmap = ui_create_bitmap(This, width, height, bmpdata);
+
+ if (bitmap)
+ {
+ cache_put_bitmap(This, cache_id, cache_idx, bitmap);
+ if (flags & PERSIST)
+ pstcache_save_bitmap(This, cache_id, cache_idx, bitmap_id, width, height,
+ width * height * Bpp, bmpdata);
+ }
+ else
+ {
+ DEBUG(("process_bmpcache2: ui_create_bitmap failed\n"));
+ }
+
+ if (compressed)
+ free(bmpdata);
+}
+
+/* Process a colourmap cache order */
+static void
+process_colcache(RDPCLIENT * This, STREAM s)
+{
+ COLOURENTRY *entry;
+ COLOURMAP map;
+ HCOLOURMAP hmap;
+ uint8 cache_id;
+ int i;
+
+ in_uint8(s, cache_id);
+ in_uint16_le(s, map.ncolours);
+
+ map.colours = (COLOURENTRY *) malloc(sizeof(COLOURENTRY) * map.ncolours);
+
+ if(map.colours == NULL)
+ {
+ in_uint8s(s, map.ncolours * 4);
+ return;
+ }
+
+ for (i = 0; i < map.ncolours; i++)
+ {
+ entry = &map.colours[i];
+ in_uint8(s, entry->blue);
+ in_uint8(s, entry->green);
+ in_uint8(s, entry->red);
+ in_uint8s(s, 1); /* pad */
+ }
+
+ DEBUG(("COLCACHE(id=%d,n=%d)\n", cache_id, map.ncolours));
+
+ hmap = ui_create_colourmap(This, &map);
+
+ if (cache_id)
+ ui_set_colourmap(This, hmap);
+
+ free(map.colours);
+}
+
+/* Process a font cache order */
+static void
+process_fontcache(RDPCLIENT * This, STREAM s)
+{
+ HGLYPH bitmap;
+ uint8 font, nglyphs;
+ uint16 character, offset, baseline, width, height;
+ int i, datasize;
+ uint8 *data;
+
+ in_uint8(s, font);
+ in_uint8(s, nglyphs);
+
+ DEBUG(("FONTCACHE(font=%d,n=%d)\n", font, nglyphs));
+
+ for (i = 0; i < nglyphs; i++)
+ {
+ in_uint16_le(s, character);
+ in_uint16_le(s, offset);
+ in_uint16_le(s, baseline);
+ in_uint16_le(s, width);
+ in_uint16_le(s, height);
+
+ datasize = (height * ((width + 7) / 8) + 3) & ~3;
+ in_uint8p(s, data, datasize);
+
+ bitmap = ui_create_glyph(This, width, height, data);
+ cache_put_font(This, font, character, offset, baseline, width, height, bitmap);
+ }
+}
+
+/* Process a secondary order */
+static void
+process_secondary_order(RDPCLIENT * This, STREAM s)
+{
+ /* The length isn't calculated correctly by the server.
+ * For very compact orders the length becomes negative
+ * so a signed integer must be used. */
+ uint16 length;
+ uint16 flags;
+ uint8 type;
+ uint8 *next_order;
+
+ in_uint16_le(s, length);
+ in_uint16_le(s, flags); /* used by bmpcache2 */
+ in_uint8(s, type);
+
+ next_order = s->p + (sint16) length + 7;
+
+ switch (type)
+ {
+ case RDP_ORDER_RAW_BMPCACHE:
+ process_raw_bmpcache(This, s);
+ break;
+
+ case RDP_ORDER_COLCACHE:
+ process_colcache(This, s);
+ break;
+
+ case RDP_ORDER_BMPCACHE:
+ process_bmpcache(This, s);
+ break;
+
+ case RDP_ORDER_FONTCACHE:
+ process_fontcache(This, s);
+ break;
+
+ case RDP_ORDER_RAW_BMPCACHE2:
+ process_bmpcache2(This, s, flags, False); /* uncompressed */
+ break;
+
+ case RDP_ORDER_BMPCACHE2:
+ process_bmpcache2(This, s, flags, True); /* compressed */
+ break;
+
+ default:
+ unimpl("secondary order %d\n", type);
+ }
+
+ s->p = next_order;
+}
+
+/* Process an order PDU */
+void
+process_orders(RDPCLIENT * This, STREAM s, uint16 num_orders)
+{
+ RDP_ORDER_STATE *os = &This->orders.order_state;
+ uint32 present;
+ uint8 order_flags;
+ int size, processed = 0;
+ BOOL delta;
+
+ while (processed < num_orders)
+ {
+ in_uint8(s, order_flags);
+
+ if (!(order_flags & RDP_ORDER_STANDARD))
+ {
+ error("order parsing failed\n");
+ break;
+ }
+
+ if (order_flags & RDP_ORDER_SECONDARY)
+ {
+ process_secondary_order(This, s);
+ }
+ else
+ {
+ if (order_flags & RDP_ORDER_CHANGE)
+ {
+ in_uint8(s, os->order_type);
+ }
+
+ switch (os->order_type)
+ {
+ case RDP_ORDER_TRIBLT:
+ case RDP_ORDER_TEXT2:
+ size = 3;
+ break;
+
+ case RDP_ORDER_PATBLT:
+ case RDP_ORDER_MEMBLT:
+ case RDP_ORDER_LINE:
+ case RDP_ORDER_POLYGON2:
+ case RDP_ORDER_ELLIPSE2:
+ size = 2;
+ break;
+
+ default:
+ size = 1;
+ }
+
+ rdp_in_present(s, &present, order_flags, size);
+
+ if (order_flags & RDP_ORDER_BOUNDS)
+ {
+ if (!(order_flags & RDP_ORDER_LASTBOUNDS))
+ rdp_parse_bounds(s, &os->bounds);
+
+ ui_set_clip(This, os->bounds.left,
+ os->bounds.top,
+ os->bounds.right -
+ os->bounds.left + 1,
+ os->bounds.bottom - os->bounds.top + 1);
+ }
+
+ delta = order_flags & RDP_ORDER_DELTA;
+
+ switch (os->order_type)
+ {
+ case RDP_ORDER_DESTBLT:
+ process_destblt(This, s, &os->destblt, present, delta);
+ break;
+
+ case RDP_ORDER_PATBLT:
+ process_patblt(This, s, &os->patblt, present, delta);
+ break;
+
+ case RDP_ORDER_SCREENBLT:
+ process_screenblt(This, s, &os->screenblt, present, delta);
+ break;
+
+ case RDP_ORDER_LINE:
+ process_line(This, s, &os->line, present, delta);
+ break;
+
+ case RDP_ORDER_RECT:
+ process_rect(This, s, &os->rect, present, delta);
+ break;
+
+ case RDP_ORDER_DESKSAVE:
+ process_desksave(This, s, &os->desksave, present, delta);
+ break;
+
+ case RDP_ORDER_MEMBLT:
+ process_memblt(This, s, &os->memblt, present, delta);
+ break;
+
+ case RDP_ORDER_TRIBLT:
+ process_triblt(This, s, &os->triblt, present, delta);
+ break;
+
+ case RDP_ORDER_POLYGON:
+ process_polygon(This, s, &os->polygon, present, delta);
+ break;
+
+ case RDP_ORDER_POLYGON2:
+ process_polygon2(This, s, &os->polygon2, present, delta);
+ break;
+
+ case RDP_ORDER_POLYLINE:
+ process_polyline(This, s, &os->polyline, present, delta);
+ break;
+
+ case RDP_ORDER_ELLIPSE:
+ process_ellipse(This, s, &os->ellipse, present, delta);
+ break;
+
+ case RDP_ORDER_ELLIPSE2:
+ process_ellipse2(This, s, &os->ellipse2, present, delta);
+ break;
+
+ case RDP_ORDER_TEXT2:
+ process_text2(This, s, &os->text2, present, delta);
+ break;
+
+ default:
+ unimpl("order %d\n", os->order_type);
+ return;
+ }
+
+ if (order_flags & RDP_ORDER_BOUNDS)
+ ui_reset_clip(This);
+ }
+
+ processed++;
+ }
+#if 0
+ /* not true when RDP_COMPRESSION is set */
+ if (s->p != This->next_packet)
+ error("%d bytes remaining\n", (int) (This->next_packet - s->p));
+#endif
+
+}
+
+/* Reset order state */
+void
+reset_order_state(RDPCLIENT * This)
+{
+ memset(&This->orders.order_state, 0, sizeof(This->orders.order_state));
+ This->orders.order_state.order_type = RDP_ORDER_PATBLT;
+}
--- /dev/null
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ RDP order processing
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifndef RDESKTOP_ORDERS_H
+#define RDESKTOP_ORDERS_H
+
+#define RDP_ORDER_STANDARD 0x01
+#define RDP_ORDER_SECONDARY 0x02
+#define RDP_ORDER_BOUNDS 0x04
+#define RDP_ORDER_CHANGE 0x08
+#define RDP_ORDER_DELTA 0x10
+#define RDP_ORDER_LASTBOUNDS 0x20
+#define RDP_ORDER_SMALL 0x40
+#define RDP_ORDER_TINY 0x80
+
+enum RDP_ORDER_TYPE
+{
+ RDP_ORDER_DESTBLT = 0,
+ RDP_ORDER_PATBLT = 1,
+ RDP_ORDER_SCREENBLT = 2,
+ RDP_ORDER_LINE = 9,
+ RDP_ORDER_RECT = 10,
+ RDP_ORDER_DESKSAVE = 11,
+ RDP_ORDER_MEMBLT = 13,
+ RDP_ORDER_TRIBLT = 14,
+ RDP_ORDER_POLYGON = 20,
+ RDP_ORDER_POLYGON2 = 21,
+ RDP_ORDER_POLYLINE = 22,
+ RDP_ORDER_ELLIPSE = 25,
+ RDP_ORDER_ELLIPSE2 = 26,
+ RDP_ORDER_TEXT2 = 27
+};
+
+enum RDP_SECONDARY_ORDER_TYPE
+{
+ RDP_ORDER_RAW_BMPCACHE = 0,
+ RDP_ORDER_COLCACHE = 1,
+ RDP_ORDER_BMPCACHE = 2,
+ RDP_ORDER_FONTCACHE = 3,
+ RDP_ORDER_RAW_BMPCACHE2 = 4,
+ RDP_ORDER_BMPCACHE2 = 5,
+ RDP_ORDER_BRUSHCACHE = 7
+};
+
+typedef struct _DESTBLT_ORDER
+{
+ sint16 x;
+ sint16 y;
+ sint16 cx;
+ sint16 cy;
+ uint8 opcode;
+
+}
+DESTBLT_ORDER;
+
+typedef struct _PATBLT_ORDER
+{
+ sint16 x;
+ sint16 y;
+ sint16 cx;
+ sint16 cy;
+ uint8 opcode;
+ uint32 bgcolour;
+ uint32 fgcolour;
+ BRUSH brush;
+
+}
+PATBLT_ORDER;
+
+typedef struct _SCREENBLT_ORDER
+{
+ sint16 x;
+ sint16 y;
+ sint16 cx;
+ sint16 cy;
+ uint8 opcode;
+ sint16 srcx;
+ sint16 srcy;
+
+}
+SCREENBLT_ORDER;
+
+typedef struct _LINE_ORDER
+{
+ uint16 mixmode;
+ sint16 startx;
+ sint16 starty;
+ sint16 endx;
+ sint16 endy;
+ uint32 bgcolour;
+ uint8 opcode;
+ PEN pen;
+
+}
+LINE_ORDER;
+
+typedef struct _RECT_ORDER
+{
+ sint16 x;
+ sint16 y;
+ sint16 cx;
+ sint16 cy;
+ uint32 colour;
+
+}
+RECT_ORDER;
+
+typedef struct _DESKSAVE_ORDER
+{
+ uint32 offset;
+ sint16 left;
+ sint16 top;
+ sint16 right;
+ sint16 bottom;
+ uint8 action;
+
+}
+DESKSAVE_ORDER;
+
+typedef struct _TRIBLT_ORDER
+{
+ uint8 colour_table;
+ uint8 cache_id;
+ sint16 x;
+ sint16 y;
+ sint16 cx;
+ sint16 cy;
+ uint8 opcode;
+ sint16 srcx;
+ sint16 srcy;
+ uint32 bgcolour;
+ uint32 fgcolour;
+ BRUSH brush;
+ uint16 cache_idx;
+ uint16 unknown;
+
+}
+TRIBLT_ORDER;
+
+typedef struct _MEMBLT_ORDER
+{
+ uint8 colour_table;
+ uint8 cache_id;
+ sint16 x;
+ sint16 y;
+ sint16 cx;
+ sint16 cy;
+ uint8 opcode;
+ sint16 srcx;
+ sint16 srcy;
+ uint16 cache_idx;
+
+}
+MEMBLT_ORDER;
+
+#define MAX_DATA 256
+
+typedef struct _POLYGON_ORDER
+{
+ sint16 x;
+ sint16 y;
+ uint8 opcode;
+ uint8 fillmode;
+ uint32 fgcolour;
+ uint8 npoints;
+ uint8 datasize;
+ uint8 data[MAX_DATA];
+
+}
+POLYGON_ORDER;
+
+typedef struct _POLYGON2_ORDER
+{
+ sint16 x;
+ sint16 y;
+ uint8 opcode;
+ uint8 fillmode;
+ uint32 bgcolour;
+ uint32 fgcolour;
+ BRUSH brush;
+ uint8 npoints;
+ uint8 datasize;
+ uint8 data[MAX_DATA];
+
+}
+POLYGON2_ORDER;
+
+typedef struct _POLYLINE_ORDER
+{
+ sint16 x;
+ sint16 y;
+ uint8 opcode;
+ uint32 fgcolour;
+ uint8 lines;
+ uint8 datasize;
+ uint8 data[MAX_DATA];
+
+}
+POLYLINE_ORDER;
+
+typedef struct _ELLIPSE_ORDER
+{
+ sint16 left;
+ sint16 top;
+ sint16 right;
+ sint16 bottom;
+ uint8 opcode;
+ uint8 fillmode;
+ uint32 fgcolour;
+
+}
+ELLIPSE_ORDER;
+
+typedef struct _ELLIPSE2_ORDER
+{
+ sint16 left;
+ sint16 top;
+ sint16 right;
+ sint16 bottom;
+ uint8 opcode;
+ uint8 fillmode;
+ BRUSH brush;
+ uint32 bgcolour;
+ uint32 fgcolour;
+
+}
+ELLIPSE2_ORDER;
+
+#define MAX_TEXT 256
+
+typedef struct _TEXT2_ORDER
+{
+ uint8 font;
+ uint8 flags;
+ uint8 opcode;
+ uint8 mixmode;
+ uint32 bgcolour;
+ uint32 fgcolour;
+ sint16 clipleft;
+ sint16 cliptop;
+ sint16 clipright;
+ sint16 clipbottom;
+ sint16 boxleft;
+ sint16 boxtop;
+ sint16 boxright;
+ sint16 boxbottom;
+ BRUSH brush;
+ sint16 x;
+ sint16 y;
+ uint8 length;
+ uint8 text[MAX_TEXT];
+
+}
+TEXT2_ORDER;
+
+typedef struct _RDP_ORDER_STATE
+{
+ uint8 order_type;
+ BOUNDS bounds;
+
+ DESTBLT_ORDER destblt;
+ PATBLT_ORDER patblt;
+ SCREENBLT_ORDER screenblt;
+ LINE_ORDER line;
+ RECT_ORDER rect;
+ DESKSAVE_ORDER desksave;
+ MEMBLT_ORDER memblt;
+ TRIBLT_ORDER triblt;
+ POLYGON_ORDER polygon;
+ POLYGON2_ORDER polygon2;
+ POLYLINE_ORDER polyline;
+ ELLIPSE_ORDER ellipse;
+ ELLIPSE2_ORDER ellipse2;
+ TEXT2_ORDER text2;
+
+}
+RDP_ORDER_STATE;
+
+typedef struct _RDP_RAW_BMPCACHE_ORDER
+{
+ uint8 cache_id;
+ uint8 pad1;
+ uint8 width;
+ uint8 height;
+ uint8 bpp;
+ uint16 bufsize;
+ uint16 cache_idx;
+ uint8 *data;
+
+}
+RDP_RAW_BMPCACHE_ORDER;
+
+typedef struct _RDP_BMPCACHE_ORDER
+{
+ uint8 cache_id;
+ uint8 pad1;
+ uint8 width;
+ uint8 height;
+ uint8 bpp;
+ uint16 bufsize;
+ uint16 cache_idx;
+ uint16 pad2;
+ uint16 size;
+ uint16 row_size;
+ uint16 final_size;
+ uint8 *data;
+
+}
+RDP_BMPCACHE_ORDER;
+
+/* RDP_BMPCACHE2_ORDER */
+#define ID_MASK 0x0007
+#define MODE_MASK 0x0038
+#define SQUARE 0x0080
+#define PERSIST 0x0100
+#define FLAG_51_UNKNOWN 0x0800
+
+#define MODE_SHIFT 3
+
+#define LONG_FORMAT 0x80
+#define BUFSIZE_MASK 0x3FFF /* or 0x1FFF? */
+
+#define MAX_GLYPH 32
+
+typedef struct _RDP_FONT_GLYPH
+{
+ uint16 character;
+ uint16 unknown;
+ uint16 baseline;
+ uint16 width;
+ uint16 height;
+ uint8 data[MAX_GLYPH];
+
+}
+RDP_FONT_GLYPH;
+
+#define MAX_GLYPHS 256
+
+typedef struct _RDP_FONTCACHE_ORDER
+{
+ uint8 font;
+ uint8 nglyphs;
+ RDP_FONT_GLYPH glyphs[MAX_GLYPHS];
+
+}
+RDP_FONTCACHE_ORDER;
+
+typedef struct _RDP_COLCACHE_ORDER
+{
+ uint8 cache_id;
+ COLOURMAP map;
+
+}
+RDP_COLCACHE_ORDER;
+
+#endif
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+#define MAX_PARALLEL_DEVICES 1
+
+#define FILE_DEVICE_PARALLEL 0x22
+
+#define IOCTL_PAR_QUERY_RAW_DEVICE_ID 0x0c
+
+#include "rdesktop.h"
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+
+#if defined(__linux__)
+#include <linux/lp.h>
+#endif
+
+/* Enumeration of devices from rdesktop.c */
+/* returns numer of units found and initialized. */
+/* optarg looks like ':LPT1=/dev/lp0' */
+/* when it arrives to this function. */
+int
+parallel_enum_devices(RDPCLIENT * This, uint32 * id, char *optarg)
+{
+ PARALLEL_DEVICE *ppar_info;
+
+ char *pos = optarg;
+ char *pos2;
+ int count = 0;
+
+ /* skip the first colon */
+ optarg++;
+ while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
+ {
+ ppar_info = (PARALLEL_DEVICE *) xmalloc(sizeof(PARALLEL_DEVICE));
+
+ pos2 = next_arg(optarg, '=');
+ strcpy(This->rdpdr_device[*id].name, optarg);
+
+ toupper_str(This->rdpdr_device[*id].name);
+
+ This->rdpdr_device[*id].local_path = xmalloc(strlen(pos2) + 1);
+ strcpy(This->rdpdr_device[*id].local_path, pos2);
+ printf("PARALLEL %s to %s\n", optarg, pos2);
+
+ /* set device type */
+ This->rdpdr_device[*id].device_type = DEVICE_TYPE_PARALLEL;
+ This->rdpdr_device[*id].pdevice_data = (void *) ppar_info;
+ This->rdpdr_device[*id].handle = 0;
+ count++;
+ (*id)++;
+
+ optarg = pos;
+ }
+ return count;
+}
+
+static NTSTATUS
+parallel_create(RDPCLIENT * This, uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition,
+ uint32 flags, char *filename, NTHANDLE * handle)
+{
+ int parallel_fd;
+
+ parallel_fd = open(This->rdpdr_device[device_id].local_path, O_RDWR);
+ if (parallel_fd == -1)
+ {
+ perror("open");
+ return STATUS_ACCESS_DENIED;
+ }
+
+ /* all read and writes should be non blocking */
+ if (fcntl(parallel_fd, F_SETFL, O_NONBLOCK) == -1)
+ perror("fcntl");
+
+#if defined(LPABORT)
+ /* Retry on errors */
+ ioctl(parallel_fd, LPABORT, (int) 1);
+#endif
+
+ This->rdpdr_device[device_id].handle = parallel_fd;
+
+ *handle = parallel_fd;
+
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+parallel_close(RDPCLIENT * This, NTHANDLE handle)
+{
+ int i = get_device_index(This, handle);
+ if (i >= 0)
+ This->rdpdr_device[i].handle = 0;
+ close(handle);
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+parallel_read(RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
+{
+ *result = read(handle, data, length);
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+parallel_write(RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
+{
+ int rc = STATUS_SUCCESS;
+
+ int n = write(handle, data, length);
+ if (n < 0)
+ {
+#if defined(LPGETSTATUS)
+ int status;
+#endif
+
+ *result = 0;
+ switch (errno)
+ {
+ case EAGAIN:
+ rc = STATUS_DEVICE_OFF_LINE;
+ case ENOSPC:
+ rc = STATUS_DEVICE_PAPER_EMPTY;
+ case EIO:
+ rc = STATUS_DEVICE_OFF_LINE;
+ default:
+ rc = STATUS_DEVICE_POWERED_OFF;
+ }
+#if defined(LPGETSTATUS)
+ if (ioctl(handle, LPGETSTATUS, &status) == 0)
+ {
+ /* coming soon: take care for the printer status */
+ printf("parallel_write: status = %d, errno = %d\n", status, errno);
+ }
+#endif
+ }
+ *result = n;
+ return rc;
+}
+
+static NTSTATUS
+parallel_device_control(RDPCLIENT * This, NTHANDLE handle, uint32 request, STREAM in, STREAM out)
+{
+ if ((request >> 16) != FILE_DEVICE_PARALLEL)
+ return STATUS_INVALID_PARAMETER;
+
+ /* extract operation */
+ request >>= 2;
+ request &= 0xfff;
+
+ printf("PARALLEL IOCTL %d: ", request);
+
+ switch (request)
+ {
+ case IOCTL_PAR_QUERY_RAW_DEVICE_ID:
+
+ default:
+
+ printf("\n");
+ unimpl("UNKNOWN IOCTL %d\n", request);
+ }
+ return STATUS_SUCCESS;
+}
+
+DEVICE_FNS parallel_fns = {
+ parallel_create,
+ parallel_close,
+ parallel_read,
+ parallel_write,
+ parallel_device_control
+};
--- /dev/null
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ Parsing primitives
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+/* Parser state */
+typedef struct stream
+{
+ unsigned char *p;
+ unsigned char *end;
+ unsigned char *data;
+ unsigned int size;
+
+ /* Offsets of various headers */
+ unsigned char *iso_hdr;
+ unsigned char *mcs_hdr;
+ unsigned char *sec_hdr;
+ unsigned char *rdp_hdr;
+ unsigned char *channel_hdr;
+
+}
+ *STREAM;
+
+#define s_push_layer(s,h,n) { (s)->h = (s)->p; (s)->p += n; }
+#define s_pop_layer(s,h) (s)->p = (s)->h;
+#define s_mark_end(s) (s)->end = (s)->p;
+#define s_check(s) ((s)->p <= (s)->end)
+#define s_check_rem(s,n) ((s)->p + n <= (s)->end)
+#define s_check_end(s) ((s)->p == (s)->end)
+
+#if defined(L_ENDIAN) && !defined(NEED_ALIGN)
+#define in_uint16_le(s,v) { v = *(uint16 *)((s)->p); (s)->p += 2; }
+#define in_uint32_le(s,v) { v = *(uint32 *)((s)->p); (s)->p += 4; }
+#define out_uint16_le(s,v) { *(uint16 *)((s)->p) = v; (s)->p += 2; }
+#define out_uint32_le(s,v) { *(uint32 *)((s)->p) = v; (s)->p += 4; }
+
+#else
+#define in_uint16_le(s,v) { v = *((s)->p++); v += *((s)->p++) << 8; }
+#define in_uint32_le(s,v) { in_uint16_le(s,v) \
+ v += *((s)->p++) << 16; v += *((s)->p++) << 24; }
+#define out_uint16_le(s,v) { *((s)->p++) = (v) & 0xff; *((s)->p++) = ((v) >> 8) & 0xff; }
+#define out_uint32_le(s,v) { out_uint16_le(s, (v) & 0xffff); out_uint16_le(s, ((v) >> 16) & 0xffff); }
+#endif
+
+#if defined(B_ENDIAN) && !defined(NEED_ALIGN)
+#define in_uint16_be(s,v) { v = *(uint16 *)((s)->p); (s)->p += 2; }
+#define in_uint32_be(s,v) { v = *(uint32 *)((s)->p); (s)->p += 4; }
+#define out_uint16_be(s,v) { *(uint16 *)((s)->p) = v; (s)->p += 2; }
+#define out_uint32_be(s,v) { *(uint32 *)((s)->p) = v; (s)->p += 4; }
+
+#define B_ENDIAN_PREFERRED
+#define in_uint16(s,v) in_uint16_be(s,v)
+#define in_uint32(s,v) in_uint32_be(s,v)
+#define out_uint16(s,v) out_uint16_be(s,v)
+#define out_uint32(s,v) out_uint32_be(s,v)
+
+#else
+#define in_uint16_be(s,v) { v = *((s)->p++); next_be(s,v); }
+#define in_uint32_be(s,v) { in_uint16_be(s,v); next_be(s,v); next_be(s,v); }
+#define out_uint16_be(s,v) { *((s)->p++) = (uint8)((v) >> 8) & 0xff; *((s)->p++) = (uint8)((v) & 0xff); }
+#define out_uint32_be(s,v) { out_uint16_be(s, (uint16)(((v) >> 16) & 0xffff)); out_uint16_be(s, (uint16)((v) & 0xffff)); }
+#endif
+
+#ifndef B_ENDIAN_PREFERRED
+#define in_uint16(s,v) in_uint16_le(s,v)
+#define in_uint32(s,v) in_uint32_le(s,v)
+#define out_uint16(s,v) out_uint16_le(s,v)
+#define out_uint32(s,v) out_uint32_le(s,v)
+#endif
+
+#define in_uint8(s,v) v = *((s)->p++);
+#define in_uint8p(s,v,n) { v = (s)->p; (s)->p += n; }
+#define in_uint8a(s,v,n) { memcpy(v,(s)->p,n); (s)->p += n; }
+#define in_uint8s(s,n) (s)->p += n;
+#define out_uint8(s,v) *((s)->p++) = v;
+#define out_uint8p(s,v,n) { memcpy((s)->p,v,n); (s)->p += n; }
+#define out_uint8a(s,v,n) out_uint8p(s,v,n);
+#define out_uint8s(s,n) { memset((s)->p,0,n); (s)->p += n; }
+
+#define next_be(s,v) v = ((v) << 8) + *((s)->p++);
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+static PRINTER *
+get_printer_data(RDPCLIENT * This, NTHANDLE handle)
+{
+ int index;
+
+ for (index = 0; index < RDPDR_MAX_DEVICES; index++)
+ {
+ if (handle == This->rdpdr_device[index].handle)
+ return (PRINTER *) This->rdpdr_device[index].pdevice_data;
+ }
+ return NULL;
+}
+
+int
+printer_enum_devices(RDPCLIENT * This, uint32 * id, char *optarg)
+{
+ PRINTER *pprinter_data;
+
+ char *pos = optarg;
+ char *pos2;
+ int count = 0;
+ int already = 0;
+
+ /* we need to know how many printers we've already set up
+ supplied from other -r flags than this one. */
+ while (count < *id)
+ {
+ if (This->rdpdr_device[count].device_type == DEVICE_TYPE_PRINTER)
+ already++;
+ count++;
+ }
+
+ count = 0;
+
+ if (*optarg == ':')
+ optarg++;
+
+ while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
+ {
+ pprinter_data = (PRINTER *) xmalloc(sizeof(PRINTER));
+
+ strcpy(This->rdpdr_device[*id].name, "PRN");
+ strcat(This->rdpdr_device[*id].name, l_to_a(already + count + 1, 10));
+
+ /* first printer is set as default printer */
+ if ((already + count) == 0)
+ pprinter_data->default_printer = True;
+ else
+ pprinter_data->default_printer = False;
+
+ pos2 = next_arg(optarg, '=');
+ if (*optarg == (char) 0x00)
+ pprinter_data->printer = "mydeskjet"; /* set default */
+ else
+ {
+ pprinter_data->printer = xmalloc(strlen(optarg) + 1);
+ strcpy(pprinter_data->printer, optarg);
+ }
+
+ if (!pos2 || (*pos2 == (char) 0x00))
+ pprinter_data->driver = "HP Color LaserJet 8500 PS"; /* no printer driver supplied set default */
+ else
+ {
+ pprinter_data->driver = xmalloc(strlen(pos2) + 1);
+ strcpy(pprinter_data->driver, pos2);
+ }
+
+ printf("PRINTER %s to %s driver %s\n", This->rdpdr_device[*id].name,
+ pprinter_data->printer, pprinter_data->driver);
+ This->rdpdr_device[*id].device_type = DEVICE_TYPE_PRINTER;
+ This->rdpdr_device[*id].pdevice_data = (void *) pprinter_data;
+ count++;
+ (*id)++;
+
+ optarg = pos;
+ }
+ return count;
+}
+
+static NTSTATUS
+printer_create(RDPCLIENT * This, uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, uint32 flags,
+ char *filename, NTHANDLE * handle)
+{
+ char cmd[256];
+ PRINTER *pprinter_data;
+
+ pprinter_data = (PRINTER *) This->rdpdr_device[device_id].pdevice_data;
+
+ /* default printer name use default printer queue as well in unix */
+ if (pprinter_data->printer == "mydeskjet")
+ {
+ pprinter_data->printer_fp = popen("lpr", "w");
+ }
+ else
+ {
+ sprintf(cmd, "lpr -P %s", pprinter_data->printer);
+ pprinter_data->printer_fp = popen(cmd, "w");
+ }
+
+ This->rdpdr_device[device_id].handle = fileno(pprinter_data->printer_fp);
+ *handle = This->rdpdr_device[device_id].handle;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+printer_close(RDPCLIENT * This, NTHANDLE handle)
+{
+ int i = get_device_index(This, handle);
+ if (i >= 0)
+ {
+ PRINTER *pprinter_data = This->rdpdr_device[i].pdevice_data;
+ if (pprinter_data)
+ pclose(pprinter_data->printer_fp);
+ This->rdpdr_device[i].handle = 0;
+ }
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+printer_write(RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
+{
+ PRINTER *pprinter_data;
+
+ pprinter_data = get_printer_data(This, handle);
+ *result = length * fwrite(data, length, 1, pprinter_data->printer_fp);
+
+ if (ferror(pprinter_data->printer_fp))
+ {
+ *result = 0;
+ return STATUS_INVALID_HANDLE;
+ }
+ return STATUS_SUCCESS;
+}
+
+DEVICE_FNS printer_fns = {
+ printer_create,
+ printer_close,
+ NULL, /* read */
+ printer_write,
+ NULL /* device_control */
+};
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ * rdesktop: A Remote Desktop Protocol client.
+ * Entrypoint and utility functions
+ * Copyright (C) Matthew Chapman 1999-2005
+ * Copyright (C) Jeroen Meijer 2003
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/* According to the W2K RDP Printer Redirection WhitePaper, a data
+ * blob is sent to the client after the configuration of the printer
+ * is changed at the server.
+ *
+ * This data blob is saved to the registry. The client returns this
+ * data blob in a new session with the printer announce data.
+ * The data is not interpreted by the client.
+ */
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include "rdesktop.h"
+
+static BOOL
+printercache_mkdir(char *base, char *printer)
+{
+ char *path;
+
+ path = (char *) xmalloc(strlen(base) + sizeof("/.rdesktop/rdpdr/") + strlen(printer) + 1);
+
+ sprintf(path, "%s/.rdesktop", base);
+ if ((mkdir(path, 0700) == -1) && errno != EEXIST)
+ {
+ perror(path);
+ xfree(path);
+ return False;
+ }
+
+ strcat(path, "/rdpdr");
+ if ((mkdir(path, 0700) == -1) && errno != EEXIST)
+ {
+ perror(path);
+ xfree(path);
+ return False;
+ }
+
+ strcat(path, "/");
+ strcat(path, printer);
+ if ((mkdir(path, 0700) == -1) && errno != EEXIST)
+ {
+ perror(path);
+ xfree(path);
+ return False;
+ }
+
+ xfree(path);
+ return True;
+}
+
+static BOOL
+printercache_unlink_blob(char *printer)
+{
+ char *path;
+ char *home;
+
+ if (printer == NULL)
+ return False;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ return False;
+
+ path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer) +
+ sizeof("/AutoPrinterCacheData") + 1);
+
+ sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer);
+
+ if (unlink(path) < 0)
+ {
+ xfree(path);
+ return False;
+ }
+
+ sprintf(path, "%s/.rdesktop/rdpdr/%s", home, printer);
+
+ if (rmdir(path) < 0)
+ {
+ xfree(path);
+ return False;
+ }
+
+ xfree(path);
+ return True;
+}
+
+
+static BOOL
+printercache_rename_blob(char *printer, char *new_printer)
+{
+ char *printer_path;
+ char *new_printer_path;
+ int printer_maxlen;
+
+ char *home;
+
+ if (printer == NULL)
+ return False;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ return False;
+
+ printer_maxlen =
+ (strlen(printer) >
+ strlen(new_printer) ? strlen(printer) : strlen(new_printer)) + strlen(home) +
+ sizeof("/.rdesktop/rdpdr/") + 1;
+
+ printer_path = (char *) xmalloc(printer_maxlen);
+ new_printer_path = (char *) xmalloc(printer_maxlen);
+
+ sprintf(printer_path, "%s/.rdesktop/rdpdr/%s", home, printer);
+ sprintf(new_printer_path, "%s/.rdesktop/rdpdr/%s", home, new_printer);
+
+ printf("%s,%s\n", printer_path, new_printer_path);
+ if (rename(printer_path, new_printer_path) < 0)
+ {
+ xfree(printer_path);
+ xfree(new_printer_path);
+ return False;
+ }
+
+ xfree(printer_path);
+ xfree(new_printer_path);
+ return True;
+}
+
+
+int
+printercache_load_blob(char *printer_name, uint8 ** data)
+{
+ char *home, *path;
+ struct stat st;
+ int fd, length;
+
+ if (printer_name == NULL)
+ return 0;
+
+ *data = NULL;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ return 0;
+
+ path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) +
+ sizeof("/AutoPrinterCacheData") + 1);
+ sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name);
+
+ fd = open(path, O_RDONLY);
+ if (fd == -1)
+ {
+ xfree(path);
+ return 0;
+ }
+
+ if (fstat(fd, &st))
+ {
+ xfree(path);
+ close(fd);
+ return 0;
+ }
+
+ *data = (uint8 *) xmalloc(st.st_size);
+ length = read(fd, *data, st.st_size);
+ close(fd);
+ xfree(path);
+ return length;
+}
+
+static void
+printercache_save_blob(char *printer_name, uint8 * data, uint32 length)
+{
+ char *home, *path;
+ int fd;
+
+ if (printer_name == NULL)
+ return;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ return;
+
+ if (!printercache_mkdir(home, printer_name))
+ return;
+
+ path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) +
+ sizeof("/AutoPrinterCacheData") + 1);
+ sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name);
+
+ fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ if (fd == -1)
+ {
+ perror(path);
+ xfree(path);
+ return;
+ }
+
+ if (write(fd, data, length) != length)
+ {
+ perror(path);
+ unlink(path);
+ }
+
+ close(fd);
+ xfree(path);
+}
+
+void
+printercache_process(RDPCLIENT * This, STREAM s)
+{
+ uint32 type, printer_length, driver_length, printer_unicode_length, blob_length;
+ char device_name[9], printer[256], driver[256];
+
+ in_uint32_le(s, type);
+ switch (type)
+ {
+ case 4: /* rename item */
+ in_uint8(s, printer_length);
+ in_uint8s(s, 0x3); /* padding */
+ in_uint8(s, driver_length);
+ in_uint8s(s, 0x3); /* padding */
+
+ /* NOTE - 'driver' doesn't contain driver, it contains the new printer name */
+
+ rdp_in_unistr(This, s, printer, printer_length);
+ rdp_in_unistr(This, s, driver, driver_length);
+
+ printercache_rename_blob(printer, driver);
+ break;
+
+ case 3: /* delete item */
+ in_uint8(s, printer_unicode_length);
+ in_uint8s(s, 0x3); /* padding */
+ printer_length = rdp_in_unistr(This, s, printer, printer_unicode_length);
+ printercache_unlink_blob(printer);
+ break;
+
+ case 2: /* save printer data */
+ in_uint32_le(s, printer_unicode_length);
+ in_uint32_le(s, blob_length);
+
+ if (printer_unicode_length < 2 * 255)
+ {
+ rdp_in_unistr(This, s, printer, printer_unicode_length);
+ printercache_save_blob(printer, s->p, blob_length);
+ }
+ break;
+
+ case 1: /* save device data */
+ in_uint8a(s, device_name, 5); /* get LPTx/COMx name */
+
+ /* need to fetch this data so that we can get the length of the packet to store. */
+ in_uint8s(s, 0x2); /* ??? */
+ in_uint8s(s, 0x2) /* pad?? */
+ in_uint32_be(s, driver_length);
+ in_uint32_be(s, printer_length);
+ in_uint8s(s, 0x7) /* pad?? */
+ /* next is driver in unicode */
+ /* next is printer in unicode */
+ /* TODO: figure out how to use this information when reconnecting */
+ /* actually - all we need to store is the driver and printer */
+ /* and figure out what the first word is. */
+ /* rewind stream so that we can save this blob */
+ /* length is driver_length + printer_length + 19 */
+ /* rewind stream */
+ s->p = s->p - 19;
+
+ printercache_save_blob(device_name, s->p,
+ driver_length + printer_length + 19);
+ break;
+ default:
+
+ unimpl("RDPDR Printer Cache Packet Type: %d\n", type);
+ break;
+ }
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifndef RDESKTOP_PROTO_H
+#define RDESKTOP_PROTO_H
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* *INDENT-ON* */
+/* bitmap.c */
+BOOL bitmap_decompress(uint8 * output, int width, int height, uint8 * input, int size, int Bpp);
+/* cache.c */
+void cache_rebuild_bmpcache_linked_list(RDPCLIENT * This, uint8 id, sint16 * idx, int count);
+void cache_bump_bitmap(RDPCLIENT * This, uint8 id, uint16 idx, int bump);
+void cache_evict_bitmap(RDPCLIENT * This, uint8 id);
+HBITMAP cache_get_bitmap(RDPCLIENT * This, uint8 id, uint16 idx);
+void cache_put_bitmap(RDPCLIENT * This, uint8 id, uint16 idx, HBITMAP bitmap);
+void cache_save_state(RDPCLIENT * This);
+FONTGLYPH *cache_get_font(RDPCLIENT * This, uint8 font, uint16 character);
+void cache_put_font(RDPCLIENT * This, uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width,
+ uint16 height, HGLYPH pixmap);
+DATABLOB *cache_get_text(RDPCLIENT * This, uint8 cache_id);
+void cache_put_text(RDPCLIENT * This, uint8 cache_id, void *data, int length);
+uint8 *cache_get_desktop(RDPCLIENT * This, uint32 offset, int cx, int cy, int bytes_per_pixel);
+void cache_put_desktop(RDPCLIENT * This, uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel,
+ uint8 * data);
+HCURSOR cache_get_cursor(RDPCLIENT * This, uint16 cache_idx);
+void cache_put_cursor(RDPCLIENT * This, uint16 cache_idx, HCURSOR cursor);
+/* channels.c */
+VCHANNEL *channel_register(RDPCLIENT * This, char *name, uint32 flags, void (*callback) (RDPCLIENT *, STREAM));
+STREAM channel_init(RDPCLIENT * This, VCHANNEL * channel, uint32 length);
+void channel_send(RDPCLIENT * This, STREAM s, VCHANNEL * channel);
+void channel_process(RDPCLIENT * This, STREAM s, uint16 mcs_channel);
+/* cliprdr.c */
+void cliprdr_send_simple_native_format_announce(RDPCLIENT * This, uint32 format);
+void cliprdr_send_native_format_announce(RDPCLIENT * This, uint8 * formats_data, uint32 formats_data_length);
+void cliprdr_send_data_request(RDPCLIENT * This, uint32 format);
+void cliprdr_send_data(RDPCLIENT * This, uint8 * data, uint32 length);
+void cliprdr_set_mode(RDPCLIENT * This, const char *optarg);
+BOOL cliprdr_init(RDPCLIENT * This);
+#if 0
+/* disk.c */
+int disk_enum_devices(RDPCLIENT * This, uint32 * id, char *optarg);
+NTSTATUS disk_query_information(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, STREAM out);
+NTSTATUS disk_set_information(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, STREAM in, STREAM out);
+NTSTATUS disk_check_notify(RDPCLIENT * This, NTHANDLE handle);
+NTSTATUS disk_create_notify(RDPCLIENT * This, NTHANDLE handle, uint32 info_class);
+NTSTATUS disk_query_volume_information(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, STREAM out);
+NTSTATUS disk_query_directory(RDPCLIENT * This, NTHANDLE handle, uint32 info_class, char *pattern, STREAM out);
+#endif
+/* mppc.c */
+int mppc_expand(RDPCLIENT * This, uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen);
+/* ewmhints.c */
+int get_current_workarea(RDPCLIENT * This, uint32 * x, uint32 * y, uint32 * width, uint32 * height);
+void ewmh_init(RDPCLIENT * This);
+/* iso.c */
+STREAM iso_init(RDPCLIENT * This, int length);
+BOOL iso_send(RDPCLIENT * This, STREAM s);
+STREAM iso_recv(RDPCLIENT * This, uint8 * rdpver);
+BOOL iso_connect(RDPCLIENT * This, char *server, char *cookie);
+BOOL iso_reconnect(RDPCLIENT * This, char *server, char *cookie);
+BOOL iso_disconnect(RDPCLIENT * This);
+void iso_reset_state(RDPCLIENT * This);
+/* licence.c */
+void licence_process(RDPCLIENT * This, STREAM s);
+/* mcs.c */
+STREAM mcs_init(RDPCLIENT * This, int length);
+BOOL mcs_send_to_channel(RDPCLIENT * This, STREAM s, uint16 channel);
+BOOL mcs_send(RDPCLIENT * This, STREAM s);
+STREAM mcs_recv(RDPCLIENT * This, uint16 * channel, uint8 * rdpver);
+BOOL mcs_connect(RDPCLIENT * This, char *server, char *cookie, STREAM mcs_data);
+BOOL mcs_reconnect(RDPCLIENT * This, char *server, char *cookie, STREAM mcs_data);
+void mcs_disconnect(RDPCLIENT * This);
+void mcs_reset_state(RDPCLIENT * This);
+/* orders.c */
+void process_orders(RDPCLIENT * This, STREAM s, uint16 num_orders);
+void reset_order_state(RDPCLIENT * This);
+/* parallel.c */
+int parallel_enum_devices(RDPCLIENT * This, uint32 * id, char *optarg);
+/* printer.c */
+int printer_enum_devices(RDPCLIENT * This, uint32 * id, char *optarg);
+/* printercache.c */
+int printercache_load_blob(char *printer_name, uint8 ** data);
+void printercache_process(RDPCLIENT * This, STREAM s);
+/* pstcache.c */
+void pstcache_touch_bitmap(RDPCLIENT * This, uint8 cache_id, uint16 cache_idx, uint32 stamp);
+BOOL pstcache_load_bitmap(RDPCLIENT * This, uint8 cache_id, uint16 cache_idx);
+BOOL pstcache_save_bitmap(RDPCLIENT * This, uint8 cache_id, uint16 cache_idx, uint8 * key, uint8 width, uint8 height,
+ uint16 length, uint8 * data);
+int pstcache_enumerate(RDPCLIENT * This, uint8 id, HASH_KEY * keylist);
+BOOL pstcache_init(RDPCLIENT * This, uint8 cache_id);
+/* rdesktop.c */
+int main(int argc, char *argv[]);
+void generate_random(uint8 * random);
+void error(char *format, ...);
+void warning(char *format, ...);
+void unimpl(char *format, ...);
+void hexdump(unsigned char *p, unsigned int len);
+char *next_arg(char *src, char needle);
+void toupper_str(char *p);
+BOOL str_startswith(const char *s, const char *prefix);
+BOOL str_handle_lines(RDPCLIENT * This, const char *input, char **rest, str_handle_lines_t linehandler, void *data);
+BOOL subprocess(RDPCLIENT * This, char *const argv[], str_handle_lines_t linehandler, void *data);
+char *l_to_a(long N, int base);
+int load_licence(RDPCLIENT * This, unsigned char **data);
+void save_licence(RDPCLIENT * This, unsigned char *data, int length);
+BOOL rd_pstcache_mkdir(void);
+int rd_open_file(char *filename);
+void rd_close_file(int fd);
+int rd_read_file(int fd, void *ptr, int len);
+int rd_write_file(int fd, void *ptr, int len);
+int rd_lseek_file(int fd, int offset);
+BOOL rd_lock_file(int fd, int start, int len);
+/* rdp5.c */
+BOOL rdp5_process(RDPCLIENT * This, STREAM s);
+/* rdp.c */
+void rdp_out_unistr(RDPCLIENT * This, STREAM s, wchar_t *string, int len);
+int rdp_in_unistr(RDPCLIENT * This, STREAM s, wchar_t *string, int uni_len);
+BOOL rdp_send_input(RDPCLIENT * This, uint32 time, uint16 message_type, uint16 device_flags, uint16 param1,
+ uint16 param2);
+BOOL rdp_send_client_window_status(RDPCLIENT * This, int status);
+void process_colour_pointer_pdu(RDPCLIENT * This, STREAM s);
+void process_cached_pointer_pdu(RDPCLIENT * This, STREAM s);
+void process_system_pointer_pdu(RDPCLIENT * This, STREAM s);
+void process_bitmap_updates(RDPCLIENT * This, STREAM s);
+void process_palette(RDPCLIENT * This, STREAM s);
+void process_disconnect_pdu(STREAM s, uint32 * ext_disc_reason);
+void rdp_main_loop(RDPCLIENT * This, BOOL * deactivated, uint32 * ext_disc_reason);
+BOOL rdp_loop(RDPCLIENT * This, BOOL * deactivated, uint32 * ext_disc_reason);
+BOOL rdp_connect(RDPCLIENT * This, char *server, uint32 flags, wchar_t *username, wchar_t *domain, wchar_t *password, wchar_t *command,
+ wchar_t *directory, wchar_t *hostname, char *cookie);
+BOOL rdp_reconnect(RDPCLIENT * This, char *server, uint32 flags, wchar_t *username, wchar_t *domain, wchar_t *password, wchar_t *command,
+ wchar_t *directory, wchar_t *hostname, char *cookie);
+void rdp_reset_state(RDPCLIENT * This);
+void rdp_disconnect(RDPCLIENT * This);
+#if 0
+/* rdpdr.c */
+int get_device_index(RDPCLIENT * This, NTHANDLE handle);
+void convert_to_unix_filename(char *filename);
+BOOL rdpdr_init(RDPCLIENT * This);
+void rdpdr_add_fds(RDPCLIENT * This, int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout);
+struct async_iorequest *rdpdr_remove_iorequest(RDPCLIENT * This, struct async_iorequest *prev,
+ struct async_iorequest *iorq);
+void rdpdr_check_fds(RDPCLIENT * This, fd_set * rfds, fd_set * wfds, BOOL timed_out);
+BOOL rdpdr_abort_io(RDPCLIENT * This, uint32 fd, uint32 major, NTSTATUS status);
+#endif
+#if 0
+/* rdpsnd.c */
+void rdpsnd_send_completion(RDPCLIENT * This, uint16 tick, uint8 packet_index);
+BOOL rdpsnd_init(RDPCLIENT * This);
+/* rdpsnd_oss.c */
+BOOL wave_out_open(void);
+void wave_out_close(void);
+BOOL wave_out_format_supported(WAVEFORMATEX * pwfx);
+BOOL wave_out_set_format(WAVEFORMATEX * pwfx);
+void wave_out_volume(uint16 left, uint16 right);
+void wave_out_write(STREAM s, uint16 tick, uint8 index);
+void wave_out_play(void);
+#endif
+/* secure.c */
+void sec_hash_48(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2, uint8 salt);
+void sec_hash_16(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2);
+void buf_out_uint32(uint8 * buffer, uint32 value);
+void sec_sign(uint8 * signature, int siglen, uint8 * session_key, int keylen, uint8 * data,
+ int datalen);
+void sec_decrypt(RDPCLIENT * This, uint8 * data, int length);
+STREAM sec_init(RDPCLIENT * This, uint32 flags, int maxlen);
+BOOL sec_send_to_channel(RDPCLIENT * This, STREAM s, uint32 flags, uint16 channel);
+BOOL sec_send(RDPCLIENT * This, STREAM s, uint32 flags);
+void sec_process_mcs_data(RDPCLIENT * This, STREAM s);
+STREAM sec_recv(RDPCLIENT * This, uint8 * rdpver);
+BOOL sec_connect(RDPCLIENT * This, char *server, wchar_t *hostname, char *cookie);
+BOOL sec_reconnect(RDPCLIENT * This, char *server, wchar_t *hostname, char *cookie);
+void sec_disconnect(RDPCLIENT * This);
+void sec_reset_state(RDPCLIENT * This);
+#if 0
+/* serial.c */
+int serial_enum_devices(RDPCLIENT * This, uint32 * id, char *optarg);
+BOOL serial_get_event(RDPCLIENT * This, NTHANDLE handle, uint32 * result);
+BOOL serial_get_timeout(RDPCLIENT * This, NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout);
+#endif
+/* tcp.c */
+STREAM tcp_init(RDPCLIENT * This, uint32 maxlen);
+BOOL tcp_send(RDPCLIENT * This, STREAM s);
+STREAM tcp_recv(RDPCLIENT * This, STREAM s, uint32 length);
+BOOL tcp_connect(RDPCLIENT * This, char *server);
+BOOL tcp_disconnect(RDPCLIENT * This);
+wchar_t *tcp_get_address(RDPCLIENT * This);
+void tcp_reset_state(RDPCLIENT * This);
+/* xclip.c */
+void ui_clip_format_announce(RDPCLIENT * This, uint8 * data, uint32 length);
+void ui_clip_handle_data(RDPCLIENT * This, uint8 * data, uint32 length);
+void ui_clip_request_failed(RDPCLIENT * This);
+void ui_clip_request_data(RDPCLIENT * This, uint32 format);
+void ui_clip_sync(RDPCLIENT * This);
+void ui_clip_set_mode(RDPCLIENT * This, const char *optarg);
+void xclip_init(RDPCLIENT * This);
+void xclip_deinit(RDPCLIENT * This);
+#if 0
+/* xkeymap.c */
+BOOL xkeymap_from_locale(RDPCLIENT * This, const char *locale);
+FILE *xkeymap_open(const char *filename);
+void xkeymap_init(RDPCLIENT * This);
+BOOL handle_special_keys(RDPCLIENT * This, uint32 keysym, unsigned int state, uint32 ev_time, BOOL pressed);
+key_translation xkeymap_translate_key(RDPCLIENT * This, uint32 keysym, unsigned int keycode, unsigned int state);
+void xkeymap_send_keys(RDPCLIENT * This, uint32 keysym, unsigned int keycode, unsigned int state, uint32 ev_time,
+ BOOL pressed, uint8 nesting);
+uint16 xkeymap_translate_button(unsigned int button);
+char *get_ksname(uint32 keysym);
+void save_remote_modifiers(RDPCLIENT * This, uint8 scancode);
+void restore_remote_modifiers(RDPCLIENT * This, uint32 ev_time, uint8 scancode);
+void ensure_remote_modifiers(RDPCLIENT * This, uint32 ev_time, key_translation tr);
+unsigned int read_keyboard_state(RDPCLIENT * This);
+uint16 ui_get_numlock_state(RDPCLIENT * This, unsigned int state);
+void reset_modifier_keys(RDPCLIENT * This);
+void rdp_send_scancode(RDPCLIENT * This, uint32 time, uint16 flags, uint8 scancode);
+#endif
+/* xwin.c */
+BOOL get_key_state(RDPCLIENT * This, unsigned int state, uint32 keysym);
+BOOL ui_init(RDPCLIENT * This);
+void ui_deinit(RDPCLIENT * This);
+BOOL ui_create_window(RDPCLIENT * This);
+void ui_resize_window(RDPCLIENT * This);
+void ui_destroy_window(RDPCLIENT * This);
+void xwin_toggle_fullscreen(RDPCLIENT * This);
+int ui_select(RDPCLIENT * This, SOCKET rdp_socket);
+void ui_move_pointer(RDPCLIENT * This, int x, int y);
+HBITMAP ui_create_bitmap(RDPCLIENT * This, int width, int height, uint8 * data);
+void ui_paint_bitmap(RDPCLIENT * This, int x, int y, int cx, int cy, int width, int height, uint8 * data);
+void ui_destroy_bitmap(RDPCLIENT * This, HBITMAP bmp);
+HGLYPH ui_create_glyph(RDPCLIENT * This, int width, int height, const uint8 * data);
+void ui_destroy_glyph(RDPCLIENT * This, HGLYPH glyph);
+HCURSOR ui_create_cursor(RDPCLIENT * This, unsigned int x, unsigned int y, int width, int height, uint8 * andmask,
+ uint8 * xormask);
+void ui_set_cursor(RDPCLIENT * This, HCURSOR cursor);
+void ui_destroy_cursor(RDPCLIENT * This, HCURSOR cursor);
+void ui_set_null_cursor(RDPCLIENT * This);
+HCOLOURMAP ui_create_colourmap(RDPCLIENT * This, COLOURMAP * colours);
+void ui_destroy_colourmap(RDPCLIENT * This, HCOLOURMAP map);
+void ui_set_colourmap(RDPCLIENT * This, HCOLOURMAP map);
+void ui_set_clip(RDPCLIENT * This, int x, int y, int cx, int cy);
+void ui_reset_clip(RDPCLIENT * This);
+void ui_bell(RDPCLIENT * This);
+void ui_destblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy);
+void ui_patblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy, BRUSH * brush, int bgcolour,
+ int fgcolour);
+void ui_screenblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy);
+void ui_memblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy);
+void ui_triblt(RDPCLIENT * This, uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy,
+ BRUSH * brush, int bgcolour, int fgcolour);
+void ui_line(RDPCLIENT * This, uint8 opcode, int startx, int starty, int endx, int endy, PEN * pen);
+void ui_rect(RDPCLIENT * This, int x, int y, int cx, int cy, int colour);
+void ui_polygon(RDPCLIENT * This, uint8 opcode, uint8 fillmode, POINT * point, int npoints, BRUSH * brush,
+ int bgcolour, int fgcolour);
+void ui_polyline(RDPCLIENT * This, uint8 opcode, POINT * points, int npoints, PEN * pen);
+void ui_ellipse(RDPCLIENT * This, uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH * brush,
+ int bgcolour, int fgcolour);
+void ui_draw_glyph(RDPCLIENT * This, int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy,
+ int bgcolour, int fgcolour);
+void ui_draw_text(RDPCLIENT * This, uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y, int clipx,
+ int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy,
+ BRUSH * brush, int bgcolour, int fgcolour, uint8 * text, uint8 length);
+void ui_desktop_save(RDPCLIENT * This, uint32 offset, int x, int y, int cx, int cy);
+void ui_desktop_restore(RDPCLIENT * This, uint32 offset, int x, int y, int cx, int cy);
+void ui_begin_update(RDPCLIENT * This);
+void ui_end_update(RDPCLIENT * This);
+void ui_seamless_begin(RDPCLIENT * This, BOOL hidden);
+void ui_seamless_hide_desktop(RDPCLIENT * This);
+void ui_seamless_unhide_desktop(RDPCLIENT * This);
+void ui_seamless_toggle(RDPCLIENT * This);
+void ui_seamless_create_window(RDPCLIENT * This, unsigned long id, unsigned long group, unsigned long parent,
+ unsigned long flags);
+void ui_seamless_destroy_window(RDPCLIENT * This, unsigned long id, unsigned long flags);
+void ui_seamless_destroy_group(RDPCLIENT * This, unsigned long id, unsigned long flags);
+void ui_seamless_move_window(RDPCLIENT * This, unsigned long id, int x, int y, int width, int height,
+ unsigned long flags);
+void ui_seamless_restack_window(RDPCLIENT * This, unsigned long id, unsigned long behind, unsigned long flags);
+void ui_seamless_settitle(RDPCLIENT * This, unsigned long id, const char *title, unsigned long flags);
+void ui_seamless_setstate(RDPCLIENT * This, unsigned long id, unsigned int state, unsigned long flags);
+void ui_seamless_syncbegin(RDPCLIENT * This, unsigned long flags);
+void ui_seamless_ack(RDPCLIENT * This, unsigned int serial);
+/* lspci.c */
+BOOL lspci_init(RDPCLIENT * This);
+/* seamless.c */
+BOOL seamless_init(RDPCLIENT * This);
+unsigned int seamless_send_sync(RDPCLIENT * This);
+unsigned int seamless_send_state(RDPCLIENT * This, unsigned long id, unsigned int state, unsigned long flags);
+unsigned int seamless_send_position(RDPCLIENT * This, unsigned long id, int x, int y, int width, int height,
+ unsigned long flags);
+void seamless_select_timeout(RDPCLIENT * This, struct timeval *tv);
+unsigned int seamless_send_zchange(RDPCLIENT * This, unsigned long id, unsigned long below, unsigned long flags);
+unsigned int seamless_send_focus(RDPCLIENT * This, unsigned long id, unsigned long flags);
+
+/* events */
+BOOL event_pubkey(RDPCLIENT * This, unsigned char * key, unsigned int key_size);
+void event_logon(RDPCLIENT * This);
+BOOL event_redirect(RDPCLIENT * This, uint32 flags, uint32 server_len, wchar_t * server, uint32 cookie_len, char * cookie, uint32 username_len, wchar_t * username, uint32 domain_len, wchar_t * domain, uint32 password_len, wchar_t * password);
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+}
+#endif
+/* *INDENT-ON* */
+
+#endif
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifndef RDESKTOP_PROTO_H
+#define RDESKTOP_PROTO_H
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* *INDENT-ON* */
--- /dev/null
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+}
+#endif
+/* *INDENT-ON* */
+
+#endif
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Persistent Bitmap Cache routines
+ Copyright (C) Jeroen Meijer 2004-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+#define MAX_CELL_SIZE 0x1000 /* pixels */
+
+#define IS_PERSISTENT(id) (id < 8 && This->pstcache_fd[id] > 0)
+
+const uint8 zero_key[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+
+/* Update mru stamp/index for a bitmap */
+void
+pstcache_touch_bitmap(RDPCLIENT * This, uint8 cache_id, uint16 cache_idx, uint32 stamp)
+{
+ int fd;
+
+ if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
+ return;
+
+ fd = This->pstcache_fd[cache_id];
+ rd_lseek_file(fd, 12 + cache_idx * (This->pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
+ rd_write_file(fd, &stamp, sizeof(stamp));
+}
+
+/* Load a bitmap from the persistent cache */
+BOOL
+pstcache_load_bitmap(RDPCLIENT * This, uint8 cache_id, uint16 cache_idx)
+{
+ uint8 *celldata;
+ int fd;
+ CELLHEADER cellhdr;
+ HBITMAP bitmap;
+
+ if (!This->bitmap_cache_persist_enable)
+ return False;
+
+ if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
+ return False;
+
+ fd = This->pstcache_fd[cache_id];
+ rd_lseek_file(fd, cache_idx * (This->pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
+ rd_read_file(fd, &cellhdr, sizeof(CELLHEADER));
+ celldata = (uint8 *) malloc(cellhdr.length);
+
+ if(celldata == NULL)
+ return False;
+
+ rd_read_file(fd, celldata, cellhdr.length);
+
+ bitmap = ui_create_bitmap(This, cellhdr.width, cellhdr.height, celldata);
+ DEBUG(("Load bitmap from disk: id=%d, idx=%d, bmp=0x%x)\n", cache_id, cache_idx, bitmap));
+ cache_put_bitmap(This, cache_id, cache_idx, bitmap);
+
+ free(celldata);
+ return True;
+}
+
+/* Store a bitmap in the persistent cache */
+BOOL
+pstcache_save_bitmap(RDPCLIENT * This, uint8 cache_id, uint16 cache_idx, uint8 * key,
+ uint8 width, uint8 height, uint16 length, uint8 * data)
+{
+ int fd;
+ CELLHEADER cellhdr;
+
+ if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
+ return False;
+
+ memcpy(cellhdr.key, key, sizeof(HASH_KEY));
+ cellhdr.width = width;
+ cellhdr.height = height;
+ cellhdr.length = length;
+ cellhdr.stamp = 0;
+
+ fd = This->pstcache_fd[cache_id];
+ rd_lseek_file(fd, cache_idx * (This->pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
+ rd_write_file(fd, &cellhdr, sizeof(CELLHEADER));
+ rd_write_file(fd, data, length);
+
+ return True;
+}
+
+/* List the bitmap keys from the persistent cache file */
+int
+pstcache_enumerate(RDPCLIENT * This, uint8 id, HASH_KEY * keylist)
+{
+ int fd, n;
+ uint16 idx;
+ sint16 mru_idx[0xa00];
+ uint32 mru_stamp[0xa00];
+ CELLHEADER cellhdr;
+
+ if (!(This->bitmap_cache && This->bitmap_cache_persist_enable && IS_PERSISTENT(id)))
+ return 0;
+
+ /* The server disconnects if the bitmap cache content is sent more than once */
+ if (This->pstcache_enumerated)
+ return 0;
+
+ DEBUG_RDP5(("Persistent bitmap cache enumeration... "));
+ for (idx = 0; idx < BMPCACHE2_NUM_PSTCELLS; idx++)
+ {
+ fd = This->pstcache_fd[id];
+ rd_lseek_file(fd, idx * (This->pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
+ if (rd_read_file(fd, &cellhdr, sizeof(CELLHEADER)) <= 0)
+ break;
+
+ if (memcmp(cellhdr.key, zero_key, sizeof(HASH_KEY)) != 0)
+ {
+ memcpy(keylist[idx], cellhdr.key, sizeof(HASH_KEY));
+
+ /* Pre-cache (not possible for 8 bit colour depth cause it needs a colourmap) */
+ if (This->bitmap_cache_precache && cellhdr.stamp && This->server_depth > 8)
+ pstcache_load_bitmap(This, id, idx);
+
+ /* Sort by stamp */
+ for (n = idx; n > 0 && cellhdr.stamp < mru_stamp[n - 1]; n--)
+ {
+ mru_idx[n] = mru_idx[n - 1];
+ mru_stamp[n] = mru_stamp[n - 1];
+ }
+
+ mru_idx[n] = idx;
+ mru_stamp[n] = cellhdr.stamp;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ DEBUG_RDP5(("%d cached bitmaps.\n", idx));
+
+ cache_rebuild_bmpcache_linked_list(This, id, mru_idx, idx);
+ This->pstcache_enumerated = True;
+ return idx;
+}
+
+/* initialise the persistent bitmap cache */
+BOOL
+pstcache_init(RDPCLIENT * This, uint8 cache_id)
+{
+ int fd;
+ char filename[256];
+
+ if (This->pstcache_enumerated)
+ return True;
+
+ This->pstcache_fd[cache_id] = 0;
+
+ if (!(This->bitmap_cache && This->bitmap_cache_persist_enable))
+ return False;
+
+ if (!rd_pstcache_mkdir())
+ {
+ DEBUG(("failed to get/make cache directory!\n"));
+ return False;
+ }
+
+ This->pstcache_Bpp = (This->server_depth + 7) / 8;
+ sprintf(filename, "cache/pstcache_%d_%d", cache_id, This->pstcache_Bpp);
+ DEBUG(("persistent bitmap cache file: %s\n", filename));
+
+ fd = rd_open_file(filename);
+ if (fd == -1)
+ return False;
+
+ if (!rd_lock_file(fd, 0, 0))
+ {
+ warning("Persistent bitmap caching is disabled. (The file is already in use)\n");
+ rd_close_file(fd);
+ return False;
+ }
+
+ This->pstcache_fd[cache_id] = fd;
+ return True;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="8,00"\r
+ Name="rdesktop-core"\r
+ ProjectGUID="{8620E9B2-9AF0-4F69-A5AF-C195D5F86372}"\r
+ Keyword="Win32Proj"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="Debug"\r
+ IntermediateDirectory="Debug"\r
+ ConfigurationType="4"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories=""C:\Documents and Settings\All Users\Documenti\openssl-0.9.8b\inc32""\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLibrarianTool"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="Release"\r
+ IntermediateDirectory="Release"\r
+ ConfigurationType="4"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalIncludeDirectories=""C:\Documents and Settings\All Users\Documenti\openssl-0.9.8b\inc32""\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLibrarianTool"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ <File\r
+ RelativePath=".\constants.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\disk.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\orders.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\parse.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\proto.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\rdesktop.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\scancodes.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\seamless.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\types.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\xproto.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+ >\r
+ </Filter>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath=".\bitmap.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\cache.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\iso.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\licence.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\mcs.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\mppc.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\orders.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\pstcache.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\rdp.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\rdp5.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\secure.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\tcp.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Entrypoint and utility functions
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include <stdarg.h> /* va_list va_start va_end */
+#include <unistd.h> /* read close getuid getgid getpid getppid gethostname */
+#include <fcntl.h> /* open */
+#include <pwd.h> /* getpwuid */
+#include <termios.h> /* tcgetattr tcsetattr */
+#include <sys/stat.h> /* stat */
+#include <sys/time.h> /* gettimeofday */
+#include <sys/times.h> /* times */
+#include <ctype.h> /* toupper */
+#include <errno.h>
+#include "rdesktop.h"
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+#ifdef HAVE_ICONV
+#ifdef HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
+#endif
+
+#ifdef EGD_SOCKET
+#include <sys/types.h>
+#include <sys/socket.h> /* socket connect */
+#include <sys/un.h> /* sockaddr_un */
+#endif
+
+#include <openssl/md5.h>
+
+#ifdef RDP2VNC
+void
+rdp2vnc_connect(char *server, uint32 flags, char *domain, char *password,
+ char *shell, char *directory);
+#endif
+/* Display usage information */
+static void
+usage(char *program)
+{
+ fprintf(stderr, "rdesktop: A Remote Desktop Protocol client.\n");
+ fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2005 Matt Chapman.\n");
+ fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
+
+ fprintf(stderr, "Usage: %s [options] server[:port]\n", program);
+#ifdef RDP2VNC
+ fprintf(stderr, " -V: vnc port\n");
+ fprintf(stderr, " -Q: defer time (ms)\n");
+#endif
+ fprintf(stderr, " -u: user name\n");
+ fprintf(stderr, " -d: domain\n");
+ fprintf(stderr, " -s: shell\n");
+ fprintf(stderr, " -c: working directory\n");
+ fprintf(stderr, " -p: password (- to prompt)\n");
+ fprintf(stderr, " -n: client hostname\n");
+ fprintf(stderr, " -k: keyboard layout on server (en-us, de, sv, etc.)\n");
+ fprintf(stderr, " -g: desktop geometry (WxH)\n");
+ fprintf(stderr, " -f: full-screen mode\n");
+ fprintf(stderr, " -b: force bitmap updates\n");
+#ifdef HAVE_ICONV
+ fprintf(stderr, " -L: local codepage\n");
+#endif
+ fprintf(stderr, " -A: enable SeamlessRDP mode\n");
+ fprintf(stderr, " -B: use BackingStore of X-server (if available)\n");
+ fprintf(stderr, " -e: disable encryption (French TS)\n");
+ fprintf(stderr, " -E: disable encryption from client to server\n");
+ fprintf(stderr, " -m: do not send motion events\n");
+ fprintf(stderr, " -C: use private colour map\n");
+ fprintf(stderr, " -D: hide window manager decorations\n");
+ fprintf(stderr, " -K: keep window manager key bindings\n");
+ fprintf(stderr, " -S: caption button size (single application mode)\n");
+ fprintf(stderr, " -T: window title\n");
+ fprintf(stderr, " -N: enable numlock syncronization\n");
+ fprintf(stderr, " -X: embed into another window with a given id.\n");
+ fprintf(stderr, " -a: connection colour depth\n");
+ fprintf(stderr, " -z: enable rdp compression\n");
+ fprintf(stderr, " -x: RDP5 experience (m[odem 28.8], b[roadband], l[an] or hex nr.)\n");
+ fprintf(stderr, " -P: use persistent bitmap caching\n");
+ fprintf(stderr, " -r: enable specified device redirection (this flag can be repeated)\n");
+ fprintf(stderr,
+ " '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n");
+ fprintf(stderr, " or COM1=/dev/ttyS0,COM2=/dev/ttyS1\n");
+ fprintf(stderr,
+ " '-r disk:floppy=/mnt/floppy': enable redirection of /mnt/floppy to 'floppy' share\n");
+ fprintf(stderr, " or 'floppy=/mnt/floppy,cdrom=/mnt/cdrom'\n");
+ fprintf(stderr, " '-r clientname=<client name>': Set the client name displayed\n");
+ fprintf(stderr, " for redirected disks\n");
+ fprintf(stderr,
+ " '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n");
+ fprintf(stderr, " or LPT1=/dev/lp0,LPT2=/dev/lp1\n");
+ fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n");
+ fprintf(stderr,
+ " or mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n");
+ fprintf(stderr, " '-r sound:[local|off|remote]': enable sound redirection\n");
+ fprintf(stderr, " remote would leave sound on server\n");
+ fprintf(stderr,
+ " '-r clipboard:[off|PRIMARYCLIPBOARD|CLIPBOARD]': enable clipboard\n");
+ fprintf(stderr, " redirection.\n");
+ fprintf(stderr,
+ " 'PRIMARYCLIPBOARD' looks at both PRIMARY and CLIPBOARD\n");
+ fprintf(stderr, " when sending data to server.\n");
+ fprintf(stderr, " 'CLIPBOARD' looks at only CLIPBOARD.\n");
+ fprintf(stderr, " -0: attach to console\n");
+ fprintf(stderr, " -4: use RDP version 4\n");
+ fprintf(stderr, " -5: use RDP version 5 (default)\n");
+}
+
+static void
+print_disconnect_reason(uint16 reason)
+{
+ char *text;
+
+ switch (reason)
+ {
+ case exDiscReasonNoInfo:
+ text = "No information available";
+ break;
+
+ case exDiscReasonAPIInitiatedDisconnect:
+ text = "Server initiated disconnect";
+ break;
+
+ case exDiscReasonAPIInitiatedLogoff:
+ text = "Server initiated logoff";
+ break;
+
+ case exDiscReasonServerIdleTimeout:
+ text = "Server idle timeout reached";
+ break;
+
+ case exDiscReasonServerLogonTimeout:
+ text = "Server logon timeout reached";
+ break;
+
+ case exDiscReasonReplacedByOtherConnection:
+ text = "The session was replaced";
+ break;
+
+ case exDiscReasonOutOfMemory:
+ text = "The server is out of memory";
+ break;
+
+ case exDiscReasonServerDeniedConnection:
+ text = "The server denied the connection";
+ break;
+
+ case exDiscReasonServerDeniedConnectionFips:
+ text = "The server denied the connection for security reason";
+ break;
+
+ case exDiscReasonLicenseInternal:
+ text = "Internal licensing error";
+ break;
+
+ case exDiscReasonLicenseNoLicenseServer:
+ text = "No license server available";
+ break;
+
+ case exDiscReasonLicenseNoLicense:
+ text = "No valid license available";
+ break;
+
+ case exDiscReasonLicenseErrClientMsg:
+ text = "Invalid licensing message";
+ break;
+
+ case exDiscReasonLicenseHwidDoesntMatchLicense:
+ text = "Hardware id doesn't match software license";
+ break;
+
+ case exDiscReasonLicenseErrClientLicense:
+ text = "Client license error";
+ break;
+
+ case exDiscReasonLicenseCantFinishProtocol:
+ text = "Network error during licensing protocol";
+ break;
+
+ case exDiscReasonLicenseClientEndedProtocol:
+ text = "Licensing protocol was not completed";
+ break;
+
+ case exDiscReasonLicenseErrClientEncryption:
+ text = "Incorrect client license enryption";
+ break;
+
+ case exDiscReasonLicenseCantUpgradeLicense:
+ text = "Can't upgrade license";
+ break;
+
+ case exDiscReasonLicenseNoRemoteConnections:
+ text = "The server is not licensed to accept remote connections";
+ break;
+
+ default:
+ if (reason > 0x1000 && reason < 0x7fff)
+ {
+ text = "Internal protocol error";
+ }
+ else
+ {
+ text = "Unknown reason";
+ }
+ }
+ fprintf(stderr, "disconnect: %s.\n", text);
+}
+
+static void
+rdesktop_reset_state(RDPCLIENT * This)
+{
+ rdp_reset_state(This);
+}
+
+static BOOL
+read_password(char *password, int size)
+{
+ struct termios tios;
+ BOOL ret = False;
+ int istty = 0;
+ char *p;
+
+ if (tcgetattr(STDIN_FILENO, &tios) == 0)
+ {
+ fprintf(stderr, "Password: ");
+ tios.c_lflag &= ~ECHO;
+ tcsetattr(STDIN_FILENO, TCSANOW, &tios);
+ istty = 1;
+ }
+
+ if (fgets(password, size, stdin) != NULL)
+ {
+ ret = True;
+
+ /* strip final newline */
+ p = strchr(password, '\n');
+ if (p != NULL)
+ *p = 0;
+ }
+
+ if (istty)
+ {
+ tios.c_lflag |= ECHO;
+ tcsetattr(STDIN_FILENO, TCSANOW, &tios);
+ fprintf(stderr, "\n");
+ }
+
+ return ret;
+}
+
+static void
+parse_server_and_port(RDPCLIENT * This, char *server)
+{
+ char *p;
+#ifdef IPv6
+ int addr_colons;
+#endif
+
+#ifdef IPv6
+ p = server;
+ addr_colons = 0;
+ while (*p)
+ if (*p++ == ':')
+ addr_colons++;
+ if (addr_colons >= 2)
+ {
+ /* numeric IPv6 style address format - [1:2:3::4]:port */
+ p = strchr(server, ']');
+ if (*server == '[' && p != NULL)
+ {
+ if (*(p + 1) == ':' && *(p + 2) != '\0')
+ This->tcp_port_rdp = strtol(p + 2, NULL, 10);
+ /* remove the port number and brackets from the address */
+ *p = '\0';
+ strncpy(server, server + 1, strlen(server));
+ }
+ }
+ else
+ {
+ /* dns name or IPv4 style address format - server.example.com:port or 1.2.3.4:port */
+ p = strchr(server, ':');
+ if (p != NULL)
+ {
+ This->tcp_port_rdp = strtol(p + 1, NULL, 10);
+ *p = 0;
+ }
+ }
+#else /* no IPv6 support */
+ p = strchr(server, ':');
+ if (p != NULL)
+ {
+ This->tcp_port_rdp = strtol(p + 1, NULL, 10);
+ *p = 0;
+ }
+#endif /* IPv6 */
+
+}
+
+/* Client program */
+int
+main(int argc, char *argv[])
+{
+ char server[64];
+ char fullhostname[64];
+ char domain[16];
+ char password[64];
+ char shell[256];
+ char directory[256];
+ BOOL prompt_password, deactivated;
+ struct passwd *pw;
+ uint32 flags, ext_disc_reason = 0;
+ char *p;
+ int c;
+ char *locale = NULL;
+ int username_option = 0;
+ BOOL geometry_option = False;
+ int run_count = 0; /* Session Directory support */
+ BOOL continue_connect = True; /* Session Directory support */
+ RDPCLIENT * This;
+
+ This = xmalloc(sizeof(RDPCLIENT));
+ memset(This, 0, sizeof(RDPCLIENT));
+
+ This->keylayout = 0x409; /* Defaults to US keyboard layout */
+ This->keyboard_type = 0x4; /* Defaults to US keyboard layout */
+ This->keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
+ This->keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */
+ This->width = 800; /* width is special: If 0, the
+ geometry will be fetched from
+ _NET_WORKAREA. If negative,
+ absolute value specifies the
+ percent of the whole screen. */
+ This->height = 600;
+ This->server_depth = -1;
+ This->bitmap_compression = True;
+ This->sendmotion = True;
+ This->bitmap_cache = True;
+ This->bitmap_cache_persist_enable = False;
+ This->bitmap_cache_precache = True;
+ This->encryption = True;
+ This->packet_encryption = True;
+ This->desktop_save = True; /* desktop save order */
+ This->polygon_ellipse_orders = True; /* polygon / ellipse orders */
+ This->fullscreen = False;
+ This->grab_keyboard = True;
+ This->hide_decorations = False;
+ This->use_rdp5 = True;
+ This->rdpclip = True;
+ This->console_session = False;
+ This->numlock_sync = False;
+ This->lspci_enabled = False;
+ This->owncolmap = False;
+ This->ownbackstore = True; /* We can't rely on external BackingStore */
+ This->seamless_rdp = False;
+ This->rdp5_performanceflags = RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | RDP5_NO_MENUANIMATIONS;
+ This->tcp_port_rdp = TCP_PORT_RDP;
+
+#define NOT_SET -1
+ This->cache.bmpcache_lru[0] = NOT_SET;
+ This->cache.bmpcache_lru[1] = NOT_SET;
+ This->cache.bmpcache_lru[2] = NOT_SET;
+ This->cache.bmpcache_mru[0] = NOT_SET;
+ This->cache.bmpcache_mru[1] = NOT_SET;
+ This->cache.bmpcache_mru[2] = NOT_SET;
+
+#ifdef HAVE_ICONV
+ This->rdp.iconv_works = True;
+#endif
+
+ This->xclip.auto_mode = True;
+
+#ifdef HAVE_LOCALE_H
+ /* Set locale according to environment */
+ locale = setlocale(LC_ALL, "");
+ if (locale)
+ {
+ locale = xstrdup(locale);
+ }
+
+#endif
+ flags = RDP_LOGON_NORMAL;
+ prompt_password = False;
+ domain[0] = password[0] = shell[0] = directory[0] = 0;
+ This->embed_wnd = 0;
+
+ This->num_devices = 0;
+
+#ifdef RDP2VNC
+#define VNCOPT "V:Q:"
+#else
+#define VNCOPT
+#endif
+
+ while ((c = getopt(argc, argv,
+ VNCOPT "Au:L:d:s:c:p:n:k:g:fbBeEmzCDKS:T:NX:a:x:Pr:045h?")) != -1)
+ {
+ switch (c)
+ {
+#ifdef RDP2VNC
+ case 'V':
+ This->rfb_port = strtol(optarg, NULL, 10);
+ if (This->rfb_port < 100)
+ This->rfb_port += 5900;
+ break;
+
+ case 'Q':
+ This->defer_time = strtol(optarg, NULL, 10);
+ if (This->defer_time < 0)
+ This->defer_time = 0;
+ break;
+#endif
+
+ case 'A':
+ This->seamless_rdp = True;
+ break;
+
+ case 'u':
+ STRNCPY(This->username, optarg, sizeof(This->username));
+ username_option = 1;
+ break;
+
+ case 'L':
+#ifdef HAVE_ICONV
+ STRNCPY(This->codepage, optarg, sizeof(This->codepage));
+#else
+ error("iconv support not available\n");
+#endif
+ break;
+
+ case 'd':
+ STRNCPY(domain, optarg, sizeof(domain));
+ break;
+
+ case 's':
+ STRNCPY(shell, optarg, sizeof(shell));
+ break;
+
+ case 'c':
+ STRNCPY(directory, optarg, sizeof(directory));
+ break;
+
+ case 'p':
+ if ((optarg[0] == '-') && (optarg[1] == 0))
+ {
+ prompt_password = True;
+ break;
+ }
+
+ STRNCPY(password, optarg, sizeof(password));
+ flags |= RDP_LOGON_AUTO;
+
+ /* try to overwrite argument so it won't appear in ps */
+ p = optarg;
+ while (*p)
+ *(p++) = 'X';
+ break;
+
+ case 'n':
+ STRNCPY(This->hostname, optarg, sizeof(This->hostname));
+ break;
+
+ case 'k':
+ STRNCPY(This->keymapname, optarg, sizeof(This->keymapname));
+ break;
+
+ case 'g':
+ geometry_option = True;
+ This->fullscreen = False;
+ if (!strcmp(optarg, "workarea"))
+ {
+ This->width = This->height = 0;
+ break;
+ }
+
+ This->width = strtol(optarg, &p, 10);
+ if (This->width <= 0)
+ {
+ error("invalid geometry\n");
+ return 1;
+ }
+
+ if (*p == 'x')
+ This->height = strtol(p + 1, &p, 10);
+
+ if (This->height <= 0)
+ {
+ error("invalid geometry\n");
+ return 1;
+ }
+
+ if (*p == '%')
+ {
+ This->width = -This->width;
+ p++;
+ }
+
+ if (*p == '+' || *p == '-')
+ {
+ This->pos |= (*p == '-') ? 2 : 1;
+ This->xpos = strtol(p, &p, 10);
+
+ }
+ if (*p == '+' || *p == '-')
+ {
+ This->pos |= (*p == '-') ? 4 : 1;
+ This->ypos = strtol(p, NULL, 10);
+ }
+
+ break;
+
+ case 'f':
+ This->fullscreen = True;
+ break;
+
+ case 'b':
+ This->bitmap_cache = False;
+ break;
+
+ case 'B':
+ This->ownbackstore = False;
+ break;
+
+ case 'e':
+ This->encryption = False;
+ break;
+ case 'E':
+ This->packet_encryption = False;
+ break;
+ case 'm':
+ This->sendmotion = False;
+ break;
+
+ case 'C':
+ This->owncolmap = True;
+ break;
+
+ case 'D':
+ This->hide_decorations = True;
+ break;
+
+ case 'K':
+ This->grab_keyboard = False;
+ break;
+
+ case 'S':
+ if (!strcmp(optarg, "standard"))
+ {
+ This->win_button_size = 18;
+ break;
+ }
+
+ This->win_button_size = strtol(optarg, &p, 10);
+
+ if (*p)
+ {
+ error("invalid button size\n");
+ return 1;
+ }
+
+ break;
+
+ case 'T':
+ STRNCPY(This->title, optarg, sizeof(This->title));
+ break;
+
+ case 'N':
+ This->numlock_sync = True;
+ break;
+
+ case 'X':
+ This->embed_wnd = strtol(optarg, NULL, 0);
+ break;
+
+ case 'a':
+ This->server_depth = strtol(optarg, NULL, 10);
+ if (This->server_depth != 8 &&
+ This->server_depth != 16 &&
+ This->server_depth != 15 && This->server_depth != 24)
+ {
+ error("Invalid server colour depth.\n");
+ return 1;
+ }
+ break;
+
+ case 'z':
+ DEBUG(("rdp compression enabled\n"));
+ flags |= (RDP_LOGON_COMPRESSION | RDP_LOGON_COMPRESSION2);
+ break;
+
+ case 'x':
+ if (str_startswith(optarg, "m")) /* modem */
+ {
+ This->rdp5_performanceflags =
+ RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG |
+ RDP5_NO_MENUANIMATIONS | RDP5_NO_THEMING;
+ }
+ else if (str_startswith(optarg, "b")) /* broadband */
+ {
+ This->rdp5_performanceflags = RDP5_NO_WALLPAPER;
+ }
+ else if (str_startswith(optarg, "l")) /* lan */
+ {
+ This->rdp5_performanceflags = RDP5_DISABLE_NOTHING;
+ }
+ else
+ {
+ This->rdp5_performanceflags = strtol(optarg, NULL, 16);
+ }
+ break;
+
+ case 'P':
+ This->bitmap_cache_persist_enable = True;
+ break;
+
+ case 'r':
+
+ if (str_startswith(optarg, "sound"))
+ {
+ optarg += 5;
+
+ if (*optarg == ':')
+ {
+ optarg++;
+ while ((p = next_arg(optarg, ',')))
+ {
+ if (str_startswith(optarg, "remote"))
+ flags |= RDP_LOGON_LEAVE_AUDIO;
+
+ if (str_startswith(optarg, "local"))
+#ifdef WITH_RDPSND
+ This->rdpsnd_enabled = True;
+#else
+ warning("Not compiled with sound support\n");
+#endif
+
+ if (str_startswith(optarg, "off"))
+#ifdef WITH_RDPSND
+ This->rdpsnd_enabled = False;
+#else
+ warning("Not compiled with sound support\n");
+#endif
+
+ optarg = p;
+ }
+ }
+ else
+ {
+#ifdef WITH_RDPSND
+ This->rdpsnd_enabled = True;
+#else
+ warning("Not compiled with sound support\n");
+#endif
+ }
+ }
+ else if (str_startswith(optarg, "disk"))
+ {
+ /* -r disk:h:=/mnt/floppy */
+ disk_enum_devices(This, &This->num_devices, optarg + 4);
+ }
+ else if (str_startswith(optarg, "comport"))
+ {
+ serial_enum_devices(This, &This->num_devices, optarg + 7);
+ }
+ else if (str_startswith(optarg, "lspci"))
+ {
+ This->lspci_enabled = True;
+ }
+ else if (str_startswith(optarg, "lptport"))
+ {
+ parallel_enum_devices(This, &This->num_devices, optarg + 7);
+ }
+ else if (str_startswith(optarg, "printer"))
+ {
+ printer_enum_devices(This, &This->num_devices, optarg + 7);
+ }
+ else if (str_startswith(optarg, "clientname"))
+ {
+ This->rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1);
+ strcpy(This->rdpdr_clientname, optarg + 11);
+ }
+ else if (str_startswith(optarg, "clipboard"))
+ {
+ optarg += 9;
+
+ if (*optarg == ':')
+ {
+ optarg++;
+
+ if (str_startswith(optarg, "off"))
+ This->rdpclip = False;
+ else
+ cliprdr_set_mode(This, optarg);
+ }
+ else
+ This->rdpclip = True;
+ }
+ else
+ {
+ warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound, clipboard\n");
+ }
+ break;
+
+ case '0':
+ This->console_session = True;
+ break;
+
+ case '4':
+ This->use_rdp5 = False;
+ break;
+
+ case '5':
+ This->use_rdp5 = True;
+ break;
+
+ case 'h':
+ case '?':
+ default:
+ usage(argv[0]);
+ return 1;
+ }
+ }
+
+ if (argc - optind != 1)
+ {
+ usage(argv[0]);
+ return 1;
+ }
+
+ STRNCPY(server, argv[optind], sizeof(server));
+ parse_server_and_port(This, server);
+
+ if (This->seamless_rdp)
+ {
+ if (This->win_button_size)
+ {
+ error("You cannot use -S and -A at the same time\n");
+ return 1;
+ }
+ This->rdp5_performanceflags &= ~RDP5_NO_FULLWINDOWDRAG;
+ if (geometry_option)
+ {
+ error("You cannot use -g and -A at the same time\n");
+ return 1;
+ }
+ if (This->fullscreen)
+ {
+ error("You cannot use -f and -A at the same time\n");
+ return 1;
+ }
+ if (This->hide_decorations)
+ {
+ error("You cannot use -D and -A at the same time\n");
+ return 1;
+ }
+ if (This->embed_wnd)
+ {
+ error("You cannot use -X and -A at the same time\n");
+ return 1;
+ }
+ if (!This->use_rdp5)
+ {
+ error("You cannot use -4 and -A at the same time\n");
+ return 1;
+ }
+ This->width = -100;
+ This->grab_keyboard = False;
+ }
+
+ if (!username_option)
+ {
+ pw = getpwuid(getuid());
+ if ((pw == NULL) || (pw->pw_name == NULL))
+ {
+ error("could not determine username, use -u\n");
+ return 1;
+ }
+
+ STRNCPY(This->username, pw->pw_name, sizeof(This->username));
+ }
+
+#ifdef HAVE_ICONV
+ if (This->codepage[0] == 0)
+ {
+ if (setlocale(LC_CTYPE, ""))
+ {
+ STRNCPY(This->codepage, nl_langinfo(CODESET), sizeof(This->codepage));
+ }
+ else
+ {
+ STRNCPY(This->codepage, DEFAULT_CODEPAGE, sizeof(This->codepage));
+ }
+ }
+#endif
+
+ if (This->hostname[0] == 0)
+ {
+ if (gethostname(fullhostname, sizeof(fullhostname)) == -1)
+ {
+ error("could not determine local hostname, use -n\n");
+ return 1;
+ }
+
+ p = strchr(fullhostname, '.');
+ if (p != NULL)
+ *p = 0;
+
+ STRNCPY(This->hostname, fullhostname, sizeof(This->hostname));
+ }
+
+ if (This->keymapname[0] == 0)
+ {
+ if (locale && xkeymap_from_locale(This, locale))
+ {
+ fprintf(stderr, "Autoselected keyboard map %s\n", This->keymapname);
+ }
+ else
+ {
+ STRNCPY(This->keymapname, "en-us", sizeof(This->keymapname));
+ }
+ }
+ if (locale)
+ xfree(locale);
+
+
+ if (prompt_password && read_password(password, sizeof(password)))
+ flags |= RDP_LOGON_AUTO;
+
+ if (This->title[0] == 0)
+ {
+ strcpy(This->title, "rdesktop - ");
+ strncat(This->title, server, sizeof(This->title) - sizeof("rdesktop - "));
+ }
+
+#ifdef RDP2VNC
+ rdp2vnc_connect(server, flags, domain, password, shell, directory);
+ return 0;
+#else
+
+ if (!ui_init(This))
+ return 1;
+
+#ifdef WITH_RDPSND
+ if (This->rdpsnd_enabled)
+ rdpsnd_init(This);
+#endif
+
+ if (This->lspci_enabled)
+ lspci_init(This);
+
+ rdpdr_init(This);
+
+ while (run_count < 2 && continue_connect) /* add support for Session Directory; only reconnect once */
+ {
+ if (run_count == 0)
+ {
+ if (!rdp_connect(This, server, flags, domain, password, shell, directory))
+ return 1;
+ }
+ else if (!rdp_reconnect
+ (This, server, flags, domain, password, shell, directory, This->redirect_cookie))
+ return 1;
+
+ /* By setting encryption to False here, we have an encrypted login
+ packet but unencrypted transfer of other packets */
+ if (!This->packet_encryption)
+ This->encryption = False;
+
+
+ DEBUG(("Connection successful.\n"));
+ memset(password, 0, sizeof(password));
+
+ if (run_count == 0)
+ if (!ui_create_window(This))
+ continue_connect = False;
+
+ if (continue_connect)
+ rdp_main_loop(This, &deactivated, &ext_disc_reason);
+
+ DEBUG(("Disconnecting...\n"));
+ rdp_disconnect(This);
+
+ if ((This->redirect == True) && (run_count == 0)) /* Support for Session Directory */
+ {
+ /* reset state of major globals */
+ rdesktop_reset_state(This);
+
+ STRNCPY(domain, This->redirect_domain, sizeof(domain));
+ STRNCPY(This->username, This->redirect_username, sizeof(This->username));
+ STRNCPY(password, This->redirect_password, sizeof(password));
+ STRNCPY(server, This->redirect_server, sizeof(server));
+ flags |= RDP_LOGON_AUTO;
+
+ This->redirect = False;
+ }
+ else
+ {
+ continue_connect = False;
+ ui_destroy_window(This);
+ break;
+ }
+
+ run_count++;
+ }
+
+ cache_save_state(This);
+ ui_deinit(This);
+
+ if (ext_disc_reason >= 2)
+ print_disconnect_reason(ext_disc_reason);
+
+ if (deactivated)
+ {
+ /* clean disconnect */
+ return 0;
+ }
+ else
+ {
+ if (ext_disc_reason == exDiscReasonAPIInitiatedDisconnect
+ || ext_disc_reason == exDiscReasonAPIInitiatedLogoff)
+ {
+ /* not so clean disconnect, but nothing to worry about */
+ return 0;
+ }
+ else
+ {
+ /* return error */
+ return 2;
+ }
+ }
+
+#endif
+
+}
+
+#ifdef EGD_SOCKET
+/* Read 32 random bytes from PRNGD or EGD socket (based on OpenSSL RAND_egd) */
+static BOOL
+generate_random_egd(uint8 * buf)
+{
+ struct sockaddr_un addr;
+ BOOL ret = False;
+ int fd;
+
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd == -1)
+ return False;
+
+ addr.sun_family = AF_UNIX;
+ memcpy(addr.sun_path, EGD_SOCKET, sizeof(EGD_SOCKET));
+ if (connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1)
+ goto err;
+
+ /* PRNGD and EGD use a simple communications protocol */
+ buf[0] = 1; /* Non-blocking (similar to /dev/urandom) */
+ buf[1] = 32; /* Number of requested random bytes */
+ if (write(fd, buf, 2) != 2)
+ goto err;
+
+ if ((read(fd, buf, 1) != 1) || (buf[0] == 0)) /* Available? */
+ goto err;
+
+ if (read(fd, buf, 32) != 32)
+ goto err;
+
+ ret = True;
+
+ err:
+ close(fd);
+ return ret;
+}
+#endif
+
+/* Generate a 32-byte random for the secure transport code. */
+void
+generate_random(uint8 * random)
+{
+ struct stat st;
+ struct tms tmsbuf;
+ MD5_CTX md5;
+ uint32 *r;
+ int fd, n;
+
+ /* If we have a kernel random device, try that first */
+ if (((fd = open("/dev/urandom", O_RDONLY)) != -1)
+ || ((fd = open("/dev/random", O_RDONLY)) != -1))
+ {
+ n = read(fd, random, 32);
+ close(fd);
+ if (n == 32)
+ return;
+ }
+
+#ifdef EGD_SOCKET
+ /* As a second preference use an EGD */
+ if (generate_random_egd(random))
+ return;
+#endif
+
+ /* Otherwise use whatever entropy we can gather - ideas welcome. */
+ r = (uint32 *) random;
+ r[0] = (getpid()) | (getppid() << 16);
+ r[1] = (getuid()) | (getgid() << 16);
+ r[2] = times(&tmsbuf); /* system uptime (clocks) */
+ gettimeofday((struct timeval *) &r[3], NULL); /* sec and usec */
+ stat("/tmp", &st);
+ r[5] = st.st_atime;
+ r[6] = st.st_mtime;
+ r[7] = st.st_ctime;
+
+ /* Hash both halves with MD5 to obscure possible patterns */
+ MD5_Init(&md5);
+ MD5_Update(&md5, random, 16);
+ MD5_Final(random, &md5);
+ MD5_Update(&md5, random + 16, 16);
+ MD5_Final(random + 16, &md5);
+}
+
+/* malloc; exit if out of memory */
+void *
+xmalloc(int size)
+{
+ void *mem = malloc(size);
+ if (mem == NULL)
+ {
+ error("xmalloc %d\n", size);
+ exit(1);
+ }
+ return mem;
+}
+
+/* strdup */
+char *
+xstrdup(const char *s)
+{
+ char *mem = strdup(s);
+ if (mem == NULL)
+ {
+ perror("strdup");
+ exit(1);
+ }
+ return mem;
+}
+
+/* realloc; exit if out of memory */
+void *
+xrealloc(void *oldmem, int size)
+{
+ void *mem;
+
+ if (size < 1)
+ size = 1;
+ mem = realloc(oldmem, size);
+ if (mem == NULL)
+ {
+ error("xrealloc %d\n", size);
+ exit(1);
+ }
+ return mem;
+}
+
+/* free */
+void
+xfree(void *mem)
+{
+ free(mem);
+}
+
+/* report an error */
+void
+error(char *format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "ERROR: ");
+
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/* report a warning */
+void
+warning(char *format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "WARNING: ");
+
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/* report an unimplemented protocol feature */
+void
+unimpl(char *format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "NOT IMPLEMENTED: ");
+
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/* produce a hex dump */
+void
+hexdump(unsigned char *p, unsigned int len)
+{
+ unsigned char *line = p;
+ int i, thisline, offset = 0;
+
+ while (offset < len)
+ {
+ printf("%04x ", offset);
+ thisline = len - offset;
+ if (thisline > 16)
+ thisline = 16;
+
+ for (i = 0; i < thisline; i++)
+ printf("%02x ", line[i]);
+
+ for (; i < 16; i++)
+ printf(" ");
+
+ for (i = 0; i < thisline; i++)
+ printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');
+
+ printf("\n");
+ offset += thisline;
+ line += thisline;
+ }
+}
+
+/*
+ input: src is the string we look in for needle.
+ Needle may be escaped by a backslash, in
+ that case we ignore that particular needle.
+ return value: returns next src pointer, for
+ succesive executions, like in a while loop
+ if retval is 0, then there are no more args.
+ pitfalls:
+ src is modified. 0x00 chars are inserted to
+ terminate strings.
+ return val, points on the next val chr after ins
+ 0x00
+
+ example usage:
+ while( (pos = next_arg( optarg, ',')) ){
+ printf("%s\n",optarg);
+ optarg=pos;
+ }
+
+*/
+char *
+next_arg(char *src, char needle)
+{
+ char *nextval;
+ char *p;
+ char *mvp = 0;
+
+ /* EOS */
+ if (*src == (char) 0x00)
+ return 0;
+
+ p = src;
+ /* skip escaped needles */
+ while ((nextval = strchr(p, needle)))
+ {
+ mvp = nextval - 1;
+ /* found backslashed needle */
+ if (*mvp == '\\' && (mvp > src))
+ {
+ /* move string one to the left */
+ while (*(mvp + 1) != (char) 0x00)
+ {
+ *mvp = *(mvp + 1);
+ mvp++;
+ }
+ *mvp = (char) 0x00;
+ p = nextval;
+ }
+ else
+ {
+ p = nextval + 1;
+ break;
+ }
+
+ }
+
+ /* more args available */
+ if (nextval)
+ {
+ *nextval = (char) 0x00;
+ return ++nextval;
+ }
+
+ /* no more args after this, jump to EOS */
+ nextval = src + strlen(src);
+ return nextval;
+}
+
+
+void
+toupper_str(char *p)
+{
+ while (*p)
+ {
+ if ((*p >= 'a') && (*p <= 'z'))
+ *p = toupper((int) *p);
+ p++;
+ }
+}
+
+
+BOOL
+str_startswith(const char *s, const char *prefix)
+{
+ return (strncmp(s, prefix, strlen(prefix)) == 0);
+}
+
+
+/* Split input into lines, and call linehandler for each
+ line. Incomplete lines are saved in the rest variable, which should
+ initially point to NULL. When linehandler returns False, stop and
+ return False. Otherwise, return True. */
+BOOL
+str_handle_lines(RDPCLIENT * This, const char *input, char **rest, str_handle_lines_t linehandler, void *data)
+{
+ char *buf, *p;
+ char *oldrest;
+ size_t inputlen;
+ size_t buflen;
+ size_t restlen = 0;
+ BOOL ret = True;
+
+ /* Copy data to buffer */
+ inputlen = strlen(input);
+ if (*rest)
+ restlen = strlen(*rest);
+ buflen = restlen + inputlen + 1;
+ buf = (char *) xmalloc(buflen);
+ buf[0] = '\0';
+ if (*rest)
+ STRNCPY(buf, *rest, buflen);
+ strncat(buf, input, inputlen);
+ p = buf;
+
+ while (1)
+ {
+ char *newline = strchr(p, '\n');
+ if (newline)
+ {
+ *newline = '\0';
+ if (!linehandler(This, p, data))
+ {
+ p = newline + 1;
+ ret = False;
+ break;
+ }
+ p = newline + 1;
+ }
+ else
+ {
+ break;
+
+ }
+ }
+
+ /* Save in rest */
+ oldrest = *rest;
+ restlen = buf + buflen - p;
+ *rest = (char *) xmalloc(restlen);
+ STRNCPY((*rest), p, restlen);
+ xfree(oldrest);
+
+ xfree(buf);
+ return ret;
+}
+
+/* Execute the program specified by argv. For each line in
+ stdout/stderr output, call linehandler. Returns false on failure. */
+BOOL
+subprocess(RDPCLIENT * This, char *const argv[], str_handle_lines_t linehandler, void *data)
+{
+ pid_t child;
+ int fd[2];
+ int n = 1;
+ char output[256];
+ char *rest = NULL;
+
+ if (pipe(fd) < 0)
+ {
+ perror("pipe");
+ return False;
+ }
+
+ if ((child = fork()) < 0)
+ {
+ perror("fork");
+ return False;
+ }
+
+ /* Child */
+ if (child == 0)
+ {
+ /* Close read end */
+ close(fd[0]);
+
+ /* Redirect stdout and stderr to pipe */
+ dup2(fd[1], 1);
+ dup2(fd[1], 2);
+
+ /* Execute */
+ execvp(argv[0], argv);
+ perror("Error executing child");
+ _exit(128);
+ }
+
+ /* Parent. Close write end. */
+ close(fd[1]);
+ while (n > 0)
+ {
+ n = read(fd[0], output, 255);
+ output[n] = '\0';
+ str_handle_lines(This, output, &rest, linehandler, data);
+ }
+ xfree(rest);
+
+ return True;
+}
+
+
+/* not all clibs got ltoa */
+#define LTOA_BUFSIZE (sizeof(long) * 8 + 1)
+
+char *
+l_to_a(long N, int base)
+{
+ static char ret[LTOA_BUFSIZE];
+
+ char *head = ret, buf[LTOA_BUFSIZE], *tail = buf + sizeof(buf);
+
+ register int divrem;
+
+ if (base < 36 || 2 > base)
+ base = 10;
+
+ if (N < 0)
+ {
+ *head++ = '-';
+ N = -N;
+ }
+
+ tail = buf + sizeof(buf);
+ *--tail = 0;
+
+ do
+ {
+ divrem = N % base;
+ *--tail = (divrem <= 9) ? divrem + '0' : divrem + 'a' - 10;
+ N /= base;
+ }
+ while (N);
+
+ strcpy(head, tail);
+ return ret;
+}
+
+
+int
+load_licence(RDPCLIENT * This, unsigned char **data)
+{
+ char *home, *path;
+ struct stat st;
+ int fd, length;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ return -1;
+
+ path = (char *) xmalloc(strlen(home) + strlen(This->hostname) + sizeof("/.rdesktop/licence."));
+ sprintf(path, "%s/.rdesktop/licence.%s", home, This->hostname);
+
+ fd = open(path, O_RDONLY);
+ if (fd == -1)
+ return -1;
+
+ if (fstat(fd, &st))
+ {
+ close(fd);
+ return -1;
+ }
+
+ *data = (uint8 *) xmalloc(st.st_size);
+ length = read(fd, *data, st.st_size);
+ close(fd);
+ xfree(path);
+ return length;
+}
+
+void
+save_licence(RDPCLIENT * This, unsigned char *data, int length)
+{
+ char *home, *path, *tmppath;
+ int fd;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ return;
+
+ path = (char *) xmalloc(strlen(home) + strlen(This->hostname) + sizeof("/.rdesktop/licence."));
+
+ sprintf(path, "%s/.rdesktop", home);
+ if ((mkdir(path, 0700) == -1) && errno != EEXIST)
+ {
+ perror(path);
+ return;
+ }
+
+ /* write licence to licence.hostname.new, then atomically rename to licence.hostname */
+
+ sprintf(path, "%s/.rdesktop/licence.%s", home, This->hostname);
+ tmppath = (char *) xmalloc(strlen(path) + sizeof(".new"));
+ strcpy(tmppath, path);
+ strcat(tmppath, ".new");
+
+ fd = open(tmppath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ if (fd == -1)
+ {
+ perror(tmppath);
+ return;
+ }
+
+ if (write(fd, data, length) != length)
+ {
+ perror(tmppath);
+ unlink(tmppath);
+ }
+ else if (rename(tmppath, path) == -1)
+ {
+ perror(path);
+ unlink(tmppath);
+ }
+
+ close(fd);
+ xfree(tmppath);
+ xfree(path);
+}
+
+/* Create the bitmap cache directory */
+BOOL
+rd_pstcache_mkdir(void)
+{
+ char *home;
+ char bmpcache_dir[256];
+
+ home = getenv("HOME");
+
+ if (home == NULL)
+ return False;
+
+ sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop");
+
+ if ((mkdir(bmpcache_dir, S_IRWXU) == -1) && errno != EEXIST)
+ {
+ perror(bmpcache_dir);
+ return False;
+ }
+
+ sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop/cache");
+
+ if ((mkdir(bmpcache_dir, S_IRWXU) == -1) && errno != EEXIST)
+ {
+ perror(bmpcache_dir);
+ return False;
+ }
+
+ return True;
+}
+
+/* open a file in the .rdesktop directory */
+int
+rd_open_file(char *filename)
+{
+ char *home;
+ char fn[256];
+ int fd;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ return -1;
+ sprintf(fn, "%s/.rdesktop/%s", home, filename);
+ fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+ if (fd == -1)
+ perror(fn);
+ return fd;
+}
+
+/* close file */
+void
+rd_close_file(int fd)
+{
+ close(fd);
+}
+
+/* read from file*/
+int
+rd_read_file(int fd, void *ptr, int len)
+{
+ return read(fd, ptr, len);
+}
+
+/* write to file */
+int
+rd_write_file(int fd, void *ptr, int len)
+{
+ return write(fd, ptr, len);
+}
+
+/* move file pointer */
+int
+rd_lseek_file(int fd, int offset)
+{
+ return lseek(fd, offset, SEEK_SET);
+}
+
+/* do a write lock on a file */
+BOOL
+rd_lock_file(int fd, int start, int len)
+{
+ struct flock lock;
+
+ lock.l_type = F_WRLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = start;
+ lock.l_len = len;
+ if (fcntl(fd, F_SETLK, &lock) == -1)
+ return False;
+ return True;
+}
--- /dev/null
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ Master include file
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+
+#include <windows.h>
+#include <winsock2.h>
+#include <cchannel.h>
+
+#if 0
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <dirent.h>
+#include <sys/time.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#else
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+#include <limits.h> /* PATH_MAX */
+
+/* FIXME FIXME */
+#include <windows.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+/* FIXME FIXME */
+#endif
+
+// TODO
+#include <openssl/rc4.h>
+#include <openssl/md5.h>
+#include <openssl/sha.h>
+#include <openssl/bn.h>
+#include <openssl/x509v3.h>
+
+#define VERSION "1.4.1"
+
+#ifdef WITH_DEBUG
+#define DEBUG(args) printf args;
+#else
+#define DEBUG(args)
+#endif
+
+#ifdef WITH_DEBUG_KBD
+#define DEBUG_KBD(args) printf args;
+#else
+#define DEBUG_KBD(args)
+#endif
+
+#ifdef WITH_DEBUG_RDP5
+#define DEBUG_RDP5(args) printf args;
+#else
+#define DEBUG_RDP5(args)
+#endif
+
+#ifdef WITH_DEBUG_CLIPBOARD
+#define DEBUG_CLIPBOARD(args) printf args;
+#else
+#define DEBUG_CLIPBOARD(args)
+#endif
+
+#ifdef WITH_DEBUG_CHANNEL
+#define DEBUG_CHANNEL(args) printf args;
+#else
+#define DEBUG_CHANNEL(args)
+#endif
+
+#define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; }
+
+#ifndef MIN
+#define MIN(x,y) (((x) < (y)) ? (x) : (y))
+#endif
+
+#ifndef MAX
+#define MAX(x,y) (((x) > (y)) ? (x) : (y))
+#endif
+
+/* timeval macros */
+#ifndef timerisset
+#define timerisset(tvp)\
+ ((tvp)->tv_sec || (tvp)->tv_usec)
+#endif
+#ifndef timercmp
+#define timercmp(tvp, uvp, cmp)\
+ ((tvp)->tv_sec cmp (uvp)->tv_sec ||\
+ (tvp)->tv_sec == (uvp)->tv_sec &&\
+ (tvp)->tv_usec cmp (uvp)->tv_usec)
+#endif
+#ifndef timerclear
+#define timerclear(tvp)\
+ ((tvp)->tv_sec = (tvp)->tv_usec = 0)
+#endif
+
+/* If configure does not define the endianess, try
+ to find it out */
+#if !defined(L_ENDIAN) && !defined(B_ENDIAN)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define L_ENDIAN
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define B_ENDIAN
+#else
+#error Unknown endianness. Edit rdesktop.h.
+#endif
+#endif /* B_ENDIAN, L_ENDIAN from configure */
+
+/* No need for alignment on x86 and amd64 */
+#if !defined(NEED_ALIGN)
+#if !(defined(__x86__) || defined(__x86_64__) || \
+ defined(__AMD64__) || defined(_M_IX86) || \
+ defined(__i386__))
+#define NEED_ALIGN
+#endif
+#endif
+
+struct rdpclient;
+typedef struct rdpclient RDPCLIENT;
+
+#include "parse.h"
+#include "constants.h"
+#include "types.h"
+#include "orders.h"
+
+#if 0
+/* Used to store incoming io request, until they are ready to be completed */
+/* using a linked list ensures that they are processed in the right order, */
+/* if multiple ios are being done on the same fd */
+struct async_iorequest
+{
+ uint32 fd, major, minor, offset, device, id, length, partial_len;
+ long timeout, /* Total timeout */
+ itv_timeout; /* Interval timeout (between serial characters) */
+ uint8 *buffer;
+ DEVICE_FNS *fns;
+
+ struct async_iorequest *next; /* next element in list */
+};
+#endif
+
+struct bmpcache_entry
+{
+ HBITMAP bitmap;
+ sint16 previous;
+ sint16 next;
+};
+
+/* holds the whole state of the RDP client */
+struct rdpclient
+{
+ /* channels.c */
+ CHANNEL_DEF channel_defs[CHANNEL_MAX_COUNT];
+ unsigned int num_channels;
+
+ /* licence.c */
+ char * licence_username;
+ char licence_hostname[MAX_COMPUTERNAME_LENGTH + 1];
+ BOOL licence_issued;
+
+ /* mcs.c */
+ uint16 mcs_userid;
+
+ /* mppc.c */
+ RDPCOMP mppc_dict;
+
+ /* pstcache.c */
+ int pstcache_fd[8];
+ int pstcache_Bpp;
+ BOOL pstcache_enumerated;
+
+ /* rdesktop.c */
+ int disconnect_reason;
+ unsigned int keylayout;
+ int keyboard_type;
+ int keyboard_subtype;
+ int keyboard_functionkeys;
+
+ int width;
+ int height;
+ int server_depth;
+ BOOL bitmap_compression;
+ BOOL bitmap_cache;
+ BOOL bitmap_cache_persist_enable;
+ BOOL bitmap_cache_precache;
+ BOOL encryption;
+ BOOL packet_encryption;
+ BOOL desktop_save; /* desktop save order */
+ BOOL polygon_ellipse_orders; /* polygon / ellipse orders */
+ BOOL use_rdp5;
+ BOOL console_session;
+ uint32 rdp5_performanceflags;
+
+ /* Session Directory redirection */
+ BOOL redirect;
+ wchar_t * redirect_server;
+ wchar_t * redirect_domain;
+ wchar_t * redirect_password;
+ wchar_t * redirect_username;
+ char * redirect_cookie;
+ uint32 redirect_flags;
+
+ /* rdp.c */
+ uint8 *next_packet;
+ uint32 rdp_shareid;
+
+ /* secure.c */
+ uint16 server_rdp_version;
+
+ /* tcp.c */
+ int tcp_port_rdp;
+
+ /* cache.c */
+ struct cache_
+ {
+ struct bmpcache_entry bmpcache[3][0xa00];
+ HBITMAP volatile_bc[3];
+
+ int bmpcache_lru[3];
+ int bmpcache_mru[3];
+ int bmpcache_count[3];
+
+ FONTGLYPH fontcache[12][256];
+ DATABLOB textcache[256];
+ uint8 deskcache[0x38400 * 4];
+ HCURSOR cursorcache[0x20];
+ }
+ cache;
+
+ /* licence.c */
+ struct licence_
+ {
+ uint8 key[16];
+ uint8 sign_key[16];
+ }
+ licence;
+
+ /* orders.c */
+ struct orders_
+ {
+ RDP_ORDER_STATE order_state;
+ }
+ orders;
+
+ /* rdp.c */
+ struct rdp_
+ {
+ int current_status;
+
+#if WITH_DEBUG
+ uint32 packetno;
+#endif
+
+#ifdef HAVE_ICONV
+ BOOL iconv_works;
+#endif
+ }
+ rdp;
+
+ /* secure.c */
+ struct secure_
+ {
+ int rc4_key_len;
+ RC4_KEY rc4_decrypt_key;
+ RC4_KEY rc4_encrypt_key;
+ RSA *server_public_key;
+ uint32 server_public_key_len;
+
+ uint8 sign_key[16];
+ uint8 decrypt_key[16];
+ uint8 encrypt_key[16];
+ uint8 decrypt_update_key[16];
+ uint8 encrypt_update_key[16];
+ uint8 crypted_random[SEC_MAX_MODULUS_SIZE];
+
+ /* These values must be available to reset state - Session Directory */
+ int encrypt_use_count;
+ int decrypt_use_count;
+ }
+ secure;
+
+ /* tcp.c */
+ struct tcp_
+ {
+ SOCKET sock;
+ struct stream in;
+ struct stream out;
+ long connection_timeout;
+ }
+ tcp;
+};
+
+#ifndef MAKE_PROTO
+#include "proto.h"
+#endif
--- /dev/null
+Summary: Remote Desktop Protocol client
+Name: rdesktop
+Version: 1.4.1
+Release: 1
+Copyright: GPL; see COPYING
+Group: Applications/Communications
+Source: rdesktop-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-buildroot
+Packager: Peter Ã…strand <peter@cendio.se>
+
+%description
+rdesktop is a client for Remote Desktop Protocol (RDP), used in a number of
+Microsoft products including Windows NT Terminal Server, Windows 2000 Server,
+Windows XP and Windows 2003 Server.
+
+%prep
+rm -rf $RPM_BUILD_ROOT
+
+%setup
+%build
+./configure --prefix=%{_prefix} --bindir=%{_bindir} --mandir=%{_mandir}
+make
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%doc COPYING doc/AUTHORS doc/keymapping.txt doc/keymap-names.txt doc/ipv6.txt doc/ChangeLog
+%{_bindir}/rdesktop
+%{_mandir}/man1/rdesktop.1*
+%{_datadir}/rdesktop/keymaps
+
+%post
+
+%postun
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - RDP layer
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include <time.h>
+#include <errno.h>
+//#include <unistd.h>
+#include "rdesktop.h"
+
+#ifdef HAVE_ICONV
+#ifdef HAVE_ICONV_H
+#include <iconv.h>
+#endif
+
+#ifndef ICONV_CONST
+#define ICONV_CONST ""
+#endif
+#endif
+
+/* Receive an RDP packet */
+static STREAM
+rdp_recv(RDPCLIENT * This, uint8 * type)
+{
+ static STREAM rdp_s; // FIXME HORROR
+ uint16 length, pdu_type;
+ uint8 rdpver;
+
+ if ((rdp_s == NULL) || (This->next_packet >= rdp_s->end) || (This->next_packet == NULL))
+ {
+ rdp_s = sec_recv(This, &rdpver);
+ if (rdp_s == NULL)
+ return NULL;
+ if (rdpver == 0xff)
+ {
+ This->next_packet = rdp_s->end;
+ *type = 0;
+ return rdp_s;
+ }
+ else if (rdpver != 3)
+ {
+ /* rdp5_process should move This->next_packet ok */
+ if(!rdp5_process(This, rdp_s))
+ return NULL;
+ *type = 0;
+ return rdp_s;
+ }
+
+ This->next_packet = rdp_s->p;
+ }
+ else
+ {
+ rdp_s->p = This->next_packet;
+ }
+
+ in_uint16_le(rdp_s, length);
+ /* 32k packets are really 8, keepalive fix */
+ if (length == 0x8000)
+ {
+ This->next_packet += 8;
+ *type = 0;
+ return rdp_s;
+ }
+ in_uint16_le(rdp_s, pdu_type);
+ in_uint8s(rdp_s, 2); /* userid */
+ *type = pdu_type & 0xf;
+
+#if WITH_DEBUG
+ DEBUG(("RDP packet #%d, (type %x)\n", ++This->rdp.packetno, *type));
+ hexdump(This->next_packet, length);
+#endif /* */
+
+ This->next_packet += length;
+ return rdp_s;
+}
+
+/* Initialise an RDP data packet */
+static STREAM
+rdp_init_data(RDPCLIENT * This, int maxlen)
+{
+ STREAM s;
+
+ s = sec_init(This, This->encryption ? SEC_ENCRYPT : 0, maxlen + 18);
+
+ if(s == NULL)
+ return NULL;
+
+ s_push_layer(s, rdp_hdr, 18);
+
+ return s;
+}
+
+/* Send an RDP data packet */
+static BOOL
+rdp_send_data(RDPCLIENT * This, STREAM s, uint8 data_pdu_type)
+{
+ uint16 length;
+
+ s_pop_layer(s, rdp_hdr);
+ length = (uint16)(s->end - s->p);
+
+ out_uint16_le(s, length);
+ out_uint16_le(s, (RDP_PDU_DATA | 0x10));
+ out_uint16_le(s, (This->mcs_userid + 1001));
+
+ out_uint32_le(s, This->rdp_shareid);
+ out_uint8(s, 0); /* pad */
+ out_uint8(s, 1); /* streamid */
+ out_uint16_le(s, (length - 14));
+ out_uint8(s, data_pdu_type);
+ out_uint8(s, 0); /* compress_type */
+ out_uint16(s, 0); /* compress_len */
+
+ return sec_send(This, s, This->encryption ? SEC_ENCRYPT : 0);
+}
+
+/* Output a string in Unicode */
+void
+rdp_out_unistr(RDPCLIENT * This, STREAM s, wchar_t *string, int len)
+{
+#ifdef HAVE_ICONV
+ size_t ibl = strlen(string), obl = len + 2;
+ static iconv_t iconv_h = (iconv_t) - 1;
+ char *pin = string, *pout = (char *) s->p;
+
+ memset(pout, 0, len + 4);
+
+ if (This->rdp.iconv_works)
+ {
+ if (iconv_h == (iconv_t) - 1)
+ {
+ size_t i = 1, o = 4;
+ if ((iconv_h = iconv_open(WINDOWS_CODEPAGE, This->codepage)) == (iconv_t) - 1)
+ {
+ warning("rdp_out_unistr: iconv_open[%s -> %s] fail %d\n",
+ This->codepage, WINDOWS_CODEPAGE, (int) iconv_h);
+
+ This->rdp.iconv_works = False;
+ rdp_out_unistr(This, s, string, len);
+ return;
+ }
+ if (iconv(iconv_h, (ICONV_CONST char **) &pin, &i, &pout, &o) ==
+ (size_t) - 1)
+ {
+ iconv_close(iconv_h);
+ iconv_h = (iconv_t) - 1;
+ warning("rdp_out_unistr: iconv(1) fail, errno %d\n", errno);
+
+ This->rdp.iconv_works = False;
+ rdp_out_unistr(This, s, string, len);
+ return;
+ }
+ pin = string;
+ pout = (char *) s->p;
+ }
+
+ if (iconv(iconv_h, (ICONV_CONST char **) &pin, &ibl, &pout, &obl) == (size_t) - 1)
+ {
+ iconv_close(iconv_h);
+ iconv_h = (iconv_t) - 1;
+ warning("rdp_out_unistr: iconv(2) fail, errno %d\n", errno);
+
+ This->rdp.iconv_works = False;
+ rdp_out_unistr(This, s, string, len);
+ return;
+ }
+
+ s->p += len + 2;
+
+ }
+ else
+#endif
+ // TODO
+ {
+ int i = 0, j = 0;
+
+ len += 2;
+
+ while (i < len)
+ {
+ int c = string[j++];
+ s->p[i++] = (c >> 0) & 0xFF;
+ s->p[i++] = (c >> 8) & 0xFF;
+ }
+
+ s->p += len;
+ }
+}
+
+/* Input a string in Unicode
+ *
+ * Returns str_len of string
+ */
+int
+rdp_in_unistr(RDPCLIENT * This, STREAM s, wchar_t *string, int uni_len)
+{
+#ifdef HAVE_ICONV
+ size_t ibl = uni_len, obl = uni_len;
+ char *pin = (char *) s->p, *pout = string;
+ static iconv_t iconv_h = (iconv_t) - 1;
+
+ if (This->rdp.iconv_works)
+ {
+ if (iconv_h == (iconv_t) - 1)
+ {
+ if ((iconv_h = iconv_open(This->codepage, WINDOWS_CODEPAGE)) == (iconv_t) - 1)
+ {
+ warning("rdp_in_unistr: iconv_open[%s -> %s] fail %d\n",
+ WINDOWS_CODEPAGE, This->codepage, (int) iconv_h);
+
+ This->rdp.iconv_works = False;
+ return rdp_in_unistr(This, s, string, uni_len);
+ }
+ }
+
+ if (iconv(iconv_h, (ICONV_CONST char **) &pin, &ibl, &pout, &obl) == (size_t) - 1)
+ {
+ iconv_close(iconv_h);
+ iconv_h = (iconv_t) - 1;
+ warning("rdp_in_unistr: iconv fail, errno %d\n", errno);
+
+ This->rdp.iconv_works = False;
+ return rdp_in_unistr(This, s, string, uni_len);
+ }
+
+ /* we must update the location of the current STREAM for future reads of s->p */
+ s->p += uni_len;
+
+ return pout - string;
+ }
+ else
+#endif
+ // TODO
+ {
+ int i = 0;
+
+ while (i < uni_len / 2)
+ {
+ in_uint8a(s, &string[i++], 1);
+ in_uint8s(s, 1);
+ }
+
+ return i - 1;
+ }
+}
+
+
+/* Parse a logon info packet */
+static BOOL
+rdp_send_logon_info(RDPCLIENT * This, uint32 flags, wchar_t *domain, wchar_t *user,
+ wchar_t *password, wchar_t *program, wchar_t *directory)
+{
+ wchar_t *ipaddr = tcp_get_address(This);
+ int len_domain = 2 * (int)wcslen(domain);
+ int len_user = 2 * (int)wcslen(user);
+ int len_password = 2 * (int)wcslen(password);
+ int len_program = 2 * (int)wcslen(program);
+ int len_directory = 2 * (int)wcslen(directory);
+ int len_ip = 2 * (int)wcslen(ipaddr);
+ int len_dll = 2 * (int)wcslen(L"C:\\WINNT\\System32\\mstscax.dll");
+ int packetlen = 0;
+ uint32 sec_flags = This->encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO;
+ STREAM s;
+ time_t t = time(NULL);
+ time_t tzone;
+
+ if (!This->use_rdp5 || 1 == This->server_rdp_version)
+ {
+ DEBUG_RDP5(("Sending RDP4-style Logon packet\n"));
+
+ s = sec_init(This, sec_flags, 18 + len_domain + len_user + len_password
+ + len_program + len_directory + 10);
+
+ if(s == NULL)
+ return False;
+
+ out_uint32(s, 0);
+ out_uint32_le(s, flags);
+ out_uint16_le(s, len_domain);
+ out_uint16_le(s, len_user);
+ out_uint16_le(s, len_password);
+ out_uint16_le(s, len_program);
+ out_uint16_le(s, len_directory);
+ rdp_out_unistr(This, s, domain, len_domain);
+ rdp_out_unistr(This, s, user, len_user);
+ rdp_out_unistr(This, s, password, len_password);
+ rdp_out_unistr(This, s, program, len_program);
+ rdp_out_unistr(This, s, directory, len_directory);
+ }
+ else
+ {
+
+ flags |= RDP_LOGON_BLOB;
+ DEBUG_RDP5(("Sending RDP5-style Logon packet\n"));
+ packetlen = 4 + /* Unknown uint32 */
+ 4 + /* flags */
+ 2 + /* len_domain */
+ 2 + /* len_user */
+ (flags & RDP_LOGON_AUTO ? 2 : 0) + /* len_password */
+ (flags & RDP_LOGON_BLOB ? 2 : 0) + /* Length of BLOB */
+ 2 + /* len_program */
+ 2 + /* len_directory */
+ (0 < len_domain ? len_domain : 2) + /* domain */
+ len_user + (flags & RDP_LOGON_AUTO ? len_password : 0) + 0 + /* We have no 512 byte BLOB. Perhaps we must? */
+ (flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO) ? 2 : 0) + /* After the BLOB is a unknown int16. If there is a BLOB, that is. */
+ (0 < len_program ? len_program : 2) + (0 < len_directory ? len_directory : 2) + 2 + /* Unknown (2) */
+ 2 + /* Client ip length */
+ len_ip + /* Client ip */
+ 2 + /* DLL string length */
+ len_dll + /* DLL string */
+ 2 + /* Unknown */
+ 2 + /* Unknown */
+ 64 + /* Time zone #0 */
+ 2 + /* Unknown */
+ 64 + /* Time zone #1 */
+ 32; /* Unknown */
+
+ s = sec_init(This, sec_flags, packetlen);
+ DEBUG_RDP5(("Called sec_init with packetlen %d\n", packetlen));
+
+ if(s == NULL)
+ return False;
+
+ out_uint32(s, 0); /* Unknown */
+ out_uint32_le(s, flags);
+ out_uint16_le(s, len_domain);
+ out_uint16_le(s, len_user);
+ if (flags & RDP_LOGON_AUTO)
+ {
+ out_uint16_le(s, len_password);
+
+ }
+ if (flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO))
+ {
+ out_uint16_le(s, 0);
+ }
+ out_uint16_le(s, len_program);
+ out_uint16_le(s, len_directory);
+ if (0 < len_domain)
+ rdp_out_unistr(This, s, domain, len_domain);
+ else
+ out_uint16_le(s, 0);
+ rdp_out_unistr(This, s, user, len_user);
+ if (flags & RDP_LOGON_AUTO)
+ {
+ rdp_out_unistr(This, s, password, len_password);
+ }
+ if (flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO))
+ {
+ out_uint16_le(s, 0);
+ }
+ if (0 < len_program)
+ {
+ rdp_out_unistr(This, s, program, len_program);
+
+ }
+ else
+ {
+ out_uint16_le(s, 0);
+ }
+ if (0 < len_directory)
+ {
+ rdp_out_unistr(This, s, directory, len_directory);
+ }
+ else
+ {
+ out_uint16_le(s, 0);
+ }
+ out_uint16_le(s, 2);
+ out_uint16_le(s, len_ip + 2); /* Length of client ip */
+ rdp_out_unistr(This, s, ipaddr, len_ip);
+ out_uint16_le(s, len_dll + 2);
+ rdp_out_unistr(This, s, L"C:\\WINNT\\System32\\mstscax.dll", len_dll);
+
+ tzone = (mktime(gmtime(&t)) - mktime(localtime(&t))) / 60;
+ out_uint32_le(s, (uint32)tzone);
+
+ rdp_out_unistr(This, s, L"GTB, normaltid", 2 * (int)wcslen(L"GTB, normaltid"));
+ out_uint8s(s, 62 - 2 * wcslen(L"GTB, normaltid"));
+
+ out_uint32_le(s, 0x0a0000);
+ out_uint32_le(s, 0x050000);
+ out_uint32_le(s, 3);
+ out_uint32_le(s, 0);
+ out_uint32_le(s, 0);
+
+ rdp_out_unistr(This, s, L"GTB, sommartid", 2 * (int)wcslen(L"GTB, sommartid"));
+ out_uint8s(s, 62 - 2 * wcslen(L"GTB, sommartid"));
+
+ out_uint32_le(s, 0x30000);
+ out_uint32_le(s, 0x050000);
+ out_uint32_le(s, 2);
+ out_uint32(s, 0);
+ out_uint32_le(s, 0xffffffc4);
+ out_uint32_le(s, 0xfffffffe);
+ out_uint32_le(s, This->rdp5_performanceflags);
+ out_uint32(s, 0);
+
+
+ }
+ s_mark_end(s);
+ return sec_send(This, s, sec_flags);
+}
+
+/* Send a control PDU */
+static BOOL
+rdp_send_control(RDPCLIENT * This, uint16 action)
+{
+ STREAM s;
+
+ s = rdp_init_data(This, 8);
+
+ if(s == NULL)
+ return False;
+
+ out_uint16_le(s, action);
+ out_uint16(s, 0); /* userid */
+ out_uint32(s, 0); /* control id */
+
+ s_mark_end(s);
+ return rdp_send_data(This, s, RDP_DATA_PDU_CONTROL);
+}
+
+/* Send a synchronisation PDU */
+static BOOL
+rdp_send_synchronise(RDPCLIENT * This)
+{
+ STREAM s;
+
+ s = rdp_init_data(This, 4);
+
+ if(s == NULL)
+ return False;
+
+ out_uint16_le(s, 1); /* type */
+ out_uint16_le(s, 1002);
+
+ s_mark_end(s);
+ return rdp_send_data(This, s, RDP_DATA_PDU_SYNCHRONISE);
+}
+
+/* Send a single input event */
+BOOL
+rdp_send_input(RDPCLIENT * This, uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
+{
+ STREAM s;
+
+ s = rdp_init_data(This, 16);
+
+ if(s == NULL)
+ return False;
+
+ out_uint16_le(s, 1); /* number of events */
+ out_uint16(s, 0); /* pad */
+
+ out_uint32_le(s, time);
+ out_uint16_le(s, message_type);
+ out_uint16_le(s, device_flags);
+ out_uint16_le(s, param1);
+ out_uint16_le(s, param2);
+
+ s_mark_end(s);
+ return rdp_send_data(This, s, RDP_DATA_PDU_INPUT);
+}
+
+/* Send a client window information PDU */
+BOOL
+rdp_send_client_window_status(RDPCLIENT * This, int status)
+{
+ STREAM s;
+
+ if (This->rdp.current_status == status)
+ return True;
+
+ s = rdp_init_data(This, 12);
+
+ if(s == NULL)
+ return False;
+
+ out_uint32_le(s, status);
+
+ switch (status)
+ {
+ case 0: /* shut the server up */
+ break;
+
+ case 1: /* receive data again */
+ out_uint32_le(s, 0); /* unknown */
+ out_uint16_le(s, This->width);
+ out_uint16_le(s, This->height);
+ break;
+ }
+
+ s_mark_end(s);
+ This->rdp.current_status = status;
+ return rdp_send_data(This, s, RDP_DATA_PDU_CLIENT_WINDOW_STATUS);
+}
+
+/* Send persistent bitmap cache enumeration PDU's */
+static BOOL
+rdp_enum_bmpcache2(RDPCLIENT * This) // THIS
+{
+ STREAM s;
+ HASH_KEY keylist[BMPCACHE2_NUM_PSTCELLS];
+ uint32 num_keys, offset, count, flags;
+
+ offset = 0;
+ num_keys = pstcache_enumerate(This, 2, keylist);
+
+ while (offset < num_keys)
+ {
+ count = MIN(num_keys - offset, 169);
+
+ s = rdp_init_data(This, 24 + count * sizeof(HASH_KEY));
+
+ if(s == NULL)
+ return False;
+
+ flags = 0;
+ if (offset == 0)
+ flags |= PDU_FLAG_FIRST;
+ if (num_keys - offset <= 169)
+ flags |= PDU_FLAG_LAST;
+
+ /* header */
+ out_uint32_le(s, 0);
+ out_uint16_le(s, count);
+ out_uint16_le(s, 0);
+ out_uint16_le(s, 0);
+ out_uint16_le(s, 0);
+ out_uint16_le(s, 0);
+ out_uint16_le(s, num_keys);
+ out_uint32_le(s, 0);
+ out_uint32_le(s, flags);
+
+ /* list */
+ out_uint8a(s, keylist[offset], count * sizeof(HASH_KEY));
+
+ s_mark_end(s);
+ if(!rdp_send_data(This, s, 0x2b))
+ return False;
+
+ offset += 169;
+ }
+
+ return True;
+}
+
+/* Send an (empty) font information PDU */
+static BOOL
+rdp_send_fonts(RDPCLIENT * This, uint16 seq)
+{
+ STREAM s;
+
+ s = rdp_init_data(This, 8);
+
+ if(s == NULL)
+ return False;
+
+ out_uint16(s, 0); /* number of fonts */
+ out_uint16_le(s, 0); /* pad? */
+ out_uint16_le(s, seq); /* unknown */
+ out_uint16_le(s, 0x32); /* entry size */
+
+ s_mark_end(s);
+ return rdp_send_data(This, s, RDP_DATA_PDU_FONT2);
+}
+
+/* Output general capability set */
+static void
+rdp_out_general_caps(RDPCLIENT * This, STREAM s)
+{
+ out_uint16_le(s, RDP_CAPSET_GENERAL);
+ out_uint16_le(s, RDP_CAPLEN_GENERAL);
+
+ out_uint16_le(s, 1); /* OS major type */
+ out_uint16_le(s, 3); /* OS minor type */
+ out_uint16_le(s, 0x200); /* Protocol version */
+ out_uint16(s, 0); /* Pad */
+ out_uint16(s, 0); /* Compression types */
+ out_uint16_le(s, This->use_rdp5 ? 0x40d : 0);
+ /* Pad, according to T.128. 0x40d seems to
+ trigger
+ the server to start sending RDP5 packets.
+ However, the value is 0x1d04 with W2KTSK and
+ NT4MS. Hmm.. Anyway, thankyou, Microsoft,
+ for sending such information in a padding
+ field.. */
+ out_uint16(s, 0); /* Update capability */
+ out_uint16(s, 0); /* Remote unshare capability */
+ out_uint16(s, 0); /* Compression level */
+ out_uint16(s, 0); /* Pad */
+}
+
+/* Output bitmap capability set */
+static void
+rdp_out_bitmap_caps(RDPCLIENT * This, STREAM s)
+{
+ out_uint16_le(s, RDP_CAPSET_BITMAP);
+ out_uint16_le(s, RDP_CAPLEN_BITMAP);
+
+ out_uint16_le(s, This->server_depth); /* Preferred colour depth */
+ out_uint16_le(s, 1); /* Receive 1 BPP */
+ out_uint16_le(s, 1); /* Receive 4 BPP */
+ out_uint16_le(s, 1); /* Receive 8 BPP */
+ out_uint16_le(s, 800); /* Desktop width */
+ out_uint16_le(s, 600); /* Desktop height */
+ out_uint16(s, 0); /* Pad */
+ out_uint16(s, 1); /* Allow resize */
+ out_uint16_le(s, This->bitmap_compression ? 1 : 0); /* Support compression */
+ out_uint16(s, 0); /* Unknown */
+ out_uint16_le(s, 1); /* Unknown */
+ out_uint16(s, 0); /* Pad */
+}
+
+/* Output order capability set */
+static void
+rdp_out_order_caps(RDPCLIENT * This, STREAM s)
+{
+ uint8 order_caps[32];
+
+ memset(order_caps, 0, 32);
+ order_caps[0] = 1; /* dest blt */
+ order_caps[1] = 1; /* pat blt */
+ order_caps[2] = 1; /* screen blt */
+ order_caps[3] = (This->bitmap_cache ? 1 : 0); /* memblt */
+ order_caps[4] = 0; /* triblt */
+ order_caps[8] = 1; /* line */
+ order_caps[9] = 1; /* line */
+ order_caps[10] = 1; /* rect */
+ order_caps[11] = (This->desktop_save ? 1 : 0); /* desksave */
+ order_caps[13] = 1; /* memblt */
+ order_caps[14] = 1; /* triblt */
+ order_caps[20] = (This->polygon_ellipse_orders ? 1 : 0); /* polygon */
+ order_caps[21] = (This->polygon_ellipse_orders ? 1 : 0); /* polygon2 */
+ order_caps[22] = 1; /* polyline */
+ order_caps[25] = (This->polygon_ellipse_orders ? 1 : 0); /* ellipse */
+ order_caps[26] = (This->polygon_ellipse_orders ? 1 : 0); /* ellipse2 */
+ order_caps[27] = 1; /* text2 */
+ out_uint16_le(s, RDP_CAPSET_ORDER);
+ out_uint16_le(s, RDP_CAPLEN_ORDER);
+
+ out_uint8s(s, 20); /* Terminal desc, pad */
+ out_uint16_le(s, 1); /* Cache X granularity */
+ out_uint16_le(s, 20); /* Cache Y granularity */
+ out_uint16(s, 0); /* Pad */
+ out_uint16_le(s, 1); /* Max order level */
+ out_uint16_le(s, 0x147); /* Number of fonts */
+ out_uint16_le(s, 0x2a); /* Capability flags */
+ out_uint8p(s, order_caps, 32); /* Orders supported */
+ out_uint16_le(s, 0x6a1); /* Text capability flags */
+ out_uint8s(s, 6); /* Pad */
+ out_uint32_le(s, This->desktop_save == False ? 0 : 0x38400); /* Desktop cache size */
+ out_uint32(s, 0); /* Unknown */
+ out_uint32_le(s, 0x4e4); /* Unknown */
+}
+
+/* Output bitmap cache capability set */
+static void
+rdp_out_bmpcache_caps(RDPCLIENT * This, STREAM s)
+{
+ int Bpp;
+ out_uint16_le(s, RDP_CAPSET_BMPCACHE);
+ out_uint16_le(s, RDP_CAPLEN_BMPCACHE);
+
+ Bpp = (This->server_depth + 7) / 8; /* bytes per pixel */
+ out_uint8s(s, 24); /* unused */
+ out_uint16_le(s, 0x258); /* entries */
+ out_uint16_le(s, 0x100 * Bpp); /* max cell size */
+ out_uint16_le(s, 0x12c); /* entries */
+ out_uint16_le(s, 0x400 * Bpp); /* max cell size */
+ out_uint16_le(s, 0x106); /* entries */
+ out_uint16_le(s, 0x1000 * Bpp); /* max cell size */
+}
+
+/* Output bitmap cache v2 capability set */
+static void
+rdp_out_bmpcache2_caps(RDPCLIENT * This, STREAM s)
+{
+ out_uint16_le(s, RDP_CAPSET_BMPCACHE2);
+ out_uint16_le(s, RDP_CAPLEN_BMPCACHE2);
+
+ out_uint16_le(s, This->bitmap_cache_persist_enable ? 2 : 0); /* version */
+
+ out_uint16_be(s, 3); /* number of caches in this set */
+
+ /* max cell size for cache 0 is 16x16, 1 = 32x32, 2 = 64x64, etc */
+ out_uint32_le(s, BMPCACHE2_C0_CELLS);
+ out_uint32_le(s, BMPCACHE2_C1_CELLS);
+ if (pstcache_init(This, 2))
+ {
+ out_uint32_le(s, BMPCACHE2_NUM_PSTCELLS | BMPCACHE2_FLAG_PERSIST);
+ }
+ else
+ {
+ out_uint32_le(s, BMPCACHE2_C2_CELLS);
+ }
+ out_uint8s(s, 20); /* other bitmap caches not used */
+}
+
+/* Output control capability set */
+static void
+rdp_out_control_caps(STREAM s)
+{
+ out_uint16_le(s, RDP_CAPSET_CONTROL);
+ out_uint16_le(s, RDP_CAPLEN_CONTROL);
+
+ out_uint16(s, 0); /* Control capabilities */
+ out_uint16(s, 0); /* Remote detach */
+ out_uint16_le(s, 2); /* Control interest */
+ out_uint16_le(s, 2); /* Detach interest */
+}
+
+/* Output activation capability set */
+static void
+rdp_out_activate_caps(STREAM s)
+{
+ out_uint16_le(s, RDP_CAPSET_ACTIVATE);
+ out_uint16_le(s, RDP_CAPLEN_ACTIVATE);
+
+ out_uint16(s, 0); /* Help key */
+ out_uint16(s, 0); /* Help index key */
+ out_uint16(s, 0); /* Extended help key */
+ out_uint16(s, 0); /* Window activate */
+}
+
+/* Output pointer capability set */
+static void
+rdp_out_pointer_caps(STREAM s)
+{
+ out_uint16_le(s, RDP_CAPSET_POINTER);
+ out_uint16_le(s, RDP_CAPLEN_POINTER);
+
+ out_uint16(s, 0); /* Colour pointer */
+ out_uint16_le(s, 20); /* Cache size */
+}
+
+/* Output share capability set */
+static void
+rdp_out_share_caps(STREAM s)
+{
+ out_uint16_le(s, RDP_CAPSET_SHARE);
+ out_uint16_le(s, RDP_CAPLEN_SHARE);
+
+ out_uint16(s, 0); /* userid */
+ out_uint16(s, 0); /* pad */
+}
+
+/* Output colour cache capability set */
+static void
+rdp_out_colcache_caps(STREAM s)
+{
+ out_uint16_le(s, RDP_CAPSET_COLCACHE);
+ out_uint16_le(s, RDP_CAPLEN_COLCACHE);
+
+ out_uint16_le(s, 6); /* cache size */
+ out_uint16(s, 0); /* pad */
+}
+
+static const uint8 caps_0x0d[] = {
+ 0x01, 0x00, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00
+};
+
+static const uint8 caps_0x0c[] = { 0x01, 0x00, 0x00, 0x00 };
+
+static const uint8 caps_0x0e[] = { 0x01, 0x00, 0x00, 0x00 };
+
+static const uint8 caps_0x10[] = {
+ 0xFE, 0x00, 0x04, 0x00, 0xFE, 0x00, 0x04, 0x00,
+ 0xFE, 0x00, 0x08, 0x00, 0xFE, 0x00, 0x08, 0x00,
+ 0xFE, 0x00, 0x10, 0x00, 0xFE, 0x00, 0x20, 0x00,
+ 0xFE, 0x00, 0x40, 0x00, 0xFE, 0x00, 0x80, 0x00,
+ 0xFE, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x08,
+ 0x00, 0x01, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00
+};
+
+/* Output unknown capability sets */
+static void
+rdp_out_unknown_caps(STREAM s, uint16 id, uint16 length, const uint8 * caps)
+{
+ out_uint16_le(s, id);
+ out_uint16_le(s, length);
+
+ out_uint8p(s, caps, length - 4);
+}
+
+#define RDP5_FLAG 0x0030
+/* Send a confirm active PDU */
+static BOOL
+rdp_send_confirm_active(RDPCLIENT * This)
+{
+ STREAM s;
+ uint32 sec_flags = This->encryption ? (RDP5_FLAG | SEC_ENCRYPT) : RDP5_FLAG;
+ uint16 caplen =
+ RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER +
+ RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +
+ RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +
+ RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE +
+ 0x58 + 0x08 + 0x08 + 0x34 /* unknown caps */ +
+ 4 /* w2k fix, why? */ ;
+
+ s = sec_init(This, sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE));
+
+ if(s == NULL)
+ return False;
+
+ out_uint16_le(s, 2 + 14 + caplen + sizeof(RDP_SOURCE));
+ out_uint16_le(s, (RDP_PDU_CONFIRM_ACTIVE | 0x10)); /* Version 1 */
+ out_uint16_le(s, (This->mcs_userid + 1001));
+
+ out_uint32_le(s, This->rdp_shareid);
+ out_uint16_le(s, 0x3ea); /* userid */
+ out_uint16_le(s, sizeof(RDP_SOURCE));
+ out_uint16_le(s, caplen);
+
+ out_uint8p(s, RDP_SOURCE, sizeof(RDP_SOURCE));
+ out_uint16_le(s, 0xd); /* num_caps */
+ out_uint8s(s, 2); /* pad */
+
+ rdp_out_general_caps(This, s);
+ rdp_out_bitmap_caps(This, s);
+ rdp_out_order_caps(This, s);
+ This->use_rdp5 ? rdp_out_bmpcache2_caps(This, s) : rdp_out_bmpcache_caps(This, s);
+ rdp_out_colcache_caps(s);
+ rdp_out_activate_caps(s);
+ rdp_out_control_caps(s);
+ rdp_out_pointer_caps(s);
+ rdp_out_share_caps(s);
+
+ rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d); /* international? */
+ rdp_out_unknown_caps(s, 0x0c, 0x08, caps_0x0c);
+ rdp_out_unknown_caps(s, 0x0e, 0x08, caps_0x0e);
+ rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10); /* glyph cache? */
+
+ s_mark_end(s);
+ return sec_send(This, s, sec_flags);
+}
+
+/* Process a general capability set */
+static void
+rdp_process_general_caps(RDPCLIENT * This, STREAM s)
+{
+ uint16 pad2octetsB; /* rdp5 flags? */
+
+ in_uint8s(s, 10);
+ in_uint16_le(s, pad2octetsB);
+
+ if (!pad2octetsB)
+ This->use_rdp5 = False;
+}
+
+/* Process a bitmap capability set */
+static void
+rdp_process_bitmap_caps(RDPCLIENT * This, STREAM s)
+{
+ uint16 width, height, depth;
+
+ in_uint16_le(s, depth);
+ in_uint8s(s, 6);
+
+ in_uint16_le(s, width);
+ in_uint16_le(s, height);
+
+ DEBUG(("setting desktop size and depth to: %dx%dx%d\n", width, height, depth));
+
+ /*
+ * The server may limit depth and change the size of the desktop (for
+ * example when shadowing another session).
+ */
+ if (This->server_depth != depth)
+ {
+ warning("Remote desktop does not support colour depth %d; falling back to %d\n",
+ This->server_depth, depth);
+ This->server_depth = depth;
+ }
+ if (This->width != width || This->height != height)
+ {
+ warning("Remote desktop changed from %dx%d to %dx%d.\n", This->width, This->height,
+ width, height);
+ This->width = width;
+ This->height = height;
+ ui_resize_window(This);
+ }
+}
+
+/* Process server capabilities */
+static void
+rdp_process_server_caps(RDPCLIENT * This, STREAM s, uint16 length)
+{
+ int n;
+ uint8 *next, *start;
+ uint16 ncapsets, capset_type, capset_length;
+
+ start = s->p;
+
+ in_uint16_le(s, ncapsets);
+ in_uint8s(s, 2); /* pad */
+
+ for (n = 0; n < ncapsets; n++)
+ {
+ if (s->p > start + length)
+ return;
+
+ in_uint16_le(s, capset_type);
+ in_uint16_le(s, capset_length);
+
+ next = s->p + capset_length - 4;
+
+ switch (capset_type)
+ {
+ case RDP_CAPSET_GENERAL:
+ rdp_process_general_caps(This, s);
+ break;
+
+ case RDP_CAPSET_BITMAP:
+ rdp_process_bitmap_caps(This, s);
+ break;
+ }
+
+ s->p = next;
+ }
+}
+
+/* Respond to a demand active PDU */
+static BOOL
+process_demand_active(RDPCLIENT * This, STREAM s)
+{
+ uint8 type;
+ uint16 len_src_descriptor, len_combined_caps;
+
+ in_uint32_le(s, This->rdp_shareid);
+ in_uint16_le(s, len_src_descriptor);
+ in_uint16_le(s, len_combined_caps);
+ in_uint8s(s, len_src_descriptor);
+
+ DEBUG(("DEMAND_ACTIVE(id=0x%x)\n", This->rdp_shareid));
+ rdp_process_server_caps(This, s, len_combined_caps);
+
+ if
+ (
+ !rdp_send_confirm_active(This) ||
+ !rdp_send_synchronise(This) ||
+ !rdp_send_control(This, RDP_CTL_COOPERATE) ||
+ !rdp_send_control(This, RDP_CTL_REQUEST_CONTROL) ||
+ !rdp_recv(This, &type) || /* RDP_PDU_SYNCHRONIZE */
+ !rdp_recv(This, &type) || /* RDP_CTL_COOPERATE */
+ !rdp_recv(This, &type) || /* RDP_CTL_GRANT_CONTROL */
+ !rdp_send_input(This, 0, RDP_INPUT_SYNCHRONIZE, 0,
+ /*This->numlock_sync ? ui_get_numlock_state(This, read_keyboard_state(This)) :*/ 0, 0) // TODO: keyboard mess
+ )
+ return False;
+
+ if (This->use_rdp5)
+ {
+ if(!rdp_enum_bmpcache2(This) || !rdp_send_fonts(This, 3))
+ return False;
+ }
+ else
+ {
+ if(!rdp_send_fonts(This, 1) || !rdp_send_fonts(This, 2))
+ return False;
+ }
+
+ if(!rdp_recv(This, &type)) /* RDP_PDU_UNKNOWN 0x28 (Fonts?) */
+ return False;
+
+ reset_order_state(This);
+ return True;
+}
+
+/* Process a colour pointer PDU */
+void
+process_colour_pointer_pdu(RDPCLIENT * This, STREAM s)
+{
+ uint16 x, y, width, height, cache_idx, masklen, datalen;
+ uint8 *mask, *data;
+ HCURSOR cursor;
+
+ in_uint16_le(s, cache_idx);
+ in_uint16_le(s, x);
+ in_uint16_le(s, y);
+ in_uint16_le(s, width);
+ in_uint16_le(s, height);
+ in_uint16_le(s, masklen);
+ in_uint16_le(s, datalen);
+ in_uint8p(s, data, datalen);
+ in_uint8p(s, mask, masklen);
+ cursor = ui_create_cursor(This, x, y, width, height, mask, data);
+ ui_set_cursor(This, cursor);
+ cache_put_cursor(This, cache_idx, cursor);
+}
+
+/* Process a cached pointer PDU */
+void
+process_cached_pointer_pdu(RDPCLIENT * This, STREAM s)
+{
+ uint16 cache_idx;
+
+ in_uint16_le(s, cache_idx);
+ ui_set_cursor(This, cache_get_cursor(This, cache_idx));
+}
+
+/* Process a system pointer PDU */
+void
+process_system_pointer_pdu(RDPCLIENT * This, STREAM s)
+{
+ uint16 system_pointer_type;
+
+ in_uint16(s, system_pointer_type);
+ switch (system_pointer_type)
+ {
+ case RDP_NULL_POINTER:
+ ui_set_null_cursor(This);
+ break;
+
+ default:
+ unimpl("System pointer message 0x%x\n", system_pointer_type);
+ }
+}
+
+/* Process a pointer PDU */
+static void
+process_pointer_pdu(RDPCLIENT * This, STREAM s)
+{
+ uint16 message_type;
+ uint16 x, y;
+
+ in_uint16_le(s, message_type);
+ in_uint8s(s, 2); /* pad */
+
+ switch (message_type)
+ {
+ case RDP_POINTER_MOVE:
+ in_uint16_le(s, x);
+ in_uint16_le(s, y);
+ if (s_check(s))
+ ui_move_pointer(This, x, y);
+ break;
+
+ case RDP_POINTER_COLOR:
+ process_colour_pointer_pdu(This, s);
+ break;
+
+ case RDP_POINTER_CACHED:
+ process_cached_pointer_pdu(This, s);
+ break;
+
+ case RDP_POINTER_SYSTEM:
+ process_system_pointer_pdu(This, s);
+ break;
+
+ default:
+ unimpl("Pointer message 0x%x\n", message_type);
+ }
+}
+
+/* Process bitmap updates */
+void
+process_bitmap_updates(RDPCLIENT * This, STREAM s)
+{
+ uint16 num_updates;
+ uint16 left, top, right, bottom, width, height;
+ uint16 cx, cy, bpp, Bpp, compress, bufsize, size;
+ uint8 *data, *bmpdata;
+ int i;
+
+ in_uint16_le(s, num_updates);
+
+ for (i = 0; i < num_updates; i++)
+ {
+ in_uint16_le(s, left);
+ in_uint16_le(s, top);
+ in_uint16_le(s, right);
+ in_uint16_le(s, bottom);
+ in_uint16_le(s, width);
+ in_uint16_le(s, height);
+ in_uint16_le(s, bpp);
+ Bpp = (bpp + 7) / 8;
+ in_uint16_le(s, compress);
+ in_uint16_le(s, bufsize);
+
+ cx = right - left + 1;
+ cy = bottom - top + 1;
+
+ DEBUG(("BITMAP_UPDATE(l=%d,t=%d,r=%d,b=%d,w=%d,h=%d,Bpp=%d,cmp=%d)\n",
+ left, top, right, bottom, width, height, Bpp, compress));
+
+ if (!compress)
+ {
+#if 0
+ int y;
+ bmpdata = (uint8 *) xmalloc(width * height * Bpp);
+ for (y = 0; y < height; y++)
+ {
+ in_uint8a(s, &bmpdata[(height - y - 1) * (width * Bpp)],
+ width * Bpp);
+ }
+ ui_paint_bitmap(This, left, top, cx, cy, width, height, bmpdata);
+ xfree(bmpdata);
+#else
+ in_uint8p(s, bmpdata, width * height * Bpp);
+ ui_paint_bitmap(This, left, top, cx, cy, width, height, bmpdata);
+#endif
+ continue;
+ }
+
+
+ if (compress & 0x400)
+ {
+ size = bufsize;
+ }
+ else
+ {
+ in_uint8s(s, 2); /* pad */
+ in_uint16_le(s, size);
+ in_uint8s(s, 4); /* line_size, final_size */
+ }
+ in_uint8p(s, data, size);
+ bmpdata = (uint8 *) malloc(width * height * Bpp);
+
+ if(bmpdata == NULL)
+ return;
+
+ if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))
+ {
+ ui_paint_bitmap(This, left, top, cx, cy, width, height, bmpdata);
+ }
+ else
+ {
+ DEBUG_RDP5(("Failed to decompress data\n"));
+ }
+
+ free(bmpdata);
+ }
+}
+
+/* Process a palette update */
+void
+process_palette(RDPCLIENT * This, STREAM s)
+{
+ COLOURENTRY *entry;
+ COLOURMAP map;
+ HCOLOURMAP hmap;
+ int i;
+
+ in_uint8s(s, 2); /* pad */
+ in_uint16_le(s, map.ncolours);
+ in_uint8s(s, 2); /* pad */
+
+ map.colours = (COLOURENTRY *) malloc(sizeof(COLOURENTRY) * map.ncolours);
+
+ if(map.colours == NULL)
+ {
+ in_uint8s(s, sizeof(*entry) * map.ncolours);
+ return;
+ }
+
+ DEBUG(("PALETTE(c=%d)\n", map.ncolours));
+
+ for (i = 0; i < map.ncolours; i++)
+ {
+ entry = &map.colours[i];
+ in_uint8(s, entry->red);
+ in_uint8(s, entry->green);
+ in_uint8(s, entry->blue);
+ }
+
+ hmap = ui_create_colourmap(This, &map);
+ ui_set_colourmap(This, hmap);
+
+ free(map.colours);
+}
+
+/* Process an update PDU */
+static void
+process_update_pdu(RDPCLIENT * This, STREAM s)
+{
+ uint16 update_type, count;
+
+ in_uint16_le(s, update_type);
+
+ ui_begin_update(This);
+ switch (update_type)
+ {
+ case RDP_UPDATE_ORDERS:
+ in_uint8s(s, 2); /* pad */
+ in_uint16_le(s, count);
+ in_uint8s(s, 2); /* pad */
+ process_orders(This, s, count);
+ break;
+
+ case RDP_UPDATE_BITMAP:
+ process_bitmap_updates(This, s);
+ break;
+
+ case RDP_UPDATE_PALETTE:
+ process_palette(This, s);
+ break;
+
+ case RDP_UPDATE_SYNCHRONIZE:
+ break;
+
+ default:
+ unimpl("update %d\n", update_type);
+ }
+ ui_end_update(This);
+}
+
+/* Process a disconnect PDU */
+void
+process_disconnect_pdu(STREAM s, uint32 * ext_disc_reason)
+{
+ in_uint32_le(s, *ext_disc_reason);
+
+ DEBUG(("Received disconnect PDU\n"));
+}
+
+/* Process data PDU */
+static BOOL
+process_data_pdu(RDPCLIENT * This, STREAM s, uint32 * ext_disc_reason)
+{
+ uint8 data_pdu_type;
+ uint8 ctype;
+ uint16 clen;
+ uint32 len;
+
+ uint32 roff, rlen;
+
+ struct stream *ns = &(This->mppc_dict.ns);
+
+ in_uint8s(s, 6); /* shareid, pad, streamid */
+ in_uint16(s, len);
+ in_uint8(s, data_pdu_type);
+ in_uint8(s, ctype);
+ in_uint16(s, clen);
+ clen -= 18;
+
+ if (ctype & RDP_MPPC_COMPRESSED)
+ {
+ void * p;
+
+ if (len > RDP_MPPC_DICT_SIZE)
+ error("error decompressed packet size exceeds max\n");
+ if (mppc_expand(This, s->p, clen, ctype, &roff, &rlen) == -1)
+ error("error while decompressing packet\n");
+
+ /* len -= 18; */
+
+ /* allocate memory and copy the uncompressed data into the temporary stream */
+ p = realloc(ns->data, rlen);
+
+ if(p == NULL)
+ {
+ This->disconnect_reason = 262;
+ return True;
+ }
+
+ ns->data = (uint8 *) p;
+
+ memcpy((ns->data), (unsigned char *) (This->mppc_dict.hist + roff), rlen);
+
+ ns->size = rlen;
+ ns->end = (ns->data + ns->size);
+ ns->p = ns->data;
+ ns->rdp_hdr = ns->p;
+
+ s = ns;
+ }
+
+ switch (data_pdu_type)
+ {
+ case RDP_DATA_PDU_UPDATE:
+ process_update_pdu(This, s);
+ break;
+
+ case RDP_DATA_PDU_CONTROL:
+ DEBUG(("Received Control PDU\n"));
+ break;
+
+ case RDP_DATA_PDU_SYNCHRONISE:
+ DEBUG(("Received Sync PDU\n"));
+ break;
+
+ case RDP_DATA_PDU_POINTER:
+ process_pointer_pdu(This, s);
+ break;
+
+ case RDP_DATA_PDU_BELL:
+ ui_bell(This);
+ break;
+
+ case RDP_DATA_PDU_LOGON:
+ DEBUG(("Received Logon PDU\n"));
+ event_logon(This);
+ /* User logged on */
+ break;
+
+ case RDP_DATA_PDU_DISCONNECT:
+ process_disconnect_pdu(s, ext_disc_reason);
+
+ /* We used to return true and disconnect immediately here, but
+ * Windows Vista sends a disconnect PDU with reason 0 when
+ * reconnecting to a disconnected session, and MSTSC doesn't
+ * drop the connection. I think we should just save the status.
+ */
+ break;
+
+ default:
+ unimpl("data PDU %d\n", data_pdu_type);
+ }
+ return False;
+}
+
+/* Process redirect PDU from Session Directory */
+static BOOL
+process_redirect_pdu(RDPCLIENT * This, STREAM s /*, uint32 * ext_disc_reason */ )
+{
+ uint32 flags;
+
+ uint32 server_len;
+ wchar_t * server;
+
+ uint32 cookie_len;
+ char * cookie;
+
+ uint32 username_len;
+ wchar_t * username;
+
+ uint32 domain_len;
+ wchar_t * domain;
+
+ uint32 password_len;
+ wchar_t * password;
+
+ /* these 2 bytes are unknown, seem to be zeros */
+ in_uint8s(s, 2);
+
+ /* read connection flags */
+ in_uint32_le(s, flags);
+
+ /* read length of ip string */
+ in_uint32_le(s, server_len);
+
+ /* read ip string */
+ server = (wchar_t *)s->p;
+ in_uint8s(s, server_len);
+
+ /* read length of cookie string */
+ in_uint32_le(s, cookie_len);
+
+ /* read cookie string (plain ASCII) */
+ cookie = (char *)s->p;
+ in_uint8s(s, cookie_len);
+
+ /* read length of username string */
+ in_uint32_le(s, username_len);
+
+ /* read username string */
+ username = (wchar_t *)s->p;
+ in_uint8s(s, username_len);
+
+ /* read length of domain string */
+ in_uint32_le(s, domain_len);
+
+ /* read domain string */
+ domain = (wchar_t *)s->p;
+ in_uint8s(s, domain_len);
+
+ /* read length of password string */
+ in_uint32_le(s, password_len);
+
+ /* read password string */
+ password = (wchar_t *)s->p;
+ in_uint8s(s, password_len);
+
+ This->redirect = True;
+
+ return event_redirect
+ (
+ This,
+ flags,
+ server_len,
+ server,
+ cookie_len,
+ cookie,
+ username_len,
+ username,
+ domain_len,
+ domain,
+ password_len,
+ password
+ );
+}
+
+/* Process incoming packets */
+/* nevers gets out of here till app is done */
+void
+rdp_main_loop(RDPCLIENT * This, BOOL * deactivated, uint32 * ext_disc_reason)
+{
+ while (rdp_loop(This, deactivated, ext_disc_reason))
+ ;
+}
+
+/* used in uiports and rdp_main_loop, processes the rdp packets waiting */
+BOOL
+rdp_loop(RDPCLIENT * This, BOOL * deactivated, uint32 * ext_disc_reason)
+{
+ uint8 type;
+ BOOL disc = False; /* True when a disconnect PDU was received */
+ BOOL cont = True;
+ STREAM s;
+
+ while (cont)
+ {
+ s = rdp_recv(This, &type);
+ if (s == NULL)
+ return False;
+ switch (type)
+ {
+ case RDP_PDU_DEMAND_ACTIVE:
+ if(!process_demand_active(This, s))
+ return False;
+ *deactivated = False;
+ break;
+ case RDP_PDU_DEACTIVATE:
+ DEBUG(("RDP_PDU_DEACTIVATE\n"));
+ *deactivated = True;
+ break;
+ case RDP_PDU_REDIRECT:
+ return process_redirect_pdu(This, s);
+ break;
+ case RDP_PDU_DATA:
+ disc = process_data_pdu(This, s, ext_disc_reason);
+ break;
+ case 0:
+ break;
+ default:
+ unimpl("PDU %d\n", type);
+ }
+ if (disc)
+ return False;
+ cont = This->next_packet < s->end;
+ }
+ return True;
+}
+
+/* Establish a connection up to the RDP layer */
+BOOL
+rdp_connect(RDPCLIENT * This, char *server, uint32 flags, wchar_t *username, wchar_t *domain, wchar_t *password,
+ wchar_t *command, wchar_t *directory, wchar_t *hostname, char *cookie)
+{
+ if (!sec_connect(This, server, hostname, cookie))
+ return False;
+
+ rdp_send_logon_info(This, flags, domain, username, password, command, directory);
+ return True;
+}
+
+/* Establish a reconnection up to the RDP layer */
+BOOL
+rdp_reconnect(RDPCLIENT * This, char *server, uint32 flags, wchar_t *username, wchar_t *domain, wchar_t *password,
+ wchar_t *command, wchar_t *directory, wchar_t *hostname, char *cookie)
+{
+ if (!sec_reconnect(This, server, hostname, cookie))
+ return False;
+
+ rdp_send_logon_info(This, flags, domain, username, password, command, directory);
+ return True;
+}
+
+/* Called during redirection to reset the state to support redirection */
+void
+rdp_reset_state(RDPCLIENT * This)
+{
+ This->next_packet = NULL; /* reset the packet information */
+ This->rdp_shareid = 0;
+ sec_reset_state(This);
+}
+
+/* Disconnect from the RDP layer */
+void
+rdp_disconnect(RDPCLIENT * This)
+{
+ sec_disconnect(This);
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - RDP5 short form PDU processing
+ Copyright (C) Matthew Chapman 1999-2005
+ Copyright (C) Erik Forsberg 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+BOOL
+rdp5_process(RDPCLIENT * This, STREAM s)
+{
+ uint16 length, count, x, y;
+ uint8 type, ctype;
+ uint8 *next;
+
+ uint32 roff, rlen;
+ struct stream *ns = &(This->mppc_dict.ns);
+ struct stream *ts;
+
+#if 0
+ printf("RDP5 data:\n");
+ hexdump(s->p, s->end - s->p);
+#endif
+
+ ui_begin_update(This);
+ while (s->p < s->end)
+ {
+ in_uint8(s, type);
+ if (type & RDP5_COMPRESSED)
+ {
+ in_uint8(s, ctype);
+ in_uint16_le(s, length);
+ type ^= RDP5_COMPRESSED;
+ }
+ else
+ {
+ ctype = 0;
+ in_uint16_le(s, length);
+ }
+ This->next_packet = next = s->p + length;
+
+ if (ctype & RDP_MPPC_COMPRESSED)
+ {
+ void * p;
+
+ if (mppc_expand(This, s->p, length, ctype, &roff, &rlen) == -1)
+ error("error while decompressing packet\n");
+
+ /* allocate memory and copy the uncompressed data into the temporary stream */
+ p = realloc(ns->data, rlen);
+
+ if(p == NULL)
+ {
+ This->disconnect_reason = 262;
+ return False;
+ }
+
+ ns->data = (uint8 *) p;
+
+ memcpy((ns->data), (unsigned char *) (This->mppc_dict.hist + roff), rlen);
+
+ ns->size = rlen;
+ ns->end = (ns->data + ns->size);
+ ns->p = ns->data;
+ ns->rdp_hdr = ns->p;
+
+ ts = ns;
+ }
+ else
+ ts = s;
+
+ switch (type)
+ {
+ case 0: /* update orders */
+ in_uint16_le(ts, count);
+ process_orders(This, ts, count);
+ break;
+ case 1: /* update bitmap */
+ in_uint8s(ts, 2); /* part length */
+ process_bitmap_updates(This, ts);
+ break;
+ case 2: /* update palette */
+ in_uint8s(ts, 2); /* uint16 = 2 */
+ process_palette(This, ts);
+ break;
+ case 3: /* update synchronize */
+ break;
+ case 5: /* null pointer */
+ ui_set_null_cursor(This);
+ break;
+ case 6: /* default pointer */
+ break;
+ case 8: /* pointer position */
+ in_uint16_le(ts, x);
+ in_uint16_le(ts, y);
+ if (s_check(ts))
+ ui_move_pointer(This, x, y);
+ break;
+ case 9: /* color pointer */
+ process_colour_pointer_pdu(This, ts);
+ break;
+ case 10: /* cached pointer */
+ process_cached_pointer_pdu(This, ts);
+ break;
+ default:
+ unimpl("RDP5 opcode %d\n", type);
+ }
+
+ s->p = next;
+ }
+ ui_end_update(This);
+ return True;
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+/*
+ Here are some resources, for your IRP hacking pleasure:
+
+ http://cvs.sourceforge.net/viewcvs.py/mingw/w32api/include/ddk/winddk.h?view=markup
+
+ http://win32.mvps.org/ntfs/streams.cpp
+
+ http://www.acc.umu.se/~bosse/ntifs.h
+
+ http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/NT%20Objects/File/
+
+ http://us1.samba.org/samba/ftp/specs/smb-nt01.txt
+
+ http://www.osronline.com/
+*/
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <dirent.h> /* opendir, closedir, readdir */
+#include <time.h>
+#include <errno.h>
+#include "rdesktop.h"
+
+#define IRP_MJ_CREATE 0x00
+#define IRP_MJ_CLOSE 0x02
+#define IRP_MJ_READ 0x03
+#define IRP_MJ_WRITE 0x04
+#define IRP_MJ_QUERY_INFORMATION 0x05
+#define IRP_MJ_SET_INFORMATION 0x06
+#define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
+#define IRP_MJ_DIRECTORY_CONTROL 0x0c
+#define IRP_MJ_DEVICE_CONTROL 0x0e
+#define IRP_MJ_LOCK_CONTROL 0x11
+
+#define IRP_MN_QUERY_DIRECTORY 0x01
+#define IRP_MN_NOTIFY_CHANGE_DIRECTORY 0x02
+
+extern DEVICE_FNS serial_fns;
+extern DEVICE_FNS printer_fns;
+extern DEVICE_FNS parallel_fns;
+extern DEVICE_FNS disk_fns;
+
+/* Return device_id for a given handle */
+int
+get_device_index(RDPCLIENT * This, NTHANDLE handle)
+{
+ int i;
+ for (i = 0; i < RDPDR_MAX_DEVICES; i++)
+ {
+ if (This->rdpdr_device[i].handle == handle)
+ return i;
+ }
+ return -1;
+}
+
+/* Converts a windows path to a unix path */
+void
+convert_to_unix_filename(char *filename)
+{
+ char *p;
+
+ while ((p = strchr(filename, '\\')))
+ {
+ *p = '/';
+ }
+}
+
+static BOOL
+rdpdr_handle_ok(RDPCLIENT * This, int device, int handle)
+{
+ switch (This->rdpdr_device[device].device_type)
+ {
+ case DEVICE_TYPE_PARALLEL:
+ case DEVICE_TYPE_SERIAL:
+ case DEVICE_TYPE_PRINTER:
+ case DEVICE_TYPE_SCARD:
+ if (This->rdpdr_device[device].handle != handle)
+ return False;
+ break;
+ case DEVICE_TYPE_DISK:
+ if (This->fileinfo[handle].device_id != device)
+ return False;
+ break;
+ }
+ return True;
+}
+
+/* Add a new io request to the table containing pending io requests so it won't block rdesktop */
+static BOOL
+add_async_iorequest(RDPCLIENT * This, uint32 device, uint32 file, uint32 id, uint32 major, uint32 length,
+ DEVICE_FNS * fns, uint32 total_timeout, uint32 interval_timeout, uint8 * buffer,
+ uint32 offset)
+{
+ struct async_iorequest *iorq;
+
+ if (This->iorequest == NULL)
+ {
+ This->iorequest = (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));
+ if (!This->iorequest)
+ return False;
+ This->iorequest->fd = 0;
+ This->iorequest->next = NULL;
+ }
+
+ iorq = This->iorequest;
+
+ while (iorq->fd != 0)
+ {
+ /* create new element if needed */
+ if (iorq->next == NULL)
+ {
+ iorq->next =
+ (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));
+ if (!iorq->next)
+ return False;
+ iorq->next->fd = 0;
+ iorq->next->next = NULL;
+ }
+ iorq = iorq->next;
+ }
+ iorq->device = device;
+ iorq->fd = file;
+ iorq->id = id;
+ iorq->major = major;
+ iorq->length = length;
+ iorq->partial_len = 0;
+ iorq->fns = fns;
+ iorq->timeout = total_timeout;
+ iorq->itv_timeout = interval_timeout;
+ iorq->buffer = buffer;
+ iorq->offset = offset;
+ return True;
+}
+
+static void
+rdpdr_send_connect(RDPCLIENT * This)
+{
+ uint8 magic[4] = "rDCC";
+ STREAM s;
+
+ s = channel_init(This, This->rdpdr.channel, 12);
+ out_uint8a(s, magic, 4);
+ out_uint16_le(s, 1); /* unknown */
+ out_uint16_le(s, 5);
+ out_uint32_be(s, 0x815ed39d); /* IP address (use 127.0.0.1) 0x815ed39d */
+ s_mark_end(s);
+ channel_send(This, s, This->rdpdr.channel);
+}
+
+
+static void
+rdpdr_send_name(RDPCLIENT * This)
+{
+ uint8 magic[4] = "rDNC";
+ STREAM s;
+ uint32 hostlen;
+
+ if (NULL == This->rdpdr_clientname)
+ {
+ This->rdpdr_clientname = This->hostname;
+ }
+ hostlen = (strlen(This->rdpdr_clientname) + 1) * 2;
+
+ s = channel_init(This, This->rdpdr.channel, 16 + hostlen);
+ out_uint8a(s, magic, 4);
+ out_uint16_le(s, 0x63); /* unknown */
+ out_uint16_le(s, 0x72);
+ out_uint32(s, 0);
+ out_uint32_le(s, hostlen);
+ rdp_out_unistr(This, s, This->rdpdr_clientname, hostlen - 2);
+ s_mark_end(s);
+ channel_send(This, s, This->rdpdr.channel);
+}
+
+/* Returns the size of the payload of the announce packet */
+static int
+announcedata_size(RDPCLIENT * This)
+{
+ int size, i;
+ PRINTER *printerinfo;
+
+ size = 8; /* static announce size */
+ size += This->num_devices * 0x14;
+
+ for (i = 0; i < This->num_devices; i++)
+ {
+ if (This->rdpdr_device[i].device_type == DEVICE_TYPE_PRINTER)
+ {
+ printerinfo = (PRINTER *) This->rdpdr_device[i].pdevice_data;
+ printerinfo->bloblen =
+ printercache_load_blob(printerinfo->printer, &(printerinfo->blob));
+
+ size += 0x18;
+ size += 2 * strlen(printerinfo->driver) + 2;
+ size += 2 * strlen(printerinfo->printer) + 2;
+ size += printerinfo->bloblen;
+ }
+ }
+
+ return size;
+}
+
+static void
+rdpdr_send_available(RDPCLIENT * This)
+{
+
+ uint8 magic[4] = "rDAD";
+ uint32 driverlen, printerlen, bloblen;
+ int i;
+ STREAM s;
+ PRINTER *printerinfo;
+
+ s = channel_init(This, This->rdpdr.channel, announcedata_size(This));
+ out_uint8a(s, magic, 4);
+ out_uint32_le(s, This->num_devices);
+
+ for (i = 0; i < This->num_devices; i++)
+ {
+ out_uint32_le(s, This->rdpdr_device[i].device_type);
+ out_uint32_le(s, i); /* RDP Device ID */
+ /* Is it possible to use share names longer than 8 chars?
+ /astrand */
+ out_uint8p(s, This->rdpdr_device[i].name, 8);
+
+ switch (This->rdpdr_device[i].device_type)
+ {
+ case DEVICE_TYPE_PRINTER:
+ printerinfo = (PRINTER *) This->rdpdr_device[i].pdevice_data;
+
+ driverlen = 2 * strlen(printerinfo->driver) + 2;
+ printerlen = 2 * strlen(printerinfo->printer) + 2;
+ bloblen = printerinfo->bloblen;
+
+ out_uint32_le(s, 24 + driverlen + printerlen + bloblen); /* length of extra info */
+ out_uint32_le(s, printerinfo->default_printer ? 2 : 0);
+ out_uint8s(s, 8); /* unknown */
+ out_uint32_le(s, driverlen);
+ out_uint32_le(s, printerlen);
+ out_uint32_le(s, bloblen);
+ rdp_out_unistr(This, s, printerinfo->driver, driverlen - 2);
+ rdp_out_unistr(This, s, printerinfo->printer, printerlen - 2);
+ out_uint8a(s, printerinfo->blob, bloblen);
+
+ if (printerinfo->blob)
+ xfree(printerinfo->blob); /* Blob is sent twice if reconnecting */
+ break;
+ default:
+ out_uint32(s, 0);
+ }
+ }
+#if 0
+ out_uint32_le(s, 0x20); /* Device type 0x20 - smart card */
+ out_uint32_le(s, 0);
+ out_uint8p(s, "SCARD", 5);
+ out_uint8s(s, 3);
+ out_uint32(s, 0);
+#endif
+
+ s_mark_end(s);
+ channel_send(This, s, This->rdpdr.channel);
+}
+
+static void
+rdpdr_send_completion(RDPCLIENT * This, uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer,
+ uint32 length)
+{
+ uint8 magic[4] = "rDCI";
+ STREAM s;
+
+ s = channel_init(This, This->rdpdr.channel, 20 + length);
+ out_uint8a(s, magic, 4);
+ out_uint32_le(s, device);
+ out_uint32_le(s, id);
+ out_uint32_le(s, status);
+ out_uint32_le(s, result);
+ out_uint8p(s, buffer, length);
+ s_mark_end(s);
+ /* JIF */
+#ifdef WITH_DEBUG_RDP5
+ printf("--> rdpdr_send_completion\n");
+ /* hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8); */
+#endif
+ channel_send(This, s, This->rdpdr.channel);
+}
+
+static void
+rdpdr_process_irp(RDPCLIENT * This, STREAM s)
+{
+ uint32 result = 0,
+ length = 0,
+ desired_access = 0,
+ request,
+ file,
+ info_level,
+ buffer_len,
+ id,
+ major,
+ minor,
+ device,
+ offset,
+ bytes_in,
+ bytes_out,
+ error_mode,
+ share_mode, disposition, total_timeout, interval_timeout, flags_and_attributes = 0;
+
+ char filename[PATH_MAX];
+ uint8 *buffer, *pst_buf;
+ struct stream out;
+ DEVICE_FNS *fns;
+ BOOL rw_blocking = True;
+ NTSTATUS status = STATUS_INVALID_DEVICE_REQUEST;
+
+ in_uint32_le(s, device);
+ in_uint32_le(s, file);
+ in_uint32_le(s, id);
+ in_uint32_le(s, major);
+ in_uint32_le(s, minor);
+
+ buffer_len = 0;
+ buffer = (uint8 *) xmalloc(1024);
+ buffer[0] = 0;
+
+ switch (This->rdpdr_device[device].device_type)
+ {
+ case DEVICE_TYPE_SERIAL:
+
+ fns = &serial_fns;
+ rw_blocking = False;
+ break;
+
+ case DEVICE_TYPE_PARALLEL:
+
+ fns = ¶llel_fns;
+ rw_blocking = False;
+ break;
+
+ case DEVICE_TYPE_PRINTER:
+
+ fns = &printer_fns;
+ break;
+
+ case DEVICE_TYPE_DISK:
+
+ fns = &disk_fns;
+ rw_blocking = False;
+ break;
+
+ case DEVICE_TYPE_SCARD:
+ default:
+
+ error("IRP for bad device %ld\n", device);
+ return;
+ }
+
+ switch (major)
+ {
+ case IRP_MJ_CREATE:
+
+ in_uint32_be(s, desired_access);
+ in_uint8s(s, 0x08); /* unknown */
+ in_uint32_le(s, error_mode);
+ in_uint32_le(s, share_mode);
+ in_uint32_le(s, disposition);
+ in_uint32_le(s, flags_and_attributes);
+ in_uint32_le(s, length);
+
+ if (length && (length / 2) < 256)
+ {
+ rdp_in_unistr(This, s, filename, length);
+ convert_to_unix_filename(filename);
+ }
+ else
+ {
+ filename[0] = 0;
+ }
+
+ if (!fns->create)
+ {
+ status = STATUS_NOT_SUPPORTED;
+ break;
+ }
+
+ status = fns->create(This, device, desired_access, share_mode, disposition,
+ flags_and_attributes, filename, &result);
+ buffer_len = 1;
+ break;
+
+ case IRP_MJ_CLOSE:
+ if (!fns->close)
+ {
+ status = STATUS_NOT_SUPPORTED;
+ break;
+ }
+
+ status = fns->close(This, file);
+ break;
+
+ case IRP_MJ_READ:
+
+ if (!fns->read)
+ {
+ status = STATUS_NOT_SUPPORTED;
+ break;
+ }
+
+ in_uint32_le(s, length);
+ in_uint32_le(s, offset);
+#if WITH_DEBUG_RDP5
+ DEBUG(("RDPDR IRP Read (length: %d, offset: %d)\n", length, offset));
+#endif
+ if (!rdpdr_handle_ok(This, device, file))
+ {
+ status = STATUS_INVALID_HANDLE;
+ break;
+ }
+
+ if (rw_blocking) /* Complete read immediately */
+ {
+ buffer = (uint8 *) xrealloc((void *) buffer, length);
+ if (!buffer)
+ {
+ status = STATUS_CANCELLED;
+ break;
+ }
+ status = fns->read(This, file, buffer, length, offset, &result);
+ buffer_len = result;
+ break;
+ }
+
+ /* Add request to table */
+ pst_buf = (uint8 *) xmalloc(length);
+ if (!pst_buf)
+ {
+ status = STATUS_CANCELLED;
+ break;
+ }
+ serial_get_timeout(This, file, length, &total_timeout, &interval_timeout);
+ if (add_async_iorequest
+ (This, device, file, id, major, length, fns, total_timeout, interval_timeout,
+ pst_buf, offset))
+ {
+ status = STATUS_PENDING;
+ break;
+ }
+
+ status = STATUS_CANCELLED;
+ break;
+ case IRP_MJ_WRITE:
+
+ buffer_len = 1;
+
+ if (!fns->write)
+ {
+ status = STATUS_NOT_SUPPORTED;
+ break;
+ }
+
+ in_uint32_le(s, length);
+ in_uint32_le(s, offset);
+ in_uint8s(s, 0x18);
+#if WITH_DEBUG_RDP5
+ DEBUG(("RDPDR IRP Write (length: %d)\n", result));
+#endif
+ if (!rdpdr_handle_ok(This, device, file))
+ {
+ status = STATUS_INVALID_HANDLE;
+ break;
+ }
+
+ if (rw_blocking) /* Complete immediately */
+ {
+ status = fns->write(This, file, s->p, length, offset, &result);
+ break;
+ }
+
+ /* Add to table */
+ pst_buf = (uint8 *) xmalloc(length);
+ if (!pst_buf)
+ {
+ status = STATUS_CANCELLED;
+ break;
+ }
+
+ in_uint8a(s, pst_buf, length);
+
+ if (add_async_iorequest
+ (This, device, file, id, major, length, fns, 0, 0, pst_buf, offset))
+ {
+ status = STATUS_PENDING;
+ break;
+ }
+
+ status = STATUS_CANCELLED;
+ break;
+
+ case IRP_MJ_QUERY_INFORMATION:
+
+ if (This->rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
+ {
+ status = STATUS_INVALID_HANDLE;
+ break;
+ }
+ in_uint32_le(s, info_level);
+
+ out.data = out.p = buffer;
+ out.size = sizeof(buffer);
+ status = disk_query_information(This, file, info_level, &out);
+ result = buffer_len = out.p - out.data;
+
+ break;
+
+ case IRP_MJ_SET_INFORMATION:
+
+ if (This->rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
+ {
+ status = STATUS_INVALID_HANDLE;
+ break;
+ }
+
+ in_uint32_le(s, info_level);
+
+ out.data = out.p = buffer;
+ out.size = sizeof(buffer);
+ status = disk_set_information(This, file, info_level, s, &out);
+ result = buffer_len = out.p - out.data;
+ break;
+
+ case IRP_MJ_QUERY_VOLUME_INFORMATION:
+
+ if (This->rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
+ {
+ status = STATUS_INVALID_HANDLE;
+ break;
+ }
+
+ in_uint32_le(s, info_level);
+
+ out.data = out.p = buffer;
+ out.size = sizeof(buffer);
+ status = disk_query_volume_information(This, file, info_level, &out);
+ result = buffer_len = out.p - out.data;
+ break;
+
+ case IRP_MJ_DIRECTORY_CONTROL:
+
+ if (This->rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
+ {
+ status = STATUS_INVALID_HANDLE;
+ break;
+ }
+
+ switch (minor)
+ {
+ case IRP_MN_QUERY_DIRECTORY:
+
+ in_uint32_le(s, info_level);
+ in_uint8s(s, 1);
+ in_uint32_le(s, length);
+ in_uint8s(s, 0x17);
+ if (length && length < 2 * 255)
+ {
+ rdp_in_unistr(This, s, filename, length);
+ convert_to_unix_filename(filename);
+ }
+ else
+ {
+ filename[0] = 0;
+ }
+ out.data = out.p = buffer;
+ out.size = sizeof(buffer);
+ status = disk_query_directory(This, file, info_level, filename,
+ &out);
+ result = buffer_len = out.p - out.data;
+ if (!buffer_len)
+ buffer_len++;
+ break;
+
+ case IRP_MN_NOTIFY_CHANGE_DIRECTORY:
+
+ /* JIF
+ unimpl("IRP major=0x%x minor=0x%x: IRP_MN_NOTIFY_CHANGE_DIRECTORY\n", major, minor); */
+
+ in_uint32_le(s, info_level); /* notify mask */
+
+ This->notify_stamp = True;
+
+ status = disk_create_notify(This, file, info_level);
+ result = 0;
+
+ if (status == STATUS_PENDING)
+ add_async_iorequest(This, device, file, id, major, length,
+ fns, 0, 0, NULL, 0);
+ break;
+
+ default:
+
+ status = STATUS_INVALID_PARAMETER;
+ /* JIF */
+ unimpl("IRP major=0x%x minor=0x%x\n", major, minor);
+ }
+ break;
+
+ case IRP_MJ_DEVICE_CONTROL:
+
+ if (!fns->device_control)
+ {
+ status = STATUS_NOT_SUPPORTED;
+ break;
+ }
+
+ in_uint32_le(s, bytes_out);
+ in_uint32_le(s, bytes_in);
+ in_uint32_le(s, request);
+ in_uint8s(s, 0x14);
+
+ buffer = (uint8 *) xrealloc((void *) buffer, bytes_out + 0x14);
+ if (!buffer)
+ {
+ status = STATUS_CANCELLED;
+ break;
+ }
+
+ out.data = out.p = buffer;
+ out.size = sizeof(buffer);
+ status = fns->device_control(This, file, request, s, &out);
+ result = buffer_len = out.p - out.data;
+
+ /* Serial SERIAL_WAIT_ON_MASK */
+ if (status == STATUS_PENDING)
+ {
+ if (add_async_iorequest
+ (This, device, file, id, major, length, fns, 0, 0, NULL, 0))
+ {
+ status = STATUS_PENDING;
+ break;
+ }
+ }
+ break;
+
+
+ case IRP_MJ_LOCK_CONTROL:
+
+ if (This->rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
+ {
+ status = STATUS_INVALID_HANDLE;
+ break;
+ }
+
+ in_uint32_le(s, info_level);
+
+ out.data = out.p = buffer;
+ out.size = sizeof(buffer);
+ /* FIXME: Perhaps consider actually *do*
+ something here :-) */
+ status = STATUS_SUCCESS;
+ result = buffer_len = out.p - out.data;
+ break;
+
+ default:
+ unimpl("IRP major=0x%x minor=0x%x\n", major, minor);
+ break;
+ }
+
+ if (status != STATUS_PENDING)
+ {
+ rdpdr_send_completion(This, device, id, status, result, buffer, buffer_len);
+ }
+ if (buffer)
+ xfree(buffer);
+ buffer = NULL;
+}
+
+static void
+rdpdr_send_clientcapabilty(RDPCLIENT * This)
+{
+ uint8 magic[4] = "rDPC";
+ STREAM s;
+
+ s = channel_init(This, This->rdpdr.channel, 0x50);
+ out_uint8a(s, magic, 4);
+ out_uint32_le(s, 5); /* count */
+ out_uint16_le(s, 1); /* first */
+ out_uint16_le(s, 0x28); /* length */
+ out_uint32_le(s, 1);
+ out_uint32_le(s, 2);
+ out_uint16_le(s, 2);
+ out_uint16_le(s, 5);
+ out_uint16_le(s, 1);
+ out_uint16_le(s, 5);
+ out_uint16_le(s, 0xFFFF);
+ out_uint16_le(s, 0);
+ out_uint32_le(s, 0);
+ out_uint32_le(s, 3);
+ out_uint32_le(s, 0);
+ out_uint32_le(s, 0);
+ out_uint16_le(s, 2); /* second */
+ out_uint16_le(s, 8); /* length */
+ out_uint32_le(s, 1);
+ out_uint16_le(s, 3); /* third */
+ out_uint16_le(s, 8); /* length */
+ out_uint32_le(s, 1);
+ out_uint16_le(s, 4); /* fourth */
+ out_uint16_le(s, 8); /* length */
+ out_uint32_le(s, 1);
+ out_uint16_le(s, 5); /* fifth */
+ out_uint16_le(s, 8); /* length */
+ out_uint32_le(s, 1);
+
+ s_mark_end(s);
+ channel_send(This, s, This->rdpdr.channel);
+}
+
+static void
+rdpdr_process(RDPCLIENT * This, STREAM s)
+{
+ uint32 handle;
+ uint8 *magic;
+
+#if WITH_DEBUG_RDP5
+ printf("--- rdpdr_process ---\n");
+ hexdump(s->p, s->end - s->p);
+#endif
+ in_uint8p(s, magic, 4);
+
+ if ((magic[0] == 'r') && (magic[1] == 'D'))
+ {
+ if ((magic[2] == 'R') && (magic[3] == 'I'))
+ {
+ rdpdr_process_irp(This, s);
+ return;
+ }
+ if ((magic[2] == 'n') && (magic[3] == 'I'))
+ {
+ rdpdr_send_connect(This);
+ rdpdr_send_name(This);
+ return;
+ }
+ if ((magic[2] == 'C') && (magic[3] == 'C'))
+ {
+ /* connect from server */
+ rdpdr_send_clientcapabilty(This);
+ rdpdr_send_available(This);
+ return;
+ }
+ if ((magic[2] == 'r') && (magic[3] == 'd'))
+ {
+ /* connect to a specific resource */
+ in_uint32(s, handle);
+#if WITH_DEBUG_RDP5
+ DEBUG(("RDPDR: Server connected to resource %d\n", handle));
+#endif
+ return;
+ }
+ if ((magic[2] == 'P') && (magic[3] == 'S'))
+ {
+ /* server capability */
+ return;
+ }
+ }
+ if ((magic[0] == 'R') && (magic[1] == 'P'))
+ {
+ if ((magic[2] == 'C') && (magic[3] == 'P'))
+ {
+ printercache_process(This, s);
+ return;
+ }
+ }
+ unimpl("RDPDR packet type %c%c%c%c\n", magic[0], magic[1], magic[2], magic[3]);
+}
+
+BOOL
+rdpdr_init(RDPCLIENT * This)
+{
+ if (This->num_devices > 0)
+ {
+ This->rdpdr.channel =
+ channel_register(This, "rdpdr",
+ CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_COMPRESS_RDP,
+ rdpdr_process);
+ }
+
+ return (This->rdpdr.channel != NULL);
+}
+
+/* Add file descriptors of pending io request to select() */
+void
+rdpdr_add_fds(RDPCLIENT * This, int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout)
+{
+ uint32 select_timeout = 0; /* Timeout value to be used for select() (in millisecons). */
+ struct async_iorequest *iorq;
+ char c;
+
+ iorq = This->iorequest;
+ while (iorq != NULL)
+ {
+ if (iorq->fd != 0)
+ {
+ switch (iorq->major)
+ {
+ case IRP_MJ_READ:
+ /* Is this FD valid? FDs will
+ be invalid when
+ reconnecting. FIXME: Real
+ support for reconnects. */
+
+ FD_SET(iorq->fd, rfds);
+ *n = MAX(*n, iorq->fd);
+
+ /* Check if io request timeout is smaller than current (but not 0). */
+ if (iorq->timeout
+ && (select_timeout == 0
+ || iorq->timeout < select_timeout))
+ {
+ /* Set new timeout */
+ select_timeout = iorq->timeout;
+ This->min_timeout_fd = iorq->fd; /* Remember fd */
+ tv->tv_sec = select_timeout / 1000;
+ tv->tv_usec = (select_timeout % 1000) * 1000;
+ *timeout = True;
+ break;
+ }
+ if (iorq->itv_timeout && iorq->partial_len > 0
+ && (select_timeout == 0
+ || iorq->itv_timeout < select_timeout))
+ {
+ /* Set new timeout */
+ select_timeout = iorq->itv_timeout;
+ This->min_timeout_fd = iorq->fd; /* Remember fd */
+ tv->tv_sec = select_timeout / 1000;
+ tv->tv_usec = (select_timeout % 1000) * 1000;
+ *timeout = True;
+ break;
+ }
+ break;
+
+ case IRP_MJ_WRITE:
+ /* FD still valid? See above. */
+ if ((write(iorq->fd, &c, 0) != 0) && (errno == EBADF))
+ break;
+
+ FD_SET(iorq->fd, wfds);
+ *n = MAX(*n, iorq->fd);
+ break;
+
+ case IRP_MJ_DEVICE_CONTROL:
+ if (select_timeout > 5)
+ select_timeout = 5; /* serial event queue */
+ break;
+
+ }
+
+ }
+
+ iorq = iorq->next;
+ }
+}
+
+struct async_iorequest *
+rdpdr_remove_iorequest(RDPCLIENT * This, struct async_iorequest *prev, struct async_iorequest *iorq)
+{
+ if (!iorq)
+ return NULL;
+
+ if (iorq->buffer)
+ xfree(iorq->buffer);
+ if (prev)
+ {
+ prev->next = iorq->next;
+ xfree(iorq);
+ iorq = prev->next;
+ }
+ else
+ {
+ /* Even if NULL */
+ This->iorequest = iorq->next;
+ xfree(iorq);
+ iorq = NULL;
+ }
+ return iorq;
+}
+
+/* Check if select() returned with one of the rdpdr file descriptors, and complete io if it did */
+static void
+_rdpdr_check_fds(RDPCLIENT * This, fd_set * rfds, fd_set * wfds, BOOL timed_out)
+{
+ NTSTATUS status;
+ uint32 result = 0;
+ DEVICE_FNS *fns;
+ struct async_iorequest *iorq;
+ struct async_iorequest *prev;
+ uint32 req_size = 0;
+ uint32 buffer_len;
+ struct stream out;
+ uint8 *buffer = NULL;
+
+
+ if (timed_out)
+ {
+ /* check serial iv_timeout */
+
+ iorq = This->iorequest;
+ prev = NULL;
+ while (iorq != NULL)
+ {
+ if (iorq->fd == This->min_timeout_fd)
+ {
+ if ((iorq->partial_len > 0) &&
+ (This->rdpdr_device[iorq->device].device_type ==
+ DEVICE_TYPE_SERIAL))
+ {
+
+ /* iv_timeout between 2 chars, send partial_len */
+ /*printf("RDPDR: IVT total %u bytes read of %u\n", iorq->partial_len, iorq->length); */
+ rdpdr_send_completion(This, iorq->device,
+ iorq->id, STATUS_SUCCESS,
+ iorq->partial_len,
+ iorq->buffer, iorq->partial_len);
+ iorq = rdpdr_remove_iorequest(This, prev, iorq);
+ return;
+ }
+ else
+ {
+ break;
+ }
+
+ }
+ else
+ {
+ break;
+ }
+
+
+ prev = iorq;
+ if (iorq)
+ iorq = iorq->next;
+
+ }
+
+ rdpdr_abort_io(This, This->min_timeout_fd, 0, STATUS_TIMEOUT);
+ return;
+ }
+
+ iorq = This->iorequest;
+ prev = NULL;
+ while (iorq != NULL)
+ {
+ if (iorq->fd != 0)
+ {
+ switch (iorq->major)
+ {
+ case IRP_MJ_READ:
+ if (FD_ISSET(iorq->fd, rfds))
+ {
+ /* Read the data */
+ fns = iorq->fns;
+
+ req_size =
+ (iorq->length - iorq->partial_len) >
+ 8192 ? 8192 : (iorq->length -
+ iorq->partial_len);
+ /* never read larger chunks than 8k - chances are that it will block */
+ status = fns->read(This, iorq->fd,
+ iorq->buffer + iorq->partial_len,
+ req_size, iorq->offset, &result);
+
+ if ((long) result > 0)
+ {
+ iorq->partial_len += result;
+ iorq->offset += result;
+ }
+#if WITH_DEBUG_RDP5
+ DEBUG(("RDPDR: %d bytes of data read\n", result));
+#endif
+ /* only delete link if all data has been transfered */
+ /* or if result was 0 and status success - EOF */
+ if ((iorq->partial_len == iorq->length) ||
+ (result == 0))
+ {
+#if WITH_DEBUG_RDP5
+ DEBUG(("RDPDR: AIO total %u bytes read of %u\n", iorq->partial_len, iorq->length));
+#endif
+ rdpdr_send_completion(This, iorq->device,
+ iorq->id, status,
+ iorq->partial_len,
+ iorq->buffer,
+ iorq->partial_len);
+ iorq = rdpdr_remove_iorequest(This, prev, iorq);
+ }
+ }
+ break;
+ case IRP_MJ_WRITE:
+ if (FD_ISSET(iorq->fd, wfds))
+ {
+ /* Write data. */
+ fns = iorq->fns;
+
+ req_size =
+ (iorq->length - iorq->partial_len) >
+ 8192 ? 8192 : (iorq->length -
+ iorq->partial_len);
+
+ /* never write larger chunks than 8k - chances are that it will block */
+ status = fns->write(This, iorq->fd,
+ iorq->buffer +
+ iorq->partial_len, req_size,
+ iorq->offset, &result);
+
+ if ((long) result > 0)
+ {
+ iorq->partial_len += result;
+ iorq->offset += result;
+ }
+
+#if WITH_DEBUG_RDP5
+ DEBUG(("RDPDR: %d bytes of data written\n",
+ result));
+#endif
+ /* only delete link if all data has been transfered */
+ /* or we couldn't write */
+ if ((iorq->partial_len == iorq->length)
+ || (result == 0))
+ {
+#if WITH_DEBUG_RDP5
+ DEBUG(("RDPDR: AIO total %u bytes written of %u\n", iorq->partial_len, iorq->length));
+#endif
+ rdpdr_send_completion(This, iorq->device,
+ iorq->id, status,
+ iorq->partial_len,
+ (uint8 *) "", 1);
+
+ iorq = rdpdr_remove_iorequest(This, prev, iorq);
+ }
+ }
+ break;
+ case IRP_MJ_DEVICE_CONTROL:
+ if (serial_get_event(This, iorq->fd, &result))
+ {
+ buffer = (uint8 *) xrealloc((void *) buffer, 0x14);
+ out.data = out.p = buffer;
+ out.size = sizeof(buffer);
+ out_uint32_le(&out, result);
+ result = buffer_len = out.p - out.data;
+ status = STATUS_SUCCESS;
+ rdpdr_send_completion(This, iorq->device, iorq->id,
+ status, result, buffer,
+ buffer_len);
+ xfree(buffer);
+ iorq = rdpdr_remove_iorequest(This, prev, iorq);
+ }
+
+ break;
+ }
+
+ }
+ prev = iorq;
+ if (iorq)
+ iorq = iorq->next;
+ }
+
+ /* Check notify */
+ iorq = This->iorequest;
+ prev = NULL;
+ while (iorq != NULL)
+ {
+ if (iorq->fd != 0)
+ {
+ switch (iorq->major)
+ {
+
+ case IRP_MJ_DIRECTORY_CONTROL:
+ if (This->rdpdr_device[iorq->device].device_type ==
+ DEVICE_TYPE_DISK)
+ {
+
+ if (This->notify_stamp)
+ {
+ This->notify_stamp = False;
+ status = disk_check_notify(This, iorq->fd);
+ if (status != STATUS_PENDING)
+ {
+ rdpdr_send_completion(This, iorq->device,
+ iorq->id,
+ status, 0,
+ NULL, 0);
+ iorq = rdpdr_remove_iorequest(This, prev,
+ iorq);
+ }
+ }
+ }
+ break;
+
+
+
+ }
+ }
+
+ prev = iorq;
+ if (iorq)
+ iorq = iorq->next;
+ }
+
+}
+
+void
+rdpdr_check_fds(RDPCLIENT * This, fd_set * rfds, fd_set * wfds, BOOL timed_out)
+{
+ fd_set dummy;
+
+
+ FD_ZERO(&dummy);
+
+
+ /* fist check event queue only,
+ any serial wait event must be done before read block will be sent
+ */
+
+ _rdpdr_check_fds(This, &dummy, &dummy, False);
+ _rdpdr_check_fds(This, rfds, wfds, timed_out);
+}
+
+
+/* Abort a pending io request for a given handle and major */
+BOOL
+rdpdr_abort_io(RDPCLIENT * This, uint32 fd, uint32 major, NTSTATUS status)
+{
+ uint32 result;
+ struct async_iorequest *iorq;
+ struct async_iorequest *prev;
+
+ iorq = This->iorequest;
+ prev = NULL;
+ while (iorq != NULL)
+ {
+ /* Only remove from table when major is not set, or when correct major is supplied.
+ Abort read should not abort a write io request. */
+ if ((iorq->fd == fd) && (major == 0 || iorq->major == major))
+ {
+ result = 0;
+ rdpdr_send_completion(This, iorq->device, iorq->id, status, result, (uint8 *) "",
+ 1);
+
+ iorq = rdpdr_remove_iorequest(This, prev, iorq);
+ return True;
+ }
+
+ prev = iorq;
+ iorq = iorq->next;
+ }
+
+ return False;
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Sound Channel Process Functions
+ Copyright (C) Matthew Chapman 2003
+ Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+#define RDPSND_CLOSE 1
+#define RDPSND_WRITE 2
+#define RDPSND_SET_VOLUME 3
+#define RDPSND_UNKNOWN4 4
+#define RDPSND_COMPLETION 5
+#define RDPSND_SERVERTICK 6
+#define RDPSND_NEGOTIATE 7
+
+static STREAM
+rdpsnd_init_packet(RDPCLIENT * This, uint16 type, uint16 size)
+{
+ STREAM s;
+
+ s = channel_init(This, This->rdpsnd.channel, size + 4);
+ out_uint16_le(s, type);
+ out_uint16_le(s, size);
+ return s;
+}
+
+static void
+rdpsnd_send(RDPCLIENT * This, STREAM s)
+{
+#ifdef RDPSND_DEBUG
+ printf("RDPSND send:\n");
+ hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8);
+#endif
+
+ channel_send(This, s, This->rdpsnd.channel);
+}
+
+void
+rdpsnd_send_completion(RDPCLIENT * This, uint16 tick, uint8 packet_index)
+{
+ STREAM s;
+
+ s = rdpsnd_init_packet(This, RDPSND_COMPLETION, 4);
+ out_uint16_le(s, tick + 50);
+ out_uint8(s, packet_index);
+ out_uint8(s, 0);
+ s_mark_end(s);
+ rdpsnd_send(This, s);
+}
+
+static void
+rdpsnd_process_negotiate(RDPCLIENT * This, STREAM in)
+{
+ unsigned int in_format_count, i;
+ WAVEFORMATEX *format;
+ STREAM out;
+ BOOL device_available = False;
+ int readcnt;
+ int discardcnt;
+
+ in_uint8s(in, 14); /* flags, volume, pitch, UDP port */
+ in_uint16_le(in, in_format_count);
+ in_uint8s(in, 4); /* pad, status, pad */
+
+ if (wave_out_open())
+ {
+ wave_out_close();
+ device_available = True;
+ }
+
+ This->rdpsnd.format_count = 0;
+ if (s_check_rem(in, 18 * in_format_count))
+ {
+ for (i = 0; i < in_format_count; i++)
+ {
+ format = &This->rdpsnd.formats[This->rdpsnd.format_count];
+ in_uint16_le(in, format->wFormatTag);
+ in_uint16_le(in, format->nChannels);
+ in_uint32_le(in, format->nSamplesPerSec);
+ in_uint32_le(in, format->nAvgBytesPerSec);
+ in_uint16_le(in, format->nBlockAlign);
+ in_uint16_le(in, format->wBitsPerSample);
+ in_uint16_le(in, format->cbSize);
+
+ /* read in the buffer of unknown use */
+ readcnt = format->cbSize;
+ discardcnt = 0;
+ if (format->cbSize > MAX_CBSIZE)
+ {
+ fprintf(stderr, "cbSize too large for buffer: %d\n",
+ format->cbSize);
+ readcnt = MAX_CBSIZE;
+ discardcnt = format->cbSize - MAX_CBSIZE;
+ }
+ in_uint8a(in, format->cb, readcnt);
+ in_uint8s(in, discardcnt);
+
+ if (device_available && wave_out_format_supported(format))
+ {
+ This->rdpsnd.format_count++;
+ if (This->rdpsnd.format_count == MAX_FORMATS)
+ break;
+ }
+ }
+ }
+
+ out = rdpsnd_init_packet(This, RDPSND_NEGOTIATE | 0x200, 20 + 18 * This->rdpsnd.format_count);
+ out_uint32_le(out, 3); /* flags */
+ out_uint32(out, 0xffffffff); /* volume */
+ out_uint32(out, 0); /* pitch */
+ out_uint16(out, 0); /* UDP port */
+
+ out_uint16_le(out, This->rdpsnd.format_count);
+ out_uint8(out, 0x95); /* pad? */
+ out_uint16_le(out, 2); /* status */
+ out_uint8(out, 0x77); /* pad? */
+
+ for (i = 0; i < This->rdpsnd.format_count; i++)
+ {
+ format = &This->rdpsnd.formats[i];
+ out_uint16_le(out, format->wFormatTag);
+ out_uint16_le(out, format->nChannels);
+ out_uint32_le(out, format->nSamplesPerSec);
+ out_uint32_le(out, format->nAvgBytesPerSec);
+ out_uint16_le(out, format->nBlockAlign);
+ out_uint16_le(out, format->wBitsPerSample);
+ out_uint16(out, 0); /* cbSize */
+ }
+
+ s_mark_end(out);
+ rdpsnd_send(This, out);
+}
+
+static void
+rdpsnd_process_servertick(RDPCLIENT * This, STREAM in)
+{
+ uint16 tick1, tick2;
+ STREAM out;
+
+ /* in_uint8s(in, 4); unknown */
+ in_uint16_le(in, tick1);
+ in_uint16_le(in, tick2);
+
+ out = rdpsnd_init_packet(This, RDPSND_SERVERTICK | 0x2300, 4);
+ out_uint16_le(out, tick1);
+ out_uint16_le(out, tick2);
+ s_mark_end(out);
+ rdpsnd_send(This, out);
+}
+
+static void
+rdpsnd_process(RDPCLIENT * This, STREAM s)
+{
+ uint8 type;
+ uint16 datalen;
+ uint32 volume;
+ static uint16 tick, format;
+ static uint8 packet_index;
+ static BOOL awaiting_data_packet;
+
+#ifdef RDPSND_DEBUG
+ printf("RDPSND recv:\n");
+ hexdump(s->p, s->end - s->p);
+#endif
+
+ if (awaiting_data_packet)
+ {
+ if (format >= MAX_FORMATS)
+ {
+ error("RDPSND: Invalid format index\n");
+ return;
+ }
+
+ if (!This->rdpsnd.device_open || (format != This->rdpsnd.current_format))
+ {
+ if (!This->rdpsnd.device_open && !wave_out_open())
+ {
+ rdpsnd_send_completion(This, tick, packet_index);
+ return;
+ }
+ if (!wave_out_set_format(&This->rdpsnd.formats[format]))
+ {
+ rdpsnd_send_completion(This, tick, packet_index);
+ wave_out_close();
+ This->rdpsnd.device_open = False;
+ return;
+ }
+ This->rdpsnd.device_open = True;
+ This->rdpsnd.current_format = format;
+ }
+
+ wave_out_write(s, tick, packet_index);
+ awaiting_data_packet = False;
+ return;
+ }
+
+ in_uint8(s, type);
+ in_uint8s(s, 1); /* unknown? */
+ in_uint16_le(s, datalen);
+
+ switch (type)
+ {
+ case RDPSND_WRITE:
+ in_uint16_le(s, tick);
+ in_uint16_le(s, format);
+ in_uint8(s, packet_index);
+ awaiting_data_packet = True;
+ break;
+ case RDPSND_CLOSE:
+ wave_out_close();
+ This->rdpsnd.device_open = False;
+ break;
+ case RDPSND_NEGOTIATE:
+ rdpsnd_process_negotiate(This, s);
+ break;
+ case RDPSND_SERVERTICK:
+ rdpsnd_process_servertick(This, s);
+ break;
+ case RDPSND_SET_VOLUME:
+ in_uint32(s, volume);
+ if (This->rdpsnd.device_open)
+ {
+ wave_out_volume((volume & 0xffff), (volume & 0xffff0000) >> 16);
+ }
+ break;
+ default:
+ unimpl("RDPSND packet type %d\n", type);
+ break;
+ }
+}
+
+BOOL
+rdpsnd_init(RDPCLIENT * This)
+{
+ This->rdpsnd.channel =
+ channel_register(This, "rdpsnd", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
+ rdpsnd_process);
+ return (This->rdpsnd.channel != NULL);
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Sound Channel Process Functions - libao-driver
+ Copyright (C) Matthew Chapman 2003
+ Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003
+ Copyright (C) Michael Gernoth mike@zerfleddert.de 2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <ao/ao.h>
+#include <sys/time.h>
+
+#define MAX_QUEUE 10
+#define WAVEOUTBUF 16
+
+int This->dsp_;
+ao_device *o_device = NULL;
+int default_driver;
+int g_samplerate;
+int This->channels;
+BOOL This->dsp_bu = False;
+static BOOL g_reopened;
+static short g_samplewidth;
+
+static struct audio_packet
+{
+ struct stream s;
+ uint16 tick;
+ uint8 index;
+} packet_queue[MAX_QUEUE];
+static unsigned int queue_hi, queue_lo;
+
+BOOL
+wave_out_open(void)
+{
+ ao_sample_format format;
+
+ ao_initialize();
+ default_driver = ao_default_driver_id();
+
+ format.bits = 16;
+ format.channels = 2;
+ This->channels = 2;
+ format.rate = 44100;
+ g_samplerate = 44100;
+ format.byte_format = AO_FMT_LITTLE;
+
+ o_device = ao_open_live(default_driver, &format, NULL);
+ if (o_device == NULL)
+ {
+ return False;
+ }
+
+ This->dsp_ = 0;
+ queue_lo = queue_hi = 0;
+
+ g_reopened = True;
+
+ return True;
+}
+
+void
+wave_out_close(void)
+{
+ /* Ack all remaining packets */
+ while (queue_lo != queue_hi)
+ {
+ rdpsnd_send_completion(packet_queue[queue_lo].tick, packet_queue[queue_lo].index);
+ free(packet_queue[queue_lo].s.data);
+ queue_lo = (queue_lo + 1) % MAX_QUEUE;
+ }
+
+ if (o_device != NULL)
+ ao_close(o_device);
+
+ ao_shutdown();
+}
+
+BOOL
+wave_out_format_supported(WAVEFORMATEX * pwfx)
+{
+ if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
+ return False;
+ if ((pwfx->nChannels != 1) && (pwfx->nChannels != 2))
+ return False;
+ if ((pwfx->wBitsPerSample != 8) && (pwfx->wBitsPerSample != 16))
+ return False;
+ /* The only common denominator between libao output drivers is a sample-rate of
+ 44100, we need to upsample 22050 to it */
+ if ((pwfx->nSamplesPerSec != 44100) && (pwfx->nSamplesPerSec != 22050))
+ return False;
+
+ return True;
+}
+
+BOOL
+wave_out_set_format(WAVEFORMATEX * pwfx)
+{
+ ao_sample_format format;
+
+ format.bits = pwfx->wBitsPerSample;
+ format.channels = pwfx->nChannels;
+ This->channels = pwfx->nChannels;
+ format.rate = 44100;
+ g_samplerate = pwfx->nSamplesPerSec;
+ format.byte_format = AO_FMT_LITTLE;
+
+ g_samplewidth = pwfx->wBitsPerSample / 8;
+
+ if (o_device != NULL)
+ ao_close(o_device);
+
+ o_device = ao_open_live(default_driver, &format, NULL);
+ if (o_device == NULL)
+ {
+ return False;
+ }
+
+ g_reopened = True;
+
+ return True;
+}
+
+void
+wave_out_volume(uint16 left, uint16 right)
+{
+ warning("volume changes not supported with libao-output\n");
+}
+
+void
+wave_out_write(STREAM s, uint16 tick, uint8 index)
+{
+ struct audio_packet *packet = &packet_queue[queue_hi];
+ unsigned int next_hi = (queue_hi + 1) % MAX_QUEUE;
+
+ if (next_hi == queue_lo)
+ {
+ error("No space to queue audio packet\n");
+ return;
+ }
+
+ queue_hi = next_hi;
+
+ packet->s = *s;
+ packet->tick = tick;
+ packet->index = index;
+ packet->s.p += 4;
+
+ /* we steal the data buffer from s, give it a new one */
+ s->data = malloc(s->size);
+
+ if (!This->dsp_bu)
+ wave_out_play();
+}
+
+void
+wave_out_play(void)
+{
+ struct audio_packet *packet;
+ STREAM out;
+ char outbuf[WAVEOUTBUF];
+ int offset, len, i;
+ static long prev_s, prev_us;
+ unsigned int duration;
+ struct timeval tv;
+ int next_tick;
+
+ if (g_reopened)
+ {
+ g_reopened = False;
+ gettimeofday(&tv, NULL);
+ prev_s = tv.tv_sec;
+ prev_us = tv.tv_usec;
+ }
+
+ if (queue_lo == queue_hi)
+ {
+ This->dsp_bu = 0;
+ return;
+ }
+
+ packet = &packet_queue[queue_lo];
+ out = &packet->s;
+
+ if (((queue_lo + 1) % MAX_QUEUE) != queue_hi)
+ {
+ next_tick = packet_queue[(queue_lo + 1) % MAX_QUEUE].tick;
+ }
+ else
+ {
+ next_tick = (packet->tick + 65535) % 65536;
+ }
+
+ len = 0;
+
+ if (g_samplerate == 22050)
+ {
+ /* Resample to 44100 */
+ for (i = 0; (i < ((WAVEOUTBUF / 4) * (3 - g_samplewidth))) && (out->p < out->end);
+ i++)
+ {
+ /* On a stereo-channel we must make sure that left and right
+ does not get mixed up, so we need to expand the sample-
+ data with channels in mind: 1234 -> 12123434
+ If we have a mono-channel, we can expand the data by simply
+ doubling the sample-data: 1234 -> 11223344 */
+ if (This->channels == 2)
+ offset = ((i * 2) - (i & 1)) * g_samplewidth;
+ else
+ offset = (i * 2) * g_samplewidth;
+
+ memcpy(&outbuf[offset], out->p, g_samplewidth);
+ memcpy(&outbuf[This->channels * g_samplewidth + offset], out->p, g_samplewidth);
+
+ out->p += g_samplewidth;
+ len += 2 * g_samplewidth;
+ }
+ }
+ else
+ {
+ len = (WAVEOUTBUF > (out->end - out->p)) ? (out->end - out->p) : WAVEOUTBUF;
+ memcpy(outbuf, out->p, len);
+ out->p += len;
+ }
+
+ ao_play(o_device, outbuf, len);
+
+ gettimeofday(&tv, NULL);
+
+ duration = ((tv.tv_sec - prev_s) * 1000000 + (tv.tv_usec - prev_us)) / 1000;
+
+ if (packet->tick > next_tick)
+ next_tick += 65536;
+
+ if ((out->p == out->end) || duration > next_tick - packet->tick + 500)
+ {
+ prev_s = tv.tv_sec;
+ prev_us = tv.tv_usec;
+
+ if (abs((next_tick - packet->tick) - duration) > 20)
+ {
+ DEBUG(("duration: %d, calc: %d, ", duration, next_tick - packet->tick));
+ DEBUG(("last: %d, is: %d, should: %d\n", packet->tick,
+ (packet->tick + duration) % 65536, next_tick % 65536));
+ }
+
+ /* Until all drivers are using the windows sound-ticks, we need to
+ substract the 50 ticks added later by rdpsnd.c */
+ rdpsnd_send_completion(((packet->tick + duration) % 65536) - 50, packet->index);
+ free(out->data);
+ queue_lo = (queue_lo + 1) % MAX_QUEUE;
+ }
+
+ This->dsp_bu = 1;
+ return;
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Sound Channel Process Functions - Open Sound System
+ Copyright (C) Matthew Chapman 2003
+ Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+/*
+ This is a workaround for Esound bug 312665.
+ FIXME: Remove this when Esound is fixed.
+*/
+#ifdef _FILE_OFFSET_BITS
+#undef _FILE_OFFSET_BITS
+#endif
+
+#include "rdesktop.h"
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/soundcard.h>
+
+#define MAX_QUEUE 10
+
+int This->dsp_;
+BOOL This->dsp_bu = False;
+static int g_snd_rate;
+static short g_samplewidth;
+static BOOL g_driver_broken = False;
+
+static struct audio_packet
+{
+ struct stream s;
+ uint16 tick;
+ uint8 index;
+} packet_queue[MAX_QUEUE];
+static unsigned int queue_hi, queue_lo;
+
+BOOL
+wave_out_open(void)
+{
+ char *dsp_dev = getenv("AUDIODEV");
+
+ if (dsp_dev == NULL)
+ {
+ dsp_dev = xstrdup("/dev/dsp");
+ }
+
+ if ((This->dsp_ = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1)
+ {
+ perror(dsp_dev);
+ return False;
+ }
+
+ /* Non-blocking so that user interface is responsive */
+ fcntl(This->dsp_, F_SETFL, fcntl(This->dsp_, F_GETFL) | O_NONBLOCK);
+ return True;
+}
+
+void
+wave_out_close(void)
+{
+ close(This->dsp_);
+}
+
+BOOL
+wave_out_format_supported(WAVEFORMATEX * pwfx)
+{
+ if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
+ return False;
+ if ((pwfx->nChannels != 1) && (pwfx->nChannels != 2))
+ return False;
+ if ((pwfx->wBitsPerSample != 8) && (pwfx->wBitsPerSample != 16))
+ return False;
+
+ return True;
+}
+
+BOOL
+wave_out_set_format(WAVEFORMATEX * pwfx)
+{
+ int stereo, format, fragments;
+
+ ioctl(This->dsp_, SNDCTL_DSP_RESET, NULL);
+ ioctl(This->dsp_, SNDCTL_DSP_SYNC, NULL);
+
+ if (pwfx->wBitsPerSample == 8)
+ format = AFMT_U8;
+ else if (pwfx->wBitsPerSample == 16)
+ format = AFMT_S16_LE;
+
+ g_samplewidth = pwfx->wBitsPerSample / 8;
+
+ if (ioctl(This->dsp_, SNDCTL_DSP_SETFMT, &format) == -1)
+ {
+ perror("SNDCTL_DSP_SETFMT");
+ close(This->dsp_);
+ return False;
+ }
+
+ if (pwfx->nChannels == 2)
+ {
+ stereo = 1;
+ g_samplewidth *= 2;
+ }
+ else
+ {
+ stereo = 0;
+ }
+
+ if (ioctl(This->dsp_, SNDCTL_DSP_STEREO, &stereo) == -1)
+ {
+ perror("SNDCTL_DSP_CHANNELS");
+ close(This->dsp_);
+ return False;
+ }
+
+ g_snd_rate = pwfx->nSamplesPerSec;
+ if (ioctl(This->dsp_, SNDCTL_DSP_SPEED, &g_snd_rate) == -1)
+ {
+ perror("SNDCTL_DSP_SPEED");
+ close(This->dsp_);
+ return False;
+ }
+
+ /* try to get 7 fragments of 2^12 bytes size */
+ fragments = (7 << 16) + 12;
+ ioctl(This->dsp_, SNDCTL_DSP_SETFRAGMENT, &fragments);
+
+ if (!g_driver_broken)
+ {
+ audio_buf_info info;
+
+ memset(&info, 0, sizeof(info));
+ if (ioctl(This->dsp_, SNDCTL_DSP_GETOSPACE, &info) == -1)
+ {
+ perror("SNDCTL_DSP_GETOSPACE");
+ close(This->dsp_);
+ return False;
+ }
+
+ if (info.fragments == 0 || info.fragstotal == 0 || info.fragsize == 0)
+ {
+ fprintf(stderr,
+ "Broken OSS-driver detected: fragments: %d, fragstotal: %d, fragsize: %d\n",
+ info.fragments, info.fragstotal, info.fragsize);
+ g_driver_broken = True;
+ }
+ }
+
+ return True;
+}
+
+void
+wave_out_volume(uint16 left, uint16 right)
+{
+ static BOOL use_dev_mixer = False;
+ uint32 volume;
+ int fd_mix = -1;
+
+ volume = left / (65536 / 100);
+ volume |= right / (65536 / 100) << 8;
+
+ if (use_dev_mixer)
+ {
+ if ((fd_mix = open("/dev/mixer", O_RDWR | O_NONBLOCK)) == -1)
+ {
+ perror("open /dev/mixer");
+ return;
+ }
+
+ if (ioctl(fd_mix, MIXER_WRITE(SOUND_MIXER_PCM), &volume) == -1)
+ {
+ perror("MIXER_WRITE(SOUND_MIXER_PCM)");
+ return;
+ }
+
+ close(fd_mix);
+ }
+
+ if (ioctl(This->dsp_, MIXER_WRITE(SOUND_MIXER_PCM), &volume) == -1)
+ {
+ perror("MIXER_WRITE(SOUND_MIXER_PCM)");
+ use_dev_mixer = True;
+ return;
+ }
+}
+
+void
+wave_out_write(STREAM s, uint16 tick, uint8 index)
+{
+ struct audio_packet *packet = &packet_queue[queue_hi];
+ unsigned int next_hi = (queue_hi + 1) % MAX_QUEUE;
+
+ if (next_hi == queue_lo)
+ {
+ error("No space to queue audio packet\n");
+ return;
+ }
+
+ queue_hi = next_hi;
+
+ packet->s = *s;
+ packet->tick = tick;
+ packet->index = index;
+ packet->s.p += 4;
+
+ /* we steal the data buffer from s, give it a new one */
+ s->data = (uint8 *) malloc(s->size);
+
+ if (!This->dsp_bu)
+ wave_out_play();
+}
+
+void
+wave_out_play(void)
+{
+ struct audio_packet *packet;
+ ssize_t len;
+ STREAM out;
+ static long startedat_us;
+ static long startedat_s;
+ static BOOL started = False;
+ struct timeval tv;
+ audio_buf_info info;
+
+ while (1)
+ {
+ if (queue_lo == queue_hi)
+ {
+ This->dsp_bu = 0;
+ return;
+ }
+
+ packet = &packet_queue[queue_lo];
+ out = &packet->s;
+
+ if (!started)
+ {
+ gettimeofday(&tv, NULL);
+ startedat_us = tv.tv_usec;
+ startedat_s = tv.tv_sec;
+ started = True;
+ }
+
+ len = out->end - out->p;
+
+ if (!g_driver_broken)
+ {
+ memset(&info, 0, sizeof(info));
+ if (ioctl(This->dsp_, SNDCTL_DSP_GETOSPACE, &info) == -1)
+ {
+ perror("SNDCTL_DSP_GETOSPACE");
+ return;
+ }
+
+ if (info.fragments == 0)
+ {
+ This->dsp_bu = 1;
+ return;
+ }
+
+ if (info.fragments * info.fragsize < len
+ && info.fragments * info.fragsize > 0)
+ {
+ len = info.fragments * info.fragsize;
+ }
+ }
+
+
+ len = write(This->dsp_, out->p, len);
+ if (len == -1)
+ {
+ if (errno != EWOULDBLOCK)
+ perror("write audio");
+ This->dsp_bu = 1;
+ return;
+ }
+
+ out->p += len;
+ if (out->p == out->end)
+ {
+ long long duration;
+ long elapsed;
+
+ gettimeofday(&tv, NULL);
+ duration = (out->size * (1000000 / (g_samplewidth * g_snd_rate)));
+ elapsed = (tv.tv_sec - startedat_s) * 1000000 + (tv.tv_usec - startedat_us);
+
+ if (elapsed >= (duration * 85) / 100)
+ {
+ rdpsnd_send_completion(packet->tick, packet->index);
+ free(out->data);
+ queue_lo = (queue_lo + 1) % MAX_QUEUE;
+ started = False;
+ }
+ else
+ {
+ This->dsp_bu = 1;
+ return;
+ }
+ }
+ }
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Sound Channel Process Functions - SGI/IRIX
+ Copyright (C) Matthew Chapman 2003
+ Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003
+ Copyright (C) Jeremy Meng void.foo@gmail.com 2004, 2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+#include <errno.h>
+#include <dmedia/audio.h>
+
+/* #define IRIX_DEBUG 1 */
+
+#define IRIX_MAX_VOL 65535
+
+#define MAX_QUEUE 10
+
+int This->dsp_;
+ALconfig audioconfig;
+ALport output_port;
+
+BOOL This->dsp_bu = False;
+static BOOL g_swapaudio;
+static int g_snd_rate;
+static BOOL g_swapaudio;
+static int width = AL_SAMPLE_16;
+
+double min_volume, max_volume, volume_range;
+int resource, maxFillable;
+int combinedFrameSize;
+
+static struct audio_packet
+{
+ struct stream s;
+ uint16 tick;
+ uint8 index;
+} packet_queue[MAX_QUEUE];
+static unsigned int queue_hi, queue_lo;
+
+BOOL
+wave_out_open(void)
+{
+ ALparamInfo pinfo;
+
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_open: begin\n");
+#endif
+
+ if (alGetParamInfo(AL_DEFAULT_OUTPUT, AL_GAIN, &pinfo) < 0)
+ {
+ fprintf(stderr, "wave_out_open: alGetParamInfo failed: %s\n",
+ alGetErrorString(oserror()));
+ }
+ min_volume = alFixedToDouble(pinfo.min.ll);
+ max_volume = alFixedToDouble(pinfo.max.ll);
+ volume_range = (max_volume - min_volume);
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_open: minvol = %lf, maxvol= %lf, range = %lf.\n",
+ min_volume, max_volume, volume_range);
+#endif
+
+ queue_lo = queue_hi = 0;
+
+ audioconfig = alNewConfig();
+ if (audioconfig == (ALconfig) 0)
+ {
+ fprintf(stderr, "wave_out_open: alNewConfig failed: %s\n",
+ alGetErrorString(oserror()));
+ return False;
+ }
+
+ output_port = alOpenPort("rdpsnd", "w", 0);
+ if (output_port == (ALport) 0)
+ {
+ fprintf(stderr, "wave_out_open: alOpenPort failed: %s\n",
+ alGetErrorString(oserror()));
+ return False;
+ }
+
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_open: returning\n");
+#endif
+ return True;
+}
+
+void
+wave_out_close(void)
+{
+ /* Ack all remaining packets */
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_close: begin\n");
+#endif
+
+ while (queue_lo != queue_hi)
+ {
+ rdpsnd_send_completion(packet_queue[queue_lo].tick, packet_queue[queue_lo].index);
+ free(packet_queue[queue_lo].s.data);
+ queue_lo = (queue_lo + 1) % MAX_QUEUE;
+ }
+ alDiscardFrames(output_port, 0);
+
+ alClosePort(output_port);
+ alFreeConfig(audioconfig);
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_close: returning\n");
+#endif
+}
+
+BOOL
+wave_out_format_supported(WAVEFORMATEX * pwfx)
+{
+ if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
+ return False;
+ if ((pwfx->nChannels != 1) && (pwfx->nChannels != 2))
+ return False;
+ if ((pwfx->wBitsPerSample != 8) && (pwfx->wBitsPerSample != 16))
+ return False;
+
+ return True;
+}
+
+BOOL
+wave_out_set_format(WAVEFORMATEX * pwfx)
+{
+ int channels;
+ int frameSize, channelCount;
+ ALpv params;
+
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_set_format: init...\n");
+#endif
+
+ g_swapaudio = False;
+ if (pwfx->wBitsPerSample == 8)
+ width = AL_SAMPLE_8;
+ else if (pwfx->wBitsPerSample == 16)
+ {
+ width = AL_SAMPLE_16;
+ /* Do we need to swap the 16bit values? (Are we BigEndian) */
+#if (defined(B_ENDIAN))
+ g_swapaudio = 1;
+#else
+ g_swapaudio = 0;
+#endif
+ }
+
+ /* Limited support to configure an opened audio port in IRIX. The
+ number of channels is a static setting and can not be changed after
+ a port is opened. So if the number of channels remains the same, we
+ can configure other settings; otherwise we have to reopen the audio
+ port, using same config. */
+
+ channels = pwfx->nChannels;
+ g_snd_rate = pwfx->nSamplesPerSec;
+
+ alSetSampFmt(audioconfig, AL_SAMPFMT_TWOSCOMP);
+ alSetWidth(audioconfig, width);
+ if (channels != alGetChannels(audioconfig))
+ {
+ alClosePort(output_port);
+ alSetChannels(audioconfig, channels);
+ output_port = alOpenPort("rdpsnd", "w", audioconfig);
+
+ if (output_port == (ALport) 0)
+ {
+ fprintf(stderr, "wave_out_set_format: alOpenPort failed: %s\n",
+ alGetErrorString(oserror()));
+ return False;
+ }
+
+ }
+
+ resource = alGetResource(output_port);
+ maxFillable = alGetFillable(output_port);
+ channelCount = alGetChannels(audioconfig);
+ frameSize = alGetWidth(audioconfig);
+
+ if (frameSize == 0 || channelCount == 0)
+ {
+ fprintf(stderr, "wave_out_set_format: bad frameSize or channelCount\n");
+ return False;
+ }
+ combinedFrameSize = frameSize * channelCount;
+
+ params.param = AL_RATE;
+ params.value.ll = (long long) g_snd_rate << 32;
+
+ if (alSetParams(resource, ¶ms, 1) < 0)
+ {
+ fprintf(stderr, "wave_set_format: alSetParams failed: %s\n",
+ alGetErrorString(oserror()));
+ return False;
+ }
+ if (params.sizeOut < 0)
+ {
+ fprintf(stderr, "wave_set_format: invalid rate %d\n", g_snd_rate);
+ return False;
+ }
+
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_set_format: returning...\n");
+#endif
+ return True;
+}
+
+void
+wave_out_volume(uint16 left, uint16 right)
+{
+ double gainleft, gainright;
+ ALpv pv[1];
+ ALfixed gain[8];
+
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_volume: begin\n");
+ fprintf(stderr, "left='%d', right='%d'\n", left, right);
+#endif
+
+ gainleft = (double) left / IRIX_MAX_VOL;
+ gainright = (double) right / IRIX_MAX_VOL;
+
+ gain[0] = alDoubleToFixed(min_volume + gainleft * volume_range);
+ gain[1] = alDoubleToFixed(min_volume + gainright * volume_range);
+
+ pv[0].param = AL_GAIN;
+ pv[0].value.ptr = gain;
+ pv[0].sizeIn = 8;
+ if (alSetParams(AL_DEFAULT_OUTPUT, pv, 1) < 0)
+ {
+ fprintf(stderr, "wave_out_volume: alSetParams failed: %s\n",
+ alGetErrorString(oserror()));
+ return;
+ }
+
+#if (defined(IRIX_DEBUG))
+ fprintf(stderr, "wave_out_volume: returning\n");
+#endif
+}
+
+void
+wave_out_write(STREAM s, uint16 tick, uint8 index)
+{
+ struct audio_packet *packet = &packet_queue[queue_hi];
+ unsigned int next_hi = (queue_hi + 1) % MAX_QUEUE;
+
+ if (next_hi == queue_lo)
+ {
+ fprintf(stderr, "No space to queue audio packet\n");
+ return;
+ }
+
+ queue_hi = next_hi;
+
+ packet->s = *s;
+ packet->tick = tick;
+ packet->index = index;
+ packet->s.p += 4;
+
+ /* we steal the data buffer from s, give it a new one */
+ s->data = malloc(s->size);
+
+ if (!This->dsp_bu)
+ wave_out_play();
+}
+
+void
+wave_out_play(void)
+{
+ struct audio_packet *packet;
+ ssize_t len;
+ unsigned int i;
+ uint8 swap;
+ STREAM out;
+ static BOOL swapped = False;
+ int gf;
+
+ while (1)
+ {
+ if (queue_lo == queue_hi)
+ {
+ This->dsp_bu = False;
+ return;
+ }
+
+ packet = &packet_queue[queue_lo];
+ out = &packet->s;
+
+ /* Swap the current packet, but only once */
+ if (g_swapaudio && !swapped)
+ {
+ for (i = 0; i < out->end - out->p; i += 2)
+ {
+ swap = *(out->p + i);
+ *(out->p + i) = *(out->p + i + 1);
+ *(out->p + i + 1) = swap;
+ }
+ swapped = True;
+ }
+
+ len = out->end - out->p;
+
+ alWriteFrames(output_port, out->p, len / combinedFrameSize);
+
+ out->p += len;
+ if (out->p == out->end)
+ {
+ gf = alGetFilled(output_port);
+ if (gf < (4 * maxFillable / 10))
+ {
+ rdpsnd_send_completion(packet->tick, packet->index);
+ free(out->data);
+ queue_lo = (queue_lo + 1) % MAX_QUEUE;
+ swapped = False;
+ }
+ else
+ {
+#if (defined(IRIX_DEBUG))
+/* fprintf(stderr,"Busy playing...\n"); */
+#endif
+ This->dsp_bu = True;
+ usleep(10);
+ return;
+ }
+ }
+ }
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Sound Channel Process Functions - Sun
+ Copyright (C) Matthew Chapman 2003
+ Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003
+ Copyright (C) Michael Gernoth mike@zerfleddert.de 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+#include <sys/audioio.h>
+
+#if (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
+#include <stropts.h>
+#endif
+
+#define MAX_QUEUE 10
+
+int This->dsp_;
+BOOL This->dsp_bu = False;
+static BOOL g_reopened;
+static BOOL g_swapaudio;
+static short g_samplewidth;
+
+static struct audio_packet
+{
+ struct stream s;
+ uint16 tick;
+ uint8 index;
+} packet_queue[MAX_QUEUE];
+static unsigned int queue_hi, queue_lo;
+
+BOOL
+wave_out_open(void)
+{
+ char *dsp_dev = getenv("AUDIODEV");
+
+ if (dsp_dev == NULL)
+ {
+ dsp_dev = xstrdup("/dev/audio");
+ }
+
+ if ((This->dsp_ = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1)
+ {
+ perror(dsp_dev);
+ return False;
+ }
+
+ /* Non-blocking so that user interface is responsive */
+ fcntl(This->dsp_, F_SETFL, fcntl(This->dsp_, F_GETFL) | O_NONBLOCK);
+
+ queue_lo = queue_hi = 0;
+ g_reopened = True;
+
+ return True;
+}
+
+void
+wave_out_close(void)
+{
+ /* Ack all remaining packets */
+ while (queue_lo != queue_hi)
+ {
+ rdpsnd_send_completion(packet_queue[queue_lo].tick, packet_queue[queue_lo].index);
+ free(packet_queue[queue_lo].s.data);
+ queue_lo = (queue_lo + 1) % MAX_QUEUE;
+ }
+
+#if defined I_FLUSH && defined FLUSHW
+ /* Flush the audiobuffer */
+ ioctl(This->dsp_, I_FLUSH, FLUSHW);
+#endif
+#if defined AUDIO_FLUSH
+ ioctl(This->dsp_, AUDIO_FLUSH, NULL);
+#endif
+ close(This->dsp_);
+}
+
+BOOL
+wave_out_format_supported(WAVEFORMATEX * pwfx)
+{
+ if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
+ return False;
+ if ((pwfx->nChannels != 1) && (pwfx->nChannels != 2))
+ return False;
+ if ((pwfx->wBitsPerSample != 8) && (pwfx->wBitsPerSample != 16))
+ return False;
+
+ return True;
+}
+
+BOOL
+wave_out_set_format(WAVEFORMATEX * pwfx)
+{
+ audio_info_t info;
+
+ ioctl(This->dsp_, AUDIO_DRAIN, 0);
+ g_swapaudio = False;
+ AUDIO_INITINFO(&info);
+
+
+ if (pwfx->wBitsPerSample == 8)
+ {
+ info.play.encoding = AUDIO_ENCODING_LINEAR8;
+ }
+ else if (pwfx->wBitsPerSample == 16)
+ {
+ info.play.encoding = AUDIO_ENCODING_LINEAR;
+ /* Do we need to swap the 16bit values? (Are we BigEndian) */
+#ifdef B_ENDIAN
+ g_swapaudio = 1;
+#else
+ g_swapaudio = 0;
+#endif
+ }
+
+ g_samplewidth = pwfx->wBitsPerSample / 8;
+
+ if (pwfx->nChannels == 1)
+ {
+ info.play.channels = 1;
+ }
+ else if (pwfx->nChannels == 2)
+ {
+ info.play.channels = 2;
+ g_samplewidth *= 2;
+ }
+
+ info.play.sample_rate = pwfx->nSamplesPerSec;
+ info.play.precision = pwfx->wBitsPerSample;
+ info.play.samples = 0;
+ info.play.eof = 0;
+ info.play.error = 0;
+ g_reopened = True;
+
+ if (ioctl(This->dsp_, AUDIO_SETINFO, &info) == -1)
+ {
+ perror("AUDIO_SETINFO");
+ close(This->dsp_);
+ return False;
+ }
+
+ return True;
+}
+
+void
+wave_out_volume(uint16 left, uint16 right)
+{
+ audio_info_t info;
+ uint balance;
+ uint volume;
+
+ AUDIO_INITINFO(&info);
+
+ volume = (left > right) ? left : right;
+
+ if (volume / AUDIO_MID_BALANCE != 0)
+ {
+ balance =
+ AUDIO_MID_BALANCE - (left / (volume / AUDIO_MID_BALANCE)) +
+ (right / (volume / AUDIO_MID_BALANCE));
+ }
+ else
+ {
+ balance = AUDIO_MID_BALANCE;
+ }
+
+ info.play.gain = volume / (65536 / AUDIO_MAX_GAIN);
+ info.play.balance = balance;
+
+ if (ioctl(This->dsp_, AUDIO_SETINFO, &info) == -1)
+ {
+ perror("AUDIO_SETINFO");
+ return;
+ }
+}
+
+void
+wave_out_write(STREAM s, uint16 tick, uint8 index)
+{
+ struct audio_packet *packet = &packet_queue[queue_hi];
+ unsigned int next_hi = (queue_hi + 1) % MAX_QUEUE;
+
+ if (next_hi == queue_lo)
+ {
+ error("No space to queue audio packet\n");
+ return;
+ }
+
+ queue_hi = next_hi;
+
+ packet->s = *s;
+ packet->tick = tick;
+ packet->index = index;
+ packet->s.p += 4;
+
+ /* we steal the data buffer from s, give it a new one */
+ s->data = malloc(s->size);
+
+ if (!This->dsp_bu)
+ wave_out_play();
+}
+
+void
+wave_out_play(void)
+{
+ struct audio_packet *packet;
+ audio_info_t info;
+ ssize_t len;
+ unsigned int i;
+ uint8 swap;
+ STREAM out;
+ static BOOL swapped = False;
+ static BOOL sentcompletion = True;
+ static uint32 samplecnt = 0;
+ static uint32 numsamples;
+
+ while (1)
+ {
+ if (g_reopened)
+ {
+ /* Device was just (re)openend */
+ samplecnt = 0;
+ swapped = False;
+ sentcompletion = True;
+ g_reopened = False;
+ }
+
+ if (queue_lo == queue_hi)
+ {
+ This->dsp_bu = 0;
+ return;
+ }
+
+ packet = &packet_queue[queue_lo];
+ out = &packet->s;
+
+ /* Swap the current packet, but only once */
+ if (g_swapaudio && !swapped)
+ {
+ for (i = 0; i < out->end - out->p; i += 2)
+ {
+ swap = *(out->p + i);
+ *(out->p + i) = *(out->p + i + 1);
+ *(out->p + i + 1) = swap;
+ }
+ swapped = True;
+ }
+
+ if (sentcompletion)
+ {
+ sentcompletion = False;
+ numsamples = (out->end - out->p) / g_samplewidth;
+ }
+
+ len = 0;
+
+ if (out->end != out->p)
+ {
+ len = write(This->dsp_, out->p, out->end - out->p);
+ if (len == -1)
+ {
+ if (errno != EWOULDBLOCK)
+ perror("write audio");
+ This->dsp_bu = 1;
+ return;
+ }
+ }
+
+ out->p += len;
+ if (out->p == out->end)
+ {
+ if (ioctl(This->dsp_, AUDIO_GETINFO, &info) == -1)
+ {
+ perror("AUDIO_GETINFO");
+ return;
+ }
+
+ /* Ack the packet, if we have played at least 70% */
+ if (info.play.samples >= samplecnt + ((numsamples * 7) / 10))
+ {
+ samplecnt += numsamples;
+ rdpsnd_send_completion(packet->tick, packet->index);
+ free(out->data);
+ queue_lo = (queue_lo + 1) % MAX_QUEUE;
+ swapped = False;
+ sentcompletion = True;
+ }
+ else
+ {
+ This->dsp_bu = 1;
+ return;
+ }
+ }
+ }
+}
--- /dev/null
+
+/* Two defines for every scancode:
+ One called SCANCODE_KEY_<num>, where <num> is the key location number.
+ One called SCANCODE_CHAR_<char-on-us-kbd>, where <char-on-us-kbd> is the
+ unshifted character on a US 101/102 keyboard. See the Microsoft
+ document "Keyboard Scan Code Specification" for more information.
+
+ Up keys normally have scancode values +0x80.
+
+ 0x0: Avoid
+ 0x1- 0x59: Normal
+ 0x60, 0x61: Avoid, since the up key would be 0xe1, 0xe1
+ 0x61 - 0x79: Normal
+ 0xfa - : keyboard drivers interpret these as responses from the 8042 chip
+
+ We use bit 7 to indicate 0xe0 prefix instead of two-byte sequence (0xe0, something). Eq.,
+ 0xe 0x38 is defined as (0x80 | 0x38)
+*/
+
+/* FIXME:
+ Special keys like Numeric / are very complicated and emits many scancodes.
+*/
+
+#define SCANCODE_EXTENDED 0x80
+
+#define SCANCODE_KEY_1 0x29
+#define SCANCODE_CHAR_GRAVE 0x29
+
+#define SCANCODE_KEY_2 0x2
+#define SCANCODE_CHAR_1 SCANCODE_KEY_2
+
+#define SCANCODE_KEY_3 0x3
+#define SCANCODE_CHAR_2 SCANCODE_KEY_3
+
+#define SCANCODE_KEY_4 0x4
+#define SCANCODE_CHAR_3 SCANCODE_KEY_4
+
+#define SCANCODE_KEY_5 0x5
+#define SCANCODE_CHAR_4 SCANCODE_KEY_5
+
+#define SCANCODE_KEY_6 0x6
+#define SCANCODE_CHAR_5 SCANCODE_KEY_6
+
+#define SCANCODE_KEY_7 0x7
+#define SCANCODE_CHAR_6 SCANCODE_KEY_7
+
+#define SCANCODE_KEY_8 0x8
+#define SCANCODE_CHAR_7 SCANCODE_KEY_8
+
+#define SCANCODE_KEY_9 0x9
+#define SCANCODE_CHAR_8 SCANCODE_KEY_9
+
+#define SCANCODE_KEY_10 0xa
+#define SCANCODE_CHAR_9 SCANCODE_KEY_10
+
+#define SCANCODE_KEY_11 0xb
+#define SCANCODE_CHAR_0 SCANCODE_KEY_11
+
+#define SCANCODE_KEY_12 0xc
+#define SCANCODE_CHAR_MINUS SCANCODE_KEY_12
+
+#define SCANCODE_KEY_13 0xd
+#define SCANCODE_CHAR_EQUAL SCANCODE_KEY_13
+
+/* Key 14 does not exist */
+
+#define SCANCODE_KEY_15 0xe
+#define SCANCODE_CHAR_BACKSPACE SCANCODE_KEY_15
+
+#define SCANCODE_KEY_16 0xf
+#define SCANCODE_CHAR_TAB SCANCODE_KEY_16
+
+#define SCANCODE_KEY_17 0x10
+#define SCANCODE_CHAR_Q SCANCODE_KEY_17
+
+#define SCANCODE_KEY_18 0x11
+#define SCANCODE_CHAR_W SCANCODE_KEY_18
+
+#define SCANCODE_KEY_19 0x12
+#define SCANCODE_CHAR_E SCANCODE_KEY_19
+
+#define SCANCODE_KEY_20 0x13
+#define SCANCODE_CHAR_R SCANCODE_KEY_20
+
+#define SCANCODE_KEY_21 0x14
+#define SCANCODE_CHAR_T SCANCODE_KEY_21
+
+#define SCANCODE_KEY_22 0x15
+#define SCANCODE_CHAR_Y SCANCODE_KEY_22
+
+#define SCANCODE_KEY_23 0x16
+#define SCANCODE_CHAR_U SCANCODE_KEY_23
+
+#define SCANCODE_KEY_24 0x17
+#define SCANCODE_CHAR_I SCANCODE_KEY_24
+
+#define SCANCODE_KEY_25 0x18
+#define SCANCODE_CHAR_O SCANCODE_KEY_25
+
+#define SCANCODE_KEY_26 0x19
+#define SCANCODE_CHAR_P SCANCODE_KEY_26
+
+#define SCANCODE_KEY_27 0x1a
+#define SCANCODE_CHAR_BRACKETLEFT SCANCODE_KEY_27
+
+#define SCANCODE_KEY_28 0x1b
+#define SCANCODE_CHAR_BRACKETRIGHT SCANCODE_KEY_28
+
+/* Only on US keyboard */
+#define SCANCODE_KEY_29 0x2b
+#define SCANCODE_CHAR_BACKSLASH SCANCODE_KEY_29
+
+#define SCANCODE_KEY_30 0x3a
+#define SCANCODE_CHAR_CAPSLOCK SCANCODE_KEY_30
+
+#define SCANCODE_KEY_31 0x1e
+#define SCANCODE_CHAR_A SCANCODE_KEY_31
+
+#define SCANCODE_KEY_32 0x1f
+#define SCANCODE_CHAR_S SCANCODE_KEY_32
+
+#define SCANCODE_KEY_33 0x20
+#define SCANCODE_CHAR_D SCANCODE_KEY_33
+
+#define SCANCODE_KEY_34 0x21
+#define SCANCODE_CHAR_F SCANCODE_KEY_34
+
+#define SCANCODE_KEY_35 0x22
+#define SCANCODE_CHAR_G SCANCODE_KEY_35
+
+#define SCANCODE_KEY_36 0x23
+#define SCANCODE_CHAR_H SCANCODE_KEY_36
+
+#define SCANCODE_KEY_37 0x24
+#define SCANCODE_CHAR_J SCANCODE_KEY_37
+
+#define SCANCODE_KEY_38 0x25
+#define SCANCODE_CHAR_K SCANCODE_KEY_38
+
+#define SCANCODE_KEY_39 0x26
+#define SCANCODE_CHAR_L SCANCODE_KEY_39
+
+#define SCANCODE_KEY_40 0x27
+#define SCANCODE_CHAR_SEMICOLON SCANCODE_KEY_40
+
+#define SCANCODE_KEY_41 0x28
+#define SCANCODE_CHAR_APOSTROPHE SCANCODE_KEY_41
+
+/* Only on international keyboard */
+#define SCANCODE_KEY_42 0x2b
+
+#define SCANCODE_KEY_43 0x1c
+#define SCANCODE_CHAR_ENTER SCANCODE_KEY_43
+
+#define SCANCODE_KEY_44 0x2a
+#define SCANCODE_CHAR_LSHIFT SCANCODE_KEY_44
+
+/* Only on international keyboard */
+#define SCANCODE_KEY_45 0x56
+
+#define SCANCODE_KEY_46 0x2c
+#define SCANCODE_CHAR_Z SCANCODE_KEY_46
+
+#define SCANCODE_KEY_47 0x2d
+#define SCANCODE_CHAR_X SCANCODE_KEY_47
+
+#define SCANCODE_KEY_48 0x2e
+#define SCANCODE_CHAR_C SCANCODE_KEY_48
+
+#define SCANCODE_KEY_49 0x2f
+#define SCANCODE_CHAR_V SCANCODE_KEY_49
+
+#define SCANCODE_KEY_50 0x30
+#define SCANCODE_CHAR_B SCANCODE_KEY_50
+
+#define SCANCODE_KEY_51 0x31
+#define SCANCODE_CHAR_N SCANCODE_KEY_51
+
+#define SCANCODE_KEY_52 0x32
+#define SCANCODE_CHAR_M SCANCODE_KEY_52
+
+#define SCANCODE_KEY_53 0x33
+#define SCANCODE_CHAR_COMMA SCANCODE_KEY_53
+
+#define SCANCODE_KEY_54 0x34
+#define SCANCODE_CHAR_DOT SCANCODE_KEY_54
+
+#define SCANCODE_KEY_55 0x35
+#define SCANCODE_CHAR_SLASH SCANCODE_KEY_55
+
+/* Only on Brazilian and some Far East keyboards */
+#define SCANCODE_KEY_56 0x73
+
+#define SCANCODE_KEY_57 0x36
+#define SCANCODE_CHAR_RSHIFT SCANCODE_KEY_57
+
+#define SCANCODE_KEY_58 0x1d
+#define SCANCODE_CHAR_LCTRL SCANCODE_KEY_58
+
+/* Key 59 does not exist */
+
+#define SCANCODE_KEY_60 0x38
+#define SCANCODE_CHAR_LALT SCANCODE_KEY_60
+
+#define SCANCODE_KEY_61 0x39
+#define SCANCODE_CHAR_SPACE SCANCODE_KEY_61
+
+#define SCANCODE_KEY_62 (SCANCODE_EXTENDED | 0x38)
+#define SCANCODE_CHAR_RALT SCANCODE_KEY_62
+
+/* Key 63 does not exist */
+
+#define SCANCODE_KEY_64 (SCANCODE_EXTENDED | 0x1d)
+#define SCANCODE_CHAR_RCTRL SCANCODE_KEY_64
+
+/* Key 65 - 74 does not exist */
+
+#define SCANCODE_KEY_75 (SCANCODE_EXTENDED | 0x52)
+#define SCANCODE_CHAR_INSERT SCANCODE_KEY_75
+
+#define SCANCODE_KEY_76 (SCANCODE_EXTENDED | 0x53)
+#define SCANCODE_CHAR_DELETE SCANCODE_KEY_76
+
+/* Key 77 - 78 does not exist */
+
+#define SCANCODE_KEY_79 (SCANCODE_EXTENDED | 0x4b)
+#define SCANCODE_CHAR_LARROW SCANCODE_KEY_79
+
+#define SCANCODE_KEY_80 (SCANCODE_EXTENDED | 0x47)
+#define SCANCODE_CHAR_HOME SCANCODE_KEY_80
+
+#define SCANCODE_KEY_81 (SCANCODE_EXTENDED | 0x4f)
+#define SCANCODE_CHAR_END SCANCODE_KEY_81
+
+/* Key 82 does not exist */
+
+#define SCANCODE_KEY_83 (SCANCODE_EXTENDED | 0x48)
+#define SCANCODE_CHAR_UPARROW SCANCODE_KEY_83
+
+#define SCANCODE_KEY_84 (SCANCODE_EXTENDED | 0x50)
+#define SCANCODE_CHAR_DNARROW SCANCODE_KEY_84
+
+#define SCANCODE_KEY_85 (SCANCODE_EXTENDED | 0x49)
+#define SCANCODE_CHAR_PAGEUP SCANCODE_KEY_85
+
+#define SCANCODE_KEY_86 (SCANCODE_EXTENDED | 0x51)
+#define SCANCODE_CHAR_PAGEDOWN SCANCODE_KEY_86
+
+/* Key 87 - 88 does not exist */
+
+#define SCANCODE_KEY_89 (SCANCODE_EXTENDED | 0x4d)
+#define SCANCODE_CHAR_RARROW SCANCODE_KEY_89
+
+#define SCANCODE_KEY_90 0x45
+#define SCANCODE_CHAR_NUMLOCK SCANCODE_KEY_90
+
+#define SCANCODE_KEY_91 0x47
+#define SCANCODE_CHAR_NUMERIC7 SCANCODE_KEY_91
+
+#define SCANCODE_KEY_92 0x4b
+#define SCANCODE_CHAR_NUMERIC4 SCANCODE_KEY_92
+
+#define SCANCODE_KEY_93 0x4f
+#define SCANCODE_CHAR_NUMERIC1 SCANCODE_KEY_93
+
+/* Key 94 does not exist */
+
+#define SCANCODE_KEY_95 (SCANCODE_EXTENDED | 0x35)
+#define SCANCODE_CHAR_NUMERICSLASH SCANCODE_KEY_95
+
+#define SCANCODE_KEY_96 0x48
+#define SCANCODE_CHAR_NUMERIC8 SCANCODE_KEY_96
+
+#define SCANCODE_KEY_97 0x4c
+#define SCANCODE_CHAR_NUMERIC5 SCANCODE_KEY_97
+
+#define SCANCODE_KEY_98 0x50
+#define SCANCODE_CHAR_NUMERIC2 SCANCODE_KEY_98
+
+#define SCANCODE_KEY_99 0x52
+#define SCANCODE_CHAR_NUMERIC0 SCANCODE_KEY_99
+
+#define SCANCODE_KEY_100 0x37
+#define SCANCODE_CHAR_NUMERICSTAR SCANCODE_KEY_100
+
+#define SCANCODE_KEY_101 0x49
+#define SCANCODE_CHAR_NUMERIC9 SCANCODE_KEY_101
+
+#define SCANCODE_KEY_102 0x4d
+#define SCANCODE_CHAR_NUMERIC6 SCANCODE_KEY_102
+
+#define SCANCODE_KEY_103 0x51
+#define SCANCODE_CHAR_NUMERIC3 SCANCODE_KEY_103
+
+#define SCANCODE_KEY_104 0x53
+#define SCANCODE_CHAR_NUMERICDOT SCANCODE_KEY_104
+
+#define SCANCODE_KEY_105 0x4a
+#define SCANCODE_CHAR_NUMERICMINUS SCANCODE_KEY_105
+
+#define SCANCODE_KEY_106 0x4e
+#define SCANCODE_CHAR_NUMERICPLUS SCANCODE_KEY_106
+
+/* Only on Brazilian and some Far East keyboards */
+#define SCANCODE_KEY_107 0x
+
+#define SCANCODE_KEY_108 (SCANCODE_EXTENDED | 0x1c)
+#define SCANCODE_CHAR_NUMERICENTER SCANCODE_KEY_108
+
+/* Key 109 does not exist */
+
+#define SCANCODE_KEY_110 0x1
+#define SCANCODE_CHAR_ESC SCANCODE_KEY_110
+
+/* Key 111 does not exist */
+
+#define SCANCODE_KEY_112 0x3b
+#define SCANCODE_CHAR_F1 SCANCODE_KEY_112
+
+#define SCANCODE_KEY_113 0x3c
+#define SCANCODE_CHAR_F2 SCANCODE_KEY_113
+
+#define SCANCODE_KEY_114 0x3d
+#define SCANCODE_CHAR_F3 SCANCODE_KEY_114
+
+#define SCANCODE_KEY_115 0x3e
+#define SCANCODE_CHAR_F4 SCANCODE_KEY_115
+
+#define SCANCODE_KEY_116 0x3f
+#define SCANCODE_CHAR_F5 SCANCODE_KEY_116
+
+#define SCANCODE_KEY_117 0x40
+#define SCANCODE_CHAR_F6 SCANCODE_KEY_117
+
+#define SCANCODE_KEY_118 0x41
+#define SCANCODE_CHAR_F7 SCANCODE_KEY_118
+
+#define SCANCODE_KEY_119 0x42
+#define SCANCODE_CHAR_F8 SCANCODE_KEY_119
+
+#define SCANCODE_KEY_120 0x43
+#define SCANCODE_CHAR_F9 SCANCODE_KEY_120
+
+#define SCANCODE_KEY_121 0x44
+#define SCANCODE_CHAR_F10 SCANCODE_KEY_121
+
+#define SCANCODE_KEY_122 0x57
+#define SCANCODE_CHAR_F11 SCANCODE_KEY_122
+
+#define SCANCODE_KEY_123 0x58
+#define SCANCODE_CHAR_F12 SCANCODE_KEY_123
+
+/* Key 124: The Print Screen sequence is complicated, and
+ hardcoded in xkeymap.c */
+
+#define SCANCODE_KEY_125 0x46
+#define SCANCODE_CHAR_SCROLLLOCK SCANCODE_KEY_125
+
+/* Key 126: The Pause and Break sequences is complicated, and
+ hardcoded in xkeymap.c */
+
+/*
+ The keys below does not have any key location number
+*/
+
+#define SCANCODE_CHAR_LWIN (SCANCODE_EXTENDED | 0x5b)
+
+#define SCANCODE_CHAR_RWIN (SCANCODE_EXTENDED | 0x5c)
+
+#define SCANCODE_CHAR_APPLICATION (SCANCODE_EXTENDED | 0x5d)
+
+#define SCANCODE_CHAR_ACPIPOWER (SCANCODE_EXTENDED | 0x5e)
+
+#define SCANCODE_CHAR_ACPISLEEP (SCANCODE_EXTENDED | 0x5f)
+
+#define SCANCODE_CHAR_ACPIWAKE (SCANCODE_EXTENDED | 0x63)
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Seamless Windows support
+ Copyright (C) Peter Astrand <astrand@cendio.se> 2005-2006
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+#include <stdarg.h>
+#include <assert.h>
+
+/* #define WITH_DEBUG_SEAMLESS */
+
+#ifdef WITH_DEBUG_SEAMLESS
+#define DEBUG_SEAMLESS(args) printf args;
+#else
+#define DEBUG_SEAMLESS(args)
+#endif
+
+static char *
+seamless_get_token(char **s)
+{
+ char *comma, *head;
+ head = *s;
+
+ if (!head)
+ return NULL;
+
+ comma = strchr(head, ',');
+ if (comma)
+ {
+ *comma = '\0';
+ *s = comma + 1;
+ }
+ else
+ {
+ *s = NULL;
+ }
+
+ return head;
+}
+
+
+static BOOL
+seamless_process_line(RDPCLIENT * This, const char *line, void *data)
+{
+ char *p, *l;
+ char *tok1, *tok2, *tok3, *tok4, *tok5, *tok6, *tok7, *tok8;
+ unsigned long id, flags;
+ char *endptr;
+
+ l = xstrdup(line);
+ p = l;
+
+ DEBUG_SEAMLESS(("seamlessrdp got:%s\n", p));
+
+ tok1 = seamless_get_token(&p);
+ tok2 = seamless_get_token(&p);
+ tok3 = seamless_get_token(&p);
+ tok4 = seamless_get_token(&p);
+ tok5 = seamless_get_token(&p);
+ tok6 = seamless_get_token(&p);
+ tok7 = seamless_get_token(&p);
+ tok8 = seamless_get_token(&p);
+
+ if (!strcmp("CREATE", tok1))
+ {
+ unsigned long group, parent;
+ if (!tok6)
+ return False;
+
+ id = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ group = strtoul(tok4, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ parent = strtoul(tok5, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ flags = strtoul(tok6, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_create_window(This, id, group, parent, flags);
+ }
+ else if (!strcmp("DESTROY", tok1))
+ {
+ if (!tok4)
+ return False;
+
+ id = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ flags = strtoul(tok4, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_destroy_window(This, id, flags);
+
+ }
+ else if (!strcmp("DESTROYGRP", tok1))
+ {
+ if (!tok4)
+ return False;
+
+ id = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ flags = strtoul(tok4, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_destroy_group(This, id, flags);
+ }
+ else if (!strcmp("SETICON", tok1))
+ {
+ unimpl("SeamlessRDP SETICON1\n");
+ }
+ else if (!strcmp("POSITION", tok1))
+ {
+ int x, y, width, height;
+
+ if (!tok8)
+ return False;
+
+ id = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ x = strtol(tok4, &endptr, 0);
+ if (*endptr)
+ return False;
+ y = strtol(tok5, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ width = strtol(tok6, &endptr, 0);
+ if (*endptr)
+ return False;
+ height = strtol(tok7, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ flags = strtoul(tok8, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_move_window(This, id, x, y, width, height, flags);
+ }
+ else if (!strcmp("ZCHANGE", tok1))
+ {
+ unsigned long behind;
+
+ id = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ behind = strtoul(tok4, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ flags = strtoul(tok5, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_restack_window(This, id, behind, flags);
+ }
+ else if (!strcmp("TITLE", tok1))
+ {
+ if (!tok5)
+ return False;
+
+ id = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ flags = strtoul(tok5, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_settitle(This, id, tok4, flags);
+ }
+ else if (!strcmp("STATE", tok1))
+ {
+ unsigned int state;
+
+ if (!tok5)
+ return False;
+
+ id = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ state = strtoul(tok4, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ flags = strtoul(tok5, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_setstate(This, id, state, flags);
+ }
+ else if (!strcmp("DEBUG", tok1))
+ {
+ DEBUG_SEAMLESS(("SeamlessRDP:%s\n", line));
+ }
+ else if (!strcmp("SYNCBEGIN", tok1))
+ {
+ if (!tok3)
+ return False;
+
+ flags = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_syncbegin(This, flags);
+ }
+ else if (!strcmp("SYNCEND", tok1))
+ {
+ if (!tok3)
+ return False;
+
+ flags = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ /* do nothing, currently */
+ }
+ else if (!strcmp("HELLO", tok1))
+ {
+ if (!tok3)
+ return False;
+
+ flags = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_begin(This, !!(flags & SEAMLESSRDP_HELLO_HIDDEN));
+ }
+ else if (!strcmp("ACK", tok1))
+ {
+ unsigned int serial;
+
+ serial = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_ack(This, serial);
+ }
+ else if (!strcmp("HIDE", tok1))
+ {
+ if (!tok3)
+ return False;
+
+ flags = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_hide_desktop(This);
+ }
+ else if (!strcmp("UNHIDE", tok1))
+ {
+ if (!tok3)
+ return False;
+
+ flags = strtoul(tok3, &endptr, 0);
+ if (*endptr)
+ return False;
+
+ ui_seamless_unhide_desktop(This);
+ }
+
+
+ xfree(l);
+ return True;
+}
+
+
+static BOOL
+seamless_line_handler(RDPCLIENT * This, const char *line, void *data)
+{
+ if (!seamless_process_line(This, line, data))
+ {
+ warning("SeamlessRDP: Invalid request:%s\n", line);
+ }
+ return True;
+}
+
+
+static void
+seamless_process(RDPCLIENT * This, STREAM s)
+{
+ unsigned int pkglen;
+ static char *rest = NULL;
+ char *buf;
+
+ pkglen = s->end - s->p;
+ /* str_handle_lines requires null terminated strings */
+ buf = xmalloc(pkglen + 1);
+ STRNCPY(buf, (char *) s->p, pkglen + 1);
+#if 0
+ printf("seamless recv:\n");
+ hexdump(s->p, pkglen);
+#endif
+
+ str_handle_lines(This, buf, &rest, seamless_line_handler, NULL);
+
+ xfree(buf);
+}
+
+
+BOOL
+seamless_init(RDPCLIENT * This)
+{
+ if (!This->seamless_rdp)
+ return False;
+
+ This->seamless.serial = 0;
+
+ This->seamless.channel =
+ channel_register(This, "seamrdp", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
+ seamless_process);
+ return (This->seamless.channel != NULL);
+}
+
+
+static unsigned int
+seamless_send(RDPCLIENT * This, const char *command, const char *format, ...)
+{
+ STREAM s;
+ size_t len;
+ va_list argp;
+ char buf[1025];
+
+ len = snprintf(buf, sizeof(buf) - 1, "%s,%u,", command, This->seamless.serial);
+
+ assert(len < (sizeof(buf) - 1));
+
+ va_start(argp, format);
+ len += vsnprintf(buf + len, sizeof(buf) - len - 1, format, argp);
+ va_end(argp);
+
+ assert(len < (sizeof(buf) - 1));
+
+ buf[len] = '\n';
+ buf[len + 1] = '\0';
+
+ len++;
+
+ s = channel_init(This, This->seamless.channel, len);
+ out_uint8p(s, buf, len) s_mark_end(s);
+
+ DEBUG_SEAMLESS(("SeamlessRDP sending:%s", buf));
+
+#if 0
+ printf("seamless send:\n");
+ hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8);
+#endif
+
+ channel_send(This, s, This->seamless.channel);
+
+ return This->seamless.serial++;
+}
+
+
+unsigned int
+seamless_send_sync(RDPCLIENT * This)
+{
+ if (!This->seamless_rdp)
+ return (unsigned int) -1;
+
+ return seamless_send(This, "SYNC", "");
+}
+
+
+unsigned int
+seamless_send_state(RDPCLIENT * This, unsigned long id, unsigned int state, unsigned long flags)
+{
+ if (!This->seamless_rdp)
+ return (unsigned int) -1;
+
+ return seamless_send(This, "STATE", "0x%08lx,0x%x,0x%lx", id, state, flags);
+}
+
+
+unsigned int
+seamless_send_position(RDPCLIENT * This, unsigned long id, int x, int y, int width, int height, unsigned long flags)
+{
+ return seamless_send(This, "POSITION", "0x%08lx,%d,%d,%d,%d,0x%lx", id, x, y, width, height,
+ flags);
+}
+
+
+/* Update select timeout */
+void
+seamless_select_timeout(RDPCLIENT * This, struct timeval *tv)
+{
+ struct timeval ourtimeout = { 0, SEAMLESSRDP_POSITION_TIMER };
+
+ if (This->seamless_rdp)
+ {
+ if (timercmp(&ourtimeout, tv, <))
+ {
+ tv->tv_sec = ourtimeout.tv_sec;
+ tv->tv_usec = ourtimeout.tv_usec;
+ }
+ }
+}
+
+
+unsigned int
+seamless_send_zchange(RDPCLIENT * This, unsigned long id, unsigned long below, unsigned long flags)
+{
+ if (!This->seamless_rdp)
+ return (unsigned int) -1;
+
+ return seamless_send(This, "ZCHANGE", "0x%08lx,0x%08lx,0x%lx", id, below, flags);
+}
+
+
+
+unsigned int
+seamless_send_focus(RDPCLIENT * This, unsigned long id, unsigned long flags)
+{
+ if (!This->seamless_rdp)
+ return (unsigned int) -1;
+
+ return seamless_send(This, "FOCUS", "0x%08lx,0x%lx", id, flags);
+}
--- /dev/null
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ Seamless Windows support
+ Copyright (C) Peter Astrand <astrand@cendio.se> 2005-2006
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - RDP encryption and licensing
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+#include <string.h>
+
+// TODO: remove dependency on OpenSSL
+#include <openssl/rc4.h>
+#include <openssl/md5.h>
+#include <openssl/sha.h>
+#include <openssl/bn.h>
+#include <openssl/x509v3.h>
+
+/*
+ * I believe this is based on SSLv3 with the following differences:
+ * MAC algorithm (5.2.3.1) uses only 32-bit length in place of seq_num/type/length fields
+ * MAC algorithm uses SHA1 and MD5 for the two hash functions instead of one or other
+ * key_block algorithm (6.2.2) uses 'X', 'YY', 'ZZZ' instead of 'A', 'BB', 'CCC'
+ * key_block partitioning is different (16 bytes each: MAC secret, decrypt key, encrypt key)
+ * encryption/decryption keys updated every 4096 packets
+ * See http://wp.netscape.com/eng/ssl3/draft302.txt
+ */
+
+/*
+ * 48-byte transformation used to generate master secret (6.1) and key material (6.2.2).
+ * Both SHA1 and MD5 algorithms are used.
+ */
+void
+sec_hash_48(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2, uint8 salt)
+{
+ uint8 shasig[20];
+ uint8 pad[4];
+ SHA_CTX sha;
+ MD5_CTX md5;
+ int i;
+
+ for (i = 0; i < 3; i++)
+ {
+ memset(pad, salt + i, i + 1);
+
+ SHA1_Init(&sha);
+ SHA1_Update(&sha, pad, i + 1);
+ SHA1_Update(&sha, in, 48);
+ SHA1_Update(&sha, salt1, 32);
+ SHA1_Update(&sha, salt2, 32);
+ SHA1_Final(shasig, &sha);
+
+ MD5_Init(&md5);
+ MD5_Update(&md5, in, 48);
+ MD5_Update(&md5, shasig, 20);
+ MD5_Final(&out[i * 16], &md5);
+ }
+}
+
+/*
+ * 16-byte transformation used to generate export keys (6.2.2).
+ */
+void
+sec_hash_16(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2)
+{
+ MD5_CTX md5;
+
+ MD5_Init(&md5);
+ MD5_Update(&md5, in, 16);
+ MD5_Update(&md5, salt1, 32);
+ MD5_Update(&md5, salt2, 32);
+ MD5_Final(out, &md5);
+}
+
+/* Reduce key entropy from 64 to 40 bits */
+static void
+sec_make_40bit(uint8 * key)
+{
+ key[0] = 0xd1;
+ key[1] = 0x26;
+ key[2] = 0x9e;
+}
+
+/* Generate encryption keys given client and server randoms */
+static void
+sec_generate_keys(RDPCLIENT * This, uint8 * client_random, uint8 * server_random, int rc4_key_size)
+{
+ uint8 pre_master_secret[48];
+ uint8 master_secret[48];
+ uint8 key_block[48];
+
+ /* Construct pre-master secret */
+ memcpy(pre_master_secret, client_random, 24);
+ memcpy(pre_master_secret + 24, server_random, 24);
+
+ /* Generate master secret and then key material */
+ sec_hash_48(master_secret, pre_master_secret, client_random, server_random, 'A');
+ sec_hash_48(key_block, master_secret, client_random, server_random, 'X');
+
+ /* First 16 bytes of key material is MAC secret */
+ memcpy(This->secure.sign_key, key_block, 16);
+
+ /* Generate export keys from next two blocks of 16 bytes */
+ sec_hash_16(This->secure.decrypt_key, &key_block[16], client_random, server_random);
+ sec_hash_16(This->secure.encrypt_key, &key_block[32], client_random, server_random);
+
+ if (rc4_key_size == 1)
+ {
+ DEBUG(("40-bit encryption enabled\n"));
+ sec_make_40bit(This->secure.sign_key);
+ sec_make_40bit(This->secure.decrypt_key);
+ sec_make_40bit(This->secure.encrypt_key);
+ This->secure.rc4_key_len = 8;
+ }
+ else
+ {
+ DEBUG(("rc_4_key_size == %d, 128-bit encryption enabled\n", rc4_key_size));
+ This->secure.rc4_key_len = 16;
+ }
+
+ /* Save initial RC4 keys as update keys */
+ memcpy(This->secure.decrypt_update_key, This->secure.decrypt_key, 16);
+ memcpy(This->secure.encrypt_update_key, This->secure.encrypt_key, 16);
+
+ /* Initialise RC4 state arrays */
+ RC4_set_key(&This->secure.rc4_decrypt_key, This->secure.rc4_key_len, This->secure.decrypt_key);
+ RC4_set_key(&This->secure.rc4_encrypt_key, This->secure.rc4_key_len, This->secure.encrypt_key);
+}
+
+static const uint8 pad_54[40] = {
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54
+};
+
+static const uint8 pad_92[48] = {
+ 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
+ 92, 92, 92, 92, 92, 92, 92,
+ 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
+ 92, 92, 92, 92, 92, 92, 92
+};
+
+/* Output a uint32 into a buffer (little-endian) */
+void
+buf_out_uint32(uint8 * buffer, uint32 value)
+{
+ buffer[0] = (value) & 0xff;
+ buffer[1] = (value >> 8) & 0xff;
+ buffer[2] = (value >> 16) & 0xff;
+ buffer[3] = (value >> 24) & 0xff;
+}
+
+/* Generate a MAC hash (5.2.3.1), using a combination of SHA1 and MD5 */
+void
+sec_sign(uint8 * signature, int siglen, uint8 * session_key, int keylen, uint8 * data, int datalen)
+{
+ uint8 shasig[20];
+ uint8 md5sig[16];
+ uint8 lenhdr[4];
+ SHA_CTX sha;
+ MD5_CTX md5;
+
+ buf_out_uint32(lenhdr, datalen);
+
+ SHA1_Init(&sha);
+ SHA1_Update(&sha, session_key, keylen);
+ SHA1_Update(&sha, pad_54, 40);
+ SHA1_Update(&sha, lenhdr, 4);
+ SHA1_Update(&sha, data, datalen);
+ SHA1_Final(shasig, &sha);
+
+ MD5_Init(&md5);
+ MD5_Update(&md5, session_key, keylen);
+ MD5_Update(&md5, pad_92, 48);
+ MD5_Update(&md5, shasig, 20);
+ MD5_Final(md5sig, &md5);
+
+ memcpy(signature, md5sig, siglen);
+}
+
+/* Update an encryption key */
+static void
+sec_update(RDPCLIENT * This, uint8 * key, uint8 * update_key)
+{
+ uint8 shasig[20];
+ SHA_CTX sha;
+ MD5_CTX md5;
+ RC4_KEY update;
+
+ SHA1_Init(&sha);
+ SHA1_Update(&sha, update_key, This->secure.rc4_key_len);
+ SHA1_Update(&sha, pad_54, 40);
+ SHA1_Update(&sha, key, This->secure.rc4_key_len);
+ SHA1_Final(shasig, &sha);
+
+ MD5_Init(&md5);
+ MD5_Update(&md5, update_key, This->secure.rc4_key_len);
+ MD5_Update(&md5, pad_92, 48);
+ MD5_Update(&md5, shasig, 20);
+ MD5_Final(key, &md5);
+
+ RC4_set_key(&update, This->secure.rc4_key_len, key);
+ RC4(&update, This->secure.rc4_key_len, key, key);
+
+ if (This->secure.rc4_key_len == 8)
+ sec_make_40bit(key);
+}
+
+/* Encrypt data using RC4 */
+static void
+sec_encrypt(RDPCLIENT * This, uint8 * data, int length)
+{
+ if (This->secure.encrypt_use_count == 4096)
+ {
+ sec_update(This, This->secure.encrypt_key, This->secure.encrypt_update_key);
+ RC4_set_key(&This->secure.rc4_encrypt_key, This->secure.rc4_key_len, This->secure.encrypt_key);
+ This->secure.encrypt_use_count = 0;
+ }
+
+ RC4(&This->secure.rc4_encrypt_key, length, data, data);
+ This->secure.encrypt_use_count++;
+}
+
+/* Decrypt data using RC4 */
+void
+sec_decrypt(RDPCLIENT * This, uint8 * data, int length)
+{
+ if (This->secure.decrypt_use_count == 4096)
+ {
+ sec_update(This, This->secure.decrypt_key, This->secure.decrypt_update_key);
+ RC4_set_key(&This->secure.rc4_decrypt_key, This->secure.rc4_key_len, This->secure.decrypt_key);
+ This->secure.decrypt_use_count = 0;
+ }
+
+ RC4(&This->secure.rc4_decrypt_key, length, data, data);
+ This->secure.decrypt_use_count++;
+}
+
+static void
+reverse(uint8 * p, int len)
+{
+ int i, j;
+ uint8 temp;
+
+ for (i = 0, j = len - 1; i < j; i++, j--)
+ {
+ temp = p[i];
+ p[i] = p[j];
+ p[j] = temp;
+ }
+}
+
+/* Perform an RSA public key encryption operation */
+static void
+sec_rsa_encrypt(uint8 * out, uint8 * in, int len, uint32 modulus_size, uint8 * modulus,
+ uint8 * exponent)
+{
+ BN_CTX *ctx;
+ BIGNUM mod, exp, x, y;
+ uint8 inr[SEC_MAX_MODULUS_SIZE];
+ int outlen;
+
+ reverse(modulus, modulus_size);
+ reverse(exponent, SEC_EXPONENT_SIZE);
+ memcpy(inr, in, len);
+ reverse(inr, len);
+
+ ctx = BN_CTX_new();
+ BN_init(&mod);
+ BN_init(&exp);
+ BN_init(&x);
+ BN_init(&y);
+
+ BN_bin2bn(modulus, modulus_size, &mod);
+ BN_bin2bn(exponent, SEC_EXPONENT_SIZE, &exp);
+ BN_bin2bn(inr, len, &x);
+ BN_mod_exp(&y, &x, &exp, &mod, ctx);
+ outlen = BN_bn2bin(&y, out);
+ reverse(out, outlen);
+ if ((uint32)outlen < modulus_size)
+ memset(out + outlen, 0, modulus_size - outlen);
+
+ BN_free(&y);
+ BN_clear_free(&x);
+ BN_free(&exp);
+ BN_free(&mod);
+ BN_CTX_free(ctx);
+}
+
+/* Initialise secure transport packet */
+STREAM
+sec_init(RDPCLIENT * This, uint32 flags, int maxlen)
+{
+ int hdrlen;
+ STREAM s;
+
+ if (!This->licence_issued)
+ hdrlen = (flags & SEC_ENCRYPT) ? 12 : 4;
+ else
+ hdrlen = (flags & SEC_ENCRYPT) ? 12 : 0;
+ s = mcs_init(This, maxlen + hdrlen);
+
+ if(s == NULL)
+ return s;
+
+ s_push_layer(s, sec_hdr, hdrlen);
+
+ return s;
+}
+
+/* Transmit secure transport packet over specified channel */
+
+// !!! we need a lock here !!!
+BOOL
+sec_send_to_channel(RDPCLIENT * This, STREAM s, uint32 flags, uint16 channel)
+{
+ int datalen;
+
+ s_pop_layer(s, sec_hdr);
+ if (!This->licence_issued || (flags & SEC_ENCRYPT))
+ out_uint32_le(s, flags);
+
+ if (flags & SEC_ENCRYPT)
+ {
+ flags &= ~SEC_ENCRYPT;
+ datalen = (int)(s->end - s->p - 8);
+
+#if WITH_DEBUG
+ DEBUG(("Sending encrypted packet:\n"));
+ hexdump(s->p + 8, datalen);
+#endif
+
+ sec_sign(s->p, 8, This->secure.sign_key, This->secure.rc4_key_len, s->p + 8, datalen);
+ sec_encrypt(This, s->p + 8, datalen);
+ }
+
+ return mcs_send_to_channel(This, s, channel);
+}
+
+/* Transmit secure transport packet */
+
+BOOL
+sec_send(RDPCLIENT * This, STREAM s, uint32 flags)
+{
+ return sec_send_to_channel(This, s, flags, MCS_GLOBAL_CHANNEL);
+}
+
+
+/* Transfer the client random to the server */
+static void
+sec_establish_key(RDPCLIENT * This)
+{
+ uint32 length = This->secure.server_public_key_len + SEC_PADDING_SIZE;
+ uint32 flags = SEC_CLIENT_RANDOM;
+ STREAM s;
+
+ s = sec_init(This, flags, length + 4);
+
+ out_uint32_le(s, length);
+ out_uint8p(s, This->secure.crypted_random, This->secure.server_public_key_len);
+ out_uint8s(s, SEC_PADDING_SIZE);
+
+ s_mark_end(s);
+ sec_send(This, s, flags);
+}
+
+/* Output connect initial data blob */
+static void
+sec_out_mcs_data(RDPCLIENT * This, STREAM s, wchar_t * hostname)
+{
+ int hostlen = 2 * (int)wcslen(hostname);
+ int length = 158 + 76 + 12 + 4;
+ unsigned int i;
+
+ if (This->num_channels > 0)
+ length += This->num_channels * 12 + 8;
+
+ if (hostlen > 30)
+ hostlen = 30;
+
+ /* Generic Conference Control (T.124) ConferenceCreateRequest */
+ out_uint16_be(s, 5);
+ out_uint16_be(s, 0x14);
+ out_uint8(s, 0x7c);
+ out_uint16_be(s, 1);
+
+ out_uint16_be(s, (length | 0x8000)); /* remaining length */
+
+ out_uint16_be(s, 8); /* length? */
+ out_uint16_be(s, 16);
+ out_uint8(s, 0);
+ out_uint16_le(s, 0xc001);
+ out_uint8(s, 0);
+
+ out_uint32_le(s, 0x61637544); /* OEM ID: "Duca", as in Ducati. */
+ out_uint16_be(s, ((length - 14) | 0x8000)); /* remaining length */
+
+ /* Client information */
+ out_uint16_le(s, SEC_TAG_CLI_INFO);
+ out_uint16_le(s, 212); /* length */
+ out_uint16_le(s, This->use_rdp5 ? 4 : 1); /* RDP version. 1 == RDP4, 4 == RDP5. */
+ out_uint16_le(s, 8);
+ out_uint16_le(s, This->width);
+ out_uint16_le(s, This->height);
+ out_uint16_le(s, 0xca01);
+ out_uint16_le(s, 0xaa03);
+ out_uint32_le(s, This->keylayout);
+ out_uint32_le(s, 2600); /* Client build. We are now 2600 compatible :-) */
+
+ /* Unicode name of client, padded to 32 bytes */
+ rdp_out_unistr(This, s, hostname, hostlen);
+ out_uint8s(s, 30 - hostlen);
+
+ /* See
+ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddk40/html/cxtsksupportingremotedesktopprotocol.asp */
+ out_uint32_le(s, This->keyboard_type);
+ out_uint32_le(s, This->keyboard_subtype);
+ out_uint32_le(s, This->keyboard_functionkeys);
+ out_uint8s(s, 64); /* reserved? 4 + 12 doublewords */
+ out_uint16_le(s, 0xca01); /* colour depth? */
+ out_uint16_le(s, 1);
+
+ out_uint32(s, 0);
+ out_uint8(s, This->server_depth);
+ out_uint16_le(s, 0x0700);
+ out_uint8(s, 0);
+ out_uint32_le(s, 1);
+ out_uint8s(s, 64); /* End of client info */
+
+ out_uint16_le(s, SEC_TAG_CLI_4);
+ out_uint16_le(s, 12);
+ out_uint32_le(s, This->console_session ? 0xb : 9);
+ out_uint32(s, 0);
+
+ /* Client encryption settings */
+ out_uint16_le(s, SEC_TAG_CLI_CRYPT);
+ out_uint16_le(s, 12); /* length */
+ out_uint32_le(s, This->encryption ? 0x3 : 0); /* encryption supported, 128-bit supported */
+ out_uint32(s, 0); /* Unknown */
+
+ DEBUG_RDP5(("This->num_channels is %d\n", This->num_channels));
+ if (This->num_channels > 0)
+ {
+ out_uint16_le(s, SEC_TAG_CLI_CHANNELS);
+ out_uint16_le(s, This->num_channels * 12 + 8); /* length */
+ out_uint32_le(s, This->num_channels); /* number of virtual channels */
+ for (i = 0; i < This->num_channels; i++)
+ {
+ DEBUG_RDP5(("Requesting channel %s\n", This->channels[i].name));
+ out_uint8a(s, This->channel_defs[i].name, 8);
+ out_uint32_be(s, This->channel_defs[i].options);
+ }
+ }
+
+ s_mark_end(s);
+}
+
+/* Parse a public key structure */
+static BOOL
+sec_parse_public_key(RDPCLIENT * This, STREAM s, uint8 ** modulus, uint8 ** exponent)
+{
+ uint32 magic, modulus_len;
+
+ in_uint32_le(s, magic);
+ if (magic != SEC_RSA_MAGIC)
+ {
+ error("RSA magic 0x%x\n", magic);
+ return False;
+ }
+
+ in_uint32_le(s, modulus_len);
+ modulus_len -= SEC_PADDING_SIZE;
+ if ((modulus_len < 64) || (modulus_len > SEC_MAX_MODULUS_SIZE))
+ {
+ error("Bad server public key size (%u bits)\n", modulus_len * 8);
+ return False;
+ }
+
+ in_uint8s(s, 8); /* modulus_bits, unknown */
+ in_uint8p(s, *exponent, SEC_EXPONENT_SIZE);
+ in_uint8p(s, *modulus, modulus_len);
+ in_uint8s(s, SEC_PADDING_SIZE);
+ This->secure.server_public_key_len = modulus_len;
+
+ return s_check(s);
+}
+
+static BOOL
+sec_parse_x509_key(RDPCLIENT * This, X509 * cert)
+{
+ EVP_PKEY *epk = NULL;
+ /* By some reason, Microsoft sets the OID of the Public RSA key to
+ the oid for "MD5 with RSA Encryption" instead of "RSA Encryption"
+
+ Kudos to Richard Levitte for the following (. intiutive .)
+ lines of code that resets the OID and let's us extract the key. */
+ if (OBJ_obj2nid(cert->cert_info->key->algor->algorithm) == NID_md5WithRSAEncryption)
+ {
+ DEBUG_RDP5(("Re-setting algorithm type to RSA in server certificate\n"));
+ ASN1_OBJECT_free(cert->cert_info->key->algor->algorithm);
+ cert->cert_info->key->algor->algorithm = OBJ_nid2obj(NID_rsaEncryption);
+ }
+ epk = X509_get_pubkey(cert);
+ if (NULL == epk)
+ {
+ error("Failed to extract public key from certificate\n");
+ return False;
+ }
+
+ This->secure.server_public_key = RSAPublicKey_dup((RSA *) epk->pkey.ptr);
+ EVP_PKEY_free(epk);
+
+ This->secure.server_public_key_len = RSA_size(This->secure.server_public_key);
+ if ((This->secure.server_public_key_len < 64) || (This->secure.server_public_key_len > SEC_MAX_MODULUS_SIZE))
+ {
+ error("Bad server public key size (%u bits)\n", This->secure.server_public_key_len * 8);
+ return False;
+ }
+
+ return True;
+}
+
+
+/* Parse a crypto information structure */
+static BOOL
+sec_parse_crypt_info(RDPCLIENT * This, STREAM s, uint32 * rc4_key_size,
+ uint8 ** server_random, uint8 ** modulus, uint8 ** exponent)
+{
+ uint32 crypt_level, random_len, rsa_info_len;
+ uint32 cacert_len, cert_len, flags;
+ X509 *cacert, *server_cert;
+ uint16 tag, length;
+ uint8 *next_tag, *end;
+
+ in_uint32_le(s, *rc4_key_size); /* 1 = 40-bit, 2 = 128-bit */
+ in_uint32_le(s, crypt_level); /* 1 = low, 2 = medium, 3 = high */
+ if (crypt_level == 0) /* no encryption */
+ return False;
+ in_uint32_le(s, random_len);
+ in_uint32_le(s, rsa_info_len);
+
+ if (random_len != SEC_RANDOM_SIZE)
+ {
+ error("random len %d, expected %d\n", random_len, SEC_RANDOM_SIZE);
+ return False;
+ }
+
+ in_uint8p(s, *server_random, random_len);
+
+ /* RSA info */
+ end = s->p + rsa_info_len;
+ if (end > s->end)
+ return False;
+
+ in_uint32_le(s, flags); /* 1 = RDP4-style, 0x80000002 = X.509 */
+ if (flags & 1)
+ {
+ DEBUG_RDP5(("We're going for the RDP4-style encryption\n"));
+ in_uint8s(s, 8); /* unknown */
+
+ while (s->p < end)
+ {
+ in_uint16_le(s, tag);
+ in_uint16_le(s, length);
+
+ next_tag = s->p + length;
+
+ switch (tag)
+ {
+ case SEC_TAG_PUBKEY:
+ if (!sec_parse_public_key(This, s, modulus, exponent))
+ return False;
+ DEBUG_RDP5(("Got Public key, RDP4-style\n"));
+
+ break;
+
+ case SEC_TAG_KEYSIG:
+ /* Is this a Microsoft key that we just got? */
+ /* Care factor: zero! */
+ /* Actually, it would probably be a good idea to check if the public key is signed with this key, and then store this
+ key as a known key of the hostname. This would prevent some MITM-attacks. */
+ break;
+
+ default:
+ unimpl("crypt tag 0x%x\n", tag);
+ }
+
+ s->p = next_tag;
+ }
+ }
+ else
+ {
+ uint32 certcount;
+
+ DEBUG_RDP5(("We're going for the RDP5-style encryption\n"));
+ in_uint32_le(s, certcount); /* Number of certificates */
+
+ if (certcount < 2)
+ {
+ error("Server didn't send enough X509 certificates\n");
+ This->disconnect_reason = 1798;
+ return False;
+ }
+
+ for (; certcount > 2; certcount--)
+ { /* ignore all the certificates between the root and the signing CA */
+ uint32 ignorelen;
+ X509 *ignorecert;
+
+ DEBUG_RDP5(("Ignored certs left: %d\n", certcount));
+
+ in_uint32_le(s, ignorelen);
+ DEBUG_RDP5(("Ignored Certificate length is %d\n", ignorelen));
+ ignorecert = d2i_X509(NULL, &(s->p), ignorelen);
+
+ if (ignorecert == NULL)
+ { /* XXX: error out? */
+ DEBUG_RDP5(("got a bad cert: this will probably screw up the rest of the communication\n"));
+ }
+
+#ifdef WITH_DEBUG_RDP5
+ DEBUG_RDP5(("cert #%d (ignored):\n", certcount));
+ X509_print_fp(stdout, ignorecert);
+#endif
+ }
+
+ /* Do da funky X.509 stuffy
+
+ "How did I find out about this? I looked up and saw a
+ bright light and when I came to I had a scar on my forehead
+ and knew about X.500"
+ - Peter Gutman in a early version of
+ http://www.cs.auckland.ac.nz/~pgut001/pubs/x509guide.txt
+ */
+
+ in_uint32_le(s, cacert_len);
+ DEBUG_RDP5(("CA Certificate length is %d\n", cacert_len));
+ cacert = d2i_X509(NULL, &(s->p), cacert_len);
+ /* Note: We don't need to move s->p here - d2i_X509 is
+ "kind" enough to do it for us */
+ if (NULL == cacert)
+ {
+ error("Couldn't load CA Certificate from server\n");
+ This->disconnect_reason = 1798;
+ return False;
+ }
+
+ /* Currently, we don't use the CA Certificate.
+ FIXME:
+ *) Verify the server certificate (server_cert) with the
+ CA certificate.
+ *) Store the CA Certificate with the hostname of the
+ server we are connecting to as key, and compare it
+ when we connect the next time, in order to prevent
+ MITM-attacks.
+ */
+
+ X509_free(cacert);
+
+ in_uint32_le(s, cert_len);
+ DEBUG_RDP5(("Certificate length is %d\n", cert_len));
+ server_cert = d2i_X509(NULL, &(s->p), cert_len);
+ if (NULL == server_cert)
+ {
+ error("Couldn't load Certificate from server\n");
+ This->disconnect_reason = 1798;
+ return False;
+ }
+
+ in_uint8s(s, 16); /* Padding */
+
+ /* Note: Verifying the server certificate must be done here,
+ before sec_parse_public_key since we'll have to apply
+ serious violence to the key after this */
+
+ if (!sec_parse_x509_key(This, server_cert))
+ {
+ DEBUG_RDP5(("Didn't parse X509 correctly\n"));
+ X509_free(server_cert);
+ This->disconnect_reason = 1798;
+ return False;
+ }
+ X509_free(server_cert);
+ return True; /* There's some garbage here we don't care about */
+ }
+ return s_check_end(s);
+}
+
+/* Process crypto information blob */
+static void
+sec_process_crypt_info(RDPCLIENT * This, STREAM s)
+{
+ uint8 *server_random, *modulus, *exponent;
+ uint8 client_random[SEC_RANDOM_SIZE];
+ uint32 rc4_key_size;
+
+ if (!sec_parse_crypt_info(This, s, &rc4_key_size, &server_random, &modulus, &exponent))
+ {
+ DEBUG(("Failed to parse crypt info\n"));
+ return;
+ }
+
+ DEBUG(("Generating client random\n"));
+ generate_random(client_random);
+
+ if (NULL != This->secure.server_public_key)
+ { /* Which means we should use
+ RDP5-style encryption */
+ uint8 inr[SEC_MAX_MODULUS_SIZE];
+ uint32 padding_len = This->secure.server_public_key_len - SEC_RANDOM_SIZE;
+
+ /* This is what the MS client do: */
+ memset(inr, 0, padding_len);
+ /* *ARIGL!* Plaintext attack, anyone?
+ I tried doing:
+ generate_random(inr);
+ ..but that generates connection errors now and then (yes,
+ "now and then". Something like 0 to 3 attempts needed before a
+ successful connection. Nice. Not!
+ */
+ memcpy(inr + padding_len, client_random, SEC_RANDOM_SIZE);
+ reverse(inr + padding_len, SEC_RANDOM_SIZE);
+
+ RSA_public_encrypt(This->secure.server_public_key_len,
+ inr, This->secure.crypted_random, This->secure.server_public_key, RSA_NO_PADDING);
+
+ reverse(This->secure.crypted_random, This->secure.server_public_key_len);
+
+ RSA_free(This->secure.server_public_key);
+ This->secure.server_public_key = NULL;
+ }
+ else
+ { /* RDP4-style encryption */
+ sec_rsa_encrypt(This->secure.crypted_random,
+ client_random, SEC_RANDOM_SIZE, This->secure.server_public_key_len, modulus,
+ exponent);
+ }
+ sec_generate_keys(This, client_random, server_random, rc4_key_size);
+}
+
+
+/* Process SRV_INFO, find RDP version supported by server */
+static void
+sec_process_srv_info(RDPCLIENT * This, STREAM s)
+{
+ in_uint16_le(s, This->server_rdp_version);
+ DEBUG_RDP5(("Server RDP version is %d\n", This->server_rdp_version));
+ if (1 == This->server_rdp_version)
+ {
+ This->use_rdp5 = 0;
+ This->server_depth = 8;
+ }
+}
+
+
+/* Process connect response data blob */
+void
+sec_process_mcs_data(RDPCLIENT * This, STREAM s)
+{
+ uint16 tag, length;
+ uint8 *next_tag;
+ uint8 len;
+
+ in_uint8s(s, 21); /* header (T.124 ConferenceCreateResponse) */
+ in_uint8(s, len);
+ if (len & 0x80)
+ in_uint8(s, len);
+
+ while (s->p < s->end)
+ {
+ in_uint16_le(s, tag);
+ in_uint16_le(s, length);
+
+ if (length <= 4)
+ return;
+
+ next_tag = s->p + length - 4;
+
+ switch (tag)
+ {
+ case SEC_TAG_SRV_INFO:
+ sec_process_srv_info(This, s);
+ break;
+
+ case SEC_TAG_SRV_CRYPT:
+ sec_process_crypt_info(This, s);
+ break;
+
+ case SEC_TAG_SRV_CHANNELS:
+ /* FIXME: We should parse this information and
+ use it to map RDP5 channels to MCS
+ channels */
+ break;
+
+ default:
+ unimpl("response tag 0x%x\n", tag);
+ }
+
+ s->p = next_tag;
+ }
+}
+
+/* Receive secure transport packet */
+STREAM
+sec_recv(RDPCLIENT * This, uint8 * rdpver)
+{
+ uint32 sec_flags;
+ uint16 channel;
+ STREAM s;
+
+ while ((s = mcs_recv(This, &channel, rdpver)) != NULL)
+ {
+ if (rdpver != NULL)
+ {
+ if (*rdpver != 3)
+ {
+ if (*rdpver & 0x80)
+ {
+ in_uint8s(s, 8); /* signature */
+ sec_decrypt(This, s->p, (int)(s->end - s->p));
+ }
+ return s;
+ }
+ }
+ if (This->encryption || !This->licence_issued)
+ {
+ in_uint32_le(s, sec_flags);
+
+ if (sec_flags & SEC_ENCRYPT)
+ {
+ in_uint8s(s, 8); /* signature */
+ sec_decrypt(This, s->p, (int)(s->end - s->p));
+ }
+
+ if (sec_flags & SEC_LICENCE_NEG)
+ {
+ licence_process(This, s);
+ continue;
+ }
+
+ if (sec_flags & 0x0400) /* SEC_REDIRECT_ENCRYPT */
+ {
+ uint8 swapbyte;
+
+ in_uint8s(s, 8); /* signature */
+ sec_decrypt(This, s->p, (int)(s->end - s->p));
+
+ /* Check for a redirect packet, starts with 00 04 */
+ if (s->p[0] == 0 && s->p[1] == 4)
+ {
+ /* for some reason the PDU and the length seem to be swapped.
+ This isn't good, but we're going to do a byte for byte
+ swap. So the first foure value appear as: 00 04 XX YY,
+ where XX YY is the little endian length. We're going to
+ use 04 00 as the PDU type, so after our swap this will look
+ like: XX YY 04 00 */
+ swapbyte = s->p[0];
+ s->p[0] = s->p[2];
+ s->p[2] = swapbyte;
+
+ swapbyte = s->p[1];
+ s->p[1] = s->p[3];
+ s->p[3] = swapbyte;
+
+ swapbyte = s->p[2];
+ s->p[2] = s->p[3];
+ s->p[3] = swapbyte;
+ }
+#ifdef WITH_DEBUG
+ /* warning! this debug statement will show passwords in the clear! */
+ hexdump(s->p, s->end - s->p);
+#endif
+ }
+
+ }
+
+ if (channel != MCS_GLOBAL_CHANNEL)
+ {
+ channel_process(This, s, channel);
+ *rdpver = 0xff;
+ return s;
+ }
+
+ return s;
+ }
+
+ return NULL;
+}
+
+/* Establish a secure connection */
+BOOL
+sec_connect(RDPCLIENT * This, char *server, wchar_t *hostname, char *cookie)
+{
+ struct stream mcs_data;
+ void * p = malloc(512);
+
+ if(p == NULL)
+ {
+ This->disconnect_reason = 262;
+ return False;
+ }
+
+ /* We exchange some RDP data during the MCS-Connect */
+ mcs_data.size = 512;
+ mcs_data.p = mcs_data.data = (uint8 *) p;
+ sec_out_mcs_data(This, &mcs_data, hostname);
+
+ if (!mcs_connect(This, server, cookie, &mcs_data))
+ return False;
+
+ /* sec_process_mcs_data(&mcs_data); */
+ if (This->encryption)
+ sec_establish_key(This);
+ free(mcs_data.data);
+ return True;
+}
+
+/* Establish a secure connection */
+BOOL
+sec_reconnect(RDPCLIENT * This, char *server, wchar_t *hostname, char *cookie)
+{
+ struct stream mcs_data;
+ void * p = malloc(512);
+
+ if(p == NULL)
+ {
+ This->disconnect_reason = 262;
+ return False;
+ }
+
+ /* We exchange some RDP data during the MCS-Connect */
+ mcs_data.size = 512;
+ mcs_data.p = mcs_data.data = (uint8 *) p;
+ sec_out_mcs_data(This, &mcs_data, hostname);
+
+ if (!mcs_reconnect(This, server, cookie, &mcs_data))
+ return False;
+
+ /* sec_process_mcs_data(&mcs_data); */
+ if (This->encryption)
+ sec_establish_key(This);
+ free(mcs_data.data);
+ return True;
+}
+
+/* Disconnect a connection */
+void
+sec_disconnect(RDPCLIENT * This)
+{
+ mcs_disconnect(This);
+}
+
+/* reset the state of the sec layer */
+void
+sec_reset_state(RDPCLIENT * This)
+{
+ This->server_rdp_version = 0;
+ This->secure.encrypt_use_count = 0;
+ This->secure.decrypt_use_count = 0;
+ mcs_reset_state(This);
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+#include <unistd.h>
+#include <fcntl.h>
+#include <termios.h>
+#include <strings.h>
+#include <sys/ioctl.h>
+
+#ifdef HAVE_SYS_MODEM_H
+#include <sys/modem.h>
+#endif
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
+#ifdef HAVE_SYS_STRTIO_H
+#include <sys/strtio.h>
+#endif
+
+#include "rdesktop.h"
+
+#ifdef WITH_DEBUG_SERIAL
+#define DEBUG_SERIAL(args) printf args;
+#else
+#define DEBUG_SERIAL(args)
+#endif
+
+#define FILE_DEVICE_SERIAL_PORT 0x1b
+
+#define SERIAL_SET_BAUD_RATE 1
+#define SERIAL_SET_QUEUE_SIZE 2
+#define SERIAL_SET_LINE_CONTROL 3
+#define SERIAL_SET_BREAK_ON 4
+#define SERIAL_SET_BREAK_OFF 5
+#define SERIAL_IMMEDIATE_CHAR 6
+#define SERIAL_SET_TIMEOUTS 7
+#define SERIAL_GET_TIMEOUTS 8
+#define SERIAL_SET_DTR 9
+#define SERIAL_CLR_DTR 10
+#define SERIAL_RESET_DEVICE 11
+#define SERIAL_SET_RTS 12
+#define SERIAL_CLR_RTS 13
+#define SERIAL_SET_XOFF 14
+#define SERIAL_SET_XON 15
+#define SERIAL_GET_WAIT_MASK 16
+#define SERIAL_SET_WAIT_MASK 17
+#define SERIAL_WAIT_ON_MASK 18
+#define SERIAL_PURGE 19
+#define SERIAL_GET_BAUD_RATE 20
+#define SERIAL_GET_LINE_CONTROL 21
+#define SERIAL_GET_CHARS 22
+#define SERIAL_SET_CHARS 23
+#define SERIAL_GET_HANDFLOW 24
+#define SERIAL_SET_HANDFLOW 25
+#define SERIAL_GET_MODEMSTATUS 26
+#define SERIAL_GET_COMMSTATUS 27
+#define SERIAL_XOFF_COUNTER 28
+#define SERIAL_GET_PROPERTIES 29
+#define SERIAL_GET_DTRRTS 30
+#define SERIAL_LSRMST_INSERT 31
+#define SERIAL_CONFIG_SIZE 32
+#define SERIAL_GET_COMMCONFIG 33
+#define SERIAL_SET_COMMCONFIG 34
+#define SERIAL_GET_STATS 35
+#define SERIAL_CLEAR_STATS 36
+#define SERIAL_GET_MODEM_CONTROL 37
+#define SERIAL_SET_MODEM_CONTROL 38
+#define SERIAL_SET_FIFO_CONTROL 39
+
+#define STOP_BITS_1 0
+#define STOP_BITS_2 2
+
+#define NO_PARITY 0
+#define ODD_PARITY 1
+#define EVEN_PARITY 2
+
+#define SERIAL_PURGE_TXABORT 0x00000001
+#define SERIAL_PURGE_RXABORT 0x00000002
+#define SERIAL_PURGE_TXCLEAR 0x00000004
+#define SERIAL_PURGE_RXCLEAR 0x00000008
+
+/* SERIAL_WAIT_ON_MASK */
+#define SERIAL_EV_RXCHAR 0x0001 /* Any Character received */
+#define SERIAL_EV_RXFLAG 0x0002 /* Received certain character */
+#define SERIAL_EV_TXEMPTY 0x0004 /* Transmitt Queue Empty */
+#define SERIAL_EV_CTS 0x0008 /* CTS changed state */
+#define SERIAL_EV_DSR 0x0010 /* DSR changed state */
+#define SERIAL_EV_RLSD 0x0020 /* RLSD changed state */
+#define SERIAL_EV_BREAK 0x0040 /* BREAK received */
+#define SERIAL_EV_ERR 0x0080 /* Line status error occurred */
+#define SERIAL_EV_RING 0x0100 /* Ring signal detected */
+#define SERIAL_EV_PERR 0x0200 /* Printer error occured */
+#define SERIAL_EV_RX80FULL 0x0400 /* Receive buffer is 80 percent full */
+#define SERIAL_EV_EVENT1 0x0800 /* Provider specific event 1 */
+#define SERIAL_EV_EVENT2 0x1000 /* Provider specific event 2 */
+
+/* Modem Status */
+#define SERIAL_MS_DTR 0x01
+#define SERIAL_MS_RTS 0x02
+#define SERIAL_MS_CTS 0x10
+#define SERIAL_MS_DSR 0x20
+#define SERIAL_MS_RNG 0x40
+#define SERIAL_MS_CAR 0x80
+
+/* Handflow */
+#define SERIAL_DTR_CONTROL 0x01
+#define SERIAL_CTS_HANDSHAKE 0x08
+#define SERIAL_ERROR_ABORT 0x80000000
+
+#define SERIAL_XON_HANDSHAKE 0x01
+#define SERIAL_XOFF_HANDSHAKE 0x02
+#define SERIAL_DSR_SENSITIVITY 0x40
+
+#define SERIAL_CHAR_EOF 0
+#define SERIAL_CHAR_ERROR 1
+#define SERIAL_CHAR_BREAK 2
+#define SERIAL_CHAR_EVENT 3
+#define SERIAL_CHAR_XON 4
+#define SERIAL_CHAR_XOFF 5
+
+#ifndef CRTSCTS
+#define CRTSCTS 0
+#endif
+
+/* FIONREAD should really do the same thing as TIOCINQ, where it is
+ * not available */
+#if !defined(TIOCINQ) && defined(FIONREAD)
+#define TIOCINQ FIONREAD
+#endif
+#if !defined(TIOCOUTQ) && defined(FIONWRITE)
+#define TIOCOUTQ FIONWRITE
+#endif
+
+static SERIAL_DEVICE *
+get_serial_info(RDPCLIENT * This, NTHANDLE handle)
+{
+ int index;
+
+ for (index = 0; index < RDPDR_MAX_DEVICES; index++)
+ {
+ if (handle == This->rdpdr_device[index].handle)
+ return (SERIAL_DEVICE *) This->rdpdr_device[index].pdevice_data;
+ }
+ return NULL;
+}
+
+static BOOL
+get_termios(SERIAL_DEVICE * pser_inf, NTHANDLE serial_fd)
+{
+ speed_t speed;
+ struct termios *ptermios;
+
+ ptermios = pser_inf->ptermios;
+
+ if (tcgetattr(serial_fd, ptermios) == -1)
+ return False;
+
+ speed = cfgetispeed(ptermios);
+ switch (speed)
+ {
+#ifdef B75
+ case B75:
+ pser_inf->baud_rate = 75;
+ break;
+#endif
+#ifdef B110
+ case B110:
+ pser_inf->baud_rate = 110;
+ break;
+#endif
+#ifdef B134
+ case B134:
+ pser_inf->baud_rate = 134;
+ break;
+#endif
+#ifdef B150
+ case B150:
+ pser_inf->baud_rate = 150;
+ break;
+#endif
+#ifdef B300
+ case B300:
+ pser_inf->baud_rate = 300;
+ break;
+#endif
+#ifdef B600
+ case B600:
+ pser_inf->baud_rate = 600;
+ break;
+#endif
+#ifdef B1200
+ case B1200:
+ pser_inf->baud_rate = 1200;
+ break;
+#endif
+#ifdef B1800
+ case B1800:
+ pser_inf->baud_rate = 1800;
+ break;
+#endif
+#ifdef B2400
+ case B2400:
+ pser_inf->baud_rate = 2400;
+ break;
+#endif
+#ifdef B4800
+ case B4800:
+ pser_inf->baud_rate = 4800;
+ break;
+#endif
+#ifdef B9600
+ case B9600:
+ pser_inf->baud_rate = 9600;
+ break;
+#endif
+#ifdef B19200
+ case B19200:
+ pser_inf->baud_rate = 19200;
+ break;
+#endif
+#ifdef B38400
+ case B38400:
+ pser_inf->baud_rate = 38400;
+ break;
+#endif
+#ifdef B57600
+ case B57600:
+ pser_inf->baud_rate = 57600;
+ break;
+#endif
+#ifdef B115200
+ case B115200:
+ pser_inf->baud_rate = 115200;
+ break;
+#endif
+#ifdef B230400
+ case B230400:
+ pser_inf->baud_rate = 230400;
+ break;
+#endif
+#ifdef B460800
+ case B460800:
+ pser_inf->baud_rate = 460800;
+ break;
+#endif
+ default:
+ pser_inf->baud_rate = 9600;
+ break;
+ }
+
+ speed = cfgetospeed(ptermios);
+ pser_inf->dtr = (speed == B0) ? 0 : 1;
+
+ pser_inf->stop_bits = (ptermios->c_cflag & CSTOPB) ? STOP_BITS_2 : STOP_BITS_1;
+ pser_inf->parity =
+ (ptermios->
+ c_cflag & PARENB) ? ((ptermios->
+ c_cflag & PARODD) ? ODD_PARITY : EVEN_PARITY) : NO_PARITY;
+ switch (ptermios->c_cflag & CSIZE)
+ {
+ case CS5:
+ pser_inf->word_length = 5;
+ break;
+ case CS6:
+ pser_inf->word_length = 6;
+ break;
+ case CS7:
+ pser_inf->word_length = 7;
+ break;
+ default:
+ pser_inf->word_length = 8;
+ break;
+ }
+
+ if (ptermios->c_cflag & CRTSCTS)
+ {
+ pser_inf->control = SERIAL_DTR_CONTROL | SERIAL_CTS_HANDSHAKE | SERIAL_ERROR_ABORT;
+ }
+ else
+ {
+ pser_inf->control = SERIAL_DTR_CONTROL | SERIAL_ERROR_ABORT;
+ }
+
+ pser_inf->xonoff = SERIAL_DSR_SENSITIVITY;
+ if (ptermios->c_iflag & IXON)
+ pser_inf->xonoff |= SERIAL_XON_HANDSHAKE;
+
+ if (ptermios->c_iflag & IXOFF)
+ pser_inf->xonoff |= SERIAL_XOFF_HANDSHAKE;
+
+ pser_inf->chars[SERIAL_CHAR_XON] = ptermios->c_cc[VSTART];
+ pser_inf->chars[SERIAL_CHAR_XOFF] = ptermios->c_cc[VSTOP];
+ pser_inf->chars[SERIAL_CHAR_EOF] = ptermios->c_cc[VEOF];
+ pser_inf->chars[SERIAL_CHAR_BREAK] = ptermios->c_cc[VINTR];
+ pser_inf->chars[SERIAL_CHAR_ERROR] = ptermios->c_cc[VKILL];
+
+ return True;
+}
+
+static void
+set_termios(SERIAL_DEVICE * pser_inf, NTHANDLE serial_fd)
+{
+ speed_t speed;
+
+ struct termios *ptermios;
+
+ ptermios = pser_inf->ptermios;
+
+
+ switch (pser_inf->baud_rate)
+ {
+#ifdef B75
+ case 75:
+ speed = B75;
+ break;
+#endif
+#ifdef B110
+ case 110:
+ speed = B110;
+ break;
+#endif
+#ifdef B134
+ case 134:
+ speed = B134;
+ break;
+#endif
+#ifdef B150
+ case 150:
+ speed = B150;
+ break;
+#endif
+#ifdef B300
+ case 300:
+ speed = B300;
+ break;
+#endif
+#ifdef B600
+ case 600:
+ speed = B600;
+ break;
+#endif
+#ifdef B1200
+ case 1200:
+ speed = B1200;
+ break;
+#endif
+#ifdef B1800
+ case 1800:
+ speed = B1800;
+ break;
+#endif
+#ifdef B2400
+ case 2400:
+ speed = B2400;
+ break;
+#endif
+#ifdef B4800
+ case 4800:
+ speed = B4800;
+ break;
+#endif
+#ifdef B9600
+ case 9600:
+ speed = B9600;
+ break;
+#endif
+#ifdef B19200
+ case 19200:
+ speed = B19200;
+ break;
+#endif
+#ifdef B38400
+ case 38400:
+ speed = B38400;
+ break;
+#endif
+#ifdef B57600
+ case 57600:
+ speed = B57600;
+ break;
+#endif
+#ifdef B115200
+ case 115200:
+ speed = B115200;
+ break;
+#endif
+#ifdef B230400
+ case 230400:
+ speed = B115200;
+ break;
+#endif
+#ifdef B460800
+ case 460800:
+ speed = B115200;
+ break;
+#endif
+ default:
+ speed = B9600;
+ break;
+ }
+
+#ifdef CBAUD
+ ptermios->c_cflag &= ~CBAUD;
+ ptermios->c_cflag |= speed;
+#else
+ /* on systems with separate ispeed and ospeed, we can remember the speed
+ in ispeed while changing DTR with ospeed */
+ cfsetispeed(pser_inf->ptermios, speed);
+ cfsetospeed(pser_inf->ptermios, pser_inf->dtr ? speed : 0);
+#endif
+
+ ptermios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CSIZE | CRTSCTS);
+ switch (pser_inf->stop_bits)
+ {
+ case STOP_BITS_2:
+ ptermios->c_cflag |= CSTOPB;
+ break;
+ default:
+ ptermios->c_cflag &= ~CSTOPB;
+ break;
+ }
+
+ switch (pser_inf->parity)
+ {
+ case EVEN_PARITY:
+ ptermios->c_cflag |= PARENB;
+ break;
+ case ODD_PARITY:
+ ptermios->c_cflag |= PARENB | PARODD;
+ break;
+ case NO_PARITY:
+ ptermios->c_cflag &= ~(PARENB | PARODD);
+ break;
+ }
+
+ switch (pser_inf->word_length)
+ {
+ case 5:
+ ptermios->c_cflag |= CS5;
+ break;
+ case 6:
+ ptermios->c_cflag |= CS6;
+ break;
+ case 7:
+ ptermios->c_cflag |= CS7;
+ break;
+ default:
+ ptermios->c_cflag |= CS8;
+ break;
+ }
+
+#if 0
+ if (pser_inf->rts)
+ ptermios->c_cflag |= CRTSCTS;
+ else
+ ptermios->c_cflag &= ~CRTSCTS;
+#endif
+
+ if (pser_inf->control & SERIAL_CTS_HANDSHAKE)
+ {
+ ptermios->c_cflag |= CRTSCTS;
+ }
+ else
+ {
+ ptermios->c_cflag &= ~CRTSCTS;
+ }
+
+
+ if (pser_inf->xonoff & SERIAL_XON_HANDSHAKE)
+ {
+ ptermios->c_iflag |= IXON | IMAXBEL;
+ }
+ if (pser_inf->xonoff & SERIAL_XOFF_HANDSHAKE)
+ {
+ ptermios->c_iflag |= IXOFF | IMAXBEL;
+ }
+
+ if ((pser_inf->xonoff & (SERIAL_XOFF_HANDSHAKE | SERIAL_XON_HANDSHAKE)) == 0)
+ {
+ ptermios->c_iflag &= ~IXON;
+ ptermios->c_iflag &= ~IXOFF;
+ }
+
+ ptermios->c_cc[VSTART] = pser_inf->chars[SERIAL_CHAR_XON];
+ ptermios->c_cc[VSTOP] = pser_inf->chars[SERIAL_CHAR_XOFF];
+ ptermios->c_cc[VEOF] = pser_inf->chars[SERIAL_CHAR_EOF];
+ ptermios->c_cc[VINTR] = pser_inf->chars[SERIAL_CHAR_BREAK];
+ ptermios->c_cc[VKILL] = pser_inf->chars[SERIAL_CHAR_ERROR];
+
+ tcsetattr(serial_fd, TCSANOW, ptermios);
+}
+
+/* Enumeration of devices from rdesktop.c */
+/* returns numer of units found and initialized. */
+/* optarg looks like ':com1=/dev/ttyS0' */
+/* when it arrives to this function. */
+/* :com1=/dev/ttyS0,com2=/dev/ttyS1 */
+int
+serial_enum_devices(RDPCLIENT * This, uint32 * id, char *optarg)
+{
+ SERIAL_DEVICE *pser_inf;
+
+ char *pos = optarg;
+ char *pos2;
+ int count = 0;
+
+ /* skip the first colon */
+ optarg++;
+ while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
+ {
+ /* Init data structures for device */
+ pser_inf = (SERIAL_DEVICE *) xmalloc(sizeof(SERIAL_DEVICE));
+ pser_inf->ptermios = (struct termios *) xmalloc(sizeof(struct termios));
+ memset(pser_inf->ptermios, 0, sizeof(struct termios));
+ pser_inf->pold_termios = (struct termios *) xmalloc(sizeof(struct termios));
+ memset(pser_inf->pold_termios, 0, sizeof(struct termios));
+
+ pos2 = next_arg(optarg, '=');
+ strcpy(This->rdpdr_device[*id].name, optarg);
+
+ toupper_str(This->rdpdr_device[*id].name);
+
+ This->rdpdr_device[*id].local_path = xmalloc(strlen(pos2) + 1);
+ strcpy(This->rdpdr_device[*id].local_path, pos2);
+ printf("SERIAL %s to %s\n", This->rdpdr_device[*id].name,
+ This->rdpdr_device[*id].local_path);
+ /* set device type */
+ This->rdpdr_device[*id].device_type = DEVICE_TYPE_SERIAL;
+ This->rdpdr_device[*id].pdevice_data = (void *) pser_inf;
+ count++;
+ (*id)++;
+
+ optarg = pos;
+ }
+ return count;
+}
+
+static NTSTATUS
+serial_create(RDPCLIENT * This, uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition,
+ uint32 flags_and_attributes, char *filename, NTHANDLE * handle)
+{
+ NTHANDLE serial_fd;
+ SERIAL_DEVICE *pser_inf;
+ struct termios *ptermios;
+
+ pser_inf = (SERIAL_DEVICE *) This->rdpdr_device[device_id].pdevice_data;
+ ptermios = pser_inf->ptermios;
+ serial_fd = open(This->rdpdr_device[device_id].local_path, O_RDWR | O_NOCTTY | O_NONBLOCK);
+
+ if (serial_fd == -1)
+ {
+ perror("open");
+ return STATUS_ACCESS_DENIED;
+ }
+
+ if (!get_termios(pser_inf, serial_fd))
+ {
+ printf("INFO: SERIAL %s access denied\n", This->rdpdr_device[device_id].name);
+ fflush(stdout);
+ return STATUS_ACCESS_DENIED;
+ }
+
+ /* Store handle for later use */
+ This->rdpdr_device[device_id].handle = serial_fd;
+
+ /* some sane information */
+ DEBUG_SERIAL(("INFO: SERIAL %s to %s\nINFO: speed %u baud, stop bits %u, parity %u, word length %u bits, dtr %u, rts %u\n", This->rdpdr_device[device_id].name, This->rdpdr_device[device_id].local_path, pser_inf->baud_rate, pser_inf->stop_bits, pser_inf->parity, pser_inf->word_length, pser_inf->dtr, pser_inf->rts));
+
+ pser_inf->ptermios->c_iflag &=
+ ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
+ pser_inf->ptermios->c_oflag &= ~OPOST;
+ pser_inf->ptermios->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
+ pser_inf->ptermios->c_cflag &= ~(CSIZE | PARENB);
+ pser_inf->ptermios->c_cflag |= CS8;
+
+ tcsetattr(serial_fd, TCSANOW, pser_inf->ptermios);
+
+ pser_inf->event_txempty = 0;
+ pser_inf->event_cts = 0;
+ pser_inf->event_dsr = 0;
+ pser_inf->event_rlsd = 0;
+ pser_inf->event_pending = 0;
+
+ *handle = serial_fd;
+
+ /* all read and writes should be non blocking */
+ if (fcntl(*handle, F_SETFL, O_NONBLOCK) == -1)
+ perror("fcntl");
+
+ pser_inf->read_total_timeout_constant = 5;
+
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+serial_close(RDPCLIENT * This, NTHANDLE handle)
+{
+ int i = get_device_index(This, handle);
+ if (i >= 0)
+ This->rdpdr_device[i].handle = 0;
+
+ rdpdr_abort_io(This, handle, 0, STATUS_TIMEOUT);
+ close(handle);
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+serial_read(RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
+{
+ long timeout;
+ SERIAL_DEVICE *pser_inf;
+ struct termios *ptermios;
+#ifdef WITH_DEBUG_SERIAL
+ int bytes_inqueue;
+#endif
+
+
+ timeout = 90;
+ pser_inf = get_serial_info(This, handle);
+ ptermios = pser_inf->ptermios;
+
+ /* Set timeouts kind of like the windows serial timeout parameters. Multiply timeout
+ with requested read size */
+ if (pser_inf->read_total_timeout_multiplier | pser_inf->read_total_timeout_constant)
+ {
+ timeout =
+ (pser_inf->read_total_timeout_multiplier * length +
+ pser_inf->read_total_timeout_constant + 99) / 100;
+ }
+ else if (pser_inf->read_interval_timeout)
+ {
+ timeout = (pser_inf->read_interval_timeout * length + 99) / 100;
+ }
+
+ /* If a timeout is set, do a blocking read, which times out after some time.
+ It will make rdesktop less responsive, but it will improve serial performance, by not
+ reading one character at a time. */
+ if (timeout == 0)
+ {
+ ptermios->c_cc[VTIME] = 0;
+ ptermios->c_cc[VMIN] = 0;
+ }
+ else
+ {
+ ptermios->c_cc[VTIME] = timeout;
+ ptermios->c_cc[VMIN] = 1;
+ }
+ tcsetattr(handle, TCSANOW, ptermios);
+
+#if defined(WITH_DEBUG_SERIAL) && defined(TIOCINQ)
+ ioctl(handle, TIOCINQ, &bytes_inqueue);
+ DEBUG_SERIAL(("serial_read inqueue: %d expected %d\n", bytes_inqueue, length));
+#endif
+
+ *result = read(handle, data, length);
+
+#ifdef WITH_DEBUG_SERIAL
+ DEBUG_SERIAL(("serial_read Bytes %d\n", *result));
+ if (*result > 0)
+ hexdump(data, *result);
+#endif
+
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+serial_write(RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32 * result)
+{
+ SERIAL_DEVICE *pser_inf;
+
+ pser_inf = get_serial_info(This, handle);
+
+ *result = write(handle, data, length);
+
+ if (*result > 0)
+ pser_inf->event_txempty = *result;
+
+ DEBUG_SERIAL(("serial_write length %d, offset %d result %d\n", length, offset, *result));
+
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+serial_device_control(RDPCLIENT * This, NTHANDLE handle, uint32 request, STREAM in, STREAM out)
+{
+ int flush_mask, purge_mask;
+ uint32 result, modemstate;
+ uint8 immediate;
+ SERIAL_DEVICE *pser_inf;
+ struct termios *ptermios;
+
+ if ((request >> 16) != FILE_DEVICE_SERIAL_PORT)
+ return STATUS_INVALID_PARAMETER;
+
+ pser_inf = get_serial_info(This, handle);
+ ptermios = pser_inf->ptermios;
+
+ /* extract operation */
+ request >>= 2;
+ request &= 0xfff;
+
+ switch (request)
+ {
+ case SERIAL_SET_BAUD_RATE:
+ in_uint32_le(in, pser_inf->baud_rate);
+ set_termios(pser_inf, handle);
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_BAUD_RATE %d\n",
+ pser_inf->baud_rate));
+ break;
+ case SERIAL_GET_BAUD_RATE:
+ out_uint32_le(out, pser_inf->baud_rate);
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_BAUD_RATE %d\n",
+ pser_inf->baud_rate));
+ break;
+ case SERIAL_SET_QUEUE_SIZE:
+ in_uint32_le(in, pser_inf->queue_in_size);
+ in_uint32_le(in, pser_inf->queue_out_size);
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_QUEUE_SIZE in %d out %d\n",
+ pser_inf->queue_in_size, pser_inf->queue_out_size));
+ break;
+ case SERIAL_SET_LINE_CONTROL:
+ in_uint8(in, pser_inf->stop_bits);
+ in_uint8(in, pser_inf->parity);
+ in_uint8(in, pser_inf->word_length);
+ set_termios(pser_inf, handle);
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_LINE_CONTROL stop %d parity %d word %d\n", pser_inf->stop_bits, pser_inf->parity, pser_inf->word_length));
+ break;
+ case SERIAL_GET_LINE_CONTROL:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_LINE_CONTROL\n"));
+ out_uint8(out, pser_inf->stop_bits);
+ out_uint8(out, pser_inf->parity);
+ out_uint8(out, pser_inf->word_length);
+ break;
+ case SERIAL_IMMEDIATE_CHAR:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_IMMEDIATE_CHAR\n"));
+ in_uint8(in, immediate);
+ serial_write(This, handle, &immediate, 1, 0, &result);
+ break;
+ case SERIAL_CONFIG_SIZE:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_CONFIG_SIZE\n"));
+ out_uint32_le(out, 0);
+ break;
+ case SERIAL_GET_CHARS:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_CHARS\n"));
+ out_uint8a(out, pser_inf->chars, 6);
+ break;
+ case SERIAL_SET_CHARS:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_CHARS\n"));
+ in_uint8a(in, pser_inf->chars, 6);
+#ifdef WITH_DEBUG_SERIAL
+ hexdump(pser_inf->chars, 6);
+#endif
+ set_termios(pser_inf, handle);
+ break;
+ case SERIAL_GET_HANDFLOW:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_HANDFLOW\n"));
+ get_termios(pser_inf, handle);
+ out_uint32_le(out, pser_inf->control);
+ out_uint32_le(out, pser_inf->xonoff); /* Xon/Xoff */
+ out_uint32_le(out, pser_inf->onlimit);
+ out_uint32_le(out, pser_inf->offlimit);
+ break;
+ case SERIAL_SET_HANDFLOW:
+ in_uint32_le(in, pser_inf->control);
+ in_uint32_le(in, pser_inf->xonoff);
+ in_uint32_le(in, pser_inf->onlimit);
+ in_uint32_le(in, pser_inf->offlimit);
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_HANDFLOW %x %x %x %x\n",
+ pser_inf->control, pser_inf->xonoff, pser_inf->onlimit,
+ pser_inf->onlimit));
+ set_termios(pser_inf, handle);
+ break;
+ case SERIAL_SET_TIMEOUTS:
+ in_uint32(in, pser_inf->read_interval_timeout);
+ in_uint32(in, pser_inf->read_total_timeout_multiplier);
+ in_uint32(in, pser_inf->read_total_timeout_constant);
+ in_uint32(in, pser_inf->write_total_timeout_multiplier);
+ in_uint32(in, pser_inf->write_total_timeout_constant);
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_TIMEOUTS read timeout %d %d %d\n",
+ pser_inf->read_interval_timeout,
+ pser_inf->read_total_timeout_multiplier,
+ pser_inf->read_total_timeout_constant));
+ break;
+ case SERIAL_GET_TIMEOUTS:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_TIMEOUTS read timeout %d %d %d\n",
+ pser_inf->read_interval_timeout,
+ pser_inf->read_total_timeout_multiplier,
+ pser_inf->read_total_timeout_constant));
+
+ out_uint32(out, pser_inf->read_interval_timeout);
+ out_uint32(out, pser_inf->read_total_timeout_multiplier);
+ out_uint32(out, pser_inf->read_total_timeout_constant);
+ out_uint32(out, pser_inf->write_total_timeout_multiplier);
+ out_uint32(out, pser_inf->write_total_timeout_constant);
+ break;
+ case SERIAL_GET_WAIT_MASK:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_WAIT_MASK %X\n",
+ pser_inf->wait_mask));
+ out_uint32(out, pser_inf->wait_mask);
+ break;
+ case SERIAL_SET_WAIT_MASK:
+ in_uint32(in, pser_inf->wait_mask);
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_WAIT_MASK %X\n",
+ pser_inf->wait_mask));
+ break;
+ case SERIAL_SET_DTR:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_DTR\n"));
+ ioctl(handle, TIOCMGET, &result);
+ result |= TIOCM_DTR;
+ ioctl(handle, TIOCMSET, &result);
+ pser_inf->dtr = 1;
+ break;
+ case SERIAL_CLR_DTR:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_CLR_DTR\n"));
+ ioctl(handle, TIOCMGET, &result);
+ result &= ~TIOCM_DTR;
+ ioctl(handle, TIOCMSET, &result);
+ pser_inf->dtr = 0;
+ break;
+ case SERIAL_SET_RTS:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_RTS\n"));
+ ioctl(handle, TIOCMGET, &result);
+ result |= TIOCM_RTS;
+ ioctl(handle, TIOCMSET, &result);
+ pser_inf->rts = 1;
+ break;
+ case SERIAL_CLR_RTS:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_CLR_RTS\n"));
+ ioctl(handle, TIOCMGET, &result);
+ result &= ~TIOCM_RTS;
+ ioctl(handle, TIOCMSET, &result);
+ pser_inf->rts = 0;
+ break;
+ case SERIAL_GET_MODEMSTATUS:
+ modemstate = 0;
+#ifdef TIOCMGET
+ ioctl(handle, TIOCMGET, &result);
+ if (result & TIOCM_CTS)
+ modemstate |= SERIAL_MS_CTS;
+ if (result & TIOCM_DSR)
+ modemstate |= SERIAL_MS_DSR;
+ if (result & TIOCM_RNG)
+ modemstate |= SERIAL_MS_RNG;
+ if (result & TIOCM_CAR)
+ modemstate |= SERIAL_MS_CAR;
+ if (result & TIOCM_DTR)
+ modemstate |= SERIAL_MS_DTR;
+ if (result & TIOCM_RTS)
+ modemstate |= SERIAL_MS_RTS;
+#endif
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_MODEMSTATUS %X\n", modemstate));
+ out_uint32_le(out, modemstate);
+ break;
+ case SERIAL_GET_COMMSTATUS:
+ out_uint32_le(out, 0); /* Errors */
+ out_uint32_le(out, 0); /* Hold reasons */
+
+ result = 0;
+#ifdef TIOCINQ
+ ioctl(handle, TIOCINQ, &result);
+#endif
+ out_uint32_le(out, result); /* Amount in in queue */
+ if (result)
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS in queue %d\n",
+ result));
+
+ result = 0;
+#ifdef TIOCOUTQ
+ ioctl(handle, TIOCOUTQ, &result);
+#endif
+ out_uint32_le(out, result); /* Amount in out queue */
+ if (result)
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS out queue %d\n", result));
+
+ out_uint8(out, 0); /* EofReceived */
+ out_uint8(out, 0); /* WaitForImmediate */
+ break;
+ case SERIAL_PURGE:
+ in_uint32(in, purge_mask);
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_PURGE purge_mask %X\n", purge_mask));
+ flush_mask = 0;
+ if (purge_mask & SERIAL_PURGE_TXCLEAR)
+ flush_mask |= TCOFLUSH;
+ if (purge_mask & SERIAL_PURGE_RXCLEAR)
+ flush_mask |= TCIFLUSH;
+ if (flush_mask != 0)
+ tcflush(handle, flush_mask);
+ if (purge_mask & SERIAL_PURGE_TXABORT)
+ rdpdr_abort_io(This, handle, 4, STATUS_CANCELLED);
+ if (purge_mask & SERIAL_PURGE_RXABORT)
+ rdpdr_abort_io(This, handle, 3, STATUS_CANCELLED);
+ break;
+ case SERIAL_WAIT_ON_MASK:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_WAIT_ON_MASK %X\n",
+ pser_inf->wait_mask));
+ pser_inf->event_pending = 1;
+ if (serial_get_event(This, handle, &result))
+ {
+ DEBUG_SERIAL(("WAIT end event = %x\n", result));
+ out_uint32_le(out, result);
+ break;
+ }
+ return STATUS_PENDING;
+ break;
+ case SERIAL_SET_BREAK_ON:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_BREAK_ON\n"));
+ tcsendbreak(handle, 0);
+ break;
+ case SERIAL_RESET_DEVICE:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_RESET_DEVICE\n"));
+ break;
+ case SERIAL_SET_BREAK_OFF:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_BREAK_OFF\n"));
+ break;
+ case SERIAL_SET_XOFF:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_XOFF\n"));
+ break;
+ case SERIAL_SET_XON:
+ DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_XON\n"));
+ tcflow(handle, TCION);
+ break;
+ default:
+ unimpl("SERIAL IOCTL %d\n", request);
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ return STATUS_SUCCESS;
+}
+
+BOOL
+serial_get_event(RDPCLIENT * This, NTHANDLE handle, uint32 * result)
+{
+ int index;
+ SERIAL_DEVICE *pser_inf;
+ int bytes;
+ BOOL ret = False;
+
+ *result = 0;
+ index = get_device_index(This, handle);
+ if (index < 0)
+ return False;
+
+#ifdef TIOCINQ
+ pser_inf = (SERIAL_DEVICE *) This->rdpdr_device[index].pdevice_data;
+
+ ioctl(handle, TIOCINQ, &bytes);
+
+ if (bytes > 0)
+ {
+ DEBUG_SERIAL(("serial_get_event Bytes %d\n", bytes));
+ if (bytes > pser_inf->event_rlsd)
+ {
+ pser_inf->event_rlsd = bytes;
+ if (pser_inf->wait_mask & SERIAL_EV_RLSD)
+ {
+ DEBUG_SERIAL(("Event -> SERIAL_EV_RLSD \n"));
+ *result |= SERIAL_EV_RLSD;
+ ret = True;
+ }
+
+ }
+
+ if ((bytes > 1) && (pser_inf->wait_mask & SERIAL_EV_RXFLAG))
+ {
+ DEBUG_SERIAL(("Event -> SERIAL_EV_RXFLAG Bytes %d\n", bytes));
+ *result |= SERIAL_EV_RXFLAG;
+ ret = True;
+ }
+ if ((pser_inf->wait_mask & SERIAL_EV_RXCHAR))
+ {
+ DEBUG_SERIAL(("Event -> SERIAL_EV_RXCHAR Bytes %d\n", bytes));
+ *result |= SERIAL_EV_RXCHAR;
+ ret = True;
+ }
+
+ }
+ else
+ {
+ pser_inf->event_rlsd = 0;
+ }
+#endif
+
+#ifdef TIOCOUTQ
+ ioctl(handle, TIOCOUTQ, &bytes);
+ if ((bytes == 0)
+ && (pser_inf->event_txempty > 0) && (pser_inf->wait_mask & SERIAL_EV_TXEMPTY))
+ {
+
+ DEBUG_SERIAL(("Event -> SERIAL_EV_TXEMPTY\n"));
+ *result |= SERIAL_EV_TXEMPTY;
+ ret = True;
+ }
+ pser_inf->event_txempty = bytes;
+#endif
+
+ ioctl(handle, TIOCMGET, &bytes);
+ if ((bytes & TIOCM_DSR) != pser_inf->event_dsr)
+ {
+ pser_inf->event_dsr = bytes & TIOCM_DSR;
+ if (pser_inf->wait_mask & SERIAL_EV_DSR)
+ {
+ DEBUG_SERIAL(("event -> SERIAL_EV_DSR %s\n",
+ (bytes & TIOCM_DSR) ? "ON" : "OFF"));
+ *result |= SERIAL_EV_DSR;
+ ret = True;
+ }
+ }
+
+ if ((bytes & TIOCM_CTS) != pser_inf->event_cts)
+ {
+ pser_inf->event_cts = bytes & TIOCM_CTS;
+ if (pser_inf->wait_mask & SERIAL_EV_CTS)
+ {
+ DEBUG_SERIAL((" EVENT-> SERIAL_EV_CTS %s\n",
+ (bytes & TIOCM_CTS) ? "ON" : "OFF"));
+ *result |= SERIAL_EV_CTS;
+ ret = True;
+ }
+ }
+
+ if (ret)
+ pser_inf->event_pending = 0;
+
+ return ret;
+}
+
+/* Read timeout for a given file descripter (device) when adding fd's to select() */
+BOOL
+serial_get_timeout(RDPCLIENT * This, NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout)
+{
+ int index;
+ SERIAL_DEVICE *pser_inf;
+
+ index = get_device_index(This, handle);
+ if (index < 0)
+ return True;
+
+ if (This->rdpdr_device[index].device_type != DEVICE_TYPE_SERIAL)
+ {
+ return False;
+ }
+
+ pser_inf = (SERIAL_DEVICE *) This->rdpdr_device[index].pdevice_data;
+
+ *timeout =
+ pser_inf->read_total_timeout_multiplier * length +
+ pser_inf->read_total_timeout_constant;
+ *itv_timeout = pser_inf->read_interval_timeout;
+ return True;
+}
+
+DEVICE_FNS serial_fns = {
+ serial_create,
+ serial_close,
+ serial_read,
+ serial_write,
+ serial_device_control
+};
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - TCP layer
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#if 0 // FIXME: header mess
+#include <unistd.h> /* select read write close */
+#include <sys/socket.h> /* socket connect setsockopt */
+#include <sys/time.h> /* timeval */
+#include <netdb.h> /* gethostbyname */
+#include <netinet/in.h> /* sockaddr_in */
+#include <netinet/tcp.h> /* TCP_NODELAY */
+#include <arpa/inet.h> /* inet_addr */
+#include <errno.h> /* errno */
+#endif
+
+#include "rdesktop.h"
+#include <winsock2.h>
+
+typedef int socklen_t;
+
+#ifndef INADDR_NONE
+#define INADDR_NONE ((unsigned long) -1)
+#endif
+
+/* Initialise TCP transport data packet */
+STREAM
+tcp_init(RDPCLIENT * This, uint32 maxlen)
+{
+ if (maxlen > This->tcp.out.size)
+ {
+ void * p;
+
+ p = realloc(This->tcp.out.data, maxlen);
+
+ if (p == NULL)
+ {
+ This->disconnect_reason = 262;
+ return NULL;
+ }
+
+ This->tcp.out.data = (uint8 *)p;
+ This->tcp.out.size = maxlen;
+ }
+
+ This->tcp.out.p = This->tcp.out.data;
+ This->tcp.out.end = This->tcp.out.data + This->tcp.out.size;
+ return &This->tcp.out;
+}
+
+/* Send TCP transport data packet */
+BOOL
+tcp_send(RDPCLIENT * This, STREAM s)
+{
+ int length = (int)(s->end - s->data);
+ int total = 0;
+ DWORD sent;
+
+ OVERLAPPED overlapped;
+ memset(&overlapped, 0, sizeof(overlapped));
+
+ while (total < length)
+ {
+ WriteFile((HANDLE)This->tcp.sock, s->data + total, length - total, NULL, &overlapped);
+
+ switch(WaitForSingleObjectEx((HANDLE)This->tcp.sock, INFINITE, TRUE))
+ {
+ /* Success */
+ case WAIT_OBJECT_0:
+ break;
+
+ /* Timeout or error */
+ case WAIT_TIMEOUT:
+ default:
+ This->disconnect_reason = 772;
+
+ /* Aborted, must disconnect ASAP */
+ case WAIT_IO_COMPLETION:
+ CancelIo((HANDLE)This->tcp.sock);
+ break;
+ }
+
+ /* Wait for completion. We could hang here, but we shouldn't */
+ if(!GetOverlappedResult((HANDLE)This->tcp.sock, &overlapped, &sent, TRUE))
+ return False;
+
+ total += sent;
+ }
+
+ return True;
+}
+
+/* Receive a message on the TCP layer */
+STREAM
+tcp_recv(RDPCLIENT * This, STREAM s, uint32 length)
+{
+ unsigned int new_length, end_offset, p_offset;
+ DWORD rcvd = 0;
+
+ if (s == NULL)
+ {
+ /* read into "new" stream */
+ if (length > This->tcp.in.size)
+ {
+ void * p = realloc(This->tcp.in.data, length);
+
+ if(p == NULL)
+ {
+ This->disconnect_reason = 262;
+ return NULL;
+ }
+
+ This->tcp.in.data = (uint8 *) p;
+ This->tcp.in.size = length;
+ }
+ This->tcp.in.end = This->tcp.in.p = This->tcp.in.data;
+ s = &This->tcp.in;
+ }
+ else
+ {
+ /* append to existing stream */
+ new_length = (unsigned int)(s->end - s->data) + length;
+ if (new_length > s->size)
+ {
+ void * p = realloc(s->data, new_length);
+
+ if(p == NULL)
+ {
+ This->disconnect_reason = 262;
+ return NULL;
+ }
+
+ p_offset = (unsigned int)(s->p - s->data);
+ end_offset = (unsigned int)(s->end - s->data);
+ s->data = (uint8 *) p;
+ s->size = new_length;
+ s->p = s->data + p_offset;
+ s->end = s->data + end_offset;
+ }
+ }
+
+ while (length > 0)
+ {
+ OVERLAPPED overlapped;
+ memset(&overlapped, 0, sizeof(overlapped));
+
+ if (!ui_select(This, This->tcp.sock))
+ /* User quit */
+ return NULL;
+
+ ReadFile((HANDLE)This->tcp.sock, s->end, length, NULL, &overlapped);
+
+ switch(WaitForSingleObjectEx((HANDLE)This->tcp.sock, INFINITE, TRUE))
+ {
+ /* Success */
+ case WAIT_OBJECT_0:
+ break;
+
+ /* Timeout or error */
+ case WAIT_TIMEOUT:
+ default:
+ This->disconnect_reason = 1028;
+
+ /* Aborted, must disconnect ASAP */
+ case WAIT_IO_COMPLETION:
+ CancelIo((HANDLE)This->tcp.sock);
+ break;
+ }
+
+ /* Wait for completion. We could hang here, but we shouldn't */
+ if(!GetOverlappedResult((HANDLE)This->tcp.sock, &overlapped, &rcvd, TRUE))
+ return False;
+
+ if (rcvd == 0)
+ {
+ error("Connection closed\n");
+ This->disconnect_reason = 2308;
+ return NULL;
+ }
+
+ s->end += rcvd;
+ length -= rcvd;
+ }
+
+ return s;
+}
+
+/* Establish a connection on the TCP layer */
+BOOL
+tcp_connect(RDPCLIENT * This, char *server)
+{
+ int true_value = 1;
+
+#ifdef IPv6
+
+ int n;
+ struct addrinfo hints, *res, *ressave;
+ char tcp_port_rdp_s[10];
+
+ snprintf(tcp_port_rdp_s, 10, "%d", This->tcp_port_rdp);
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+
+ if ((n = getaddrinfo(server, tcp_port_rdp_s, &hints, &res)))
+ {
+ error("getaddrinfo: %s\n", gai_strerror(n));
+ return False;
+ }
+
+ ressave = res;
+ This->tcp.sock = -1;
+ while (res)
+ {
+ This->tcp.sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ if (!(This->tcp.sock < 0))
+ {
+ if (connect(This->tcp.sock, res->ai_addr, res->ai_addrlen) == 0)
+ break;
+ close(This->tcp.sock);
+ This->tcp.sock = -1;
+ }
+ res = res->ai_next;
+ }
+ freeaddrinfo(ressave);
+
+ if (This->tcp.sock == -1)
+ {
+ error("%s: unable to connect\n", server);
+ return False;
+ }
+
+#else /* no IPv6 support */
+
+ struct hostent *nslookup;
+ struct sockaddr_in servaddr;
+
+ if ((nslookup = gethostbyname(server)) != NULL)
+ {
+ memcpy(&servaddr.sin_addr, nslookup->h_addr, sizeof(servaddr.sin_addr));
+ }
+ else if ((servaddr.sin_addr.s_addr = inet_addr(server)) == INADDR_NONE)
+ {
+ error("%s: unable to resolve host\n", server);
+ This->disconnect_reason = 260;
+ return False;
+ }
+
+ if ((This->tcp.sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+ {
+ // error("socket: %s\n", strerror(errno)); // EOF
+ return False;
+ }
+
+ servaddr.sin_family = AF_INET;
+ servaddr.sin_port = htons(This->tcp_port_rdp);
+
+ // TODO: apply connection timeout here
+
+ if (connect(This->tcp.sock, (struct sockaddr *) &servaddr, sizeof(struct sockaddr)) < 0)
+ {
+ // error("connect: %s\n", strerror(errno)); // EOF
+ This->disconnect_reason = 516;
+ closesocket(This->tcp.sock);
+ return False;
+ }
+
+#endif /* IPv6 */
+
+ setsockopt(This->tcp.sock, IPPROTO_TCP, TCP_NODELAY, (void *) &true_value, sizeof(true_value));
+
+ This->tcp.in.size = 4096;
+ This->tcp.in.data = (uint8 *) malloc(This->tcp.in.size);
+
+ if(This->tcp.in.data == NULL)
+ {
+ This->disconnect_reason = 262;
+ return False;
+ }
+
+ This->tcp.out.size = 4096;
+ This->tcp.out.data = (uint8 *) malloc(This->tcp.out.size);
+
+ if(This->tcp.out.data == NULL)
+ {
+ This->disconnect_reason = 262;
+ return False;
+ }
+
+ return True;
+}
+
+/* Disconnect on the TCP layer */
+BOOL
+tcp_disconnect(RDPCLIENT * This)
+{
+ closesocket(This->tcp.sock);
+ return True;
+}
+
+wchar_t *
+tcp_get_address(RDPCLIENT * This)
+{
+#if 0
+ static char ipaddr[32];
+ struct sockaddr_in sockaddr;
+ socklen_t len = sizeof(sockaddr);
+ if (getsockname(This->tcp.sock, (struct sockaddr *) &sockaddr, &len) == 0)
+ {
+ unsigned char *ip = (unsigned char *) &sockaddr.sin_addr;
+ sprintf(ipaddr, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+ }
+ else
+ strcpy(ipaddr, "127.0.0.1");
+ return ipaddr;
+#endif
+ return NULL; // TODO
+}
+
+/* reset the state of the tcp layer */
+/* Support for Session Directory */
+void
+tcp_reset_state(RDPCLIENT * This)
+{
+ This->tcp.sock = -1; /* reset socket */
+
+ /* Clear the incoming stream */
+ if (This->tcp.in.data != NULL)
+ free(This->tcp.in.data);
+ This->tcp.in.p = NULL;
+ This->tcp.in.end = NULL;
+ This->tcp.in.data = NULL;
+ This->tcp.in.size = 0;
+ This->tcp.in.iso_hdr = NULL;
+ This->tcp.in.mcs_hdr = NULL;
+ This->tcp.in.sec_hdr = NULL;
+ This->tcp.in.rdp_hdr = NULL;
+ This->tcp.in.channel_hdr = NULL;
+
+ /* Clear the outgoing stream */
+ if (This->tcp.out.data != NULL)
+ free(This->tcp.out.data);
+ This->tcp.out.p = NULL;
+ This->tcp.out.end = NULL;
+ This->tcp.out.data = NULL;
+ This->tcp.out.size = 0;
+ This->tcp.out.iso_hdr = NULL;
+ This->tcp.out.mcs_hdr = NULL;
+ This->tcp.out.sec_hdr = NULL;
+ This->tcp.out.rdp_hdr = NULL;
+ This->tcp.out.channel_hdr = NULL;
+}
--- /dev/null
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ Common data types
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#if 0
+typedef int BOOL;
+#endif
+
+#ifndef True
+#define True (1)
+#define False (0)
+#endif
+
+typedef unsigned char uint8;
+typedef signed char sint8;
+typedef unsigned short uint16;
+typedef signed short sint16;
+typedef unsigned int uint32;
+typedef signed int sint32;
+
+// TODO: detect Win32, avoid this mess
+#if 0
+typedef void *HBITMAP;
+typedef void *HCURSOR;
+#endif
+typedef void *HGLYPH;
+
+// TODO: nuke, use HPALETTE
+typedef void *HCOLOURMAP;
+
+#if 0
+typedef struct _POINT
+{
+ sint16 x, y;
+}
+POINT;
+#endif
+
+// TODO: nuke, use COLORREF
+typedef struct _COLOURENTRY
+{
+ uint8 red;
+ uint8 green;
+ uint8 blue;
+
+}
+COLOURENTRY;
+
+// TODO: nuke, use LOGPALETTE
+typedef struct _COLOURMAP
+{
+ uint16 ncolours;
+ COLOURENTRY *colours;
+
+}
+COLOURMAP;
+
+// TODO: nuke, use RECT
+typedef struct _BOUNDS
+{
+ sint16 left;
+ sint16 top;
+ sint16 right;
+ sint16 bottom;
+
+}
+BOUNDS;
+
+// TODO: nuke, use LOGPEN
+typedef struct _PEN
+{
+ uint8 style;
+ uint8 width;
+ uint32 colour;
+
+}
+PEN;
+
+typedef struct _BRUSH
+{
+ uint8 xorigin;
+ uint8 yorigin;
+ uint8 style;
+ uint8 pattern[8];
+
+}
+BRUSH;
+
+typedef struct _FONTGLYPH
+{
+ sint16 offset;
+ sint16 baseline;
+ uint16 width;
+ uint16 height;
+ HBITMAP pixmap;
+
+}
+FONTGLYPH;
+
+typedef struct _DATABLOB
+{
+ void *data;
+ int size;
+
+}
+DATABLOB;
+
+typedef struct _key_translation
+{
+ /* For normal scancode translations */
+ uint8 scancode;
+ uint16 modifiers;
+ /* For sequences. If keysym is nonzero, the fields above are not used. */
+ uint32 seq_keysym; /* Really KeySym */
+ struct _key_translation *next;
+}
+key_translation;
+
+typedef struct _VCHANNEL
+{
+ CHANNEL_DEF def;
+ uint16 mcs_id;
+ struct stream in;
+ void (*process) (RDPCLIENT *, STREAM);
+}
+VCHANNEL;
+
+/* PSTCACHE */
+typedef uint8 HASH_KEY[8];
+
+/* Header for an entry in the persistent bitmap cache file */
+typedef struct _PSTCACHE_CELLHEADER
+{
+ HASH_KEY key;
+ uint8 width, height;
+ uint16 length;
+ uint32 stamp;
+}
+CELLHEADER;
+
+#define MAX_CBSIZE 256
+
+/* RDPSND */
+#if 0
+typedef struct
+{
+ uint16 wFormatTag;
+ uint16 nChannels;
+ uint32 nSamplesPerSec;
+ uint32 nAvgBytesPerSec;
+ uint16 nBlockAlign;
+ uint16 wBitsPerSample;
+ uint16 cbSize;
+ uint8 cb[MAX_CBSIZE];
+} WAVEFORMATEX;
+#endif
+typedef struct _RDPCOMP
+{
+ uint32 roff;
+ uint8 hist[RDP_MPPC_DICT_SIZE];
+ struct stream ns;
+}
+RDPCOMP;
+
+#if 0
+/* RDPDR */
+typedef uint32 NTSTATUS;
+typedef uint32 NTHANDLE;
+
+typedef struct _DEVICE_FNS
+{
+ NTSTATUS(*create) (RDPCLIENT * This, uint32 device, uint32 desired_access, uint32 share_mode,
+ uint32 create_disposition, uint32 flags_and_attributes, char *filename,
+ NTHANDLE * handle);
+ NTSTATUS(*close) (RDPCLIENT * This, NTHANDLE handle);
+ NTSTATUS(*read) (RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
+ uint32 * result);
+ NTSTATUS(*write) (RDPCLIENT * This, NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
+ uint32 * result);
+ NTSTATUS(*device_control) (RDPCLIENT * This, NTHANDLE handle, uint32 request, STREAM in, STREAM out);
+}
+DEVICE_FNS;
+
+
+typedef struct rdpdr_device_info
+{
+ uint32 device_type;
+ NTHANDLE handle;
+ char name[8];
+ char *local_path;
+ void *pdevice_data;
+}
+RDPDR_DEVICE;
+
+typedef struct rdpdr_serial_device_info
+{
+ int dtr;
+ int rts;
+ uint32 control, xonoff, onlimit, offlimit;
+ uint32 baud_rate,
+ queue_in_size,
+ queue_out_size,
+ wait_mask,
+ read_interval_timeout,
+ read_total_timeout_multiplier,
+ read_total_timeout_constant,
+ write_total_timeout_multiplier, write_total_timeout_constant, posix_wait_mask;
+ uint8 stop_bits, parity, word_length;
+ uint8 chars[6];
+ struct termios *ptermios, *pold_termios;
+ int event_txempty, event_cts, event_dsr, event_rlsd, event_pending;
+}
+SERIAL_DEVICE;
+
+typedef struct rdpdr_parallel_device_info
+{
+ char *driver, *printer;
+ uint32 queue_in_size,
+ queue_out_size,
+ wait_mask,
+ read_interval_timeout,
+ read_total_timeout_multiplier,
+ read_total_timeout_constant,
+ write_total_timeout_multiplier,
+ write_total_timeout_constant, posix_wait_mask, bloblen;
+ uint8 *blob;
+}
+PARALLEL_DEVICE;
+
+typedef struct rdpdr_printer_info
+{
+ FILE *printer_fp;
+ char *driver, *printer;
+ uint32 bloblen;
+ uint8 *blob;
+ BOOL default_printer;
+}
+PRINTER;
+
+typedef struct notify_data
+{
+ time_t modify_time;
+ time_t status_time;
+ time_t total_time;
+ unsigned int num_entries;
+}
+NOTIFY;
+
+#ifndef PATH_MAX
+#define PATH_MAX 256
+#endif
+
+typedef struct fileinfo
+{
+ uint32 device_id, flags_and_attributes, accessmask;
+ char path[PATH_MAX];
+ DIR *pdir;
+ struct dirent *pdirent;
+ char pattern[PATH_MAX];
+ BOOL delete_on_close;
+ NOTIFY notify;
+ uint32 info_class;
+}
+FILEINFO;
+#endif
+
+typedef BOOL(*str_handle_lines_t) (RDPCLIENT * This, const char *line, void *data);
--- /dev/null
+#
+# nanoxrdesktop makefile
+#
+# These two following lines must point to the currently installed version of
+# nano-X. You can override them on the make command line to point at your
+# installation without changing this file.
+#
+NXINCLUDES=/usr/local/nanox/src/include
+NXLIBS=/usr/local/nanox/src/lib/libnano-X.a
+
+CC = gcc
+CFLAGS = -Os -Wall -I$(NXINCLUDES)
+RESTOBJ = ../tcp.o ../iso.o ../mcs.o ../secure.o ../rdp.o ../rdp5.o ../orders.o ../cache.o ../mppc.o ../licence.o ../bitmap.o ../channels.o ../pstcache.o
+LDFLAGS = -lcrypto
+
+all: nanoxrd
+
+nanoxrd: $(RESTOBJ) nanoxwin.o
+ $(CC) -o nanoxrdesktop nanoxwin.o $(NXLIBS) $(RESTOBJ) $(LDFLAGS)
+ strip nanoxrdesktop
+
+clean:
+ rm -f nanoxrdesktop
+ rm -f *.o
+ rm -f ../*.o
--- /dev/null
+#
+# qtrdesktop makefile
+# qt should be installed in /usr/local/qt
+#
+CC = g++
+CPPFLAGS = -O2 -Wall -I/usr/local/qt/include -I..
+# the next line is for sound
+CPPFLAGS += -DWITH_RDPSND
+RESTOBJ = tcp.o iso.o mcs.o secure.o rdp.o rdp5.o
+RESTOBJ += orders.o cache.o mppc.o licence.o bitmap.o
+RESTOBJ += channels.o pstcache.o
+# the next line is for sound
+RESTOBJ += rdpsnd.o rdpsnd_oss.o
+LD2FLAGS = -L/usr/local/qt/lib -L/usr/X11R6/lib
+LDFLAGS = -lcrypto -lqt -lXext -lX11 -lm
+MOCFILE = /usr/local/qt/bin/moc
+
+all: qtrd
+
+qtrd: $(RESTOBJ) qtwin.o
+ $(MOCFILE) qtwin.h > moc_qtwin.cpp
+ $(CC) $(CPPFLAGS) -c moc_qtwin.cpp
+ $(CC) -o qtrdesktop $(LD2FLAGS) qtwin.o moc_qtwin.o $(RESTOBJ) $(LDFLAGS)
+ strip qtrdesktop
+
+clean:
+ rm -f qtrdesktop
+ rm -f *.o
+ rm -f ../*.o
+ rm -f moc_qtwin.cpp
+
+# common files
+
+tcp.o: ../tcp.c
+ $(CC) $(CPPFLAGS) -c ../tcp.c
+
+iso.o: ../iso.c
+ $(CC) $(CPPFLAGS) -c ../iso.c
+
+mcs.o: ../mcs.c
+ $(CC) $(CPPFLAGS) -c ../mcs.c
+
+secure.o: ../secure.c
+ $(CC) $(CPPFLAGS) -c ../secure.c
+
+rdp.o: ../rdp.c
+ $(CC) $(CPPFLAGS) -c ../rdp.c
+
+rdp5.o: ../rdp5.c
+ $(CC) $(CPPFLAGS) -c ../rdp5.c
+
+orders.o: ../orders.c
+ $(CC) $(CPPFLAGS) -c ../orders.c
+
+cache.o: ../cache.c
+ $(CC) $(CPPFLAGS) -c ../cache.c
+
+mppc.o: ../mppc.c
+ $(CC) $(CPPFLAGS) -c ../mppc.c
+
+licence.o: ../licence.c
+ $(CC) $(CPPFLAGS) -c ../licence.c
+
+bitmap.o: ../bitmap.c
+ $(CC) $(CPPFLAGS) -c ../bitmap.c
+
+channels.o: ../channels.c
+ $(CC) $(CPPFLAGS) -c ../channels.c
+
+pstcache.o: ../pstcache.c
+ $(CC) $(CPPFLAGS) -c ../pstcache.c
+
+rdpsnd.o: ../rdpsnd.c
+ $(CC) $(CPPFLAGS) -c ../rdpsnd.c
+
+rdpsnd_oss.o: ../rdpsnd_oss.c
+ $(CC) $(CPPFLAGS) -c ../rdpsnd_oss.c
--- /dev/null
+#
+# qterdesktop makefile
+# qt should be installed in /usr/local/qt
+#
+CC = g++
+CPPFLAGS = -DQWS -fno-exceptions -fno-rtti -Wall -Os -Wall -I/usr/local/qt/include -DWITH_RDPSND -DNO_DEBUG
+RESTOBJ = ../tcp.o ../iso.o ../mcs.o ../secure.o ../rdp.o ../rdp5.o ../orders.o ../cache.o ../mppc.o ../licence.o ../bitmap.o ../channels.o ../pstcache.o ../rdpsnd.o ../rdpsnd_oss.o
+LD2FLAGS = -L/usr/local/qt/lib
+LDFLAGS = -lcrypto -lqte
+MOCFILE = /usr/local/qt/bin/moc
+
+all: qtrd
+
+qtrd: $(RESTOBJ) qtewin.o
+ $(MOCFILE) qtewin.h > moc_qtewin.cpp
+ $(CC) $(CPPFLAGS) -c moc_qtewin.cpp
+ $(CC) -o qterdesktop $(LD2FLAGS) qtewin.o moc_qtewin.o $(RESTOBJ) $(LDFLAGS)
+ strip qterdesktop
+
+clean:
+ rm -f qterdesktop
+ rm -f *.o
+ rm -f ../*.o
+ rm -f moc_qtewin.cpp
--- /dev/null
+CC = gcc
+CFLAGS = -Os -DWITH_OPENSSL -DL_ENDIAN -Wall
+RESTOBJ = ../tcp.o ../iso.o ../mcs.o ../secure.o ../rdp.o ../rdp5.o ../orders.o ../cache.o ../mppc.o ../licence.o ../bitmap.o ../channels.o ../pstcache.o
+LDFLAGS = -lvga -lcrypto
+
+#LDFLAGS = -lm /usr/local/lib/libvga.a /usr/lib/libcrypto.a
+#LDFLAGS = -lvga /usr/lib/libcrypto.a
+
+all: svgard
+svgard: svgawin.o $(RESTOBJ)
+ $(CC) -o svgardesktop svgawin.o $(RESTOBJ) $(LDFLAGS)
+ strip svgardesktop
+
+#rest: $(RESTOBJ)
+#rest: tcp.o iso.o mcs.o secure.o rdp.o rdp5.o orders.o cache.o mppc.o licence.o bitmap.o channels.o pstcache.o
+rest: ../tcp.c ../iso.c ../mcs.c ../secure.c ../rdp.c ../rdp5.c ../orders.c ../cache.c ../mppc.c ../licence.c ../bitmap.c ../channels.c ../pstcache.c
+ $(CC) $(CFLAGS) -c ../tcp.c -o ../tcp.o
+ $(CC) $(CFLAGS) -c ../iso.c -o ../iso.o
+ $(CC) $(CFLAGS) -c ../mcs.c -o ../mcs.o
+ $(CC) $(CFLAGS) -c ../secure.c -o ../secue.o
+ $(CC) $(CFLAGS) -c ../rdp.c -o ../rdp.o
+ $(CC) $(CFLAGS) -c ../rdp5.c -o ../rdp5.o
+ $(CC) $(CFLAGS) -c ../orders.c -o ../orders.o
+ $(CC) $(CFLAGS) -c ../cache.c -o ../cache.o
+ $(CC) $(CFLAGS) -c ../mppc.c -o ../mppc.o
+ $(CC) $(CFLAGS) -c ../licence.c -o ../licence.o
+ $(CC) $(CFLAGS) -c ../bitmap.c -o ../bitmap.o
+ $(CC) $(CFLAGS) -c ../channels.c -o ../channels.o
+ $(CC) $(CFLAGS) -c ../pstcache.c -o ../pstcache.o
+
+svgawin.o: svgawin.c
+ $(CC) $(CFLAGS) -c $*.c
+clean:
+ rm -f svgardesktop
+ rm -f *.o
+ rm -f ../*.o
--- /dev/null
+#
+# xxxrdesktop makefile
+#
+CC = gcc
+CFLAGS = -O2 -Wall
+RESTOBJ = ../tcp.o ../iso.o ../mcs.o ../secure.o ../rdp.o ../rdp5.o ../orders.o ../cache.o ../mppc.o ../licence.o ../bitmap.o ../channels.o ../pstcache.o
+LDFLAGS = -lcrypto
+
+all: xxxrd
+
+xxxrd: $(RESTOBJ) xxxwin.o
+ $(CC) -o xxxrdesktop xxxwin.o $(RESTOBJ) $(LDFLAGS)
+ strip xxxrdesktop
+
+clean:
+ rm -f xxxrdesktop
+ rm -f *.o
+ rm -f ../*.o
--- /dev/null
+This is the nanox ui port
+tested with versions 0.90
+
+makefile_nanox can be edited to change file localtions
+run make -f makefile_nanox in this directory to compile it
+
+nanoxreadme.txt - notes, this file
+makefile_nanox - makefile
+nanoxwin.cpp - ui lib
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ User interface services - NanoX(microwindows)
+ Copyright (C) Jay Sorg 2004-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+/*
+ problems with nanox lib
+ opcodes don't work, can only rely on copy
+ stipple orgins don't work
+ clip seems to affect source too, it should only affect dest
+ in copyarea functions
+*/
+
+#include "../rdesktop.h"
+
+#include <stdarg.h> /* va_list va_start va_end */
+#include <unistd.h> /* gethostname */
+#include <pwd.h> /* getpwuid */
+
+#include <nano-X.h>
+
+extern int g_tcp_port_rdp;
+int g_use_rdp5 = 1;
+char g_hostname[16];
+char g_username[64];
+int g_width = 800;
+int g_height = 600;
+int g_server_bpp = 16;
+int g_encryption = 1;
+int g_desktop_save = 0; /* todo */
+int g_polygon_ellipse_orders = 0;
+int g_bitmap_cache = 1;
+int g_bitmap_cache_persist_enable = 0;
+int g_bitmap_cache_precache = 1;
+int g_bitmap_compression = 1;
+uint32 g_rdp5_performanceflags =
+ RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | RDP5_NO_MENUANIMATIONS;
+int g_console_session = 0;
+int g_keylayout = 0x409; /* Defaults to US keyboard layout */
+int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */
+int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
+int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */
+
+static int g_sck = 0;
+static char g_servername[256] = "";
+static char g_password[64] = "";
+static char g_domain[64] = "";
+static char g_shell[64] = "";
+static char g_directory[64] = "";
+static GR_WINDOW_ID g_wnd = 0;
+static GR_GC_ID g_gc = 0;
+static GR_GC_ID g_gc_clean = 0;
+static int g_deactivated = 0;
+static int g_ext_disc_reason = 0;
+static GR_SCREEN_INFO g_screen_info;
+static int g_bpp = 0;
+static int g_Bpp = 0;
+static GR_RECT g_clip; /* set in main */
+static GR_CURSOR_ID g_null_cursor; /* set in main */
+static int g_flags = RDP_LOGON_NORMAL;
+
+struct key
+{
+ int ch1;
+ int ch2;
+ int ch3;
+ int chs; /* shift char */
+};
+
+static struct key g_keys[256];
+
+/* Session Directory redirection */
+BOOL g_redirect = False;
+char g_redirect_server[64];
+char g_redirect_domain[16];
+char g_redirect_password[64];
+char g_redirect_username[64];
+char g_redirect_cookie[128];
+uint32 g_redirect_flags = 0;
+
+#define COLOR16TO32(color) \
+( \
+ ((((color >> 8) & 0xf8) | ((color >> 13) & 0x7)) << 0) | \
+ ((((color >> 3) & 0xfc) | ((color >> 9) & 0x3)) << 8) | \
+ ((((color << 3) & 0xf8) | ((color >> 2) & 0x7)) << 16) \
+)
+
+static uint32 g_ops[16] =
+{
+ GR_MODE_CLEAR, /* 0 */
+ GR_MODE_NOR, /* ~(src | dst) */
+ GR_MODE_ANDINVERTED, /* (~src) & dst */
+ GR_MODE_COPYINVERTED, /* ~src */
+ GR_MODE_ANDREVERSE, /* src & (~dst) */
+ GR_MODE_INVERT, /* ~(dst) */
+ GR_MODE_XOR, /* src ^ dst */
+ GR_MODE_NAND, /* ~(src & dst) */
+ GR_MODE_AND, /* src & dst */
+ GR_MODE_EQUIV, /* ~(src) ^ dst or is it ~(src ^ dst) */
+ GR_MODE_NOOP, /* dst */
+ GR_MODE_ORINVERTED, /* (~src) | dst */
+ GR_MODE_COPY, /* src */
+ GR_MODE_ORREVERSE, /* src | (~dst) */
+ GR_MODE_OR, /* src | dst */
+ GR_MODE_SETTO1 /* ~0 */
+};
+
+/*****************************************************************************/
+/* do a raster op */
+static int rop(int rop, int src, int dst)
+{
+ switch (rop)
+ {
+ case 0x0: return 0;
+ case 0x1: return ~(src | dst);
+ case 0x2: return (~src) & dst;
+ case 0x3: return ~src;
+ case 0x4: return src & (~dst);
+ case 0x5: return ~(dst);
+ case 0x6: return src ^ dst;
+ case 0x7: return ~(src & dst);
+ case 0x8: return src & dst;
+ case 0x9: return ~(src) ^ dst;
+ case 0xa: return dst;
+ case 0xb: return (~src) | dst;
+ case 0xc: return src;
+ case 0xd: return src | (~dst);
+ case 0xe: return src | dst;
+ case 0xf: return ~0;
+ }
+ return dst;
+}
+
+/*****************************************************************************/
+static int get_pixel32(uint8 * data, int x, int y,
+ int width, int height)
+{
+ if (x >= 0 && y >= 0 && x < width && y < height)
+ {
+ return *(((int*)data) + (y * width + x));
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/*****************************************************************************/
+static void set_pixel32(uint8 * data, int x, int y,
+ int width, int height, int pixel)
+{
+ if (x >= 0 && y >= 0 && x < width && y < height)
+ {
+ *(((int*)data) + (y * width + x)) = pixel;
+ }
+}
+
+/*****************************************************************************/
+static int warp_coords(int * x, int * y, int * cx, int * cy,
+ int * srcx, int * srcy)
+{
+ int dx;
+ int dy;
+
+ if (g_clip.x > *x)
+ {
+ dx = g_clip.x - *x;
+ }
+ else
+ {
+ dx = 0;
+ }
+ if (g_clip.y > *y)
+ {
+ dy = g_clip.y - *y;
+ }
+ else
+ {
+ dy = 0;
+ }
+ if (*x + *cx > g_clip.x + g_clip.width)
+ {
+ *cx = (*cx - ((*x + *cx) - (g_clip.x + g_clip.width)));
+ }
+ if (*y + *cy > g_clip.y + g_clip.height)
+ {
+ *cy = (*cy - ((*y + *cy) - (g_clip.y + g_clip.height)));
+ }
+ *cx = *cx - dx;
+ *cy = *cy - dy;
+ if (*cx <= 0)
+ {
+ return 0;
+ }
+ if (*cy <= 0)
+ {
+ return 0;
+ }
+ *x = *x + dx;
+ *y = *y + dy;
+ if (srcx != 0)
+ {
+ *srcx = *srcx + dx;
+ }
+ if (srcy != 0)
+ {
+ *srcy = *srcy + dy;
+ }
+ return 1;
+}
+
+/******************************************************************************/
+/* check if a certain pixel is set in a bitmap */
+static int is_pixel_on(uint8 * data, int x, int y, int width, int bpp)
+{
+ int start;
+ int shift;
+
+ if (bpp == 1)
+ {
+ width = (width + 7) / 8;
+ start = (y * width) + x / 8;
+ shift = x % 8;
+ return (data[start] & (0x80 >> shift)) != 0;
+ }
+ else
+ return 0;
+}
+
+/*****************************************************************************/
+int ui_select(int in)
+{
+ if (g_sck == 0)
+ {
+ g_sck = in;
+ }
+ return 1;
+}
+
+/*****************************************************************************/
+void ui_set_clip(int x, int y, int cx, int cy)
+{
+ GR_REGION_ID region;
+
+ g_clip.x = x;
+ g_clip.y = y;
+ g_clip.width = cx;
+ g_clip.height = cy;
+ region = GrNewRegion();
+ GrUnionRectWithRegion(region, &g_clip);
+ GrSetGCRegion(g_gc, region); /* can't destroy region here, i guess gc */
+ /* takes owership, if you destroy it */
+ /* clip is reset, hum */
+}
+
+/*****************************************************************************/
+void ui_reset_clip(void)
+{
+ GrSetGCRegion(g_gc, 0);
+ g_clip.x = 0;
+ g_clip.y = 0;
+ g_clip.width = g_width;
+ g_clip.height = g_height;
+}
+
+/*****************************************************************************/
+void ui_bell(void)
+{
+ GrBell();
+}
+
+/*****************************************************************************/
+/* gota convert the rdp glyph to nanox glyph */
+void * ui_create_glyph(int width, int height, uint8 * data)
+{
+ char * p, * q, * r;
+ int datasize, i, j;
+
+ datasize = GR_BITMAP_SIZE(width, height) * sizeof(GR_BITMAP);
+ p = xmalloc(datasize);
+ q = p;
+ r = data;
+ memset(p, 0, datasize);
+ for (i = 0; i < height; i++)
+ {
+ j = 0;
+ while (j + 8 < width)
+ {
+ *q = *(r + 1);
+ q++;
+ r++;
+ *q = *(r - 1);
+ q++;
+ r++;
+ j += 16;
+ }
+ if ((width % 16) <= 8 && (width % 16) > 0)
+ {
+ q++;
+ *q = *r;
+ q++;
+ r++;
+ j += 8;
+ }
+ }
+ return p;
+}
+
+/*****************************************************************************/
+void ui_destroy_glyph(void * glyph)
+{
+ xfree(glyph);
+}
+
+/*****************************************************************************/
+void * ui_create_colourmap(COLOURMAP * colors)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_set_colourmap(void * map)
+{
+}
+
+/*****************************************************************************/
+void * ui_create_bitmap(int width, int height, uint8 * data)
+{
+ GR_WINDOW_ID pixmap;
+ uint8 * p;
+ uint32 i, j, pixel;
+
+ p = data;
+ pixmap = GrNewPixmap(width, height, 0);
+ if (g_server_bpp == 16 && g_bpp == 32)
+ {
+ p = xmalloc(width * height * g_Bpp);
+ for (i = 0; i < height; i++)
+ {
+ for (j = 0; j < width; j++)
+ {
+ pixel = *(((uint16 *) data) + (i * width + j));
+ pixel = COLOR16TO32(pixel);
+ *(((uint32 *) p) + (i * width + j)) = pixel;
+ }
+ }
+ }
+ GrArea(pixmap, g_gc_clean, 0, 0, width, height, p, MWPF_RGB);
+ if (p != data)
+ {
+ xfree(p);
+ }
+ return (void *) pixmap;
+}
+
+/*****************************************************************************/
+void ui_destroy_bitmap(void * bmp)
+{
+ GrDestroyWindow((GR_WINDOW_ID)bmp);
+}
+
+/*****************************************************************************/
+#define DO_GLYPH(ttext,idx) \
+{ \
+ glyph = cache_get_font (font, ttext[idx]); \
+ if (!(flags & TEXT2_IMPLICIT_X)) \
+ { \
+ xyoffset = ttext[++idx]; \
+ if ((xyoffset & 0x80)) \
+ { \
+ if (flags & TEXT2_VERTICAL) \
+ { \
+ y += ttext[idx+1] | (ttext[idx+2] << 8); \
+ } \
+ else \
+ { \
+ x += ttext[idx+1] | (ttext[idx+2] << 8); \
+ } \
+ idx += 2; \
+ } \
+ else \
+ { \
+ if (flags & TEXT2_VERTICAL) \
+ { \
+ y += xyoffset; \
+ } \
+ else \
+ { \
+ x += xyoffset; \
+ } \
+ } \
+ } \
+ if (glyph != NULL) \
+ { \
+ x1 = x + glyph->offset; \
+ y1 = y + glyph->baseline; \
+ GrBitmap(g_wnd, g_gc, x1, y1, glyph->width, glyph->height, glyph->pixmap); \
+ if (flags & TEXT2_IMPLICIT_X) \
+ { \
+ x += glyph->width; \
+ } \
+ } \
+}
+
+/*****************************************************************************/
+void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode,
+ int x, int y,
+ int clipx, int clipy, int clipcx, int clipcy,
+ int boxx, int boxy, int boxcx, int boxcy, BRUSH * brush,
+ int bgcolor, int fgcolor, uint8 * text, uint8 length)
+{
+ FONTGLYPH * glyph;
+ int i, j, xyoffset, x1, y1;
+ DATABLOB * entry;
+
+ GrSetGCMode(g_gc, GR_MODE_COPY);
+ GrSetGCUseBackground(g_gc, 0); /* this can be set when gc is created */
+ if (g_server_bpp == 16 && g_bpp == 32)
+ {
+ fgcolor = COLOR16TO32(fgcolor);
+ bgcolor = COLOR16TO32(bgcolor);
+ }
+ GrSetGCForeground(g_gc, bgcolor);
+ if (boxx + boxcx > g_width)
+ {
+ boxcx = g_width - boxx;
+ }
+ if (boxcx > 1)
+ {
+ GrFillRect(g_wnd, g_gc, boxx, boxy, boxcx, boxcy);
+ }
+ else if (mixmode == MIX_OPAQUE)
+ {
+ GrFillRect(g_wnd, g_gc, clipx, clipy, clipcx, clipcy);
+ }
+ GrSetGCForeground(g_gc, fgcolor);
+ /* Paint text, character by character */
+ for (i = 0; i < length;)
+ {
+ switch (text[i])
+ {
+ case 0xff:
+ if (i + 2 < length)
+ {
+ cache_put_text(text[i + 1], text, text[i + 2]);
+ }
+ else
+ {
+ error("this shouldn't be happening\n");
+ exit(1);
+ }
+ /* this will move pointer from start to first character after */
+ /* FF command */
+ length -= i + 3;
+ text = &(text[i + 3]);
+ i = 0;
+ break;
+ case 0xfe:
+ entry = cache_get_text(text[i + 1]);
+ if (entry != NULL)
+ {
+ if ((((uint8 *) (entry->data))[1] == 0) &&
+ (!(flags & TEXT2_IMPLICIT_X)))
+ {
+ if (flags & TEXT2_VERTICAL)
+ {
+ y += text[i + 2];
+ }
+ else
+ {
+ x += text[i + 2];
+ }
+ }
+ for (j = 0; j < entry->size; j++)
+ {
+ DO_GLYPH(((uint8 *) (entry->data)), j);
+ }
+ }
+ if (i + 2 < length)
+ {
+ i += 3;
+ }
+ else
+ {
+ i += 2;
+ }
+ length -= i;
+ /* this will move pointer from start to first character after */
+ /* FE command */
+ text = &(text[i]);
+ i = 0;
+ break;
+ default:
+ DO_GLYPH(text, i);
+ i++;
+ break;
+ }
+ }
+}
+
+/*****************************************************************************/
+void ui_line(uint8 opcode, int startx, int starty, int endx, int endy,
+ PEN * pen)
+{
+ uint32 op;
+ uint32 color;
+
+ color = pen->colour;
+ if (opcode == 5) /* GR_MODE_INVERT, not supported so convert it */
+ { /* i think x ^ -1 = ~x */
+ color = 0xffffffff;
+ opcode = 6; /* GR_MODE_XOR */
+ }
+ if (opcode == 12 || opcode == 6) /* nanox only supports these 2 opcode */
+ {
+ op = g_ops[opcode];
+ GrSetGCMode(g_gc, op);
+ if (g_server_bpp == 16 && g_bpp == 32)
+ {
+ color = COLOR16TO32(color);
+ }
+ GrSetGCForeground(g_gc, color);
+ GrLine(g_wnd, g_gc, startx, starty, endx, endy);
+ GrSetGCMode(g_gc, GR_MODE_COPY);
+ }
+ else
+ {
+ unimpl("opcode %d in ui_line\n", opcode);
+ }
+}
+
+/*****************************************************************************/
+void ui_triblt(uint8 opcode, int x, int y, int cx, int cy,
+ void * src, int srcx, int srcy,
+ BRUSH * brush, int bgcolor, int fgcolor)
+{
+/* not used, turned off */
+}
+
+/*****************************************************************************/
+void ui_memblt(uint8 opcode, int x, int y, int cx, int cy,
+ void * src, int srcx, int srcy)
+{
+ uint8 * dest;
+ uint8 * source;
+ uint8 * final;
+ GR_WINDOW_INFO wi;
+ int i, j, s, d;
+ GR_WINDOW_ID pixmap;
+
+ if (opcode == 12)
+ {
+ GrCopyArea(g_wnd, g_gc, x, y, cx, cy, (GR_DRAW_ID)src, srcx, srcy,
+ GR_MODE_COPY);
+ }
+ else /* do opcodes ourself */
+ { /* slow but its correct, ok to be slow here, these are rare */
+ GrGetWindowInfo((GR_DRAW_ID)src, &wi);
+ dest = xmalloc(cx * cy * g_Bpp);
+ source = xmalloc(wi.width * wi.height * g_Bpp);
+ final = xmalloc(cx * cy * g_Bpp);
+ memset(final, 0, cx * cy * g_Bpp);
+ /* dest */
+ GrReadArea(g_wnd, x, y, cx, cy, (GR_PIXELVAL*)dest);
+ /* source */
+ GrReadArea((GR_DRAW_ID)src, 0, 0,
+ wi.width, wi.height, (GR_PIXELVAL*)source);
+ for (i = 0; i < cy; i++)
+ {
+ for (j = 0; j < cx; j++)
+ {
+ s = get_pixel32(source, j + srcx, i + srcy, wi.width, wi.height);
+ d = get_pixel32(dest, j, i, cx ,cy);
+ set_pixel32(final, j, i, cx, cy, rop(opcode, s, d));
+ }
+ }
+ pixmap = GrNewPixmap(cx, cy, 0);
+ GrArea(pixmap, g_gc_clean, 0, 0, cx, cy, final, MWPF_TRUECOLOR0888);
+ GrCopyArea(g_wnd, g_gc, x, y, cx, cy, pixmap, 0, 0, GR_MODE_COPY);
+ GrDestroyWindow(pixmap);
+ xfree(dest);
+ xfree(source);
+ xfree(final);
+ }
+}
+
+/*****************************************************************************/
+void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
+{
+/* not used, turned off */
+}
+
+/*****************************************************************************/
+void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
+{
+/* not used, turned off */
+}
+
+/*****************************************************************************/
+void ui_rect(int x, int y, int cx, int cy, int color)
+{
+ if (g_server_bpp == 16 && g_bpp == 32)
+ {
+ color = COLOR16TO32(color);
+ }
+ GrSetGCForeground(g_gc, color);
+ GrFillRect(g_wnd, g_gc, x, y, cx, cy);
+}
+
+/*****************************************************************************/
+/* using warp_coords cause clip seems to affect source in GrCopyArea */
+void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy,
+ int srcx, int srcy)
+{
+ if (opcode == 12)
+ {
+ if (warp_coords(&x, &y, &cx, &cy, &srcx, &srcy))
+ {
+ GrCopyArea(g_wnd, g_gc_clean, x, y, cx, cy, g_wnd, srcx, srcy,
+ GR_MODE_COPY);
+ }
+ }
+ else
+ {
+ unimpl("opcode %d in ui_screenblt\n", opcode);
+ }
+}
+
+/******************************************************************************/
+/* can't use stipple cause tsorigin don't work, GrPoint too slow,
+ GrPoints too slow but better, using a copy from the screen,
+ do the pattern and copy it back */
+void ui_patblt(uint8 opcode, int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolor, int fgcolor)
+{
+ uint8 ipattern[8], * dest, * final;
+ uint32 op;
+ int i, j, s, d;
+ GR_WINDOW_ID pixmap;
+
+ if (g_server_bpp == 16 && g_bpp == 32)
+ {
+ fgcolor = COLOR16TO32(fgcolor);
+ bgcolor = COLOR16TO32(bgcolor);
+ }
+ switch (brush->style)
+ {
+ case 0: /* Solid */
+ if (opcode == 12 || opcode == 6)
+ {
+ op = g_ops[opcode];
+ GrSetGCMode(g_gc, op);
+ GrSetGCForeground(g_gc, fgcolor);
+ GrFillRect(g_wnd, g_gc, x, y, cx, cy);
+ GrSetGCMode(g_gc, GR_MODE_COPY);
+ }
+ else
+ {
+ unimpl("opcode %d in ui_patblt solid brush\n", opcode);
+ }
+ break;
+ case 3: /* Pattern - all opcodes ok */
+ for (i = 0; i != 8; i++)
+ {
+ ipattern[7 - i] = brush->pattern[i];
+ }
+ dest = xmalloc(cx * cy * g_Bpp);
+ final = xmalloc(cx * cy * g_Bpp);
+ memset(final, 0, cx * cy * g_Bpp);
+ /* dest */
+ if (opcode != 12)
+ {
+ GrReadArea(g_wnd, x, y, cx, cy, (GR_PIXELVAL*)dest);
+ }
+ for (i = 0; i < cy; i++)
+ {
+ for (j = 0; j < cx; j++)
+ {
+ if (is_pixel_on(ipattern, (x + j + brush->xorigin) % 8,
+ (y + i + brush->yorigin) % 8, 8, 1))
+ {
+ s = fgcolor;
+ }
+ else
+ {
+ s = bgcolor;
+ }
+ d = get_pixel32(dest, j, i, cx ,cy);
+ set_pixel32(final, j, i, cx, cy, rop(opcode, s, d));
+ }
+ }
+ pixmap = GrNewPixmap(cx, cy, 0);
+ GrArea(pixmap, g_gc_clean, 0, 0, cx, cy, final, MWPF_TRUECOLOR0888);
+ GrCopyArea(g_wnd, g_gc, x, y, cx, cy, pixmap, 0, 0, GR_MODE_COPY);
+ GrDestroyWindow(pixmap);
+ xfree(dest);
+ xfree(final);
+ break;
+ }
+}
+
+/*****************************************************************************/
+void ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
+{
+ uint32 op;
+
+ if (opcode == 0) /* black */
+ {
+ GrSetGCForeground(g_gc, 0);
+ opcode = 12;
+ }
+ else if (opcode == 5) /* invert */
+ {
+ GrSetGCForeground(g_gc, 0xffffffff);
+ opcode = 6;
+ }
+ else if (opcode == 15) /* white */
+ {
+ GrSetGCForeground(g_gc, 0xffffffff);
+ opcode = 12;
+ }
+ if (opcode == 12 || opcode == 6)
+ {
+ op = g_ops[opcode];
+ GrSetGCMode(g_gc, op);
+ GrFillRect(g_wnd, g_gc, x, y, cx, cy);
+ GrSetGCMode(g_gc, GR_MODE_COPY);
+ }
+ else
+ {
+ unimpl("opcode %d in ui_destblt\n", opcode);
+ }
+}
+
+/*****************************************************************************/
+void ui_paint_bitmap(int x, int y, int cx, int cy,
+ int width, int height, uint8 * data)
+{
+ void * b;
+
+ b = ui_create_bitmap(width, height, data);
+ ui_memblt(12, x, y, cx, cy, b, 0, 0);
+ ui_destroy_bitmap(b);
+}
+
+/*****************************************************************************/
+void ui_move_pointer(int x, int y)
+{
+ GrMoveCursor(x, y);
+}
+
+/*****************************************************************************/
+void ui_set_null_cursor(void)
+{
+ GrSetWindowCursor(g_wnd, g_null_cursor);
+}
+
+/*****************************************************************************/
+void ui_set_cursor(void * cursor)
+{
+ GrSetWindowCursor(g_wnd, (GR_CURSOR_ID)cursor);
+}
+
+//******************************************************************************
+static int is24on(uint8 * data, int x, int y)
+{
+ uint8 r, g, b;
+ int start;
+
+ if (data == 0)
+ {
+ return 0;
+ }
+ start = y * 32 * 3 + x * 3;
+ r = data[start];
+ g = data[start + 1];
+ b = data[start + 2];
+ return !((r == 0) && (g == 0) && (b == 0));
+}
+
+//******************************************************************************
+static int is1on(uint8 * data, int x, int y)
+{
+ int start;
+ int shift;
+
+ if (data == 0)
+ {
+ return 0;
+ }
+ start = (y * 32) / 8 + x / 8;
+ shift = x % 8;
+ return (data[start] & (0x80 >> shift)) == 0;
+}
+
+//******************************************************************************
+static void set1(uint8 * data, int x, int y)
+{
+ int start;
+ int shift;
+
+ if (data == 0)
+ {
+ return;
+ }
+ start = (y * 32) / 8 + x / 8;
+ shift = x % 8;
+ data[start] = data[start] | (0x80 >> shift);
+}
+
+//******************************************************************************
+static void flipover(uint8 * data)
+{
+ uint8 adata[128];
+ int index;
+
+ if (data == 0)
+ {
+ return;
+ }
+ memcpy(adata, data, 128);
+ for (index = 0; index <= 31; index++)
+ {
+ data[127 - (index * 4 + 3)] = adata[index * 4];
+ data[127 - (index * 4 + 2)] = adata[index * 4 + 1];
+ data[127 - (index * 4 + 1)] = adata[index * 4 + 2];
+ data[127 - index * 4] = adata[index * 4 + 3];
+ }
+}
+
+/*****************************************************************************/
+void * ui_create_cursor(uint32 x, uint32 y,
+ int width, int height,
+ uint8 * andmask, uint8 * xormask)
+{
+ uint8 adata[128];
+ uint8 amask[128];
+ GR_BITMAP * databitmap;
+ GR_BITMAP * maskbitmap;
+ GR_CURSOR_ID cursor;
+ int i1, i2, bon, mon;
+
+ if (width != 32 || height != 32)
+ {
+ return 0;
+ }
+ memset(adata, 0, 128);
+ memset(amask, 0, 128);
+ for (i1 = 0; i1 <= 31; i1++)
+ {
+ for (i2 = 0; i2 <= 31; i2++)
+ {
+ mon = is24on(xormask, i1, i2);
+ bon = is1on(andmask, i1, i2);
+ if (bon ^ mon) // xor
+ {
+ set1(adata, i1, i2);
+ if (!mon)
+ {
+ set1(amask, i1, i2);
+ }
+ }
+ if (mon)
+ {
+ set1(amask, i1, i2);
+ }
+ }
+ }
+ flipover(adata);
+ flipover(amask);
+ databitmap = ui_create_glyph(32, 32, adata);
+ maskbitmap = ui_create_glyph(32, 32, amask);
+ cursor = GrNewCursor(32, 32, x, y, 0xffffff, 0, databitmap, maskbitmap);
+ ui_destroy_glyph(databitmap);
+ ui_destroy_glyph(maskbitmap);
+ return (void*)cursor;
+}
+
+/*****************************************************************************/
+void ui_destroy_cursor(void * cursor)
+{
+ GrDestroyCursor((GR_CURSOR_ID)cursor);
+}
+
+/*****************************************************************************/
+uint16 ui_get_numlock_state(uint32 state)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+uint32 read_keyboard_state(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_resize_window(void)
+{
+}
+
+/*****************************************************************************/
+void ui_begin_update(void)
+{
+}
+
+/*****************************************************************************/
+void ui_end_update(void)
+{
+}
+
+/*****************************************************************************/
+void ui_polygon(uint8 opcode, uint8 fillmode, POINT * point, int npoints,
+ BRUSH * brush, int bgcolor, int fgcolor)
+{
+/* not used, turned off */
+}
+
+/*****************************************************************************/
+void ui_polyline(uint8 opcode, POINT * points, int npoints, PEN * pen)
+{
+ int i, x, y, dx, dy;
+
+ if (npoints > 0)
+ {
+ x = points[0].x;
+ y = points[0].y;
+ for (i = 1; i < npoints; i++)
+ {
+ dx = points[i].x;
+ dy = points[i].y;
+ ui_line(opcode, x, y, x + dx, y + dy, pen);
+ x = x + dx;
+ y = y + dy;
+ }
+ }
+}
+
+/*****************************************************************************/
+void ui_ellipse(uint8 opcode, uint8 fillmode,
+ int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolor, int fgcolor)
+{
+/* not used, turned off */
+}
+
+/*****************************************************************************/
+void generate_random(uint8 * random)
+{
+ memcpy(random, "12345678901234567890123456789012", 32);
+}
+
+/*****************************************************************************/
+void save_licence(uint8 * data, int length)
+{
+}
+
+/*****************************************************************************/
+int load_licence(uint8 ** data)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void * xrealloc(void * in, int size)
+{
+ if (size < 1)
+ {
+ size = 1;
+ }
+ return realloc(in, size);
+}
+
+/*****************************************************************************/
+void * xmalloc(int size)
+{
+ return malloc(size);
+}
+
+/*****************************************************************************/
+void xfree(void * in)
+{
+ if (in != 0)
+ {
+ free(in);
+ }
+}
+
+/*****************************************************************************/
+char * xstrdup(const char * s)
+{
+ char * mem = strdup(s);
+ if (mem == NULL)
+ {
+ perror("strdup");
+ exit(1);
+ }
+ return mem;
+}
+
+/*****************************************************************************/
+void warning(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "WARNING: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void unimpl(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "NOT IMPLEMENTED: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void error(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "ERROR: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+int rd_pstcache_mkdir(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_open_file(char * filename)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void rd_close_file(int fd)
+{
+ return;
+}
+
+/*****************************************************************************/
+int rd_read_file(int fd, void * ptr, int len)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_write_file(int fd, void * ptr, int len)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_lseek_file(int fd, int offset)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_lock_file(int fd, int start, int len)
+{
+ return False;
+}
+
+/*****************************************************************************/
+/*static int key(int ch, int flags)
+{
+ return (ch & 0xffff) | ((flags & 0xffff) << 16);
+}*/
+
+/*****************************************************************************/
+static void init_keys(void)
+{
+ memset(&g_keys, 0, sizeof(g_keys));
+ g_keys[0x01].ch1 = 27; /* esc */
+ g_keys[0x02].ch1 = '1';
+ g_keys[0x02].chs = '!';
+ g_keys[0x03].ch1 = '2';
+ g_keys[0x03].chs = '@';
+ g_keys[0x04].ch1 = '3';
+ g_keys[0x04].chs = '#';
+ g_keys[0x05].ch1 = '4';
+ g_keys[0x05].chs = '$';
+ g_keys[0x06].ch1 = '5';
+ g_keys[0x06].chs = '%';
+ g_keys[0x07].ch1 = '6';
+ g_keys[0x07].chs = '^';
+ g_keys[0x08].ch1 = '7';
+ g_keys[0x08].chs = '&';
+ g_keys[0x09].ch1 = '8';
+ g_keys[0x09].chs = '*';
+ g_keys[0x0a].ch1 = '9';
+ g_keys[0x0a].chs = '(';
+ g_keys[0x0b].ch1 = '0';
+ g_keys[0x0b].chs = ')';
+ g_keys[0x0c].ch1 = '-';
+ g_keys[0x0c].chs = '_';
+ g_keys[0x0d].ch1 = '=';
+ g_keys[0x0d].chs = '+';
+ g_keys[0x0e].ch1 = 8; /* backspace */
+ g_keys[0x0f].ch1 = 9; /* tab */
+ g_keys[0x10].ch1 = 'q';
+ g_keys[0x10].chs = 'Q';
+ g_keys[0x11].ch1 = 'w';
+ g_keys[0x11].chs = 'W';
+ g_keys[0x12].ch1 = 'e';
+ g_keys[0x12].chs = 'E';
+ g_keys[0x13].ch1 = 'r';
+ g_keys[0x13].chs = 'R';
+ g_keys[0x14].ch1 = 't';
+ g_keys[0x14].chs = 'T';
+ g_keys[0x15].ch1 = 'y';
+ g_keys[0x15].chs = 'Y';
+ g_keys[0x16].ch1 = 'u';
+ g_keys[0x16].chs = 'U';
+ g_keys[0x17].ch1 = 'i';
+ g_keys[0x17].chs = 'I';
+ g_keys[0x18].ch1 = 'o';
+ g_keys[0x18].chs = 'O';
+ g_keys[0x19].ch1 = 'p';
+ g_keys[0x19].chs = 'P';
+ g_keys[0x1a].ch1 = '[';
+ g_keys[0x1a].chs = '{';
+ g_keys[0x1b].ch1 = ']';
+ g_keys[0x1b].chs = '}';
+ g_keys[0x1c].ch2 = 13; /* enter */
+ g_keys[0x1d].ch1 = 63533; /* left control */
+ g_keys[0x1d].ch2 = 63534; /* right control */
+ g_keys[0x1e].ch1 = 'a';
+ g_keys[0x1e].chs = 'A';
+ g_keys[0x1f].ch1 = 's';
+ g_keys[0x1f].chs = 'S';
+ g_keys[0x20].ch1 = 'd';
+ g_keys[0x20].chs = 'D';
+ g_keys[0x21].ch1 = 'f';
+ g_keys[0x21].chs = 'F';
+ g_keys[0x22].ch1 = 'g';
+ g_keys[0x22].chs = 'G';
+ g_keys[0x23].ch1 = 'h';
+ g_keys[0x23].chs = 'H';
+ g_keys[0x24].ch1 = 'j';
+ g_keys[0x24].chs = 'J';
+ g_keys[0x25].ch1 = 'k';
+ g_keys[0x25].chs = 'K';
+ g_keys[0x26].ch1 = 'l';
+ g_keys[0x26].chs = 'L';
+ g_keys[0x27].ch1 = ';';
+ g_keys[0x27].chs = ':';
+ g_keys[0x28].ch1 = '\'';
+ g_keys[0x28].chs = '"';
+ g_keys[0x29].ch1 = '`';
+ g_keys[0x29].chs = '~';
+ g_keys[0x2a].ch1 = 63531; /* left shift */
+ g_keys[0x2b].ch1 = '\\';
+ g_keys[0x2c].ch1 = 'z';
+ g_keys[0x2c].chs = 'Z';
+ g_keys[0x2d].ch1 = 'x';
+ g_keys[0x2d].chs = 'X';
+ g_keys[0x2e].ch1 = 'c';
+ g_keys[0x2e].chs = 'C';
+ g_keys[0x2f].ch1 = 'v';
+ g_keys[0x2f].chs = 'V';
+ g_keys[0x30].ch1 = 'b';
+ g_keys[0x30].chs = 'B';
+ g_keys[0x31].ch1 = 'n';
+ g_keys[0x31].chs = 'N';
+ g_keys[0x32].ch1 = 'm';
+ g_keys[0x32].chs = 'M';
+ g_keys[0x33].ch1 = ',';
+ g_keys[0x33].chs = '<';
+ g_keys[0x34].ch1 = '.';
+ g_keys[0x34].chs = '>';
+ g_keys[0x35].ch1 = '/';
+ g_keys[0x35].ch2 = 63509;
+ g_keys[0x35].chs = '?';
+ g_keys[0x36].ch1 = 63532; /* right shift */
+ g_keys[0x37].ch1 = '*'; /* star on keypad */
+ g_keys[0x37].ch2 = 63510; /* star on keypad */
+ g_keys[0x38].ch1 = 63535; /* alt */
+ g_keys[0x38].ch2 = 63536; /* alt */
+ g_keys[0x39].ch1 = ' ';
+ g_keys[0x3a].ch1 = 0; /* caps lock */
+ g_keys[0x3b].ch1 = 63515; /* f1 */
+ g_keys[0x3c].ch1 = 63516; /* f2 */
+ g_keys[0x3d].ch1 = 63517; /* f3 */
+ g_keys[0x3e].ch1 = 63518; /* f4 */
+ g_keys[0x3f].ch1 = 63519; /* f5 */
+ g_keys[0x40].ch1 = 63520; /* f6 */
+ g_keys[0x41].ch1 = 63521; /* f7 */
+ g_keys[0x42].ch1 = 63522; /* f8 */
+ g_keys[0x43].ch1 = 63523; /* f9 */
+ g_keys[0x44].ch1 = 63524; /* f10 */
+ g_keys[0x45].ch1 = 0; /* num lock */
+ g_keys[0x46].ch1 = 0; /* scroll lock */
+ g_keys[0x47].ch1 = 63505; /* home */
+ g_keys[0x47].ch2 = 63494; /* home */
+ g_keys[0x48].ch1 = 63490; /* arrow up */
+ g_keys[0x48].ch2 = 63506; /* arrow up */
+ g_keys[0x49].ch1 = 63507; /* page up */
+ g_keys[0x49].ch2 = 63496; /* page up */
+ g_keys[0x4a].ch1 = '-'; /* -(minus) on keypad */
+ g_keys[0x4a].ch2 = 63511; /* -(minus) on keypad */
+ g_keys[0x4b].ch1 = 63502; /* arrow left */
+ g_keys[0x4b].ch2 = 63488; /* arrow left */
+ g_keys[0x4c].ch1 = 63503; /* middle(5 key) on keypad */
+ g_keys[0x4d].ch1 = 63504; /* arrow right */
+ g_keys[0x4d].ch2 = 63489; /* arrow right */
+ g_keys[0x4e].ch1 = '+'; /* +(plus) on keypad */
+ g_keys[0x4e].ch2 = 63512; /* +(plus) on keypad */
+ g_keys[0x4f].ch1 = 63499; /* end */
+ g_keys[0x4f].ch2 = 63495; /* end */
+ g_keys[0x50].ch1 = 63500; /* arrow down */
+ g_keys[0x50].ch2 = 63491; /* arrow down */
+ g_keys[0x51].ch1 = 63501; /* page down */
+ g_keys[0x51].ch2 = 63497; /* page down */
+ g_keys[0x52].ch1 = 63498; /* insert */
+ g_keys[0x52].ch2 = 63492; /* insert */
+ g_keys[0x53].ch1 = 63508; /* delete */
+ g_keys[0x53].ch2 = 63493; /* delete */
+ g_keys[0x54].ch1 = 63525; /* f11 */
+ g_keys[0x54].ch1 = 63527; /* f12 */
+}
+
+/*****************************************************************************/
+/* returns 0 if found key */
+static int get_sc(GR_EVENT_KEYSTROKE * event_keystroke, int * sc, int * ec)
+{
+ int i;
+
+ //printf("%d %d\n", event_keystroke->ch, event_keystroke->modifiers);
+ *sc = 0;
+ *ec = 0;
+ for (i = 0; i < 256; i++)
+ {
+ if (event_keystroke->modifiers & 1) /* shift is down */
+ {
+ if (event_keystroke->ch == g_keys[i].chs)
+ {
+ *sc = i;
+ break;
+ }
+ }
+ if (event_keystroke->ch == g_keys[i].ch1 ||
+ event_keystroke->ch == g_keys[i].ch2 ||
+ event_keystroke->ch == g_keys[i].ch3)
+ {
+ *sc = i;
+ break;
+ }
+ }
+ if (*sc == 0)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/*****************************************************************************/
+void static process_keystroke(GR_EVENT_KEYSTROKE * event_keystroke, int down)
+{
+ int sc, ec;
+
+ if (get_sc(event_keystroke, &sc, &ec) == 0)
+ {
+ if (down)
+ {
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS, sc, ec);
+ }
+ else
+ {
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, sc, ec);
+ }
+ }
+}
+
+/*****************************************************************************/
+void nanox_event(GR_EVENT * ev)
+{
+ GR_EVENT_MOUSE * event_mouse;
+ GR_EVENT_BUTTON * event_button;
+ GR_EVENT_FDINPUT * event_fdinput;
+ GR_EVENT_KEYSTROKE * event_keystroke;
+
+ do
+ {
+ if (ev->type == GR_EVENT_TYPE_FDINPUT) /* 12 */
+ {
+ event_fdinput = (GR_EVENT_FDINPUT *) ev;
+ if (event_fdinput->fd == g_sck)
+ {
+ if (!rdp_loop(&g_deactivated, &g_ext_disc_reason))
+ {
+ fprintf(stderr, "rdp_loop in nanox_event exit codes %d %d\n",
+ g_deactivated, g_ext_disc_reason);
+ exit(1);
+ }
+ }
+ }
+ else if (ev->type == GR_EVENT_TYPE_BUTTON_DOWN) /* 2 */
+ {
+ event_button = (GR_EVENT_BUTTON *) ev;
+ if (event_button->changebuttons & 4) /* left */
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON1,
+ event_button->x, event_button->y);
+ }
+ else if (event_button->changebuttons & 1) /* right */
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON2,
+ event_button->x, event_button->y);
+ }
+ }
+ else if (ev->type == GR_EVENT_TYPE_BUTTON_UP) /* 3 */
+ {
+ event_button = (GR_EVENT_BUTTON *) ev;
+ if (event_button->changebuttons & 4) /* left */
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1,
+ event_button->x, event_button->y);
+ }
+ else if (event_button->changebuttons & 1) /* right */
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2,
+ event_button->x, event_button->y);
+ }
+ }
+ else if (ev->type == GR_EVENT_TYPE_MOUSE_MOTION) /* 6 */
+ {
+ event_mouse = (GR_EVENT_MOUSE *) ev;
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE,
+ event_mouse->x, event_mouse->y);
+ }
+ else if (ev->type == GR_EVENT_TYPE_MOUSE_POSITION) /* 7 */
+ {
+ /* use GR_EVENT_TYPE_MOUSE_MOTION */
+ }
+ else if (ev->type == GR_EVENT_TYPE_KEY_DOWN) /* 8 */
+ {
+ event_keystroke = (GR_EVENT_KEYSTROKE *) ev;
+ process_keystroke(event_keystroke, 1);
+ }
+ else if (ev->type == GR_EVENT_TYPE_KEY_UP) /* 9 */
+ {
+ event_keystroke = (GR_EVENT_KEYSTROKE *) ev;
+ process_keystroke(event_keystroke, 0);
+ }
+ else if (ev->type == GR_EVENT_TYPE_FOCUS_IN) /* 10 */
+ {
+ }
+ else if (ev->type == GR_EVENT_TYPE_FOCUS_OUT) /* 11 */
+ {
+ }
+ else if (ev->type == GR_EVENT_TYPE_UPDATE) /* 13 */
+ {
+ }
+ GrCheckNextEvent(ev);
+ } while (ev->type != GR_EVENT_TYPE_NONE);
+}
+
+/*****************************************************************************/
+static void get_username_and_hostname(void)
+{
+ char fullhostname[64];
+ char * p;
+ struct passwd * pw;
+
+ STRNCPY(g_username, "unknown", sizeof(g_username));
+ STRNCPY(g_hostname, "unknown", sizeof(g_hostname));
+ pw = getpwuid(getuid());
+ if (pw != NULL && pw->pw_name != NULL)
+ {
+ STRNCPY(g_username, pw->pw_name, sizeof(g_username));
+ }
+ if (gethostname(fullhostname, sizeof(fullhostname)) != -1)
+ {
+ p = strchr(fullhostname, '.');
+ if (p != NULL)
+ {
+ *p = 0;
+ }
+ STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));
+ }
+}
+/*****************************************************************************/
+static void out_params(void)
+{
+ fprintf(stderr, "rdesktop: A Remote Desktop Protocol client.\n");
+ fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2005 Matt Chapman.\n");
+ fprintf(stderr, "nanox uiport by Jay Sorg\n");
+ fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
+ fprintf(stderr, "Usage: nanoxrdesktop [options] server\n");
+ fprintf(stderr, " -u: user name\n");
+ fprintf(stderr, " -n: client hostname\n");
+ fprintf(stderr, " -p: password\n");
+ fprintf(stderr, " -d: domain\n");
+ fprintf(stderr, " -s: shell\n");
+ fprintf(stderr, " -c: working directory\n");
+ fprintf(stderr, "\n");
+}
+
+/*****************************************************************************/
+static int parse_parameters(int in_argc, char ** in_argv)
+{
+ int i;
+
+ if (in_argc <= 1)
+ {
+ out_params();
+ return 0;
+ }
+ for (i = 1; i < in_argc; i++)
+ {
+ strcpy(g_servername, in_argv[i]);
+ if (strcmp(in_argv[i], "-h") == 0)
+ {
+ out_params();
+ return 0;
+ }
+ else if (strcmp(in_argv[i], "-n") == 0)
+ {
+ STRNCPY(g_hostname, in_argv[i + 1], sizeof(g_hostname));
+ }
+ else if (strcmp(in_argv[i], "-u") == 0)
+ {
+ STRNCPY(g_username, in_argv[i + 1], sizeof(g_username));
+ }
+ else if (strcmp(in_argv[i], "-p") == 0)
+ {
+ STRNCPY(g_password, in_argv[i + 1], sizeof(g_password));
+ g_flags |= RDP_LOGON_AUTO;
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-d") == 0)
+ {
+ STRNCPY(g_domain, in_argv[i + 1], sizeof(g_domain));
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-s") == 0)
+ {
+ STRNCPY(g_shell, in_argv[i + 1], sizeof(g_shell));
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-c") == 0)
+ {
+ STRNCPY(g_directory, in_argv[i + 1], sizeof(g_directory));
+ i++;
+ }
+ }
+ return 1;
+}
+
+/*****************************************************************************/
+int main(int in_argc, char ** in_argv)
+{
+ get_username_and_hostname();
+ /* read command line options */
+ if (!parse_parameters(in_argc, in_argv))
+ {
+ exit(0);
+ }
+ /* connect to server */
+ if (GrOpen() < 0)
+ {
+ fprintf(stderr, "Couldn't connect to Nano-X server\n");
+ exit(1);
+ }
+ GrGetScreenInfo(&g_screen_info);
+ g_bpp = g_screen_info.bpp;
+ g_Bpp = (g_screen_info.bpp + 7) / 8;
+ g_width = g_screen_info.vs_width;
+ g_height = g_screen_info.vs_height;
+ g_clip.x = 0;
+ g_clip.y = 0;
+ g_clip.width = g_width;
+ g_clip.height = g_height;
+ if (!((g_bpp == 32 && g_server_bpp == 16) ||
+ (g_bpp == 16 && g_server_bpp == 16)))
+ {
+ fprintf(stderr, "unsupported bpp, server = %d, client = %d\n",
+ g_server_bpp, g_bpp);
+ GrClose();
+ exit(0);
+ }
+ init_keys();
+ /* connect to server */
+ if (!rdp_connect(g_servername, g_flags, g_domain, g_password, g_shell,
+ g_directory))
+ {
+ fprintf(stderr, "Error connecting\n");
+ GrClose();
+ exit(1);
+ }
+ /* create window */
+ g_wnd = GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, g_width, g_height, 0, 0, 0);
+ /* show window */
+ GrMapWindow(g_wnd);
+ /* create graphic context */
+ g_gc = GrNewGC();
+ g_gc_clean = GrNewGC();
+ /* clear screen */
+ GrSetGCForeground(g_gc, 0);
+ GrFillRect(g_wnd, g_gc, 0, 0, g_width, g_height);
+ /* create null cursor */
+ g_null_cursor = (GR_CURSOR_ID)ui_create_cursor(0, 0, 32, 32, 0, 0);
+ /* register callbacks, set mask, and run main loop */
+ GrSelectEvents(g_wnd, -1); /* all events */
+ GrRegisterInput(g_sck);
+ GrMainLoop(nanox_event);
+ /* free null cursor */
+ ui_destroy_cursor((void*)g_null_cursor);
+ /* free graphic context */
+ GrDestroyGC(g_gc);
+ GrDestroyGC(g_gc_clean);
+ /* free window */
+ GrDestroyWindow(g_wnd);
+ /* close connection */
+ GrClose();
+ return 0;
+}
--- /dev/null
+This is the Qt/Emb ui port
+qt should be installed in /usr/local/qt
+you may need to have LD_LIBRARY_PATH and QTDIR defined to run qtrdesktop
+tested with versions 2.3, 3.1
+
+makefile_qte can be edited to change file localtions
+run make -f makefile_qte in this directory to compile it
+
+qtereadme.txt - notes, this file
+makefile_qte - makefile
+qtewin.cpp - ui lib
+qtewin.h - header
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ User interface services - QT Emb System
+ Copyright (C) Jay Sorg 2004-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+//#define SHARP
+
+#ifdef SHARP
+#include <qpe/qpeapplication.h>
+#else
+#include <qapplication.h>
+#endif
+#include <qcursor.h>
+#include <qmainwindow.h>
+#include <qwidget.h>
+#include <qpainter.h>
+#include <qimage.h>
+#include <qsocketnotifier.h>
+#include <qscrollview.h>
+#include <qmessagebox.h>
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qfile.h>
+#include <qcheckbox.h>
+#include <qpopupmenu.h>
+
+#include <stdlib.h>
+#include <stdarg.h> // va_list va_start va_end
+#include <unistd.h> // gethostname
+#include <pwd.h> // getpwuid
+
+#include "../rdesktop.h"
+#include "qtewin.h"
+
+#define QT_OPTI
+
+extern int g_tcp_port_rdp;
+int g_encryption = 1;
+int g_bitmap_cache = 1;
+int g_bitmap_cache_persist_enable = 0;
+int g_bitmap_cache_precache = 1;
+int g_use_rdp5 = 1;
+int g_desktop_save = 1;
+int g_bitmap_compression = 1;
+int g_polygon_ellipse_orders = 0;
+int g_rdp5_performanceflags =
+ RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | RDP5_NO_MENUANIMATIONS;
+int g_console_session = 0;
+int g_keylayout = 0x409; /* Defaults to US keyboard layout */
+int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */
+int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
+int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */
+int g_width = 640;
+int g_height = 480;
+int g_server_bpp = 8;
+char g_hostname[16] = "";
+char g_username[100] = "";
+
+#ifdef WITH_RDPSND
+extern int g_dsp_busy;
+extern int g_dsp_fd;
+int g_rdpsnd = 0;
+static QSocketNotifier * g_SoundNotifier = 0;
+#endif
+
+/* types */
+struct QColorMap
+{
+ uint32 RGBColors[256];
+ uint32 NumColors;
+};
+
+struct bitmap
+{
+ int w;
+ int h;
+ uint8 * data;
+};
+
+static int g_client_width = 640;
+static int g_client_height = 480;
+static uint32 g_flags = RDP_LOGON_NORMAL;
+static char g_server[64] = "";
+static char g_domain[16] = "";
+static char g_password[16] = "";
+static char g_shell[128] = "";
+static char g_directory[32] = "";
+static int g_fullscreen = 0;
+static int g_global_sock = 0;
+static int g_deactivated = 0;
+static uint32 g_ext_disc_reason = 0;
+
+static QSocketNotifier * g_SocketNotifier = 0;
+#ifdef SHARP
+static QPEApplication * g_App = 0;
+#else
+static QApplication * g_App = 0;
+#endif
+static QMyMainWindow * g_MW = 0;
+static QMyScrollView * g_SV = 0;
+static struct QColorMap * g_CM = 0;
+static uint8 * g_BS = 0; /* the screen data */
+static int g_clipx = 0;
+static int g_clipy = 0;
+static int g_clipcx = 0;
+static int g_clipcy = 0;
+
+/* Session Directory redirection */
+BOOL g_redirect = False;
+char g_redirect_server[64];
+char g_redirect_domain[16];
+char g_redirect_password[64];
+char g_redirect_username[64];
+char g_redirect_cookie[128];
+uint32 g_redirect_flags = 0;
+
+#define BPP ((g_server_bpp + 7) / 8)
+#define GETPIXEL8(d, x, y, w) (*(((uint8*)d) + ((y) * (w) + (x))))
+#define GETPIXEL16(d, x, y, w) (*(((uint16*)d) + ((y) * (w) + (x))))
+#define GETPIXEL32(d, x, y, w) (*(((uint32*)d) + ((y) * (w) + (x))))
+#define SETPIXEL8(d, x, y, w, v) *(((uint8*)d) + ((y) * (w) + (x))) = v
+#define SETPIXEL16(d, x, y, w, v) *(((uint16*)d) + ((y) * (w) + (x))) = v
+#define SETPIXEL32(d, x, y, w, v) *(((uint32*)d) + ((y) * (w) + (x))) = v
+
+/******************************************************************************/
+void CleanString(QString * Item)
+{
+ int i;
+
+ i = Item->length() - 1;
+ while (i >= 0)
+ {
+ if (Item->at(i) == 10 || Item->at(i) == 13)
+ {
+ Item->remove(i, 1);
+ }
+ i--;
+ }
+}
+
+/******************************************************************************/
+QMyDialog::QMyDialog(QWidget * parent) : QDialog(parent, "Settings", true)
+{
+ int i, j;
+ char * home;
+ char Text[256];
+ QString Line;
+ QString ItemName;
+ QString ItemValue;
+
+ // resize dialog
+ resize(230, 270);
+ // main list box
+ ListBox = new QListBox(this);
+ ListBox->move(10, 10);
+ ListBox->resize(200, 100);
+ connect(ListBox, SIGNAL(selectionChanged()), this, SLOT(ListBoxChanged()));
+ connect(ListBox, SIGNAL(selected(int)), this, SLOT(ListBoxSelected(int)));
+ // server
+ Label1 = new QLabel(this);
+ Label1->setText("Server Desc");
+ Label1->move(10, 120);
+ Label1->resize(100, 20);
+ ServerNameEdit = new QLineEdit(this);
+ ServerNameEdit->move(75, 120);
+ ServerNameEdit->resize(100, 20);
+ // username
+ Label2 = new QLabel(this);
+ Label2->setText("User Name");
+ Label2->move(10, 150);
+ Label2->resize(100, 20);
+ UserNameEdit = new QLineEdit(this);
+ UserNameEdit->move(75, 150);
+ UserNameEdit->resize(100, 20);
+ // ip
+ Label3 = new QLabel(this);
+ Label3->setText("Server IP");
+ Label3->move(10, 180);
+ Label3->resize(100, 20);
+ IPEdit = new QLineEdit(this);
+ IPEdit->move(75, 180);
+ IPEdit->resize(100, 20);
+ // width and height
+ WidthHeightBox = new QComboBox(this);
+ WidthHeightBox->move(10, 210);
+ WidthHeightBox->resize(100, 20);
+ WidthHeightBox->insertItem("240x320");
+ WidthHeightBox->insertItem("640x480");
+ WidthHeightBox->insertItem("800x600");
+ connect(WidthHeightBox, SIGNAL(activated(int)), this, SLOT(ComboChanged(int)));
+ WidthHeightBox->setCurrentItem(1);
+ WidthEdit = new QLineEdit(this);
+ WidthEdit->move(110, 210);
+ WidthEdit->resize(30, 20);
+ WidthEdit->setText("800");
+ HeightEdit = new QLineEdit(this);
+ HeightEdit->move(140, 210);
+ HeightEdit->resize(30, 20);
+ HeightEdit->setText("600");
+ // add to list button
+ AddButton = new QPushButton(this);
+ AddButton->move(180, 120);
+ AddButton->resize(50, 20);
+ AddButton->setText("Add");
+ connect(AddButton, SIGNAL(clicked()), this, SLOT(AddClicked()));
+ // change list item button
+ EditButton = new QPushButton(this);
+ EditButton->move(180, 140);
+ EditButton->resize(50, 20);
+ EditButton->setText("Edit");
+ connect(EditButton, SIGNAL(clicked()), this, SLOT(EditClicked()));
+ // save to file button
+ SaveButton = new QPushButton(this);
+ SaveButton->move(180, 160);
+ SaveButton->resize(50, 20);
+ SaveButton->setText("Save");
+ connect(SaveButton, SIGNAL(clicked()), this, SLOT(SaveClicked()));
+ // remove an item button
+ RemoveButton = new QPushButton(this);
+ RemoveButton->move(180, 180);
+ RemoveButton->resize(50, 20);
+ RemoveButton->setText("Remove");
+ connect(RemoveButton, SIGNAL(clicked()), this, SLOT(RemoveClicked()));
+ // full screen check box
+ FullScreenCheckBox = new QCheckBox(this, "Full Screen");
+ FullScreenCheckBox->setText("Full Screen");
+ FullScreenCheckBox->move(10, 230);
+ // ok button
+ OKButton = new QPushButton(this);
+ OKButton->setText("OK");
+ OKButton->move(100, 240);
+ OKButton->resize(50, 20);
+ connect(OKButton, SIGNAL(clicked()), this, SLOT(OKClicked()));
+ // cancel button
+ CancelButton = new QPushButton(this);
+ CancelButton->setText("Cancel");
+ CancelButton->move(160, 240);
+ CancelButton->resize(50, 20);
+ connect(CancelButton, SIGNAL(clicked()), this, SLOT(CancelClicked()));
+
+ for (i = 0; i < 10; i++)
+ {
+ ConnectionList[i] = new QMyConnectionItem;
+ ConnectionList[i]->ServerName = "";
+ ConnectionList[i]->UserName = "";
+ ConnectionList[i]->ServerIP = "";
+ ConnectionList[i]->Width = 0;
+ ConnectionList[i]->Height = 0;
+ ConnectionList[i]->FullScreen = 0;
+ }
+ home = getenv("HOME");
+ if (home != NULL)
+ {
+ sprintf(Text, "%s/rdesktop.ini", home);
+ QFile * File = new QFile(Text);
+ if (File->open(IO_ReadOnly))
+ {
+ i = -1;
+ while (!File->atEnd())
+ {
+ File->readLine(Line, 255);
+ j = Line.find("=");
+ if (j > 0)
+ {
+ ItemName = Line.mid(0, j);
+ CleanString(&ItemName);
+ ItemValue = Line.mid(j + 1);
+ CleanString(&ItemValue);
+ if (ItemName == "Server")
+ {
+ i++;
+ ConnectionList[i]->ServerName = ItemValue;
+ ListBox->insertItem(ItemValue);
+ }
+ else if (ItemName == "UserName")
+ ConnectionList[i]->UserName = ItemValue;
+ else if (ItemName == "Width")
+ ConnectionList[i]->Width = ItemValue.toInt();
+ else if (ItemName == "Height")
+ ConnectionList[i]->Height = ItemValue.toInt();
+ else if (ItemName == "IP")
+ ConnectionList[i]->ServerIP = ItemValue;
+ else if (ItemName == "FullScreen")
+ ConnectionList[i]->FullScreen = (ItemValue != "0");
+ }
+ }
+ }
+ delete File;
+ }
+}
+
+/******************************************************************************/
+QMyDialog::~QMyDialog()
+{
+ QMyConnectionItem * Item;
+ int i;
+
+ for (i = 0; i < 10; i++)
+ {
+ Item = ConnectionList[i];
+ delete Item;
+ }
+}
+
+/******************************************************************************/
+void QMyDialog::ComboChanged(int index)
+{
+ if (index == 0)
+ {
+ WidthEdit->setText("240");
+ HeightEdit->setText("320");
+ }
+ if (index == 1)
+ {
+ WidthEdit->setText("640");
+ HeightEdit->setText("480");
+ }
+ else if (index == 2)
+ {
+ WidthEdit->setText("800");
+ HeightEdit->setText("600");
+ }
+}
+
+/******************************************************************************/
+void QMyDialog::OKClicked()
+{
+ ServerName = ServerNameEdit->text();
+ UserName = UserNameEdit->text();
+ Width = WidthEdit->text().toInt();
+ Height = HeightEdit->text().toInt();
+ ServerIP = IPEdit->text();
+ FullScreen = FullScreenCheckBox->isChecked();
+ done(1);
+}
+
+/******************************************************************************/
+void QMyDialog::CancelClicked()
+{
+ done(0);
+}
+
+/******************************************************************************/
+void QMyDialog::AddClicked()
+{
+ int i;
+ QMyConnectionItem * Item;
+
+ i = ListBox->count();
+ if (i < 10)
+ {
+ ListBox->insertItem(ServerNameEdit->text());
+ Item = ConnectionList[i];
+ Item->ServerName = ServerNameEdit->text();
+ Item->UserName = UserNameEdit->text();
+ Item->Width = WidthEdit->text().toInt();
+ Item->Height = HeightEdit->text().toInt();
+ Item->ServerIP = IPEdit->text();
+ Item->FullScreen = FullScreenCheckBox->isChecked();
+ }
+}
+
+/******************************************************************************/
+void QMyDialog::EditClicked()
+{
+ int i;
+ QMyConnectionItem * Item;
+
+ i = ListBox->currentItem();
+ if (i >= 0)
+ {
+ Item = ConnectionList[i];
+ Item->ServerName = ServerNameEdit->text();
+ Item->UserName = UserNameEdit->text();
+ Item->Width = WidthEdit->text().toInt();
+ Item->Height = HeightEdit->text().toInt();
+ Item->ServerIP = IPEdit->text();
+ Item->FullScreen = FullScreenCheckBox->isChecked();
+ ListBox->changeItem(ServerNameEdit->text(), i);
+ }
+}
+
+/******************************************************************************/
+void WriteString(QFile* File, QString* Line)
+{
+ File->writeBlock((const char*)(*Line), Line->length());
+}
+
+/******************************************************************************/
+void QMyDialog::SaveClicked()
+{
+ int i, j;
+ QMyConnectionItem * Item;
+ QString Line;
+ char * home;
+ char Text[256];
+ QFile* File;
+
+ home = getenv("HOME");
+ if (home != NULL)
+ {
+ sprintf(Text, "%s/rdesktop.ini", home);
+ File = new QFile(Text);
+ if (File->open(IO_Truncate | IO_ReadWrite))
+ {
+ i = ListBox->count();
+ for (j = 0; j < i; j++)
+ {
+ Item = ConnectionList[j];
+ Line = "Server=";
+ Line += Item->ServerName;
+ Line += (char)10;
+ WriteString(File, &Line);
+ Line = "UserName=";
+ Line += Item->UserName;
+ Line += (char)10;
+ WriteString(File, &Line);
+ Line = "Width=";
+ sprintf(Text, "%d", Item->Width);
+ Line += Text;
+ Line += (char)10;
+ WriteString(File, &Line);
+ Line = "Height=";
+ sprintf(Text, "%d", Item->Height);
+ Line += Text;
+ Line += (char)10;
+ WriteString(File, &Line);
+ Line = "IP=";
+ Line += Item->ServerIP;
+ Line += (char)10;
+ WriteString(File, &Line);
+ Line = "FullScreen=";
+ if (Item->FullScreen)
+ Line += "1";
+ else
+ Line += "0";
+ Line += (char)10;
+ WriteString(File, &Line);
+ }
+ }
+ File->flush();
+ File->close();
+ delete File;
+ }
+}
+
+/******************************************************************************/
+void QMyDialog::RemoveClicked()
+{
+ int i, j, c;
+ QMyConnectionItem * Item1;
+ QMyConnectionItem * Item2;
+
+ i = ListBox->currentItem();
+ if (i >= 0)
+ {
+ c = ListBox->count();
+ for (j = i; j < c - 1; j++)
+ {
+ Item1 = ConnectionList[i];
+ Item2 = ConnectionList[i + 1];
+ Item1->ServerName = Item2->ServerName;
+ Item1->UserName = Item2->UserName;
+ Item1->Width = Item2->Width;
+ Item1->Height = Item2->Height;
+ Item1->ServerIP = Item2->ServerIP;
+ Item1->FullScreen = Item2->FullScreen;
+ }
+ ListBox->removeItem(i);
+ }
+}
+
+/******************************************************************************/
+void QMyDialog::ListBoxChanged()
+{
+ int i;
+ QMyConnectionItem * Item;
+ char Text[100];
+
+ i = ListBox->currentItem();
+ if (i >= 0 && i < 10)
+ {
+ Item = ConnectionList[i];
+ ServerNameEdit->setText(Item->ServerName);
+ UserNameEdit->setText(Item->UserName);
+ sprintf(Text, "%d", Item->Width);
+ WidthEdit->setText(Text);
+ sprintf(Text, "%d", Item->Height);
+ HeightEdit->setText(Text);
+ IPEdit->setText(Item->ServerIP);
+ FullScreenCheckBox->setChecked(Item->FullScreen != 0);
+ }
+}
+
+/******************************************************************************/
+void QMyDialog::ListBoxSelected(int /*index*/)
+{
+}
+
+/******************************************************************************/
+void GetScanCode(QKeyEvent * e, int * ScanCode, int * code)
+{
+ int key;
+ int mod;
+ int ascii;
+
+ key = e->key();
+ mod = e->state();
+ ascii = e->ascii();
+
+ *ScanCode = 0;
+ *code = mod; // 8 shift, 16 control, 32 alt
+
+ switch (key)
+ {
+ case 4096: // esc
+ case 4097: // tab
+ case 4099: // backspace
+ case 4100: // enter
+ case 4101: // enter
+ case 4103: // delete
+ ascii = 0;
+ }
+
+ if (ascii == 0)
+ {
+ switch (key)
+ {
+ case 4096: *ScanCode = 0x01; break; // esc
+ case 4097: *ScanCode = 0x0f; break; // tab
+ case 4099: *ScanCode = 0x0e; break; // backspace
+ case 4100: *ScanCode = 0x1c; break; // enter
+ case 4101: *ScanCode = 0x1c; break; // enter
+ case 4112: *ScanCode = 0xc7; break; // home
+ case 4113: *ScanCode = 0xcf; break; // end
+ case 4102: *ScanCode = 0xd2; break; // insert
+ case 4103: *ScanCode = 0xd3; break; // delete
+ case 4118: *ScanCode = 0xc9; break; // page up
+ case 4119: *ScanCode = 0xd1; break; // page down
+ case 4117: *ScanCode = 0xd0; break; // down arrow
+ case 4115: *ScanCode = 0xc8; break; // up arrow
+ case 4114: *ScanCode = 0xcb; break; // left arrow
+ case 4116: *ScanCode = 0xcd; break; // right arrow
+ case 4128: *ScanCode = 0x2a; break; // shift
+ case 4131: *ScanCode = 0x38; break; // alt
+ case 4129: *ScanCode = 0x1d; break; // ctrl
+ }
+ if (*ScanCode != 0)
+ return;
+ }
+
+ switch (ascii)
+ {
+ // first row
+ case 'q': *ScanCode = 0x10; break;
+ case 'Q': *ScanCode = 0x10; *code |= 8; break;
+ case '1': *ScanCode = 0x02; break;
+ case 'w': *ScanCode = 0x11; break;
+ case 'W': *ScanCode = 0x11; *code |= 8; break;
+ case '2': *ScanCode = 0x03; break;
+ case 'e': *ScanCode = 0x12; break;
+ case 'E': *ScanCode = 0x12; *code |= 8; break;
+ case '3': *ScanCode = 0x04; break;
+ case 'r': *ScanCode = 0x13; break;
+ case 'R': *ScanCode = 0x13; *code |= 8; break;
+ case '4': *ScanCode = 0x05; break;
+ case 't': *ScanCode = 0x14; break;
+ case 'T': *ScanCode = 0x14; *code |= 8; break;
+ case '5': *ScanCode = 0x06; break;
+ case 'y': *ScanCode = 0x15; break;
+ case 'Y': *ScanCode = 0x15; *code |= 8; break;
+ case '6': *ScanCode = 0x07; break;
+ case 'u': *ScanCode = 0x16; break;
+ case 'U': *ScanCode = 0x16; *code |= 8; break;
+ case '7': *ScanCode = 0x08; break;
+ case 'i': *ScanCode = 0x17; break;
+ case 'I': *ScanCode = 0x17; *code |= 8; break;
+ case '8': *ScanCode = 0x09; break;
+ case 'o': *ScanCode = 0x18; break;
+ case 'O': *ScanCode = 0x18; *code |= 8; break;
+ case '9': *ScanCode = 0x0a; break;
+ case 'p': *ScanCode = 0x19; break;
+ case 'P': *ScanCode = 0x19; *code |= 8; break;
+ case '0': *ScanCode = 0x0b; break;
+ // second row
+ case 'a': *ScanCode = 0x1e; break;
+ case 'A': *ScanCode = 0x1e; *code |= 8; break;
+ case '!': *ScanCode = 0x02; *code |= 8; break;
+ case 's': *ScanCode = 0x1f; break;
+ case 'S': *ScanCode = 0x1f; *code |= 8; break;
+ case '@': *ScanCode = 0x03; *code |= 8; break;
+ case 'd': *ScanCode = 0x20; break;
+ case 'D': *ScanCode = 0x20; *code |= 8; break;
+ case '#': *ScanCode = 0x04; *code |= 8; break;
+ case 'f': *ScanCode = 0x21; break;
+ case 'F': *ScanCode = 0x21; *code |= 8; break;
+ case '$': *ScanCode = 0x05; *code |= 8; break;
+ case 'g': *ScanCode = 0x22; break;
+ case 'G': *ScanCode = 0x22; *code |= 8; break;
+ case '%': *ScanCode = 0x06; *code |= 8; break;
+ case 'h': *ScanCode = 0x23; break;
+ case 'H': *ScanCode = 0x23; *code |= 8; break;
+ case '_': *ScanCode = 0x0c; *code |= 8; break;
+ case 'j': *ScanCode = 0x24; break;
+ case 'J': *ScanCode = 0x24; *code |= 8; break;
+ case '&': *ScanCode = 0x08; *code |= 8; break;
+ case 'k': *ScanCode = 0x25; break;
+ case 'K': *ScanCode = 0x25; *code |= 8; break;
+ case '*': *ScanCode = 0x09; *code |= 8; break;
+ case 'l': *ScanCode = 0x26; break;
+ case 'L': *ScanCode = 0x26; *code |= 8; break;
+ case '(': *ScanCode = 0x0a; *code |= 8; break;
+// case 8: *ScanCode = 0x0e; break; // backspace
+ // third row
+ case 'z': *ScanCode = 0x2c; break;
+ case 'Z': *ScanCode = 0x2c; *code |= 8; break;
+ case 'x': *ScanCode = 0x2d; break;
+ case 'X': *ScanCode = 0x2d; *code |= 8; break;
+ case 'c': *ScanCode = 0x2e; break;
+ case 'C': *ScanCode = 0x2e; *code |= 8; break;
+ case 'v': *ScanCode = 0x2f; break;
+ case 'V': *ScanCode = 0x2f; *code |= 8; break;
+ case 'b': *ScanCode = 0x30; break;
+ case 'B': *ScanCode = 0x30; *code |= 8; break;
+ case '-': *ScanCode = 0x0c; break;
+ case 'n': *ScanCode = 0x31; break;
+ case 'N': *ScanCode = 0x31; *code |= 8; break;
+ case '+': *ScanCode = 0x0d; *code |= 8; break;
+ case 'm': *ScanCode = 0x32; break;
+ case 'M': *ScanCode = 0x32; *code |= 8; break;
+ case '=': *ScanCode = 0x0d; break;
+ case ',': *ScanCode = 0x33; break;
+ case ';': *ScanCode = 0x27; break;
+ case ')': *ScanCode = 0x0b; *code |= 8; break;
+ // fourth row
+// case 9: *ScanCode = 0x0f; break; // tab
+ case '/': *ScanCode = 0x35; break;
+ case '?': *ScanCode = 0x35; *code |= 8; break;
+ case ' ': *ScanCode = 0x39; break;
+ case '\'': *ScanCode = 0x28; break;
+ case '"': *ScanCode = 0x28; *code |= 8; break;
+ case '~': *ScanCode = 0x29; *code |= 8; break;
+ case '.': *ScanCode = 0x34; break;
+ case ':': *ScanCode = 0x27; *code |= 8; break;
+ case '<': *ScanCode = 0x33; *code |= 8; break;
+// case 13: *ScanCode = 0x1c; break; // enter
+ case '>': *ScanCode = 0x34; *code |= 8; break;
+ // others
+// case 27: *ScanCode = 0x01; break; // esc
+ case '`': *ScanCode = 0x29; break;
+ case '^': *ScanCode = 0x07; *code |= 8; break;
+ case '[': *ScanCode = 0x1a; break;
+ case '{': *ScanCode = 0x1a; *code |= 8; break;
+ case ']': *ScanCode = 0x1b; break;
+ case '}': *ScanCode = 0x1b; *code |= 8; break;
+ case '\\': *ScanCode = 0x2b; break;
+ case '|': *ScanCode = 0x2b; *code |= 8; break;
+ // ctrl keys
+ case 1: *ScanCode = 0x1e; *code |= 16; break; // a
+ case 2: *ScanCode = 0x30; *code |= 16; break; // b
+ }
+
+ if (*ScanCode == 0 && key < 3000)
+ printf("unknown key %d mod %d ascii %d\n", key, mod, ascii);
+
+}
+
+/******************************************************************************/
+QMyScrollView::QMyScrollView() : QScrollView()
+{
+}
+
+/******************************************************************************/
+QMyScrollView::~QMyScrollView()
+{
+}
+
+/******************************************************************************/
+void QMyScrollView::keyPressEvent(QKeyEvent* e)
+{
+ int ScanCode, code;
+ GetScanCode(e, &ScanCode, &code);
+ if (ScanCode != 0)
+ {
+ if (code & 8) // send shift
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0x2a, 0);
+ if (code & 16) // send control
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0x1d, 0);
+ if (code & 32) // send alt
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0x38, 0);
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS, ScanCode, 0);
+ e->accept();
+ }
+}
+
+/******************************************************************************/
+void QMyScrollView::keyReleaseEvent(QKeyEvent* e)
+{
+ int ScanCode, code;
+ GetScanCode(e, &ScanCode, &code);
+ if (ScanCode != 0)
+ {
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, ScanCode, 0);
+ if (code & 8) // send shift
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, 0x2a, 0);
+ if (code & 16) // send control
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, 0x1d, 0);
+ if (code & 32) // send alt
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, 0x38, 0);
+ e->accept();
+ }
+}
+
+/******************************************************************************/
+void QMyScrollView::showEvent(QShowEvent* e)
+{
+ QScrollView::showEvent(e);
+}
+
+/******************************************************************************/
+void QMyScrollView::show()
+{
+ QScrollView::show();
+}
+
+/******************************************************************************/
+void QMyScrollView::polish()
+{
+ QScrollView::polish();
+}
+
+/******************************************************************************/
+void QMyScrollView::timerEvent(QTimerEvent * e)
+{
+ QMyDialog * d;
+ QWidget * Desktop;
+ int dw;
+ int dh;
+
+ QScrollView::timerEvent(e);
+ killTimer(timer_id);
+ d = new QMyDialog(this);
+ if (d->exec() == 1) // ok clicked
+ {
+ g_width = d->Width;
+ g_height = d->Height;
+ g_client_width = g_width;
+ g_client_height = g_height;
+ g_fullscreen = d->FullScreen;
+ sprintf(g_server, "%s", (const char*)d->ServerIP);
+ sprintf(g_username, "%s", (const char*)d->UserName);
+#ifdef WITH_RDPSND
+ // init sound
+ if (g_rdpsnd)
+ {
+ rdpsnd_init();
+ }
+#endif
+ if (!rdp_connect(g_server, g_flags, g_domain, g_password, g_shell,
+ g_directory))
+ {
+ delete d;
+ g_SV->close();
+ return;
+ }
+ g_BS = (uint8*)xmalloc(g_width * g_height * 4);
+ memset(g_BS, 0, g_width * g_height * 4);
+ g_clipx = 0;
+ g_clipy = 0;
+ g_clipcx = g_width;
+ g_clipcy = g_height;
+ g_CM = (QColorMap*)xmalloc(sizeof(struct QColorMap));
+ memset(g_CM, 0, sizeof(struct QColorMap));
+ g_CM->NumColors = 256;
+ g_MW = new QMyMainWindow();
+ g_MW->resize(g_client_width, g_client_height);
+ g_MW->show();
+ g_SV->addChild(g_MW);
+ g_MW->setMouseTracking(true);
+ g_MW->setCursor((int)10); /* Qt::BlankCursor */
+ g_SocketNotifier = new QSocketNotifier(g_global_sock,
+ QSocketNotifier::Read,
+ g_MW);
+ g_MW->connect(g_SocketNotifier, SIGNAL(activated(int)), g_MW,
+ SLOT(dataReceived()));
+ if (g_fullscreen)
+ {
+ Desktop = g_App->desktop();
+ dw = Desktop->width();
+ dh = Desktop->height();
+ if (dw == g_client_width && dh == g_client_height)
+ {
+ g_MW->resize(g_client_width - 4, g_client_height - 4);
+ }
+ g_SV->showFullScreen();
+ }
+ delete d;
+ }
+ else // cancel clicked
+ {
+ delete d;
+ g_SV->close();
+ }
+}
+
+/******************************************************************************/
+QMyMainWindow::QMyMainWindow() : QWidget(g_SV->viewport())
+{
+ PopupMenu = new QPopupMenu(this);
+ PopupMenu->insertItem("Right click", 1, 0);
+ PopupMenu->insertItem("Toggle fullscreen", 2, 1);
+ PopupMenu->insertItem("Reset keyboard", 3, 2);
+ PopupMenu->insertItem("Double click", 4, 3);
+ connect(PopupMenu, SIGNAL(activated(int)), this, SLOT(MemuClicked(int)));
+}
+
+/******************************************************************************/
+QMyMainWindow::~QMyMainWindow()
+{
+ delete PopupMenu;
+}
+
+/******************************************************************************/
+int rd(double in)
+{
+ return (int)(in + 0.50);
+}
+
+/******************************************************************************/
+int c2sx(int cx)
+{
+ double sx;
+
+ sx = (double)g_client_width / (double)g_width;
+ return rd(cx / sx);
+}
+
+/******************************************************************************/
+int c2sy(int cy)
+{
+ double sy;
+
+ sy = (double)g_client_height / (double)g_height;
+ return rd(cy / sy);
+}
+
+/******************************************************************************/
+void QMyMainWindow::timerEvent(QTimerEvent * e)
+{
+ QWidget::timerEvent(e);
+ if (e->timerId() == timer_id)
+ {
+ // send mouse up
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1,
+ rd(c2sx(mx)), rd(c2sy(my)));
+ // if in fullscreen, take it out or the menu won't work
+ if (g_fullscreen)
+ {
+ g_fullscreen = 0;
+ g_SV->showNormal();
+ g_SV->showMaximized();
+ }
+ else
+ PopupMenu->popup(mapToGlobal(QPoint(mx, my)));
+ }
+ killTimer(timer_id);
+}
+
+/******************************************************************************/
+void QMyMainWindow::MemuClicked(int MenuID)
+{
+ QWidget * Desktop;
+ int dw;
+ int dh;
+
+ if (MenuID == 1) // right click
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON2,
+ rd(c2sx(mx)), rd(c2sy(my)));
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2,
+ rd(c2sx(mx)), rd(c2sy(my)));
+ }
+ else if (MenuID == 2) // toggle full screen
+ {
+ g_fullscreen = ~g_fullscreen;
+ if (g_fullscreen)
+ {
+ Desktop = g_App->desktop();
+ dw = Desktop->width();
+ dh = Desktop->height();
+ if (dw == g_client_width && dh == g_client_height)
+ g_MW->resize(g_client_width - 4, g_client_height - 4);
+ g_SV->showFullScreen();
+ }
+ else
+ {
+ g_SV->showNormal();
+ g_SV->showMaximized();
+ g_MW->resize(g_client_width, g_client_height);
+ }
+ }
+ else if (MenuID == 3) // reset keyboard
+ {
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, 0x2a, 0); // shift
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, 0x1d, 0); // control
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, 0x38, 0); // alt
+ }
+ else if (MenuID == 4) // double click
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON1,
+ rd(c2sx(mx)), rd(c2sy(my)));
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1,
+ rd(c2sx(mx)), rd(c2sy(my)));
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON1,
+ rd(c2sx(mx)), rd(c2sy(my)));
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1,
+ rd(c2sx(mx)), rd(c2sy(my)));
+ }
+}
+
+/******************************************************************************/
+void QMyMainWindow::mouseMoveEvent(QMouseEvent* e)
+{
+ int x, y;
+
+ x = e->x();
+ y = e->y();
+ if (timer_id)
+ {
+ x = x - mx;
+ y = y - my;
+ if (x < -10 || x > 10 || y < -10 || y > 10)
+ {
+ killTimer(timer_id);
+ timer_id = 0;
+ }
+ }
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE, c2sx(e->x()),
+ c2sy(e->y()));
+}
+
+/******************************************************************************/
+void QMyMainWindow::mousePressEvent(QMouseEvent* e)
+{
+ timer_id = startTimer(1000);
+ mx = e->x();
+ my = e->y();
+ if (e->button() == LeftButton)
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON1,
+ c2sx(e->x()), c2sy(e->y()));
+ else if (e->button() == RightButton)
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON2,
+ c2sx(e->x()), c2sy(e->y()));
+ else if (e->button() == MidButton)
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON3,
+ c2sx(e->x()), c2sy(e->y()));
+}
+
+/******************************************************************************/
+void QMyMainWindow::mouseReleaseEvent(QMouseEvent* e)
+{
+ killTimer(timer_id);
+ timer_id = 0;
+ if (e->button() == LeftButton)
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1, c2sx(e->x()),
+ c2sy(e->y()));
+ else if (e->button() == RightButton)
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2, c2sx(e->x()),
+ c2sy(e->y()));
+ else if (e->button() == MidButton)
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3, c2sx(e->x()),
+ c2sy(e->y()));
+}
+
+/******************************************************************************/
+void QMyMainWindow::wheelEvent(QWheelEvent* e)
+{
+ if (e->delta() > 0)
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON4, c2sx(e->x()),
+ c2sy(e->y()));
+ else if (e->delta() < 0)
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON5, c2sx(e->x()),
+ c2sy(e->y()));
+}
+
+#define NOT(x) (~x)
+
+/******************************************************************************/
+int rop(int rop, int src, int dst)
+{
+ switch (rop)
+ {
+ case 0x0: return 0;
+ case 0x1: return NOT (src | dst);
+ case 0x2: return NOT (src) & dst;
+ case 0x3: return NOT (src);
+ case 0x4: return src & NOT (dst);
+ case 0x5: return NOT (dst);
+ case 0x6: return src ^ dst;
+ case 0x7: return NOT (src & dst);
+ case 0x8: return src & dst;
+ case 0x9: return NOT (src) ^ dst;
+ case 0xa: return dst;
+ case 0xb: return NOT (src) | dst;
+ case 0xc: return src;
+ case 0xd: return src | NOT (dst);
+ case 0xe: return src | dst;
+ case 0xf: return NOT (0);
+ }
+ return dst;
+}
+
+/*****************************************************************************/
+int get_pixel(int x, int y)
+{
+ if (x >= 0 && x < g_width && y >= 0 && y < g_height)
+ {
+ if (g_server_bpp == 8)
+ return GETPIXEL8(g_BS, x, y, g_width);
+ else if (g_server_bpp == 16)
+ return GETPIXEL16(g_BS, x, y, g_width);
+ else if (g_server_bpp == 24)
+ return GETPIXEL32(g_BS, x, y, g_width);
+ else
+ return 0;
+ }
+ else
+ return 0;
+}
+
+/******************************************************************************/
+void set_pixel(int x, int y, int pixel, int op = 0xc)
+{
+ int p;
+
+ if (x >= g_clipx && x < (g_clipx + g_clipcx) &&
+ y >= g_clipy && y < (g_clipy + g_clipcy))
+ {
+ if (x >= 0 && x < g_width && y >= 0 && y < g_height)
+ {
+ if (op == 0xc)
+ {
+ if (g_server_bpp == 8)
+ {
+ SETPIXEL8(g_BS, x, y, g_width, pixel);
+ }
+ else if (g_server_bpp == 16)
+ {
+ SETPIXEL16(g_BS, x, y, g_width, pixel);
+ }
+ else if (g_server_bpp == 24)
+ {
+ SETPIXEL32(g_BS, x, y, g_width, pixel);
+ }
+ }
+ else
+ {
+ if (g_server_bpp == 8)
+ {
+ p = GETPIXEL8(g_BS, x, y, g_width);
+ p = rop(op, pixel, p);
+ SETPIXEL8(g_BS, x, y, g_width, p);
+ }
+ else if (g_server_bpp == 16)
+ {
+ p = GETPIXEL16(g_BS, x, y, g_width);
+ p = rop(op, pixel, p);
+ SETPIXEL16(g_BS, x, y, g_width, p);
+ }
+ else if (g_server_bpp == 24)
+ {
+ p = GETPIXEL32(g_BS, x, y, g_width);
+ p = rop(op, pixel, p);
+ SETPIXEL32(g_BS, x, y, g_width, p);
+ }
+ }
+ }
+ }
+}
+
+/******************************************************************************/
+// adjust coordinates for cliping rect
+bool WarpCoords(int * x, int * y, int * cx, int * cy, int * srcx, int * srcy)
+{
+ int dx, dy;
+ QRect InRect(*x, *y, *cx, *cy);
+ QRect OutRect;
+ QRect CRect(g_clipx, g_clipy, g_clipcx, g_clipcy);
+ OutRect = InRect.intersect(CRect);
+ if (OutRect.isEmpty())
+ return false;
+ dx = OutRect.x() - InRect.x();
+ dy = OutRect.y() - InRect.y();
+ *x = OutRect.x();
+ *y = OutRect.y();
+ *cx = OutRect.width();
+ *cy = OutRect.height();
+ if (srcx != NULL)
+ *srcx = *srcx + dx;
+ if (srcy != NULL)
+ *srcy = *srcy + dy;
+ return true;
+}
+
+/******************************************************************************/
+void QMyMainWindow::paintEvent(QPaintEvent * pe)
+{
+ QImage * Image;
+ QPainter * Painter;
+ QRect Rect;
+ int i, j, w, h, l, t, pixel, r, g, b;
+ uint8 * data;
+ double sx, sy;
+
+ Image = 0;
+ data = 0;
+ if (!testWFlags(WRepaintNoErase))
+ setWFlags(WRepaintNoErase);
+ if (g_CM != NULL || g_server_bpp > 8)
+ {
+ sx = (double)g_client_width / (double)g_width;
+ sy = (double)g_client_height / (double)g_height;
+ Rect = pe->rect();
+ l = rd(Rect.left() / sx);
+ t = rd(Rect.top() / sy);
+ w = rd(Rect.width() / sx);
+ h = rd(Rect.height() / sy);
+ if (w > 0 && h > 0)
+ {
+ if (g_server_bpp == 8 && g_CM->NumColors > 0)
+ {
+ w = (w + 3) & ~3;
+ data = (uint8*)xmalloc(w * h);
+ for (i = 0; i < h; i++)
+ for (j = 0; j < w; j++)
+ data[i * w + j] = GETPIXEL8(g_BS, l + j, t + i, g_width);
+ Image = new QImage(data, w, h, 8,(QRgb*)g_CM->RGBColors,
+ g_CM->NumColors, QImage::IgnoreEndian);
+ }
+ else if (g_server_bpp == 16)
+ {
+ w = (w + 3) & ~3;
+ data = (uint8*)xmalloc(w * h * 4);
+ for (i = 0; i < h; i++)
+ for (j = 0; j < w; j++)
+ {
+ pixel = GETPIXEL16(g_BS, l + j, t + i, g_width);
+ r = ((pixel >> 8) & 0xf8) | ((pixel >> 13) & 0x7);
+ g = ((pixel >> 3) & 0xfc) | ((pixel >> 9) & 0x3);
+ b = ((pixel << 3) & 0xf8) | ((pixel >> 2) & 0x7);
+ pixel = ((r << 16) | (g << 8) | b);
+ SETPIXEL32(data, j, i, w, pixel);
+ }
+ Image = new QImage(data, w, h, 32, NULL,
+ 0, QImage::IgnoreEndian);
+ }
+ else if (g_server_bpp == 24)
+ {
+ w = (w + 3) & ~3;
+ data = (uint8*)xmalloc(w * h * 4);
+ for (i = 0; i < h; i++)
+ for (j = 0; j < w; j++)
+ {
+ pixel = GETPIXEL32(g_BS, l + j, t + i, g_width);
+ r = (pixel >> 0) & 0xff;
+ g = (pixel >> 8) & 0xff;
+ b = (pixel >> 16) & 0xff;
+ pixel = ((r << 16) | (g << 8) | b);
+ SETPIXEL32(data, j, i, w, pixel);
+ }
+ Image = new QImage(data, w, h, 32, NULL,
+ 0, QImage::IgnoreEndian);
+ }
+ if (Image != 0)
+ {
+ Painter = new QPainter(this);
+ Painter->scale(sx, sy);
+ Painter->drawImage(l, t, *Image, 0, 0, w, h);
+ delete Painter;
+ delete Image;
+ }
+ xfree(data);
+ }
+ }
+}
+
+/******************************************************************************/
+void QMyMainWindow::closeEvent(QCloseEvent * e)
+{
+ e->accept();
+}
+
+/******************************************************************************/
+void QMyMainWindow::dataReceived()
+{
+ if (!rdp_loop(&g_deactivated, &g_ext_disc_reason))
+ g_SV->close();
+#ifdef WITH_RDPSND
+ if (g_dsp_busy)
+ {
+ if (g_SoundNotifier == 0)
+ {
+ g_SoundNotifier = new QSocketNotifier(g_dsp_fd, QSocketNotifier::Write,
+ g_MW);
+ g_MW->connect(g_SoundNotifier, SIGNAL(activated(int)), g_MW,
+ SLOT(soundSend()));
+ }
+ else
+ {
+ if (!g_SoundNotifier->isEnabled())
+ g_SoundNotifier->setEnabled(true);
+ }
+ }
+#endif
+}
+
+/******************************************************************************/
+void QMyMainWindow::soundSend()
+{
+#ifdef WITH_RDPSND
+ g_SoundNotifier->setEnabled(false);
+ wave_out_play();
+ if (g_dsp_busy)
+ {
+ g_SoundNotifier->setEnabled(true);
+ }
+#endif
+}
+
+/******************************************************************************/
+void redraw(int x, int y, int cx, int cy)
+{
+ double sx, sy;
+
+ if (WarpCoords(&x, &y, &cx, &cy, NULL, NULL))
+ {
+ sx = (double)g_client_width / (double)g_width;
+ sy = (double)g_client_height / (double)g_height;
+ x = rd(x * sx);
+ y = rd(y * sy);
+ cx = rd(cx * sx);
+ cy = rd(cy * sy);
+ g_MW->update(x, y, cx, cy);
+ }
+}
+
+/******************************************************************************/
+/* Returns 0 after user quit, 1 otherwise */
+int ui_select(int rdp_socket)
+{
+ if (g_global_sock == 0)
+ g_global_sock = rdp_socket;
+ return 1;
+}
+
+/******************************************************************************/
+void ui_move_pointer(int /*x*/, int /*y*/)
+{
+}
+
+/******************************************************************************/
+void ui_set_null_cursor(void)
+{
+}
+
+/******************************************************************************/
+HBITMAP ui_create_bitmap(int width, int height, uint8 * data)
+{
+ struct bitmap * the_bitmap;
+ uint8 * bitmap_data;
+ int i, j;
+ int r, g, b, pixel;
+
+ bitmap_data = (uint8*)xmalloc(width * height * 4);
+ the_bitmap = (struct bitmap*)xmalloc(sizeof(struct bitmap));
+ the_bitmap->w = width;
+ the_bitmap->h = height;
+ the_bitmap->data = bitmap_data;
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < height; i++)
+ for (j = 0; j < width; j++)
+ bitmap_data[i * width + j] = data[i * width + j];
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < height; i++)
+ for (j = 0; j < width; j++)
+ *(((uint16*)bitmap_data) + (i * width + j)) =
+ *(((uint16*)data) + (i * width + j));
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < height; i++)
+ for (j = 0; j < width; j++)
+ {
+ r = data[(i * width + j) * 3 + 0];
+ g = data[(i * width + j) * 3 + 1];
+ b = data[(i * width + j) * 3 + 2];
+ pixel = (r << 16) | (g << 8) | b;
+ SETPIXEL32(bitmap_data, j, i, width, pixel);
+ }
+ }
+ return the_bitmap;
+}
+
+/******************************************************************************/
+void ui_paint_bitmap(int x, int y, int cx, int cy, int width,
+ int height, uint8 * data)
+{
+ int i, j;
+ int r, g, b, pixel;
+
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ if (i < height)
+ if (j < width)
+ set_pixel(x + j, y + i, data[i * width + j]);
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ if (i < height)
+ if (j < width)
+ set_pixel(x + j, y + i, *(((uint16*)data) + (i * width + j)));
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ if (i < height)
+ if (j < width)
+ {
+ r = data[(i * width + j) * 3 + 0];
+ g = data[(i * width + j) * 3 + 1];
+ b = data[(i * width + j) * 3 + 2];
+ pixel = (r << 16) | (g << 8) | b;
+ set_pixel(x + j, y + i, pixel);
+ }
+ }
+ redraw(x, y, cx, cy);
+}
+
+/******************************************************************************/
+void ui_destroy_bitmap(HBITMAP bmp)
+{
+ struct bitmap* the_bitmap;
+
+ the_bitmap = (struct bitmap*)bmp;
+ if (the_bitmap != NULL)
+ {
+ if (the_bitmap->data != NULL)
+ xfree(the_bitmap->data);
+ xfree(the_bitmap);
+ }
+}
+
+/******************************************************************************/
+bool is_pixel_on(uint8 * data, int x, int y, int width, int bpp)
+{
+ int start, shift;
+
+ if (bpp == 1)
+ {
+ width = (width + 7) / 8;
+ start = (y * width) + x / 8;
+ shift = x % 8;
+ return (data[start] & (0x80 >> shift)) != 0;
+ }
+ else if (bpp == 8)
+ return data[y * width + x] != 0;
+ else
+ return false;
+}
+
+/******************************************************************************/
+void set_pixel_on(uint8 * data, int x, int y, int width, int bpp, uint8 pixel)
+{
+ if (bpp == 8)
+ data[y * width + x] = pixel;
+}
+
+/******************************************************************************/
+HGLYPH ui_create_glyph(int width, int height, uint8 * data)
+{
+ int i, j;
+ uint8* glyph_data;
+ struct bitmap* the_glyph;
+
+ glyph_data = (uint8*)xmalloc(width * height);
+ the_glyph = (struct bitmap*)xmalloc(sizeof(struct bitmap));
+ the_glyph->w = width;
+ the_glyph->h = height;
+ the_glyph->data = glyph_data;
+ memset(glyph_data, 0, width * height);
+ for (i = 0; i < height; i++)
+ for (j = 0; j < width; j++)
+ if (is_pixel_on(data, j, i, width, 1))
+ set_pixel_on(glyph_data, j, i, width, 8, 255);
+ return the_glyph;
+}
+
+/******************************************************************************/
+void ui_destroy_glyph(HGLYPH glyph)
+{
+ struct bitmap* the_glyph;
+
+ the_glyph = (struct bitmap*)glyph;
+ if (the_glyph != NULL)
+ {
+ if (the_glyph->data != NULL)
+ xfree(the_glyph->data);
+ xfree(the_glyph);
+ }
+}
+
+/******************************************************************************/
+HCURSOR ui_create_cursor(uint32 x, uint32 y,
+ int width, int height,
+ uint8 * andmask, uint8 * xormask)
+{
+ return (void*)1;
+}
+
+/******************************************************************************/
+void ui_set_cursor(HCURSOR /*cursor*/)
+{
+}
+
+/*****************************************************************************/
+uint16 ui_get_numlock_state(uint32 state)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+unsigned int read_keyboard_state(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_resize_window(void)
+{
+}
+
+/*****************************************************************************/
+void ui_polygon(uint8 opcode, uint8 fillmode, POINT * point, int npoints,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+/* todo, use qt function for this (QPainter::drawPolyline) */
+void ui_polyline(uint8 opcode, POINT * points, int npoints, PEN * pen)
+{
+ int i, x, y, dx, dy;
+
+ if (npoints > 0)
+ {
+ x = points[0].x;
+ y = points[0].y;
+ for (i = 1; i < npoints; i++)
+ {
+ dx = points[i].x;
+ dy = points[i].y;
+ ui_line(opcode, x, y, x + dx, y + dy, pen);
+ x = x + dx;
+ y = y + dy;
+ }
+ }
+}
+
+/*****************************************************************************/
+void ui_ellipse(uint8 opcode, uint8 fillmode,
+ int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/******************************************************************************/
+void ui_destroy_cursor(HCURSOR /*cursor*/)
+{
+}
+
+/******************************************************************************/
+HCOLOURMAP ui_create_colourmap(COLOURMAP * colours)
+{
+ int i;
+ int x;
+ uint8 r, g, b;
+ i = 0;
+ while (i < colours->ncolours && i < 256)
+ {
+ r = colours->colours[i].red;
+ g = colours->colours[i].green;
+ b = colours->colours[i].blue;
+ x = (r << 16) | (g << 8) | b;
+ g_CM->RGBColors[i] = x;
+ i++;
+ }
+ g_CM->NumColors = colours->ncolours;
+ return g_CM;
+}
+
+/******************************************************************************/
+void ui_set_colourmap(HCOLOURMAP map)
+{
+}
+
+/******************************************************************************/
+void ui_destroy_colourmap(HCOLOURMAP map)
+{
+}
+
+/******************************************************************************/
+void ui_begin_update(void)
+{
+}
+
+/******************************************************************************/
+void ui_end_update(void)
+{
+}
+
+/******************************************************************************/
+void ui_set_clip(int x, int y, int cx, int cy)
+{
+ g_clipx = x;
+ g_clipy = y;
+ g_clipcx = cx;
+ g_clipcy = cy;
+}
+
+/******************************************************************************/
+void ui_reset_clip(void)
+{
+ g_clipx = 0;
+ g_clipy = 0;
+ g_clipcx = g_width;
+ g_clipcy = g_height;
+}
+
+/******************************************************************************/
+void ui_bell(void)
+{
+ g_App->beep();
+}
+
+/******************************************************************************/
+void ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
+{
+ int i, j;
+
+
+ if (opcode == 0x0) /* black */
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, 0, 0xc);
+ }
+ else if (opcode == 0xf) /* white */
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, 0xffffff, 0xc);
+ }
+ else
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, get_pixel(x + j, y + i), opcode);
+ }
+ redraw(x, y, cx, cy);
+}
+
+/******************************************************************************/
+// does not repaint
+void fill_rect(int x, int y, int cx, int cy, int colour, int opcode = 0xc)
+{
+ int i, j;
+
+ if (x + cx > g_width)
+ cx = g_width - x;
+ if (y + cy > g_height)
+ cy = g_height - y;
+#ifdef QT_OPTI
+ if (opcode == 0xc) /* optimize */
+ {
+ if (WarpCoords(&x, &y, &cx, &cy, 0, 0))
+ {
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ SETPIXEL8(g_BS, x + j, y + i, g_width, colour);
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ SETPIXEL16(g_BS, x + j, y + i, g_width, colour);
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ SETPIXEL32(g_BS, x + j, y + i, g_width, colour);
+ }
+ }
+ }
+ else
+#endif
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, colour, opcode);
+ }
+}
+
+/******************************************************************************/
+void ui_rect(int x, int y, int cx, int cy, int colour)
+{
+ fill_rect(x, y, cx, cy, colour);
+ redraw(x, y, cx, cy);
+}
+
+/******************************************************************************/
+void ui_patblt(uint8 opcode, int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+ int i, j;
+ uint8 ipattern[8];
+
+ switch (brush->style)
+ {
+ case 0:
+ fill_rect(x, y, cx, cy, fgcolour, opcode);
+ break;
+ case 3:
+ for (i = 0; i < 8; i++)
+ ipattern[i] = ~brush->pattern[7 - i];
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ if (is_pixel_on(ipattern, (x + j + brush->xorigin) % 8,
+ (y + i + brush->yorigin) % 8, 8, 1))
+ set_pixel(x + j, y + i, fgcolour, opcode);
+ else
+ set_pixel(x + j, y + i, bgcolour, opcode);
+ break;
+ }
+ redraw(x, y, cx, cy);
+}
+
+/******************************************************************************/
+void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy,
+ int srcx, int srcy)
+{
+ int i, j, pixel;
+ uint8 * temp;
+
+ temp = (uint8*)xmalloc(cx * cy * 4);
+#ifdef QT_OPTI
+ if (opcode == 0xc)
+ {
+ if (WarpCoords(&x, &y, &cx, &cy, &srcx, &srcy))
+ {
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = GETPIXEL8(g_BS, srcx + j, srcy + i, g_width);
+ SETPIXEL8(temp, j, i, cx, pixel);
+ }
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = GETPIXEL8(temp, j, i, cx);
+ SETPIXEL8(g_BS, x + j, y + i, g_width, pixel);
+ }
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = GETPIXEL16(g_BS, srcx + j, srcy + i, g_width);
+ SETPIXEL16(temp, j, i, cx, pixel);
+ }
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = GETPIXEL16(temp, j, i, cx);
+ SETPIXEL16(g_BS, x + j, y + i, g_width, pixel);
+ }
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = GETPIXEL32(g_BS, srcx + j, srcy + i, g_width);
+ SETPIXEL32(temp, j, i, cx, pixel);
+ }
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = GETPIXEL32(temp, j, i, cx);
+ SETPIXEL32(g_BS, x + j, y + i, g_width, pixel);
+ }
+ }
+ }
+ }
+ else
+#endif
+ {
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ temp[i * cx + j] = get_pixel(srcx + j, srcy + i);
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, temp[i * cx + j], opcode);
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = get_pixel(srcx + j, srcy + i);
+ SETPIXEL16(temp, j, i, cx, pixel);
+ }
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = GETPIXEL16(temp, j, i, cx);
+ set_pixel(x + j, y + i, pixel, opcode);
+ }
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ *(((uint32*)temp) + (i * cx + j)) = get_pixel(srcx + j, srcy + i);
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, *(((uint32*)temp) + (i * cx + j)), opcode);
+ }
+ }
+ xfree(temp);
+ redraw(x, y, cx, cy);
+}
+
+/******************************************************************************/
+void ui_memblt(uint8 opcode, int x, int y, int cx, int cy,
+ HBITMAP src, int srcx, int srcy)
+{
+ int i, j, p;
+ struct bitmap * the_bitmap;
+
+ the_bitmap = (struct bitmap*)src;
+ if (the_bitmap == NULL)
+ return;
+#ifdef QT_OPTI
+ if (opcode == 0xc) /* optimize */
+ {
+ if (WarpCoords(&x, &y, &cx, &cy, &srcx, &srcy))
+ {
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ p = GETPIXEL8(the_bitmap->data, srcx + j, srcy + i, the_bitmap->w);
+ SETPIXEL8(g_BS, x + j, y + i, g_width, p);
+ }
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ p = GETPIXEL16(the_bitmap->data, srcx + j, srcy + i, the_bitmap->w);
+ SETPIXEL16(g_BS, x + j, y + i, g_width, p);
+ }
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ p = GETPIXEL32(the_bitmap->data, srcx + j, srcy + i, the_bitmap->w);
+ SETPIXEL32(g_BS, x + j, y + i, g_width, p);
+ }
+ }
+ }
+ }
+ else
+#endif
+ {
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ if ((i + srcy) < the_bitmap->h && (j + srcx) < the_bitmap->w)
+ set_pixel(x + j, y + i,
+ the_bitmap->data[(i + srcy) * the_bitmap->w + (j + srcx)],
+ opcode);
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ if ((i + srcy) < the_bitmap->h && (j + srcx) < the_bitmap->w)
+ set_pixel(x + j, y + i,
+ *(((uint16*)the_bitmap->data) + ((i + srcy) * the_bitmap->w + (j + srcx))),
+ opcode);
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ if ((i + srcy) < the_bitmap->h && (j + srcx) < the_bitmap->w)
+ set_pixel(x + j, y + i,
+ *(((uint32*)the_bitmap->data) + ((i + srcy) * the_bitmap->w + (j + srcx))),
+ opcode);
+ }
+ }
+ redraw(x, y, cx, cy);
+}
+
+/******************************************************************************/
+// not used
+void ui_triblt(uint8 opcode, int x, int y, int cx, int cy,
+ HBITMAP src, int srcx, int srcy, BRUSH * brush,
+ int bgcolour, int fgcolour)
+{
+}
+
+/******************************************************************************/
+/* Bresenham's line drawing algorithm */
+void ui_line(uint8 opcode, int startx, int starty, int endx,
+ int endy, PEN * pen)
+{
+ int dx, dy, incx, incy, dpr, dpru, p, left, top, right, bottom;
+
+ if (startx > endx)
+ {
+ dx = startx - endx;
+ incx = -1;
+ left = endx;
+ right = startx;
+ }
+ else
+ {
+ dx = endx - startx;
+ incx = 1;
+ left = startx;
+ right = endx;
+ }
+ if (starty > endy)
+ {
+ dy = starty - endy;
+ incy = -1;
+ top = endy;
+ bottom = starty;
+ }
+ else
+ {
+ dy = endy - starty;
+ incy = 1;
+ top = starty;
+ bottom = endy;
+ }
+ if (dx >= dy)
+ {
+ dpr = dy << 1;
+ dpru = dpr - (dx << 1);
+ p = dpr - dx;
+ for (; dx >= 0; dx--)
+ {
+ set_pixel(startx, starty, pen->colour, opcode);
+ if (p > 0)
+ {
+ startx += incx;
+ starty += incy;
+ p += dpru;
+ }
+ else
+ {
+ startx += incx;
+ p += dpr;
+ }
+ }
+ }
+ else
+ {
+ dpr = dx << 1;
+ dpru = dpr - (dy << 1);
+ p = dpr - dy;
+ for (; dy >= 0; dy--)
+ {
+ set_pixel(startx, starty, pen->colour, opcode);
+ if (p > 0)
+ {
+ startx += incx;
+ starty += incy;
+ p += dpru;
+ }
+ else
+ {
+ starty += incy;
+ p += dpr;
+ }
+ }
+ }
+ redraw(left, top, (right - left) + 1, (bottom - top) + 1);
+}
+
+/******************************************************************************/
+void draw_glyph (int x, int y, HGLYPH glyph, int fgcolour)
+{
+ struct bitmap *the_glyph;
+ int i, j;
+
+ the_glyph = (struct bitmap*)glyph;
+ if (the_glyph == NULL)
+ return;
+ for (i = 0; i < the_glyph->h; i++)
+ for (j = 0; j < the_glyph->w; j++)
+ if (is_pixel_on(the_glyph->data, j, i, the_glyph->w, 8))
+ set_pixel(x + j, y + i, fgcolour);
+}
+
+#define DO_GLYPH(ttext,idx) \
+{\
+ glyph = cache_get_font (font, ttext[idx]);\
+ if (!(flags & TEXT2_IMPLICIT_X))\
+ {\
+ xyoffset = ttext[++idx];\
+ if ((xyoffset & 0x80))\
+ {\
+ if (flags & TEXT2_VERTICAL) \
+ y += ttext[idx+1] | (ttext[idx+2] << 8);\
+ else\
+ x += ttext[idx+1] | (ttext[idx+2] << 8);\
+ idx += 2;\
+ }\
+ else\
+ {\
+ if (flags & TEXT2_VERTICAL) \
+ y += xyoffset;\
+ else\
+ x += xyoffset;\
+ }\
+ }\
+ if (glyph != NULL)\
+ {\
+ draw_glyph (x + glyph->offset, y + glyph->baseline, glyph->pixmap, fgcolour);\
+ if (flags & TEXT2_IMPLICIT_X)\
+ x += glyph->width;\
+ }\
+}
+
+/******************************************************************************/
+//*****************************************************************************
+void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode,
+ int x, int y, int clipx, int clipy,
+ int clipcx, int clipcy, int boxx,
+ int boxy, int boxcx, int boxcy, BRUSH * brush,
+ int bgcolour, int fgcolour, uint8 * text, uint8 length)
+{
+ FONTGLYPH * glyph;
+ int i, j, xyoffset;
+ DATABLOB * entry;
+
+ if (boxx + boxcx > g_width)
+ boxcx = g_width - boxx;
+ if (boxy + boxcy > g_height)
+ boxcy = g_height - boxy;
+
+ if (boxcx > 1)
+ fill_rect(boxx, boxy, boxcx, boxcy, bgcolour);
+ else if (mixmode == MIX_OPAQUE)
+ fill_rect(clipx, clipy, clipcx, clipcy, bgcolour);
+
+ /* Paint text, character by character */
+ for (i = 0; i < length;)
+ {
+ switch (text[i])
+ {
+ case 0xff:
+ if (i + 2 < length)
+ cache_put_text(text[i + 1], text, text[i + 2]);
+ else
+ {
+ error("this shouldn't be happening\n");
+ exit(1);
+ }
+ /* this will move pointer from start to first character after FF command */
+ length -= i + 3;
+ text = &(text[i + 3]);
+ i = 0;
+ break;
+
+ case 0xfe:
+ entry = cache_get_text(text[i + 1]);
+ if (entry != NULL)
+ {
+ if ((((uint8 *) (entry->data))[1] == 0) && (!(flags & TEXT2_IMPLICIT_X)))
+ {
+ if (flags & TEXT2_VERTICAL)
+ y += text[i + 2];
+ else
+ x += text[i + 2];
+ }
+ for (j = 0; j < entry->size; j++)
+ DO_GLYPH(((uint8 *) (entry->data)), j);
+ }
+ if (i + 2 < length)
+ i += 3;
+ else
+ i += 2;
+ length -= i;
+ /* this will move pointer from start to first character after FE command */
+ text = &(text[i]);
+ i = 0;
+ break;
+
+ default:
+ DO_GLYPH(text, i);
+ i++;
+ break;
+ }
+ }
+ if (boxcx > 1)
+ redraw(boxx, boxy, boxcx, boxcy);
+ else
+ redraw(clipx, clipy, clipcx, clipcy);
+}
+
+/******************************************************************************/
+void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
+{
+ uint8 * data;
+ int i, j, Bpp, pixel;
+
+ Bpp = 4;
+ switch (g_server_bpp)
+ {
+ case 8: Bpp = 1; break;
+ case 15: Bpp = 2; break;
+ case 16: Bpp = 2; break;
+ }
+ data = (uint8*)xmalloc(cx * cy * Bpp);
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = get_pixel(x + j, y + i);
+ SETPIXEL8(data, j, i, cx, pixel);
+ }
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ {
+ pixel = get_pixel(x + j, y + i);
+ SETPIXEL16(data, j, i, cx, pixel);
+ }
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ *(((uint32*)data) + (i * cx + j)) = get_pixel(x + j, y + i);
+ }
+ offset *= Bpp;
+ cache_put_desktop(offset, cx, cy, cx * Bpp, Bpp, data);
+ xfree(data);
+}
+
+/******************************************************************************/
+void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
+{
+ uint8 * data;
+ int i, j;
+ int Bpp;
+
+ Bpp = 4;
+ switch (g_server_bpp)
+ {
+ case 8: Bpp = 1; break;
+ case 15: Bpp = 2; break;
+ case 16: Bpp = 2; break;
+ }
+ offset *= Bpp;
+ data = cache_get_desktop(offset, cx, cy, Bpp);
+ if (g_server_bpp == 8)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, data[i * cx + j]);
+ }
+ else if (g_server_bpp == 16)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, *(((uint16*)data) + (i * cx + j)));
+ }
+ else if (g_server_bpp == 24)
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, *(((uint32*)data) + (i * cx + j)));
+ }
+ redraw(x, y, cx, cy);
+}
+
+/*****************************************************************************/
+void * xrealloc(void * in_val, int size)
+{
+ if (size < 1)
+ {
+ size = 1;
+ }
+ return realloc(in_val, size);
+}
+
+/*****************************************************************************/
+void * xmalloc(int size)
+{
+ return malloc(size);
+}
+
+/*****************************************************************************/
+void xfree(void * in_val)
+{
+ if (in_val != NULL)
+ {
+ free(in_val);
+ }
+}
+
+/*****************************************************************************/
+char * xstrdup(const char * s)
+{
+ char * mem = strdup(s);
+ if (mem == NULL)
+ {
+ perror("strdup");
+ exit(1);
+ }
+ return mem;
+}
+
+/*****************************************************************************/
+void warning(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "WARNING: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void unimpl(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "NOT IMPLEMENTED: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void error(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "ERROR: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+BOOL rd_pstcache_mkdir(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_open_file(char * filename)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void rd_close_file(int fd)
+{
+ return;
+}
+
+/*****************************************************************************/
+int rd_read_file(int fd, void * ptr, int len)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_write_file(int fd, void * ptr, int len)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_lseek_file(int fd, int offset)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+BOOL rd_lock_file(int fd, int start, int len)
+{
+ return False;
+}
+
+/*****************************************************************************/
+int load_licence(uint8 ** data)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void save_licence(uint8 * data, int length)
+{
+}
+
+/*****************************************************************************/
+void generate_random(uint8 * random)
+{
+ QFile File("/dev/random");
+ File.open(IO_ReadOnly);
+ if (File.readBlock((char*)random, 32) == 32)
+ {
+ return;
+ }
+ warning("no /dev/random\n");
+ memcpy(random, "12345678901234567890123456789012", 32);
+}
+
+/*****************************************************************************/
+/* produce a hex dump */
+void hexdump(uint8 * p, uint32 len)
+{
+ uint8 * line = p;
+ int i, thisline;
+ uint32 offset = 0;
+
+ while (offset < len)
+ {
+ printf("%04x ", offset);
+ thisline = len - offset;
+ if (thisline > 16)
+ {
+ thisline = 16;
+ }
+ for (i = 0; i < thisline; i++)
+ {
+ printf("%02x ", line[i]);
+ }
+ for (; i < 16; i++)
+ {
+ printf(" ");
+ }
+ for (i = 0; i < thisline; i++)
+ {
+ printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');
+ }
+ printf("\n");
+ offset += thisline;
+ line += thisline;
+ }
+}
+
+/*****************************************************************************/
+void get_username_and_hostname(void)
+{
+ char fullhostname[64];
+ char * p;
+ struct passwd * pw;
+
+ STRNCPY(g_username, "unknown", sizeof(g_username));
+ STRNCPY(g_hostname, "unknown", sizeof(g_hostname));
+ pw = getpwuid(getuid());
+ if (pw != NULL && pw->pw_name != NULL)
+ {
+ STRNCPY(g_username, pw->pw_name, sizeof(g_username));
+ }
+ if (gethostname(fullhostname, sizeof(fullhostname)) != -1)
+ {
+ p = strchr(fullhostname, '.');
+ if (p != NULL)
+ {
+ *p = 0;
+ }
+ STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));
+ }
+}
+
+/*****************************************************************************/
+void out_params(void)
+{
+ fprintf(stderr, "qterdesktop: A Remote Desktop Protocol client.\n");
+ fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2004 Matt Chapman.\n");
+ fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
+ fprintf(stderr, "Usage: qterdesktop [options] server\n");
+ fprintf(stderr, " -g: desktop geometry (WxH)\n");
+ fprintf(stderr, " -4: use RDP version 4\n");
+ fprintf(stderr, " -5: use RDP version 5 (default)\n");
+ fprintf(stderr, " -t: tcp port)\n");
+ fprintf(stderr, " -a: connection colour depth\n");
+ fprintf(stderr, " -u: user name\n");
+ fprintf(stderr, " -d: domain\n");
+ fprintf(stderr, " -s: shell\n");
+ fprintf(stderr, " -c: working directory\n");
+ fprintf(stderr, " -p: password (- to prompt)\n");
+ fprintf(stderr, " -n: client hostname\n");
+ fprintf(stderr, " -f: full screen\n");
+ fprintf(stderr, " -r sound: enable sound\n");
+ fprintf(stderr, "\n");
+}
+
+/*****************************************************************************/
+int parse_parameters(int in_argc, char ** in_argv)
+{
+ int i;
+ char * p;
+
+ for (i = 1; i < in_argc; i++)
+ {
+ strcpy(g_server, in_argv[i]);
+ if (strcmp(in_argv[i], "-h") == 0)
+ {
+ out_params();
+ return 0;
+ }
+ else if (strcmp(in_argv[i], "-g") == 0)
+ {
+ g_width = strtol(in_argv[i + 1], &p, 10);
+ if (*p == 'x')
+ {
+ g_height = strtol(p + 1, &p, 10);
+ }
+ if (*p == '-')
+ {
+ g_client_width = strtol(p + 1, &p, 10);
+ }
+ else
+ {
+ g_client_width = g_width;
+ g_client_height = g_height;
+ }
+ if (*p == 'x')
+ {
+ g_client_height = strtol(p + 1, NULL, 10);
+ }
+ g_width = (g_width + 3) & ~3;
+ g_height = (g_height + 3) & ~3;
+ g_client_width = (g_client_width + 3) & ~3;
+ g_client_height = (g_client_height + 3) & ~3;
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-4") == 0)
+ {
+ g_use_rdp5 = 0;
+ }
+ else if (strcmp(in_argv[i], "-5") == 0)
+ {
+ g_use_rdp5 = 1;
+ }
+ else if (strcmp(in_argv[i], "-a") == 0)
+ {
+ g_server_bpp = strtol(in_argv[i + 1], &p, 10);
+ if (g_server_bpp != 8 &&
+ g_server_bpp != 16 && g_server_bpp != 24)
+ {
+ error("invalid bpp\n");
+ return 0;
+ }
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-t") == 0)
+ {
+ g_tcp_port_rdp = strtol(in_argv[i + 1], &p, 10);
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-u") == 0)
+ {
+ STRNCPY(g_username, in_argv[i + 1], sizeof(g_username));
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-d") == 0)
+ {
+ STRNCPY(g_domain, in_argv[i + 1], sizeof(g_domain));
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-s") == 0)
+ {
+ STRNCPY(g_shell, in_argv[i + 1], sizeof(g_shell));
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-c") == 0)
+ {
+ STRNCPY(g_directory, in_argv[i + 1], sizeof(g_directory));
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-p") == 0)
+ {
+ STRNCPY(g_password, in_argv[i + 1], sizeof(g_password));
+ g_flags |= RDP_LOGON_AUTO;
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-n") == 0)
+ {
+ STRNCPY(g_hostname, in_argv[i + 1], sizeof(g_hostname));
+ i++;
+ }
+ else if (strcmp(in_argv[i], "-f") == 0)
+ {
+ g_fullscreen = 1;
+ }
+ else if (strcmp(in_argv[i], "-r") == 0)
+ {
+ if (strcmp(in_argv[i + 1], "sound") == 0)
+ {
+#ifdef WITH_RDPSND
+ g_rdpsnd = 1;
+#endif
+ }
+ i++;
+ }
+ }
+ return 1;
+}
+
+/******************************************************************************/
+int param_connect(void)
+{
+ QWidget * Desktop;
+ int dw, dh;
+
+#ifdef WITH_RDPSND
+ // init sound
+ if (g_rdpsnd)
+ {
+ rdpsnd_init();
+ }
+#endif
+ if (rdp_connect(g_server, g_flags, g_domain, g_password, g_shell,
+ g_directory))
+ {
+ g_BS = (uint8*)xmalloc(g_width * g_height * 4);
+ memset(g_BS, 0, g_width * g_height * 4);
+ g_clipx = 0;
+ g_clipy = 0;
+ g_clipcx = g_width;
+ g_clipcy = g_height;
+ g_CM = (QColorMap*)xmalloc(sizeof(struct QColorMap));
+ memset(g_CM, 0, sizeof(struct QColorMap));
+ g_CM->NumColors = 256;
+ g_MW = new QMyMainWindow();
+ g_MW->resize(g_client_width, g_client_height);
+ g_MW->show();
+ g_SV->addChild(g_MW);
+ g_MW->setMouseTracking(true);
+ g_SocketNotifier = new QSocketNotifier(g_global_sock,
+ QSocketNotifier::Read,
+ g_MW);
+ g_MW->connect(g_SocketNotifier, SIGNAL(activated(int)), g_MW,
+ SLOT(dataReceived()));
+ if (g_fullscreen)
+ {
+ Desktop = g_App->desktop();
+ dw = Desktop->width();
+ dh = Desktop->height();
+ if (dw == g_client_width && dh == g_client_height)
+ {
+ g_MW->resize(g_client_width - 4, g_client_height - 4);
+ }
+ g_SV->showFullScreen();
+ }
+ g_MW->setCursor((int)10); /* Qt::BlankCursor */
+ g_App->exec();
+ }
+ return 0;
+}
+
+/******************************************************************************/
+int main(int argc, char ** argv)
+{
+#ifdef SHARP
+ g_App = new QPEApplication(argc, argv);
+#else
+ g_App = new QApplication(argc, argv, QApplication::GuiServer);
+ //g_App = new QApplication(argc, argv);
+#endif
+ g_SV = new QMyScrollView();
+ g_App->setMainWidget(g_SV);
+ g_SV->showMaximized();
+ if (argc > 1)
+ {
+ get_username_and_hostname();
+ if (parse_parameters(argc, argv))
+ {
+ param_connect();
+ }
+ }
+ else
+ {
+ g_SV->timer_id = g_SV->startTimer(1000); /* one sec delay, then dialog */
+ g_App->exec();
+ }
+ delete g_SV;
+ delete g_App;
+ xfree(g_CM);
+ xfree(g_BS);
+ return 0;
+}
--- /dev/null
+
+#include <qwidget.h>
+#include <qscrollview.h>
+#include <qdialog.h>
+#include <qlistbox.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qpopupmenu.h>
+
+class QMyConnectionItem
+{
+ public:
+ QString ServerName;
+ QString UserName;
+ QString ServerIP;
+ int Width;
+ int Height;
+ int FullScreen;
+};
+
+class QMyDialog: public QDialog
+{
+ Q_OBJECT
+ public:
+ QMyDialog(QWidget*);
+ ~QMyDialog();
+ public:
+ QListBox* ListBox;
+ QPushButton* OKButton;
+ QPushButton* CancelButton;
+ QLabel* Label1;
+ QLineEdit* ServerNameEdit;
+ QLabel* Label2;
+ QLineEdit* UserNameEdit;
+ QLabel* Label3;
+ QLineEdit* IPEdit;
+ QLineEdit* WidthEdit;
+ QLineEdit* HeightEdit;
+ QComboBox* WidthHeightBox;
+ QPushButton* AddButton;
+ QPushButton* EditButton;
+ QPushButton* SaveButton;
+ QPushButton* RemoveButton;
+ QCheckBox* FullScreenCheckBox;
+ public slots:
+ void ComboChanged(int);
+ void OKClicked();
+ void CancelClicked();
+ void AddClicked();
+ void EditClicked();
+ void SaveClicked();
+ void RemoveClicked();
+ void ListBoxChanged();
+ void ListBoxSelected(int);
+ public:
+ QString ServerName;
+ QString UserName;
+ QString ServerIP;
+ int Width;
+ int Height;
+ int FullScreen;
+ QMyConnectionItem* ConnectionList[10];
+};
+
+class QMyScrollView: public QScrollView
+{
+ Q_OBJECT
+ public:
+ QMyScrollView();
+ ~QMyScrollView();
+ void keyPressEvent(QKeyEvent*);
+ void keyReleaseEvent(QKeyEvent*);
+ void showEvent(QShowEvent*);
+ void show();
+ void polish();
+ void timerEvent(QTimerEvent*);
+ public:
+ int timer_id;
+ int sound_timer_id;
+};
+
+class QMyMainWindow: public QWidget
+{
+ Q_OBJECT
+ public:
+ QMyMainWindow();
+ ~QMyMainWindow();
+ void paintEvent(QPaintEvent*);
+ void mouseMoveEvent(QMouseEvent*);
+ void mousePressEvent(QMouseEvent*);
+ void mouseReleaseEvent(QMouseEvent*);
+ void wheelEvent(QWheelEvent*);
+ void closeEvent(QCloseEvent*);
+ void timerEvent(QTimerEvent*);
+ public slots:
+ void dataReceived();
+ void soundSend();
+ void MemuClicked(int);
+ public:
+ QPopupMenu* PopupMenu;
+ int timer_id;
+ int mx;
+ int my;
+};
+
--- /dev/null
+This is the Qt/X11 ui port
+qt should be installed in /usr/local/qt
+you may need to have LD_LIBRARY_PATH defined to run qtrdesktop
+tested with versions 2.3.2, 3.1.2
+
+makefile_qt can be edited to change file localtions
+run make -f makefile_qt in this directory to compile it
+
+qtreadme.txt - notes, this file
+makefile_qt - makefile
+qtwin.cpp - ui lib
+qtwin.h - header
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ User interface services - QT Window System
+ Copyright (C) Jay Sorg 2004-2006
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "rdesktop.h"
+
+#include <qapplication.h>
+#include <qmainwindow.h>
+#include <qwidget.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qbrush.h>
+#include <qimage.h>
+#include <qbitmap.h>
+#include <qcursor.h>
+#include <qsocketnotifier.h>
+#include <qscrollview.h>
+#include <qfile.h>
+
+#include "qtwin.h"
+
+#include <unistd.h> // gethostname
+#include <pwd.h> // getpwuid
+#include <stdarg.h> // va_list va_start va_end
+
+#include <errno.h>
+#include <fcntl.h>
+
+/* rdesktop globals */
+extern int g_tcp_port_rdp;
+int g_use_rdp5 = 1;
+char g_hostname[16];
+char g_username[64];
+int g_height = 600;
+int g_width = 800;
+int g_server_depth = 8;
+int g_encryption = 1;
+int g_desktop_save = 1;
+int g_polygon_ellipse_orders = 0;
+int g_bitmap_cache = 1;
+int g_bitmap_cache_persist_enable = False;
+int g_bitmap_cache_precache = True;
+int g_bitmap_compression = 1;
+int g_rdp5_performanceflags = 0;
+int g_console_session = 0;
+int g_keylayout = 0x409; /* Defaults to US keyboard layout */
+int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */
+int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
+int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */
+
+/* hack globals */
+static int g_argc = 0;
+static char ** g_argv = 0;
+static int g_UpAndRunning = 0;
+static int g_sock = 0;
+static int g_deactivated = 0;
+static uint32 g_ext_disc_reason = 0;
+static char g_servername[128];
+static char g_title[128] = "";
+static int g_flags = RDP_LOGON_NORMAL;
+
+#ifdef WITH_RDPSND
+extern int g_dsp_busy;
+extern int g_dsp_fd;
+static int g_rdpsnd = 0;
+static QSocketNotifier * g_SoundNotifier = 0;
+#endif
+
+/* qt globals */
+static QSocketNotifier * g_SocketNotifier = 0;
+static QApplication * g_App = 0;
+static QMyMainWindow * g_MW = 0;
+static QMyScrollView * g_SV = 0;
+static QPixmap * g_BS = 0;
+static QPixmap * g_DS = 0;
+static QPainter * g_P1 = 0;
+static QPainter * g_P2 = 0;
+static QColor g_Color1;
+static QColor g_Color2;
+
+struct QColorMap
+{
+ uint32 RGBColors[256];
+ int NumColors;
+};
+static struct QColorMap * g_CM = 0;
+static QRegion * g_ClipRect;
+
+static Qt::RasterOp g_OpCodes[16] = {
+ Qt::ClearROP, // BLACKNESS 0
+ Qt::NorROP, // NOTSRCERASE DSon
+ Qt::NotAndROP, // DSna
+ Qt::NotCopyROP, // NOTSRCCOPY Sn
+ Qt::AndNotROP, // SRCERASE SDna
+ Qt::NotROP, // DSTINVERT Dn
+ Qt::XorROP, // SRCINVERT DSx
+ Qt::NandROP, // DSan
+ Qt::AndROP, // SRCAND DSa
+ Qt::NotXorROP, // DSxn
+ Qt::NopROP, // D
+ Qt::NotOrROP, // MERGEPAINT DSno
+ Qt::CopyROP, // SRCCOPY S
+ Qt::OrNotROP, // SDno
+ Qt::OrROP, // SRCPAINT DSo
+ Qt::SetROP}; // WHITENESS 1
+
+/* Session Directory redirection */
+BOOL g_redirect = False;
+char g_redirect_server[64];
+char g_redirect_domain[16];
+char g_redirect_password[64];
+char g_redirect_username[64];
+char g_redirect_cookie[128];
+uint32 g_redirect_flags = 0;
+
+//*****************************************************************************
+uint32 Color15to32(uint32 InColor)
+{
+ uint32 r, g, b;
+
+ r = (InColor & 0x7c00) >> 10;
+ r = (r * 0xff) / 0x1f;
+ g = (InColor & 0x03e0) >> 5;
+ g = (g * 0xff) / 0x1f;
+ b = (InColor & 0x001f);
+ b = (b * 0xff) / 0x1f;
+ return (r << 16) | (g << 8) | b;
+}
+
+//*****************************************************************************
+uint32 Color16to32(uint32 InColor)
+{
+ uint32 r, g, b;
+
+ r = (InColor & 0xf800) >> 11;
+ r = (r * 0xff) / 0x1f;
+ g = (InColor & 0x07e0) >> 5;
+ g = (g * 0xff) / 0x3f;
+ b = (InColor & 0x001f);
+ b = (b * 0xff) / 0x1f;
+ return (r << 16) | (g << 8) | b;
+}
+
+//*****************************************************************************
+uint32 Color24to32(uint32 InColor)
+{
+ return ((InColor & 0x00ff0000) >> 16) |
+ ((InColor & 0x000000ff) << 16) |
+ (InColor & 0x0000ff00);
+}
+
+//*****************************************************************************
+void SetColorx(QColor * Color, uint32 InColor)
+{
+ switch (g_server_depth)
+ {
+ case 8:
+ if (g_CM == NULL || InColor > 255)
+ {
+ Color->setRgb(0);
+ return;
+ }
+ Color->setRgb(g_CM->RGBColors[InColor]);
+ break;
+ case 15:
+ Color->setRgb(Color15to32(InColor));
+ break;
+ case 16:
+ Color->setRgb(Color16to32(InColor));
+ break;
+ case 24:
+ Color->setRgb(Color24to32(InColor));
+ break;
+ default:
+ Color->setRgb(0);
+ }
+}
+
+//*****************************************************************************
+void SetOpCode(int opcode)
+{
+ if (opcode >= 0 && opcode < 16)
+ {
+ Qt::RasterOp op = g_OpCodes[opcode];
+ if (op != Qt::CopyROP)
+ {
+ g_P1->setRasterOp(op);
+ g_P2->setRasterOp(op);
+ }
+ }
+}
+
+//*****************************************************************************
+void ResetOpCode(int opcode)
+{
+ if (opcode >= 0 && opcode < 16)
+ {
+ Qt::RasterOp op = g_OpCodes[opcode];
+ if (op != Qt::CopyROP)
+ {
+ g_P1->setRasterOp(Qt::CopyROP);
+ g_P2->setRasterOp(Qt::CopyROP);
+ }
+ }
+}
+
+/*****************************************************************************/
+QMyMainWindow::QMyMainWindow(): QWidget()
+{
+}
+
+/*****************************************************************************/
+QMyMainWindow::~QMyMainWindow()
+{
+}
+
+//*****************************************************************************
+void QMyMainWindow::mouseMoveEvent(QMouseEvent * e)
+{
+ if (!g_UpAndRunning)
+ {
+ return;
+ }
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE, e->x(), e->y());
+}
+
+//*****************************************************************************
+void QMyMainWindow::mousePressEvent(QMouseEvent * e)
+{
+ if (!g_UpAndRunning)
+ {
+ return;
+ }
+ if (e->button() == LeftButton)
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON1,
+ e->x(), e->y());
+ }
+ else if (e->button() == RightButton)
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON2,
+ e->x(), e->y());
+ }
+ else if (e->button() == MidButton)
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON3,
+ e->x(), e->y());
+ }
+}
+
+//*****************************************************************************
+void QMyMainWindow::mouseReleaseEvent(QMouseEvent * e)
+{
+ if (!g_UpAndRunning)
+ {
+ return;
+ }
+ if (e->button() == LeftButton)
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1, e->x(), e->y());
+ }
+ else if (e->button() == RightButton)
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2, e->x(), e->y());
+ }
+ else if (e->button() == MidButton)
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3, e->x(), e->y());
+ }
+}
+
+//*****************************************************************************
+void QMyMainWindow::wheelEvent(QWheelEvent * e)
+{
+ if (!g_UpAndRunning)
+ {
+ return;
+ }
+ if (e->delta() > 0)
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON4, e->x(), e->y());
+ }
+ else if (e->delta() < 0)
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON5, e->x(), e->y());
+ }
+}
+
+//*****************************************************************************
+int GetScanCode(QKeyEvent* e)
+{
+ int Key = e->key();
+ int ScanCode = 0;
+ Qt::ButtonState bs = e->state();
+ if (!(bs & Qt::ShiftButton)) // shift is not down
+ {
+ if (Key == 42) // *
+ return 0x37;
+ if (Key == 43) // +
+ return 0x4e;
+ }
+ switch (Key)
+ {
+ case 4100: ScanCode = 0x1c; break; // enter
+ case 4101: ScanCode = 0x1c; break;
+ case 4117: ScanCode = 0xd0; break; // down arrow
+ case 4115: ScanCode = 0xc8; break; // up arrow
+ case 4114: ScanCode = 0xcb; break; // left arrow
+ case 4116: ScanCode = 0xcd; break; // right arrow
+ case 4112: ScanCode = 0xc7; break; // home
+ case 4113: ScanCode = 0xcf; break; // end
+ case 4102: ScanCode = 0xd2; break; // insert
+ case 4103: ScanCode = 0xd3; break; // delete
+ case 4118: ScanCode = 0xc9; break; // page up
+ case 4119: ScanCode = 0xd1; break; // page down
+ case 4143: ScanCode = 0x00; break; // num lock
+ case 47: ScanCode = 0x35; break; // /
+ case 42: ScanCode = 0x37; break; // *
+ case 45: ScanCode = 0x0c; break; // -
+ case 95: ScanCode = 0x0c; break; // _
+ case 43: ScanCode = 0x0d; break; // +
+ case 46: ScanCode = 0x34; break; // .
+ case 48: ScanCode = 0x0b; break; // 0
+ case 41: ScanCode = 0x0b; break; // )
+ case 49: ScanCode = 0x02; break; // 1
+ case 33: ScanCode = 0x02; break; // !
+ case 50: ScanCode = 0x03; break; // 2
+ case 64: ScanCode = 0x03; break; // @
+ case 51: ScanCode = 0x04; break; // 3
+ case 35: ScanCode = 0x04; break; // #
+ case 52: ScanCode = 0x05; break; // 4
+ case 36: ScanCode = 0x05; break; // $
+ case 53: ScanCode = 0x06; break; // 5
+ case 37: ScanCode = 0x06; break; // %
+ case 54: ScanCode = 0x07; break; // 6
+ case 94: ScanCode = 0x07; break; // ^
+ case 55: ScanCode = 0x08; break; // 7
+ case 38: ScanCode = 0x08; break; // &
+ case 56: ScanCode = 0x09; break; // 8
+ case 57: ScanCode = 0x0a; break; // 9
+ case 40: ScanCode = 0x0a; break; // (
+ case 61: ScanCode = 0x0d; break; // =
+ case 65: ScanCode = 0x1e; break; // a
+ case 66: ScanCode = 0x30; break; // b
+ case 67: ScanCode = 0x2e; break; // c
+ case 68: ScanCode = 0x20; break; // d
+ case 69: ScanCode = 0x12; break; // e
+ case 70: ScanCode = 0x21; break; // f
+ case 71: ScanCode = 0x22; break; // g
+ case 72: ScanCode = 0x23; break; // h
+ case 73: ScanCode = 0x17; break; // i
+ case 74: ScanCode = 0x24; break; // j
+ case 75: ScanCode = 0x25; break; // k
+ case 76: ScanCode = 0x26; break; // l
+ case 77: ScanCode = 0x32; break; // m
+ case 78: ScanCode = 0x31; break; // n
+ case 79: ScanCode = 0x18; break; // o
+ case 80: ScanCode = 0x19; break; // p
+ case 81: ScanCode = 0x10; break; // q
+ case 82: ScanCode = 0x13; break; // r
+ case 83: ScanCode = 0x1f; break; // s
+ case 84: ScanCode = 0x14; break; // t
+ case 85: ScanCode = 0x16; break; // u
+ case 86: ScanCode = 0x2f; break; // v
+ case 87: ScanCode = 0x11; break; // w
+ case 88: ScanCode = 0x2d; break; // x
+ case 89: ScanCode = 0x15; break; // y
+ case 90: ScanCode = 0x2c; break; // z
+ case 32: ScanCode = 0x39; break; // space
+ case 44: ScanCode = 0x33; break; // ,
+ case 60: ScanCode = 0x33; break; // <
+ case 62: ScanCode = 0x34; break; // >
+ case 63: ScanCode = 0x35; break; // ?
+ case 92: ScanCode = 0x2b; break; // backslash
+ case 124: ScanCode = 0x2b; break; // bar
+ case 4097: ScanCode = 0x0f; break; // tab
+ case 4132: ScanCode = 0x3a; break; // caps lock
+ case 4096: ScanCode = 0x01; break; // esc
+ case 59: ScanCode = 0x27; break; // ;
+ case 58: ScanCode = 0x27; break; // :
+ case 39: ScanCode = 0x28; break; // '
+ case 34: ScanCode = 0x28; break; // "
+ case 91: ScanCode = 0x1a; break; // [
+ case 123: ScanCode = 0x1a; break; // {
+ case 93: ScanCode = 0x1b; break; // ]
+ case 125: ScanCode = 0x1b; break; // }
+ case 4144: ScanCode = 0x3b; break; // f1
+ case 4145: ScanCode = 0x3c; break; // f2
+ case 4146: ScanCode = 0x3d; break; // f3
+ case 4147: ScanCode = 0x3e; break; // f4
+ case 4148: ScanCode = 0x3f; break; // f5
+ case 4149: ScanCode = 0x40; break; // f6
+ case 4150: ScanCode = 0x41; break; // f7
+ case 4151: ScanCode = 0x42; break; // f8
+ case 4152: ScanCode = 0x43; break; // f9
+ case 4153: ScanCode = 0x44; break; // f10
+ case 4154: ScanCode = 0x57; break; // f11
+ case 4155: ScanCode = 0x58; break; // f12
+ case 4128: ScanCode = 0x2a; break; // shift
+ case 4131: ScanCode = 0x38; break; // alt
+ case 4129: ScanCode = 0x1d; break; // ctrl
+ case 96: ScanCode = 0x29; break; // `
+ case 126: ScanCode = 0x29; break; // ~
+ case 4099: ScanCode = 0x0e; break; // backspace
+ }
+// if (ScanCode == 0)
+// printf("key %d scancode %d\n", Key, ScanCode);
+ return ScanCode;
+}
+
+//*****************************************************************************
+void QMyMainWindow::keyPressEvent(QKeyEvent* e)
+{
+ if (!g_UpAndRunning)
+ return;
+ int ScanCode = GetScanCode(e);
+ if (ScanCode != 0)
+ {
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS, ScanCode, 0);
+ e->accept();
+ }
+}
+
+//*****************************************************************************
+void QMyMainWindow::keyReleaseEvent(QKeyEvent* e)
+{
+ if (!g_UpAndRunning)
+ {
+ return;
+ }
+ int ScanCode = GetScanCode(e);
+ if (ScanCode != 0)
+ {
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE, ScanCode, 0);
+ e->accept();
+ }
+}
+
+//*****************************************************************************
+void QMyMainWindow::paintEvent(QPaintEvent * pe)
+{
+ QRect Rect;
+
+ Rect = pe->rect();
+ bitBlt(this, Rect.left(), Rect.top(), g_BS, Rect.left(), Rect.top(),
+ Rect.width(), Rect.height());
+}
+
+//*****************************************************************************
+void QMyMainWindow::closeEvent(QCloseEvent * e)
+{
+ e->accept();
+}
+
+//*****************************************************************************
+bool QMyMainWindow::event(QEvent * e)
+{
+ return QWidget::event(e);
+}
+
+//*****************************************************************************
+void QMyMainWindow::dataReceived()
+{
+ if (!rdp_loop(&g_deactivated, &g_ext_disc_reason))
+ {
+ g_SV->close();
+ }
+#ifdef WITH_RDPSND
+ if (g_dsp_busy)
+ {
+ if (g_SoundNotifier == 0)
+ {
+ g_SoundNotifier = new QSocketNotifier(g_dsp_fd, QSocketNotifier::Write,
+ g_MW);
+ g_MW->connect(g_SoundNotifier, SIGNAL(activated(int)), g_MW,
+ SLOT(soundSend()));
+ }
+ else
+ {
+ if (!g_SoundNotifier->isEnabled())
+ {
+ g_SoundNotifier->setEnabled(true);
+ }
+ }
+ }
+#endif
+}
+
+/******************************************************************************/
+void QMyMainWindow::soundSend()
+{
+#ifdef WITH_RDPSND
+ g_SoundNotifier->setEnabled(false);
+ wave_out_play();
+ if (g_dsp_busy)
+ {
+ g_SoundNotifier->setEnabled(true);
+ }
+#endif
+}
+
+//*****************************************************************************
+void QMyScrollView::keyPressEvent(QKeyEvent * e)
+{
+ g_MW->keyPressEvent(e);
+}
+
+//*****************************************************************************
+void QMyScrollView::keyReleaseEvent(QKeyEvent * e)
+{
+ g_MW->keyReleaseEvent(e);
+}
+
+
+//*****************************************************************************
+void ui_begin_update(void)
+{
+ g_P1->begin(g_MW);
+ g_P2->begin(g_BS);
+}
+
+//*****************************************************************************
+void ui_end_update(void)
+{
+ g_P1->end();
+ g_P2->end();
+}
+
+/*****************************************************************************/
+int ui_init(void)
+{
+ g_App = new QApplication(g_argc, g_argv);
+ return 1;
+}
+
+/*****************************************************************************/
+void ui_deinit(void)
+{
+ delete g_App;
+}
+
+/*****************************************************************************/
+int ui_create_window(void)
+{
+ int w, h;
+ QPainter * painter;
+ QWidget * desktop;
+
+ g_MW = new QMyMainWindow();
+ g_SV = new QMyScrollView();
+ g_SV->addChild(g_MW);
+ g_BS = new QPixmap(g_width, g_height);
+ painter = new QPainter(g_BS);
+ painter->fillRect(0, 0, g_width, g_height, QBrush(QColor("white")));
+ painter->fillRect(0, 0, g_width, g_height, QBrush(QBrush::CrossPattern));
+ delete painter;
+ g_DS = new QPixmap(480, 480);
+ g_P1 = new QPainter();
+ g_P2 = new QPainter();
+ g_ClipRect = new QRegion(0, 0, g_width, g_height);
+ desktop = QApplication::desktop();
+ w = desktop->width(); // returns screen width
+ h = desktop->height(); // returns screen height
+ g_MW->resize(g_width, g_height);
+ if (w < g_width || h < g_height)
+ {
+ g_SV->resize(w, h);
+ }
+ else
+ {
+ g_SV->resize(g_width + 4, g_height + 4);
+ }
+ g_SV->setMaximumWidth(g_width + 4);
+ g_SV->setMaximumHeight(g_height + 4);
+ g_App->setMainWidget(g_SV);
+ g_SV->show();
+ g_MW->setMouseTracking(true);
+ if (g_title[0] != 0)
+ {
+ g_SV->setCaption(g_title);
+ }
+
+/* XGrayKey(0, 64, AnyModifie, SV->winId(), 0, GrabModeAsync, GrabModeAsync);
+ XGrayKey(0, 113, AnyModifie, SV->winId(), 0, GrabModeAsync, GrabModeAsync);
+ XGrayKey(0, 37, AnyModifie, SV-winId(), 0, GrabModeAsync, GrabModeAsync);
+ XGrayKey(0, 109, AnyModifie, SV->winId(), 0, GrabModeAsync, GrabModeAsync);
+ XGrayKey(0, 115, AnyModifie, SV->winId(), 0, GrabModeAsync, GrabModeAsync);
+ XGrayKey(0, 116, AnyModifie, SV->winId(), 0, GrabModeAsync, GrabModeAsync);
+ XGrayKey(0, 117, AnyModifie, SV->winId(), 0, GrabModeAsync, GrabModeAsync);
+ XGrayKey(0, 62, AnyModifie, SV->winId(), 0, GrabModeAsync, GrabModeAsync);
+ XGrayKey(0, 50, AnyModifie, SV->winId(), 0, GrabModeAsync, GrabModeAsync);*/
+
+ return 1;
+}
+
+//*****************************************************************************
+void ui_main_loop(void)
+{
+#ifdef WITH_RDPSND
+ // init sound
+ if (g_rdpsnd)
+ {
+ rdpsnd_init();
+ }
+#endif
+ // connect
+ if (!rdp_connect(g_servername, g_flags, "", "", "", ""))
+ {
+ return;
+ }
+ // start notifier
+ g_SocketNotifier = new QSocketNotifier(g_sock, QSocketNotifier::Read, g_MW);
+ g_MW->connect(g_SocketNotifier, SIGNAL(activated(int)),
+ g_MW, SLOT(dataReceived()));
+ g_UpAndRunning = 1;
+ // app main loop
+ g_App->exec();
+}
+
+//*****************************************************************************
+void ui_destroy_window(void)
+{
+ delete g_MW;
+ delete g_SV;
+ delete g_BS;
+ delete g_DS;
+ delete g_P1;
+ delete g_P2;
+ delete g_ClipRect;
+}
+
+/*****************************************************************************/
+void ui_bell(void)
+{
+}
+
+/*****************************************************************************/
+int ui_select(int in_val)
+{
+ if (g_sock == 0)
+ {
+ g_sock = in_val;
+ }
+ return 1;
+}
+
+/*****************************************************************************/
+void ui_destroy_cursor(void * cursor)
+{
+ QCursor * Cursor;
+ Cursor = (QCursor*)cursor;
+ if (Cursor != NULL)
+ {
+ delete Cursor;
+ }
+}
+
+/*****************************************************************************/
+void* ui_create_glyph(int width, int height, uint8 * data)
+{
+ QBitmap * Bitmap;
+ Bitmap = new QBitmap(width, height, data);
+ Bitmap->setMask(*Bitmap);
+ return (HGLYPH)Bitmap;
+}
+
+/*****************************************************************************/
+void ui_destroy_glyph(void * glyph)
+{
+ QBitmap* Bitmap;
+ Bitmap = (QBitmap*)glyph;
+ delete Bitmap;
+}
+
+/*****************************************************************************/
+void ui_destroy_bitmap(void * bmp)
+{
+ QPixmap * Pixmap;
+ Pixmap = (QPixmap*)bmp;
+ delete Pixmap;
+}
+
+/*****************************************************************************/
+void ui_reset_clip(void)
+{
+ g_P1->setClipRect(0, 0, g_width, g_height);
+ g_P2->setClipRect(0, 0, g_width, g_height);
+ delete g_ClipRect;
+ g_ClipRect = new QRegion(0, 0, g_width, g_height);
+}
+
+/*****************************************************************************/
+void ui_set_clip(int x, int y, int cx, int cy)
+{
+ g_P1->setClipRect(x, y, cx, cy);
+ g_P2->setClipRect(x, y, cx, cy);
+ delete g_ClipRect;
+ g_ClipRect = new QRegion(x, y, cx, cy);
+}
+
+/*****************************************************************************/
+void * ui_create_colourmap(COLOURMAP * colours)
+{
+ QColorMap* LCM;
+ int i, r, g, b;
+ LCM = (QColorMap*)malloc(sizeof(QColorMap));
+ memset(LCM, 0, sizeof(QColorMap));
+ i = 0;
+ while (i < colours->ncolours && i < 256)
+ {
+ r = colours->colours[i].red;
+ g = colours->colours[i].green;
+ b = colours->colours[i].blue;
+ LCM->RGBColors[i] = (r << 16) | (g << 8) | b;
+ i++;
+ }
+ LCM->NumColors = colours->ncolours;
+ return LCM;
+}
+
+//*****************************************************************************
+// todo, does this leak at end of program
+void ui_destroy_colourmap(HCOLOURMAP map)
+{
+ QColorMap * LCM;
+ LCM = (QColorMap*)map;
+ if (LCM == NULL)
+ return;
+ free(LCM);
+}
+
+/*****************************************************************************/
+void ui_set_colourmap(void * map)
+{
+ // destoy old colormap
+ ui_destroy_colourmap(g_CM);
+ g_CM = (QColorMap*)map;
+}
+
+/*****************************************************************************/
+HBITMAP ui_create_bitmap(int width, int height, uint8 * data)
+{
+ QImage * Image = NULL;
+ QPixmap * Pixmap;
+ uint32 * d = NULL;
+ uint16 * s;
+ int i;
+
+ switch (g_server_depth)
+ {
+ case 8:
+ Image = new QImage(data, width, height, 8, (QRgb*)&g_CM->RGBColors,
+ g_CM->NumColors, QImage::IgnoreEndian);
+ break;
+ case 15:
+ d = (uint32*)malloc(width * height * 4);
+ s = (uint16*)data;
+ for (i = 0; i < width * height; i++)
+ {
+ d[i] = Color15to32(s[i]);
+ }
+ Image = new QImage((uint8*)d, width, height, 32, NULL,
+ 0, QImage::IgnoreEndian);
+ break;
+ case 16:
+ d = (uint32*)malloc(width * height * 4);
+ s = (uint16*)data;
+ for (i = 0; i < width * height; i++)
+ {
+ d[i] = Color16to32(s[i]);
+ }
+ Image = new QImage((uint8*)d, width, height, 32, NULL,
+ 0, QImage::IgnoreEndian);
+ break;
+ case 24:
+ d = (uint32*)malloc(width * height * 4);
+ memset(d, 0, width * height * 4);
+ for (i = 0; i < width * height; i++)
+ {
+ memcpy(d + i, data + i * 3, 3);
+ }
+ Image = new QImage((uint8*)d, width, height, 32, NULL,
+ 0, QImage::IgnoreEndian);
+ break;
+ }
+ if (Image == NULL)
+ {
+ return NULL;
+ }
+ Pixmap = new QPixmap();
+ Pixmap->convertFromImage(*Image);
+ delete Image;
+ if (d != NULL)
+ {
+ free(d);
+ }
+ return (HBITMAP)Pixmap;
+}
+
+//******************************************************************************
+// adjust coordinates for cliping rect
+int WarpCoords(int * x, int * y, int * cx, int * cy, int * srcx, int * srcy)
+{
+ int dx, dy;
+ QRect InRect(*x, *y, *cx, *cy);
+ QRect OutRect;
+ QRect CRect = g_ClipRect->boundingRect();
+ OutRect = InRect.intersect(CRect);
+ if (OutRect.isEmpty())
+ {
+ return False;
+ }
+ dx = OutRect.x() - InRect.x();
+ dy = OutRect.y() - InRect.y();
+ *x = OutRect.x();
+ *y = OutRect.y();
+ *cx = OutRect.width();
+ *cy = OutRect.height();
+ *srcx = *srcx + dx;
+ *srcy = *srcy + dy;
+ return True;
+}
+
+//******************************************************************************
+// needed because bitBlt don't seem to care about clipping rects
+// also has 2 dsts and src can be null
+void bitBltClip(QPaintDevice * dst1, QPaintDevice * dst2, int dx, int dy,
+ QPaintDevice * src, int sx, int sy, int sw, int sh,
+ Qt::RasterOp rop, bool im)
+{
+ if (WarpCoords(&dx, &dy, &sw, &sh, &sx, &sy))
+ {
+ if (dst1 != NULL)
+ {
+ if (src == NULL)
+ {
+ bitBlt(dst1, dx, dy, dst1, sx, sy, sw, sh, rop, im);
+ }
+ else
+ {
+ bitBlt(dst1, dx, dy, src, sx, sy, sw, sh, rop, im);
+ }
+ }
+ if (dst2 != NULL)
+ {
+ if (src == NULL)
+ {
+ bitBlt(dst2, dx, dy, dst2, sx, sy, sw, sh, rop, im);
+ }
+ else
+ {
+ bitBlt(dst2, dx, dy, src, sx, sy, sw, sh, rop, im);
+ }
+ }
+ }
+}
+
+#define DO_GLYPH(ttext,idx) \
+{ \
+ glyph = cache_get_font (font, ttext[idx]); \
+ if (!(flags & TEXT2_IMPLICIT_X)) \
+ { \
+ xyoffset = ttext[++idx]; \
+ if ((xyoffset & 0x80)) \
+ { \
+ if (flags & TEXT2_VERTICAL) \
+ y += ttext[idx+1] | (ttext[idx+2] << 8); \
+ else \
+ x += ttext[idx+1] | (ttext[idx+2] << 8); \
+ idx += 2; \
+ } \
+ else \
+ { \
+ if (flags & TEXT2_VERTICAL) \
+ y += xyoffset; \
+ else \
+ x += xyoffset; \
+ } \
+ } \
+ if (glyph != NULL) \
+ { \
+ g_P2->drawPixmap(x + glyph->offset, y + glyph->baseline, \
+ *((QBitmap*)glyph->pixmap)); \
+ if (flags & TEXT2_IMPLICIT_X) \
+ x += glyph->width; \
+ } \
+}
+
+//*****************************************************************************
+void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode,
+ int x, int y, int clipx, int clipy,
+ int clipcx, int clipcy, int boxx,
+ int boxy, int boxcx, int boxcy, BRUSH * brush,
+ int bgcolour, int fgcolour, uint8 * text, uint8 length)
+{
+ FONTGLYPH * glyph;
+ int i, j, xyoffset;
+ DATABLOB * entry;
+
+ SetColorx(&g_Color1, fgcolour);
+ SetColorx(&g_Color2, bgcolour);
+ g_P2->setBackgroundColor(g_Color2);
+ g_P2->setPen(g_Color1);
+ if (boxcx > 1)
+ {
+ g_P2->fillRect(boxx, boxy, boxcx, boxcy, QBrush(g_Color2));
+ }
+ else if (mixmode == MIX_OPAQUE)
+ {
+ g_P2->fillRect(clipx, clipy, clipcx, clipcy, QBrush(g_Color2));
+ }
+
+ /* Paint text, character by character */
+ for (i = 0; i < length;)
+ {
+ switch (text[i])
+ {
+ case 0xff:
+ if (i + 2 < length)
+ {
+ cache_put_text(text[i + 1], text, text[i + 2]);
+ }
+ else
+ {
+ error("this shouldn't be happening\n");
+ exit(1);
+ }
+ /* this will move pointer from start to first character after FF
+ command */
+ length -= i + 3;
+ text = &(text[i + 3]);
+ i = 0;
+ break;
+
+ case 0xfe:
+ entry = cache_get_text(text[i + 1]);
+ if (entry != NULL)
+ {
+ if ((((uint8 *) (entry->data))[1] == 0) &&
+ (!(flags & TEXT2_IMPLICIT_X)))
+ {
+ if (flags & TEXT2_VERTICAL)
+ {
+ y += text[i + 2];
+ }
+ else
+ {
+ x += text[i + 2];
+ }
+ }
+ for (j = 0; j < entry->size; j++)
+ {
+ DO_GLYPH(((uint8 *) (entry->data)), j);
+ }
+ }
+ if (i + 2 < length)
+ {
+ i += 3;
+ }
+ else
+ {
+ i += 2;
+ }
+ length -= i;
+ /* this will move pointer from start to first character after FE
+ command */
+ text = &(text[i]);
+ i = 0;
+ break;
+
+ default:
+ DO_GLYPH(text, i);
+ i++;
+ break;
+ }
+ }
+ if (boxcx > 1)
+ {
+ bitBltClip(g_MW, NULL, boxx, boxy, g_BS, boxx, boxy, boxcx, boxcy,
+ Qt::CopyROP, true);
+ }
+ else
+ {
+ bitBltClip(g_MW, NULL, clipx, clipy, g_BS, clipx, clipy, clipcx,
+ clipcy, Qt::CopyROP, true);
+ }
+}
+
+/*****************************************************************************/
+void ui_line(uint8 opcode, int startx, int starty, int endx, int endy,
+ PEN * pen)
+{
+ SetColorx(&g_Color1, pen->colour);
+ SetOpCode(opcode);
+ g_P1->setPen(g_Color1);
+ g_P1->moveTo(startx, starty);
+ g_P1->lineTo(endx, endy);
+ g_P2->setPen(g_Color1);
+ g_P2->moveTo(startx, starty);
+ g_P2->lineTo(endx, endy);
+ ResetOpCode(opcode);
+}
+
+/*****************************************************************************/
+// not used
+void ui_triblt(uint8 opcode, int x, int y, int cx, int cy,
+ HBITMAP src, int srcx, int srcy,
+ BRUSH* brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+void ui_memblt(uint8 opcode, int x, int y, int cx, int cy,
+ HBITMAP src, int srcx, int srcy)
+{
+ QPixmap* Pixmap;
+ Pixmap = (QPixmap*)src;
+ if (Pixmap != NULL)
+ {
+ SetOpCode(opcode);
+ g_P1->drawPixmap(x, y, *Pixmap, srcx, srcy, cx, cy);
+ g_P2->drawPixmap(x, y, *Pixmap, srcx, srcy, cx, cy);
+ ResetOpCode(opcode);
+ }
+}
+
+//******************************************************************************
+void CommonDeskSave(QPixmap* Pixmap1, QPixmap* Pixmap2, int Offset, int x,
+ int y, int cx, int cy, int dir)
+{
+ int lx;
+ int ly;
+ int x1;
+ int y1;
+ int width;
+ int lcx;
+ int right;
+ int bottom;
+ lx = Offset % 480;
+ ly = Offset / 480;
+ y1 = y;
+ right = x + cx;
+ bottom = y + cy;
+ while (y1 < bottom)
+ {
+ x1 = x;
+ lcx = cx;
+ while (x1 < right)
+ {
+ width = 480 - lx;
+ if (width > lcx)
+ width = lcx;
+ if (dir == 0)
+ bitBlt(Pixmap1, lx, ly, Pixmap2, x1, y1, width, 1, Qt::CopyROP, true);
+ else
+ bitBlt(Pixmap2, x1, y1, Pixmap1, lx, ly, width, 1, Qt::CopyROP, true);
+ lx = lx + width;
+ if (lx >= 480)
+ {
+ lx = 0;
+ ly++;
+ if (ly >= 480)
+ ly = 0;
+ }
+ lcx = lcx - width;
+ x1 = x1 + width;
+ }
+ y1++;
+ }
+}
+
+/*****************************************************************************/
+void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
+{
+ QPixmap * Pixmap;
+
+ Pixmap = new QPixmap(cx, cy);
+ CommonDeskSave(g_DS, Pixmap, offset, 0, 0, cx, cy, 1);
+ bitBltClip(g_MW, g_BS, x, y, Pixmap, 0, 0, cx, cy, Qt::CopyROP, true);
+ delete Pixmap;
+}
+
+/*****************************************************************************/
+void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
+{
+ CommonDeskSave(g_DS, g_BS, offset, x, y, cx, cy, 0);
+}
+
+/*****************************************************************************/
+void ui_rect(int x, int y, int cx, int cy, int colour)
+{
+ SetColorx(&g_Color1, colour);
+ g_P1->fillRect(x, y, cx, cy, QBrush(g_Color1));
+ g_P2->fillRect(x, y, cx, cy, QBrush(g_Color1));
+}
+
+/*****************************************************************************/
+void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy,
+ int srcx, int srcy)
+{
+ SetOpCode(opcode);
+ bitBltClip(g_MW, g_BS, x, y, NULL, srcx, srcy, cx, cy, Qt::CopyROP, true);
+ ResetOpCode(opcode);
+}
+
+/*****************************************************************************/
+void ui_patblt(uint8 opcode, int x, int y, int cx, int cy,
+ BRUSH* brush, int bgcolour, int fgcolour)
+{
+ QBitmap* Bitmap;
+ QBrush* Brush;
+ uint8 ipattern[8], i;
+ SetOpCode(opcode);
+ switch (brush->style)
+ {
+ case 0:
+ SetColorx(&g_Color1, fgcolour);
+ g_P2->fillRect(x, y, cx, cy, QBrush(g_Color1));
+ break;
+ case 3:
+ SetColorx(&g_Color1, fgcolour);
+ SetColorx(&g_Color2, bgcolour);
+ for (i = 0; i != 8; i++)
+ {
+ ipattern[7 - i] = ~brush->pattern[i];
+ }
+ Bitmap = new QBitmap(8, 8, ipattern);
+ Brush = new QBrush(g_Color1, *Bitmap);
+ g_P2->setBackgroundMode(Qt::OpaqueMode);
+ g_P2->setBrushOrigin(brush->xorigin, brush->yorigin);
+ g_P2->setBackgroundColor(g_Color2);
+ g_P2->fillRect(x, y, cx, cy, *Brush);
+ delete Brush;
+ delete Bitmap;
+ g_P2->setBackgroundMode(Qt::TransparentMode);
+ g_P2->setBrushOrigin(0, 0);
+ break;
+ }
+ ResetOpCode(opcode);
+ bitBltClip(g_MW, NULL, x, y, g_BS, x, y, cx, cy, Qt::CopyROP, true);
+}
+
+/*****************************************************************************/
+void ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
+{
+ SetOpCode(opcode);
+ g_P1->fillRect(x, y, cx, cy, QBrush(QColor("black")));
+ g_P2->fillRect(x, y, cx, cy, QBrush(QColor("black")));
+ ResetOpCode(opcode);
+}
+
+/*****************************************************************************/
+void ui_move_pointer(int x, int y)
+{
+}
+
+/*****************************************************************************/
+void ui_set_null_cursor(void)
+{
+ g_MW->setCursor(10); // Qt::BlankCursor
+}
+
+/*****************************************************************************/
+void ui_paint_bitmap(int x, int y, int cx, int cy,
+ int width, int height, uint8* data)
+{
+ QImage * Image = NULL;
+ QPixmap * Pixmap;
+ uint32 * d = NULL;
+ uint16 * s;
+ int i;
+
+ switch (g_server_depth)
+ {
+ case 8:
+ Image = new QImage(data, width, height, 8, (QRgb*)&g_CM->RGBColors,
+ g_CM->NumColors, QImage::IgnoreEndian);
+ break;
+ case 15:
+ d = (uint32*)malloc(width * height * 4);
+ s = (uint16*)data;
+ for (i = 0; i < width * height; i++)
+ {
+ d[i] = Color15to32(s[i]);
+ }
+ Image = new QImage((uint8*)d, width, height, 32, NULL,
+ 0, QImage::IgnoreEndian);
+ break;
+ case 16:
+ d = (uint32*)malloc(width * height * 4);
+ s = (uint16*)data;
+ for (i = 0; i < width * height; i++)
+ {
+ d[i] = Color16to32(s[i]);
+ }
+ Image = new QImage((uint8*)d, width, height, 32, NULL,
+ 0, QImage::IgnoreEndian);
+ break;
+ case 24:
+ d = (uint32*)malloc(width * height * 4);
+ memset(d, 0, width * height * 4);
+ for (i = 0; i < width * height; i++)
+ {
+ memcpy(d + i, data + i * 3, 3);
+ }
+ Image = new QImage((uint8*)d, width, height, 32, NULL,
+ 0, QImage::IgnoreEndian);
+ break;
+ }
+ if (Image == NULL)
+ {
+ return;
+ }
+ Pixmap = new QPixmap();
+ Pixmap->convertFromImage(*Image);
+ g_P1->drawPixmap(x, y, *Pixmap, 0, 0, cx, cy);
+ g_P2->drawPixmap(x, y, *Pixmap, 0, 0, cx, cy);
+ delete Image;
+ delete Pixmap;
+ if (d != NULL)
+ {
+ free(d);
+ }
+}
+
+//******************************************************************************
+int Is24On(uint8* Data, int X, int Y)
+{
+ uint8 R, G, B;
+ int Start;
+ Start = Y * 32 * 3 + X * 3;
+ R = Data[Start];
+ G = Data[Start + 1];
+ B = Data[Start + 2];
+ return !((R == 0) && (G == 0) && (B == 0));
+}
+
+//******************************************************************************
+int Is1On(uint8* Data, int X, int Y)
+{
+ int Start;
+ int Shift;
+ Start = (Y * 32) / 8 + X / 8;
+ Shift = X % 8;
+ return (Data[Start] & (0x80 >> Shift)) == 0;
+}
+
+//******************************************************************************
+void Set1(uint8* Data, int X, int Y)
+{
+ int Start;
+ int Shift;
+ Start = (Y * 32) / 8 + X / 8;
+ Shift = X % 8;
+ Data[Start] = Data[Start] | (0x80 >> Shift);
+}
+
+//******************************************************************************
+void FlipOver(uint8* Data)
+{
+ uint8 AData[128];
+ int Index;
+ memcpy(AData, Data, 128);
+ for (Index = 0; Index <= 31; Index++)
+ {
+ Data[127 - (Index * 4 + 3)] = AData[Index * 4];
+ Data[127 - (Index * 4 + 2)] = AData[Index * 4 + 1];
+ Data[127 - (Index * 4 + 1)] = AData[Index * 4 + 2];
+ Data[127 - Index * 4] = AData[Index * 4 + 3];
+ }
+}
+
+/*****************************************************************************/
+void ui_set_cursor(HCURSOR cursor)
+{
+ QCursor* Cursor;
+ Cursor = (QCursor*)cursor;
+ if (Cursor != NULL)
+ g_MW->setCursor(*Cursor);
+}
+
+/*****************************************************************************/
+HCURSOR ui_create_cursor(unsigned int x, unsigned int y,
+ int width, int height,
+ uint8* andmask, uint8* xormask)
+{
+ uint8 AData[128];
+ uint8 AMask[128];
+ QBitmap* DataBitmap;
+ QBitmap* MaskBitmap;
+ QCursor* Cursor;
+ int I1, I2, BOn, MOn;
+
+ if (width != 32 || height != 32)
+ {
+ return 0;
+ }
+ memset(AData, 0, 128);
+ memset(AMask, 0, 128);
+ for (I1 = 0; I1 <= 31; I1++)
+ {
+ for (I2 = 0; I2 <= 31; I2++)
+ {
+ MOn = Is24On(xormask, I1, I2);
+ BOn = Is1On(andmask, I1, I2);
+ if (BOn ^ MOn) // xor
+ {
+ Set1(AData, I1, I2);
+ if (!MOn)
+ {
+ Set1(AMask, I1, I2);
+ }
+ }
+ if (MOn)
+ {
+ Set1(AMask, I1, I2);
+ }
+ }
+ }
+ FlipOver(AData);
+ FlipOver(AMask);
+ DataBitmap = new QBitmap(32, 32, AData);
+ MaskBitmap = new QBitmap(32, 32, AMask);
+ Cursor = new QCursor(*DataBitmap, *MaskBitmap, x, y);
+ delete DataBitmap;
+ delete MaskBitmap;
+ return Cursor;
+}
+
+/*****************************************************************************/
+uint16 ui_get_numlock_state(uint32 state)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+uint32 read_keyboard_state(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_resize_window(void)
+{
+}
+
+/*****************************************************************************/
+void ui_polygon(uint8 opcode, uint8 fillmode, POINT * point, int npoints,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+/* todo, use qt function for this (QPainter::drawPolyline) */
+void ui_polyline(uint8 opcode, POINT * points, int npoints, PEN * pen)
+{
+ int i, x, y, dx, dy;
+
+ if (npoints > 0)
+ {
+ x = points[0].x;
+ y = points[0].y;
+ for (i = 1; i < npoints; i++)
+ {
+ dx = points[i].x;
+ dy = points[i].y;
+ ui_line(opcode, x, y, x + dx, y + dy, pen);
+ x = x + dx;
+ y = y + dy;
+ }
+ }
+}
+
+/*****************************************************************************/
+void ui_ellipse(uint8 opcode, uint8 fillmode,
+ int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+void generate_random(uint8 * random)
+{
+ QFile File("/dev/random");
+ File.open(IO_ReadOnly);
+ if (File.readBlock((char*)random, 32) == 32)
+ {
+ return;
+ }
+ warning("no /dev/random\n");
+ memcpy(random, "12345678901234567890123456789012", 32);
+}
+
+/*****************************************************************************/
+void save_licence(uint8 * data, int length)
+{
+ char * home, * path, * tmppath;
+ int fd;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ {
+ return;
+ }
+ path = (char *) xmalloc(strlen(home) + strlen(g_hostname) +
+ sizeof("/.rdesktop/licence."));
+ sprintf(path, "%s/.rdesktop", home);
+ if ((mkdir(path, 0700) == -1) && errno != EEXIST)
+ {
+ perror(path);
+ return;
+ }
+ /* write licence to licence.hostname.new, then atomically rename to
+ licence.hostname */
+ sprintf(path, "%s/.rdesktop/licence.%s", home, g_hostname);
+ tmppath = (char *) xmalloc(strlen(path) + sizeof(".new"));
+ strcpy(tmppath, path);
+ strcat(tmppath, ".new");
+ fd = open(tmppath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ if (fd == -1)
+ {
+ perror(tmppath);
+ return;
+ }
+ if (write(fd, data, length) != length)
+ {
+ perror(tmppath);
+ unlink(tmppath);
+ }
+ else if (rename(tmppath, path) == -1)
+ {
+ perror(path);
+ unlink(tmppath);
+ }
+ close(fd);
+ xfree(tmppath);
+ xfree(path);
+}
+
+/*****************************************************************************/
+int load_licence(uint8 ** data)
+{
+ char * home, * path;
+ struct stat st;
+ int fd, length;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ {
+ return -1;
+ }
+ path = (char *) xmalloc(strlen(home) + strlen(g_hostname) +
+ sizeof("/.rdesktop/licence."));
+ sprintf(path, "%s/.rdesktop/licence.%s", home, g_hostname);
+ fd = open(path, O_RDONLY);
+ if (fd == -1)
+ {
+ return -1;
+ }
+ if (fstat(fd, &st))
+ {
+ close(fd);
+ xfree(path);
+ return -1;
+ }
+ *data = (uint8 *) xmalloc(st.st_size);
+ length = read(fd, *data, st.st_size);
+ close(fd);
+ xfree(path);
+ return length;
+}
+
+/*****************************************************************************/
+void* xrealloc(void * in_val, int size)
+{
+ return realloc(in_val, size);
+}
+
+/*****************************************************************************/
+void* xmalloc(int size)
+{
+ return malloc(size);
+}
+
+/*****************************************************************************/
+void xfree(void * in_val)
+{
+ if (in_val != NULL)
+ {
+ free(in_val);
+ }
+}
+
+/*****************************************************************************/
+char * xstrdup(const char * s)
+{
+ char * mem = strdup(s);
+ if (mem == NULL)
+ {
+ perror("strdup");
+ exit(1);
+ }
+ return mem;
+}
+
+/*****************************************************************************/
+void warning(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "WARNING: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void unimpl(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "NOT IMPLEMENTED: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void error(char * format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "ERROR: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void out_params(void)
+{
+ fprintf(stderr, "rdesktop: A Remote Desktop Protocol client.\n");
+ fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2005 Matt Chapman.\n");
+ fprintf(stderr, "QT uiport by Jay Sorg\n");
+ fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
+ fprintf(stderr, "Usage: qtrdesktop [options] server\n");
+ fprintf(stderr, " -g WxH: desktop geometry\n");
+ fprintf(stderr, " -4: use RDP version 4\n");
+ fprintf(stderr, " -5: use RDP version 5 (default)\n");
+ fprintf(stderr, " -t 3389: tcp port)\n");
+ fprintf(stderr, " -a 8|16|24: connection colour depth\n");
+ fprintf(stderr, " -T title: window title\n");
+ fprintf(stderr, " -P: use persistent bitmap caching\n");
+ fprintf(stderr, " -0: attach to console\n");
+ fprintf(stderr, " -z: enable rdp compression\n");
+ fprintf(stderr, " -r sound: enable sound\n");
+ fprintf(stderr, "\n");
+}
+
+/*****************************************************************************/
+/* produce a hex dump */
+void hexdump(uint8 * p, uint32 len)
+{
+ uint8 * line = p;
+ int i, thisline;
+ uint32 offset = 0;
+
+ while (offset < len)
+ {
+ printf("%04x ", offset);
+ thisline = len - offset;
+ if (thisline > 16)
+ {
+ thisline = 16;
+ }
+ for (i = 0; i < thisline; i++)
+ {
+ printf("%02x ", line[i]);
+ }
+ for (; i < 16; i++)
+ {
+ printf(" ");
+ }
+ for (i = 0; i < thisline; i++)
+ {
+ printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');
+ }
+ printf("\n");
+ offset += thisline;
+ line += thisline;
+ }
+}
+
+/*****************************************************************************/
+int rd_pstcache_mkdir(void)
+{
+ char * home;
+ char bmpcache_dir[256];
+
+ home = getenv("HOME");
+ if (home == NULL)
+ {
+ return False;
+ }
+ sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop");
+ if ((mkdir(bmpcache_dir, S_IRWXU) == -1) && errno != EEXIST)
+ {
+ perror(bmpcache_dir);
+ return False;
+ }
+ sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop/cache");
+ if ((mkdir(bmpcache_dir, S_IRWXU) == -1) && errno != EEXIST)
+ {
+ perror(bmpcache_dir);
+ return False;
+ }
+ return True;
+}
+
+/*****************************************************************************/
+int rd_open_file(char * filename)
+{
+ char * home;
+ char fn[256];
+ int fd;
+
+ home = getenv("HOME");
+ if (home == NULL)
+ {
+ return -1;
+ }
+ sprintf(fn, "%s/.rdesktop/%s", home, filename);
+ fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+ if (fd == -1)
+ {
+ perror(fn);
+ }
+ return fd;
+}
+
+/*****************************************************************************/
+void rd_close_file(int fd)
+{
+ close(fd);
+}
+
+/*****************************************************************************/
+int rd_read_file(int fd, void * ptr, int len)
+{
+ return read(fd, ptr, len);
+}
+
+/*****************************************************************************/
+int rd_write_file(int fd, void * ptr, int len)
+{
+ return write(fd, ptr, len);
+}
+
+/*****************************************************************************/
+int rd_lseek_file(int fd, int offset)
+{
+ return lseek(fd, offset, SEEK_SET);
+}
+
+/*****************************************************************************/
+int rd_lock_file(int fd, int start, int len)
+{
+ struct flock lock;
+
+ lock.l_type = F_WRLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = start;
+ lock.l_len = len;
+ if (fcntl(fd, F_SETLK, &lock) == -1)
+ {
+ return False;
+ }
+ return True;
+}
+
+/*****************************************************************************/
+void get_username_and_hostname(void)
+{
+ char fullhostname[64];
+ char * p;
+ struct passwd * pw;
+
+ STRNCPY(g_username, "unknown", sizeof(g_username));
+ STRNCPY(g_hostname, "unknown", sizeof(g_hostname));
+ pw = getpwuid(getuid());
+ if (pw != NULL && pw->pw_name != NULL)
+ {
+ STRNCPY(g_username, pw->pw_name, sizeof(g_username));
+ }
+ if (gethostname(fullhostname, sizeof(fullhostname)) != -1)
+ {
+ p = strchr(fullhostname, '.');
+ if (p != NULL)
+ {
+ *p = 0;
+ }
+ STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));
+ }
+}
+
+/*****************************************************************************/
+int parse_parameters(int in_argc, char ** in_argv)
+{
+ int i;
+ char * p;
+
+ if (in_argc <= 1)
+ {
+ out_params();
+ return 0;
+ }
+ g_argc = in_argc;
+ g_argv = in_argv;
+ for (i = 1; i < in_argc; i++)
+ {
+ strcpy(g_servername, in_argv[i]);
+ if (strcmp(in_argv[i], "-g") == 0)
+ {
+ g_width = strtol(in_argv[i + 1], &p, 10);
+ if (g_width <= 0)
+ {
+ error("invalid geometry\n");
+ return 0;
+ }
+ if (*p == 'x')
+ {
+ g_height = strtol(p + 1, NULL, 10);
+ }
+ if (g_height <= 0)
+ {
+ error("invalid geometry\n");
+ return 0;
+ }
+ g_width = (g_width + 3) & ~3;
+ }
+ else if (strcmp(in_argv[i], "-T") == 0)
+ {
+ strcpy(g_title, in_argv[i + 1]);
+ }
+ else if (strcmp(in_argv[i], "-4") == 0)
+ {
+ g_use_rdp5 = 0;
+ }
+ else if (strcmp(in_argv[i], "-5") == 0)
+ {
+ g_use_rdp5 = 1;
+ }
+ else if (strcmp(in_argv[i], "-a") == 0)
+ {
+ g_server_depth = strtol(in_argv[i + 1], &p, 10);
+ if (g_server_depth != 8 && g_server_depth != 15 &&
+ g_server_depth != 16 && g_server_depth != 24)
+ {
+ error("invalid bpp\n");
+ return 0;
+ }
+ }
+ else if (strcmp(in_argv[i], "-t") == 0)
+ {
+ g_tcp_port_rdp = strtol(in_argv[i + 1], &p, 10);
+ }
+ else if (strcmp(in_argv[i], "-P") == 0)
+ {
+ g_bitmap_cache_persist_enable = 1;
+ }
+ else if (strcmp(in_argv[i], "-0") == 0)
+ {
+ g_console_session = 1;
+ }
+ else if (strcmp(in_argv[i], "-z") == 0)
+ {
+ g_flags |= (RDP_LOGON_COMPRESSION | RDP_LOGON_COMPRESSION2);
+ }
+ else if (strcmp(in_argv[i], "-r") == 0)
+ {
+ if (strcmp(in_argv[i + 1], "sound") == 0)
+ {
+#ifdef WITH_RDPSND
+ g_rdpsnd = 1;
+#endif
+ }
+ }
+ }
+ return 1;
+}
+
+/*****************************************************************************/
+int main(int in_argc, char** in_argv)
+{
+ get_username_and_hostname();
+ if (!parse_parameters(in_argc, in_argv))
+ {
+ return 0;
+ }
+ if (!ui_init())
+ {
+ return 1;
+ }
+ if (!ui_create_window())
+ {
+ return 1;
+ }
+ ui_main_loop();
+ ui_destroy_window();
+ ui_deinit();
+ return 0;
+}
--- /dev/null
+
+#include <qwidget.h>
+#include <qscrollview.h>
+
+class QMyScrollView: public QScrollView
+{
+ Q_OBJECT
+ public:
+ void keyPressEvent(QKeyEvent*);
+ void keyReleaseEvent(QKeyEvent*);
+};
+
+class QMyMainWindow: public QWidget
+{
+ Q_OBJECT
+ public:
+ QMyMainWindow();
+ ~QMyMainWindow();
+ void paintEvent(QPaintEvent*);
+ void mouseMoveEvent(QMouseEvent*);
+ void mousePressEvent(QMouseEvent*);
+ void mouseReleaseEvent(QMouseEvent*);
+ void wheelEvent(QWheelEvent*);
+ void keyPressEvent(QKeyEvent*);
+ void keyReleaseEvent(QKeyEvent*);
+ void closeEvent(QCloseEvent*);
+ bool event(QEvent*);
+ public slots:
+ void dataReceived();
+ void soundSend();
+};
+
--- /dev/null
+This directory contains information on uiports.
+uiports are different graphics libraries using the same core
+rdesktop files.
+
+This directory is provided to include information and examples
+on how to do a new uiport. Not all ports of rdesktop can
+be included.
+
+see xxxreadme.txt for info on a blank empty uiport
+
+see qtreadme.txt for info on the Qt/X11 uiport
+
+see qtereadme.txt for info on the Qt embeded uiport
+
+see svgareadme.txt for info on the svga uiport
+
+see nanoxreadme.txt for info on the nanox uiport
--- /dev/null
+This is the svga ui port
+send any fixes or improvments to me Jay Sorg(j@american-data.com)
+svgalib should be installed
+tested with versions 1.4.3, 1.9.x
+
+thanks to
+ Donald Gordon - original work
+ Peter Nikolow - misc fixes
+
+run make -f makefile_svga to compile it
+
+svgareadme.txt - notes, this file
+makefile_svga - makefile
+svgawin.c - ui lib
+
+svgalib has some support for acceleration but most drivers
+do not support it. I hope they fix this.
+The ones that do are Cirus Logic and ATI Mach 32 cards.
+If running on really slow hardware(486), use one of these cards,
+it improves performance alot.
+
+run ./svgardesktop with no parameters to see a list of
+commnad line options
+
+You will need to modify the libvga.config file most likely.
+Its in /etc/vga.
+Here is what mine looks like.
+BOF
+ mouse imps2
+ mouse_fake_kbd_event 112 113
+ mouse_accel_mult 1.5
+ mouse_accel_type normal
+ HorizSync 31.5 56.0
+ VertRefresh 50 90
+ nosigint
+EOF
+The mouse_fake_kbd_event line makes the wheel mouse work.
+
+Jay
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ User interface services - SVGA lib
+ Copyright (C) Jay Sorg 2004-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "../rdesktop.h"
+
+#include <vga.h>
+#include <vgakeyboard.h>
+#include <vgamouse.h>
+#include <vgagl.h>
+
+#include <unistd.h> // gethostname
+#include <pwd.h> // getpwuid
+#include <stdarg.h> // va_list va_start va_end
+
+#include <sys/ioctl.h>
+#include <linux/keyboard.h>
+#include <linux/kd.h>
+#include <fcntl.h>
+
+extern int g_tcp_port_rdp;
+int g_use_rdp5 = 0;
+char g_hostname[16] = "";
+char g_username[64] = "";
+int g_height = 600;
+int g_width = 800;
+int g_server_bpp = 8;
+int g_encryption = 1;
+int g_desktop_save = 1;
+int g_polygon_ellipse_orders = 0;
+int g_bitmap_cache = 1;
+int g_bitmap_cache_persist_enable = False;
+int g_bitmap_cache_precache = True;
+int g_bitmap_compression = 1;
+int g_rdp5_performanceflags = 0;
+int g_console_session = 0;
+int g_keylayout = 0x409; /* Defaults to US keyboard layout */
+int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */
+int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
+int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */
+
+/* hack globals */
+int g_argc = 0;
+char** g_argv = 0;
+int UpAndRunning = 0;
+int g_sock = 0;
+int deactivated = 0;
+uint32 ext_disc_reason = 0;
+char g_servername[128] = "";
+static uint32* colmap = 0;
+static uint8* desk_save = 0;
+static int g_server_Bpp = 1;
+
+/* Keyboard LEDS */
+static int numlock;
+static int capslock;
+static int scrolllock;
+
+// this is non null if vgalib has non accel functions available
+// reading from video memory is sooo slow
+static uint8* sdata = 0;
+static int g_save_mem = 0; // for video memory use eg sdata == 0
+
+// video acceleration
+static int use_accel = 1;
+static int has_fill_box = 0;
+static int has_screen_copy = 0;
+static int has_put_image = 0;
+
+// clip
+int clip_startx;
+int clip_starty;
+int clip_endx;
+int clip_endy;
+
+// mouse
+uint8 mouse_under[32 * 32 * 4]; // save area under mouse
+int mousex = 0;
+int mousey = 0;
+int mouseb = 0;
+
+// mouse info
+typedef struct
+{
+ uint8 andmask[32 * 32];
+ uint8 xormask[32 * 32];
+ int x;
+ int y;
+ int w;
+ int h;
+} tcursor;
+
+// mouse global
+static tcursor mcursor;
+
+static int g_draw_mouse = 1;
+
+/* Session Directory redirection */
+BOOL g_redirect = False;
+char g_redirect_server[64];
+char g_redirect_domain[16];
+char g_redirect_password[64];
+char g_redirect_username[64];
+char g_redirect_cookie[128];
+uint32 g_redirect_flags = 0;
+
+// bitmap
+typedef struct
+{
+ int width;
+ int height;
+ uint8* data;
+ uint8 Bpp;
+} bitmap;
+
+typedef struct
+{
+ int x;
+ int y;
+ int cx;
+ int cy;
+ void* prev;
+ void* next;
+} myrect;
+
+myrect* head_rect = 0;
+
+//*****************************************************************************
+// Keyboard stuff - PeterS
+static void setled(int mask, int state)
+{
+ int fd;
+ long int leds;
+
+ if (( fd=open("/dev/console", O_NOCTTY)) != -1 )
+ {
+ if (ioctl (fd, KDGETLED, &leds) != -1)
+ {
+ leds &= 7;
+ if (state)
+ leds |= mask;
+ else
+ leds &= ~mask;
+ ioctl (fd, KDSETLED, leds);
+ }
+ close(fd);
+ }
+}
+
+
+//*****************************************************************************
+// do a raster op
+int rop(int rop, int src, int dst)
+{
+ switch (rop)
+ {
+ case 0x0: return 0;
+ case 0x1: return ~(src | dst);
+ case 0x2: return (~src) & dst;
+ case 0x3: return ~src;
+ case 0x4: return src & (~dst);
+ case 0x5: return ~(dst);
+ case 0x6: return src ^ dst;
+ case 0x7: return ~(src & dst);
+ case 0x8: return src & dst;
+ case 0x9: return ~(src) ^ dst;
+ case 0xa: return dst;
+ case 0xb: return (~src) | dst;
+ case 0xc: return src;
+ case 0xd: return src | (~dst);
+ case 0xe: return src | dst;
+ case 0xf: return ~0;
+ }
+ return dst;
+}
+
+//*****************************************************************************
+// get a screen pixel
+int get_pixel(int x, int y)
+{
+ if (x >= 0 && x < g_width && y >= 0 && y < g_height)
+ {
+ if (sdata != 0)
+ {
+ if (g_server_Bpp == 1)
+ return sdata[y * g_width + x];
+ else if (g_server_Bpp == 2)
+ return ((uint16*)sdata)[y * g_width + x];
+ else
+ return 0;
+ }
+ else
+ return vga_getpixel(x, y);
+ }
+ else
+ return 0;
+}
+
+//*****************************************************************************
+// set a screen pixel
+void set_pixel(int x, int y, int pixel, int op)
+{
+ if (x >= clip_startx && x < clip_endx && y >= clip_starty && y < clip_endy)
+ {
+ if (x >= 0 && x < g_width && y >= 0 && y < g_height)
+ {
+ if (op == 0x0)
+ pixel = 0;
+ else if (op == 0xf)
+ pixel = -1;
+ else if (op != 0xc)
+ pixel = rop(op, pixel, get_pixel(x, y));
+ if (sdata != 0)
+ {
+ if (g_server_Bpp == 1)
+ sdata[y * g_width + x] = pixel;
+ else if (g_server_Bpp == 2)
+ ((uint16*)sdata)[y * g_width + x] = pixel;
+ }
+ else
+ {
+ vga_setcolor(pixel);
+ vga_drawpixel(x, y);
+ }
+ }
+ }
+}
+
+//*****************************************************************************
+// get a pixel from a bitmap
+int get_pixel2(int x, int y, uint8* data, int width, int bpp)
+{
+ if (bpp == 8)
+ return data[y * width + x];
+ else if (bpp == 16)
+ return ((uint16*)data)[y * width + x];
+ else
+ return 0;
+}
+
+//*****************************************************************************
+// set a pixel in a bitmap
+void set_pixel2(int x, int y, int pixel, uint8* data, int width, int bpp)
+{
+ if (bpp == 8)
+ data[y * width + x] = pixel;
+ else if (bpp == 16)
+ ((uint16*)data)[y * width + x] = pixel;
+}
+
+//*****************************************************************************
+// get a pointer into a bitmap
+uint8* get_ptr(int x, int y, uint8* data, int width, int bpp)
+{
+ if (bpp == 8)
+ return data + (y * width + x);
+ else if (bpp == 16)
+ return data + (y * width + x) * 2;
+ else
+ return 0;
+}
+
+//*****************************************************************************
+// check if a certain pixel is set in a bitmap
+BOOL is_pixel_on(uint8* data, int x, int y, int width, int bpp)
+{
+ int start;
+ int shift;
+
+ if (bpp == 1)
+ {
+ width = (width + 7) / 8;
+ start = (y * width) + x / 8;
+ shift = x % 8;
+ return (data[start] & (0x80 >> shift)) != 0;
+ }
+ else if (bpp == 8)
+ {
+ return data[y * width + x] != 0;
+ }
+ else if (bpp == 24)
+ {
+ return data[(y * 3) * width + (x * 3)] != 0 &&
+ data[(y * 3) * width + (x * 3) + 1] != 0 &&
+ data[(y * 3) * width + (x * 3) + 2] != 0;
+ }
+ else
+ return False;
+}
+
+//*****************************************************************************
+void set_pixel_on(uint8* data, int x, int y, int width, int bpp, int pixel)
+{
+ if (bpp == 8)
+ {
+ data[y * width + x] = pixel;
+ }
+}
+
+/*****************************************************************************/
+int warp_coords(int* x, int* y, int* cx, int* cy, int* srcx, int* srcy)
+{
+ int dx;
+ int dy;
+// int lx = *x, ly = *y, lcx = *cx, lcy = *cy;
+
+ if (clip_startx > *x)
+ dx = clip_startx - *x;
+ else
+ dx = 0;
+ if (clip_starty > *y)
+ dy = clip_starty - *y;
+ else
+ dy = 0;
+ if (*x + *cx > clip_endx)
+ *cx = (*cx - ((*x + *cx) - clip_endx)) /*+ 1*/;
+ if (*y + *cy > clip_endy)
+ *cy = (*cy - ((*y + *cy) - clip_endy)) /*+ 1*/;
+ *cx = *cx - dx;
+ *cy = *cy - dy;
+ if (*cx <= 0)
+ return False;
+ if (*cy <= 0)
+ return False;
+ *x = *x + dx;
+ *y = *y + dy;
+ if (srcx != NULL)
+ *srcx = *srcx + dx;
+ if (srcy != NULL)
+ *srcy = *srcy + dy;
+
+// if (*x != lx || *y != ly || *cx != lcx || *cy != lcy)
+// printf("%d %d %d %d to %d %d %d %d\n", lx, ly, lcx, lcy, *x, *y, *cx, *cy);
+
+ return True;
+}
+
+//*****************************************************************************
+void copy_mem(uint8* d, uint8* s, int n)
+{
+ while (n & (~7))
+ {
+ *(d++) = *(s++);
+ *(d++) = *(s++);
+ *(d++) = *(s++);
+ *(d++) = *(s++);
+ *(d++) = *(s++);
+ *(d++) = *(s++);
+ *(d++) = *(s++);
+ *(d++) = *(s++);
+ n = n - 8;
+ }
+ while (n > 0)
+ {
+ *(d++) = *(s++);
+ n--;
+ }
+}
+
+//*****************************************************************************
+void copy_memb(uint8* d, uint8* s, int n)
+{
+ d = (d + n) - 1;
+ s = (s + n) - 1;
+ while (n & (~7))
+ {
+ *(d--) = *(s--);
+ *(d--) = *(s--);
+ *(d--) = *(s--);
+ *(d--) = *(s--);
+ *(d--) = *(s--);
+ *(d--) = *(s--);
+ *(d--) = *(s--);
+ *(d--) = *(s--);
+ n = n - 8;
+ }
+ while (n > 0)
+ {
+ *(d--) = *(s--);
+ n--;
+ }
+}
+
+//*****************************************************************************
+// all in pixel except line_size is in bytes
+void accel_draw_box(int x, int y, int cx, int cy, uint8* data, int line_size)
+{
+ int i;
+ uint8* s;
+ uint8* d;
+
+ if (sdata != 0)
+ {
+ s = data;
+ d = get_ptr(x, y, sdata, g_width, g_server_bpp);
+ for (i = 0; i < cy; i++)
+ {
+ copy_mem(d, s, cx * g_server_Bpp);
+ s = s + line_size;
+ d = d + g_width * g_server_Bpp;
+ }
+ }
+ else if (has_put_image && line_size == cx * g_server_Bpp)
+ {
+ vga_accel(ACCEL_PUTIMAGE, x, y, cx, cy, data);
+ }
+ else
+ {
+ s = data;
+ for (i = 0; i < cy; i++)
+ {
+ vga_drawscansegment(s, x, y + i, cx * g_server_Bpp);
+ s = s + line_size;
+ }
+ }
+}
+
+//*****************************************************************************
+void accel_fill_rect(int x, int y, int cx, int cy, int color)
+{
+ int i;
+ uint8* temp;
+ uint8* d;
+
+ if (sdata != 0)
+ {
+ temp = xmalloc(cx * g_server_Bpp);
+ if (g_server_Bpp == 1)
+ for (i = 0; i < cx; i++)
+ temp[i] = color;
+ else if (g_server_Bpp == 2)
+ for (i = 0; i < cx; i++)
+ ((uint16*)temp)[i] = color;
+ d = get_ptr(x, y, sdata, g_width, g_server_bpp);
+ for (i = 0; i < cy; i++)
+ {
+ copy_mem(d, temp, cx * g_server_Bpp);
+ d = d + g_width * g_server_Bpp;
+ }
+ xfree(temp);
+ }
+ else if (has_fill_box)
+ {
+ vga_accel(ACCEL_SETFGCOLOR, color);
+ vga_accel(ACCEL_FILLBOX, x, y, cx, cy);
+ }
+ else
+ {
+ temp = xmalloc(cx * g_server_Bpp);
+ if (g_server_Bpp == 1)
+ for (i = 0; i < cx; i++)
+ temp[i] = color;
+ else if (g_server_Bpp == 2)
+ for (i = 0; i < cx; i++)
+ ((uint16*)temp)[i] = color;
+ for (i = 0; i < cy; i++)
+ vga_drawscansegment(temp, x, y + i, cx * g_server_Bpp);
+ xfree(temp);
+ }
+}
+
+//*****************************************************************************
+void accel_screen_copy(int x, int y, int cx, int cy, int srcx, int srcy)
+{
+ uint8* temp;
+ uint8* s;
+ uint8* d;
+ int i;
+
+ if (sdata != 0)
+ {
+ if (srcy < y)
+ { // bottom to top
+ s = get_ptr(srcx, (srcy + cy) - 1, sdata, g_width, g_server_bpp);
+ d = get_ptr(x, (y + cy) - 1, sdata, g_width, g_server_bpp);
+ for (i = 0; i < cy; i++) // copy down
+ {
+ copy_mem(d, s, cx * g_server_Bpp);
+ s = s - g_width * g_server_Bpp;
+ d = d - g_width * g_server_Bpp;
+ }
+ }
+ else if (srcy > y || srcx > x) // copy up or left
+ { // top to bottom
+ s = get_ptr(srcx, srcy, sdata, g_width, g_server_bpp);
+ d = get_ptr(x, y, sdata, g_width, g_server_bpp);
+ for (i = 0; i < cy; i++)
+ {
+ copy_mem(d, s, cx * g_server_Bpp);
+ s = s + g_width * g_server_Bpp;
+ d = d + g_width * g_server_Bpp;
+ }
+ }
+ else // copy straight right
+ {
+ s = get_ptr(srcx, srcy, sdata, g_width, g_server_bpp);
+ d = get_ptr(x, y, sdata, g_width, g_server_bpp);
+ for (i = 0; i < cy; i++)
+ {
+ copy_memb(d, s, cx * g_server_Bpp);
+ s = s + g_width * g_server_Bpp;
+ d = d + g_width * g_server_Bpp;
+ }
+ }
+ }
+ else if (has_screen_copy)
+ {
+ vga_accel(ACCEL_SCREENCOPY, srcx, srcy, x, y, cx, cy);
+ }
+ else
+ {
+ // slow
+ temp = (uint8*)xmalloc(cx * cy * g_server_Bpp);
+ for (i = 0; i < cy; i++)
+ vga_getscansegment(get_ptr(0, i, temp, cx, g_server_bpp), srcx, srcy + i, cx * g_server_Bpp);
+ for (i = 0; i < cy; i++)
+ vga_drawscansegment(get_ptr(0, i, temp, cx, g_server_bpp), x, y + i, cx * g_server_Bpp);
+ xfree(temp);
+ }
+}
+
+//*****************************************************************************
+// return bool
+int contains_mouse(int x, int y, int cx, int cy)
+{
+ if (mousex + 32 >= x &&
+ mousey + 32 >= y &&
+ mousex <= x + cx &&
+ mousey <= y + cy)
+ return 1;
+ else
+ return 0;
+}
+
+//*****************************************************************************
+void fill_rect(int x, int y, int cx, int cy, int colour, int opcode)
+{
+ int i;
+ int j;
+
+ if (warp_coords(&x, &y, &cx, &cy, NULL, NULL))
+ {
+ if (opcode == 0xc)
+ accel_fill_rect(x, y, cx, cy, colour);
+ else if (opcode == 0xf)
+ accel_fill_rect(x, y, cx, cy, -1);
+ else if (opcode == 0x0)
+ accel_fill_rect(x, y, cx, cy, 0);
+ else
+ {
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, colour, opcode);
+ }
+ }
+}
+
+//*****************************************************************************
+void get_rect(int x, int y, int cx, int cy, uint8* p)
+{
+ int i;
+
+ if (x < 0)
+ {
+ cx = cx + x;
+ x = 0;
+ }
+ if (y < 0)
+ {
+ cy = cy + y;
+ y = 0;
+ }
+ if (sdata != 0)
+ {
+ for (i = 0; i < cy; i++)
+ {
+ copy_mem(p, get_ptr(x, y + i, sdata, g_width, g_server_bpp), cx * g_server_Bpp);
+ p = p + cx * g_server_Bpp;
+ }
+ }
+ else
+ {
+ for (i = 0; i < cy; i++)
+ {
+ vga_getscansegment(p, x, y + i, cx * g_server_Bpp);
+ p = p + cx * g_server_Bpp;
+ }
+ }
+}
+
+/*****************************************************************************/
+// return true if r1 is contained by r2
+int is_contained_by(myrect* r1, myrect* r2)
+{
+ if (r1->x >= r2->x &&
+ r1->y >= r2->y &&
+ r1->x + r1->cx <= r2->x + r2->cx &&
+ r1->y + r1->cy <= r2->y + r2->cy)
+ return 1;
+ else
+ return 0;
+}
+
+/*****************************************************************************/
+void draw_cursor_under(int ox, int oy)
+{
+ int i;
+ int j;
+ int k;
+ uint8* ptr;
+ int len;
+
+ if (ox < 0)
+ k = -ox;
+ else
+ k = 0;
+ j = g_width - ox;
+ if (j > 32)
+ j = 32;
+ if (j > 0)
+ {
+ for (i = 0; i < 32; i++)
+ {
+ ptr = get_ptr(k, i, mouse_under, 32, g_server_bpp);
+ len = (j - k) * g_server_Bpp;
+ if (ox + k >= 0 && oy + i >= 0 && ox + k < g_width && oy + i < g_height)
+ vga_drawscansegment(ptr, ox + k, oy + i, len);
+ }
+ }
+ g_draw_mouse = 1;
+}
+
+/*****************************************************************************/
+void draw_cursor(void)
+{
+ int i;
+ int j;
+ int k;
+ int pixel;
+ uint8 mouse_a[32 * 32 * 4];
+ uint8* ptr;
+ int len;
+
+ if (!g_draw_mouse)
+ return;
+ memset(mouse_under, 0, sizeof(mouse_under));
+ for (i = 0; i < 32; i++)
+ {
+ for (j = 0; j < 32; j++)
+ {
+ pixel = get_pixel(mousex + j, mousey + i);
+ set_pixel2(j, i, pixel, mouse_under, 32, g_server_bpp);
+ if (mcursor.andmask[i * 32 + j] == 0)
+ k = 0;
+ else
+ k = ~0;
+ pixel = rop(0x8, k, pixel);
+ if (mcursor.xormask[i * 32 + j] == 0)
+ k = 0;
+ else
+ k = ~0;
+ pixel = rop(0x6, k, pixel);
+ set_pixel2(j, i, pixel, mouse_a, 32, g_server_bpp);
+ }
+ }
+ if (mousex < 0)
+ k = -mousex;
+ else
+ k = 0;
+ j = g_width - mousex;
+ if (j > 32)
+ j = 32;
+ if (j > 0)
+ {
+ for (i = mousey; i < mousey + 32; i++)
+ if (i < g_height && i >= 0)
+ {
+ ptr = get_ptr(k, i - mousey, mouse_a, 32, g_server_bpp);
+ len = (j - k) * g_server_Bpp;
+ vga_drawscansegment(ptr, mousex + k, i, len);
+ }
+ }
+ g_draw_mouse = 0;
+}
+
+/*****************************************************************************/
+// add a rect to cache
+void cache_rect(int x, int y, int cx, int cy, int do_warp)
+{
+ myrect* rect;
+ myrect* walk_rect;
+
+ if (sdata == 0)
+ {
+ draw_cursor();
+ return;
+ }
+ if (do_warp)
+ if (!warp_coords(&x, &y, &cx, &cy, NULL, NULL))
+ return;
+ rect = (myrect*)xmalloc(sizeof(myrect));
+ rect->x = x;
+ rect->y = y;
+ rect->cx = cx;
+ rect->cy = cy;
+ rect->next = 0;
+ rect->prev = 0;
+ if (head_rect == 0)
+ head_rect = rect;
+ else
+ {
+ walk_rect = 0;
+ do
+ {
+ if (walk_rect == 0)
+ walk_rect = head_rect;
+ else
+ walk_rect = walk_rect->next;
+ if (is_contained_by(rect, walk_rect))
+ {
+ xfree(rect);
+ return;
+ }
+ }
+ while (walk_rect->next != 0);
+ walk_rect->next = rect;
+ rect->prev = walk_rect;
+ }
+}
+
+//*****************************************************************************
+void draw_cache_rects(void)
+{
+ int i;
+ myrect* rect;
+ myrect* rect1;
+ uint8* p;
+
+ // draw all the rects
+ rect = head_rect;
+ while (rect != 0)
+ {
+ p = get_ptr(rect->x, rect->y, sdata, g_width, g_server_bpp);
+ for (i = 0; i < rect->cy; i++)
+ {
+ vga_drawscansegment(p, rect->x, rect->y + i, rect->cx * g_server_Bpp);
+ p = p + g_width * g_server_Bpp;
+ }
+ rect1 = rect;
+ rect = rect->next;
+ xfree(rect1);
+ }
+ head_rect = 0;
+}
+
+/*****************************************************************************/
+void key_event(int scancode, int pressed)
+{
+ int rdpkey;
+ int ext;
+
+ if (!UpAndRunning)
+ return;
+ rdpkey = scancode;
+ ext = 0;
+
+ // Keyboard LEDS
+ if ((scancode == SCANCODE_CAPSLOCK) && pressed)
+ {
+ capslock = !capslock;
+ setled(LED_CAP, capslock);
+ }
+ if ((scancode == SCANCODE_SCROLLLOCK) && pressed)
+ {
+ scrolllock = !scrolllock;
+ setled(LED_SCR, scrolllock);
+ }
+
+ if ((scancode == SCANCODE_NUMLOCK) && pressed)
+ {
+ numlock = !numlock;
+ setled(LED_NUM, numlock);
+ }
+
+ switch (scancode)
+ {
+ case SCANCODE_CURSORBLOCKUP: rdpkey = 0xc8; ext = KBD_FLAG_EXT; break; // up arrow
+ case SCANCODE_CURSORBLOCKDOWN: rdpkey = 0xd0; ext = KBD_FLAG_EXT; break; // down arrow
+ case SCANCODE_CURSORBLOCKRIGHT: rdpkey = 0xcd; ext = KBD_FLAG_EXT; break; // right arrow
+ case SCANCODE_CURSORBLOCKLEFT: rdpkey = 0xcb; ext = KBD_FLAG_EXT; break; // left arrow
+ case SCANCODE_PAGEDOWN: rdpkey = 0xd1; ext = KBD_FLAG_EXT; break; // page down
+ case SCANCODE_PAGEUP: rdpkey = 0xc9; ext = KBD_FLAG_EXT; break; // page up
+ case SCANCODE_HOME: rdpkey = 0xc7; ext = KBD_FLAG_EXT; break; // home
+ case SCANCODE_END: rdpkey = 0xcf; ext = KBD_FLAG_EXT; break; // end
+ case SCANCODE_INSERT: rdpkey = 0xd2; ext = KBD_FLAG_EXT; break; // insert
+ case SCANCODE_REMOVE: rdpkey = 0xd3; ext = KBD_FLAG_EXT; break; // delete
+ case SCANCODE_KEYPADDIVIDE: rdpkey = 0x35; break; // /
+ case SCANCODE_KEYPADENTER: rdpkey = 0x1c; break; // enter
+ case SCANCODE_RIGHTCONTROL: rdpkey = 0x1d; break; // right ctrl
+ case SCANCODE_RIGHTALT: rdpkey = 0x38; break; // right alt
+ case SCANCODE_LEFTWIN: rdpkey = 0x5b; ext = KBD_FLAG_EXT; break; // left win
+ case SCANCODE_RIGHTWIN: rdpkey = 0x5c; ext = KBD_FLAG_EXT; break; // right win
+ case 127: rdpkey = 0x5d; ext = KBD_FLAG_EXT; break; // menu key
+ case SCANCODE_PRINTSCREEN: rdpkey = 0x37; ext = KBD_FLAG_EXT; break; // print screen
+ case SCANCODE_BREAK: //rdpkey = 0; break; // break
+ {
+ if (pressed)
+ {
+ ext = KBD_FLAG_EXT;
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS | ext, 0x46, 0);
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS | ext, 0xc6, 0);
+ }
+ rdpkey = 0;
+ }
+ case SCANCODE_SCROLLLOCK: rdpkey = 0x46; break; // scroll lock
+ case 112: // mouse down
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON4,
+ mouse_getx(), mouse_gety());
+ return;
+ }
+ case 113: // mouse up
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON5,
+ mouse_getx(), mouse_gety());
+ return;
+ }
+ }
+// printf("%d %d\n", scancode, pressed);
+ if (pressed)
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS | ext, rdpkey, 0);
+ else
+ rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE | ext, rdpkey, 0);
+
+
+}
+
+/*****************************************************************************/
+int ui_init(void)
+{
+ vga_init();
+ memset(&mcursor, 0, sizeof(tcursor));
+ desk_save = (uint8*)xmalloc(0x38400 * g_server_Bpp);
+ return 1;
+}
+
+/*****************************************************************************/
+void ui_deinit(void)
+{
+ xfree(desk_save);
+}
+
+/*****************************************************************************/
+int ui_create_window(void)
+{
+ int vgamode;
+ int i;
+
+ vgamode = G800x600x256;
+ if (g_width == 640 && g_height == 480)
+ {
+ if (g_server_Bpp == 1)
+ vgamode = G640x480x256;
+ else if (g_server_Bpp == 2)
+ vgamode = G640x480x64K;
+ }
+ else if (g_width == 800 && g_height == 600)
+ {
+ if (g_server_Bpp == 1)
+ vgamode = G800x600x256;
+ else if (g_server_Bpp == 2)
+ vgamode = G800x600x64K;
+ }
+ else if (g_width == 1024 && g_height == 768)
+ {
+ if (g_server_Bpp == 1)
+ vgamode = G1024x768x256;
+ else if (g_server_Bpp == 2)
+ vgamode = G1024x768x64K;
+ }
+ else
+ {
+ error("Invalid width / height");
+ return 0;
+ }
+ ui_reset_clip();
+ if (!vga_hasmode(vgamode))
+ {
+ error("Graphics unavailable");
+ return 0;
+ }
+ vga_setmousesupport(1);
+ mouse_setposition(g_width / 2, g_height / 2);
+ vga_setmode(vgamode);
+ if (keyboard_init())
+ {
+ error("Keyboard unavailable");
+ return 0;
+ }
+ keyboard_seteventhandler(key_event);
+ if (use_accel)
+ {
+ i = vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_ACCEL);
+ if (i & ACCELFLAG_PUTIMAGE)
+ has_put_image = 1;
+ if (i & ACCELFLAG_SCREENCOPY)
+ has_screen_copy = 1;
+ if (i & ACCELFLAG_FILLBOX)
+ has_fill_box = 1;
+ printf("accel %d\n", i);
+ }
+ if (!has_screen_copy && !g_save_mem)
+ sdata = xmalloc(g_width * g_height * g_server_Bpp);
+ return 1;
+}
+
+/*****************************************************************************/
+void ui_destroy_window(void)
+{
+ keyboard_close(); /* Don't forget this! */
+ vga_setmode(TEXT);
+ if (sdata != 0)
+ xfree(sdata);
+}
+
+/*****************************************************************************/
+void process_mouse(void)
+{
+ int ox = mousex;
+ int oy = mousey;
+ int ob = mouseb;
+
+ if (!UpAndRunning)
+ return;
+ mousex = mouse_getx() - mcursor.x;
+ mousey = mouse_gety() - mcursor.y;
+ mouseb = mouse_getbutton();
+
+ if (mouseb != ob) // button
+ {
+ // right button
+ if (mouseb & 1)
+ if (!(ob & 1))
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON2,
+ mousex + mcursor.x, mousey + mcursor.y);
+ if (ob & 1)
+ if (!(mouseb & 1))
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2,
+ mousex + mcursor.x, mousey + mcursor.y);
+ // middle button
+ if (mouseb & 2)
+ if (!(ob & 2))
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON3,
+ mousex + mcursor.x, mousey + mcursor.y);
+ if (ob & 2)
+ if (!(mouseb & 2))
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3,
+ mousex + mcursor.x, mousey + mcursor.y);
+ // left button
+ if (mouseb & 4)
+ if (!(ob & 4))
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_DOWN | MOUSE_FLAG_BUTTON1,
+ mousex + mcursor.x, mousey + mcursor.y);
+ if (ob & 4)
+ if (!(mouseb & 4))
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1,
+ mousex + mcursor.x, mousey + mcursor.y);
+ }
+ if (mousex != ox || mousey != oy) // movement
+ {
+ rdp_send_input(0, RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE,
+ mousex + mcursor.x, mousey + mcursor.y);
+ draw_cursor_under(ox, oy);
+ draw_cursor();
+ }
+}
+
+/*****************************************************************************/
+void process_keyboard(void)
+{
+ if (!UpAndRunning)
+ return;
+}
+
+/*****************************************************************************/
+BOOL ui_main_loop(void)
+{
+ int sel;
+ fd_set rfds;
+
+ if (!rdp_connect(g_servername, RDP_LOGON_NORMAL, "", "", "", ""))
+ return False;
+ UpAndRunning = 1;
+ FD_ZERO(&rfds);
+ FD_SET(g_sock, &rfds);
+ sel = vga_waitevent(3, &rfds, NULL, NULL, NULL);
+ while (sel >= 0)
+ {
+ if (sel & 1) /* mouse */
+ {
+ process_mouse();
+ }
+ else if (sel & 2) /* keyboard */
+ {
+ process_keyboard();
+ }
+ else
+ {
+ if (!rdp_loop(&deactivated, &ext_disc_reason))
+ return True; /* ok */
+ }
+ FD_ZERO(&rfds);
+ FD_SET(g_sock, &rfds);
+ sel = vga_waitevent(3, &rfds, NULL, NULL, NULL);
+ }
+ return True;
+}
+
+/*****************************************************************************/
+void ui_bell(void)
+{
+}
+
+/*****************************************************************************/
+int ui_select(int in)
+{
+ g_sock = in;
+ return 1;
+}
+
+/*****************************************************************************/
+void* ui_create_glyph(int width, int height, uint8* data)
+{
+ int i, j;
+ uint8* glyph_data;
+ bitmap* the_glyph;
+
+ glyph_data = (uint8*)xmalloc(width * height);
+ the_glyph = (bitmap*)xmalloc(sizeof(bitmap));
+ the_glyph->width = width;
+ the_glyph->height = height;
+ the_glyph->data = glyph_data;
+ memset(glyph_data, 0, width * height);
+ for (i = 0; i < height; i++)
+ for (j = 0; j < width; j++)
+ if (is_pixel_on(data, j, i, width, 1))
+ set_pixel_on(glyph_data, j, i, width, 8, 255);
+ return the_glyph;
+}
+
+/*****************************************************************************/
+void ui_destroy_glyph(void* glyph)
+{
+ bitmap* the_glyph;
+
+ the_glyph = (bitmap*)glyph;
+ if (the_glyph != NULL)
+ {
+ if (the_glyph->data != NULL)
+ xfree(the_glyph->data);
+ xfree(the_glyph);
+ }
+}
+
+/*****************************************************************************/
+void ui_destroy_bitmap(void* bmp)
+{
+ bitmap* b;
+
+ b = (bitmap*)bmp;
+ xfree(b->data);
+ xfree(b);
+}
+
+/*****************************************************************************/
+void ui_reset_clip(void)
+{
+ clip_startx = 0;
+ clip_starty = 0;
+ clip_endx = g_width;
+ clip_endy = g_height;
+}
+
+/*****************************************************************************/
+void ui_set_clip(int x, int y, int cx, int cy)
+{
+ clip_startx = x;
+ clip_starty = y;
+ clip_endx = x + cx;
+ clip_endy = y + cy;
+}
+
+/*****************************************************************************/
+void* ui_create_colourmap(COLOURMAP * colours)
+{
+ int i = 0;
+ int n = colours->ncolours;
+ COLOURENTRY* c = colours->colours;
+ int* cmap = (int*)xmalloc(3 * 256 * sizeof (int));
+ if (n > 256)
+ n = 256;
+ bzero(cmap, 256 * 3 * sizeof (int));
+ for (i = 0; i < (3 * n); c++)
+ {
+ cmap[i++] = (c->red) >> 2;
+ cmap[i++] = (c->green) >> 2;
+ cmap[i++] = (c->blue) >> 2;
+ }
+ return cmap;
+}
+
+/*****************************************************************************/
+void ui_destroy_colourmap(HCOLOURMAP map)
+{
+ if (colmap == map)
+ colmap = 0;
+ xfree(map);
+}
+
+/*****************************************************************************/
+void ui_set_colourmap(void* map)
+{
+ if (colmap != 0)
+ xfree(colmap);
+ vga_setpalvec(0, 256, (int*)map);
+ colmap = map;
+}
+
+/*****************************************************************************/
+HBITMAP ui_create_bitmap(int width, int height, uint8* data)
+{
+ bitmap* b;
+
+ b = (bitmap*)xmalloc(sizeof(bitmap));
+ b->data = (uint8*)xmalloc(width * height * g_server_Bpp);
+ b->width = width;
+ b->height = height;
+ b->Bpp = g_server_Bpp;
+ copy_mem(b->data, data, width * height * g_server_Bpp);
+ return (void*)b;
+}
+
+//*****************************************************************************
+void draw_glyph (int x, int y, HGLYPH glyph, int fgcolour)
+{
+ bitmap* the_glyph;
+ int i, j;
+
+ the_glyph = (bitmap*)glyph;
+ if (the_glyph == NULL)
+ return;
+ for (i = 0; i < the_glyph->height; i++)
+ for (j = 0; j < the_glyph->width; j++)
+ if (is_pixel_on(the_glyph->data, j, i, the_glyph->width, 8))
+ set_pixel(x + j, y + i, fgcolour, 0xc);
+}
+
+#define DO_GLYPH(ttext,idx) \
+{\
+ glyph = cache_get_font (font, ttext[idx]);\
+ if (!(flags & TEXT2_IMPLICIT_X))\
+ {\
+ xyoffset = ttext[++idx];\
+ if ((xyoffset & 0x80))\
+ {\
+ if (flags & TEXT2_VERTICAL) \
+ y += ttext[idx+1] | (ttext[idx+2] << 8);\
+ else\
+ x += ttext[idx+1] | (ttext[idx+2] << 8);\
+ idx += 2;\
+ }\
+ else\
+ {\
+ if (flags & TEXT2_VERTICAL) \
+ y += xyoffset;\
+ else\
+ x += xyoffset;\
+ }\
+ }\
+ if (glyph != NULL)\
+ {\
+ draw_glyph (x + glyph->offset, y + glyph->baseline, glyph->pixmap, fgcolour);\
+ if (flags & TEXT2_IMPLICIT_X)\
+ x += glyph->width;\
+ }\
+}
+
+/*****************************************************************************/
+void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode,
+ int x, int y,
+ int clipx, int clipy, int clipcx, int clipcy,
+ int boxx, int boxy, int boxcx, int boxcy, BRUSH * brush,
+ int bgcolour, int fgcolour, uint8* text, uint8 length)
+{
+ int i;
+ int j;
+ int xyoffset;
+ DATABLOB* entry;
+ FONTGLYPH* glyph;
+
+ if (boxcx > 1)
+ {
+ if (contains_mouse(boxx, boxy, boxcx, boxcy))
+ draw_cursor_under(mousex, mousey);
+ fill_rect(boxx, boxy, boxcx, boxcy, bgcolour, 0xc);
+ }
+ else
+ {
+ if (contains_mouse(clipx, clipy, clipcx, clipcy))
+ draw_cursor_under(mousex, mousey);
+ if (mixmode == MIX_OPAQUE)
+ fill_rect(clipx, clipy, clipcx, clipcy, bgcolour, 0xc);
+ }
+
+ /* Paint text, character by character */
+ for (i = 0; i < length;)
+ {
+ switch (text[i])
+ {
+ case 0xff:
+ if (i + 2 < length)
+ cache_put_text(text[i + 1], text, text[i + 2]);
+ else
+ {
+ error("this shouldn't be happening\n");
+ exit(1);
+ }
+ /* this will move pointer from start to first character after FF command */
+ length -= i + 3;
+ text = &(text[i + 3]);
+ i = 0;
+ break;
+
+ case 0xfe:
+ entry = cache_get_text(text[i + 1]);
+ if (entry != NULL)
+ {
+ if ((((uint8 *) (entry->data))[1] == 0) && (!(flags & TEXT2_IMPLICIT_X)))
+ {
+ if (flags & TEXT2_VERTICAL)
+ y += text[i + 2];
+ else
+ x += text[i + 2];
+ }
+ for (j = 0; j < entry->size; j++)
+ DO_GLYPH(((uint8 *) (entry->data)), j);
+ }
+ if (i + 2 < length)
+ i += 3;
+ else
+ i += 2;
+ length -= i;
+ /* this will move pointer from start to first character after FE command */
+ text = &(text[i]);
+ i = 0;
+ break;
+
+ default:
+ DO_GLYPH(text, i);
+ i++;
+ break;
+ }
+ }
+ if (boxcx > 1)
+ cache_rect(boxx, boxy, boxcx, boxcy, True);
+ else
+ cache_rect(clipx, clipy, clipcx, clipcy, True);
+}
+
+//*****************************************************************************
+// Bresenham's line drawing algorithm
+void ui_line(uint8 opcode, int startx, int starty, int endx,
+ int endy, PEN* pen)
+{
+ int dx;
+ int dy;
+ int incx;
+ int incy;
+ int dpr;
+ int dpru;
+ int p;
+ int left;
+ int top;
+ int right;
+ int bottom;
+
+ if (startx > endx)
+ {
+ dx = startx - endx;
+ incx = -1;
+ left = endx;
+ right = startx;
+ }
+ else
+ {
+ dx = endx - startx;
+ incx = 1;
+ left = startx;
+ right = endx;
+ }
+ if (starty > endy)
+ {
+ dy = starty - endy;
+ incy = -1;
+ top = endy;
+ bottom = starty;
+ }
+ else
+ {
+ dy = endy - starty;
+ incy = 1;
+ top = starty;
+ bottom = endy;
+ }
+ if (contains_mouse(left, top, (right - left) + 1, (bottom - top) + 1))
+ draw_cursor_under(mousex, mousey);
+ if (dx >= dy)
+ {
+ dpr = dy << 1;
+ dpru = dpr - (dx << 1);
+ p = dpr - dx;
+ for (; dx >= 0; dx--)
+ {
+ set_pixel(startx, starty, pen->colour, opcode);
+ if (p > 0)
+ {
+ startx += incx;
+ starty += incy;
+ p += dpru;
+ }
+ else
+ {
+ startx += incx;
+ p += dpr;
+ }
+ }
+ }
+ else
+ {
+ dpr = dx << 1;
+ dpru = dpr - (dy << 1);
+ p = dpr - dy;
+ for (; dy >= 0; dy--)
+ {
+ set_pixel(startx, starty, pen->colour, opcode);
+ if (p > 0)
+ {
+ startx += incx;
+ starty += incy;
+ p += dpru;
+ }
+ else
+ {
+ starty += incy;
+ p += dpr;
+ }
+ }
+ }
+ cache_rect(left, top, (right - left) + 1, (bottom - top) + 1, True);
+}
+
+/*****************************************************************************/
+void ui_triblt(uint8 opcode, int x, int y, int cx, int cy,
+ HBITMAP src, int srcx, int srcy,
+ BRUSH* brush, int bgcolour, int fgcolour)
+{
+ // non used
+}
+
+/*****************************************************************************/
+void ui_memblt(uint8 opcode, int x, int y, int cx, int cy,
+ HBITMAP src, int srcx, int srcy)
+{
+ bitmap* b;
+ int i;
+ int j;
+ int pixel;
+
+ if (warp_coords(&x, &y, &cx, &cy, &srcx, &srcy))
+ {
+ if (contains_mouse(x, y, cx, cy))
+ draw_cursor_under(mousex, mousey);
+ b = (bitmap*)src;
+ if (opcode == 0xc)
+ accel_draw_box(x, y, cx, cy, get_ptr(srcx, srcy, b->data, b->width, g_server_bpp),
+ b->width * g_server_Bpp);
+ else
+ {
+ for (i = 0; i < cy; i++)
+ {
+ for (j = 0; j < cx; j++)
+ {
+ pixel = get_pixel2(srcx + j, srcy + i, b->data, b->width, g_server_bpp);
+ set_pixel(x + j, y + i, pixel, opcode);
+ }
+ }
+ }
+ cache_rect(x, y, cx, cy, False);
+ }
+}
+
+/*****************************************************************************/
+void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
+{
+ uint8* p;
+
+ if (offset > 0x38400)
+ offset = 0;
+ if (offset + cx * cy > 0x38400)
+ return;
+ p = desk_save + offset * g_server_Bpp;
+ ui_paint_bitmap(x, y, cx, cy, cx, cy, p);
+}
+
+/*****************************************************************************/
+void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
+{
+ uint8* p;
+
+ if (offset > 0x38400)
+ offset = 0;
+ if (offset + cx * cy > 0x38400)
+ return;
+ if (contains_mouse(x, y, cx, cy))
+ draw_cursor_under(mousex, mousey);
+ p = desk_save + offset * g_server_Bpp;
+ get_rect(x, y, cx, cy, p);
+}
+
+/*****************************************************************************/
+void ui_rect(int x, int y, int cx, int cy, int colour)
+{
+ if (warp_coords(&x, &y, &cx, &cy, NULL, NULL))
+ {
+ if (contains_mouse(x, y, cx, cy))
+ draw_cursor_under(mousex, mousey);
+ accel_fill_rect(x, y, cx, cy, colour);
+ cache_rect(x, y, cx, cy, False);
+ }
+}
+
+/*****************************************************************************/
+void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy,
+ int srcx, int srcy)
+{
+ int i;
+ int j;
+ uint8* temp;
+
+ if (x == srcx && y == srcy)
+ return;
+ if (warp_coords(&x, &y, &cx, &cy, &srcx, &srcy))
+ {
+ if (contains_mouse(x, y, cx, cy) || contains_mouse(srcx, srcy, cx, cy))
+ draw_cursor_under(mousex, mousey);
+ if (opcode == 0xc) /* copy */
+ accel_screen_copy(x, y, cx, cy, srcx, srcy);
+ else
+ {
+ temp = (uint8*)xmalloc(cx * cy * g_server_Bpp);
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel2(j, i, get_pixel(srcx + j, srcy + i), temp, cx, g_server_bpp);
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ set_pixel(x + j, y + i, get_pixel2(j, i, temp, cx, g_server_bpp), opcode);
+ xfree(temp);
+ }
+ cache_rect(x, y, cx, cy, False);
+ draw_cache_rects(); // draw them all so screen is not jumpy
+ }
+}
+
+/*****************************************************************************/
+void ui_patblt(uint8 opcode, int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+ int i;
+ int j;
+ uint8 ipattern[8];
+
+ if (warp_coords(&x, &y, &cx, &cy, NULL, NULL))
+ {
+ if (contains_mouse(x, y, cx, cy))
+ draw_cursor_under(mousex, mousey);
+ switch (brush->style)
+ {
+ case 0:
+ fill_rect(x, y, cx, cy, fgcolour, opcode);
+ break;
+ case 3:
+ for (i = 0; i < 8; i++)
+ ipattern[i] = ~brush->pattern[7 - i];
+ for (i = 0; i < cy; i++)
+ for (j = 0; j < cx; j++)
+ if (is_pixel_on(ipattern, (x + j + brush->xorigin) % 8,
+ (y + i + brush->yorigin) % 8, 8, 1))
+ set_pixel(x + j, y + i, fgcolour, opcode);
+ else
+ set_pixel(x + j, y + i, bgcolour, opcode);
+ break;
+ }
+ cache_rect(x, y, cx, cy, False);
+ }
+}
+
+/*****************************************************************************/
+void ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
+{
+ if (warp_coords(&x, &y, &cx, &cy, NULL, NULL))
+ {
+ if (contains_mouse(x, y, cx, cy))
+ draw_cursor_under(mousex, mousey);
+ fill_rect(x, y, cx, cy, -1, opcode);
+ cache_rect(x, y, cx, cy, False);
+ }
+}
+
+/*****************************************************************************/
+void ui_move_pointer(int x, int y)
+{
+}
+
+/*****************************************************************************/
+void ui_set_null_cursor(void)
+{
+ draw_cursor_under(mousex, mousey);
+ mousex = mousex - mcursor.x;
+ mousey = mousey - mcursor.y;
+ memset(&mcursor, 0, sizeof(mcursor));
+ memset(mcursor.andmask, 255, sizeof(mcursor.andmask));
+ memset(mcursor.xormask, 0, sizeof(mcursor.xormask));
+ draw_cursor();
+}
+
+/*****************************************************************************/
+void ui_paint_bitmap(int x, int y, int cx, int cy,
+ int width, int height, uint8* data)
+{
+ if (warp_coords(&x, &y, &cx, &cy, NULL, NULL))
+ {
+ if (contains_mouse(x, y, cx, cy))
+ draw_cursor_under(mousex, mousey);
+ accel_draw_box(x, y, cx, cy, data, width * g_server_Bpp);
+ cache_rect(x, y, cx, cy, False);
+ }
+}
+
+/*****************************************************************************/
+void* ui_create_cursor(unsigned int x, unsigned int y,
+ int width, int height,
+ uint8* andmask, uint8* xormask)
+{
+ tcursor* c;
+ int i;
+ int j;
+
+ c = (tcursor*)xmalloc(sizeof(tcursor));
+ memset(c, 0, sizeof(tcursor));
+ c->w = width;
+ c->h = height;
+ c->x = x;
+ c->y = y;
+ for (i = 0; i < 32; i++)
+ {
+ for (j = 0; j < 32; j++)
+ {
+ if (is_pixel_on(andmask, j, i, 32, 1))
+ set_pixel_on(c->andmask, j, 31 - i, 32, 8, 255);
+ if (is_pixel_on(xormask, j, i, 32, 24))
+ set_pixel_on(c->xormask, j, 31 - i, 32, 8, 255);
+ }
+ }
+ return (void*)c;
+}
+
+/*****************************************************************************/
+void ui_destroy_cursor(void* cursor)
+{
+ if (cursor != NULL)
+ xfree(cursor);
+}
+
+/*****************************************************************************/
+void ui_set_cursor(void* cursor)
+{
+ int x;
+ int y;
+ int ox;
+ int oy;
+
+ ox = mousex;
+ oy = mousey;
+ x = mousex + mcursor.x;
+ y = mousey + mcursor.y;
+ memcpy(&mcursor, cursor, sizeof(tcursor));
+ mousex = x - mcursor.x;
+ mousey = y - mcursor.y;
+ draw_cursor_under(ox, oy);
+ draw_cursor();
+}
+
+/*****************************************************************************/
+uint16 ui_get_numlock_state(unsigned int state)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+unsigned int read_keyboard_state(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_resize_window(void)
+{
+}
+
+/*****************************************************************************/
+void ui_begin_update(void)
+{
+}
+
+/*****************************************************************************/
+void ui_end_update(void)
+{
+ draw_cache_rects();
+ draw_cursor();
+}
+
+/*****************************************************************************/
+void ui_polygon(uint8 opcode, uint8 fillmode, POINT * point, int npoints,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+void ui_polyline(uint8 opcode, POINT * points, int npoints, PEN * pen)
+{
+}
+
+/*****************************************************************************/
+void ui_ellipse(uint8 opcode, uint8 fillmode,
+ int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+void generate_random(uint8* random)
+{
+ memcpy(random, "12345678901234567890123456789012", 32);
+}
+
+/*****************************************************************************/
+void save_licence(uint8* data, int length)
+{
+}
+
+/*****************************************************************************/
+int load_licence(uint8** data)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void* xrealloc(void* in_val, int size)
+{
+ return realloc(in_val, size);
+}
+
+/*****************************************************************************/
+void* xmalloc(int size)
+{
+ return malloc(size);
+}
+
+/*****************************************************************************/
+void xfree(void* in_val)
+{
+ free(in_val);
+}
+
+/*****************************************************************************/
+char * xstrdup(const char * s)
+{
+ char * mem = strdup(s);
+ if (mem == NULL)
+ {
+ perror("strdup");
+ exit(1);
+ }
+ return mem;
+}
+
+/*****************************************************************************/
+void warning(char* format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "WARNING: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void unimpl(char* format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "NOT IMPLEMENTED: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+/*****************************************************************************/
+void error(char* format, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "ERROR: ");
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+BOOL rd_pstcache_mkdir(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_open_file(char *filename)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void rd_close_file(int fd)
+{
+ return;
+}
+
+/*****************************************************************************/
+int rd_read_file(int fd, void *ptr, int len)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_write_file(int fd, void* ptr, int len)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_lseek_file(int fd, int offset)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+BOOL rd_lock_file(int fd, int start, int len)
+{
+ return False;
+}
+
+/*****************************************************************************/
+void get_username_and_hostname(void)
+{
+ char fullhostname[64];
+ char* p;
+ struct passwd* pw;
+
+ STRNCPY(g_username, "unknown", sizeof(g_username));
+ STRNCPY(g_hostname, "unknown", sizeof(g_hostname));
+ pw = getpwuid(getuid());
+ if (pw != NULL && pw->pw_name != NULL)
+ {
+ STRNCPY(g_username, pw->pw_name, sizeof(g_username));
+ }
+ if (gethostname(fullhostname, sizeof(fullhostname)) != -1)
+ {
+ p = strchr(fullhostname, '.');
+ if (p != NULL)
+ *p = 0;
+ STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));
+ }
+}
+
+/*****************************************************************************/
+void out_params(void)
+{
+ fprintf(stderr, "rdesktop: A Remote Desktop Protocol client.\n");
+ fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2003 Matt Chapman.\n");
+ fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
+ fprintf(stderr, "Usage: svgardesktop [options] server\n");
+ fprintf(stderr, " -g: desktop geometry (WxH)\n");
+ fprintf(stderr, " -4: use RDP version 4\n");
+ fprintf(stderr, " -5: use RDP version 5 (default)\n");
+ fprintf(stderr, " -t: tcp port\n");
+ fprintf(stderr, " -u: user name\n");
+ fprintf(stderr, " -n: client hostname\n");
+ fprintf(stderr, " -d: disable accel funcs\n");
+ fprintf(stderr, " -a: connection colour depth\n");
+ fprintf(stderr, " -l: low memory\n");
+ fprintf(stderr, "\n");
+}
+
+/* produce a hex dump */
+void hexdump(uint8* p, uint32 len)
+{
+ uint8* line;
+ int i;
+ int thisline;
+ int offset;
+
+ line = p;
+ offset = 0;
+ while (offset < len)
+ {
+ printf("%04x ", offset);
+ thisline = len - offset;
+ if (thisline > 16)
+ thisline = 16;
+
+ for (i = 0; i < thisline; i++)
+ printf("%02x ", line[i]);
+
+ for (; i < 16; i++)
+ printf(" ");
+
+ for (i = 0; i < thisline; i++)
+ printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');
+
+ printf("\n");
+ offset += thisline;
+ line += thisline;
+ }
+}
+
+/*****************************************************************************/
+int parse_parameters(int in_argc, char** in_argv)
+{
+ int i;
+ char* p;
+
+ if (in_argc <= 1)
+ {
+ out_params();
+ return 0;
+ }
+ g_argc = in_argc;
+ g_argv = in_argv;
+ for (i = 1; i < in_argc; i++)
+ {
+ strcpy(g_servername, in_argv[i]);
+ if (strcmp(in_argv[i], "-g") == 0)
+ {
+ g_width = strtol(in_argv[i + 1], &p, 10);
+ if (g_width <= 0)
+ {
+ error("invalid geometry\n");
+ return 0;
+ }
+ if (*p == 'x')
+ g_height = strtol(p + 1, NULL, 10);
+ if (g_height <= 0)
+ {
+ error("invalid geometry\n");
+ return 0;
+ }
+ g_width = (g_width + 3) & ~3;
+ }
+ else if (strcmp(in_argv[i], "-4") == 0)
+ g_use_rdp5 = 0;
+ else if (strcmp(in_argv[i], "-5") == 0)
+ g_use_rdp5 = 1;
+ else if (strcmp(in_argv[i], "-t") == 0)
+ g_tcp_port_rdp = strtol(in_argv[i + 1], &p, 10);
+ else if (strcmp(in_argv[i], "-h") == 0)
+ {
+ out_params();
+ return 0;
+ }
+ else if (strcmp(in_argv[i], "-n") == 0)
+ {
+ STRNCPY(g_hostname, in_argv[i + 1], sizeof(g_hostname));
+ }
+ else if (strcmp(in_argv[i], "-u") == 0)
+ {
+ STRNCPY(g_username, in_argv[i + 1], sizeof(g_username));
+ }
+ else if (strcmp(in_argv[i], "-d") == 0)
+ {
+ use_accel = 0;
+ }
+ else if (strcmp(in_argv[i], "-a") == 0)
+ {
+ g_server_bpp = strtol(in_argv[i + 1], NULL, 10);
+ if (g_server_bpp != 8 && g_server_bpp != 16)
+ {
+ error("invalid server bpp\n");
+ return 0;
+ }
+ g_server_Bpp = (g_server_bpp + 7) / 8;
+ }
+ else if (strcmp(in_argv[i], "-l") == 0)
+ g_save_mem = 1;
+ }
+ return 1;
+}
+
+/*****************************************************************************/
+int main(int in_argc, char** in_argv)
+{
+ get_username_and_hostname();
+ if (!parse_parameters(in_argc, in_argv))
+ return 0;
+ if (!ui_init())
+ return 1;
+ if (!ui_create_window())
+ return 1;
+ ui_main_loop();
+ ui_destroy_window();
+ ui_deinit();
+ return 0;
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ User interface services - Generic
+ Copyright (C) Jay Sorg 2004-2006
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "../rdesktop.h"
+
+extern int g_tcp_port_rdp;
+int g_use_rdp5 = 0;
+char g_hostname[16];
+char g_username[64];
+int g_height = 600;
+int g_width = 800;
+int g_server_depth = 8;
+int g_encryption = 1;
+int g_desktop_save = 1;
+int g_polygon_ellipse_orders = 0;
+int g_bitmap_cache = 1;
+int g_bitmap_cache_persist_enable = False;
+int g_bitmap_cache_precache = True;
+int g_bitmap_compression = 1;
+int g_rdp5_performanceflags = 0;
+int g_console_session = 0;
+int g_keylayout = 0x409; /* Defaults to US keyboard layout */
+int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */
+int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
+int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */
+/* Session Directory redirection */
+BOOL g_redirect = False;
+char g_redirect_server[64];
+char g_redirect_domain[16];
+char g_redirect_password[64];
+char g_redirect_username[64];
+char g_redirect_cookie[128];
+uint32 g_redirect_flags = 0;
+
+/*****************************************************************************/
+void ui_bell(void)
+{
+}
+
+/*****************************************************************************/
+int ui_select(int in)
+{
+ return 1;
+}
+
+/*****************************************************************************/
+void ui_destroy_cursor(void* cursor)
+{
+}
+
+/*****************************************************************************/
+void* ui_create_glyph(int width, int height, uint8* data)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_destroy_glyph(void* glyph)
+{
+}
+
+/*****************************************************************************/
+void ui_destroy_bitmap(void* bmp)
+{
+}
+
+/*****************************************************************************/
+void ui_reset_clip(void)
+{
+}
+
+/*****************************************************************************/
+void ui_set_clip(int x, int y, int cx, int cy)
+{
+}
+
+/*****************************************************************************/
+void* ui_create_colourmap(COLOURMAP * colours)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_set_colourmap(void* map)
+{
+}
+
+/*****************************************************************************/
+HBITMAP ui_create_bitmap(int width, int height, uint8* data)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode,
+ int x, int y,
+ int clipx, int clipy, int clipcx, int clipcy,
+ int boxx, int boxy, int boxcx, int boxcy, BRUSH * brush,
+ int bgcolour, int fgcolour, uint8* text, uint8 length)
+{
+}
+
+/*****************************************************************************/
+void ui_line(uint8 opcode, int startx, int starty, int endx, int endy,
+ PEN * pen)
+{
+}
+
+/*****************************************************************************/
+void ui_triblt(uint8 opcode, int x, int y, int cx, int cy,
+ HBITMAP src, int srcx, int srcy,
+ BRUSH* brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+void ui_memblt(uint8 opcode, int x, int y, int cx, int cy,
+ HBITMAP src, int srcx, int srcy)
+{
+}
+
+/*****************************************************************************/
+void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
+{
+}
+
+/*****************************************************************************/
+void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
+{
+}
+
+/*****************************************************************************/
+void ui_rect(int x, int y, int cx, int cy, int colour)
+{
+}
+
+/*****************************************************************************/
+void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy,
+ int srcx, int srcy)
+{
+}
+
+/*****************************************************************************/
+void ui_patblt(uint8 opcode, int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+void ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
+{
+}
+
+/*****************************************************************************/
+void ui_move_pointer(int x, int y)
+{
+}
+
+/*****************************************************************************/
+void ui_set_null_cursor(void)
+{
+}
+
+/*****************************************************************************/
+void ui_paint_bitmap(int x, int y, int cx, int cy,
+ int width, int height, uint8* data)
+{
+}
+
+/*****************************************************************************/
+void ui_set_cursor(HCURSOR cursor)
+{
+}
+
+/*****************************************************************************/
+HCURSOR ui_create_cursor(unsigned int x, unsigned int y,
+ int width, int height,
+ uint8* andmask, uint8* xormask)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+uint16 ui_get_numlock_state(unsigned int state)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+unsigned int read_keyboard_state(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void ui_resize_window(void)
+{
+}
+
+/*****************************************************************************/
+void ui_begin_update(void)
+{
+}
+
+/*****************************************************************************/
+void ui_end_update(void)
+{
+}
+
+/*****************************************************************************/
+void ui_polygon(uint8 opcode, uint8 fillmode, POINT * point, int npoints,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+/* todo, use qt function for this (QPainter::drawPolyline) */
+void ui_polyline(uint8 opcode, POINT * points, int npoints, PEN * pen)
+{
+ int i, x, y, dx, dy;
+ if (npoints > 0)
+ {
+ x = points[0].x;
+ y = points[0].y;
+ for (i = 1; i < npoints; i++)
+ {
+ dx = points[i].x;
+ dy = points[i].y;
+ ui_line(opcode, x, y, x + dx, y + dy, pen);
+ x = x + dx;
+ y = y + dy;
+ }
+ }
+}
+
+/*****************************************************************************/
+void ui_ellipse(uint8 opcode, uint8 fillmode,
+ int x, int y, int cx, int cy,
+ BRUSH * brush, int bgcolour, int fgcolour)
+{
+}
+
+/*****************************************************************************/
+void generate_random(uint8* random)
+{
+}
+
+/*****************************************************************************/
+void save_licence(uint8* data, int length)
+{
+}
+
+/*****************************************************************************/
+int load_licence(uint8** data)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void* xrealloc(void* in, int size)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void* xmalloc(int size)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void xfree(void* in)
+{
+}
+
+/*****************************************************************************/
+char * xstrdup(const char * s)
+{
+ char * mem = strdup(s);
+ if (mem == NULL)
+ {
+ perror("strdup");
+ exit(1);
+ }
+ return mem;
+}
+/*****************************************************************************/
+void warning(char* format, ...)
+{
+}
+
+/*****************************************************************************/
+void unimpl(char* format, ...)
+{
+}
+
+/*****************************************************************************/
+void error(char* format, ...)
+{
+}
+
+/*****************************************************************************/
+BOOL rd_pstcache_mkdir(void)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_open_file(char *filename)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+void rd_close_file(int fd)
+{
+ return;
+}
+
+/*****************************************************************************/
+int rd_read_file(int fd, void *ptr, int len)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_write_file(int fd, void* ptr, int len)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+int rd_lseek_file(int fd, int offset)
+{
+ return 0;
+}
+
+/*****************************************************************************/
+BOOL rd_lock_file(int fd, int start, int len)
+{
+ return False;
+}
+
+/*****************************************************************************/
+int main(int c, char** p)
+{
+ return 0;
+}
--- /dev/null
+/*
+ rdesktop: A Remote Desktop Protocol client.
+ User interface services - VNC target
+ Copyright (C) Matthew Chapman 1999-2000
+ Copyright (C) 2000 Tim Edmonds
+ Copyright (C) 2001 James "Wez" Weatherall
+ Copyright (C) 2001 Johannes E. Schindelin
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+
+#include <stdio.h>
+#include <time.h>
+
+#ifdef WIN32
+#define close closesocket
+#define strcasecmp _strcmpi
+#else
+#include <unistd.h>
+#include <sys/time.h> /* timeval */
+#include <sys/socket.h>
+#endif
+
+#include "../rdesktop.h"
+#undef VERSION
+
+#ifdef WIN32
+#define HBITMAP R_HBITMAP
+#define HCURSOR R_HCURSOR
+#define WORD R_WORD
+#endif
+#include "vnc.h"
+#ifdef WIN32
+#undef HBITMAP
+#undef HCURSOR
+#undef WORD
+#endif
+
+#include <errno.h>
+#include <sys/socket.h>
+extern int ListenOnTCPPort(int port);
+extern int rfbClientSocket;
+
+#include <rfb/rfbregion.h>
+
+#define BITSPERBYTES 8
+#define TOBYTES(bits) ((bits)/BITSPERBYTES)
+
+extern int g_width;
+extern int g_height;
+extern int keylayout;
+extern BOOL sendmotion;
+#ifdef ENABLE_SHADOW
+extern int client_counter;
+#endif
+
+
+int rfb_port = 5923;
+int defer_time = 5;
+int rfbClientSocket = 0;
+static rfbScreenInfoPtr server = NULL;
+static vncBuffer *frameBuffer = NULL;
+static uint8_t reverseByte[0x100];
+BOOL g_enable_compose = False;
+int g_display = 0;
+
+/* ignored */
+BOOL owncolmap = False;
+BOOL enable_compose = False;
+
+void
+vncHideCursor()
+{
+ if (server->clientHead)
+ rfbUndrawCursor(server);
+}
+
+/* -=- mouseLookup
+ * Table converting mouse button number (0-2) to flag
+ */
+
+int mouseLookup[3] = {
+ MOUSE_FLAG_BUTTON1, MOUSE_FLAG_BUTTON3, MOUSE_FLAG_BUTTON2
+};
+
+int clipX, clipY, clipW, clipH;
+
+BOOL
+vncwinClipRect(int *x, int *y, int *cx, int *cy)
+{
+ if (*x + *cx > clipX + clipW)
+ *cx = clipX + clipW - *x;
+ if (*y + *cy > clipY + clipH)
+ *cy = clipY + clipH - *y;
+ if (*x < clipX)
+ {
+ *cx -= clipX - *x;
+ *x = clipX;
+ }
+ if (*y < clipY)
+ {
+ *cy -= clipY - *y;
+ *y = clipY;
+ }
+ if (*cx < 0 || *cy < 0)
+ *cx = *cy = 0;
+ return (*cx > 0 && *cy > 0 && *x < server->width && *y < server->height);
+}
+
+void
+xwin_toggle_fullscreen(void)
+{
+}
+
+static int lastbuttons = 0;
+
+#define FIRST_MODIFIER XK_Shift_L
+#define LAST_MODIFIER XK_Hyper_R
+
+static BOOL keystate[LAST_MODIFIER - FIRST_MODIFIER];
+
+void
+init_keyboard()
+{
+ int i;
+ for (i = 0; i < LAST_MODIFIER - FIRST_MODIFIER; i++)
+ keystate[i] = 0;
+
+ xkeymap_init();
+}
+
+BOOL
+get_key_state(unsigned int state, uint32 keysym)
+{
+ if (keysym >= FIRST_MODIFIER && keysym <= LAST_MODIFIER)
+ return keystate[keysym - FIRST_MODIFIER];
+ return 0;
+}
+
+void
+vncKey(rfbBool down, rfbKeySym keysym, struct _rfbClientRec *cl)
+{
+ uint32 ev_time = time(NULL);
+ key_translation tr = { 0, 0 };
+
+ if (keysym >= FIRST_MODIFIER && keysym <= LAST_MODIFIER)
+ {
+ /* TODO: fake local state */
+ keystate[keysym - FIRST_MODIFIER] = down;
+ }
+
+ if (down)
+ {
+ /* TODO: fake local state */
+ if (handle_special_keys(keysym, 0, ev_time, True))
+ return;
+
+ /* TODO: fake local state */
+ tr = xkeymap_translate_key(keysym, 0, 0);
+
+ if (tr.scancode == 0)
+ return;
+
+ ensure_remote_modifiers(ev_time, tr);
+
+ rdp_send_scancode(ev_time, RDP_KEYPRESS, tr.scancode);
+ }
+ else
+ {
+ /* todO: fake local state */
+ if (handle_special_keys(keysym, 0, ev_time, False))
+ return;
+
+ /* todO: fake local state */
+ tr = xkeymap_translate_key(keysym, 0, 0);
+
+ if (tr.scancode == 0)
+ return;
+
+ rdp_send_scancode(ev_time, RDP_KEYRELEASE, tr.scancode);
+ }
+}
+
+void
+vncMouse(int buttonMask, int x, int y, struct _rfbClientRec *cl)
+{
+ int b;
+ uint32 ev_time = time(NULL);
+
+ rdp_send_input(ev_time, RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE, x, y);
+
+ for (b = 0; b < 3; b++)
+ {
+ int bb = 1 << (b);
+ if (!(lastbuttons & bb) && (buttonMask & bb))
+ {
+ rdp_send_input(ev_time, RDP_INPUT_MOUSE,
+ (mouseLookup[b]) | MOUSE_FLAG_DOWN, x, y);
+ }
+ else if ((lastbuttons & bb) && !(buttonMask & bb))
+ {
+ rdp_send_input(ev_time, RDP_INPUT_MOUSE, (mouseLookup[b]), x, y);
+ }
+ }
+ lastbuttons = buttonMask;
+
+ /* handle cursor */
+ rfbDefaultPtrAddEvent(buttonMask, x, y, cl);
+}
+
+
+void
+rdp2vnc_connect(char *server, uint32 flags, char *domain, char *password,
+ char *shell, char *directory)
+{
+ struct sockaddr addr;
+ fd_set fdset;
+ struct timeval tv;
+ int rfbListenSock, addrlen = sizeof(addr);
+
+ rfbListenSock = rfbListenOnTCPPort(rfb_port);
+ fprintf(stderr, "Listening on VNC port %d\n", rfb_port);
+ if (rfbListenSock <= 0)
+ error("Cannot listen on port %d", rfb_port);
+ else
+ while (1)
+ {
+ FD_ZERO(&fdset);
+ FD_SET(rfbListenSock, &fdset);
+ tv.tv_sec = 5;
+ tv.tv_usec = 0;
+ if (select(rfbListenSock + 1, &fdset, NULL, NULL, &tv) > 0)
+ {
+ rfbClientSocket = accept(rfbListenSock, &addr, &addrlen);
+ if (rfbClientSocket < 0)
+ {
+ error("Error accepting client (%d: %s.\n",
+ errno, strerror(errno));
+ continue;
+ }
+ ui_create_window();
+ if (!rdp_connect(server, flags, domain, password, shell, directory))
+ {
+ error("Error connecting to RDP server.\n");
+ continue;
+ }
+ if (!fork())
+ {
+ BOOL deactivated;
+ uint32_t ext_disc_reason;
+ printf("Connection successful.\n");
+ rdp_main_loop(&deactivated, &ext_disc_reason);
+ printf("Disconnecting...\n");
+ rdp_disconnect();
+ ui_destroy_window();
+ exit(0);
+ }
+ }
+ }
+}
+
+
+
+
+
+extern char g_title[];
+BOOL
+ui_create_window()
+{
+ int i;
+
+ for (i = 0; i < 0x100; i++)
+ reverseByte[i] =
+ (((i >> 7) & 1)) | (((i >> 6) & 1) << 1) | (((i >> 5) & 1) << 2) |
+ (((i >> 4) & 1) << 3) | (((i >> 3) & 1) << 4) | (((i >> 2) & 1) << 5) |
+ (((i >> 1) & 1) << 6) | (((i >> 0) & 1) << 7);
+
+ server = rfbGetScreen(0, NULL, g_width, g_height, 8, 1, 1);
+ server->desktopName = g_title;
+ server->frameBuffer = (char *) malloc(g_width * g_height);
+ server->ptrAddEvent = vncMouse;
+ server->kbdAddEvent = vncKey;
+#ifdef ENABLE_SHADOW
+ server->httpPort = 6124 + client_counter;
+ server->port = 5924 + client_counter;
+ rfbInitSockets(server);
+ server->alwaysShared = TRUE;
+ server->neverShared = FALSE;
+#else
+ server->port = -1;
+ server->alwaysShared = FALSE;
+ server->neverShared = FALSE;
+#endif
+ server->inetdSock = rfbClientSocket;
+ server->serverFormat.trueColour = FALSE; /* activate colour maps */
+ server->deferUpdateTime = defer_time;
+
+ frameBuffer = (vncBuffer *) malloc(sizeof(vncBuffer));
+ frameBuffer->w = g_width;
+ frameBuffer->h = g_height;
+ frameBuffer->linew = g_width;
+ frameBuffer->data = server->frameBuffer;
+ frameBuffer->owner = FALSE;
+ frameBuffer->format = &server->serverFormat;
+
+ ui_set_clip(0, 0, g_width, g_height);
+
+ rfbInitServer(server);
+#ifndef ENABLE_SHADOW
+ server->port = rfb_port;
+#else
+ fprintf(stderr, "server listening on port %d (socket %d)\n", server->port,
+ server->listenSock);
+#endif
+
+ init_keyboard();
+
+ return (server != NULL);
+}
+
+void
+ui_destroy_window()
+{
+ rfbCloseClient(server->clientHead);
+}
+
+
+int
+ui_select(int rdpSocket)
+{
+ fd_set fds;
+ struct timeval tv;
+ int n, m = server->maxFd;
+
+ if (rdpSocket > m)
+ m = rdpSocket;
+ while (1)
+ {
+ fds = server->allFds;
+ FD_SET(rdpSocket, &fds);
+ tv.tv_sec = defer_time / 1000;
+ tv.tv_usec = (defer_time % 1000) * 1000;
+ n = select(m + 1, &fds, NULL, NULL, &tv);
+ rfbProcessEvents(server, 0);
+ /* if client is gone, close connection */
+ if (!server->clientHead)
+ close(rdpSocket);
+ if (FD_ISSET(rdpSocket, &fds))
+ return 1;
+ }
+ return 0;
+}
+
+void
+ui_move_pointer(int x, int y)
+{
+ // TODO: Is there a way to send x,y even if cursor encoding is active?
+ rfbUndrawCursor(server);
+ server->cursorX = x;
+ server->cursorY = y;
+}
+
+HBITMAP
+ui_create_bitmap(int width, int height, uint8 * data)
+{
+ vncBuffer *buf;
+
+ buf = vncNewBuffer(width, height, 8);
+ memcpy(buf->data, data, width * height);
+
+ return (HBITMAP) buf;
+}
+
+void
+ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 * data)
+{
+ vncBuffer *buf;
+ buf = ui_create_bitmap(width, height, data);
+ vncCopyBlitFrom(server, x, y, cx, cy, buf, 0, 0);
+ vncDeleteBuffer(buf);
+}
+
+void
+ui_destroy_bitmap(HBITMAP bmp)
+{
+ vncDeleteBuffer((vncBuffer *) bmp);
+}
+
+uint8_t
+vncLookupColour(rfbColourMap * colourMap, uint8_t * p)
+{
+ uint8_t i, i1 = 0;
+ uint8_t *cm = colourMap->data.bytes;
+ uint32_t m, m1 = abs(cm[0] - p[0]) + abs(cm[1] - p[1]) + abs(cm[2] - p[2]);
+ for (i = 1; i < 255; i++)
+ {
+ m = abs(cm[i * 3] - p[0]) + abs(cm[i * 3 + 1] - p[1]) + abs(cm[i * 3 + 2] - p[2]);
+ if (m < m1)
+ {
+ m1 = m;
+ i1 = i;
+ }
+ }
+ return (i1);
+}
+
+HCURSOR
+ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 * mask, uint8 * data)
+{
+ int i, j;
+ uint8_t *d0, *d1;
+ uint8_t *cdata;
+ uint8_t white[3] = { 0xff, 0xff, 0xff };
+ uint8_t black[3] = { 0, 0, 0 };
+ uint8_t *cur;
+ rfbCursorPtr cursor;
+ rfbColourMap *colourMap = &server->colourMap;
+
+ cdata = xmalloc(sizeof(uint8_t) * width * height);
+ d0 = xmalloc(sizeof(uint32_t) * width * height / 4);
+ d1 = (uint8_t *) mask;
+ for (j = 0; j < height; j++)
+ for (i = 0; i < width / 8; i++)
+ {
+ d0[j * width / 8 + i] = d1[(height - 1 - j) * width / 8 + i] ^ 0xffffffff;
+ }
+ for (j = 0; j < height; j++)
+ {
+ for (i = 0; i < width; i++)
+ {
+ //strange that the pointer is in 24bit depth when everything
+ //else is in 8bit palletized.
+ cur = data + ((height - 1 - j) * width + i) * 3;
+ if (cur[0] > 0x80 || cur[1] > 0x80 || cur[2] > 0x80)
+ {
+ if (!(d0[(j * width + i) / 8] & (0x80 >> (i & 7))))
+ {
+ /* text cursor! */
+ cdata[j * width + i] = vncLookupColour(colourMap, black);
+ d0[(j * width + i) / 8] |= 0x80 >> (i & 7);
+ }
+ else
+ cdata[j * width + i] = vncLookupColour(colourMap, white);
+ }
+ else
+ cdata[j * width + i] = vncLookupColour(colourMap, cur);
+ }
+ }
+ cursor = (rfbCursorPtr) xmalloc(sizeof(rfbCursor));
+ cursor->width = width;
+ cursor->height = height;
+ cursor->xhot = x;
+ cursor->yhot = y;
+ cursor->mask = (char *) d0;
+ cursor->source = 0;
+ cursor->richSource = cdata;
+ cursor->cleanup = 0; // workaround: this produces a memleak
+
+ cursor->backRed = cursor->backGreen = cursor->backBlue = 0xffff;
+ cursor->foreRed = cursor->foreGreen = cursor->foreBlue = 0;
+
+ return (HCURSOR) cursor;
+}
+
+void
+ui_set_cursor(HCURSOR cursor)
+{
+ /* FALSE means: don't delete old cursor */
+ rfbSetCursor(server, (rfbCursorPtr) cursor, FALSE);
+}
+
+void
+ui_destroy_cursor(HCURSOR cursor)
+{
+ if (cursor)
+ rfbFreeCursor((rfbCursorPtr) cursor);
+}
+
+void
+ui_set_null_cursor(void)
+{
+ rfbSetCursor(server, 0, FALSE);
+}
+
+HGLYPH
+ui_create_glyph(int width, int height, uint8 * data)
+{
+ int x, y;
+ vncBuffer *buf;
+
+ buf = vncNewBuffer(width, height, 8);
+
+ //data is padded to multiple of 16bit line lengths
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ int byte = x / 8 + (y * ((width + 7) / 8));
+ byte = rfbEndianTest ? reverseByte[data[byte]] : data[byte];
+ byte = (byte >> (x & 7)) & 0x01;
+ vncSetPixel(buf, x, y, byte ? 0x7f : 0x00);
+ }
+ }
+
+ return (HGLYPH) buf;
+}
+
+void
+ui_destroy_glyph(HGLYPH glyph)
+{
+ ui_destroy_bitmap((HBITMAP) glyph);
+}
+
+HCOLOURMAP
+ui_create_colourmap(COLOURMAP * colours)
+{
+ int i;
+ rfbColourMap *map = vncNewColourMap(server, colours->ncolours);
+ for (i = 0; i < colours->ncolours; i++)
+ {
+ vncSetColourMapEntry(map, i, colours->colours[i].red,
+ colours->colours[i].green, colours->colours[i].blue);
+ }
+ return map;
+}
+
+void
+ui_destroy_colourmap(HCOLOURMAP map)
+{
+ vncDeleteColourMap(map);
+}
+
+void
+ui_set_colourmap(HCOLOURMAP map)
+{
+ vncSetColourMap(server, map);
+}
+
+void
+ui_set_clip(int x, int y, int cx, int cy)
+{
+ clipX = x;
+ clipY = y;
+ clipW = cx;
+ clipH = cy;
+}
+
+void
+ui_reset_clip()
+{
+ clipX = 0;
+ clipY = 0;
+ clipW = 64000;
+ clipH = 64000;
+}
+
+void
+ui_bell()
+{
+ rfbSendBell(server);
+}
+
+void
+ui_destblt(uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy)
+{
+ int i;
+ vncBuffer *buf;
+
+ switch (opcode)
+ {
+ case 0:
+ case 15:
+ ui_rect(x, y, cx, cy, 0xff);
+ break;
+ case 5: // invert
+ buf = vncGetRect(server, x, y, cx, cy);
+ for (i = 0; i < cx * cy; i++)
+ ((char *) (buf->data))[i] = !((char *) (buf->data))[i];
+ break;
+ default:
+ unimpl("ui_destblt: opcode=%d %d,%d %dx%d\n", opcode, x, y, cx, cy);
+ }
+}
+
+void
+ui_patblt(uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
+{
+ switch (brush->style)
+ {
+ case 0: /* Solid */
+ switch (opcode)
+ {
+ case ROP2_XOR:
+ {
+ int xx, yy;
+ vncBuffer *fill = vncNewBuffer(cx, cy, 8);
+ for (yy = 0; yy < cy; yy++)
+ for (xx = 0; xx < cx; xx++)
+ vncSetPixel(fill, xx, yy, fgcolour);
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ vncXorBlitFrom(server, x, y, cx, cy, fill,
+ 0, 0);
+ break;
+ }
+
+ default:
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ vncSetRect(server, x, y, cx, cy, fgcolour);
+ }
+ break;
+
+ case 3: /* Pattern */
+ {
+ int xx, yy;
+ vncBuffer *fill;
+ fill = (vncBuffer *) ui_create_glyph(8, 8, brush->pattern);
+
+ for (yy = 0; yy < 8; yy++)
+ {
+ for (xx = 0; xx < 8; xx++)
+ {
+ vncSetPixel(fill, xx, yy,
+ vncGetPixel(fill, xx,
+ yy) ? fgcolour : bgcolour);
+ }
+ }
+
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ {
+ switch (opcode)
+ {
+ case ROP2_COPY:
+ vncCopyBlitFrom(server, x, y, cx, cy, fill,
+ 0, 0);
+ break;
+ case ROP2_XOR:
+ vncXorBlitFrom(server, x, y, cx, cy, fill,
+ 0, 0);
+ break;
+ default:
+ unimpl("pattern blit (%d,%d) opcode=%d bg=%d fg=%d\n", x, y, opcode, bgcolour, fgcolour);
+ vncCopyBlitFrom(server, x, y, cx, cy, fill,
+ 0, 0);
+ break;
+ }
+ }
+
+ ui_destroy_glyph((HGLYPH) fill);
+ break;
+
+ }
+ default:
+ unimpl("brush %d\n", brush->style);
+ }
+}
+
+void
+ui_screenblt(uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* src */ int srcx, int srcy)
+{
+ int ox, oy;
+
+ ox = x;
+ oy = y;
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ {
+ //if we clipped top or left, we have to adjust srcx,srcy;
+ srcx += x - ox;
+ srcy += y - oy;
+ vncCopyBlit(server, x, y, cx, cy, srcx, srcy);
+ }
+}
+
+void
+ui_memblt(uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* src */ HBITMAP src, int srcx, int srcy)
+{
+ int ox, oy;
+ ox = x;
+ oy = y;
+
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ {
+ //if we clipped top or left, we have to adjust srcx,srcy;
+ srcx += x - ox;
+ srcy += y - oy;
+ switch (ROP2_S(opcode))
+ {
+ case ROP2_OR:
+ vncTransBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx,
+ srcy, 0x0);
+ break;
+ case ROP2_XOR:
+ vncXorBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx, srcy);
+ break;
+ case ROP2_AND:
+ vncAndBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx, srcy);
+ break;
+ case ROP2_COPY:
+ vncCopyBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx,
+ srcy);
+ break;
+ default:
+ unimpl("ui_memblt: op%d %d,%d %dx%d\n", opcode, x, y, cx, cy);
+ vncCopyBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx,
+ srcy);
+ break;
+ }
+ }
+}
+
+void
+ui_triblt(uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* src */ HBITMAP src, int srcx, int srcy,
+ /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
+{
+ /* This is potentially difficult to do in general. Until someone
+ comes up with a more efficient way of doing it I am using cases. */
+
+ switch (opcode)
+ {
+ case 0x69: /* PDSxxn */
+ ui_memblt(ROP2_XOR, x, y, cx, cy, src, srcx, srcy);
+ ui_patblt(ROP2_NXOR, x, y, cx, cy, brush, bgcolour, fgcolour);
+ break;
+
+ case 0xb8: /* PSDPxax */
+ ui_patblt(ROP2_XOR, x, y, cx, cy, brush, bgcolour, fgcolour);
+ ui_memblt(ROP2_AND, x, y, cx, cy, src, srcx, srcy);
+ ui_patblt(ROP2_XOR, x, y, cx, cy, brush, bgcolour, fgcolour);
+ break;
+
+ default:
+ unimpl("ui_triblt 1x%x\n", opcode);
+ ui_memblt(ROP2_COPY, x, y, cx, cy, src, srcx, srcy);
+ }
+
+}
+
+void
+ui_line(uint8 opcode,
+ /* dest */ int startx, int starty, int endx, int endy,
+ /* pen */ PEN * pen)
+{
+ //vncSetRect(server,startx,starty,1+endx-startx,endy-starty,pen->colour);
+ //unimpl("drawline: pen colour=%d\n",pen->colour);
+ /* TODO: implement opcodes */
+ rfbDrawLine(server, startx, starty, endx, endy, pen->colour);
+}
+
+void
+ui_rect(
+ /* dest */ int x, int y, int cx, int cy,
+ /* brush */ int colour)
+{
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ {
+ vncSetRect(server, x, y, cx, cy, colour);
+ }
+}
+
+void
+ui_draw_glyph(int mixmode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* src */ HGLYPH glyph, int srcx, int srcy,
+ /* colours */ int bgcolour, int fgcolour)
+{
+ int xx, yy;
+ int ox, oy;
+ vncBuffer *buf = vncDupBuffer(glyph);
+
+ x &= 0xffff;
+ y &= 0xffff;
+
+ /* yes, sometimes same fgcolour and bgcolour are sent, but because
+ * of transparency, we have to change that! */
+ if (mixmode == MIX_TRANSPARENT && fgcolour == bgcolour)
+ bgcolour = fgcolour ^ 0xff;
+
+ ox = x;
+ oy = y;
+
+ for (yy = srcy; yy < srcy + cy; yy++)
+ {
+ for (xx = srcx; xx < srcx + cx; xx++)
+ {
+ vncSetPixel(buf, xx, yy, vncGetPixel(buf, xx, yy) ? fgcolour : bgcolour);
+ }
+ }
+
+ switch (mixmode)
+ {
+ case MIX_TRANSPARENT:
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ {
+ //if we clipped top or left, we have to adjust srcx,srcy;
+ srcx += x - ox;
+ srcy += y - oy;
+ vncTransBlitFrom(server, x, y, cx, cy, buf, srcx, srcy, bgcolour);
+ }
+ break;
+ case MIX_OPAQUE:
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ {
+ //if we clipped top or left, we have to adjust srcx,srcy;
+ srcx += x - ox;
+ srcy += y - oy;
+ vncCopyBlitFrom(server, x, y, cx, cy, buf, srcx, srcy);
+ }
+ break;
+
+ default:
+ unimpl("mix %d\n", mixmode);
+ }
+ vncDeleteBuffer(buf);
+}
+
+#define DO_GLYPH(ttext,idx) \
+{\
+ glyph = cache_get_font (font, ttext[idx]);\
+ if (!(flags & TEXT2_IMPLICIT_X))\
+ {\
+ offset = ttext[++idx];\
+ if ((offset & 0x80))\
+ offset = ((offset & 0x7f) << 8) | ttext[++idx];\
+ if (flags & TEXT2_VERTICAL)\
+ y += offset;\
+ else\
+ x += offset;\
+ }\
+ if (glyph != NULL)\
+ {\
+ ui_draw_glyph (mixmode, x + (short) glyph->offset,\
+ y + (short) glyph->baseline,\
+ glyph->width, glyph->height,\
+ glyph->pixmap, 0, 0, bgcolour, fgcolour);\
+ if (flags & TEXT2_IMPLICIT_X)\
+ x += glyph->width;\
+ }\
+}
+
+
+void
+ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y,
+ int clipx, int clipy, int clipcx, int clipcy,
+ int boxx, int boxy, int boxcx, int boxcy,
+ int bgcolour, int fgcolour, uint8 * text, uint8 length)
+{
+ FONTGLYPH *glyph;
+ int i, j, offset;
+ DATABLOB *entry;
+
+ if (boxcx > 1)
+ {
+ ui_rect(boxx, boxy, boxcx, boxcy, bgcolour);
+ }
+ else if (mixmode == MIX_OPAQUE)
+ {
+ ui_rect(clipx, clipy, clipcx, clipcy, bgcolour);
+ }
+
+ /* Paint text, character by character */
+ for (i = 0; i < length;)
+ {
+ switch (text[i])
+ {
+ case 0xff:
+ if (i + 2 < length)
+ cache_put_text(text[i + 1], &(text[i - text[i + 2]]),
+ text[i + 2]);
+ else
+ {
+ error("this shouldn't be happening\n");
+ break;
+ }
+ /* this will move pointer from start to first character after FF command */
+ length -= i + 3;
+ text = &(text[i + 3]);
+ i = 0;
+ break;
+
+ case 0xfe:
+ entry = cache_get_text(text[i + 1]);
+ if (entry != NULL)
+ {
+ if ((((uint8 *) (entry->data))[1] == 0)
+ && (!(flags & TEXT2_IMPLICIT_X)))
+ {
+ if (flags & 0x04) /* vertical text */
+ y += text[i + 2];
+ else
+ x += text[i + 2];
+ }
+ if (i + 2 < length)
+ i += 3;
+ else
+ i += 2;
+ length -= i;
+ /* this will move pointer from start to first character after FE command */
+ text = &(text[i]);
+ i = 0;
+ for (j = 0; j < entry->size; j++)
+ DO_GLYPH(((uint8 *) (entry->data)), j);
+ }
+ break;
+ default:
+ DO_GLYPH(text, i);
+ i++;
+ break;
+ }
+ }
+}
+
+void
+ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
+{
+ vncBuffer *buf;
+
+ buf = vncGetRect(server, x, y, cx, cy);
+ offset *= TOBYTES(server->serverFormat.bitsPerPixel);
+ cache_put_desktop(offset, cx, cy, cx, TOBYTES(server->serverFormat.bitsPerPixel),
+ (buf->data));
+}
+
+void
+ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
+{
+ uint8 *data;
+ vncBuffer *buf;
+ int ox, oy, srcx, srcy;
+
+ srcx = srcy = 0;
+ ox = x;
+ oy = y;
+
+ offset *= TOBYTES(server->serverFormat.bitsPerPixel);
+ data = cache_get_desktop(offset, cx, cy, TOBYTES(server->serverFormat.bitsPerPixel));
+ if (data == NULL)
+ return;
+
+ buf = vncNewBuffer(cx, cy, 8);
+ memcpy(buf->data, data, cx * cy * 1);
+
+ if (vncwinClipRect(&x, &y, &cx, &cy))
+ {
+ srcx += x - ox;
+ srcy += y - oy;
+ vncCopyBlitFrom(server, x, y, cx, cy, buf, srcx, srcy);
+ }
+ vncDeleteBuffer(buf);
+}
+
+rfbPixelFormat vnc_formats[] = {
+ /* bpp, depth,BE,TC, rmax, gmax, bmax, rsh, gsh, bsh */
+ {8, 8, 1, 0, 7, 7, 3, 0, 3, 6}
+ ,
+ {16, 16, 1, 1, 31, 63, 31, 0, 5, 10}
+ ,
+ {32, 24, 1, 1, 255, 255, 255, 0, 8, 16}
+ , //non-existant
+ {32, 32, 1, 1, 2047, 2047, 1023, 0, 11, 22}
+};
+
+rfbPixelFormat *
+vncNewFormat(int depth)
+{
+ return &(vnc_formats[(depth + 1) / 8 - 1]);
+}
+
+vncBuffer *
+vncNewBuffer(int w, int h, int depth)
+{
+ vncBuffer *b = (vncBuffer *) xmalloc(sizeof(vncBuffer));
+ b->format = vncNewFormat(depth);
+ b->data = (void *) xmalloc(w * h * (b->format->bitsPerPixel / 8));
+ b->owner = 1;
+ b->w = w;
+ b->h = h;
+ b->linew = w;
+ return b;
+}
+
+vncBuffer *
+vncDupBuffer(vncBuffer * b)
+{
+ vncBuffer *buf = vncNewBuffer(b->w, b->h, b->format->depth);
+ memcpy(buf->data, b->data, b->linew * b->h * b->format->bitsPerPixel / 8);
+ return buf;
+}
+
+void
+vncPrintStats()
+{
+ if (server && server->clientHead)
+ rfbPrintStats(server->clientHead);
+}
+
+/* blit */
+
+#define GETPIXEL(buf,x,y) \
+ (((uint8_t*)(buf->data))[(x)+((y)*buf->linew)])
+#define SETPIXEL(buf,x,y,p) \
+ (((uint8_t*)(buf->data))[(x)+((y)*buf->linew)] = (uint8_t)p)
+
+void
+vncCopyBlitFromNoEncode(rfbScreenInfoPtr s, int x, int y, int w, int h,
+ vncBuffer * src, int srcx, int srcy)
+{
+ int xx, yy;
+
+ vncHideCursor();
+
+ if (s->serverFormat.bitsPerPixel == src->format->bitsPerPixel
+ && srcx + w <= src->w && srcy + h <= src->h)
+ {
+ //simple copy
+ uint8_t *srcdata, *dstdata;
+ srcdata = src->data + (srcy * src->linew + srcx);
+ dstdata = s->frameBuffer + (y * s->paddedWidthInBytes + x);
+ for (yy = 0; yy < h; yy++)
+ {
+ memcpy(dstdata, srcdata, w);
+ dstdata += s->paddedWidthInBytes;
+ srcdata += src->linew;
+ }
+ }
+ else
+ {
+ // xsrc,ysrc provide tiling copy support.
+ for (yy = y; yy < y + h; yy++)
+ {
+ int ysrc = srcy + yy - y;
+ while (ysrc >= src->h)
+ ysrc -= src->h;
+ for (xx = x; xx < x + w; xx++)
+ {
+ vncPixel p;
+ int xsrc = srcx + xx - x;
+ while (xsrc >= src->linew)
+ xsrc -= src->linew;
+ p = GETPIXEL(src, xsrc, ysrc);
+ SETPIXEL(frameBuffer, xx, yy, p);
+ }
+ }
+ }
+}
+
+void
+vncCopyBlit(rfbScreenInfoPtr s, int x, int y, int w, int h, int srcx, int srcy)
+{
+ /* LibVNCServer already knows how to copy the data. */
+ rfbDoCopyRect(s, x, y, x + w, y + h, x - srcx, y - srcy);
+}
+
+void
+vncCopyBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer * src, int srcx, int srcy)
+{
+ vncCopyBlitFromNoEncode(s, x, y, w, h, src, srcx, srcy);
+ rfbMarkRectAsModified(s, x, y, x + w, y + h);
+}
+
+void
+vncTransBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
+ vncBuffer * src, int srcx, int srcy, int bg)
+{
+ int xx, yy;
+
+ vncHideCursor();
+
+ // xsrc,ysrc provide tiling copy support.
+ for (yy = y; yy < y + h; yy++)
+ {
+ int ysrc = srcy + yy - y;
+ while (ysrc >= src->h)
+ ysrc -= src->h;
+ for (xx = x; xx < x + w; xx++)
+ {
+ vncPixel p;
+ int xsrc = srcx + xx - x;
+ while (xsrc >= src->linew)
+ xsrc -= src->linew;
+ p = GETPIXEL(src, xsrc, ysrc);
+ // transparent blit!
+ if (p != bg)
+ SETPIXEL(frameBuffer, xx, yy, p);
+ }
+ }
+
+ rfbMarkRectAsModified(s, x, y, x + w, y + h);
+}
+
+void
+vncXorBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer * src, int srcx, int srcy)
+{
+ int xx, yy;
+
+ vncHideCursor();
+
+ // xsrc,ysrc provide tiling copy support.
+ for (yy = y; yy < y + h; yy++)
+ {
+ int ysrc = srcy + yy - y;
+ while (ysrc >= src->h)
+ ysrc -= src->h;
+ for (xx = x; xx < x + w; xx++)
+ {
+ vncPixel p, pp;
+ int xsrc = srcx + xx - x;
+ while (xsrc >= src->linew)
+ xsrc -= src->linew;
+ p = GETPIXEL(src, xsrc, ysrc);
+ pp = GETPIXEL(frameBuffer, xx, yy);
+ // xor blit!
+ SETPIXEL(frameBuffer, xx, yy, p ^ pp);
+ }
+ }
+
+ rfbMarkRectAsModified(s, x, y, x + w, y + h);
+}
+
+void
+vncAndBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer * src, int srcx, int srcy)
+{
+ int xx, yy;
+
+ vncHideCursor();
+
+ // xsrc,ysrc provide tiling copy support.
+ for (yy = y; yy < y + h; yy++)
+ {
+ int ysrc = srcy + yy - y;
+ while (ysrc >= src->h)
+ ysrc -= src->h;
+ for (xx = x; xx < x + w; xx++)
+ {
+ vncPixel p, pp;
+ int xsrc = srcx + xx - x;
+ while (xsrc >= src->linew)
+ xsrc -= src->linew;
+ p = GETPIXEL(src, xsrc, ysrc);
+ pp = GETPIXEL(frameBuffer, xx, yy);
+ // and blit!
+ SETPIXEL(frameBuffer, xx, yy, p & pp);
+ }
+ }
+
+ rfbMarkRectAsModified(s, x, y, x + w, y + h);
+}
+
+void
+vncDeleteBuffer(vncBuffer * b)
+{
+ if (b->owner)
+ xfree(b->data);
+ xfree(b);
+}
+
+/* cursor */
+rfbCursorPtr
+vncNewCursor(vncBuffer * mask, vncBuffer * pointer, int hotx, int hoty)
+{
+ int i, j, w = (mask->w + 7) / 8, mask_size = w * mask->h,
+ pointer_size = pointer->w * pointer->h;
+ rfbCursorPtr c = (rfbCursorPtr) xmalloc(sizeof(rfbCursor));
+
+ if (mask->w != pointer->w || mask->h != pointer->h)
+ error("ERROR! Mask is %dx%d, Pointer is %dx%d\n",
+ mask->w, mask->h, pointer->w, pointer->h);
+
+ c->xhot = hotx;
+ c->yhot = hoty;
+ c->width = mask->w;
+ c->height = mask->h;
+
+ c->mask = (char *) xmalloc(mask_size);
+ for (j = 0; j < c->height; j++)
+ for (i = 0; i < w; i++)
+ c->mask[j * w + i] =
+ reverseByte[((unsigned char *) mask->data)[(j) * w + i]];
+ vncDeleteBuffer(mask);
+
+ c->source = 0;
+ c->richSource = (char *) xmalloc(pointer_size);
+ memcpy(c->richSource, pointer->data, pointer_size);
+ vncDeleteBuffer(pointer);
+
+ return c;
+}
+
+/* No FreeCursor, because the cursors are buffered. We only get a "HANDLE" */
+void
+vncSetCursor(rfbScreenInfoPtr s, rfbCursorPtr c)
+{
+ rfbSetCursor(s, c, FALSE);
+}
+
+/* these functions work even if vncBuffer's pixel format is not 1 byte/pixel */
+vncPixel
+vncGetPixel(vncBuffer * b, int x, int y)
+{
+ unsigned long offset = (x + (y * (b->linew))) * (b->format->bitsPerPixel >> 3);
+ return ((uint8_t *) (b->data))[offset];
+}
+
+void
+vncSetPixel(vncBuffer * b, int x, int y, vncPixel c)
+{
+ unsigned long offset = (x + (y * (b->linew))) * (b->format->bitsPerPixel >> 3);
+ ((uint8_t *) (b->data))[offset] = c;
+}
+
+void
+vncSetRect(rfbScreenInfoPtr s, int x, int y, int w, int h, vncPixel c)
+{
+ int xx, yy;
+
+ if (x + w > s->width)
+ w = s->width - x;
+ if (y + h > s->height)
+ h = s->height - y;
+ if (w <= 0 || h <= 0)
+ return;
+
+ vncHideCursor();
+
+ // - Fill the rect in the local framebuffer
+ if (s->serverFormat.bitsPerPixel == 8)
+ {
+ // - Simple 8-bit fill
+ uint8_t *dstdata;
+ dstdata = s->frameBuffer + (y * s->paddedWidthInBytes + x);
+ for (yy = 0; yy < h; yy++)
+ {
+ memset(dstdata, c, w);
+ dstdata += s->paddedWidthInBytes;
+ }
+ }
+ else
+ {
+ for (yy = y; yy < y + h; yy++)
+ {
+ for (xx = x; xx < x + w; xx++)
+ {
+ SETPIXEL(frameBuffer, xx, yy, c);
+ }
+ }
+ }
+
+ rfbMarkRectAsModified(s, x, y, x + w, y + h);
+}
+
+vncBuffer *
+vncGetRect(rfbScreenInfoPtr s, int x, int y, int w, int h)
+{
+ int xx, yy;
+ vncBuffer *b = vncNewBuffer(w, h, s->serverFormat.depth);
+
+ vncHideCursor();
+
+ if (s->serverFormat.bitsPerPixel == 8)
+ {
+ //simple copy
+ int srcstep, dststep;
+ char *srcdata, *dstdata;
+ srcstep = s->paddedWidthInBytes * s->serverFormat.bitsPerPixel / 8;
+ dststep = w * s->serverFormat.bitsPerPixel / 8;
+ dstdata = b->data;
+ srcdata = s->frameBuffer + (y * srcstep + x * s->serverFormat.bitsPerPixel / 8);
+ for (yy = 0; yy < h; yy++)
+ {
+ memcpy(dstdata, srcdata, dststep);
+ dstdata += dststep;
+ srcdata += srcstep;
+ }
+ }
+ else
+ {
+ for (yy = y; yy < y + h; yy++)
+ {
+ for (xx = x; xx < x + w; xx++)
+ {
+ SETPIXEL(b, xx - x, yy - y, GETPIXEL(frameBuffer, xx, yy));
+ }
+ }
+ }
+
+ return b;
+}
+
+/* colourmap */
+
+rfbColourMap *
+vncNewColourMap(rfbScreenInfoPtr s, int n)
+{
+ rfbColourMap *m = (rfbColourMap *) xmalloc(sizeof(rfbColourMap));
+ m->is16 = FALSE;
+ m->count = n;
+ m->data.bytes = (uint8_t *) xmalloc(n * 3);
+ return m;
+}
+
+void
+vncSetColourMapEntry(rfbColourMap * m, int i, vncPixel r, vncPixel g, vncPixel b)
+{
+ if (i < m->count)
+ {
+ m->data.bytes[3 * i + 0] = r;
+ m->data.bytes[3 * i + 1] = g;
+ m->data.bytes[3 * i + 2] = b;
+ }
+}
+
+void
+vncDeleteColourMap(rfbColourMap * m)
+{
+ if (m->data.bytes)
+ free(m->data.bytes);
+ m->count = 0;
+}
+
+void
+vncSetColourMap(rfbScreenInfoPtr s, rfbColourMap * m)
+{
+ vncDeleteColourMap(&s->colourMap);
+ s->colourMap = *m;
+ rfbSetClientColourMaps(s, 0, 0);
+}
+
+void
+ui_begin_update()
+{
+}
+
+void
+ui_end_update()
+{
+}
+
+void
+ui_resize_window()
+{
+ rfbClientIteratorPtr iter;
+ rfbClientPtr cl;
+
+ server->width = g_width;
+ server->height = g_height;
+ server->frameBuffer = (char *) realloc(server->frameBuffer, g_width * g_height);
+ server->paddedWidthInBytes = g_width;
+
+ iter = rfbGetClientIterator(server);
+ while ((cl = rfbClientIteratorNext(iter)))
+ if (cl->useNewFBSize)
+ cl->newFBSizePending = TRUE;
+ else
+ rfbLog("Warning: Client %s does not support NewFBSize!\n ", cl->host);
+ rfbReleaseClientIterator(iter);
+}
--- /dev/null
+#ifndef VNC_H
+#define VNC_H
+
+#define BOOL rfb_BOOL
+#include <rfb/rfb.h>
+#undef BOOL
+
+typedef unsigned int vncPixel;
+
+typedef struct
+{
+ uint16_t w, h;
+ uint16_t linew;
+ rfbPixelFormat *format;
+ char *data;
+ BOOL owner;
+}
+vncBuffer;
+
+extern int vncPreparedClientSocket;
+extern int vncPreparedServerSocket;
+
+/* - Buffer management */
+extern vncBuffer *vncNewBuffer(int w, int h, int depth);
+extern vncBuffer *vncDupBuffer(vncBuffer * b);
+extern void vncDeleteBuffer(vncBuffer * b);
+
+/* - Colourmaps */
+typedef struct
+{
+ uint8_t r, g, b;
+}
+vncColour;
+
+extern void vncSetColourMap(rfbScreenInfoPtr s, rfbColourMap * m);
+extern rfbColourMap *vncNewColourMap(rfbScreenInfoPtr s, int n);
+extern void vncSetColourMapEntry(rfbColourMap * m, int i, vncPixel r, vncPixel g, vncPixel b);
+extern void vncDeleteColourMap(rfbColourMap * m);
+
+/* - Simple pixel manipulation */
+extern vncPixel vncGetPixel(vncBuffer * b, int x, int y);
+extern void vncSetPixel(vncBuffer * b, int x, int y, vncPixel c);
+
+/* - Drawing primitives */
+extern void vncSetRect(rfbScreenInfoPtr s, int x, int y, int w, int h, vncPixel c);
+extern void vncCopyBlit(rfbScreenInfoPtr s, int x, int y, int w, int h, int srcx, int srcy);
+extern void vncCopyBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
+ vncBuffer * b, int srcx, int srcy);
+extern void vncTransBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
+ vncBuffer * b, int srcx, int srcy, int bg);
+extern void vncXorBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
+ vncBuffer * b, int srcx, int srcy);
+extern void vncAndBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
+ vncBuffer * b, int srcx, int srcy);
+extern vncBuffer *vncGetRect(rfbScreenInfoPtr s, int x, int y, int w, int h);
+
+// - Low level VNC update primitives upon which the rest are based
+extern void vncQueueCopyRect(rfbScreenInfoPtr s, int x, int y, int w, int h, int src_x, int src_y);
+extern void vncQueueUpdate(rfbScreenInfoPtr s, int x, int y, int w, int h);
+
+/* cursor */
+extern rfbCursorPtr vncNewCursor(vncBuffer * mask, vncBuffer * pointer, int hotx, int hoty);
+extern void vncSetCursor(rfbScreenInfoPtr s, rfbCursorPtr c);
+
+int vncListenAtTcpAddr(unsigned short port);
+void vncPrintStats();
+
+#endif
--- /dev/null
+/*
+
+This file fakes some of X11's key handling for the special purpose of running
+a standalone rdp2vnc (without linking to X11)
+
+*/
+
+#include "x11stubs.h"
+#include <string.h>
+
+/* ignored */
+int *display;
+
+typedef struct
+{
+ const char *string;
+ KeySym keysym;
+}
+StringToKeysym_t;
+
+StringToKeysym_t StringToKeysym[] = {
+#ifndef KEYSYMFAKE_H
+ {"VoidSymbol", XK_VoidSymbol},
+#ifdef XK_MISCELLANY
+ {"BackSpace", XK_BackSpace},
+ {"Tab", XK_Tab},
+ {"Linefeed", XK_Linefeed},
+ {"Clear", XK_Clear},
+ {"Return", XK_Return},
+ {"Pause", XK_Pause},
+ {"Scroll_Lock", XK_Scroll_Lock},
+ {"Sys_Req", XK_Sys_Req},
+ {"Escape", XK_Escape},
+ {"Delete", XK_Delete},
+ {"Multi_key", XK_Multi_key},
+ {"SingleCandidate", XK_SingleCandidate},
+ {"MultipleCandidate", XK_MultipleCandidate},
+ {"PreviousCandidate", XK_PreviousCandidate},
+ {"Kanji", XK_Kanji},
+ {"Muhenkan", XK_Muhenkan},
+ {"Henkan_Mode", XK_Henkan_Mode},
+ {"Henkan", XK_Henkan},
+ {"Romaji", XK_Romaji},
+ {"Hiragana", XK_Hiragana},
+ {"Katakana", XK_Katakana},
+ {"Hiragana_Katakana", XK_Hiragana_Katakana},
+ {"Zenkaku", XK_Zenkaku},
+ {"Hankaku", XK_Hankaku},
+ {"Zenkaku_Hankaku", XK_Zenkaku_Hankaku},
+ {"Touroku", XK_Touroku},
+ {"Massyo", XK_Massyo},
+ {"Kana_Lock", XK_Kana_Lock},
+ {"Kana_Shift", XK_Kana_Shift},
+ {"Eisu_Shift", XK_Eisu_Shift},
+ {"Eisu_toggle", XK_Eisu_toggle},
+ {"Zen_Koho", XK_Zen_Koho},
+ {"Mae_Koho", XK_Mae_Koho},
+ {"Home", XK_Home},
+ {"Left", XK_Left},
+ {"Up", XK_Up},
+ {"Right", XK_Right},
+ {"Down", XK_Down},
+ {"Prior", XK_Prior},
+ {"Page_Up", XK_Page_Up},
+ {"Next", XK_Next},
+ {"Page_Down", XK_Page_Down},
+ {"End", XK_End},
+ {"Begin", XK_Begin},
+ {"Select", XK_Select},
+ {"Print", XK_Print},
+ {"Execute", XK_Execute},
+ {"Insert", XK_Insert},
+ {"Undo", XK_Undo},
+ {"Redo", XK_Redo},
+ {"Menu", XK_Menu},
+ {"Find", XK_Find},
+ {"Cancel", XK_Cancel},
+ {"Help", XK_Help},
+ {"Break", XK_Break},
+ {"Mode_switch", XK_Mode_switch},
+ {"script_switch", XK_script_switch},
+ {"Num_Lock", XK_Num_Lock},
+ {"KP_Space", XK_KP_Space},
+ {"KP_Tab", XK_KP_Tab},
+ {"KP_Enter", XK_KP_Enter},
+ {"KP_F1", XK_KP_F1},
+ {"KP_F2", XK_KP_F2},
+ {"KP_F3", XK_KP_F3},
+ {"KP_F4", XK_KP_F4},
+ {"KP_Home", XK_KP_Home},
+ {"KP_Left", XK_KP_Left},
+ {"KP_Up", XK_KP_Up},
+ {"KP_Right", XK_KP_Right},
+ {"KP_Down", XK_KP_Down},
+ {"KP_Prior", XK_KP_Prior},
+ {"KP_Page_Up", XK_KP_Page_Up},
+ {"KP_Next", XK_KP_Next},
+ {"KP_Page_Down", XK_KP_Page_Down},
+ {"KP_End", XK_KP_End},
+ {"KP_Begin", XK_KP_Begin},
+ {"KP_Insert", XK_KP_Insert},
+ {"KP_Delete", XK_KP_Delete},
+ {"KP_Equal", XK_KP_Equal},
+ {"KP_Multiply", XK_KP_Multiply},
+ {"KP_Add", XK_KP_Add},
+ {"KP_Separator", XK_KP_Separator},
+ {"KP_Subtract", XK_KP_Subtract},
+ {"KP_Decimal", XK_KP_Decimal},
+ {"KP_Divide", XK_KP_Divide},
+ {"KP_0", XK_KP_0},
+ {"KP_1", XK_KP_1},
+ {"KP_2", XK_KP_2},
+ {"KP_3", XK_KP_3},
+ {"KP_4", XK_KP_4},
+ {"KP_5", XK_KP_5},
+ {"KP_6", XK_KP_6},
+ {"KP_7", XK_KP_7},
+ {"KP_8", XK_KP_8},
+ {"KP_9", XK_KP_9},
+ {"F1", XK_F1},
+ {"F2", XK_F2},
+ {"F3", XK_F3},
+ {"F4", XK_F4},
+ {"F5", XK_F5},
+ {"F6", XK_F6},
+ {"F7", XK_F7},
+ {"F8", XK_F8},
+ {"F9", XK_F9},
+ {"F10", XK_F10},
+ {"F11", XK_F11},
+ {"L1", XK_L1},
+ {"F12", XK_F12},
+ {"L2", XK_L2},
+ {"F13", XK_F13},
+ {"L3", XK_L3},
+ {"F14", XK_F14},
+ {"L4", XK_L4},
+ {"F15", XK_F15},
+ {"L5", XK_L5},
+ {"F16", XK_F16},
+ {"L6", XK_L6},
+ {"F17", XK_F17},
+ {"L7", XK_L7},
+ {"F18", XK_F18},
+ {"L8", XK_L8},
+ {"F19", XK_F19},
+ {"L9", XK_L9},
+ {"F20", XK_F20},
+ {"L10", XK_L10},
+ {"F21", XK_F21},
+ {"R1", XK_R1},
+ {"F22", XK_F22},
+ {"R2", XK_R2},
+ {"F23", XK_F23},
+ {"R3", XK_R3},
+ {"F24", XK_F24},
+ {"R4", XK_R4},
+ {"F25", XK_F25},
+ {"R5", XK_R5},
+ {"F26", XK_F26},
+ {"R6", XK_R6},
+ {"F27", XK_F27},
+ {"R7", XK_R7},
+ {"F28", XK_F28},
+ {"R8", XK_R8},
+ {"F29", XK_F29},
+ {"R9", XK_R9},
+ {"F30", XK_F30},
+ {"R10", XK_R10},
+ {"F31", XK_F31},
+ {"R11", XK_R11},
+ {"F32", XK_F32},
+ {"R12", XK_R12},
+ {"F33", XK_F33},
+ {"R13", XK_R13},
+ {"F34", XK_F34},
+ {"R14", XK_R14},
+ {"F35", XK_F35},
+ {"R15", XK_R15},
+ {"Shift_L", XK_Shift_L},
+ {"Shift_R", XK_Shift_R},
+ {"Control_L", XK_Control_L},
+ {"Control_R", XK_Control_R},
+ {"Caps_Lock", XK_Caps_Lock},
+ {"Shift_Lock", XK_Shift_Lock},
+ {"Meta_L", XK_Meta_L},
+ {"Meta_R", XK_Meta_R},
+ {"Alt_L", XK_Alt_L},
+ {"Alt_R", XK_Alt_R},
+ {"Super_L", XK_Super_L},
+ {"Super_R", XK_Super_R},
+ {"Hyper_L", XK_Hyper_L},
+ {"Hyper_R", XK_Hyper_R},
+#endif /* XK_MISCELLANY */
+#ifdef XK_XKB_KEYS
+ {"ISO_Lock", XK_ISO_Lock},
+ {"ISO_Level2_Latch", XK_ISO_Level2_Latch},
+ {"ISO_Level3_Shift", XK_ISO_Level3_Shift},
+ {"ISO_Level3_Latch", XK_ISO_Level3_Latch},
+ {"ISO_Level3_Lock", XK_ISO_Level3_Lock},
+ {"ISO_Group_Shift", XK_ISO_Group_Shift},
+ {"ISO_Group_Latch", XK_ISO_Group_Latch},
+ {"ISO_Group_Lock", XK_ISO_Group_Lock},
+ {"ISO_Next_Group", XK_ISO_Next_Group},
+ {"ISO_Next_Group_Lock", XK_ISO_Next_Group_Lock},
+ {"ISO_Prev_Group", XK_ISO_Prev_Group},
+ {"ISO_Prev_Group_Lock", XK_ISO_Prev_Group_Lock},
+ {"ISO_First_Group", XK_ISO_First_Group},
+ {"ISO_First_Group_Lock", XK_ISO_First_Group_Lock},
+ {"ISO_Last_Group", XK_ISO_Last_Group},
+ {"ISO_Last_Group_Lock", XK_ISO_Last_Group_Lock},
+ {"ISO_Left_Tab", XK_ISO_Left_Tab},
+ {"ISO_Move_Line_Up", XK_ISO_Move_Line_Up},
+ {"ISO_Move_Line_Down", XK_ISO_Move_Line_Down},
+ {"ISO_Partial_Line_Up", XK_ISO_Partial_Line_Up},
+ {"ISO_Partial_Line_Down", XK_ISO_Partial_Line_Down},
+ {"ISO_Partial_Space_Left", XK_ISO_Partial_Space_Left},
+ {"ISO_Partial_Space_Right", XK_ISO_Partial_Space_Right},
+ {"ISO_Set_Margin_Left", XK_ISO_Set_Margin_Left},
+ {"ISO_Set_Margin_Right", XK_ISO_Set_Margin_Right},
+ {"ISO_Release_Margin_Left", XK_ISO_Release_Margin_Left},
+ {"ISO_Release_Margin_Right", XK_ISO_Release_Margin_Right},
+ {"ISO_Release_Both_Margins", XK_ISO_Release_Both_Margins},
+ {"ISO_Fast_Cursor_Left", XK_ISO_Fast_Cursor_Left},
+ {"ISO_Fast_Cursor_Right", XK_ISO_Fast_Cursor_Right},
+ {"ISO_Fast_Cursor_Up", XK_ISO_Fast_Cursor_Up},
+ {"ISO_Fast_Cursor_Down", XK_ISO_Fast_Cursor_Down},
+ {"ISO_Continuous_Underline", XK_ISO_Continuous_Underline},
+ {"ISO_Discontinuous_Underline", XK_ISO_Discontinuous_Underline},
+ {"ISO_Emphasize", XK_ISO_Emphasize},
+ {"ISO_Center_Object", XK_ISO_Center_Object},
+ {"ISO_Enter", XK_ISO_Enter},
+ {"dead_grave", XK_dead_grave},
+ {"dead_acute", XK_dead_acute},
+ {"dead_circumflex", XK_dead_circumflex},
+ {"dead_tilde", XK_dead_tilde},
+ {"dead_macron", XK_dead_macron},
+ {"dead_breve", XK_dead_breve},
+ {"dead_abovedot", XK_dead_abovedot},
+ {"dead_diaeresis", XK_dead_diaeresis},
+ {"dead_abovering", XK_dead_abovering},
+ {"dead_doubleacute", XK_dead_doubleacute},
+ {"dead_caron", XK_dead_caron},
+ {"dead_cedilla", XK_dead_cedilla},
+ {"dead_ogonek", XK_dead_ogonek},
+ {"dead_iota", XK_dead_iota},
+ {"dead_voiced_sound", XK_dead_voiced_sound},
+ {"dead_semivoiced_sound", XK_dead_semivoiced_sound},
+ {"dead_belowdot", XK_dead_belowdot},
+ {"First_Virtual_Screen", XK_First_Virtual_Screen},
+ {"Prev_Virtual_Screen", XK_Prev_Virtual_Screen},
+ {"Next_Virtual_Screen", XK_Next_Virtual_Screen},
+ {"Last_Virtual_Screen", XK_Last_Virtual_Screen},
+ {"Terminate_Server", XK_Terminate_Server},
+ {"AccessX_Enable", XK_AccessX_Enable},
+ {"AccessX_Feedback_Enable", XK_AccessX_Feedback_Enable},
+ {"RepeatKeys_Enable", XK_RepeatKeys_Enable},
+ {"SlowKeys_Enable", XK_SlowKeys_Enable},
+ {"BounceKeys_Enable", XK_BounceKeys_Enable},
+ {"StickyKeys_Enable", XK_StickyKeys_Enable},
+ {"MouseKeys_Enable", XK_MouseKeys_Enable},
+ {"MouseKeys_Accel_Enable", XK_MouseKeys_Accel_Enable},
+ {"Overlay1_Enable", XK_Overlay1_Enable},
+ {"Overlay2_Enable", XK_Overlay2_Enable},
+ {"AudibleBell_Enable", XK_AudibleBell_Enable},
+ {"Pointer_Left", XK_Pointer_Left},
+ {"Pointer_Right", XK_Pointer_Right},
+ {"Pointer_Up", XK_Pointer_Up},
+ {"Pointer_Down", XK_Pointer_Down},
+ {"Pointer_UpLeft", XK_Pointer_UpLeft},
+ {"Pointer_UpRight", XK_Pointer_UpRight},
+ {"Pointer_DownLeft", XK_Pointer_DownLeft},
+ {"Pointer_DownRight", XK_Pointer_DownRight},
+ {"Pointer_Button_Dflt", XK_Pointer_Button_Dflt},
+ {"Pointer_Button1", XK_Pointer_Button1},
+ {"Pointer_Button2", XK_Pointer_Button2},
+ {"Pointer_Button3", XK_Pointer_Button3},
+ {"Pointer_Button4", XK_Pointer_Button4},
+ {"Pointer_Button5", XK_Pointer_Button5},
+ {"Pointer_DblClick_Dflt", XK_Pointer_DblClick_Dflt},
+ {"Pointer_DblClick1", XK_Pointer_DblClick1},
+ {"Pointer_DblClick2", XK_Pointer_DblClick2},
+ {"Pointer_DblClick3", XK_Pointer_DblClick3},
+ {"Pointer_DblClick4", XK_Pointer_DblClick4},
+ {"Pointer_DblClick5", XK_Pointer_DblClick5},
+ {"Pointer_Drag_Dflt", XK_Pointer_Drag_Dflt},
+ {"Pointer_Drag1", XK_Pointer_Drag1},
+ {"Pointer_Drag2", XK_Pointer_Drag2},
+ {"Pointer_Drag3", XK_Pointer_Drag3},
+ {"Pointer_Drag4", XK_Pointer_Drag4},
+ {"Pointer_Drag5", XK_Pointer_Drag5},
+ {"Pointer_EnableKeys", XK_Pointer_EnableKeys},
+ {"Pointer_Accelerate", XK_Pointer_Accelerate},
+ {"Pointer_DfltBtnNext", XK_Pointer_DfltBtnNext},
+ {"Pointer_DfltBtnPrev", XK_Pointer_DfltBtnPrev},
+#endif
+#ifdef XK_3270
+ {"3270_Duplicate", XK_3270_Duplicate},
+ {"3270_FieldMark", XK_3270_FieldMark},
+ {"3270_Right2", XK_3270_Right2},
+ {"3270_Left2", XK_3270_Left2},
+ {"3270_BackTab", XK_3270_BackTab},
+ {"3270_EraseEOF", XK_3270_EraseEOF},
+ {"3270_EraseInput", XK_3270_EraseInput},
+ {"3270_Reset", XK_3270_Reset},
+ {"3270_Quit", XK_3270_Quit},
+ {"3270_PA1", XK_3270_PA1},
+ {"3270_PA2", XK_3270_PA2},
+ {"3270_PA3", XK_3270_PA3},
+ {"3270_Test", XK_3270_Test},
+ {"3270_Attn", XK_3270_Attn},
+ {"3270_CursorBlink", XK_3270_CursorBlink},
+ {"3270_AltCursor", XK_3270_AltCursor},
+ {"3270_KeyClick", XK_3270_KeyClick},
+ {"3270_Jump", XK_3270_Jump},
+ {"3270_Ident", XK_3270_Ident},
+ {"3270_Rule", XK_3270_Rule},
+ {"3270_Copy", XK_3270_Copy},
+ {"3270_Play", XK_3270_Play},
+ {"3270_Setup", XK_3270_Setup},
+ {"3270_Record", XK_3270_Record},
+ {"3270_ChangeScreen", XK_3270_ChangeScreen},
+ {"3270_DeleteWord", XK_3270_DeleteWord},
+ {"3270_ExSelect", XK_3270_ExSelect},
+ {"3270_CursorSelect", XK_3270_CursorSelect},
+ {"3270_PrintScreen", XK_3270_PrintScreen},
+ {"3270_Enter", XK_3270_Enter},
+#endif
+#ifdef XK_LATIN1
+ {"space", XK_space},
+ {"exclam", XK_exclam},
+ {"quotedbl", XK_quotedbl},
+ {"numbersign", XK_numbersign},
+ {"dollar", XK_dollar},
+ {"percent", XK_percent},
+ {"ampersand", XK_ampersand},
+ {"apostrophe", XK_apostrophe},
+ {"quoteright", XK_quoteright},
+ {"parenleft", XK_parenleft},
+ {"parenright", XK_parenright},
+ {"asterisk", XK_asterisk},
+ {"plus", XK_plus},
+ {"comma", XK_comma},
+ {"minus", XK_minus},
+ {"period", XK_period},
+ {"slash", XK_slash},
+ {"0", XK_0},
+ {"1", XK_1},
+ {"2", XK_2},
+ {"3", XK_3},
+ {"4", XK_4},
+ {"5", XK_5},
+ {"6", XK_6},
+ {"7", XK_7},
+ {"8", XK_8},
+ {"9", XK_9},
+ {"colon", XK_colon},
+ {"semicolon", XK_semicolon},
+ {"less", XK_less},
+ {"equal", XK_equal},
+ {"greater", XK_greater},
+ {"question", XK_question},
+ {"at", XK_at},
+ {"A", XK_A},
+ {"B", XK_B},
+ {"C", XK_C},
+ {"D", XK_D},
+ {"E", XK_E},
+ {"F", XK_F},
+ {"G", XK_G},
+ {"H", XK_H},
+ {"I", XK_I},
+ {"J", XK_J},
+ {"K", XK_K},
+ {"L", XK_L},
+ {"M", XK_M},
+ {"N", XK_N},
+ {"O", XK_O},
+ {"P", XK_P},
+ {"Q", XK_Q},
+ {"R", XK_R},
+ {"S", XK_S},
+ {"T", XK_T},
+ {"U", XK_U},
+ {"V", XK_V},
+ {"W", XK_W},
+ {"X", XK_X},
+ {"Y", XK_Y},
+ {"Z", XK_Z},
+ {"bracketleft", XK_bracketleft},
+ {"backslash", XK_backslash},
+ {"bracketright", XK_bracketright},
+ {"asciicircum", XK_asciicircum},
+ {"underscore", XK_underscore},
+ {"grave", XK_grave},
+ {"quoteleft", XK_quoteleft},
+ {"a", XK_a},
+ {"b", XK_b},
+ {"c", XK_c},
+ {"d", XK_d},
+ {"e", XK_e},
+ {"f", XK_f},
+ {"g", XK_g},
+ {"h", XK_h},
+ {"i", XK_i},
+ {"j", XK_j},
+ {"k", XK_k},
+ {"l", XK_l},
+ {"m", XK_m},
+ {"n", XK_n},
+ {"o", XK_o},
+ {"p", XK_p},
+ {"q", XK_q},
+ {"r", XK_r},
+ {"s", XK_s},
+ {"t", XK_t},
+ {"u", XK_u},
+ {"v", XK_v},
+ {"w", XK_w},
+ {"x", XK_x},
+ {"y", XK_y},
+ {"z", XK_z},
+ {"braceleft", XK_braceleft},
+ {"bar", XK_bar},
+ {"braceright", XK_braceright},
+ {"asciitilde", XK_asciitilde},
+ {"nobreakspace", XK_nobreakspace},
+ {"exclamdown", XK_exclamdown},
+ {"cent", XK_cent},
+ {"sterling", XK_sterling},
+ {"currency", XK_currency},
+ {"yen", XK_yen},
+ {"brokenbar", XK_brokenbar},
+ {"section", XK_section},
+ {"diaeresis", XK_diaeresis},
+ {"copyright", XK_copyright},
+ {"ordfeminine", XK_ordfeminine},
+ {"guillemotleft", XK_guillemotleft},
+ {"notsign", XK_notsign},
+ {"hyphen", XK_hyphen},
+ {"registered", XK_registered},
+ {"macron", XK_macron},
+ {"degree", XK_degree},
+ {"plusminus", XK_plusminus},
+ {"twosuperior", XK_twosuperior},
+ {"threesuperior", XK_threesuperior},
+ {"acute", XK_acute},
+ {"mu", XK_mu},
+ {"paragraph", XK_paragraph},
+ {"periodcentered", XK_periodcentered},
+ {"cedilla", XK_cedilla},
+ {"onesuperior", XK_onesuperior},
+ {"masculine", XK_masculine},
+ {"guillemotright", XK_guillemotright},
+ {"onequarter", XK_onequarter},
+ {"onehalf", XK_onehalf},
+ {"threequarters", XK_threequarters},
+ {"questiondown", XK_questiondown},
+ {"Agrave", XK_Agrave},
+ {"Aacute", XK_Aacute},
+ {"Acircumflex", XK_Acircumflex},
+ {"Atilde", XK_Atilde},
+ {"Adiaeresis", XK_Adiaeresis},
+ {"Aring", XK_Aring},
+ {"AE", XK_AE},
+ {"Ccedilla", XK_Ccedilla},
+ {"Egrave", XK_Egrave},
+ {"Eacute", XK_Eacute},
+ {"Ecircumflex", XK_Ecircumflex},
+ {"Ediaeresis", XK_Ediaeresis},
+ {"Igrave", XK_Igrave},
+ {"Iacute", XK_Iacute},
+ {"Icircumflex", XK_Icircumflex},
+ {"Idiaeresis", XK_Idiaeresis},
+ {"ETH", XK_ETH},
+ {"Eth", XK_Eth},
+ {"Ntilde", XK_Ntilde},
+ {"Ograve", XK_Ograve},
+ {"Oacute", XK_Oacute},
+ {"Ocircumflex", XK_Ocircumflex},
+ {"Otilde", XK_Otilde},
+ {"Odiaeresis", XK_Odiaeresis},
+ {"multiply", XK_multiply},
+ {"Ooblique", XK_Ooblique},
+ {"Ugrave", XK_Ugrave},
+ {"Uacute", XK_Uacute},
+ {"Ucircumflex", XK_Ucircumflex},
+ {"Udiaeresis", XK_Udiaeresis},
+ {"Yacute", XK_Yacute},
+ {"THORN", XK_THORN},
+ {"Thorn", XK_Thorn},
+ {"ssharp", XK_ssharp},
+ {"agrave", XK_agrave},
+ {"aacute", XK_aacute},
+ {"acircumflex", XK_acircumflex},
+ {"atilde", XK_atilde},
+ {"adiaeresis", XK_adiaeresis},
+ {"aring", XK_aring},
+ {"ae", XK_ae},
+ {"ccedilla", XK_ccedilla},
+ {"egrave", XK_egrave},
+ {"eacute", XK_eacute},
+ {"ecircumflex", XK_ecircumflex},
+ {"ediaeresis", XK_ediaeresis},
+ {"igrave", XK_igrave},
+ {"iacute", XK_iacute},
+ {"icircumflex", XK_icircumflex},
+ {"idiaeresis", XK_idiaeresis},
+ {"eth", XK_eth},
+ {"ntilde", XK_ntilde},
+ {"ograve", XK_ograve},
+ {"oacute", XK_oacute},
+ {"ocircumflex", XK_ocircumflex},
+ {"otilde", XK_otilde},
+ {"odiaeresis", XK_odiaeresis},
+ {"division", XK_division},
+ {"oslash", XK_oslash},
+ {"ugrave", XK_ugrave},
+ {"uacute", XK_uacute},
+ {"ucircumflex", XK_ucircumflex},
+ {"udiaeresis", XK_udiaeresis},
+ {"yacute", XK_yacute},
+ {"thorn", XK_thorn},
+ {"ydiaeresis", XK_ydiaeresis},
+#endif /* XK_LATIN1 */
+#ifdef XK_LATIN2
+ {"Aogonek", XK_Aogonek},
+ {"breve", XK_breve},
+ {"Lstroke", XK_Lstroke},
+ {"Lcaron", XK_Lcaron},
+ {"Sacute", XK_Sacute},
+ {"Scaron", XK_Scaron},
+ {"Scedilla", XK_Scedilla},
+ {"Tcaron", XK_Tcaron},
+ {"Zacute", XK_Zacute},
+ {"Zcaron", XK_Zcaron},
+ {"Zabovedot", XK_Zabovedot},
+ {"aogonek", XK_aogonek},
+ {"ogonek", XK_ogonek},
+ {"lstroke", XK_lstroke},
+ {"lcaron", XK_lcaron},
+ {"sacute", XK_sacute},
+ {"caron", XK_caron},
+ {"scaron", XK_scaron},
+ {"scedilla", XK_scedilla},
+ {"tcaron", XK_tcaron},
+ {"zacute", XK_zacute},
+ {"doubleacute", XK_doubleacute},
+ {"zcaron", XK_zcaron},
+ {"zabovedot", XK_zabovedot},
+ {"Racute", XK_Racute},
+ {"Abreve", XK_Abreve},
+ {"Lacute", XK_Lacute},
+ {"Cacute", XK_Cacute},
+ {"Ccaron", XK_Ccaron},
+ {"Eogonek", XK_Eogonek},
+ {"Ecaron", XK_Ecaron},
+ {"Dcaron", XK_Dcaron},
+ {"Dstroke", XK_Dstroke},
+ {"Nacute", XK_Nacute},
+ {"Ncaron", XK_Ncaron},
+ {"Odoubleacute", XK_Odoubleacute},
+ {"Rcaron", XK_Rcaron},
+ {"Uring", XK_Uring},
+ {"Udoubleacute", XK_Udoubleacute},
+ {"Tcedilla", XK_Tcedilla},
+ {"racute", XK_racute},
+ {"abreve", XK_abreve},
+ {"lacute", XK_lacute},
+ {"cacute", XK_cacute},
+ {"ccaron", XK_ccaron},
+ {"eogonek", XK_eogonek},
+ {"ecaron", XK_ecaron},
+ {"dcaron", XK_dcaron},
+ {"dstroke", XK_dstroke},
+ {"nacute", XK_nacute},
+ {"ncaron", XK_ncaron},
+ {"odoubleacute", XK_odoubleacute},
+ {"udoubleacute", XK_udoubleacute},
+ {"rcaron", XK_rcaron},
+ {"uring", XK_uring},
+ {"tcedilla", XK_tcedilla},
+ {"abovedot", XK_abovedot},
+#endif /* XK_LATIN2 */
+#ifdef XK_LATIN3
+ {"Hstroke", XK_Hstroke},
+ {"Hcircumflex", XK_Hcircumflex},
+ {"Iabovedot", XK_Iabovedot},
+ {"Gbreve", XK_Gbreve},
+ {"Jcircumflex", XK_Jcircumflex},
+ {"hstroke", XK_hstroke},
+ {"hcircumflex", XK_hcircumflex},
+ {"idotless", XK_idotless},
+ {"gbreve", XK_gbreve},
+ {"jcircumflex", XK_jcircumflex},
+ {"Cabovedot", XK_Cabovedot},
+ {"Ccircumflex", XK_Ccircumflex},
+ {"Gabovedot", XK_Gabovedot},
+ {"Gcircumflex", XK_Gcircumflex},
+ {"Ubreve", XK_Ubreve},
+ {"Scircumflex", XK_Scircumflex},
+ {"cabovedot", XK_cabovedot},
+ {"ccircumflex", XK_ccircumflex},
+ {"gabovedot", XK_gabovedot},
+ {"gcircumflex", XK_gcircumflex},
+ {"ubreve", XK_ubreve},
+ {"scircumflex", XK_scircumflex},
+#endif /* XK_LATIN3 */
+#ifdef XK_LATIN4
+ {"kra", XK_kra},
+ {"kappa", XK_kappa},
+ {"Rcedilla", XK_Rcedilla},
+ {"Itilde", XK_Itilde},
+ {"Lcedilla", XK_Lcedilla},
+ {"Emacron", XK_Emacron},
+ {"Gcedilla", XK_Gcedilla},
+ {"Tslash", XK_Tslash},
+ {"rcedilla", XK_rcedilla},
+ {"itilde", XK_itilde},
+ {"lcedilla", XK_lcedilla},
+ {"emacron", XK_emacron},
+ {"gcedilla", XK_gcedilla},
+ {"tslash", XK_tslash},
+ {"ENG", XK_ENG},
+ {"eng", XK_eng},
+ {"Amacron", XK_Amacron},
+ {"Iogonek", XK_Iogonek},
+ {"Eabovedot", XK_Eabovedot},
+ {"Imacron", XK_Imacron},
+ {"Ncedilla", XK_Ncedilla},
+ {"Omacron", XK_Omacron},
+ {"Kcedilla", XK_Kcedilla},
+ {"Uogonek", XK_Uogonek},
+ {"Utilde", XK_Utilde},
+ {"Umacron", XK_Umacron},
+ {"amacron", XK_amacron},
+ {"iogonek", XK_iogonek},
+ {"eabovedot", XK_eabovedot},
+ {"imacron", XK_imacron},
+ {"ncedilla", XK_ncedilla},
+ {"omacron", XK_omacron},
+ {"kcedilla", XK_kcedilla},
+ {"uogonek", XK_uogonek},
+ {"utilde", XK_utilde},
+ {"umacron", XK_umacron},
+#endif /* XK_LATIN4 */
+#ifdef XK_KATAKANA
+ {"overline", XK_overline},
+ {"kana_fullstop", XK_kana_fullstop},
+ {"kana_openingbracket", XK_kana_openingbracket},
+ {"kana_closingbracket", XK_kana_closingbracket},
+ {"kana_comma", XK_kana_comma},
+ {"kana_conjunctive", XK_kana_conjunctive},
+ {"kana_middledot", XK_kana_middledot},
+ {"kana_WO", XK_kana_WO},
+ {"kana_a", XK_kana_a},
+ {"kana_i", XK_kana_i},
+ {"kana_u", XK_kana_u},
+ {"kana_e", XK_kana_e},
+ {"kana_o", XK_kana_o},
+ {"kana_ya", XK_kana_ya},
+ {"kana_yu", XK_kana_yu},
+ {"kana_yo", XK_kana_yo},
+ {"kana_tsu", XK_kana_tsu},
+ {"kana_tu", XK_kana_tu},
+ {"prolongedsound", XK_prolongedsound},
+ {"kana_A", XK_kana_A},
+ {"kana_I", XK_kana_I},
+ {"kana_U", XK_kana_U},
+ {"kana_E", XK_kana_E},
+ {"kana_O", XK_kana_O},
+ {"kana_KA", XK_kana_KA},
+ {"kana_KI", XK_kana_KI},
+ {"kana_KU", XK_kana_KU},
+ {"kana_KE", XK_kana_KE},
+ {"kana_KO", XK_kana_KO},
+ {"kana_SA", XK_kana_SA},
+ {"kana_SHI", XK_kana_SHI},
+ {"kana_SU", XK_kana_SU},
+ {"kana_SE", XK_kana_SE},
+ {"kana_SO", XK_kana_SO},
+ {"kana_TA", XK_kana_TA},
+ {"kana_CHI", XK_kana_CHI},
+ {"kana_TI", XK_kana_TI},
+ {"kana_TSU", XK_kana_TSU},
+ {"kana_TU", XK_kana_TU},
+ {"kana_TE", XK_kana_TE},
+ {"kana_TO", XK_kana_TO},
+ {"kana_NA", XK_kana_NA},
+ {"kana_NI", XK_kana_NI},
+ {"kana_NU", XK_kana_NU},
+ {"kana_NE", XK_kana_NE},
+ {"kana_NO", XK_kana_NO},
+ {"kana_HA", XK_kana_HA},
+ {"kana_HI", XK_kana_HI},
+ {"kana_FU", XK_kana_FU},
+ {"kana_HU", XK_kana_HU},
+ {"kana_HE", XK_kana_HE},
+ {"kana_HO", XK_kana_HO},
+ {"kana_MA", XK_kana_MA},
+ {"kana_MI", XK_kana_MI},
+ {"kana_MU", XK_kana_MU},
+ {"kana_ME", XK_kana_ME},
+ {"kana_MO", XK_kana_MO},
+ {"kana_YA", XK_kana_YA},
+ {"kana_YU", XK_kana_YU},
+ {"kana_YO", XK_kana_YO},
+ {"kana_RA", XK_kana_RA},
+ {"kana_RI", XK_kana_RI},
+ {"kana_RU", XK_kana_RU},
+ {"kana_RE", XK_kana_RE},
+ {"kana_RO", XK_kana_RO},
+ {"kana_WA", XK_kana_WA},
+ {"kana_N", XK_kana_N},
+ {"voicedsound", XK_voicedsound},
+ {"semivoicedsound", XK_semivoicedsound},
+ {"kana_switch", XK_kana_switch},
+#endif /* XK_KATAKANA */
+#ifdef XK_ARABIC
+ {"Arabic_comma", XK_Arabic_comma},
+ {"Arabic_semicolon", XK_Arabic_semicolon},
+ {"Arabic_question_mark", XK_Arabic_question_mark},
+ {"Arabic_hamza", XK_Arabic_hamza},
+ {"Arabic_maddaonalef", XK_Arabic_maddaonalef},
+ {"Arabic_hamzaonalef", XK_Arabic_hamzaonalef},
+ {"Arabic_hamzaonwaw", XK_Arabic_hamzaonwaw},
+ {"Arabic_hamzaunderalef", XK_Arabic_hamzaunderalef},
+ {"Arabic_hamzaonyeh", XK_Arabic_hamzaonyeh},
+ {"Arabic_alef", XK_Arabic_alef},
+ {"Arabic_beh", XK_Arabic_beh},
+ {"Arabic_tehmarbuta", XK_Arabic_tehmarbuta},
+ {"Arabic_teh", XK_Arabic_teh},
+ {"Arabic_theh", XK_Arabic_theh},
+ {"Arabic_jeem", XK_Arabic_jeem},
+ {"Arabic_hah", XK_Arabic_hah},
+ {"Arabic_khah", XK_Arabic_khah},
+ {"Arabic_dal", XK_Arabic_dal},
+ {"Arabic_thal", XK_Arabic_thal},
+ {"Arabic_ra", XK_Arabic_ra},
+ {"Arabic_zain", XK_Arabic_zain},
+ {"Arabic_seen", XK_Arabic_seen},
+ {"Arabic_sheen", XK_Arabic_sheen},
+ {"Arabic_sad", XK_Arabic_sad},
+ {"Arabic_dad", XK_Arabic_dad},
+ {"Arabic_tah", XK_Arabic_tah},
+ {"Arabic_zah", XK_Arabic_zah},
+ {"Arabic_ain", XK_Arabic_ain},
+ {"Arabic_ghain", XK_Arabic_ghain},
+ {"Arabic_tatweel", XK_Arabic_tatweel},
+ {"Arabic_feh", XK_Arabic_feh},
+ {"Arabic_qaf", XK_Arabic_qaf},
+ {"Arabic_kaf", XK_Arabic_kaf},
+ {"Arabic_lam", XK_Arabic_lam},
+ {"Arabic_meem", XK_Arabic_meem},
+ {"Arabic_noon", XK_Arabic_noon},
+ {"Arabic_ha", XK_Arabic_ha},
+ {"Arabic_heh", XK_Arabic_heh},
+ {"Arabic_waw", XK_Arabic_waw},
+ {"Arabic_alefmaksura", XK_Arabic_alefmaksura},
+ {"Arabic_yeh", XK_Arabic_yeh},
+ {"Arabic_fathatan", XK_Arabic_fathatan},
+ {"Arabic_dammatan", XK_Arabic_dammatan},
+ {"Arabic_kasratan", XK_Arabic_kasratan},
+ {"Arabic_fatha", XK_Arabic_fatha},
+ {"Arabic_damma", XK_Arabic_damma},
+ {"Arabic_kasra", XK_Arabic_kasra},
+ {"Arabic_shadda", XK_Arabic_shadda},
+ {"Arabic_sukun", XK_Arabic_sukun},
+ {"Arabic_switch", XK_Arabic_switch},
+#endif /* XK_ARABIC */
+#ifdef XK_CYRILLIC
+ {"Serbian_dje", XK_Serbian_dje},
+ {"Macedonia_gje", XK_Macedonia_gje},
+ {"Cyrillic_io", XK_Cyrillic_io},
+ {"Ukrainian_ie", XK_Ukrainian_ie},
+ {"Ukranian_je", XK_Ukranian_je},
+ {"Macedonia_dse", XK_Macedonia_dse},
+ {"Ukrainian_i", XK_Ukrainian_i},
+ {"Ukranian_i", XK_Ukranian_i},
+ {"Ukrainian_yi", XK_Ukrainian_yi},
+ {"Ukranian_yi", XK_Ukranian_yi},
+ {"Cyrillic_je", XK_Cyrillic_je},
+ {"Serbian_je", XK_Serbian_je},
+ {"Cyrillic_lje", XK_Cyrillic_lje},
+ {"Serbian_lje", XK_Serbian_lje},
+ {"Cyrillic_nje", XK_Cyrillic_nje},
+ {"Serbian_nje", XK_Serbian_nje},
+ {"Serbian_tshe", XK_Serbian_tshe},
+ {"Macedonia_kje", XK_Macedonia_kje},
+ {"Byelorussian_shortu", XK_Byelorussian_shortu},
+ {"Cyrillic_dzhe", XK_Cyrillic_dzhe},
+ {"Serbian_dze", XK_Serbian_dze},
+ {"numerosign", XK_numerosign},
+ {"Serbian_DJE", XK_Serbian_DJE},
+ {"Macedonia_GJE", XK_Macedonia_GJE},
+ {"Cyrillic_IO", XK_Cyrillic_IO},
+ {"Ukrainian_IE", XK_Ukrainian_IE},
+ {"Ukranian_JE", XK_Ukranian_JE},
+ {"Macedonia_DSE", XK_Macedonia_DSE},
+ {"Ukrainian_I", XK_Ukrainian_I},
+ {"Ukranian_I", XK_Ukranian_I},
+ {"Ukrainian_YI", XK_Ukrainian_YI},
+ {"Ukranian_YI", XK_Ukranian_YI},
+ {"Cyrillic_JE", XK_Cyrillic_JE},
+ {"Serbian_JE", XK_Serbian_JE},
+ {"Cyrillic_LJE", XK_Cyrillic_LJE},
+ {"Serbian_LJE", XK_Serbian_LJE},
+ {"Cyrillic_NJE", XK_Cyrillic_NJE},
+ {"Serbian_NJE", XK_Serbian_NJE},
+ {"Serbian_TSHE", XK_Serbian_TSHE},
+ {"Macedonia_KJE", XK_Macedonia_KJE},
+ {"Byelorussian_SHORTU", XK_Byelorussian_SHORTU},
+ {"Cyrillic_DZHE", XK_Cyrillic_DZHE},
+ {"Serbian_DZE", XK_Serbian_DZE},
+ {"Cyrillic_yu", XK_Cyrillic_yu},
+ {"Cyrillic_a", XK_Cyrillic_a},
+ {"Cyrillic_be", XK_Cyrillic_be},
+ {"Cyrillic_tse", XK_Cyrillic_tse},
+ {"Cyrillic_de", XK_Cyrillic_de},
+ {"Cyrillic_ie", XK_Cyrillic_ie},
+ {"Cyrillic_ef", XK_Cyrillic_ef},
+ {"Cyrillic_ghe", XK_Cyrillic_ghe},
+ {"Cyrillic_ha", XK_Cyrillic_ha},
+ {"Cyrillic_i", XK_Cyrillic_i},
+ {"Cyrillic_shorti", XK_Cyrillic_shorti},
+ {"Cyrillic_ka", XK_Cyrillic_ka},
+ {"Cyrillic_el", XK_Cyrillic_el},
+ {"Cyrillic_em", XK_Cyrillic_em},
+ {"Cyrillic_en", XK_Cyrillic_en},
+ {"Cyrillic_o", XK_Cyrillic_o},
+ {"Cyrillic_pe", XK_Cyrillic_pe},
+ {"Cyrillic_ya", XK_Cyrillic_ya},
+ {"Cyrillic_er", XK_Cyrillic_er},
+ {"Cyrillic_es", XK_Cyrillic_es},
+ {"Cyrillic_te", XK_Cyrillic_te},
+ {"Cyrillic_u", XK_Cyrillic_u},
+ {"Cyrillic_zhe", XK_Cyrillic_zhe},
+ {"Cyrillic_ve", XK_Cyrillic_ve},
+ {"Cyrillic_softsign", XK_Cyrillic_softsign},
+ {"Cyrillic_yeru", XK_Cyrillic_yeru},
+ {"Cyrillic_ze", XK_Cyrillic_ze},
+ {"Cyrillic_sha", XK_Cyrillic_sha},
+ {"Cyrillic_e", XK_Cyrillic_e},
+ {"Cyrillic_shcha", XK_Cyrillic_shcha},
+ {"Cyrillic_che", XK_Cyrillic_che},
+ {"Cyrillic_hardsign", XK_Cyrillic_hardsign},
+ {"Cyrillic_YU", XK_Cyrillic_YU},
+ {"Cyrillic_A", XK_Cyrillic_A},
+ {"Cyrillic_BE", XK_Cyrillic_BE},
+ {"Cyrillic_TSE", XK_Cyrillic_TSE},
+ {"Cyrillic_DE", XK_Cyrillic_DE},
+ {"Cyrillic_IE", XK_Cyrillic_IE},
+ {"Cyrillic_EF", XK_Cyrillic_EF},
+ {"Cyrillic_GHE", XK_Cyrillic_GHE},
+ {"Cyrillic_HA", XK_Cyrillic_HA},
+ {"Cyrillic_I", XK_Cyrillic_I},
+ {"Cyrillic_SHORTI", XK_Cyrillic_SHORTI},
+ {"Cyrillic_KA", XK_Cyrillic_KA},
+ {"Cyrillic_EL", XK_Cyrillic_EL},
+ {"Cyrillic_EM", XK_Cyrillic_EM},
+ {"Cyrillic_EN", XK_Cyrillic_EN},
+ {"Cyrillic_O", XK_Cyrillic_O},
+ {"Cyrillic_PE", XK_Cyrillic_PE},
+ {"Cyrillic_YA", XK_Cyrillic_YA},
+ {"Cyrillic_ER", XK_Cyrillic_ER},
+ {"Cyrillic_ES", XK_Cyrillic_ES},
+ {"Cyrillic_TE", XK_Cyrillic_TE},
+ {"Cyrillic_U", XK_Cyrillic_U},
+ {"Cyrillic_ZHE", XK_Cyrillic_ZHE},
+ {"Cyrillic_VE", XK_Cyrillic_VE},
+ {"Cyrillic_SOFTSIGN", XK_Cyrillic_SOFTSIGN},
+ {"Cyrillic_YERU", XK_Cyrillic_YERU},
+ {"Cyrillic_ZE", XK_Cyrillic_ZE},
+ {"Cyrillic_SHA", XK_Cyrillic_SHA},
+ {"Cyrillic_E", XK_Cyrillic_E},
+ {"Cyrillic_SHCHA", XK_Cyrillic_SHCHA},
+ {"Cyrillic_CHE", XK_Cyrillic_CHE},
+ {"Cyrillic_HARDSIGN", XK_Cyrillic_HARDSIGN},
+#endif /* XK_CYRILLIC */
+#ifdef XK_GREEK
+ {"Greek_ALPHAaccent", XK_Greek_ALPHAaccent},
+ {"Greek_EPSILONaccent", XK_Greek_EPSILONaccent},
+ {"Greek_ETAaccent", XK_Greek_ETAaccent},
+ {"Greek_IOTAaccent", XK_Greek_IOTAaccent},
+ {"Greek_IOTAdieresis", XK_Greek_IOTAdieresis},
+ {"Greek_OMICRONaccent", XK_Greek_OMICRONaccent},
+ {"Greek_UPSILONaccent", XK_Greek_UPSILONaccent},
+ {"Greek_UPSILONdieresis", XK_Greek_UPSILONdieresis},
+ {"Greek_OMEGAaccent", XK_Greek_OMEGAaccent},
+ {"Greek_accentdieresis", XK_Greek_accentdieresis},
+ {"Greek_horizbar", XK_Greek_horizbar},
+ {"Greek_alphaaccent", XK_Greek_alphaaccent},
+ {"Greek_epsilonaccent", XK_Greek_epsilonaccent},
+ {"Greek_etaaccent", XK_Greek_etaaccent},
+ {"Greek_iotaaccent", XK_Greek_iotaaccent},
+ {"Greek_iotadieresis", XK_Greek_iotadieresis},
+ {"Greek_iotaaccentdieresis", XK_Greek_iotaaccentdieresis},
+ {"Greek_omicronaccent", XK_Greek_omicronaccent},
+ {"Greek_upsilonaccent", XK_Greek_upsilonaccent},
+ {"Greek_upsilondieresis", XK_Greek_upsilondieresis},
+ {"Greek_upsilonaccentdieresis", XK_Greek_upsilonaccentdieresis},
+ {"Greek_omegaaccent", XK_Greek_omegaaccent},
+ {"Greek_ALPHA", XK_Greek_ALPHA},
+ {"Greek_BETA", XK_Greek_BETA},
+ {"Greek_GAMMA", XK_Greek_GAMMA},
+ {"Greek_DELTA", XK_Greek_DELTA},
+ {"Greek_EPSILON", XK_Greek_EPSILON},
+ {"Greek_ZETA", XK_Greek_ZETA},
+ {"Greek_ETA", XK_Greek_ETA},
+ {"Greek_THETA", XK_Greek_THETA},
+ {"Greek_IOTA", XK_Greek_IOTA},
+ {"Greek_KAPPA", XK_Greek_KAPPA},
+ {"Greek_LAMDA", XK_Greek_LAMDA},
+ {"Greek_LAMBDA", XK_Greek_LAMBDA},
+ {"Greek_MU", XK_Greek_MU},
+ {"Greek_NU", XK_Greek_NU},
+ {"Greek_XI", XK_Greek_XI},
+ {"Greek_OMICRON", XK_Greek_OMICRON},
+ {"Greek_PI", XK_Greek_PI},
+ {"Greek_RHO", XK_Greek_RHO},
+ {"Greek_SIGMA", XK_Greek_SIGMA},
+ {"Greek_TAU", XK_Greek_TAU},
+ {"Greek_UPSILON", XK_Greek_UPSILON},
+ {"Greek_PHI", XK_Greek_PHI},
+ {"Greek_CHI", XK_Greek_CHI},
+ {"Greek_PSI", XK_Greek_PSI},
+ {"Greek_OMEGA", XK_Greek_OMEGA},
+ {"Greek_alpha", XK_Greek_alpha},
+ {"Greek_beta", XK_Greek_beta},
+ {"Greek_gamma", XK_Greek_gamma},
+ {"Greek_delta", XK_Greek_delta},
+ {"Greek_epsilon", XK_Greek_epsilon},
+ {"Greek_zeta", XK_Greek_zeta},
+ {"Greek_eta", XK_Greek_eta},
+ {"Greek_theta", XK_Greek_theta},
+ {"Greek_iota", XK_Greek_iota},
+ {"Greek_kappa", XK_Greek_kappa},
+ {"Greek_lamda", XK_Greek_lamda},
+ {"Greek_lambda", XK_Greek_lambda},
+ {"Greek_mu", XK_Greek_mu},
+ {"Greek_nu", XK_Greek_nu},
+ {"Greek_xi", XK_Greek_xi},
+ {"Greek_omicron", XK_Greek_omicron},
+ {"Greek_pi", XK_Greek_pi},
+ {"Greek_rho", XK_Greek_rho},
+ {"Greek_sigma", XK_Greek_sigma},
+ {"Greek_finalsmallsigma", XK_Greek_finalsmallsigma},
+ {"Greek_tau", XK_Greek_tau},
+ {"Greek_upsilon", XK_Greek_upsilon},
+ {"Greek_phi", XK_Greek_phi},
+ {"Greek_chi", XK_Greek_chi},
+ {"Greek_psi", XK_Greek_psi},
+ {"Greek_omega", XK_Greek_omega},
+ {"Greek_switch", XK_Greek_switch},
+#endif /* XK_GREEK */
+#ifdef XK_TECHNICAL
+ {"leftradical", XK_leftradical},
+ {"topleftradical", XK_topleftradical},
+ {"horizconnector", XK_horizconnector},
+ {"topintegral", XK_topintegral},
+ {"botintegral", XK_botintegral},
+ {"vertconnector", XK_vertconnector},
+ {"topleftsqbracket", XK_topleftsqbracket},
+ {"botleftsqbracket", XK_botleftsqbracket},
+ {"toprightsqbracket", XK_toprightsqbracket},
+ {"botrightsqbracket", XK_botrightsqbracket},
+ {"topleftparens", XK_topleftparens},
+ {"botleftparens", XK_botleftparens},
+ {"toprightparens", XK_toprightparens},
+ {"botrightparens", XK_botrightparens},
+ {"leftmiddlecurlybrace", XK_leftmiddlecurlybrace},
+ {"rightmiddlecurlybrace", XK_rightmiddlecurlybrace},
+ {"topleftsummation", XK_topleftsummation},
+ {"botleftsummation", XK_botleftsummation},
+ {"topvertsummationconnector", XK_topvertsummationconnector},
+ {"botvertsummationconnector", XK_botvertsummationconnector},
+ {"toprightsummation", XK_toprightsummation},
+ {"botrightsummation", XK_botrightsummation},
+ {"rightmiddlesummation", XK_rightmiddlesummation},
+ {"lessthanequal", XK_lessthanequal},
+ {"notequal", XK_notequal},
+ {"greaterthanequal", XK_greaterthanequal},
+ {"integral", XK_integral},
+ {"therefore", XK_therefore},
+ {"variation", XK_variation},
+ {"infinity", XK_infinity},
+ {"nabla", XK_nabla},
+ {"approximate", XK_approximate},
+ {"similarequal", XK_similarequal},
+ {"ifonlyif", XK_ifonlyif},
+ {"implies", XK_implies},
+ {"identical", XK_identical},
+ {"radical", XK_radical},
+ {"includedin", XK_includedin},
+ {"includes", XK_includes},
+ {"intersection", XK_intersection},
+ {"union", XK_union},
+ {"logicaland", XK_logicaland},
+ {"logicalor", XK_logicalor},
+ {"partialderivative", XK_partialderivative},
+ {"function", XK_function},
+ {"leftarrow", XK_leftarrow},
+ {"uparrow", XK_uparrow},
+ {"rightarrow", XK_rightarrow},
+ {"downarrow", XK_downarrow},
+#endif /* XK_TECHNICAL */
+#ifdef XK_SPECIAL
+ {"blank", XK_blank},
+ {"soliddiamond", XK_soliddiamond},
+ {"checkerboard", XK_checkerboard},
+ {"ht", XK_ht},
+ {"ff", XK_ff},
+ {"cr", XK_cr},
+ {"lf", XK_lf},
+ {"nl", XK_nl},
+ {"vt", XK_vt},
+ {"lowrightcorner", XK_lowrightcorner},
+ {"uprightcorner", XK_uprightcorner},
+ {"upleftcorner", XK_upleftcorner},
+ {"lowleftcorner", XK_lowleftcorner},
+ {"crossinglines", XK_crossinglines},
+ {"horizlinescan1", XK_horizlinescan1},
+ {"horizlinescan3", XK_horizlinescan3},
+ {"horizlinescan5", XK_horizlinescan5},
+ {"horizlinescan7", XK_horizlinescan7},
+ {"horizlinescan9", XK_horizlinescan9},
+ {"leftt", XK_leftt},
+ {"rightt", XK_rightt},
+ {"bott", XK_bott},
+ {"topt", XK_topt},
+ {"vertbar", XK_vertbar},
+#endif /* XK_SPECIAL */
+#ifdef XK_PUBLISHING
+ {"emspace", XK_emspace},
+ {"enspace", XK_enspace},
+ {"em3space", XK_em3space},
+ {"em4space", XK_em4space},
+ {"digitspace", XK_digitspace},
+ {"punctspace", XK_punctspace},
+ {"thinspace", XK_thinspace},
+ {"hairspace", XK_hairspace},
+ {"emdash", XK_emdash},
+ {"endash", XK_endash},
+ {"signifblank", XK_signifblank},
+ {"ellipsis", XK_ellipsis},
+ {"doubbaselinedot", XK_doubbaselinedot},
+ {"onethird", XK_onethird},
+ {"twothirds", XK_twothirds},
+ {"onefifth", XK_onefifth},
+ {"twofifths", XK_twofifths},
+ {"threefifths", XK_threefifths},
+ {"fourfifths", XK_fourfifths},
+ {"onesixth", XK_onesixth},
+ {"fivesixths", XK_fivesixths},
+ {"careof", XK_careof},
+ {"figdash", XK_figdash},
+ {"leftanglebracket", XK_leftanglebracket},
+ {"decimalpoint", XK_decimalpoint},
+ {"rightanglebracket", XK_rightanglebracket},
+ {"marker", XK_marker},
+ {"oneeighth", XK_oneeighth},
+ {"threeeighths", XK_threeeighths},
+ {"fiveeighths", XK_fiveeighths},
+ {"seveneighths", XK_seveneighths},
+ {"trademark", XK_trademark},
+ {"signaturemark", XK_signaturemark},
+ {"trademarkincircle", XK_trademarkincircle},
+ {"leftopentriangle", XK_leftopentriangle},
+ {"rightopentriangle", XK_rightopentriangle},
+ {"emopencircle", XK_emopencircle},
+ {"emopenrectangle", XK_emopenrectangle},
+ {"leftsinglequotemark", XK_leftsinglequotemark},
+ {"rightsinglequotemark", XK_rightsinglequotemark},
+ {"leftdoublequotemark", XK_leftdoublequotemark},
+ {"rightdoublequotemark", XK_rightdoublequotemark},
+ {"prescription", XK_prescription},
+ {"minutes", XK_minutes},
+ {"seconds", XK_seconds},
+ {"latincross", XK_latincross},
+ {"hexagram", XK_hexagram},
+ {"filledrectbullet", XK_filledrectbullet},
+ {"filledlefttribullet", XK_filledlefttribullet},
+ {"filledrighttribullet", XK_filledrighttribullet},
+ {"emfilledcircle", XK_emfilledcircle},
+ {"emfilledrect", XK_emfilledrect},
+ {"enopencircbullet", XK_enopencircbullet},
+ {"enopensquarebullet", XK_enopensquarebullet},
+ {"openrectbullet", XK_openrectbullet},
+ {"opentribulletup", XK_opentribulletup},
+ {"opentribulletdown", XK_opentribulletdown},
+ {"openstar", XK_openstar},
+ {"enfilledcircbullet", XK_enfilledcircbullet},
+ {"enfilledsqbullet", XK_enfilledsqbullet},
+ {"filledtribulletup", XK_filledtribulletup},
+ {"filledtribulletdown", XK_filledtribulletdown},
+ {"leftpointer", XK_leftpointer},
+ {"rightpointer", XK_rightpointer},
+ {"club", XK_club},
+ {"diamond", XK_diamond},
+ {"heart", XK_heart},
+ {"maltesecross", XK_maltesecross},
+ {"dagger", XK_dagger},
+ {"doubledagger", XK_doubledagger},
+ {"checkmark", XK_checkmark},
+ {"ballotcross", XK_ballotcross},
+ {"musicalsharp", XK_musicalsharp},
+ {"musicalflat", XK_musicalflat},
+ {"malesymbol", XK_malesymbol},
+ {"femalesymbol", XK_femalesymbol},
+ {"telephone", XK_telephone},
+ {"telephonerecorder", XK_telephonerecorder},
+ {"phonographcopyright", XK_phonographcopyright},
+ {"caret", XK_caret},
+ {"singlelowquotemark", XK_singlelowquotemark},
+ {"doublelowquotemark", XK_doublelowquotemark},
+ {"cursor", XK_cursor},
+#endif /* XK_PUBLISHING */
+#ifdef XK_APL
+ {"leftcaret", XK_leftcaret},
+ {"rightcaret", XK_rightcaret},
+ {"downcaret", XK_downcaret},
+ {"upcaret", XK_upcaret},
+ {"overbar", XK_overbar},
+ {"downtack", XK_downtack},
+ {"upshoe", XK_upshoe},
+ {"downstile", XK_downstile},
+ {"underbar", XK_underbar},
+ {"jot", XK_jot},
+ {"quad", XK_quad},
+ {"uptack", XK_uptack},
+ {"circle", XK_circle},
+ {"upstile", XK_upstile},
+ {"downshoe", XK_downshoe},
+ {"rightshoe", XK_rightshoe},
+ {"leftshoe", XK_leftshoe},
+ {"lefttack", XK_lefttack},
+ {"righttack", XK_righttack},
+#endif /* XK_APL */
+#ifdef XK_HEBREW
+ {"hebrew_doublelowline", XK_hebrew_doublelowline},
+ {"hebrew_aleph", XK_hebrew_aleph},
+ {"hebrew_bet", XK_hebrew_bet},
+ {"hebrew_beth", XK_hebrew_beth},
+ {"hebrew_gimel", XK_hebrew_gimel},
+ {"hebrew_gimmel", XK_hebrew_gimmel},
+ {"hebrew_dalet", XK_hebrew_dalet},
+ {"hebrew_daleth", XK_hebrew_daleth},
+ {"hebrew_he", XK_hebrew_he},
+ {"hebrew_waw", XK_hebrew_waw},
+ {"hebrew_zain", XK_hebrew_zain},
+ {"hebrew_zayin", XK_hebrew_zayin},
+ {"hebrew_chet", XK_hebrew_chet},
+ {"hebrew_het", XK_hebrew_het},
+ {"hebrew_tet", XK_hebrew_tet},
+ {"hebrew_teth", XK_hebrew_teth},
+ {"hebrew_yod", XK_hebrew_yod},
+ {"hebrew_finalkaph", XK_hebrew_finalkaph},
+ {"hebrew_kaph", XK_hebrew_kaph},
+ {"hebrew_lamed", XK_hebrew_lamed},
+ {"hebrew_finalmem", XK_hebrew_finalmem},
+ {"hebrew_mem", XK_hebrew_mem},
+ {"hebrew_finalnun", XK_hebrew_finalnun},
+ {"hebrew_nun", XK_hebrew_nun},
+ {"hebrew_samech", XK_hebrew_samech},
+ {"hebrew_samekh", XK_hebrew_samekh},
+ {"hebrew_ayin", XK_hebrew_ayin},
+ {"hebrew_finalpe", XK_hebrew_finalpe},
+ {"hebrew_pe", XK_hebrew_pe},
+ {"hebrew_finalzade", XK_hebrew_finalzade},
+ {"hebrew_finalzadi", XK_hebrew_finalzadi},
+ {"hebrew_zade", XK_hebrew_zade},
+ {"hebrew_zadi", XK_hebrew_zadi},
+ {"hebrew_qoph", XK_hebrew_qoph},
+ {"hebrew_kuf", XK_hebrew_kuf},
+ {"hebrew_resh", XK_hebrew_resh},
+ {"hebrew_shin", XK_hebrew_shin},
+ {"hebrew_taw", XK_hebrew_taw},
+ {"hebrew_taf", XK_hebrew_taf},
+ {"Hebrew_switch", XK_Hebrew_switch},
+#endif /* XK_HEBREW */
+#ifdef XK_THAI
+ {"Thai_kokai", XK_Thai_kokai},
+ {"Thai_khokhai", XK_Thai_khokhai},
+ {"Thai_khokhuat", XK_Thai_khokhuat},
+ {"Thai_khokhwai", XK_Thai_khokhwai},
+ {"Thai_khokhon", XK_Thai_khokhon},
+ {"Thai_khorakhang", XK_Thai_khorakhang},
+ {"Thai_ngongu", XK_Thai_ngongu},
+ {"Thai_chochan", XK_Thai_chochan},
+ {"Thai_choching", XK_Thai_choching},
+ {"Thai_chochang", XK_Thai_chochang},
+ {"Thai_soso", XK_Thai_soso},
+ {"Thai_chochoe", XK_Thai_chochoe},
+ {"Thai_yoying", XK_Thai_yoying},
+ {"Thai_dochada", XK_Thai_dochada},
+ {"Thai_topatak", XK_Thai_topatak},
+ {"Thai_thothan", XK_Thai_thothan},
+ {"Thai_thonangmontho", XK_Thai_thonangmontho},
+ {"Thai_thophuthao", XK_Thai_thophuthao},
+ {"Thai_nonen", XK_Thai_nonen},
+ {"Thai_dodek", XK_Thai_dodek},
+ {"Thai_totao", XK_Thai_totao},
+ {"Thai_thothung", XK_Thai_thothung},
+ {"Thai_thothahan", XK_Thai_thothahan},
+ {"Thai_thothong", XK_Thai_thothong},
+ {"Thai_nonu", XK_Thai_nonu},
+ {"Thai_bobaimai", XK_Thai_bobaimai},
+ {"Thai_popla", XK_Thai_popla},
+ {"Thai_phophung", XK_Thai_phophung},
+ {"Thai_fofa", XK_Thai_fofa},
+ {"Thai_phophan", XK_Thai_phophan},
+ {"Thai_fofan", XK_Thai_fofan},
+ {"Thai_phosamphao", XK_Thai_phosamphao},
+ {"Thai_moma", XK_Thai_moma},
+ {"Thai_yoyak", XK_Thai_yoyak},
+ {"Thai_rorua", XK_Thai_rorua},
+ {"Thai_ru", XK_Thai_ru},
+ {"Thai_loling", XK_Thai_loling},
+ {"Thai_lu", XK_Thai_lu},
+ {"Thai_wowaen", XK_Thai_wowaen},
+ {"Thai_sosala", XK_Thai_sosala},
+ {"Thai_sorusi", XK_Thai_sorusi},
+ {"Thai_sosua", XK_Thai_sosua},
+ {"Thai_hohip", XK_Thai_hohip},
+ {"Thai_lochula", XK_Thai_lochula},
+ {"Thai_oang", XK_Thai_oang},
+ {"Thai_honokhuk", XK_Thai_honokhuk},
+ {"Thai_paiyannoi", XK_Thai_paiyannoi},
+ {"Thai_saraa", XK_Thai_saraa},
+ {"Thai_maihanakat", XK_Thai_maihanakat},
+ {"Thai_saraaa", XK_Thai_saraaa},
+ {"Thai_saraam", XK_Thai_saraam},
+ {"Thai_sarai", XK_Thai_sarai},
+ {"Thai_saraii", XK_Thai_saraii},
+ {"Thai_saraue", XK_Thai_saraue},
+ {"Thai_sarauee", XK_Thai_sarauee},
+ {"Thai_sarau", XK_Thai_sarau},
+ {"Thai_sarauu", XK_Thai_sarauu},
+ {"Thai_phinthu", XK_Thai_phinthu},
+ {"Thai_maihanakat_maitho", XK_Thai_maihanakat_maitho},
+ {"Thai_baht", XK_Thai_baht},
+ {"Thai_sarae", XK_Thai_sarae},
+ {"Thai_saraae", XK_Thai_saraae},
+ {"Thai_sarao", XK_Thai_sarao},
+ {"Thai_saraaimaimuan", XK_Thai_saraaimaimuan},
+ {"Thai_saraaimaimalai", XK_Thai_saraaimaimalai},
+ {"Thai_lakkhangyao", XK_Thai_lakkhangyao},
+ {"Thai_maiyamok", XK_Thai_maiyamok},
+ {"Thai_maitaikhu", XK_Thai_maitaikhu},
+ {"Thai_maiek", XK_Thai_maiek},
+ {"Thai_maitho", XK_Thai_maitho},
+ {"Thai_maitri", XK_Thai_maitri},
+ {"Thai_maichattawa", XK_Thai_maichattawa},
+ {"Thai_thanthakhat", XK_Thai_thanthakhat},
+ {"Thai_nikhahit", XK_Thai_nikhahit},
+ {"Thai_leksun", XK_Thai_leksun},
+ {"Thai_leknung", XK_Thai_leknung},
+ {"Thai_leksong", XK_Thai_leksong},
+ {"Thai_leksam", XK_Thai_leksam},
+ {"Thai_leksi", XK_Thai_leksi},
+ {"Thai_lekha", XK_Thai_lekha},
+ {"Thai_lekhok", XK_Thai_lekhok},
+ {"Thai_lekchet", XK_Thai_lekchet},
+ {"Thai_lekpaet", XK_Thai_lekpaet},
+ {"Thai_lekkao", XK_Thai_lekkao},
+#endif /* XK_THAI */
+#ifdef XK_KOREAN
+ {"Hangul", XK_Hangul},
+ {"Hangul_Start", XK_Hangul_Start},
+ {"Hangul_End", XK_Hangul_End},
+ {"Hangul_Hanja", XK_Hangul_Hanja},
+ {"Hangul_Jamo", XK_Hangul_Jamo},
+ {"Hangul_Romaja", XK_Hangul_Romaja},
+ {"Hangul_Codeinput", XK_Hangul_Codeinput},
+ {"Hangul_Jeonja", XK_Hangul_Jeonja},
+ {"Hangul_Banja", XK_Hangul_Banja},
+ {"Hangul_PreHanja", XK_Hangul_PreHanja},
+ {"Hangul_PostHanja", XK_Hangul_PostHanja},
+ {"Hangul_SingleCandidate", XK_Hangul_SingleCandidate},
+ {"Hangul_MultipleCandidate", XK_Hangul_MultipleCandidate},
+ {"Hangul_PreviousCandidate", XK_Hangul_PreviousCandidate},
+ {"Hangul_Special", XK_Hangul_Special},
+ {"Hangul_switch", XK_Hangul_switch},
+ {"Hangul_Kiyeog", XK_Hangul_Kiyeog},
+ {"Hangul_SsangKiyeog", XK_Hangul_SsangKiyeog},
+ {"Hangul_KiyeogSios", XK_Hangul_KiyeogSios},
+ {"Hangul_Nieun", XK_Hangul_Nieun},
+ {"Hangul_NieunJieuj", XK_Hangul_NieunJieuj},
+ {"Hangul_NieunHieuh", XK_Hangul_NieunHieuh},
+ {"Hangul_Dikeud", XK_Hangul_Dikeud},
+ {"Hangul_SsangDikeud", XK_Hangul_SsangDikeud},
+ {"Hangul_Rieul", XK_Hangul_Rieul},
+ {"Hangul_RieulKiyeog", XK_Hangul_RieulKiyeog},
+ {"Hangul_RieulMieum", XK_Hangul_RieulMieum},
+ {"Hangul_RieulPieub", XK_Hangul_RieulPieub},
+ {"Hangul_RieulSios", XK_Hangul_RieulSios},
+ {"Hangul_RieulTieut", XK_Hangul_RieulTieut},
+ {"Hangul_RieulPhieuf", XK_Hangul_RieulPhieuf},
+ {"Hangul_RieulHieuh", XK_Hangul_RieulHieuh},
+ {"Hangul_Mieum", XK_Hangul_Mieum},
+ {"Hangul_Pieub", XK_Hangul_Pieub},
+ {"Hangul_SsangPieub", XK_Hangul_SsangPieub},
+ {"Hangul_PieubSios", XK_Hangul_PieubSios},
+ {"Hangul_Sios", XK_Hangul_Sios},
+ {"Hangul_SsangSios", XK_Hangul_SsangSios},
+ {"Hangul_Ieung", XK_Hangul_Ieung},
+ {"Hangul_Jieuj", XK_Hangul_Jieuj},
+ {"Hangul_SsangJieuj", XK_Hangul_SsangJieuj},
+ {"Hangul_Cieuc", XK_Hangul_Cieuc},
+ {"Hangul_Khieuq", XK_Hangul_Khieuq},
+ {"Hangul_Tieut", XK_Hangul_Tieut},
+ {"Hangul_Phieuf", XK_Hangul_Phieuf},
+ {"Hangul_Hieuh", XK_Hangul_Hieuh},
+ {"Hangul_A", XK_Hangul_A},
+ {"Hangul_AE", XK_Hangul_AE},
+ {"Hangul_YA", XK_Hangul_YA},
+ {"Hangul_YAE", XK_Hangul_YAE},
+ {"Hangul_EO", XK_Hangul_EO},
+ {"Hangul_E", XK_Hangul_E},
+ {"Hangul_YEO", XK_Hangul_YEO},
+ {"Hangul_YE", XK_Hangul_YE},
+ {"Hangul_O", XK_Hangul_O},
+ {"Hangul_WA", XK_Hangul_WA},
+ {"Hangul_WAE", XK_Hangul_WAE},
+ {"Hangul_OE", XK_Hangul_OE},
+ {"Hangul_YO", XK_Hangul_YO},
+ {"Hangul_U", XK_Hangul_U},
+ {"Hangul_WEO", XK_Hangul_WEO},
+ {"Hangul_WE", XK_Hangul_WE},
+ {"Hangul_WI", XK_Hangul_WI},
+ {"Hangul_YU", XK_Hangul_YU},
+ {"Hangul_EU", XK_Hangul_EU},
+ {"Hangul_YI", XK_Hangul_YI},
+ {"Hangul_I", XK_Hangul_I},
+ {"Hangul_J_Kiyeog", XK_Hangul_J_Kiyeog},
+ {"Hangul_J_SsangKiyeog", XK_Hangul_J_SsangKiyeog},
+ {"Hangul_J_KiyeogSios", XK_Hangul_J_KiyeogSios},
+ {"Hangul_J_Nieun", XK_Hangul_J_Nieun},
+ {"Hangul_J_NieunJieuj", XK_Hangul_J_NieunJieuj},
+ {"Hangul_J_NieunHieuh", XK_Hangul_J_NieunHieuh},
+ {"Hangul_J_Dikeud", XK_Hangul_J_Dikeud},
+ {"Hangul_J_Rieul", XK_Hangul_J_Rieul},
+ {"Hangul_J_RieulKiyeog", XK_Hangul_J_RieulKiyeog},
+ {"Hangul_J_RieulMieum", XK_Hangul_J_RieulMieum},
+ {"Hangul_J_RieulPieub", XK_Hangul_J_RieulPieub},
+ {"Hangul_J_RieulSios", XK_Hangul_J_RieulSios},
+ {"Hangul_J_RieulTieut", XK_Hangul_J_RieulTieut},
+ {"Hangul_J_RieulPhieuf", XK_Hangul_J_RieulPhieuf},
+ {"Hangul_J_RieulHieuh", XK_Hangul_J_RieulHieuh},
+ {"Hangul_J_Mieum", XK_Hangul_J_Mieum},
+ {"Hangul_J_Pieub", XK_Hangul_J_Pieub},
+ {"Hangul_J_PieubSios", XK_Hangul_J_PieubSios},
+ {"Hangul_J_Sios", XK_Hangul_J_Sios},
+ {"Hangul_J_SsangSios", XK_Hangul_J_SsangSios},
+ {"Hangul_J_Ieung", XK_Hangul_J_Ieung},
+ {"Hangul_J_Jieuj", XK_Hangul_J_Jieuj},
+ {"Hangul_J_Cieuc", XK_Hangul_J_Cieuc},
+ {"Hangul_J_Khieuq", XK_Hangul_J_Khieuq},
+ {"Hangul_J_Tieut", XK_Hangul_J_Tieut},
+ {"Hangul_J_Phieuf", XK_Hangul_J_Phieuf},
+ {"Hangul_J_Hieuh", XK_Hangul_J_Hieuh},
+ {"Hangul_RieulYeorinHieuh", XK_Hangul_RieulYeorinHieuh},
+ {"Hangul_SunkyeongeumMieum", XK_Hangul_SunkyeongeumMieum},
+ {"Hangul_SunkyeongeumPieub", XK_Hangul_SunkyeongeumPieub},
+ {"Hangul_PanSios", XK_Hangul_PanSios},
+ {"Hangul_KkogjiDalrinIeung", XK_Hangul_KkogjiDalrinIeung},
+ {"Hangul_SunkyeongeumPhieuf", XK_Hangul_SunkyeongeumPhieuf},
+ {"Hangul_YeorinHieuh", XK_Hangul_YeorinHieuh},
+ {"Hangul_AraeA", XK_Hangul_AraeA},
+ {"Hangul_AraeAE", XK_Hangul_AraeAE},
+ {"Hangul_J_PanSios", XK_Hangul_J_PanSios},
+ {"Hangul_J_KkogjiDalrinIeung", XK_Hangul_J_KkogjiDalrinIeung},
+ {"Hangul_J_YeorinHieuh", XK_Hangul_J_YeorinHieuh},
+ {"Korean_Won", XK_Korean_Won},
+#endif /* XK_KOREAN */
+ {"EuroSign", XK_EuroSign},
+#endif
+ {"NoSymbol", NoSymbol}
+};
+
+KeySym
+XStringToKeysym(const char *str)
+{
+ int i;
+ for (i = 0; StringToKeysym[i].keysym != NoSymbol
+ && strcmp(StringToKeysym[i].string, str); i++);
+ return StringToKeysym[i].keysym;
+}
+
+const char *
+XKeysymToString(KeySym keysym)
+{
+ int i;
+ for (i = 0; StringToKeysym[i].keysym != NoSymbol
+ && StringToKeysym[i].keysym != keysym; i++);
+ return StringToKeysym[i].string;
+}
+
+void
+XDisplayKeycodes(Display * display, int *min_keycode, int *max_keycode)
+{
+ /* VNC keycodes are non-existant */
+ *min_keycode = 0xffff;
+ *max_keycode = 0;
+}
--- /dev/null
+#ifndef NOXKEYMAP_H
+#define NOXKEYMAP_H
+
+/* Fake a few X11 calls */
+
+#define XK_MISCELLANY
+#include <rfb/rfb.h>
+#include <rfb/keysym.h>
+
+#define NoSymbol 0L
+#define ShiftMask (1<<0)
+#define LockMask (1<<1)
+#define ControlMask (1<<2)
+#define Mod1Mask (1<<3)
+#define Mod2Mask (1<<4)
+#define Mod3Mask (1<<5)
+#define Mod4Mask (1<<6)
+#define Mod5Mask (1<<7)
+#define Button1 1
+#define Button2 2
+#define Button3 3
+#define Button4 4
+#define Button5 5
+
+typedef int Display;
+typedef int Window;
+typedef rfbKeySym KeySym;
+
+KeySym XStringToKeysym(const char *str);
+const char *XKeysymToString(KeySym keysym);
+void XDisplayKeycodes(Display * display, int *min_keycode, int *max_keycode);
+
+#endif
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ Protocol services - Clipboard functions
+ Copyright (C) Erik Forsberg <forsberg@cendio.se> 2003
+ Copyright (C) Matthew Chapman 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include "rdesktop.h"
+
+/*
+ To gain better understanding of this code, one could be assisted by the following documents:
+ - Inter-Client Communication Conventions Manual (ICCCM)
+ HTML: http://tronche.com/gui/x/icccm/
+ PDF: http://ftp.xfree86.org/pub/XFree86/4.5.0/doc/PDF/icccm.pdf
+ - MSDN: Clipboard Formats
+ http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/dataexchange/clipboard/clipboardformats.asp
+*/
+
+#ifdef HAVE_ICONV
+#ifdef HAVE_LANGINFO_H
+#ifdef HAVE_ICONV_H
+#include <langinfo.h>
+#include <iconv.h>
+#define USE_UNICODE_CLIPBOARD
+#endif
+#endif
+#endif
+
+#ifdef USE_UNICODE_CLIPBOARD
+#define RDP_CF_TEXT CF_UNICODETEXT
+#else
+#define RDP_CF_TEXT CF_TEXT
+#endif
+
+
+/* Translate LF to CR-LF. To do this, we must allocate more memory.
+ The returned string is null-terminated, as required by CF_TEXT.
+ Does not stop on embedded nulls.
+ The length is updated. */
+static void
+crlf2lf(uint8 * data, uint32 * length)
+{
+ uint8 *dst, *src;
+ src = dst = data;
+ while (src < data + *length)
+ {
+ if (*src != '\x0d')
+ *dst++ = *src;
+ src++;
+ }
+ *length = dst - data;
+}
+
+#ifdef USE_UNICODE_CLIPBOARD
+/* Translate LF to CR-LF. To do this, we must allocate more memory.
+ The returned string is null-terminated, as required by CF_UNICODETEXT.
+ The size is updated. */
+static uint8 *
+utf16_lf2crlf(uint8 * data, uint32 * size)
+{
+ uint8 *result;
+ uint16 *inptr, *outptr;
+ Bool swap_endianess;
+
+ /* Worst case: Every char is LF */
+ result = xmalloc((*size * 2) + 2);
+ if (result == NULL)
+ return NULL;
+
+ inptr = (uint16 *) data;
+ outptr = (uint16 *) result;
+
+ /* Check for a reversed BOM */
+ swap_endianess = (*inptr == 0xfffe);
+
+ while ((uint8 *) inptr < data + *size)
+ {
+ uint16 uvalue = *inptr;
+ if (swap_endianess)
+ uvalue = ((uvalue << 8) & 0xff00) + (uvalue >> 8);
+ if (uvalue == 0x0a)
+ *outptr++ = swap_endianess ? 0x0d00 : 0x0d;
+ *outptr++ = *inptr++;
+ }
+ *outptr++ = 0; /* null termination */
+ *size = (uint8 *) outptr - result;
+
+ return result;
+}
+#else
+/* Translate LF to CR-LF. To do this, we must allocate more memory.
+ The length is updated. */
+static uint8 *
+lf2crlf(uint8 * data, uint32 * length)
+{
+ uint8 *result, *p, *o;
+
+ /* Worst case: Every char is LF */
+ result = xmalloc(*length * 2);
+
+ p = data;
+ o = result;
+
+ while (p < data + *length)
+ {
+ if (*p == '\x0a')
+ *o++ = '\x0d';
+ *o++ = *p++;
+ }
+ *length = o - result;
+
+ /* Convenience */
+ *o++ = '\0';
+
+ return result;
+}
+#endif
+
+static void
+xclip_provide_selection(RDPCLIENT * This, XSelectionRequestEvent * req, Atom type, unsigned int format, uint8 * data,
+ uint32 length)
+{
+ XEvent xev;
+
+ DEBUG_CLIPBOARD(("xclip_provide_selection: requestor=0x%08x, target=%s, property=%s, length=%u\n", (unsigned) req->requestor, XGetAtomName(This->display, req->target), XGetAtomName(This->display, req->property), (unsigned) length));
+
+ XChangeProperty(This->display, req->requestor, req->property,
+ type, format, PropModeReplace, data, length);
+
+ xev.xselection.type = SelectionNotify;
+ xev.xselection.serial = 0;
+ xev.xselection.send_event = True;
+ xev.xselection.requestor = req->requestor;
+ xev.xselection.selection = req->selection;
+ xev.xselection.target = req->target;
+ xev.xselection.property = req->property;
+ xev.xselection.time = req->time;
+ XSendEvent(This->display, req->requestor, False, NoEventMask, &xev);
+}
+
+/* Replies a clipboard requestor, telling that we're unable to satisfy his request for whatever reason.
+ This has the benefit of finalizing the clipboard negotiation and thus not leaving our requestor
+ lingering (and, potentially, stuck). */
+static void
+xclip_refuse_selection(RDPCLIENT * This, XSelectionRequestEvent * req)
+{
+ XEvent xev;
+
+ DEBUG_CLIPBOARD(("xclip_refuse_selection: requestor=0x%08x, target=%s, property=%s\n",
+ (unsigned) req->requestor, XGetAtomName(This->display, req->target),
+ XGetAtomName(This->display, req->property)));
+
+ xev.xselection.type = SelectionNotify;
+ xev.xselection.serial = 0;
+ xev.xselection.send_event = True;
+ xev.xselection.requestor = req->requestor;
+ xev.xselection.selection = req->selection;
+ xev.xselection.target = req->target;
+ xev.xselection.property = None;
+ xev.xselection.time = req->time;
+ XSendEvent(This->display, req->requestor, False, NoEventMask, &xev);
+}
+
+/* Wrapper for cliprdr_send_data which also cleans the request state. */
+static void
+helper_cliprdr_send_response(RDPCLIENT * This, uint8 * data, uint32 length)
+{
+ if (This->xclip.rdp_clipboard_request_format != 0)
+ {
+ cliprdr_send_data(This, data, length);
+ This->xclip.rdp_clipboard_request_format = 0;
+ if (!This->xclip.rdesktop_is_selection_owner)
+ cliprdr_send_simple_native_format_announce(This, RDP_CF_TEXT);
+ }
+}
+
+/* Last resort, when we have to provide clipboard data but for whatever
+ reason couldn't get any.
+ */
+static void
+helper_cliprdr_send_empty_response(RDPCLIENT * This)
+{
+ helper_cliprdr_send_response(This, NULL, 0);
+}
+
+/* Replies with clipboard data to RDP, converting it from the target format
+ to the expected RDP format as necessary. Returns true if data was sent.
+ */
+static Bool
+xclip_send_data_with_convert(RDPCLIENT * This, uint8 * source, size_t source_size, Atom target)
+{
+ DEBUG_CLIPBOARD(("xclip_send_data_with_convert: target=%s, size=%u\n",
+ XGetAtomName(This->display, target), (unsigned) source_size));
+
+#ifdef USE_UNICODE_CLIPBOARD
+ if (target == This->xclip.format_string_atom ||
+ target == This->xclip.format_unicode_atom || target == This->xclip.format_utf8_string_atom)
+ {
+ size_t unicode_buffer_size;
+ char *unicode_buffer;
+ iconv_t cd;
+ size_t unicode_buffer_size_remaining;
+ char *unicode_buffer_remaining;
+ char *data_remaining;
+ size_t data_size_remaining;
+ uint32 translated_data_size;
+ uint8 *translated_data;
+
+ if (This->xclip.rdp_clipboard_request_format != RDP_CF_TEXT)
+ return False;
+
+ /* Make an attempt to convert any string we send to Unicode.
+ We don't know what the RDP server's ANSI Codepage is, or how to convert
+ to it, so using CF_TEXT is not safe (and is unnecessary, since all
+ WinNT versions are Unicode-minded).
+ */
+ if (target == This->xclip.format_string_atom)
+ {
+ char *locale_charset = nl_langinfo(CODESET);
+ cd = iconv_open(WINDOWS_CODEPAGE, locale_charset);
+ if (cd == (iconv_t) - 1)
+ {
+ DEBUG_CLIPBOARD(("Locale charset %s not found in iconv. Unable to convert clipboard text.\n", locale_charset));
+ return False;
+ }
+ unicode_buffer_size = source_size * 4;
+ }
+ else if (target == This->xclip.format_unicode_atom)
+ {
+ cd = iconv_open(WINDOWS_CODEPAGE, "UCS-2");
+ if (cd == (iconv_t) - 1)
+ {
+ return False;
+ }
+ unicode_buffer_size = source_size;
+ }
+ else if (target == This->xclip.format_utf8_string_atom)
+ {
+ cd = iconv_open(WINDOWS_CODEPAGE, "UTF-8");
+ if (cd == (iconv_t) - 1)
+ {
+ return False;
+ }
+ /* UTF-8 is guaranteed to be less or equally compact
+ as UTF-16 for all Unicode chars >=2 bytes.
+ */
+ unicode_buffer_size = source_size * 2;
+ }
+ else
+ {
+ return False;
+ }
+
+ unicode_buffer = xmalloc(unicode_buffer_size);
+ unicode_buffer_size_remaining = unicode_buffer_size;
+ unicode_buffer_remaining = unicode_buffer;
+ data_remaining = (char *) source;
+ data_size_remaining = source_size;
+ iconv(cd, (ICONV_CONST char **) &data_remaining, &data_size_remaining,
+ &unicode_buffer_remaining, &unicode_buffer_size_remaining);
+ iconv_close(cd);
+
+ /* translate linebreaks */
+ translated_data_size = unicode_buffer_size - unicode_buffer_size_remaining;
+ translated_data = utf16_lf2crlf((uint8 *) unicode_buffer, &translated_data_size);
+ if (translated_data != NULL)
+ {
+ DEBUG_CLIPBOARD(("Sending Unicode string of %d bytes\n",
+ translated_data_size));
+ helper_cliprdr_send_response(This, translated_data, translated_data_size);
+ xfree(translated_data); /* Not the same thing as XFree! */
+ }
+
+ xfree(unicode_buffer);
+
+ return True;
+ }
+#else
+ if (target == This->xclip.format_string_atom)
+ {
+ uint8 *translated_data;
+ uint32 length = source_size;
+
+ if (This->xclip.rdp_clipboard_request_format != RDP_CF_TEXT)
+ return False;
+
+ DEBUG_CLIPBOARD(("Translating linebreaks before sending data\n"));
+ translated_data = lf2crlf(source, &length);
+ if (translated_data != NULL)
+ {
+ helper_cliprdr_send_response(This, translated_data, length);
+ xfree(translated_data); /* Not the same thing as XFree! */
+ }
+
+ return True;
+ }
+#endif
+ else if (target == This->xclip.rdesktop_native_atom)
+ {
+ helper_cliprdr_send_response(This, source, source_size + 1);
+
+ return True;
+ }
+ else
+ {
+ return False;
+ }
+}
+
+static void
+xclip_clear_target_props(RDPCLIENT * This)
+{
+ XDeleteProperty(This->display, This->wnd, This->xclip.rdesktop_clipboard_target_atom);
+ XDeleteProperty(This->display, This->wnd, This->xclip.rdesktop_primary_timestamp_target_atom);
+ XDeleteProperty(This->display, This->wnd, This->xclip.rdesktop_clipboard_timestamp_target_atom);
+}
+
+static void
+xclip_notify_change(RDPCLIENT * This)
+{
+ XChangeProperty(This->display, DefaultRootWindow(This->display),
+ This->xclip.rdesktop_selection_notify_atom, XA_INTEGER, 32, PropModeReplace, NULL, 0);
+}
+
+static void
+xclip_probe_selections(RDPCLIENT * This)
+{
+ Window primary_owner, clipboard_owner;
+
+ if (This->xclip.probing_selections)
+ {
+ DEBUG_CLIPBOARD(("Already probing selections. Scheduling reprobe.\n"));
+ This->xclip.reprobe_selections = True;
+ return;
+ }
+
+ DEBUG_CLIPBOARD(("Probing selections.\n"));
+
+ This->xclip.probing_selections = True;
+ This->xclip.reprobe_selections = False;
+
+ xclip_clear_target_props(This);
+
+ if (This->xclip.auto_mode)
+ primary_owner = XGetSelectionOwner(This->display, This->xclip.primary_atom);
+ else
+ primary_owner = None;
+
+ clipboard_owner = XGetSelectionOwner(This->display, This->xclip.clipboard_atom);
+
+ /* If we own all relevant selections then don't do anything. */
+ if (((primary_owner == This->wnd) || !This->xclip.auto_mode) && (clipboard_owner == This->wnd))
+ goto end;
+
+ /* Both available */
+ if ((primary_owner != None) && (clipboard_owner != None))
+ {
+ This->xclip.primary_timestamp = 0;
+ This->xclip.clipboard_timestamp = 0;
+ XConvertSelection(This->display, This->xclip.primary_atom, This->xclip.timestamp_atom,
+ This->xclip.rdesktop_primary_timestamp_target_atom, This->wnd, CurrentTime);
+ XConvertSelection(This->display, This->xclip.clipboard_atom, This->xclip.timestamp_atom,
+ This->xclip.rdesktop_clipboard_timestamp_target_atom, This->wnd, CurrentTime);
+ return;
+ }
+
+ /* Just PRIMARY */
+ if (primary_owner != None)
+ {
+ XConvertSelection(This->display, This->xclip.primary_atom, This->xclip.targets_atom,
+ This->xclip.rdesktop_clipboard_target_atom, This->wnd, CurrentTime);
+ return;
+ }
+
+ /* Just CLIPBOARD */
+ if (clipboard_owner != None)
+ {
+ XConvertSelection(This->display, This->xclip.clipboard_atom, This->xclip.targets_atom,
+ This->xclip.rdesktop_clipboard_target_atom, This->wnd, CurrentTime);
+ return;
+ }
+
+ DEBUG_CLIPBOARD(("No owner of any selection.\n"));
+
+ /* FIXME:
+ Without XFIXES, we cannot reliably know the formats offered by an
+ upcoming selection owner, so we just lie about him offering
+ RDP_CF_TEXT. */
+ cliprdr_send_simple_native_format_announce(This, RDP_CF_TEXT);
+
+ end:
+ This->xclip.probing_selections = False;
+}
+
+/* This function is called for SelectionNotify events.
+ The SelectionNotify event is sent from the clipboard owner to the requestor
+ after his request was satisfied.
+ If this function is called, we're the requestor side. */
+#ifndef MAKE_PROTO
+void
+xclip_handle_SelectionNotify(RDPCLIENT * This, XSelectionEvent * event)
+{
+ unsigned long nitems, bytes_left;
+ XWindowAttributes wa;
+ Atom type;
+ Atom *supported_targets;
+ int res, i, format;
+ uint8 *data = NULL;
+
+ if (event->property == None)
+ goto fail;
+
+ DEBUG_CLIPBOARD(("xclip_handle_SelectionNotify: selection=%s, target=%s, property=%s\n",
+ XGetAtomName(This->display, event->selection),
+ XGetAtomName(This->display, event->target),
+ XGetAtomName(This->display, event->property)));
+
+ if (event->target == This->xclip.timestamp_atom)
+ {
+ if (event->selection == This->xclip.primary_atom)
+ {
+ res = XGetWindowProperty(This->display, This->wnd,
+ This->xclip.rdesktop_primary_timestamp_target_atom, 0,
+ XMaxRequestSize(This->display), False, AnyPropertyType,
+ &type, &format, &nitems, &bytes_left, &data);
+ }
+ else
+ {
+ res = XGetWindowProperty(This->display, This->wnd,
+ This->xclip.rdesktop_clipboard_timestamp_target_atom, 0,
+ XMaxRequestSize(This->display), False, AnyPropertyType,
+ &type, &format, &nitems, &bytes_left, &data);
+ }
+
+
+ if ((res != Success) || (nitems != 1) || (format != 32))
+ {
+ DEBUG_CLIPBOARD(("XGetWindowProperty failed!\n"));
+ goto fail;
+ }
+
+ if (event->selection == This->xclip.primary_atom)
+ {
+ This->xclip.primary_timestamp = *(Time *) data;
+ if (This->xclip.primary_timestamp == 0)
+ This->xclip.primary_timestamp++;
+ XDeleteProperty(This->display, This->wnd, This->xclip.rdesktop_primary_timestamp_target_atom);
+ DEBUG_CLIPBOARD(("Got PRIMARY timestamp: %u\n",
+ (unsigned) This->xclip.primary_timestamp));
+ }
+ else
+ {
+ This->xclip.clipboard_timestamp = *(Time *) data;
+ if (This->xclip.clipboard_timestamp == 0)
+ This->xclip.clipboard_timestamp++;
+ XDeleteProperty(This->display, This->wnd, This->xclip.rdesktop_clipboard_timestamp_target_atom);
+ DEBUG_CLIPBOARD(("Got CLIPBOARD timestamp: %u\n",
+ (unsigned) This->xclip.clipboard_timestamp));
+ }
+
+ XFree(data);
+
+ if (This->xclip.primary_timestamp && This->xclip.clipboard_timestamp)
+ {
+ if (This->xclip.primary_timestamp > This->xclip.clipboard_timestamp)
+ {
+ DEBUG_CLIPBOARD(("PRIMARY is most recent selection.\n"));
+ XConvertSelection(This->display, This->xclip.primary_atom, This->xclip.targets_atom,
+ This->xclip.rdesktop_clipboard_target_atom, This->wnd,
+ event->time);
+ }
+ else
+ {
+ DEBUG_CLIPBOARD(("CLIPBOARD is most recent selection.\n"));
+ XConvertSelection(This->display, This->xclip.clipboard_atom, This->xclip.targets_atom,
+ This->xclip.rdesktop_clipboard_target_atom, This->wnd,
+ event->time);
+ }
+ }
+
+ return;
+ }
+
+ if (This->xclip.probing_selections && This->xclip.reprobe_selections)
+ {
+ This->xclip.probing_selections = False;
+ xclip_probe_selections(This);
+ return;
+ }
+
+ res = XGetWindowProperty(This->display, This->wnd, This->xclip.rdesktop_clipboard_target_atom,
+ 0, XMaxRequestSize(This->display), False, AnyPropertyType,
+ &type, &format, &nitems, &bytes_left, &data);
+
+ xclip_clear_target_props(This);
+
+ if (res != Success)
+ {
+ DEBUG_CLIPBOARD(("XGetWindowProperty failed!\n"));
+ goto fail;
+ }
+
+ if (type == This->xclip.incr_atom)
+ {
+ DEBUG_CLIPBOARD(("Received INCR.\n"));
+
+ XGetWindowAttributes(This->display, This->wnd, &wa);
+ if ((wa.your_event_mask | PropertyChangeMask) != wa.your_event_mask)
+ {
+ XSelectInput(This->display, This->wnd, (wa.your_event_mask | PropertyChangeMask));
+ }
+ XFree(data);
+ This->xclip.incr_target = event->target;
+ This->xclip.waiting_for_INCR = 1;
+ goto end;
+ }
+
+ /* Negotiate target format */
+ if (event->target == This->xclip.targets_atom)
+ {
+ /* Determine the best of text This->xclip.targets that we have available:
+ Prefer UTF8_STRING > text/unicode (unspecified encoding) > STRING
+ (ignore TEXT and COMPOUND_TEXT because we don't have code to handle them)
+ */
+ int text_target_satisfaction = 0;
+ Atom best_text_target = 0; /* measures how much we're satisfied with what we found */
+ if (type != None)
+ {
+ supported_targets = (Atom *) data;
+ for (i = 0; i < nitems; i++)
+ {
+ DEBUG_CLIPBOARD(("Target %d: %s\n", i,
+ XGetAtomName(This->display, supported_targets[i])));
+ if (supported_targets[i] == This->xclip.format_string_atom)
+ {
+ if (text_target_satisfaction < 1)
+ {
+ DEBUG_CLIPBOARD(("Other party supports STRING, choosing that as best_target\n"));
+ best_text_target = supported_targets[i];
+ text_target_satisfaction = 1;
+ }
+ }
+#ifdef USE_UNICODE_CLIPBOARD
+ else if (supported_targets[i] == This->xclip.format_unicode_atom)
+ {
+ if (text_target_satisfaction < 2)
+ {
+ DEBUG_CLIPBOARD(("Other party supports text/unicode, choosing that as best_target\n"));
+ best_text_target = supported_targets[i];
+ text_target_satisfaction = 2;
+ }
+ }
+ else if (supported_targets[i] == This->xclip.format_utf8_string_atom)
+ {
+ if (text_target_satisfaction < 3)
+ {
+ DEBUG_CLIPBOARD(("Other party supports UTF8_STRING, choosing that as best_target\n"));
+ best_text_target = supported_targets[i];
+ text_target_satisfaction = 3;
+ }
+ }
+#endif
+ else if (supported_targets[i] == This->xclip.rdesktop_clipboard_formats_atom)
+ {
+ if (This->xclip.probing_selections && (text_target_satisfaction < 4))
+ {
+ DEBUG_CLIPBOARD(("Other party supports native formats, choosing that as best_target\n"));
+ best_text_target = supported_targets[i];
+ text_target_satisfaction = 4;
+ }
+ }
+ }
+ }
+
+ /* Kickstarting the next step in the process of satisfying RDP's
+ clipboard request -- specifically, requesting the actual clipboard data.
+ */
+ if ((best_text_target != 0)
+ && (!This->xclip.probing_selections
+ || (best_text_target == This->xclip.rdesktop_clipboard_formats_atom)))
+ {
+ XConvertSelection(This->display, event->selection, best_text_target,
+ This->xclip.rdesktop_clipboard_target_atom, This->wnd, event->time);
+ goto end;
+ }
+ else
+ {
+ DEBUG_CLIPBOARD(("Unable to find a textual target to satisfy RDP clipboard text request\n"));
+ goto fail;
+ }
+ }
+ else
+ {
+ if (This->xclip.probing_selections)
+ {
+ Window primary_owner, clipboard_owner;
+
+ /* FIXME:
+ Without XFIXES, we must make sure that the other
+ rdesktop owns all relevant selections or we might try
+ to get a native format from non-rdesktop window later
+ on. */
+
+ clipboard_owner = XGetSelectionOwner(This->display, This->xclip.clipboard_atom);
+
+ if (This->xclip.auto_mode)
+ primary_owner = XGetSelectionOwner(This->display, This->xclip.primary_atom);
+ else
+ primary_owner = clipboard_owner;
+
+ if (primary_owner != clipboard_owner)
+ goto fail;
+
+ DEBUG_CLIPBOARD(("Got fellow rdesktop formats\n"));
+ This->xclip.probing_selections = False;
+ This->xclip.rdesktop_is_selection_owner = True;
+ cliprdr_send_native_format_announce(This, data, nitems);
+ }
+ else if (!xclip_send_data_with_convert(This, data, nitems, event->target))
+ {
+ goto fail;
+ }
+ }
+
+ end:
+ if (data)
+ XFree(data);
+
+ return;
+
+ fail:
+ xclip_clear_target_props(This);
+ if (This->xclip.probing_selections)
+ {
+ DEBUG_CLIPBOARD(("Unable to find suitable target. Using default text format.\n"));
+ This->xclip.probing_selections = False;
+ This->xclip.rdesktop_is_selection_owner = False;
+
+ /* FIXME:
+ Without XFIXES, we cannot reliably know the formats offered by an
+ upcoming selection owner, so we just lie about him offering
+ RDP_CF_TEXT. */
+ cliprdr_send_simple_native_format_announce(This, RDP_CF_TEXT);
+ }
+ else
+ {
+ helper_cliprdr_send_empty_response(This);
+ }
+ goto end;
+}
+
+/* This function is called for SelectionRequest events.
+ The SelectionRequest event is sent from the requestor to the clipboard owner
+ to request clipboard data.
+ */
+void
+xclip_handle_SelectionRequest(RDPCLIENT * This, XSelectionRequestEvent * event)
+{
+ unsigned long nitems, bytes_left;
+ unsigned char *prop_return;
+ int format, res;
+ Atom type;
+
+ DEBUG_CLIPBOARD(("xclip_handle_SelectionRequest: selection=%s, target=%s, property=%s\n",
+ XGetAtomName(This->display, event->selection),
+ XGetAtomName(This->display, event->target),
+ XGetAtomName(This->display, event->property)));
+
+ if (event->target == This->xclip.targets_atom)
+ {
+ xclip_provide_selection(This, event, XA_ATOM, 32, (uint8 *) & This->xclip.targets, This->xclip.num_targets);
+ return;
+ }
+ else if (event->target == This->xclip.timestamp_atom)
+ {
+ xclip_provide_selection(This, event, XA_INTEGER, 32, (uint8 *) & This->xclip.acquire_time, 1);
+ return;
+ }
+ else if (event->target == This->xclip.rdesktop_clipboard_formats_atom)
+ {
+ xclip_provide_selection(This, event, XA_STRING, 8, This->xclip.formats_data, This->xclip.formats_data_length);
+ }
+ else
+ {
+ /* All the following This->xclip.targets require an async operation with the RDP server
+ and currently we don't do X clipboard request queueing so we can only
+ handle one such request at a time. */
+ if (This->xclip.has_selection_request)
+ {
+ DEBUG_CLIPBOARD(("Error: Another clipboard request was already sent to the RDP server and not yet responded. Refusing this request.\n"));
+ xclip_refuse_selection(This, event);
+ return;
+ }
+ if (event->target == This->xclip.rdesktop_native_atom)
+ {
+ /* Before the requestor makes a request for the _RDESKTOP_NATIVE target,
+ he should declare requestor[property] = CF_SOMETHING. */
+ res = XGetWindowProperty(This->display, event->requestor,
+ event->property, 0, 1, True,
+ XA_INTEGER, &type, &format, &nitems, &bytes_left,
+ &prop_return);
+ if (res != Success)
+ {
+ DEBUG_CLIPBOARD(("Requested native format but didn't specifiy which.\n"));
+ xclip_refuse_selection(This, event);
+ return;
+ }
+
+ format = *(uint32 *) prop_return;
+ XFree(prop_return);
+ }
+ else if (event->target == This->xclip.format_string_atom || event->target == XA_STRING)
+ {
+ /* STRING and XA_STRING are defined to be ISO8859-1 */
+ format = CF_TEXT;
+ }
+ else if (event->target == This->xclip.format_utf8_string_atom)
+ {
+#ifdef USE_UNICODE_CLIPBOARD
+ format = CF_UNICODETEXT;
+#else
+ DEBUG_CLIPBOARD(("Requested target unavailable due to lack of Unicode support. (It was not in TARGETS, so why did you ask for it?!)\n"));
+ xclip_refuse_selection(This, event);
+ return;
+#endif
+ }
+ else if (event->target == This->xclip.format_unicode_atom)
+ {
+ /* Assuming text/unicode to be UTF-16 */
+ format = CF_UNICODETEXT;
+ }
+ else
+ {
+ DEBUG_CLIPBOARD(("Requested target unavailable. (It was not in TARGETS, so why did you ask for it?!)\n"));
+ xclip_refuse_selection(This, event);
+ return;
+ }
+
+ cliprdr_send_data_request(This, format);
+ This->xclip.selection_request = *event;
+ This->xclip.has_selection_request = True;
+ return; /* wait for data */
+ }
+}
+
+/* While this rdesktop holds ownership over the clipboard, it means the clipboard data
+ is offered by the RDP server (and when it is pasted inside RDP, there's no network
+ roundtrip).
+
+ This event (SelectionClear) symbolizes this rdesktop lost onwership of the clipboard
+ to some other X client. We should find out what clipboard formats this other
+ client offers and announce that to RDP. */
+void
+xclip_handle_SelectionClear(RDPCLIENT * This)
+{
+ DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n"));
+ xclip_notify_change(This);
+ xclip_probe_selections(This);
+}
+
+/* Called when any property changes in our window or the root window. */
+void
+xclip_handle_PropertyNotify(RDPCLIENT * This, XPropertyEvent * event)
+{
+ unsigned long nitems;
+ unsigned long offset = 0;
+ unsigned long bytes_left = 1;
+ int format;
+ XWindowAttributes wa;
+ uint8 *data;
+ Atom type;
+
+ if (event->state == PropertyNewValue && This->xclip.waiting_for_INCR)
+ {
+ DEBUG_CLIPBOARD(("x_clip_handle_PropertyNotify: This->xclip.waiting_for_INCR != 0\n"));
+
+ while (bytes_left > 0)
+ {
+ /* Unlike the specification, we don't set the 'delete' arugment to True
+ since we slurp the INCR's chunks in even-smaller chunks of 4096 bytes. */
+ if ((XGetWindowProperty
+ (This->display, This->wnd, This->xclip.rdesktop_clipboard_target_atom, offset, 4096L,
+ False, AnyPropertyType, &type, &format, &nitems, &bytes_left,
+ &data) != Success))
+ {
+ XFree(data);
+ return;
+ }
+
+ if (nitems == 0)
+ {
+ /* INCR transfer finished */
+ XGetWindowAttributes(This->display, This->wnd, &wa);
+ XSelectInput(This->display, This->wnd,
+ (wa.your_event_mask ^ PropertyChangeMask));
+ XFree(data);
+ This->xclip.waiting_for_INCR = 0;
+
+ if (This->xclip.clip_buflen > 0)
+ {
+ if (!xclip_send_data_with_convert
+ (This, This->xclip.clip_buffer, This->xclip.clip_buflen, This->xclip.incr_target))
+ {
+ helper_cliprdr_send_empty_response(This);
+ }
+ xfree(This->xclip.clip_buffer);
+ This->xclip.clip_buffer = NULL;
+ This->xclip.clip_buflen = 0;
+ }
+ }
+ else
+ {
+ /* Another chunk in the INCR transfer */
+ offset += (nitems / 4); /* offset at which to begin the next slurp */
+ This->xclip.clip_buffer = xrealloc(This->xclip.clip_buffer, This->xclip.clip_buflen + nitems);
+ memcpy(This->xclip.clip_buffer + This->xclip.clip_buflen, data, nitems);
+ This->xclip.clip_buflen += nitems;
+
+ XFree(data);
+ }
+ }
+ XDeleteProperty(This->display, This->wnd, This->xclip.rdesktop_clipboard_target_atom);
+ return;
+ }
+
+ if ((event->atom == This->xclip.rdesktop_selection_notify_atom) &&
+ (event->window == DefaultRootWindow(This->display)))
+ xclip_probe_selections(This);
+}
+#endif
+
+
+/* Called when the RDP server announces new clipboard data formats.
+ In response, we:
+ - take ownership over the clipboard
+ - declare those formats in their Windows native form
+ to other rdesktop instances on this X server */
+void
+ui_clip_format_announce(RDPCLIENT * This, uint8 * data, uint32 length)
+{
+ This->xclip.acquire_time = This->last_gesturetime;
+
+ XSetSelectionOwner(This->display, This->xclip.primary_atom, This->wnd, This->xclip.acquire_time);
+ if (XGetSelectionOwner(This->display, This->xclip.primary_atom) != This->wnd)
+ warning("Failed to aquire ownership of PRIMARY clipboard\n");
+
+ XSetSelectionOwner(This->display, This->xclip.clipboard_atom, This->wnd, This->xclip.acquire_time);
+ if (XGetSelectionOwner(This->display, This->xclip.clipboard_atom) != This->wnd)
+ warning("Failed to aquire ownership of CLIPBOARD clipboard\n");
+
+ if (This->xclip.formats_data)
+ xfree(This->xclip.formats_data);
+ This->xclip.formats_data = xmalloc(length);
+ memcpy(This->xclip.formats_data, data, length);
+ This->xclip.formats_data_length = length;
+
+ xclip_notify_change(This);
+}
+
+/* Called when the RDP server responds with clipboard data (after we've requested it). */
+void
+ui_clip_handle_data(RDPCLIENT * This, uint8 * data, uint32 length)
+{
+ BOOL free_data = False;
+
+ if (length == 0)
+ {
+ xclip_refuse_selection(This, &This->xclip.selection_request);
+ This->xclip.has_selection_request = False;
+ return;
+ }
+
+ if (This->xclip.selection_request.target == This->xclip.format_string_atom || This->xclip.selection_request.target == XA_STRING)
+ {
+ /* We're expecting a CF_TEXT response */
+ uint8 *firstnull;
+
+ /* translate linebreaks */
+ crlf2lf(data, &length);
+
+ /* Only send data up to null byte, if any */
+ firstnull = (uint8 *) strchr((char *) data, '\0');
+ if (firstnull)
+ {
+ length = firstnull - data + 1;
+ }
+ }
+#ifdef USE_UNICODE_CLIPBOARD
+ else if (This->xclip.selection_request.target == This->xclip.format_utf8_string_atom)
+ {
+ /* We're expecting a CF_UNICODETEXT response */
+ iconv_t cd = iconv_open("UTF-8", WINDOWS_CODEPAGE);
+ if (cd != (iconv_t) - 1)
+ {
+ size_t utf8_length = length * 2;
+ char *utf8_data = malloc(utf8_length);
+ size_t utf8_length_remaining = utf8_length;
+ char *utf8_data_remaining = utf8_data;
+ char *data_remaining = (char *) data;
+ size_t length_remaining = (size_t) length;
+ if (utf8_data == NULL)
+ {
+ iconv_close(cd);
+ return;
+ }
+ iconv(cd, (ICONV_CONST char **) &data_remaining, &length_remaining,
+ &utf8_data_remaining, &utf8_length_remaining);
+ iconv_close(cd);
+ free_data = True;
+ data = (uint8 *) utf8_data;
+ length = utf8_length - utf8_length_remaining;
+ }
+ }
+ else if (This->xclip.selection_request.target == This->xclip.format_unicode_atom)
+ {
+ /* We're expecting a CF_UNICODETEXT response, so what we're
+ receiving matches our requirements and there's no need
+ for further conversions. */
+ }
+#endif
+ else if (This->xclip.selection_request.target == This->xclip.rdesktop_native_atom)
+ {
+ /* Pass as-is */
+ }
+ else
+ {
+ DEBUG_CLIPBOARD(("ui_clip_handle_data: BUG! I don't know how to convert selection target %s!\n", XGetAtomName(This->display, This->xclip.selection_request.target)));
+ xclip_refuse_selection(This, &This->xclip.selection_request);
+ This->xclip.has_selection_request = False;
+ return;
+ }
+
+ xclip_provide_selection(This, &This->xclip.selection_request, This->xclip.selection_request.target, 8, data, length - 1);
+ This->xclip.has_selection_request = False;
+
+ if (free_data)
+ free(data);
+}
+
+void
+ui_clip_request_failed(RDPCLIENT * This)
+{
+ xclip_refuse_selection(This, &This->xclip.selection_request);
+ This->xclip.has_selection_request = False;
+}
+
+void
+ui_clip_request_data(RDPCLIENT * This, uint32 format)
+{
+ Window primary_owner, clipboard_owner;
+
+ DEBUG_CLIPBOARD(("Request from server for format %d\n", format));
+ This->xclip.rdp_clipboard_request_format = format;
+
+ if (This->xclip.probing_selections)
+ {
+ DEBUG_CLIPBOARD(("ui_clip_request_data: Selection probe in progress. Cannot handle request.\n"));
+ helper_cliprdr_send_empty_response(This);
+ return;
+ }
+
+ xclip_clear_target_props(This);
+
+ if (This->xclip.rdesktop_is_selection_owner)
+ {
+ XChangeProperty(This->display, This->wnd, This->xclip.rdesktop_clipboard_target_atom,
+ XA_INTEGER, 32, PropModeReplace, (unsigned char *) &format, 1);
+
+ XConvertSelection(This->display, This->xclip.primary_atom, This->xclip.rdesktop_native_atom,
+ This->xclip.rdesktop_clipboard_target_atom, This->wnd, CurrentTime);
+ return;
+ }
+
+ if (This->xclip.auto_mode)
+ primary_owner = XGetSelectionOwner(This->display, This->xclip.primary_atom);
+ else
+ primary_owner = None;
+
+ clipboard_owner = XGetSelectionOwner(This->display, This->xclip.clipboard_atom);
+
+ /* Both available */
+ if ((primary_owner != None) && (clipboard_owner != None))
+ {
+ This->xclip.primary_timestamp = 0;
+ This->xclip.clipboard_timestamp = 0;
+ XConvertSelection(This->display, This->xclip.primary_atom, This->xclip.timestamp_atom,
+ This->xclip.rdesktop_primary_timestamp_target_atom, This->wnd, CurrentTime);
+ XConvertSelection(This->display, This->xclip.clipboard_atom, This->xclip.timestamp_atom,
+ This->xclip.rdesktop_clipboard_timestamp_target_atom, This->wnd, CurrentTime);
+ return;
+ }
+
+ /* Just PRIMARY */
+ if (primary_owner != None)
+ {
+ XConvertSelection(This->display, This->xclip.primary_atom, This->xclip.targets_atom,
+ This->xclip.rdesktop_clipboard_target_atom, This->wnd, CurrentTime);
+ return;
+ }
+
+ /* Just CLIPBOARD */
+ if (clipboard_owner != None)
+ {
+ XConvertSelection(This->display, This->xclip.clipboard_atom, This->xclip.targets_atom,
+ This->xclip.rdesktop_clipboard_target_atom, This->wnd, CurrentTime);
+ return;
+ }
+
+ /* No data available */
+ helper_cliprdr_send_empty_response(This);
+}
+
+void
+ui_clip_sync(RDPCLIENT * This)
+{
+ xclip_probe_selections(This);
+}
+
+void
+ui_clip_set_mode(RDPCLIENT * This, const char *optarg)
+{
+ This->rdpclip = True;
+
+ if (str_startswith(optarg, "PRIMARYCLIPBOARD"))
+ This->xclip.auto_mode = True;
+ else if (str_startswith(optarg, "CLIPBOARD"))
+ This->xclip.auto_mode = False;
+ else
+ {
+ warning("Invalid clipboard mode '%s'.\n", optarg);
+ This->rdpclip = False;
+ }
+}
+
+void
+xclip_init(RDPCLIENT * This)
+{
+ if (!This->rdpclip)
+ return;
+
+ if (!cliprdr_init(This))
+ return;
+
+ This->xclip.primary_atom = XInternAtom(This->display, "PRIMARY", False);
+ This->xclip.clipboard_atom = XInternAtom(This->display, "CLIPBOARD", False);
+ This->xclip.targets_atom = XInternAtom(This->display, "TARGETS", False);
+ This->xclip.timestamp_atom = XInternAtom(This->display, "TIMESTAMP", False);
+ This->xclip.rdesktop_clipboard_target_atom =
+ XInternAtom(This->display, "_RDESKTOP_CLIPBOARD_TARGET", False);
+ This->xclip.rdesktop_primary_timestamp_target_atom =
+ XInternAtom(This->display, "_RDESKTOP_PRIMARY_TIMESTAMP_TARGET", False);
+ This->xclip.rdesktop_clipboard_timestamp_target_atom =
+ XInternAtom(This->display, "_RDESKTOP_CLIPBOARD_TIMESTAMP_TARGET", False);
+ This->xclip.incr_atom = XInternAtom(This->display, "INCR", False);
+ This->xclip.format_string_atom = XInternAtom(This->display, "STRING", False);
+ This->xclip.format_utf8_string_atom = XInternAtom(This->display, "UTF8_STRING", False);
+ This->xclip.format_unicode_atom = XInternAtom(This->display, "text/unicode", False);
+
+ /* rdesktop sets _RDESKTOP_SELECTION_NOTIFY on the root window when acquiring the clipboard.
+ Other interested rdesktops can use this to notify their server of the available formats. */
+ This->xclip.rdesktop_selection_notify_atom =
+ XInternAtom(This->display, "_RDESKTOP_SELECTION_NOTIFY", False);
+ XSelectInput(This->display, DefaultRootWindow(This->display), PropertyChangeMask);
+ This->xclip.probing_selections = False;
+
+ This->xclip.rdesktop_native_atom = XInternAtom(This->display, "_RDESKTOP_NATIVE", False);
+ This->xclip.rdesktop_clipboard_formats_atom =
+ XInternAtom(This->display, "_RDESKTOP_CLIPBOARD_FORMATS", False);
+ This->xclip.rdesktop_primary_owner_atom = XInternAtom(This->display, "_RDESKTOP_PRIMARY_OWNER", False);
+ This->xclip.rdesktop_clipboard_owner_atom = XInternAtom(This->display, "_RDESKTOP_CLIPBOARD_OWNER", False);
+
+ This->xclip.num_targets = 0;
+ This->xclip.targets[This->xclip.num_targets++] = This->xclip.targets_atom;
+ This->xclip.targets[This->xclip.num_targets++] = This->xclip.timestamp_atom;
+ This->xclip.targets[This->xclip.num_targets++] = This->xclip.rdesktop_native_atom;
+ This->xclip.targets[This->xclip.num_targets++] = This->xclip.rdesktop_clipboard_formats_atom;
+#ifdef USE_UNICODE_CLIPBOARD
+ This->xclip.targets[This->xclip.num_targets++] = This->xclip.format_utf8_string_atom;
+#endif
+ This->xclip.targets[This->xclip.num_targets++] = This->xclip.format_unicode_atom;
+ This->xclip.targets[This->xclip.num_targets++] = This->xclip.format_string_atom;
+ This->xclip.targets[This->xclip.num_targets++] = XA_STRING;
+}
+
+void
+xclip_deinit(RDPCLIENT * This)
+{
+ if (XGetSelectionOwner(This->display, This->xclip.primary_atom) == This->wnd)
+ XSetSelectionOwner(This->display, This->xclip.primary_atom, None, This->xclip.acquire_time);
+ if (XGetSelectionOwner(This->display, This->xclip.clipboard_atom) == This->wnd)
+ XSetSelectionOwner(This->display, This->xclip.clipboard_atom, None, This->xclip.acquire_time);
+ xclip_notify_change(This);
+}
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ User interface services - X keyboard mapping
+
+ Copyright (C) Matthew Chapman 1999-2005
+ Copyright (C) Peter Astrand <peter@cendio.se> 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifdef RDP2VNC
+#include "vnc/x11stubs.h"
+#else
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+#endif
+
+#include <ctype.h>
+#include <limits.h>
+#include <time.h>
+#include <string.h>
+#include "rdesktop.h"
+#include "scancodes.h"
+
+#define KEYMAP_MASK 0xffff
+#define KEYMAP_MAX_LINE_LENGTH 80
+
+static void update_modifier_state(RDPCLIENT * This, uint8 scancode, BOOL pressed);
+
+/* Free key_translation structure, including linked list */
+static void
+free_key_translation(key_translation * ptr)
+{
+ key_translation *next;
+
+ while (ptr)
+ {
+ next = ptr->next;
+ xfree(ptr);
+ ptr = next;
+ }
+}
+
+static void
+add_to_keymap(RDPCLIENT * This, char *keyname, uint8 scancode, uint16 modifiers, char *mapname)
+{
+ KeySym keysym;
+ key_translation *tr;
+
+ keysym = XStringToKeysym(keyname);
+ if (keysym == NoSymbol)
+ {
+ DEBUG_KBD(("Bad keysym \"%s\" in keymap %s (ignoring)\n", keyname, mapname));
+ return;
+ }
+
+ DEBUG_KBD(("Adding translation, keysym=0x%x, scancode=0x%x, "
+ "modifiers=0x%x\n", (unsigned int) keysym, scancode, modifiers));
+
+ tr = (key_translation *) xmalloc(sizeof(key_translation));
+ memset(tr, 0, sizeof(key_translation));
+ tr->scancode = scancode;
+ tr->modifiers = modifiers;
+ free_key_translation(This->xkeymap.keymap[keysym & KEYMAP_MASK]);
+ This->xkeymap.keymap[keysym & KEYMAP_MASK] = tr;
+
+ return;
+}
+
+static void
+add_sequence(RDPCLIENT * This, char *rest, char *mapname)
+{
+ KeySym keysym;
+ key_translation *tr, **prev_next;
+ size_t chars;
+ char keyname[KEYMAP_MAX_LINE_LENGTH];
+
+ /* Skip over whitespace after the sequence keyword */
+ chars = strspn(rest, " \t");
+ rest += chars;
+
+ /* Fetch the keysym name */
+ chars = strcspn(rest, " \t\0");
+ STRNCPY(keyname, rest, chars + 1);
+ rest += chars;
+
+ keysym = XStringToKeysym(keyname);
+ if (keysym == NoSymbol)
+ {
+ DEBUG_KBD(("Bad keysym \"%s\" in keymap %s (ignoring line)\n", keyname, mapname));
+ return;
+ }
+
+
+ DEBUG_KBD(("Adding sequence for keysym (0x%lx, %s) -> ", keysym, keyname));
+
+ free_key_translation(This->xkeymap.keymap[keysym & KEYMAP_MASK]);
+ prev_next = &This->xkeymap.keymap[keysym & KEYMAP_MASK];
+
+ while (*rest)
+ {
+ /* Skip whitespace */
+ chars = strspn(rest, " \t");
+ rest += chars;
+
+ /* Fetch the keysym name */
+ chars = strcspn(rest, " \t\0");
+ STRNCPY(keyname, rest, chars + 1);
+ rest += chars;
+
+ keysym = XStringToKeysym(keyname);
+ if (keysym == NoSymbol)
+ {
+ DEBUG_KBD(("Bad keysym \"%s\" in keymap %s (ignoring line)\n", keyname,
+ mapname));
+ return;
+ }
+
+ /* Allocate space for key_translation structure */
+ tr = (key_translation *) xmalloc(sizeof(key_translation));
+ memset(tr, 0, sizeof(key_translation));
+ *prev_next = tr;
+ prev_next = &tr->next;
+ tr->seq_keysym = keysym;
+
+ DEBUG_KBD(("0x%x, ", (unsigned int) keysym));
+ }
+ DEBUG_KBD(("\n"));
+}
+
+BOOL
+xkeymap_from_locale(RDPCLIENT * This, const char *locale)
+{
+ char *str, *ptr;
+ FILE *fp;
+
+ /* Create a working copy */
+ str = xstrdup(locale);
+
+ /* Truncate at dot and at */
+ ptr = strrchr(str, '.');
+ if (ptr)
+ *ptr = '\0';
+ ptr = strrchr(str, '@');
+ if (ptr)
+ *ptr = '\0';
+
+ /* Replace _ with - */
+ ptr = strrchr(str, '_');
+ if (ptr)
+ *ptr = '-';
+
+ /* Convert to lowercase */
+ ptr = str;
+ while (*ptr)
+ {
+ *ptr = tolower((int) *ptr);
+ ptr++;
+ }
+
+ /* Try to open this keymap (da-dk) */
+ fp = xkeymap_open(str);
+ if (fp == NULL)
+ {
+ /* Truncate at dash */
+ ptr = strrchr(str, '-');
+ if (ptr)
+ *ptr = '\0';
+
+ /* Try the short name (da) */
+ fp = xkeymap_open(str);
+ }
+
+ if (fp)
+ {
+ fclose(fp);
+ STRNCPY(This->keymapname, str, sizeof(This->keymapname));
+ xfree(str);
+ return True;
+ }
+
+ xfree(str);
+ return False;
+}
+
+
+/* Joins two path components. The result should be freed with
+ xfree(). */
+static char *
+pathjoin(const char *a, const char *b)
+{
+ char *result;
+ result = xmalloc(PATH_MAX * 2 + 1);
+
+ if (b[0] == '/')
+ {
+ strncpy(result, b, PATH_MAX);
+ }
+ else
+ {
+ strncpy(result, a, PATH_MAX);
+ strcat(result, "/");
+ strncat(result, b, PATH_MAX);
+ }
+ return result;
+}
+
+/* Try to open a keymap with fopen() */
+FILE *
+xkeymap_open(const char *filename)
+{
+ char *path1, *path2;
+ char *home;
+ FILE *fp;
+
+ /* Try ~/.rdesktop/keymaps */
+ home = getenv("HOME");
+ if (home)
+ {
+ path1 = pathjoin(home, ".rdesktop/keymaps");
+ path2 = pathjoin(path1, filename);
+ xfree(path1);
+ fp = fopen(path2, "r");
+ xfree(path2);
+ if (fp)
+ return fp;
+ }
+
+ /* Try KEYMAP_PATH */
+ path1 = pathjoin(KEYMAP_PATH, filename);
+ fp = fopen(path1, "r");
+ xfree(path1);
+ if (fp)
+ return fp;
+
+ /* Try current directory, in case we are running from the source
+ tree */
+ path1 = pathjoin("keymaps", filename);
+ fp = fopen(path1, "r");
+ xfree(path1);
+ if (fp)
+ return fp;
+
+ return NULL;
+}
+
+static BOOL
+xkeymap_read(RDPCLIENT * This, char *mapname)
+{
+ FILE *fp;
+ char line[KEYMAP_MAX_LINE_LENGTH];
+ unsigned int line_num = 0;
+ unsigned int line_length = 0;
+ char *keyname, *p;
+ char *line_rest;
+ uint8 scancode;
+ uint16 modifiers;
+
+ fp = xkeymap_open(mapname);
+ if (fp == NULL)
+ {
+ error("Failed to open keymap %s\n", mapname);
+ return False;
+ }
+
+ /* FIXME: More tolerant on white space */
+ while (fgets(line, sizeof(line), fp) != NULL)
+ {
+ line_num++;
+
+ /* Replace the \n with \0 */
+ p = strchr(line, '\n');
+ if (p != NULL)
+ *p = 0;
+
+ line_length = strlen(line);
+
+ /* Completely empty line */
+ if (strspn(line, " \t\n\r\f\v") == line_length)
+ {
+ continue;
+ }
+
+ /* Include */
+ if (str_startswith(line, "include "))
+ {
+ if (!xkeymap_read(This, line + sizeof("include ") - 1))
+ return False;
+ continue;
+ }
+
+ /* map */
+ if (str_startswith(line, "map "))
+ {
+ This->keylayout = strtoul(line + sizeof("map ") - 1, NULL, 16);
+ DEBUG_KBD(("Keylayout 0x%x\n", This->keylayout));
+ continue;
+ }
+
+ /* compose */
+ if (str_startswith(line, "enable_compose"))
+ {
+ DEBUG_KBD(("Enabling compose handling\n"));
+ This->enable_compose = True;
+ continue;
+ }
+
+ /* sequence */
+ if (str_startswith(line, "sequence"))
+ {
+ add_sequence(This, line + sizeof("sequence") - 1, mapname);
+ continue;
+ }
+
+ /* keyboard_type */
+ if (str_startswith(line, "keyboard_type "))
+ {
+ This->keyboard_type = strtol(line + sizeof("keyboard_type ") - 1, NULL, 16);
+ DEBUG_KBD(("keyboard_type 0x%x\n", This->keyboard_type));
+ continue;
+ }
+
+ /* keyboard_subtype */
+ if (str_startswith(line, "keyboard_subtype "))
+ {
+ This->keyboard_subtype =
+ strtol(line + sizeof("keyboard_subtype ") - 1, NULL, 16);
+ DEBUG_KBD(("keyboard_subtype 0x%x\n", This->keyboard_subtype));
+ continue;
+ }
+
+ /* keyboard_functionkeys */
+ if (str_startswith(line, "keyboard_functionkeys "))
+ {
+ This->keyboard_functionkeys =
+ strtol(line + sizeof("keyboard_functionkeys ") - 1, NULL, 16);
+ DEBUG_KBD(("keyboard_functionkeys 0x%x\n", This->keyboard_functionkeys));
+ continue;
+ }
+
+ /* Comment */
+ if (line[0] == '#')
+ {
+ continue;
+ }
+
+ /* Normal line */
+ keyname = line;
+ p = strchr(line, ' ');
+ if (p == NULL)
+ {
+ error("Bad line %d in keymap %s\n", line_num, mapname);
+ continue;
+ }
+ else
+ {
+ *p = 0;
+ }
+
+ /* scancode */
+ p++;
+ scancode = strtol(p, &line_rest, 16);
+
+ /* flags */
+ /* FIXME: Should allow case-insensitive flag names.
+ Fix by using lex+yacc... */
+ modifiers = 0;
+ if (strstr(line_rest, "altgr"))
+ {
+ MASK_ADD_BITS(modifiers, MapAltGrMask);
+ }
+
+ if (strstr(line_rest, "shift"))
+ {
+ MASK_ADD_BITS(modifiers, MapLeftShiftMask);
+ }
+
+ if (strstr(line_rest, "numlock"))
+ {
+ MASK_ADD_BITS(modifiers, MapNumLockMask);
+ }
+
+ if (strstr(line_rest, "localstate"))
+ {
+ MASK_ADD_BITS(modifiers, MapLocalStateMask);
+ }
+
+ if (strstr(line_rest, "inhibit"))
+ {
+ MASK_ADD_BITS(modifiers, MapInhibitMask);
+ }
+
+ add_to_keymap(This, keyname, scancode, modifiers, mapname);
+
+ if (strstr(line_rest, "addupper"))
+ {
+ /* Automatically add uppercase key, with same modifiers
+ plus shift */
+ for (p = keyname; *p; p++)
+ *p = toupper((int) *p);
+ MASK_ADD_BITS(modifiers, MapLeftShiftMask);
+ add_to_keymap(This, keyname, scancode, modifiers, mapname);
+ }
+ }
+
+ fclose(fp);
+ return True;
+}
+
+
+/* Before connecting and creating UI */
+void
+xkeymap_init(RDPCLIENT * This)
+{
+ unsigned int max_keycode;
+
+ if (strcmp(This->keymapname, "none"))
+ {
+ if (xkeymap_read(This, This->keymapname))
+ This->xkeymap.keymap_loaded = True;
+ }
+
+ XDisplayKeycodes(This->display, &This->xkeymap.min_keycode, (int *) &max_keycode);
+}
+
+static void
+send_winkey(RDPCLIENT * This, uint32 ev_time, BOOL pressed, BOOL leftkey)
+{
+ uint8 winkey;
+
+ if (leftkey)
+ winkey = SCANCODE_CHAR_LWIN;
+ else
+ winkey = SCANCODE_CHAR_RWIN;
+
+ if (pressed)
+ {
+ if (This->use_rdp5)
+ {
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS, winkey);
+ }
+ else
+ {
+ /* RDP4 doesn't support winkey. Fake with Ctrl-Esc */
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS, SCANCODE_CHAR_LCTRL);
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS, SCANCODE_CHAR_ESC);
+ }
+ }
+ else
+ {
+ /* key released */
+ if (This->use_rdp5)
+ {
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, winkey);
+ }
+ else
+ {
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_ESC);
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL);
+ }
+ }
+}
+
+static void
+reset_winkey(RDPCLIENT * This, uint32 ev_time)
+{
+ if (This->use_rdp5)
+ {
+ /* For some reason, it seems to suffice to release
+ *either* the left or right winkey. */
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LWIN);
+ }
+}
+
+/* Handle special key combinations */
+BOOL
+handle_special_keys(RDPCLIENT * This, uint32 keysym, unsigned int state, uint32 ev_time, BOOL pressed)
+{
+ switch (keysym)
+ {
+ case XK_Return:
+ if ((get_key_state(This, state, XK_Alt_L) || get_key_state(This, state, XK_Alt_R))
+ && (get_key_state(This, state, XK_Control_L)
+ || get_key_state(This, state, XK_Control_R)))
+ {
+ /* Ctrl-Alt-Enter: toggle full screen */
+ if (pressed)
+ xwin_toggle_fullscreen(This);
+ return True;
+ }
+ break;
+
+ case XK_Break:
+ /* Send Break sequence E0 46 E0 C6 */
+ if (pressed)
+ {
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS,
+ (SCANCODE_EXTENDED | 0x46));
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS,
+ (SCANCODE_EXTENDED | 0xc6));
+ }
+ /* No release sequence */
+ return True;
+ break;
+
+ case XK_Pause:
+ /* According to MS Keyboard Scan Code
+ Specification, pressing Pause should result
+ in E1 1D 45 E1 9D C5. I'm not exactly sure
+ of how this is supposed to be sent via
+ RDP. The code below seems to work, but with
+ the side effect that Left Ctrl stays
+ down. Therefore, we release it when Pause
+ is released. */
+ if (pressed)
+ {
+ rdp_send_input(This, ev_time, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0xe1, 0);
+ rdp_send_input(This, ev_time, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0x1d, 0);
+ rdp_send_input(This, ev_time, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0x45, 0);
+ rdp_send_input(This, ev_time, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0xe1, 0);
+ rdp_send_input(This, ev_time, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0x9d, 0);
+ rdp_send_input(This, ev_time, RDP_INPUT_SCANCODE, RDP_KEYPRESS, 0xc5, 0);
+ }
+ else
+ {
+ /* Release Left Ctrl */
+ rdp_send_input(This, ev_time, RDP_INPUT_SCANCODE, RDP_KEYRELEASE,
+ 0x1d, 0);
+ }
+ return True;
+ break;
+
+ case XK_Meta_L: /* Windows keys */
+ case XK_Super_L:
+ case XK_Hyper_L:
+ send_winkey(This, ev_time, pressed, True);
+ return True;
+ break;
+
+ case XK_Meta_R:
+ case XK_Super_R:
+ case XK_Hyper_R:
+ send_winkey(This, ev_time, pressed, False);
+ return True;
+ break;
+
+ case XK_space:
+ /* Prevent access to the Windows system menu in single app mode */
+ if (This->win_button_size
+ && (get_key_state(This, state, XK_Alt_L) || get_key_state(This, state, XK_Alt_R)))
+ return True;
+ break;
+
+ case XK_Num_Lock:
+ /* Synchronize on key release */
+ if (This->numlock_sync && !pressed)
+ rdp_send_input(This, 0, RDP_INPUT_SYNCHRONIZE, 0,
+ ui_get_numlock_state(This, read_keyboard_state(This)), 0);
+
+ /* Inhibit */
+ return True;
+ break;
+ case XK_Overlay1_Enable:
+ /* Toggle SeamlessRDP */
+ if (pressed)
+ ui_seamless_toggle(This);
+ break;
+
+ }
+ return False;
+}
+
+
+key_translation
+xkeymap_translate_key(RDPCLIENT * This, uint32 keysym, unsigned int keycode, unsigned int state)
+{
+ key_translation tr = { 0, 0, 0, 0 };
+ key_translation *ptr;
+
+ ptr = This->xkeymap.keymap[keysym & KEYMAP_MASK];
+ if (ptr)
+ {
+ tr = *ptr;
+ if (tr.seq_keysym == 0) /* Normal scancode translation */
+ {
+ if (MASK_HAS_BITS(tr.modifiers, MapInhibitMask))
+ {
+ DEBUG_KBD(("Inhibiting key\n"));
+ tr.scancode = 0;
+ return tr;
+ }
+
+ if (MASK_HAS_BITS(tr.modifiers, MapLocalStateMask))
+ {
+ /* The modifiers to send for this key should be obtained
+ from the local state. Currently, only shift is implemented. */
+ if (MASK_HAS_BITS(state, ShiftMask))
+ {
+ tr.modifiers = MapLeftShiftMask;
+ }
+ }
+
+ /* Windows interprets CapsLock+Ctrl+key
+ differently from Shift+Ctrl+key. Since we
+ are simulating CapsLock with Shifts, things
+ like Ctrl+f with CapsLock on breaks. To
+ solve this, we are releasing Shift if Ctrl
+ is on, but only if Shift isn't physically pressed. */
+ if (MASK_HAS_BITS(tr.modifiers, MapShiftMask)
+ && MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapCtrlMask)
+ && !MASK_HAS_BITS(state, ShiftMask))
+ {
+ DEBUG_KBD(("Non-physical Shift + Ctrl pressed, releasing Shift\n"));
+ MASK_REMOVE_BITS(tr.modifiers, MapShiftMask);
+ }
+
+ DEBUG_KBD(("Found scancode translation, scancode=0x%x, modifiers=0x%x\n",
+ tr.scancode, tr.modifiers));
+ }
+ }
+ else
+ {
+ if (This->xkeymap.keymap_loaded)
+ warning("No translation for (keysym 0x%lx, %s)\n", keysym,
+ get_ksname(keysym));
+
+ /* not in keymap, try to interpret the raw scancode */
+ if (((int) keycode >= This->xkeymap.min_keycode) && (keycode <= 0x60))
+ {
+ tr.scancode = keycode - This->xkeymap.min_keycode;
+
+ /* The modifiers to send for this key should be
+ obtained from the local state. Currently, only
+ shift is implemented. */
+ if (MASK_HAS_BITS(state, ShiftMask))
+ {
+ tr.modifiers = MapLeftShiftMask;
+ }
+
+ DEBUG_KBD(("Sending guessed scancode 0x%x\n", tr.scancode));
+ }
+ else
+ {
+ DEBUG_KBD(("No good guess for keycode 0x%x found\n", keycode));
+ }
+ }
+
+ return tr;
+}
+
+void
+xkeymap_send_keys(RDPCLIENT * This, uint32 keysym, unsigned int keycode, unsigned int state, uint32 ev_time,
+ BOOL pressed, uint8 nesting)
+{
+ key_translation tr, *ptr;
+ tr = xkeymap_translate_key(This, keysym, keycode, state);
+
+ if (tr.seq_keysym == 0)
+ {
+ /* Scancode translation */
+ if (tr.scancode == 0)
+ return;
+
+ if (pressed)
+ {
+ save_remote_modifiers(This, tr.scancode);
+ ensure_remote_modifiers(This, ev_time, tr);
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS, tr.scancode);
+ restore_remote_modifiers(This, ev_time, tr.scancode);
+ }
+ else
+ {
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, tr.scancode);
+ }
+ return;
+ }
+
+ /* Sequence, only on key down */
+ if (pressed)
+ {
+ ptr = &tr;
+ do
+ {
+ DEBUG_KBD(("Handling sequence element, keysym=0x%x\n",
+ (unsigned int) ptr->seq_keysym));
+
+ if (nesting++ > 32)
+ {
+ error("Sequence nesting too deep\n");
+ return;
+ }
+
+ xkeymap_send_keys(This, ptr->seq_keysym, keycode, state, ev_time, True, nesting);
+ xkeymap_send_keys(This, ptr->seq_keysym, keycode, state, ev_time, False, nesting);
+ ptr = ptr->next;
+ }
+ while (ptr);
+ }
+}
+
+uint16
+xkeymap_translate_button(unsigned int button)
+{
+ switch (button)
+ {
+ case Button1: /* left */
+ return MOUSE_FLAG_BUTTON1;
+ case Button2: /* middle */
+ return MOUSE_FLAG_BUTTON3;
+ case Button3: /* right */
+ return MOUSE_FLAG_BUTTON2;
+ case Button4: /* wheel up */
+ return MOUSE_FLAG_BUTTON4;
+ case Button5: /* wheel down */
+ return MOUSE_FLAG_BUTTON5;
+ }
+
+ return 0;
+}
+
+char *
+get_ksname(uint32 keysym)
+{
+ char *ksname = NULL;
+
+ if (keysym == NoSymbol)
+ ksname = "NoSymbol";
+ else if (!(ksname = XKeysymToString(keysym)))
+ ksname = "(no name)";
+
+ return ksname;
+}
+
+static BOOL
+is_modifier(uint8 scancode)
+{
+ switch (scancode)
+ {
+ case SCANCODE_CHAR_LSHIFT:
+ case SCANCODE_CHAR_RSHIFT:
+ case SCANCODE_CHAR_LCTRL:
+ case SCANCODE_CHAR_RCTRL:
+ case SCANCODE_CHAR_LALT:
+ case SCANCODE_CHAR_RALT:
+ case SCANCODE_CHAR_LWIN:
+ case SCANCODE_CHAR_RWIN:
+ case SCANCODE_CHAR_NUMLOCK:
+ return True;
+ default:
+ break;
+ }
+ return False;
+}
+
+void
+save_remote_modifiers(RDPCLIENT * This, uint8 scancode)
+{
+ if (is_modifier(scancode))
+ return;
+
+ This->xkeymap.saved_remote_modifier_state = This->xkeymap.remote_modifier_state;
+}
+
+void
+restore_remote_modifiers(RDPCLIENT * This, uint32 ev_time, uint8 scancode)
+{
+ key_translation dummy;
+
+ if (is_modifier(scancode))
+ return;
+
+ dummy.scancode = 0;
+ dummy.modifiers = This->xkeymap.saved_remote_modifier_state;
+ ensure_remote_modifiers(This, ev_time, dummy);
+}
+
+void
+ensure_remote_modifiers(RDPCLIENT * This, uint32 ev_time, key_translation tr)
+{
+ /* If this key is a modifier, do nothing */
+ if (is_modifier(tr.scancode))
+ return;
+
+ if (!This->numlock_sync)
+ {
+ /* NumLock */
+ if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask)
+ != MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapNumLockMask))
+ {
+ /* The remote modifier state is not correct */
+ uint16 new_remote_state;
+
+ if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask))
+ {
+ DEBUG_KBD(("Remote NumLock state is incorrect, activating NumLock.\n"));
+ new_remote_state = KBD_FLAG_NUMLOCK;
+ This->xkeymap.remote_modifier_state = MapNumLockMask;
+ }
+ else
+ {
+ DEBUG_KBD(("Remote NumLock state is incorrect, deactivating NumLock.\n"));
+ new_remote_state = 0;
+ This->xkeymap.remote_modifier_state = 0;
+ }
+
+ rdp_send_input(This, 0, RDP_INPUT_SYNCHRONIZE, 0, new_remote_state, 0);
+ }
+ }
+
+
+ /* Shift. Left shift and right shift are treated as equal; either is fine. */
+ if (MASK_HAS_BITS(tr.modifiers, MapShiftMask)
+ != MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapShiftMask))
+ {
+ /* The remote modifier state is not correct */
+ if (MASK_HAS_BITS(tr.modifiers, MapLeftShiftMask))
+ {
+ /* Needs left shift. Send down. */
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS, SCANCODE_CHAR_LSHIFT);
+ }
+ else if (MASK_HAS_BITS(tr.modifiers, MapRightShiftMask))
+ {
+ /* Needs right shift. Send down. */
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS, SCANCODE_CHAR_RSHIFT);
+ }
+ else
+ {
+ /* Should not use this modifier. Send up for shift currently pressed. */
+ if (MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapLeftShiftMask))
+ /* Left shift is down */
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT);
+ else
+ /* Right shift is down */
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT);
+ }
+ }
+
+ /* AltGr */
+ if (MASK_HAS_BITS(tr.modifiers, MapAltGrMask)
+ != MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapAltGrMask))
+ {
+ /* The remote modifier state is not correct */
+ if (MASK_HAS_BITS(tr.modifiers, MapAltGrMask))
+ {
+ /* Needs this modifier. Send down. */
+ rdp_send_scancode(This, ev_time, RDP_KEYPRESS, SCANCODE_CHAR_RALT);
+ }
+ else
+ {
+ /* Should not use this modifier. Send up. */
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT);
+ }
+ }
+
+
+}
+
+
+unsigned int
+read_keyboard_state(RDPCLIENT * This)
+{
+#ifdef RDP2VNC
+ return 0;
+#else
+ unsigned int state;
+ Window wdummy;
+ int dummy;
+
+ XQueryPointer(This->display, This->wnd, &wdummy, &wdummy, &dummy, &dummy, &dummy, &dummy, &state);
+ return state;
+#endif
+}
+
+
+uint16
+ui_get_numlock_state(RDPCLIENT * This, unsigned int state)
+{
+ uint16 numlock_state = 0;
+
+ if (get_key_state(This, state, XK_Num_Lock))
+ numlock_state = KBD_FLAG_NUMLOCK;
+
+ return numlock_state;
+}
+
+
+void
+reset_modifier_keys(RDPCLIENT * This)
+{
+ unsigned int state = read_keyboard_state(This);
+
+ /* reset keys */
+ uint32 ev_time;
+ ev_time = time(NULL);
+
+ if (MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapLeftShiftMask)
+ && !get_key_state(This, state, XK_Shift_L))
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT);
+
+ if (MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapRightShiftMask)
+ && !get_key_state(This, state, XK_Shift_R))
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT);
+
+ if (MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapLeftCtrlMask)
+ && !get_key_state(This, state, XK_Control_L))
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL);
+
+ if (MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapRightCtrlMask)
+ && !get_key_state(This, state, XK_Control_R))
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RCTRL);
+
+ if (MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapLeftAltMask) && !get_key_state(This, state, XK_Alt_L))
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LALT);
+
+ if (MASK_HAS_BITS(This->xkeymap.remote_modifier_state, MapRightAltMask) &&
+ !get_key_state(This, state, XK_Alt_R) && !get_key_state(This, state, XK_Mode_switch)
+ && !get_key_state(This, state, XK_ISO_Level3_Shift))
+ rdp_send_scancode(This, ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT);
+
+ reset_winkey(This, ev_time);
+
+ if (This->numlock_sync)
+ rdp_send_input(This, ev_time, RDP_INPUT_SYNCHRONIZE, 0, ui_get_numlock_state(This, state), 0);
+}
+
+
+static void
+update_modifier_state(RDPCLIENT * This, uint8 scancode, BOOL pressed)
+{
+#ifdef WITH_DEBUG_KBD
+ uint16 old_modifier_state;
+
+ old_modifier_state = This->xkeymap.remote_modifier_state;
+#endif
+
+ switch (scancode)
+ {
+ case SCANCODE_CHAR_LSHIFT:
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state, MapLeftShiftMask, pressed);
+ break;
+ case SCANCODE_CHAR_RSHIFT:
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state, MapRightShiftMask, pressed);
+ break;
+ case SCANCODE_CHAR_LCTRL:
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state, MapLeftCtrlMask, pressed);
+ break;
+ case SCANCODE_CHAR_RCTRL:
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state, MapRightCtrlMask, pressed);
+ break;
+ case SCANCODE_CHAR_LALT:
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state, MapLeftAltMask, pressed);
+ break;
+ case SCANCODE_CHAR_RALT:
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state, MapRightAltMask, pressed);
+ break;
+ case SCANCODE_CHAR_LWIN:
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state, MapLeftWinMask, pressed);
+ break;
+ case SCANCODE_CHAR_RWIN:
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state, MapRightWinMask, pressed);
+ break;
+ case SCANCODE_CHAR_NUMLOCK:
+ /* KeyReleases for NumLocks are sent immediately. Toggle the
+ modifier state only on Keypress */
+ if (pressed && !This->numlock_sync)
+ {
+ BOOL newNumLockState;
+ newNumLockState =
+ (MASK_HAS_BITS
+ (This->xkeymap.remote_modifier_state, MapNumLockMask) == False);
+ MASK_CHANGE_BIT(This->xkeymap.remote_modifier_state,
+ MapNumLockMask, newNumLockState);
+ }
+ }
+
+#ifdef WITH_DEBUG_KBD
+ if (old_modifier_state != This->xkeymap.remote_modifier_state)
+ {
+ DEBUG_KBD(("Before updating modifier_state:0x%x, pressed=0x%x\n",
+ old_modifier_state, pressed));
+ DEBUG_KBD(("After updating modifier_state:0x%x\n", This->xkeymap.remote_modifier_state));
+ }
+#endif
+
+}
+
+/* Send keyboard input */
+void
+rdp_send_scancode(RDPCLIENT * This, uint32 time, uint16 flags, uint8 scancode)
+{
+ update_modifier_state(This, scancode, !(flags & RDP_KEYRELEASE));
+
+ if (scancode & SCANCODE_EXTENDED)
+ {
+ DEBUG_KBD(("Sending extended scancode=0x%x, flags=0x%x\n",
+ scancode & ~SCANCODE_EXTENDED, flags));
+ rdp_send_input(This, time, RDP_INPUT_SCANCODE, flags | KBD_FLAG_EXT,
+ scancode & ~SCANCODE_EXTENDED, 0);
+ }
+ else
+ {
+ DEBUG_KBD(("Sending scancode=0x%x, flags=0x%x\n", scancode, flags));
+ rdp_send_input(This, time, RDP_INPUT_SCANCODE, flags, scancode, 0);
+ }
+}
--- /dev/null
+void xclip_handle_SelectionNotify(RDPCLIENT * This, XSelectionEvent * event);
+void xclip_handle_SelectionRequest(RDPCLIENT * This, XSelectionRequestEvent * xevent);
+void xclip_handle_SelectionClear(RDPCLIENT * This);
+void xclip_handle_PropertyNotify(RDPCLIENT * This, XPropertyEvent * xev);
+int ewmh_get_window_state(RDPCLIENT * This, Window w);
+int ewmh_change_state(RDPCLIENT * This, Window wnd, int state);
+int ewmh_move_to_desktop(RDPCLIENT * This, Window wnd, unsigned int desktop);
+int ewmh_get_window_desktop(RDPCLIENT * This, Window wnd);
+void ewmh_set_wm_name(RDPCLIENT * This, Window wnd, const char *title);
+int ewmh_set_window_popup(RDPCLIENT * This, Window wnd);
+int ewmh_set_window_modal(RDPCLIENT * This, Window wnd);
--- /dev/null
+/* -*- c-basic-offset: 8 -*-
+ rdesktop: A Remote Desktop Protocol client.
+ User interface services - X Window System
+ Copyright (C) Matthew Chapman 1999-2005
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <time.h>
+#include <errno.h>
+#include <strings.h>
+#include "rdesktop.h"
+#include "xproto.h"
+
+/* We can't include Xproto.h because of conflicting defines for BOOL */
+#define X_ConfigureWindow 12
+
+/* MWM decorations */
+#define MWM_HINTS_DECORATIONS (1L << 1)
+#define PROP_MOTIF_WM_HINTS_ELEMENTS 5
+typedef struct
+{
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long inputMode;
+ unsigned long status;
+}
+PropMotifWmHints;
+
+typedef struct
+{
+ uint32 red;
+ uint32 green;
+ uint32 blue;
+}
+PixelColour;
+
+#define ON_ALL_SEAMLESS_WINDOWS(func, args) \
+ do { \
+ seamless_window *sw; \
+ XRectangle rect; \
+ if (!This->xwin.seamless_windows) break; \
+ for (sw = This->xwin.seamless_windows; sw; sw = sw->next) { \
+ rect.x = This->xwin.clip_rectangle.x - sw->xoffset; \
+ rect.y = This->xwin.clip_rectangle.y - sw->yoffset; \
+ rect.width = This->xwin.clip_rectangle.width; \
+ rect.height = This->xwin.clip_rectangle.height; \
+ XSetClipRectangles(This->display, This->xwin.gc, 0, 0, &rect, 1, YXBanded); \
+ func args; \
+ } \
+ XSetClipRectangles(This->display, This->xwin.gc, 0, 0, &This->xwin.clip_rectangle, 1, YXBanded); \
+ } while (0)
+
+static void
+seamless_XFillPolygon(RDPCLIENT * This, Drawable d, XPoint * points, int npoints, int xoffset, int yoffset)
+{
+ points[0].x -= xoffset;
+ points[0].y -= yoffset;
+ XFillPolygon(This->display, d, This->xwin.gc, points, npoints, Complex, CoordModePrevious);
+ points[0].x += xoffset;
+ points[0].y += yoffset;
+}
+
+static void
+seamless_XDrawLines(RDPCLIENT * This, Drawable d, XPoint * points, int npoints, int xoffset, int yoffset)
+{
+ points[0].x -= xoffset;
+ points[0].y -= yoffset;
+ XDrawLines(This->display, d, This->xwin.gc, points, npoints, CoordModePrevious);
+ points[0].x += xoffset;
+ points[0].y += yoffset;
+}
+
+#define FILL_RECTANGLE(x,y,cx,cy)\
+{ \
+ XFillRectangle(This->display, This->wnd, This->xwin.gc, x, y, cx, cy); \
+ ON_ALL_SEAMLESS_WINDOWS(XFillRectangle, (This->display, sw->wnd, This->xwin.gc, x-sw->xoffset, y-sw->yoffset, cx, cy)); \
+ if (This->ownbackstore) \
+ XFillRectangle(This->display, This->xwin.backstore, This->xwin.gc, x, y, cx, cy); \
+}
+
+#define FILL_RECTANGLE_BACKSTORE(x,y,cx,cy)\
+{ \
+ XFillRectangle(This->display, This->ownbackstore ? This->xwin.backstore : This->wnd, This->xwin.gc, x, y, cx, cy); \
+}
+
+#define FILL_POLYGON(p,np)\
+{ \
+ XFillPolygon(This->display, This->wnd, This->xwin.gc, p, np, Complex, CoordModePrevious); \
+ if (This->ownbackstore) \
+ XFillPolygon(This->display, This->xwin.backstore, This->xwin.gc, p, np, Complex, CoordModePrevious); \
+ ON_ALL_SEAMLESS_WINDOWS(seamless_XFillPolygon, (This, sw->wnd, p, np, sw->xoffset, sw->yoffset)); \
+}
+
+#define DRAW_ELLIPSE(x,y,cx,cy,m)\
+{ \
+ switch (m) \
+ { \
+ case 0: /* Outline */ \
+ XDrawArc(This->display, This->wnd, This->xwin.gc, x, y, cx, cy, 0, 360*64); \
+ ON_ALL_SEAMLESS_WINDOWS(XDrawArc, (This->display, sw->wnd, This->xwin.gc, x-sw->xoffset, y-sw->yoffset, cx, cy, 0, 360*64)); \
+ if (This->ownbackstore) \
+ XDrawArc(This->display, This->xwin.backstore, This->xwin.gc, x, y, cx, cy, 0, 360*64); \
+ break; \
+ case 1: /* Filled */ \
+ XFillArc(This->display, This->wnd, This->xwin.gc, x, y, cx, cy, 0, 360*64); \
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea, (This->display, This->ownbackstore ? This->xwin.backstore : This->wnd, sw->wnd, This->xwin.gc, \
+ x, y, cx, cy, x-sw->xoffset, y-sw->yoffset)); \
+ if (This->ownbackstore) \
+ XFillArc(This->display, This->xwin.backstore, This->xwin.gc, x, y, cx, cy, 0, 360*64); \
+ break; \
+ } \
+}
+
+#define TRANSLATE(col) ( This->server_depth != 8 ? translate_colour(This, col) : This->owncolmap ? col : This->xwin.colmap[col] )
+#define SET_FOREGROUND(col) XSetForeground(This->display, This->xwin.gc, TRANSLATE(col));
+#define SET_BACKGROUND(col) XSetBackground(This->display, This->xwin.gc, TRANSLATE(col));
+
+static const int rop2_map[] = {
+ GXclear, /* 0 */
+ GXnor, /* DPon */
+ GXandInverted, /* DPna */
+ GXcopyInverted, /* Pn */
+ GXandReverse, /* PDna */
+ GXinvert, /* Dn */
+ GXxor, /* DPx */
+ GXnand, /* DPan */
+ GXand, /* DPa */
+ GXequiv, /* DPxn */
+ GXnoop, /* D */
+ GXorInverted, /* DPno */
+ GXcopy, /* P */
+ GXorReverse, /* PDno */
+ GXor, /* DPo */
+ GXset /* 1 */
+};
+
+#define SET_FUNCTION(rop2) { if (rop2 != ROP2_COPY) XSetFunction(This->display, This->xwin.gc, rop2_map[rop2]); }
+#define RESET_FUNCTION(rop2) { if (rop2 != ROP2_COPY) XSetFunction(This->display, This->xwin.gc, GXcopy); }
+
+static seamless_window *
+sw_get_window_by_id(RDPCLIENT * This, unsigned long id)
+{
+ seamless_window *sw;
+ for (sw = This->xwin.seamless_windows; sw; sw = sw->next)
+ {
+ if (sw->id == id)
+ return sw;
+ }
+ return NULL;
+}
+
+
+static seamless_window *
+sw_get_window_by_wnd(RDPCLIENT * This, Window wnd)
+{
+ seamless_window *sw;
+ for (sw = This->xwin.seamless_windows; sw; sw = sw->next)
+ {
+ if (sw->wnd == wnd)
+ return sw;
+ }
+ return NULL;
+}
+
+
+static void
+sw_remove_window(RDPCLIENT * This, seamless_window * win)
+{
+ seamless_window *sw, **prevnext = &This->xwin.seamless_windows;
+ for (sw = This->xwin.seamless_windows; sw; sw = sw->next)
+ {
+ if (sw == win)
+ {
+ *prevnext = sw->next;
+ sw->group->refcnt--;
+ if (sw->group->refcnt == 0)
+ {
+ XDestroyWindow(This->display, sw->group->wnd);
+ xfree(sw->group);
+ }
+ xfree(sw->position_timer);
+ xfree(sw);
+ return;
+ }
+ prevnext = &sw->next;
+ }
+ return;
+}
+
+
+/* Move all windows except wnd to new desktop */
+static void
+sw_all_to_desktop(RDPCLIENT * This, Window wnd, unsigned int desktop)
+{
+ seamless_window *sw;
+ for (sw = This->xwin.seamless_windows; sw; sw = sw->next)
+ {
+ if (sw->wnd == wnd)
+ continue;
+ if (sw->desktop != desktop)
+ {
+ ewmh_move_to_desktop(This, sw->wnd, desktop);
+ sw->desktop = desktop;
+ }
+ }
+}
+
+
+/* Send our position */
+static void
+sw_update_position(RDPCLIENT * This, seamless_window * sw)
+{
+ XWindowAttributes wa;
+ int x, y;
+ Window child_return;
+ unsigned int serial;
+
+ XGetWindowAttributes(This->display, sw->wnd, &wa);
+ XTranslateCoordinates(This->display, sw->wnd, wa.root,
+ -wa.border_width, -wa.border_width, &x, &y, &child_return);
+
+ serial = seamless_send_position(This, sw->id, x, y, wa.width, wa.height, 0);
+
+ sw->outstanding_position = True;
+ sw->outpos_serial = serial;
+
+ sw->outpos_xoffset = x;
+ sw->outpos_yoffset = y;
+ sw->outpos_width = wa.width;
+ sw->outpos_height = wa.height;
+}
+
+
+/* Check if it's time to send our position */
+static void
+sw_check_timers(RDPCLIENT * This)
+{
+ seamless_window *sw;
+ struct timeval now;
+
+ gettimeofday(&now, NULL);
+ for (sw = This->xwin.seamless_windows; sw; sw = sw->next)
+ {
+ if (timerisset(sw->position_timer) && timercmp(sw->position_timer, &now, <))
+ {
+ timerclear(sw->position_timer);
+ sw_update_position(This, sw);
+ }
+ }
+}
+
+
+static void
+sw_restack_window(RDPCLIENT * This, seamless_window * sw, unsigned long behind)
+{
+ seamless_window *sw_above;
+
+ /* Remove window from stack */
+ for (sw_above = This->xwin.seamless_windows; sw_above; sw_above = sw_above->next)
+ {
+ if (sw_above->behind == sw->id)
+ break;
+ }
+
+ if (sw_above)
+ sw_above->behind = sw->behind;
+
+ /* And then add it at the new position */
+ for (sw_above = This->xwin.seamless_windows; sw_above; sw_above = sw_above->next)
+ {
+ if (sw_above->behind == behind)
+ break;
+ }
+
+ if (sw_above)
+ sw_above->behind = sw->id;
+
+ sw->behind = behind;
+}
+
+
+static void
+sw_handle_restack(RDPCLIENT * This, seamless_window * sw)
+{
+ Status status;
+ Window root, parent, *children;
+ unsigned int nchildren, i;
+ seamless_window *sw_below;
+
+ status = XQueryTree(This->display, RootWindowOfScreen(This->xwin.screen),
+ &root, &parent, &children, &nchildren);
+ if (!status || !nchildren)
+ return;
+
+ sw_below = NULL;
+
+ i = 0;
+ while (children[i] != sw->wnd)
+ {
+ i++;
+ if (i >= nchildren)
+ goto end;
+ }
+
+ for (i++; i < nchildren; i++)
+ {
+ sw_below = sw_get_window_by_wnd(This, children[i]);
+ if (sw_below)
+ break;
+ }
+
+ if (!sw_below && !sw->behind)
+ goto end;
+ if (sw_below && (sw_below->id == sw->behind))
+ goto end;
+
+ if (sw_below)
+ {
+ seamless_send_zchange(This, sw->id, sw_below->id, 0);
+ sw_restack_window(This, sw, sw_below->id);
+ }
+ else
+ {
+ seamless_send_zchange(This, sw->id, 0, 0);
+ sw_restack_window(This, sw, 0);
+ }
+
+ end:
+ XFree(children);
+}
+
+
+static seamless_group *
+sw_find_group(RDPCLIENT * This, unsigned long id, BOOL dont_create)
+{
+ seamless_window *sw;
+ seamless_group *sg;
+ XSetWindowAttributes attribs;
+
+ for (sw = This->xwin.seamless_windows; sw; sw = sw->next)
+ {
+ if (sw->group->id == id)
+ return sw->group;
+ }
+
+ if (dont_create)
+ return NULL;
+
+ sg = xmalloc(sizeof(seamless_group));
+
+ sg->wnd =
+ XCreateWindow(This->display, RootWindowOfScreen(This->xwin.screen), -1, -1, 1, 1, 0,
+ CopyFromParent, CopyFromParent, CopyFromParent, 0, &attribs);
+
+ sg->id = id;
+ sg->refcnt = 0;
+
+ return sg;
+}
+
+
+static void
+mwm_hide_decorations(RDPCLIENT * This, Window wnd)
+{
+ PropMotifWmHints motif_hints;
+ Atom hintsatom;
+
+ /* setup the property */
+ motif_hints.flags = MWM_HINTS_DECORATIONS;
+ motif_hints.decorations = 0;
+
+ /* get the atom for the property */
+ hintsatom = XInternAtom(This->display, "_MOTIF_WM_HINTS", False);
+ if (!hintsatom)
+ {
+ warning("Failed to get atom _MOTIF_WM_HINTS: probably your window manager does not support MWM hints\n");
+ return;
+ }
+
+ XChangeProperty(This->display, wnd, hintsatom, hintsatom, 32, PropModeReplace,
+ (unsigned char *) &motif_hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
+
+}
+
+#define SPLITCOLOUR15(colour, rv) \
+{ \
+ rv.red = ((colour >> 7) & 0xf8) | ((colour >> 12) & 0x7); \
+ rv.green = ((colour >> 2) & 0xf8) | ((colour >> 8) & 0x7); \
+ rv.blue = ((colour << 3) & 0xf8) | ((colour >> 2) & 0x7); \
+}
+
+#define SPLITCOLOUR16(colour, rv) \
+{ \
+ rv.red = ((colour >> 8) & 0xf8) | ((colour >> 13) & 0x7); \
+ rv.green = ((colour >> 3) & 0xfc) | ((colour >> 9) & 0x3); \
+ rv.blue = ((colour << 3) & 0xf8) | ((colour >> 2) & 0x7); \
+} \
+
+#define SPLITCOLOUR24(colour, rv) \
+{ \
+ rv.blue = (colour & 0xff0000) >> 16; \
+ rv.green = (colour & 0x00ff00) >> 8; \
+ rv.red = (colour & 0x0000ff); \
+}
+
+#define MAKECOLOUR(pc) \
+ ((pc.red >> This->xwin.red_shift_r) << This->xwin.red_shift_l) \
+ | ((pc.green >> This->xwin.green_shift_r) << This->xwin.green_shift_l) \
+ | ((pc.blue >> This->xwin.blue_shift_r) << This->xwin.blue_shift_l) \
+
+#define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); }
+#define BSWAP24(x) { x = (((x & 0xff) << 16) | (x >> 16) | (x & 0xff00)); }
+#define BSWAP32(x) { x = (((x & 0xff00ff) << 8) | ((x >> 8) & 0xff00ff)); \
+ x = (x << 16) | (x >> 16); }
+
+/* The following macros output the same octet sequences
+ on both BE and LE hosts: */
+
+#define BOUT16(o, x) { *(o++) = x >> 8; *(o++) = x; }
+#define BOUT24(o, x) { *(o++) = x >> 16; *(o++) = x >> 8; *(o++) = x; }
+#define BOUT32(o, x) { *(o++) = x >> 24; *(o++) = x >> 16; *(o++) = x >> 8; *(o++) = x; }
+#define LOUT16(o, x) { *(o++) = x; *(o++) = x >> 8; }
+#define LOUT24(o, x) { *(o++) = x; *(o++) = x >> 8; *(o++) = x >> 16; }
+#define LOUT32(o, x) { *(o++) = x; *(o++) = x >> 8; *(o++) = x >> 16; *(o++) = x >> 24; }
+
+static uint32
+translate_colour(RDPCLIENT * This, uint32 colour)
+{
+ PixelColour pc;
+ switch (This->server_depth)
+ {
+ case 15:
+ SPLITCOLOUR15(colour, pc);
+ break;
+ case 16:
+ SPLITCOLOUR16(colour, pc);
+ break;
+ case 24:
+ SPLITCOLOUR24(colour, pc);
+ break;
+ default:
+ /* Avoid warning */
+ pc.red = 0;
+ pc.green = 0;
+ pc.blue = 0;
+ break;
+ }
+ return MAKECOLOUR(pc);
+}
+
+/* indent is confused by UNROLL8 */
+/* *INDENT-OFF* */
+
+/* repeat and unroll, similar to bitmap.c */
+/* potentialy any of the following translate */
+/* functions can use repeat but just doing */
+/* the most common ones */
+
+#define UNROLL8(stm) { stm stm stm stm stm stm stm stm }
+/* 2 byte output repeat */
+#define REPEAT2(stm) \
+{ \
+ while (out <= end - 8 * 2) \
+ UNROLL8(stm) \
+ while (out < end) \
+ { stm } \
+}
+/* 3 byte output repeat */
+#define REPEAT3(stm) \
+{ \
+ while (out <= end - 8 * 3) \
+ UNROLL8(stm) \
+ while (out < end) \
+ { stm } \
+}
+/* 4 byte output repeat */
+#define REPEAT4(stm) \
+{ \
+ while (out <= end - 8 * 4) \
+ UNROLL8(stm) \
+ while (out < end) \
+ { stm } \
+}
+/* *INDENT-ON* */
+
+static void
+translate8to8(RDPCLIENT * This, const uint8 * data, uint8 * out, uint8 * end)
+{
+ while (out < end)
+ *(out++) = (uint8) This->xwin.colmap[*(data++)];
+}
+
+static void
+translate8to16(RDPCLIENT * This, const uint8 * data, uint8 * out, uint8 * end)
+{
+ uint16 value;
+
+ if (This->xwin.compatible_arch)
+ {
+ /* *INDENT-OFF* */
+ REPEAT2
+ (
+ *((uint16 *) out) = This->xwin.colmap[*(data++)];
+ out += 2;
+ )
+ /* *INDENT-ON* */
+ }
+ else if (This->xwin.xserver_be)
+ {
+ while (out < end)
+ {
+ value = (uint16) This->xwin.colmap[*(data++)];
+ BOUT16(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ value = (uint16) This->xwin.colmap[*(data++)];
+ LOUT16(out, value);
+ }
+ }
+}
+
+/* little endian - conversion happens when colourmap is built */
+static void
+translate8to24(RDPCLIENT * This, const uint8 * data, uint8 * out, uint8 * end)
+{
+ uint32 value;
+
+ if (This->xwin.compatible_arch)
+ {
+ while (out < end)
+ {
+ value = This->xwin.colmap[*(data++)];
+ BOUT24(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ value = This->xwin.colmap[*(data++)];
+ LOUT24(out, value);
+ }
+ }
+}
+
+static void
+translate8to32(RDPCLIENT * This, const uint8 * data, uint8 * out, uint8 * end)
+{
+ uint32 value;
+
+ if (This->xwin.compatible_arch)
+ {
+ /* *INDENT-OFF* */
+ REPEAT4
+ (
+ *((uint32 *) out) = This->xwin.colmap[*(data++)];
+ out += 4;
+ )
+ /* *INDENT-ON* */
+ }
+ else if (This->xwin.xserver_be)
+ {
+ while (out < end)
+ {
+ value = This->xwin.colmap[*(data++)];
+ BOUT32(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ value = This->xwin.colmap[*(data++)];
+ LOUT32(out, value);
+ }
+ }
+}
+
+static void
+translate15to16(RDPCLIENT * This, const uint16 * data, uint8 * out, uint8 * end)
+{
+ uint16 pixel;
+ uint16 value;
+ PixelColour pc;
+
+ if (This->xwin.xserver_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ if (This->xwin.host_be)
+ {
+ BSWAP16(pixel);
+ }
+ SPLITCOLOUR15(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT16(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ if (This->xwin.host_be)
+ {
+ BSWAP16(pixel);
+ }
+ SPLITCOLOUR15(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT16(out, value);
+ }
+ }
+}
+
+static void
+translate15to24(RDPCLIENT * This, const uint16 * data, uint8 * out, uint8 * end)
+{
+ uint32 value;
+ uint16 pixel;
+ PixelColour pc;
+
+ if (This->xwin.compatible_arch)
+ {
+ /* *INDENT-OFF* */
+ REPEAT3
+ (
+ pixel = *(data++);
+ SPLITCOLOUR15(pixel, pc);
+ *(out++) = pc.blue;
+ *(out++) = pc.green;
+ *(out++) = pc.red;
+ )
+ /* *INDENT-ON* */
+ }
+ else if (This->xwin.xserver_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ if (This->xwin.host_be)
+ {
+ BSWAP16(pixel);
+ }
+ SPLITCOLOUR15(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT24(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ if (This->xwin.host_be)
+ {
+ BSWAP16(pixel);
+ }
+ SPLITCOLOUR15(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT24(out, value);
+ }
+ }
+}
+
+static void
+translate15to32(RDPCLIENT * This, const uint16 * data, uint8 * out, uint8 * end)
+{
+ uint16 pixel;
+ uint32 value;
+ PixelColour pc;
+
+ if (This->xwin.compatible_arch)
+ {
+ /* *INDENT-OFF* */
+ REPEAT4
+ (
+ pixel = *(data++);
+ SPLITCOLOUR15(pixel, pc);
+ *(out++) = pc.blue;
+ *(out++) = pc.green;
+ *(out++) = pc.red;
+ *(out++) = 0;
+ )
+ /* *INDENT-ON* */
+ }
+ else if (This->xwin.xserver_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ if (This->xwin.host_be)
+ {
+ BSWAP16(pixel);
+ }
+ SPLITCOLOUR15(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT32(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ if (This->xwin.host_be)
+ {
+ BSWAP16(pixel);
+ }
+ SPLITCOLOUR15(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT32(out, value);
+ }
+ }
+}
+
+static void
+translate16to16(RDPCLIENT * This, const uint16 * data, uint8 * out, uint8 * end)
+{
+ uint16 pixel;
+ uint16 value;
+ PixelColour pc;
+
+ if (This->xwin.xserver_be)
+ {
+ if (This->xwin.host_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ BSWAP16(pixel);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT16(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT16(out, value);
+ }
+ }
+ }
+ else
+ {
+ if (This->xwin.host_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ BSWAP16(pixel);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT16(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT16(out, value);
+ }
+ }
+ }
+}
+
+static void
+translate16to24(RDPCLIENT * This, const uint16 * data, uint8 * out, uint8 * end)
+{
+ uint32 value;
+ uint16 pixel;
+ PixelColour pc;
+
+ if (This->xwin.compatible_arch)
+ {
+ /* *INDENT-OFF* */
+ REPEAT3
+ (
+ pixel = *(data++);
+ SPLITCOLOUR16(pixel, pc);
+ *(out++) = pc.blue;
+ *(out++) = pc.green;
+ *(out++) = pc.red;
+ )
+ /* *INDENT-ON* */
+ }
+ else if (This->xwin.xserver_be)
+ {
+ if (This->xwin.host_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ BSWAP16(pixel);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT24(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT24(out, value);
+ }
+ }
+ }
+ else
+ {
+ if (This->xwin.host_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ BSWAP16(pixel);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT24(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT24(out, value);
+ }
+ }
+ }
+}
+
+static void
+translate16to32(RDPCLIENT * This, const uint16 * data, uint8 * out, uint8 * end)
+{
+ uint16 pixel;
+ uint32 value;
+ PixelColour pc;
+
+ if (This->xwin.compatible_arch)
+ {
+ /* *INDENT-OFF* */
+ REPEAT4
+ (
+ pixel = *(data++);
+ SPLITCOLOUR16(pixel, pc);
+ *(out++) = pc.blue;
+ *(out++) = pc.green;
+ *(out++) = pc.red;
+ *(out++) = 0;
+ )
+ /* *INDENT-ON* */
+ }
+ else if (This->xwin.xserver_be)
+ {
+ if (This->xwin.host_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ BSWAP16(pixel);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT32(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT32(out, value);
+ }
+ }
+ }
+ else
+ {
+ if (This->xwin.host_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ BSWAP16(pixel);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT32(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++);
+ SPLITCOLOUR16(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT32(out, value);
+ }
+ }
+ }
+}
+
+static void
+translate24to16(RDPCLIENT * This, const uint8 * data, uint8 * out, uint8 * end)
+{
+ uint32 pixel = 0;
+ uint16 value;
+ PixelColour pc;
+
+ while (out < end)
+ {
+ pixel = *(data++) << 16;
+ pixel |= *(data++) << 8;
+ pixel |= *(data++);
+ SPLITCOLOUR24(pixel, pc);
+ value = MAKECOLOUR(pc);
+ if (This->xwin.xserver_be)
+ {
+ BOUT16(out, value);
+ }
+ else
+ {
+ LOUT16(out, value);
+ }
+ }
+}
+
+static void
+translate24to24(RDPCLIENT * This, const uint8 * data, uint8 * out, uint8 * end)
+{
+ uint32 pixel;
+ uint32 value;
+ PixelColour pc;
+
+ if (This->xwin.xserver_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++) << 16;
+ pixel |= *(data++) << 8;
+ pixel |= *(data++);
+ SPLITCOLOUR24(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT24(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++) << 16;
+ pixel |= *(data++) << 8;
+ pixel |= *(data++);
+ SPLITCOLOUR24(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT24(out, value);
+ }
+ }
+}
+
+static void
+translate24to32(RDPCLIENT * This, const uint8 * data, uint8 * out, uint8 * end)
+{
+ uint32 pixel;
+ uint32 value;
+ PixelColour pc;
+
+ if (This->xwin.compatible_arch)
+ {
+ /* *INDENT-OFF* */
+#ifdef NEED_ALIGN
+ REPEAT4
+ (
+ *(out++) = *(data++);
+ *(out++) = *(data++);
+ *(out++) = *(data++);
+ *(out++) = 0;
+ )
+#else
+ REPEAT4
+ (
+ /* Only read 3 bytes. Reading 4 bytes means reading beyond buffer. */
+ *((uint32 *) out) = *((uint16 *) data) + (*((uint8 *) data + 2) << 16);
+ out += 4;
+ data += 3;
+ )
+#endif
+ /* *INDENT-ON* */
+ }
+ else if (This->xwin.xserver_be)
+ {
+ while (out < end)
+ {
+ pixel = *(data++) << 16;
+ pixel |= *(data++) << 8;
+ pixel |= *(data++);
+ SPLITCOLOUR24(pixel, pc);
+ value = MAKECOLOUR(pc);
+ BOUT32(out, value);
+ }
+ }
+ else
+ {
+ while (out < end)
+ {
+ pixel = *(data++) << 16;
+ pixel |= *(data++) << 8;
+ pixel |= *(data++);
+ SPLITCOLOUR24(pixel, pc);
+ value = MAKECOLOUR(pc);
+ LOUT32(out, value);
+ }
+ }
+}
+
+static uint8 *
+translate_image(RDPCLIENT * This, int width, int height, uint8 * data)
+{
+ int size;
+ uint8 *out;
+ uint8 *end;
+
+ /*
+ If RDP depth and X Visual depths match,
+ and arch(endian) matches, no need to translate:
+ just return data.
+ Note: select_visual should've already ensured g_no_translate
+ is only set for compatible depths, but the RDP depth might've
+ changed during connection negotiations.
+ */
+ if (This->xwin.no_translate_image)
+ {
+ if ((This->xwin.depth == 15 && This->server_depth == 15) ||
+ (This->xwin.depth == 16 && This->server_depth == 16) ||
+ (This->xwin.depth == 24 && This->server_depth == 24))
+ return data;
+ }
+
+ size = width * height * (This->xwin.bpp / 8);
+ out = (uint8 *) xmalloc(size);
+ end = out + size;
+
+ switch (This->server_depth)
+ {
+ case 24:
+ switch (This->xwin.bpp)
+ {
+ case 32:
+ translate24to32(This, data, out, end);
+ break;
+ case 24:
+ translate24to24(This, data, out, end);
+ break;
+ case 16:
+ translate24to16(This, data, out, end);
+ break;
+ }
+ break;
+ case 16:
+ switch (This->xwin.bpp)
+ {
+ case 32:
+ translate16to32(This, (uint16 *) data, out, end);
+ break;
+ case 24:
+ translate16to24(This, (uint16 *) data, out, end);
+ break;
+ case 16:
+ translate16to16(This, (uint16 *) data, out, end);
+ break;
+ }
+ break;
+ case 15:
+ switch (This->xwin.bpp)
+ {
+ case 32:
+ translate15to32(This, (uint16 *) data, out, end);
+ break;
+ case 24:
+ translate15to24(This, (uint16 *) data, out, end);
+ break;
+ case 16:
+ translate15to16(This, (uint16 *) data, out, end);
+ break;
+ }
+ break;
+ case 8:
+ switch (This->xwin.bpp)
+ {
+ case 8:
+ translate8to8(This, data, out, end);
+ break;
+ case 16:
+ translate8to16(This, data, out, end);
+ break;
+ case 24:
+ translate8to24(This, data, out, end);
+ break;
+ case 32:
+ translate8to32(This, data, out, end);
+ break;
+ }
+ break;
+ }
+ return out;
+}
+
+BOOL
+get_key_state(RDPCLIENT * This, unsigned int state, uint32 keysym)
+{
+ int modifierpos, key, keysymMask = 0;
+ int offset;
+
+ KeyCode keycode = XKeysymToKeycode(This->display, keysym);
+
+ if (keycode == NoSymbol)
+ return False;
+
+ for (modifierpos = 0; modifierpos < 8; modifierpos++)
+ {
+ offset = This->xwin.mod_map->max_keypermod * modifierpos;
+
+ for (key = 0; key < This->xwin.mod_map->max_keypermod; key++)
+ {
+ if (This->xwin.mod_map->modifiermap[offset + key] == keycode)
+ keysymMask |= 1 << modifierpos;
+ }
+ }
+
+ return (state & keysymMask) ? True : False;
+}
+
+static void
+calculate_shifts(uint32 mask, int *shift_r, int *shift_l)
+{
+ *shift_l = ffs(mask) - 1;
+ mask >>= *shift_l;
+ *shift_r = 8 - ffs(mask & ~(mask >> 1));
+}
+
+/* Given a mask of a colour channel (e.g. XVisualInfo.red_mask),
+ calculates the bits-per-pixel of this channel (a.k.a. colour weight).
+ */
+static unsigned
+calculate_mask_weight(uint32 mask)
+{
+ unsigned weight = 0;
+ do
+ {
+ weight += (mask & 1);
+ }
+ while (mask >>= 1);
+ return weight;
+}
+
+static BOOL
+select_visual(RDPCLIENT * This)
+{
+ XPixmapFormatValues *pfm;
+ int pixmap_formats_count, visuals_count;
+ XVisualInfo *vmatches = NULL;
+ XVisualInfo template;
+ int i;
+ unsigned red_weight, blue_weight, green_weight;
+
+ red_weight = blue_weight = green_weight = 0;
+
+ if (This->server_depth == -1)
+ {
+ This->server_depth = DisplayPlanes(This->display, DefaultScreen(This->display));
+ }
+
+ pfm = XListPixmapFormats(This->display, &pixmap_formats_count);
+ if (pfm == NULL)
+ {
+ error("Unable to get list of pixmap formats from display.\n");
+ XCloseDisplay(This->display);
+ return False;
+ }
+
+ /* Search for best TrueColor visual */
+ template.class = TrueColor;
+ vmatches = XGetVisualInfo(This->display, VisualClassMask, &template, &visuals_count);
+ This->xwin.visual = NULL;
+ This->xwin.no_translate_image = False;
+ This->xwin.compatible_arch = False;
+ if (vmatches != NULL)
+ {
+ for (i = 0; i < visuals_count; ++i)
+ {
+ XVisualInfo *visual_info = &vmatches[i];
+ BOOL can_translate_to_bpp = False;
+ int j;
+
+ /* Try to find a no-translation visual that'll
+ allow us to use RDP bitmaps directly as ZPixmaps. */
+ if (!This->xwin.xserver_be && (((visual_info->depth == 15) &&
+ /* R5G5B5 */
+ (visual_info->red_mask == 0x7c00) &&
+ (visual_info->green_mask == 0x3e0) &&
+ (visual_info->blue_mask == 0x1f)) ||
+ ((visual_info->depth == 16) &&
+ /* R5G6B5 */
+ (visual_info->red_mask == 0xf800) &&
+ (visual_info->green_mask == 0x7e0) &&
+ (visual_info->blue_mask == 0x1f)) ||
+ ((visual_info->depth == 24) &&
+ /* R8G8B8 */
+ (visual_info->red_mask == 0xff0000) &&
+ (visual_info->green_mask == 0xff00) &&
+ (visual_info->blue_mask == 0xff))))
+ {
+ This->xwin.visual = visual_info->visual;
+ This->xwin.depth = visual_info->depth;
+ This->xwin.compatible_arch = !This->xwin.host_be;
+ This->xwin.no_translate_image = (visual_info->depth == This->server_depth);
+ if (This->xwin.no_translate_image)
+ /* We found the best visual */
+ break;
+ }
+ else
+ {
+ This->xwin.compatible_arch = False;
+ }
+
+ if (visual_info->depth > 24)
+ {
+ /* Avoid 32-bit visuals and likes like the plague.
+ They're either untested or proven to work bad
+ (e.g. nvidia's Composite 32-bit visual).
+ Most implementation offer a 24-bit visual anyway. */
+ continue;
+ }
+
+ /* Only care for visuals, for whose BPPs (not depths!)
+ we have a translateXtoY function. */
+ for (j = 0; j < pixmap_formats_count; ++j)
+ {
+ if (pfm[j].depth == visual_info->depth)
+ {
+ if ((pfm[j].bits_per_pixel == 16) ||
+ (pfm[j].bits_per_pixel == 24) ||
+ (pfm[j].bits_per_pixel == 32))
+ {
+ can_translate_to_bpp = True;
+ }
+ break;
+ }
+ }
+
+ /* Prefer formats which have the most colour depth.
+ We're being truly aristocratic here, minding each
+ weight on its own. */
+ if (can_translate_to_bpp)
+ {
+ unsigned vis_red_weight =
+ calculate_mask_weight(visual_info->red_mask);
+ unsigned vis_green_weight =
+ calculate_mask_weight(visual_info->green_mask);
+ unsigned vis_blue_weight =
+ calculate_mask_weight(visual_info->blue_mask);
+ if ((vis_red_weight >= red_weight)
+ && (vis_green_weight >= green_weight)
+ && (vis_blue_weight >= blue_weight))
+ {
+ red_weight = vis_red_weight;
+ green_weight = vis_green_weight;
+ blue_weight = vis_blue_weight;
+ This->xwin.visual = visual_info->visual;
+ This->xwin.depth = visual_info->depth;
+ }
+ }
+ }
+ XFree(vmatches);
+ }
+
+ if (This->xwin.visual != NULL)
+ {
+ This->owncolmap = False;
+ calculate_shifts(This->xwin.visual->red_mask, &This->xwin.red_shift_r, &This->xwin.red_shift_l);
+ calculate_shifts(This->xwin.visual->green_mask, &This->xwin.green_shift_r, &This->xwin.green_shift_l);
+ calculate_shifts(This->xwin.visual->blue_mask, &This->xwin.blue_shift_r, &This->xwin.blue_shift_l);
+ }
+ else
+ {
+ template.class = PseudoColor;
+ template.depth = 8;
+ template.colormap_size = 256;
+ vmatches =
+ XGetVisualInfo(This->display,
+ VisualClassMask | VisualDepthMask | VisualColormapSizeMask,
+ &template, &visuals_count);
+ if (vmatches == NULL)
+ {
+ error("No usable TrueColor or PseudoColor visuals on this display.\n");
+ XCloseDisplay(This->display);
+ XFree(pfm);
+ return False;
+ }
+
+ /* we use a colourmap, so the default visual should do */
+ This->owncolmap = True;
+ This->xwin.visual = vmatches[0].visual;
+ This->xwin.depth = vmatches[0].depth;
+ }
+
+ This->xwin.bpp = 0;
+ for (i = 0; i < pixmap_formats_count; ++i)
+ {
+ XPixmapFormatValues *pf = &pfm[i];
+ if (pf->depth == This->xwin.depth)
+ {
+ This->xwin.bpp = pf->bits_per_pixel;
+
+ if (This->xwin.no_translate_image)
+ {
+ switch (This->server_depth)
+ {
+ case 15:
+ case 16:
+ if (This->xwin.bpp != 16)
+ This->xwin.no_translate_image = False;
+ break;
+ case 24:
+ /* Yes, this will force image translation
+ on most modern servers which use 32 bits
+ for R8G8B8. */
+ if (This->xwin.bpp != 24)
+ This->xwin.no_translate_image = False;
+ break;
+ default:
+ This->xwin.no_translate_image = False;
+ break;
+ }
+ }
+
+ /* Pixmap formats list is a depth-to-bpp mapping --
+ there's just a single entry for every depth,
+ so we can safely break here */
+ break;
+ }
+ }
+ XFree(pfm);
+ pfm = NULL;
+ return True;
+}
+
+/*
+static int
+error_handler(RDPCLIENT * This, Display * dpy, XErrorEvent * eev)
+{
+ if ((eev->error_code == BadMatch) && (eev->request_code == X_ConfigureWindow))
+ {
+ fprintf(stderr, "Got \"BadMatch\" when trying to restack windows.\n");
+ fprintf(stderr,
+ "This is most likely caused by a broken window manager (commonly KWin).\n");
+ return 0;
+ }
+
+ return This->xwin.old_error_handler(dpy, eev);
+}
+*/
+
+BOOL
+ui_init(RDPCLIENT * This)
+{
+ int screen_num;
+
+ This->display = XOpenDisplay(NULL);
+ if (This->display == NULL)
+ {
+ error("Failed to open display: %s\n", XDisplayName(NULL));
+ return False;
+ }
+
+ {
+ uint16 endianess_test = 1;
+ This->xwin.host_be = !(BOOL) (*(uint8 *) (&endianess_test));
+ }
+
+ /*This->xwin.old_error_handler = XSetErrorHandler(error_handler);*/
+ This->xwin.xserver_be = (ImageByteOrder(This->display) == MSBFirst);
+ screen_num = DefaultScreen(This->display);
+ This->xwin.x_socket = ConnectionNumber(This->display);
+ This->xwin.screen = ScreenOfDisplay(This->display, screen_num);
+ This->xwin.depth = DefaultDepthOfScreen(This->xwin.screen);
+
+ if (!select_visual(This))
+ return False;
+
+ if (This->xwin.no_translate_image)
+ {
+ DEBUG(("Performance optimization possible: avoiding image translation (colour depth conversion).\n"));
+ }
+
+ if (This->server_depth > This->xwin.bpp)
+ {
+ warning("Remote desktop colour depth %d higher than display colour depth %d.\n",
+ This->server_depth, This->xwin.bpp);
+ }
+
+ DEBUG(("RDP depth: %d, display depth: %d, display bpp: %d, X server BE: %d, host BE: %d\n",
+ This->server_depth, This->xwin.depth, This->xwin.bpp, This->xwin.xserver_be, This->xwin.host_be));
+
+ if (!This->owncolmap)
+ {
+ This->xwin.xcolmap =
+ XCreateColormap(This->display, RootWindowOfScreen(This->xwin.screen), This->xwin.visual,
+ AllocNone);
+ if (This->xwin.depth <= 8)
+ warning("Display colour depth is %d bit: you may want to use -C for a private colourmap.\n", This->xwin.depth);
+ }
+
+ if ((!This->ownbackstore) && (DoesBackingStore(This->xwin.screen) != Always))
+ {
+ warning("External BackingStore not available. Using internal.\n");
+ This->ownbackstore = True;
+ }
+
+ /*
+ * Determine desktop size
+ */
+ if (This->fullscreen)
+ {
+ This->width = WidthOfScreen(This->xwin.screen);
+ This->height = HeightOfScreen(This->xwin.screen);
+ This->xwin.using_full_workarea = True;
+ }
+ else if (This->width < 0)
+ {
+ /* Percent of screen */
+ if (-This->width >= 100)
+ This->xwin.using_full_workarea = True;
+ This->height = HeightOfScreen(This->xwin.screen) * (-This->width) / 100;
+ This->width = WidthOfScreen(This->xwin.screen) * (-This->width) / 100;
+ }
+ else if (This->width == 0)
+ {
+ /* Fetch geometry from _NET_WORKAREA */
+ uint32 x, y, cx, cy;
+ if (get_current_workarea(This, &x, &y, &cx, &cy) == 0)
+ {
+ This->width = cx;
+ This->height = cy;
+ This->xwin.using_full_workarea = True;
+ }
+ else
+ {
+ warning("Failed to get workarea: probably your window manager does not support extended hints\n");
+ This->width = WidthOfScreen(This->xwin.screen);
+ This->height = HeightOfScreen(This->xwin.screen);
+ }
+ }
+
+ /* make sure width is a multiple of 4 */
+ This->width = (This->width + 3) & ~3;
+
+ This->xwin.mod_map = XGetModifierMapping(This->display);
+
+ xkeymap_init(This);
+
+ if (This->enable_compose)
+ This->xwin.IM = XOpenIM(This->display, NULL, NULL, NULL);
+
+ xclip_init(This);
+ ewmh_init(This);
+ if (This->seamless_rdp)
+ seamless_init(This);
+
+ DEBUG_RDP5(("server bpp %d client bpp %d depth %d\n", This->server_depth, This->xwin.bpp, This->xwin.depth));
+
+ return True;
+}
+
+void
+ui_deinit(RDPCLIENT * This)
+{
+ while (This->xwin.seamless_windows)
+ {
+ XDestroyWindow(This->display, This->xwin.seamless_windows->wnd);
+ sw_remove_window(This, This->xwin.seamless_windows);
+ }
+
+ xclip_deinit(This);
+
+ if (This->xwin.IM != NULL)
+ XCloseIM(This->xwin.IM);
+
+ if (This->xwin.null_cursor != NULL)
+ ui_destroy_cursor(This, This->xwin.null_cursor);
+
+ XFreeModifiermap(This->xwin.mod_map);
+
+ if (This->ownbackstore)
+ XFreePixmap(This->display, This->xwin.backstore);
+
+ XFreeGC(This->display, This->xwin.gc);
+ XCloseDisplay(This->display);
+ This->display = NULL;
+}
+
+
+static void
+get_window_attribs(RDPCLIENT * This, XSetWindowAttributes * attribs)
+{
+ attribs->background_pixel = BlackPixelOfScreen(This->xwin.screen);
+ attribs->background_pixel = WhitePixelOfScreen(This->xwin.screen);
+ attribs->border_pixel = WhitePixelOfScreen(This->xwin.screen);
+ attribs->backing_store = This->ownbackstore ? NotUseful : Always;
+ attribs->override_redirect = This->fullscreen;
+ attribs->colormap = This->xwin.xcolmap;
+}
+
+static void
+get_input_mask(RDPCLIENT * This, long *input_mask)
+{
+ *input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
+ VisibilityChangeMask | FocusChangeMask | StructureNotifyMask;
+
+ if (This->sendmotion)
+ *input_mask |= PointerMotionMask;
+ if (This->ownbackstore)
+ *input_mask |= ExposureMask;
+ if (This->fullscreen || This->grab_keyboard)
+ *input_mask |= EnterWindowMask;
+ if (This->grab_keyboard)
+ *input_mask |= LeaveWindowMask;
+}
+
+BOOL
+ui_create_window(RDPCLIENT * This)
+{
+ uint8 null_pointer_mask[1] = { 0x80 };
+ uint8 null_pointer_data[24] = { 0x00 };
+
+ XSetWindowAttributes attribs;
+ XClassHint *classhints;
+ XSizeHints *sizehints;
+ int wndwidth, wndheight;
+ long input_mask, ic_input_mask;
+ XEvent xevent;
+
+ wndwidth = This->fullscreen ? WidthOfScreen(This->xwin.screen) : This->width;
+ wndheight = This->fullscreen ? HeightOfScreen(This->xwin.screen) : This->height;
+
+ /* Handle -x-y portion of geometry string */
+ if (This->xpos < 0 || (This->xpos == 0 && (This->pos & 2)))
+ This->xpos = WidthOfScreen(This->xwin.screen) + This->xpos - This->width;
+ if (This->ypos < 0 || (This->ypos == 0 && (This->pos & 4)))
+ This->ypos = HeightOfScreen(This->xwin.screen) + This->ypos - This->height;
+
+ get_window_attribs(This, &attribs);
+
+ This->wnd = XCreateWindow(This->display, RootWindowOfScreen(This->xwin.screen), This->xpos, This->ypos, wndwidth,
+ wndheight, 0, This->xwin.depth, InputOutput, This->xwin.visual,
+ CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap |
+ CWBorderPixel, &attribs);
+
+ if (This->xwin.gc == NULL)
+ {
+ This->xwin.gc = XCreateGC(This->display, This->wnd, 0, NULL);
+ ui_reset_clip(This);
+ }
+
+ if (This->xwin.create_bitmap_gc == NULL)
+ This->xwin.create_bitmap_gc = XCreateGC(This->display, This->wnd, 0, NULL);
+
+ if ((This->ownbackstore) && (This->xwin.backstore == 0))
+ {
+ This->xwin.backstore = XCreatePixmap(This->display, This->wnd, This->width, This->height, This->xwin.depth);
+
+ /* clear to prevent rubbish being exposed at startup */
+ XSetForeground(This->display, This->xwin.gc, BlackPixelOfScreen(This->xwin.screen));
+ XFillRectangle(This->display, This->xwin.backstore, This->xwin.gc, 0, 0, This->width, This->height);
+ }
+
+ XStoreName(This->display, This->wnd, This->title);
+
+ if (This->hide_decorations)
+ mwm_hide_decorations(This, This->wnd);
+
+ classhints = XAllocClassHint();
+ if (classhints != NULL)
+ {
+ classhints->res_name = classhints->res_class = "rdesktop";
+ XSetClassHint(This->display, This->wnd, classhints);
+ XFree(classhints);
+ }
+
+ sizehints = XAllocSizeHints();
+ if (sizehints)
+ {
+ sizehints->flags = PMinSize | PMaxSize;
+ if (This->pos)
+ sizehints->flags |= PPosition;
+ sizehints->min_width = sizehints->max_width = This->width;
+ sizehints->min_height = sizehints->max_height = This->height;
+ XSetWMNormalHints(This->display, This->wnd, sizehints);
+ XFree(sizehints);
+ }
+
+ if (This->embed_wnd)
+ {
+ XReparentWindow(This->display, This->wnd, (Window) This->embed_wnd, 0, 0);
+ }
+
+ get_input_mask(This, &input_mask);
+
+ if (This->xwin.IM != NULL)
+ {
+ This->xwin.IC = XCreateIC(This->xwin.IM, XNInputStyle, (XIMPreeditNothing | XIMStatusNothing),
+ XNClientWindow, This->wnd, XNFocusWindow, This->wnd, NULL);
+
+ if ((This->xwin.IC != NULL)
+ && (XGetICValues(This->xwin.IC, XNFilterEvents, &ic_input_mask, NULL) == NULL))
+ input_mask |= ic_input_mask;
+ }
+
+ XSelectInput(This->display, This->wnd, input_mask);
+ XMapWindow(This->display, This->wnd);
+
+ /* wait for VisibilityNotify */
+ do
+ {
+ XMaskEvent(This->display, VisibilityChangeMask, &xevent);
+ }
+ while (xevent.type != VisibilityNotify);
+ This->Unobscured = xevent.xvisibility.state == VisibilityUnobscured;
+
+ This->xwin.focused = False;
+ This->xwin.mouse_in_wnd = False;
+
+ /* handle the WM_DELETE_WINDOW protocol */
+ This->xwin.protocol_atom = XInternAtom(This->display, "WM_PROTOCOLS", True);
+ This->xwin.kill_atom = XInternAtom(This->display, "WM_DELETE_WINDOW", True);
+ XSetWMProtocols(This->display, This->wnd, &This->xwin.kill_atom, 1);
+
+ /* create invisible 1x1 cursor to be used as null cursor */
+ if (This->xwin.null_cursor == NULL)
+ This->xwin.null_cursor = ui_create_cursor(This, 0, 0, 1, 1, null_pointer_mask, null_pointer_data);
+
+ return True;
+}
+
+void
+ui_resize_window(RDPCLIENT * This)
+{
+ XSizeHints *sizehints;
+ Pixmap bs;
+
+ sizehints = XAllocSizeHints();
+ if (sizehints)
+ {
+ sizehints->flags = PMinSize | PMaxSize;
+ sizehints->min_width = sizehints->max_width = This->width;
+ sizehints->min_height = sizehints->max_height = This->height;
+ XSetWMNormalHints(This->display, This->wnd, sizehints);
+ XFree(sizehints);
+ }
+
+ if (!(This->fullscreen || This->embed_wnd))
+ {
+ XResizeWindow(This->display, This->wnd, This->width, This->height);
+ }
+
+ /* create new backstore pixmap */
+ if (This->xwin.backstore != 0)
+ {
+ bs = XCreatePixmap(This->display, This->wnd, This->width, This->height, This->xwin.depth);
+ XSetForeground(This->display, This->xwin.gc, BlackPixelOfScreen(This->xwin.screen));
+ XFillRectangle(This->display, bs, This->xwin.gc, 0, 0, This->width, This->height);
+ XCopyArea(This->display, This->xwin.backstore, bs, This->xwin.gc, 0, 0, This->width, This->height, 0, 0);
+ XFreePixmap(This->display, This->xwin.backstore);
+ This->xwin.backstore = bs;
+ }
+}
+
+void
+ui_destroy_window(RDPCLIENT * This)
+{
+ if (This->xwin.IC != NULL)
+ XDestroyIC(This->xwin.IC);
+
+ XDestroyWindow(This->display, This->wnd);
+}
+
+void
+xwin_toggle_fullscreen(RDPCLIENT * This)
+{
+ Pixmap contents = 0;
+
+ if (This->xwin.seamless_active)
+ /* Turn off SeamlessRDP mode */
+ ui_seamless_toggle(This);
+
+ if (!This->ownbackstore)
+ {
+ /* need to save contents of window */
+ contents = XCreatePixmap(This->display, This->wnd, This->width, This->height, This->xwin.depth);
+ XCopyArea(This->display, This->wnd, contents, This->xwin.gc, 0, 0, This->width, This->height, 0, 0);
+ }
+
+ ui_destroy_window(This);
+ This->fullscreen = !This->fullscreen;
+ ui_create_window(This);
+
+ XDefineCursor(This->display, This->wnd, This->xwin.current_cursor);
+
+ if (!This->ownbackstore)
+ {
+ XCopyArea(This->display, contents, This->wnd, This->xwin.gc, 0, 0, This->width, This->height, 0, 0);
+ XFreePixmap(This->display, contents);
+ }
+}
+
+static void
+handle_button_event(RDPCLIENT * This, XEvent xevent, BOOL down)
+{
+ uint16 button, flags = 0;
+ This->last_gesturetime = xevent.xbutton.time;
+ button = xkeymap_translate_button(xevent.xbutton.button);
+ if (button == 0)
+ return;
+
+ if (down)
+ flags = MOUSE_FLAG_DOWN;
+
+ /* Stop moving window when button is released, regardless of cursor position */
+ if (This->xwin.moving_wnd && (xevent.type == ButtonRelease))
+ This->xwin.moving_wnd = False;
+
+ /* If win_button_sizee is nonzero, enable single app mode */
+ if (xevent.xbutton.y < This->win_button_size)
+ {
+ /* Check from right to left: */
+ if (xevent.xbutton.x >= This->width - This->win_button_size)
+ {
+ /* The close button, continue */
+ ;
+ }
+ else if (xevent.xbutton.x >= This->width - This->win_button_size * 2)
+ {
+ /* The maximize/restore button. Do not send to
+ server. It might be a good idea to change the
+ cursor or give some other visible indication
+ that rdesktop inhibited this click */
+ if (xevent.type == ButtonPress)
+ return;
+ }
+ else if (xevent.xbutton.x >= This->width - This->win_button_size * 3)
+ {
+ /* The minimize button. Iconify window. */
+ if (xevent.type == ButtonRelease)
+ {
+ /* Release the mouse button outside the minimize button, to prevent the
+ actual minimazation to happen */
+ rdp_send_input(This, time(NULL), RDP_INPUT_MOUSE, button, 1, 1);
+ XIconifyWindow(This->display, This->wnd, DefaultScreen(This->display));
+ return;
+ }
+ }
+ else if (xevent.xbutton.x <= This->win_button_size)
+ {
+ /* The system menu. Ignore. */
+ if (xevent.type == ButtonPress)
+ return;
+ }
+ else
+ {
+ /* The title bar. */
+ if (xevent.type == ButtonPress)
+ {
+ if (!This->fullscreen && This->hide_decorations && !This->xwin.using_full_workarea)
+ {
+ This->xwin.moving_wnd = True;
+ This->xwin.move_x_offset = xevent.xbutton.x;
+ This->xwin.move_y_offset = xevent.xbutton.y;
+ }
+ return;
+ }
+ }
+ }
+
+ if (xevent.xmotion.window == This->wnd)
+ {
+ rdp_send_input(This, time(NULL), RDP_INPUT_MOUSE,
+ flags | button, xevent.xbutton.x, xevent.xbutton.y);
+ }
+ else
+ {
+ /* SeamlessRDP */
+ rdp_send_input(This, time(NULL), RDP_INPUT_MOUSE,
+ flags | button, xevent.xbutton.x_root, xevent.xbutton.y_root);
+ }
+}
+
+
+/* Process events in Xlib queue
+ Returns 0 after user quit, 1 otherwise */
+static int
+xwin_process_events(RDPCLIENT * This)
+{
+ XEvent xevent;
+ KeySym keysym;
+ uint32 ev_time;
+ char str[256];
+ Status status;
+ int events = 0;
+ seamless_window *sw;
+
+ while ((XPending(This->display) > 0) && events++ < 20)
+ {
+ XNextEvent(This->display, &xevent);
+
+ if ((This->xwin.IC != NULL) && (XFilterEvent(&xevent, None) == True))
+ {
+ DEBUG_KBD(("Filtering event\n"));
+ continue;
+ }
+
+ switch (xevent.type)
+ {
+ case VisibilityNotify:
+ if (xevent.xvisibility.window == This->wnd)
+ This->Unobscured =
+ xevent.xvisibility.state == VisibilityUnobscured;
+
+ break;
+ case ClientMessage:
+ /* the window manager told us to quit */
+ if ((xevent.xclient.message_type == This->xwin.protocol_atom)
+ && ((Atom) xevent.xclient.data.l[0] == This->xwin.kill_atom))
+ /* Quit */
+ return 0;
+ break;
+
+ case KeyPress:
+ This->last_gesturetime = xevent.xkey.time;
+ if (This->xwin.IC != NULL)
+ /* Multi_key compatible version */
+ {
+ XmbLookupString(This->xwin.IC,
+ &xevent.xkey, str, sizeof(str), &keysym,
+ &status);
+ if (!((status == XLookupKeySym) || (status == XLookupBoth)))
+ {
+ error("XmbLookupString failed with status 0x%x\n",
+ status);
+ break;
+ }
+ }
+ else
+ {
+ /* Plain old XLookupString */
+ DEBUG_KBD(("\nNo input context, using XLookupString\n"));
+ XLookupString((XKeyEvent *) & xevent,
+ str, sizeof(str), &keysym, NULL);
+ }
+
+ DEBUG_KBD(("KeyPress for keysym (0x%lx, %s)\n", keysym,
+ get_ksname(keysym)));
+
+ ev_time = time(NULL);
+ if (handle_special_keys(This, keysym, xevent.xkey.state, ev_time, True))
+ break;
+
+ xkeymap_send_keys(This, keysym, xevent.xkey.keycode, xevent.xkey.state,
+ ev_time, True, 0);
+ break;
+
+ case KeyRelease:
+ This->last_gesturetime = xevent.xkey.time;
+ XLookupString((XKeyEvent *) & xevent, str,
+ sizeof(str), &keysym, NULL);
+
+ DEBUG_KBD(("\nKeyRelease for keysym (0x%lx, %s)\n", keysym,
+ get_ksname(keysym)));
+
+ ev_time = time(NULL);
+ if (handle_special_keys(This, keysym, xevent.xkey.state, ev_time, False))
+ break;
+
+ xkeymap_send_keys(This, keysym, xevent.xkey.keycode, xevent.xkey.state,
+ ev_time, False, 0);
+ break;
+
+ case ButtonPress:
+ handle_button_event(This, xevent, True);
+ break;
+
+ case ButtonRelease:
+ handle_button_event(This, xevent, False);
+ break;
+
+ case MotionNotify:
+ if (This->xwin.moving_wnd)
+ {
+ XMoveWindow(This->display, This->wnd,
+ xevent.xmotion.x_root - This->xwin.move_x_offset,
+ xevent.xmotion.y_root - This->xwin.move_y_offset);
+ break;
+ }
+
+ if (This->fullscreen && !This->xwin.focused)
+ XSetInputFocus(This->display, This->wnd, RevertToPointerRoot,
+ CurrentTime);
+
+ if (xevent.xmotion.window == This->wnd)
+ {
+ rdp_send_input(This, time(NULL), RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE,
+ xevent.xmotion.x, xevent.xmotion.y);
+ }
+ else
+ {
+ /* SeamlessRDP */
+ rdp_send_input(This, time(NULL), RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE,
+ xevent.xmotion.x_root,
+ xevent.xmotion.y_root);
+ }
+ break;
+
+ case FocusIn:
+ if (xevent.xfocus.mode == NotifyGrab)
+ break;
+ This->xwin.focused = True;
+ reset_modifier_keys(This);
+ if (This->grab_keyboard && This->xwin.mouse_in_wnd)
+ XGrabKeyboard(This->display, This->wnd, True,
+ GrabModeAsync, GrabModeAsync, CurrentTime);
+
+ sw = sw_get_window_by_wnd(This, xevent.xfocus.window);
+ if (!sw)
+ break;
+
+ if (sw->id != This->xwin.seamless_focused)
+ {
+ seamless_send_focus(This, sw->id, 0);
+ This->xwin.seamless_focused = sw->id;
+ }
+ break;
+
+ case FocusOut:
+ if (xevent.xfocus.mode == NotifyUngrab)
+ break;
+ This->xwin.focused = False;
+ if (xevent.xfocus.mode == NotifyWhileGrabbed)
+ XUngrabKeyboard(This->display, CurrentTime);
+ break;
+
+ case EnterNotify:
+ /* we only register for this event when in fullscreen mode */
+ /* or grab_keyboard */
+ This->xwin.mouse_in_wnd = True;
+ if (This->fullscreen)
+ {
+ XSetInputFocus(This->display, This->wnd, RevertToPointerRoot,
+ CurrentTime);
+ break;
+ }
+ if (This->xwin.focused)
+ XGrabKeyboard(This->display, This->wnd, True,
+ GrabModeAsync, GrabModeAsync, CurrentTime);
+ break;
+
+ case LeaveNotify:
+ /* we only register for this event when grab_keyboard */
+ This->xwin.mouse_in_wnd = False;
+ XUngrabKeyboard(This->display, CurrentTime);
+ break;
+
+ case Expose:
+ if (xevent.xexpose.window == This->wnd)
+ {
+ XCopyArea(This->display, This->xwin.backstore, xevent.xexpose.window,
+ This->xwin.gc,
+ xevent.xexpose.x, xevent.xexpose.y,
+ xevent.xexpose.width, xevent.xexpose.height,
+ xevent.xexpose.x, xevent.xexpose.y);
+ }
+ else
+ {
+ sw = sw_get_window_by_wnd(This, xevent.xexpose.window);
+ if (!sw)
+ break;
+ XCopyArea(This->display, This->xwin.backstore,
+ xevent.xexpose.window, This->xwin.gc,
+ xevent.xexpose.x + sw->xoffset,
+ xevent.xexpose.y + sw->yoffset,
+ xevent.xexpose.width,
+ xevent.xexpose.height, xevent.xexpose.x,
+ xevent.xexpose.y);
+ }
+
+ break;
+
+ case MappingNotify:
+ /* Refresh keyboard mapping if it has changed. This is important for
+ Xvnc, since it allocates keycodes dynamically */
+ if (xevent.xmapping.request == MappingKeyboard
+ || xevent.xmapping.request == MappingModifier)
+ XRefreshKeyboardMapping(&xevent.xmapping);
+
+ if (xevent.xmapping.request == MappingModifier)
+ {
+ XFreeModifiermap(This->xwin.mod_map);
+ This->xwin.mod_map = XGetModifierMapping(This->display);
+ }
+ break;
+
+ /* clipboard stuff */
+ case SelectionNotify:
+ xclip_handle_SelectionNotify(This, &xevent.xselection);
+ break;
+ case SelectionRequest:
+ xclip_handle_SelectionRequest(This, &xevent.xselectionrequest);
+ break;
+ case SelectionClear:
+ xclip_handle_SelectionClear(This);
+ break;
+ case PropertyNotify:
+ xclip_handle_PropertyNotify(This, &xevent.xproperty);
+ if (xevent.xproperty.window == This->wnd)
+ break;
+ if (xevent.xproperty.window == DefaultRootWindow(This->display))
+ break;
+
+ /* seamless */
+ sw = sw_get_window_by_wnd(This, xevent.xproperty.window);
+ if (!sw)
+ break;
+
+ if ((xevent.xproperty.atom == This->net_wm_state_atom)
+ && (xevent.xproperty.state == PropertyNewValue))
+ {
+ sw->state = ewmh_get_window_state(This, sw->wnd);
+ seamless_send_state(This, sw->id, sw->state, 0);
+ }
+
+ if ((xevent.xproperty.atom == This->net_wm_desktop_atom)
+ && (xevent.xproperty.state == PropertyNewValue))
+ {
+ sw->desktop = ewmh_get_window_desktop(This, sw->wnd);
+ sw_all_to_desktop(This, sw->wnd, sw->desktop);
+ }
+
+ break;
+ case MapNotify:
+ if (!This->xwin.seamless_active)
+ rdp_send_client_window_status(This, 1);
+ break;
+ case UnmapNotify:
+ if (!This->xwin.seamless_active)
+ rdp_send_client_window_status(This, 0);
+ break;
+ case ConfigureNotify:
+ if (!This->xwin.seamless_active)
+ break;
+
+ sw = sw_get_window_by_wnd(This, xevent.xconfigure.window);
+ if (!sw)
+ break;
+
+ gettimeofday(sw->position_timer, NULL);
+ if (sw->position_timer->tv_usec + SEAMLESSRDP_POSITION_TIMER >=
+ 1000000)
+ {
+ sw->position_timer->tv_usec +=
+ SEAMLESSRDP_POSITION_TIMER - 1000000;
+ sw->position_timer->tv_sec += 1;
+ }
+ else
+ {
+ sw->position_timer->tv_usec += SEAMLESSRDP_POSITION_TIMER;
+ }
+
+ sw_handle_restack(This, sw);
+ break;
+ }
+ }
+ /* Keep going */
+ return 1;
+}
+
+/* Returns 0 after user quit, 1 otherwise */
+int
+ui_select(RDPCLIENT * This, int rdp_socket)
+{
+ int n;
+ fd_set rfds, wfds;
+ struct timeval tv;
+ BOOL s_timeout = False;
+
+ while (True)
+ {
+ n = (rdp_socket > This->xwin.x_socket) ? rdp_socket : This->xwin.x_socket;
+ /* Process any events already waiting */
+ if (!xwin_process_events(This))
+ /* User quit */
+ return 0;
+
+ if (This->xwin.seamless_active)
+ sw_check_timers(This);
+
+ FD_ZERO(&rfds);
+ FD_ZERO(&wfds);
+ FD_SET(rdp_socket, &rfds);
+ FD_SET(This->xwin.x_socket, &rfds);
+
+#ifdef WITH_RDPSND
+ /* FIXME: there should be an API for registering fds */
+ if (This->dsp_busy)
+ {
+ FD_SET(This->dsp_fd, &wfds);
+ n = (This->dsp_fd > n) ? This->dsp_fd : n;
+ }
+#endif
+ /* default timeout */
+ tv.tv_sec = 60;
+ tv.tv_usec = 0;
+
+ /* add redirection handles */
+ rdpdr_add_fds(This, &n, &rfds, &wfds, &tv, &s_timeout);
+ seamless_select_timeout(This, &tv);
+
+ n++;
+
+ switch (select(n, &rfds, &wfds, NULL, &tv))
+ {
+ case -1:
+ error("select: %s\n", strerror(errno));
+
+ case 0:
+ /* Abort serial read calls */
+ if (s_timeout)
+ rdpdr_check_fds(This, &rfds, &wfds, (BOOL) True);
+ continue;
+ }
+
+ rdpdr_check_fds(This, &rfds, &wfds, (BOOL) False);
+
+ if (FD_ISSET(rdp_socket, &rfds))
+ return 1;
+
+#ifdef WITH_RDPSND
+ if (This->dsp_busy && FD_ISSET(This->dsp_fd, &wfds))
+ wave_out_play();
+#endif
+ }
+}
+
+void
+ui_move_pointer(RDPCLIENT * This, int x, int y)
+{
+ XWarpPointer(This->display, This->wnd, This->wnd, 0, 0, 0, 0, x, y);
+}
+
+HBITMAP
+ui_create_bitmap(RDPCLIENT * This, int width, int height, uint8 * data)
+{
+ XImage *image;
+ Pixmap bitmap;
+ uint8 *tdata;
+ int bitmap_pad;
+
+ if (This->server_depth == 8)
+ {
+ bitmap_pad = 8;
+ }
+ else
+ {
+ bitmap_pad = This->xwin.bpp;
+
+ if (This->xwin.bpp == 24)
+ bitmap_pad = 32;
+ }
+
+ tdata = (This->owncolmap ? data : translate_image(This, width, height, data));
+ bitmap = XCreatePixmap(This->display, This->wnd, width, height, This->xwin.depth);
+ image = XCreateImage(This->display, This->xwin.visual, This->xwin.depth, ZPixmap, 0,
+ (char *) tdata, width, height, bitmap_pad, 0);
+
+ XPutImage(This->display, bitmap, This->xwin.create_bitmap_gc, image, 0, 0, 0, 0, width, height);
+
+ XFree(image);
+ if (tdata != data)
+ xfree(tdata);
+ return (HBITMAP) bitmap;
+}
+
+void
+ui_paint_bitmap(RDPCLIENT * This, int x, int y, int cx, int cy, int width, int height, uint8 * data)
+{
+ XImage *image;
+ uint8 *tdata;
+ int bitmap_pad;
+
+ if (This->server_depth == 8)
+ {
+ bitmap_pad = 8;
+ }
+ else
+ {
+ bitmap_pad = This->xwin.bpp;
+
+ if (This->xwin.bpp == 24)
+ bitmap_pad = 32;
+ }
+
+ tdata = (This->owncolmap ? data : translate_image(This, width, height, data));
+ image = XCreateImage(This->display, This->xwin.visual, This->xwin.depth, ZPixmap, 0,
+ (char *) tdata, width, height, bitmap_pad, 0);
+
+ if (This->ownbackstore)
+ {
+ XPutImage(This->display, This->xwin.backstore, This->xwin.gc, image, 0, 0, x, y, cx, cy);
+ XCopyArea(This->display, This->xwin.backstore, This->wnd, This->xwin.gc, x, y, cx, cy, x, y);
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, This->xwin.backstore, sw->wnd, This->xwin.gc, x, y, cx, cy,
+ x - sw->xoffset, y - sw->yoffset));
+ }
+ else
+ {
+ XPutImage(This->display, This->wnd, This->xwin.gc, image, 0, 0, x, y, cx, cy);
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, This->wnd, sw->wnd, This->xwin.gc, x, y, cx, cy,
+ x - sw->xoffset, y - sw->yoffset));
+ }
+
+ XFree(image);
+ if (tdata != data)
+ xfree(tdata);
+}
+
+void
+ui_destroy_bitmap(RDPCLIENT * This, HBITMAP bmp)
+{
+ XFreePixmap(This->display, (Pixmap) bmp);
+}
+
+HGLYPH
+ui_create_glyph(RDPCLIENT * This, int width, int height, const uint8 * data)
+{
+ XImage *image;
+ Pixmap bitmap;
+ int scanline;
+
+ scanline = (width + 7) / 8;
+
+ bitmap = XCreatePixmap(This->display, This->wnd, width, height, 1);
+ if (This->xwin.create_glyph_gc == 0)
+ This->xwin.create_glyph_gc = XCreateGC(This->display, bitmap, 0, NULL);
+
+ image = XCreateImage(This->display, This->xwin.visual, 1, ZPixmap, 0, (char *) data,
+ width, height, 8, scanline);
+ image->byte_order = MSBFirst;
+ image->bitmap_bit_order = MSBFirst;
+ XInitImage(image);
+
+ XPutImage(This->display, bitmap, This->xwin.create_glyph_gc, image, 0, 0, 0, 0, width, height);
+
+ XFree(image);
+ return (HGLYPH) bitmap;
+}
+
+void
+ui_destroy_glyph(RDPCLIENT * This, HGLYPH glyph)
+{
+ XFreePixmap(This->display, (Pixmap) glyph);
+}
+
+HCURSOR
+ui_create_cursor(RDPCLIENT * This, unsigned int x, unsigned int y, int width, int height,
+ uint8 * andmask, uint8 * xormask)
+{
+ HGLYPH maskglyph, cursorglyph;
+ XColor bg, fg;
+ Cursor xcursor;
+ uint8 *cursor, *pcursor;
+ uint8 *mask, *pmask;
+ uint8 nextbit;
+ int scanline, offset;
+ int i, j;
+
+ scanline = (width + 7) / 8;
+ offset = scanline * height;
+
+ cursor = (uint8 *) xmalloc(offset);
+ memset(cursor, 0, offset);
+
+ mask = (uint8 *) xmalloc(offset);
+ memset(mask, 0, offset);
+
+ /* approximate AND and XOR masks with a monochrome X pointer */
+ for (i = 0; i < height; i++)
+ {
+ offset -= scanline;
+ pcursor = &cursor[offset];
+ pmask = &mask[offset];
+
+ for (j = 0; j < scanline; j++)
+ {
+ for (nextbit = 0x80; nextbit != 0; nextbit >>= 1)
+ {
+ if (xormask[0] || xormask[1] || xormask[2])
+ {
+ *pcursor |= (~(*andmask) & nextbit);
+ *pmask |= nextbit;
+ }
+ else
+ {
+ *pcursor |= ((*andmask) & nextbit);
+ *pmask |= (~(*andmask) & nextbit);
+ }
+
+ xormask += 3;
+ }
+
+ andmask++;
+ pcursor++;
+ pmask++;
+ }
+ }
+
+ fg.red = fg.blue = fg.green = 0xffff;
+ bg.red = bg.blue = bg.green = 0x0000;
+ fg.flags = bg.flags = DoRed | DoBlue | DoGreen;
+
+ cursorglyph = ui_create_glyph(This, width, height, cursor);
+ maskglyph = ui_create_glyph(This, width, height, mask);
+
+ xcursor =
+ XCreatePixmapCursor(This->display, (Pixmap) cursorglyph,
+ (Pixmap) maskglyph, &fg, &bg, x, y);
+
+ ui_destroy_glyph(This, maskglyph);
+ ui_destroy_glyph(This, cursorglyph);
+ xfree(mask);
+ xfree(cursor);
+ return (HCURSOR) xcursor;
+}
+
+void
+ui_set_cursor(RDPCLIENT * This, HCURSOR cursor)
+{
+ This->xwin.current_cursor = (Cursor) cursor;
+ XDefineCursor(This->display, This->wnd, This->xwin.current_cursor);
+ ON_ALL_SEAMLESS_WINDOWS(XDefineCursor, (This->display, sw->wnd, This->xwin.current_cursor));
+}
+
+void
+ui_destroy_cursor(RDPCLIENT * This, HCURSOR cursor)
+{
+ XFreeCursor(This->display, (Cursor) cursor);
+}
+
+void
+ui_set_null_cursor(RDPCLIENT * This)
+{
+ ui_set_cursor(This, This->xwin.null_cursor);
+}
+
+#define MAKE_XCOLOR(xc,c) \
+ (xc)->red = ((c)->red << 8) | (c)->red; \
+ (xc)->green = ((c)->green << 8) | (c)->green; \
+ (xc)->blue = ((c)->blue << 8) | (c)->blue; \
+ (xc)->flags = DoRed | DoGreen | DoBlue;
+
+
+HCOLOURMAP
+ui_create_colourmap(RDPCLIENT * This, COLOURMAP * colours)
+{
+ COLOURENTRY *entry;
+ int i, ncolours = colours->ncolours;
+ if (!This->owncolmap)
+ {
+ uint32 *map = (uint32 *) xmalloc(sizeof(*This->xwin.colmap) * ncolours);
+ XColor xentry;
+ XColor xc_cache[256];
+ uint32 colour;
+ int colLookup = 256;
+ for (i = 0; i < ncolours; i++)
+ {
+ entry = &colours->colours[i];
+ MAKE_XCOLOR(&xentry, entry);
+
+ if (XAllocColor(This->display, This->xwin.xcolmap, &xentry) == 0)
+ {
+ /* Allocation failed, find closest match. */
+ int j = 256;
+ int nMinDist = 3 * 256 * 256;
+ long nDist = nMinDist;
+
+ /* only get the colors once */
+ while (colLookup--)
+ {
+ xc_cache[colLookup].pixel = colLookup;
+ xc_cache[colLookup].red = xc_cache[colLookup].green =
+ xc_cache[colLookup].blue = 0;
+ xc_cache[colLookup].flags = 0;
+ XQueryColor(This->display,
+ DefaultColormap(This->display,
+ DefaultScreen(This->display)),
+ &xc_cache[colLookup]);
+ }
+ colLookup = 0;
+
+ /* approximate the pixel */
+ while (j--)
+ {
+ if (xc_cache[j].flags)
+ {
+ nDist = ((long) (xc_cache[j].red >> 8) -
+ (long) (xentry.red >> 8)) *
+ ((long) (xc_cache[j].red >> 8) -
+ (long) (xentry.red >> 8)) +
+ ((long) (xc_cache[j].green >> 8) -
+ (long) (xentry.green >> 8)) *
+ ((long) (xc_cache[j].green >> 8) -
+ (long) (xentry.green >> 8)) +
+ ((long) (xc_cache[j].blue >> 8) -
+ (long) (xentry.blue >> 8)) *
+ ((long) (xc_cache[j].blue >> 8) -
+ (long) (xentry.blue >> 8));
+ }
+ if (nDist < nMinDist)
+ {
+ nMinDist = nDist;
+ xentry.pixel = j;
+ }
+ }
+ }
+ colour = xentry.pixel;
+
+ /* update our cache */
+ if (xentry.pixel < 256)
+ {
+ xc_cache[xentry.pixel].red = xentry.red;
+ xc_cache[xentry.pixel].green = xentry.green;
+ xc_cache[xentry.pixel].blue = xentry.blue;
+
+ }
+
+ map[i] = colour;
+ }
+ return map;
+ }
+ else
+ {
+ XColor *xcolours, *xentry;
+ Colormap map;
+
+ xcolours = (XColor *) xmalloc(sizeof(XColor) * ncolours);
+ for (i = 0; i < ncolours; i++)
+ {
+ entry = &colours->colours[i];
+ xentry = &xcolours[i];
+ xentry->pixel = i;
+ MAKE_XCOLOR(xentry, entry);
+ }
+
+ map = XCreateColormap(This->display, This->wnd, This->xwin.visual, AllocAll);
+ XStoreColors(This->display, map, xcolours, ncolours);
+
+ xfree(xcolours);
+ return (HCOLOURMAP) map;
+ }
+}
+
+void
+ui_destroy_colourmap(RDPCLIENT * This, HCOLOURMAP map)
+{
+ if (!This->owncolmap)
+ xfree(map);
+ else
+ XFreeColormap(This->display, (Colormap) map);
+}
+
+void
+ui_set_colourmap(RDPCLIENT * This, HCOLOURMAP map)
+{
+ if (!This->owncolmap)
+ {
+ if (This->xwin.colmap)
+ xfree(This->xwin.colmap);
+
+ This->xwin.colmap = (uint32 *) map;
+ }
+ else
+ {
+ XSetWindowColormap(This->display, This->wnd, (Colormap) map);
+ ON_ALL_SEAMLESS_WINDOWS(XSetWindowColormap, (This->display, sw->wnd, (Colormap) map));
+ }
+}
+
+void
+ui_set_clip(RDPCLIENT * This, int x, int y, int cx, int cy)
+{
+ This->xwin.clip_rectangle.x = x;
+ This->xwin.clip_rectangle.y = y;
+ This->xwin.clip_rectangle.width = cx;
+ This->xwin.clip_rectangle.height = cy;
+ XSetClipRectangles(This->display, This->xwin.gc, 0, 0, &This->xwin.clip_rectangle, 1, YXBanded);
+}
+
+void
+ui_reset_clip(RDPCLIENT * This)
+{
+ This->xwin.clip_rectangle.x = 0;
+ This->xwin.clip_rectangle.y = 0;
+ This->xwin.clip_rectangle.width = This->width;
+ This->xwin.clip_rectangle.height = This->height;
+ XSetClipRectangles(This->display, This->xwin.gc, 0, 0, &This->xwin.clip_rectangle, 1, YXBanded);
+}
+
+void
+ui_bell(RDPCLIENT * This)
+{
+ XBell(This->display, 0);
+}
+
+void
+ui_destblt(RDPCLIENT * This, uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy)
+{
+ SET_FUNCTION(opcode);
+ FILL_RECTANGLE(x, y, cx, cy);
+ RESET_FUNCTION(opcode);
+}
+
+static const uint8 hatch_patterns[] = {
+ 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0 - bsHorizontal */
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 1 - bsVertical */
+ 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, /* 2 - bsFDiagonal */
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, /* 3 - bsBDiagonal */
+ 0x08, 0x08, 0x08, 0xff, 0x08, 0x08, 0x08, 0x08, /* 4 - bsCross */
+ 0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81 /* 5 - bsDiagCross */
+};
+
+void
+ui_patblt(RDPCLIENT * This, uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
+{
+ Pixmap fill;
+ uint8 i, ipattern[8];
+
+ SET_FUNCTION(opcode);
+
+ switch (brush->style)
+ {
+ case 0: /* Solid */
+ SET_FOREGROUND(fgcolour);
+ FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
+ break;
+
+ case 2: /* Hatch */
+ fill = (Pixmap) ui_create_glyph(This, 8, 8,
+ hatch_patterns + brush->pattern[0] * 8);
+ SET_FOREGROUND(fgcolour);
+ SET_BACKGROUND(bgcolour);
+ XSetFillStyle(This->display, This->xwin.gc, FillOpaqueStippled);
+ XSetStipple(This->display, This->xwin.gc, fill);
+ XSetTSOrigin(This->display, This->xwin.gc, brush->xorigin, brush->yorigin);
+ FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
+ XSetFillStyle(This->display, This->xwin.gc, FillSolid);
+ XSetTSOrigin(This->display, This->xwin.gc, 0, 0);
+ ui_destroy_glyph(This, (HGLYPH) fill);
+ break;
+
+ case 3: /* Pattern */
+ for (i = 0; i != 8; i++)
+ ipattern[7 - i] = brush->pattern[i];
+ fill = (Pixmap) ui_create_glyph(This, 8, 8, ipattern);
+ SET_FOREGROUND(bgcolour);
+ SET_BACKGROUND(fgcolour);
+ XSetFillStyle(This->display, This->xwin.gc, FillOpaqueStippled);
+ XSetStipple(This->display, This->xwin.gc, fill);
+ XSetTSOrigin(This->display, This->xwin.gc, brush->xorigin, brush->yorigin);
+ FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
+ XSetFillStyle(This->display, This->xwin.gc, FillSolid);
+ XSetTSOrigin(This->display, This->xwin.gc, 0, 0);
+ ui_destroy_glyph(This, (HGLYPH) fill);
+ break;
+
+ default:
+ unimpl("brush %d\n", brush->style);
+ }
+
+ RESET_FUNCTION(opcode);
+
+ if (This->ownbackstore)
+ XCopyArea(This->display, This->xwin.backstore, This->wnd, This->xwin.gc, x, y, cx, cy, x, y);
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, This->ownbackstore ? This->xwin.backstore : This->wnd, sw->wnd, This->xwin.gc,
+ x, y, cx, cy, x - sw->xoffset, y - sw->yoffset));
+}
+
+void
+ui_screenblt(RDPCLIENT * This, uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* src */ int srcx, int srcy)
+{
+ SET_FUNCTION(opcode);
+ if (This->ownbackstore)
+ {
+ XCopyArea(This->display, This->Unobscured ? This->wnd : This->xwin.backstore,
+ This->wnd, This->xwin.gc, srcx, srcy, cx, cy, x, y);
+ XCopyArea(This->display, This->xwin.backstore, This->xwin.backstore, This->xwin.gc, srcx, srcy, cx, cy, x, y);
+ }
+ else
+ {
+ XCopyArea(This->display, This->wnd, This->wnd, This->xwin.gc, srcx, srcy, cx, cy, x, y);
+ }
+
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, This->ownbackstore ? This->xwin.backstore : This->wnd,
+ sw->wnd, This->xwin.gc, x, y, cx, cy, x - sw->xoffset, y - sw->yoffset));
+
+ RESET_FUNCTION(opcode);
+}
+
+void
+ui_memblt(RDPCLIENT * This, uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* src */ HBITMAP src, int srcx, int srcy)
+{
+ SET_FUNCTION(opcode);
+ XCopyArea(This->display, (Pixmap) src, This->wnd, This->xwin.gc, srcx, srcy, cx, cy, x, y);
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, (Pixmap) src, sw->wnd, This->xwin.gc,
+ srcx, srcy, cx, cy, x - sw->xoffset, y - sw->yoffset));
+ if (This->ownbackstore)
+ XCopyArea(This->display, (Pixmap) src, This->xwin.backstore, This->xwin.gc, srcx, srcy, cx, cy, x, y);
+ RESET_FUNCTION(opcode);
+}
+
+void
+ui_triblt(RDPCLIENT * This, uint8 opcode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* src */ HBITMAP src, int srcx, int srcy,
+ /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
+{
+ /* This is potentially difficult to do in general. Until someone
+ comes up with a more efficient way of doing it I am using cases. */
+
+ switch (opcode)
+ {
+ case 0x69: /* PDSxxn */
+ ui_memblt(This, ROP2_XOR, x, y, cx, cy, src, srcx, srcy);
+ ui_patblt(This, ROP2_NXOR, x, y, cx, cy, brush, bgcolour, fgcolour);
+ break;
+
+ case 0xb8: /* PSDPxax */
+ ui_patblt(This, ROP2_XOR, x, y, cx, cy, brush, bgcolour, fgcolour);
+ ui_memblt(This, ROP2_AND, x, y, cx, cy, src, srcx, srcy);
+ ui_patblt(This, ROP2_XOR, x, y, cx, cy, brush, bgcolour, fgcolour);
+ break;
+
+ case 0xc0: /* PSa */
+ ui_memblt(This, ROP2_COPY, x, y, cx, cy, src, srcx, srcy);
+ ui_patblt(This, ROP2_AND, x, y, cx, cy, brush, bgcolour, fgcolour);
+ break;
+
+ default:
+ unimpl("triblt 0x%x\n", opcode);
+ ui_memblt(This, ROP2_COPY, x, y, cx, cy, src, srcx, srcy);
+ }
+}
+
+void
+ui_line(RDPCLIENT * This, uint8 opcode,
+ /* dest */ int startx, int starty, int endx, int endy,
+ /* pen */ PEN * pen)
+{
+ SET_FUNCTION(opcode);
+ SET_FOREGROUND(pen->colour);
+ XDrawLine(This->display, This->wnd, This->xwin.gc, startx, starty, endx, endy);
+ ON_ALL_SEAMLESS_WINDOWS(XDrawLine, (This->display, sw->wnd, This->xwin.gc,
+ startx - sw->xoffset, starty - sw->yoffset,
+ endx - sw->xoffset, endy - sw->yoffset));
+ if (This->ownbackstore)
+ XDrawLine(This->display, This->xwin.backstore, This->xwin.gc, startx, starty, endx, endy);
+ RESET_FUNCTION(opcode);
+}
+
+void
+ui_rect(RDPCLIENT * This,
+ /* dest */ int x, int y, int cx, int cy,
+ /* brush */ int colour)
+{
+ SET_FOREGROUND(colour);
+ FILL_RECTANGLE(x, y, cx, cy);
+}
+
+void
+ui_polygon(RDPCLIENT * This, uint8 opcode,
+ /* mode */ uint8 fillmode,
+ /* dest */ POINT * point, int npoints,
+ /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
+{
+ uint8 style, i, ipattern[8];
+ Pixmap fill;
+
+ SET_FUNCTION(opcode);
+
+ switch (fillmode)
+ {
+ case ALTERNATE:
+ XSetFillRule(This->display, This->xwin.gc, EvenOddRule);
+ break;
+ case WINDING:
+ XSetFillRule(This->display, This->xwin.gc, WindingRule);
+ break;
+ default:
+ unimpl("fill mode %d\n", fillmode);
+ }
+
+ if (brush)
+ style = brush->style;
+ else
+ style = 0;
+
+ switch (style)
+ {
+ case 0: /* Solid */
+ SET_FOREGROUND(fgcolour);
+ FILL_POLYGON((XPoint *) point, npoints);
+ break;
+
+ case 2: /* Hatch */
+ fill = (Pixmap) ui_create_glyph(This, 8, 8,
+ hatch_patterns + brush->pattern[0] * 8);
+ SET_FOREGROUND(fgcolour);
+ SET_BACKGROUND(bgcolour);
+ XSetFillStyle(This->display, This->xwin.gc, FillOpaqueStippled);
+ XSetStipple(This->display, This->xwin.gc, fill);
+ XSetTSOrigin(This->display, This->xwin.gc, brush->xorigin, brush->yorigin);
+ FILL_POLYGON((XPoint *) point, npoints);
+ XSetFillStyle(This->display, This->xwin.gc, FillSolid);
+ XSetTSOrigin(This->display, This->xwin.gc, 0, 0);
+ ui_destroy_glyph(This, (HGLYPH) fill);
+ break;
+
+ case 3: /* Pattern */
+ for (i = 0; i != 8; i++)
+ ipattern[7 - i] = brush->pattern[i];
+ fill = (Pixmap) ui_create_glyph(This, 8, 8, ipattern);
+ SET_FOREGROUND(bgcolour);
+ SET_BACKGROUND(fgcolour);
+ XSetFillStyle(This->display, This->xwin.gc, FillOpaqueStippled);
+ XSetStipple(This->display, This->xwin.gc, fill);
+ XSetTSOrigin(This->display, This->xwin.gc, brush->xorigin, brush->yorigin);
+ FILL_POLYGON((XPoint *) point, npoints);
+ XSetFillStyle(This->display, This->xwin.gc, FillSolid);
+ XSetTSOrigin(This->display, This->xwin.gc, 0, 0);
+ ui_destroy_glyph(This, (HGLYPH) fill);
+ break;
+
+ default:
+ unimpl("brush %d\n", brush->style);
+ }
+
+ RESET_FUNCTION(opcode);
+}
+
+void
+ui_polyline(RDPCLIENT * This, uint8 opcode,
+ /* dest */ POINT * points, int npoints,
+ /* pen */ PEN * pen)
+{
+ /* TODO: set join style */
+ SET_FUNCTION(opcode);
+ SET_FOREGROUND(pen->colour);
+ XDrawLines(This->display, This->wnd, This->xwin.gc, (XPoint *) points, npoints, CoordModePrevious);
+ if (This->ownbackstore)
+ XDrawLines(This->display, This->xwin.backstore, This->xwin.gc, (XPoint *) points, npoints,
+ CoordModePrevious);
+
+ ON_ALL_SEAMLESS_WINDOWS(seamless_XDrawLines,
+ (This, sw->wnd, (XPoint *) points, npoints, sw->xoffset, sw->yoffset));
+
+ RESET_FUNCTION(opcode);
+}
+
+void
+ui_ellipse(RDPCLIENT * This, uint8 opcode,
+ /* mode */ uint8 fillmode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
+{
+ uint8 style, i, ipattern[8];
+ Pixmap fill;
+
+ SET_FUNCTION(opcode);
+
+ if (brush)
+ style = brush->style;
+ else
+ style = 0;
+
+ switch (style)
+ {
+ case 0: /* Solid */
+ SET_FOREGROUND(fgcolour);
+ DRAW_ELLIPSE(x, y, cx, cy, fillmode);
+ break;
+
+ case 2: /* Hatch */
+ fill = (Pixmap) ui_create_glyph(This, 8, 8,
+ hatch_patterns + brush->pattern[0] * 8);
+ SET_FOREGROUND(fgcolour);
+ SET_BACKGROUND(bgcolour);
+ XSetFillStyle(This->display, This->xwin.gc, FillOpaqueStippled);
+ XSetStipple(This->display, This->xwin.gc, fill);
+ XSetTSOrigin(This->display, This->xwin.gc, brush->xorigin, brush->yorigin);
+ DRAW_ELLIPSE(x, y, cx, cy, fillmode);
+ XSetFillStyle(This->display, This->xwin.gc, FillSolid);
+ XSetTSOrigin(This->display, This->xwin.gc, 0, 0);
+ ui_destroy_glyph(This, (HGLYPH) fill);
+ break;
+
+ case 3: /* Pattern */
+ for (i = 0; i != 8; i++)
+ ipattern[7 - i] = brush->pattern[i];
+ fill = (Pixmap) ui_create_glyph(This, 8, 8, ipattern);
+ SET_FOREGROUND(bgcolour);
+ SET_BACKGROUND(fgcolour);
+ XSetFillStyle(This->display, This->xwin.gc, FillOpaqueStippled);
+ XSetStipple(This->display, This->xwin.gc, fill);
+ XSetTSOrigin(This->display, This->xwin.gc, brush->xorigin, brush->yorigin);
+ DRAW_ELLIPSE(x, y, cx, cy, fillmode);
+ XSetFillStyle(This->display, This->xwin.gc, FillSolid);
+ XSetTSOrigin(This->display, This->xwin.gc, 0, 0);
+ ui_destroy_glyph(This, (HGLYPH) fill);
+ break;
+
+ default:
+ unimpl("brush %d\n", brush->style);
+ }
+
+ RESET_FUNCTION(opcode);
+}
+
+/* warning, this function only draws on wnd or backstore, not both */
+void
+ui_draw_glyph(RDPCLIENT * This, int mixmode,
+ /* dest */ int x, int y, int cx, int cy,
+ /* src */ HGLYPH glyph, int srcx, int srcy,
+ int bgcolour, int fgcolour)
+{
+ SET_FOREGROUND(fgcolour);
+ SET_BACKGROUND(bgcolour);
+
+ XSetFillStyle(This->display, This->xwin.gc,
+ (mixmode == MIX_TRANSPARENT) ? FillStippled : FillOpaqueStippled);
+ XSetStipple(This->display, This->xwin.gc, (Pixmap) glyph);
+ XSetTSOrigin(This->display, This->xwin.gc, x, y);
+
+ FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
+
+ XSetFillStyle(This->display, This->xwin.gc, FillSolid);
+}
+
+#define DO_GLYPH(ttext,idx) \
+{\
+ glyph = cache_get_font (This, font, ttext[idx]);\
+ if (!(flags & TEXT2_IMPLICIT_X))\
+ {\
+ xyoffset = ttext[++idx];\
+ if ((xyoffset & 0x80))\
+ {\
+ if (flags & TEXT2_VERTICAL)\
+ y += ttext[idx+1] | (ttext[idx+2] << 8);\
+ else\
+ x += ttext[idx+1] | (ttext[idx+2] << 8);\
+ idx += 2;\
+ }\
+ else\
+ {\
+ if (flags & TEXT2_VERTICAL)\
+ y += xyoffset;\
+ else\
+ x += xyoffset;\
+ }\
+ }\
+ if (glyph != NULL)\
+ {\
+ x1 = x + glyph->offset;\
+ y1 = y + glyph->baseline;\
+ XSetStipple(This->display, This->xwin.gc, (Pixmap) glyph->pixmap);\
+ XSetTSOrigin(This->display, This->xwin.gc, x1, y1);\
+ FILL_RECTANGLE_BACKSTORE(x1, y1, glyph->width, glyph->height);\
+ if (flags & TEXT2_IMPLICIT_X)\
+ x += glyph->width;\
+ }\
+}
+
+void
+ui_draw_text(RDPCLIENT * This, uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y,
+ int clipx, int clipy, int clipcx, int clipcy,
+ int boxx, int boxy, int boxcx, int boxcy, BRUSH * brush,
+ int bgcolour, int fgcolour, uint8 * text, uint8 length)
+{
+ /* TODO: use brush appropriately */
+
+ FONTGLYPH *glyph;
+ int i, j, xyoffset, x1, y1;
+ DATABLOB *entry;
+
+ SET_FOREGROUND(bgcolour);
+
+ /* Sometimes, the boxcx value is something really large, like
+ 32691. This makes XCopyArea fail with Xvnc. The code below
+ is a quick fix. */
+ if (boxx + boxcx > This->width)
+ boxcx = This->width - boxx;
+
+ if (boxcx > 1)
+ {
+ FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy);
+ }
+ else if (mixmode == MIX_OPAQUE)
+ {
+ FILL_RECTANGLE_BACKSTORE(clipx, clipy, clipcx, clipcy);
+ }
+
+ SET_FOREGROUND(fgcolour);
+ SET_BACKGROUND(bgcolour);
+ XSetFillStyle(This->display, This->xwin.gc, FillStippled);
+
+ /* Paint text, character by character */
+ for (i = 0; i < length;)
+ {
+ switch (text[i])
+ {
+ case 0xff:
+ /* At least two bytes needs to follow */
+ if (i + 3 > length)
+ {
+ warning("Skipping short 0xff command:");
+ for (j = 0; j < length; j++)
+ fprintf(stderr, "%02x ", text[j]);
+ fprintf(stderr, "\n");
+ i = length = 0;
+ break;
+ }
+ cache_put_text(This, text[i + 1], text, text[i + 2]);
+ i += 3;
+ length -= i;
+ /* this will move pointer from start to first character after FF command */
+ text = &(text[i]);
+ i = 0;
+ break;
+
+ case 0xfe:
+ /* At least one byte needs to follow */
+ if (i + 2 > length)
+ {
+ warning("Skipping short 0xfe command:");
+ for (j = 0; j < length; j++)
+ fprintf(stderr, "%02x ", text[j]);
+ fprintf(stderr, "\n");
+ i = length = 0;
+ break;
+ }
+ entry = cache_get_text(This, text[i + 1]);
+ if (entry->data != NULL)
+ {
+ if ((((uint8 *) (entry->data))[1] == 0)
+ && (!(flags & TEXT2_IMPLICIT_X)) && (i + 2 < length))
+ {
+ if (flags & TEXT2_VERTICAL)
+ y += text[i + 2];
+ else
+ x += text[i + 2];
+ }
+ for (j = 0; j < entry->size; j++)
+ DO_GLYPH(((uint8 *) (entry->data)), j);
+ }
+ if (i + 2 < length)
+ i += 3;
+ else
+ i += 2;
+ length -= i;
+ /* this will move pointer from start to first character after FE command */
+ text = &(text[i]);
+ i = 0;
+ break;
+
+ default:
+ DO_GLYPH(text, i);
+ i++;
+ break;
+ }
+ }
+
+ XSetFillStyle(This->display, This->xwin.gc, FillSolid);
+
+ if (This->ownbackstore)
+ {
+ if (boxcx > 1)
+ {
+ XCopyArea(This->display, This->xwin.backstore, This->wnd, This->xwin.gc, boxx,
+ boxy, boxcx, boxcy, boxx, boxy);
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, This->xwin.backstore, sw->wnd, This->xwin.gc,
+ boxx, boxy,
+ boxcx, boxcy,
+ boxx - sw->xoffset, boxy - sw->yoffset));
+ }
+ else
+ {
+ XCopyArea(This->display, This->xwin.backstore, This->wnd, This->xwin.gc, clipx,
+ clipy, clipcx, clipcy, clipx, clipy);
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, This->xwin.backstore, sw->wnd, This->xwin.gc,
+ clipx, clipy,
+ clipcx, clipcy, clipx - sw->xoffset,
+ clipy - sw->yoffset));
+ }
+ }
+}
+
+void
+ui_desktop_save(RDPCLIENT * This, uint32 offset, int x, int y, int cx, int cy)
+{
+ Pixmap pix;
+ XImage *image;
+
+ if (This->ownbackstore)
+ {
+ image = XGetImage(This->display, This->xwin.backstore, x, y, cx, cy, AllPlanes, ZPixmap);
+ }
+ else
+ {
+ pix = XCreatePixmap(This->display, This->wnd, cx, cy, This->xwin.depth);
+ XCopyArea(This->display, This->wnd, pix, This->xwin.gc, x, y, cx, cy, 0, 0);
+ image = XGetImage(This->display, pix, 0, 0, cx, cy, AllPlanes, ZPixmap);
+ XFreePixmap(This->display, pix);
+ }
+
+ offset *= This->xwin.bpp / 8;
+ cache_put_desktop(This, offset, cx, cy, image->bytes_per_line, This->xwin.bpp / 8, (uint8 *) image->data);
+
+ XDestroyImage(image);
+}
+
+void
+ui_desktop_restore(RDPCLIENT * This, uint32 offset, int x, int y, int cx, int cy)
+{
+ XImage *image;
+ uint8 *data;
+
+ offset *= This->xwin.bpp / 8;
+ data = cache_get_desktop(This, offset, cx, cy, This->xwin.bpp / 8);
+ if (data == NULL)
+ return;
+
+ image = XCreateImage(This->display, This->xwin.visual, This->xwin.depth, ZPixmap, 0,
+ (char *) data, cx, cy, BitmapPad(This->display), cx * This->xwin.bpp / 8);
+
+ if (This->ownbackstore)
+ {
+ XPutImage(This->display, This->xwin.backstore, This->xwin.gc, image, 0, 0, x, y, cx, cy);
+ XCopyArea(This->display, This->xwin.backstore, This->wnd, This->xwin.gc, x, y, cx, cy, x, y);
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, This->xwin.backstore, sw->wnd, This->xwin.gc,
+ x, y, cx, cy, x - sw->xoffset, y - sw->yoffset));
+ }
+ else
+ {
+ XPutImage(This->display, This->wnd, This->xwin.gc, image, 0, 0, x, y, cx, cy);
+ ON_ALL_SEAMLESS_WINDOWS(XCopyArea,
+ (This->display, This->wnd, sw->wnd, This->xwin.gc, x, y, cx, cy,
+ x - sw->xoffset, y - sw->yoffset));
+ }
+
+ XFree(image);
+}
+
+/* these do nothing here but are used in uiports */
+void
+ui_begin_update(RDPCLIENT * This)
+{
+}
+
+void
+ui_end_update(RDPCLIENT * This)
+{
+}
+
+
+void
+ui_seamless_begin(RDPCLIENT * This, BOOL hidden)
+{
+ if (!This->seamless_rdp)
+ return;
+
+ if (This->xwin.seamless_started)
+ return;
+
+ This->xwin.seamless_started = True;
+ This->xwin.seamless_hidden = hidden;
+
+ if (!hidden)
+ ui_seamless_toggle(This);
+}
+
+
+void
+ui_seamless_hide_desktop(RDPCLIENT * This)
+{
+ if (!This->seamless_rdp)
+ return;
+
+ if (!This->xwin.seamless_started)
+ return;
+
+ if (This->xwin.seamless_active)
+ ui_seamless_toggle(This);
+
+ This->xwin.seamless_hidden = True;
+}
+
+
+void
+ui_seamless_unhide_desktop(RDPCLIENT * This)
+{
+ if (!This->seamless_rdp)
+ return;
+
+ if (!This->xwin.seamless_started)
+ return;
+
+ This->xwin.seamless_hidden = False;
+
+ ui_seamless_toggle(This);
+}
+
+
+void
+ui_seamless_toggle(RDPCLIENT * This)
+{
+ if (!This->seamless_rdp)
+ return;
+
+ if (!This->xwin.seamless_started)
+ return;
+
+ if (This->xwin.seamless_hidden)
+ return;
+
+ if (This->xwin.seamless_active)
+ {
+ /* Deactivate */
+ while (This->xwin.seamless_windows)
+ {
+ XDestroyWindow(This->display, This->xwin.seamless_windows->wnd);
+ sw_remove_window(This, This->xwin.seamless_windows);
+ }
+ XMapWindow(This->display, This->wnd);
+ }
+ else
+ {
+ /* Activate */
+ XUnmapWindow(This->display, This->wnd);
+ seamless_send_sync(This);
+ }
+
+ This->xwin.seamless_active = !This->xwin.seamless_active;
+}
+
+
+void
+ui_seamless_create_window(RDPCLIENT * This, unsigned long id, unsigned long group, unsigned long parent,
+ unsigned long flags)
+{
+ Window wnd;
+ XSetWindowAttributes attribs;
+ XClassHint *classhints;
+ XSizeHints *sizehints;
+ XWMHints *wmhints;
+ long input_mask;
+ seamless_window *sw, *sw_parent;
+
+ if (!This->xwin.seamless_active)
+ return;
+
+ /* Ignore CREATEs for existing windows */
+ sw = sw_get_window_by_id(This, id);
+ if (sw)
+ return;
+
+ get_window_attribs(This, &attribs);
+ wnd = XCreateWindow(This->display, RootWindowOfScreen(This->xwin.screen), -1, -1, 1, 1, 0, This->xwin.depth,
+ InputOutput, This->xwin.visual,
+ CWBackPixel | CWBackingStore | CWColormap | CWBorderPixel, &attribs);
+
+ XStoreName(This->display, wnd, "SeamlessRDP");
+ ewmh_set_wm_name(This, wnd, "SeamlessRDP");
+
+ mwm_hide_decorations(This, wnd);
+
+ classhints = XAllocClassHint();
+ if (classhints != NULL)
+ {
+ classhints->res_name = "rdesktop";
+ classhints->res_class = "SeamlessRDP";
+ XSetClassHint(This->display, wnd, classhints);
+ XFree(classhints);
+ }
+
+ /* WM_NORMAL_HINTS */
+ sizehints = XAllocSizeHints();
+ if (sizehints != NULL)
+ {
+ sizehints->flags = USPosition;
+ XSetWMNormalHints(This->display, wnd, sizehints);
+ XFree(sizehints);
+ }
+
+ /* Parent-less transient windows */
+ if (parent == 0xFFFFFFFF)
+ {
+ XSetTransientForHint(This->display, wnd, RootWindowOfScreen(This->xwin.screen));
+ /* Some buggy wm:s (kwin) do not handle the above, so fake it
+ using some other hints. */
+ ewmh_set_window_popup(This, wnd);
+ }
+ /* Normal transient windows */
+ else if (parent != 0x00000000)
+ {
+ sw_parent = sw_get_window_by_id(This, parent);
+ if (sw_parent)
+ XSetTransientForHint(This->display, wnd, sw_parent->wnd);
+ else
+ warning("ui_seamless_create_window: No parent window 0x%lx\n", parent);
+ }
+
+ if (flags & SEAMLESSRDP_CREATE_MODAL)
+ {
+ /* We do this to support buggy wm:s (*cough* metacity *cough*)
+ somewhat at least */
+ if (parent == 0x00000000)
+ XSetTransientForHint(This->display, wnd, RootWindowOfScreen(This->xwin.screen));
+ ewmh_set_window_modal(This, wnd);
+ }
+
+ /* FIXME: Support for Input Context:s */
+
+ get_input_mask(This, &input_mask);
+ input_mask |= PropertyChangeMask;
+
+ XSelectInput(This->display, wnd, input_mask);
+
+ /* handle the WM_DELETE_WINDOW protocol. FIXME: When killing a
+ seamless window, we could try to close the window on the
+ serverside, instead of terminating rdesktop */
+ XSetWMProtocols(This->display, wnd, &This->xwin.kill_atom, 1);
+
+ sw = xmalloc(sizeof(seamless_window));
+ sw->wnd = wnd;
+ sw->id = id;
+ sw->behind = 0;
+ sw->group = sw_find_group(This, group, False);
+ sw->group->refcnt++;
+ sw->xoffset = 0;
+ sw->yoffset = 0;
+ sw->width = 0;
+ sw->height = 0;
+ sw->state = SEAMLESSRDP_NOTYETMAPPED;
+ sw->desktop = 0;
+ sw->position_timer = xmalloc(sizeof(struct timeval));
+ timerclear(sw->position_timer);
+
+ sw->outstanding_position = False;
+ sw->outpos_serial = 0;
+ sw->outpos_xoffset = sw->outpos_yoffset = 0;
+ sw->outpos_width = sw->outpos_height = 0;
+
+ sw->next = This->xwin.seamless_windows;
+ This->xwin.seamless_windows = sw;
+
+ /* WM_HINTS */
+ wmhints = XAllocWMHints();
+ if (wmhints)
+ {
+ wmhints->flags = WindowGroupHint;
+ wmhints->window_group = sw->group->wnd;
+ XSetWMHints(This->display, sw->wnd, wmhints);
+ XFree(wmhints);
+ }
+}
+
+
+void
+ui_seamless_destroy_window(RDPCLIENT * This, unsigned long id, unsigned long flags)
+{
+ seamless_window *sw;
+
+ if (!This->xwin.seamless_active)
+ return;
+
+ sw = sw_get_window_by_id(This, id);
+ if (!sw)
+ {
+ warning("ui_seamless_destroy_window: No information for window 0x%lx\n", id);
+ return;
+ }
+
+ XDestroyWindow(This->display, sw->wnd);
+ sw_remove_window(This, sw);
+}
+
+
+void
+ui_seamless_destroy_group(RDPCLIENT * This, unsigned long id, unsigned long flags)
+{
+ seamless_window *sw, *sw_next;
+
+ if (!This->xwin.seamless_active)
+ return;
+
+ for (sw = This->xwin.seamless_windows; sw; sw = sw_next)
+ {
+ sw_next = sw->next;
+
+ if (sw->group->id == id)
+ {
+ XDestroyWindow(This->display, sw->wnd);
+ sw_remove_window(This, sw);
+ }
+ }
+}
+
+
+void
+ui_seamless_move_window(RDPCLIENT * This, unsigned long id, int x, int y, int width, int height, unsigned long flags)
+{
+ seamless_window *sw;
+
+ if (!This->xwin.seamless_active)
+ return;
+
+ sw = sw_get_window_by_id(This, id);
+ if (!sw)
+ {
+ warning("ui_seamless_move_window: No information for window 0x%lx\n", id);
+ return;
+ }
+
+ /* We ignore server updates until it has handled our request. */
+ if (sw->outstanding_position)
+ return;
+
+ if (!width || !height)
+ /* X11 windows must be at least 1x1 */
+ return;
+
+ sw->xoffset = x;
+ sw->yoffset = y;
+ sw->width = width;
+ sw->height = height;
+
+ /* If we move the window in a maximized state, then KDE won't
+ accept restoration */
+ switch (sw->state)
+ {
+ case SEAMLESSRDP_MINIMIZED:
+ case SEAMLESSRDP_MAXIMIZED:
+ return;
+ }
+
+ /* FIXME: Perhaps use ewmh_net_moveresize_window instead */
+ XMoveResizeWindow(This->display, sw->wnd, sw->xoffset, sw->yoffset, sw->width, sw->height);
+}
+
+
+void
+ui_seamless_restack_window(RDPCLIENT * This, unsigned long id, unsigned long behind, unsigned long flags)
+{
+ seamless_window *sw;
+
+ if (!This->xwin.seamless_active)
+ return;
+
+ sw = sw_get_window_by_id(This, id);
+ if (!sw)
+ {
+ warning("ui_seamless_restack_window: No information for window 0x%lx\n", id);
+ return;
+ }
+
+ if (behind)
+ {
+ seamless_window *sw_behind;
+ Window wnds[2];
+
+ sw_behind = sw_get_window_by_id(This, behind);
+ if (!sw_behind)
+ {
+ warning("ui_seamless_restack_window: No information for window 0x%lx\n",
+ behind);
+ return;
+ }
+
+ wnds[1] = sw_behind->wnd;
+ wnds[0] = sw->wnd;
+
+ XRestackWindows(This->display, wnds, 2);
+ }
+ else
+ {
+ XRaiseWindow(This->display, sw->wnd);
+ }
+
+ sw_restack_window(This, sw, behind);
+}
+
+
+void
+ui_seamless_settitle(RDPCLIENT * This, unsigned long id, const char *title, unsigned long flags)
+{
+ seamless_window *sw;
+
+ if (!This->xwin.seamless_active)
+ return;
+
+ sw = sw_get_window_by_id(This, id);
+ if (!sw)
+ {
+ warning("ui_seamless_settitle: No information for window 0x%lx\n", id);
+ return;
+ }
+
+ /* FIXME: Might want to convert the name for non-EWMH WMs */
+ XStoreName(This->display, sw->wnd, title);
+ ewmh_set_wm_name(This, sw->wnd, title);
+}
+
+
+void
+ui_seamless_setstate(RDPCLIENT * This, unsigned long id, unsigned int state, unsigned long flags)
+{
+ seamless_window *sw;
+
+ if (!This->xwin.seamless_active)
+ return;
+
+ sw = sw_get_window_by_id(This, id);
+ if (!sw)
+ {
+ warning("ui_seamless_setstate: No information for window 0x%lx\n", id);
+ return;
+ }
+
+ switch (state)
+ {
+ case SEAMLESSRDP_NORMAL:
+ case SEAMLESSRDP_MAXIMIZED:
+ ewmh_change_state(This, sw->wnd, state);
+ XMapWindow(This->display, sw->wnd);
+ break;
+ case SEAMLESSRDP_MINIMIZED:
+ /* EWMH says: "if an Application asks to toggle _NET_WM_STATE_HIDDEN
+ the Window Manager should probably just ignore the request, since
+ _NET_WM_STATE_HIDDEN is a function of some other aspect of the window
+ such as minimization, rather than an independent state." Besides,
+ XIconifyWindow is easier. */
+ if (sw->state == SEAMLESSRDP_NOTYETMAPPED)
+ {
+ XWMHints *hints;
+ hints = XGetWMHints(This->display, sw->wnd);
+ if (hints)
+ {
+ hints->flags |= StateHint;
+ hints->initial_state = IconicState;
+ XSetWMHints(This->display, sw->wnd, hints);
+ XFree(hints);
+ }
+ XMapWindow(This->display, sw->wnd);
+ }
+ else
+ XIconifyWindow(This->display, sw->wnd, DefaultScreen(This->display));
+ break;
+ default:
+ warning("SeamlessRDP: Invalid state %d\n", state);
+ break;
+ }
+
+ sw->state = state;
+}
+
+
+void
+ui_seamless_syncbegin(RDPCLIENT * This, unsigned long flags)
+{
+ if (!This->xwin.seamless_active)
+ return;
+
+ /* Destroy all seamless windows */
+ while (This->xwin.seamless_windows)
+ {
+ XDestroyWindow(This->display, This->xwin.seamless_windows->wnd);
+ sw_remove_window(This, This->xwin.seamless_windows);
+ }
+}
+
+
+void
+ui_seamless_ack(RDPCLIENT * This, unsigned int serial)
+{
+ seamless_window *sw;
+ for (sw = This->xwin.seamless_windows; sw; sw = sw->next)
+ {
+ if (sw->outstanding_position && (sw->outpos_serial == serial))
+ {
+ sw->xoffset = sw->outpos_xoffset;
+ sw->yoffset = sw->outpos_yoffset;
+ sw->width = sw->outpos_width;
+ sw->height = sw->outpos_height;
+ sw->outstanding_position = False;
+
+ /* Do a complete redraw of the window as part of the
+ completion of the move. This is to remove any
+ artifacts caused by our lack of synchronization. */
+ XCopyArea(This->display, This->xwin.backstore,
+ sw->wnd, This->xwin.gc,
+ sw->xoffset, sw->yoffset, sw->width, sw->height, 0, 0);
+
+ break;
+ }
+ }
+}