diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 792a9557..1d3d4f1e 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -348,6 +348,7 @@ patch_enable_all () enable_version_VerQueryValue="$1" enable_vulkan_Vulkan_Implementation="$1" enable_wbemdisp_ISWbemSecurity="$1" + enable_wbemdisp_Printer="$1" enable_widl_SLTG_Typelib_Support="$1" enable_windowscodecs_32bppGrayFloat="$1" enable_windowscodecs_IMILBitmapSource="$1" @@ -1223,6 +1224,9 @@ patch_enable () wbemdisp-ISWbemSecurity) enable_wbemdisp_ISWbemSecurity="$2" ;; + wbemdisp-Printer) + enable_wbemdisp_Printer="$2" + ;; widl-SLTG_Typelib_Support) enable_widl_SLTG_Typelib_Support="$2" ;; @@ -7094,6 +7098,21 @@ if test "$enable_wbemdisp_ISWbemSecurity" -eq 1; then ) >> "$patchlist" fi +# Patchset wbemdisp-Printer +# | +# | This patchset fixes the following Wine bugs: +# | * [#40539] Provide DeviceID, Location and PortName for printers +# | +# | Modified files: +# | * dlls/wbemprox/builtin.c +# | +if test "$enable_wbemdisp_Printer" -eq 1; then + patch_apply wbemdisp-Printer/0001-wbemprox-Provide-DeviceID-Location-and-PortName-for-.patch + ( + echo '+ { "Michael Müller", "wbemprox: Provide DeviceID, Location and PortName for printers.", 1 },'; + ) >> "$patchlist" +fi + # Patchset windowscodecs-32bppGrayFloat # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wbemdisp-Printer/0001-wbemprox-Provide-DeviceID-Location-and-PortName-for-.patch b/patches/wbemdisp-Printer/0001-wbemprox-Provide-DeviceID-Location-and-PortName-for-.patch new file mode 100644 index 00000000..7c0f7cb1 --- /dev/null +++ b/patches/wbemdisp-Printer/0001-wbemprox-Provide-DeviceID-Location-and-PortName-for-.patch @@ -0,0 +1,80 @@ +From 0a1d25ac7af31d4e2f015cf815f8abcb4d6033e6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 27 May 2016 22:32:23 +0200 +Subject: wbemprox: Provide DeviceID, Location and PortName for printers. + +--- + dlls/wbemprox/builtin.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c +index 13f708f..8e730bd 100644 +--- a/dlls/wbemprox/builtin.c ++++ b/dlls/wbemprox/builtin.c +@@ -237,6 +237,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}; ++static const WCHAR prop_locationW[] = ++ {'L','o','c','a','t','i','o','n',0}; + 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[] = + {'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}; ++static const WCHAR prop_portnameW[] = ++ {'P','o','r','t','N','a','m','e',0}; + 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[] = + { prop_horizontalresolutionW, CIM_UINT32 }, + { prop_localW, CIM_BOOLEAN }, + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, +- { prop_networkW, CIM_BOOLEAN } ++ { prop_networkW, CIM_BOOLEAN }, ++ { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, ++ { prop_portnameW, CIM_STRING|COL_FLAG_DYNAMIC }, ++ { prop_locationW, CIM_STRING|COL_FLAG_DYNAMIC }, + }; + static const struct column col_process[] = + { +@@ -940,6 +947,9 @@ struct record_printer + int local; + const WCHAR *name; + int network; ++ const WCHAR *device_id; ++ const WCHAR *portname; ++ const WCHAR *location; + }; + struct record_process + { +@@ -2285,10 +2295,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 ) + { ++ static const WCHAR fmtW[] = {'P','r','i','n','t','e','r','%','d',0}; + struct record_printer *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + PRINTER_INFO_2W *info; + DWORD i, offset = 0, count = 0, size = 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 + rec->local = -1; + rec->name = heap_strdupW( info[i].pPrinterName ); + rec->network = 0; ++ sprintfW( id, fmtW, i ); ++ rec->device_id = heap_strdupW( id ); ++ rec->portname = heap_strdupW( info[i].pPortName ); ++ rec->location = heap_strdupW( info[i].pLocation ); + if (!match_row( table, i, cond, &status )) + { + free_row_values( table, i ); +-- +2.8.0 + diff --git a/patches/wbemdisp-Printer/definition b/patches/wbemdisp-Printer/definition new file mode 100644 index 00000000..1692bf90 --- /dev/null +++ b/patches/wbemdisp-Printer/definition @@ -0,0 +1 @@ +Fixes: [40539] Provide DeviceID, Location and PortName for printers