[USERENV]

- GetAllUsersProfileDirectoryW: Fail if lpcchSize is NULL.
- GetDefaultUserProfileDirectoryW: Fail if lpcchSize is NULL.
- GetUserProfileDirectoryW: Fail if hToken is NULL.

svn path=/trunk/; revision=69841
This commit is contained in:
Eric Kohl 2015-11-07 21:06:07 +00:00
parent 1eff622a45
commit 3a42dbb92a

View file

@ -464,6 +464,12 @@ GetAllUsersProfileDirectoryW(LPWSTR lpProfileDir,
HKEY hKey;
LONG Error;
if (!lpcchSize)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
Error = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList",
0,
@ -586,6 +592,12 @@ GetDefaultUserProfileDirectoryW(LPWSTR lpProfileDir,
HKEY hKey;
LONG Error;
if (!lpcchSize)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
Error = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList",
0,
@ -839,9 +851,15 @@ GetUserProfileDirectoryW(HANDLE hToken,
HKEY hKey;
LONG Error;
if (!hToken)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (!lpcchSize)
{
SetLastError( ERROR_INVALID_PARAMETER );
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}