advapi32: Implement GetServiceDisplayNameA.

This commit is contained in:
Rolf Kalbermatter 2007-05-07 21:54:56 +02:00 committed by Alexandre Julliard
parent 46fed9f1ef
commit 7af5a9d87f
1 changed files with 29 additions and 2 deletions

View File

@ -2035,9 +2035,36 @@ BOOL WINAPI QueryServiceLockStatusW( SC_HANDLE hSCManager,
BOOL WINAPI GetServiceDisplayNameA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
LPSTR lpDisplayName, LPDWORD lpcchBuffer)
{
FIXME("%p %s %p %p\n", hSCManager,
struct sc_manager *hscm;
DWORD type, size;
LONG ret;
TRACE("%p %s %p %p\n", hSCManager,
debugstr_a(lpServiceName), lpDisplayName, lpcchBuffer);
return FALSE;
hscm = sc_handle_get_handle_data(hSCManager, SC_HTYPE_MANAGER);
if (!hscm)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
size = *lpcchBuffer;
ret = RegGetValueA(hscm->hkey, lpServiceName, "DisplayName", RRF_RT_REG_SZ, &type, lpDisplayName, &size);
if (ret)
{
if (lpDisplayName && *lpcchBuffer) *lpDisplayName = 0;
if (ret == ERROR_MORE_DATA)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
*lpcchBuffer = size - 1;
}
else
SetLastError(ret);
return FALSE;
}
return TRUE;
}
/******************************************************************************