The bit pattern of -32767 as a 2-byte SHORT is 0x8001, i.e., the most significant and least significant bits are set. You have, of course, read the documentation for the function, so you know what that means. Perhaps you even see the problem as mentioned in the "remarks" section, which suggests to me that it would be better to use the value -32768 (only the most significant bit set).