Commit 52f03de9 authored by Jeff Latimer's avatar Jeff Latimer Committed by Alexandre Julliard

pdh/tests: Add test for size > 0 but no buffer.

parent 84acc6f9
......@@ -646,6 +646,10 @@ static void test_PdhLookupPerfNameByIndexA( void )
ok(size == sizeof("% Processor Time"), "PdhLookupPerfNameByIndexA failed %d\n", size);
size = sizeof(buffer);
ret = PdhLookupPerfNameByIndexA( NULL, 674, NULL, &size );
ok(ret == PDH_INVALID_ARGUMENT, "PdhLookupPerfNameByIndexA failed 0x%08x\n", ret);
size = sizeof(buffer);
ret = PdhLookupPerfNameByIndexA( NULL, 674, buffer, &size );
ok(ret == ERROR_SUCCESS, "PdhLookupPerfNameByIndexA failed 0x%08x\n", ret);
ok(!lstrcmpA( buffer, "System Up Time" ),
......@@ -672,6 +676,10 @@ static void test_PdhLookupPerfNameByIndexW( void )
ok(size == sizeof(processor_time) / sizeof(WCHAR), "PdhLookupPerfNameByIndexW failed %d\n", size);
size = sizeof(buffer) / sizeof(WCHAR);
ret = PdhLookupPerfNameByIndexW( NULL, 674, NULL, &size );
ok(ret == PDH_INVALID_ARGUMENT, "PdhLookupPerfNameByIndexW failed 0x%08x\n", ret);
size = sizeof(buffer) / sizeof(WCHAR);
ret = PdhLookupPerfNameByIndexW( NULL, 674, buffer, &size );
ok(ret == ERROR_SUCCESS, "PdhLookupPerfNameByIndexW failed 0x%08x\n", ret);
ok(size == sizeof(uptime) / sizeof(WCHAR), "PdhLookupPerfNameByIndexW failed %d\n", size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment