advapi32: Fix return value to indicate error when NULL string is passed in.

This commit is contained in:
Rolf Kalbermatter 2007-05-18 21:02:20 +02:00 committed by Alexandre Julliard
parent 3cfb018ea6
commit ac5dca86ff
1 changed files with 6 additions and 0 deletions

View File

@ -2078,6 +2078,9 @@ BOOL WINAPI GetServiceDisplayNameA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
size = *lpcchBuffer;
ret = RegGetValueA(hscm->hkey, lpServiceName, "DisplayName", RRF_RT_REG_SZ, &type, lpDisplayName, &size);
if (!ret && !lpDisplayName && size)
ret = ERROR_MORE_DATA;
if (ret)
{
if (lpDisplayName && *lpcchBuffer) *lpDisplayName = 0;
@ -2116,6 +2119,9 @@ BOOL WINAPI GetServiceDisplayNameW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
size = *lpcchBuffer * sizeof(WCHAR);
ret = RegGetValueW(hscm->hkey, lpServiceName, szDisplayName, RRF_RT_REG_SZ, &type, lpDisplayName, &size);
if (!ret && !lpDisplayName && size)
ret = ERROR_MORE_DATA;
if (ret)
{
if (lpDisplayName && *lpcchBuffer) *lpDisplayName = 0;