From d866f078185b0213fc46a454680466d97393d192 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 12 Mar 2019 09:19:17 +1100 Subject: [PATCH] Added pdh-PdhLookupPerfNameByIndex-processor patchset --- patches/patchinstall.sh | 19 +++++++ ...-Support-the-Processor-object-string.patch | 53 +++++++++++++++++++ .../definition | 1 + 3 files changed, 73 insertions(+) create mode 100644 patches/pdh-PdhLookupPerfNameByIndex-processor/0001-pdh-Support-the-Processor-object-string.patch create mode 100644 patches/pdh-PdhLookupPerfNameByIndex-processor/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 6bb78e90..3f63af7a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -251,6 +251,7 @@ patch_enable_all () enable_oleaut32_OleLoadPictureFile="$1" enable_opengl32_wglChoosePixelFormat="$1" enable_packager_DllMain="$1" + enable_pdh_PdhLookupPerfNameByIndex_processor="$1" enable_quartz_MediaSeeking_Positions="$1" enable_quartz_Silence_FIXMEs="$1" enable_qwave_QOSCreateHandle="$1" @@ -903,6 +904,9 @@ patch_enable () packager-DllMain) enable_packager_DllMain="$2" ;; + pdh-PdhLookupPerfNameByIndex-processor) + enable_pdh_PdhLookupPerfNameByIndex_processor="$2" + ;; quartz-MediaSeeking_Positions) enable_quartz_MediaSeeking_Positions="$2" ;; @@ -5312,6 +5316,21 @@ if test "$enable_packager_DllMain" -eq 1; then ) >> "$patchlist" fi +# Patchset pdh-PdhLookupPerfNameByIndex-processor +# | +# | This patchset fixes the following Wine bugs: +# | * [#33018] pdh: Support the 'Processor' object string. +# | +# | Modified files: +# | * dlls/pdh/pdh_main.c, dlls/pdh/tests/pdh.c +# | +if test "$enable_pdh_PdhLookupPerfNameByIndex_processor" -eq 1; then + patch_apply pdh-PdhLookupPerfNameByIndex-processor/0001-pdh-Support-the-Processor-object-string.patch + ( + printf '%s\n' '+ { "Erich Hoover", "pdh: Support the '\''Processor'\'' object string.", 1 },'; + ) >> "$patchlist" +fi + # Patchset quartz-MediaSeeking_Positions # | # | Modified files: diff --git a/patches/pdh-PdhLookupPerfNameByIndex-processor/0001-pdh-Support-the-Processor-object-string.patch b/patches/pdh-PdhLookupPerfNameByIndex-processor/0001-pdh-Support-the-Processor-object-string.patch new file mode 100644 index 00000000..6dbb15a6 --- /dev/null +++ b/patches/pdh-PdhLookupPerfNameByIndex-processor/0001-pdh-Support-the-Processor-object-string.patch @@ -0,0 +1,53 @@ +From 01716b5ded881d602bcc3260f946ba4c15432160 Mon Sep 17 00:00:00 2001 +From: Erich Hoover +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/tests/pdh.c | 7 +++++++ + 2 files changed, 10 insertions(+) + +diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c +index 7ef91f1..ef69e45 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 ) + 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 } + }; + +diff --git a/dlls/pdh/tests/pdh.c b/dlls/pdh/tests/pdh.c +index 0a17906..a9613e2 100644 +--- a/dlls/pdh/tests/pdh.c ++++ b/dlls/pdh/tests/pdh.c +@@ -674,6 +674,13 @@ static void test_PdhLookupPerfNameByIndexA( void ) + ok(size == sizeof("% Processor Time"), "PdhLookupPerfNameByIndexA failed %d\n", size); + + 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); + ret = PdhLookupPerfNameByIndexA( NULL, 674, NULL, &size ); + ok(ret == PDH_INVALID_ARGUMENT || + ret == PDH_MORE_DATA, /* win2k3 */ +-- +1.9.1 + diff --git a/patches/pdh-PdhLookupPerfNameByIndex-processor/definition b/patches/pdh-PdhLookupPerfNameByIndex-processor/definition new file mode 100644 index 00000000..c9ddfe2a --- /dev/null +++ b/patches/pdh-PdhLookupPerfNameByIndex-processor/definition @@ -0,0 +1 @@ +Fixes: [33018] pdh: Support the 'Processor' object string.