pdh: Update PdhAddEnglishCounterA/W() to match Windows 10 >= 2004.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Francois Gouget 2021-06-22 12:03:21 +02:00 committed by Alexandre Julliard
parent 6799667b71
commit 071292bedd
2 changed files with 8 additions and 4 deletions

View File

@ -284,7 +284,8 @@ PDH_STATUS WINAPI PdhAddEnglishCounterA( PDH_HQUERY query, LPCSTR path,
{
TRACE("%p %s %lx %p\n", query, debugstr_a(path), userdata, counter);
if (!query) return PDH_INVALID_ARGUMENT;
if (!counter) return PDH_INVALID_ARGUMENT;
if (!query) return PDH_INVALID_HANDLE;
return PdhAddCounterA( query, path, userdata, counter );
}
@ -296,7 +297,8 @@ PDH_STATUS WINAPI PdhAddEnglishCounterW( PDH_HQUERY query, LPCWSTR path,
{
TRACE("%p %s %lx %p\n", query, debugstr_w(path), userdata, counter);
if (!query) return PDH_INVALID_ARGUMENT;
if (!counter) return PDH_INVALID_ARGUMENT;
if (!query) return PDH_INVALID_HANDLE;
return PdhAddCounterW( query, path, userdata, counter );
}

View File

@ -240,7 +240,8 @@ static void test_PdhAddEnglishCounterA( void )
ok(ret == PDH_INVALID_ARGUMENT, "PdhAddEnglishCounterA failed 0x%08x\n", ret);
ret = pPdhAddEnglishCounterA( NULL, "\\System\\System Up Time", 0, &counter );
ok(ret == PDH_INVALID_ARGUMENT, "PdhAddEnglishCounterA failed 0x%08x\n", ret);
ok(ret == PDH_INVALID_HANDLE || broken(ret == PDH_INVALID_ARGUMENT) /* win10 <= 1909 */,
"PdhAddEnglishCounterA failed 0x%08x\n", ret);
ret = pPdhAddEnglishCounterA( query, NULL, 0, &counter );
ok(ret == PDH_INVALID_ARGUMENT, "PdhAddEnglishCounterA failed 0x%08x\n", ret);
@ -281,7 +282,8 @@ static void test_PdhAddEnglishCounterW( void )
ok(ret == PDH_INVALID_ARGUMENT, "PdhAddEnglishCounterW failed 0x%08x\n", ret);
ret = pPdhAddEnglishCounterW( NULL, system_uptime, 0, &counter );
ok(ret == PDH_INVALID_ARGUMENT, "PdhAddEnglishCounterW failed 0x%08x\n", ret);
ok(ret == PDH_INVALID_HANDLE || broken(ret == PDH_INVALID_ARGUMENT) /* win10 <= 1909 */,
"PdhAddEnglishCounterW failed 0x%08x\n", ret);
ret = pPdhAddEnglishCounterW( query, NULL, 0, &counter );
ok(ret == PDH_INVALID_ARGUMENT, "PdhAddEnglishCounterW failed 0x%08x\n", ret);