winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2020
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
947 discussions
Start a n
N
ew thread
Nikolay Sivov : dwrite: Silence HasVariations() fixme.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: f51d0487a7421ff8094349ed074d39b303f657fc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f51d0487a7421ff8094349ed…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 10 17:21:31 2020 +0300 dwrite: Silence HasVariations() fixme. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 2d7a97594f..d8d892c9ef 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -1545,7 +1545,10 @@ static HRESULT WINAPI dwritefontface5_GetFontAxisValues(IDWriteFontFace5 *iface, static BOOL WINAPI dwritefontface5_HasVariations(IDWriteFontFace5 *iface) { - FIXME("%p: stub\n", iface); + static int once; + + if (!once++) + FIXME("%p: stub\n", iface); return FALSE; }
1
0
0
0
Nikolay Sivov : dwrite: Implement GetVerticalGlyphVariants().
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: 03fe6c64bca9570407e769e659ec663e1247e06e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=03fe6c64bca9570407e769e6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 10 17:21:30 2020 +0300 dwrite: Implement GetVerticalGlyphVariants(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/dwrite_private.h | 2 ++ dlls/dwrite/font.c | 8 +++--- dlls/dwrite/opentype.c | 60 ++++++++++++++++++++++++++++++++++++++++++++ dlls/dwrite/tests/font.c | 43 +++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 3 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index a9fbb260e3..e53b4dba0b 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -642,6 +642,8 @@ extern void opentype_layout_apply_gpos_features(struct scriptshaping_context *co extern BOOL opentype_layout_check_feature(struct scriptshaping_context *context, unsigned int script_index, unsigned int language_index, struct shaping_feature *feature, unsigned int glyph_count, const UINT16 *glyphs, UINT8 *feature_applies) DECLSPEC_HIDDEN; +extern HRESULT opentype_get_vertical_glyph_variants(struct dwrite_fontface *fontface, unsigned int glyph_count, + const UINT16 *nominal_glyphs, UINT16 *glyphs) DECLSPEC_HIDDEN; extern HRESULT shape_get_glyphs(struct scriptshaping_context *context, const unsigned int *scripts) DECLSPEC_HIDDEN; extern HRESULT shape_get_positions(struct scriptshaping_context *context, const unsigned int *scripts) DECLSPEC_HIDDEN; diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index ab60d4368c..2d7a97594f 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -1166,11 +1166,13 @@ static HRESULT WINAPI dwritefontface1_GetRecommendedRenderingMode(IDWriteFontFac } static HRESULT WINAPI dwritefontface1_GetVerticalGlyphVariants(IDWriteFontFace5 *iface, UINT32 glyph_count, - const UINT16 *nominal_indices, UINT16 *vertical_indices) + const UINT16 *nominal_glyphs, UINT16 *glyphs) { - FIXME("%p, %u, %p, %p: stub\n", iface, glyph_count, nominal_indices, vertical_indices); + struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface); - return E_NOTIMPL; + TRACE("%p, %u, %p, %p.\n", iface, glyph_count, nominal_glyphs, glyphs); + + return opentype_get_vertical_glyph_variants(fontface, glyph_count, nominal_glyphs, glyphs); } static BOOL WINAPI dwritefontface1_HasVerticalGlyphVariants(IDWriteFontFace5 *iface) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index d8bfa3f7f6..1f0174ad72 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -6214,3 +6214,63 @@ BOOL opentype_layout_check_feature(struct scriptshaping_context *context, unsign return ret; } + +HRESULT opentype_get_vertical_glyph_variants(struct dwrite_fontface *fontface, unsigned int glyph_count, + const UINT16 *nominal_glyphs, UINT16 *glyphs) +{ + struct shaping_features features = { 0 }; + struct shaping_feature vert_feature = { 0 }; + struct scriptshaping_context context = { 0 }; + struct lookups lookups = { 0 }; + unsigned int i; + + memcpy(glyphs, nominal_glyphs, glyph_count * sizeof(*glyphs)); + + if (!(fontface->flags & FONTFACE_HAS_VERTICAL_VARIANTS)) + return S_OK; + + context.cache = fontface_get_shaping_cache(fontface); + context.u.subst.glyphs = glyphs; + context.u.subst.glyph_props = heap_calloc(glyph_count, sizeof(*context.u.subst.glyph_props)); + context.u.subst.max_glyph_count = glyph_count; + context.u.subst.capacity = glyph_count; + context.glyph_infos = heap_alloc_zero(sizeof(*context.glyph_infos) * glyph_count); + context.table = &context.cache->gsub; + + vert_feature.tag = DWRITE_MAKE_OPENTYPE_TAG('v','e','r','t'); + vert_feature.flags = FEATURE_GLOBAL | FEATURE_GLOBAL_SEARCH; + vert_feature.max_value = 1; + vert_feature.default_value = 1; + + features.features = &vert_feature; + features.count = features.capacity = 1; + + opentype_layout_collect_lookups(&context, ~0u, ~0u, &features, context.table, &lookups); + opentype_layout_set_glyph_masks(&context, &features); + + for (i = 0; i < lookups.count; ++i) + { + const struct lookup *lookup = &lookups.lookups[i]; + + if (lookup->type != GSUB_LOOKUP_SINGLE_SUBST) + continue; + + context.cur = 0; + while (context.cur < context.glyph_count) + { + BOOL ret = FALSE; + + if (lookup_is_glyph_match(&context, context.cur, lookup->flags)) + ret = opentype_layout_apply_gsub_lookup(&context, lookup); + + if (!ret) + context.cur++; + } + } + + heap_free(context.u.subst.glyph_props); + heap_free(context.glyph_infos); + heap_free(lookups.lookups); + + return S_OK; +} diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 7c48a57eab..f8abbf9e4b 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -9736,6 +9736,48 @@ static void test_IsColorFont(void) ok(refcount == 0, "Factory not released, refcount %u.\n", refcount); } +static void test_GetVerticalGlyphVariants(void) +{ + UINT16 glyphs[1], glyph_variants[1]; + IDWriteFontFace1 *fontface1; + IDWriteFontFace *fontface; + IDWriteFactory *factory; + unsigned int ch; + ULONG refcount; + HRESULT hr; + BOOL ret; + + factory = create_factory(); + + fontface = create_fontface(factory); + hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1); + IDWriteFontFace_Release(fontface); + if (FAILED(hr)) + { + win_skip("GetVerticalGlyphVariants() is not supported.\n"); + IDWriteFactory_Release(factory); + return; + } + + ch = 'A'; + *glyphs = 0; + hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &ch, 1, glyphs); + ok(hr == S_OK, "Failed to get glyph, hr %#x.\n", hr); + ok(!!*glyphs, "Unexpected glyph %u.\n", glyphs[0]); + + memset(glyph_variants, 0, sizeof(glyph_variants)); + hr = IDWriteFontFace1_GetVerticalGlyphVariants(fontface1, 1, glyphs, glyph_variants); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(glyphs[0] == glyph_variants[0], "Unexpected glyph.\n"); + + ret = IDWriteFontFace1_HasVerticalGlyphVariants(fontface1); + ok(!ret, "Unexpected flag.\n"); + + IDWriteFontFace1_Release(fontface1); + refcount = IDWriteFactory_Release(factory); + ok(!refcount, "Factory not released, refcount %u.\n", refcount); +} + START_TEST(font) { IDWriteFactory *factory; @@ -9805,6 +9847,7 @@ START_TEST(font) test_fontsetbuilder(); test_font_resource(); test_IsColorFont(); + test_GetVerticalGlyphVariants(); IDWriteFactory_Release(factory); }
1
0
0
0
Nikolay Sivov : dwrite: Return ranges for selected cmap.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: f48ecfc83e574993bebbbfffd394170a66523e2b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f48ecfc83e574993bebbbfff…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 10 17:21:29 2020 +0300 dwrite: Return ranges for selected cmap. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/dwrite_private.h | 7 +- dlls/dwrite/font.c | 18 +---- dlls/dwrite/opentype.c | 188 +++++++++++++++++-------------------------- 3 files changed, 81 insertions(+), 132 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f48ecfc83e574993bebb…
1
0
0
0
Dmitry Timoshkov : prntvpt: Add some tests for PTOpenProvider and PTOpenProviderEx.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: 87ca6a068a8af0e4ed1592fbc819ac208d25ba61 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=87ca6a068a8af0e4ed1592fb…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Jun 10 13:31:52 2020 +0800 prntvpt: Add some tests for PTOpenProvider and PTOpenProviderEx. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 + configure.ac | 1 + dlls/prntvpt/tests/Makefile.in | 5 ++ dlls/prntvpt/tests/prntvpt.c | 148 +++++++++++++++++++++++++++++++++++++++++ include/prntvpt.h | 1 + 5 files changed, 156 insertions(+) diff --git a/configure b/configure index 44f8e7b9db..b5287cdce1 100755 --- a/configure +++ b/configure @@ -21028,6 +21028,7 @@ wine_fn_config_makefile dlls/pidgen enable_pidgen wine_fn_config_makefile dlls/powrprof enable_powrprof wine_fn_config_makefile dlls/printui enable_printui wine_fn_config_makefile dlls/prntvpt enable_prntvpt +wine_fn_config_makefile dlls/prntvpt/tests enable_tests wine_fn_config_makefile dlls/propsys enable_propsys wine_fn_config_makefile dlls/propsys/tests enable_tests wine_fn_config_makefile dlls/psapi enable_psapi diff --git a/configure.ac b/configure.ac index e61a98455c..72276fc066 100644 --- a/configure.ac +++ b/configure.ac @@ -3616,6 +3616,7 @@ WINE_CONFIG_MAKEFILE(dlls/pidgen) WINE_CONFIG_MAKEFILE(dlls/powrprof) WINE_CONFIG_MAKEFILE(dlls/printui) WINE_CONFIG_MAKEFILE(dlls/prntvpt) +WINE_CONFIG_MAKEFILE(dlls/prntvpt/tests) WINE_CONFIG_MAKEFILE(dlls/propsys) WINE_CONFIG_MAKEFILE(dlls/propsys/tests) WINE_CONFIG_MAKEFILE(dlls/psapi) diff --git a/dlls/prntvpt/tests/Makefile.in b/dlls/prntvpt/tests/Makefile.in new file mode 100644 index 0000000000..692a134d01 --- /dev/null +++ b/dlls/prntvpt/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = prntvpt.dll +IMPORTS = prntvpt winspool ole32 + +C_SRCS = \ + prntvpt.c diff --git a/dlls/prntvpt/tests/prntvpt.c b/dlls/prntvpt/tests/prntvpt.c new file mode 100644 index 0000000000..55b6f3fdef --- /dev/null +++ b/dlls/prntvpt/tests/prntvpt.c @@ -0,0 +1,148 @@ +/* + * Copyright 2019 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include <stdarg.h> + +#include <windef.h> +#include <winbase.h> +#include <wingdi.h> +#include <winspool.h> +#include <objbase.h> +#include <prntvpt.h> + +#include "wine/test.h" + +static WCHAR default_name[256]; + +struct hprov_data +{ + HPTPROVIDER hprov; + HRESULT hr; +}; + +static DWORD WINAPI CloseProvider_proc(void *param) +{ + struct hprov_data *data = param; + + data->hr = PTCloseProvider(data->hprov); + + return 0; +} + +static void test_PTOpenProvider(void) +{ + DWORD tid, i; + HPTPROVIDER hprov; + HRESULT hr; + HANDLE hthread; + struct hprov_data data; + + hr = PTOpenProvider(default_name, 1, &hprov); + ok(hr == S_OK, "got %#x\n", hr); + + data.hprov = hprov; + hthread = CreateThread(NULL, 0, CloseProvider_proc, &data, 0, &tid); + WaitForSingleObject(hthread, INFINITE); + CloseHandle(hthread); + ok(data.hr == E_HANDLE || data.hr == E_INVALIDARG /* XP */ || broken(data.hr == S_OK) /* Win8 */, "got %#x\n", data.hr); + + if (data.hr != S_OK) + { + hr = PTCloseProvider(hprov); + ok(hr == S_OK, "got %#x\n", hr); + } + + hr = PTOpenProvider(default_name, 0, &hprov); + ok(hr == E_INVALIDARG, "got %#x\n", hr); + + for (i = 2; i < 20; i++) + { + hr = PTOpenProvider(default_name, i, &hprov); + ok(hr == 0x80040001 || hr == E_INVALIDARG /* Wine */, "%u: got %#x\n", i, hr); + } +} + +static void test_PTOpenProviderEx(void) +{ + DWORD tid, ver, i; + HPTPROVIDER hprov; + HRESULT hr; + HANDLE hthread; + struct hprov_data data; + + hr = PTOpenProviderEx(default_name, 1, 1, &hprov, NULL); + ok(hr == E_INVALIDARG, "got %#x\n", hr); + + ver = 0xdeadbeef; + hr = PTOpenProviderEx(default_name, 1, 1, &hprov, &ver); + ok(hr == S_OK, "got %#x\n", hr); + ok(ver == 1, "got %#x\n", ver); + + data.hprov = hprov; + hthread = CreateThread(NULL, 0, CloseProvider_proc, &data, 0, &tid); + WaitForSingleObject(hthread, INFINITE); + CloseHandle(hthread); + ok(data.hr == E_HANDLE || data.hr == E_INVALIDARG /* XP */ || broken(data.hr == S_OK) /* Win8 */, "got %#x\n", data.hr); + + if (data.hr != S_OK) + { + hr = PTCloseProvider(hprov); + ok(hr == S_OK, "got %#x\n", hr); + } + + for (i = 1; i < 20; i++) + { + hr = PTOpenProviderEx(default_name, 0, i, &hprov, &ver); + ok(hr == E_INVALIDARG, "%u: got %#x\n", i, hr); + + ver = 0xdeadbeef; + hr = PTOpenProviderEx(default_name, 1, i, &hprov, &ver); + ok(hr == S_OK, "%u: got %#x\n", i, hr); + ok(ver == 1, "%u: got %#x\n", i, ver); + PTCloseProvider(hprov); + + ver = 0xdeadbeef; + hr = PTOpenProviderEx(default_name, i, i, &hprov, &ver); + ok(hr == S_OK, "%u: got %#x\n", i, hr); + ok(ver == 1, "%u: got %#x\n", i, ver); + PTCloseProvider(hprov); + } +} + +START_TEST(prntvpt) +{ + DWORD size; + + CoInitializeEx(NULL, COINIT_MULTITHREADED); + + size = ARRAY_SIZE(default_name); + if (!GetDefaultPrinterW(default_name, &size)) + { + skip("no default printer set\n"); + return; + } + + trace("default printer: %s\n", wine_dbgstr_w(default_name)); + + test_PTOpenProvider(); + test_PTOpenProviderEx(); + + CoUninitialize(); +} diff --git a/include/prntvpt.h b/include/prntvpt.h index 8b873dd0aa..a453f8cb37 100644 --- a/include/prntvpt.h +++ b/include/prntvpt.h @@ -27,6 +27,7 @@ DECLARE_HANDLE(HPTPROVIDER); HRESULT WINAPI PTOpenProvider(const WCHAR *printer, DWORD version, HPTPROVIDER *provider); HRESULT WINAPI PTOpenProviderEx(const WCHAR *printer, DWORD max_version, DWORD pref_version, HPTPROVIDER *provider, DWORD *used_version); +HRESULT WINAPI PTCloseProvider(HPTPROVIDER); #ifdef __cplusplus }
1
0
0
0
Dmitry Timoshkov : prntvpt: Implement PTCloseProvider.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: f8d3b8e58f4e07b288484a0b48103a6f162463eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f8d3b8e58f4e07b288484a0b…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Jun 10 13:31:42 2020 +0800 prntvpt: Implement PTCloseProvider. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/prntvpt/main.c | 21 +++++++++++++++++++++ dlls/prntvpt/prntvpt.spec | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/prntvpt/main.c b/dlls/prntvpt/main.c index 9c12b0cbfa..1bbe280d0e 100644 --- a/dlls/prntvpt/main.c +++ b/dlls/prntvpt/main.c @@ -57,6 +57,27 @@ HRESULT WINAPI PTQuerySchemaVersionSupport(PCWSTR printer, DWORD *version) return E_NOTIMPL; } +static BOOL is_valid_provider(struct prn_provider *prov) +{ + return prov && prov->owner == GetCurrentThreadId(); +} + +HRESULT WINAPI PTCloseProvider(HPTPROVIDER provider) +{ + struct prn_provider *prov = (struct prn_provider *)provider; + + TRACE("%p\n", provider); + + if (!is_valid_provider(prov)) + return E_HANDLE; + + prov->owner = 0; + ClosePrinter(prov->hprn); + heap_free(prov); + + return S_OK; +} + HRESULT WINAPI PTOpenProvider(PCWSTR printer, DWORD version, HPTPROVIDER *provider) { DWORD used_version; diff --git a/dlls/prntvpt/prntvpt.spec b/dlls/prntvpt/prntvpt.spec index 5581fa4c50..99c6708242 100644 --- a/dlls/prntvpt/prntvpt.spec +++ b/dlls/prntvpt/prntvpt.spec @@ -1,7 +1,7 @@ @ stdcall PTQuerySchemaVersionSupport(wstr ptr) @ stdcall PTOpenProvider(wstr long ptr) @ stdcall PTOpenProviderEx(wstr long long ptr ptr) -@ stub PTCloseProvider +@ stdcall PTCloseProvider(ptr) @ stub BindPTProviderThunk @ stub PTGetPrintCapabilities @ stub PTMergeAndValidatePrintTicket
1
0
0
0
Dmitry Timoshkov : prntvpt: Implement PTOpenProvider.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: 83eb1e1535375f17e678ddb63e6aacc846079b37 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=83eb1e1535375f17e678ddb6…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Jun 10 13:31:39 2020 +0800 prntvpt: Implement PTOpenProvider. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/prntvpt/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/prntvpt/main.c b/dlls/prntvpt/main.c index 902be87114..9c12b0cbfa 100644 --- a/dlls/prntvpt/main.c +++ b/dlls/prntvpt/main.c @@ -59,8 +59,13 @@ HRESULT WINAPI PTQuerySchemaVersionSupport(PCWSTR printer, DWORD *version) HRESULT WINAPI PTOpenProvider(PCWSTR printer, DWORD version, HPTPROVIDER *provider) { - FIXME("%s, %d, %p: stub\n", debugstr_w(printer), version, provider); - return E_NOTIMPL; + DWORD used_version; + + TRACE("%s, %d, %p\n", debugstr_w(printer), version, provider); + + if (version != 1) return E_INVALIDARG; + + return PTOpenProviderEx(printer, 1, 1, provider, &used_version); } HRESULT WINAPI PTOpenProviderEx(const WCHAR *printer, DWORD max_version, DWORD pref_version, HPTPROVIDER *provider, DWORD *used_version)
1
0
0
0
Dmitry Timoshkov : prntvpt: Implement PTOpenProviderEx.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: 645d909b28b29970af220d5d241ac8b5c5add38e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=645d909b28b29970af220d5d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Jun 10 13:31:36 2020 +0800 prntvpt: Implement PTOpenProviderEx. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/prntvpt/Makefile.in | 4 +++- dlls/prntvpt/main.c | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/dlls/prntvpt/Makefile.in b/dlls/prntvpt/Makefile.in index 5efd1c4eb2..a3db8760c2 100644 --- a/dlls/prntvpt/Makefile.in +++ b/dlls/prntvpt/Makefile.in @@ -1,4 +1,6 @@ -MODULE = prntvpt.dll +MODULE = prntvpt.dll +IMPORTLIB = prntvpt +IMPORTS = winspool EXTRADLLFLAGS = -mno-cygwin diff --git a/dlls/prntvpt/main.c b/dlls/prntvpt/main.c index ec7cf7c3e2..902be87114 100644 --- a/dlls/prntvpt/main.c +++ b/dlls/prntvpt/main.c @@ -22,11 +22,20 @@ #include "windef.h" #include "winbase.h" +#include "wingdi.h" +#include "winspool.h" #include "prntvpt.h" +#include "wine/heap.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(prntvpt); +struct prn_provider +{ + DWORD owner; + HANDLE hprn; +}; + BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) { TRACE("(%p, %d, %p)\n", hinst, reason, reserved); @@ -42,7 +51,6 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) return TRUE; } - HRESULT WINAPI PTQuerySchemaVersionSupport(PCWSTR printer, DWORD *version) { FIXME("stub:%s %p\n", debugstr_w(printer), version); @@ -57,6 +65,25 @@ HRESULT WINAPI PTOpenProvider(PCWSTR printer, DWORD version, HPTPROVIDER *provid HRESULT WINAPI PTOpenProviderEx(const WCHAR *printer, DWORD max_version, DWORD pref_version, HPTPROVIDER *provider, DWORD *used_version) { - FIXME("%s, %d, %d, %p, %p: stub\n", debugstr_w(printer), max_version, pref_version, provider, used_version); - return E_NOTIMPL; + struct prn_provider *prov; + + TRACE("%s, %d, %d, %p, %p\n", debugstr_w(printer), max_version, pref_version, provider, used_version); + + if (!max_version || !provider || !used_version) + return E_INVALIDARG; + + prov = heap_alloc(sizeof(*prov)); + if (!prov) return E_OUTOFMEMORY; + + if (!OpenPrinterW((LPWSTR)printer, &prov->hprn, NULL)) + { + heap_free(prov); + return HRESULT_FROM_WIN32(GetLastError()); + } + + prov->owner = GetCurrentThreadId(); + *provider = (HPTPROVIDER)prov; + *used_version = 1; + + return S_OK; }
1
0
0
0
Hans Leidekker : msi: Fix installing from administrative image with compressed source files.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: 15c8e5dee6fa3b7eac1d1b3cd6d27aa744faff4d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=15c8e5dee6fa3b7eac1d1b3c…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jun 10 11:43:39 2020 +0200 msi: Fix installing from administrative image with compressed source files. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49352
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/action.c | 10 +++------ dlls/msi/tests/install.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 048d5983a9..bc7fecbd73 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -1223,10 +1223,9 @@ static UINT load_file(MSIRECORD *row, LPVOID param) */ if (package->WordCount & msidbSumInfoSourceTypeAdminImage) { - file->IsCompressed = FALSE; + file->IsCompressed = package->WordCount & msidbSumInfoSourceTypeCompressed; } - else if (file->Attributes & - (msidbFileAttributesCompressed | msidbFileAttributesPatchAdded)) + else if (file->Attributes & (msidbFileAttributesCompressed | msidbFileAttributesPatchAdded)) { file->IsCompressed = TRUE; } @@ -1234,10 +1233,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param) { file->IsCompressed = FALSE; } - else - { - file->IsCompressed = package->WordCount & msidbSumInfoSourceTypeCompressed; - } + else file->IsCompressed = package->WordCount & msidbSumInfoSourceTypeCompressed; load_file_hash(package, file); load_file_disk_id(package, file); diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 99d53e5657..2cfa810e1d 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -1392,6 +1392,34 @@ static const CHAR sr_custom_action_dat[] = "sourcedir_unset\t19\t\tSourceDir should not be set\n" "sourcedir_set\t19\t\tSourceDir should be set\n"; +static const CHAR ai2_file_dat[] = + "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "five.txt\tFive\tfive.txt\t1000\t\t\t0\t5\n" + "four.txt\tFour\tfour.txt\t1000\t\t\t0\t4\n"; + +static const CHAR ai2_component_dat[] = + "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n" + "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"; + +static const CHAR ai2_feature_dat[] = + "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n" + "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"; + +static const CHAR ai2_feature_comp_dat[] = + "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "Five\tFive\n" + "Four\tFour\n"; + static const msi_table tables[] = { ADD_TABLE(component), @@ -1821,6 +1849,18 @@ static const msi_table ai_tables[] = ADD_TABLE(property) }; +static const msi_table ai2_tables[] = +{ + ADD_TABLE(ai2_component), + ADD_TABLE(directory), + ADD_TABLE(ai2_feature), + ADD_TABLE(ai2_feature_comp), + ADD_TABLE(ai2_file), + ADD_TABLE(install_exec_seq), + ADD_TABLE(media), + ADD_TABLE(property) +}; + static const msi_table pc_tables[] = { ADD_TABLE(ca51_component), @@ -4865,6 +4905,24 @@ static void test_adminimage(void) delete_pf_files(); + create_file("four.txt", 100); + create_file("five.txt", 100); + create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0"); + create_database_wordcount(msifile, ai2_tables, ARRAY_SIZE(ai2_tables), + 100, msidbSumInfoSourceTypeAdminImage|msidbSumInfoSourceTypeCompressed, + ";1033", "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}"); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n"); + ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n"); + ok(delete_pf("msitest", FALSE), "Directory not created\n"); + error: DeleteFileA("msifile"); DeleteFileA("msitest\\cabout\\new\\five.txt");
1
0
0
0
Alexandre Julliard : ntdll: Implement NtCreateUserProcess().
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: 84d25135b3b2f9a30619f741d166fa1daa8298e5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=84d25135b3b2f9a30619f741…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 10 09:37:01 2020 +0200 ntdll: Implement NtCreateUserProcess(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/process.c | 192 ++++++++++++++++++++++++++++++++++++++++---------- include/winternl.h | 130 ++++++++++++++++++++++++++++++++-- 3 files changed, 281 insertions(+), 42 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=84d25135b3b2f9a30619…
1
0
0
0
Alexandre Julliard : ntdll: Avoid referencing security descriptor functions from the Unix library.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: df513b95ec24d279a10fbe358973662ce2c9c385 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=df513b95ec24d279a10fbe35…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 10 08:45:11 2020 +0200 ntdll: Avoid referencing security descriptor functions from the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/sync.c | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 636dccf1a1..03b511881b 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -186,11 +186,9 @@ NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_a data_size_t *ret_len ) { unsigned int len = sizeof(**ret); - PSID owner = NULL, group = NULL; - ACL *dacl, *sacl; - BOOLEAN dacl_present, sacl_present, defaulted; - PSECURITY_DESCRIPTOR sd; - NTSTATUS status; + SID *owner = NULL, *group = NULL; + ACL *dacl = NULL, *sacl = NULL; + SECURITY_DESCRIPTOR *sd; *ret = NULL; *ret_len = 0; @@ -202,15 +200,27 @@ NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_a if ((sd = attr->SecurityDescriptor)) { len += sizeof(struct security_descriptor); + if (sd->Revision != SECURITY_DESCRIPTOR_REVISION) return STATUS_UNKNOWN_REVISION; + if (sd->Control & SE_SELF_RELATIVE) + { + SECURITY_DESCRIPTOR_RELATIVE *rel = (SECURITY_DESCRIPTOR_RELATIVE *)sd; + if (rel->Owner) owner = (PSID)((BYTE *)rel + rel->Owner); + if (rel->Group) group = (PSID)((BYTE *)rel + rel->Group); + if ((sd->Control & SE_SACL_PRESENT) && rel->Sacl) sacl = (PSID)((BYTE *)rel + rel->Sacl); + if ((sd->Control & SE_DACL_PRESENT) && rel->Dacl) dacl = (PSID)((BYTE *)rel + rel->Dacl); + } + else + { + owner = sd->Owner; + group = sd->Group; + if (sd->Control & SE_SACL_PRESENT) sacl = sd->Sacl; + if (sd->Control & SE_SACL_PRESENT) dacl = sd->Dacl; + } - if ((status = RtlGetOwnerSecurityDescriptor( sd, &owner, &defaulted ))) return status; - if ((status = RtlGetGroupSecurityDescriptor( sd, &group, &defaulted ))) return status; - if ((status = RtlGetSaclSecurityDescriptor( sd, &sacl_present, &sacl, &defaulted ))) return status; - if ((status = RtlGetDaclSecurityDescriptor( sd, &dacl_present, &dacl, &defaulted ))) return status; - if (owner) len += RtlLengthSid( owner ); - if (group) len += RtlLengthSid( group ); - if (sacl_present && sacl) len += sacl->AclSize; - if (dacl_present && dacl) len += dacl->AclSize; + if (owner) len += offsetof( SID, SubAuthority[owner->SubAuthorityCount] ); + if (group) len += offsetof( SID, SubAuthority[group->SubAuthorityCount] ); + if (sacl) len += sacl->AclSize; + if (dacl) len += dacl->AclSize; /* fix alignment for the Unicode name that follows the structure */ len = (len + sizeof(WCHAR) - 1) & ~(sizeof(WCHAR) - 1); @@ -236,11 +246,11 @@ NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_a struct security_descriptor *descr = (struct security_descriptor *)(*ret + 1); unsigned char *ptr = (unsigned char *)(descr + 1); - descr->control = ((SECURITY_DESCRIPTOR *)sd)->Control & ~SE_SELF_RELATIVE; - if (owner) descr->owner_len = RtlLengthSid( owner ); - if (group) descr->group_len = RtlLengthSid( group ); - if (sacl_present && sacl) descr->sacl_len = sacl->AclSize; - if (dacl_present && dacl) descr->dacl_len = dacl->AclSize; + descr->control = sd->Control & ~SE_SELF_RELATIVE; + if (owner) descr->owner_len = offsetof( SID, SubAuthority[owner->SubAuthorityCount] ); + if (group) descr->group_len = offsetof( SID, SubAuthority[group->SubAuthorityCount] ); + if (sacl) descr->sacl_len = sacl->AclSize; + if (dacl) descr->dacl_len = dacl->AclSize; memcpy( ptr, owner, descr->owner_len ); ptr += descr->owner_len;
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
...
95
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200