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
July
June
May
April
March
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
August 2012
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
541 discussions
Start a n
N
ew thread
Jacek Caban : d3d8: Use proper helpers for iface calls.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 1524cc2ab7c20123fc6dee708073958fcdc7fbd6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1524cc2ab7c20123fc6dee708…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 27 12:27:34 2012 +0200 d3d8: Use proper helpers for iface calls. --- dlls/d3d8/buffer.c | 8 ++++---- dlls/d3d8/device.c | 4 ++-- dlls/d3d8/directx.c | 2 +- dlls/d3d8/surface.c | 6 +++--- dlls/d3d8/swapchain.c | 2 +- dlls/d3d8/tests/device.c | 8 ++++---- dlls/d3d8/texture.c | 8 ++++---- dlls/d3d8/volume.c | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c index b0a11ad..775595a 100644 --- a/dlls/d3d8/buffer.c +++ b/dlls/d3d8/buffer.c @@ -34,7 +34,7 @@ static HRESULT WINAPI d3d8_vertexbuffer_QueryInterface(IDirect3DVertexBuffer8 *i || IsEqualGUID(riid, &IID_IDirect3DResource8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DVertexBuffer8_AddRef(iface); *object = iface; return S_OK; } @@ -302,7 +302,7 @@ HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device * } buffer->parent_device = &device->IDirect3DDevice8_iface; - IUnknown_AddRef(buffer->parent_device); + IDirect3DDevice8_AddRef(buffer->parent_device); return D3D_OK; } @@ -329,7 +329,7 @@ static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *ifa || IsEqualGUID(riid, &IID_IDirect3DResource8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DIndexBuffer8_AddRef(iface); *object = iface; return S_OK; } @@ -596,7 +596,7 @@ HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *de } buffer->parent_device = &device->IDirect3DDevice8_iface; - IUnknown_AddRef(buffer->parent_device); + IDirect3DDevice8_AddRef(buffer->parent_device); return D3D_OK; } diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index fa7cb48..d90161f 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -307,7 +307,7 @@ static HRESULT WINAPI d3d8_device_QueryInterface(IDirect3DDevice8 *iface, REFIID if (IsEqualGUID(riid, &IID_IDirect3DDevice8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DDevice8_AddRef(iface); *out = iface; return S_OK; } @@ -2845,7 +2845,7 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_ wined3d_surface_incref(*surface); d3d_surface->container = container_parent; - IUnknown_Release(d3d_surface->parent_device); + IDirect3DDevice8_Release(d3d_surface->parent_device); d3d_surface->parent_device = NULL; IDirect3DSurface8_Release(&d3d_surface->IDirect3DSurface8_iface); diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index 89c2fcc..4339251 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -49,7 +49,7 @@ static HRESULT WINAPI d3d8_QueryInterface(IDirect3D8 *iface, REFIID riid, void * if (IsEqualGUID(riid, &IID_IDirect3D8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3D8_AddRef(iface); *out = iface; return S_OK; } diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index 91d263c..3a0f862 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -36,7 +36,7 @@ static HRESULT WINAPI d3d8_surface_QueryInterface(IDirect3DSurface8 *iface, REFI || IsEqualGUID(riid, &IID_IDirect3DResource8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DSurface8_AddRef(iface); *out = iface; return S_OK; } @@ -69,7 +69,7 @@ static ULONG WINAPI d3d8_surface_AddRef(IDirect3DSurface8 *iface) if (ref == 1) { if (surface->parent_device) - IUnknown_AddRef(surface->parent_device); + IDirect3DDevice8_AddRef(surface->parent_device); wined3d_mutex_lock(); wined3d_surface_incref(surface->wined3d_surface); wined3d_mutex_unlock(); @@ -359,7 +359,7 @@ HRESULT surface_init(struct d3d8_surface *surface, struct d3d8_device *device, } surface->parent_device = &device->IDirect3DDevice8_iface; - IUnknown_AddRef(surface->parent_device); + IDirect3DDevice8_AddRef(surface->parent_device); return D3D_OK; } diff --git a/dlls/d3d8/swapchain.c b/dlls/d3d8/swapchain.c index 0410fb8..3482900 100644 --- a/dlls/d3d8/swapchain.c +++ b/dlls/d3d8/swapchain.c @@ -35,7 +35,7 @@ static HRESULT WINAPI d3d8_swapchain_QueryInterface(IDirect3DSwapChain8 *iface, if (IsEqualGUID(riid, &IID_IDirect3DSwapChain8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DSwapChain8_AddRef(iface); *out = iface; return S_OK; } diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index ddb72c6..b16d5bf 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -121,7 +121,7 @@ static HRESULT reset_device(IDirect3DDevice8 *device, HWND device_window, BOOL w #define CHECK_RELEASE(obj,d,rc) \ if (obj) { \ int tmp1, rc_new = rc; \ - IUnknown_Release( obj ); \ + IUnknown_Release( (IUnknown*)obj ); \ tmp1 = get_refcount( (IUnknown *)d ); \ ok(tmp1 == rc_new, "Invalid refcount. Expected %d got %d\n", rc_new, tmp1); \ } @@ -168,7 +168,7 @@ static void check_mipmap_levels(IDirect3DDevice8 *device, UINT width, UINT heigh } else trace("CreateTexture failed: %#08x\n", hr); - if (texture) IUnknown_Release( texture ); + if (texture) IDirect3DDevice8_Release( texture ); } static void test_mipmap_levels(void) @@ -210,10 +210,10 @@ static void test_mipmap_levels(void) cleanup: if (pDevice) { - UINT refcount = IUnknown_Release( pDevice ); + UINT refcount = IDirect3DDevice8_Release( pDevice ); ok(!refcount, "Device has %u references left.\n", refcount); } - if (pD3d) IUnknown_Release( pD3d ); + if (pD3d) IDirect3D8_Release( pD3d ); DestroyWindow( hwnd ); } diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index 59bc693..f139d4e 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -45,7 +45,7 @@ static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, R || IsEqualGUID(riid, &IID_IDirect3DResource8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DTexture8_AddRef(iface); *out = iface; return S_OK; } @@ -413,7 +413,7 @@ static HRESULT WINAPI d3d8_texture_cube_QueryInterface(IDirect3DCubeTexture8 *if || IsEqualGUID(riid, &IID_IDirect3DResource8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DCubeTexture8_AddRef(iface); *out = iface; return S_OK; } @@ -433,7 +433,7 @@ static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface) if (ref == 1) { - IUnknown_AddRef(texture->parent_device); + IDirect3DDevice8_AddRef(texture->parent_device); wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); wined3d_mutex_unlock(); @@ -806,7 +806,7 @@ static HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *if || IsEqualGUID(riid, &IID_IDirect3DResource8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DVolumeTexture8_AddRef(iface); *out = iface; return S_OK; } diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c index 5c77193..ecd4bb1 100644 --- a/dlls/d3d8/volume.c +++ b/dlls/d3d8/volume.c @@ -35,7 +35,7 @@ static HRESULT WINAPI d3d8_volume_QueryInterface(IDirect3DVolume8 *iface, REFIID if (IsEqualGUID(riid, &IID_IDirect3DVolume8) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + IDirect3DVolume8_AddRef(iface); *out = iface; return S_OK; }
1
0
0
0
Nikolay Sivov : kernel32: Handle neutral locale names better in GetLocaleInfoEx.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 2097c5ddb6bec24cf4bbd440a6f401cfa67007f0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2097c5ddb6bec24cf4bbd440a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Aug 26 09:53:23 2012 +0400 kernel32: Handle neutral locale names better in GetLocaleInfoEx. --- dlls/kernel32/locale.c | 21 ++++++++++++++++++++- dlls/kernel32/tests/locale.c | 33 ++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 1e5b7e5..c41442c 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -1427,7 +1427,26 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len ) */ INT WINAPI GetLocaleInfoEx(LPCWSTR locale, LCTYPE info, LPWSTR buffer, INT len) { - return GetLocaleInfoW(LocaleNameToLCID(locale, 0), info, buffer, len); + LCID lcid = LocaleNameToLCID(locale, 0); + + TRACE("%s, lcid=0x%x, 0x%x\n", debugstr_w(locale), lcid, info); + + if (!lcid) return 0; + + /* special handling for neutral locale names */ + if (info == LOCALE_SNAME && strlenW(locale) == 2) + { + if (len && len < 3) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return 0; + } + + if (len) strcpyW(buffer, locale); + return 3; + } + + return GetLocaleInfoW(lcid, info, buffer, len); } /****************************************************************************** diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 199451b..0225c2b 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -1918,6 +1918,13 @@ static void test_LocaleNameToLCID(void) else ok(lcid == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), lcid, ptr->lcid); + + *buffer = 0; + ret = pLCIDToLocaleName(lcid, buffer, sizeof(buffer)/sizeof(WCHAR), 0); + ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(ptr->name), ret); + ok(lstrcmpW(ptr->name, buffer), "%s: got wrong locale name %s\n", + wine_dbgstr_w(ptr->name), wine_dbgstr_w(buffer)); + ptr++; } } @@ -3400,29 +3407,37 @@ static void test_GetLocaleInfoEx(void) const struct neutralsublang_name_t *ptr = neutralsublang_names; DWORD val; -todo_wine + ok(ret == lstrlenW(bufferW)+1, "got %d\n", ret); ok(!lstrcmpW(bufferW, enW), "got %s\n", wine_dbgstr_w(bufferW)); + SetLastError(0xdeadbeef); + ret = pGetLocaleInfoEx(enW, LOCALE_SNAME, bufferW, 2); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, %d\n", ret, GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetLocaleInfoEx(enW, LOCALE_SNAME, NULL, 0); + ok(ret == 3 && GetLastError() == 0xdeadbeef, "got %d, %d\n", ret, GetLastError()); + ret = pGetLocaleInfoEx(enusW, LOCALE_SNAME, bufferW, sizeof(bufferW)/sizeof(WCHAR)); - ok(ret, "got %d\n", ret); + ok(ret == lstrlenW(bufferW)+1, "got %d\n", ret); ok(!lstrcmpW(bufferW, enusW), "got %s\n", wine_dbgstr_w(bufferW)); ret = pGetLocaleInfoEx(enW, LOCALE_SABBREVCTRYNAME, bufferW, sizeof(bufferW)/sizeof(WCHAR)); - ok(ret, "got %d\n", ret); + ok(ret == lstrlenW(bufferW)+1, "got %d\n", ret); ok(!lstrcmpW(bufferW, usaW), "got %s\n", wine_dbgstr_w(bufferW)); ret = pGetLocaleInfoEx(enW, LOCALE_SABBREVLANGNAME, bufferW, sizeof(bufferW)/sizeof(WCHAR)); - ok(ret, "got %d\n", ret); + ok(ret == lstrlenW(bufferW)+1, "got %d\n", ret); ok(!lstrcmpW(bufferW, enuW), "got %s\n", wine_dbgstr_w(bufferW)); ret = pGetLocaleInfoEx(enW, LOCALE_SCOUNTRY, bufferW, sizeof(bufferW)/sizeof(WCHAR)); - ok(ret, "got %d\n", ret); + ok(ret == lstrlenW(bufferW)+1, "got %d\n", ret); ok(!lstrcmpW(bufferW, statesW), "got %s\n", wine_dbgstr_w(bufferW)); bufferW[0] = 0; + SetLastError(0xdeadbeef); ret = pGetLocaleInfoEx(dummyW, LOCALE_SNAME, bufferW, sizeof(bufferW)/sizeof(WCHAR)); -todo_wine - ok(!ret, "got %d\n", ret); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); while (*ptr->name) { @@ -3434,8 +3449,8 @@ todo_wine else ok(val == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), val, ptr->lcid); bufferW[0] = 0; - pGetLocaleInfoEx(ptr->name, LOCALE_SNAME, bufferW, sizeof(bufferW)/sizeof(WCHAR)); - todo_wine + ret = pGetLocaleInfoEx(ptr->name, LOCALE_SNAME, bufferW, sizeof(bufferW)/sizeof(WCHAR)); + ok(ret == lstrlenW(bufferW)+1, "%s: got ret value %d\n", wine_dbgstr_w(ptr->name), ret); ok(!lstrcmpW(bufferW, ptr->name), "%s: got wrong LOCALE_SNAME %s\n", wine_dbgstr_w(ptr->name), wine_dbgstr_w(bufferW)); ptr++; }
1
0
0
0
Nikolay Sivov : dwrite: Added IDWriteFontFamily stub.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: debc356afd026a9e4c75fa3ffefbf628088f2e02 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=debc356afd026a9e4c75fa3ff…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Aug 25 13:11:31 2012 +0400 dwrite: Added IDWriteFontFamily stub. --- dlls/dwrite/font.c | 146 ++++++++++++++++++++++++++++++++++++++++++++- dlls/dwrite/tests/font.c | 56 ++++++++++++++++++ 2 files changed, 198 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index e73ef44..892ee72 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -27,10 +27,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite); +struct dwrite_fontfamily { + IDWriteFontFamily IDWriteFontFamily_iface; + LONG ref; +}; + struct dwrite_font { IDWriteFont IDWriteFont_iface; LONG ref; + IDWriteFontFamily *family; DWRITE_FONT_STYLE style; }; @@ -39,6 +45,11 @@ static inline struct dwrite_font *impl_from_IDWriteFont(IDWriteFont *iface) return CONTAINING_RECORD(iface, struct dwrite_font, IDWriteFont_iface); } +static inline struct dwrite_fontfamily *impl_from_IDWriteFontFamily(IDWriteFontFamily *iface) +{ + return CONTAINING_RECORD(iface, struct dwrite_fontfamily, IDWriteFontFamily_iface); +} + static HRESULT WINAPI dwritefont_QueryInterface(IDWriteFont *iface, REFIID riid, void **obj) { struct dwrite_font *This = impl_from_IDWriteFont(iface); @@ -72,7 +83,10 @@ static ULONG WINAPI dwritefont_Release(IDWriteFont *iface) TRACE("(%p)->(%d)\n", This, ref); if (!ref) + { + IDWriteFontFamily_Release(This->family); heap_free(This); + } return S_OK; } @@ -80,8 +94,11 @@ static ULONG WINAPI dwritefont_Release(IDWriteFont *iface) static HRESULT WINAPI dwritefont_GetFontFamily(IDWriteFont *iface, IDWriteFontFamily **family) { struct dwrite_font *This = impl_from_IDWriteFont(iface); - FIXME("(%p)->(%p): stub\n", This, family); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, family); + + *family = This->family; + IDWriteFontFamily_AddRef(*family); + return S_OK; } static DWRITE_FONT_WEIGHT WINAPI dwritefont_GetWeight(IDWriteFont *iface) @@ -171,18 +188,139 @@ static const IDWriteFontVtbl dwritefontvtbl = { dwritefont_CreateFontFace }; +static HRESULT WINAPI dwritefontfamily_QueryInterface(IDWriteFontFamily *iface, REFIID riid, void **obj) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IDWriteFontList) || + IsEqualIID(riid, &IID_IDWriteFontFamily)) + { + *obj = iface; + IDWriteFontFamily_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI dwritefontfamily_AddRef(IDWriteFontFamily *iface) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; +} + +static ULONG WINAPI dwritefontfamily_Release(IDWriteFontFamily *iface) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%d)\n", This, ref); + + if (!ref) + heap_free(This); + + return S_OK; +} + +static HRESULT WINAPI dwritefontfamily_GetFontCollection(IDWriteFontFamily *iface, IDWriteFontCollection **collection) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + FIXME("(%p)->(%p): stub\n", This, collection); + return E_NOTIMPL; +} + +static UINT32 WINAPI dwritefontfamily_GetFontCount(IDWriteFontFamily *iface) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + FIXME("(%p): stub\n", This); + return 0; +} + +static HRESULT WINAPI dwritefontfamily_GetFont(IDWriteFontFamily *iface, UINT32 index, IDWriteFont **font) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + FIXME("(%p)->(%u %p): stub\n", This, index, font); + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefontfamily_GetFamilyNames(IDWriteFontFamily *iface, IDWriteLocalizedStrings **names) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + FIXME("(%p)->(%p): stub\n", This, names); + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *iface, DWRITE_FONT_WEIGHT weight, + DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFont **font) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + FIXME("(%p)->(%d %d %d %p): stub\n", This, weight, stretch, style, font); + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefontfamily_GetMatchingFonts(IDWriteFontFamily *iface, DWRITE_FONT_WEIGHT weight, + DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFontList **fonts) +{ + struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + FIXME("(%p)->(%d %d %d %p): stub\n", This, weight, stretch, style, fonts); + return E_NOTIMPL; +} + +static const IDWriteFontFamilyVtbl fontfamilyvtbl = { + dwritefontfamily_QueryInterface, + dwritefontfamily_AddRef, + dwritefontfamily_Release, + dwritefontfamily_GetFontCollection, + dwritefontfamily_GetFontCount, + dwritefontfamily_GetFont, + dwritefontfamily_GetFamilyNames, + dwritefontfamily_GetFirstMatchingFont, + dwritefontfamily_GetMatchingFonts +}; + +static HRESULT create_fontfamily(IDWriteFontFamily **family) +{ + struct dwrite_fontfamily *This; + + *family = NULL; + + This = heap_alloc(sizeof(struct dwrite_fontfamily)); + if (!This) return E_OUTOFMEMORY; + + This->IDWriteFontFamily_iface.lpVtbl = &fontfamilyvtbl; + This->ref = 1; + + *family = &This->IDWriteFontFamily_iface; + + return S_OK; +} + HRESULT create_font_from_logfont(const LOGFONTW *logfont, IDWriteFont **font) { struct dwrite_font *This; + IDWriteFontFamily *family; + HRESULT hr; *font = NULL; + hr = create_fontfamily(&family); + if (hr != S_OK) return hr; + This = heap_alloc(sizeof(struct dwrite_font)); - if (!This) return E_OUTOFMEMORY; + if (!This) + { + IDWriteFontFamily_Release(family); + return E_OUTOFMEMORY; + } This->IDWriteFont_iface.lpVtbl = &dwritefontvtbl; This->ref = 1; - + This->family = family; This->style = logfont->lfItalic ? DWRITE_FONT_STYLE_ITALIC : DWRITE_FONT_STYLE_NORMAL; *font = &This->IDWriteFont_iface; diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index ccaba88..64fe390 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -30,6 +30,14 @@ #define EXPECT_HR(hr,hr_exp) \ ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) +#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__) +static void _expect_ref(IUnknown* obj, ULONG ref, int line) +{ + ULONG rc = IUnknown_AddRef(obj); + IUnknown_Release(obj); + ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); +} + static IDWriteFactory *factory; static void test_CreateFontFromLOGFONT(void) @@ -234,6 +242,53 @@ if (0) /* crashes on native */ IDWriteGdiInterop_Release(interop); } +static void test_GetFontFamily(void) +{ + static const WCHAR arialW[] = {'A','r','i','a','l',0}; + IDWriteFontFamily *family, *family2; + IDWriteGdiInterop *interop; + IDWriteFont *font; + LOGFONTW logfont; + HRESULT hr; + + hr = IDWriteFactory_GetGdiInterop(factory, &interop); + EXPECT_HR(hr, S_OK); + + memset(&logfont, 0, sizeof(logfont)); + logfont.lfHeight = 12; + logfont.lfWidth = 12; + logfont.lfWeight = FW_NORMAL; + logfont.lfItalic = 1; + lstrcpyW(logfont.lfFaceName, arialW); + + hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); + EXPECT_HR(hr, S_OK); + +if (0) /* crashes on native */ + hr = IDWriteFont_GetFontFamily(font, NULL); + + EXPECT_REF(font, 1); + hr = IDWriteFont_GetFontFamily(font, &family); + EXPECT_HR(hr, S_OK); + EXPECT_REF(font, 1); + EXPECT_REF(family, 2); + + hr = IDWriteFont_GetFontFamily(font, &family2); + EXPECT_HR(hr, S_OK); + ok(family2 == family, "got %p, previous %p\n", family2, family); + EXPECT_REF(font, 1); + EXPECT_REF(family, 3); + IDWriteFontFamily_Release(family2); + + hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFontFamily, (void**)&family2); + EXPECT_HR(hr, E_NOINTERFACE); + ok(family2 == NULL, "got %p\n", family2); + + IDWriteFontFamily_Release(family); + IDWriteFont_Release(font); + IDWriteGdiInterop_Release(interop); +} + START_TEST(font) { HRESULT hr; @@ -248,6 +303,7 @@ START_TEST(font) test_CreateFontFromLOGFONT(); test_CreateBitmapRenderTarget(); + test_GetFontFamily(); IDWriteFactory_Release(factory); }
1
0
0
0
Piotr Caban : msvcp100: Removed virtual function callers for functions that are not virtual.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 388f11abb3adef9397a65f4e996ec215a3449a99 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=388f11abb3adef9397a65f4e9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Aug 27 11:09:44 2012 +0200 msvcp100: Removed virtual function callers for functions that are not virtual. --- dlls/msvcp100/ios.c | 16 ++++++---------- dlls/msvcp100/locale.c | 20 ++++---------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/dlls/msvcp100/ios.c b/dlls/msvcp100/ios.c index b79c8a1..e69345a 100644 --- a/dlls/msvcp100/ios.c +++ b/dlls/msvcp100/ios.c @@ -1071,8 +1071,6 @@ int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this) /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */ /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */ DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20) -#define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \ - streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count)) streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count) { streamsize copied, chunk; @@ -1109,7 +1107,7 @@ DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20) streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count) { TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count)); - return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count); + return basic_streambuf_char__Xsgetn_s(this, ptr, size, count); } /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */ @@ -1366,7 +1364,7 @@ DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16) streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count) { TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count)); - return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count); + return basic_streambuf_char__Xsgetn_s(this, ptr, -1, count); } /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */ @@ -1487,7 +1485,7 @@ DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16) streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count) { TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count)); - return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count); + return basic_streambuf_char__Xsgetn_s(this, ptr, -1, count); } /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */ @@ -1811,8 +1809,6 @@ unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *thi /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */ /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */ DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20) -#define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \ - streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count)) streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count) { streamsize copied, chunk; @@ -1851,7 +1847,7 @@ DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20) streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count) { TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count)); - return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count); + return basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count); } /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */ @@ -2156,7 +2152,7 @@ DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16) streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count) { TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count)); - return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count); + return basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count); } /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */ @@ -2297,7 +2293,7 @@ DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16) streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count) { TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count)); - return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count); + return basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count); } /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */ diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c index ccc48ab..52a45ba 100644 --- a/dlls/msvcp100/locale.c +++ b/dlls/msvcp100/locale.c @@ -1391,9 +1391,6 @@ const char* __thiscall ctype_char_do_narrow(const ctype_char *this, /* ?_Do_narrow_s@?$ctype@D@std@@MBEPBDPBD0DPADI@Z */ /* ?_Do_narrow_s@?$ctype@D@std@@MEBAPEBDPEBD0DPEAD_K@Z */ DEFINE_THISCALL_WRAPPER(ctype_char__Do_narrow_s, 24) -#define call_ctype_char__Do_narrow_s(this, first, last, unused, dest, size) CALL_VTBL_FUNC(this, 40, \ - const char*, (const ctype_char*, const char*, const char*, char, char*, MSVCP_size_t), \ - (this, first, last, unused, dest, size)) const char* __thiscall ctype_char__Do_narrow_s(const ctype_char *this, const char *first, const char *last, char unused, char *dest, MSVCP_size_t size) { @@ -1428,7 +1425,7 @@ const char* __thiscall ctype_char__Narrow_s(const ctype_char *this, const char * const char *last, char dflt, char *dest, MSVCP_size_t size) { TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size); - return call_ctype_char__Do_narrow_s(this, first, last, dflt, dest, size); + return ctype_char__Do_narrow_s(this, first, last, dflt, dest, size); } /* ?do_widen@?$ctype@D@std@@MBEDD@Z */ @@ -1459,9 +1456,6 @@ const char* __thiscall ctype_char_do_widen(const ctype_char *this, /* ?_Do_widen_s@?$ctype@D@std@@MBEPBDPBD0PADI@Z */ /* ?_Do_widen_s@?$ctype@D@std@@MEBAPEBDPEBD0PEAD_K@Z */ DEFINE_THISCALL_WRAPPER(ctype_char__Do_widen_s, 20) -#define call_ctype_char__Do_widen_s(this, first, last, dest, size) CALL_VTBL_FUNC(this, 28, \ - const char*, (const ctype_char*, const char*, const char*, char*, MSVCP_size_t), \ - (this, first, last, dest, size)) const char* __thiscall ctype_char__Do_widen_s(const ctype_char *this, const char *first, const char *last, char *dest, MSVCP_size_t size) { @@ -1496,7 +1490,7 @@ const char* __thiscall ctype_char__Widen_s(const ctype_char *this, const char *first, const char *last, char *dest, MSVCP_size_t size) { TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size); - return call_ctype_char__Do_widen_s(this, first, last, dest, size); + return ctype_char__Do_widen_s(this, first, last, dest, size); } /* ?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */ @@ -2017,9 +2011,6 @@ const wchar_t* __thiscall ctype_wchar_do_narrow(const ctype_wchar *this, /* ?_Do_narrow_s@?$ctype@G@std@@MBEPBGPBG0DPADI@Z */ /* ?_Do_narrow_s@?$ctype@G@std@@MEBAPEBGPEBG0DPEAD_K@Z */ DEFINE_THISCALL_WRAPPER(ctype_wchar__Do_narrow_s, 24) -#define call_ctype_wchar__Do_narrow_s(this, first, last, dflt, dest, size) CALL_VTBL_FUNC(this, 56, \ - const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, char, char*, MSVCP_size_t), \ - (this, first, last, dflt, dest, size)) const wchar_t* __thiscall ctype_wchar__Do_narrow_s(const ctype_wchar *this, const wchar_t *first, const wchar_t *last, char dflt, char *dest, MSVCP_size_t size) { @@ -2063,7 +2054,7 @@ const wchar_t* __thiscall ctype_wchar__Narrow_s(const ctype_wchar *this, const w const wchar_t *last, char dflt, char *dest, MSVCP_size_t size) { TRACE("(%p %p %p %d %p %lu)\n", this, first, last, dflt, dest, size); - return call_ctype_wchar__Do_narrow_s(this, first, last, dflt, dest, size); + return ctype_wchar__Do_narrow_s(this, first, last, dflt, dest, size); } /* _Mbrtowc */ @@ -2182,9 +2173,6 @@ const char* __thiscall ctype_wchar_do_widen(const ctype_wchar *this, /* ?_Do_widen_s@?$ctype@G@std@@MBEPBDPBD0PAGI@Z */ /* ?_Do_widen_s@?$ctype@G@std@@MEBAPEBDPEBD0PEAG_K@Z */ DEFINE_THISCALL_WRAPPER(ctype_wchar__Do_widen_s, 20) -#define call_ctype_wchar__Do_widen_s(this, first, last, dest, size) CALL_VTBL_FUNC(this, 44, \ - const char*, (const ctype_wchar*, const char*, const char*, wchar_t*, MSVCP_size_t), \ - (this, first, last, dest, size)) const char* __thiscall ctype_wchar__Do_widen_s(const ctype_wchar *this, const char *first, const char *last, wchar_t *dest, MSVCP_size_t size) { @@ -2228,7 +2216,7 @@ const char* __thiscall ctype_wchar__Widen_s(const ctype_wchar *this, const char *first, const char *last, wchar_t *dest, MSVCP_size_t size) { TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size); - return call_ctype_wchar__Do_widen_s(this, first, last, dest, size); + return ctype_wchar__Do_widen_s(this, first, last, dest, size); } /* ?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1
0
0
0
Rico Schüller : d3dx9/tests: Fix typo.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 42d28e0d3446654a58548fa215bc13ecc8f3a3c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=42d28e0d3446654a58548fa21…
Author: Rico Schüller <kgbricola(a)web.de> Date: Sat Aug 25 16:29:00 2012 +0200 d3dx9/tests: Fix typo. --- dlls/d3dx9_36/tests/shader.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index 9ae77b3..cd69a34 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -777,7 +777,7 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device) ok(res == D3D_OK, "D3DXGetShaderConstantTable failed: got %#x\n", res); res = ID3DXConstantTable_SetMatrix(ctable, device, "imatrix2x3", &fmatrix); - ok(res == D3D_OK, "ID3DXConstantTable_SetMatrix failed on variable fmatrix2x3: got %#x\n", res); + ok(res == D3D_OK, "ID3DXConstantTable_SetMatrix failed on variable imatrix2x3: got %#x\n", res); res = ID3DXConstantTable_SetMatrix(ctable, device, "fmatrix3x1", &fmatrix); ok(res == D3D_OK, "ID3DXConstantTable_SetMatrix failed on variable fmatrix3x1: got %#x\n", res);
1
0
0
0
Rico Schüller : d3dx9: Remove "too many constants" fixme.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 8c8b4c356cb76377e2c8dcaf7d0e8f1d3e3b4a76 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8c8b4c356cb76377e2c8dcaf7…
Author: Rico Schüller <kgbricola(a)web.de> Date: Sat Aug 25 16:28:56 2012 +0200 d3dx9: Remove "too many constants" fixme. --- dlls/d3dx9_36/shader.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index e7fbf30..1295f08 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -1760,13 +1760,6 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD *byte_code, debugstr_a(object->desc.Creator), object->desc.Version, object->desc.Constants, debugstr_a(ctab_header->Target ? object->ctab + ctab_header->Target : NULL)); - if (object->desc.Constants > 65535) - { - FIXME("Too many constants (%u)\n", object->desc.Constants); - hr = E_NOTIMPL; - goto error; - } - object->constants = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object->constants) * object->desc.Constants); if (!object->constants)
1
0
0
0
Rico Schüller : d3dx9: Add debug helper function for RegisterSet.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 3dc48141d108dc47b100ea53b4b2be4a19b4de37 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3dc48141d108dc47b100ea53b…
Author: Rico Schüller <kgbricola(a)web.de> Date: Sat Aug 25 16:28:53 2012 +0200 d3dx9: Add debug helper function for RegisterSet. --- dlls/d3dx9_36/d3dx9_36_private.h | 1 + dlls/d3dx9_36/shader.c | 17 +++++++++-------- dlls/d3dx9_36/util.c | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index 76a9694..ea7b401 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -91,5 +91,6 @@ HRESULT load_volume_texture_from_dds(IDirect3DVolumeTexture9 *volume_texture, co /* debug helpers */ const char *debug_d3dxparameter_class(D3DXPARAMETER_CLASS c) DECLSPEC_HIDDEN; const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t) DECLSPEC_HIDDEN; +const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r) DECLSPEC_HIDDEN; #endif /* __WINE_D3DX9_36_PRIVATE_H */ diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index a3cd6f1..e7fbf30 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -674,8 +674,8 @@ static inline int is_vertex_shader(DWORD version) static DWORD calc_bytes(D3DXCONSTANT_DESC *desc) { if (desc->RegisterSet != D3DXRS_FLOAT4 && desc->RegisterSet != D3DXRS_SAMPLER) - FIXME("Don't know how to calculate Bytes for constants of type %d\n", - desc->RegisterSet); + FIXME("Don't know how to calculate Bytes for constants of type %s\n", + debug_d3dxparameter_registerset(desc->RegisterSet)); return 4 * desc->Elements * desc->Rows * desc->Columns; } @@ -1064,7 +1064,7 @@ static HRESULT set_scalar_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev } break; default: - FIXME("Handle other register sets\n"); + FIXME("Unhandled register set %s\n", debug_d3dxparameter_registerset(desc.RegisterSet)); return E_NOTIMPL; } @@ -1117,7 +1117,7 @@ static HRESULT set_vector_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev } break; default: - FIXME("Unhandled register set %#x\n", desc.RegisterSet); + FIXME("Unhandled register set %s\n", debug_d3dxparameter_registerset(desc.RegisterSet)); return E_NOTIMPL; } @@ -1235,7 +1235,7 @@ static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev } break; default: - FIXME("Unhandled register set %#x\n", desc.RegisterSet); + FIXME("Unhandled register set %s\n", debug_d3dxparameter_registerset(desc.RegisterSet)); return E_NOTIMPL; } @@ -1340,7 +1340,7 @@ static HRESULT set_matrix_pointer_array(ID3DXConstantTable *iface, IDirect3DDevi } break; default: - FIXME("Unhandled register set %#x\n", desc.RegisterSet); + FIXME("Unhandled register set %s\n", debug_d3dxparameter_registerset(desc.RegisterSet)); return E_NOTIMPL; } @@ -1599,8 +1599,9 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru constant->desc.RegisterSet = regset; constant->desc.RegisterIndex = index; - TRACE("name %s, elements %u, index %u, defaultvalue %p\n", constant->desc.Name, - constant->desc.Elements, index, constant->desc.DefaultValue); + TRACE("name %s, elements %u, index %u, defaultvalue %p, regset %s\n", constant->desc.Name, + constant->desc.Elements, index, constant->desc.DefaultValue, + debug_d3dxparameter_registerset(regset)); TRACE("class %s, type %s, rows %d, columns %d, elements %d, struct_members %d\n", debug_d3dxparameter_class(type->Class), debug_d3dxparameter_type(type->Type), type->Rows, type->Columns, type->Elements, type->StructMembers); diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c index cf974cf..5c34834 100644 --- a/dlls/d3dx9_36/util.c +++ b/dlls/d3dx9_36/util.c @@ -250,7 +250,21 @@ const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t) WINE_D3DX_TO_STR(D3DXPT_VERTEXFRAGMENT); WINE_D3DX_TO_STR(D3DXPT_UNSUPPORTED); default: - FIXME("Unrecognized D3DXPARAMETER_TYP %#x.\n", t); + FIXME("Unrecognized D3DXPARAMETER_TYP %#x.\n", t); + return "unrecognized"; + } +} + +const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r) +{ + switch (r) + { + WINE_D3DX_TO_STR(D3DXRS_BOOL); + WINE_D3DX_TO_STR(D3DXRS_INT4); + WINE_D3DX_TO_STR(D3DXRS_FLOAT4); + WINE_D3DX_TO_STR(D3DXRS_SAMPLER); + default: + FIXME("Unrecognized D3DXREGISTER_SET %#x.\n", r); return "unrecognized"; } }
1
0
0
0
Rico Schüller : d3dx9: Use debug_d3dxparameter_class/ type in traces.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 24ab70906b108bd2ffc05d5e6484166dc99dba9b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=24ab70906b108bd2ffc05d5e6…
Author: Rico Schüller <kgbricola(a)web.de> Date: Sat Aug 25 16:28:49 2012 +0200 d3dx9: Use debug_d3dxparameter_class/type in traces. --- dlls/d3dx9_36/shader.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 162909b..a3cd6f1 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -1057,7 +1057,7 @@ static HRESULT set_scalar_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev row[0] = ((BOOL *)data)[i] ? 1.0f : 0.0f; break; default: - FIXME("Unhandled type %#x\n", type); + FIXME("Unhandled type %s\n", debug_d3dxparameter_type(type)); return D3DERR_INVALIDCALL; } set_float_shader_constant(This, device, desc.RegisterIndex + i, row, 1); @@ -1109,7 +1109,7 @@ static HRESULT set_vector_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev vec[j] = ((BOOL *)data)[i * desc.Columns + j] ? 1.0f : 0.0f; break; default: - FIXME("Unhandled type %#x\n", type); + FIXME("Unhandled type %s\n", debug_d3dxparameter_type(type)); return D3DERR_INVALIDCALL; } @@ -1147,7 +1147,7 @@ static HRESULT set_float_matrix(FLOAT *matrix, const D3DXCONSTANT_DESC *desc, } break; default: - FIXME("Unhandled type %#x\n", type); + FIXME("Unhandled type %s\n", debug_d3dxparameter_type(type)); return D3DERR_INVALIDCALL; } @@ -1213,7 +1213,7 @@ static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev } else { - FIXME("Unhandled variable class %#x\n", desc.Class); + FIXME("Unhandled variable class %s\n", debug_d3dxparameter_class(desc.Class)); return D3D_OK; } @@ -1319,7 +1319,7 @@ static HRESULT set_matrix_pointer_array(ID3DXConstantTable *iface, IDirect3DDevi } else { - FIXME("Unhandled variable class %#x\n", desc.Class); + FIXME("Unhandled variable class %s\n", debug_d3dxparameter_class(desc.Class)); return D3D_OK; } @@ -1395,13 +1395,13 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetValue(ID3DXConstantTable *iface, case D3DXPC_SCALAR: return set_scalar_array(iface, device, constant, data, elements, desc.Type); case D3DXPC_VECTOR: - return set_vector_array(iface, device, constant, data,elements, desc.Type); + return set_vector_array(iface, device, constant, data, elements, desc.Type); case D3DXPC_MATRIX_ROWS: case D3DXPC_MATRIX_COLUMNS: return set_matrix_array(iface, device, constant, data, elements, D3DXPC_MATRIX_ROWS, desc.Type, desc.Rows, desc.Columns); default: - FIXME("Unhandled parameter class %#x\n", desc.Class); + FIXME("Unhandled parameter class %s\n", debug_d3dxparameter_class(desc.Class)); return D3DERR_INVALIDCALL; } } @@ -1601,8 +1601,9 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru TRACE("name %s, elements %u, index %u, defaultvalue %p\n", constant->desc.Name, constant->desc.Elements, index, constant->desc.DefaultValue); - TRACE("class %d, type %d, rows %d, columns %d, elements %d, struct_members %d\n", - type->Class, type->Type, type->Rows, type->Columns, type->Elements, type->StructMembers); + TRACE("class %s, type %s, rows %d, columns %d, elements %d, struct_members %d\n", + debug_d3dxparameter_class(type->Class), debug_d3dxparameter_type(type->Type), + type->Rows, type->Columns, type->Elements, type->StructMembers); if (type->Elements > 1 && !is_element) { @@ -1662,7 +1663,7 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru break; default: - FIXME("Unhandled type class %u\n", type->Class); + FIXME("Unhandled type class %s\n", debug_d3dxparameter_class(type->Class)); break; }
1
0
0
0
Rico Schüller : d3dx9/tests: Add tests for ID3DXConstantTable::GetConstant/ByName/Element().
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 68508ed5810c4f1509b24e6d1a02e84617233ecc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=68508ed5810c4f1509b24e6d1…
Author: Rico Schüller <kgbricola(a)web.de> Date: Sat Aug 25 16:28:44 2012 +0200 d3dx9/tests: Add tests for ID3DXConstantTable::GetConstant/ByName/Element(). --- dlls/d3dx9_36/tests/shader.c | 71 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 70 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index e2496a7..9ae77b3 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -1731,7 +1731,7 @@ static void test_get_shader_constant_variables(void) ULONG count; UINT i; UINT nr = 1; - D3DXHANDLE constant; + D3DXHANDLE constant, element; D3DXCONSTANT_DESC desc; DWORD *ctab; @@ -1779,6 +1779,75 @@ static void test_get_shader_constant_variables(void) fullname, (UINT)((DWORD *)desc.DefaultValue - ctab), ctaboffset); } + element = ID3DXConstantTable_GetConstantElement(ctable, NULL, 0); + ok(element == NULL, "GetConstantElement failed\n"); + + constant = ID3DXConstantTable_GetConstantByName(ctable, NULL, "i"); + ok(constant != NULL, "GetConstantByName failed\n"); + + element = ID3DXConstantTable_GetConstantByName(ctable, NULL, "i[0]"); + ok(constant == element, "GetConstantByName failed, got %p, expected %p\n", element, constant); + + element = ID3DXConstantTable_GetConstantElement(ctable, "i", 0); + ok(element == constant, "GetConstantElement failed, got %p, expected %p\n", element, constant); + + constant = ID3DXConstantTable_GetConstantByName(ctable, NULL, "f"); + ok(constant != NULL, "GetConstantByName failed\n"); + + element = ID3DXConstantTable_GetConstant(ctable, NULL, 0); + ok(element == constant, "GetConstant failed, got %p, expected %p\n", element, constant); + + element = ID3DXConstantTable_GetConstant(ctable, "invalid", 0); + ok(element == NULL, "GetConstant failed\n"); + + element = ID3DXConstantTable_GetConstant(ctable, "f", 0); + ok(element == NULL, "GetConstant failed\n"); + + element = ID3DXConstantTable_GetConstantByName(ctable, NULL, "f[0]"); + ok(constant == element, "GetConstantByName failed, got %p, expected %p\n", element, constant); + + element = ID3DXConstantTable_GetConstantByName(ctable, NULL, "f[1]"); + ok(NULL == element, "GetConstantByName failed\n"); + + element = ID3DXConstantTable_GetConstantByName(ctable, NULL, "f[0][0]"); + ok(constant == element, "GetConstantByName failed, got %p, expected %p\n", element, constant); + + element = ID3DXConstantTable_GetConstantByName(ctable, NULL, "f."); + ok(element == NULL, "GetConstantByName failed\n"); + + element = ID3DXConstantTable_GetConstantElement(ctable, "f", 0); + ok(element == constant, "GetConstantElement failed, got %p, expected %p\n", element, constant); + + element = ID3DXConstantTable_GetConstantElement(ctable, "f", 1); + ok(element == NULL, "GetConstantElement failed\n"); + + constant = ID3DXConstantTable_GetConstantByName(ctable, NULL, "f_2[0]"); + ok(constant != NULL, "GetConstantByName failed\n"); + + element = ID3DXConstantTable_GetConstantByName(ctable, NULL, "f_2"); + ok(element != constant, "GetConstantByName failed, got %p, expected %p\n", element, constant); + + element = ID3DXConstantTable_GetConstantElement(ctable, "f_2", 0); + ok(element == constant, "GetConstantElement failed, got %p, expected %p\n", element, constant); + + constant = ID3DXConstantTable_GetConstantByName(ctable, NULL, "f_2[1]"); + ok(constant != NULL, "GetConstantByName failed\n"); + + element = ID3DXConstantTable_GetConstantElement(ctable, "f_2", 1); + ok(element == constant, "GetConstantElement failed, got %p, expected %p\n", element, constant); + + constant = ID3DXConstantTable_GetConstantByName(ctable, NULL, "s_2[0].f"); + ok(constant != NULL, "GetConstantByName failed\n"); + + element = ID3DXConstantTable_GetConstant(ctable, "s_2[0]", 0); + ok(element == constant, "GetConstant failed, got %p, expected %p\n", element, constant); + + element = ID3DXConstantTable_GetConstantByName(ctable, "s_2[0]", "f"); + ok(element == constant, "GetConstantByName failed, got %p, expected %p\n", element, constant); + + element = ID3DXConstantTable_GetConstantByName(ctable, "s_2[0]", "invalid"); + ok(element == NULL, "GetConstantByName failed\n"); + count = ID3DXConstantTable_Release(ctable); ok(count == 0, "Release failed, got %u, expected %u\n", count, 0); }
1
0
0
0
Rico Schüller : d3dx9/tests: Add tests for ID3DXConstantTable::GetConstantDesc().
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: fdbcbb0c91859a959b0a92efd198201c1d021f23 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fdbcbb0c91859a959b0a92efd…
Author: Rico Schüller <kgbricola(a)web.de> Date: Sat Aug 25 16:28:39 2012 +0200 d3dx9/tests: Add tests for ID3DXConstantTable::GetConstantDesc(). --- dlls/d3dx9_36/tests/shader.c | 216 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 216 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=fdbcbb0c91859a959b0a9…
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
55
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
Results per page:
10
25
50
100
200