To quote "Willy" (with amendments):
Beware the booleans!
Win32 defines different versions of booleans.
1) BOOL used by most Win32 API's, is an unsigned int a signed int (4 bytes)
2) BOOLEAN is a single byte, only used by a few win32 API's!!
3) and C/C++ has it's builtin 'bool' which is a single byte
...and to add what @tenfour pointed out:
4) the even more bizarre VARIANT_BOOL
typedef short VARIANT_BOOL;
#define VARIANT_TRUE ((VARIANT_BOOL)-1)
#define VARIANT_FALSE ((VARIANT_BOOL)0)
The signed or unsigned nature shouldn't matter for BOOL, as the only "false" pattern is 0. So try treating it as a 4 byte quantity...however you interface with a DWORD may be satisfactory, (I've not dealt with Windows 64-bit conventions.)