--- Neil Skrypuch <ns03ja(a)brocku.ca> wrote:
On Monday, July 31, 2006 06:37, Damjan Jovanovic wrote:
+ WCHAR guidStringWithBraces[MAX_GUID_STRING_LEN];
You need MAX_GUID_STRING_LEN + 1 to store the null too, if I'm not mistaken.
0 1 2 3 0123456789012345678901234567890123456789 {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\0 MAX_GUID_STRING_LEN is 39, so it includes space for the terminating NULL.
+ CopyMemory(&guidStringWithBraces[1], lpGuidString, + (MAX_GUID_STRING_LEN - 3) * sizeof(WCHAR));
Why MAX_GUID_STRING_LEN - 3? Wouldn't that miss the last 3 characters?
No, because without braces and the terminating NULL it is MAX_GUID_STRING_LEN - 3.
- Neil
Thanks anyway Damjan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com