Author: ekohl
Date: Sat Nov 7 19:47:24 2015
New Revision: 69837
URL:
http://svn.reactos.org/svn/reactos?rev=69837&view=rev
Log:
[USERENV]
- GetProfilesDirectoryA: In case of success, return the length of the profiles directory.
- GetProfilesDirectoryW: Set ERROR_INSUFFICIENT_BUFFER, if lpProfilesDir is NULL.
Modified:
trunk/reactos/dll/win32/userenv/profile.c
Modified: trunk/reactos/dll/win32/userenv/profile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/profile.…
==============================================================================
--- trunk/reactos/dll/win32/userenv/profile.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/profile.c [iso-8859-1] Sat Nov 7 19:47:24 2015
@@ -687,14 +687,14 @@
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);
@@ -713,6 +713,7 @@
DWORD dwLength;
HKEY hKey;
LONG Error;
+ BOOL bRet = FALSE;
if (!lpcchSize)
{
@@ -764,17 +765,22 @@
{
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;
}