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
April 2019
----- 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
803 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Introduce a Vulkan based adapter implementation.
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: 7cf3edcdc85e7a0c9262fa8325ce0bc243e991d3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7cf3edcdc85e7a0c9262fa83…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Apr 1 17:38:26 2019 +0430 wined3d: Introduce a Vulkan based adapter implementation. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/Makefile.in | 1 + dlls/wined3d/adapter_vk.c | 105 +++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/directx.c | 3 ++ dlls/wined3d/utils.c | 5 ++ dlls/wined3d/wined3d_main.c | 27 +++++++---- dlls/wined3d/wined3d_private.h | 24 +++++++++- 6 files changed, 156 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/Makefile.in b/dlls/wined3d/Makefile.in index 39fed38..7ebd010 100644 --- a/dlls/wined3d/Makefile.in +++ b/dlls/wined3d/Makefile.in @@ -4,6 +4,7 @@ IMPORTS = opengl32 user32 gdi32 advapi32 C_SRCS = \ adapter_gl.c \ + adapter_vk.c \ arb_program_shader.c \ ati_fragment_shader.c \ buffer.c \ diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c new file mode 100644 index 0000000..e2c940d --- /dev/null +++ b/dlls/wined3d/adapter_vk.c @@ -0,0 +1,105 @@ +/* + * Copyright 2018 Henri Verbeet for CodeWeavers + * + * 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 + */ + +#include "config.h" +#include "wine/port.h" +#include "wined3d_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d); + +static void adapter_vk_destroy(struct wined3d_adapter *adapter) +{ + wined3d_adapter_cleanup(adapter); + heap_free(adapter); +} + +static BOOL adapter_vk_create_context(struct wined3d_context *context, + struct wined3d_texture *target, const struct wined3d_format *ds_format) +{ + return TRUE; +} + +static void adapter_vk_get_wined3d_caps(const struct wined3d_adapter *adapter, struct wined3d_caps *caps) +{ +} + +static BOOL adapter_vk_check_format(const struct wined3d_adapter *adapter, + const struct wined3d_format *adapter_format, const struct wined3d_format *rt_format, + const struct wined3d_format *ds_format) +{ + return TRUE; +} + +static const struct wined3d_adapter_ops wined3d_adapter_vk_ops = +{ + adapter_vk_destroy, + adapter_vk_create_context, + adapter_vk_get_wined3d_caps, + adapter_vk_check_format, +}; + +static BOOL wined3d_adapter_vk_init(struct wined3d_adapter_vk *adapter_vk, + unsigned int ordinal, unsigned int wined3d_creation_flags) +{ + const struct wined3d_gpu_description *gpu_description; + struct wined3d_adapter *adapter = &adapter_vk->a; + + TRACE("adapter_vk %p, ordinal %u, wined3d_creation_flags %#x.\n", + adapter_vk, ordinal, wined3d_creation_flags); + + if (!wined3d_adapter_init(adapter, ordinal)) + return FALSE; + + if (!(gpu_description = wined3d_get_gpu_description(HW_VENDOR_AMD, CARD_AMD_RADEON_RX_VEGA))) + { + ERR("Failed to get GPU description.\n"); + return FALSE; + } + wined3d_driver_info_init(&adapter->driver_info, gpu_description, wined3d_settings.emulated_textureram); + + if (!wined3d_adapter_vk_init_format_info(adapter)) + return FALSE; + + adapter->vertex_pipe = &none_vertex_pipe; + adapter->fragment_pipe = &none_fragment_pipe; + adapter->shader_backend = &none_shader_backend; + adapter->adapter_ops = &wined3d_adapter_vk_ops; + + adapter->d3d_info.wined3d_creation_flags = wined3d_creation_flags; + + return TRUE; +} + +struct wined3d_adapter *wined3d_adapter_vk_create(unsigned int ordinal, + unsigned int wined3d_creation_flags) +{ + struct wined3d_adapter_vk *adapter_vk; + + if (!(adapter_vk = heap_alloc_zero(sizeof(*adapter_vk)))) + return NULL; + + if (!wined3d_adapter_vk_init(adapter_vk, ordinal, wined3d_creation_flags)) + { + heap_free(adapter_vk); + return NULL; + } + + TRACE("Created adapter %p.\n", adapter_vk); + + return &adapter_vk->a; +} diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 83fa47a..49e56e0 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2314,6 +2314,9 @@ static struct wined3d_adapter *wined3d_adapter_create(unsigned int ordinal, DWOR if (wined3d_creation_flags & WINED3D_NO3D) return wined3d_adapter_no3d_create(ordinal, wined3d_creation_flags); + if (wined3d_settings.renderer == WINED3D_RENDERER_VULKAN) + return wined3d_adapter_vk_create(ordinal, wined3d_creation_flags); + return wined3d_adapter_gl_create(ordinal, wined3d_creation_flags); } diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index a242283..be76dbb 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4067,6 +4067,11 @@ fail: return FALSE; } +BOOL wined3d_adapter_vk_init_format_info(struct wined3d_adapter *adapter) +{ + return wined3d_adapter_init_format_info(adapter, sizeof(struct wined3d_format)); +} + const struct wined3d_format *wined3d_get_format(const struct wined3d_adapter *adapter, enum wined3d_format_id format_id, unsigned int bind_flags) { diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 5ca58ae..d2e4978 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -89,7 +89,7 @@ struct wined3d_settings wined3d_settings = ~0U, /* No GS shader model limit by default. */ ~0U, /* No PS shader model limit by default. */ ~0u, /* No CS shader model limit by default. */ - FALSE, /* 3D support enabled by default. */ + WINED3D_RENDERER_AUTO, WINED3D_SHADER_BACKEND_AUTO, }; @@ -104,11 +104,10 @@ struct wined3d * CDECL wined3d_create(DWORD flags) return NULL; } - if (wined3d_settings.no_3d) + if (wined3d_settings.renderer == WINED3D_RENDERER_NO3D) flags |= WINED3D_NO3D; - hr = wined3d_init(object, flags); - if (FAILED(hr)) + if (FAILED(hr = wined3d_init(object, flags))) { WARN("Failed to initialize wined3d object, hr %#x.\n", hr); heap_free(object); @@ -327,12 +326,24 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) TRACE("Limiting PS shader model to %u.\n", wined3d_settings.max_sm_ps); if (!get_config_key_dword(hkey, appkey, "MaxShaderModelCS", &wined3d_settings.max_sm_cs)) TRACE("Limiting CS shader model to %u.\n", wined3d_settings.max_sm_cs); - if ((!get_config_key(hkey, appkey, "renderer", buffer, size) + if (!get_config_key(hkey, appkey, "renderer", buffer, size) || !get_config_key(hkey, appkey, "DirectDrawRenderer", buffer, size)) - && !strcmp(buffer, "gdi")) { - TRACE("Disabling 3D support.\n"); - wined3d_settings.no_3d = TRUE; + if (!strcmp(buffer, "vulkan")) + { + ERR_(winediag)("Using the Vulkan renderer.\n"); + wined3d_settings.renderer = WINED3D_RENDERER_VULKAN; + } + else if (!strcmp(buffer, "gl")) + { + ERR_(winediag)("Using the OpenGL renderer.\n"); + wined3d_settings.renderer = WINED3D_RENDERER_OPENGL; + } + else if (!strcmp(buffer, "gdi") || !strcmp(buffer, "no3d")) + { + ERR_(winediag)("Disabling 3D support.\n"); + wined3d_settings.renderer = WINED3D_RENDERER_NO3D; + } } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f482bb9..5a455ed 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -379,6 +379,14 @@ static inline void wined3d_pause(void) #define PCI_VENDOR_NONE 0xffff /* e.g. 0x8086 for Intel and 0x10de for Nvidia */ #define PCI_DEVICE_NONE 0xffff /* e.g. 0x14f for a Geforce6200 */ +enum wined3d_renderer +{ + WINED3D_RENDERER_AUTO, + WINED3D_RENDERER_VULKAN, + WINED3D_RENDERER_OPENGL, + WINED3D_RENDERER_NO3D, +}; + enum wined3d_shader_backend { WINED3D_SHADER_BACKEND_AUTO, @@ -409,7 +417,7 @@ struct wined3d_settings unsigned int max_sm_gs; unsigned int max_sm_ps; unsigned int max_sm_cs; - BOOL no_3d; + enum wined3d_renderer renderer; enum wined3d_shader_backend shader_backend; }; @@ -2741,6 +2749,19 @@ struct wined3d_adapter *wined3d_adapter_gl_create(unsigned int ordinal, unsigned BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, struct wined3d_texture *target, const struct wined3d_format *ds_format) DECLSPEC_HIDDEN; +struct wined3d_adapter_vk +{ + struct wined3d_adapter a; +}; + +static inline struct wined3d_adapter_vk *wined3d_adapter_vk(struct wined3d_adapter *adapter) +{ + return CONTAINING_RECORD(adapter, struct wined3d_adapter_vk, a); +} + +struct wined3d_adapter *wined3d_adapter_vk_create(unsigned int ordinal, + unsigned int wined3d_creation_flags) DECLSPEC_HIDDEN; + struct wined3d_caps_gl_ctx { HDC dc; @@ -2757,6 +2778,7 @@ struct wined3d_caps_gl_ctx BOOL wined3d_adapter_gl_init_format_info(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN; BOOL wined3d_adapter_no3d_init_format_info(struct wined3d_adapter *adapter) DECLSPEC_HIDDEN; +BOOL wined3d_adapter_vk_init_format_info(struct wined3d_adapter *adapter) DECLSPEC_HIDDEN; UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount) DECLSPEC_HIDDEN; BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits(struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN;
1
0
0
0
Zebediah Figura : oleaut32/tests: Test marshalling of complex structs.
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: c299f09e255fdea7f6e06ea2f59c9b799c86a5b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c299f09e255fdea7f6e06ea2…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 31 23:31:20 2019 -0500 oleaut32/tests: Test marshalling of complex structs. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/tmarshal.c | 45 ++++++++++++++++++++++++++++++++++++++++ dlls/oleaut32/tests/tmarshal.idl | 21 ++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c index 9a7d995..4f84442 100644 --- a/dlls/oleaut32/tests/tmarshal.c +++ b/dlls/oleaut32/tests/tmarshal.c @@ -1441,6 +1441,28 @@ static HRESULT WINAPI Widget_rect(IWidget *iface, RECT in, RECT *out, RECT *in_p return S_OK; } +static HRESULT WINAPI Widget_complex_struct(IWidget *iface, struct complex in) +{ + HRESULT hr; + + ok(in.c == 98, "Got char %d.\n", in.c); + ok(in.i == 76543, "Got int %d.\n", in.i); + ok(*in.pi == 2, "Got int pointer %d.\n", *in.pi); + ok(**in.ppi == 10, "Got int double pointer %d.\n", **in.ppi); + hr = ISomethingFromDispatch_anotherfn(in.iface); + ok(hr == 0x01234567, "Got wrong hr %#x.\n", hr); + hr = ISomethingFromDispatch_anotherfn(*in.iface_ptr); + ok(hr == 0x01234567, "Got wrong hr %#x.\n", hr); + ok(!lstrcmpW(in.bstr, test_bstr2), "Got string %s.\n", wine_dbgstr_w(in.bstr)); + ok(V_VT(&in.var) == VT_I4, "Got wrong type %u.\n", V_VT(&in.var)); + ok(V_I4(&in.var) == 123, "Got wrong value %d.\n", V_I4(&in.var)); + ok(!memcmp(&in.mystruct, &test_mystruct1, sizeof(MYSTRUCT)), "Structs didn't match.\n"); + ok(!memcmp(in.arr, test_array1, sizeof(array_t)), "Arrays didn't match.\n"); + ok(in.myint == 456, "Got int %d.\n", in.myint); + + return S_OK; +} + static HRESULT WINAPI Widget_array(IWidget *iface, array_t in, array_t out, array_t in_out) { static const array_t empty = {0}; @@ -1600,6 +1622,7 @@ static const struct IWidgetVtbl Widget_VTable = Widget_mystruct_ptr_ptr, Widget_thin_struct, Widget_rect, + Widget_complex_struct, Widget_array, Widget_variant_array, Widget_mystruct_array, @@ -2500,6 +2523,9 @@ static void test_marshal_struct(IWidget *widget, IDispatch *disp) { MYSTRUCT out, in_ptr, in_out, *in_ptr_ptr; RECT rect_out, rect_in_ptr, rect_in_out; + ISomethingFromDispatch *sfd; + struct complex complex; + int i, i2, *pi = &i2; HRESULT hr; memcpy(&out, &test_mystruct2, sizeof(MYSTRUCT)); @@ -2531,6 +2557,25 @@ static void test_marshal_struct(IWidget *widget, IDispatch *disp) ok(EqualRect(&rect_out, &test_rect5), "Rects didn't match.\n"); ok(EqualRect(&rect_in_ptr, &test_rect3), "Rects didn't match.\n"); ok(EqualRect(&rect_in_out, &test_rect7), "Rects didn't match.\n"); + + /* Test complex structs. */ + complex.c = 98; + complex.i = 76543; + i = 2; + complex.pi = &i; + i2 = 10; + complex.ppi = π + complex.iface = create_disp_obj(); + sfd = create_disp_obj(); + complex.iface_ptr = &sfd; + complex.bstr = SysAllocString(test_bstr2); + V_VT(&complex.var) = VT_I4; + V_I4(&complex.var) = 123; + memcpy(&complex.mystruct, &test_mystruct1, sizeof(MYSTRUCT)); + memcpy(complex.arr, test_array1, sizeof(array_t)); + complex.myint = 456; + hr = IWidget_complex_struct(widget, complex); + ok(hr == S_OK, "Got hr %#x.\n", hr); } static void test_marshal_array(IWidget *widget, IDispatch *disp) diff --git a/dlls/oleaut32/tests/tmarshal.idl b/dlls/oleaut32/tests/tmarshal.idl index cdc7dc1..14b80c4 100644 --- a/dlls/oleaut32/tests/tmarshal.idl +++ b/dlls/oleaut32/tests/tmarshal.idl @@ -65,6 +65,7 @@ enum IWidget_dispids DISPID_TM_STRUCT_PTR_PTR, DISPID_TM_THIN_STRUCT, DISPID_TM_RECT, + DISPID_TM_COMPLEX_STRUCT, DISPID_TM_ARRAY, DISPID_TM_VARIANT_ARRAY, DISPID_TM_STRUCT_ARRAY, @@ -105,6 +106,8 @@ library TestTypelib typedef [public] int myint_t; + typedef int array_t[4]; + coclass ApplicationObject2; [ @@ -335,7 +338,23 @@ library TestTypelib [id(DISPID_TM_RECT)] HRESULT rect([in] RECT in, [out] RECT *out, [in] RECT *in_ptr, [in, out] RECT *in_out); - typedef int array_t[4]; + struct complex + { + char c; + int i; + int *pi; + int **ppi; + ISomethingFromDispatch *iface; + ISomethingFromDispatch **iface_ptr; + BSTR bstr; + VARIANT var; + MYSTRUCT mystruct; + array_t arr; + myint_t myint; + }; + + [id(DISPID_TM_COMPLEX_STRUCT)] + HRESULT complex_struct([in] struct complex in); [id(DISPID_TM_ARRAY)] HRESULT array([in] array_t in, [out] array_t out, [in, out] array_t in_out);
1
0
0
0
Zebediah Figura : rpcrt4: Write type format strings for complex structs.
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: ad2cba9d8427a9543a0cca18267136b45741ba66 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ad2cba9d8427a9543a0cca18…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 31 23:31:19 2019 -0500 rpcrt4: Write type format strings for complex structs. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46378
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_typelib.c | 231 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 221 insertions(+), 10 deletions(-) diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c index 3d3d42b..5a4de51 100644 --- a/dlls/rpcrt4/ndr_typelib.c +++ b/dlls/rpcrt4/ndr_typelib.c @@ -355,24 +355,42 @@ static unsigned char get_array_fc(ITypeInfo *typeinfo, TYPEDESC *desc) return FC_BOGUS_ARRAY; } -static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str, +static BOOL type_is_non_iface_pointer(ITypeInfo *typeinfo, TYPEDESC *desc) +{ + if (desc->vt == VT_PTR) + return !type_pointer_is_iface(typeinfo, desc->lptdesc); + else if (desc->vt == VT_USERDEFINED) + { + ITypeInfo *refinfo; + TYPEATTR *attr; + BOOL ret; + + ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo); + ITypeInfo_GetTypeAttr(refinfo, &attr); + + if (attr->typekind == TKIND_ALIAS) + ret = type_is_non_iface_pointer(refinfo, &attr->tdescAlias); + else + ret = FALSE; + + ITypeInfo_ReleaseTypeAttr(refinfo, attr); + ITypeInfo_Release(refinfo); + + return ret; + } + else + return FALSE; +} + +static void write_struct_members(ITypeInfo *typeinfo, unsigned char *str, size_t *len, TYPEATTR *attr) { - unsigned char fc = get_struct_fc(typeinfo, attr); unsigned int struct_offset = 0; unsigned char basetype; - size_t off = *len; TYPEDESC *tdesc; VARDESC *desc; WORD i; - if (fc != FC_STRUCT) - FIXME("fc %02x not implemented\n", fc); - - WRITE_CHAR (str, *len, FC_STRUCT); - WRITE_CHAR (str, *len, attr->cbAlignment - 1); - WRITE_SHORT(str, *len, attr->cbSizeInstance); - for (i = 0; i < attr->cVars; i++) { ITypeInfo_GetVarDesc(typeinfo, i, &desc); @@ -391,12 +409,205 @@ static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str, if ((basetype = get_basetype(typeinfo, tdesc))) WRITE_CHAR(str, *len, basetype); + else if (type_is_non_iface_pointer(typeinfo, tdesc)) + WRITE_CHAR(str, *len, FC_POINTER); + else + { + WRITE_CHAR(str, *len, FC_EMBEDDED_COMPLEX); + WRITE_CHAR(str, *len, 0); + WRITE_SHORT(str, *len, 0); + } ITypeInfo_ReleaseVarDesc(typeinfo, desc); } if (!(*len & 1)) WRITE_CHAR (str, *len, FC_PAD); WRITE_CHAR (str, *len, FC_END); +} + +static void write_simple_struct_tfs(ITypeInfo *typeinfo, unsigned char *str, + size_t *len, TYPEATTR *attr) +{ + write_struct_members(typeinfo, str, len, attr); +} + +static BOOL type_needs_pointer_deref(ITypeInfo *typeinfo, TYPEDESC *desc) +{ + if (desc->vt == VT_PTR || desc->vt == VT_UNKNOWN || desc->vt == VT_DISPATCH) + return TRUE; + else if (desc->vt == VT_USERDEFINED) + { + ITypeInfo *refinfo; + BOOL ret = FALSE; + TYPEATTR *attr; + + ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo); + ITypeInfo_GetTypeAttr(refinfo, &attr); + + if (attr->typekind == TKIND_ALIAS) + ret = type_needs_pointer_deref(refinfo, &attr->tdescAlias); + + ITypeInfo_ReleaseTypeAttr(refinfo, attr); + ITypeInfo_Release(refinfo); + + return ret; + } + else + return FALSE; +} + +static void write_complex_struct_pointer_layout(ITypeInfo *typeinfo, + TYPEDESC *desc, unsigned char *str, size_t *len) +{ + unsigned char basetype; + + if (desc->vt == VT_PTR && !type_pointer_is_iface(typeinfo, desc->lptdesc)) + { + WRITE_CHAR(str, *len, FC_UP); + if ((basetype = get_basetype(typeinfo, desc->lptdesc))) + { + WRITE_CHAR(str, *len, FC_SIMPLE_POINTER); + WRITE_CHAR(str, *len, basetype); + WRITE_CHAR(str, *len, FC_PAD); + } + else + { + if (type_needs_pointer_deref(typeinfo, desc->lptdesc)) + WRITE_CHAR(str, *len, FC_POINTER_DEREF); + else + WRITE_CHAR(str, *len, 0); + WRITE_SHORT(str, *len, 0); + } + } + else if (desc->vt == VT_USERDEFINED) + { + ITypeInfo *refinfo; + TYPEATTR *attr; + + ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo); + ITypeInfo_GetTypeAttr(refinfo, &attr); + + if (attr->typekind == TKIND_ALIAS) + write_complex_struct_pointer_layout(refinfo, &attr->tdescAlias, str, len); + + ITypeInfo_ReleaseTypeAttr(refinfo, attr); + ITypeInfo_Release(refinfo); + } +} + +static size_t write_complex_struct_pointer_ref(ITypeInfo *typeinfo, + TYPEDESC *desc, unsigned char *str, size_t *len) +{ + if (desc->vt == VT_PTR && !type_pointer_is_iface(typeinfo, desc->lptdesc) + && !get_basetype(typeinfo, desc->lptdesc)) + { + return write_type_tfs(typeinfo, str, len, desc->lptdesc, FALSE, FALSE); + } + else if (desc->vt == VT_USERDEFINED) + { + ITypeInfo *refinfo; + TYPEATTR *attr; + size_t ret = 0; + + ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo); + ITypeInfo_GetTypeAttr(refinfo, &attr); + + if (attr->typekind == TKIND_ALIAS) + ret = write_complex_struct_pointer_ref(refinfo, &attr->tdescAlias, str, len); + + ITypeInfo_ReleaseTypeAttr(refinfo, attr); + ITypeInfo_Release(refinfo); + + return ret; + } + + return 0; +} + +static void write_complex_struct_tfs(ITypeInfo *typeinfo, unsigned char *str, + size_t *len, TYPEATTR *attr) +{ + size_t pointer_layout_offset, pointer_layout, member_layout, ref; + unsigned int struct_offset = 0; + TYPEDESC *tdesc; + VARDESC *desc; + WORD i; + + WRITE_SHORT(str, *len, 0); /* conformant array description */ + pointer_layout_offset = *len; + WRITE_SHORT(str, *len, 0); /* pointer layout; will be filled in later */ + member_layout = *len; + + /* First pass: write the struct members and pointer layout, but do not yet + * write the offsets for embedded complexes and pointer refs. These must be + * handled after we write the whole struct description, since it must be + * contiguous. */ + + write_struct_members(typeinfo, str, len, attr); + + pointer_layout = *len; + if (str) *((short *)(str + pointer_layout_offset)) = pointer_layout - pointer_layout_offset; + + for (i = 0; i < attr->cVars; i++) + { + ITypeInfo_GetVarDesc(typeinfo, i, &desc); + write_complex_struct_pointer_layout(typeinfo, &desc->elemdescVar.tdesc, str, len); + ITypeInfo_ReleaseVarDesc(typeinfo, desc); + } + + /* Second pass: write types for embedded complexes and non-simple pointers. */ + + struct_offset = 0; + + for (i = 0; i < attr->cVars; i++) + { + ITypeInfo_GetVarDesc(typeinfo, i, &desc); + tdesc = &desc->elemdescVar.tdesc; + + if (struct_offset != desc->oInst) + member_layout++; /* alignment directive */ + struct_offset = desc->oInst + type_memsize(typeinfo, tdesc); + + if (get_basetype(typeinfo, tdesc)) + member_layout++; + else if (type_is_non_iface_pointer(typeinfo, tdesc)) + { + member_layout++; + if ((ref = write_complex_struct_pointer_ref(typeinfo, tdesc, str, len))) + { + if (str) *((short *)(str + pointer_layout + 2)) = ref - (pointer_layout + 2); + } + pointer_layout += 4; + } + else + { + ref = write_type_tfs(typeinfo, str, len, tdesc, FALSE, FALSE); + if (str) *((short *)(str + member_layout + 2)) = ref - (member_layout + 2); + member_layout += 4; + } + + ITypeInfo_ReleaseVarDesc(typeinfo, desc); + } +} + +static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str, + size_t *len, TYPEATTR *attr) +{ + unsigned char fc = get_struct_fc(typeinfo, attr); + size_t off = *len; + + /* For the sake of simplicity, write pointer structs as complex structs. */ + if (fc == FC_PSTRUCT) + fc = FC_BOGUS_STRUCT; + + WRITE_CHAR (str, *len, fc); + WRITE_CHAR (str, *len, attr->cbAlignment - 1); + WRITE_SHORT(str, *len, attr->cbSizeInstance); + + if (fc == FC_STRUCT) + write_simple_struct_tfs(typeinfo, str, len, attr); + else if (fc == FC_BOGUS_STRUCT) + write_complex_struct_tfs(typeinfo, str, len, attr); return off; }
1
0
0
0
Zebediah Figura : rpcrt4: Write parameters for fixed structs.
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: 46e51ef7764a53fa40859b8a53ee7983f40cc544 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=46e51ef7764a53fa40859b8a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 31 23:31:18 2019 -0500 rpcrt4: Write parameters for fixed structs. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_typelib.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c index 8f87693..3d3d42b 100644 --- a/dlls/rpcrt4/ndr_typelib.c +++ b/dlls/rpcrt4/ndr_typelib.c @@ -246,6 +246,7 @@ static unsigned char get_struct_member_fc(ITypeInfo *typeinfo, TYPEDESC *tdesc) return (sizeof(void *) == 4) ? FC_PSTRUCT : FC_BOGUS_STRUCT; case VT_CY: return FC_STRUCT; + case VT_VARIANT: case VT_UNKNOWN: case VT_DISPATCH: return FC_BOGUS_STRUCT; @@ -358,7 +359,12 @@ static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str, size_t *len, TYPEATTR *attr) { unsigned char fc = get_struct_fc(typeinfo, attr); + unsigned int struct_offset = 0; + unsigned char basetype; size_t off = *len; + TYPEDESC *tdesc; + VARDESC *desc; + WORD i; if (fc != FC_STRUCT) FIXME("fc %02x not implemented\n", fc); @@ -366,7 +372,30 @@ static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str, WRITE_CHAR (str, *len, FC_STRUCT); WRITE_CHAR (str, *len, attr->cbAlignment - 1); WRITE_SHORT(str, *len, attr->cbSizeInstance); - WRITE_CHAR (str, *len, FC_PAD); + + for (i = 0; i < attr->cVars; i++) + { + ITypeInfo_GetVarDesc(typeinfo, i, &desc); + tdesc = &desc->elemdescVar.tdesc; + + /* This may not match the intended alignment, but we don't have enough + * information to determine that. This should always give the correct + * layout. */ + if ((struct_offset & 7) && !(desc->oInst & 7)) + WRITE_CHAR(str, *len, FC_ALIGNM8); + else if ((struct_offset & 3) && !(desc->oInst & 3)) + WRITE_CHAR(str, *len, FC_ALIGNM4); + else if ((struct_offset & 1) && !(desc->oInst & 1)) + WRITE_CHAR(str, *len, FC_ALIGNM2); + struct_offset = desc->oInst + type_memsize(typeinfo, tdesc); + + if ((basetype = get_basetype(typeinfo, tdesc))) + WRITE_CHAR(str, *len, basetype); + + ITypeInfo_ReleaseVarDesc(typeinfo, desc); + } + if (!(*len & 1)) + WRITE_CHAR (str, *len, FC_PAD); WRITE_CHAR (str, *len, FC_END); return off;
1
0
0
0
Zebediah Figura : rpcrt4: Improve struct type detection.
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: 583dca9d7231479774be92aca8a30da1d660246a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=583dca9d7231479774be92ac…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 31 23:31:17 2019 -0500 rpcrt4: Improve struct type detection. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_typelib.c | 92 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 17 deletions(-) diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c index c756682..8f87693 100644 --- a/dlls/rpcrt4/ndr_typelib.c +++ b/dlls/rpcrt4/ndr_typelib.c @@ -231,34 +231,92 @@ static BOOL type_pointer_is_iface(ITypeInfo *typeinfo, TYPEDESC *tdesc) } static unsigned char get_array_fc(ITypeInfo *typeinfo, TYPEDESC *desc); +static unsigned char get_struct_fc(ITypeInfo *typeinfo, TYPEATTR *attr); -static unsigned char get_struct_fc(ITypeInfo *typeinfo, TYPEATTR *attr) +static unsigned char get_struct_member_fc(ITypeInfo *typeinfo, TYPEDESC *tdesc) { - unsigned char fc = FC_STRUCT; - VARDESC *desc; - VARTYPE vt; - WORD i; + unsigned char fc; + ITypeInfo *refinfo; + TYPEATTR *attr; - for (i = 0; i < attr->cVars; i++) + switch (tdesc->vt) { - ITypeInfo_GetVarDesc(typeinfo, i, &desc); - vt = desc->elemdescVar.tdesc.vt; + case VT_BSTR: + case VT_SAFEARRAY: + return (sizeof(void *) == 4) ? FC_PSTRUCT : FC_BOGUS_STRUCT; + case VT_CY: + return FC_STRUCT; + case VT_UNKNOWN: + case VT_DISPATCH: + return FC_BOGUS_STRUCT; + case VT_CARRAY: + if (get_array_fc(typeinfo, &tdesc->lpadesc->tdescElem) == FC_BOGUS_ARRAY) + return FC_BOGUS_STRUCT; + return FC_STRUCT; + case VT_PTR: + if (type_pointer_is_iface(typeinfo, tdesc)) + fc = FC_BOGUS_STRUCT; + else + fc = (sizeof(void *) == 4) ? FC_PSTRUCT : FC_BOGUS_STRUCT; + break; + case VT_USERDEFINED: + ITypeInfo_GetRefTypeInfo(typeinfo, tdesc->hreftype, &refinfo); + ITypeInfo_GetTypeAttr(refinfo, &attr); - switch (vt) + switch (attr->typekind) { - case VT_CARRAY: - if (get_array_fc(typeinfo, &desc->elemdescVar.tdesc.lpadesc->tdescElem) == FC_BOGUS_ARRAY) - fc = FC_BOGUS_STRUCT; + case TKIND_ENUM: + fc = FC_STRUCT; + break; + case TKIND_RECORD: + fc = get_struct_fc(refinfo, attr); + break; + case TKIND_INTERFACE: + case TKIND_DISPATCH: + case TKIND_COCLASS: + fc = FC_BOGUS_STRUCT; + break; + case TKIND_ALIAS: + fc = get_struct_member_fc(refinfo, &attr->tdescAlias); break; default: - if (!get_basetype(typeinfo, &desc->elemdescVar.tdesc)) - { - FIXME("unhandled type %u\n", vt); - fc = FC_BOGUS_STRUCT; - } + FIXME("Unhandled kind %#x.\n", attr->typekind); + fc = FC_BOGUS_STRUCT; break; } + ITypeInfo_ReleaseTypeAttr(refinfo, attr); + ITypeInfo_Release(refinfo); + break; + default: + if (get_basetype(typeinfo, tdesc)) + return FC_STRUCT; + else + { + FIXME("Unhandled type %u.\n", tdesc->vt); + return FC_BOGUS_STRUCT; + } + } + + return fc; +} + +static unsigned char get_struct_fc(ITypeInfo *typeinfo, TYPEATTR *attr) +{ + unsigned char fc = FC_STRUCT, member_fc; + VARDESC *desc; + WORD i; + + for (i = 0; i < attr->cVars; i++) + { + ITypeInfo_GetVarDesc(typeinfo, i, &desc); + + member_fc = get_struct_member_fc(typeinfo, &desc->elemdescVar.tdesc); + if (member_fc == FC_BOGUS_STRUCT) + fc = FC_BOGUS_STRUCT; + else if (member_fc == FC_PSTRUCT && fc != FC_BOGUS_STRUCT) + fc = FC_PSTRUCT; + ITypeInfo_ReleaseVarDesc(typeinfo, desc); }
1
0
0
0
Zebediah Figura : rpcrt4: Abort if an interface is passed directly to write_type_tfs().
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: 81745dfd082cc9156c3b1d5d04d05cabc90a9998 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=81745dfd082cc9156c3b1d5d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 31 23:31:16 2019 -0500 rpcrt4: Abort if an interface is passed directly to write_type_tfs(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_typelib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c index 963a119..c756682 100644 --- a/dlls/rpcrt4/ndr_typelib.c +++ b/dlls/rpcrt4/ndr_typelib.c @@ -497,6 +497,11 @@ static size_t write_type_tfs(ITypeInfo *typeinfo, unsigned char *str, case TKIND_RECORD: off = write_struct_tfs(refinfo, str, len, attr); break; + case TKIND_INTERFACE: + case TKIND_DISPATCH: + case TKIND_COCLASS: + assert(0); + break; case TKIND_ALIAS: off = write_type_tfs(refinfo, str, len, &attr->tdescAlias, toplevel, onstack); break;
1
0
0
0
Zebediah Figura : rpcrt4: Handle TKIND_ALIAS in more places.
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: c73988178f834ba7fb9ca40f3da05d26d6a7a5c7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c73988178f834ba7fb9ca40f…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 31 23:31:15 2019 -0500 rpcrt4: Handle TKIND_ALIAS in more places. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_typelib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c index f182f1a..963a119 100644 --- a/dlls/rpcrt4/ndr_typelib.c +++ b/dlls/rpcrt4/ndr_typelib.c @@ -220,6 +220,8 @@ static BOOL type_pointer_is_iface(ITypeInfo *typeinfo, TYPEDESC *tdesc) || attr->typekind == TKIND_DISPATCH || attr->typekind == TKIND_COCLASS) ret = TRUE; + else if (attr->typekind == TKIND_ALIAS) + ret = type_pointer_is_iface(refinfo, &attr->tdescAlias); ITypeInfo_ReleaseTypeAttr(refinfo, attr); ITypeInfo_Release(refinfo); @@ -280,6 +282,8 @@ static unsigned char get_array_fc(ITypeInfo *typeinfo, TYPEDESC *desc) fc = FC_LGFARRAY; else if (attr->typekind == TKIND_RECORD && get_struct_fc(refinfo, attr) == FC_STRUCT) fc = FC_LGFARRAY; + else if (attr->typekind == TKIND_ALIAS) + fc = get_array_fc(refinfo, &attr->tdescAlias); else fc = FC_BOGUS_ARRAY; @@ -493,6 +497,9 @@ static size_t write_type_tfs(ITypeInfo *typeinfo, unsigned char *str, case TKIND_RECORD: off = write_struct_tfs(refinfo, str, len, attr); break; + case TKIND_ALIAS: + off = write_type_tfs(refinfo, str, len, &attr->tdescAlias, toplevel, onstack); + break; default: FIXME("unhandled kind %u\n", attr->typekind); off = *len;
1
0
0
0
Zebediah Figura : rpcrt4: Factor out type_pointer_is_iface().
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: 7eb670825188969dda42790d187210fad601f8b8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7eb670825188969dda42790d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 31 23:31:14 2019 -0500 rpcrt4: Factor out type_pointer_is_iface(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_typelib.c | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c index d8c429b..f182f1a 100644 --- a/dlls/rpcrt4/ndr_typelib.c +++ b/dlls/rpcrt4/ndr_typelib.c @@ -205,6 +205,29 @@ static unsigned int type_memsize(ITypeInfo *typeinfo, TYPEDESC *desc) } } +static BOOL type_pointer_is_iface(ITypeInfo *typeinfo, TYPEDESC *tdesc) +{ + ITypeInfo *refinfo; + BOOL ret = FALSE; + TYPEATTR *attr; + + if (tdesc->vt == VT_USERDEFINED) + { + ITypeInfo_GetRefTypeInfo(typeinfo, tdesc->hreftype, &refinfo); + ITypeInfo_GetTypeAttr(refinfo, &attr); + + if (attr->typekind == TKIND_INTERFACE + || attr->typekind == TKIND_DISPATCH + || attr->typekind == TKIND_COCLASS) + ret = TRUE; + + ITypeInfo_ReleaseTypeAttr(refinfo, attr); + ITypeInfo_Release(refinfo); + } + + return ret; +} + static unsigned char get_array_fc(ITypeInfo *typeinfo, TYPEDESC *desc); static unsigned char get_struct_fc(ITypeInfo *typeinfo, TYPEATTR *attr) @@ -530,26 +553,10 @@ static HRESULT get_param_pointer_info(ITypeInfo *typeinfo, TYPEDESC *tdesc, int break; case VT_PTR: *flags |= MustFree; - - if (tdesc->lptdesc->vt == VT_USERDEFINED) + if (type_pointer_is_iface(typeinfo, tdesc->lptdesc)) { - ITypeInfo_GetRefTypeInfo(typeinfo, tdesc->lptdesc->hreftype, &refinfo); - ITypeInfo_GetTypeAttr(refinfo, &attr); - - switch (attr->typekind) - { - case TKIND_INTERFACE: - case TKIND_DISPATCH: - case TKIND_COCLASS: - if (is_in && is_out) - *server_size = sizeof(void *); - break; - default: + if (is_in && is_out) *server_size = sizeof(void *); - } - - ITypeInfo_ReleaseTypeAttr(refinfo, attr); - ITypeInfo_Release(refinfo); } else *server_size = sizeof(void *);
1
0
0
0
Zebediah Figura : rpcrt4: Detect enums and aliases in get_base_type().
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: d97b421b92665b33d0b5e15960b10522eaadb2eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d97b421b92665b33d0b5e159…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 31 23:31:13 2019 -0500 rpcrt4: Detect enums and aliases in get_base_type(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_typelib.c | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c index 8a08ad9..d8c429b 100644 --- a/dlls/rpcrt4/ndr_typelib.c +++ b/dlls/rpcrt4/ndr_typelib.c @@ -106,9 +106,13 @@ static unsigned short write_oleaut_tfs(VARTYPE vt) return 0; } -static unsigned char get_base_type(VARTYPE vt) +static unsigned char get_basetype(ITypeInfo *typeinfo, TYPEDESC *desc) { - switch (vt) + ITypeInfo *refinfo; + unsigned char ret; + TYPEATTR *attr; + + switch (desc->vt) { case VT_I1: return FC_SMALL; case VT_BOOL: @@ -126,6 +130,18 @@ static unsigned char get_base_type(VARTYPE vt) case VT_R4: return FC_FLOAT; case VT_DATE: case VT_R8: return FC_DOUBLE; + case VT_USERDEFINED: + ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo); + ITypeInfo_GetTypeAttr(refinfo, &attr); + if (attr->typekind == TKIND_ENUM) + ret = FC_ENUM32; + else if (attr->typekind == TKIND_ALIAS) + ret = get_basetype(refinfo, &attr->tdescAlias); + else + ret = 0; + ITypeInfo_ReleaseTypeAttr(refinfo, attr); + ITypeInfo_Release(refinfo); + return ret; default: return 0; } } @@ -210,7 +226,7 @@ static unsigned char get_struct_fc(ITypeInfo *typeinfo, TYPEATTR *attr) fc = FC_BOGUS_STRUCT; break; default: - if (!get_base_type(vt)) + if (!get_basetype(typeinfo, &desc->elemdescVar.tdesc)) { FIXME("unhandled type %u\n", vt); fc = FC_BOGUS_STRUCT; @@ -226,7 +242,7 @@ static unsigned char get_struct_fc(ITypeInfo *typeinfo, TYPEATTR *attr) static unsigned char get_array_fc(ITypeInfo *typeinfo, TYPEDESC *desc) { - if (get_base_type(desc->vt)) + if (get_basetype(typeinfo, desc)) return FC_LGFARRAY; else if (desc->vt == VT_USERDEFINED) { @@ -283,7 +299,7 @@ static size_t write_array_tfs(ITypeInfo *typeinfo, unsigned char *str, if (fc != FC_LGFARRAY) FIXME("complex arrays not implemented\n"); - if (!(basetype = get_base_type(desc->tdescElem.vt))) + if (!(basetype = get_basetype(typeinfo, &desc->tdescElem))) ref = write_type_tfs(typeinfo, str, len, &desc->tdescElem, FALSE, FALSE); /* In theory arrays should be nested, but there's no reason not to marshal @@ -401,7 +417,7 @@ static size_t write_pointer_tfs(ITypeInfo *typeinfo, unsigned char *str, ITypeInfo_ReleaseTypeAttr(refinfo, attr); ITypeInfo_Release(refinfo); } - else if ((basetype = get_base_type(desc->vt))) + else if ((basetype = get_basetype(typeinfo, desc))) { assert(!toplevel); /* toplevel base-type pointers should use IsSimpleRef */ WRITE_CHAR(str, *len, FC_UP); @@ -466,7 +482,7 @@ static size_t write_type_tfs(ITypeInfo *typeinfo, unsigned char *str, break; default: /* base types are always embedded directly */ - assert(!get_base_type(desc->vt)); + assert(!get_basetype(typeinfo, desc)); FIXME("unhandled type %u\n", desc->vt); off = *len; WRITE_SHORT(str, *len, 0); @@ -584,7 +600,7 @@ static HRESULT get_param_pointer_info(ITypeInfo *typeinfo, TYPEDESC *tdesc, int *tfs_tdesc = tdesc; if (!is_in && is_out) *server_size = type_memsize(typeinfo, tdesc); - if ((*basetype = get_base_type(tdesc->vt))) + if ((*basetype = get_basetype(typeinfo, tdesc))) *flags |= IsBasetype; break; } @@ -662,7 +678,7 @@ static HRESULT get_param_info(ITypeInfo *typeinfo, TYPEDESC *tdesc, int is_in, ITypeInfo_Release(refinfo); break; default: - if ((*basetype = get_base_type(tdesc->vt))) + if ((*basetype = get_basetype(typeinfo, tdesc))) *flags |= IsBasetype; else { @@ -749,7 +765,7 @@ static void write_proc_func_header(ITypeInfo *typeinfo, FUNCDESC *desc, WRITE_SHORT(proc, *proclen, 0); /* NotifyIndex */ for (param_idx = 0; param_idx < desc->cParams && param_idx < 3; param_idx++) { - basetype = get_base_type(desc->lprgelemdescParam[param_idx].tdesc.vt); + basetype = get_basetype(typeinfo, &desc->lprgelemdescParam[param_idx].tdesc); if (basetype == FC_FLOAT) float_mask |= (1 << ((param_idx + 1) * 2)); else if (basetype == FC_DOUBLE)
1
0
0
0
Vijay Kiran Kamuju : uianimation: Add stub dll.
by Alexandre Julliard
01 Apr '19
01 Apr '19
Module: wine Branch: master Commit: 9a562d963f3994c9ee61ae5181133895147aabac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9a562d963f3994c9ee61ae51…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Fri Mar 29 23:05:20 2019 +0100 uianimation: Add stub dll. Based on a patch from Louis Lenders Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 2 ++ configure.ac | 1 + dlls/uianimation/Makefile.in | 4 ++++ dlls/uianimation/main.c | 46 +++++++++++++++++++++++++++++++++++++++ dlls/uianimation/uianimation.spec | 4 ++++ 5 files changed, 57 insertions(+) diff --git a/configure b/configure index 44d97a8..6f9013c 100755 --- a/configure +++ b/configure @@ -1564,6 +1564,7 @@ enable_traffic enable_twain_32 enable_tzres enable_ucrtbase +enable_uianimation enable_uiautomationcore enable_uiribbon enable_unicows @@ -19970,6 +19971,7 @@ wine_fn_config_makefile dlls/typelib.dll16 enable_win16 wine_fn_config_makefile dlls/tzres enable_tzres wine_fn_config_makefile dlls/ucrtbase enable_ucrtbase wine_fn_config_makefile dlls/ucrtbase/tests enable_tests +wine_fn_config_makefile dlls/uianimation enable_uianimation wine_fn_config_makefile dlls/uiautomationcore enable_uiautomationcore wine_fn_config_makefile dlls/uiautomationcore/tests enable_tests wine_fn_config_makefile dlls/uiribbon enable_uiribbon diff --git a/configure.ac b/configure.ac index d5640ed..6c72566 100644 --- a/configure.ac +++ b/configure.ac @@ -3691,6 +3691,7 @@ WINE_CONFIG_MAKEFILE(dlls/typelib.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/tzres) WINE_CONFIG_MAKEFILE(dlls/ucrtbase) WINE_CONFIG_MAKEFILE(dlls/ucrtbase/tests) +WINE_CONFIG_MAKEFILE(dlls/uianimation) WINE_CONFIG_MAKEFILE(dlls/uiautomationcore) WINE_CONFIG_MAKEFILE(dlls/uiautomationcore/tests) WINE_CONFIG_MAKEFILE(dlls/uiribbon) diff --git a/dlls/uianimation/Makefile.in b/dlls/uianimation/Makefile.in new file mode 100644 index 0000000..b504181 --- /dev/null +++ b/dlls/uianimation/Makefile.in @@ -0,0 +1,4 @@ +MODULE = uianimation.dll + +C_SRCS = \ + main.c diff --git a/dlls/uianimation/main.c b/dlls/uianimation/main.c new file mode 100644 index 0000000..0fa9bfb --- /dev/null +++ b/dlls/uianimation/main.c @@ -0,0 +1,46 @@ +/* + * Uianimation main file. + * + * Copyright (C) 2018 Louis Lenders + * + * 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 + */ + +#include "config.h" +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" + +#include "uianimation.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(uianimation); + +BOOL WINAPI DllMain( HINSTANCE dll, DWORD reason, LPVOID reserved ) +{ + TRACE("(%p %d %p)\n", dll, reason, reserved); + + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( dll ); + break; + } + return TRUE; +} diff --git a/dlls/uianimation/uianimation.spec b/dlls/uianimation/uianimation.spec new file mode 100644 index 0000000..a43b12d --- /dev/null +++ b/dlls/uianimation/uianimation.spec @@ -0,0 +1,4 @@ +@ stub DllCanUnloadNow() +@ stub DllGetClassObject(ptr ptr ptr) +@ stub DllRegisterServer() +@ stub DllUnregisterServer()
1
0
0
0
← Newer
1
...
74
75
76
77
78
79
80
81
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
Results per page:
10
25
50
100
200