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
December 2008
----- 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
1225 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Fix use_vs() usage in vertexdeclaration().
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 143fb431e0959a6ba054a347e70e45eb5a710138 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=143fb431e0959a6ba054a347e…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 15 16:35:15 2008 +0100 wined3d: Fix use_vs() usage in vertexdeclaration(). --- dlls/wined3d/state.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 085e3d4..8ffcec0 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4449,19 +4449,16 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo } static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - BOOL useVertexShaderFunction = FALSE, updateFog = FALSE; + BOOL updateFog = FALSE; + BOOL useVertexShaderFunction = use_vs(stateblock->wineD3DDevice); BOOL usePixelShaderFunction = use_ps(stateblock->wineD3DDevice); BOOL transformed; /* Some stuff is in the device until we have per context tracking */ IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; BOOL wasrhw = context->last_was_rhw; - /* Shaders can be implemented using ARB_PROGRAM, GLSL, or software - - * here simply check whether a shader was set, or the user disabled shaders - */ - if (use_vs(device)) { - useVertexShaderFunction = TRUE; - + if (useVertexShaderFunction) + { if(((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.reg_maps.fog != context->last_was_foggy_shader) { updateFog = TRUE; } @@ -4470,8 +4467,6 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W } transformed = device->strided_streams.u.s.position_transformed; - if (transformed) useVertexShaderFunction = FALSE; - if(transformed != context->last_was_rhw && !useVertexShaderFunction) { updateFog = TRUE; }
1
0
0
0
Henri Verbeet : wined3d: Shaders will never have a NULL function.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: f3743fb402351922f1b4fdf505fd92f2dbabcb15 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f3743fb402351922f1b4fdf50…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 15 16:35:14 2008 +0100 wined3d: Shaders will never have a NULL function. --- dlls/wined3d/baseshader.c | 15 --------------- dlls/wined3d/nvidia_texture_shader.c | 7 ++----- dlls/wined3d/pixelshader.c | 25 ++++++++----------------- dlls/wined3d/state.c | 18 ++++-------------- dlls/wined3d/vertexshader.c | 30 +++++++----------------------- dlls/wined3d/wined3d_private.h | 4 +--- 6 files changed, 22 insertions(+), 77 deletions(-) diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index 392c512..9cc0e2b 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -216,13 +216,6 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m memset(reg_maps->bumpmat, 0, sizeof(reg_maps->bumpmat)); memset(reg_maps->luminanceparams, 0, sizeof(reg_maps->luminanceparams)); - if (!pToken) - { - WARN("Got a NULL pFunction, returning.\n"); - This->baseShader.functionLength = 0; - return WINED3D_OK; - } - /* get_registers_used is called on every compile on some 1.x shaders, which can result * in stacking up a collection of local constants. Delete the old constants if existing */ @@ -844,8 +837,6 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer, hw_arg.reg_maps = reg_maps; This->baseShader.parse_state.current_row = 0; - if (!pToken) return; - while (WINED3DPS_END() != *pToken) { /* Skip version token */ @@ -970,12 +961,6 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table TRACE("Parsing %p\n", pFunction); - if (!pFunction) - { - WARN("Got a NULL pFunction, returning.\n"); - return; - } - /* The version token is supposed to be the first token */ if (!shader_is_version_token(*pToken)) { diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index 1b31c74..e761288 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -457,11 +457,8 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3 TRACE("Setting color op for stage %d\n", stage); - if (stateblock->pixelShader && stateblock->wineD3DDevice->ps_selected_mode != SHADER_NONE && - ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function) { - /* Using a pixel shader? Don't care for anything here, the shader applying does it */ - return; - } + /* Using a pixel shader? Don't care for anything here, the shader applying does it */ + if (use_ps(stateblock->wineD3DDevice)) return; if (stage != mapped_stage) WARN("Using non 1:1 mapping: %d -> %d!\n", stage, mapped_stage); diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index f3d4386..1dd3888 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -115,13 +115,10 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_GetFunction(IWineD3DPixelShader* * return D3DERR_MOREDATA. That's not actually true. */ return WINED3DERR_INVALIDCALL; } - if (NULL == This->baseShader.function) { /* no function defined */ - TRACE("(%p) : GetFunction no User Function defined using NULL to %p\n", This, pData); - (*(DWORD **) pData) = NULL; - } else { - TRACE("(%p) : GetFunction copying to %p\n", This, pData); - memcpy(pData, This->baseShader.function, This->baseShader.functionLength); - } + + TRACE("(%p) : GetFunction copying to %p\n", This, pData); + memcpy(pData, This->baseShader.function, This->baseShader.functionLength); + return WINED3D_OK; } @@ -382,16 +379,10 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i This->baseShader.shader_mode = deviceImpl->ps_selected_mode; TRACE("(%p) : Copying the function\n", This); - if (NULL != pFunction) { - void *function; - function = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->baseShader.functionLength); - if (!function) return E_OUTOFMEMORY; - memcpy(function, pFunction, This->baseShader.functionLength); - This->baseShader.function = function; - } else { - This->baseShader.function = NULL; - } + This->baseShader.function = HeapAlloc(GetProcessHeap(), 0, This->baseShader.functionLength); + if (!This->baseShader.function) return E_OUTOFMEMORY; + memcpy(This->baseShader.function, pFunction, This->baseShader.functionLength); return WINED3D_OK; } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index ccaf6f5..085e3d4 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -2917,11 +2917,8 @@ static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D TRACE("Setting color op for stage %d\n", stage); - if (stateblock->pixelShader && stateblock->wineD3DDevice->ps_selected_mode != SHADER_NONE && - ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function) { - /* Using a pixel shader? Don't care for anything here, the shader applying does it */ - return; - } + /* Using a pixel shader? Don't care for anything here, the shader applying does it */ + if (use_ps(stateblock->wineD3DDevice)) return; if (stage != mapped_stage) WARN("Using non 1:1 mapping: %d -> %d!\n", stage, mapped_stage); @@ -4365,13 +4362,7 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo BOOL load_numbered = FALSE; BOOL load_named = FALSE; - if (device->vs_selected_mode != SHADER_NONE && stateblock->vertexShader && - ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.function != NULL) { - useVertexShaderFunction = TRUE; - } else { - useVertexShaderFunction = FALSE; - } - + useVertexShaderFunction = (device->vs_selected_mode != SHADER_NONE && stateblock->vertexShader) ? TRUE : FALSE; if(device->up_strided) { /* Note: this is a ddraw fixed-function code path */ @@ -4459,8 +4450,7 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { BOOL useVertexShaderFunction = FALSE, updateFog = FALSE; - BOOL usePixelShaderFunction = stateblock->wineD3DDevice->ps_selected_mode != SHADER_NONE && stateblock->pixelShader - && ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function; + BOOL usePixelShaderFunction = use_ps(stateblock->wineD3DDevice); BOOL transformed; /* Some stuff is in the device until we have per context tracking */ IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c index ef55f67..063f576 100644 --- a/dlls/wined3d/vertexshader.c +++ b/dlls/wined3d/vertexshader.c @@ -412,13 +412,10 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_GetFunction(IWineD3DVertexShader* * return D3DERR_MOREDATA. That's not actually true. */ return WINED3DERR_INVALIDCALL; } - if (NULL == This->baseShader.function) { /* no function defined */ - TRACE("(%p) : GetFunction no User Function defined using NULL to %p\n", This, pData); - (*(DWORD **) pData) = NULL; - } else { - TRACE("(%p) : GetFunction copying to %p\n", This, pData); - memcpy(pData, This->baseShader.function, This->baseShader.functionLength); - } + + TRACE("(%p) : GetFunction copying to %p\n", This, pData); + memcpy(pData, This->baseShader.function, This->baseShader.functionLength); + return WINED3D_OK; } @@ -474,16 +471,9 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader This->baseShader.load_local_constsF = This->baseShader.reg_maps.usesrelconstF && !list_empty(&This->baseShader.constantsF); /* copy the function ... because it will certainly be released by application */ - if (NULL != pFunction) { - void *function; - - function = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->baseShader.functionLength); - if (!function) return E_OUTOFMEMORY; - memcpy(function, pFunction, This->baseShader.functionLength); - This->baseShader.function = function; - } else { - This->baseShader.function = NULL; - } + This->baseShader.function = HeapAlloc(GetProcessHeap(), 0, This->baseShader.functionLength); + if (!This->baseShader.function) return E_OUTOFMEMORY; + memcpy(This->baseShader.function, pFunction, This->baseShader.functionLength); return WINED3D_OK; } @@ -611,12 +601,6 @@ HRESULT IWineD3DVertexShaderImpl_CompileShader(IWineD3DVertexShader *iface) { deviceImpl->shader_backend->shader_destroy((IWineD3DBaseShader *) iface); } - /* We don't need to compile */ - if (!function) { - This->baseShader.is_compiled = TRUE; - return WINED3D_OK; - } - /* Generate the HW shader */ TRACE("(%p) : Generating hardware program\n", This); IWineD3DVertexShaderImpl_GenerateShader(iface, &This->baseShader.reg_maps, function); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index a660581..9500031 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2465,14 +2465,12 @@ const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, static inline BOOL use_vs(IWineD3DDeviceImpl *device) { return (device->vs_selected_mode != SHADER_NONE && device->stateBlock->vertexShader - && ((IWineD3DVertexShaderImpl *)device->stateBlock->vertexShader)->baseShader.function && !device->strided_streams.u.s.position_transformed); } static inline BOOL use_ps(IWineD3DDeviceImpl *device) { return (device->ps_selected_mode != SHADER_NONE - && device->stateBlock->pixelShader - && ((IWineD3DPixelShaderImpl *)device->stateBlock->pixelShader)->baseShader.function); + && device->stateBlock->pixelShader); } void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED3DRECT *src_rect,
1
0
0
0
Henri Verbeet : wined3d: Refuse to create shaders with a NULL function.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 46572f682ceb651803d7ef6c166d514381ff42a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=46572f682ceb651803d7ef6c1…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 15 16:35:13 2008 +0100 wined3d: Refuse to create shaders with a NULL function. --- dlls/d3d8/device.c | 59 +++++++++++++++++++++++++++++++++------------ dlls/d3d8/vertexshader.c | 2 +- dlls/d3d9/tests/shader.c | 10 +++++++- dlls/wined3d/device.c | 5 ++++ 4 files changed, 58 insertions(+), 18 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 58f698a..41d8554 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1599,20 +1599,28 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 wined3d_vertex_declaration = ((IDirect3DVertexDeclaration8Impl *)object->vertex_declaration)->wined3d_vertex_declaration; - /* Usage is missing ... Use SetRenderState to set the sw vp render state in SetVertexShader */ - hrc = IWineD3DDevice_CreateVertexShader(This->WineD3DDevice, wined3d_vertex_declaration, pFunction, &object->wineD3DVertexShader, (IUnknown *)object); + if (pFunction) + { + /* Usage is missing ... Use SetRenderState to set the sw vp render state in SetVertexShader */ + hrc = IWineD3DDevice_CreateVertexShader(This->WineD3DDevice, wined3d_vertex_declaration, + pFunction, &object->wineD3DVertexShader, (IUnknown *)object); - if (FAILED(hrc)) { - /* free up object */ - FIXME("Call to IWineD3DDevice_CreateVertexShader failed\n"); - free_shader_handle(This, handle); - IDirect3DVertexDeclaration8_Release(object->vertex_declaration); - HeapFree(GetProcessHeap(), 0, object); - *ppShader = 0; - } else { - load_local_constants(pDeclaration, object->wineD3DVertexShader); - TRACE("(%p) : returning %p (handle %#x)\n", This, object, *ppShader); + if (FAILED(hrc)) + { + /* free up object */ + FIXME("Call to IWineD3DDevice_CreateVertexShader failed\n"); + free_shader_handle(This, handle); + IDirect3DVertexDeclaration8_Release(object->vertex_declaration); + HeapFree(GetProcessHeap(), 0, object); + *ppShader = 0; + } + else + { + load_local_constants(pDeclaration, object->wineD3DVertexShader); + TRACE("(%p) : returning %p (handle %#x)\n", This, object, *ppShader); + } } + LeaveCriticalSection(&d3d8_cs); return hrc; @@ -1706,9 +1714,19 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 ifa hrc = D3DERR_INVALIDCALL; } else { IDirect3DVertexShader8Impl *shader = This->shader_handles[pShader - (VS_HIGHESTFIXEDFXF + 1)]; - IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, - shader ? ((IDirect3DVertexDeclaration8Impl *)shader->vertex_declaration)->wined3d_vertex_declaration : NULL); - hrc = IWineD3DDevice_SetVertexShader(This->WineD3DDevice, 0 == shader ? NULL : shader->wineD3DVertexShader); + + if (shader) + { + hrc = IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, + ((IDirect3DVertexDeclaration8Impl *)shader->vertex_declaration)->wined3d_vertex_declaration); + if (SUCCEEDED(hrc)) + hrc = IWineD3DDevice_SetVertexShader(This->WineD3DDevice, shader->wineD3DVertexShader); + } + else + { + hrc = IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, NULL); + if (SUCCEEDED(hrc)) hrc = IWineD3DDevice_SetVertexShader(This->WineD3DDevice, NULL); + } } } TRACE("(%p) : returning hr(%u)\n", This, hrc); @@ -1860,7 +1878,16 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEV } shader = This->shader_handles[pVertexShader - (VS_HIGHESTFIXEDFXF + 1)]; - hr = IWineD3DVertexShader_GetFunction(shader->wineD3DVertexShader, pData, pSizeOfData); + if (shader->wineD3DVertexShader) + { + hr = IWineD3DVertexShader_GetFunction(shader->wineD3DVertexShader, pData, pSizeOfData); + } + else + { + *pSizeOfData = 0; + hr = D3D_OK; + } + LeaveCriticalSection(&d3d8_cs); return hr; } diff --git a/dlls/d3d8/vertexshader.c b/dlls/d3d8/vertexshader.c index bdc6685..8cd822b 100644 --- a/dlls/d3d8/vertexshader.c +++ b/dlls/d3d8/vertexshader.c @@ -57,7 +57,7 @@ static ULONG WINAPI IDirect3DVertexShader8Impl_Release(IDirect3DVertexShader8 *i if (ref == 0) { IDirect3DVertexDeclaration8_Release(This->vertex_declaration); - IWineD3DVertexShader_Release(This->wineD3DVertexShader); + if (This->wineD3DVertexShader) IWineD3DVertexShader_Release(This->wineD3DVertexShader); HeapFree(GetProcessHeap(), 0, This); } return ref; diff --git a/dlls/d3d9/tests/shader.c b/dlls/d3d9/tests/shader.c index dcf8851..522f128 100644 --- a/dlls/d3d9/tests/shader.c +++ b/dlls/d3d9/tests/shader.c @@ -90,7 +90,11 @@ static void test_get_set_vertex_shader(IDirect3DDevice9 *device_ptr) HRESULT hret = 0; int shader_refcount = 0; int i = 0; - + + hret = IDirect3DDevice9_CreateVertexShader(device_ptr, NULL, &shader_ptr); + ok(hret == D3DERR_INVALIDCALL, "CreateVertexShader returned %#x, expected D3DERR_INVALIDCALL (%#x).\n", + hret, D3DERR_INVALIDCALL); + hret = IDirect3DDevice9_CreateVertexShader(device_ptr, simple_vs, &shader_ptr); ok(hret == D3D_OK && shader_ptr != NULL, "CreateVertexShader returned: hret 0x%x, shader_ptr %p. " "Expected hret 0x%x, shader_ptr != %p. Aborting.\n", hret, shader_ptr, D3D_OK, NULL); @@ -155,6 +159,10 @@ static void test_get_set_pixel_shader(IDirect3DDevice9 *device_ptr) int shader_refcount = 0; int i = 0; + hret = IDirect3DDevice9_CreatePixelShader(device_ptr, NULL, &shader_ptr); + ok(hret == D3DERR_INVALIDCALL, "CreatePixelShader returned %#x, expected D3DERR_INVALIDCALL (%#x).\n", + hret, D3DERR_INVALIDCALL); + hret = IDirect3DDevice9_CreatePixelShader(device_ptr, simple_ps, &shader_ptr); ok(hret == D3D_OK && shader_ptr != NULL, "CreatePixelShader returned: hret 0x%x, shader_ptr %p. " "Expected hret 0x%x, shader_ptr != %p. Aborting.\n", hret, shader_ptr, D3D_OK, NULL); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a99ff56..b765f12 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1874,6 +1874,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *ifac IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DVertexShaderImpl *object; /* NOTE: impl usage is ok, this is a create */ HRESULT hr = WINED3D_OK; + + if (!pFunction) return WINED3DERR_INVALIDCALL; + D3DCREATESHADEROBJECTINSTANCE(object, VertexShader) object->baseShader.shader_ins = IWineD3DVertexShaderImpl_shader_ins; @@ -1900,6 +1903,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface IWineD3DPixelShaderImpl *object; /* NOTE: impl allowed, this is a create */ HRESULT hr = WINED3D_OK; + if (!pFunction) return WINED3DERR_INVALIDCALL; + D3DCREATESHADEROBJECTINSTANCE(object, PixelShader) object->baseShader.shader_ins = IWineD3DPixelShaderImpl_shader_ins; hr = IWineD3DPixelShader_SetFunction(*ppPixelShader, pFunction);
1
0
0
0
Henri Verbeet : d3d8: Remove unused code.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 62497e8772e541fe55df55ea0d3b02595276237e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=62497e8772e541fe55df55ea0…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 15 16:35:13 2008 +0100 d3d8: Remove unused code. Also corrects some related comments. --- dlls/d3d8/d3d8_private.h | 18 ++---------------- dlls/d3d8/pixelshader.c | 24 ------------------------ dlls/d3d8/vertexshader.c | 29 ----------------------------- 3 files changed, 2 insertions(+), 69 deletions(-) diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 28952a3..b9850b6 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -536,7 +536,7 @@ typedef struct { /***************************************************************************** - * IDirect3DVertexShader9 interface + * IDirect3DVertexShader8 interface */ #define INTERFACE IDirect3DVertexShader8 DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown) @@ -545,9 +545,6 @@ DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown) STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirect3DVertexShader9 methods ***/ - STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE; }; #undef INTERFACE @@ -555,16 +552,13 @@ DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown) #define IDirect3DVertexShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) #define IDirect3DVertexShader8_AddRef(p) (p)->lpVtbl->AddRef(p) #define IDirect3DVertexShader8_Release(p) (p)->lpVtbl->Release(p) -/*** IDirect3DVertexShader8 methods ***/ -#define IDirect3DVertexShader8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVertexShader8_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) /* ------------------------- */ /* IDirect3DVertexShader8Impl */ /* ------------------------- */ /***************************************************************************** - * IDirect3DPixelShader9 interface + * IDirect3DPixelShader8 interface */ #define INTERFACE IDirect3DPixelShader8 DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown) @@ -573,9 +567,6 @@ DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown) STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirect3DPixelShader8 methods ***/ - STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE; }; #undef INTERFACE @@ -583,10 +574,6 @@ DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown) #define IDirect3DPixelShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) #define IDirect3DPixelShader8_AddRef(p) (p)->lpVtbl->AddRef(p) #define IDirect3DPixelShader8_Release(p) (p)->lpVtbl->Release(p) -/*** IDirect3DPixelShader8 methods ***/ -#define IDirect3DPixelShader8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DPixelShader8_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) - /***************************************************************************** * Predeclare the interface implementation structures @@ -624,7 +611,6 @@ typedef struct IDirect3DPixelShader8Impl { LONG ref; DWORD handle; - /* The device, to be replaced by an IDirect3DDeviceImpl */ IWineD3DPixelShader *wineD3DPixelShader; } IDirect3DPixelShader8Impl; diff --git a/dlls/d3d8/pixelshader.c b/dlls/d3d8/pixelshader.c index 3ad39e6..5cfb0ca 100644 --- a/dlls/d3d8/pixelshader.c +++ b/dlls/d3d8/pixelshader.c @@ -62,34 +62,10 @@ static ULONG WINAPI IDirect3DPixelShader8Impl_Release(IDirect3DPixelShader8 * if return ref; } -/* IDirect3DPixelShader8 Interface follow: */ -static HRESULT WINAPI IDirect3DPixelShader8Impl_GetDevice(IDirect3DPixelShader8 *iface, IDirect3DDevice8 **ppDevice) { - IDirect3DPixelShader8Impl *This = (IDirect3DPixelShader8Impl *)iface; - IWineD3DDevice *myDevice = NULL; - - TRACE("(%p) : Relay\n", This); - - IWineD3DPixelShader_GetDevice(This->wineD3DPixelShader, &myDevice); - IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice); - IWineD3DDevice_Release(myDevice); - TRACE("(%p) returning (%p)\n", This, *ppDevice); - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DPixelShader8Impl_GetFunction(IDirect3DPixelShader8 *iface, VOID *pData, UINT *pSizeOfData) { - IDirect3DPixelShader8Impl *This = (IDirect3DPixelShader8Impl *)iface; - TRACE("(%p) Relay\n", This); - return IWineD3DPixelShader_GetFunction(This->wineD3DPixelShader, pData, pSizeOfData); -} - - const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl = { /* IUnknown */ IDirect3DPixelShader8Impl_QueryInterface, IDirect3DPixelShader8Impl_AddRef, IDirect3DPixelShader8Impl_Release, - /* IDirect3DPixelShader8 */ - IDirect3DPixelShader8Impl_GetDevice, - IDirect3DPixelShader8Impl_GetFunction }; diff --git a/dlls/d3d8/vertexshader.c b/dlls/d3d8/vertexshader.c index 16a809e..bdc6685 100644 --- a/dlls/d3d8/vertexshader.c +++ b/dlls/d3d8/vertexshader.c @@ -63,39 +63,10 @@ static ULONG WINAPI IDirect3DVertexShader8Impl_Release(IDirect3DVertexShader8 *i return ref; } -/* IDirect3DVertexShader8 Interface follow: */ -static HRESULT WINAPI IDirect3DVertexShader8Impl_GetDevice(IDirect3DVertexShader8 *iface, IDirect3DDevice8** ppDevice) { - IDirect3DVertexShader8Impl *This = (IDirect3DVertexShader8Impl *)iface; - IWineD3DDevice *myDevice = NULL; - HRESULT hr; - TRACE("(%p) : Relay\n", This); - - hr = IWineD3DVertexShader_GetDevice(This->wineD3DVertexShader, &myDevice); - if (WINED3D_OK == hr && myDevice != NULL) { - hr = IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice); - IWineD3DDevice_Release(myDevice); - } else { - *ppDevice = NULL; - } - TRACE("(%p) returning (%p)\n", This, *ppDevice); - return hr; -} - -static HRESULT WINAPI IDirect3DVertexShader8Impl_GetFunction(IDirect3DVertexShader8 *iface, VOID* pData, UINT* pSizeOfData) { - IDirect3DVertexShader8Impl *This = (IDirect3DVertexShader8Impl *)iface; - - TRACE("(%p) : Relay\n", This); - return IWineD3DVertexShader_GetFunction(This->wineD3DVertexShader, pData, pSizeOfData); -} - - const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl = { /* IUnknown */ IDirect3DVertexShader8Impl_QueryInterface, IDirect3DVertexShader8Impl_AddRef, IDirect3DVertexShader8Impl_Release, - /* IDirect3DVertexShader8 */ - IDirect3DVertexShader8Impl_GetDevice, - IDirect3DVertexShader8Impl_GetFunction };
1
0
0
0
Paul Vriens : riched20/tests: Fix test failures on Win9x, WinMe and Wine in win9x mode.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 9bc409cfcb5972414747e358e56934cf77d7db59 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9bc409cfcb5972414747e358e…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Tue Dec 16 11:29:54 2008 +0100 riched20/tests: Fix test failures on Win9x, WinMe and Wine in win9x mode. --- dlls/riched20/tests/editor.c | 45 ++++++++++++++++++++++++++++-------------- 1 files changed, 30 insertions(+), 15 deletions(-) diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 39d519b..a425275 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -44,6 +44,8 @@ static CHAR string1[MAX_PATH], string2[MAX_PATH], string3[MAX_PATH]; static HMODULE hmoduleRichEdit; +static int is_win9x = 0; + static HWND new_window(LPCTSTR lpClassName, DWORD dwStyle, HWND parent) { HWND hwnd; hwnd = CreateWindow(lpClassName, NULL, dwStyle|WS_POPUP|WS_HSCROLL|WS_VSCROLL @@ -4911,9 +4913,7 @@ static void test_unicode_conversions(void) char bufA[64]; WCHAR bufW[64]; HWND hwnd; - int is_win9x, em_settextex_supported, ret; - - is_win9x = GetVersion() & 0x80000000; + int em_settextex_supported, ret; #define set_textA(hwnd, wm_set_text, txt) \ do { \ @@ -5146,8 +5146,12 @@ static void test_EM_GETTEXTLENGTHEX(void) char buffer[64] = {0}; /* single line */ - hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP, - 0, 0, 200, 60, 0, 0, 0, 0); + if (!is_win9x) + hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP, + 0, 0, 200, 60, 0, 0, 0, 0); + else + hwnd = CreateWindowExA(0, "RichEdit20A", NULL, WS_POPUP, + 0, 0, 200, 60, 0, 0, 0, 0); ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError()); gtl.flags = GTL_NUMCHARS | GTL_PRECISE | GTL_USECRLF; @@ -5191,8 +5195,12 @@ static void test_EM_GETTEXTLENGTHEX(void) DestroyWindow(hwnd); /* multi line */ - hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP | ES_MULTILINE, - 0, 0, 200, 60, 0, 0, 0, 0); + if (!is_win9x) + hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP | ES_MULTILINE, + 0, 0, 200, 60, 0, 0, 0, 0); + else + hwnd = CreateWindowExA(0, "RichEdit20A", NULL, WS_POPUP | ES_MULTILINE, + 0, 0, 200, 60, 0, 0, 0, 0); ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError()); gtl.flags = GTL_NUMCHARS | GTL_PRECISE | GTL_USECRLF; @@ -5431,8 +5439,12 @@ static void test_undo_coalescing(void) char buffer[64] = {0}; /* multi-line control inserts CR normally */ - hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP|ES_MULTILINE, - 0, 0, 200, 60, 0, 0, 0, 0); + if (!is_win9x) + hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP|ES_MULTILINE, + 0, 0, 200, 60, 0, 0, 0, 0); + else + hwnd = CreateWindowExA(0, "RichEdit20A", NULL, WS_POPUP|ES_MULTILINE, + 0, 0, 200, 60, 0, 0, 0, 0); ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError()); result = SendMessage(hwnd, EM_CANUNDO, 0, 0); @@ -5652,16 +5664,16 @@ static void test_word_movement(void) /* Make sure the behaviour is the same with a unicode richedit window, * and using unicode functions. */ - SetLastError(0xdeadbeef); - hwnd = CreateWindowW(RICHEDIT_CLASS20W, NULL, - ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, - 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); - if (!hwnd && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + if (is_win9x) { - win_skip("Needed unicode functions are not implemented\n"); + skip("Cannot test with unicode richedit window\n"); return; } + hwnd = CreateWindowW(RICHEDIT_CLASS20W, NULL, + ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + /* Test with a custom word break procedure that uses X as the delimiter. */ result = SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW); ok (result == TRUE, "Failed to clear the text.\n"); @@ -5829,6 +5841,9 @@ START_TEST( editor ) * RICHED20.DLL, so the linker doesn't actually link to it. */ hmoduleRichEdit = LoadLibrary("RICHED20.DLL"); ok(hmoduleRichEdit != NULL, "error: %d\n", (int) GetLastError()); + + is_win9x = GetVersion() & 0x80000000; + test_WM_CHAR(); test_EM_FINDTEXT(); test_EM_GETLINE();
1
0
0
0
Paul Vriens : comctl32/tests: Destroy the window after the tests.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 1a853abecb33515f9a8596a706106c390c8c14ed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a853abecb33515f9a8596a70…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Mon Dec 15 18:39:06 2008 +0100 comctl32/tests: Destroy the window after the tests. --- dlls/comctl32/tests/comboex.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c index 7add84b..f59d1d1 100644 --- a/dlls/comctl32/tests/comboex.c +++ b/dlls/comctl32/tests/comboex.c @@ -351,6 +351,7 @@ static void cleanup(void) DispatchMessageA(&msg); } + DestroyWindow(hComboExParentWnd); UnregisterClassA(ComboExTestClass, GetModuleHandleA(NULL)); }
1
0
0
0
Paul Vriens : msi/tests: Run tests again on Win9x and NT4.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 017fee4aa0d3295e64260ee61ecf0aebefe3cb5f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=017fee4aa0d3295e64260ee61…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Mon Dec 15 16:29:19 2008 +0100 msi/tests: Run tests again on Win9x and NT4. --- dlls/msi/tests/msi.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 6384f36..7201329 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -10255,9 +10255,9 @@ static void test_MsiGetPatchInfoEx(void) /* pcchValue is too small, lpValue is NULL */ size = 0; - r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, - MSIINSTALLCONTEXT_USERMANAGED, - INSTALLPROPERTY_MOREINFOURL, NULL, &size); + r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid, + MSIINSTALLCONTEXT_USERMANAGED, + INSTALLPROPERTY_MOREINFOURL, NULL, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(size == 16, "Expected 16, got %d\n", size);
1
0
0
0
Paul Vriens : rpcrt4/tests: Move function pointer initialization to the init function.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 5021965d2ec15cc05c838571253997fa582e762b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5021965d2ec15cc05c8385712…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Mon Dec 15 15:06:37 2008 +0100 rpcrt4/tests: Move function pointer initialization to the init function. --- dlls/rpcrt4/tests/server.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index a2d72de..ed4fef9 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -38,6 +38,8 @@ static HANDLE stop_event; static void (WINAPI *pNDRSContextMarshall2)(RPC_BINDING_HANDLE, NDR_SCONTEXT, void*, NDR_RUNDOWN, void*, ULONG); static NDR_SCONTEXT (WINAPI *pNDRSContextUnmarshall2)(RPC_BINDING_HANDLE, void*, ULONG, void*, ULONG); +static RPC_STATUS (WINAPI *pRpcServerRegisterIfEx)(RPC_IF_HANDLE,UUID*, RPC_MGR_EPV*, unsigned int, + unsigned int,RPC_IF_CALLBACK_FN*); static void InitFunctionPointers(void) { @@ -45,6 +47,7 @@ static void InitFunctionPointers(void) pNDRSContextMarshall2 = (void *)GetProcAddress(hrpcrt4, "NDRSContextMarshall2"); pNDRSContextUnmarshall2 = (void *)GetProcAddress(hrpcrt4, "NDRSContextUnmarshall2"); + pRpcServerRegisterIfEx = (void *)GetProcAddress(hrpcrt4, "RpcServerRegisterIfEx"); } void __RPC_FAR *__RPC_USER @@ -1288,8 +1291,6 @@ server(void) static unsigned char np[] = "ncacn_np"; static unsigned char pipe[] = PIPE; RPC_STATUS status, iptcp_status, np_status; - RPC_STATUS (RPC_ENTRY *pRpcServerRegisterIfEx)(RPC_IF_HANDLE,UUID*, - RPC_MGR_EPV*, unsigned int,unsigned int,RPC_IF_CALLBACK_FN*); DWORD ret; iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL); @@ -1300,7 +1301,6 @@ server(void) else ok(np_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %ld\n", np_status); - pRpcServerRegisterIfEx = (void *)GetProcAddress(GetModuleHandle("rpcrt4.dll"), "RpcServerRegisterIfEx"); if (pRpcServerRegisterIfEx) { trace("Using RpcServerRegisterIfEx\n");
1
0
0
0
Paul Vriens : rpcrt4/tests: Use GetModuleHandle instead of LoadLibrary.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 1aa9e3846c2d040366f79e8086a848d5ea02310d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1aa9e3846c2d040366f79e808…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Mon Dec 15 14:58:29 2008 +0100 rpcrt4/tests: Use GetModuleHandle instead of LoadLibrary. --- dlls/rpcrt4/tests/cstub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/tests/cstub.c b/dlls/rpcrt4/tests/cstub.c index 29bcb27..f101a6f 100644 --- a/dlls/rpcrt4/tests/cstub.c +++ b/dlls/rpcrt4/tests/cstub.c @@ -434,7 +434,7 @@ static IPSFactoryBuffer *test_NdrDllGetClassObject(void) const CLSID PSDispatch = {0x20420, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}}; const CLSID CLSID_Unknown = {0x45678, 0x1234, 0x6666, {0xff, 0x67, 0x45, 0x98, 0x76, 0x12, 0x34, 0x56}}; HRESULT r; - HMODULE hmod = LoadLibraryA("rpcrt4.dll"); + HMODULE hmod = GetModuleHandleA("rpcrt4.dll"); void *CStd_QueryInterface = GetProcAddress(hmod, "CStdStubBuffer_QueryInterface"); void *CStd_AddRef = GetProcAddress(hmod, "CStdStubBuffer_AddRef"); void *CStd_Release = GetProcAddress(hmod, "NdrCStdStubBuffer_Release");
1
0
0
0
Paul Vriens : xinput1_3/tests: Call FreeLibrary() after tests.
by Alexandre Julliard
16 Dec '08
16 Dec '08
Module: wine Branch: master Commit: 99eaf51bb72d8c92daa9c03fb471b68c3155b6bc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=99eaf51bb72d8c92daa9c03fb…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Mon Dec 15 14:50:06 2008 +0100 xinput1_3/tests: Call FreeLibrary() after tests. --- dlls/xinput1_3/tests/xinput.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/xinput1_3/tests/xinput.c b/dlls/xinput1_3/tests/xinput.c index ffc0d33..1125dcc 100644 --- a/dlls/xinput1_3/tests/xinput.c +++ b/dlls/xinput1_3/tests/xinput.c @@ -94,15 +94,15 @@ START_TEST(xinput) HMODULE hXinput; hXinput = LoadLibraryA( "xinput1_3.dll" ); - if (hXinput) + if (!hXinput) { - pXInputGetState = (void*)GetProcAddress(hXinput, "XInputGetState"); - pXInputGetCapabilities = (void*)GetProcAddress(hXinput, "XInputGetCapabilities"); - test_get_state(); - test_get_capabilities(); - } - else - { - skip("Could not load xinput1_3.dll\n"); + win_skip("Could not load xinput1_3.dll\n"); + return; } + + pXInputGetState = (void*)GetProcAddress(hXinput, "XInputGetState"); + pXInputGetCapabilities = (void*)GetProcAddress(hXinput, "XInputGetCapabilities"); + test_get_state(); + test_get_capabilities(); + FreeLibrary(hXinput); }
1
0
0
0
← Newer
1
...
53
54
55
56
57
58
59
...
123
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Results per page:
10
25
50
100
200