Added patch to fix row count in fill_processor and fill_printer function.

This commit is contained in:
Sebastian Lackner 2017-01-12 05:34:14 +01:00
parent 8c909daf10
commit 7ad3349f66
5 changed files with 102 additions and 10 deletions

View File

@ -357,6 +357,7 @@ patch_enable_all ()
enable_vulkan_Vulkan_Implementation="$1"
enable_wbemdisp_ISWbemSecurity="$1"
enable_wbemdisp_Printer="$1"
enable_wbemprox_fill_processor="$1"
enable_widl_SLTG_Typelib_Support="$1"
enable_windowscodecs_32bppGrayFloat="$1"
enable_windowscodecs_GIF_Encoder="$1"
@ -1266,6 +1267,9 @@ patch_enable ()
wbemdisp-Printer)
enable_wbemdisp_Printer="$2"
;;
wbemprox-fill_processor)
enable_wbemprox_fill_processor="$2"
;;
widl-SLTG_Typelib_Support)
enable_widl_SLTG_Typelib_Support="$2"
;;
@ -2154,6 +2158,13 @@ if test "$enable_windowscodecs_Palette_Images" -eq 1; then
enable_windowscodecs_32bppGrayFloat=1
fi
if test "$enable_wbemdisp_Printer" -eq 1; then
if test "$enable_wbemprox_fill_processor" -gt 1; then
abort "Patchset wbemprox-fill_processor disabled, but wbemdisp-Printer depends on that."
fi
enable_wbemprox_fill_processor=1
fi
if test "$enable_uxtheme_GTK_Theming" -eq 1; then
if test "$enable_ntdll_DllRedirects" -gt 1; then
abort "Patchset ntdll-DllRedirects disabled, but uxtheme-GTK_Theming depends on that."
@ -7494,8 +7505,26 @@ if test "$enable_wbemdisp_ISWbemSecurity" -eq 1; then
) >> "$patchlist"
fi
# Patchset wbemprox-fill_processor
# |
# | This patchset fixes the following Wine bugs:
# | * [#40392] Fix row count in fill_processor and fill_printer function
# |
# | Modified files:
# | * dlls/wbemprox/builtin.c
# |
if test "$enable_wbemprox_fill_processor" -eq 1; then
patch_apply wbemprox-fill_processor/0001-wbemprox-Only-include-matching-rows-in-the-table-row.patch
(
echo '+ { "Hans Leidekker", "wbemprox: Only include matching rows in the table row count.", 1 },';
) >> "$patchlist"
fi
# Patchset wbemdisp-Printer
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * wbemprox-fill_processor
# |
# | This patchset fixes the following Wine bugs:
# | * [#40539] Provide DeviceID, Location and PortName for printers
# |

View File

