Skip to content

Commit

Permalink
Bug 132 32 bit pointers not coerced to 64 bit correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
freemansoft committed Jun 10, 2018
1 parent 93cdadf commit 7edda76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion jacob/jni/Dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ JNIEXPORT jobject JNICALL Java_com_jacob_com_Dispatch_QueryInterface
// I am copying the pointer to java
// jacob-msg 1817 - SF 1053871 : QueryInterface already called AddRef!!
//if (disp) disp->AddRef();
jobject newAuto = env->NewObject(autoClass, autoCons, disp);
// jacobproject/bug/132
jobject newAuto = env->NewObject(autoClass, autoCons, (jlong)(uintptr_t)disp);
return newAuto;
}

Expand Down
3 changes: 2 additions & 1 deletion jacob/jni/DispatchProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ JNIEXPORT jobject JNICALL Java_com_jacob_com_DispatchProxy_MarshalFromStream
// construct a Dispatch object to return
// I am copying the pointer to java
if (pD) pD->AddRef();
jobject newAuto = env->NewObject(autoClass, autoCons, pD);
// jacobproject/bug/132
jobject newAuto = env->NewObject(autoClass, autoCons, (jlong)(uintptr_t)pD);
return newAuto;
}

Expand Down
6 changes: 4 additions & 2 deletions jacob/jni/Variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_toEnumVariant
// SF-1674179 fix EnumVariants memory leak
// AJ: yes, but the QueryInterface call above already incremented the reference
//if (ie) ie->AddRef();
jobject newAuto = env->NewObject(autoClass, autoCons, ie);
// jacobproject/bug/132
jobject newAuto = env->NewObject(autoClass, autoCons, (jlong)(uintptr_t)ie);
return newAuto;
}
return NULL;
Expand Down Expand Up @@ -411,7 +412,8 @@ JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_toVariantDispatch
IDispatch *disp = V_DISPATCH(v);
// I am copying the pointer to java
if (disp) disp->AddRef();
jobject newAuto = env->NewObject(autoClass, autoCons, disp);
// jacobproject/bug/132
jobject newAuto = env->NewObject(autoClass, autoCons, (jlong)(uintptr_t)disp);
return newAuto;
}
return NULL;
Expand Down

0 comments on commit 7edda76

Please sign in to comment.