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
January 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
2 participants
499 discussions
Start a n
N
ew thread
Zebediah Figura : wined3d: Store pixel shader boolean constants in the wined3d_stateblock_state structure.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: c1f6c489c14529b99fceb6523804ce82bb5f2d49 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c1f6c489c14529b99fceb652…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 28 23:09:13 2019 -0600 wined3d: Store pixel shader boolean constants in the wined3d_stateblock_state structure. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 17 +++++++++-------- dlls/wined3d/stateblock.c | 8 +++++--- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d0e9d59..2c22331 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2610,23 +2610,24 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, if (count > WINED3D_MAX_CONSTS_B - start_idx) count = WINED3D_MAX_CONSTS_B - start_idx; - memcpy(&device->update_state->ps_consts_b[start_idx], constants, count * sizeof(*constants)); - if (TRACE_ON(d3d)) - { - for (i = 0; i < count; ++i) - TRACE("Set BOOL constant %u to %#x.\n", start_idx + i, constants[i]); - } + memcpy(&device->update_stateblock_state->ps_consts_b[start_idx], constants, count * sizeof(*constants)); if (device->recording) { for (i = start_idx; i < count + start_idx; ++i) device->recording->changed.pixelShaderConstantsB |= (1u << i); + return WINED3D_OK; } - else + + memcpy(&device->state.ps_consts_b[start_idx], constants, count * sizeof(*constants)); + if (TRACE_ON(d3d)) { - wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_B, start_idx, count, constants); + for (i = 0; i < count; ++i) + TRACE("Set BOOL constant %u to %#x.\n", start_idx + i, constants[i]); } + wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_B, start_idx, count, constants); + return WINED3D_OK; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 340578c..a87e3eb 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -762,10 +762,11 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) for (i = 0; i < stateblock->num_contained_ps_consts_b; ++i) { unsigned int idx = stateblock->contained_ps_consts_b[i]; + TRACE("Setting ps_consts_b[%u] to %s.\n", - idx, src_state->ps_consts_b[idx] ? "TRUE" : "FALSE"); + idx, state->ps_consts_b[idx] ? "TRUE" : "FALSE"); - stateblock->state.ps_consts_b[idx] = src_state->ps_consts_b[idx]; + stateblock->stateblock_state.ps_consts_b[idx] = state->ps_consts_b[idx]; } /* Others + Render & Texture */ @@ -1057,8 +1058,9 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) } for (i = 0; i < stateblock->num_contained_ps_consts_b; ++i) { + state->ps_consts_b[i] = stateblock->stateblock_state.ps_consts_b[i]; wined3d_device_set_ps_consts_b(device, stateblock->contained_ps_consts_b[i], - 1, &stateblock->state.ps_consts_b[stateblock->contained_ps_consts_b[i]]); + 1, &stateblock->stateblock_state.ps_consts_b[stateblock->contained_ps_consts_b[i]]); } /* Render states. */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 227b7fb..c347018 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2978,6 +2978,7 @@ struct wined3d_stateblock_state struct wined3d_shader *ps; struct wined3d_vec4 ps_consts_f[WINED3D_MAX_PS_CONSTS_F]; struct wined3d_ivec4 ps_consts_i[WINED3D_MAX_CONSTS_I]; + BOOL ps_consts_b[WINED3D_MAX_CONSTS_B]; }; struct wined3d_device
1
0
0
0
Zebediah Figura : wined3d: Store pixel shader integer constants in the wined3d_stateblock_state structure.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: c49ff2ce74f0b8be4665d5de0187b5449b5384fc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c49ff2ce74f0b8be4665d5de…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 28 23:09:12 2019 -0600 wined3d: Store pixel shader integer constants in the wined3d_stateblock_state structure. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 17 +++++++++-------- dlls/wined3d/stateblock.c | 7 ++++--- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 18c775a..d0e9d59 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2659,23 +2659,24 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, if (count > WINED3D_MAX_CONSTS_I - start_idx) count = WINED3D_MAX_CONSTS_I - start_idx; - memcpy(&device->update_state->ps_consts_i[start_idx], constants, count * sizeof(*constants)); - if (TRACE_ON(d3d)) - { - for (i = 0; i < count; ++i) - TRACE("Set ivec4 constant %u to %s.\n", start_idx + i, debug_ivec4(&constants[i])); - } + memcpy(&device->update_stateblock_state->ps_consts_i[start_idx], constants, count * sizeof(*constants)); if (device->recording) { for (i = start_idx; i < count + start_idx; ++i) device->recording->changed.pixelShaderConstantsI |= (1u << i); + return WINED3D_OK; } - else + + memcpy(&device->state.ps_consts_i[start_idx], constants, count * sizeof(*constants)); + if (TRACE_ON(d3d)) { - wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_I, start_idx, count, constants); + for (i = 0; i < count; ++i) + TRACE("Set ivec4 constant %u to %s.\n", start_idx + i, debug_ivec4(&constants[i])); } + wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_I, start_idx, count, constants); + return WINED3D_OK; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 05d213b..340578c 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -753,9 +753,9 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) { unsigned int idx = stateblock->contained_ps_consts_i[i]; - TRACE("Setting ps_consts_i[%u] to %s.\n", idx, debug_ivec4(&src_state->ps_consts_i[idx])); + TRACE("Setting ps_consts_i[%u] to %s.\n", idx, debug_ivec4(&state->ps_consts_i[idx])); - stateblock->state.ps_consts_i[idx] = src_state->ps_consts_i[idx]; + stateblock->stateblock_state.ps_consts_i[idx] = state->ps_consts_i[idx]; } /* Pixel shader boolean constants. */ @@ -1051,8 +1051,9 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) } for (i = 0; i < stateblock->num_contained_ps_consts_i; ++i) { + state->ps_consts_i[i] = stateblock->stateblock_state.ps_consts_i[i]; wined3d_device_set_ps_consts_i(device, stateblock->contained_ps_consts_i[i], - 1, &stateblock->state.ps_consts_i[stateblock->contained_ps_consts_i[i]]); + 1, &stateblock->stateblock_state.ps_consts_i[stateblock->contained_ps_consts_i[i]]); } for (i = 0; i < stateblock->num_contained_ps_consts_b; ++i) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6822874..227b7fb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2977,6 +2977,7 @@ struct wined3d_stateblock_state struct wined3d_shader *ps; struct wined3d_vec4 ps_consts_f[WINED3D_MAX_PS_CONSTS_F]; + struct wined3d_ivec4 ps_consts_i[WINED3D_MAX_CONSTS_I]; }; struct wined3d_device
1
0
0
0
Zebediah Figura : wined3d: Store pixel shader floating point constants in the wined3d_stateblock_state structure.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: 3a5d7487d5a5f00598db1bb433a53677d104b5e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3a5d7487d5a5f00598db1bb4…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 28 23:09:11 2019 -0600 wined3d: Store pixel shader floating point constants in the wined3d_stateblock_state structure. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 16 ++++++++++------ dlls/wined3d/stateblock.c | 7 ++++--- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 28e113a..18c775a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2708,18 +2708,22 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, || count > d3d_info->limits.ps_uniform_count - start_idx) return WINED3DERR_INVALIDCALL; - memcpy(&device->update_state->ps_consts_f[start_idx], constants, count * sizeof(*constants)); + memcpy(&device->update_stateblock_state->ps_consts_f[start_idx], constants, count * sizeof(*constants)); + if (device->recording) + { + memset(&device->recording->changed.ps_consts_f[start_idx], 1, + count * sizeof(*device->recording->changed.ps_consts_f)); + return WINED3D_OK; + } + + memcpy(&device->state.ps_consts_f[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { for (i = 0; i < count; ++i) TRACE("Set vec4 constant %u to %s.\n", start_idx + i, debug_vec4(&constants[i])); } - if (device->recording) - memset(&device->recording->changed.ps_consts_f[start_idx], 1, - count * sizeof(*device->recording->changed.ps_consts_f)); - else - wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_F, start_idx, count, constants); + wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_F, start_idx, count, constants); return WINED3D_OK; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 2b916a9..05d213b 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -743,9 +743,9 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) { unsigned int idx = stateblock->contained_ps_consts_f[i]; - TRACE("Setting ps_consts_f[%u] to %s.\n", idx, debug_vec4(&src_state->ps_consts_f[idx])); + TRACE("Setting ps_consts_f[%u] to %s.\n", idx, debug_vec4(&state->ps_consts_f[idx])); - stateblock->state.ps_consts_f[idx] = src_state->ps_consts_f[idx]; + stateblock->stateblock_state.ps_consts_f[idx] = state->ps_consts_f[idx]; } /* Pixel shader integer constants. */ @@ -1045,8 +1045,9 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) /* Pixel Shader Constants. */ for (i = 0; i < stateblock->num_contained_ps_consts_f; ++i) { + state->ps_consts_f[i] = stateblock->stateblock_state.ps_consts_f[i]; wined3d_device_set_ps_consts_f(device, stateblock->contained_ps_consts_f[i], - 1, &stateblock->state.ps_consts_f[stateblock->contained_ps_consts_f[i]]); + 1, &stateblock->stateblock_state.ps_consts_f[stateblock->contained_ps_consts_f[i]]); } for (i = 0; i < stateblock->num_contained_ps_consts_i; ++i) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b638d87..6822874 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2976,6 +2976,7 @@ struct wined3d_stateblock_state BOOL vs_consts_b[WINED3D_MAX_CONSTS_B]; struct wined3d_shader *ps; + struct wined3d_vec4 ps_consts_f[WINED3D_MAX_PS_CONSTS_F]; }; struct wined3d_device
1
0
0
0
Jacek Caban : widl: Check function return values for additional prototype types.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: 759a3bf34d004a841f8fd49915fac339c1a1efb8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=759a3bf34d004a841f8fd499…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jan 29 15:46:30 2019 +0100 widl: Check function return values for additional prototype types. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/header.c | 135 ++++++++++++++++++++++++------------------------- tools/widl/parser.y | 6 ++- tools/widl/widltypes.h | 2 +- 3 files changed, 71 insertions(+), 72 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index ef141d9..f618e02 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -637,82 +637,77 @@ unsigned int get_generic_handle_offset( const type_t *type ) /* check for types which require additional prototypes to be generated in the * header */ -void check_for_additional_prototype_types(const var_list_t *list) -{ - const var_t *v; - - if (!list) return; - LIST_FOR_EACH_ENTRY( v, list, const var_t, entry ) - { - type_t *type = v->type; - if (!type) continue; - for (;;) { - const char *name = type->name; - if (type->user_types_registered) break; - type->user_types_registered = 1; - if (is_attr(type->attrs, ATTR_CONTEXTHANDLE)) { - if (!context_handle_registered(name)) - { - context_handle_t *ch = xmalloc(sizeof(*ch)); - ch->name = xstrdup(name); - list_add_tail(&context_handle_list, &ch->entry); - } - /* don't carry on parsing fields within this type */ - break; - } - if ((type_get_type(type) != TYPE_BASIC || - type_basic_get_type(type) != TYPE_BASIC_HANDLE) && - is_attr(type->attrs, ATTR_HANDLE)) { - if (!generic_handle_registered(name)) - { - generic_handle_t *gh = xmalloc(sizeof(*gh)); - gh->name = xstrdup(name); - list_add_tail(&generic_handle_list, &gh->entry); - } - /* don't carry on parsing fields within this type */ - break; +void check_for_additional_prototype_types(type_t *type) +{ + if (!type) return; + for (;;) { + const char *name = type->name; + if (type->user_types_registered) break; + type->user_types_registered = 1; + if (is_attr(type->attrs, ATTR_CONTEXTHANDLE)) { + if (!context_handle_registered(name)) + { + context_handle_t *ch = xmalloc(sizeof(*ch)); + ch->name = xstrdup(name); + list_add_tail(&context_handle_list, &ch->entry); } - if (is_attr(type->attrs, ATTR_WIREMARSHAL)) { - if (!user_type_registered(name)) - { - user_type_t *ut = xmalloc(sizeof *ut); - ut->name = xstrdup(name); - list_add_tail(&user_type_list, &ut->entry); - } - /* don't carry on parsing fields within this type as we are already - * using a wire marshaled type */ - break; + /* don't carry on parsing fields within this type */ + break; + } + if ((type_get_type(type) != TYPE_BASIC || + type_basic_get_type(type) != TYPE_BASIC_HANDLE) && + is_attr(type->attrs, ATTR_HANDLE)) { + if (!generic_handle_registered(name)) + { + generic_handle_t *gh = xmalloc(sizeof(*gh)); + gh->name = xstrdup(name); + list_add_tail(&generic_handle_list, &gh->entry); } - else if (type_is_complete(type)) + /* don't carry on parsing fields within this type */ + break; + } + if (is_attr(type->attrs, ATTR_WIREMARSHAL)) { + if (!user_type_registered(name)) { - var_list_t *vars; - switch (type_get_type_detect_alias(type)) - { - case TYPE_ENUM: - vars = type_enum_get_values(type); - break; - case TYPE_STRUCT: - vars = type_struct_get_fields(type); - break; - case TYPE_UNION: - vars = type_union_get_cases(type); - break; - default: - vars = NULL; - break; - } - check_for_additional_prototype_types(vars); + user_type_t *ut = xmalloc(sizeof *ut); + ut->name = xstrdup(name); + list_add_tail(&user_type_list, &ut->entry); } - - if (type_is_alias(type)) - type = type_alias_get_aliasee(type); - else if (is_ptr(type)) - type = type_pointer_get_ref(type); - else if (is_array(type)) - type = type_array_get_element(type); - else + /* don't carry on parsing fields within this type as we are already + * using a wire marshaled type */ + break; + } + else if (type_is_complete(type)) + { + var_list_t *vars; + const var_t *v; + switch (type_get_type_detect_alias(type)) + { + case TYPE_ENUM: + vars = type_enum_get_values(type); + break; + case TYPE_STRUCT: + vars = type_struct_get_fields(type); + break; + case TYPE_UNION: + vars = type_union_get_cases(type); + break; + default: + vars = NULL; break; + } + if (vars) LIST_FOR_EACH_ENTRY( v, vars, const var_t, entry ) + check_for_additional_prototype_types(v->type); } + + if (type_is_alias(type)) + type = type_alias_get_aliasee(type); + else if (is_ptr(type)) + type = type_pointer_get_ref(type); + else if (is_array(type)) + type = type_array_get_element(type); + else + break; } } diff --git a/tools/widl/parser.y b/tools/widl/parser.y index d979394..5156dce 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -2911,6 +2911,7 @@ static void check_statements(const statement_list_t *stmts, int is_inside_librar static void check_all_user_types(const statement_list_t *stmts) { const statement_t *stmt; + const var_t *v; if (stmts) LIST_FOR_EACH_ENTRY(stmt, stmts, const statement_t, entry) { @@ -2922,7 +2923,10 @@ static void check_all_user_types(const statement_list_t *stmts) const statement_t *stmt_func; STATEMENTS_FOR_EACH_FUNC(stmt_func, type_iface_get_stmts(stmt->u.type)) { const var_t *func = stmt_func->u.var; - check_for_additional_prototype_types(func->type->details.function->args); + if (func->type->details.function->args) + LIST_FOR_EACH_ENTRY( v, func->type->details.function->args, const var_t, entry ) + check_for_additional_prototype_types(v->type); + check_for_additional_prototype_types(type_function_get_rettype(func->type)); } } } diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 37792b2..afca4c0 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -556,7 +556,7 @@ typedef enum { extern user_type_list_t user_type_list; extern context_handle_list_t context_handle_list; extern generic_handle_list_t generic_handle_list; -void check_for_additional_prototype_types(const var_list_t *list); +void check_for_additional_prototype_types(type_t *type); void init_types(void); type_t *alloc_type(void);
1
0
0
0
Hans Leidekker : winhttp: Implement WINHTTP_OPTION_CLIENT_CERT_CONTEXT.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: c68b5eb8500055c623486ad0b626a5f7691bfa89 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c68b5eb8500055c623486ad0…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jan 29 11:40:53 2019 +0100 winhttp: Implement WINHTTP_OPTION_CLIENT_CERT_CONTEXT. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/request.c | 23 +++++++++++++---------- dlls/winhttp/session.c | 32 +++++++++++++++++++++++++++++--- dlls/winhttp/winhttp_private.h | 5 +++-- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 5525c1c..af484cc 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1527,25 +1527,28 @@ static DWORD map_secure_protocols( DWORD mask ) return ret; } -static BOOL ensure_cred_handle( struct session *session ) +static BOOL ensure_cred_handle( struct request *request ) { SECURITY_STATUS status = SEC_E_OK; - if (session->cred_handle_initialized) return TRUE; + if (request->cred_handle_initialized) return TRUE; - EnterCriticalSection( &session->cs ); - if (!session->cred_handle_initialized) + if (!request->cred_handle_initialized) { SCHANNEL_CRED cred; memset( &cred, 0, sizeof(cred) ); cred.dwVersion = SCHANNEL_CRED_VERSION; - cred.grbitEnabledProtocols = map_secure_protocols( session->secure_protocols ); + cred.grbitEnabledProtocols = map_secure_protocols( request->connect->session->secure_protocols ); + if (request->client_cert) + { + cred.paCred = &request->client_cert; + cred.cCreds = 1; + } status = AcquireCredentialsHandleW( NULL, (WCHAR *)UNISP_NAME_W, SECPKG_CRED_OUTBOUND, NULL, - &cred, NULL, NULL, &session->cred_handle, NULL ); + &cred, NULL, NULL, &request->cred_handle, NULL ); if (status == SEC_E_OK) - session->cred_handle_initialized = TRUE; + request->cred_handle_initialized = TRUE; } - LeaveCriticalSection( &session->cs ); if (status != SEC_E_OK) { @@ -1686,9 +1689,9 @@ static BOOL open_connection( struct request *request ) CertFreeCertificateContext( request->server_cert ); request->server_cert = NULL; - if (!ensure_cred_handle( connect->session ) || + if (!ensure_cred_handle( request ) || !netconn_secure_connect( netconn, connect->hostname, request->security_flags, - &connect->session->cred_handle, request->check_revocation )) + &request->cred_handle, request->check_revocation )) { heap_free( addressW ); netconn_close( netconn ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 82615ad..64fa8bb 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -81,7 +81,6 @@ static void session_destroy( struct object_header *hdr ) TRACE("%p\n", session); if (session->unload_event) SetEvent( session->unload_event ); - if (session->cred_handle_initialized) FreeCredentialsHandle( &session->cred_handle ); destroy_cookies( session ); session->cs.DebugInfo->Spare[0] = 0; @@ -610,7 +609,9 @@ static void request_destroy( struct object_header *hdr ) } release_object( &request->connect->hdr ); + if (request->cred_handle_initialized) FreeCredentialsHandle( &request->cred_handle ); CertFreeCertificateContext( request->server_cert ); + CertFreeCertificateContext( request->client_cert ); destroy_authinfo( request->authinfo ); destroy_authinfo( request->proxy_authinfo ); @@ -1000,14 +1001,39 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b return TRUE; } case WINHTTP_OPTION_CLIENT_CERT_CONTEXT: + { + const CERT_CONTEXT *cert; + if (!(hdr->flags & WINHTTP_FLAG_SECURE)) { SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_STATE ); return FALSE; } - FIXME("WINHTTP_OPTION_CLIENT_CERT_CONTEXT\n"); - return TRUE; + if (!buffer) + { + CertFreeCertificateContext( request->client_cert ); + request->client_cert = NULL; + } + else if (buflen >= sizeof(cert)) + { + if (!(cert = CertDuplicateCertificateContext( buffer ))) return FALSE; + CertFreeCertificateContext( request->client_cert ); + request->client_cert = cert; + } + else + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + if (request->cred_handle_initialized) + { + FreeCredentialsHandle( &request->cred_handle ); + request->cred_handle_initialized = FALSE; + } + + return TRUE; + } case WINHTTP_OPTION_ENABLE_FEATURE: if(buflen == sizeof( DWORD ) && *(DWORD *)buffer == WINHTTP_ENABLE_SSL_REVOCATION) { diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index b46f708..38e39cb 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -92,8 +92,6 @@ struct session WCHAR *proxy_password; struct list cookie_cache; HANDLE unload_event; - CredHandle cred_handle; - BOOL cred_handle_initialized; DWORD secure_protocols; }; @@ -182,6 +180,9 @@ struct request DWORD security_flags; BOOL check_revocation; const CERT_CONTEXT *server_cert; + const CERT_CONTEXT *client_cert; + CredHandle cred_handle; + BOOL cred_handle_initialized; int resolve_timeout; int connect_timeout; int send_timeout;
1
0
0
0
Alistair Leslie-Hughes : include: Add MFSetAttributeSize/ MFSetAttributeRatio inline functions.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: cffb77e95f472c7613e69716570ff981d81397f5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cffb77e95f472c7613e69716…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Jan 29 02:31:03 2019 +0000 include: Add MFSetAttributeSize/MFSetAttributeRatio inline functions. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/mfidl.idl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/mfidl.idl b/include/mfidl.idl index 2373e41..124ae3c 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -349,3 +349,14 @@ cpp_quote("#define MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL cpp_quote("#define MF_RESOLUTION_READ 0x00010000") cpp_quote("#define MF_RESOLUTION_WRITE 0x00020000") cpp_quote("#define MF_RESOLUTION_DISABLE_LOCAL_PLUGINS 0x00000040") + +cpp_quote("#ifdef __cplusplus") +cpp_quote("static inline HRESULT MFSetAttributeSize(IMFAttributes *attributes, REFGUID key, UINT32 width, UINT32 height)") +cpp_quote("{") +cpp_quote(" return attributes->SetUINT64(key, ((UINT64)width << 32) | height);") +cpp_quote("}") +cpp_quote("static inline HRESULT MFSetAttributeRatio(IMFAttributes *attributes, REFGUID key, UINT32 numerator, UINT32 denominator)") +cpp_quote("{") +cpp_quote(" return attributes->SetUINT64(key, ((UINT64)numerator << 32) | denominator);") +cpp_quote("}") +cpp_quote("#endif")
1
0
0
0
Alistair Leslie-Hughes : mfreadwrite: Add initial tests.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: 2e4afec590a9375f55090dfc71bfb8a98a29e16e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2e4afec590a9375f55090dfc…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Jan 29 02:31:00 2019 +0000 mfreadwrite: Add initial tests. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 + configure.ac | 1 + dlls/mfreadwrite/Makefile.in | 1 + dlls/mfreadwrite/tests/Makefile.in | 5 ++ dlls/mfreadwrite/tests/mfplat.c | 109 +++++++++++++++++++++++++++++++++++++ 5 files changed, 117 insertions(+) diff --git a/configure b/configure index b3a360e..663b6dc 100755 --- a/configure +++ b/configure @@ -19692,6 +19692,7 @@ wine_fn_config_makefile dlls/mf3216 enable_mf3216 wine_fn_config_makefile dlls/mfplat enable_mfplat wine_fn_config_makefile dlls/mfplat/tests enable_tests wine_fn_config_makefile dlls/mfreadwrite enable_mfreadwrite +wine_fn_config_makefile dlls/mfreadwrite/tests enable_tests wine_fn_config_makefile dlls/mfuuid enable_mfuuid wine_fn_config_makefile dlls/mgmtapi enable_mgmtapi wine_fn_config_makefile dlls/midimap enable_midimap diff --git a/configure.ac b/configure.ac index 119c4ce..1b425d2 100644 --- a/configure.ac +++ b/configure.ac @@ -3431,6 +3431,7 @@ WINE_CONFIG_MAKEFILE(dlls/mf3216) WINE_CONFIG_MAKEFILE(dlls/mfplat) WINE_CONFIG_MAKEFILE(dlls/mfplat/tests) WINE_CONFIG_MAKEFILE(dlls/mfreadwrite) +WINE_CONFIG_MAKEFILE(dlls/mfreadwrite/tests) WINE_CONFIG_MAKEFILE(dlls/mfuuid) WINE_CONFIG_MAKEFILE(dlls/mgmtapi) WINE_CONFIG_MAKEFILE(dlls/midimap) diff --git a/dlls/mfreadwrite/Makefile.in b/dlls/mfreadwrite/Makefile.in index 7cf3a59..4b8ee82 100644 --- a/dlls/mfreadwrite/Makefile.in +++ b/dlls/mfreadwrite/Makefile.in @@ -1,4 +1,5 @@ MODULE = mfreadwrite.dll +IMPORTLIB = mfreadwrite C_SRCS = \ main.c diff --git a/dlls/mfreadwrite/tests/Makefile.in b/dlls/mfreadwrite/tests/Makefile.in new file mode 100644 index 0000000..5c906a1 --- /dev/null +++ b/dlls/mfreadwrite/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = mfreadwrite.dll +IMPORTS = ole32 mfplat mfreadwrite mfuuid + +C_SRCS = \ + mfplat.c diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c new file mode 100644 index 0000000..9f5cad6 --- /dev/null +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -0,0 +1,109 @@ +/* + * Copyright 2018 Alistair Leslie-Hughes + * + * 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 <stdarg.h> +#include <string.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" + +#include "mfapi.h" +#include "mfidl.h" +#include "mferror.h" +#include "mfreadwrite.h" + +#include "wine/test.h" + +#include "initguid.h" +DEFINE_GUID(MF_READWRITE_MMCSS_PRIORITY_AUDIO,0x273db885, 0x2de2, 0x4db2, 0xa6, 0xa7, 0xfd, 0xb6, 0x6f, 0xb4, 0x0b, 0x61); +DEFINE_GUID(MF_READWRITE_MMCSS_CLASS_AUDIO, 0x430847da, 0x0890, 0x4b0e, 0x93, 0x8c, 0x05, 0x43, 0x32, 0xc5, 0x47, 0xe1); + +static HRESULT (WINAPI *pMFCreateMFByteStreamOnStream)(IStream *stream, IMFByteStream **bytestream); + +static void init_functions(void) +{ + HMODULE mod = GetModuleHandleA("mfplat.dll"); + +#define X(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return; + X(MFCreateMFByteStreamOnStream); +#undef X +} + +static void test_MFCreateSourceReaderFromByteStream(void) +{ + static const WCHAR audio[] = {'A','u','d','i','o',0}; + IMFSourceReader *source; + IMFAttributes *attributes; + IMFByteStream *bytestream = NULL; + IStream *stream = NULL; + HRESULT hr; + + if(!pMFCreateMFByteStreamOnStream) + { + win_skip("MFCreateMFByteStreamOnStream() not found\n"); + return; + } + + hr = MFCreateAttributes( &attributes, 3 ); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IMFAttributes_SetString(attributes, &MF_READWRITE_MMCSS_CLASS_AUDIO, audio); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IMFAttributes_SetUINT32(attributes, &MF_READWRITE_MMCSS_PRIORITY_AUDIO, 0); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = pMFCreateMFByteStreamOnStream(stream, &bytestream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = MFCreateSourceReaderFromByteStream(bytestream, attributes, &source); + ok(hr == S_OK || hr == MF_E_UNSUPPORTED_BYTESTREAM_TYPE, "got 0x%08x\n", hr); + + if(stream) + IStream_Release(stream); + if(bytestream) + IMFByteStream_Release(bytestream); + IMFAttributes_Release(attributes); + if(source) + IMFSourceReader_Release(source); +} + +START_TEST(mfplat) +{ + HRESULT hr; + + CoInitialize(NULL); + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + init_functions(); + + test_MFCreateSourceReaderFromByteStream(); + + MFShutdown(); + + CoUninitialize(); +}
1
0
0
0
Zebediah Figura : hal: Implement plain queued spinlock functions on top of DPC-level ones.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: 119b9c70392ab2f19ab805718bc99e9a61044f8f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=119b9c70392ab2f19ab80571…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 28 19:21:14 2019 -0600 hal: Implement plain queued spinlock functions on top of DPC-level ones. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hal/hal.c | 31 +++++++++++++++++++++++++++++++ dlls/hal/hal.spec | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 5b3ee44..8796272 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -49,6 +49,21 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl); "pushl %eax\n\t" \ "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(8)) +extern void * WINAPI call_fastcall_func1( void *func, const void *a ); +__ASM_STDCALL_FUNC( call_fastcall_func1, 8, + "popl %ecx\n\t" + "popl %eax\n\t" + "xchgl (%esp),%ecx\n\t" + "jmp *%eax" ); + +extern void * WINAPI call_fastcall_func2( void *func, const void *a, const void *b ); +__ASM_STDCALL_FUNC( call_fastcall_func2, 12, + "popl %edx\n\t" + "popl %eax\n\t" + "popl %ecx\n\t" + "xchgl (%esp),%edx\n\t" + "jmp *%eax" ); + DEFINE_FASTCALL1_ENTRYPOINT( ExAcquireFastMutex ) VOID WINAPI DECLSPEC_HIDDEN __regs_ExAcquireFastMutex(PFAST_MUTEX FastMutex) { @@ -94,6 +109,22 @@ void WINAPI KeReleaseSpinLock( KSPIN_LOCK *lock, KIRQL irql ) TRACE("lock %p, irql %u.\n", lock, irql); KeReleaseSpinLockFromDpcLevel( lock ); } + +extern void WINAPI KeAcquireInStackQueuedSpinLockAtDpcLevel( KSPIN_LOCK *, KLOCK_QUEUE_HANDLE * ); + +DEFINE_FASTCALL2_ENTRYPOINT( KeAcquireInStackQueuedSpinLock ) +void WINAPI DECLSPEC_HIDDEN __regs_KeAcquireInStackQueuedSpinLock( KSPIN_LOCK *lock, KLOCK_QUEUE_HANDLE *queue ) +{ + call_fastcall_func2( KeAcquireInStackQueuedSpinLockAtDpcLevel, lock, queue ); +} + +extern void WINAPI KeReleaseInStackQueuedSpinLockFromDpcLevel( KLOCK_QUEUE_HANDLE * ); + +DEFINE_FASTCALL1_ENTRYPOINT( KeReleaseInStackQueuedSpinLock ) +void WINAPI DECLSPEC_HIDDEN __regs_KeReleaseInStackQueuedSpinLock( KLOCK_QUEUE_HANDLE *queue ) +{ + call_fastcall_func1( KeReleaseInStackQueuedSpinLockFromDpcLevel, queue ); +} #endif /* __i386__ */ #if defined(__i386__) || defined(__arm__) || defined(__aarch64__) diff --git a/dlls/hal/hal.spec b/dlls/hal/hal.spec index b4ec512..16822fc 100644 --- a/dlls/hal/hal.spec +++ b/dlls/hal/hal.spec @@ -4,12 +4,12 @@ @ stub HalClearSoftwareInterrupt @ stub HalRequestSoftwareInterrupt @ stub HalSystemVectorDispatchEntry -@ stdcall -norelay KeAcquireInStackQueuedSpinLock(ptr ptr) ntoskrnl.exe.KeAcquireInStackQueuedSpinLock +@ stdcall -arch=i386 -norelay KeAcquireInStackQueuedSpinLock(ptr ptr) @ stub KeAcquireInStackQueuedSpinLockRaiseToSynch @ stub KeAcquireQueuedSpinLock @ stub KeAcquireQueuedSpinLockRaiseToSynch @ stub KeAcquireSpinLockRaiseToSynch -@ stdcall -norelay KeReleaseInStackQueuedSpinLock(ptr) ntoskrnl.exe.KeReleaseInStackQueuedSpinLock +@ stdcall -arch=i386 -norelay KeReleaseInStackQueuedSpinLock(ptr) @ stub KeReleaseQueuedSpinLock @ stub KeTryToAcquireQueuedSpinLock @ stub KeTryToAcquireQueuedSpinLockRaiseToSynch
1
0
0
0
Zebediah Figura : ntoskrnl.exe: Implement plain queued spinlock functions on top of DPC-level ones.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: 10dcc10a5527ec6f143ba9618c8712b09601f255 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=10dcc10a5527ec6f143ba961…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 28 19:21:13 2019 -0600 ntoskrnl.exe: Implement plain queued spinlock functions on top of DPC-level ones. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.c | 27 --------------------------- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 ++-- dlls/ntoskrnl.exe/sync.c | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index ec78f4b..9ee7543 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -3765,33 +3765,6 @@ NTSTATUS WINAPI IoCreateFile(HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBUT } /*********************************************************************** - * KeAcquireInStackQueuedSpinLock (NTOSKRNL.EXE.@) - */ -#ifdef DEFINE_FASTCALL2_ENTRYPOINT -DEFINE_FASTCALL2_ENTRYPOINT( KeAcquireInStackQueuedSpinLock ) -void WINAPI DECLSPEC_HIDDEN __regs_KeAcquireInStackQueuedSpinLock( KSPIN_LOCK *spinlock, - KLOCK_QUEUE_HANDLE *handle ) -#else -void WINAPI KeAcquireInStackQueuedSpinLock( KSPIN_LOCK *spinlock, KLOCK_QUEUE_HANDLE *handle ) -#endif -{ - FIXME( "stub: %p %p\n", spinlock, handle ); -} - -/*********************************************************************** - * KeReleaseInStackQueuedSpinLock (NTOSKRNL.EXE.@) - */ -#ifdef DEFINE_FASTCALL1_ENTRYPOINT -DEFINE_FASTCALL1_ENTRYPOINT( KeReleaseInStackQueuedSpinLock ) -void WINAPI DECLSPEC_HIDDEN __regs_KeReleaseInStackQueuedSpinLock( KLOCK_QUEUE_HANDLE *handle ) -#else -void WINAPI KeReleaseInStackQueuedSpinLock( KLOCK_QUEUE_HANDLE *handle ) -#endif -{ - FIXME( "stub: %p\n", handle ); -} - -/*********************************************************************** * IoCreateNotificationEvent (NTOSKRNL.EXE.@) */ PKEVENT WINAPI IoCreateNotificationEvent(UNICODE_STRING *name, HANDLE *handle) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 7bda160..3f57f7d 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -41,9 +41,9 @@ @ stub IoWritePartitionTable @ stdcall -norelay IofCallDriver(ptr ptr) @ stdcall -norelay IofCompleteRequest(ptr long) -@ stdcall -norelay KeAcquireInStackQueuedSpinLock(ptr ptr) +@ stdcall -arch=arm,arm64,x86_64 KeAcquireInStackQueuedSpinLock(ptr ptr) @ stdcall -norelay KeAcquireInStackQueuedSpinLockAtDpcLevel(ptr ptr) -@ stdcall -norelay KeReleaseInStackQueuedSpinLock(ptr) +@ stdcall -arch=arm,arm64,x86_64 KeReleaseInStackQueuedSpinLock(ptr) @ stdcall -norelay KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr) @ stub KeSetTimeUpdateNotifyRoutine @ stub KefAcquireSpinLockAtDpcLevel diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 4dc1fc3..46ffc581 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -498,6 +498,24 @@ KIRQL WINAPI KeAcquireSpinLockRaiseToDpc( KSPIN_LOCK *lock ) KeAcquireSpinLockAtDpcLevel( lock ); return 0; } + +/*********************************************************************** + * KeAcquireInStackQueuedSpinLock (NTOSKRNL.EXE.@) + */ +void WINAPI KeAcquireInStackQueuedSpinLock( KSPIN_LOCK *lock, KLOCK_QUEUE_HANDLE *queue ) +{ + TRACE("lock %p, queue %p.\n", lock, queue); + KeAcquireInStackQueuedSpinLockAtDpcLevel( lock, queue ); +} + +/*********************************************************************** + * KeReleaseInStackQueuedSpinLock (NTOSKRNL.EXE.@) + */ +void WINAPI KeReleaseInStackQueuedSpinLock( KLOCK_QUEUE_HANDLE *queue ) +{ + TRACE("queue %p.\n", queue); + KeReleaseInStackQueuedSpinLockFromDpcLevel( queue ); +} #endif static KSPIN_LOCK cancel_lock;
1
0
0
0
Zebediah Figura : ntoskrnl.exe: Implement DPC-level queued spinlock functions.
by Alexandre Julliard
29 Jan '19
29 Jan '19
Module: wine Branch: master Commit: c3c2a4f697c2c249a6e3376f273bf3ee74223350 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c3c2a4f697c2c249a6e3376f…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 28 19:21:12 2019 -0600 ntoskrnl.exe: Implement DPC-level queued spinlock functions. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 +-- dlls/ntoskrnl.exe/sync.c | 65 +++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 52ffc3d..7bda160 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -42,9 +42,9 @@ @ stdcall -norelay IofCallDriver(ptr ptr) @ stdcall -norelay IofCompleteRequest(ptr long) @ stdcall -norelay KeAcquireInStackQueuedSpinLock(ptr ptr) -@ stub KeAcquireInStackQueuedSpinLockAtDpcLevel +@ stdcall -norelay KeAcquireInStackQueuedSpinLockAtDpcLevel(ptr ptr) @ stdcall -norelay KeReleaseInStackQueuedSpinLock(ptr) -@ stub KeReleaseInStackQueuedSpinLockFromDpcLevel +@ stdcall -norelay KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr) @ stub KeSetTimeUpdateNotifyRoutine @ stub KefAcquireSpinLockAtDpcLevel @ stub KefReleaseSpinLockFromDpcLevel diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 2a4685c..4dc1fc3 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -414,6 +414,71 @@ void WINAPI KeReleaseSpinLockFromDpcLevel( KSPIN_LOCK *lock ) InterlockedExchangePointer( (void **)lock, 0 ); } +#define QUEUED_SPINLOCK_OWNED 0x2 + +/*********************************************************************** + * KeAcquireInStackQueuedSpinLockAtDpcLevel (NTOSKRNL.EXE.@) + */ +#ifdef DEFINE_FASTCALL2_ENTRYPOINT +DEFINE_FASTCALL2_ENTRYPOINT( KeAcquireInStackQueuedSpinLockAtDpcLevel ) +void WINAPI DECLSPEC_HIDDEN __regs_KeAcquireInStackQueuedSpinLockAtDpcLevel( KSPIN_LOCK *lock, KLOCK_QUEUE_HANDLE *queue ) +#else +void WINAPI KeAcquireInStackQueuedSpinLockAtDpcLevel( KSPIN_LOCK *lock, KLOCK_QUEUE_HANDLE *queue ) +#endif +{ + KSPIN_LOCK_QUEUE *tail; + + TRACE("lock %p, queue %p.\n", lock, queue); + + queue->LockQueue.Next = NULL; + + if (!(tail = InterlockedExchangePointer( (void **)lock, &queue->LockQueue ))) + queue->LockQueue.Lock = (KSPIN_LOCK *)((ULONG_PTR)lock | QUEUED_SPINLOCK_OWNED); + else + { + queue->LockQueue.Lock = lock; + InterlockedExchangePointer( (void **)&tail->Next, &queue->LockQueue ); + + while (!((ULONG_PTR)InterlockedCompareExchangePointer( (void **)&queue->LockQueue.Lock, 0, 0 ) + & QUEUED_SPINLOCK_OWNED)) + { + small_pause(); + } + } +} + +/*********************************************************************** + * KeReleaseInStackQueuedSpinLockFromDpcLevel (NTOSKRNL.EXE.@) + */ +#ifdef DEFINE_FASTCALL1_ENTRYPOINT +DEFINE_FASTCALL1_ENTRYPOINT( KeReleaseInStackQueuedSpinLockFromDpcLevel ) +void WINAPI DECLSPEC_HIDDEN __regs_KeReleaseInStackQueuedSpinLockFromDpcLevel( KLOCK_QUEUE_HANDLE *queue ) +#else +void WINAPI KeReleaseInStackQueuedSpinLockFromDpcLevel( KLOCK_QUEUE_HANDLE *queue ) +#endif +{ + KSPIN_LOCK *lock = (KSPIN_LOCK *)((ULONG_PTR)queue->LockQueue.Lock & ~QUEUED_SPINLOCK_OWNED); + KSPIN_LOCK_QUEUE *next; + + TRACE("lock %p, queue %p.\n", lock, queue); + + queue->LockQueue.Lock = NULL; + + if (!(next = queue->LockQueue.Next)) + { + /* If we are truly the last in the queue, the lock will point to us. */ + if (InterlockedCompareExchangePointer( (void **)lock, NULL, &queue->LockQueue ) == queue) + return; + + /* Otherwise, someone just queued themselves, but hasn't yet set + * themselves as successor. Spin waiting for them to do so. */ + while (!(next = queue->LockQueue.Next)) + small_pause(); + } + + InterlockedExchangePointer( (void **)&next->Lock, (KSPIN_LOCK *)((ULONG_PTR)lock | QUEUED_SPINLOCK_OWNED) ); +} + #ifndef __i386__ /*********************************************************************** * KeReleaseSpinLock (NTOSKRNL.EXE.@)
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
50
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
Results per page:
10
25
50
100
200