kernelbase: Implement reading performance counter help strings.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
aaf66e57de
commit
aa99608dfa
|
@ -3849,7 +3849,7 @@ static void test_performance_keys(void)
|
|||
|
||||
size = 0xdeadbeef;
|
||||
ret = RegQueryValueExA(keys[i], "hElP", NULL, NULL, NULL, &size);
|
||||
todo_wine
|
||||
todo_wine_if (keys[i] != HKEY_PERFORMANCE_DATA)
|
||||
{
|
||||
ok(!ret, "got %u\n", ret);
|
||||
ok(size > 0 && size < 0xdeadbeef, "got size %u\n", size);
|
||||
|
@ -3859,15 +3859,19 @@ static void test_performance_keys(void)
|
|||
size = 0;
|
||||
ret = RegQueryValueExA(keys[i], "hElP", NULL, &type, buffer, &size);
|
||||
todo_wine_if (keys[i] != HKEY_PERFORMANCE_DATA)
|
||||
{
|
||||
ok(ret == ERROR_MORE_DATA, "got %u\n", ret);
|
||||
todo_wine ok(size > 0, "got size %u\n", size);
|
||||
ok(size > 0, "got size %u\n", size);
|
||||
}
|
||||
|
||||
type = 0xdeadbeef;
|
||||
size = buffer_size;
|
||||
ret = RegQueryValueExA(keys[i], "hElP", NULL, &type, buffer, &size);
|
||||
todo_wine_if (keys[i] != HKEY_PERFORMANCE_DATA)
|
||||
{
|
||||
ok(!ret, "got %u\n", ret);
|
||||
todo_wine ok(type == REG_MULTI_SZ, "got type %u\n", type);
|
||||
ok(type == REG_MULTI_SZ, "got type %u\n", type);
|
||||
}
|
||||
if (type == REG_MULTI_SZ)
|
||||
test_help_values(buffer, keys[i]);
|
||||
|
||||
|
@ -3875,14 +3879,16 @@ static void test_performance_keys(void)
|
|||
size = buffer_size;
|
||||
ret = RegQueryValueExA(keys[i], "hElPwine", NULL, &type, buffer, &size);
|
||||
todo_wine_if (keys[i] != HKEY_PERFORMANCE_DATA)
|
||||
{
|
||||
ok(!ret, "got %u\n", ret);
|
||||
todo_wine ok(type == REG_MULTI_SZ, "got type %u\n", type);
|
||||
ok(type == REG_MULTI_SZ, "got type %u\n", type);
|
||||
}
|
||||
if (type == REG_MULTI_SZ)
|
||||
test_help_values(buffer, keys[i]);
|
||||
|
||||
size = 0;
|
||||
ret = RegQueryValueExW(keys[i], L"hElP", NULL, NULL, NULL, &size);
|
||||
todo_wine
|
||||
todo_wine_if (keys[i] != HKEY_PERFORMANCE_DATA)
|
||||
{
|
||||
ok(!ret, "got %u\n", ret);
|
||||
ok(size > 0, "got size %u\n", size);
|
||||
|
@ -3892,7 +3898,7 @@ static void test_performance_keys(void)
|
|||
|
||||
type = 0xdeadbeef;
|
||||
ret = RegQueryValueExW(keys[i], L"hElP", NULL, &type, bufferW, &size);
|
||||
todo_wine
|
||||
todo_wine_if (keys[i] != HKEY_PERFORMANCE_DATA)
|
||||
{
|
||||
ok(!ret, "got %u\n", ret);
|
||||
ok(type == REG_MULTI_SZ, "got type %u\n", type);
|
||||
|
|
|
@ -1225,6 +1225,27 @@ static DWORD query_perf_names( DWORD *type, void *data, DWORD *ret_size, BOOL un
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
/* FIXME: we should read data from system32/perf009h.dat (or perf###h depending
|
||||
* on locale) instead */
|
||||
static DWORD query_perf_help( DWORD *type, void *data, DWORD *ret_size, BOOL unicode )
|
||||
{
|
||||
static const WCHAR names[] = L"1847\0End Marker\0";
|
||||
DWORD size = *ret_size;
|
||||
|
||||
if (type) *type = REG_MULTI_SZ;
|
||||
*ret_size = sizeof(names);
|
||||
if (!unicode) *ret_size /= sizeof(WCHAR);
|
||||
|
||||
if (!data) return ERROR_SUCCESS;
|
||||
if (size < *ret_size) return ERROR_MORE_DATA;
|
||||
|
||||
if (unicode)
|
||||
memcpy( data, names, sizeof(names) );
|
||||
else
|
||||
RtlUnicodeToMultiByteN( data, size, NULL, names, sizeof(names) );
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
struct perf_provider
|
||||
{
|
||||
HMODULE perflib;
|
||||
|
@ -1370,6 +1391,8 @@ static DWORD query_perf_data( const WCHAR *query, DWORD *type, void *data, DWORD
|
|||
|
||||
if (!wcsnicmp( query, L"counter", 7 ))
|
||||
return query_perf_names( type, data, ret_size, unicode );
|
||||
if (!wcsnicmp( query, L"help", 4 ))
|
||||
return query_perf_help( type, data, ret_size, unicode );
|
||||
|
||||
data_size = *ret_size;
|
||||
*ret_size = 0;
|
||||
|
|
Loading…
Reference in New Issue