Keywords: ^VAL, return value
Topics: 64bit, 32bit
Consider the following toy program:
kernel32Handle = %dll_open( "Kernel32" )
processHeap = GetProcessHeap(kernel32Handle)
function GetProcessHeap ,^val
freturn %dll_call(kernel32Handle, DLL_TYPE_WINAPI, "GetProcessHeap")
This particular function works in both 64bit and 32bit Synergy. However in 32bit Synergy it is wasteful that processHeap is defined as an i8.
^VAL functions (https://www.synergex.com/docs/versions/v111/index.htm#lrm/lrmChap7Writingsubroutinesandfunctions.htm#%5EVAL%20functions
) are defined as returning "...an integer value that is the natural integer size of the machine. That is, for a 32-bit machine, it returns an i4
; for a 64-bit machine, it returns an i8
We are looking for something similar to D_ADDR for ^VAL functions to allow us to write bit-agnostic code.