I tried switching err to PInteger. But the return result is still -1 (on Linux).
As PInteger, debugger reports :
err = $000000000155F3F0
(err)^ = Attempt to dereference a generic pointer.
As Pointer, debugger reports :
err = $00000000015D8CD0
(err)^ = Attempt to dereference a generic pointer.
This is also stated in original post for info.
Either way, the point here is the code works on Windows. But it doesn't on Linux, or rather, it runs on Linux but doesn't return values on Linux that it should, and does, on Windows. The err var is not the problem, I don't believe. The problem is that var p and l are having values put in them that are invalid...on Linux. But perfectly fine, on Windows.
Using the libraries error reporting code I was able to generate this message data :
libuna_unicode_character_copy_to_utf8: UTF-8 string too small.
libuna_utf8_string_with_index_copy_from_utf8_stream: unable to copy Unicode character to UTF-8.
libfvalue_string_copy_to_utf8_string_with_index: unable to copy UTF-8 stream to UTF-8 string.
libfvalue_value_copy_to_utf8_string_with_index: unable to copy instance to UTF-8 string.
libfvalue_value_copy_to_utf8_string: unable to copy value: 0 to UTF-8 string.
libewf_handle_get_utf8_hash_value: unable to copy hash value to UTF-8 string.
which, given that p is complaining about being unable to be dereferenced, and l is a massive longword value instead of just 1, makes a degree of sense. I still don't see where the problem is, though, IRO Linux itself.