Rebase against 4919b9b99fe20cfb8599b7b827811fdd7937ea9d.

This commit is contained in:
Alistair Leslie-Hughes 2020-11-06 11:12:16 +11:00
parent 4130b2a71c
commit 9d2a93164f
3 changed files with 16 additions and 25 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "b793799d3d5facb765d97041669da4bc159b860b"
echo "4919b9b99fe20cfb8599b7b827811fdd7937ea9d"
}
# Show version information

View File

@ -1,53 +1,44 @@
From 01716b5ded881d602bcc3260f946ba4c15432160 Mon Sep 17 00:00:00 2001
From 7d05b746a1ed3528230dd438cf29f41d332c97ae Mon Sep 17 00:00:00 2001
From: Erich Hoover <ehoover@mines.edu>
Date: Mon, 18 Feb 2013 16:02:27 -0700
Subject: [PATCH] pdh: Support the 'Processor' object string.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33018
---
dlls/pdh/pdh_main.c | 3 +++
dlls/pdh/pdh_main.c | 1 +
dlls/pdh/tests/pdh.c | 7 +++++++
2 files changed, 10 insertions(+)
2 files changed, 8 insertions(+)
diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c
index 7ef91f1..ef69e45 100644
index d3bf6ab8706..fbe5ae1cdd3 100644
--- a/dlls/pdh/pdh_main.c
+++ b/dlls/pdh/pdh_main.c
@@ -178,6 +178,8 @@ struct source
static const WCHAR path_processor_time[] =
{'\\','P','r','o','c','e','s','s','o','r','(','_','T','o','t','a','l',')',
'\\','%',' ','P','r','o','c','e','s','s','o','r',' ','T','i','m','e',0};
+static const WCHAR path_processor[] =
+ {'\\','P','r','o','c','e','s','s','o','r',0};
static const WCHAR path_uptime[] =
{'\\','S','y','s','t','e','m', '\\', 'S','y','s','t','e','m',' ','U','p',' ','T','i','m','e',0};
@@ -204,6 +206,7 @@ static void CALLBACK collect_uptime( struct counter *counter )
@@ -197,6 +197,7 @@ static void CALLBACK collect_uptime( struct counter *counter )
static const struct source counter_sources[] =
{
{ 6, path_processor_time, collect_processor_time, TYPE_PROCESSOR_TIME, -5, 10000000 },
+ { 238, path_processor, NULL, 0, 0, 0 },
{ 674, path_uptime, collect_uptime, TYPE_UPTIME, -3, 1000 }
{ 6, L"\\Processor(_Total)\\% Processor Time", collect_processor_time, TYPE_PROCESSOR_TIME, -5, 10000000 },
+ { 238, L"\\Processor", NULL, 0, 0, 0 },
{ 674, L"\\System\\System Up Time", collect_uptime, TYPE_UPTIME, -3, 1000 }
};
diff --git a/dlls/pdh/tests/pdh.c b/dlls/pdh/tests/pdh.c
index 0a17906..a9613e2 100644
index 71603f8c6ba..da0af83a006 100644
--- a/dlls/pdh/tests/pdh.c
+++ b/dlls/pdh/tests/pdh.c
@@ -674,6 +674,13 @@ static void test_PdhLookupPerfNameByIndexA( void )
@@ -665,6 +665,13 @@ static void test_PdhLookupPerfNameByIndexA( void )
"PdhLookupPerfNameByIndexA failed, got %s expected \'%% Processor Time\'\n", buffer);
ok(size == sizeof("% Processor Time"), "PdhLookupPerfNameByIndexA failed %d\n", size);
size = sizeof(buffer);
+ size = sizeof(buffer);
+ ret = PdhLookupPerfNameByIndexA( NULL, 238, buffer, &size );
+ ok(ret == ERROR_SUCCESS, "PdhLookupPerfNameByIndexA failed 0x%08x\n", ret);
+ ok(!lstrcmpA( buffer, "Processor" ),
+ "PdhLookupPerfNameByIndexA failed, got %s expected \'Processor\'\n", buffer);
+ ok(size == sizeof("Processor"), "PdhLookupPerfNameByIndexA failed %d\n", size);
+
+ size = sizeof(buffer);
size = sizeof(buffer);
ret = PdhLookupPerfNameByIndexA( NULL, 674, NULL, &size );
ok(ret == PDH_INVALID_ARGUMENT ||
ret == PDH_MORE_DATA, /* win2k3 */
--
1.9.1
2.28.0

View File

@ -1 +1 @@
b793799d3d5facb765d97041669da4bc159b860b
4919b9b99fe20cfb8599b7b827811fdd7937ea9d