The function returns the following error codes:
0 ... everything OK -1 ... the Mask parameter was invalid (valid range 1..32)