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
February 2019
----- 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
672 discussions
Start a n
N
ew thread
Paul Gofman : ntdll: Pass async parameter to add_fd_completion server call.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: ba42efdb14ad97c029db4c23c67515706c8a0592 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ba42efdb14ad97c029db4c23…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu Feb 21 15:10:14 2019 +0100 ntdll: Pass async parameter to add_fd_completion server call. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/file.c | 4 ++-- dlls/ntdll/file.c | 17 +++++++++-------- dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/sync.c | 3 ++- dlls/ntdll/tests/file.c | 2 +- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index dd84557..33b17aa 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -4577,8 +4577,8 @@ static void test_WriteFileGather(void) ok(GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed, error %u.\n", GetLastError()); br = GetQueuedCompletionStatus(hiocp2, &size, &key, &povl, 1000); - todo_wine ok(br, "GetQueuedCompletionStatus failed, err %u.\n", GetLastError()); - todo_wine ok(povl == &ovl, "Wrong ovl %p.\n", povl); + ok(br, "GetQueuedCompletionStatus failed, err %u.\n", GetLastError()); + ok(povl == &ovl, "Wrong ovl %p.\n", povl); br = GetOverlappedResult(hfile, &ovl, &tx, TRUE); ok(br, "GetOverlappedResult failed, err %u.\n", GetLastError()); diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 1cf3ae2..ffedbeb 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -831,7 +831,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent, int result, unix_handle, needs_close; unsigned int options; struct io_timeouts timeouts; - NTSTATUS status; + NTSTATUS status, ret_status; ULONG total = 0; enum server_fd_type type; ULONG_PTR cvalue = apc ? 0 : (ULONG_PTR)apc_user; @@ -1013,10 +1013,11 @@ err: if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL ); } - if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total ); - if (async_read && (options & FILE_NO_INTERMEDIATE_BUFFERING) && status == STATUS_SUCCESS) - return STATUS_PENDING; - return status; + ret_status = async_read && (options & FILE_NO_INTERMEDIATE_BUFFERING) && status == STATUS_SUCCESS + ? STATUS_PENDING : status; + + if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total, ret_status == STATUS_PENDING ); + return ret_status; } @@ -1089,7 +1090,7 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap if (event) NtSetEvent( event, NULL ); if (apc) NtQueueApcThread( GetCurrentThread(), (PNTAPCFUNC)apc, (ULONG_PTR)apc_user, (ULONG_PTR)io_status, 0 ); - if (send_completion) NTDLL_AddCompletion( file, cvalue, status, total ); + if (send_completion) NTDLL_AddCompletion( file, cvalue, status, total, TRUE ); return STATUS_PENDING; @@ -1408,7 +1409,7 @@ err: if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL ); } - if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total ); + if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total, FALSE ); return status; } @@ -1500,7 +1501,7 @@ NTSTATUS WINAPI NtWriteFileGather( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap if (status != STATUS_PENDING && event) NtResetEvent( event, NULL ); } - if (send_completion) NTDLL_AddCompletion( file, cvalue, status, total ); + if (send_completion) NTDLL_AddCompletion( file, cvalue, status, total, FALSE ); return status; } diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 5afb17f..2692c43 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -194,7 +194,7 @@ extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN; /* completion */ extern NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue, - NTSTATUS CompletionStatus, ULONG Information ) DECLSPEC_HIDDEN; + NTSTATUS CompletionStatus, ULONG Information, BOOL async) DECLSPEC_HIDDEN; /* code pages */ extern int ntdll_umbstowcs(DWORD flags, const char* src, int srclen, WCHAR* dst, int dstlen) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index 3293c52..94819b2 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -1529,7 +1529,7 @@ NTSTATUS WINAPI NtQueryIoCompletion( HANDLE CompletionPort, IO_COMPLETION_INFORM } NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue, - NTSTATUS CompletionStatus, ULONG Information ) + NTSTATUS CompletionStatus, ULONG Information, BOOL async ) { NTSTATUS status; @@ -1539,6 +1539,7 @@ NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue, req->cvalue = CompletionValue; req->status = CompletionStatus; req->information = Information; + req->async = async; status = wine_server_call( req ); } SERVER_END_REQ; diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 1c1143f..3320cce 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -3579,7 +3579,7 @@ static void test_file_completion_information(void) ret = GetOverlappedResult(h, &ov, &num_bytes, TRUE); ok(ret, "GetOverlappedResult failed, error %u.\n", GetLastError()); ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000); - todo_wine ok(ret, "GetQueuedCompletionStatus failed, error %u.\n", GetLastError()); + ok(ret, "GetQueuedCompletionStatus failed, error %u.\n", GetLastError()); CloseHandle(ov.hEvent); CloseHandle(port);
1
0
0
0
Zebediah Figura : quartz/tests/filesource: Add some tests for IBaseFilter_FindPin().
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 85ce2157c8e34f77dc243b77ab82394677664d8d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=85ce2157c8e34f77dc243b77…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Feb 21 00:17:16 2019 -0600 quartz/tests/filesource: Add some tests for IBaseFilter_FindPin(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filesource.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c index 9781a83..6578cbe 100644 --- a/dlls/quartz/tests/filesource.c +++ b/dlls/quartz/tests/filesource.c @@ -25,6 +25,8 @@ static const WCHAR avifile[] = {'t','e','s','t','.','a','v','i',0}; +static const WCHAR source_id[] = {'O','u','t','p','u','t',0}; + static IBaseFilter *create_file_source(void) { IBaseFilter *filter = NULL; @@ -351,12 +353,52 @@ todo_wine ok(ret, "Failed to delete file, error %u.\n", GetLastError()); } +static void test_find_pin(void) +{ + const WCHAR *filename = load_resource(avifile); + IBaseFilter *filter = create_file_source(); + IEnumPins *enumpins; + IPin *pin, *pin2; + HRESULT hr; + ULONG ref; + BOOL ret; + + hr = IBaseFilter_FindPin(filter, source_id, &pin); + ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr); + + load_file(filter, filename); + + hr = IBaseFilter_FindPin(filter, source_id, &pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); +todo_wine + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pin); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + + hr = IBaseFilter_EnumPins(filter, &enumpins); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enumpins, 1, &pin2, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(pin == pin2, "Expected pin %p, got %p.\n", pin, pin2); + + IPin_Release(pin2); + IPin_Release(pin); + IEnumPins_Release(enumpins); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ret = DeleteFileW(filename); + ok(ret, "Failed to delete file, error %u.\n", GetLastError()); +} + START_TEST(filesource) { CoInitialize(NULL); test_interfaces(); test_enum_pins(); + test_find_pin(); test_file_source_filter(); CoUninitialize();
1
0
0
0
Zebediah Figura : quartz/tests/filesource: Add some tests for IBaseFilter_EnumPins().
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: b5cdfb312d9d35e4986e6e91220ac649f8c81af3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b5cdfb312d9d35e4986e6e91…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Feb 21 00:17:15 2019 -0600 quartz/tests/filesource: Add some tests for IBaseFilter_EnumPins(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filesource.c | 160 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c index b9040e2..9781a83 100644 --- a/dlls/quartz/tests/filesource.c +++ b/dlls/quartz/tests/filesource.c @@ -23,6 +23,8 @@ #include "dshow.h" #include "wine/test.h" +static const WCHAR avifile[] = {'t','e','s','t','.','a','v','i',0}; + static IBaseFilter *create_file_source(void) { IBaseFilter *filter = NULL; @@ -32,6 +34,50 @@ static IBaseFilter *create_file_source(void) return filter; } +static WCHAR *load_resource(const WCHAR *name) +{ + static WCHAR pathW[MAX_PATH]; + DWORD written; + HANDLE file; + HRSRC res; + void *ptr; + + GetTempPathW(ARRAY_SIZE(pathW), pathW); + lstrcatW(pathW, name); + + file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s, error %u.\n", + wine_dbgstr_w(pathW), GetLastError()); + + res = FindResourceW(NULL, name, (LPCWSTR)RT_RCDATA); + ok(!!res, "Failed to load resource, error %u.\n", GetLastError()); + ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res)); + WriteFile(file, ptr, SizeofResource( GetModuleHandleA(NULL), res), &written, NULL); + ok(written == SizeofResource(GetModuleHandleA(NULL), res), "Failed to write resource.\n"); + CloseHandle(file); + + return pathW; +} + +static void load_file(IBaseFilter *filter, const WCHAR *filename) +{ + IFileSourceFilter *filesource; + HRESULT hr; + + hr = IBaseFilter_QueryInterface(filter, &IID_IFileSourceFilter, (void **)&filesource); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFileSourceFilter_Load(filesource, filename, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IFileSourceFilter_Release(filesource); +} + +static ULONG get_refcount(void *iface) +{ + IUnknown *unknown = iface; + IUnknown_AddRef(unknown); + return IUnknown_Release(unknown); +} + #define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) { @@ -192,11 +238,125 @@ static void test_file_source_filter(void) } } +static void test_enum_pins(void) +{ + const WCHAR *filename = load_resource(avifile); + IBaseFilter *filter = create_file_source(); + IEnumPins *enum1, *enum2; + IPin *pins[2]; + ULONG count; + HRESULT hr; + ULONG ref; + BOOL ret; + + ref = get_refcount(filter); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + + hr = IBaseFilter_EnumPins(filter, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IBaseFilter_EnumPins(filter, &enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + + hr = IEnumPins_Next(enum1, 1, NULL, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 1); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + load_file(filter, filename); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); +todo_wine + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); +todo_wine + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pins[0]); +todo_wine + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(!count, "Got count %u.\n", count); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, NULL); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Clone(enum1, &enum2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 2); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 1); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum2, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IPin_Release(pins[0]); + + IEnumPins_Release(enum2); + IEnumPins_Release(enum1); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ret = DeleteFileW(filename); + ok(ret, "Failed to delete file, error %u.\n", GetLastError()); +} + START_TEST(filesource) { CoInitialize(NULL); test_interfaces(); + test_enum_pins(); test_file_source_filter(); CoUninitialize();
1
0
0
0
Austin English : comctl32: Fix a memory leak (valgrind).
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: b4a9f3f3f3797465329e0839d480100e4a151b90 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b4a9f3f3f3797465329e0839…
Author: Austin English <austinenglish(a)gmail.com> Date: Wed Feb 20 22:41:28 2019 -0600 comctl32: Fix a memory leak (valgrind). Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/subclass.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c index 41ba065..fc778d6 100644 --- a/dlls/comctl32/tests/subclass.c +++ b/dlls/comctl32/tests/subclass.c @@ -273,6 +273,9 @@ static void test_subclass(void) ret = pSetWindowSubclass(hwnd, NULL, 1, 0); ok(ret == FALSE, "Expected FALSE\n"); + pRemoveWindowSubclass(hwnd, wnd_proc_sub, 2); + pRemoveWindowSubclass(hwnd, wnd_proc_sub, 5); + DestroyWindow(hwnd); }
1
0
0
0
Paul Gofman : kernel32/tests: Test ReadFileScatter() completion status with FILE_SKIP_COMPLETION_PORT_ON_SUCCESS.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 41b221ff823029e0a906a09f930d19f13cba97f3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=41b221ff823029e0a906a09f…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Wed Feb 20 21:50:14 2019 +0300 kernel32/tests: Test ReadFileScatter() completion status with FILE_SKIP_COMPLETION_PORT_ON_SUCCESS. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Jacek Caban<jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/file.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 18cd18d..dd84557 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -61,6 +61,7 @@ static BOOL (WINAPI *pSetFileInformationByHandle)(HANDLE, FILE_INFO_BY_HANDLE_CL static BOOL (WINAPI *pGetQueuedCompletionStatusEx)(HANDLE, OVERLAPPED_ENTRY*, ULONG, ULONG*, DWORD, BOOL); static void (WINAPI *pRtlInitAnsiString)(PANSI_STRING,PCSZ); static void (WINAPI *pRtlFreeUnicodeString)(PUNICODE_STRING); +static BOOL (WINAPI *pSetFileCompletionNotificationModes)(HANDLE, UCHAR); static char filename[MAX_PATH]; static const char sillytext[] = @@ -109,6 +110,7 @@ static void InitFunctionPointers(void) pGetFinalPathNameByHandleW = (void *) GetProcAddress(hkernel32, "GetFinalPathNameByHandleW"); pSetFileInformationByHandle = (void *) GetProcAddress(hkernel32, "SetFileInformationByHandle"); pGetQueuedCompletionStatusEx = (void *) GetProcAddress(hkernel32, "GetQueuedCompletionStatusEx"); + pSetFileCompletionNotificationModes = (void *)GetProcAddress(hkernel32, "SetFileCompletionNotificationModes"); } static void test__hread( void ) @@ -4565,6 +4567,28 @@ static void test_WriteFileGather(void) ok( memcmp( rbuf1 + si.dwPageSize / 2, rbuf2, si.dwPageSize - si.dwPageSize / 2 ) == 0, "invalid data was read into buffer\n" ); + if (pSetFileCompletionNotificationModes) + { + br = pSetFileCompletionNotificationModes(hfile, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS); + ok(br, "SetFileCompletionNotificationModes failed, error %u.\n", GetLastError()); + + br = ReadFileScatter(hfile, fse, si.dwPageSize, NULL, &ovl); + ok(br == FALSE, "ReadFileScatter should be asynchronous.\n"); + ok(GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed, error %u.\n", GetLastError()); + + br = GetQueuedCompletionStatus(hiocp2, &size, &key, &povl, 1000); + todo_wine ok(br, "GetQueuedCompletionStatus failed, err %u.\n", GetLastError()); + todo_wine ok(povl == &ovl, "Wrong ovl %p.\n", povl); + + br = GetOverlappedResult(hfile, &ovl, &tx, TRUE); + ok(br, "GetOverlappedResult failed, err %u.\n", GetLastError()); + ok(tx == si.dwPageSize, "Got unexpected size %u.\n", tx); + + ResetEvent(evt); + } + else + win_skip("SetFileCompletionNotificationModes not available.\n"); + CloseHandle( hfile ); CloseHandle( hiocp1 ); CloseHandle( hiocp2 );
1
0
0
0
Sven Baars : dinput8/tests: Fix some memory leaks (Valgrind).
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 76cbd21c5a3d8d20ef5a5ba8b2523013d19202b9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=76cbd21c5a3d8d20ef5a5ba8…
Author: Sven Baars <sven.wine(a)gmail.com> Date: Thu Feb 21 14:54:15 2019 +0100 dinput8/tests: Fix some memory leaks (Valgrind). Signed-off-by: Sven Baars <sven.wine(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput8/tests/device.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c index aaeddd9..1bfb34a 100644 --- a/dlls/dinput8/tests/device.c +++ b/dlls/dinput8/tests/device.c @@ -281,6 +281,8 @@ static BOOL CALLBACK enumeration_callback(const DIDEVICEINSTANCEA *lpddi, IDirec hr = IDirectInputDevice8_SetActionMap(lpdid, data->lpdiaf, NULL, 0); ok (hr == DIERR_ACQUIRED, "SetActionMap succeeded with an acquired device hr=%08x\n", hr); + IDirectInputDevice_Release(lpdid2); + return DIENUM_CONTINUE; } @@ -329,6 +331,12 @@ static void test_action_mapping(void) hr = IDirectInput8_EnumDevicesBySemantics(pDI, 0, &af, enumeration_callback, &data, DIEDBSFL_ATTACHEDONLY); ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed: hr=%08x\n", hr); + if (data.keyboard) + IDirectInputDevice_Release(data.keyboard); + + if (data.mouse) + IDirectInputDevice_Release(data.mouse); + /* Repeat tests with a non NULL user */ data.username = "Ninja Brian"; hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &af, enumeration_callback, &data, DIEDBSFL_ATTACHEDONLY); @@ -383,6 +391,8 @@ static void test_action_mapping(void) hr = IDirectInputDevice_GetProperty(data.keyboard, DIPROP_USERNAME, &dps.diph); ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); ok (dps.wsz[0] == 0, "Expected empty username, got=%s\n", wine_dbgstr_w(dps.wsz)); + + IDirectInputDevice_Release(data.keyboard); } if (data.mouse != NULL) @@ -392,9 +402,12 @@ static void test_action_mapping(void) test_build_action_map(data.mouse, data.lpdiaf, DITEST_YAXIS, DIDFT_RELAXIS, 0x01); test_device_input(data.mouse, INPUT_MOUSE, MOUSEEVENTF_LEFTDOWN, 3); + + IDirectInputDevice_Release(data.mouse); } DestroyWindow(hwnd); + IDirectInput_Release(pDI); } static void test_save_settings(void) @@ -458,7 +471,6 @@ static void test_save_settings(void) /* Easy case. Ask for default mapping, save, ask for previous map and read it back */ hr = IDirectInputDevice8_BuildActionMap(pKey, &af, NULL, DIDBAM_HWDEFAULTS); ok (SUCCEEDED(hr), "BuildActionMap failed hr=%08x\n", hr); - ok (results[0] == af.rgoAction[0].dwObjID, "Mapped incorrectly expected: 0x%08x got: 0x%08x\n", results[0], af.rgoAction[0].dwObjID); @@ -543,6 +555,9 @@ static void test_save_settings(void) ok (other_results[1] == af.rgoAction[1].dwObjID, "Mapped incorrectly expected: 0x%08x got: 0x%08x\n", other_results[1], af.rgoAction[1].dwObjID); ok (IsEqualGUID(&GUID_SysKeyboard, &af.rgoAction[1].guidInstance), "Action should be mapped to keyboard\n"); + + IDirectInputDevice_Release(pKey); + IDirectInput_Release(pDI); } START_TEST(device)
1
0
0
0
Paul Gofman : ntdll/tests: Test ReadFile() completion status with FILE_SKIP_COMPLETION_PORT_ON_SUCCESS.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: e2f46a604fef6dfcb95858940675fd9f6b92ed01 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e2f46a604fef6dfcb9585894…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Wed Feb 20 21:50:15 2019 +0300 ntdll/tests: Test ReadFile() completion status with FILE_SKIP_COMPLETION_PORT_ON_SUCCESS. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Jacek Caban<jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/file.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index e210a6e..1c1143f 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -3403,6 +3403,7 @@ static void _test_completion_flags(unsigned line, HANDLE handle, DWORD expected_ static void test_file_completion_information(void) { + DECLSPEC_ALIGN(TEST_OVERLAPPED_READ_SIZE) static unsigned char aligned_buf[TEST_OVERLAPPED_READ_SIZE]; static const char buf[] = "testdata"; FILE_IO_COMPLETION_NOTIFICATION_INFORMATION info; OVERLAPPED ov, *pov; @@ -3546,6 +3547,40 @@ static void test_file_completion_information(void) else win_skip("WriteFile never returned TRUE\n"); + CloseHandle(port); + CloseHandle(h); + + if (!(h = create_temp_file(FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING))) + return; + + port = CreateIoCompletionPort(h, NULL, 0xdeadbeef, 0); + ok(port != NULL, "CreateIoCompletionPort failed, error %u.\n", GetLastError()); + + info.Flags = FILE_SKIP_COMPLETION_PORT_ON_SUCCESS; + status = pNtSetInformationFile(h, &io, &info, sizeof(info), FileIoCompletionNotificationInformation); + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %#x.\n", status); + test_completion_flags(h, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS); + + ret = WriteFile(h, aligned_buf, sizeof(aligned_buf), &num_bytes, &ov); + if (!ret && GetLastError() == ERROR_IO_PENDING) + { + ret = GetOverlappedResult(h, &ov, &num_bytes, TRUE); + ok(ret, "GetOverlappedResult failed, error %u.\n", GetLastError()); + ok(num_bytes == sizeof(aligned_buf), "expected sizeof(aligned_buf), got %u.\n", num_bytes); + ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000); + ok(ret, "GetQueuedCompletionStatus failed, error %u.\n", GetLastError()); + } + ok(num_bytes == sizeof(aligned_buf), "expected sizeof(buf), got %u.\n", num_bytes); + + SetLastError(0xdeadbeef); + ret = ReadFile(h, aligned_buf, sizeof(aligned_buf), &num_bytes, &ov); + ok(!ret && GetLastError() == ERROR_IO_PENDING, "Unexpected result, ret %#x, error %u.\n", + ret, GetLastError()); + ret = GetOverlappedResult(h, &ov, &num_bytes, TRUE); + ok(ret, "GetOverlappedResult failed, error %u.\n", GetLastError()); + ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000); + todo_wine ok(ret, "GetQueuedCompletionStatus failed, error %u.\n", GetLastError()); + CloseHandle(ov.hEvent); CloseHandle(port); CloseHandle(h);
1
0
0
0
Nikolay Sivov : mfreadwrite/tests: Initialize COM only for tests that need it.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 4bca67bd474e0265ccaacabb987311f6b700fc6f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4bca67bd474e0265ccaacabb…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Feb 21 15:34:58 2019 +0300 mfreadwrite/tests: Initialize COM only for tests that need it. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfreadwrite/tests/mfplat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c index de5f359..b2675dc 100644 --- a/dlls/mfreadwrite/tests/mfplat.c +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -96,6 +96,8 @@ static void test_factory(void) IMFReadWriteClassFactory *factory, *factory2; HRESULT hr; + CoInitialize(NULL); + hr = CoCreateInstance(&CLSID_MFReadWriteClassFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IMFReadWriteClassFactory, (void **)&factory); ok(hr == S_OK, "Failed to create class factory, hr %#x.\n", hr); @@ -105,14 +107,14 @@ static void test_factory(void) ok(hr == CLASS_E_NOAGGREGATION, "Unexpected hr %#x.\n", hr); IMFReadWriteClassFactory_Release(factory); + + CoUninitialize(); } START_TEST(mfplat) { HRESULT hr; - CoInitialize(NULL); - hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -122,6 +124,4 @@ START_TEST(mfplat) test_factory(); MFShutdown(); - - CoUninitialize(); }
1
0
0
0
Nikolay Sivov : mf/tests: Add some tests for node management.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: 2a1576c0d396a0269d12f53d2cf3e085491bd7cb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2a1576c0d396a0269d12f53d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Feb 21 13:32:21 2019 +0300 mf/tests: Add some tests for node management. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mf/tests/mf.c | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 132 insertions(+), 2 deletions(-) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 6e77f6b..d6091cb 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -28,29 +28,159 @@ #include "initguid.h" #include "mfapi.h" +#include "mferror.h" #include "mfidl.h" #include "wine/test.h" static void test_topology(void) { + IMFTopologyNode *node, *node2; IMFTopology *topology; - IMFTopologyNode *node; + WORD count; HRESULT hr; + TOPOID id; hr = MFCreateTopology(NULL); ok(hr == E_POINTER, "got %#x\n", hr); hr = MFCreateTopology(&topology); ok(hr == S_OK, "got %#x\n", hr); - IMFTopology_Release(topology); hr = MFCreateTopologyNode(MF_TOPOLOGY_OUTPUT_NODE, NULL); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); hr = MFCreateTopologyNode(MF_TOPOLOGY_OUTPUT_NODE, &node); ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr); + + hr = MFCreateTopologyNode(MF_TOPOLOGY_TEE_NODE, &node2); + ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr); + + hr = IMFTopologyNode_GetTopoNodeID(node, &id); +todo_wine + ok(hr == S_OK, "Failed to get node id, hr %#x.\n", hr); + + hr = IMFTopologyNode_SetTopoNodeID(node2, id); +todo_wine + ok(hr == S_OK, "Failed to set node id, hr %#x.\n", hr); + + count = 1; + hr = IMFTopology_GetNodeCount(topology, &count); +todo_wine { + ok(hr == S_OK, "Failed to get node count, hr %#x.\n", hr); + ok(count == 0, "Unexpected node count %u.\n", count); +} + /* Same id, different nodes. */ + hr = IMFTopology_AddNode(topology, node); +todo_wine + ok(hr == S_OK, "Failed to add a node, hr %#x.\n", hr); + + count = 0; + hr = IMFTopology_GetNodeCount(topology, &count); +todo_wine { + ok(hr == S_OK, "Failed to get node count, hr %#x.\n", hr); + ok(count == 1, "Unexpected node count %u.\n", count); +} + hr = IMFTopology_AddNode(topology, node2); +todo_wine + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + IMFTopologyNode_Release(node2); + + hr = IMFTopology_GetNodeByID(topology, id, &node2); +todo_wine { + ok(hr == S_OK, "Failed to get a node, hr %#x.\n", hr); + ok(node2 == node, "Unexpected node.\n"); +} + if (SUCCEEDED(hr)) + IMFTopologyNode_Release(node2); + + /* Change node id, add it again. */ + hr = IMFTopologyNode_SetTopoNodeID(node, ++id); +todo_wine + ok(hr == S_OK, "Failed to set node id, hr %#x.\n", hr); + + hr = IMFTopology_GetNodeByID(topology, id, &node2); +todo_wine { + ok(hr == S_OK, "Failed to get a node, hr %#x.\n", hr); + ok(node2 == node, "Unexpected node.\n"); +} + if (SUCCEEDED(hr)) + IMFTopologyNode_Release(node2); + + hr = IMFTopology_GetNodeByID(topology, id + 1, &node2); +todo_wine + ok(hr == MF_E_NOT_FOUND, "Unexpected hr %#x.\n", hr); + + hr = IMFTopology_AddNode(topology, node); +todo_wine + ok(hr == E_INVALIDARG, "Failed to add a node, hr %#x.\n", hr); + + hr = IMFTopology_GetNode(topology, 0, &node2); +todo_wine { + ok(hr == S_OK, "Failed to get a node, hr %#x.\n", hr); + ok(node2 == node, "Unexpected node.\n"); +} + if (SUCCEEDED(hr)) + IMFTopologyNode_Release(node2); + + hr = IMFTopology_GetNode(topology, 1, &node2); +todo_wine + ok(hr == MF_E_INVALIDINDEX, "Failed to get a node, hr %#x.\n", hr); + + hr = IMFTopology_GetNode(topology, -2, &node2); +todo_wine + ok(hr == MF_E_INVALIDINDEX, "Failed to get a node, hr %#x.\n", hr); + + hr = MFCreateTopologyNode(MF_TOPOLOGY_TEE_NODE, &node2); + ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr); + hr = IMFTopology_AddNode(topology, node2); +todo_wine + ok(hr == S_OK, "Failed to add a node, hr %#x.\n", hr); + IMFTopologyNode_Release(node2); + + count = 0; + hr = IMFTopology_GetNodeCount(topology, &count); +todo_wine { + ok(hr == S_OK, "Failed to get node count, hr %#x.\n", hr); + ok(count == 2, "Unexpected node count %u.\n", count); +} + /* Remove with detached node, existing id. */ + hr = MFCreateTopologyNode(MF_TOPOLOGY_TEE_NODE, &node2); + ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr); + hr = IMFTopologyNode_SetTopoNodeID(node2, id); +todo_wine + ok(hr == S_OK, "Failed to set node id, hr %#x.\n", hr); + hr = IMFTopology_RemoveNode(topology, node2); +todo_wine + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + IMFTopologyNode_Release(node2); + + hr = IMFTopology_RemoveNode(topology, node); +todo_wine + ok(hr == S_OK, "Failed to remove a node, hr %#x.\n", hr); + + count = 0; + hr = IMFTopology_GetNodeCount(topology, &count); +todo_wine { + ok(hr == S_OK, "Failed to get node count, hr %#x.\n", hr); + ok(count == 1, "Unexpected node count %u.\n", count); +} + hr = IMFTopology_Clear(topology); +todo_wine + ok(hr == S_OK, "Failed to clear topology, hr %#x.\n", hr); + + count = 1; + hr = IMFTopology_GetNodeCount(topology, &count); +todo_wine { + ok(hr == S_OK, "Failed to get node count, hr %#x.\n", hr); + ok(count == 0, "Unexpected node count %u.\n", count); +} + hr = IMFTopology_Clear(topology); +todo_wine + ok(hr == S_OK, "Failed to clear topology, hr %#x.\n", hr); + IMFTopologyNode_Release(node); + IMFTopology_Release(topology); } static HRESULT WINAPI test_getservice_QI(IMFGetService *iface, REFIID riid, void **obj)
1
0
0
0
Nikolay Sivov : mfreadwrite: Add MFReadWriteClassFactory stub.
by Alexandre Julliard
21 Feb '19
21 Feb '19
Module: wine Branch: master Commit: b91fbb1c2822a513d671c73ccfdb56760819184c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b91fbb1c2822a513d671c73c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Feb 21 15:34:57 2019 +0300 mfreadwrite: Add MFReadWriteClassFactory stub. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfreadwrite/main.c | 129 ++++++++++++++++++++++++++++++++++++++-- dlls/mfreadwrite/tests/mfplat.c | 18 ++++++ 2 files changed, 141 insertions(+), 6 deletions(-) diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 666e5ae..77dbd7b 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -24,12 +24,15 @@ #include "windef.h" #include "winbase.h" +#include "initguid.h" #include "ole2.h" #include "rpcproxy.h" #include "mfreadwrite.h" #include "wine/debug.h" +DEFINE_GUID(CLSID_MFReadWriteClassFactory, 0x48e2ed0f, 0x98c2, 0x4a37, 0xbe, 0xd5, 0x16, 0x63, 0x12, 0xdd, 0xd8, 0x3f); + WINE_DEFAULT_DEBUG_CHANNEL(mfplat); static HINSTANCE mfinstance; @@ -58,12 +61,6 @@ HRESULT WINAPI MFCreateSourceReaderFromMediaSource(IMFMediaSource *source, IMFAt return E_NOTIMPL; } -HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) -{ - FIXME("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); - return CLASS_E_CLASSNOTAVAILABLE; -} - HRESULT WINAPI DllCanUnloadNow(void) { return S_FALSE; @@ -247,3 +244,123 @@ HRESULT WINAPI MFCreateSourceReaderFromByteStream(IMFByteStream *stream, IMFAttr *reader = &object->IMFSourceReader_iface; return S_OK; } + +static HRESULT WINAPI readwrite_factory_QueryInterface(IMFReadWriteClassFactory *iface, REFIID riid, void **out) +{ + if (IsEqualIID(riid, &IID_IMFReadWriteClassFactory) || + IsEqualIID(riid, &IID_IUnknown)) + { + *out = iface; + IMFReadWriteClassFactory_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI readwrite_factory_AddRef(IMFReadWriteClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI readwrite_factory_Release(IMFReadWriteClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI readwrite_factory_CreateInstanceFromURL(IMFReadWriteClassFactory *iface, REFCLSID clsid, + const WCHAR *url, IMFAttributes *attributes, REFIID riid, void **out) +{ + FIXME("%s, %s, %p, %s, %p.\n", debugstr_guid(clsid), debugstr_w(url), attributes, debugstr_guid(riid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI readwrite_factory_CreateInstanceFromObject(IMFReadWriteClassFactory *iface, REFCLSID clsid, + IUnknown *unk, IMFAttributes *attributes, REFIID riid, void **out) +{ + FIXME("%s, %p, %p, %s, %p.\n", debugstr_guid(clsid), unk, attributes, debugstr_guid(riid), out); + + return E_NOTIMPL; +} + +static const IMFReadWriteClassFactoryVtbl readwrite_factory_vtbl = +{ + readwrite_factory_QueryInterface, + readwrite_factory_AddRef, + readwrite_factory_Release, + readwrite_factory_CreateInstanceFromURL, + readwrite_factory_CreateInstanceFromObject, +}; + +static IMFReadWriteClassFactory readwrite_factory = { &readwrite_factory_vtbl }; + +static HRESULT WINAPI classfactory_QueryInterface(IClassFactory *iface, REFIID riid, void **out) +{ + TRACE("%s, %p.\n", debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IClassFactory) || + IsEqualGUID(riid, &IID_IUnknown)) + { + IClassFactory_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("interface %s not implemented\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI classfactory_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI classfactory_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI classfactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **out) +{ + TRACE("%p, %s, %p.\n", outer, debugstr_guid(riid), out); + + *out = NULL; + + if (outer) + return CLASS_E_NOAGGREGATION; + + return IMFReadWriteClassFactory_QueryInterface(&readwrite_factory, riid, out); +} + +static HRESULT WINAPI classfactory_LockServer(IClassFactory *iface, BOOL dolock) +{ + FIXME("%d.\n", dolock); + return S_OK; +} + +static const struct IClassFactoryVtbl classfactoryvtbl = +{ + classfactory_QueryInterface, + classfactory_AddRef, + classfactory_Release, + classfactory_CreateInstance, + classfactory_LockServer, +}; + +static IClassFactory classfactory = { &classfactoryvtbl }; + +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + TRACE("%s, %s, %p.\n", debugstr_guid(clsid), debugstr_guid(riid), out); + + if (IsEqualGUID(clsid, &CLSID_MFReadWriteClassFactory)) + return IClassFactory_QueryInterface(&classfactory, riid, out); + + WARN("Unsupported class %s.\n", debugstr_guid(clsid)); + *out = NULL; + return CLASS_E_CLASSNOTAVAILABLE; +} diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c index 9f5cad6..de5f359 100644 --- a/dlls/mfreadwrite/tests/mfplat.c +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -36,6 +36,7 @@ #include "initguid.h" DEFINE_GUID(MF_READWRITE_MMCSS_PRIORITY_AUDIO,0x273db885, 0x2de2, 0x4db2, 0xa6, 0xa7, 0xfd, 0xb6, 0x6f, 0xb4, 0x0b, 0x61); DEFINE_GUID(MF_READWRITE_MMCSS_CLASS_AUDIO, 0x430847da, 0x0890, 0x4b0e, 0x93, 0x8c, 0x05, 0x43, 0x32, 0xc5, 0x47, 0xe1); +DEFINE_GUID(CLSID_MFReadWriteClassFactory, 0x48e2ed0f, 0x98c2, 0x4a37, 0xbe, 0xd5, 0x16, 0x63, 0x12, 0xdd, 0xd8, 0x3f); static HRESULT (WINAPI *pMFCreateMFByteStreamOnStream)(IStream *stream, IMFByteStream **bytestream); @@ -90,6 +91,22 @@ static void test_MFCreateSourceReaderFromByteStream(void) IMFSourceReader_Release(source); } +static void test_factory(void) +{ + IMFReadWriteClassFactory *factory, *factory2; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_MFReadWriteClassFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IMFReadWriteClassFactory, + (void **)&factory); + ok(hr == S_OK, "Failed to create class factory, hr %#x.\n", hr); + + hr = CoCreateInstance(&CLSID_MFReadWriteClassFactory, (IUnknown *)factory, CLSCTX_INPROC_SERVER, &IID_IMFReadWriteClassFactory, + (void **)&factory2); + ok(hr == CLASS_E_NOAGGREGATION, "Unexpected hr %#x.\n", hr); + + IMFReadWriteClassFactory_Release(factory); +} + START_TEST(mfplat) { HRESULT hr; @@ -102,6 +119,7 @@ START_TEST(mfplat) init_functions(); test_MFCreateSourceReaderFromByteStream(); + test_factory(); MFShutdown();
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
68
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
Results per page:
10
25
50
100
200