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
July 2011
----- 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
838 discussions
Start a n
N
ew thread
Michael Stefaniuc : d3d9: COM cleanup for the IDirect3DSurface9 iface.
by Alexandre Julliard
07 Jul '11
07 Jul '11
Module: wine Branch: master Commit: 4e31d28cff3b619a13da3f6e6f501939b457a96b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4e31d28cff3b619a13da3f6e6…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 7 10:59:49 2011 +0200 d3d9: COM cleanup for the IDirect3DSurface9 iface. --- dlls/d3d9/d3d9_private.h | 5 +-- dlls/d3d9/device.c | 8 ++-- dlls/d3d9/surface.c | 69 ++++++++++++++++++++++++++++------------------ 3 files changed, 48 insertions(+), 34 deletions(-) diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 8d592be..76fef72 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -223,9 +223,8 @@ HRESULT swapchain_init(IDirect3DSwapChain9Impl *swapchain, IDirect3DDevice9Impl */ typedef struct IDirect3DSurface9Impl { - /* IUnknown fields */ - const IDirect3DSurface9Vtbl *lpVtbl; - LONG ref; + IDirect3DSurface9 IDirect3DSurface9_iface; + LONG ref; struct wined3d_surface *wined3d_surface; IDirect3DDevice9Ex *parentDevice; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 200b611..2866126 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -920,7 +920,7 @@ static HRESULT IDirect3DDevice9Impl_CreateSurface(IDirect3DDevice9Impl *device, } TRACE("Created surface %p.\n", object); - *ppSurface = (IDirect3DSurface9 *)object; + *ppSurface = &object->IDirect3DSurface9_iface; return D3D_OK; } @@ -3142,7 +3142,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent * IDirect3DDevice9Ex_Release(d3d_surface->parentDevice); d3d_surface->parentDevice = NULL; - IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface); + IDirect3DSurface9_Release(&d3d_surface->IDirect3DSurface9_iface); d3d_surface->forwardReference = container_parent; return hr; @@ -3176,7 +3176,7 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par d3d_surface->container = container_parent; /* Implicit surfaces are created with an refcount of 0 */ - IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface); + IDirect3DSurface9_Release(&d3d_surface->IDirect3DSurface9_iface); return hr; } @@ -3206,7 +3206,7 @@ static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_pa wined3d_surface_incref(*surface); d3d_surface->container = (IUnknown *)&device->IDirect3DDevice9Ex_iface; /* Implicit surfaces are created with an refcount of 0 */ - IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface); + IDirect3DSurface9_Release(&d3d_surface->IDirect3DSurface9_iface); return hr; } diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index 3f3ac3c..126b947 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -27,12 +27,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d9); static inline IDirect3DSurface9Impl *impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) { - return CONTAINING_RECORD(iface, IDirect3DSurface9Impl, lpVtbl); + return CONTAINING_RECORD(iface, IDirect3DSurface9Impl, IDirect3DSurface9_iface); } /* IDirect3DSurface9 IUnknown parts follow: */ -static HRESULT WINAPI IDirect3DSurface9Impl_QueryInterface(LPDIRECT3DSURFACE9 iface, REFIID riid, LPVOID* ppobj) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static HRESULT WINAPI IDirect3DSurface9Impl_QueryInterface(IDirect3DSurface9 *iface, REFIID riid, + void **ppobj) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), ppobj); @@ -49,8 +51,9 @@ static HRESULT WINAPI IDirect3DSurface9Impl_QueryInterface(LPDIRECT3DSURFACE9 if return E_NOINTERFACE; } -static ULONG WINAPI IDirect3DSurface9Impl_AddRef(LPDIRECT3DSURFACE9 iface) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static ULONG WINAPI IDirect3DSurface9Impl_AddRef(IDirect3DSurface9 *iface) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); TRACE("iface %p.\n", iface); @@ -77,8 +80,9 @@ static ULONG WINAPI IDirect3DSurface9Impl_AddRef(LPDIRECT3DSURFACE9 iface) { } -static ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static ULONG WINAPI IDirect3DSurface9Impl_Release(IDirect3DSurface9 *iface) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); TRACE("iface %p.\n", iface); @@ -108,9 +112,10 @@ static ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface) { } /* IDirect3DSurface9 IDirect3DResource9 Interface follow: */ -static HRESULT WINAPI IDirect3DSurface9Impl_GetDevice(IDirect3DSurface9 *iface, IDirect3DDevice9 **device) +static HRESULT WINAPI IDirect3DSurface9Impl_GetDevice(IDirect3DSurface9 *iface, + IDirect3DDevice9 **device) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); TRACE("iface %p, device %p.\n", iface, device); @@ -191,8 +196,9 @@ static HRESULT WINAPI IDirect3DSurface9Impl_FreePrivateData(IDirect3DSurface9 *i return hr; } -static DWORD WINAPI IDirect3DSurface9Impl_SetPriority(LPDIRECT3DSURFACE9 iface, DWORD PriorityNew) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static DWORD WINAPI IDirect3DSurface9Impl_SetPriority(IDirect3DSurface9 *iface, DWORD PriorityNew) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); HRESULT hr; TRACE("iface %p, priority %u.\n", iface, PriorityNew); @@ -204,8 +210,9 @@ static DWORD WINAPI IDirect3DSurface9Impl_SetPriority(LPDIRECT3DSURFACE9 iface, return hr; } -static DWORD WINAPI IDirect3DSurface9Impl_GetPriority(LPDIRECT3DSURFACE9 iface) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static DWORD WINAPI IDirect3DSurface9Impl_GetPriority(IDirect3DSurface9 *iface) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); HRESULT hr; TRACE("iface %p.\n", iface); @@ -217,8 +224,9 @@ static DWORD WINAPI IDirect3DSurface9Impl_GetPriority(LPDIRECT3DSURFACE9 iface) return hr; } -static void WINAPI IDirect3DSurface9Impl_PreLoad(LPDIRECT3DSURFACE9 iface) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static void WINAPI IDirect3DSurface9Impl_PreLoad(IDirect3DSurface9 *iface) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); TRACE("iface %p.\n", iface); @@ -235,8 +243,10 @@ static D3DRESOURCETYPE WINAPI IDirect3DSurface9Impl_GetType(IDirect3DSurface9 *i } /* IDirect3DSurface9 Interface follow: */ -static HRESULT WINAPI IDirect3DSurface9Impl_GetContainer(LPDIRECT3DSURFACE9 iface, REFIID riid, void** ppContainer) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static HRESULT WINAPI IDirect3DSurface9Impl_GetContainer(IDirect3DSurface9 *iface, REFIID riid, + void **ppContainer) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); HRESULT res; TRACE("iface %p, riid %s, container %p.\n", iface, debugstr_guid(riid), ppContainer); @@ -252,7 +262,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetContainer(LPDIRECT3DSURFACE9 ifac static HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(IDirect3DSurface9 *iface, D3DSURFACE_DESC *desc) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); struct wined3d_resource_desc wined3d_desc; struct wined3d_resource *wined3d_resource; @@ -275,8 +285,10 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(IDirect3DSurface9 *iface, D3 return D3D_OK; } -static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(LPDIRECT3DSURFACE9 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(IDirect3DSurface9 *iface, + D3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); HRESULT hr; TRACE("iface %p, locked_rect %p, rect %p, flags %#x.\n", iface, pLockedRect, pRect, Flags); @@ -288,8 +300,9 @@ static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(LPDIRECT3DSURFACE9 iface, D return hr; } -static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(IDirect3DSurface9 *iface) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); HRESULT hr; TRACE("iface %p.\n", iface); @@ -305,8 +318,9 @@ static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface) } } -static HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC* phdc) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static HRESULT WINAPI IDirect3DSurface9Impl_GetDC(IDirect3DSurface9 *iface, HDC* phdc) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); HRESULT hr; TRACE("iface %p, hdc %p.\n", iface, phdc); @@ -325,8 +339,9 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC* return hr; } -static HRESULT WINAPI IDirect3DSurface9Impl_ReleaseDC(LPDIRECT3DSURFACE9 iface, HDC hdc) { - IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; +static HRESULT WINAPI IDirect3DSurface9Impl_ReleaseDC(IDirect3DSurface9 *iface, HDC hdc) +{ + IDirect3DSurface9Impl *This = impl_from_IDirect3DSurface9(iface); HRESULT hr; TRACE("iface %p, hdc %p.\n", iface, hdc); @@ -382,7 +397,7 @@ HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *devic { HRESULT hr; - surface->lpVtbl = &Direct3DSurface9_Vtbl; + surface->IDirect3DSurface9_iface.lpVtbl = &Direct3DSurface9_Vtbl; surface->ref = 1; switch (format)
1
0
0
0
Michael Stefaniuc : d3d9: Use unsafe_impl_from_IDirect3DSurface9 for app provided ifaces.
by Alexandre Julliard
07 Jul '11
07 Jul '11
Module: wine Branch: master Commit: a7530e789273db28d988d51810cb5a9e8971c4dd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a7530e789273db28d988d5181…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 7 10:54:02 2011 +0200 d3d9: Use unsafe_impl_from_IDirect3DSurface9 for app provided ifaces. --- dlls/d3d9/d3d9_private.h | 1 + dlls/d3d9/device.c | 27 +++++++++++++-------------- dlls/d3d9/surface.c | 10 ++++++++++ dlls/d3d9/swapchain.c | 8 +++++--- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index fb6e7e6..8d592be 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -241,6 +241,7 @@ typedef struct IDirect3DSurface9Impl HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device, UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level, DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN; +IDirect3DSurface9Impl *unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) DECLSPEC_HIDDEN; /* ---------------------- */ /* IDirect3DVertexBuffer9 */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 0f33a27..200b611 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -400,7 +400,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(IDirect3DDevice9E UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9 *pCursorBitmap) { IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DSurface9Impl *pSurface = (IDirect3DSurface9Impl*)pCursorBitmap; + IDirect3DSurface9Impl *pSurface = unsafe_impl_from_IDirect3DSurface9(pCursorBitmap); HRESULT hr; TRACE("iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.\n", @@ -970,15 +970,16 @@ static HRESULT WINAPI IDirect3DDevice9Impl_UpdateSurface(IDirect3DDevice9Ex *ifa IDirect3DSurface9 *pDestinationSurface, const POINT *pDestPoint) { IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); + IDirect3DSurface9Impl *src = unsafe_impl_from_IDirect3DSurface9(pSourceSurface); + IDirect3DSurface9Impl *dst = unsafe_impl_from_IDirect3DSurface9(pDestinationSurface); HRESULT hr; TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_point %p.\n", iface, pSourceSurface, pSourceRect, pDestinationSurface, pDestPoint); wined3d_mutex_lock(); - hr = wined3d_device_update_surface(This->wined3d_device, - ((IDirect3DSurface9Impl *)pSourceSurface)->wined3d_surface, pSourceRect, - ((IDirect3DSurface9Impl *)pDestinationSurface)->wined3d_surface, pDestPoint); + hr = wined3d_device_update_surface(This->wined3d_device, src->wined3d_surface, pSourceRect, + dst->wined3d_surface, pDestPoint); wined3d_mutex_unlock(); return hr; @@ -1004,8 +1005,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_UpdateTexture(IDirect3DDevice9Ex *ifa static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTargetData(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *pRenderTarget, IDirect3DSurface9 *pDestSurface) { - IDirect3DSurface9Impl *renderTarget = (IDirect3DSurface9Impl *)pRenderTarget; - IDirect3DSurface9Impl *destSurface = (IDirect3DSurface9Impl *)pDestSurface; + IDirect3DSurface9Impl *renderTarget = unsafe_impl_from_IDirect3DSurface9(pRenderTarget); + IDirect3DSurface9Impl *destSurface = unsafe_impl_from_IDirect3DSurface9(pDestSurface); HRESULT hr; TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, pRenderTarget, pDestSurface); @@ -1022,7 +1023,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(IDirect3DDevice9Ex UINT iSwapChain, IDirect3DSurface9 *pDestSurface) { IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DSurface9Impl *destSurface = (IDirect3DSurface9Impl *)pDestSurface; + IDirect3DSurface9Impl *destSurface = unsafe_impl_from_IDirect3DSurface9(pDestSurface); HRESULT hr; TRACE("iface %p, swapchain %u, dst_surface %p.\n", iface, iSwapChain, pDestSurface); @@ -1037,8 +1038,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(IDirect3DDevice9Ex static HRESULT WINAPI IDirect3DDevice9Impl_StretchRect(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *pSourceSurface, const RECT *pSourceRect, IDirect3DSurface9 *pDestSurface, const RECT *pDestRect, D3DTEXTUREFILTERTYPE Filter) { - IDirect3DSurface9Impl *src = (IDirect3DSurface9Impl *) pSourceSurface; - IDirect3DSurface9Impl *dst = (IDirect3DSurface9Impl *) pDestSurface; + IDirect3DSurface9Impl *src = unsafe_impl_from_IDirect3DSurface9(pSourceSurface); + IDirect3DSurface9Impl *dst = unsafe_impl_from_IDirect3DSurface9(pDestSurface); HRESULT hr; TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_rect %p, filter %#x.\n", @@ -1062,7 +1063,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface, ((color >> 24) & 0xff) / 255.0f, }; IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DSurface9Impl *surface = (IDirect3DSurface9Impl *)pSurface; + IDirect3DSurface9Impl *surface = unsafe_impl_from_IDirect3DSurface9(pSurface); struct wined3d_resource *wined3d_resource; struct wined3d_resource_desc desc; HRESULT hr; @@ -1124,7 +1125,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(IDirect3DDevice9Ex *i DWORD RenderTargetIndex, IDirect3DSurface9 *pRenderTarget) { IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DSurface9Impl *pSurface = (IDirect3DSurface9Impl*)pRenderTarget; + IDirect3DSurface9Impl *pSurface = unsafe_impl_from_IDirect3DSurface9(pRenderTarget); HRESULT hr; TRACE("iface %p, idx %u, surface %p.\n", iface, RenderTargetIndex, pRenderTarget); @@ -1190,13 +1191,11 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetDepthStencilSurface(IDirect3DDevic IDirect3DSurface9 *pZStencilSurface) { IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DSurface9Impl *pSurface; + IDirect3DSurface9Impl *pSurface = unsafe_impl_from_IDirect3DSurface9(pZStencilSurface); HRESULT hr; TRACE("iface %p, depth_stencil %p.\n", iface, pZStencilSurface); - pSurface = (IDirect3DSurface9Impl*)pZStencilSurface; - wined3d_mutex_lock(); hr = wined3d_device_set_depth_stencil(This->wined3d_device, pSurface ? pSurface->wined3d_surface : NULL); wined3d_mutex_unlock(); diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index a4111ff..3f3ac3c 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -20,6 +20,7 @@ */ #include "config.h" +#include <assert.h> #include "d3d9_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d9); @@ -423,3 +424,12 @@ HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *devic return D3D_OK; } + +IDirect3DSurface9Impl *unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &Direct3DSurface9_Vtbl); + + return impl_from_IDirect3DSurface9(iface); +} diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c index 2643707..f316058 100644 --- a/dlls/d3d9/swapchain.c +++ b/dlls/d3d9/swapchain.c @@ -98,15 +98,17 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DSwapChain9Impl_Present(LPDIRECT return hr; } -static HRESULT WINAPI IDirect3DSwapChain9Impl_GetFrontBufferData(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DSurface9* pDestSurface) { +static HRESULT WINAPI IDirect3DSwapChain9Impl_GetFrontBufferData(IDirect3DSwapChain9 *iface, + IDirect3DSurface9 *pDestSurface) +{ IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface; + IDirect3DSurface9Impl *dst = unsafe_impl_from_IDirect3DSurface9(pDestSurface); HRESULT hr; TRACE("iface %p, surface %p.\n", iface, pDestSurface); wined3d_mutex_lock(); - hr = wined3d_swapchain_get_front_buffer_data(This->wined3d_swapchain, - ((IDirect3DSurface9Impl *)pDestSurface)->wined3d_surface); + hr = wined3d_swapchain_get_front_buffer_data(This->wined3d_swapchain, dst->wined3d_surface); wined3d_mutex_unlock(); return hr;
1
0
0
0
Henri Verbeet : wined3d: Rename "flag" to "location" in surface_modify_location().
by Alexandre Julliard
07 Jul '11
07 Jul '11
Module: wine Branch: master Commit: 640234c504babbaf61dfd57848803aa838ebf79d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=640234c504babbaf61dfd5784…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 6 23:14:28 2011 +0200 wined3d: Rename "flag" to "location" in surface_modify_location(). --- dlls/wined3d/surface.c | 28 ++++++++++++++-------------- dlls/wined3d/wined3d_private.h | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 439cb2f..d44904d 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -5793,20 +5793,22 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } -void surface_modify_location(struct wined3d_surface *surface, DWORD flag, BOOL persistent) +void surface_modify_location(struct wined3d_surface *surface, DWORD location, BOOL persistent) { const struct wined3d_gl_info *gl_info = &surface->resource.device->adapter->gl_info; struct wined3d_surface *overlay; TRACE("surface %p, location %s, persistent %#x.\n", - surface, debug_surflocation(flag), persistent); + surface, debug_surflocation(location), persistent); if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { if (surface_is_offscreen(surface)) { - /* With ORM_FBO, SFLAG_INTEXTURE and SFLAG_INDRAWABLE are the same for offscreen targets. */ - if (flag & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE)) flag |= (SFLAG_INTEXTURE | SFLAG_INDRAWABLE); + /* With ORM_FBO, SFLAG_INTEXTURE and SFLAG_INDRAWABLE are the same + * for offscreen targets. */ + if (location & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE)) + location |= (SFLAG_INTEXTURE | SFLAG_INDRAWABLE); } else { @@ -5814,16 +5816,14 @@ void surface_modify_location(struct wined3d_surface *surface, DWORD flag, BOOL p } } - if (flag & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX) + if (location & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX) && gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) - { - flag |= (SFLAG_INTEXTURE | SFLAG_INSRGBTEX); - } + location |= (SFLAG_INTEXTURE | SFLAG_INSRGBTEX); if (persistent) { - if (((surface->flags & SFLAG_INTEXTURE) && !(flag & SFLAG_INTEXTURE)) - || ((surface->flags & SFLAG_INSRGBTEX) && !(flag & SFLAG_INSRGBTEX))) + if (((surface->flags & SFLAG_INTEXTURE) && !(location & SFLAG_INTEXTURE)) + || ((surface->flags & SFLAG_INSRGBTEX) && !(location & SFLAG_INSRGBTEX))) { if (surface->container.type == WINED3D_CONTAINER_TEXTURE) { @@ -5832,10 +5832,10 @@ void surface_modify_location(struct wined3d_surface *surface, DWORD flag, BOOL p } } surface->flags &= ~SFLAG_LOCATIONS; - surface->flags |= flag; + surface->flags |= location; /* Redraw emulated overlays, if any */ - if (flag & SFLAG_INDRAWABLE && !list_empty(&surface->overlays)) + if (location & SFLAG_INDRAWABLE && !list_empty(&surface->overlays)) { LIST_FOR_EACH_ENTRY(overlay, &surface->overlays, struct wined3d_surface, overlay_entry) { @@ -5845,7 +5845,7 @@ void surface_modify_location(struct wined3d_surface *surface, DWORD flag, BOOL p } else { - if ((surface->flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)) && (flag & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX))) + if ((surface->flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)) && (location & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX))) { if (surface->container.type == WINED3D_CONTAINER_TEXTURE) { @@ -5853,7 +5853,7 @@ void surface_modify_location(struct wined3d_surface *surface, DWORD flag, BOOL p wined3d_texture_set_dirty(surface->container.u.texture, TRUE); } } - surface->flags &= ~flag; + surface->flags &= ~location; } if (!(surface->flags & SFLAG_LOCATIONS)) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ae660a2..535e2d3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2075,9 +2075,9 @@ BOOL surface_is_offscreen(const struct wined3d_surface *surface) DECLSPEC_HIDDEN HRESULT surface_load(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -HRESULT surface_load_location(struct wined3d_surface *surface, DWORD flag, const RECT *rect) DECLSPEC_HIDDEN; +HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location, const RECT *rect) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; -void surface_modify_location(struct wined3d_surface *surface, DWORD flag, BOOL persistent) DECLSPEC_HIDDEN; +void surface_modify_location(struct wined3d_surface *surface, DWORD location, BOOL persistent) DECLSPEC_HIDDEN; void surface_prepare_texture(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN; void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, struct wined3d_surface *rt) DECLSPEC_HIDDEN;
1
0
0
0
Henri Verbeet : wined3d: Make the surface parameter to surface_get_texture_name() const.
by Alexandre Julliard
07 Jul '11
07 Jul '11
Module: wine Branch: master Commit: 67724d9f706e62adedd56aecaf144219e6071461 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=67724d9f706e62adedd56aeca…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 6 23:14:27 2011 +0200 wined3d: Make the surface parameter to surface_get_texture_name() const. --- dlls/wined3d/wined3d_private.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 2ba3e14..ae660a2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2058,7 +2058,7 @@ static inline struct wined3d_surface *surface_from_resource(struct wined3d_resou return CONTAINING_RECORD(resource, struct wined3d_surface, resource); } -static inline GLuint surface_get_texture_name(struct wined3d_surface *surface, +static inline GLuint surface_get_texture_name(const struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL srgb) { return srgb && !gl_info->supported[EXT_TEXTURE_SRGB_DECODE]
1
0
0
0
Henri Verbeet : wined3d: Make the current_renderbuffer field in struct wined3d_surface const.
by Alexandre Julliard
07 Jul '11
07 Jul '11
Module: wine Branch: master Commit: bec379e411fd039e2c008eb0434673802d768280 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bec379e411fd039e2c008eb04…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 6 23:14:26 2011 +0200 wined3d: Make the current_renderbuffer field in struct wined3d_surface const. --- dlls/wined3d/wined3d_private.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8541fcd..2ba3e14 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2039,7 +2039,7 @@ struct wined3d_surface WINEDDCOLORKEY glCKey; struct list renderbuffers; - struct wined3d_renderbuffer_entry *current_renderbuffer; + const struct wined3d_renderbuffer_entry *current_renderbuffer; SIZE ds_current_size; /* DirectDraw clippers */
1
0
0
0
Henri Verbeet : wined3d: Make the context parameter to the get_drawable_size() callback const.
by Alexandre Julliard
07 Jul '11
07 Jul '11
Module: wine Branch: master Commit: 4671f86cd6bfdd16818c292c95d82766c8d89b69 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4671f86cd6bfdd16818c292c9…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 6 23:14:25 2011 +0200 wined3d: Make the context parameter to the get_drawable_size() callback const. --- dlls/wined3d/device.c | 6 +++--- dlls/wined3d/swapchain.c | 2 +- dlls/wined3d/wined3d_private.h | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 514630c..b10fde6 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -6185,16 +6185,16 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) } } -void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *height) +void get_drawable_size_fbo(const struct wined3d_context *context, UINT *width, UINT *height) { /* The drawable size of a fbo target is the opengl texture size, which is the power of two size. */ *width = context->current_rt->pow2Width; *height = context->current_rt->pow2Height; } -void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height) +void get_drawable_size_backbuffer(const struct wined3d_context *context, UINT *width, UINT *height) { - struct wined3d_swapchain *swapchain = context->swapchain; + const struct wined3d_swapchain *swapchain = context->swapchain; /* The drawable size of a backbuffer / aux buffer offscreen target is the size of the * current context's drawable, which is the size of the back buffer of the swapchain * the active context belongs to. */ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 5848f37..405d89f 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1190,7 +1190,7 @@ struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchai return swapchain_create_context(swapchain); } -void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, UINT *height) +void get_drawable_size_swapchain(const struct wined3d_context *context, UINT *width, UINT *height) { /* The drawable size of an onscreen drawable is the surface size. * (Actually: The window size, but the surface is created in window size) */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7f23111..8541fcd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2011,7 +2011,7 @@ struct wined3d_surface UINT pow2Height; /* A method to retrieve the drawable size. Not in the Vtable to make it changeable */ - void (*get_drawable_size)(struct wined3d_context *context, UINT *width, UINT *height); + void (*get_drawable_size)(const struct wined3d_context *context, UINT *width, UINT *height); /* PBO */ GLuint pbo; @@ -2090,9 +2090,9 @@ void surface_upload_data(struct wined3d_surface *surface, const struct wined3d_g const struct wined3d_format *format, const RECT *src_rect, UINT src_w, const POINT *dst_point, BOOL srgb, const struct wined3d_bo_address *data) DECLSPEC_HIDDEN; -void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; -void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; -void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; +void get_drawable_size_swapchain(const struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; +void get_drawable_size_backbuffer(const struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; +void get_drawable_size_fbo(const struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; void draw_textured_quad(struct wined3d_surface *src_surface, const RECT *src_rect, const RECT *dst_rect, WINED3DTEXTUREFILTERTYPE Filter) DECLSPEC_HIDDEN;
1
0
0
0
Henri Verbeet : wined3d: Make the device parameter to device_preload_textures() const.
by Alexandre Julliard
07 Jul '11
07 Jul '11
Module: wine Branch: master Commit: 0a5b56083d9e27dbf94644267a25ea4fb69bca9f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0a5b56083d9e27dbf94644267…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 6 23:14:24 2011 +0200 wined3d: Make the device parameter to device_preload_textures() const. --- dlls/wined3d/device.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index bc9c716..514630c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -461,7 +461,7 @@ static void device_preload_texture(const struct wined3d_state *state, unsigned i texture->texture_ops->texture_preload(texture, srgb); } -void device_preload_textures(struct wined3d_device *device) +void device_preload_textures(const struct wined3d_device *device) { const struct wined3d_state *state = &device->stateBlock->state; unsigned int i; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4000ed2..7f23111 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1753,7 +1753,7 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, UINT adapter_idx, WINED3DDEVTYPE device_type, HWND focus_window, DWORD flags, BYTE surface_alignment, struct wined3d_device_parent *device_parent) DECLSPEC_HIDDEN; -void device_preload_textures(struct wined3d_device *device) DECLSPEC_HIDDEN; +void device_preload_textures(const struct wined3d_device *device) DECLSPEC_HIDDEN; LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL unicode, UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
1
0
0
0
André Hentschel : kernel32/tests: Fix warning on non-x86 platforms.
by Alexandre Julliard
07 Jul '11
07 Jul '11
Module: wine Branch: master Commit: ff63e42785143a62a1ebb22ab206433733931290 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ff63e42785143a62a1ebb22ab…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Jul 6 20:08:40 2011 +0200 kernel32/tests: Fix warning on non-x86 platforms. --- dlls/kernel32/tests/thread.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index e35e0e4..03983f5 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -1351,19 +1351,16 @@ static void test_ThreadErrorMode(void) pSetThreadErrorMode(oldmode, NULL); } +#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) static inline void set_fpu_cw(WORD cw) { -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ volatile ("fnclex; fldcw %0" : : "m" (cw)); -#endif } static inline WORD get_fpu_cw(void) { WORD cw = 0; -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ volatile ("fnstcw %0" : "=m" (cw)); -#endif return cw; } @@ -1431,6 +1428,7 @@ static void test_thread_fpu_cw(void) cw = get_fpu_cw(); ok(cw == initial_cw, "Expected FPU control word %#x, got %#x.\n", initial_cw, cw); } +#endif START_TEST(thread) {
1
0
0
0
Alexandre Julliard : cmd/tests: Rewrite replace_escaped_spaces to avoid overflows.
by Alexandre Julliard
06 Jul '11
06 Jul '11
Module: wine Branch: master Commit: 766dc67043e3e65a729a76014654d3250cc9e76e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=766dc67043e3e65a729a76014…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 6 19:51:51 2011 +0200 cmd/tests: Rewrite replace_escaped_spaces to avoid overflows. Spotted by Marcus Meissner. --- programs/cmd/tests/batch.c | 28 +++++++++------------------- 1 files changed, 9 insertions(+), 19 deletions(-) diff --git a/programs/cmd/tests/batch.c b/programs/cmd/tests/batch.c index 3c12fe7..95366da 100644 --- a/programs/cmd/tests/batch.c +++ b/programs/cmd/tests/batch.c @@ -29,29 +29,19 @@ static DWORD workdir_len; static const char* replace_escaped_spaces(const char *data, DWORD size, DWORD *new_size) { static const char escaped_space[] = {'@','s','p','a','c','e','@','\0'}; - const char *a, *b; - char *new_data; - DWORD len_space = sizeof(escaped_space) -1; + char *ptr, *new_data; - a = b = data; - *new_size = 0; + new_data = ptr = HeapAlloc(GetProcessHeap(), 0, size + 1); + memcpy( new_data, data, size ); + new_data[size] = 0; - new_data = HeapAlloc(GetProcessHeap(), 0, size*sizeof(char)); - ok(new_data != NULL, "HeapAlloc failed\n"); - if(!new_data) - return NULL; - - while( (b = strstr(a, escaped_space)) ) + while ((ptr = strstr(ptr, escaped_space))) { - strncpy(new_data + *new_size, a, b-a + 1); - *new_size += b-a + 1; - new_data[*new_size - 1] = ' '; - a = b + len_space; + char *end = ptr + sizeof(escaped_space) - 1; + *ptr++ = ' '; + memmove( ptr, end, strlen(end) + 1 ); } - - strncpy(new_data + *new_size, a, strlen(a) + 1); - *new_size += strlen(a); - + *new_size = strlen(new_data); return new_data; }
1
0
0
0
Vincent Povirk : winex11.drv: Process keyboard events when QS_HOTKEY is specified.
by Alexandre Julliard
06 Jul '11
06 Jul '11
Module: wine Branch: master Commit: 7a21d06295269e19139abf50a50cdc857fdb2078 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a21d06295269e19139abf50a…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Jun 17 14:01:13 2011 -0500 winex11.drv: Process keyboard events when QS_HOTKEY is specified. --- dlls/winex11.drv/event.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 419ad0f..00915cf 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -213,7 +213,7 @@ static Bool filter_event( Display *display, XEvent *event, char *arg ) case KeyRelease: case KeymapNotify: case MappingNotify: - return (mask & QS_KEY) != 0; + return (mask & (QS_KEY|QS_HOTKEY)) != 0; case ButtonPress: case ButtonRelease: return (mask & QS_MOUSEBUTTON) != 0;
1
0
0
0
← Newer
1
...
63
64
65
66
67
68
69
...
84
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
Results per page:
10
25
50
100
200