On Fri, Feb 14, 2014 at 5:28 AM, Alistair Leslie-Hughes leslie_alistair@hotmail.com wrote:
Hi Bruno,
On 14/02/2014 10:18 AM, Bruno Jesus wrote:
On Thu, Feb 13, 2014 at 1:23 AM, Alistair Leslie-Hughes leslie_alistair@hotmail.com wrote: You are only reading the key value in the first loop to trace it, maybe you could simplify this loop with a single RegGetValueW call and no memory allocation just to get the size required and in the next loop where you really copy the data you could trace it.
Thanks for you feedback. I've re-factored the patch and it's alot cleaner than the first few iterations.
Its still needs to be a char cast since RegGetValueW returns the size in bytes which would make the offset incorrect.
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).
Best Regards Alistair Leslie-Hughes
Bruno