ReactOS.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
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
List overview
Download
Ros-diffs
July 2015
----- 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
ros-diffs@reactos.org
13 participants
257 discussions
Start a n
N
ew thread
[akhaldi] 68534: [URLMON_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:37:31 2015 New Revision: 68534 URL:
http://svn.reactos.org/svn/reactos?rev=68534&view=rev
Log: [URLMON_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/urlmon/protocol.c trunk/rostests/winetests/urlmon/url.c Modified: trunk/rostests/winetests/urlmon/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/protocol…
============================================================================== --- trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] Wed Jul 22 00:37:31 2015 @@ -158,7 +158,7 @@ static DWORD prot_read, filter_state, http_post_test, thread_id; static BOOL security_problem, test_async_req, impl_protex; static BOOL async_read_pending, mimefilter_test, direct_read, wait_for_switch, emulate_prot, short_read, test_abort; -static BOOL empty_file, no_mime, bind_from_cache; +static BOOL empty_file, no_mime, bind_from_cache, file_with_hash; enum { STATE_CONNECTING, @@ -585,7 +585,8 @@ { HRESULT hres; - trace("continue in state %d\n", state); + if (winetest_debug > 1) + trace("continue in state %d\n", state); if(state == STATE_CONNECTING) { if(tested_protocol == HTTP_TEST || tested_protocol == HTTPS_TEST || tested_protocol == FTP_TEST) { @@ -766,10 +767,13 @@ '0','0','0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0','0','}',0}; static const WCHAR text_plain[] = {'t','e','x','t','/','p','l','a','i','n',0}; - if (ulStatusCode < sizeof(status_names)/sizeof(status_names[0])) - trace( "progress: %s %s\n", status_names[ulStatusCode], wine_dbgstr_w(szStatusText) ); - else - trace( "progress: %u %s\n", ulStatusCode, wine_dbgstr_w(szStatusText) ); + if (winetest_debug > 1) + { + if (ulStatusCode < sizeof(status_names)/sizeof(status_names[0])) + trace( "progress: %s %s\n", status_names[ulStatusCode], wine_dbgstr_w(szStatusText) ); + else + trace( "progress: %u %s\n", ulStatusCode, wine_dbgstr_w(szStatusText) ); + } switch(ulStatusCode) { case BINDSTATUS_MIMETYPEAVAILABLE: @@ -908,7 +912,8 @@ ok(ulProgress == ulProgressMax, "ulProgress (%d) != ulProgressMax (%d)\n", ulProgress, ulProgressMax); - ok(ulProgressMax == 13, "ulProgressMax=%d, expected 13\n", ulProgressMax); + if(!file_with_hash) + ok(ulProgressMax == 13, "ulProgressMax=%d, expected 13\n", ulProgressMax); /* BSCF_SKIPDRAINDATAFORFILEURLS added in IE8 */ if(tested_protocol == FILE_TEST) ok((grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION)) || @@ -2397,6 +2402,7 @@ impl_protex = (flags & TEST_IMPLPROTEX) != 0; empty_file = (flags & TEST_EMPTY) != 0; bind_from_cache = (flags & TEST_FROMCACHE) != 0; + file_with_hash = FALSE; register_filter(mimefilter_test); } @@ -2531,6 +2537,8 @@ hres = IInternetProtocol_Read(protocol, buf, 2, &cb); ok(hres == S_OK, "Read failed: %08x\n", hres); ok(cb == 2, "cb=%u expected 2\n", cb); + buf[2] = 0; + ok(!memcmp(buf, file_with_hash ? "XX" : "<H", 2), "Unexpected data %s\n", buf); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); ok(hres == S_FALSE, "Read failed: %08x\n", hres); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); @@ -2565,7 +2573,10 @@ hres = IInternetProtocol_UnlockRequest(protocol); ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); + if(file_with_hash) /* FIXME: An effect of UnlockRequest call? */ + todo_wine ok(hres == S_OK, "Read failed: %08x\n", hres); + else + ok(hres == S_OK, "Read failed: %08x\n", hres); hres = IInternetProtocol_Terminate(protocol, 0); ok(hres == S_OK, "Terminate failed: %08x\n", hres); } @@ -2718,6 +2729,7 @@ static const WCHAR wszFile3[] = {'f','i','l','e',':','/','/','/',0}; static const WCHAR wszFile4[] = {'f','i','l','e',':','\\','\\',0}; static const char html_doc[] = "<HTML></HTML>"; + static const WCHAR fragmentW[] = {'#','f','r','a','g',0}; trace("Testing file protocol...\n"); init_test(FILE_TEST, 0); @@ -2791,7 +2803,25 @@ buf[sizeof(wszFile4)/sizeof(WCHAR)] = '|'; test_file_protocol_url(buf); + /* Fragment part of URL is skipped if the file doesn't exist. */ + lstrcatW(buf, fragmentW); + test_file_protocol_url(buf); + + /* Fragment part is considered a part of the file name, if the file exsists. */ + len = lstrlenW(file_name_buf); + lstrcpyW(file_name_buf+len, fragmentW); + file = CreateFileW(wszIndexHtml, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n"); + WriteFile(file, "XXX", 3, &size, NULL); + CloseHandle(file); + file_name_buf[len] = 0; + + file_with_hash = TRUE; + test_file_protocol_url(buf); + DeleteFileW(wszIndexHtml); + DeleteFileW(file_name_buf); bindf = 0; test_file_protocol_fail(); Modified: trunk/rostests/winetests/urlmon/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/url.c?re…
============================================================================== --- trunk/rostests/winetests/urlmon/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/url.c [iso-8859-1] Wed Jul 22 00:37:31 2015 @@ -2572,6 +2572,7 @@ IHttpNegotiate *http_negotiate, *http_negotiate_serv; IHttpNegotiate2 *http_negotiate2, *http_negotiate2_serv; IAuthenticate *authenticate, *authenticate_serv; + IInternetBindInfo *bind_info; IInternetProtocol *protocol; BINDINFO bindinfo = {sizeof(bindinfo)}; BOOL ret = TRUE; @@ -2685,6 +2686,16 @@ IAuthenticate_Release(authenticate); IAuthenticate_Release(authenticate_serv); + + hres = IBindStatusCallback_QueryInterface(holder, &IID_IInternetBindInfo, (void**)&bind_info); + ok(hres == S_OK || broken(hres == E_NOINTERFACE /* win2k */), "Could not get IInternetBindInfo interface: %08x\n", hres); + + if(SUCCEEDED(hres)) { + hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_USER_AGENT, &wstr, 1, &dw); + ok(hres == E_NOINTERFACE, "GetBindString(BINDSTRING_USER_AGENT) failed: %08x\n", hres); + + IInternetBindInfo_Release(bind_info); + } SET_EXPECT(OnStopBinding); hres = IBindStatusCallback_OnStopBinding(holder, S_OK, NULL); @@ -3848,6 +3859,32 @@ IInternetSession_Release(session); } +static BOOL can_do_https(void) +{ + HINTERNET ses, con, req; + BOOL ret; + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); + ok(ses != NULL, "InternetOpen failed\n"); + + con = InternetConnectA(ses, "
test.winehq.org
", INTERNET_DEFAULT_HTTPS_PORT, + NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnect failed\n"); + + req = HttpOpenRequestA(con, "GET", "/tests/hello.html", NULL, NULL, NULL, + INTERNET_FLAG_SECURE, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret || broken(GetLastError() == ERROR_INTERNET_CANNOT_CONNECT), + "request failed: %u\n", GetLastError()); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); + return ret; +} + START_TEST(url) { HMODULE hurlmon; @@ -3927,25 +3964,34 @@ trace("file test (no callback)...\n"); test_BindToStorage(FILE_TEST, BINDTEST_NO_CALLBACK, TYMED_ISTREAM); - trace("synchronous https test (invalid CN, dialog)\n"); - onsecurityproblem_hres = S_FALSE; - http_is_first = TRUE; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + if(can_do_https()) { + trace("synchronous https test (invalid CN, dialog)\n"); + onsecurityproblem_hres = S_FALSE; + http_is_first = TRUE; + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + + bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA; + + trace("asynchronous https test (invalid CN, fail)\n"); + onsecurityproblem_hres = E_FAIL; + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + + trace("asynchronous https test (invalid CN, accept)\n"); + onsecurityproblem_hres = S_OK; + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + + trace("asynchronous https test (invalid CN, dialog 2)\n"); + onsecurityproblem_hres = S_FALSE; + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + invalid_cn_accepted = FALSE; + + trace("asynchronous https test...\n"); + test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM); + }else { + win_skip("Skipping https testt\n"); + } bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA; - - trace("asynchronous https test (invalid CN, fail)\n"); - onsecurityproblem_hres = E_FAIL; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); - - trace("asynchronous https test (invalid CN, accept)\n"); - onsecurityproblem_hres = S_OK; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); - - trace("asynchronous https test (invalid CN, dialog 2)\n"); - onsecurityproblem_hres = S_FALSE; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); - invalid_cn_accepted = FALSE; trace("winetest test (async switch)...\n"); test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_ASYNC_SWITCH, TYMED_ISTREAM); @@ -3999,9 +4045,6 @@ trace("winetest test (no callback)...\n"); test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_NO_CALLBACK|BINDTEST_USE_CACHE, TYMED_ISTREAM); - - trace("asynchronous https test...\n"); - test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM); trace("emulated https test...\n"); test_BindToStorage(HTTPS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
9 years, 5 months
1
0
0
0
[akhaldi] 68533: [URLMON] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:37:05 2015 New Revision: 68533 URL:
http://svn.reactos.org/svn/reactos?rev=68533&view=rev
Log: [URLMON] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/urlmon/bindctx.c trunk/reactos/dll/win32/urlmon/file.c trunk/reactos/dll/win32/urlmon/mimefilter.c trunk/reactos/dll/win32/urlmon/sec_mgr.c trunk/reactos/dll/win32/urlmon/uri.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/urlmon/bindctx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/bindctx.c…
============================================================================== --- trunk/reactos/dll/win32/urlmon/bindctx.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/bindctx.c [iso-8859-1] Wed Jul 22 00:37:05 2015 @@ -24,6 +24,7 @@ typedef struct { IBindStatusCallbackEx IBindStatusCallbackEx_iface; + IInternetBindInfo IInternetBindInfo_iface; IServiceProvider IServiceProvider_iface; IHttpNegotiate2 IHttpNegotiate2_iface; IAuthenticate IAuthenticate_iface; @@ -121,6 +122,9 @@ }else if(IsEqualGUID(&IID_IAuthenticate, riid)) { TRACE("(%p)->(IID_IAuthenticate, %p)\n", This, ppv); *ppv = &This->IAuthenticate_iface; + }else if(IsEqualGUID(&IID_IInternetBindInfo, riid)) { + TRACE("(%p)->(IID_IInternetBindInfo, %p)\n", This, ppv); + *ppv = &This->IInternetBindInfo_iface; } if(*ppv) { @@ -492,6 +496,63 @@ BSCAuthenticate_Authenticate }; +static inline BindStatusCallback *impl_from_IInternetBindInfo(IInternetBindInfo *iface) +{ + return CONTAINING_RECORD(iface, BindStatusCallback, IInternetBindInfo_iface); +} + +static HRESULT WINAPI BSCInternetBindInfo_QueryInterface(IInternetBindInfo *iface, REFIID riid, void **ppv) +{ + BindStatusCallback *This = impl_from_IInternetBindInfo(iface); + return IBindStatusCallbackEx_QueryInterface(&This->IBindStatusCallbackEx_iface, riid, ppv); +} + +static ULONG WINAPI BSCInternetBindInfo_AddRef(IInternetBindInfo *iface) +{ + BindStatusCallback *This = impl_from_IInternetBindInfo(iface); + return IBindStatusCallbackEx_AddRef(&This->IBindStatusCallbackEx_iface); +} + +static ULONG WINAPI BSCInternetBindInfo_Release(IInternetBindInfo *iface) +{ + BindStatusCallback *This = impl_from_IInternetBindInfo(iface); + return IBindStatusCallbackEx_Release(&This->IBindStatusCallbackEx_iface); +} + +static HRESULT WINAPI BSCInternetBindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *bindf, BINDINFO *bindinfo) +{ + BindStatusCallback *This = impl_from_IInternetBindInfo(iface); + FIXME("(%p)->(%p %p)\n", This, bindf, bindinfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI BSCInternetBindInfo_GetBindString(IInternetBindInfo *iface, ULONG string_type, + WCHAR **strs, ULONG cnt, ULONG *fetched) +{ + BindStatusCallback *This = impl_from_IInternetBindInfo(iface); + IInternetBindInfo *bind_info; + HRESULT hres; + + TRACE("(%p)->(%d %p %d %p)\n", This, string_type, strs, cnt, fetched); + + hres = IBindStatusCallback_QueryInterface(This->callback, &IID_IInternetBindInfo, (void**)&bind_info); + if(FAILED(hres)) + return hres; + + hres = IInternetBindInfo_GetBindString(bind_info, string_type, strs, cnt, fetched); + + IInternetBindInfo_Release(bind_info); + return hres; +} + +static IInternetBindInfoVtbl BSCInternetBindInfoVtbl = { + BSCInternetBindInfo_QueryInterface, + BSCInternetBindInfo_AddRef, + BSCInternetBindInfo_Release, + BSCInternetBindInfo_GetBindInfo, + BSCInternetBindInfo_GetBindString +}; + static void set_callback(BindStatusCallback *This, IBindStatusCallback *bsc) { IServiceProvider *serv_prov; @@ -518,6 +579,7 @@ return E_OUTOFMEMORY; ret->IBindStatusCallbackEx_iface.lpVtbl = &BindStatusCallbackExVtbl; + ret->IInternetBindInfo_iface.lpVtbl = &BSCInternetBindInfoVtbl; ret->IServiceProvider_iface.lpVtbl = &BSCServiceProviderVtbl; ret->IHttpNegotiate2_iface.lpVtbl = &BSCHttpNegotiateVtbl; ret->IAuthenticate_iface.lpVtbl = &BSCAuthenticateVtbl; Modified: trunk/reactos/dll/win32/urlmon/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/file.c?re…
============================================================================== --- trunk/reactos/dll/win32/urlmon/file.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/file.c [iso-8859-1] Wed Jul 22 00:37:05 2015 @@ -211,35 +211,14 @@ return hres; } -static HRESULT open_file(FileProtocol *This, const WCHAR *path, IInternetProtocolSink *protocol_sink) -{ - LARGE_INTEGER size; - HANDLE file; - - file = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if(file == INVALID_HANDLE_VALUE) - return report_result(protocol_sink, INET_E_RESOURCE_NOT_FOUND, GetLastError()); - - if(!GetFileSizeEx(file, &size)) { - CloseHandle(file); - return report_result(protocol_sink, INET_E_RESOURCE_NOT_FOUND, GetLastError()); - } - - This->file = file; - This->size = size.u.LowPart; - - IInternetProtocolSink_ReportProgress(protocol_sink, - BINDSTATUS_CACHEFILENAMEAVAILABLE, path); - return S_OK; -} - static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved) { FileProtocol *This = impl_from_IInternetProtocolEx(iface); - WCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH], *ptr; + LARGE_INTEGER file_size; + HANDLE file_handle; BINDINFO bindinfo; DWORD grfBINDF = 0; DWORD scheme, size; @@ -290,13 +269,31 @@ return report_result(pOIProtSink, hres, 0); } - hres = open_file(This, path, pOIProtSink); - if(FAILED(hres)) - return hres; + file_handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if(file_handle == INVALID_HANDLE_VALUE && (ptr = strrchrW(path, '#'))) { + /* If path contains fragment part, try without it. */ + *ptr = 0; + file_handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + } + if(file_handle == INVALID_HANDLE_VALUE) + return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, GetLastError()); + + if(!GetFileSizeEx(file_handle, &file_size)) { + CloseHandle(file_handle); + return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, GetLastError()); + } + + This->file = file_handle; + This->size = file_size.u.LowPart; + IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_CACHEFILENAMEAVAILABLE, path); hres = IUri_GetExtension(pUri, &ext); if(SUCCEEDED(hres)) { if(hres == S_OK && *ext) { + if((ptr = strchrW(ext, '#'))) + *ptr = 0; hres = find_mime_from_ext(ext, &mime); if(SUCCEEDED(hres)) { IInternetProtocolSink_ReportProgress(pOIProtSink, Modified: trunk/reactos/dll/win32/urlmon/mimefilter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/mimefilte…
============================================================================== --- trunk/reactos/dll/win32/urlmon/mimefilter.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/mimefilter.c [iso-8859-1] Wed Jul 22 00:37:05 2015 @@ -694,8 +694,5 @@ if(pwzMimeProposed || pBuffer) return find_mime_from_buffer(pBuffer, cbSize, pwzMimeProposed, pwzUrl, ppwzMimeOut); - if(pwzUrl) - return find_mime_from_url(pwzUrl, ppwzMimeOut); - - return E_FAIL; -} + return find_mime_from_url(pwzUrl, ppwzMimeOut); +} Modified: trunk/reactos/dll/win32/urlmon/sec_mgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/sec_mgr.c…
============================================================================== --- trunk/reactos/dll/win32/urlmon/sec_mgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/sec_mgr.c [iso-8859-1] Wed Jul 22 00:37:05 2015 @@ -884,7 +884,7 @@ TRACE("(%p) ref=%u\n", This, refCount); - /* destroy the object if there's no more reference on it */ + /* destroy the object if there are no more references on it */ if (!refCount){ if(This->mgrsite) IInternetSecurityMgrSite_Release(This->mgrsite); Modified: trunk/reactos/dll/win32/urlmon/uri.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/uri.c?rev…
============================================================================== --- trunk/reactos/dll/win32/urlmon/uri.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/uri.c [iso-8859-1] Wed Jul 22 00:37:05 2015 @@ -6834,8 +6834,7 @@ ptr = uri->canon_uri+uri->scheme_start+uri->scheme_len+1; pptr = &ptr; } - reduce_path = !(flags & URL_NO_META) && - !(flags & URL_DONT_SIMPLIFY) && + reduce_path = !(flags & URL_DONT_SIMPLIFY) && ptr && check_hierarchical(pptr); for(ptr = uri->canon_uri; ptr < uri->canon_uri+uri->canon_len; ++ptr) { Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Jul 22 00:37:05 2015 @@ -195,7 +195,7 @@ reactos/dll/win32/unicows # Synced to Wine-1.3.32 (Win9x only, why do we need this?!) reactos/dll/win32/updspapi # Synced to WineStaging-1.7.37 reactos/dll/win32/url # Synced to WineStaging-1.7.37 -reactos/dll/win32/urlmon # Synced to WineStaging-1.7.37 +reactos/dll/win32/urlmon # Synced to WineStaging-1.7.47 reactos/dll/win32/usp10 # Synced to WineStaging-1.7.47 reactos/dll/win32/uxtheme # Forked reactos/dll/win32/vbscript # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68532: [D3DX9_24] => [D3DX9_43] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:34:54 2015 New Revision: 68532 URL:
http://svn.reactos.org/svn/reactos?rev=68532&view=rev
Log: [D3DX9_24] => [D3DX9_43] Sync with Wine Staging 1.7.47. CORE-9924 Added: trunk/reactos/dll/directx/wine/d3dx9_25/effect.c (with props) Modified: trunk/reactos/dll/directx/wine/d3dx9_24/d3dx9_24.spec trunk/reactos/dll/directx/wine/d3dx9_25/CMakeLists.txt trunk/reactos/dll/directx/wine/d3dx9_25/d3dx9_25.spec trunk/reactos/dll/directx/wine/d3dx9_26/d3dx9_26.spec trunk/reactos/dll/directx/wine/d3dx9_27/d3dx9_27.spec trunk/reactos/dll/directx/wine/d3dx9_28/d3dx9_28.spec trunk/reactos/dll/directx/wine/d3dx9_29/d3dx9_29.spec trunk/reactos/dll/directx/wine/d3dx9_30/d3dx9_30.spec trunk/reactos/dll/directx/wine/d3dx9_31/d3dx9_31.spec trunk/reactos/dll/directx/wine/d3dx9_32/d3dx9_32.spec trunk/reactos/dll/directx/wine/d3dx9_33/d3dx9_33.spec trunk/reactos/dll/directx/wine/d3dx9_34/d3dx9_34.spec trunk/reactos/dll/directx/wine/d3dx9_35/d3dx9_35.spec trunk/reactos/dll/directx/wine/d3dx9_36/d3dx9_36.spec trunk/reactos/dll/directx/wine/d3dx9_36/effect.c trunk/reactos/dll/directx/wine/d3dx9_36/mesh.c trunk/reactos/dll/directx/wine/d3dx9_36/surface.c trunk/reactos/dll/directx/wine/d3dx9_36/texture.c trunk/reactos/dll/directx/wine/d3dx9_36/volume.c trunk/reactos/dll/directx/wine/d3dx9_36/xfile.c trunk/reactos/dll/directx/wine/d3dx9_37/d3dx9_37.spec trunk/reactos/dll/directx/wine/d3dx9_38/d3dx9_38.spec trunk/reactos/dll/directx/wine/d3dx9_39/d3dx9_39.spec trunk/reactos/dll/directx/wine/d3dx9_40/d3dx9_40.spec trunk/reactos/dll/directx/wine/d3dx9_41/d3dx9_41.spec trunk/reactos/dll/directx/wine/d3dx9_42/d3dx9_42.spec trunk/reactos/dll/directx/wine/d3dx9_43/d3dx9_43.spec trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/wine/d3dx9_24/d3dx9_24.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_24/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_25/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_25/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_25/d3dx9_25.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_25/…
Added: trunk/reactos/dll/directx/wine/d3dx9_25/effect.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_25/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_26/d3dx9_26.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_26/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_27/d3dx9_27.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_27/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_28/d3dx9_28.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_28/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_29/d3dx9_29.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_29/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_30/d3dx9_30.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_30/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_31/d3dx9_31.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_31/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_32/d3dx9_32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_32/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_33/d3dx9_33.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_33/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_34/d3dx9_34.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_34/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_35/d3dx9_35.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_35/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_36/d3dx9_36.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_36/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_36/effect.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_36/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_36/mesh.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_36/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_36/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_36/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_36/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_36/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_36/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_36/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_36/xfile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_36/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_37/d3dx9_37.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_37/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_38/d3dx9_38.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_38/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_39/d3dx9_39.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_39/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_40/d3dx9_40.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_40/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_41/d3dx9_41.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_41/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_42/d3dx9_42.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_42/…
Modified: trunk/reactos/dll/directx/wine/d3dx9_43/d3dx9_43.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dx9_43/…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
9 years, 5 months
1
0
0
0
[akhaldi] 68531: [D3DCOMPILER_43] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:32:43 2015 New Revision: 68531 URL:
http://svn.reactos.org/svn/reactos?rev=68531&view=rev
Log: [D3DCOMPILER_43] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/bytecodewriter.c trunk/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.tab.c trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.tab.h trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.y trunk/reactos/dll/directx/wine/d3dcompiler_43/utils.c trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/bytecodewriter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.tab.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
9 years, 5 months
1
0
0
0
[akhaldi] 68530: [D3D8][D3D9][DDRAW][WINED3D] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 21 23:40:47 2015 New Revision: 68530 URL:
http://svn.reactos.org/svn/reactos?rev=68530&view=rev
Log: [D3D8][D3D9][DDRAW][WINED3D] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/directx/wine/d3d8/device.c trunk/reactos/dll/directx/wine/d3d8/directx.c trunk/reactos/dll/directx/wine/d3d8/swapchain.c trunk/reactos/dll/directx/wine/d3d8/vertexdeclaration.c trunk/reactos/dll/directx/wine/d3d9/device.c trunk/reactos/dll/directx/wine/d3d9/directx.c trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c trunk/reactos/dll/directx/wine/ddraw/ddraw.c trunk/reactos/dll/directx/wine/ddraw/ddraw_private.h trunk/reactos/dll/directx/wine/ddraw/device.c trunk/reactos/dll/directx/wine/ddraw/executebuffer.c trunk/reactos/dll/directx/wine/ddraw/light.c trunk/reactos/dll/directx/wine/ddraw/main.c trunk/reactos/dll/directx/wine/ddraw/material.c trunk/reactos/dll/directx/wine/ddraw/surface.c trunk/reactos/dll/directx/wine/ddraw/utils.c trunk/reactos/dll/directx/wine/ddraw/vertexbuffer.c trunk/reactos/dll/directx/wine/ddraw/viewport.c trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c trunk/reactos/dll/directx/wine/wined3d/buffer.c trunk/reactos/dll/directx/wine/wined3d/context.c trunk/reactos/dll/directx/wine/wined3d/cs.c trunk/reactos/dll/directx/wine/wined3d/device.c trunk/reactos/dll/directx/wine/wined3d/directx.c trunk/reactos/dll/directx/wine/wined3d/drawprim.c trunk/reactos/dll/directx/wine/wined3d/dxtn.c trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c trunk/reactos/dll/directx/wine/wined3d/nvidia_texture_shader.c trunk/reactos/dll/directx/wine/wined3d/query.c trunk/reactos/dll/directx/wine/wined3d/resource.c trunk/reactos/dll/directx/wine/wined3d/shader.c trunk/reactos/dll/directx/wine/wined3d/state.c trunk/reactos/dll/directx/wine/wined3d/stateblock.c trunk/reactos/dll/directx/wine/wined3d/surface.c trunk/reactos/dll/directx/wine/wined3d/swapchain.c trunk/reactos/dll/directx/wine/wined3d/texture.c trunk/reactos/dll/directx/wine/wined3d/utils.c trunk/reactos/dll/directx/wine/wined3d/vertexdeclaration.c trunk/reactos/dll/directx/wine/wined3d/view.c trunk/reactos/dll/directx/wine/wined3d/volume.c trunk/reactos/dll/directx/wine/wined3d/wined3d.spec trunk/reactos/dll/directx/wine/wined3d/wined3d_gl.h trunk/reactos/dll/directx/wine/wined3d/wined3d_main.c trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h trunk/reactos/include/reactos/wine/wgl.h trunk/reactos/include/reactos/wine/wgl_driver.h trunk/reactos/include/reactos/wine/wined3d.h trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/wine/d3d8/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/devi…
Modified: trunk/reactos/dll/directx/wine/d3d8/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/dire…
Modified: trunk/reactos/dll/directx/wine/d3d8/swapchain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/swap…
Modified: trunk/reactos/dll/directx/wine/d3d8/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/vert…
Modified: trunk/reactos/dll/directx/wine/d3d9/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/devi…
Modified: trunk/reactos/dll/directx/wine/d3d9/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/dire…
Modified: trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/vert…
Modified: trunk/reactos/dll/directx/wine/ddraw/ddraw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/ddr…
Modified: trunk/reactos/dll/directx/wine/ddraw/ddraw_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/ddr…
Modified: trunk/reactos/dll/directx/wine/ddraw/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/dev…
Modified: trunk/reactos/dll/directx/wine/ddraw/executebuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/exe…
Modified: trunk/reactos/dll/directx/wine/ddraw/light.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/lig…
Modified: trunk/reactos/dll/directx/wine/ddraw/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/mai…
Modified: trunk/reactos/dll/directx/wine/ddraw/material.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/mat…
Modified: trunk/reactos/dll/directx/wine/ddraw/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/sur…
Modified: trunk/reactos/dll/directx/wine/ddraw/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/uti…
Modified: trunk/reactos/dll/directx/wine/ddraw/vertexbuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/ver…
Modified: trunk/reactos/dll/directx/wine/ddraw/viewport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/vie…
Modified: trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
Modified: trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
Modified: trunk/reactos/dll/directx/wine/wined3d/buffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/b…
Modified: trunk/reactos/dll/directx/wine/wined3d/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/c…
Modified: trunk/reactos/dll/directx/wine/wined3d/cs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/c…
Modified: trunk/reactos/dll/directx/wine/wined3d/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/drawprim.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/dxtn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/g…
Modified: trunk/reactos/dll/directx/wine/wined3d/nvidia_texture_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/n…
Modified: trunk/reactos/dll/directx/wine/wined3d/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/q…
Modified: trunk/reactos/dll/directx/wine/wined3d/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/r…
Modified: trunk/reactos/dll/directx/wine/wined3d/shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/state.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/stateblock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/swapchain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/t…
Modified: trunk/reactos/dll/directx/wine/wined3d/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/u…
Modified: trunk/reactos/dll/directx/wine/wined3d/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/view.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_gl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/include/reactos/wine/wgl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/wgl.h…
Modified: trunk/reactos/include/reactos/wine/wgl_driver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/wgl_d…
Modified: trunk/reactos/include/reactos/wine/wined3d.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/wined…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
9 years, 5 months
1
0
0
0
[akhaldi] 68529: [D3DRM_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 21 23:33:35 2015 New Revision: 68529 URL:
http://svn.reactos.org/svn/reactos?rev=68529&view=rev
Log: [D3DRM_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/d3drm/CMakeLists.txt trunk/rostests/winetests/d3drm/d3drm.c trunk/rostests/winetests/d3drm/vector.c Modified: trunk/rostests/winetests/d3drm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/d3drm/CMakeList…
============================================================================== --- trunk/rostests/winetests/d3drm/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/d3drm/CMakeLists.txt [iso-8859-1] Tue Jul 21 23:33:35 2015 @@ -1,7 +1,7 @@ add_definitions(-DUSE_WINE_TODOS) add_executable(d3drm_winetest d3drm.c vector.c testlist.c) -target_link_libraries(d3drm_winetest dxguid) +target_link_libraries(d3drm_winetest uuid dxguid) set_module_type(d3drm_winetest win32cui) -add_importlibs(d3drm_winetest ddraw user32 msvcrt kernel32) +add_importlibs(d3drm_winetest ddraw d3drm user32 msvcrt kernel32) add_cd_file(TARGET d3drm_winetest DESTINATION reactos/bin FOR all) Modified: trunk/rostests/winetests/d3drm/d3drm.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/d3drm/d3drm.c?r…
============================================================================== --- trunk/rostests/winetests/d3drm/d3drm.c [iso-8859-1] (original) +++ trunk/rostests/winetests/d3drm/d3drm.c [iso-8859-1] Tue Jul 21 23:33:35 2015 @@ -1,6 +1,7 @@ /* * Copyright 2010, 2012 Christian Costa * Copyright 2012 André Hentschel + * Copyright 2011-2014 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,10 +26,6 @@ #include "wine/test.h" -static HMODULE d3drm_handle = 0; - -static HRESULT (WINAPI * pDirect3DRMCreate)(IDirect3DRM **d3drm); - #define CHECK_REFCOUNT(obj,rc) \ { \ int rc_new = rc; \ @@ -36,30 +33,7 @@ ok(count == rc_new, "Invalid refcount. Expected %d got %d\n", rc_new, count); \ } -#define D3DRM_GET_PROC(func) \ - p ## func = (void*)GetProcAddress(d3drm_handle, #func); \ - if(!p ## func) { \ - trace("GetProcAddress(%s) failed\n", #func); \ - FreeLibrary(d3drm_handle); \ - return FALSE; \ - } - -static BOOL InitFunctionPtrs(void) -{ - d3drm_handle = LoadLibraryA("d3drm.dll"); - - if(!d3drm_handle) - { - skip("Could not load d3drm.dll\n"); - return FALSE; - } - - D3DRM_GET_PROC(Direct3DRMCreate) - - return TRUE; -} - -static int get_refcount(IUnknown *object) +static ULONG get_refcount(IUnknown *object) { IUnknown_AddRef( object ); return IUnknown_Release( object ); @@ -241,7 +215,7 @@ D3DCOLOR color; CHAR cname[64] = {0}; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); hr = IDirect3DRM_CreateMeshBuilder(d3drm, &pMeshBuilder); @@ -473,21 +447,19 @@ hr = IDirect3DRMMesh_GetGroupMaterial(mesh, 0, &material); ok(hr == D3DRM_OK, "GetCroupMaterial failed returning hr = %x\n", hr); ok(material != NULL, "No material present\n"); - if ((hr == D3DRM_OK) && material) - { - hr = IDirect3DRMMaterial_GetEmissive(material, &values[0], &values[1], &values[2]); - ok(hr == D3DRM_OK, "GetMaterialEmissive failed returning hr = %x\n", hr); - ok(values[0] == 0.5f, "Emissive red component should be %f instead of %f\n", 0.5f, values[0]); - ok(values[1] == 0.5f, "Emissive green component should be %f instead of %f\n", 0.5f, values[1]); - ok(values[2] == 0.5f, "Emissive blue component should be %f instead of %f\n", 0.5f, values[2]); - hr = IDirect3DRMMaterial_GetSpecular(material, &values[0], &values[1], &values[2]); - ok(hr == D3DRM_OK, "GetMaterialEmissive failed returning hr = %x\n", hr); - ok(values[0] == 1.0f, "Specular red component should be %f instead of %f\n", 1.0f, values[0]); - ok(values[1] == 0.0f, "Specular green component should be %f instead of %f\n", 0.0f, values[1]); - ok(values[2] == 0.0f, "Specular blue component should be %f instead of %f\n", 0.0f, values[2]); - values[0] = IDirect3DRMMaterial_GetPower(material); - ok(values[0] == 30.0f, "Power value should be %f instead of %f\n", 30.0f, values[0]); - } + hr = IDirect3DRMMaterial_GetEmissive(material, &values[0], &values[1], &values[2]); + ok(hr == D3DRM_OK, "Failed to get emissive color, hr %#x.\n", hr); + ok(values[0] == 0.5f, "Got unexpected red component %.8e.\n", values[0]); + ok(values[1] == 0.5f, "Got unexpected green component %.8e.\n", values[1]); + ok(values[2] == 0.5f, "Got unexpected blue component %.8e.\n", values[2]); + hr = IDirect3DRMMaterial_GetSpecular(material, &values[0], &values[1], &values[2]); + ok(hr == D3DRM_OK, "Failed to get specular color, hr %#x.\n", hr); + ok(values[0] == 1.0f, "Got unexpected red component %.8e.\n", values[0]); + ok(values[1] == 0.0f, "Got unexpected green component %.8e.\n", values[1]); + ok(values[2] == 0.0f, "Got unexpected blue component %.8e.\n", values[2]); + values[0] = IDirect3DRMMaterial_GetPower(material); + ok(values[0] == 30.0f, "Got unexpected power value %.8e.\n", values[0]); + IDirect3DRMMaterial_Release(material); IDirect3DRMMesh_Release(mesh); } @@ -537,7 +509,7 @@ DWORD size; CHAR cname[64] = {0}; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); if (FAILED(hr = IDirect3DRM_QueryInterface(d3drm, &IID_IDirect3DRM3, (void **)&d3drm3))) @@ -643,7 +615,7 @@ DWORD size; CHAR cname[64] = {0}; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); hr = IDirect3DRM_CreateMesh(d3drm, &mesh); @@ -684,7 +656,7 @@ CHAR cname[64] = {0}; int icount; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); hr = IDirect3DRM_CreateFace(d3drm, &face1); @@ -852,7 +824,7 @@ ok(count == 4, "count = %u\n", count); hr = IDirect3DRMFaceArray_GetElement(array1, 1, &face); ok(hr == D3DRM_OK, "Cannot get face (hr = %x)\n", hr); - IDirect3DRMFace_GetVertices(face, &count, v2, n2); + hr = IDirect3DRMFace_GetVertices(face, &count, v2, n2); ok(hr == D3DRM_OK, "Cannot get vertices information (hr = %x)\n", hr); ok(count == 3, "Wrong number of vertices %d (must be 3)\n", count); ok(U1(v2[0]).x == U1(v1[0]).x, "Wrong component v2[0].x = %f (expected %f)\n", @@ -924,7 +896,7 @@ DWORD count; CHAR cname[64] = {0}; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); hr = IDirect3DRM_CreateFrame(d3drm, NULL, &pFrameC); @@ -1256,7 +1228,7 @@ window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0); GetClientRect(window, &rc); - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); hr = DirectDrawCreateClipper(0, &pClipper, NULL); @@ -1307,7 +1279,7 @@ DWORD size; CHAR cname[64] = {0}; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); hr = IDirect3DRM_CreateLightRGB(d3drm, D3DRMLIGHT_SPOT, 0.5, 0.5, 0.5, &light); @@ -1362,7 +1334,7 @@ DWORD size; CHAR cname[64] = {0}; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); if (FAILED(hr = IDirect3DRM_QueryInterface(d3drm, &IID_IDirect3DRM3, (void **)&d3drm3))) @@ -1446,7 +1418,7 @@ DWORD size; CHAR cname[64] = {0}; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); initimg.buffer1 = &pixel; @@ -1487,7 +1459,7 @@ window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0); GetClientRect(window, &rc); - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); hr = DirectDrawCreateClipper(0, &pClipper, NULL); @@ -1550,7 +1522,7 @@ IDirect3DRMFrame *frame; D3DRMMATRIX4D matrix; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); hr = IDirect3DRM_CreateFrame(d3drm, NULL, &frame); @@ -1588,7 +1560,7 @@ D3DRMLOADMEMORY info; const GUID* req_refiids[] = { &IID_IDirect3DRMMeshBuilder, &IID_IDirect3DRMFrame, &IID_IDirect3DRMMaterial }; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); info.lpMemory = data_d3drm_load; @@ -1664,7 +1636,7 @@ IDirect3DRMTexture *texture; int i; - hr = pDirect3DRMCreate(&d3drm); + hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Direct3DRMCreate returned %x\n", hr); info.lpMemory = data_frame_mesh_materials; @@ -1726,11 +1698,842 @@ IDirect3DRM_Release(d3drm); } +struct qi_test +{ + REFIID iid; + REFIID refcount_iid; + HRESULT hr; +}; + +static void test_qi(const char *test_name, IUnknown *base_iface, + REFIID refcount_iid, const struct qi_test *tests, UINT entry_count) +{ + ULONG refcount, expected_refcount; + IUnknown *iface1, *iface2; + HRESULT hr; + UINT i, j; + + for (i = 0; i < entry_count; ++i) + { + hr = IUnknown_QueryInterface(base_iface, tests[i].iid, (void **)&iface1); + ok(hr == tests[i].hr, "Got hr %#x for test \"%s\" %u.\n", hr, test_name, i); + if (SUCCEEDED(hr)) + { + for (j = 0; j < entry_count; ++j) + { + hr = IUnknown_QueryInterface(iface1, tests[j].iid, (void **)&iface2); + ok(hr == tests[j].hr, "Got hr %#x for test \"%s\" %u, %u.\n", hr, test_name, i, j); + if (SUCCEEDED(hr)) + { + expected_refcount = 0; + if (IsEqualGUID(refcount_iid, tests[j].refcount_iid)) + ++expected_refcount; + if (IsEqualGUID(tests[i].refcount_iid, tests[j].refcount_iid)) + ++expected_refcount; + refcount = IUnknown_Release(iface2); + ok(refcount == expected_refcount, "Got refcount %u for test \"%s\" %u, %u, expected %u.\n", + refcount, test_name, i, j, expected_refcount); + } + } + + expected_refcount = 0; + if (IsEqualGUID(refcount_iid, tests[i].refcount_iid)) + ++expected_refcount; + refcount = IUnknown_Release(iface1); + ok(refcount == expected_refcount, "Got refcount %u for test \"%s\" %u, expected %u.\n", + refcount, test_name, i, expected_refcount); + } + } +} + +static void test_d3drm_qi(void) +{ + static const struct qi_test tests[] = + { + { &IID_IDirect3DRM3, &IID_IDirect3DRM3, S_OK, }, + { &IID_IDirect3DRM2, &IID_IDirect3DRM2, S_OK, }, + { &IID_IDirect3DRM, &IID_IDirect3DRM, S_OK, }, + { &IID_IDirect3DRMDevice, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObject, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObject2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDevice2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDevice3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewport, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewport2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFrame, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFrame2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFrame3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMVisual, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMesh, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFace, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFace2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMLight, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMWrap, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMaterial, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMaterial2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimation, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimation2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationSet, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationSet2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObjectArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDeviceArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewportArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFrameArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMVisualArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMLightArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMPickedArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFaceArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMUserVisual, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMShadow, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMShadow2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMInterpolator, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMProgressiveMesh, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMPicked2Array, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMClippedVisual, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawClipper, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface7, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface4, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice7, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D7, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw7, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw4, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DLight, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IUnknown, &IID_IDirect3DRM, S_OK }, + }; + HRESULT hr; + IDirect3DRM *d3drm; + + hr = Direct3DRMCreate(&d3drm); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); + + test_qi("d3drm_qi", (IUnknown *)d3drm, &IID_IDirect3DRM, tests, sizeof(tests) / sizeof(*tests)); + + IDirect3DRM_Release(d3drm); +} + +static void test_frame_qi(void) +{ + static const struct qi_test tests[] = + { + { &IID_IDirect3DRMFrame3, &IID_IUnknown, S_OK }, + { &IID_IDirect3DRMFrame2, &IID_IUnknown, S_OK }, + { &IID_IDirect3DRMFrame, &IID_IUnknown, S_OK }, + { &IID_IDirect3DRM, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDevice, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObject, &IID_IUnknown, S_OK }, + { &IID_IDirect3DRMDevice2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDevice3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewport, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewport2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRM3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRM2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMVisual, &IID_IUnknown, S_OK }, + { &IID_IDirect3DRMMesh, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFace, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFace2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMLight, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMWrap, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMaterial, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMaterial2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimation, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimation2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationSet, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationSet2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObjectArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDeviceArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewportArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFrameArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMVisualArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMLightArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMPickedArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFaceArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationArray, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMUserVisual, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMShadow, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMShadow2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMInterpolator, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMProgressiveMesh, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMPicked2Array, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMClippedVisual, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawClipper, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface7, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface4, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice7, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D7, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw7, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw4, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw3, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw2, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DLight, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IUnknown, &IID_IUnknown, S_OK }, + }; + HRESULT hr; + IDirect3DRM *d3drm1; + IDirect3DRM2 *d3drm2; + IDirect3DRM3 *d3drm3; + IDirect3DRMFrame *frame1; + IDirect3DRMFrame2 *frame2; + IDirect3DRMFrame3 *frame3; + IUnknown *unknown; + + hr = Direct3DRMCreate(&d3drm1); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); + + hr = IDirect3DRM_CreateFrame(d3drm1, NULL, &frame1); + ok(hr == D3DRM_OK, "Failed to create frame1 (hr = %x)\n", hr); + IDirect3DRMFrame_QueryInterface(frame1, &IID_IUnknown, (void **)&unknown); + ok(hr == D3DRM_OK, "Failed to create IUnknown from frame1 (hr = %x)\n", hr); + IDirect3DRMFrame_Release(frame1); + test_qi("frame1_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + IUnknown_Release(unknown); + + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM2 interface (hr = %x).\n", hr); + hr = IDirect3DRM2_CreateFrame(d3drm2, NULL, &frame2); + ok(hr == D3DRM_OK, "Failed to create frame2 (hr = %x)\n", hr); + IDirect3DRMFrame2_QueryInterface(frame2, &IID_IUnknown, (void **)&unknown); + ok(hr == D3DRM_OK, "Failed to create IUnknown from frame2 (hr = %x)\n", hr); + IDirect3DRMFrame2_Release(frame2); + test_qi("frame2_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + IUnknown_Release(unknown); + + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM3 interface (hr = %x).\n", hr); + hr = IDirect3DRM3_CreateFrame(d3drm3, NULL, &frame3); + ok(hr == D3DRM_OK, "Failed to create frame3 (hr = %x)\n", hr); + IDirect3DRMFrame3_QueryInterface(frame3, &IID_IUnknown, (void **)&unknown); + ok(hr == D3DRM_OK, "Failed to create IUnknown from frame3 (hr = %x)\n", hr); + IDirect3DRMFrame3_Release(frame3); + test_qi("frame3_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + IUnknown_Release(unknown); + + IDirect3DRM3_Release(d3drm3); + IDirect3DRM2_Release(d3drm2); + IDirect3DRM_Release(d3drm1); +} + +static HRESULT CALLBACK surface_callback(IDirectDrawSurface *surface, DDSURFACEDESC *desc, void *context) +{ + IDirectDrawSurface **primary = context; + + if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + { + *primary = surface; + return DDENUMRET_CANCEL; + } + IDirectDrawSurface_Release(surface); + + return DDENUMRET_OK; +} + +static void test_create_device_from_clipper(void) +{ + DDSCAPS caps = { DDSCAPS_ZBUFFER }; + IDirect3DRM *d3drm1 = NULL; + IDirect3DRM2 *d3drm2 = NULL; + IDirectDraw *ddraw = NULL; + IUnknown *unknown = NULL; + IDirect3DRMDevice2 *device2 = NULL; + IDirect3DDevice2 *d3ddevice2 = NULL; + IDirectDrawClipper *clipper = NULL, *d3drm_clipper = NULL; + IDirectDrawSurface *surface = NULL, *ds = NULL, *d3drm_primary = NULL; + IDirectDrawSurface7 *surface7 = NULL; + DDSURFACEDESC desc, surface_desc; + DWORD expected_flags; + HWND window; + GUID driver = IID_IDirect3DRGBDevice; + HRESULT hr; + ULONG ref1, ref2, ref3, cref1, cref2; + RECT rc; + + window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 500, 400, 0, 0, 0, 0); + GetClientRect(window, &rc); + hr = DirectDrawCreateClipper(0, &clipper, NULL); + ok(hr == DD_OK, "Cannot get IDirectDrawClipper interface (hr = %x).\n", hr); + hr = IDirectDrawClipper_SetHWnd(clipper, 0, window); + ok(hr == DD_OK, "Cannot set HWnd to Clipper (hr = %x).\n", hr); + + hr = Direct3DRMCreate(&d3drm1); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x).\n", hr); + ref1 = get_refcount((IUnknown *)d3drm1); + cref1 = get_refcount((IUnknown *)clipper); + + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM2 interface (hr = %x).\n", hr); + ref2 = get_refcount((IUnknown *)d3drm2); + + hr = IDirect3DRM2_CreateDeviceFromClipper(d3drm2, clipper, &driver, 0, 0, &device2); + todo_wine ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %x.\n", hr); + + /* If NULL is passed for clipper, CreateDeviceFromClipper returns D3DRMERR_BADVALUE */ + hr = IDirect3DRM2_CreateDeviceFromClipper(d3drm2, NULL, &driver, 0, 0, &device2); + todo_wine ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %x.\n", hr); + + hr = IDirect3DRM2_CreateDeviceFromClipper(d3drm2, clipper, &driver, 300, 200, &device2); + ok(hr == D3DRM_OK, "Cannot create IDirect3DRMDevice2 interface (hr = %x).\n", hr); + ref3 = get_refcount((IUnknown *)d3drm1); + todo_wine ok(ref3 > ref1, "expected ref3 > ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); + cref2 = get_refcount((IUnknown *)clipper); + todo_wine ok(cref2 > cref1, "expected cref2 > cref1, got cref1 = %u , cref2 = %u.\n", cref1, cref2); + + /* Fetch immediate mode device in order to access render target */ + hr = IDirect3DRMDevice2_GetDirect3DDevice2(device2, &d3ddevice2); + todo_wine ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice2 interface (hr = %x).\n", hr); + if (FAILED(hr)) + goto cleanup; + + hr = IDirect3DDevice2_GetRenderTarget(d3ddevice2, &surface); + ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x).\n", hr); + + hr = IDirectDrawSurface_GetClipper(surface, &d3drm_clipper); + ok(hr == DDERR_NOCLIPPERATTACHED, "Expected hr == DDERR_NOCLIPPERATTACHED, got %x.\n", hr); + + /* Check if CreateDeviceFromClipper creates a primary surface and attaches the clipper to it */ + hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface7, (void **)&surface7); + ok(hr == DD_OK, "Cannot get IDirectDrawSurface7 interface (hr = %x).\n", hr); + IDirectDrawSurface7_GetDDInterface(surface7, (void **)&unknown); + hr = IUnknown_QueryInterface(unknown, &IID_IDirectDraw, (void **)&ddraw); + ok(hr == DD_OK, "Cannot get IDirectDraw interface (hr = %x).\n", hr); + IUnknown_Release(unknown); + hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST, + NULL, &d3drm_primary, surface_callback); + ok(hr == DD_OK, "Failed to enumerate surfaces (hr = %x).\n", hr); + ok(d3drm_primary != NULL, "No primary surface was enumerated.\n"); + hr = IDirectDrawSurface_GetClipper(d3drm_primary, &d3drm_clipper); + ok(hr == DD_OK, "Cannot get attached clipper from primary surface (hr = %x).\n", hr); + if (SUCCEEDED(hr)) + { + ok(d3drm_clipper == clipper, "Expected clipper returned == %p, got %p.\n", clipper , d3drm_clipper); + IDirectDrawClipper_Release(d3drm_clipper); + } + if (d3drm_primary) + IDirectDrawSurface_Release(d3drm_primary); + IDirectDrawSurface7_Release(surface7); + IDirectDraw_Release(ddraw); + + /* Check properties of render target and depth surface */ + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); + ok(hr == DD_OK, "Cannot get surface desc structure (hr = %x).\n", hr); + + ok((surface_desc.dwWidth == 300) && (surface_desc.dwHeight == 200), "Expected surface dimensions = 300, 200, got %u, %u.\n", + surface_desc.dwWidth, surface_desc.dwHeight); + ok((surface_desc.ddsCaps.dwCaps & (DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE)) == (DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE), + "Expected caps containing %x, got %x.\n", DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE, surface_desc.ddsCaps.dwCaps); + expected_flags = DDSD_PIXELFORMAT | DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH; + ok(surface_desc.dwFlags == expected_flags, "Expected %x for flags, got %x.\n", expected_flags, surface_desc.dwFlags); + + hr = DirectDrawCreate(NULL, &ddraw, NULL); + ok(hr == DD_OK, "Cannot get IDirectDraw interface (hr = %x).\n", hr); + desc.dwSize = sizeof(desc); + hr = IDirectDraw_GetDisplayMode(ddraw, &desc); + ok(hr == DD_OK, "Cannot get IDirectDraw display mode (hr = %x)\n", hr); + ok(desc.ddpfPixelFormat.dwRGBBitCount == surface_desc.ddpfPixelFormat.dwRGBBitCount, "Expected %u bpp, got %u bpp.\n", + surface_desc.ddpfPixelFormat.dwRGBBitCount, desc.ddpfPixelFormat.dwRGBBitCount); + + hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds); + ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x).\n", hr); + + desc.dwSize = sizeof(desc); + hr = IDirectDrawSurface_GetSurfaceDesc(ds, &desc); + ok(hr == DD_OK, "Cannot get z surface desc structure (hr = %x).\n", hr); + + ok((desc.dwWidth == 300) && (desc.dwHeight == 200), "Expected surface dimensions = 300, 200, got %u, %u.\n", + desc.dwWidth, desc.dwHeight); + ok((desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER) == DDSCAPS_ZBUFFER, "Expected caps containing %x, got %x.\n", DDSCAPS_ZBUFFER, desc.ddsCaps.dwCaps); + expected_flags = DDSD_ZBUFFERBITDEPTH | DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH; + ok(desc.dwFlags == expected_flags, "Expected %x for flags, got %x.\n", expected_flags, desc.dwFlags); + ok(desc.dwZBufferBitDepth == 16, "Expected 16 for Z buffer bit depth, got %u.\n", desc.dwZBufferBitDepth); + ok(desc.ddpfPixelFormat.dwStencilBitMask == 0, "Expected 0 stencil bits, got %x.\n", desc.ddpfPixelFormat.dwStencilBitMask); + + /* Release old objects and check refcount of device and clipper */ + IDirectDrawSurface_Release(ds); + ds = NULL; + IDirectDrawSurface_Release(surface); + surface = NULL; + IDirect3DDevice2_Release(d3ddevice2); + d3ddevice2 = NULL; + IDirect3DRMDevice2_Release(device2); + ref3 = get_refcount((IUnknown *)d3drm1); + ok(ref1 == ref3, "expected ref1 == ref3, got ref1 = %u, ref3 = %u.\n", ref1, ref3); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); + cref2 = get_refcount((IUnknown *)clipper); + todo_wine ok(cref1 == cref2, "expected cref1 == cref2, got cref1 = %u, cref2 = %u.\n", cref1, cref2); + + /* Test if render target format follows the screen format */ + hr = IDirectDraw_GetDisplayMode(ddraw, &desc); + ok(hr == DD_OK, "Cannot get IDirectDraw display mode (hr = %x)\n", hr); + hr = IDirectDraw_SetDisplayMode(ddraw, desc.dwWidth, desc.dwHeight, 16); + ok(hr == DD_OK, "Cannot set display mode to 16bpp (hr = %x).\n", hr); + + hr = IDirectDraw_GetDisplayMode(ddraw, &desc); + ok(hr == DD_OK, "Cannot get IDirectDraw display mode (hr = %x)\n", hr); + ok(desc.ddpfPixelFormat.dwRGBBitCount == 16, "Expected 16 bpp, got %u.\n", desc.ddpfPixelFormat.dwRGBBitCount); + + hr = IDirect3DRM2_CreateDeviceFromClipper(d3drm2, clipper, &driver, rc.right, rc.bottom, &device2); + ok(hr == D3DRM_OK, "Cannot create IDirect3DRMDevice2 interface (hr = %x).\n", hr); + + hr = IDirect3DRMDevice2_GetDirect3DDevice2(device2, &d3ddevice2); + todo_wine ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice2 interface (hr = %x).\n", hr); + if (FAILED(hr)) + goto cleanup; + + hr = IDirect3DDevice2_GetRenderTarget(d3ddevice2, &surface); + ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x).\n", hr); + + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); + ok(hr == DD_OK, "Cannot get surface desc structure (hr = %x).\n", hr); + todo_wine ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == 16, "Expected 16bpp, got %ubpp.\n", + surface_desc.ddpfPixelFormat.dwRGBBitCount); + + hr = IDirectDraw2_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr); + +cleanup: + if (ds) + IDirectDrawSurface_Release(ds); + if (surface) + IDirectDrawSurface_Release(surface); + if (d3ddevice2) + IDirect3DDevice2_Release(d3ddevice2); + if (device2) + IDirect3DRMDevice2_Release(device2); + if (d3drm2) + IDirect3DRM2_Release(d3drm2); + if (d3drm1) + IDirect3DRM_Release(d3drm1); + if (clipper) + IDirectDrawClipper_Release(clipper); + if (ddraw) + IDirectDraw_Release(ddraw); + DestroyWindow(window); +} + +static void test_create_device_from_surface(void) +{ + DDSCAPS caps = { DDSCAPS_ZBUFFER }; + DDSURFACEDESC desc; + IDirectDraw *ddraw = NULL; + IDirect3DRM *d3drm1 = NULL; + IDirect3DRM2 *d3drm2 = NULL; + IDirect3DRMDevice2 *device2 = NULL; + IDirect3DDevice2 *d3ddevice2 = NULL; + IDirectDrawSurface *surface = NULL, *ds = NULL, *d3drm_surface = NULL, *d3drm_ds = NULL; + DWORD expected_flags; + HWND window; + GUID driver = IID_IDirect3DRGBDevice; + ULONG ref1, ref2, ref3, surface_ref1, surface_ref2; + RECT rc; + BOOL use_sysmem_zbuffer = FALSE; + HRESULT hr; + + hr = DirectDrawCreate(NULL, &ddraw, NULL); + ok(hr == DD_OK, "Cannot get IDirectDraw interface (hr = %x).\n", hr); + + window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0); + GetClientRect(window, &rc); + + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + hr = Direct3DRMCreate(&d3drm1); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x).\n", hr); + ref1 = get_refcount((IUnknown *)d3drm1); + + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM2 interface (hr = %x).\n", hr); + ref2 = get_refcount((IUnknown *)d3drm2); + + /* Create a surface and use it to create the retained mode device. */ + memset(&desc, 0, sizeof(desc)); + desc.dwSize = sizeof(desc); + desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + desc.dwWidth = rc.right; + desc.dwHeight = rc.bottom; + + hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirect3DRM2_CreateDeviceFromSurface(d3drm2, &driver, ddraw, surface, &device2); + todo_wine ok(hr == DDERR_INVALIDCAPS, "Expected hr == DDERR_INVALIDCAPS, got %x.\n", hr); + IDirectDrawSurface_Release(surface); + + desc.ddsCaps.dwCaps |= DDSCAPS_3DDEVICE; + hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + surface_ref1 = get_refcount((IUnknown *)surface); + hr = IDirect3DRM2_CreateDeviceFromSurface(d3drm2, &driver, ddraw, surface, &device2); + ok(SUCCEEDED(hr), "Cannot create IDirect3DRMDevice2 interface (hr = %x).\n", hr); + ref3 = get_refcount((IUnknown *)d3drm1); + todo_wine ok(ref3 > ref1, "expected ref3 > ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); + surface_ref2 = get_refcount((IUnknown *)surface); + todo_wine ok(surface_ref2 > surface_ref1, "Expected surface_ref2 > surface_ref1, got surface_ref1 = %u, surface_ref2 = %u.\n", + surface_ref1, surface_ref2); + + /* Check if CreateDeviceFromSurface creates a primary surface */ + hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST, + NULL, &d3drm_surface, surface_callback); + ok(hr == DD_OK, "Failed to enumerate surfaces (hr = %x).\n", hr); + ok(d3drm_surface == NULL, "No primary surface should have enumerated (%p).\n", d3drm_surface); + + hr = IDirect3DRMDevice2_GetDirect3DDevice2(device2, &d3ddevice2); + todo_wine ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice2 interface (hr = %x).\n", hr); + if (FAILED(hr)) + goto cleanup; + + hr = IDirect3DDevice2_GetRenderTarget(d3ddevice2, &d3drm_surface); + ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x).\n", hr); + ok(surface == d3drm_surface, "Expected surface returned == %p, got %p.\n", surface, d3drm_surface); + + /* Check properties of attached depth surface */ + hr = IDirectDrawSurface_GetAttachedSurface(d3drm_surface, &caps, &ds); + ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x).\n", hr); + + memset(&desc, 0, sizeof(desc)); + desc.dwSize = sizeof(desc); + hr = IDirectDrawSurface_GetSurfaceDesc(ds, &desc); + ok(hr == DD_OK, "Cannot get z surface desc structure (hr = %x).\n", hr); + + use_sysmem_zbuffer = desc.ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY; + ok((desc.dwWidth == rc.right) && (desc.dwHeight == rc.bottom), "Expected surface dimentions = %u, %u, got %u, %u.\n", + rc.right, rc.bottom, desc.dwWidth, desc.dwHeight); + ok(desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER, "Expected caps containing %x, got %x.\n", DDSCAPS_ZBUFFER, desc.ddsCaps.dwCaps); + expected_flags = DDSD_ZBUFFERBITDEPTH | DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH; + ok(desc.dwFlags == expected_flags, "Expected %x for flags, got %x.\n", expected_flags, desc.dwFlags); + + IDirectDrawSurface_Release(ds); + IDirect3DDevice2_Release(d3ddevice2); + IDirectDrawSurface_Release(d3drm_surface); + if (device2) + { + IDirect3DRMDevice2_Release(device2); + ref3 = get_refcount((IUnknown *)d3drm1); + ok(ref1 == ref3, "expected ref1 == ref3, got ref1 = %u, ref3 = %u.\n", ref1, ref3); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); + surface_ref2 = get_refcount((IUnknown *)surface); + ok(surface_ref2 == surface_ref1, "Expected surface_ref2 == surface_ref1, got surface_ref1 = %u, surface_ref2 = %u.\n", + surface_ref1, surface_ref2); + hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds); + ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x).\n", hr); + + /*The render target still holds a reference to ds as the depth surface remains attached to it, so refcount will be 1*/ + ref1 = IDirectDrawSurface_Release(ds); + ok(ref1 == 1, "Expected ref1 == 1, got %u.\n", ref1); + } + ref1 = IDirectDrawSurface_Release(surface); + ok(ref1 == 0, "Expected Render target refcount == 0, got %u.\n", ref1); + + memset(&desc, 0, sizeof(desc)); + desc.dwSize = sizeof(desc); + desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + desc.dwWidth = rc.right; + desc.dwHeight = rc.bottom; + + hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + memset(&desc, 0, sizeof(desc)); + desc.dwSize = sizeof(desc); + desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT; + desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | (use_sysmem_zbuffer ? DDSCAPS_SYSTEMMEMORY : 0); + desc.dwZBufferBitDepth = 16; + desc.dwWidth = rc.right; + desc.dwHeight = rc.bottom; + hr = IDirectDraw_CreateSurface(ddraw, &desc, &ds, NULL); + ok(hr == DD_OK, "Cannot create depth surface (hr = %x).\n", hr); + hr = IDirectDrawSurface_AddAttachedSurface(surface, ds); + ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr); + + hr = IDirect3DRM2_CreateDeviceFromSurface(d3drm2, &driver, ddraw, surface, &device2); + ok(SUCCEEDED(hr), "Cannot create IDirect3DRMDevice2 interface (hr = %x).\n", hr); + + hr = IDirect3DRMDevice2_GetDirect3DDevice2(device2, &d3ddevice2); + todo_wine ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice2 interface (hr = %x).\n", hr); + if (FAILED(hr)) + goto cleanup; + + hr = IDirect3DDevice2_GetRenderTarget(d3ddevice2, &d3drm_surface); + ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x).\n", hr); + ok(surface == d3drm_surface, "Expected surface returned == %p, got %p.\n", surface, d3drm_surface); + + /* Check if depth surface matches the one we created */ + hr = IDirectDrawSurface_GetAttachedSurface(d3drm_surface, &caps, &d3drm_ds); + ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x).\n", hr); + ok(ds == d3drm_ds, "Expected depth surface (%p) == surface created internally (%p).\n", ds, d3drm_ds); + + IDirectDrawSurface_Release(d3drm_ds); + IDirectDrawSurface_Release(d3drm_surface); + IDirectDrawSurface_Release(ds); + +cleanup: + if (d3ddevice2) + IDirect3DDevice2_Release(d3ddevice2); + if (device2) + { + IDirect3DRMDevice2_Release(device2); + hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds); + todo_wine ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x).\n", hr); + if (SUCCEEDED(hr)) + { + /*The render target still holds a reference to ds as the depth surface remains attached to it, so refcount will be 1*/ + ref1 = IDirectDrawSurface_Release(ds); + ok(ref1 == 1, "Expected ref1 == 1, got %u.\n", ref1); + } + } + if (surface) + { + ref1 = IDirectDrawSurface_Release(surface); + ok(ref1 == 0, "Expected Render target refcount == 0, got %u.\n", ref1); + } + if (d3drm2) + IDirect3DRM2_Release(d3drm2); + if (d3drm1) + IDirect3DRM_Release(d3drm1); + if (ddraw) + IDirectDraw_Release(ddraw); + DestroyWindow(window); +} + +static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, IDirectDrawSurface **ds) +{ + static const DWORD z_depths[] = { 32, 24, 16 }; + IDirectDrawSurface *surface; + IDirect3DDevice2 *device = NULL; + DDSURFACEDESC surface_desc; + IDirect3D2 *d3d; + unsigned int i; + HRESULT hr; + RECT rc; + + GetClientRect(window, &rc); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + surface_desc.dwWidth = rc.right; + surface_desc.dwHeight = rc.bottom; + + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirect3D2, (void **)&d3d); + if (FAILED(hr)) + { + IDirectDrawSurface_Release(surface); + *ds = NULL; + return NULL; + } + + /* We used to use EnumDevices() for this, but it seems + * D3DDEVICEDESC.dwDeviceZBufferBitDepth only has a very casual + * relationship with reality. */ + for (i = 0; i < sizeof(z_depths) / sizeof(*z_depths); ++i) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + U2(surface_desc).dwZBufferBitDepth = z_depths[i]; + surface_desc.dwWidth = rc.right; + surface_desc.dwHeight = rc.bottom; + if (FAILED(IDirectDraw2_CreateSurface(ddraw, &surface_desc, ds, NULL))) + continue; + + hr = IDirectDrawSurface_AddAttachedSurface(surface, *ds); + ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr); + if (FAILED(hr)) + { + IDirectDrawSurface_Release(*ds); + continue; + } + + if (SUCCEEDED(IDirect3D2_CreateDevice(d3d, &IID_IDirect3DRGBDevice, surface, &device))) + break; + + IDirectDrawSurface_DeleteAttachedSurface(surface, 0, *ds); + IDirectDrawSurface_Release(*ds); + *ds = NULL; + } + + IDirect3D2_Release(d3d); + IDirectDrawSurface_Release(surface); + return device; +} + +static void test_create_device_from_d3d(void) +{ + IDirectDraw *ddraw1 = NULL; + IDirectDraw2 *ddraw2 = NULL; + IDirect3D2 *d3d2 = NULL; + IDirect3DRM *d3drm1 = NULL; + IDirect3DRM2 *d3drm2 = NULL; + IDirect3DRMDevice2 *device2 = NULL; + IDirect3DDevice2 *d3ddevice2 = NULL, *d3drm_d3ddevice2 = NULL; + IDirectDrawSurface *surface = NULL, *ds = NULL, *d3drm_ds = NULL; + DWORD expected_flags; + DDSCAPS caps = { DDSCAPS_ZBUFFER }; + DDSURFACEDESC desc; + RECT rc; + HWND window; + ULONG ref1, ref2, ref3, device_ref1, device_ref2; + HRESULT hr; + + hr = DirectDrawCreate(NULL, &ddraw1, NULL); + ok(hr == DD_OK, "Cannot get IDirectDraw interface (hr = %x).\n", hr); + + window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0); + GetClientRect(window, &rc); + + hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirect3D2, (void **)&d3d2); + ok(hr == DD_OK, "Cannot get IDirect3D2 interface (hr = %x).\n", hr); + hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw2); + ok(hr == DD_OK, "Cannot get IDirectDraw2 interface (hr = %x).\n", hr); + + /* Create the immediate mode device */ + d3ddevice2 = create_device(ddraw2, window, &ds); + if (d3ddevice2 == NULL) + { + win_skip("Cannot create IM device, skipping tests.\n"); + IDirect3D2_Release(d3d2); + IDirectDraw2_Release(ddraw2); + IDirectDraw_Release(ddraw1); + return; + } + device_ref1 = get_refcount((IUnknown *)d3ddevice2); + + hr = Direct3DRMCreate(&d3drm1); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x).\n", hr); + ref1 = get_refcount((IUnknown *)d3drm1); + + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); + ok(hr == D3DRM_OK, "Cannot get IDirect3DRM2 interface (hr = %x).\n", hr); + ref2 = get_refcount((IUnknown *)d3drm2); + + hr = IDirect3DRM2_CreateDeviceFromD3D(d3drm2, d3d2, d3ddevice2, &device2); + ok(hr == DD_OK, "Failed to create IDirect3DRMDevice2 interface (hr = %x)\n", hr); + ref3 = get_refcount((IUnknown *)d3drm1); + todo_wine ok(ref3 > ref1, "expected ref3 > ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); + device_ref2 = get_refcount((IUnknown *)d3ddevice2); + todo_wine ok(device_ref2 > device_ref1, "Expected device_ref2 > device_ref1, got device_ref1 = %u, device_ref2 = %u.\n", device_ref1, device_ref2); + + hr = IDirectDraw_EnumSurfaces(ddraw1, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST, + NULL, &surface, surface_callback); + ok(hr == DD_OK, "Failed to enumerate surfaces (hr = %x).\n", hr); + ok(surface == NULL, "No primary surface should have enumerated (%p).\n", surface); + + hr = IDirect3DRMDevice2_GetDirect3DDevice2(device2, &d3drm_d3ddevice2); + todo_wine ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice2 interface (hr = %x).\n", hr); + if (FAILED(hr)) + goto cleanup; + ok(d3ddevice2 == d3drm_d3ddevice2, "Expected Immediate Mode deivce created == %p, got %p.\n", d3ddevice2, d3drm_d3ddevice2); + + /* Check properties of render target and depth surfaces */ + hr = IDirect3DDevice2_GetRenderTarget(d3drm_d3ddevice2, &surface); + ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x).\n", hr); + + memset(&desc, 0, sizeof(desc)); + desc.dwSize = sizeof(desc); + hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc); + ok(hr == DD_OK, "Cannot get surface desc structure (hr = %x).\n", hr); + + ok((desc.dwWidth == rc.right) && (desc.dwHeight == rc.bottom), "Expected surface dimentions = %u, %u, got %u, %u.\n", + rc.right, rc.bottom, desc.dwWidth, desc.dwHeight); + ok((desc.ddsCaps.dwCaps & (DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE)) == (DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE), + "Expected caps containing %x, got %x.\n", DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE, desc.ddsCaps.dwCaps); + expected_flags = DDSD_PIXELFORMAT | DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH; + ok(desc.dwFlags == expected_flags, "Expected %x for flags, got %x.\n", expected_flags, desc.dwFlags); + + hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &d3drm_ds); + ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x).\n", hr); + ok(ds == d3drm_ds, "Expected depth surface (%p) == surface created internally (%p).\n", ds, d3drm_ds); + + desc.dwSize = sizeof(desc); + hr = IDirectDrawSurface_GetSurfaceDesc(ds, &desc); + ok(hr == DD_OK, "Cannot get z surface desc structure (hr = %x).\n", hr); + + ok((desc.dwWidth == rc.right) && (desc.dwHeight == rc.bottom), "Expected surface dimentions = %u, %u, got %u, %u.\n", + rc.right, rc.bottom, desc.dwWidth, desc.dwHeight); + ok((desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER) == DDSCAPS_ZBUFFER, "Expected caps containing %x, got %x.\n", DDSCAPS_ZBUFFER, desc.ddsCaps.dwCaps); + expected_flags = DDSD_ZBUFFERBITDEPTH | DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH; + ok(desc.dwFlags == expected_flags, "Expected %x for flags, got %x.\n", expected_flags, desc.dwFlags); + + IDirectDrawSurface_Release(d3drm_ds); + IDirectDrawSurface_Release(ds); + ds = NULL; + IDirectDrawSurface_Release(surface); + IDirect3DDevice2_Release(d3drm_d3ddevice2); +cleanup: + if (ds) + IDirectDrawSurface_Release(ds); + + IDirect3DRMDevice2_Release(device2); + ref3 = get_refcount((IUnknown *)d3drm1); + ok(ref1 == ref3, "expected ref1 == ref3, got ref1 = %u, ref3 = %u.\n", ref1, ref3); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); + device_ref2 = get_refcount((IUnknown *)d3ddevice2); + ok(device_ref2 == device_ref1, "Expected device_ref2 == device_ref1, got device_ref1 = %u, device_ref2 = %u.\n", device_ref1, device_ref2); + + IDirect3DRM2_Release(d3drm2); + IDirect3DRM_Release(d3drm1); + IDirect3DDevice2_Release(d3ddevice2); + IDirect3D2_Release(d3d2); + IDirectDraw2_Release(ddraw2); + IDirectDraw_Release(ddraw1); + DestroyWindow(window); +} + START_TEST(d3drm) { - if (!InitFunctionPtrs()) - return; - test_MeshBuilder(); test_MeshBuilder3(); test_Mesh(); @@ -1744,6 +2547,9 @@ test_frame_transform(); test_d3drm_load(); test_frame_mesh_materials(); - - FreeLibrary(d3drm_handle); + test_d3drm_qi(); + test_frame_qi(); + test_create_device_from_clipper(); + test_create_device_from_surface(); + test_create_device_from_d3d(); } Modified: trunk/rostests/winetests/d3drm/vector.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/d3drm/vector.c?…
============================================================================== --- trunk/rostests/winetests/d3drm/vector.c [iso-8859-1] (original) +++ trunk/rostests/winetests/d3drm/vector.c [iso-8859-1] Tue Jul 21 23:33:35 2015 @@ -66,69 +66,6 @@ "Expected Vector= (%f, %f, %f)\n , Got Vector= (%f, %f, %f)\n", \ U1(expectedvec).x,U2(expectedvec).y,U3(expectedvec).z, U1(gotvec).x, U2(gotvec).y, U3(gotvec).z); -static HMODULE d3drm_handle = 0; - -static void (WINAPI * pD3DRMMatrixFromQuaternion)(D3DRMMATRIX4D, D3DRMQUATERNION *); -static D3DVECTOR *(WINAPI *pD3DRMVectorAdd)(D3DVECTOR *, D3DVECTOR *, D3DVECTOR *); -static D3DVECTOR *(WINAPI *pD3DRMVectorCrossProduct)(D3DVECTOR *, D3DVECTOR *, D3DVECTOR *); -static D3DVALUE (WINAPI *pD3DRMVectorDotProduct)(D3DVECTOR *, D3DVECTOR *); -static D3DVALUE (WINAPI *pD3DRMVectorModulus)(D3DVECTOR *); -static D3DVECTOR *(WINAPI *pD3DRMVectorNormalize)(D3DVECTOR *); -static D3DVECTOR *(WINAPI *pD3DRMVectorReflect)(D3DVECTOR *, D3DVECTOR *, D3DVECTOR *); -static D3DVECTOR *(WINAPI *pD3DRMVectorRotate)(D3DVECTOR *, D3DVECTOR *, D3DVECTOR *, D3DVALUE); -static D3DVECTOR *(WINAPI *pD3DRMVectorScale)(D3DVECTOR *, D3DVECTOR *, D3DVALUE); -static D3DVECTOR *(WINAPI *pD3DRMVectorSubtract)(D3DVECTOR *, D3DVECTOR *, D3DVECTOR *); -static D3DRMQUATERNION *(WINAPI *pD3DRMQuaternionFromRotation)(D3DRMQUATERNION*, D3DVECTOR *, D3DVALUE); -static D3DRMQUATERNION *(WINAPI * pD3DRMQuaternionSlerp)(D3DRMQUATERNION *, - D3DRMQUATERNION *, D3DRMQUATERNION *, D3DVALUE); -static D3DCOLOR (WINAPI * pD3DRMCreateColorRGB)(D3DVALUE, D3DVALUE, D3DVALUE); -static D3DCOLOR (WINAPI * pD3DRMCreateColorRGBA)(D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE); -static D3DVALUE (WINAPI * pD3DRMColorGetAlpha)(D3DCOLOR); -static D3DVALUE (WINAPI * pD3DRMColorGetBlue)(D3DCOLOR); -static D3DVALUE (WINAPI * pD3DRMColorGetGreen)(D3DCOLOR); -static D3DVALUE (WINAPI * pD3DRMColorGetRed)(D3DCOLOR); - -#define D3DRM_GET_PROC(func) \ - p ## func = (void*)GetProcAddress(d3drm_handle, #func); \ - if(!p ## func) { \ - trace("GetProcAddress(%s) failed\n", #func); \ - FreeLibrary(d3drm_handle); \ - return FALSE; \ - } - -static BOOL InitFunctionPtrs(void) -{ - d3drm_handle = LoadLibraryA("d3drm.dll"); - - if(!d3drm_handle) - { - skip("Could not load d3drm.dll\n"); - return FALSE; - } - - D3DRM_GET_PROC(D3DRMMatrixFromQuaternion) - D3DRM_GET_PROC(D3DRMVectorAdd) - D3DRM_GET_PROC(D3DRMVectorCrossProduct) - D3DRM_GET_PROC(D3DRMVectorDotProduct) - D3DRM_GET_PROC(D3DRMVectorModulus) - D3DRM_GET_PROC(D3DRMVectorNormalize) - D3DRM_GET_PROC(D3DRMVectorReflect) - D3DRM_GET_PROC(D3DRMVectorRotate) - D3DRM_GET_PROC(D3DRMVectorScale) - D3DRM_GET_PROC(D3DRMVectorSubtract) - D3DRM_GET_PROC(D3DRMQuaternionFromRotation) - D3DRM_GET_PROC(D3DRMQuaternionSlerp) - D3DRM_GET_PROC(D3DRMCreateColorRGB) - D3DRM_GET_PROC(D3DRMCreateColorRGBA) - D3DRM_GET_PROC(D3DRMColorGetAlpha) - D3DRM_GET_PROC(D3DRMColorGetBlue) - D3DRM_GET_PROC(D3DRMColorGetGreen) - D3DRM_GET_PROC(D3DRMColorGetRed) - - return TRUE; -} - - static void VectorTest(void) { D3DVALUE mod,par,theta; @@ -139,52 +76,52 @@ /*______________________VectorAdd_________________________________*/ - pD3DRMVectorAdd(&r,&u,&v); + D3DRMVectorAdd(&r,&u,&v); U1(e).x=6.0f; U2(e).y=6.0f; U3(e).z=1.0f; expect_vec(e,r); U1(self).x=9.0f; U2(self).y=18.0f; U3(self).z=27.0f; - pD3DRMVectorAdd(&self,&self,&u); + D3DRMVectorAdd(&self,&self,&u); U1(e).x=11.0f; U2(e).y=20.0f; U3(e).z=28.0f; expect_vec(e,self); /*_______________________VectorSubtract__________________________*/ - pD3DRMVectorSubtract(&r,&u,&v); + D3DRMVectorSubtract(&r,&u,&v); U1(e).x=-2.0f; U2(e).y=-2.0f; U3(e).z=1.0f; expect_vec(e,r); U1(self).x=9.0f; U2(self).y=18.0f; U3(self).z=27.0f; - pD3DRMVectorSubtract(&self,&self,&u); + D3DRMVectorSubtract(&self,&self,&u); U1(e).x=7.0f; U2(e).y=16.0f; U3(e).z=26.0f; expect_vec(e,self); /*_______________________VectorCrossProduct_______________________*/ - pD3DRMVectorCrossProduct(&r,&u,&v); + D3DRMVectorCrossProduct(&r,&u,&v); U1(e).x=-4.0f; U2(e).y=4.0f; U3(e).z=0.0f; expect_vec(e,r); U1(self).x=9.0f; U2(self).y=18.0f; U3(self).z=27.0f; - pD3DRMVectorCrossProduct(&self,&self,&u); + D3DRMVectorCrossProduct(&self,&self,&u); U1(e).x=-36.0f; U2(e).y=45.0f; U3(e).z=-18.0f; expect_vec(e,self); /*_______________________VectorDotProduct__________________________*/ - mod=pD3DRMVectorDotProduct(&u,&v); + mod=D3DRMVectorDotProduct(&u,&v); ok((mod == 16.0f), "Expected 16.0f, Got %f\n", mod); /*_______________________VectorModulus_____________________________*/ - mod=pD3DRMVectorModulus(&u); + mod=D3DRMVectorModulus(&u); ok((mod == 3.0f), "Expected 3.0f, Got %f\n", mod); /*_______________________VectorNormalize___________________________*/ - pD3DRMVectorNormalize(&u); + D3DRMVectorNormalize(&u); U1(e).x=2.0f/3.0f; U2(e).y=2.0f/3.0f; U3(e).z=1.0f/3.0f; expect_vec(e,u); /* If u is the NULL vector, MSDN says that the return vector is NULL. In fact, the returned vector is (1,0,0). The following test case prove it. */ U1(casnul).x=0.0f; U2(casnul).y=0.0f; U3(casnul).z=0.0f; - pD3DRMVectorNormalize(&casnul); + D3DRMVectorNormalize(&casnul); U1(e).x=1.0f; U2(e).y=0.0f; U3(e).z=0.0f; expect_vec(e,casnul); @@ -192,36 +129,36 @@ U1(ray).x=3.0f; U2(ray).y=-4.0f; U3(ray).z=5.0f; U1(norm).x=1.0f; U2(norm).y=-2.0f; U3(norm).z=6.0f; U1(e).x=79.0f; U2(e).y=-160.0f; U3(e).z=487.0f; - pD3DRMVectorReflect(&r,&ray,&norm); + D3DRMVectorReflect(&r,&ray,&norm); expect_vec(e,r); /*_______________________VectorRotate_______________________________*/ U1(w).x=3.0f; U2(w).y=4.0f; U3(w).z=0.0f; U1(axis).x=0.0f; U2(axis).y=0.0f; U3(axis).z=1.0f; theta=2.0f*PI/3.0f; - pD3DRMVectorRotate(&r,&w,&axis,theta); + D3DRMVectorRotate(&r,&w,&axis,theta); U1(e).x=-0.3f-0.4f*sqrtf(3.0f); U2(e).y=0.3f*sqrtf(3.0f)-0.4f; U3(e).z=0.0f; expect_vec(e,r); /* The same formula gives D3DRMVectorRotate, for theta in [-PI/2;+PI/2] or not. The following test proves this fact.*/ theta=-PI/4.0f; - pD3DRMVectorRotate(&r,&w,&axis,theta); + D3DRMVectorRotate(&r,&w,&axis,theta); U1(e).x=1.4f/sqrtf(2.0f); U2(e).y=0.2f/sqrtf(2.0f); U3(e).z=0.0f; expect_vec(e,r); theta=PI/8.0f; - pD3DRMVectorRotate(&self,&self,&axis,theta); + D3DRMVectorRotate(&self,&self,&axis,theta); U1(e).x=0.989950; U2(e).y=0.141421f; U3(e).z=0.0f; expect_vec(e,r); /*_______________________VectorScale__________________________*/ par=2.5f; - pD3DRMVectorScale(&r,&v,par); + D3DRMVectorScale(&r,&v,par); U1(e).x=10.0f; U2(e).y=10.0f; U3(e).z=0.0f; expect_vec(e,r); U1(self).x=9.0f; U2(self).y=18.0f; U3(self).z=27.0f; - pD3DRMVectorScale(&self,&self,2); + D3DRMVectorScale(&self,&self,2); U1(e).x=18.0f; U2(e).y=36.0f; U3(e).z=54.0f; expect_vec(e,self); } @@ -237,7 +174,7 @@ exp[3][0]=0.0f; exp[3][1]=0.0f; exp[3][2]=0.0f; exp[3][3]=1.0f; q.s=1.0f; U1(q.v).x=2.0f; U2(q.v).y=3.0f; U3(q.v).z=4.0f; - pD3DRMMatrixFromQuaternion(mat,&q); + D3DRMMatrixFromQuaternion(mat,&q); expect_mat(exp,mat); } @@ -250,7 +187,7 @@ /*_________________QuaternionFromRotation___________________*/ U1(axis).x=1.0f; U2(axis).y=1.0f; U3(axis).z=1.0f; theta=2.0f*PI/3.0f; - pD3DRMQuaternionFromRotation(&r,&axis,theta); + D3DRMQuaternionFromRotation(&r,&axis,theta); q.s=0.5f; U1(q.v).x=0.5f; U2(q.v).y=0.5f; U3(q.v).z=0.5f; expect_quat(q,r); @@ -263,14 +200,14 @@ q2.s=-4.0f; U1(q2.v).x=6.0f; U2(q2.v).y=7.0f; U3(q2.v).z=8.0f; /* The angle between q1 and q2 is in [-PI/2,PI/2]. So, one interpolates between q1 and q2. */ q.s = -0.55f; U1(q.v).x=3.24f; U2(q.v).y=4.24f; U3(q.v).z=36.98f; - pD3DRMQuaternionSlerp(&r,&q1,&q2,par); + D3DRMQuaternionSlerp(&r,&q1,&q2,par); expect_quat(q,r); q1.s=1.0f; U1(q1.v).x=2.0f; U2(q1.v).y=3.0f; U3(q1.v).z=50.0f; q2.s=-94.0f; U1(q2.v).x=6.0f; U2(q2.v).y=7.0f; U3(q2.v).z=-8.0f; /* The angle between q1 and q2 is not in [-PI/2,PI/2]. So, one interpolates between q1 and -q2. */ q.s=29.83f; U1(q.v).x=-0.48f; U2(q.v).y=-0.10f; U3(q.v).z=36.98f; - pD3DRMQuaternionSlerp(&r,&q1,&q2,par); + D3DRMQuaternionSlerp(&r,&q1,&q2,par); expect_quat(q,r); /* Test the spherical interpolation part */ @@ -280,7 +217,7 @@ q1final=q1; q2final=q2; - pD3DRMQuaternionSlerp(&r,&q1,&q2,par); + D3DRMQuaternionSlerp(&r,&q1,&q2,par); expect_quat(q,r); /* Test to show that the input quaternions are not changed */ @@ -298,7 +235,7 @@ green=0.3f; blue=0.55f; expected_color=0xffcc4c8c; - got_color=pD3DRMCreateColorRGB(red,green,blue); + got_color=D3DRMCreateColorRGB(red,green,blue); ok((expected_color==got_color),"Expected color=%x, Got color=%x\n",expected_color,got_color); /*___________D3DRMCreateColorRGBA________________________*/ @@ -307,7 +244,7 @@ blue=0.7f; alpha=0.58f; expected_color=0x931966b2; - got_color=pD3DRMCreateColorRGBA(red,green,blue,alpha); + got_color=D3DRMCreateColorRGBA(red,green,blue,alpha); ok((expected_color==got_color),"Expected color=%x, Got color=%x\n",expected_color,got_color); /* if a component is <0 then, then one considers this component as 0. The following test proves this fact (test only with the red component). */ @@ -316,7 +253,7 @@ blue=0.6f; alpha=0.41f; expected_color=0x68006699; - got_color=pD3DRMCreateColorRGBA(red,green,blue,alpha); + got_color=D3DRMCreateColorRGBA(red,green,blue,alpha); ok((expected_color==got_color),"Expected color=%x, Got color=%x\n",expected_color,got_color); /* if a component is >1 then, then one considers this component as 1. The following test proves this fact (test only with the red component). */ @@ -325,43 +262,38 @@ blue=0.6f; alpha=0.41f; expected_color=0x68ff6699; - got_color=pD3DRMCreateColorRGBA(red,green,blue,alpha); + got_color=D3DRMCreateColorRGBA(red,green,blue,alpha); ok((expected_color==got_color),"Expected color=%x, Got color=%x\n",expected_color,got_color); /*___________D3DRMColorGetAlpha_________________________*/ color=0x0e4921bf; expected=14.0f/255.0f; - got=pD3DRMColorGetAlpha(color); + got=D3DRMColorGetAlpha(color); ok((fabs(expected-got)<admit_error),"Expected=%f, Got=%f\n",expected,got); /*___________D3DRMColorGetBlue__________________________*/ color=0xc82a1455; expected=1.0f/3.0f; - got=pD3DRMColorGetBlue(color); + got=D3DRMColorGetBlue(color); ok((fabs(expected-got)<admit_error),"Expected=%f, Got=%f\n",expected,got); /*___________D3DRMColorGetGreen_________________________*/ color=0xad971203; expected=6.0f/85.0f; - got=pD3DRMColorGetGreen(color); + got=D3DRMColorGetGreen(color); ok((fabs(expected-got)<admit_error),"Expected=%f, Got=%f\n",expected,got); /*___________D3DRMColorGetRed__________________________*/ color=0xb62d7a1c; expected=3.0f/17.0f; - got=pD3DRMColorGetRed(color); + got=D3DRMColorGetRed(color); ok((fabs(expected-got)<admit_error),"Expected=%f, Got=%f\n",expected,got); } START_TEST(vector) { - if(!InitFunctionPtrs()) - return; - VectorTest(); MatrixTest(); QuaternionTest(); ColorTest(); - - FreeLibrary(d3drm_handle); -} +}
9 years, 5 months
1
0
0
0
[akhaldi] 68528: [D3DRM] Sync with Wine Staging 1.7.47. CORE-9924 [PSDK] Update d3drm.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 21 23:33:10 2015 New Revision: 68528 URL:
http://svn.reactos.org/svn/reactos?rev=68528&view=rev
Log: [D3DRM] Sync with Wine Staging 1.7.47. CORE-9924 [PSDK] Update d3drm.h. Modified: trunk/reactos/dll/directx/wine/d3drm/CMakeLists.txt trunk/reactos/dll/directx/wine/d3drm/d3drm.c trunk/reactos/dll/directx/wine/d3drm/d3drm.spec trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h trunk/reactos/dll/directx/wine/d3drm/device.c trunk/reactos/dll/directx/wine/d3drm/face.c trunk/reactos/dll/directx/wine/d3drm/frame.c trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c trunk/reactos/dll/directx/wine/d3drm/viewport.c trunk/reactos/include/psdk/d3drm.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/d3drm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/CMa…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/CMakeLists.txt [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -1,7 +1,7 @@ add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) -spec2def(d3drm.dll d3drm.spec) +spec2def(d3drm.dll d3drm.spec ADD_IMPORTLIB) list(APPEND SOURCE d3drm.c Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/d3drm.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/d3drm.c [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -44,7 +44,7 @@ IDirect3DRM IDirect3DRM_iface; IDirect3DRM2 IDirect3DRM2_iface; IDirect3DRM3 IDirect3DRM3_iface; - LONG ref; + LONG ref1, ref2, ref3, iface_count; }; static inline struct d3drm *impl_from_IDirect3DRM(IDirect3DRM *iface) @@ -60,6 +60,12 @@ static inline struct d3drm *impl_from_IDirect3DRM3(IDirect3DRM3 *iface) { return CONTAINING_RECORD(iface, struct d3drm, IDirect3DRM3_iface); +} + +static void d3drm_destroy(struct d3drm *d3drm) +{ + HeapFree(GetProcessHeap(), 0, d3drm); + TRACE("d3drm object %p is being destroyed.\n", d3drm); } static HRESULT WINAPI d3drm1_QueryInterface(IDirect3DRM *iface, REFIID riid, void **out) @@ -84,8 +90,8 @@ else { *out = NULL; - WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - return E_NOINTERFACE; + WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid)); + return CLASS_E_CLASSNOTAVAILABLE; } IUnknown_AddRef((IUnknown *)*out); @@ -95,22 +101,25 @@ static ULONG WINAPI d3drm1_AddRef(IDirect3DRM *iface) { struct d3drm *d3drm = impl_from_IDirect3DRM(iface); - ULONG refcount = InterlockedIncrement(&d3drm->ref); + ULONG refcount = InterlockedIncrement(&d3drm->ref1); TRACE("%p increasing refcount to %u.\n", iface, refcount); + if (refcount == 1) + InterlockedIncrement(&d3drm->iface_count); + return refcount; } static ULONG WINAPI d3drm1_Release(IDirect3DRM *iface) { struct d3drm *d3drm = impl_from_IDirect3DRM(iface); - ULONG refcount = InterlockedDecrement(&d3drm->ref); + ULONG refcount = InterlockedDecrement(&d3drm->ref1); TRACE("%p decreasing refcount to %u.\n", iface, refcount); - if (!refcount) - HeapFree(GetProcessHeap(), 0, d3drm); + if (!refcount && !InterlockedDecrement(&d3drm->iface_count)) + d3drm_destroy(d3drm); return refcount; } @@ -444,15 +453,27 @@ static ULONG WINAPI d3drm2_AddRef(IDirect3DRM2 *iface) { struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); - - return d3drm1_AddRef(&d3drm->IDirect3DRM_iface); + ULONG refcount = InterlockedIncrement(&d3drm->ref2); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + if (refcount == 1) + InterlockedIncrement(&d3drm->iface_count); + + return refcount; } static ULONG WINAPI d3drm2_Release(IDirect3DRM2 *iface) { struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); - - return d3drm1_Release(&d3drm->IDirect3DRM_iface); + ULONG refcount = InterlockedDecrement(&d3drm->ref2); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount && !InterlockedDecrement(&d3drm->iface_count)) + d3drm_destroy(d3drm); + + return refcount; } static HRESULT WINAPI d3drm2_CreateObject(IDirect3DRM2 *iface, @@ -793,15 +814,27 @@ static ULONG WINAPI d3drm3_AddRef(IDirect3DRM3 *iface) { struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); - - return d3drm1_AddRef(&d3drm->IDirect3DRM_iface); + ULONG refcount = InterlockedIncrement(&d3drm->ref3); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + if (refcount == 1) + InterlockedIncrement(&d3drm->iface_count); + + return refcount; } static ULONG WINAPI d3drm3_Release(IDirect3DRM3 *iface) { struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); - - return d3drm1_Release(&d3drm->IDirect3DRM_iface); + ULONG refcount = InterlockedDecrement(&d3drm->ref3); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount && !InterlockedDecrement(&d3drm->iface_count)) + d3drm_destroy(d3drm); + + return refcount; } static HRESULT WINAPI d3drm3_CreateObject(IDirect3DRM3 *iface, @@ -919,10 +952,10 @@ } static HRESULT WINAPI d3drm3_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID *guid, - IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, IDirect3DRMDevice3 **device) -{ - FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, device %p partial stub.\n", - iface, debugstr_guid(guid), ddraw, backbuffer, device); + IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, DWORD flags, IDirect3DRMDevice3 **device) +{ + FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, flags %#x, device %p partial stub.\n", + iface, debugstr_guid(guid), ddraw, backbuffer, flags, device); return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device); } @@ -1162,32 +1195,29 @@ IDirectXFileDataReference *reference; IDirectXFileBinary *binary; - hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileBinary, (void **)&binary); - if (SUCCEEDED(hr)) + if (SUCCEEDED(IDirectXFileObject_QueryInterface(child, + &IID_IDirectXFileBinary, (void **)&binary))) { FIXME("Binary Object not supported yet\n"); IDirectXFileBinary_Release(binary); - continue; } - - hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data); - if (SUCCEEDED(hr)) + else if (SUCCEEDED(IDirectXFileObject_QueryInterface(child, + &IID_IDirectXFileData, (void **)&data))) { TRACE("Found Data Object\n"); hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame); IDirectXFileData_Release(data); - continue; } - hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference); - if (SUCCEEDED(hr)) + else if (SUCCEEDED(IDirectXFileObject_QueryInterface(child, + &IID_IDirectXFileDataReference, (void **)&reference))) { TRACE("Found Data Object Reference\n"); IDirectXFileDataReference_Resolve(reference, &data); hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame); IDirectXFileData_Release(data); IDirectXFileDataReference_Release(reference); - continue; } + IDirectXFileObject_Release(child); } if (hr != DXFILEERR_NOMOREOBJECTS) @@ -1480,9 +1510,25 @@ object->IDirect3DRM_iface.lpVtbl = &d3drm1_vtbl; object->IDirect3DRM2_iface.lpVtbl = &d3drm2_vtbl; object->IDirect3DRM3_iface.lpVtbl = &d3drm3_vtbl; - object->ref = 1; + object->ref1 = 1; + object->iface_count = 1; *d3drm = &object->IDirect3DRM_iface; return S_OK; } + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) +{ + TRACE("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); + + if(!ppv) + return E_INVALIDARG; + + return CLASS_E_CLASSNOTAVAILABLE; +} Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/d3drm.spec [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/d3drm.spec [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -19,5 +19,5 @@ @ stdcall D3DRMVectorScale(ptr ptr float) @ stdcall D3DRMVectorSubtract(ptr ptr ptr) @ stdcall Direct3DRMCreate(ptr) -@ stub -private DllCanUnloadNow -@ stub -private DllGetClassObject +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -58,6 +58,6 @@ DWORD flags; }; -extern char templates[]; +extern char templates[] DECLSPEC_HIDDEN; #endif /* __D3DRM_PRIVATE_INCLUDED__ */ Modified: trunk/reactos/dll/directx/wine/d3drm/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/dev…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/device.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/device.c [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -2,9 +2,6 @@ * Implementation of IDirect3DRMDevice Interface * * Copyright 2011, 2012 André Hentschel - * - * This file contains the (internal) driver registration functions, - * driver enumeration APIs and DirectDraw creation functions. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public Modified: trunk/reactos/dll/directx/wine/d3drm/face.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/fac…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/face.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/face.c [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -2,9 +2,6 @@ * Implementation of IDirect3DRMFace Interface * * Copyright 2013 André Hentschel - * - * This file contains the (internal) driver registration functions, - * driver enumeration APIs and DirectDraw creation functions. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public Modified: trunk/reactos/dll/directx/wine/d3drm/frame.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/fra…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/frame.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/frame.c [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -462,66 +462,25 @@ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2) - || IsEqualGUID(riid, &IID_IDirect3DRMFrame) - || IsEqualGUID(riid, &IID_IUnknown)) - { - *out = &frame->IDirect3DRMFrame2_iface; - } - else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3)) - { - *out = &frame->IDirect3DRMFrame3_iface; - } - else - { - *out = NULL; - WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*out); - return S_OK; + return IDirect3DRMFrame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out); } static ULONG WINAPI d3drm_frame2_AddRef(IDirect3DRMFrame2 *iface) { struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); - ULONG refcount = InterlockedIncrement(&frame->ref); - - TRACE("%p increasing refcount to %u.\n", iface, refcount); - - return refcount; + + TRACE("iface %p.\n", iface); + + return IDirect3DRMFrame3_AddRef(&frame->IDirect3DRMFrame3_iface); } static ULONG WINAPI d3drm_frame2_Release(IDirect3DRMFrame2 *iface) { struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); - ULONG refcount = InterlockedDecrement(&frame->ref); - ULONG i; - - TRACE("%p decreasing refcount to %u.\n", iface, refcount); - - if (!refcount) - { - for (i = 0; i < frame->nb_children; ++i) - { - IDirect3DRMFrame3_Release(frame->children[i]); - } - HeapFree(GetProcessHeap(), 0, frame->children); - for (i = 0; i < frame->nb_visuals; ++i) - { - IDirect3DRMVisual_Release(frame->visuals[i]); - } - HeapFree(GetProcessHeap(), 0, frame->visuals); - for (i = 0; i < frame->nb_lights; ++i) - { - IDirect3DRMLight_Release(frame->lights[i]); - } - HeapFree(GetProcessHeap(), 0, frame->lights); - HeapFree(GetProcessHeap(), 0, frame); - } - - return refcount; + + TRACE("iface %p.\n", iface); + + return IDirect3DRMFrame3_Release(&frame->IDirect3DRMFrame3_iface); } static HRESULT WINAPI d3drm_frame2_Clone(IDirect3DRMFrame2 *iface, @@ -1223,25 +1182,68 @@ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - return d3drm_frame2_QueryInterface(&frame->IDirect3DRMFrame2_iface, riid, out); + if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2) + || IsEqualGUID(riid, &IID_IDirect3DRMFrame) + || IsEqualGUID(riid, &IID_IDirect3DRMObject) + || IsEqualGUID(riid, &IID_IDirect3DRMVisual) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &frame->IDirect3DRMFrame2_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3)) + { + *out = &frame->IDirect3DRMFrame3_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid)); + return CLASS_E_CLASSNOTAVAILABLE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; } static ULONG WINAPI d3drm_frame3_AddRef(IDirect3DRMFrame3 *iface) { struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); - - TRACE("iface %p.\n", iface); - - return d3drm_frame2_AddRef(&frame->IDirect3DRMFrame2_iface); + ULONG refcount = InterlockedIncrement(&frame->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; } static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface) { struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); - - TRACE("iface %p.\n", iface); - - return d3drm_frame2_Release(&frame->IDirect3DRMFrame2_iface); + ULONG refcount = InterlockedDecrement(&frame->ref); + ULONG i; + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + for (i = 0; i < frame->nb_children; ++i) + { + IDirect3DRMFrame3_Release(frame->children[i]); + } + HeapFree(GetProcessHeap(), 0, frame->children); + for (i = 0; i < frame->nb_visuals; ++i) + { + IDirect3DRMVisual_Release(frame->visuals[i]); + } + HeapFree(GetProcessHeap(), 0, frame->visuals); + for (i = 0; i < frame->nb_lights; ++i) + { + IDirect3DRMLight_Release(frame->lights[i]); + } + HeapFree(GetProcessHeap(), 0, frame->lights); + HeapFree(GetProcessHeap(), 0, frame); + } + + return refcount; } static HRESULT WINAPI d3drm_frame3_Clone(IDirect3DRMFrame3 *iface, @@ -2293,5 +2295,5 @@ hr = IDirect3DRMFrame3_QueryInterface(&object->IDirect3DRMFrame3_iface, riid, (void **)out); IDirect3DRMFrame3_Release(&object->IDirect3DRMFrame3_iface); - return S_OK; -} + return hr; +} Modified: trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/mes…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -343,7 +343,9 @@ } mesh_builder->nb_materials = 0; HeapFree(GetProcessHeap(), 0, mesh_builder->materials); + mesh_builder->materials = NULL; HeapFree(GetProcessHeap(), 0, mesh_builder->material_indices); + mesh_builder->material_indices = NULL; } static HRESULT WINAPI d3drm_mesh_builder2_QueryInterface(IDirect3DRMMeshBuilder2 *iface, REFIID riid, void **out) @@ -1235,20 +1237,21 @@ IDirectXFileData *data; char **filename; - hr = IDirectXFileObject_QueryInterface(material_child, &IID_IDirectXFileData, (void **)&data); - if (FAILED(hr)) + if (FAILED(hr = IDirectXFileObject_QueryInterface(material_child, + &IID_IDirectXFileData, (void **)&data))) { IDirectXFileDataReference *reference; - hr = IDirectXFileObject_QueryInterface(material_child, &IID_IDirectXFileDataReference, (void **)&reference); - if (FAILED(hr)) - goto end; - - hr = IDirectXFileDataReference_Resolve(reference, &data); - IDirectXFileDataReference_Release(reference); - if (FAILED(hr)) - goto end; + if (SUCCEEDED(IDirectXFileObject_QueryInterface(material_child, + &IID_IDirectXFileDataReference, (void **)&reference))) + { + hr = IDirectXFileDataReference_Resolve(reference, &data); + IDirectXFileDataReference_Release(reference); + } } + IDirectXFileObject_Release(material_child); + if (FAILED(hr)) + goto end; hr = IDirectXFileData_GetType(data, &guid); if (hr != DXFILE_OK) @@ -1293,6 +1296,7 @@ } } } + IDirectXFileData_Release(data); } else if (hr != DXFILEERR_NOMOREOBJECTS) { @@ -1351,7 +1355,10 @@ if (!This->nb_normals) { /* Compute face normal */ - if (nb_face_indexes > 2) + if (nb_face_indexes > 2 + && faces_vertex_idx_ptr[0] < This->nb_vertices + && faces_vertex_idx_ptr[1] < This->nb_vertices + && faces_vertex_idx_ptr[2] < This->nb_vertices) { D3DVECTOR a, b; Modified: trunk/reactos/dll/directx/wine/d3drm/viewport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/vie…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/viewport.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/viewport.c [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -2,9 +2,6 @@ * Implementation of IDirect3DRMViewport Interface * * Copyright 2012 André Hentschel - * - * This file contains the (internal) driver registration functions, - * driver enumeration APIs and DirectDraw creation functions. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public Modified: trunk/reactos/include/psdk/d3drm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/d3drm.h?rev=6…
============================================================================== --- trunk/reactos/include/psdk/d3drm.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/d3drm.h [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -353,7 +353,7 @@ STDMETHOD(CreateMaterial)(THIS_ D3DVALUE, IDirect3DRMMaterial2 **material) PURE; STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice3 **device) PURE; STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw, - IDirectDrawSurface *surface, IDirect3DRMDevice3 **device) PURE; + IDirectDrawSurface *surface, DWORD flags, IDirect3DRMDevice3 **device) PURE; STDMETHOD(CreateDeviceFromD3D)(THIS_ IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, IDirect3DRMDevice3 **device) PURE; STDMETHOD(CreateDeviceFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid, @@ -411,7 +411,7 @@ #define IDirect3DRM3_CreateLightRGB(p,a,b,c,d,e) (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e) #define IDirect3DRM3_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) #define IDirect3DRM3_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d) (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d) +#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d,e) #define IDirect3DRM3_CreateDeviceFromD3D(p,a,b,c) (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c) #define IDirect3DRM3_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e) #define IDirect3DRM3_CreateTextureFromSurface(p,a,b) (p)->lpVtbl->CreateTextureFromSurface(p,a,b) @@ -455,7 +455,7 @@ #define IDirect3DRM3_CreateLightRGB(p,a,b,c,d,e) (p)->CreateLightRGB(a,b,c,d,e) #define IDirect3DRM3_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) #define IDirect3DRM3_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d) (p)->CreateDeviceFromSurface(a,b,c,d) +#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d,e) (p)->CreateDeviceFromSurface(a,b,c,d,e) #define IDirect3DRM3_CreateDeviceFromD3D(p,a,b,c) (p)->CreateDeviceFromD3D(a,b,c) #define IDirect3DRM3_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->CreateDeviceFromClipper(a,b,c,d,e) #define IDirect3DRM3_CreateTextureFromSurface(p,a,b) (p)->CreateTextureFromSurface(a,b) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jul 21 23:33:10 2015 @@ -25,7 +25,7 @@ reactos/dll/directx/wine/d3d8 # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/d3d9 # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-1.7.37 -reactos/dll/directx/wine/d3drm # Synced to WineStaging-1.7.37 +reactos/dll/directx/wine/d3drm # Synced to WineStaging-1.7.47 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/d3dxof # Synced to WineStaging-1.7.47 reactos/dll/directx/wine/ddraw # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68527: [QUARTZ_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 21 23:30:04 2015 New Revision: 68527 URL:
http://svn.reactos.org/svn/reactos?rev=68527&view=rev
Log: [QUARTZ_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/quartz/dsoundrender.c trunk/rostests/winetests/quartz/referenceclock.c Modified: trunk/rostests/winetests/quartz/dsoundrender.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/quartz/dsoundre…
============================================================================== --- trunk/rostests/winetests/quartz/dsoundrender.c [iso-8859-1] (original) +++ trunk/rostests/winetests/quartz/dsoundrender.c [iso-8859-1] Tue Jul 21 23:30:04 2015 @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION #define COBJMACROS #include "wine/test.h" Modified: trunk/rostests/winetests/quartz/referenceclock.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/quartz/referenc…
============================================================================== --- trunk/rostests/winetests/quartz/referenceclock.c [iso-8859-1] (original) +++ trunk/rostests/winetests/quartz/referenceclock.c [iso-8859-1] Tue Jul 21 23:30:04 2015 @@ -28,21 +28,21 @@ static void test_IReferenceClock_query_interface(const char * clockdesc, IReferenceClock * pClock) { HRESULT hr; - void *pF; + IUnknown *pF; - hr = IReferenceClock_QueryInterface(pClock, &IID_IUnknown, &pF); + hr = IReferenceClock_QueryInterface(pClock, &IID_IUnknown, (void**)&pF); ok(hr == S_OK, "IReferenceClock_QueryInterface returned %x\n", hr); ok(pF != NULL, "pF is NULL\n"); - if (SUCCEEDED(hr)) IUnknown_Release((IUnknown *)pF); + if (SUCCEEDED(hr)) IUnknown_Release(pF); - hr = IReferenceClock_QueryInterface(pClock, &IID_IDirectDraw, &pF); + hr = IReferenceClock_QueryInterface(pClock, &IID_IDirectDraw, (void**)&pF); ok(hr == E_NOINTERFACE, "IReferenceClock_QueryInterface returned %x\n", hr); ok(pF == NULL, "pF is not NULL\n"); - hr = IReferenceClock_QueryInterface(pClock, &IID_IReferenceClock, &pF); + hr = IReferenceClock_QueryInterface(pClock, &IID_IReferenceClock, (void**)&pF); ok(hr == S_OK, "IReferenceClock_QueryInterface returned %x\n", hr); ok(pF != NULL, "pF is NULL\n"); - if (SUCCEEDED(hr)) IReferenceClock_Release((IReferenceClock *)pF); + if (SUCCEEDED(hr)) IUnknown_Release(pF); } /* The following method expects a reference clock that will keep ticking for
9 years, 5 months
1
0
0
0
[akhaldi] 68526: [QUARTZ] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 21 23:29:47 2015 New Revision: 68526 URL:
http://svn.reactos.org/svn/reactos?rev=68526&view=rev
Log: [QUARTZ] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/directx/wine/quartz/acmwrapper.c trunk/reactos/dll/directx/wine/quartz/avidec.c trunk/reactos/dll/directx/wine/quartz/filesource.c trunk/reactos/dll/directx/wine/quartz/filtergraph.c trunk/reactos/dll/directx/wine/quartz/main.c trunk/reactos/dll/directx/wine/quartz/memallocator.c trunk/reactos/dll/directx/wine/quartz/systemclock.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/quartz/acmwrapper.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/ac…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/acmwrapper.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/acmwrapper.c [iso-8859-1] Tue Jul 21 23:29:47 2015 @@ -375,7 +375,7 @@ if (FAILED(hr)) return hr; - *ppv = This; + *ppv = &This->tf.filter.IBaseFilter_iface; This->lasttime_real = This->lasttime_sent = -1; return hr; Modified: trunk/reactos/dll/directx/wine/quartz/avidec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/av…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/avidec.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/avidec.c [iso-8859-1] Tue Jul 21 23:29:47 2015 @@ -396,7 +396,7 @@ This->pBihIn = NULL; This->pBihOut = NULL; - *ppv = This; + *ppv = &This->tf.filter.IBaseFilter_iface; return hr; } Modified: trunk/reactos/dll/directx/wine/quartz/filesource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/fi…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/filesource.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/filesource.c [iso-8859-1] Tue Jul 21 23:29:47 2015 @@ -437,13 +437,13 @@ *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_IFileSourceFilter)) *ppv = &This->IFileSourceFilter_iface; else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags)) Modified: trunk/reactos/dll/directx/wine/quartz/filtergraph.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/fi…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/filtergraph.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/filtergraph.c [iso-8859-1] Tue Jul 21 23:29:47 2015 @@ -2432,8 +2432,16 @@ { IFilterGraphImpl *This = impl_from_IMediaSeeking(iface); - FIXME("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This, iface, pTarget, - pTargetFormat, wine_dbgstr_longlong(Source), pSourceFormat); + TRACE("(%p/%p)->(%p, %s, 0x%s, %s)\n", This, iface, pTarget, + debugstr_guid(pTargetFormat), wine_dbgstr_longlong(Source), debugstr_guid(pSourceFormat)); + + if (!pSourceFormat) + pSourceFormat = &This->timeformatseek; + + if (IsEqualGUID(pTargetFormat, pSourceFormat)) + *pTarget = Source; + else + FIXME("conversion %s->%s not supported\n", debugstr_guid(pSourceFormat), debugstr_guid(pTargetFormat)); return S_OK; } Modified: trunk/reactos/dll/directx/wine/quartz/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/ma…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/main.c [iso-8859-1] Tue Jul 21 23:29:47 2015 @@ -22,8 +22,6 @@ extern HRESULT WINAPI QUARTZ_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN; extern HRESULT WINAPI QUARTZ_DllCanUnloadNow(void) DECLSPEC_HIDDEN; extern BOOL WINAPI QUARTZ_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN; - -static DWORD dll_ref = 0; /* For the moment, do nothing here. */ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) @@ -200,7 +198,6 @@ */ HRESULT WINAPI DllCanUnloadNow(void) { - if (dll_ref) return S_FALSE; return QUARTZ_DllCanUnloadNow(); } Modified: trunk/reactos/dll/directx/wine/quartz/memallocator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/me…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/memallocator.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/memallocator.c [iso-8859-1] Tue Jul 21 23:29:47 2015 @@ -107,9 +107,9 @@ *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; + *ppv = &This->IMemAllocator_iface; else if (IsEqualIID(riid, &IID_IMemAllocator)) - *ppv = This; + *ppv = &This->IMemAllocator_iface; if (*ppv) { Modified: trunk/reactos/dll/directx/wine/quartz/systemclock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/sy…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/systemclock.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/systemclock.c [iso-8859-1] Tue Jul 21 23:29:47 2015 @@ -121,6 +121,7 @@ it = nextit; } if (NULL != it) timeOut = (DWORD) ((it->rtBaseTime + it->rtIntervalTime) - curTime) / (REFERENCE_TIME)10000; + else timeOut = INFINITE; /** Now Periodics Advice: semi sorted list (sort cannot be used) */ for (it = This->pPeriodicAdvise; NULL != it; it = it->next) { Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jul 21 23:29:47 2015 @@ -40,7 +40,7 @@ reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.47 reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.7.47 reactos/dll/directx/wine/qedit # Synced to WineStaging-1.7.37 -reactos/dll/directx/wine/quartz # Synced to WineStaging-1.7.37 +reactos/dll/directx/wine/quartz # Synced to WineStaging-1.7.47 reactos/dll/directx/wine/wined3d # Synced to WineStaging-1.7.37 reactos/dll/win32/activeds # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68525: [MSDMO] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jul 21 23:28:13 2015 New Revision: 68525 URL:
http://svn.reactos.org/svn/reactos?rev=68525&view=rev
Log: [MSDMO] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/directx/wine/msdmo/dmoreg.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/msdmo/dmoreg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/msdmo/dmo…
============================================================================== --- trunk/reactos/dll/directx/wine/msdmo/dmoreg.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/msdmo/dmoreg.c [iso-8859-1] Tue Jul 21 23:28:13 2015 @@ -80,7 +80,7 @@ IEnumDMO IEnumDMO_iface; LONG ref; DWORD index; - const GUID* guidCategory; + GUID category; DWORD dwFlags; DWORD cInTypes; DMO_PARTIAL_MEDIATYPE *pInTypes; @@ -179,25 +179,26 @@ HKEY hkey = 0; HKEY hckey = 0; HKEY hclskey = 0; + LONG ret; TRACE("%s %s %s\n", debugstr_w(szName), debugstr_guid(clsidDMO), debugstr_guid(guidCategory)); if (IsEqualGUID(guidCategory, &GUID_NULL)) return E_INVALIDARG; - hres = RegCreateKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, NULL, + ret = RegCreateKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hrkey, NULL); - if (ERROR_SUCCESS != hres) + if (ret) + return HRESULT_FROM_WIN32(ret); + + /* Create clsidDMO key under MediaObjects */ + ret = RegCreateKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, NULL); + if (ret) goto lend; - /* Create clsidDMO key under MediaObjects */ - hres = RegCreateKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, NULL); - if (ERROR_SUCCESS != hres) - goto lend; - /* Set default Name value */ - hres = RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE*) szName, + ret = RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE*) szName, (strlenW(szName) + 1) * sizeof(WCHAR)); /* Set InputTypes */ @@ -209,28 +210,28 @@ if (dwFlags & DMO_REGISTERF_IS_KEYED) { /* Create Keyed key */ - hres = RegCreateKeyExW(hkey, szDMOKeyed, 0, NULL, + ret = RegCreateKeyExW(hkey, szDMOKeyed, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hckey, NULL); - if (ERROR_SUCCESS != hres) + if (ret) goto lend; RegCloseKey(hckey); } /* Register the category */ - hres = RegCreateKeyExW(hrkey, szDMOCategories, 0, NULL, + ret = RegCreateKeyExW(hrkey, szDMOCategories, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hckey, NULL); - if (ERROR_SUCCESS != hres) + if (ret) goto lend; RegCloseKey(hkey); - hres = RegCreateKeyExW(hckey, GUIDToString(szguid, guidCategory), 0, NULL, + ret = RegCreateKeyExW(hckey, GUIDToString(szguid, guidCategory), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, NULL); - if (ERROR_SUCCESS != hres) + if (ret) goto lend; - hres = RegCreateKeyExW(hkey, GUIDToString(szguid, clsidDMO), 0, NULL, + ret = RegCreateKeyExW(hkey, GUIDToString(szguid, clsidDMO), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hclskey, NULL); - if (ERROR_SUCCESS != hres) + if (ret) goto lend; lend: @@ -243,6 +244,7 @@ if (hrkey) RegCloseKey(hrkey); + hres = HRESULT_FROM_WIN32(ret); TRACE(" hresult=0x%08x\n", hres); return hres; } @@ -317,56 +319,53 @@ /*************************************************************** * DMOGetName (MSDMO.@) * - * Get DMP Name from the registry - */ -HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[]) -{ + * Get DMO Name from the registry + */ +HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR name[]) +{ + static const INT max_name_len = 80*sizeof(WCHAR); + DWORD count = max_name_len; WCHAR szguid[64]; - HKEY hrkey = 0; - HKEY hkey = 0; - static const INT max_name_len = 80; - DWORD count; + HKEY hrkey, hkey; LONG ret; - TRACE("%s\n", debugstr_guid(clsidDMO)); - - ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &hrkey); - if (ERROR_SUCCESS != ret) - goto lend; + TRACE("%s %p\n", debugstr_guid(clsidDMO), name); + + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &hrkey)) + return E_FAIL; ret = RegOpenKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, KEY_READ, &hkey); - if (ERROR_SUCCESS != ret) - goto lend; - - count = max_name_len * sizeof(WCHAR); - ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE) szName, &count); - - TRACE(" szName=%s\n", debugstr_w(szName)); -lend: - if (hkey) - RegCloseKey(hrkey); - if (hkey) - RegCloseKey(hkey); - - return HRESULT_FROM_WIN32(ret); -} - -/************************************************************************** -* IEnumDMOImpl_Destructor -*/ -static BOOL IEnumDMOImpl_Destructor(IEnumDMOImpl* This) -{ - TRACE("%p\n", This); - - if (This->hkey) - RegCloseKey(This->hkey); - - HeapFree(GetProcessHeap(), 0, This->pInTypes); - HeapFree(GetProcessHeap(), 0, This->pOutTypes); - - return TRUE; -} - + RegCloseKey(hrkey); + if (ret) + return E_FAIL; + + ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)name, &count); + RegCloseKey(hkey); + + if (!ret && count > 1) + { + TRACE("name=%s\n", debugstr_w(name)); + return S_OK; + } + + name[0] = 0; + return S_FALSE; +} + +static HRESULT dup_partial_mediatype(const DMO_PARTIAL_MEDIATYPE *types, DWORD count, DMO_PARTIAL_MEDIATYPE **ret) +{ + *ret = NULL; + + if (count == 0) + return S_OK; + + *ret = HeapAlloc(GetProcessHeap(), 0, count*sizeof(*types)); + if (!*ret) + return E_OUTOFMEMORY; + + memcpy(*ret, types, count*sizeof(*types)); + return S_OK; +} /************************************************************************** * IEnumDMO_Constructor @@ -381,8 +380,7 @@ IEnumDMO **obj) { IEnumDMOImpl* lpedmo; - HRESULT hr = S_OK; - UINT size; + HRESULT hr; LONG ret; *obj = NULL; @@ -394,34 +392,18 @@ lpedmo->IEnumDMO_iface.lpVtbl = &edmovt; lpedmo->ref = 1; lpedmo->index = -1; - lpedmo->guidCategory = guidCategory; + lpedmo->category = *guidCategory; lpedmo->dwFlags = dwFlags; - - if (cInTypes > 0) - { - size = cInTypes * sizeof(DMO_PARTIAL_MEDIATYPE); - lpedmo->pInTypes = HeapAlloc(GetProcessHeap(), 0, size); - if (!lpedmo->pInTypes) - { - hr = E_OUTOFMEMORY; - goto lerr; - } - memcpy(lpedmo->pInTypes, pInTypes, size); - lpedmo->cInTypes = cInTypes; - } - - if (cOutTypes > 0) - { - size = cOutTypes * sizeof(DMO_PARTIAL_MEDIATYPE); - lpedmo->pOutTypes = HeapAlloc(GetProcessHeap(), 0, size); - if (!lpedmo->pOutTypes) - { - hr = E_OUTOFMEMORY; - goto lerr; - } - memcpy(lpedmo->pOutTypes, pOutTypes, size); - lpedmo->cOutTypes = cOutTypes; - } + lpedmo->cInTypes = cInTypes; + lpedmo->cOutTypes = cOutTypes; + + hr = dup_partial_mediatype(pInTypes, cInTypes, &lpedmo->pInTypes); + if (FAILED(hr)) + goto lerr; + + hr = dup_partial_mediatype(pOutTypes, cOutTypes, &lpedmo->pOutTypes); + if (FAILED(hr)) + goto lerr; /* If not filtering by category enum from media objects root */ if (IsEqualGUID(guidCategory, &GUID_NULL)) @@ -434,8 +416,7 @@ WCHAR szguid[64]; WCHAR szKey[MAX_PATH]; - wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories, - GUIDToString(szguid, guidCategory)); + wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories, GUIDToString(szguid, guidCategory)); if ((ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey))) hr = HRESULT_FROM_WIN32(ret); } @@ -443,10 +424,7 @@ lerr: if (FAILED(hr)) - { - IEnumDMOImpl_Destructor(lpedmo); - HeapFree(GetProcessHeap(), 0, lpedmo); - } + IEnumDMO_Release(&lpedmo->IEnumDMO_iface); else { TRACE("returning %p\n", lpedmo); @@ -482,7 +460,7 @@ IsEqualIID(riid, &IID_IUnknown)) { *ppvObj = iface; - IEnumDMO_fnAddRef(iface); + IEnumDMO_AddRef(iface); } return *ppvObj ? S_OK : E_NOINTERFACE; @@ -500,8 +478,11 @@ if (!refCount) { - IEnumDMOImpl_Destructor(This); - HeapFree(GetProcessHeap(),0,This); + if (This->hkey) + RegCloseKey(This->hkey); + HeapFree(GetProcessHeap(), 0, This->pInTypes); + HeapFree(GetProcessHeap(), 0, This->pOutTypes); + HeapFree(GetProcessHeap(), 0, This); } return refCount; } @@ -517,7 +498,6 @@ WCHAR ** Names, DWORD * pcItemsFetched) { - FILETIME ft; HKEY hkey; WCHAR szNextKey[MAX_PATH]; WCHAR szGuidKey[64]; @@ -540,7 +520,7 @@ This->index++; len = MAX_PATH; - ret = RegEnumKeyExW(This->hkey, This->index, szNextKey, &len, NULL, NULL, NULL, &ft); + ret = RegEnumKeyExW(This->hkey, This->index, szNextKey, &len, NULL, NULL, NULL, NULL); if (ret != ERROR_SUCCESS) { hres = HRESULT_FROM_WIN32(ret); @@ -563,6 +543,7 @@ wsprintfW(szKey, szCat2Fmt, szDMORootKey, szNextKey); ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hkey); + TRACE("testing %s\n", debugstr_w(szKey)); if (This->pInTypes) { @@ -581,6 +562,12 @@ } pInTypes = (DMO_PARTIAL_MEDIATYPE*) szValue; + + TRACE("read %d intypes for %s:\n", cInTypes, debugstr_w(szKey)); + for (i = 0; i < cInTypes; i++) { + TRACE("intype %d: type %s, subtype %s\n", i, debugstr_guid(&pInTypes[i].type), + debugstr_guid(&pInTypes[i].subtype)); + } for (i = 0; i < This->cInTypes; i++) { @@ -619,6 +606,12 @@ pOutTypes = (DMO_PARTIAL_MEDIATYPE*) szValue; + TRACE("read %d outtypes for %s:\n", cOutTypes, debugstr_w(szKey)); + for (i = 0; i < cOutTypes; i++) { + TRACE("outtype %d: type %s, subtype %s\n", i, debugstr_guid(&pOutTypes[i].type), + debugstr_guid(&pOutTypes[i].subtype)); + } + for (i = 0; i < This->cOutTypes; i++) { for (j = 0; j < cOutTypes; j++) @@ -644,7 +637,7 @@ ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)szValue, &len); if (ERROR_SUCCESS == ret) { - Names[count] = HeapAlloc(GetProcessHeap(), 0, (strlenW(szValue) + 1) * sizeof(WCHAR)); + Names[count] = CoTaskMemAlloc((strlenW(szValue) + 1) * sizeof(WCHAR)); if (Names[count]) strcpyW(Names[count], szValue); } @@ -700,7 +693,7 @@ { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); TRACE("(%p)->(%p)\n", This, ppEnum); - return IEnumDMO_Constructor(This->guidCategory, This->dwFlags, This->cInTypes, This->pInTypes, + return IEnumDMO_Constructor(&This->category, This->dwFlags, This->cInTypes, This->pInTypes, This->cOutTypes, This->pOutTypes, ppEnum); } @@ -711,18 +704,35 @@ * Enumerate DirectX Media Objects in the registry. */ HRESULT WINAPI DMOEnum( - REFGUID guidCategory, - DWORD dwFlags, + REFGUID category, + DWORD flags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, const DMO_PARTIAL_MEDIATYPE *pOutTypes, IEnumDMO **ppEnum) { - TRACE("guidCategory=%p dwFlags=0x%08x cInTypes=%d cOutTypes=%d\n", - guidCategory, dwFlags, cInTypes, cOutTypes); - - return IEnumDMO_Constructor(guidCategory, dwFlags, cInTypes, + TRACE("%s 0x%08x %d %p %d %p %p\n", debugstr_guid(category), flags, cInTypes, pInTypes, + cOutTypes, pOutTypes, ppEnum); + + if (TRACE_ON(msdmo)) + { + DWORD i; + if (cInTypes) + { + for (i = 0; i < cInTypes; i++) + TRACE("intype %d - type %s, subtype %s\n", i, debugstr_guid(&pInTypes[i].type), + debugstr_guid(&pInTypes[i].subtype)); + } + + if (cOutTypes) { + for (i = 0; i < cOutTypes; i++) + TRACE("outtype %d - type %s, subtype %s\n", i, debugstr_guid(&pOutTypes[i].type), + debugstr_guid(&pOutTypes[i].subtype)); + } + } + + return IEnumDMO_Constructor(category, flags, cInTypes, pInTypes, cOutTypes, pOutTypes, ppEnum); } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jul 21 23:28:13 2015 @@ -38,7 +38,7 @@ reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29 reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-1.7.47 reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.47 -reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.7.37 +reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.7.47 reactos/dll/directx/wine/qedit # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/quartz # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/wined3d # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
26
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
Results per page:
10
25
50
100
200