I'm not sure what this is:

Code:
BYTE   defaultVal[MAX_PATH]; 
...
* (BOOL *) &defaultVal = 0;
If BOOL is an int, you're setting the first 4 values of the array to zero. Can you explain why?

Initializing the array can be done like this:
Code:
BYTE   defaultVal[MAX_PATH] = {0};