long in C++ is not the same as long in Java, especially on Windows.

Do this instead:

    u64 startPos = ((u64)Memory::Read_U32(parameters) << 32) | Memory::Read_U32(parameters + 4);

and so on.