API Calls from LotusScript on 64bit server: 4-byte pointer issue

In the Domino Designer help database is the following note regarding calls to C-API functions:

“When an argument is passed by reference, the C function receives a 4-byte pointer to the value area.”

If I understand this correctly then API calls from LotusScript on a 64-bit Domino server will fail (crash) when an 8-byte pointer is expected?

For example the first argument in ODSReadMemory is a pointer passed by reference. Works perfectly on Domino 32-bit (when first argument is defined in LotusScript as a Long) but crashes on Domino 64-bit (when first argument is defined in LotusScript as a Double). It seems even though the Double data type is 8-bytes LotusScript will still only pass a 4-byte pointer to the API call.

I’d like to hear other developer’s thoughts, comments and possible workarounds. Thanks.

Alex

Subject: NSFItemDefExtGetEntry returning null ItemName Pointer

Hi Jennifer,

Thanks for forwarding my previous issue regarding ODSReadMemory crashing on 64-bit. I’ve now been able to get ODSReadMemory working successfully but now have an issue with NSFItemDefExtGetEntry. On 64-bit all values are being correctly returned in the API call from LotusScript however the ItemName pointer is coming back as zero - I’ve defined ItemName pointer in the LotusScript code as both a Long and a Double but get a null value for both. Same call using the same code on 32-bit works correctly.

Regards,

Alex

Subject: Forwarded to development

64 bit/kb

Subject: More details on making C calls from LS on 64 Bit OS

This link goes into details about how to properly make call outs to C function from LS on 64 a 64 bit OS-
Using LotusScript C-Callouts on non-32-bit Platforms
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/C-Callouts_on_non-32-bit_Platforms http://www-10.lotus.com/ldd/ddwiki.nsf/dx/C-Callouts_on_non-32-bit_Platforms

Prior to 8.5.3 Fix Pack 3 64-bit Domino, LotusScript did not properly align data in type structures for C API call outs. A fix for that issue (SPR# EFFEN8MJJCY) was introduced in 8.5.3 Fix Pack 3 64-bit, thus now 8 byte data types must be defined as Double in type structures (the same is true for C API arguments and return value). This resulted in some issues that are covered in this TN.

Title: C API call out results in server crash or returns corrupt data on 64-bit Domino 8.5.3 Fix Pack 3
Doc #: 1624936
URL: http://www.ibm.com/support/docview.wss?uid=swg21624936 http://www.ibm.com/support/docview.wss?uid=swg21624936