mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
advapi32: Fix return value to indicate error when NULL string is passed in.
This commit is contained in:
parent
3cfb018ea6
commit
ac5dca86ff
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user