The return value of the lseek function is off_t, which is 32 bit on 32 bit builds (as currently all RevPis are running under)
and 64 bit ONLY on 64 bit builds. Hence, the long return value in the Interop.cs file is wrong- especially in combination with the PiControl code Read(...), where the check of lseek is just < 0 (better would be a check if it is equal to -1 which is the return value when lseek fails). So after each start of the program it depends on the memory location where the variables are being located and it is pure luck if the 32 bit above the real value are set to 0 or not. If not, each call to Read returns null.
The return value of the lseek function is off_t, which is 32 bit on 32 bit builds (as currently all RevPis are running under) and 64 bit ONLY on 64 bit builds. Hence, the long return value in the Interop.cs file is wrong- especially in combination with the PiControl code Read(...), where the check of lseek is just < 0 (better would be a check if it is equal to -1 which is the return value when lseek fails). So after each start of the program it depends on the memory location where the variables are being located and it is pure luck if the 32 bit above the real value are set to 0 or not. If not, each call to Read returns null.