There is no 'hidden' limitation. Actually the limitation is documented in MSDN (http://msdn.microsoft.com/en-us/library/windows/desktop/ms724348(v=vs.85).aspx): ...nSize [in]
The size of the buffer pointed to by the lpReturnedString parameter, in characters. The maximum profile section size is 32,767 characters...

Hence, the above function is perfectly well and nothing is "hidden". :-)