More accurately, it will cause the function to return ERROR_MORE_DATA since I told it my buffer was 1 byte long.
However, it's also possible to query the size of the data using
Code:
RegQueryValueEx(HKEY_LOCAL_MACHINE, "", NULL, &retType, NULL, &dwSize);
Then you can allocate a buffer and fetch the data:
Code:
char* pData;
DWORD dwDataSize = 0;
DWORD retType;
RegQueryValueEx(HKEY_LOCAL_MACHINE, "", NULL, &retType, NULL, &dwSize);
pData = malloc(dwSize);
RegQueryValueEx(HKEY_LOCAL_MACHINE, "", NULL, &retType, pData, &dwSize);
/* Do something */
free(pData)