Hi Nikolay,
On 12/03/12 12:29, Nikolay Sivov wrote:
- /* skip '' after root name */
- if (name[len] == '\') len++;
It looks like if name[len] != '\', then name should be considered invalid.
- val = strlenW(name);
- while (name[--val] != '\' && val)
;
- keyname = SysAllocStringLen(&name[len], val-len);
This won't work if name has no backslashes.
- /* skip leading '' */
- val++;
- type = REG_NONE;
- datalen = 0;
- ret = RegGetValueW(root, keyname, &name[val], RRF_RT_ANY, &type, NULL, &datalen);
- if (ret == ERROR_SUCCESS)
- {
if (type == REG_SZ)
{
V_VT(value) = VT_BSTR;
V_BSTR(value) = SysAllocStringLen(NULL, datalen-1);
ret = RegGetValueW(root, keyname, &name[val], RRF_RT_ANY, &type, V_BSTR(value), &datalen);
}
else
FIXME("type %d not handled\n", type);
This should return an error.
Jacek
On 12/3/2012 15:42, Jacek Caban wrote:
Hi Nikolay,
On 12/03/12 12:29, Nikolay Sivov wrote:
- /* skip '' after root name */
- if (name[len] == '\') len++;
It looks like if name[len] != '\', then name should be considered invalid.
- val = strlenW(name);
- while (name[--val] != '\' && val)
;
- keyname = SysAllocStringLen(&name[len], val-len);
This won't work if name has no backslashes.
- /* skip leading '' */
- val++;
- type = REG_NONE;
- datalen = 0;
- ret = RegGetValueW(root, keyname, &name[val], RRF_RT_ANY, &type, NULL, &datalen);
- if (ret == ERROR_SUCCESS)
- {
if (type == REG_SZ)
{
V_VT(value) = VT_BSTR;
V_BSTR(value) = SysAllocStringLen(NULL, datalen-1);
ret = RegGetValueW(root, keyname, &name[val], RRF_RT_ANY, &type, V_BSTR(value), &datalen);
}
else
FIXME("type %d not handled\n", type);
This should return an error.
Thanks for comments. Next try I just sent should be better.
Jacek