From cfde60c60d83595d4e68b63e6a294da867e59ac5 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Mon, 8 Nov 2004 21:23:34 +0000 Subject: [PATCH] 1. fixed GetProfilesDirectoryW(). the lpcchSize parameter takes the size of the buffer in characters, not bytes. 2. LoadUserProfileW() should pass the buffer size to GetProfilesDirectoryW() svn path=/trunk/; revision=11598 --- reactos/lib/userenv/profile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/lib/userenv/profile.c b/reactos/lib/userenv/profile.c index b81ec8b45cd..cd22f74a408 100644 --- a/reactos/lib/userenv/profile.c +++ b/reactos/lib/userenv/profile.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: profile.c,v 1.15 2004/10/05 13:39:42 ekohl Exp $ +/* $Id: profile.c,v 1.16 2004/11/08 21:23:34 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -604,9 +604,9 @@ GetProfilesDirectoryW (LPWSTR lpProfilesDir, dwLength = wcslen (szProfilesPath); if (lpProfilesDir != NULL) { - if (*lpcchSize < dwLength) + if (*lpcchSize < dwLength / sizeof(WCHAR)) { - *lpcchSize = dwLength; + *lpcchSize = dwLength / sizeof(WCHAR); SetLastError (ERROR_INSUFFICIENT_BUFFER); return FALSE; } @@ -789,7 +789,7 @@ LoadUserProfileW (HANDLE hToken, { WCHAR szUserHivePath[MAX_PATH]; UNICODE_STRING SidString; - DWORD dwLength; + DWORD dwLength = sizeof(szUserHivePath) / sizeof(szUserHivePath[0]); DPRINT ("LoadUserProfileW() called\n");