advapi32: Read the configured object list for the performance provider.

FIXME: it's not currently used, but the queries should be matched
against the configured object lists, and the providers should be
loaded and called only in case of a match.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-07-11 12:16:22 +08:00 committed by Alexandre Julliard
parent 8be6b299bc
commit 6500f882da
1 changed files with 12 additions and 0 deletions

View File

@ -1486,6 +1486,7 @@ struct perf_provider
{
HMODULE perflib;
WCHAR linkage[MAX_PATH];
WCHAR objects[MAX_PATH];
PM_OPEN_PROC *pOpen;
PM_CLOSE_PROC *pClose;
PM_COLLECT_PROC *pCollect;
@ -1509,6 +1510,7 @@ static void *get_provider_entry(HKEY perf, HMODULE perflib, const char *name)
static BOOL load_provider(HKEY root, const WCHAR *name, struct perf_provider *provider)
{
static const WCHAR object_listW[] = { 'O','b','j','e','c','t',' ','L','i','s','t',0 };
static const WCHAR performanceW[] = { 'P','e','r','f','o','r','m','a','n','c','e',0 };
static const WCHAR libraryW[] = { 'L','i','b','r','a','r','y',0 };
static const WCHAR linkageW[] = { 'L','i','n','k','a','g','e',0 };
@ -1541,6 +1543,16 @@ static BOOL load_provider(HKEY root, const WCHAR *name, struct perf_provider *pr
if (err != ERROR_SUCCESS)
return FALSE;
provider->objects[0] = 0;
len = sizeof(buf) - sizeof(WCHAR);
err = RegQueryValueExW(perf, object_listW, NULL, &type, (BYTE *)buf, &len);
if (err == ERROR_SUCCESS && (type == REG_SZ || type == REG_MULTI_SZ))
{
memcpy(provider->objects, buf, len);
provider->objects[len / sizeof(WCHAR)] = 0;
TRACE("Object List: %s\n", debugstr_w(provider->objects));
}
len = sizeof(buf) - sizeof(WCHAR);
err = RegQueryValueExW(perf, libraryW, NULL, &type, (BYTE *)buf, &len);
if (err != ERROR_SUCCESS || !(type == REG_SZ || type == REG_EXPAND_SZ))