@@ -18,30 +79,30 @@
| 3065265 |
- Bit masking in Variant.getXXXRef() uses wrong mask allowing more than
+ | (M4)Bit masking in Variant.getXXXRef() uses wrong mask allowing more than
one type to be seen as the requested type. Code that passed in the correct type always worked
- but invalid types were not always detected.(M4) |
+ but invalid types were not always detected.
| 2935662 |
- Error handling code crashes because of uninitialized data in Dispatch.cpp
- Check for NULL fails. pfnDeferredFillIn pointer is not initialized, but it's not NULL.(M4) |
+ (M4)Error handling code crashes because of uninitialized data in Dispatch.cpp
+ Check for NULL fails. pfnDeferredFillIn pointer is not initialized, but it's not NULL. |
| 2819445 |
- SafeArray.fromLongArray fails when using VariantLongInt (M3) |
+ (M3)SafeArray.fromLongArray fails when using VariantLongInt |
| 2847577 |
- SafeArray#setString(*) incorrectly handles unicode strings (M3) |
+ (M3) SafeArray#setString(*) incorrectly handles unicode strings |
| 2721937 |
- System.getProperties call caused security exception in applet.
+ | (M2)System.getProperties call caused security exception in applet.
com.jacob.includeAllClassesInROT now acts as master switch for class/ROT control.
This change also has the side benefit that the PutInROT property is not
checked on every object creation for users who run in the standard
- all classes in ROT mode. (M2) |
+ all classes in ROT mode.
| |
@@ -52,11 +113,11 @@
| 2762275 |
- Support conversion of primitive arrays to Variant arrays. (M1) |
+ (M1)Support conversion of primitive arrays to Variant arrays. |
| 2171967 |
- VariantUtils.populateVariant can cause VM crash with unrecognized type.(M1) |
+ (M1)VariantUtils.populateVariant can cause VM crash with unrecognized type. |
| |
@@ -72,13 +133,13 @@
file signing and file placement is required
| 2963102 |
- Convert API to use var args and remove the many overloaded Dispatch
- methods that each added one more parameter.(M4) |
+ (M4)Convert API to use var args and remove the many overloaded Dispatch
+ methods that each added one more parameter. |
| 2927058 |
- a hasExited() method that allows polling until a COM server is
- terminated and implemented this method in JACOB(M4) |
+ (M4)a hasExited() method that allows polling until a COM server is
+ terminated and implemented this method in JACOB |
| |
diff --git a/jni/EnumVariant.cpp b/jni/EnumVariant.cpp
index 25fb226..5164130 100644
--- a/jni/EnumVariant.cpp
+++ b/jni/EnumVariant.cpp
@@ -57,6 +57,14 @@ Java_com_jacob_com_EnumVariant_Next(JNIEnv* env, jobject _this, jobjectArray var
return 0;
VARIANT* sink = (VARIANT*)CoTaskMemAlloc(count * sizeof(VARIANT));
+ // SF 3377279
+ // Added initializing Variant used to retrieve the next value from IEnum
+ // because some implemenations call VariantClear on it before setting a new value
+ for (ULONG i = 0; i < count; ++i)
+ {
+ VariantInit(sink + i);
+ }
+
ULONG fetchCount = 0;
HRESULT hr = self->Next(count, sink, &fetchCount);
diff --git a/jni/StdAfx.h b/jni/StdAfx.h
index 3d1a2d2..e0f8c22 100644
--- a/jni/StdAfx.h
+++ b/jni/StdAfx.h
@@ -31,8 +31,10 @@
#ifndef STRICT
#define STRICT
#endif
+// SF 3377279 Changed _WIN32_WINNT to 0x0500 to fix build with VS2010
+// 0x400 is NT or later 0x500 is windows 2000 or later. we could go higher
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0400
+#define _WIN32_WINNT 0x0500
#endif
//#define _ATL_APARTMENT_THREADED
#include
diff --git a/jni/Variant.cpp b/jni/Variant.cpp
index 7f13de0..88cce9c 100644
--- a/jni/Variant.cpp
+++ b/jni/Variant.cpp
@@ -967,6 +967,8 @@ JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantNoParam
{
VARIANT *v = extractVariant(env, _this);
if (v) {
+ // SF 3377279 clear variable to fix leak
+ VariantClear(v);
V_VT(v) = VT_ERROR;
V_ERROR(v) = DISP_E_PARAMNOTFOUND;
}
diff --git a/src/com/jacob/com/EnumVariant.java b/src/com/jacob/com/EnumVariant.java
index 8ff298f..4dab6e3 100644
--- a/src/com/jacob/com/EnumVariant.java
+++ b/src/com/jacob/com/EnumVariant.java
@@ -40,12 +40,13 @@ public class EnumVariant extends JacobObject implements
*/
public EnumVariant(Dispatch disp) {
int[] hres = new int[1];
+ // SF 3377279
+ // Added Dispatch.Method to the invoke flags to call _NewEnum. There are some
+ // non-conforming legacy implementations that expose _NewEnum as a method.
Variant evv = Dispatch.invokev(disp, DispatchIdentifier.DISPID_NEWENUM,
- Dispatch.Get, new Variant[0], hres);
+ Dispatch.Get | Dispatch.Method, new Variant[0], hres);
if (evv.getvt() != Variant.VariantObject)
- //
// The DISPID_NEWENUM did not result in a valid object
- //
throw new ComFailException("Can't obtain EnumVARIANT");
EnumVariant tmp = evv.toEnumVariant();
diff --git a/unittest/com/jacob/test/events/IETest.java b/unittest/com/jacob/test/events/IETest.java
index 40d529f..845de86 100644
--- a/unittest/com/jacob/test/events/IETest.java
+++ b/unittest/com/jacob/test/events/IETest.java
@@ -126,7 +126,8 @@ class IETestThread extends Thread {
Dispatch.put(ie, "Visible", new Variant(true));
Dispatch.put(ie, "AddressBar", new Variant(true));
System.out.println("IETestThread: " + Dispatch.get(ie, "Path"));
- Dispatch.put(ie, "StatusText", new Variant("My Status Text"));
+ // Some version of IE broke this. Not sure which one
+ // Dispatch.put(ie, "StatusText", new Variant("My Status Text"));
System.out.println("IETestThread: About to hookup event listener");
IEEvents ieE = new IEEvents();