SF 3377279

- Placed JacobVersion.properties into ${release.dir.java.meta.inf} instead of the current folder;
- com/jacob/test/safearray/SafeArrayBasicTest.java is compiled separately, because it is in UTF-16 encoding
- Added initializing Variant used to retrieve the next value from IEnum because some implemenations call VariantClear on it before setting a new value
- Changed _WIN32_WINNT to 0x0500 to fix build with VS2010
- Fixed the leak in Java_com_jacob_com_Variant_putVariantNoParam
- Added Dispatch.Method to the invoke flags to call _NewEnum. There are some nonconforming legacy implementations that expose _NewEnum as a method.
This commit is contained in:
clay_shooter
2011-10-01 22:33:38 +00:00
parent cbfc548c6f
commit 003671fb90
7 changed files with 108 additions and 27 deletions

View File

@@ -111,9 +111,10 @@
<!-- ======================================================================
Writes out a version file to be included in the jar
build iteration is only the iteration since lat time releases directory cleaned
================================================================== -->
<property name="version" value="version not set in compilation_tools properties file"/>
<propertyfile file="${generated.filename.version}">
<propertyfile file="${release.dir.java.meta.inf}/${generated.filename.version}">
<entry key="version" type="string" value="${version}" />
<entry key="build.iteration" type="int" operation="+" value="1" pattern="00" />
<entry key="build.date" type="date" value="now" operation="=" pattern="dd-MMMM-yyyy HH:mm:ss" />
@@ -222,8 +223,14 @@
<javac srcdir="${src.java.unittest}"
destdir="${release.dir.java}"
classpath="${release.dir.java}:${junit.jar}"
listfiles="true" debug="on" source="1.5" />
<copy file="${generated.filename.version}" todir="${release.dir.java.meta.inf}"/>
listfiles="true" debug="on" source="1.5"
excludes="com/jacob/test/safearray/SafeArrayBasicTest.java"/>
<javac srcdir="${src.java.unittest}"
destdir="${release.dir.java}"
classpath="${release.dir.java}:${junit.jar}"
listfiles="true" debug="on" source="1.5"
includes="com/jacob/test/safearray/SafeArrayBasicTest.java"
encoding="UTF-16"/>
</target>
<!-- ======================================================================
Package the classes into a JAR.
@@ -422,7 +429,7 @@
<exclude name="**/CVS" />
<exclude name="**/*.obj" />
<exclude name="**/*.class" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="LICENSE.* ${generated.filename.version} README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="LICENSE.* README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="docs/**" />
<zipfileset dir="${release.dir.x86}" prefix="${generated.filename.zip}" includes="${generated.filename.dll.x86}" />
<zipfileset dir="${release.dir.x64}" prefix="${generated.filename.zip}" includes="${generated.filename.dll.x64}" />
@@ -437,15 +444,14 @@
<exclude name="**/*.dll" />
<exclude name="**/*.exp" />
<exclude name="**/*.jar" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="src/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="build.xml LICENSE.* README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="docs/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="lib/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="src/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="jni/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="samples/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="unittest/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="vstudio/jacob.vcproj" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="lib/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="build.xml, README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="LICENSE.* ${generated.filename.version}" />
</zip>
</target>

View File

@@ -1,6 +1,67 @@
<HTML>
<BODY>
<!-- --------- -->
<h2>JACOB 1.16</h2>
<h3>What's New</h3>
<ul>
<li>
No new features
</li>
</ul>
<h3>Tracked Changes</h3>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" >
<tr>
<td colspan="2"><b>Bugs</b></td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><b>Patches</b></td>
</tr>
<tr>
<td width="13%" valign="top">3377279</td>
<td width="87%" valign="top">(M1)Fix possible exception. Added initializing Variant used to retrieve
the next value from IEnum
because some implementations call VariantClear on it before setting a new value</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">(M1)Isolate compilation of SafeArrayTest.java because it is UTF-16 and not UTF-8</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">(M1)Changed windows version _WIN32_WINNT to 0x0500 to fix build with VS2010. (now 2000 or later)</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">(M1)Fixed the leak in Java_com_jacob_com_Variant_putVariantNoParam</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">(M1)Added Dispatch.Method to the invoke flags to call _NewEnum.
There are some non-conforming legacy implementations that expose _NewEnum as a method.</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><b>Feature Requests</b></td>
</tr>
<tr>
<tr>
<td width="13%" valign="top"></td>
<td width="87%" valign="top"></td>
</tr>
</table>
<!-- --------- -->
<h2>JACOB 1.15</h2>
<h3>What's New</h3>
<ul>
@@ -18,30 +79,30 @@
</tr>
<tr>
<td width="13%" valign="top">3065265</td>
<td width="87%" valign="top">Bit masking in Variant.getXXXRef() uses wrong mask allowing more than
<td width="87%" valign="top">(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)</td>
but invalid types were not always detected.</td>
</tr>
<tr>
<td width="13%" valign="top">2935662</td>
<td width="87%" valign="top">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)</td>
<td width="87%" valign="top">(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.</td>
</tr>
<tr>
<td width="13%" valign="top">2819445</td>
<td width="87%" valign="top">SafeArray.fromLongArray fails when using VariantLongInt (M3)</td>
<td width="87%" valign="top">(M3)SafeArray.fromLongArray fails when using VariantLongInt</td>
</tr>
<tr>
<td width="13%" valign="top">2847577</td>
<td width="87%" valign="top">SafeArray#setString(*) incorrectly handles unicode strings (M3)</td>
<td width="87%" valign="top">(M3) SafeArray#setString(*) incorrectly handles unicode strings</td>
</tr>
<tr>
<td width="13%" valign="top">2721937</td>
<td width="87%" valign="top">System.getProperties call caused security exception in applet.
<td width="87%" valign="top">(M2)System.getProperties call caused security exception in applet.
<i>com.jacob.includeAllClassesInROT</i> 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
<i>all classes in ROT</i> mode. (M2)</td>
<i>all classes in ROT</i> mode.</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
@@ -52,11 +113,11 @@
</tr>
<tr>
<td width="13%" valign="top">2762275 </td>
<td width="87%" valign="top">Support conversion of primitive arrays to Variant arrays. (M1)</td>
<td width="87%" valign="top">(M1)Support conversion of primitive arrays to Variant arrays.</td>
</tr>
<tr>
<td width="13%" valign="top">2171967 </td>
<td width="87%" valign="top">VariantUtils.populateVariant can cause VM crash with unrecognized type.(M1)</td>
<td width="87%" valign="top">(M1)VariantUtils.populateVariant can cause VM crash with unrecognized type.</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
@@ -72,13 +133,13 @@
file signing and file placement is required</td>
<tr>
<td width="13%" valign="top">2963102</td>
<td width="87%" valign="top">Convert API to use var args and remove the many overloaded Dispatch
methods that each added one more parameter.(M4)</td>
<td width="87%" valign="top">(M4)Convert API to use var args and remove the many overloaded Dispatch
methods that each added one more parameter.</td>
</tr>
<tr>
<td width="13%" valign="top">2927058</td>
<td width="87%" valign="top">a hasExited() method that allows polling until a COM server is
terminated and implemented this method in JACOB(M4)</td>
<td width="87%" valign="top">(M4)a hasExited() method that allows polling until a COM server is
terminated and implemented this method in JACOB</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>

View File

@@ -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);

View File

@@ -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 <windows.h>

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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();