Re: Difference between CRegKey::QueryStringValue and RegQueryValueEx
- From: David Lowndes <davidl@xxxxxxxxxxxxxxx>
- Date: Mon, 18 Apr 2005 09:48:40 +0100
>When you run this code (on VC++ 7.1 Standard, with _LIBS_USER_FULL_VER
>defined as "7.10.3077" in atlbuild.h) QueryStringValue will return
>ERROR_INVALID_DATA and RegQueryValueEx will return 0 (with cbZeroSize =
>0). Is there some fix or service pack for this bug, and is it removed
>from .NET 2005?
It appears to be fixed for VS2005 - in B1 the offending code in
CRegKey::QueryStringValue has been changed to:
if (pszValue != NULL)
{
if(nBytes!=0)
{
if ((nBytes % sizeof(TCHAR) != 0) || (pszValue[nBytes /
sizeof(TCHAR) -1] != 0))
{
return ERROR_INVALID_DATA;
}
}
else
{
pszValue[0]=_T('\0');
}
}
*pnChars = nBytes/sizeof(TCHAR);
return ERROR_SUCCESS;
Dave
.
- References:
- Difference between CRegKey::QueryStringValue and RegQueryValueEx
- From: Mihajlo Cvetanovic
- Difference between CRegKey::QueryStringValue and RegQueryValueEx
- Prev by Date: RE: debuging memory leak
- Next by Date: Re: debuging memory leak
- Previous by thread: Re: Difference between CRegKey::QueryStringValue and RegQueryValueEx
- Next by thread: Disableing items in CLIstCtrl
- Index(es):
Relevant Pages
|