Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2004-12-16 21:23:59 +0000
committerVeronika Irvine2004-12-16 21:23:59 +0000
commit2a80b0283d6dbaa0760372cca4c2d987b77727a2 (patch)
tree648da16498e99325f9b187ead3bf274ad7874a24
parent3df01f1dfcce5cfbf90215bdd41e9437d26339e5 (diff)
downloadeclipse.platform.swt-2a80b0283d6dbaa0760372cca4c2d987b77727a2.tar.gz
eclipse.platform.swt-2a80b0283d6dbaa0760372cca4c2d987b77727a2.tar.xz
eclipse.platform.swt-2a80b0283d6dbaa0760372cca4c2d987b77727a2.zip
Check address of callback after creation
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java
index f3bd50ccc6..a83d04d042 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java
@@ -11,6 +11,7 @@
package org.eclipse.swt.internal.ole.win32;
import java.util.Hashtable;
+import org.eclipse.swt.*;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.win32.*;
@@ -29,6 +30,7 @@ public COMObject(int[] argCounts) {
for (int i = 0, length = argCounts.length; i < length; i++){
if ((Callbacks[i][argCounts[i]]) == null) {
Callbacks[i][argCounts[i]] = new Callback(this.getClass(), "callback"+i, argCounts[i] + 1, true, COM.E_FAIL); //$NON-NLS-1$
+ if (Callbacks[i][argCounts[i]].getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
}
callbackAddresses[i] = Callbacks[i][argCounts[i]].getAddress();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
index 243758e35c..8bc59dc0d7 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
@@ -157,6 +157,7 @@ private static void initMsgHook(Display display) {
if (display.getData(HHOOK) != null) return;
final Callback callback = new Callback(OleFrame.class, "getMsgProc", 3); //$NON-NLS-1$
int address = callback.getAddress();
+ if (address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
int threadId = OS.GetCurrentThreadId();
final int hHook = OS.SetWindowsHookEx(OS.WH_GETMESSAGE, address, 0, threadId);
if (hHook == 0) {
@@ -216,10 +217,10 @@ static int getMsgProc(int code, int wParam, int lParam) {
return 0;
}
}
+ }
}
}
}
- }
return OS.CallNextHookEx(hHook.intValue(), code, wParam, lParam);
}
/**

Back to the top