GetServiceDisplayName function advapi32
Retrieves the display name of the specified service.
To learn more, see learn.microsoft.com/windows/win32/api/winsvc/nf-winsvc-getservicedisplaynamew.
Implementation
Win32Result<bool> GetServiceDisplayName(
SC_HANDLE hSCManager,
PCWSTR lpServiceName,
PWSTR? lpDisplayName,
Pointer<Uint32> lpcchBuffer,
) {
resolveGetLastError();
final result_ = _GetServiceDisplayName(
hSCManager,
lpServiceName,
lpDisplayName ?? nullptr,
lpcchBuffer,
);
return .new(value: result_ != FALSE, error: GetLastError());
}