2819445 SafeArray.fromLongArray fails when using VariantLongInt

This commit is contained in:
clay_shooter
2009-12-25 19:11:55 +00:00
parent 54f105525b
commit d639d9fd76
3 changed files with 6 additions and 1 deletions

View File

@@ -16,6 +16,10 @@
<tr> <tr>
<td colspan="2"><b>Bugs</b></td> <td colspan="2"><b>Bugs</b></td>
</tr> </tr>
<tr>
<td width="13%" valign="top">2819445</td>
<td width="87%" valign="top">SafeArray.fromLongArray fails when using VariantLongInt (M3)</td>
</tr>
<tr> <tr>
<td width="13%" valign="top">2847577</td> <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">SafeArray#setString(*) incorrectly handles unicode strings (M3)</td>

View File

@@ -483,7 +483,8 @@ JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromLongArray
} else if (vt == VT_I8) { } else if (vt == VT_I8) {
void *pData; void *pData;
SafeArrayAccessData(psa, &pData); SafeArrayAccessData(psa, &pData);
memcpy(pData, arrayElements, len*sizeof(long)); // VT_I8 is actually a LONGLONG and not a long in length SF 2819445
memcpy(pData, arrayElements, len*sizeof(LONGLONG));
SafeArrayUnaccessData(psa); SafeArrayUnaccessData(psa);
} else { } else {
ThrowComFail(env, "safearray cannot be assigned from long", -1); ThrowComFail(env, "safearray cannot be assigned from long", -1);