Alexander Nicolaysen Sørnes alex@thehandofagony.com writes:
@@ -185,13 +199,16 @@ static DWORD getDataType(LPSTR *lpValue, DWORD* parse_type) *lpValue+=ptr->len; if (type == -1) { char* end;
char* buf = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(*lpValue)+1)*sizeof(WCHAR));
WideCharToMultiByte(CP_ACP, 0, *lpValue, -1, buf, (lstrlenW(*lpValue)+1)*sizeof(WCHAR), NULL, NULL); /* "hex(xx):" is special */
type = (int)strtoul( *lpValue , &end, 16 );
if (**lpValue=='\0' || *end!=')' || *(end+1)!=':') {
type = (int)strtoul( buf , &end, 16 );
if (*buf=='\0' || *end!=')' || *(end+1)!=':') { type=REG_NONE; } else {
*lpValue=end+2;
*lpValue += (end - buf)*sizeof(WCHAR) + 2;
The last line is not correct, besides we have strtoulW so you don't need any of that W->A conversion.