@ -1,4 +1,4 @@
From 0a1d25ac7af31d4e2f015cf815f8abcb4d6033e6 Mon Sep 17 00:00:00 2001
From 777d2b61b1104cf2192f6da4c04e7a42d7637561 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 27 May 2016 22:32:23 +0200
Subject: wbemprox: Provide DeviceID, Location and PortName for printers.
@ -8,10 +8,10 @@ Subject: wbemprox: Provide DeviceID, Location and PortName for printers.
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 13f708f..8e730bd 100644
index 14e819e5373..c83e7db499a 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -237,6 +237,8 @@ static const WCHAR prop_localdatetimeW[] =
@@ -241,6 +241,8 @@ static const WCHAR prop_localdatetimeW[] =
{'L','o','c','a','l','D','a','t','e','T','i','m','e',0};
static const WCHAR prop_localeW[] =
{'L','o','c','a','l','e',0};
@ -20,7 +20,7 @@ index 13f708f..8e730bd 100644
static const WCHAR prop_lockpresentW[] =
{'L','o','c','k','P','r','e','s','e','n','t',0};
static const WCHAR prop_macaddressW[] =
@@ -279,6 +281,8 @@ static const WCHAR prop_pixelsperxlogicalinchW[] =
@@ -285,6 +287,8 @@ static const WCHAR prop_pixelsperxlogicalinchW[] =
{'P','i','x','e','l','s','P','e','r','X','L','o','g','i','c','a','l','I','n','c','h',0};
static const WCHAR prop_pnpdeviceidW[] =
{'P','N','P','D','e','v','i','c','e','I','D',0};
@ -29,7 +29,7 @@ index 13f708f..8e730bd 100644
static const WCHAR prop_pprocessidW[] =
{'P','a','r','e','n','t','P','r','o','c','e','s','s','I','D',0};
static const WCHAR prop_primaryW[] =
@@ -543,7 +547,10 @@ static const struct column col_printer[] =
@@ -553,7 +557,10 @@ static const struct column col_printer[] =
{ prop_horizontalresolutionW, CIM_UINT32 },
{ prop_localW, CIM_BOOLEAN },
{ prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC },
@ -41,7 +41,7 @@ index 13f708f..8e730bd 100644
};
static const struct column col_process[] =
{
@@ -940,6 +947,9 @@ struct record_printer
@@ -938,6 +945,9 @@ struct record_printer
int local;
const WCHAR *name;
int network;
@ -51,7 +51,7 @@ index 13f708f..8e730bd 100644
};
struct record_process
{
@@ -2285,10 +2295,12 @@ static enum fill_status fill_physicalmemory( struct table *table, const struct e
@@ -2347,10 +2357,12 @@ static enum fill_status fill_physicalmemory( struct table *table, const struct e
static enum fill_status fill_printer( struct table *table, const struct expr *cond )
{
@ -59,12 +59,12 @@ index 13f708f..8e730bd 100644
struct record_printer *rec;
enum fill_status status = FILL_STATUS_UNFILTERED;
PRINTER_INFO_2W *info;
DWORD i, offset = 0, count = 0, size = 0;
DWORD i, offset = 0, count = 0, size = 0, num_rows = 0;
+ WCHAR id[20];
EnumPrintersW( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &size, &count );
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FILL_STATUS_FAILED;
@@ -2314,6 +2326,10 @@ static enum fill_status fill_printer( struct table *table, const struct expr *co
@@ -2376,6 +2388,10 @@ static enum fill_status fill_printer( struct table *table, const struct expr *co
rec->local = -1;
rec->name = heap_strdupW( info[i].pPrinterName );
rec->network = 0;
@ -76,5 +76,5 @@ index 13f708f..8e730bd 100644
{
free_row_values( table, i );
--
2.8.0
2.11.0

View File

@ -1 +1,2 @@
Fixes: [40539] Provide DeviceID, Location and PortName for printers
Depends: wbemprox-fill_processor

View File

@ -0,0 +1,61 @@
From 476ce365e5c475be94a88ef48b11f4a4191a813a Mon Sep 17 00:00:00 2001
From: Hans Leidekker <hans@codeweavers.com>
Date: Thu, 12 Jan 2017 05:29:07 +0100
Subject: wbemprox: Only include matching rows in the table row count.
---
dlls/wbemprox/builtin.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index cf9ae5c8437..14e819e5373 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -2350,7 +2350,7 @@ static enum fill_status fill_printer( struct table *table, const struct expr *co
struct record_printer *rec;
enum fill_status status = FILL_STATUS_UNFILTERED;
PRINTER_INFO_2W *info;
- DWORD i, offset = 0, count = 0, size = 0;
+ DWORD i, offset = 0, count = 0, size = 0, num_rows = 0;
EnumPrintersW( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &size, &count );
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FILL_STATUS_FAILED;
@@ -2382,9 +2382,10 @@ static enum fill_status fill_printer( struct table *table, const struct expr *co
continue;
}
offset += sizeof(*rec);
+ num_rows++;
}
- TRACE("created %u rows\n", count);
- table->num_rows = count;
+ TRACE("created %u rows\n", num_rows);
+ table->num_rows = num_rows;
heap_free( info );
return status;
@@ -2567,7 +2568,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr *
static const WCHAR fmtW[] = {'C','P','U','%','u',0};
WCHAR caption[100], device_id[14], processor_id[17], manufacturer[13], name[49] = {0}, version[50];
struct record_processor *rec;
- UINT i, offset = 0, num_cores, num_logical_processors, count = get_processor_count();
+ UINT i, offset = 0, num_rows = 0, num_cores, num_logical_processors, count = get_processor_count();
enum fill_status status = FILL_STATUS_UNFILTERED;
if (!resize_table( table, count, sizeof(*rec) )) return FILL_STATUS_FAILED;
@@ -2608,10 +2609,11 @@ static enum fill_status fill_processor( struct table *table, const struct expr *
continue;
}
offset += sizeof(*rec);
+ num_rows++;
}
- TRACE("created %u rows\n", count);
- table->num_rows = count;
+ TRACE("created %u rows\n", num_rows);
+ table->num_rows = num_rows;
return status;
}
--
2.11.0

View File

@ -0,0 +1 @@
Fixes: [40392] Fix row count in fill_processor and fill_printer function