First of all the Boolean type is said to have a default marshal type of a four-byte value.So the following code works: