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
June 2012
----- 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
3 participants
827 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Set undefined vertex attributes to 0.0.
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: 611b541f292761e459eac4eb1cf88d765b939ff8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=611b541f292761e459eac4eb1…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jun 12 17:03:49 2012 +0200 wined3d: Set undefined vertex attributes to 0.0. --- dlls/wined3d/state.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index f2da77c..35e1736 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4082,7 +4082,10 @@ static void load_numbered_arrays(struct wined3d_context *context, if (!(stream_info->use_map & (1 << i))) { - if (context->numbered_array_mask & (1 << i)) unload_numbered_array(context, i); + if (context->numbered_array_mask & (1 << i)) + unload_numbered_array(context, i); + if (state->vertex_shader->reg_maps.input_registers & (1 << i)) + GL_EXTCALL(glVertexAttrib4fARB(i, 0.0f, 0.0f, 0.0f, 0.0f)); continue; }
1
0
0
0
Henri Verbeet : d3d9: Get rid of IDirect3DQuery9Impl.
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: 56fffd06597c056655bf270fb0f8fe1134466f74 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=56fffd06597c056655bf270fb…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jun 12 17:03:48 2012 +0200 d3d9: Get rid of IDirect3DQuery9Impl. --- dlls/d3d9/d3d9_private.h | 26 +++-------- dlls/d3d9/device.c | 2 +- dlls/d3d9/query.c | 108 ++++++++++++++++++++++----------------------- 3 files changed, 62 insertions(+), 74 deletions(-) diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 6925272..60bcc72 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -299,24 +299,14 @@ HRESULT pixelshader_init(struct d3d9_pixelshader *shader, struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN; struct d3d9_pixelshader *unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) DECLSPEC_HIDDEN; -/* --------------- */ -/* IDirect3DQuery9 */ -/* --------------- */ - -/***************************************************************************** - * IDirect3DPixelShader implementation structure - */ -typedef struct IDirect3DQuery9Impl { - IDirect3DQuery9 IDirect3DQuery9_iface; - LONG ref; - - /* IDirect3DQuery9 fields */ - struct wined3d_query *wineD3DQuery; - - /* Parent reference */ - IDirect3DDevice9Ex *parentDevice; -} IDirect3DQuery9Impl; +struct d3d9_query +{ + IDirect3DQuery9 IDirect3DQuery9_iface; + LONG refcount; + struct wined3d_query *wined3d_query; + IDirect3DDevice9Ex *parent_device; +}; -HRESULT query_init(IDirect3DQuery9Impl *query, struct d3d9_device *device, D3DQUERYTYPE type) DECLSPEC_HIDDEN; +HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUERYTYPE type) DECLSPEC_HIDDEN; #endif /* __WINE_D3D9_PRIVATE_H */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 1cfeace..1014c27 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2760,7 +2760,7 @@ static HRESULT WINAPI d3d9_device_DeletePatch(IDirect3DDevice9Ex *iface, UINT ha static HRESULT WINAPI d3d9_device_CreateQuery(IDirect3DDevice9Ex *iface, D3DQUERYTYPE type, IDirect3DQuery9 **query) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DQuery9Impl *object; + struct d3d9_query *object; HRESULT hr; TRACE("iface %p, type %#x, query %p.\n", iface, type, query); diff --git a/dlls/d3d9/query.c b/dlls/d3d9/query.c index 20dcfc4..d363413 100644 --- a/dlls/d3d9/query.c +++ b/dlls/d3d9/query.c @@ -25,66 +25,65 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d9); -static inline IDirect3DQuery9Impl *impl_from_IDirect3DQuery9(IDirect3DQuery9 *iface) +static inline struct d3d9_query *impl_from_IDirect3DQuery9(IDirect3DQuery9 *iface) { - return CONTAINING_RECORD(iface, IDirect3DQuery9Impl, IDirect3DQuery9_iface); + return CONTAINING_RECORD(iface, struct d3d9_query, IDirect3DQuery9_iface); } -static HRESULT WINAPI IDirect3DQuery9Impl_QueryInterface(IDirect3DQuery9 *iface, REFIID riid, - void **ppobj) +static HRESULT WINAPI d3d9_query_QueryInterface(IDirect3DQuery9 *iface, REFIID riid, void **out) { - TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), ppobj); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IDirect3DQuery9) || IsEqualGUID(riid, &IID_IUnknown)) { IDirect3DQuery9_AddRef(iface); - *ppobj = iface; + *out = iface; return S_OK; } WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - *ppobj = NULL; + *out = NULL; return E_NOINTERFACE; } -static ULONG WINAPI IDirect3DQuery9Impl_AddRef(IDirect3DQuery9 *iface) +static ULONG WINAPI d3d9_query_AddRef(IDirect3DQuery9 *iface) { - IDirect3DQuery9Impl *This = impl_from_IDirect3DQuery9(iface); - ULONG ref = InterlockedIncrement(&This->ref); + struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); + ULONG refcount = InterlockedIncrement(&query->refcount); - TRACE("%p increasing refcount to %u.\n", iface, ref); + TRACE("%p increasing refcount to %u.\n", iface, refcount); - return ref; + return refcount; } -static ULONG WINAPI IDirect3DQuery9Impl_Release(IDirect3DQuery9 *iface) +static ULONG WINAPI d3d9_query_Release(IDirect3DQuery9 *iface) { - IDirect3DQuery9Impl *This = impl_from_IDirect3DQuery9(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); + ULONG refcount = InterlockedDecrement(&query->refcount); - TRACE("%p decreasing refcount to %u.\n", iface, ref); + TRACE("%p decreasing refcount to %u.\n", iface, refcount); - if (ref == 0) { + if (!refcount) + { wined3d_mutex_lock(); - wined3d_query_decref(This->wineD3DQuery); + wined3d_query_decref(query->wined3d_query); wined3d_mutex_unlock(); - IDirect3DDevice9Ex_Release(This->parentDevice); - HeapFree(GetProcessHeap(), 0, This); + IDirect3DDevice9Ex_Release(query->parent_device); + HeapFree(GetProcessHeap(), 0, query); } - return ref; + return refcount; } -static HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(IDirect3DQuery9 *iface, - IDirect3DDevice9 **device) +static HRESULT WINAPI d3d9_query_GetDevice(IDirect3DQuery9 *iface, IDirect3DDevice9 **device) { - IDirect3DQuery9Impl *This = impl_from_IDirect3DQuery9(iface); + struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (IDirect3DDevice9 *)This->parentDevice; + *device = (IDirect3DDevice9 *)query->parent_device; IDirect3DDevice9_AddRef(*device); TRACE("Returning device %p.\n", *device); @@ -92,86 +91,85 @@ static HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(IDirect3DQuery9 *iface, return D3D_OK; } -static D3DQUERYTYPE WINAPI IDirect3DQuery9Impl_GetType(IDirect3DQuery9 *iface) +static D3DQUERYTYPE WINAPI d3d9_query_GetType(IDirect3DQuery9 *iface) { - IDirect3DQuery9Impl *This = impl_from_IDirect3DQuery9(iface); + struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); D3DQUERYTYPE type; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - type = wined3d_query_get_type(This->wineD3DQuery); + type = wined3d_query_get_type(query->wined3d_query); wined3d_mutex_unlock(); return type; } -static DWORD WINAPI IDirect3DQuery9Impl_GetDataSize(IDirect3DQuery9 *iface) +static DWORD WINAPI d3d9_query_GetDataSize(IDirect3DQuery9 *iface) { - IDirect3DQuery9Impl *This = impl_from_IDirect3DQuery9(iface); + struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_query_get_data_size(This->wineD3DQuery); + ret = wined3d_query_get_data_size(query->wined3d_query); wined3d_mutex_unlock(); return ret; } -static HRESULT WINAPI IDirect3DQuery9Impl_Issue(IDirect3DQuery9 *iface, DWORD dwIssueFlags) +static HRESULT WINAPI d3d9_query_Issue(IDirect3DQuery9 *iface, DWORD flags) { - IDirect3DQuery9Impl *This = impl_from_IDirect3DQuery9(iface); + struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); HRESULT hr; - TRACE("iface %p, flags %#x.\n", iface, dwIssueFlags); + TRACE("iface %p, flags %#x.\n", iface, flags); wined3d_mutex_lock(); - hr = wined3d_query_issue(This->wineD3DQuery, dwIssueFlags); + hr = wined3d_query_issue(query->wined3d_query, flags); wined3d_mutex_unlock(); return hr; } -static HRESULT WINAPI IDirect3DQuery9Impl_GetData(IDirect3DQuery9 *iface, void *pData, - DWORD dwSize, DWORD dwGetDataFlags) +static HRESULT WINAPI d3d9_query_GetData(IDirect3DQuery9 *iface, void *data, DWORD size, DWORD flags) { - IDirect3DQuery9Impl *This = impl_from_IDirect3DQuery9(iface); + struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); HRESULT hr; TRACE("iface %p, data %p, size %u, flags %#x.\n", - iface, pData, dwSize, dwGetDataFlags); + iface, data, size, flags); wined3d_mutex_lock(); - hr = wined3d_query_get_data(This->wineD3DQuery, pData, dwSize, dwGetDataFlags); + hr = wined3d_query_get_data(query->wined3d_query, data, size, flags); wined3d_mutex_unlock(); return hr; } -static const IDirect3DQuery9Vtbl Direct3DQuery9_Vtbl = +static const struct IDirect3DQuery9Vtbl d3d9_query_vtbl = { - IDirect3DQuery9Impl_QueryInterface, - IDirect3DQuery9Impl_AddRef, - IDirect3DQuery9Impl_Release, - IDirect3DQuery9Impl_GetDevice, - IDirect3DQuery9Impl_GetType, - IDirect3DQuery9Impl_GetDataSize, - IDirect3DQuery9Impl_Issue, - IDirect3DQuery9Impl_GetData + d3d9_query_QueryInterface, + d3d9_query_AddRef, + d3d9_query_Release, + d3d9_query_GetDevice, + d3d9_query_GetType, + d3d9_query_GetDataSize, + d3d9_query_Issue, + d3d9_query_GetData, }; -HRESULT query_init(IDirect3DQuery9Impl *query, struct d3d9_device *device, D3DQUERYTYPE type) +HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUERYTYPE type) { HRESULT hr; - query->IDirect3DQuery9_iface.lpVtbl = &Direct3DQuery9_Vtbl; - query->ref = 1; + query->IDirect3DQuery9_iface.lpVtbl = &d3d9_query_vtbl; + query->refcount = 1; wined3d_mutex_lock(); - hr = wined3d_query_create(device->wined3d_device, type, &query->wineD3DQuery); + hr = wined3d_query_create(device->wined3d_device, type, &query->wined3d_query); wined3d_mutex_unlock(); if (FAILED(hr)) { @@ -179,8 +177,8 @@ HRESULT query_init(IDirect3DQuery9Impl *query, struct d3d9_device *device, D3DQU return hr; } - query->parentDevice = &device->IDirect3DDevice9Ex_iface; - IDirect3DDevice9Ex_AddRef(query->parentDevice); + query->parent_device = &device->IDirect3DDevice9Ex_iface; + IDirect3DDevice9Ex_AddRef(query->parent_device); return D3D_OK; }
1
0
0
0
Henri Verbeet : d3d9: Get rid of IDirect3DPixelShader9Impl.
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: 2f2995de753d09d21c2ed33ac65fb2f777f1d4e8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f2995de753d09d21c2ed33ac…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jun 12 17:03:47 2012 +0200 d3d9: Get rid of IDirect3DPixelShader9Impl. --- dlls/d3d9/d3d9_private.h | 20 +++++++------------- dlls/d3d9/device.c | 6 +++--- dlls/d3d9/shader.c | 46 ++++++++++++++++++++++------------------------ 3 files changed, 32 insertions(+), 40 deletions(-) diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index d1d177d..6925272 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -287,23 +287,17 @@ struct d3d9_vertexshader *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVerte #define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256 #define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4 -/* --------------------- */ -/* IDirect3DPixelShader9 */ -/* --------------------- */ - -/***************************************************************************** - * IDirect3DPixelShader implementation structure - */ -typedef struct IDirect3DPixelShader9Impl { +struct d3d9_pixelshader +{ IDirect3DPixelShader9 IDirect3DPixelShader9_iface; - LONG ref; + LONG refcount; struct wined3d_shader *wined3d_shader; - IDirect3DDevice9Ex *parentDevice; -} IDirect3DPixelShader9Impl; + IDirect3DDevice9Ex *parent_device; +}; -HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader, +HRESULT pixelshader_init(struct d3d9_pixelshader *shader, struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN; -IDirect3DPixelShader9Impl *unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) DECLSPEC_HIDDEN; +struct d3d9_pixelshader *unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) DECLSPEC_HIDDEN; /* --------------- */ /* IDirect3DQuery9 */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 2e5eb3d..1cfeace 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2547,7 +2547,7 @@ static HRESULT WINAPI d3d9_device_CreatePixelShader(IDirect3DDevice9Ex *iface, const DWORD *byte_code, IDirect3DPixelShader9 **shader) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DPixelShader9Impl *object; + struct d3d9_pixelshader *object; HRESULT hr; TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader); @@ -2576,7 +2576,7 @@ static HRESULT WINAPI d3d9_device_CreatePixelShader(IDirect3DDevice9Ex *iface, static HRESULT WINAPI d3d9_device_SetPixelShader(IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 *shader) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DPixelShader9Impl *shader_obj = unsafe_impl_from_IDirect3DPixelShader9(shader); + struct d3d9_pixelshader *shader_obj = unsafe_impl_from_IDirect3DPixelShader9(shader); HRESULT hr; TRACE("iface %p, shader %p.\n", iface, shader); @@ -2592,7 +2592,7 @@ static HRESULT WINAPI d3d9_device_SetPixelShader(IDirect3DDevice9Ex *iface, IDir static HRESULT WINAPI d3d9_device_GetPixelShader(IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 **shader) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DPixelShader9Impl *shader_impl; + struct d3d9_pixelshader *shader_impl; struct wined3d_shader *wined3d_shader; TRACE("iface %p, shader %p.\n", iface, shader); diff --git a/dlls/d3d9/shader.c b/dlls/d3d9/shader.c index 7020d15..e65f485 100644 --- a/dlls/d3d9/shader.c +++ b/dlls/d3d9/shader.c @@ -166,39 +166,39 @@ struct d3d9_vertexshader *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVerte return impl_from_IDirect3DVertexShader9(iface); } -static inline IDirect3DPixelShader9Impl *impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) +static inline struct d3d9_pixelshader *impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) { - return CONTAINING_RECORD(iface, IDirect3DPixelShader9Impl, IDirect3DPixelShader9_iface); + return CONTAINING_RECORD(iface, struct d3d9_pixelshader, IDirect3DPixelShader9_iface); } -static HRESULT WINAPI d3d9_pixelshader_QueryInterface(IDirect3DPixelShader9 *iface, REFIID riid, void **object) +static HRESULT WINAPI d3d9_pixelshader_QueryInterface(IDirect3DPixelShader9 *iface, REFIID riid, void **out) { - TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IDirect3DPixelShader9) || IsEqualGUID(riid, &IID_IUnknown)) { IDirect3DPixelShader9_AddRef(iface); - *object = iface; + *out = iface; return S_OK; } WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - *object = NULL; + *out = NULL; return E_NOINTERFACE; } static ULONG WINAPI d3d9_pixelshader_AddRef(IDirect3DPixelShader9 *iface) { - IDirect3DPixelShader9Impl *shader = impl_from_IDirect3DPixelShader9(iface); - ULONG refcount = InterlockedIncrement(&shader->ref); + struct d3d9_pixelshader *shader = impl_from_IDirect3DPixelShader9(iface); + ULONG refcount = InterlockedIncrement(&shader->refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); if (refcount == 1) { - IDirect3DDevice9Ex_AddRef(shader->parentDevice); + IDirect3DDevice9Ex_AddRef(shader->parent_device); wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); @@ -209,14 +209,14 @@ static ULONG WINAPI d3d9_pixelshader_AddRef(IDirect3DPixelShader9 *iface) static ULONG WINAPI d3d9_pixelshader_Release(IDirect3DPixelShader9 *iface) { - IDirect3DPixelShader9Impl *shader = impl_from_IDirect3DPixelShader9(iface); - ULONG refcount = InterlockedDecrement(&shader->ref); + struct d3d9_pixelshader *shader = impl_from_IDirect3DPixelShader9(iface); + ULONG refcount = InterlockedDecrement(&shader->refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) { - IDirect3DDevice9Ex *device = shader->parentDevice; + IDirect3DDevice9Ex *device = shader->parent_device; wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); @@ -229,14 +229,13 @@ static ULONG WINAPI d3d9_pixelshader_Release(IDirect3DPixelShader9 *iface) return refcount; } -static HRESULT WINAPI d3d9_pixelshader_GetDevice(IDirect3DPixelShader9 *iface, - IDirect3DDevice9 **device) +static HRESULT WINAPI d3d9_pixelshader_GetDevice(IDirect3DPixelShader9 *iface, IDirect3DDevice9 **device) { - IDirect3DPixelShader9Impl *shader = impl_from_IDirect3DPixelShader9(iface); + struct d3d9_pixelshader *shader = impl_from_IDirect3DPixelShader9(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (IDirect3DDevice9 *)shader->parentDevice; + *device = (IDirect3DDevice9 *)shader->parent_device; IDirect3DDevice9_AddRef(*device); TRACE("Returning device %p.\n", *device); @@ -244,10 +243,9 @@ static HRESULT WINAPI d3d9_pixelshader_GetDevice(IDirect3DPixelShader9 *iface, return D3D_OK; } -static HRESULT WINAPI d3d9_pixelshader_GetFunction(IDirect3DPixelShader9 *iface, void *data, - UINT *data_size) +static HRESULT WINAPI d3d9_pixelshader_GetFunction(IDirect3DPixelShader9 *iface, void *data, UINT *data_size) { - IDirect3DPixelShader9Impl *shader = impl_from_IDirect3DPixelShader9(iface); + struct d3d9_pixelshader *shader = impl_from_IDirect3DPixelShader9(iface); HRESULT hr; TRACE("iface %p, data %p, data_size %p.\n", iface, data, data_size); @@ -280,11 +278,11 @@ static const struct wined3d_parent_ops d3d9_pixelshader_wined3d_parent_ops = d3d9_pixelshader_wined3d_object_destroyed, }; -HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader, struct d3d9_device *device, const DWORD *byte_code) +HRESULT pixelshader_init(struct d3d9_pixelshader *shader, struct d3d9_device *device, const DWORD *byte_code) { HRESULT hr; - shader->ref = 1; + shader->refcount = 1; shader->IDirect3DPixelShader9_iface.lpVtbl = &d3d9_pixelshader_vtbl; wined3d_mutex_lock(); @@ -297,13 +295,13 @@ HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader, struct d3d9_device * return hr; } - shader->parentDevice = &device->IDirect3DDevice9Ex_iface; - IDirect3DDevice9Ex_AddRef(shader->parentDevice); + shader->parent_device = &device->IDirect3DDevice9Ex_iface; + IDirect3DDevice9Ex_AddRef(shader->parent_device); return D3D_OK; } -IDirect3DPixelShader9Impl *unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) +struct d3d9_pixelshader *unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) { if (!iface) return NULL;
1
0
0
0
Henri Verbeet : d3d9: Get rid of IDirect3DVertexShader9Impl.
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: df9c6aa3ec1ca4239dc7e458f129efe921894ade URL:
http://source.winehq.org/git/wine.git/?a=commit;h=df9c6aa3ec1ca4239dc7e458f…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jun 12 17:03:46 2012 +0200 d3d9: Get rid of IDirect3DVertexShader9Impl. --- dlls/d3d9/d3d9_private.h | 24 +++++++++--------------- dlls/d3d9/device.c | 6 +++--- dlls/d3d9/shader.c | 43 +++++++++++++++++++++---------------------- 3 files changed, 33 insertions(+), 40 deletions(-) diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index f386eb5..d1d177d 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -272,23 +272,17 @@ HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device, struct d3d9_vertex_declaration *unsafe_impl_from_IDirect3DVertexDeclaration9( IDirect3DVertexDeclaration9 *iface) DECLSPEC_HIDDEN; -/* ---------------------- */ -/* IDirect3DVertexShader9 */ -/* ---------------------- */ +struct d3d9_vertexshader +{ + IDirect3DVertexShader9 IDirect3DVertexShader9_iface; + LONG refcount; + struct wined3d_shader *wined3d_shader; + IDirect3DDevice9Ex *parent_device; +}; -/***************************************************************************** - * IDirect3DVertexShader implementation structure - */ -typedef struct IDirect3DVertexShader9Impl { - IDirect3DVertexShader9 IDirect3DVertexShader9_iface; - LONG ref; - struct wined3d_shader *wined3d_shader; - IDirect3DDevice9Ex *parentDevice; -} IDirect3DVertexShader9Impl; - -HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader, +HRESULT vertexshader_init(struct d3d9_vertexshader *shader, struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN; -IDirect3DVertexShader9Impl *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface) DECLSPEC_HIDDEN; +struct d3d9_vertexshader *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface) DECLSPEC_HIDDEN; #define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256 #define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4 diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 80349cd..2e5eb3d 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2240,7 +2240,7 @@ static HRESULT WINAPI d3d9_device_CreateVertexShader(IDirect3DDevice9Ex *iface, const DWORD *byte_code, IDirect3DVertexShader9 **shader) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DVertexShader9Impl *object; + struct d3d9_vertexshader *object; HRESULT hr; TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader); @@ -2269,7 +2269,7 @@ static HRESULT WINAPI d3d9_device_CreateVertexShader(IDirect3DDevice9Ex *iface, static HRESULT WINAPI d3d9_device_SetVertexShader(IDirect3DDevice9Ex *iface, IDirect3DVertexShader9 *shader) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DVertexShader9Impl *shader_obj = unsafe_impl_from_IDirect3DVertexShader9(shader); + struct d3d9_vertexshader *shader_obj = unsafe_impl_from_IDirect3DVertexShader9(shader); HRESULT hr; TRACE("iface %p, shader %p.\n", iface, shader); @@ -2285,7 +2285,7 @@ static HRESULT WINAPI d3d9_device_SetVertexShader(IDirect3DDevice9Ex *iface, IDi static HRESULT WINAPI d3d9_device_GetVertexShader(IDirect3DDevice9Ex *iface, IDirect3DVertexShader9 **shader) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - IDirect3DVertexShader9Impl *shader_impl; + struct d3d9_vertexshader *shader_impl; struct wined3d_shader *wined3d_shader; TRACE("iface %p, shader %p.\n", iface, shader); diff --git a/dlls/d3d9/shader.c b/dlls/d3d9/shader.c index b4d8a3d..7020d15 100644 --- a/dlls/d3d9/shader.c +++ b/dlls/d3d9/shader.c @@ -22,39 +22,39 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d9); -static inline IDirect3DVertexShader9Impl *impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface) +static inline struct d3d9_vertexshader *impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface) { - return CONTAINING_RECORD(iface, IDirect3DVertexShader9Impl, IDirect3DVertexShader9_iface); + return CONTAINING_RECORD(iface, struct d3d9_vertexshader, IDirect3DVertexShader9_iface); } -static HRESULT WINAPI d3d9_vertexshader_QueryInterface(IDirect3DVertexShader9 *iface, REFIID riid, void **object) +static HRESULT WINAPI d3d9_vertexshader_QueryInterface(IDirect3DVertexShader9 *iface, REFIID riid, void **out) { - TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IDirect3DVertexShader9) || IsEqualGUID(riid, &IID_IUnknown)) { IDirect3DVertexShader9_AddRef(iface); - *object = iface; + *out = iface; return S_OK; } WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - *object = NULL; + *out = NULL; return E_NOINTERFACE; } static ULONG WINAPI d3d9_vertexshader_AddRef(IDirect3DVertexShader9 *iface) { - IDirect3DVertexShader9Impl *shader = impl_from_IDirect3DVertexShader9(iface); - ULONG refcount = InterlockedIncrement(&shader->ref); + struct d3d9_vertexshader *shader = impl_from_IDirect3DVertexShader9(iface); + ULONG refcount = InterlockedIncrement(&shader->refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); if (refcount == 1) { - IDirect3DDevice9Ex_AddRef(shader->parentDevice); + IDirect3DDevice9Ex_AddRef(shader->parent_device); wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); @@ -65,14 +65,14 @@ static ULONG WINAPI d3d9_vertexshader_AddRef(IDirect3DVertexShader9 *iface) static ULONG WINAPI d3d9_vertexshader_Release(IDirect3DVertexShader9 *iface) { - IDirect3DVertexShader9Impl *shader = impl_from_IDirect3DVertexShader9(iface); - ULONG refcount = InterlockedDecrement(&shader->ref); + struct d3d9_vertexshader *shader = impl_from_IDirect3DVertexShader9(iface); + ULONG refcount = InterlockedDecrement(&shader->refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) { - IDirect3DDevice9Ex *device = shader->parentDevice; + IDirect3DDevice9Ex *device = shader->parent_device; wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); @@ -87,11 +87,11 @@ static ULONG WINAPI d3d9_vertexshader_Release(IDirect3DVertexShader9 *iface) static HRESULT WINAPI d3d9_vertexshader_GetDevice(IDirect3DVertexShader9 *iface, IDirect3DDevice9 **device) { - IDirect3DVertexShader9Impl *shader = impl_from_IDirect3DVertexShader9(iface); + struct d3d9_vertexshader *shader = impl_from_IDirect3DVertexShader9(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (IDirect3DDevice9 *)shader->parentDevice; + *device = (IDirect3DDevice9 *)shader->parent_device; IDirect3DDevice9_AddRef(*device); TRACE("Returning device %p.\n", *device); @@ -99,10 +99,9 @@ static HRESULT WINAPI d3d9_vertexshader_GetDevice(IDirect3DVertexShader9 *iface, return D3D_OK; } -static HRESULT WINAPI d3d9_vertexshader_GetFunction(IDirect3DVertexShader9 *iface, - void *data, UINT *data_size) +static HRESULT WINAPI d3d9_vertexshader_GetFunction(IDirect3DVertexShader9 *iface, void *data, UINT *data_size) { - IDirect3DVertexShader9Impl *shader = impl_from_IDirect3DVertexShader9(iface); + struct d3d9_vertexshader *shader = impl_from_IDirect3DVertexShader9(iface); HRESULT hr; TRACE("iface %p, data %p, data_size %p.\n", iface, data, data_size); @@ -135,11 +134,11 @@ static const struct wined3d_parent_ops d3d9_vertexshader_wined3d_parent_ops = d3d9_vertexshader_wined3d_object_destroyed, }; -HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader, struct d3d9_device *device, const DWORD *byte_code) +HRESULT vertexshader_init(struct d3d9_vertexshader *shader, struct d3d9_device *device, const DWORD *byte_code) { HRESULT hr; - shader->ref = 1; + shader->refcount = 1; shader->IDirect3DVertexShader9_iface.lpVtbl = &d3d9_vertexshader_vtbl; wined3d_mutex_lock(); @@ -152,13 +151,13 @@ HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader, struct d3d9_device return hr; } - shader->parentDevice = &device->IDirect3DDevice9Ex_iface; - IDirect3DDevice9Ex_AddRef(shader->parentDevice); + shader->parent_device = &device->IDirect3DDevice9Ex_iface; + IDirect3DDevice9Ex_AddRef(shader->parent_device); return D3D_OK; } -IDirect3DVertexShader9Impl *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface) +struct d3d9_vertexshader *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface) { if (!iface) return NULL;
1
0
0
0
Aric Stewart : usp10: In ShapeCharGlyphProp_BaseIndic set justification to SCRIPT_JUSTIFY_NONE for glyphs with no characters .
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: 9ea4543d12adecb749ceba9e150413844fbe0011 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ea4543d12adecb749ceba9e1…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Jun 12 08:22:50 2012 -0500 usp10: In ShapeCharGlyphProp_BaseIndic set justification to SCRIPT_JUSTIFY_NONE for glyphs with no characters. --- dlls/usp10/shape.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index cb5adcc..c654b07 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -2991,7 +2991,10 @@ static void ShapeCharGlyphProp_BaseIndic( HDC hdc, ScriptCache *psc, SCRIPT_ANAL } if (char_count == 0) + { + pGlyphProp[i].sva.uJustification = SCRIPT_JUSTIFY_NONE; continue; + } if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */ {
1
0
0
0
Aric Stewart : usp10: Do not use custom indic ShapeCharGlyphProp when shaping Indic numeric scripts .
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: 3447b716a6e3bef5a6158de6c4b267d07cdf9422 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3447b716a6e3bef5a6158de6c…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Jun 12 08:22:40 2012 -0500 usp10: Do not use custom indic ShapeCharGlyphProp when shaping Indic numeric scripts. --- dlls/usp10/shape.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 36f6854..cb5adcc 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -415,25 +415,25 @@ static const ScriptShapeData ShapingData[] = {{ thai_features, 1}, required_lao_features, 0, ContextualShape_Lao, ShapeCharGlyphProp_Thai}, {{ thai_features, 1}, required_lao_features, 0, ContextualShape_Lao, ShapeCharGlyphProp_Thai}, {{ devanagari_features, 6}, required_devanagari_features, MS_MAKE_TAG('d','e','v','2'), ContextualShape_Devanagari, ShapeCharGlyphProp_Devanagari}, - {{ devanagari_features, 6}, required_devanagari_features, MS_MAKE_TAG('d','e','v','2'), ContextualShape_Devanagari, ShapeCharGlyphProp_Devanagari}, - {{ devanagari_features, 6}, required_bengali_features, MS_MAKE_TAG('b','n','g','2'), ContextualShape_Bengali, ShapeCharGlyphProp_Bengali}, + {{ devanagari_features, 6}, required_devanagari_features, MS_MAKE_TAG('d','e','v','2'), ContextualShape_Devanagari, NULL}, {{ devanagari_features, 6}, required_bengali_features, MS_MAKE_TAG('b','n','g','2'), ContextualShape_Bengali, ShapeCharGlyphProp_Bengali}, + {{ devanagari_features, 6}, required_bengali_features, MS_MAKE_TAG('b','n','g','2'), ContextualShape_Bengali, NULL}, {{ devanagari_features, 6}, required_bengali_features, MS_MAKE_TAG('b','n','g','2'), ContextualShape_Bengali, ShapeCharGlyphProp_Bengali}, {{ devanagari_features, 6}, required_gurmukhi_features, MS_MAKE_TAG('g','u','r','2'), ContextualShape_Gurmukhi, ShapeCharGlyphProp_Gurmukhi}, - {{ devanagari_features, 6}, required_gurmukhi_features, MS_MAKE_TAG('g','u','r','2'), ContextualShape_Gurmukhi, ShapeCharGlyphProp_Gurmukhi}, + {{ devanagari_features, 6}, required_gurmukhi_features, MS_MAKE_TAG('g','u','r','2'), ContextualShape_Gurmukhi, NULL}, {{ devanagari_features, 6}, required_devanagari_features, MS_MAKE_TAG('g','j','r','2'), ContextualShape_Gujarati, ShapeCharGlyphProp_Gujarati}, + {{ devanagari_features, 6}, required_devanagari_features, MS_MAKE_TAG('g','j','r','2'), ContextualShape_Gujarati, NULL}, {{ devanagari_features, 6}, required_devanagari_features, MS_MAKE_TAG('g','j','r','2'), ContextualShape_Gujarati, ShapeCharGlyphProp_Gujarati}, - {{ devanagari_features, 6}, required_devanagari_features, MS_MAKE_TAG('g','j','r','2'), ContextualShape_Gujarati, ShapeCharGlyphProp_Gujarati}, - {{ devanagari_features, 6}, required_oriya_features, MS_MAKE_TAG('o','r','y','2'), ContextualShape_Oriya, ShapeCharGlyphProp_Oriya}, {{ devanagari_features, 6}, required_oriya_features, MS_MAKE_TAG('o','r','y','2'), ContextualShape_Oriya, ShapeCharGlyphProp_Oriya}, + {{ devanagari_features, 6}, required_oriya_features, MS_MAKE_TAG('o','r','y','2'), ContextualShape_Oriya, NULL}, {{ devanagari_features, 6}, required_tamil_features, MS_MAKE_TAG('t','a','m','2'), ContextualShape_Tamil, ShapeCharGlyphProp_Tamil}, - {{ devanagari_features, 6}, required_tamil_features, MS_MAKE_TAG('t','a','m','2'), ContextualShape_Tamil, ShapeCharGlyphProp_Tamil}, - {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('t','e','l','2'), ContextualShape_Telugu, ShapeCharGlyphProp_Telugu}, + {{ devanagari_features, 6}, required_tamil_features, MS_MAKE_TAG('t','a','m','2'), ContextualShape_Tamil, NULL}, {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('t','e','l','2'), ContextualShape_Telugu, ShapeCharGlyphProp_Telugu}, + {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('t','e','l','2'), ContextualShape_Telugu, NULL}, {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('k','n','d','2'), ContextualShape_Kannada, ShapeCharGlyphProp_Kannada}, - {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('k','n','d','2'), ContextualShape_Kannada, ShapeCharGlyphProp_Kannada}, - {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('m','l','m','2'), ContextualShape_Malayalam, ShapeCharGlyphProp_Malayalam}, + {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('k','n','d','2'), ContextualShape_Kannada, NULL}, {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('m','l','m','2'), ContextualShape_Malayalam, ShapeCharGlyphProp_Malayalam}, + {{ devanagari_features, 6}, required_telugu_features, MS_MAKE_TAG('m','l','m','2'), ContextualShape_Malayalam, NULL}, {{ standard_features, 2}, NULL, 0, NULL, NULL}, {{ latin_features, 2}, NULL, 0, NULL, NULL}, {{ standard_features, 2}, NULL, 0, NULL, NULL},
1
0
0
0
Huw Davies : winspool: Update the ppd file of an already installed printer in the first call to OpenPrinter .
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: 28ef1af6d0435211e243bc4b22856fa8fc579d52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=28ef1af6d0435211e243bc4b2…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jun 12 09:42:49 2012 +0100 winspool: Update the ppd file of an already installed printer in the first call to OpenPrinter. --- dlls/winspool.drv/info.c | 201 +++++++++++++++++++++++++++++++--------------- 1 files changed, 137 insertions(+), 64 deletions(-) diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index a5ccf49..ed470bb 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -450,6 +450,62 @@ static inline DWORD set_reg_DWORD( HKEY hkey, const WCHAR *keyname, const DWORD return RegSetValueExW( hkey, keyname, 0, REG_DWORD, (const BYTE*)&value, sizeof(value) ); } +/****************************************************************** + * get_opened_printer + * Get the pointer to the opened printer referred by the handle + */ +static opened_printer_t *get_opened_printer(HANDLE hprn) +{ + UINT_PTR idx = (UINT_PTR)hprn; + opened_printer_t *ret = NULL; + + EnterCriticalSection(&printer_handles_cs); + + if ((idx > 0) && (idx <= nb_printer_handles)) { + ret = printer_handles[idx - 1]; + } + LeaveCriticalSection(&printer_handles_cs); + return ret; +} + +/****************************************************************** + * get_opened_printer_name + * Get the pointer to the opened printer name referred by the handle + */ +static LPCWSTR get_opened_printer_name(HANDLE hprn) +{ + opened_printer_t *printer = get_opened_printer(hprn); + if(!printer) return NULL; + return printer->name; +} + +static DWORD open_printer_reg_key( const WCHAR *name, HKEY *key ) +{ + HKEY printers; + DWORD err; + + *key = NULL; + err = RegCreateKeyW( HKEY_LOCAL_MACHINE, PrintersW, &printers ); + if (err) return err; + + err = RegOpenKeyW( printers, name, key ); + if (err) err = ERROR_INVALID_PRINTER_NAME; + RegCloseKey( printers ); + return err; +} + +/****************************************************************** + * WINSPOOL_GetOpenedPrinterRegKey + * + */ +static DWORD WINSPOOL_GetOpenedPrinterRegKey(HANDLE hPrinter, HKEY *phkey) +{ + LPCWSTR name = get_opened_printer_name(hPrinter); + + if(!name) return ERROR_INVALID_HANDLE; + return open_printer_reg_key( name, phkey ); +} + static void WINSPOOL_SetDefaultPrinter(const char *devname, const char *name, BOOL force) { char qbuf[200]; @@ -476,13 +532,13 @@ WINSPOOL_SetDefaultPrinter(const char *devname, const char *name, BOOL force) { } } -static BOOL add_printer_driver(WCHAR *name, WCHAR *ppd) +static BOOL add_printer_driver(const WCHAR *name, WCHAR *ppd) { DRIVER_INFO_3W di3; ZeroMemory(&di3, sizeof(DRIVER_INFO_3W)); di3.cVersion = 3; - di3.pName = name; + di3.pName = (WCHAR*)name; di3.pEnvironment = envname_x86W; di3.pDriverPath = driver_nt; di3.pDataFile = ppd; @@ -831,7 +887,61 @@ static BOOL CUPS_LoadPrinters(void) RegCloseKey(hkeyPrinters); return TRUE; } + +static char *get_cups_name( HANDLE printer ) +{ + WCHAR *port; + DWORD err, needed, type; + char *ret = NULL; + HKEY key; + + err = WINSPOOL_GetOpenedPrinterRegKey( printer, &key ); + if (err) return NULL; + err = RegQueryValueExW( key, PortW, 0, &type, NULL, &needed ); + if (err || needed <= sizeof( CUPS_Port )) goto end; + port = HeapAlloc( GetProcessHeap(), 0, needed ); + if (!port) goto end; + RegQueryValueExW( key, PortW, 0, &type, (BYTE*)port, &needed ); + if (!memcmp( port, CUPS_Port, sizeof(CUPS_Port) - sizeof(WCHAR) )) + { + WCHAR *name = port + sizeof(CUPS_Port) / sizeof(WCHAR) - 1; + needed = WideCharToMultiByte( CP_UNIXCP, 0, name, -1, NULL, 0, NULL, NULL ); + ret = HeapAlloc( GetProcessHeap(), 0, needed ); + if(ret) WideCharToMultiByte( CP_UNIXCP, 0, name, -1, ret, needed, NULL, NULL ); + } + HeapFree( GetProcessHeap(), 0, port ); +end: + RegCloseKey( key ); + return ret; +} +#endif + +static BOOL update_driver( HANDLE printer ) +{ + BOOL ret = FALSE; +#ifdef SONAME_LIBCUPS + const WCHAR *name = get_opened_printer_name( printer ); + WCHAR *ppd_dir, *ppd; + char *cups_name; + + if (!name) return FALSE; + cups_name = get_cups_name( printer ); + if (!cups_name) return FALSE; + + ppd_dir = get_ppd_dir(); + ppd = get_ppd_filename( ppd_dir, name ); + if (get_cups_ppd( cups_name, ppd )) + { + TRACE( "updating driver %s\n", debugstr_w( name ) ); + ret = add_printer_driver( name, ppd ); + unlink_ppd( ppd ); + } + HeapFree( GetProcessHeap(), 0, ppd_dir ); + HeapFree( GetProcessHeap(), 0, ppd ); + HeapFree( GetProcessHeap(), 0, cups_name ); #endif + return ret; +} static BOOL PRINTCAP_ParseEntry( const char *pent, BOOL isfirst ) { @@ -1243,62 +1353,6 @@ end: return (HANDLE)handle; } -/****************************************************************** - * get_opened_printer - * Get the pointer to the opened printer referred by the handle - */ -static opened_printer_t *get_opened_printer(HANDLE hprn) -{ - UINT_PTR idx = (UINT_PTR)hprn; - opened_printer_t *ret = NULL; - - EnterCriticalSection(&printer_handles_cs); - - if ((idx > 0) && (idx <= nb_printer_handles)) { - ret = printer_handles[idx - 1]; - } - LeaveCriticalSection(&printer_handles_cs); - return ret; -} - -/****************************************************************** - * get_opened_printer_name - * Get the pointer to the opened printer name referred by the handle - */ -static LPCWSTR get_opened_printer_name(HANDLE hprn) -{ - opened_printer_t *printer = get_opened_printer(hprn); - if(!printer) return NULL; - return printer->name; -} - -static DWORD open_printer_reg_key( const WCHAR *name, HKEY *key ) -{ - HKEY printers; - DWORD err; - - *key = NULL; - err = RegCreateKeyW( HKEY_LOCAL_MACHINE, PrintersW, &printers ); - if (err) return err; - - err = RegOpenKeyW( printers, name, key ); - if (err) err = ERROR_INVALID_PRINTER_NAME; - RegCloseKey( printers ); - return err; -} - -/****************************************************************** - * WINSPOOL_GetOpenedPrinterRegKey - * - */ -static DWORD WINSPOOL_GetOpenedPrinterRegKey(HANDLE hPrinter, HKEY *phkey) -{ - LPCWSTR name = get_opened_printer_name(hPrinter); - - if(!name) return ERROR_INVALID_HANDLE; - return open_printer_reg_key( name, phkey ); -} - static void old_printer_check( BOOL delete_phase ) { PRINTER_INFO_5W* pi; @@ -1348,6 +1402,7 @@ static void old_printer_check( BOOL delete_phase ) static const WCHAR winspool_mutex_name[] = {'_','_','W','I','N','E','_','W','I','N','S','P','O','O','L','_', 'M','U','T','E','X','_','_','\0'}; +static HANDLE init_mutex; void WINSPOOL_LoadSystemPrinters(void) { @@ -1355,19 +1410,18 @@ void WINSPOOL_LoadSystemPrinters(void) DWORD needed, num, i; WCHAR PrinterName[256]; BOOL done = FALSE; - HANDLE mutex; /* FIXME: The init code should be moved to spoolsv.exe */ - mutex = CreateMutexW( NULL, TRUE, winspool_mutex_name ); - if (!mutex) + init_mutex = CreateMutexW( NULL, TRUE, winspool_mutex_name ); + if (!init_mutex) { ERR( "Failed to create mutex\n" ); return; } if (GetLastError() == ERROR_ALREADY_EXISTS) { - WaitForSingleObject( mutex, INFINITE ); - ReleaseMutex( mutex ); + WaitForSingleObject( init_mutex, INFINITE ); + ReleaseMutex( init_mutex ); TRACE( "Init already done\n" ); return; } @@ -1403,7 +1457,7 @@ void WINSPOOL_LoadSystemPrinters(void) old_printer_check( TRUE ); - ReleaseMutex( mutex ); + ReleaseMutex( init_mutex ); return; } @@ -2277,6 +2331,25 @@ BOOL WINAPI OpenPrinterW(LPWSTR lpPrinterName,HANDLE *phPrinter, LPPRINTER_DEFAU /* Get the unique handle of the printer or Printserver */ *phPrinter = get_opened_printer_entry(lpPrinterName, pDefault); + + WaitForSingleObject( init_mutex, INFINITE ); + if (*phPrinter) + { + HKEY key; + DWORD deleting = 0, size = sizeof( deleting ), type; + DWORD status; + WINSPOOL_GetOpenedPrinterRegKey( *phPrinter, &key ); + RegQueryValueExW( key, May_Delete_Value, NULL, &type, (LPBYTE)&deleting, &size ); + status = get_dword_from_reg( key, StatusW ); + if (!deleting && (status & PRINTER_STATUS_DRIVER_UPDATE_NEEDED)) + { + update_driver( *phPrinter ); + set_reg_DWORD( key, StatusW, status & ~PRINTER_STATUS_DRIVER_UPDATE_NEEDED ); + } + RegCloseKey( key ); + } + ReleaseMutex( init_mutex ); + TRACE("returning %d with %u and %p\n", *phPrinter != NULL, GetLastError(), *phPrinter); return (*phPrinter != 0); }
1
0
0
0
Huw Davies : winspool: Set the printer status of old printers to indicate that they should check for driver updates .
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: 0ef0ce2938fcdb45dd5ca4a735ae10a9e22c89cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0ef0ce2938fcdb45dd5ca4a73…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jun 12 09:42:48 2012 +0100 winspool: Set the printer status of old printers to indicate that they should check for driver updates. --- dlls/winspool.drv/info.c | 61 +++++++++++++++++++++++++--------------------- 1 files changed, 33 insertions(+), 28 deletions(-) diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 022041c..a5ccf49 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -420,6 +420,36 @@ static int multi_sz_lenA(const char *str) return ptr - str + 1; } +/***************************************************************************** + * get_dword_from_reg + * + * Return DWORD associated with name from hkey. + */ +static DWORD get_dword_from_reg( HKEY hkey, const WCHAR *name ) +{ + DWORD sz = sizeof(DWORD), type, value = 0; + LONG ret; + + ret = RegQueryValueExW( hkey, name, 0, &type, (LPBYTE)&value, &sz ); + + if (ret != ERROR_SUCCESS) + { + WARN( "Got ret = %d on name %s\n", ret, debugstr_w(name) ); + return 0; + } + if (type != REG_DWORD) + { + ERR( "Got type %d\n", type ); + return 0; + } + return value; +} + +static inline DWORD set_reg_DWORD( HKEY hkey, const WCHAR *keyname, const DWORD value ) +{ + return RegSetValueExW( hkey, keyname, 0, REG_DWORD, (const BYTE*)&value, sizeof(value) ); +} + static void WINSPOOL_SetDefaultPrinter(const char *devname, const char *name, BOOL force) { char qbuf[200]; @@ -738,12 +768,15 @@ static BOOL CUPS_LoadPrinters(void) TRACE("Printer %d: %s\n", i, debugstr_w(nameW)); if(RegOpenKeyW(hkeyPrinters, nameW, &hkeyPrinter) == ERROR_SUCCESS) { + DWORD status = get_dword_from_reg( hkeyPrinter, StatusW ); /* Printer already in registry, delete the tag added in WINSPOOL_LoadSystemPrinters and continue */ TRACE("Printer already exists\n"); /* overwrite old LPR:* port */ RegSetValueExW(hkeyPrinter, PortW, 0, REG_SZ, (LPBYTE)port, (lstrlenW(port) + 1) * sizeof(WCHAR)); RegDeleteValueW(hkeyPrinter, May_Delete_Value); + /* flag that the PPD file should be checked for an update */ + set_reg_DWORD( hkeyPrinter, StatusW, status | PRINTER_STATUS_DRIVER_UPDATE_NEEDED ); RegCloseKey(hkeyPrinter); } else { BOOL added_driver = FALSE; @@ -990,11 +1023,6 @@ PRINTCAP_LoadPrinters(void) { return hadprinter; } -static inline DWORD set_reg_DWORD(HKEY hkey, const WCHAR *keyname, const DWORD value) -{ - return RegSetValueExW(hkey, keyname, 0, REG_DWORD, (const BYTE*)&value, sizeof(value)); -} - static inline DWORD set_reg_szW(HKEY hkey, const WCHAR *keyname, const WCHAR *value) { if (value) @@ -3593,29 +3621,6 @@ BOOL WINAPI ResetPrinterW(HANDLE hPrinter, LPPRINTER_DEFAULTSW pDefault) } /***************************************************************************** - * get_dword_from_reg - * - * Return DWORD associated with name from hkey. - */ -static DWORD get_dword_from_reg( HKEY hkey, const WCHAR *name ) -{ - DWORD sz = sizeof(DWORD), type, value = 0; - LONG ret; - - ret = RegQueryValueExW( hkey, name, 0, &type, (LPBYTE)&value, &sz ); - - if(ret != ERROR_SUCCESS) { - WARN("Got ret = %d on name %s\n", ret, debugstr_w(name)); - return 0; - } - if(type != REG_DWORD) { - ERR("Got type %d\n", type); - return 0; - } - return value; -} - -/***************************************************************************** * get_filename_from_reg [internal] * * Get ValueName from hkey storing result in out
1
0
0
0
Huw Davies : winspool: Install the ppd files into the driver directory.
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: da0e1ecdd6d1c00b391333dd45a2e50791b7afc5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da0e1ecdd6d1c00b391333dd4…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jun 12 09:42:47 2012 +0100 winspool: Install the ppd files into the driver directory. --- dlls/winspool.drv/info.c | 259 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 246 insertions(+), 13 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=da0e1ecdd6d1c00b39133…
1
0
0
0
Jacek Caban : urlmon: Avoid useless InternetQueryOptionW call.
by Alexandre Julliard
12 Jun '12
12 Jun '12
Module: wine Branch: master Commit: 5c654b4839521dbfa54d676363860323978153da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5c654b4839521dbfa54d67636…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jun 12 10:35:52 2012 +0200 urlmon: Avoid useless InternetQueryOptionW call. --- dlls/urlmon/http.c | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index c67d36e..b1ca83a 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -79,18 +79,13 @@ static LPWSTR query_http_info(HttpProtocol *This, DWORD option) return ret; } -static inline BOOL set_security_flag(HttpProtocol *This, DWORD new_flag) +static inline BOOL set_security_flag(HttpProtocol *This, DWORD flags) { - DWORD flags, size = sizeof(flags); BOOL res; - res = InternetQueryOptionW(This->base.request, INTERNET_OPTION_SECURITY_FLAGS, &flags, &size); - if(res) { - flags |= new_flag; - res = InternetSetOptionW(This->base.request, INTERNET_OPTION_SECURITY_FLAGS, &flags, size); - } + res = InternetSetOptionW(This->base.request, INTERNET_OPTION_SECURITY_FLAGS, &flags, sizeof(flags)); if(!res) - ERR("Failed to set security flag(s): %x\n", new_flag); + ERR("Failed to set security flags: %x\n", flags); return res; }
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
83
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
Results per page:
10
25
50
100
200