23 Apr
2007
23 Apr
'07
12:35 p.m.
"Rolf Kalbermatter" <r.kalbermatter(a)hccnet.nl> writes:
+ size = *lpcchBuffer * sizeof(WCHAR); + ret = RegGetValueW(hscm->hkey, lpServiceName, szDisplayName, RRF_RT_REG_SZ, &type, NULL, &size); + switch (ret) + { + case ERROR_SUCCESS: + ret = RegGetValueW(hscm->hkey, lpServiceName, szDisplayName, RRF_RT_REG_SZ, &type, lpDisplayName, &size); + *lpcchBuffer = (size / sizeof(WCHAR)) - 1; + break;
It would be better to put the data into the buffer right away, so that you don't need two registry queries in the common case of the buffer being large enough. -- Alexandre Julliard julliard(a)winehq.org