winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 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
2 participants
737 discussions
Start a n
N
ew thread
Andrew Eikum : winmm: Close open wave devices upon process detach.
by Alexandre Julliard
08 May '12
08 May '12
Module: wine Branch: master Commit: 31291cdc6ccc4c172ccf86f383c6a90f31a50ba1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31291cdc6ccc4c172ccf86f38…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Mon May 7 09:58:04 2012 -0500 winmm: Close open wave devices upon process detach. --- dlls/winmm/waveform.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c index d4dc9aa..a985ee8 100644 --- a/dlls/winmm/waveform.c +++ b/dlls/winmm/waveform.c @@ -183,6 +183,26 @@ static LRESULT WID_Close(HWAVEIN hwave); void WINMM_DeleteWaveform(void) { + UINT i, j; + + for(i = 0; i < g_outmmdevices_count; ++i){ + WINMM_MMDevice *mmdevice = &g_out_mmdevices[i]; + for(j = 0; j < MAX_DEVICES && mmdevice->devices[j]; ++j){ + WINMM_Device *device = mmdevice->devices[j]; + if(device->open) + SendMessageW(g_devices_hwnd, WODM_CLOSE, (WPARAM)device->handle, 0); + } + } + + for(i = 0; i < g_inmmdevices_count; ++i){ + WINMM_MMDevice *mmdevice = &g_in_mmdevices[i]; + for(j = 0; j < MAX_DEVICES && mmdevice->devices[j]; ++j){ + WINMM_Device *device = mmdevice->devices[j]; + if(device->open) + SendMessageW(g_devices_hwnd, WIDM_CLOSE, (WPARAM)device->handle, 0); + } + } + /* FIXME: Free g_(in,out)_mmdevices? */ DeleteCriticalSection(&g_devthread_lock); }
1
0
0
0
Alexander E. Patrakov : dsound: Added a windowed-sinc resampler.
by Alexandre Julliard
08 May '12
08 May '12
Module: wine Branch: master Commit: 275dfb83f2371a476b615b260465afb3cdf67f32 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=275dfb83f2371a476b615b260…
Author: Alexander E. Patrakov <patrakov(a)gmail.com> Date: Mon May 7 00:06:13 2012 +0600 dsound: Added a windowed-sinc resampler. --- dlls/dsound/dsound_private.h | 3 +- dlls/dsound/fir.h | 1587 ++++++++++++++++++++++++++++++++++++++++++ dlls/dsound/mixer.c | 122 +++- tools/make_fir | 158 +++++ 4 files changed, 1852 insertions(+), 18 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=275dfb83f2371a476b615…
1
0
0
0
Alexandre Julliard : urlmon/tests: Allow some more optional progress notifications.
by Alexandre Julliard
08 May '12
08 May '12
Module: wine Branch: master Commit: 0789ec11449db52b6424e3959b7431f7f6524a56 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0789ec11449db52b6424e3959…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 8 09:01:36 2012 +0200 urlmon/tests: Allow some more optional progress notifications. --- dlls/urlmon/tests/protocol.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index a39b8ed..ce383ee 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -594,6 +594,7 @@ static void call_continue(PROTOCOLDATA *protocol_data) SET_EXPECT(OnResponse); if(tested_protocol == HTTPS_TEST || test_redirect || test_abort || empty_file) SET_EXPECT(ReportProgress_ACCEPTRANGES); + SET_EXPECT(ReportProgress_ENCODING); SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE); if(bindf & BINDF_NEEDFILE) SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); @@ -627,6 +628,7 @@ static void call_continue(PROTOCOLDATA *protocol_data) CHECK_CALLED(ReportProgress_ACCEPTRANGES); else if(test_redirect || test_abort) CLEAR_CALLED(ReportProgress_ACCEPTRANGES); + CLEAR_CALLED(ReportProgress_ENCODING); CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); if(bindf & BINDF_NEEDFILE) CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE); @@ -751,7 +753,7 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface, switch(ulStatusCode) { case BINDSTATUS_MIMETYPEAVAILABLE: - CHECK_EXPECT(ReportProgress_MIMETYPEAVAILABLE); + CHECK_EXPECT2(ReportProgress_MIMETYPEAVAILABLE); if(tested_protocol != FILE_TEST && tested_protocol != ITS_TEST && !mimefilter_test && (pi & PI_MIMEVERIFICATION)) { if(!short_read || !direct_read) CHECK_CALLED(Read); /* set in Continue */ @@ -831,7 +833,7 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface, ok(!lstrcmpW(szStatusText, null_guid), "unexpected classid %s\n", wine_dbgstr_w(szStatusText)); break; case BINDSTATUS_COOKIE_SENT: - CHECK_EXPECT(ReportProgress_COOKIE_SENT); + CHECK_EXPECT2(ReportProgress_COOKIE_SENT); ok(szStatusText == NULL, "szStatusText != NULL\n"); break; case BINDSTATUS_REDIRECTING:
1
0
0
0
Jeremy Newman : updated via suggestion from Adys
by Jeremy Newman
08 May '12
08 May '12
Module: website Branch: master Commit: d2e3822e541724b7746acc17eaa776e01bd95b71 URL:
http://source.winehq.org/git/website.git/?a=commit;h=d2e3822e541724b7746acc…
Author: Jeremy Newman <jnewman(a)codeweavers.com> Date: Tue May 8 14:06:32 2012 -0500 updated via suggestion from Adys --- favicon.ico | Bin 1406 -> 1150 bytes 1 files changed, 0 insertions(+), 0 deletions(-) diff --git a/favicon.ico b/favicon.ico index 78b6d9b..3a71334 100644 Binary files a/favicon.ico and b/favicon.ico differ
1
0
0
0
Nikolay Sivov : msxml3: Make ::put_data() use passed BSTR as general WCHAR buffer.
by Alexandre Julliard
07 May '12
07 May '12
Module: wine Branch: master Commit: b80c71abe6de1a76a7a7d869ed11d06b6953755a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b80c71abe6de1a76a7a7d869e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon May 7 15:36:03 2012 +0400 msxml3: Make ::put_data() use passed BSTR as general WCHAR buffer. --- dlls/msxml3/cdata.c | 10 +--- dlls/msxml3/comment.c | 9 +--- dlls/msxml3/pi.c | 8 +-- dlls/msxml3/tests/domdoc.c | 118 ++++++++++++++++++++++++++++++++++++++++++++ dlls/msxml3/text.c | 9 +--- 5 files changed, 126 insertions(+), 28 deletions(-) diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index 63265bf..b07cd84 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -552,14 +552,8 @@ static HRESULT WINAPI domcdata_put_data( BSTR data) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - VARIANT val; - - TRACE("(%p)->(%s)\n", This, debugstr_w(data) ); - - V_VT(&val) = VT_BSTR; - V_BSTR(&val) = data; - - return IXMLDOMCDATASection_put_nodeValue( iface, val ); + TRACE("(%p)->(%s)\n", This, debugstr_w(data)); + return node_set_content(&This->node, data); } static HRESULT WINAPI domcdata_get_length( diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index f1f94c6..3dab11b 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -554,13 +554,8 @@ static HRESULT WINAPI domcomment_put_data( BSTR data) { domcomment *This = impl_from_IXMLDOMComment( iface ); - VARIANT val; - - TRACE("(%p)->(%s)\n", This, debugstr_w(data) ); - - V_VT(&val) = VT_BSTR; - V_BSTR(&val) = data; - return node_put_value(&This->node, &val); + TRACE("(%p)->(%s)\n", This, debugstr_w(data)); + return node_set_content(&This->node, data); } static HRESULT WINAPI domcomment_get_length( diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index a6034bb..4d1910b 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -602,13 +602,12 @@ static HRESULT WINAPI dom_pi_put_data( BSTR data) { dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); - VARIANT val; BSTR target; HRESULT hr; TRACE("(%p)->(%s)\n", This, debugstr_w(data) ); - /* Cannot set data to a PI node whose target is 'xml' */ + /* cannot set data to a PI node whose target is 'xml' */ hr = IXMLDOMProcessingInstruction_get_nodeName(iface, &target); if(hr == S_OK) { @@ -622,10 +621,7 @@ static HRESULT WINAPI dom_pi_put_data( SysFreeString(target); } - V_VT(&val) = VT_BSTR; - V_BSTR(&val) = data; - - return IXMLDOMProcessingInstruction_put_nodeValue( iface, val ); + return node_set_content(&This->node, data); } static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl = diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index d50a22e..09165c3 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -11675,6 +11675,123 @@ todo_wine free_bstrs(); } +static DOMNodeType put_data_types[] = { + NODE_TEXT, + NODE_CDATA_SECTION, + NODE_PROCESSING_INSTRUCTION, + NODE_COMMENT, + NODE_INVALID +}; + +static void test_put_data(void) +{ + static const WCHAR test_data[] = {'t','e','s','t',' ','n','o','d','e',' ','d','a','t','a',0}; + WCHAR buff[100], *data; + IXMLDOMDocument *doc; + DOMNodeType *type; + BSTR get_data; + HRESULT hr; + + doc = create_document(&IID_IXMLDOMDocument); + if (!doc) return; + + memcpy(&buff[2], test_data, sizeof(test_data)); + /* just a big length */ + *(DWORD*)buff = 0xf0f0; + data = &buff[2]; + + type = put_data_types; + while (*type != NODE_INVALID) + { + IXMLDOMNode *node; + VARIANT v; + + V_VT(&v) = VT_I2; + V_I2(&v) = *type; + + hr = IXMLDOMDocument_createNode(doc, v, _bstr_("name"), NULL, &node); + EXPECT_HR(hr, S_OK); + + /* put_data() is interface-specific */ + switch (*type) + { + case NODE_TEXT: + { + IXMLDOMText *text; + + hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMText, (void**)&text); + EXPECT_HR(hr, S_OK); + hr = IXMLDOMText_put_data(text, data); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMText_get_data(text, &get_data); + EXPECT_HR(hr, S_OK); + + IXMLDOMText_Release(text); + break; + } + case NODE_CDATA_SECTION: + { + IXMLDOMCDATASection *cdata; + + hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMCDATASection, (void**)&cdata); + EXPECT_HR(hr, S_OK); + hr = IXMLDOMCDATASection_put_data(cdata, data); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMCDATASection_get_data(cdata, &get_data); + EXPECT_HR(hr, S_OK); + + IXMLDOMCDATASection_Release(cdata); + break; + } + case NODE_PROCESSING_INSTRUCTION: + { + IXMLDOMProcessingInstruction *pi; + + hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMProcessingInstruction, (void**)&pi); + EXPECT_HR(hr, S_OK); + hr = IXMLDOMProcessingInstruction_put_data(pi, data); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMProcessingInstruction_get_data(pi, &get_data); + EXPECT_HR(hr, S_OK); + + IXMLDOMProcessingInstruction_Release(pi); + break; + } + case NODE_COMMENT: + { + IXMLDOMComment *comment; + + hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMComment, (void**)&comment); + EXPECT_HR(hr, S_OK); + hr = IXMLDOMComment_put_data(comment, data); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMComment_get_data(comment, &get_data); + EXPECT_HR(hr, S_OK); + + IXMLDOMComment_Release(comment); + break; + } + default: + break; + } + + /* compare */ + ok(!lstrcmpW(data, get_data), "%d: got wrong data %s, expected %s\n", *type, wine_dbgstr_w(get_data), + wine_dbgstr_w(data)); + SysFreeString(get_data); + + IXMLDOMNode_Release(node); + type++; + } + + IXMLDOMDocument_Release(doc); + free_bstrs(); +} + START_TEST(domdoc) { IXMLDOMDocument *doc; @@ -11752,6 +11869,7 @@ START_TEST(domdoc) test_supporterrorinfo(); test_nodeValue(); test_get_namespaces(); + test_put_data(); test_xsltemplate(); diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index 74de8e5..705afd0 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -608,13 +608,8 @@ static HRESULT WINAPI domtext_put_data( BSTR data) { domtext *This = impl_from_IXMLDOMText( iface ); - VARIANT val; - - TRACE("(%p)->(%s)\n", This, debugstr_w(data) ); - - V_VT(&val) = VT_BSTR; - V_BSTR(&val) = data; - return node_put_value(&This->node, &val); + TRACE("(%p)->(%s)\n", This, debugstr_w(data)); + return node_set_content(&This->node, data); } static HRESULT WINAPI domtext_get_length(
1
0
0
0
Nikolay Sivov : shell32: Added a stub for IShellDispatch2.
by Alexandre Julliard
07 May '12
07 May '12
Module: wine Branch: master Commit: cb53b7a8e164261a37ca5b04872a686ef8502a64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb53b7a8e164261a37ca5b048…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon May 7 09:07:21 2012 +0400 shell32: Added a stub for IShellDispatch2. --- dlls/shell32/shelldispatch.c | 179 ++++++++++++++++++++++++++++------------- include/shldisp.idl | 27 ++++++- 2 files changed, 148 insertions(+), 58 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=cb53b7a8e164261a37ca5…
1
0
0
0
Józef Kucia : d3dx9/tests: Add tests for D3DXSaveSurfaceToFile.
by Alexandre Julliard
07 May '12
07 May '12
Module: wine Branch: master Commit: 8b17b0f5c6b469758fe78228611ad7f0b9a93d69 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b17b0f5c6b469758fe782286…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Fri May 4 13:01:23 2012 +0200 d3dx9/tests: Add tests for D3DXSaveSurfaceToFile. --- dlls/d3dx9_36/tests/surface.c | 84 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 84 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 79d4bc3..2138e45 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -917,6 +917,89 @@ static void test_D3DXCreateVolumeTexture(IDirect3DDevice9 *device) } } +static void test_D3DXSaveSurfaceToFile(IDirect3DDevice9 *device) +{ + HRESULT hr; + IDirect3DSurface9 *surface; + RECT rect; + D3DLOCKED_RECT lock_rect; + D3DXIMAGE_INFO image_info; + const BYTE pixels[] = { 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0xff }; + DWORD pitch = sizeof(pixels) / 2; + + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 2, 2, D3DFMT_R8G8B8, D3DPOOL_SCRATCH, &surface, NULL); + if (FAILED(hr)) { + skip("Couldn't create surface\n"); + return; + } + + SetRect(&rect, 0, 0, 2, 2); + hr = D3DXLoadSurfaceFromMemory(surface, NULL, NULL, pixels, D3DFMT_R8G8B8, pitch, NULL, &rect, D3DX_FILTER_NONE, 0); + if (SUCCEEDED(hr)) { + hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, NULL); + ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK); + + hr = D3DXLoadSurfaceFromFileA(surface, NULL, NULL, "saved_surface.bmp", NULL, D3DX_FILTER_NONE, 0, &image_info); + ok(hr == D3D_OK, "Couldn't load saved surface %#x\n", hr); + if (FAILED(hr)) goto next_tests; + + ok(image_info.Width == 2, "Wrong width %u\n", image_info.Width); + ok(image_info.Height == 2, "Wrong height %u\n", image_info.Height); + ok(image_info.Format == D3DFMT_R8G8B8, "Wrong format %#x\n", image_info.Format); + ok(image_info.ImageFileFormat == D3DXIFF_BMP, "Wrong file format %u\n", image_info.ImageFileFormat); + + hr = IDirect3DSurface9_LockRect(surface, &lock_rect, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "Couldn't lock surface %#x\n", hr); + if (FAILED(hr)) goto next_tests; + + ok(!memcmp(lock_rect.pBits, pixels, pitch), "Pixel data mismatch in first row\n"); + ok(!memcmp((BYTE *)lock_rect.pBits + lock_rect.Pitch, pixels + pitch, pitch), "Pixel data mismatch in second row\n"); + + IDirect3DSurface9_UnlockRect(surface); + } else skip("Couldn't fill surface\n"); + +next_tests: + hr = D3DXSaveSurfaceToFileA(NULL, D3DXIFF_BMP, surface, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); + + /* PPM and TGA are supported, even though MSDN claims they aren't */ + todo_wine { + hr = D3DXSaveSurfaceToFileA("saved_surface.ppm", D3DXIFF_PPM, surface, NULL, NULL); + ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK); + hr = D3DXSaveSurfaceToFileA("saved_surface.tga", D3DXIFF_TGA, surface, NULL, NULL); + ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK); + hr = D3DXSaveSurfaceToFileA("saved_surface.dds", D3DXIFF_DDS, surface, NULL, NULL); + ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK); + } + + hr = D3DXSaveSurfaceToFileA("saved_surface", D3DXIFF_PFM + 1, surface, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); + + SetRect(&rect, 0, 0, 4, 4); + hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect); + ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); + SetRect(&rect, 2, 0, 1, 4); + hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect); + ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); + SetRect(&rect, 0, 2, 4, 1); + hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect); + ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); + SetRect(&rect, -1, -1, 2, 2); + hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect); + ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); + SetRect(&rect, 0, 0, 0, 0); + hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect); + ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK); + + DeleteFileA("saved_surface.bmp"); + DeleteFileA("saved_surface.ppm"); + DeleteFileA("saved_surface.tga"); + DeleteFileA("saved_surface.dds"); + + IDirect3DSurface9_Release(surface); +} + START_TEST(surface) { HWND wnd; @@ -952,6 +1035,7 @@ START_TEST(surface) test_D3DXLoadSurface(device); test_D3DXCreateCubeTexture(device); test_D3DXCreateVolumeTexture(device); + test_D3DXSaveSurfaceToFile(device); check_release((IUnknown*)device, 0); check_release((IUnknown*)d3d, 0);
1
0
0
0
Józef Kucia : d3dx9: Implement the pixel format conversion in D3DXSaveSurfaceToFileW.
by Alexandre Julliard
07 May '12
07 May '12
Module: wine Branch: master Commit: f0bb42551615f1601c318be81d04d5af6fb95806 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f0bb42551615f1601c318be81…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Fri May 4 13:01:22 2012 +0200 d3dx9: Implement the pixel format conversion in D3DXSaveSurfaceToFileW. --- dlls/d3dx9_36/surface.c | 54 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 50 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index e5d0dc6..a78d8cf 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1527,15 +1527,61 @@ HRESULT WINAPI D3DXSaveSurfaceToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEF IWICBitmapFrameEncode_WritePixels(frame, height, locked_rect.Pitch, height * locked_rect.Pitch, locked_rect.pBits); IDirect3DSurface9_UnlockRect(src_surface); - hr = IWICBitmapFrameEncode_Commit(frame); } } - else FIXME("Unsupported pixel format conversion %#x -> %#x\n", src_surface_desc.Format, d3d_pixel_format); + else /* Pixel format conversion */ + { + const PixelFormatDesc *src_format_desc, *dst_format_desc; + SIZE size; + DWORD dst_pitch; + void *dst_data; + + src_format_desc = get_format_info(src_surface_desc.Format); + dst_format_desc = get_format_info(d3d_pixel_format); + if (src_format_desc->format == D3DFMT_UNKNOWN || dst_format_desc->format == D3DFMT_UNKNOWN) + { + FIXME("Unsupported pixel format conversion %#x -> %#x\n", + src_format_desc->format, dst_format_desc->format); + hr = E_NOTIMPL; + goto cleanup; + } + + if (src_format_desc->bytes_per_pixel > 4 + || dst_format_desc->bytes_per_pixel > 4 + || src_format_desc->block_height != 1 || src_format_desc->block_width != 1 + || dst_format_desc->block_height != 1 || dst_format_desc->block_width != 1) + { + hr = E_NOTIMPL; + goto cleanup; + } + + size.cx = width; + size.cy = height; + dst_pitch = width * dst_format_desc->bytes_per_pixel; + dst_data = HeapAlloc(GetProcessHeap(), 0, dst_pitch * height); + if (!dst_data) + { + hr = E_OUTOFMEMORY; + goto cleanup; + } + + hr = IDirect3DSurface9_LockRect(src_surface, &locked_rect, src_rect, D3DLOCK_READONLY); + if (SUCCEEDED(hr)) + { + copy_simple_data(locked_rect.pBits, locked_rect.Pitch, size, src_format_desc, + dst_data, dst_pitch, size, dst_format_desc, 0); + IDirect3DSurface9_UnlockRect(src_surface); + } + + IWICBitmapFrameEncode_WritePixels(frame, height, dst_pitch, dst_pitch * height, dst_data); + HeapFree(GetProcessHeap(), 0, dst_data); + } + + hr = IWICBitmapFrameEncode_Commit(frame); + if (SUCCEEDED(hr)) hr = IWICBitmapEncoder_Commit(encoder); } else WARN("Unsupported pixel format %#x\n", src_surface_desc.Format); - if (SUCCEEDED(hr)) hr = IWICBitmapEncoder_Commit(encoder); - cleanup_err: if (FAILED(hr)) hr = D3DERR_INVALIDCALL;
1
0
0
0
Józef Kucia : d3dx9: Implement D3DXSaveSurfaceToFileW.
by Alexandre Julliard
07 May '12
07 May '12
Module: wine Branch: master Commit: ec70b67b8d908d1ee11708d18a75774cb9a9bdf8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ec70b67b8d908d1ee11708d18…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Fri May 4 13:01:21 2012 +0200 d3dx9: Implement D3DXSaveSurfaceToFileW. --- dlls/d3dx9_36/surface.c | 166 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 162 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index ab316cf..e5d0dc6 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -59,6 +59,19 @@ static D3DFORMAT wic_guid_to_d3dformat(const GUID *guid) return D3DFMT_UNKNOWN; } +static const GUID *d3dformat_to_wic_guid(D3DFORMAT format) +{ + int i; + + for (i = 0; i < sizeof(wic_pixel_formats) / sizeof(wic_pixel_formats[0]); i++) + { + if (wic_pixel_formats[i].d3dformat == format) + return wic_pixel_formats[i].wic_guid; + } + + return NULL; +} + /* dds_header.flags */ #define DDS_CAPS 0x1 #define DDS_HEIGHT 0x2 @@ -1387,9 +1400,154 @@ HRESULT WINAPI D3DXSaveSurfaceToFileA(const char *dst_filename, D3DXIMAGE_FILEFO return hr; } -HRESULT WINAPI D3DXSaveSurfaceToFileW(LPCWSTR pDestFile, D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DSURFACE9 pSrcSurface, const PALETTEENTRY* pSrcPalette, const RECT* pSrcRect) +HRESULT WINAPI D3DXSaveSurfaceToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEFORMAT file_format, + IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect) { - FIXME("(%p, %d, %p, %p, %p): stub\n", pDestFile, DestFormat, pSrcSurface, pSrcPalette, pSrcRect); - return D3DERR_INVALIDCALL; + IWICImagingFactory *factory; + IWICBitmapEncoder *encoder = NULL; + IWICBitmapFrameEncode *frame = NULL; + IPropertyBag2 *encoder_options = NULL; + IWICStream *stream = NULL; + HRESULT hr; + HRESULT initresult; + const CLSID *encoder_clsid; + const GUID *pixel_format_guid; + WICPixelFormatGUID wic_pixel_format; + D3DFORMAT d3d_pixel_format; + D3DSURFACE_DESC src_surface_desc; + D3DLOCKED_RECT locked_rect; + int width, height; + + TRACE("(%s, %#x, %p, %p, %s)\n", + wine_dbgstr_w(dst_filename), file_format, src_surface, src_palette, wine_dbgstr_rect(src_rect)); + + if (!dst_filename || !src_surface) return D3DERR_INVALIDCALL; + + if (src_palette) + { + FIXME("Saving surfaces with palettized pixel formats not implemented yet\n"); + return D3DERR_INVALIDCALL; + } + + switch (file_format) + { + case D3DXIFF_BMP: + encoder_clsid = &CLSID_WICBmpEncoder; + break; + case D3DXIFF_PNG: + encoder_clsid = &CLSID_WICPngEncoder; + break; + case D3DXIFF_JPG: + encoder_clsid = &CLSID_WICJpegEncoder; + break; + case D3DXIFF_DDS: + case D3DXIFF_DIB: + case D3DXIFF_HDR: + case D3DXIFF_PFM: + case D3DXIFF_TGA: + case D3DXIFF_PPM: + FIXME("File format %#x is not supported yet\n", file_format); + return E_NOTIMPL; + default: + return D3DERR_INVALIDCALL; + } + + IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); + if (src_rect) + { + if (src_rect->left == src_rect->right || src_rect->top == src_rect->bottom) + return D3D_OK; + if (src_rect->left < 0 || src_rect->top < 0) + return D3DERR_INVALIDCALL; + if (src_rect->left > src_rect->right || src_rect->top > src_rect->bottom) + return D3DERR_INVALIDCALL; + if (src_rect->right > src_surface_desc.Width || src_rect->bottom > src_surface_desc.Height) + return D3DERR_INVALIDCALL; + + width = src_rect->right - src_rect->left; + height = src_rect->bottom - src_rect->top; + } + else + { + width = src_surface_desc.Width; + height = src_surface_desc.Height; + } + + initresult = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void **)&factory); + if (FAILED(hr)) goto cleanup_err; + + hr = IWICImagingFactory_CreateStream(factory, &stream); + IWICImagingFactory_Release(factory); + if (FAILED(hr)) goto cleanup_err; + + hr = IWICStream_InitializeFromFilename(stream, dst_filename, GENERIC_WRITE); + if (FAILED(hr)) goto cleanup_err; + + hr = CoCreateInstance(encoder_clsid, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICBitmapEncoder, (void **)&encoder); + if (FAILED(hr)) goto cleanup_err; + + hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache); + IStream_Release((IStream *)stream); + stream = NULL; + if (FAILED(hr)) goto cleanup_err; + + hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame, &encoder_options); + if (FAILED(hr)) goto cleanup_err; + + hr = IWICBitmapFrameEncode_Initialize(frame, encoder_options); + if (FAILED(hr)) goto cleanup_err; + + hr = IWICBitmapFrameEncode_SetSize(frame, width, height); + if (FAILED(hr)) goto cleanup_err; + + pixel_format_guid = d3dformat_to_wic_guid(src_surface_desc.Format); + if (!pixel_format_guid) + { + FIXME("Pixel format %#x is not supported yet\n", src_surface_desc.Format); + hr = E_NOTIMPL; + goto cleanup; + } + + memcpy(&wic_pixel_format, pixel_format_guid, sizeof(GUID)); + hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &wic_pixel_format); + d3d_pixel_format = wic_guid_to_d3dformat(&wic_pixel_format); + if (SUCCEEDED(hr) && d3d_pixel_format != D3DFMT_UNKNOWN) + { + TRACE("Using pixel format %s %#x\n", debugstr_guid(&wic_pixel_format), d3d_pixel_format); + + if (src_surface_desc.Format == d3d_pixel_format) /* Simple copy */ + { + hr = IDirect3DSurface9_LockRect(src_surface, &locked_rect, src_rect, D3DLOCK_READONLY); + if (SUCCEEDED(hr)) + { + IWICBitmapFrameEncode_WritePixels(frame, height, + locked_rect.Pitch, height * locked_rect.Pitch, locked_rect.pBits); + IDirect3DSurface9_UnlockRect(src_surface); + hr = IWICBitmapFrameEncode_Commit(frame); + } + } + else FIXME("Unsupported pixel format conversion %#x -> %#x\n", src_surface_desc.Format, d3d_pixel_format); + } + else WARN("Unsupported pixel format %#x\n", src_surface_desc.Format); + + if (SUCCEEDED(hr)) hr = IWICBitmapEncoder_Commit(encoder); + +cleanup_err: + if (FAILED(hr)) hr = D3DERR_INVALIDCALL; + +cleanup: + if (stream) IStream_Release((IStream *)stream); + + if (frame) IWICBitmapFrameEncode_Release(frame); + if (encoder_options) IPropertyBag2_Release(encoder_options); + + if (encoder) IWICBitmapEncoder_Release(encoder); + + if (SUCCEEDED(initresult)) CoUninitialize(); + + return hr; }
1
0
0
0
Józef Kucia : d3dx9: Forward D3DXSaveSurfaceToFileA to D3DXSaveSurfaceToFileW.
by Alexandre Julliard
07 May '12
07 May '12
Module: wine Branch: master Commit: ea5f799a6b18004426c33386367d466dac11e13b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ea5f799a6b18004426c333863…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Fri May 4 13:01:20 2012 +0200 d3dx9: Forward D3DXSaveSurfaceToFileA to D3DXSaveSurfaceToFileW. --- dlls/d3dx9_36/surface.c | 24 ++++++++++++++++++++---- 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 44d4e06..ab316cf 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1364,11 +1364,27 @@ HRESULT WINAPI D3DXLoadSurfaceFromSurface(LPDIRECT3DSURFACE9 pDestSurface, } -HRESULT WINAPI D3DXSaveSurfaceToFileA(LPCSTR pDestFile, D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DSURFACE9 pSrcSurface, const PALETTEENTRY* pSrcPalette, const RECT* pSrcRect) +HRESULT WINAPI D3DXSaveSurfaceToFileA(const char *dst_filename, D3DXIMAGE_FILEFORMAT file_format, + IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect) { - FIXME("(%p, %d, %p, %p, %p): stub\n", pDestFile, DestFormat, pSrcSurface, pSrcPalette, pSrcRect); - return D3DERR_INVALIDCALL; + int len; + WCHAR *filename; + HRESULT hr; + + TRACE("(%s, %#x, %p, %p, %s): relay\n", + wine_dbgstr_a(dst_filename), file_format, src_surface, src_palette, wine_dbgstr_rect(src_rect)); + + if (!dst_filename) return D3DERR_INVALIDCALL; + + len = MultiByteToWideChar(CP_ACP, 0, dst_filename, -1, NULL, 0); + filename = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (!filename) return E_OUTOFMEMORY; + MultiByteToWideChar(CP_ACP, 0, dst_filename, -1, filename, len); + + hr = D3DXSaveSurfaceToFileW(filename, file_format, src_surface, src_palette, src_rect); + + HeapFree(GetProcessHeap(), 0, filename); + return hr; } HRESULT WINAPI D3DXSaveSurfaceToFileW(LPCWSTR pDestFile, D3DXIMAGE_FILEFORMAT DestFormat,
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
74
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
Results per page:
10
25
50
100
200