- GetProfilesDirectoryA: In case of success, return the length of the profiles directory.
- GetProfilesDirectoryW: Set ERROR_INSUFFICIENT_BUFFER, if lpProfilesDir is NULL.
svn path=/trunk/; revision=69837
lpcchSize);
if (bResult)
{
- WideCharToMultiByte(CP_ACP,
- 0,
- lpBuffer,
- -1,
- lpProfileDir,
- *lpcchSize,
- NULL,
- NULL);
+ bResult = WideCharToMultiByte(CP_ACP,
+ 0,
+ lpBuffer,
+ -1,
+ lpProfileDir,
+ *lpcchSize,
+ NULL,
+ NULL);
}
GlobalFree(lpBuffer);
DWORD dwLength;
HKEY hKey;
LONG Error;
+ BOOL bRet = FALSE;
if (!lpcchSize)
{
{
if (*lpcchSize < dwLength)
{
- *lpcchSize = dwLength;
SetLastError(ERROR_INSUFFICIENT_BUFFER);
- return FALSE;
}
-
- wcscpy(lpProfilesDir, szProfilesPath);
+ else
+ {
+ wcscpy(lpProfilesDir, szProfilesPath);
+ bRet = TRUE;
+ }
+ }
+ else
+ {
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
}
*lpcchSize = dwLength;
- return TRUE;
+ return bRet;
}