Commit 7af5a9d8 authored by Rolf Kalbermatter's avatar Rolf Kalbermatter Committed by Alexandre Julliard

advapi32: Implement GetServiceDisplayNameA.

parent 46fed9f1
......@@ -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;
}
/******************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment