mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
[USERENV]
- 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
This commit is contained in:
parent
d7bf1738d4
commit
21f40234d7
1 changed files with 19 additions and 13 deletions
|
@ -687,7 +687,7 @@ GetProfilesDirectoryA(LPSTR lpProfileDir,
|
||||||
lpcchSize);
|
lpcchSize);
|
||||||
if (bResult)
|
if (bResult)
|
||||||
{
|
{
|
||||||
WideCharToMultiByte(CP_ACP,
|
bResult = WideCharToMultiByte(CP_ACP,
|
||||||
0,
|
0,
|
||||||
lpBuffer,
|
lpBuffer,
|
||||||
-1,
|
-1,
|
||||||
|
@ -713,6 +713,7 @@ GetProfilesDirectoryW(LPWSTR lpProfilesDir,
|
||||||
DWORD dwLength;
|
DWORD dwLength;
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
LONG Error;
|
LONG Error;
|
||||||
|
BOOL bRet = FALSE;
|
||||||
|
|
||||||
if (!lpcchSize)
|
if (!lpcchSize)
|
||||||
{
|
{
|
||||||
|
@ -764,17 +765,22 @@ GetProfilesDirectoryW(LPWSTR lpProfilesDir,
|
||||||
{
|
{
|
||||||
if (*lpcchSize < dwLength)
|
if (*lpcchSize < dwLength)
|
||||||
{
|
{
|
||||||
*lpcchSize = dwLength;
|
|
||||||
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
wcscpy(lpProfilesDir, szProfilesPath);
|
wcscpy(lpProfilesDir, szProfilesPath);
|
||||||
|
bRet = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||||
}
|
}
|
||||||
|
|
||||||
*lpcchSize = dwLength;
|
*lpcchSize = dwLength;
|
||||||
|
|
||||||
return TRUE;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue