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
May 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
1019 discussions
Start a n
N
ew thread
Nikolay Sivov : mf: Implement node connections.
by Alexandre Julliard
08 May '19
08 May '19
Module: wine Branch: master Commit: 6b1a33ce93cc57bcc1346d09a3f8d429e3d7bd88 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6b1a33ce93cc57bcc1346d09…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed May 8 14:46:40 2019 +0300 mf: Implement node connections. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mf/tests/mf.c | 115 +++++++++++++++++++++++++- dlls/mf/topology.c | 235 ++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 308 insertions(+), 42 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=6b1a33ce93cc57bcc134…
1
0
0
0
Henri Verbeet : wined3d: Pass a wined3d_context_gl structure to context_load_tex_coords().
by Alexandre Julliard
08 May '19
08 May '19
Module: wine Branch: master Commit: 34ab198faf9990b3371c10519dfc6d0162b3953d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=34ab198faf9990b3371c1051…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed May 8 18:09:38 2019 +0430 wined3d: Pass a wined3d_context_gl structure to context_load_tex_coords(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 13 +++++++------ dlls/wined3d/state.c | 3 ++- dlls/wined3d/wined3d_private.h | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index e52e4bc..97d7656 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -5036,19 +5036,19 @@ void context_unload_tex_coords(const struct wined3d_context *context) } } -void context_load_tex_coords(const struct wined3d_context *context, const struct wined3d_stream_info *si, - GLuint *current_bo, const struct wined3d_state *state) +void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl, + const struct wined3d_stream_info *si, GLuint *current_bo, const struct wined3d_state *state) { - const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_gl_info *gl_info = context_gl->c.gl_info; const struct wined3d_format_gl *format_gl; unsigned int mapped_stage = 0; unsigned int texture_idx; - for (texture_idx = 0; texture_idx < context->d3d_info->limits.ffp_blend_stages; ++texture_idx) + for (texture_idx = 0; texture_idx < context_gl->c.d3d_info->limits.ffp_blend_stages; ++texture_idx) { unsigned int coord_idx = state->texture_states[texture_idx][WINED3D_TSS_TEXCOORD_INDEX]; - if ((mapped_stage = context->tex_unit_map[texture_idx]) == WINED3D_UNMAPPED_STAGE) + if ((mapped_stage = context_gl->c.tex_unit_map[texture_idx]) == WINED3D_UNMAPPED_STAGE) continue; if (mapped_stage >= gl_info->limits.texture_coords) @@ -5116,6 +5116,7 @@ static void context_unload_vertex_data(struct wined3d_context *context) static void context_load_vertex_data(struct wined3d_context *context, const struct wined3d_stream_info *si, const struct wined3d_state *state) { + struct wined3d_context_gl *context_gl = wined3d_context_gl(context); const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_stream_info_element *e; const struct wined3d_format_gl *format_gl; @@ -5305,7 +5306,7 @@ static void context_load_vertex_data(struct wined3d_context *context, } /* Texture coordinates */ - context_load_tex_coords(context, si, ¤t_bo, state); + wined3d_context_gl_load_tex_coords(context_gl, si, ¤t_bo, state); } static void context_unload_numbered_array(struct wined3d_context *context, unsigned int i) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 1d2ffbb..0f35f2a 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3315,6 +3315,7 @@ static void transform_texture(struct wined3d_context *context, const struct wine static void tex_coordindex(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); + struct wined3d_context_gl *context_gl = wined3d_context_gl(context); static const GLfloat s_plane[] = { 1.0f, 0.0f, 0.0f, 0.0f }; static const GLfloat t_plane[] = { 0.0f, 1.0f, 0.0f, 0.0f }; static const GLfloat r_plane[] = { 0.0f, 0.0f, 1.0f, 0.0f }; @@ -3483,7 +3484,7 @@ static void tex_coordindex(struct wined3d_context *context, const struct wined3d GLuint curVBO = gl_info->supported[ARB_VERTEX_BUFFER_OBJECT] ? ~0U : 0; context_unload_tex_coords(context); - context_load_tex_coords(context, &context->stream_info, &curVBO, state); + wined3d_context_gl_load_tex_coords(context_gl, &context->stream_info, &curVBO, state); } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index fd27c6e..a226cd4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2054,6 +2054,8 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; +void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl, + const struct wined3d_stream_info *si, GLuint *current_bo, const struct wined3d_state *state) DECLSPEC_HIDDEN; struct wined3d_fb_state { @@ -2236,8 +2238,6 @@ void context_gl_resource_released(struct wined3d_device *device, GLuint name, BOOL rb_namespace) DECLSPEC_HIDDEN; void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN; void context_invalidate_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN; -void context_load_tex_coords(const struct wined3d_context *context, const struct wined3d_stream_info *si, - GLuint *current_bo, const struct wined3d_state *state) DECLSPEC_HIDDEN; void *context_map_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, size_t size, GLenum binding, DWORD flags) DECLSPEC_HIDDEN; struct wined3d_context *context_reacquire(const struct wined3d_device *device,
1
0
0
0
Henri Verbeet : wined3d: Move the extension emulation fields from struct wined3d_context to struct wined3d_context_gl.
by Alexandre Julliard
08 May '19
08 May '19
Module: wine Branch: master Commit: d76bf253185aeb438ddcb13538551d9c36590baa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d76bf253185aeb438ddcb135…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed May 8 18:09:37 2019 +0430 wined3d: Move the extension emulation fields from struct wined3d_context to struct wined3d_context_gl. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/gl_compat.c | 241 +++++++++++++++++++++++++---------------- dlls/wined3d/wined3d_private.h | 18 +-- 2 files changed, 159 insertions(+), 100 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d76bf253185aeb438ddc…
1
0
0
0
Henri Verbeet : wined3d: Store the glEnableWINE and glDisableWINE pointers in the wined3d_gl_info structure.
by Alexandre Julliard
08 May '19
08 May '19
Module: wine Branch: master Commit: da42cf905d07613ad5243ddee16486369025eb6e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=da42cf905d07613ad5243dde…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed May 8 18:09:36 2019 +0430 wined3d: Store the glEnableWINE and glDisableWINE pointers in the wined3d_gl_info structure. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_gl.c | 4 ++-- dlls/wined3d/context.c | 2 +- dlls/wined3d/gl_compat.c | 8 ++++---- dlls/wined3d/state.c | 4 ++-- dlls/wined3d/wined3d_gl.h | 3 --- dlls/wined3d/wined3d_private.h | 3 +++ 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index b08ba62..e2cd96f 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4654,8 +4654,8 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl, } #endif - glEnableWINE = gl_info->gl_ops.gl.p_glEnable; - glDisableWINE = gl_info->gl_ops.gl.p_glDisable; + gl_info->p_glEnableWINE = gl_info->gl_ops.gl.p_glEnable; + gl_info->p_glDisableWINE = gl_info->gl_ops.gl.p_glDisable; if (!wined3d_caps_gl_ctx_create(&adapter_gl->a, &caps_gl_ctx)) { diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index eb64f14..e52e4bc 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2978,7 +2978,7 @@ void context_apply_ffp_blit_state(struct wined3d_context *context, const struct /* Other misc states. */ gl_info->gl_ops.gl.p_glDisable(GL_LIGHTING); context_invalidate_state(context, STATE_RENDER(WINED3D_RS_LIGHTING)); - glDisableWINE(GL_FOG); + gl_info->p_glDisableWINE(GL_FOG); context_invalidate_state(context, STATE_RENDER(WINED3D_RS_FOGENABLE)); if (gl_info->supported[EXT_SECONDARY_COLOR]) diff --git a/dlls/wined3d/gl_compat.c b/dlls/wined3d/gl_compat.c index 7e6b510..a2fb09c 100644 --- a/dlls/wined3d/gl_compat.c +++ b/dlls/wined3d/gl_compat.c @@ -437,10 +437,10 @@ void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_ gl_info->gl_ops.gl.p_glFogf = wine_glFogf; old_fogcoord_glFogfv = gl_info->gl_ops.gl.p_glFogfv; gl_info->gl_ops.gl.p_glFogfv = wine_glFogfv; - old_fogcoord_glEnable = glEnableWINE; - glEnableWINE = wine_glEnable; - old_fogcoord_glDisable = glDisableWINE; - glDisableWINE = wine_glDisable; + old_fogcoord_glEnable = gl_info->p_glEnableWINE; + gl_info->p_glEnableWINE = wine_glEnable; + old_fogcoord_glDisable = gl_info->p_glDisableWINE; + gl_info->p_glDisableWINE = wine_glDisable; old_fogcoord_glVertex4f = gl_info->gl_ops.gl.p_glVertex4f; gl_info->gl_ops.gl.p_glVertex4f = wine_glVertex4f; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index f2ae39e..1d2ffbb 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1125,7 +1125,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st if (!state->render_states[WINED3D_RS_FOGENABLE]) { /* No fog? Disable it, and we're done :-) */ - glDisableWINE(GL_FOG); + gl_info->p_glDisableWINE(GL_FOG); checkGLcall("glDisable GL_FOG"); return; } @@ -1262,7 +1262,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st } } - glEnableWINE(GL_FOG); + gl_info->p_glEnableWINE(GL_FOG); checkGLcall("glEnable GL_FOG"); if (new_source != context->fog_source || fogstart == fogend) { diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 5241b6c..0e5ae5e 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -28,9 +28,6 @@ #define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 /* not in the gl spec */ -void (WINE_GLAPI *glDisableWINE)(GLenum cap) DECLSPEC_HIDDEN; -void (WINE_GLAPI *glEnableWINE)(GLenum cap) DECLSPEC_HIDDEN; - /* OpenGL extensions. */ enum wined3d_gl_extension { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b649a47..2b7172a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2656,6 +2656,9 @@ struct wined3d_gl_info HGLRC (WINAPI *p_wglCreateContextAttribsARB)(HDC dc, HGLRC share, const GLint *attribs); struct opengl_funcs gl_ops; struct wined3d_fbo_ops fbo_ops; + + void (WINE_GLAPI *p_glDisableWINE)(GLenum cap); + void (WINE_GLAPI *p_glEnableWINE)(GLenum cap); }; /* The driver names reflect the lowest GPU supported
1
0
0
0
Henri Verbeet : wined3d: Move the "dummy_arbfp_prog" field from struct wined3d_context to struct wined3d_context_gl.
by Alexandre Julliard
08 May '19
08 May '19
Module: wine Branch: master Commit: 3d2b82a257493de36e922bb18f3d43dc2600f479 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3d2b82a257493de36e922bb1…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed May 8 18:09:35 2019 +0430 wined3d: Move the "dummy_arbfp_prog" field from struct wined3d_context to struct wined3d_context_gl. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 33 ++++++++++++++++++++++++++------- dlls/wined3d/wined3d_private.h | 3 ++- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 1a45eca..eb64f14 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1398,11 +1398,6 @@ void wined3d_context_cleanup(struct wined3d_context *context) if (context->valid) { - if (context->dummy_arbfp_prog) - { - GL_EXTCALL(glDeleteProgramsARB(1, &context->dummy_arbfp_prog)); - } - if (gl_info->supported[WINED3D_GL_PRIMITIVE_QUERY]) { for (i = 0; i < context->free_so_statistics_query_count; ++i) @@ -1482,8 +1477,32 @@ void wined3d_context_cleanup(struct wined3d_context *context) void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) { + const struct wined3d_gl_info *gl_info = context_gl->c.gl_info; + HGLRC restore_ctx; + HDC restore_dc; + + restore_ctx = wglGetCurrentContext(); + restore_dc = wglGetCurrentDC(); + + if (restore_ctx == context_gl->c.glCtx) + restore_ctx = NULL; + else if (context_gl->c.valid) + context_set_gl_context(&context_gl->c); + + if (context_gl->c.valid) + { + if (context_gl->dummy_arbfp_prog) + GL_EXTCALL(glDeleteProgramsARB(1, &context_gl->dummy_arbfp_prog)); + + checkGLcall("context cleanup"); + } + heap_free(context_gl->texture_type); + context_restore_pixel_format(&context_gl->c); + if (restore_ctx) + context_restore_gl_context(gl_info, restore_dc, restore_ctx); + wined3d_context_cleanup(&context_gl->c); } @@ -2232,8 +2251,8 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi "!!ARBfp1.0\n" "MOV result.color, fragment.color.primary;\n" "END\n"; - GL_EXTCALL(glGenProgramsARB(1, &context->dummy_arbfp_prog)); - GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, context->dummy_arbfp_prog)); + GL_EXTCALL(glGenProgramsARB(1, &context_gl->dummy_arbfp_prog)); + GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, context_gl->dummy_arbfp_prog)); GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(dummy_program), dummy_program)); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b8edf68..b649a47 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2023,7 +2023,6 @@ struct wined3d_context GLint gl_fog_source; GLfloat fog_coord_value; GLfloat color[4], fogstart, fogend, fogcolor[4]; - GLuint dummy_arbfp_prog; unsigned int viewport_count; unsigned int scissor_rect_count; @@ -2039,6 +2038,8 @@ struct wined3d_context_gl struct wined3d_context c; GLenum *texture_type; + + GLuint dummy_arbfp_prog; }; static inline struct wined3d_context_gl *wined3d_context_gl(struct wined3d_context *context)
1
0
0
0
Henri Verbeet : wined3d: Move the "texture_type" field from struct wined3d_context to struct wined3d_context_gl.
by Alexandre Julliard
08 May '19
08 May '19
Module: wine Branch: master Commit: c5b09fd2312234ce8e47a7a030782caa38b23cac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c5b09fd2312234ce8e47a7a0…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed May 8 18:09:34 2019 +0430 wined3d: Move the "texture_type" field from struct wined3d_context to struct wined3d_context_gl. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 22 +++++++++++----------- dlls/wined3d/wined3d_private.h | 3 ++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 9aa78f5..1a45eca 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1478,12 +1478,12 @@ void wined3d_context_cleanup(struct wined3d_context *context) DWORD err = GetLastError(); ERR("wglDeleteContext(%p) failed, last error %#x.\n", context->glCtx, err); } - - heap_free(context->texture_type); } void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) { + heap_free(context_gl->texture_type); + wined3d_context_cleanup(&context_gl->c); } @@ -2009,8 +2009,8 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi } } - if (!(context->texture_type = heap_calloc(gl_info->limits.combined_samplers, - sizeof(*context->texture_type)))) + if (!(context_gl->texture_type = heap_calloc(gl_info->limits.combined_samplers, + sizeof(*context_gl->texture_type)))) return E_FAIL; target = &context->current_rt.texture->resource; @@ -2093,7 +2093,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi { ERR("Failed to set pixel format %d on device context %p.\n", context->pixel_format, context->hdc); context_release(context); - heap_free(context->texture_type); + heap_free(context_gl->texture_type); return E_FAIL; } @@ -2103,7 +2103,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi if (!(ctx = context_create_wgl_attribs(gl_info, context->hdc, share_ctx))) { context_release(context); - heap_free(context->texture_type); + heap_free(context_gl->texture_type); return E_FAIL; } } @@ -2113,7 +2113,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi { ERR("Failed to create a WGL context.\n"); context_release(context); - heap_free(context->texture_type); + heap_free(context_gl->texture_type); return E_FAIL; } @@ -2123,7 +2123,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi context_release(context); if (!wglDeleteContext(ctx)) ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError()); - heap_free(context->texture_type); + heap_free(context_gl->texture_type); return E_FAIL; } } @@ -2143,7 +2143,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi context_release(context); if (!wglDeleteContext(ctx)) ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError()); - heap_free(context->texture_type); + heap_free(context_gl->texture_type); return E_FAIL; } @@ -2541,7 +2541,7 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLen target = GL_NONE; unit = context_gl->c.active_texture; - old_texture_type = context_gl->c.texture_type[unit]; + old_texture_type = context_gl->texture_type[unit]; if (old_texture_type != target) { switch (old_texture_type) @@ -2586,7 +2586,7 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLen ERR("Unexpected texture target %#x.\n", old_texture_type); } - context_gl->c.texture_type[unit] = target; + context_gl->texture_type[unit] = target; } checkGLcall("bind texture"); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 03c6977..b8edf68 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1954,7 +1954,6 @@ struct wined3d_context UINT blit_w, blit_h; enum fogsource fog_source; DWORD active_texture; - DWORD *texture_type; UINT instance_count; @@ -2038,6 +2037,8 @@ HRESULT wined3d_context_no3d_init(struct wined3d_context *context_no3d, struct wined3d_context_gl { struct wined3d_context c; + + GLenum *texture_type; }; static inline struct wined3d_context_gl *wined3d_context_gl(struct wined3d_context *context)
1
0
0
0
Józef Kucia : wined3d: Propagate HRESULTs in context creation functions.
by Alexandre Julliard
08 May '19
08 May '19
Module: wine Branch: master Commit: ad5a448d7e95d4d6c94312fb65a872591d399e6f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ad5a448d7e95d4d6c94312fb…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed May 8 12:04:06 2019 +0200 wined3d: Propagate HRESULTs in context creation functions. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_gl.c | 5 +++-- dlls/wined3d/adapter_vk.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 1f4ba79..b08ba62 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4277,17 +4277,18 @@ static void adapter_gl_destroy_device(struct wined3d_device *device) static HRESULT adapter_gl_create_context(struct wined3d_swapchain *swapchain, struct wined3d_context **context) { struct wined3d_context_gl *context_gl; + HRESULT hr; TRACE("swapchain %p, context %p.\n", swapchain, context); if (!(context_gl = heap_alloc_zero(sizeof(*context_gl)))) return E_OUTOFMEMORY; - if (FAILED(wined3d_context_gl_init(context_gl, swapchain))) + if (FAILED(hr = wined3d_context_gl_init(context_gl, swapchain))) { WARN("Failed to initialise context.\n"); heap_free(context_gl); - return E_FAIL; + return hr; } TRACE("Created context %p.\n", context_gl); diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index d39e651..fad78ae 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -291,17 +291,18 @@ static void adapter_vk_destroy_device(struct wined3d_device *device) static HRESULT adapter_vk_create_context(struct wined3d_swapchain *swapchain, struct wined3d_context **context) { struct wined3d_context *context_vk; + HRESULT hr; TRACE("swapchain %p, context %p.\n", swapchain, context); if (!(context_vk = heap_alloc_zero(sizeof(*context_vk)))) return E_OUTOFMEMORY; - if (FAILED(wined3d_context_vk_init(context_vk, swapchain))) + if (FAILED(hr = wined3d_context_vk_init(context_vk, swapchain))) { WARN("Failed to initialise context.\n"); heap_free(context_vk); - return E_FAIL; + return hr; } TRACE("Created context %p.\n", context_vk);
1
0
0
0
Paul Gofman : ddraw: Fix vertex count in d3d_device3_DrawIndexedPrimitiveVB().
by Alexandre Julliard
08 May '19
08 May '19
Module: wine Branch: master Commit: 08d630e250d24d6f0f8c1f6106dff0397b4d058e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=08d630e250d24d6f0f8c1f61…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Tue May 7 21:57:53 2019 +0300 ddraw: Fix vertex count in d3d_device3_DrawIndexedPrimitiveVB(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47129
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/device.c | 19 ++++++++++++------- dlls/ddraw/tests/ddraw4.c | 10 +++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 054e2dc..18e5854 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -4518,19 +4518,24 @@ static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve(IDirect3DDe } static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB(IDirect3DDevice3 *iface, - D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer *D3DVertexBuf, WORD *Indices, - DWORD IndexCount, DWORD Flags) + D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer *vertex_buffer, + WORD *indices, DWORD index_count, DWORD flags) { + struct d3d_vertex_buffer *vb = + unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)vertex_buffer); struct d3d_device *device = impl_from_IDirect3DDevice3(iface); - struct d3d_vertex_buffer *vb = unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)D3DVertexBuf); + DWORD stride; TRACE("iface %p, primitive_type %#x, vb %p, indices %p, index_count %u, flags %#x.\n", - iface, PrimitiveType, D3DVertexBuf, Indices, IndexCount, Flags); + iface, primitive_type, vertex_buffer, indices, index_count, flags); - setup_lighting(device, vb->fvf, Flags); + setup_lighting(device, vb->fvf, flags); + + if (!(stride = get_flexible_vertex_size(vb->fvf))) + return D3D_OK; - return IDirect3DDevice7_DrawIndexedPrimitiveVB(&device->IDirect3DDevice7_iface, PrimitiveType, - &vb->IDirect3DVertexBuffer7_iface, 0, IndexCount, Indices, IndexCount, Flags); + return IDirect3DDevice7_DrawIndexedPrimitiveVB(&device->IDirect3DDevice7_iface, primitive_type, + &vb->IDirect3DVertexBuffer7_iface, 0, vb->size / stride, indices, index_count, flags); } /***************************************************************************** diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 0116106..cb7582c 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -15523,12 +15523,16 @@ static void test_sysmem_draw(void) } quad[] = { + {{ 0.0f, 0.0f, 0.0f}, 0x00000000}, + {{ 0.0f, 0.0f, 0.0f}, 0x00000000}, + {{ 0.0f, 0.0f, 0.0f}, 0x00000000}, + {{ 0.0f, 0.0f, 0.0f}, 0x00000000}, {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, }; - static WORD indices[] = {0, 1, 2, 3}; + static WORD indices[] = {4, 5, 6, 7}; window = create_window(); ok(!!window, "Failed to create a window.\n"); @@ -15557,7 +15561,7 @@ static void test_sysmem_draw(void) vb_desc.dwSize = sizeof(vb_desc); vb_desc.dwCaps = D3DVBCAPS_SYSTEMMEMORY; vb_desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; - vb_desc.dwNumVertices = 4; + vb_desc.dwNumVertices = ARRAY_SIZE(quad); hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &vb, 0, NULL); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); @@ -15572,7 +15576,7 @@ static void test_sysmem_draw(void) hr = IDirect3DDevice3_BeginScene(device); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); + hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 4, 4, 0); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_EndScene(device); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
1
0
0
0
Jactry Zeng : d3dcompiler: Implement D3DReadFileToBlob().
by Alexandre Julliard
07 May '19
07 May '19
Module: wine Branch: master Commit: 622422e67bfd9da487102aee4ca42681a24a8e65 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=622422e67bfd9da487102aee…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Tue May 7 22:42:24 2019 +0200 d3dcompiler: Implement D3DReadFileToBlob(). Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/blob.c | 50 ++++++++++- dlls/d3dcompiler_43/d3dcompiler_private.h | 1 + dlls/d3dcompiler_43/tests/blob.c | 132 ++++++++++++++++++++++++++++-- 3 files changed, 175 insertions(+), 8 deletions(-) diff --git a/dlls/d3dcompiler_43/blob.c b/dlls/d3dcompiler_43/blob.c index f22dc71..6c925af 100644 --- a/dlls/d3dcompiler_43/blob.c +++ b/dlls/d3dcompiler_43/blob.c @@ -466,9 +466,55 @@ HRESULT WINAPI D3DStripShader(const void *data, SIZE_T data_size, UINT flags, ID HRESULT WINAPI D3DReadFileToBlob(const WCHAR *filename, ID3DBlob **contents) { - FIXME("filename %s, contents %p\n", debugstr_w(filename), contents); + struct d3dcompiler_blob *object; + SIZE_T data_size; + DWORD read_size; + HANDLE file; + HRESULT hr; - return E_NOTIMPL; + TRACE("filename %s, contents %p.\n", debugstr_w(filename), contents); + + file = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (file == INVALID_HANDLE_VALUE) + return HRESULT_FROM_WIN32(GetLastError()); + + data_size = GetFileSize(file, NULL); + if (data_size == INVALID_FILE_SIZE) + { + CloseHandle(file); + return HRESULT_FROM_WIN32(GetLastError()); + } + + if (!(object = heap_alloc_zero(sizeof(*object)))) + { + CloseHandle(file); + return E_OUTOFMEMORY; + } + + if (FAILED(hr = d3dcompiler_blob_init(object, data_size))) + { + WARN("Failed to initialize blob, hr %#x.\n", hr); + CloseHandle(file); + heap_free(object); + return hr; + } + + if (!ReadFile(file, object->data, data_size, &read_size, NULL) || (read_size != data_size)) + { + WARN("Failed to read file contents.\n"); + CloseHandle(file); + heap_free(object->data); + heap_free(object); + return E_FAIL; + } + CloseHandle(file); + object->size = read_size; + + *contents = &object->ID3DBlob_iface; + + TRACE("Returning ID3DBlob %p.\n", *contents); + + return S_OK; } HRESULT WINAPI D3DWriteBlobToFile(ID3DBlob* blob, const WCHAR *filename, BOOL overwrite) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 68ff962..dabe0da 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -25,6 +25,7 @@ #include "wine/debug.h" #include "wine/list.h" #include "wine/rbtree.h" +#include "wine/heap.h" #define COBJMACROS #include "windef.h" diff --git a/dlls/d3dcompiler_43/tests/blob.c b/dlls/d3dcompiler_43/tests/blob.c index 443ed27..3e1a3aa 100644 --- a/dlls/d3dcompiler_43/tests/blob.c +++ b/dlls/d3dcompiler_43/tests/blob.c @@ -35,6 +35,7 @@ static HRESULT (WINAPI *pD3DCreateBlob)(SIZE_T, ID3DBlob **); static HRESULT (WINAPI *pD3DGetBlobPart)(const void *, SIZE_T, D3D_BLOB_PART, UINT, ID3DBlob **); +static HRESULT (WINAPI *pD3DReadFileToBlob)(const WCHAR *, ID3DBlob **); static HRESULT (WINAPI *pD3DStripShader)(const void *, SIZE_T, UINT, ID3DBlob **); #define MAKE_TAG(ch0, ch1, ch2, ch3) \ @@ -740,7 +741,7 @@ static void test_get_blob_part2(void) ok(!refcount, "ID3DBlob has %u references left\n", refcount); } -static BOOL load_d3dcompiler(void) +static BOOL load_d3dcompiler_43(void) { HMODULE module; @@ -752,15 +753,134 @@ static BOOL load_d3dcompiler(void) return TRUE; } +static BOOL load_d3dcompiler_47(void) +{ + HMODULE module; + + if (!(module = LoadLibraryA("d3dcompiler_47.dll"))) + return FALSE; + + pD3DReadFileToBlob = (void *)GetProcAddress(module, "D3DReadFileToBlob"); + return TRUE; +} + +static BOOL create_file(WCHAR *filename, const DWORD *data, DWORD data_size) +{ + static WCHAR temp_dir[MAX_PATH]; + DWORD written; + HANDLE file; + + if (!temp_dir[0]) + GetTempPathW(ARRAY_SIZE(temp_dir), temp_dir); + GetTempFileNameW(temp_dir, NULL, 0, filename); + file = CreateFileW(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + if (file == INVALID_HANDLE_VALUE) + return FALSE; + + if (data) + { + WriteFile(file, data, data_size, &written, NULL); + if (written != data_size) + { + CloseHandle(file); + DeleteFileW(filename); + return FALSE; + } + } + CloseHandle(file); + return TRUE; +} + +/* test_cso_data - fxc.exe file.hlsl /Fo file.cso */ +static const DWORD test_cso_data[] = +{ +#if 0 + struct PSInput + { + float4 value : SV_POSITION; + }; + + PSInput main(float4 position : POSITION) + { + PSInput result; + result.value = position; + return result; + } +#endif + 0xfffe0200, 0x0014fffe, 0x42415443, 0x0000001c, 0x00000023, 0xfffe0200, 0x00000000, 0x00000000, + 0x00000100, 0x0000001c, 0x325f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, + 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x0200001f, 0x80000000, + 0x900f0000, 0x02000001, 0xc00f0000, 0x90e40000, 0x0000ffff +}; + +static void test_D3DReadFileToBlob(void) +{ + WCHAR filename[MAX_PATH] = {'n','o','n','e','x','i','s','t','e','n','t',0}; + ID3DBlob *blob = NULL; + SIZE_T data_size; + DWORD *data; + HRESULT hr; + + hr = pD3DReadFileToBlob(filename, NULL); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#x.\n", hr); + + hr = pD3DReadFileToBlob(filename, &blob); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#x.\n", hr); + + if (0) + { + /* Crashes on Windows. */ + create_file(filename, test_cso_data, ARRAY_SIZE(test_cso_data)); + pD3DReadFileToBlob(filename, NULL); + DeleteFileW(filename); + } + + if (!create_file(filename, NULL, 0)) + { + win_skip("File creation failed.\n"); + return; + } + hr = pD3DReadFileToBlob(filename, &blob); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + data_size = ID3D10Blob_GetBufferSize(blob); + ok(!data_size, "Got unexpected data size.\n"); + DeleteFileW(filename); + ID3D10Blob_Release(blob); + + if (!create_file(filename, test_cso_data, ARRAY_SIZE(test_cso_data))) + { + win_skip("File creation failed.\n"); + return; + } + hr = pD3DReadFileToBlob(filename, &blob); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + data_size = ID3D10Blob_GetBufferSize(blob); + ok(data_size == ARRAY_SIZE(test_cso_data), "Got unexpected data size.\n"); + data = ID3D10Blob_GetBufferPointer(blob); + ok(!memcmp(data, test_cso_data, ARRAY_SIZE(test_cso_data)), "Got unexpected data.\n"); + DeleteFileW(filename); + ID3D10Blob_Release(blob); +} + START_TEST(blob) { - if (!load_d3dcompiler()) + if (load_d3dcompiler_43()) + { + test_create_blob(); + test_get_blob_part(); + test_get_blob_part2(); + } + else { win_skip("Could not load d3dcompiler_43.dll\n"); - return; } - test_create_blob(); - test_get_blob_part(); - test_get_blob_part2(); + if (load_d3dcompiler_47()) + { + test_D3DReadFileToBlob(); + } + else + { + win_skip("Could not load d3dcompiler_47.dll.\n"); + } }
1
0
0
0
Jacek Caban : ntoskrnl.exe/tests: Add more overlapped tests.
by Alexandre Julliard
07 May '19
07 May '19
Module: wine Branch: master Commit: 4e4a1098f27e09d0c450e8425b158ad416133be5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4e4a1098f27e09d0c450e842…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 7 16:15:33 2019 +0200 ntoskrnl.exe/tests: Add more overlapped tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 45 +++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 33027d9..d47943a 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -35,6 +35,7 @@ static HANDLE device; static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)(const WCHAR *, UNICODE_STRING *, WCHAR **, CURDIR *); static BOOL (WINAPI *pRtlFreeUnicodeString)(UNICODE_STRING *); static BOOL (WINAPI *pCancelIoEx)(HANDLE, OVERLAPPED *); +static BOOL (WINAPI *pSetFileCompletionNotificationModes)(HANDLE, UCHAR); static void load_resource(const char *name, char *filename) { @@ -198,17 +199,19 @@ static void test_basic_ioctl(void) ok(!strcmp(buf, teststr), "got '%s'\n", buf); } -static void test_cancel_io(void) +static void test_overlapped(void) { - OVERLAPPED overlapped, overlapped2; - DWORD cancel_cnt; - HANDLE file; + OVERLAPPED overlapped, overlapped2, *o; + DWORD cancel_cnt, size; + HANDLE file, port; + ULONG_PTR key; BOOL res; overlapped.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); overlapped2.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); - file = CreateFileA("\\\\.\\WineTestDriver", 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); + file = CreateFileA("\\\\.\\WineTestDriver", FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES, + 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); ok(file != INVALID_HANDLE_VALUE, "failed to open device: %u\n", GetLastError()); /* test cancelling all device requests */ @@ -275,6 +278,34 @@ static void test_cancel_io(void) ok(cancel_cnt == 2, "cancel_cnt = %u\n", cancel_cnt); } + port = CreateIoCompletionPort(file, NULL, 0xdeadbeef, 0); + ok(port != NULL, "CreateIoCompletionPort failed, error %u\n", GetLastError()); + res = GetQueuedCompletionStatus(port, &size, &key, &o, 0); + ok(!res && GetLastError() == WAIT_TIMEOUT, "GetQueuedCompletionStatus returned %x(%u)\n", res, GetLastError()); + + res = DeviceIoControl(file, IOCTL_WINETEST_RESET_CANCEL, NULL, 0, NULL, 0, NULL, &overlapped); + todo_wine + ok(res, "DeviceIoControl failed: %u\n", GetLastError()); + if (!res && GetLastError() == ERROR_IO_PENDING) WaitForSingleObject(overlapped.hEvent, INFINITE); + res = GetQueuedCompletionStatus(port, &size, &key, &o, 0); + ok(res, "GetQueuedCompletionStatus failed: %u\n", GetLastError()); + ok(o == &overlapped, "o != overlapped\n"); + + if (pSetFileCompletionNotificationModes) + { + res = pSetFileCompletionNotificationModes(file, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS); + ok(res, "SetFileCompletionNotificationModes failed: %u\n", GetLastError()); + + res = DeviceIoControl(file, IOCTL_WINETEST_RESET_CANCEL, NULL, 0, NULL, 0, NULL, &overlapped); + todo_wine + ok(res, "DeviceIoControl failed: %u\n", GetLastError()); + if (!res && GetLastError() == ERROR_IO_PENDING) WaitForSingleObject(overlapped.hEvent, INFINITE); + res = GetQueuedCompletionStatus(port, &size, &key, &o, 0); + todo_wine + ok(!res && GetLastError() == WAIT_TIMEOUT, "GetQueuedCompletionStatus returned %x(%u)\n", res, GetLastError()); + } + + CloseHandle(port); CloseHandle(overlapped.hEvent); CloseHandle(overlapped2.hEvent); CloseHandle(file); @@ -337,6 +368,8 @@ START_TEST(ntoskrnl) pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U"); pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); pCancelIoEx = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "CancelIoEx"); + pSetFileCompletionNotificationModes = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), + "SetFileCompletionNotificationModes"); if (!(service = load_driver(filename, "driver.dll", "WineTestDriver"))) return; @@ -352,7 +385,7 @@ START_TEST(ntoskrnl) test_basic_ioctl(); main_test(); - test_cancel_io(); + test_overlapped(); test_load_driver(service2); unload_driver(service2);
1
0
0
0
← Newer
1
...
77
78
79
80
81
82
83
...
102
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Results per page:
10
25
50
100
200