Description
These two functions are documented to always null terminate the string types (RegQueryValueEx is not guaranteed to null terminate). If the string in not terminated and there is no more room in the buffer, it should return ERROR_MORE_DATA.