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
October 2020
----- 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
1 participants
796 discussions
Start a n
N
ew thread
Nikolay Sivov : mf/sar: Use advertised type in IsMediaTypeSupported().
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: f6a5a3d03c1eb914444af96352ca54eec79d7e2c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f6a5a3d03c1eb914444af963…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Oct 21 13:07:23 2020 +0300 mf/sar: Use advertised type in IsMediaTypeSupported(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mf/sar.c | 5 ++--- dlls/mf/tests/mf.c | 62 ++++++++++++++++++++---------------------------------- 2 files changed, 25 insertions(+), 42 deletions(-) diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c index 6f1f1bd834e..e318576e80e 100644 --- a/dlls/mf/sar.c +++ b/dlls/mf/sar.c @@ -1479,11 +1479,10 @@ static HRESULT WINAPI audio_renderer_stream_type_handler_IsMediaTypeSupported(IM TRACE("%p, %p, %p.\n", iface, in_type, out_type); EnterCriticalSection(&renderer->cs); - hr = renderer->current_media_type && IMFMediaType_IsEqual(renderer->current_media_type, in_type, &flags) == S_OK ? - S_OK : MF_E_INVALIDMEDIATYPE; + hr = IMFMediaType_IsEqual(renderer->media_type, in_type, &flags); LeaveCriticalSection(&renderer->cs); - return hr; + return hr != S_OK ? MF_E_INVALIDMEDIATYPE : hr; } static HRESULT WINAPI audio_renderer_stream_type_handler_GetMediaTypeCount(IMFMediaTypeHandler *iface, DWORD *count) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 7dc325424a6..6699c1ca9d1 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2831,7 +2831,7 @@ static void test_sar(void) IMFMediaSink *sink, *sink2; IMFStreamSink *stream_sink; IMFAttributes *attributes; - DWORD id, flags, count; + DWORD i, id, flags, count; IMFActivate *activate; MFCLOCK_STATE state; IMFClock *clock; @@ -2839,6 +2839,7 @@ static void test_sar(void) HRESULT hr; GUID guid; BOOL mute; + int found; hr = CoInitialize(NULL); ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr); @@ -2988,6 +2989,22 @@ todo_wine ok(hr == S_OK, "Failed to get type count, hr %#x.\n", hr); ok(!!count, "Unexpected type count %u.\n", count); + /* A number of same major/subtype entries are returned, with different degrees of finer format + details. Some incomplete types are not accepted, check that at least one of them is considered supported. */ + + for (i = 0, found = -1; i < count; ++i) + { + hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, i, &mediatype); + ok(hr == S_OK, "Failed to get media type, hr %#x.\n", hr); + + if (SUCCEEDED(IMFMediaTypeHandler_IsMediaTypeSupported(handler, mediatype, NULL))) + found = i; + IMFMediaType_Release(mediatype); + + if (found != -1) break; + } + ok(found != -1, "Haven't found a supported type.\n"); + hr = IMFMediaTypeHandler_GetCurrentMediaType(handler, &mediatype); ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr); @@ -3005,16 +3022,16 @@ todo_wine hr = IMFMediaTypeHandler_SetCurrentMediaType(handler, mediatype); ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr); - hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, 0, &mediatype2); + hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, found, &mediatype2); ok(hr == S_OK, "Failed to get media type, hr %#x.\n", hr); - hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, 0, &mediatype3); + hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, found, &mediatype3); ok(hr == S_OK, "Failed to get media type, hr %#x.\n", hr); ok(mediatype2 == mediatype3, "Unexpected instance.\n"); IMFMediaType_Release(mediatype3); hr = IMFMediaTypeHandler_IsMediaTypeSupported(handler, mediatype2, NULL); - ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); IMFMediaType_Release(mediatype); @@ -3026,39 +3043,8 @@ todo_wine ok(mediatype == mediatype2, "Unexpected instance.\n"); IMFMediaType_Release(mediatype); - /* Type is validated against current type. */ - hr = IMFMediaTypeHandler_IsMediaTypeSupported(handler, mediatype2, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IMFMediaType_Release(mediatype2); - /* Set partial type. */ - hr = MFCreateMediaType(&mediatype); - ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr); - - hr = IMFMediaType_GetGUID(mediatype2, &MF_MT_SUBTYPE, &guid); - ok(hr == S_OK, "Failed to get attribute, hr %#x.\n", hr); - - hr = IMFMediaType_SetGUID(mediatype, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); - ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); - - hr = IMFMediaType_SetGUID(mediatype, &MF_MT_SUBTYPE, &guid); - ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); - - hr = IMFMediaTypeHandler_SetCurrentMediaType(handler, mediatype); - ok(hr == S_OK, "Failed to set current type, hr %#x.\n", hr); - - hr = IMFMediaTypeHandler_GetCurrentMediaType(handler, &mediatype2); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(mediatype == mediatype2, "Unexpected instance.\n"); - IMFMediaType_Release(mediatype2); - - hr = IMFMediaType_GetCount(mediatype, &count); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(count == 2, "Unexpected attribute count %u.\n", count); - - IMFMediaType_Release(mediatype); - /* Reset back to uninitialized state. */ hr = IMFMediaTypeHandler_SetCurrentMediaType(handler, NULL); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); @@ -3121,10 +3107,8 @@ todo_wine IMFAudioStreamVolume_Release(stream_volume); hr = MFGetService((IUnknown *)sink, &MR_AUDIO_POLICY_SERVICE, &IID_IMFAudioPolicy, (void **)&unk); -todo_wine - ok(hr == MF_E_NOT_INITIALIZED, "Failed to get interface, hr %#x.\n", hr); - if (SUCCEEDED(hr)) - IUnknown_Release(unk); + ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); + IUnknown_Release(unk); /* Shutdown */ EXPECT_REF(present_clock, 2);
1
0
0
0
Alistair Leslie-Hughes : msado15: Implement _Connection Open.
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: 57e30f27cb3f4d3d494660b09746b67b152efcc7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57e30f27cb3f4d3d494660b0…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Oct 21 11:47:14 2020 +0200 msado15: Implement _Connection Open. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/Makefile.in | 2 +- dlls/msado15/connection.c | 55 ++++++++++++++++++++++++++++++++++++++++---- dlls/msado15/tests/msado15.c | 4 ++-- 3 files changed, 54 insertions(+), 7 deletions(-) diff --git a/dlls/msado15/Makefile.in b/dlls/msado15/Makefile.in index 9852e0863dd..e64da605473 100644 --- a/dlls/msado15/Makefile.in +++ b/dlls/msado15/Makefile.in @@ -1,5 +1,5 @@ MODULE = msado15.dll -IMPORTS = oleaut32 +IMPORTS = oleaut32 ole32 EXTRADLLFLAGS = -mno-cygwin diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c index 3f1a87aa5b3..fd15d5a443f 100644 --- a/dlls/msado15/connection.c +++ b/dlls/msado15/connection.c @@ -23,6 +23,7 @@ #include "initguid.h" #include "ocidl.h" #include "objbase.h" +#include "msdasc.h" #include "olectl.h" #include "msado15_backcompat.h" @@ -56,6 +57,7 @@ struct connection WCHAR *provider; ConnectModeEnum mode; CursorLocationEnum location; + IUnknown *session; struct connection_point cp_connev; }; @@ -98,6 +100,7 @@ static ULONG WINAPI connection_Release( _Connection *iface ) if (connection->cp_connev.sinks[i]) IUnknown_Release( connection->cp_connev.sinks[i] ); } + if (connection->session) IUnknown_Release( connection->session ); heap_free( connection->cp_connev.sinks ); heap_free( connection->provider ); heap_free( connection->datasource ); @@ -240,6 +243,12 @@ static HRESULT WINAPI connection_Close( _Connection *iface ) if (connection->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed ); + if (connection->session) + { + IUnknown_Release( connection->session ); + connection->session = NULL; + } + connection->state = adStateClosed; return S_OK; } @@ -273,13 +282,50 @@ static HRESULT WINAPI connection_Open( _Connection *iface, BSTR connect_str, BST LONG options ) { struct connection *connection = impl_from_Connection( iface ); - FIXME( "%p, %s, %s, %p, %08x\n", iface, debugstr_w(connect_str), debugstr_w(userid), - password, options ); + IDBProperties *props; + IDBInitialize *dbinit = NULL; + IDataInitialize *datainit; + IDBCreateSession *session = NULL; + HRESULT hr; + + TRACE( "%p, %s, %s, %p, %08x\n", iface, debugstr_w(connect_str), debugstr_w(userid), password, options ); if (connection->state == adStateOpen) return MAKE_ADO_HRESULT( adErrObjectOpen ); + if (!connect_str) return E_FAIL; - connection->state = adStateOpen; - return S_OK; + if ((hr = CoCreateInstance( &CLSID_MSDAINITIALIZE, NULL, CLSCTX_INPROC_SERVER, &IID_IDataInitialize, + (void **)&datainit )) != S_OK) return hr; + if ((hr = IDataInitialize_GetDataSource( datainit, NULL, CLSCTX_INPROC_SERVER, connect_str, &IID_IDBInitialize, + (IUnknown **)&dbinit )) != S_OK) goto done; + if ((hr = IDBInitialize_QueryInterface( dbinit, &IID_IDBProperties, (void **)&props )) != S_OK) goto done; + + /* TODO - Update username/password if required. */ + if ((userid && *userid) || (password && *password)) + FIXME("Username/password parameters currently not supported\n"); + + if ((hr = IDBInitialize_Initialize( dbinit )) != S_OK) goto done; + if ((hr = IDBInitialize_QueryInterface( dbinit, &IID_IDBCreateSession, (void **)&session )) != S_OK) goto done; + if ((hr = IDBCreateSession_CreateSession( session, NULL, &IID_IUnknown, &connection->session )) == S_OK) + { + connection->state = adStateOpen; + } + IDBCreateSession_Release( session ); + +done: + if (hr != S_OK && connection->session) + { + IUnknown_Release( connection->session ); + connection->session = NULL; + } + if (dbinit) + { + IDBInitialize_Uninitialize( dbinit ); + IDBInitialize_Release( dbinit ); + } + IDataInitialize_Release( datainit ); + + TRACE("ret 0x%08x\n", hr); + return hr; } static HRESULT WINAPI connection_get_Errors( _Connection *iface, Errors **obj ) @@ -688,6 +734,7 @@ HRESULT Connection_create( void **obj ) } connection->mode = adModeUnknown; connection->location = adUseServer; + connection->session = NULL; connection->cp_connev.conn = connection; connection->cp_connev.riid = &DIID_ConnectionEvents; diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index 378c2eb918c..adf9fb30bc2 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -808,12 +808,12 @@ if (0) /* Crashes on windows */ ok(!wcscmp(str, str2), "wrong string %s\n", wine_dbgstr_w(str2)); hr = _Connection_Open(connection, NULL, NULL, NULL, 0); - todo_wine ok(hr == E_FAIL, "Failed, hr 0x%08x\n", hr); + ok(hr == E_FAIL, "Failed, hr 0x%08x\n", hr); /* Open adds trailing ; if it's missing */ str3 = SysAllocString(L"Provider=MSDASQL.1;Persist Security Info=False;Data Source=wine_test;"); hr = _Connection_Open(connection, NULL, NULL, NULL, adConnectUnspecified); - todo_wine ok(hr == E_FAIL, "Failed, hr 0x%08x\n", hr); + ok(hr == E_FAIL, "Failed, hr 0x%08x\n", hr); str2 = NULL; hr = _Connection_get_ConnectionString(connection, &str2);
1
0
0
0
Hans Leidekker : msado15: Avoid a crash with tracing on.
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: 45295c5e07f13c7ff98e73e5e0134b19d8f8aa17 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=45295c5e07f13c7ff98e73e5…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Oct 21 11:47:13 2020 +0200 msado15: Avoid a crash with tracing on. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c index e3222e63b6a..3f1a87aa5b3 100644 --- a/dlls/msado15/connection.c +++ b/dlls/msado15/connection.c @@ -190,7 +190,7 @@ static HRESULT WINAPI connection_put_ConnectionString( _Connection *iface, BSTR struct connection *connection = impl_from_Connection( iface ); WCHAR *source = NULL; - TRACE( "%p, %s\n", connection, debugstr_w( !wcsstr( str, L"Password" ) ? L"<hidden>" : str ) ); + TRACE( "%p, %s\n", connection, debugstr_w( str && !wcsstr( str, L"Password" ) ? L"<hidden>" : str ) ); if (str && !(source = strdupW( str ))) return E_OUTOFMEMORY; heap_free( connection->datasource );
1
0
0
0
Hans Leidekker : msado15: Use correct string type for default provider.
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: 9415d45a808eb0d35380b22430b892cb9291c0f8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9415d45a808eb0d35380b224…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Oct 21 11:47:12 2020 +0200 msado15: Use correct string type for default provider. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/connection.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c index 2773850236d..e3222e63b6a 100644 --- a/dlls/msado15/connection.c +++ b/dlls/msado15/connection.c @@ -681,7 +681,11 @@ HRESULT Connection_create( void **obj ) connection->state = adStateClosed; connection->timeout = 30; connection->datasource = NULL; - connection->provider = SysAllocString(L"MSDASQL"); + if (!(connection->provider = strdupW( L"MSDASQL" ))) + { + heap_free( connection ); + return E_OUTOFMEMORY; + } connection->mode = adModeUnknown; connection->location = adUseServer;
1
0
0
0
Zhiyi Zhang : dxgi/tests: Fix a window leak in test_inexact_modes().
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: 541437e2ce8affc5626e9ec4f95d06ee4a56720f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=541437e2ce8affc5626e9ec4…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Oct 21 15:10:52 2020 +0800 dxgi/tests: Fix a window leak in test_inexact_modes(). Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dxgi/tests/dxgi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index bf798508a6d..43c4247dc2a 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -3630,6 +3630,7 @@ done: ok(!refcount, "Device has %u references left.\n", refcount); refcount = IDXGIFactory_Release(factory); ok(!refcount, "Factory has %u references left.\n", refcount); + DestroyWindow(swapchain_desc.OutputWindow); } static void test_create_factory(void)
1
0
0
0
Zhiyi Zhang : ddraw/tests: Fix possible memory leaks.
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: 8915500868a4be4838af5a2c84bdf2fc67406b1e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8915500868a4be4838af5a2c…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Oct 20 15:42:24 2020 +0800 ddraw/tests: Fix possible memory leaks. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/d3d.c | 21 ++++++++++++++++++++- dlls/ddraw/tests/dsurface.c | 9 +++++++++ dlls/ddraw/tests/refcount.c | 3 +++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 93ff6e296cc..d8f3618200b 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -109,7 +109,11 @@ static BOOL CreateDirect3D(void) ok(rc==DD_OK, "SetCooperativeLevel returned: %x\n", rc); rc = IDirectDraw7_QueryInterface(lpDD, &IID_IDirect3D7, (void**) &lpD3D); - if (rc == E_NOINTERFACE) return FALSE; + if (rc == E_NOINTERFACE) + { + IDirectDraw7_Release(lpDD); + return FALSE; + } ok(rc==DD_OK, "QueryInterface returned: %x\n", rc); memset(&ddsd, 0, sizeof(ddsd)); @@ -120,7 +124,11 @@ static BOOL CreateDirect3D(void) ddsd.dwHeight = 256; rc = IDirectDraw7_CreateSurface(lpDD, &ddsd, &lpDDS, NULL); if (FAILED(rc)) + { + IDirect3D7_Release(lpD3D); + IDirectDraw7_Release(lpDD); return FALSE; + } num = 0; IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST, NULL, &num, SurfaceCounter); @@ -144,7 +152,13 @@ static BOOL CreateDirect3D(void) rc = IDirectDrawSurface_AddAttachedSurface(lpDDS, lpDDSdepth); ok(rc == DD_OK, "IDirectDrawSurface_AddAttachedSurface returned %x\n", rc); if (FAILED(rc)) + { + IDirectDrawSurface7_Release(lpDDSdepth); + IDirectDrawSurface7_Release(lpDDS); + IDirect3D7_Release(lpD3D); + IDirectDraw7_Release(lpDD); return FALSE; + } } rc = IDirect3D7_CreateDevice(lpD3D, &IID_IDirect3DTnLHalDevice, lpDDS, @@ -160,6 +174,11 @@ static BOOL CreateDirect3D(void) &lpD3DDevice); if (!lpD3DDevice) { trace("IDirect3D7::CreateDevice() for a RGB device failed with an error %x, giving up\n", rc); + if (lpDDSdepth) + IDirectDrawSurface7_Release(lpDDSdepth); + IDirectDrawSurface7_Release(lpDDS); + IDirect3D7_Release(lpD3D); + IDirectDraw7_Release(lpDD); return FALSE; } } diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index af18fc217b1..478fb5d4a27 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -165,6 +165,9 @@ static void GetDDInterface_2(void) if(ret != DD_OK) { ok(FALSE, "IDirectDraw::CreateSurface failed with error %x\n", ret); + IDirectDraw2_Release(dd2); + IDirectDraw4_Release(dd4); + IDirectDraw7_Release(dd7); return; } ret = IDirectDrawSurface_QueryInterface(dsurface, &IID_IDirectDrawSurface2, (void **) &dsurface2); @@ -226,6 +229,9 @@ static void GetDDInterface_4(void) if(ret != DD_OK) { ok(FALSE, "IDirectDraw::CreateSurface failed with error %x\n", ret); + IDirectDraw2_Release(dd2); + IDirectDraw4_Release(dd4); + IDirectDraw7_Release(dd7); return; } ret = IDirectDrawSurface4_QueryInterface(dsurface4, &IID_IDirectDrawSurface2, (void **) &dsurface2); @@ -297,6 +303,9 @@ static void GetDDInterface_7(void) if(ret != DD_OK) { ok(FALSE, "IDirectDraw::CreateSurface failed with error %x\n", ret); + IDirectDraw2_Release(dd2); + IDirectDraw4_Release(dd4); + IDirectDraw7_Release(dd7); return; } ret = IDirectDrawSurface7_QueryInterface(dsurface7, &IID_IDirectDrawSurface4, (void **) &dsurface4); diff --git a/dlls/ddraw/tests/refcount.c b/dlls/ddraw/tests/refcount.c index 447e6a99c67..07673ab66e9 100644 --- a/dlls/ddraw/tests/refcount.c +++ b/dlls/ddraw/tests/refcount.c @@ -97,6 +97,9 @@ static void test_ddraw_objects(void) if (!surface) { win_skip("Could not create surface : %08x\n", hr); + IDirectDraw_Release(DDraw1); + IDirectDraw2_Release(DDraw2); + IDirectDraw4_Release(DDraw4); IDirectDraw7_Release(DDraw7); return; }
1
0
0
0
Zhiyi Zhang : ddraw/tests: Use the correct version of DirectDraw calls.
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: e89c85118b543b597f06cd62ed52aa843a73f8d3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e89c85118b543b597f06cd62…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Oct 20 15:42:07 2020 +0800 ddraw/tests: Use the correct version of DirectDraw calls. These are typos cumulated over the years. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/d3d.c | 4 ++-- dlls/ddraw/tests/ddraw1.c | 8 ++++---- dlls/ddraw/tests/ddraw2.c | 14 ++++++------- dlls/ddraw/tests/ddraw4.c | 12 +++++------ dlls/ddraw/tests/ddraw7.c | 8 ++++---- dlls/ddraw/tests/dsurface.c | 50 ++++++++++++++++++++++----------------------- dlls/ddraw/tests/refcount.c | 6 +++--- dlls/ddraw/tests/visual.c | 6 +++--- 8 files changed, 54 insertions(+), 54 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e89c85118b543b597f06…
1
0
0
0
Huw Davies : riched20: Return a paragraph ptr from the table insert helper.
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: 103cd9f2f2237d624090b41d1b2476a5cb5a879d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=103cd9f2f2237d624090b41d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Oct 21 10:05:56 2020 +0100 riched20: Return a paragraph ptr from the table insert helper. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/table.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c index a26715a5d80..14fdf6eb73a 100644 --- a/dlls/riched20/table.c +++ b/dlls/riched20/table.c @@ -58,29 +58,27 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit_lists); static const WCHAR cr_lf[] = {'\r', '\n', 0}; -static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor, - int nCursor, - const WCHAR *eol_str, int eol_len, - int paraFlags) +static ME_Paragraph* table_insert_end_para( ME_TextEditor *editor, ME_Cursor *cursor, + const WCHAR *eol_str, int eol_len, int para_flags ) { - ME_Style *pStyle = style_get_insert_style( editor, editor->pCursors + nCursor ); - ME_Paragraph *para; - ME_Cursor* cursor = &editor->pCursors[nCursor]; + ME_Style *style = style_get_insert_style( editor, cursor ); + ME_Paragraph *para; - if (cursor->nOffset) run_split( editor, cursor ); + if (cursor->nOffset) run_split( editor, cursor ); - para = para_split( editor, &cursor->pRun->member.run, pStyle, eol_str, eol_len, paraFlags ); - ME_ReleaseStyle(pStyle); - cursor->pPara = para_get_di( para ); - cursor->pRun = run_get_di( para_first_run( para ) ); - return para_get_di( para ); + para = para_split( editor, &cursor->pRun->member.run, style, eol_str, eol_len, para_flags ); + ME_ReleaseStyle( style ); + cursor->pPara = para_get_di( para ); + cursor->pRun = run_get_di( para_first_run( para ) ); + return para; } ME_DisplayItem* ME_InsertTableRowStartFromCursor(ME_TextEditor *editor) { - ME_DisplayItem *para; - para = ME_InsertEndParaFromCursor(editor, 0, cr_lf, 2, MEPF_ROWSTART); - return para->member.para.prev_para; + ME_Paragraph *para; + + para = table_insert_end_para( editor, editor->pCursors, cr_lf, 2, MEPF_ROWSTART ); + return para_get_di( para_prev( para ) ); } ME_DisplayItem* ME_InsertTableRowStartAtParagraph(ME_TextEditor *editor, @@ -120,17 +118,19 @@ ME_DisplayItem* ME_InsertTableRowStartAtParagraph(ME_TextEditor *editor, * Returns the first paragraph of the new cell. */ ME_DisplayItem* ME_InsertTableCellFromCursor(ME_TextEditor *editor) { - ME_DisplayItem *para; - WCHAR tab = '\t'; - para = ME_InsertEndParaFromCursor(editor, 0, &tab, 1, MEPF_CELL); - return para; + ME_Paragraph *para; + WCHAR tab = '\t'; + + para = table_insert_end_para( editor, editor->pCursors, &tab, 1, MEPF_CELL ); + return para_get_di( para ); } ME_DisplayItem* ME_InsertTableRowEndFromCursor(ME_TextEditor *editor) { - ME_DisplayItem *para; - para = ME_InsertEndParaFromCursor(editor, 0, cr_lf, 2, MEPF_ROWEND); - return para->member.para.prev_para; + ME_Paragraph *para; + + para = table_insert_end_para( editor, editor->pCursors, cr_lf, 2, MEPF_ROWEND ); + return para_get_di( para_prev( para ) ); } ME_Paragraph* table_row_end( ME_Paragraph *para )
1
0
0
0
Huw Davies : riched20: Pass and return paragraph ptrs in the table append row function.
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: f0783863f90543580a47766e7235b1ddc8e272fb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f0783863f90543580a47766e…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Oct 21 10:05:55 2020 +0100 riched20: Pass and return paragraph ptrs in the table append row function. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.c | 6 +-- dlls/riched20/editor.h | 4 +- dlls/riched20/table.c | 126 +++++++++++++++++++++++++------------------------ 3 files changed, 70 insertions(+), 66 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f0783863f90543580a47…
1
0
0
0
Huw Davies : riched20: Pass a cursor ptr to the insert style retrieval function.
by Alexandre Julliard
21 Oct '20
21 Oct '20
Module: wine Branch: master Commit: 75433bc39be8d71dbd8ed45e9578a40f965ef6c0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=75433bc39be8d71dbd8ed45e…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Oct 21 10:05:54 2020 +0100 riched20: Pass a cursor ptr to the insert style retrieval function. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/caret.c | 6 +++--- dlls/riched20/editor.c | 6 +++--- dlls/riched20/editor.h | 2 +- dlls/riched20/richole.c | 2 +- dlls/riched20/run.c | 2 +- dlls/riched20/style.c | 44 ++++++++++++++------------------------------ dlls/riched20/table.c | 2 +- 7 files changed, 24 insertions(+), 40 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 97cee3d9b3a..5d49d11bd3b 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -473,11 +473,11 @@ static struct re_object* create_re_object(const REOBJECT *reo) void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCursor) { - ME_Style *style = ME_GetInsertStyle( editor, nCursor ); ME_Run *run, *prev; const WCHAR space = ' '; struct re_object *reobj_prev = NULL; ME_Cursor *cursor = editor->pCursors + nCursor; + ME_Style *style = style_get_insert_style( editor, cursor ); /* FIXME no no no */ if (ME_IsSelection(editor)) @@ -508,9 +508,9 @@ void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCur void ME_InsertEndRowFromCursor(ME_TextEditor *editor, int nCursor) { - ME_Style *style = ME_GetInsertStyle( editor, nCursor ); const WCHAR space = ' '; ME_Cursor *cursor = editor->pCursors + nCursor; + ME_Style *style = style_get_insert_style( editor, cursor ); /* FIXME no no no */ if (ME_IsSelection(editor)) @@ -1510,7 +1510,7 @@ void ME_DeleteSelection(ME_TextEditor *editor) ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor) { - return ME_GetInsertStyle(editor, 0); + return style_get_insert_style( editor, editor->pCursors ); } void ME_SendSelChange(ME_TextEditor *editor) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index c91d47302cf..dfb066d5976 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2596,7 +2596,7 @@ static BOOL handle_enter(ME_TextEditor *editor) } } - style = ME_GetInsertStyle(editor, 0); + style = style_get_insert_style( editor, editor->pCursors ); /* Normally the new eop style is the insert style, however in a list it is copied from the existing eop style (this prevents the list label style changing when the new eop is inserted). @@ -2838,7 +2838,7 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode, /* WM_CHAR is restricted to nTextLimit */ if(editor->nTextLimit > ME_GetTextLength(editor) - (to-from)) { - ME_Style *style = ME_GetInsertStyle(editor, 0); + ME_Style *style = style_get_insert_style( editor, editor->pCursors ); ME_ContinueCoalescingTransaction(editor); ME_InsertTextFromCursor(editor, 0, &wstr, 1, style); ME_ReleaseStyle(style); @@ -4818,7 +4818,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, { HIMC hIMC; - ME_Style *style = ME_GetInsertStyle(editor, 0); + ME_Style *style = style_get_insert_style( editor, editor->pCursors ); hIMC = ITextHost_TxImmGetContext(editor->texthost); ME_DeleteSelection(editor); ME_SaveTempStyle(editor, style); diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 1f74a2eb8b4..a43a6c2c1ed 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -47,11 +47,11 @@ static inline const char *debugstr_run( const ME_Run *run ) } /* style.c */ +ME_Style *style_get_insert_style( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN; ME_Style *ME_MakeStyle(CHARFORMAT2W *style) DECLSPEC_HIDDEN; void ME_AddRefStyle(ME_Style *item) DECLSPEC_HIDDEN; void ME_DestroyStyle(ME_Style *item) DECLSPEC_HIDDEN; void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN; -ME_Style *ME_GetInsertStyle(ME_TextEditor *editor, int nCursor) DECLSPEC_HIDDEN; ME_Style *ME_ApplyStyle(ME_TextEditor *ed, ME_Style *sSrc, CHARFORMAT2W *style) DECLSPEC_HIDDEN; void select_style(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN; void ME_InitCharFormat2W(CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN; diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 21e92e95cd1..2f2e5e09d1f 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -1697,7 +1697,7 @@ static HRESULT WINAPI ITextRange_fnSetText(ITextRange *me, BSTR str) len = lstrlenW(str); cursor = editor->pCursors[0]; cursor_from_char_ofs( editor, This->start, &editor->pCursors[0] ); - style = ME_GetInsertStyle(editor, 0); + style = style_get_insert_style( editor, editor->pCursors ); ME_InsertTextFromCursor(editor, 0, str, len, style); ME_ReleaseStyle(style); editor->pCursors[0] = cursor; diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index 22a5db8610b..b1436ad5060 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -716,7 +716,7 @@ void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) { ME_Style *s; if (!editor->pBuffer->pCharStyle) - editor->pBuffer->pCharStyle = ME_GetInsertStyle(editor, 0); + editor->pBuffer->pCharStyle = style_get_insert_style( editor, editor->pCursors ); s = ME_ApplyStyle(editor, editor->pBuffer->pCharStyle, pFmt); ME_ReleaseStyle(editor->pBuffer->pCharStyle); editor->pBuffer->pCharStyle = s; diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c index 8b9c2126b1b..fbbe29dce14 100644 --- a/dlls/riched20/style.c +++ b/dlls/riched20/style.c @@ -473,42 +473,26 @@ void ME_ReleaseStyle(ME_Style *s) ME_DestroyStyle(s); } -ME_Style *ME_GetInsertStyle(ME_TextEditor *editor, int nCursor) +ME_Style *style_get_insert_style( ME_TextEditor *editor, ME_Cursor *cursor ) { - if (ME_IsSelection(editor)) - { + ME_Style *style; ME_Cursor *from, *to; + ME_Run *prev; - ME_GetSelection(editor, &from, &to); - ME_AddRefStyle(from->pRun->member.run.style); - return from->pRun->member.run.style; - } - if (editor->pBuffer->pCharStyle) { - ME_AddRefStyle(editor->pBuffer->pCharStyle); - return editor->pBuffer->pCharStyle; - } - else - { - ME_Cursor *pCursor = &editor->pCursors[nCursor]; - ME_DisplayItem *pRunItem = pCursor->pRun; - ME_DisplayItem *pPrevItem = NULL; - if (pCursor->nOffset) { - ME_Run *pRun = &pRunItem->member.run; - ME_AddRefStyle(pRun->style); - return pRun->style; - } - pPrevItem = ME_FindItemBack(pRunItem, diRunOrParagraph); - if (pPrevItem->type == diRun) + if (ME_IsSelection( editor )) { - ME_AddRefStyle(pPrevItem->member.run.style); - return pPrevItem->member.run.style; + ME_GetSelection( editor, &from, &to ); + style = from->pRun->member.run.style; } + else if (editor->pBuffer->pCharStyle) + style = editor->pBuffer->pCharStyle; + else if (!cursor->nOffset && (prev = run_prev( &cursor->pRun->member.run ))) + style = prev->style; else - { - ME_AddRefStyle(pRunItem->member.run.style); - return pRunItem->member.run.style; - } - } + style = cursor->pRun->member.run.style; + + ME_AddRefStyle( style ); + return style; } void ME_SaveTempStyle(ME_TextEditor *editor, ME_Style *style) diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c index 876244c9706..08c8fcb7ebf 100644 --- a/dlls/riched20/table.c +++ b/dlls/riched20/table.c @@ -63,7 +63,7 @@ static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor, const WCHAR *eol_str, int eol_len, int paraFlags) { - ME_Style *pStyle = ME_GetInsertStyle(editor, nCursor); + ME_Style *pStyle = style_get_insert_style( editor, editor->pCursors + nCursor ); ME_Paragraph *para; ME_Cursor* cursor = &editor->pCursors[nCursor];
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
80
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
Results per page:
10
25
50
100
200