Hi Bruno,
On 14/02/2014 8:30 PM, Bruno Jesus wrote:
On Fri, Feb 14, 2014 at 5:28 AM, Alistair Leslie-Hughes Not really, because when you add a size to a pointer it increments in the pointer size and not bytes. So WCHAR *ptr=0; ptr+=10; printf("%p\n", p); would print 0x14 (20 in decimal although we just added 10 to it).
The theory is correct. However RegGetValueW returns the size of the buffer we would need to allocate including the null terminator. In your example it would return 20 (9+1*sizeof(WCHAR)) and not 10.
Best Regards Alistair Leslie-Hughes