summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT OLE Win32
diff options
context:
space:
mode:
authorDuong Nguyen <dnguyen>2008-10-03 22:48:15 +0000
committerDuong Nguyen <dnguyen>2008-10-03 22:48:15 +0000
commite0cab416a57c67e62a8bf049b1140825d3427f4f (patch)
tree1be23a683c3846e8e454fc374b394fd057f28364 /bundles/org.eclipse.swt/Eclipse SWT OLE Win32
parent4a612b2956f61d263eac63e0666a4682bcad134f (diff)
downloadeclipse.platform.swt-e0cab416a57c67e62a8bf049b1140825d3427f4f.tar.gz
eclipse.platform.swt-e0cab416a57c67e62a8bf049b1140825d3427f4f.tar.xz
eclipse.platform.swt-e0cab416a57c67e62a8bf049b1140825d3427f4f.zip
173556 - don't set the clientSite twice if it's already defined.
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT OLE Win32')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java15
1 files changed, 14 insertions, 1 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 b89458d525..e9aed1d202 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
@@ -420,7 +420,20 @@ protected void addObjectReferences() {
if (result != COM.S_OK)
OLE.error(OLE.ERROR_INTERFACE_NOT_FOUND, result);
objIOleObject = new IOleObject(ppvObject[0]);
- objIOleObject.SetClientSite(iOleClientSite.getAddress());
+ /*
+ * Although the clientSite was passed in during the creation of OleObject
+ * (which is required by WMP11 - see bug 173556), some applications ignore this
+ * parameter (see bug 211663) because it is optional during the OleCreate.
+ * To ensure that we don't set the clientSite twice, we will not set the clientSite
+ * again if it's already defined.
+ */
+ int /*long*/[] ppvClientSite = new int /*long*/[1];
+ result = objIOleObject.GetClientSite(ppvClientSite);
+ if (ppvClientSite[0] == 0) {
+ objIOleObject.SetClientSite(iOleClientSite.getAddress());
+ } else {
+ Release(); // GetClientSite performs an AddRef so we must release it.
+ }
int[] pdwConnection = new int[1];
objIOleObject.Advise(iAdviseSink.getAddress(), pdwConnection);
objIOleObject.SetHostNames("main", "main"); //$NON-NLS-1$ //$NON-NLS-2$