Rename the invalid default parameter and make registry string reads
more robust.
Validate the returned value type and byte count after querying the
value data, reject malformed UTF-16 sizes, and explicitly terminate
the string based on the number of bytes actually returned.
Sanity check the parsed mode values