cleanup code for sdk subprojects
correct prototypes
use bool type where it is possible
correct mbcs <-> unicode conversion/read/write routines