diff options
author | Silenio Quarti <silenio> | 2010-11-25 15:13:38 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2010-11-25 15:13:38 +0000 |
commit | e256b8b3806f27e2c37f54a8944f1dcaae965a78 (patch) | |
tree | 37f544845389f012d695e64a51bea69144ec7d50 /bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole | |
parent | 34327c07833b5bbd74e560c7f09bc9ccb63b4395 (diff) | |
download | eclipse.platform.swt-e256b8b3806f27e2c37f54a8944f1dcaae965a78.tar.gz eclipse.platform.swt-e256b8b3806f27e2c37f54a8944f1dcaae965a78.tar.xz eclipse.platform.swt-e256b8b3806f27e2c37f54a8944f1dcaae965a78.zip |
Bug 327560 - Failed to create Citrix Client v12
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole')
2 files changed, 19 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java index a54b742cb2..f05b576148 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java @@ -230,7 +230,14 @@ public OleClientSite(Composite parent, int style, String progId) { // Create ole object with storage object int /*long*/[] address = new int /*long*/[1]; - int result = COM.OleCreate(appClsid, COM.IIDIUnknown, COM.OLERENDER_DRAW, null, iOleClientSite.getAddress(), tempStorage.getAddress(), address); + /* + * Bug in ICA Client 2.7. The creation of the IOleObject fails if the client + * site is provided to OleCreate(). The fix is to detect that the program + * id is an ICA Client and do not pass a client site to OleCreate(). + * IOleObject.SetClientSite() is called later on. + */ + int /*long*/ clientSite = isICAClient() ? 0 : iOleClientSite.getAddress(); + int result = COM.OleCreate(appClsid, COM.IIDIUnknown, COM.OLERENDER_DRAW, null, clientSite, tempStorage.getAddress(), address); if (result != COM.S_OK) OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result); @@ -821,6 +828,9 @@ private int GetWindowContext(int /*long*/ ppFrame, int /*long*/ ppDoc, int /*lon return COM.S_OK; } +boolean isICAClient() { + return getProgramID().startsWith("Citrix.ICAClient"); //$NON-NLS-1$ +} /** * Returns whether ole document is dirty by checking whether the content * of the file representing the document is dirty. diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java index b9e5a69fd5..b5dda3f6ca 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java @@ -137,7 +137,14 @@ public OleControlSite(Composite parent, int style, String progId) { // Create ole object with storage object int /*long*/[] address = new int /*long*/[1]; - int result = COM.OleCreate(appClsid, COM.IIDIUnknown, COM.OLERENDER_DRAW, null, iOleClientSite.getAddress(), tempStorage.getAddress(), address); + /* + * Bug in ICA Client 2.7. The creation of the IOleObject fails if the client + * site is provided to OleCreate(). The fix is to detect that the program + * id is an ICA Client and do not pass a client site to OleCreate(). + * IOleObject.SetClientSite() is called later on. + */ + int /*long*/ clientSite = isICAClient() ? 0 : iOleClientSite.getAddress(); + int result = COM.OleCreate(appClsid, COM.IIDIUnknown, COM.OLERENDER_DRAW, null, clientSite, tempStorage.getAddress(), address); if (result != COM.S_OK) OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result); |