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
September 2017
----- 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
17 participants
284 discussions
Start a n
N
ew thread
[akhaldi] 75860: [README.WINE] Update the status of the recently committed syncs. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:52:03 2017 New Revision: 75860 URL:
http://svn.reactos.org/svn/reactos?rev=75860&view=rev
Log: [README.WINE] Update the status of the recently committed syncs. CORE-13762 Modified: trunk/reactos/media/doc/README.WINE 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] Sat Sep 16 20:52:03 2017 @@ -22,25 +22,25 @@ The following libraries are shared with Wine. reactos/dll/directx/wine/amstream # Synced to WineStaging-2.9 -reactos/dll/directx/wine/d3d8 # Synced to WineStaging-2.9 -reactos/dll/directx/wine/d3d9 # Synced to WineStaging-2.9 -reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-1.9.4 -reactos/dll/directx/wine/d3drm # Synced to WineStaging-2.9 +reactos/dll/directx/wine/d3d8 # Synced to WineStaging-2.16 +reactos/dll/directx/wine/d3d9 # Synced to WineStaging-2.16 +reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-2.16 +reactos/dll/directx/wine/d3drm # Synced to WineStaging-2.16 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/d3dxof # Synced to WineStaging-2.9 -reactos/dll/directx/wine/ddraw # Synced to WineStaging-2.9 +reactos/dll/directx/wine/ddraw # Synced to WineStaging-2.16 reactos/dll/directx/wine/devenum # Synced to WineStaging-2.9 -reactos/dll/directx/wine/dinput # Synced to WineStaging-2.9 +reactos/dll/directx/wine/dinput # Synced to WineStaging-2.16 reactos/dll/directx/wine/dinput8 # Synced to WineStaging-2.9 reactos/dll/directx/wine/dmusic # Synced to WineStaging-2.9 reactos/dll/directx/wine/dplay # Synced to WineStaging-2.9 -reactos/dll/directx/wine/dplayx # Synced to WineStaging-2.9 +reactos/dll/directx/wine/dplayx # Synced to WineStaging-2.16 reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29 reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-2.9 reactos/dll/directx/wine/msdmo # Synced to WineStaging-2.9 reactos/dll/directx/wine/qedit # Synced to WineStaging-2.9 -reactos/dll/directx/wine/quartz # Synced to WineStaging-2.9 -reactos/dll/directx/wine/wined3d # Synced to WineStaging-2.9 +reactos/dll/directx/wine/quartz # Synced to WineStaging-2.16 +reactos/dll/directx/wine/wined3d # Synced to WineStaging-2.16 reactos/dll/win32/activeds # Synced to WineStaging-2.9 reactos/dll/win32/actxprxy # Synced to WineStaging-2.9
7 years, 3 months
1
0
0
0
[akhaldi] 75859: [QUARTZ_WINETEST] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:45:12 2017 New Revision: 75859 URL:
http://svn.reactos.org/svn/reactos?rev=75859&view=rev
Log: [QUARTZ_WINETEST] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/rostests/winetests/quartz/CMakeLists.txt trunk/rostests/winetests/quartz/filtergraph.c Modified: trunk/rostests/winetests/quartz/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/quartz/CMakeLis…
============================================================================== --- trunk/rostests/winetests/quartz/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/quartz/CMakeLists.txt [iso-8859-1] Sat Sep 16 20:45:12 2017 @@ -1,3 +1,5 @@ + +add_definitions(-DWINETEST_USE_DBGSTR_LONGLONG) include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) Modified: trunk/rostests/winetests/quartz/filtergraph.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/quartz/filtergr…
============================================================================== --- trunk/rostests/winetests/quartz/filtergraph.c [iso-8859-1] (original) +++ trunk/rostests/winetests/quartz/filtergraph.c [iso-8859-1] Sat Sep 16 20:45:12 2017 @@ -581,21 +581,21 @@ pos = 0xdeadbeef; hr = IMediaSeeking_ConvertTimeFormat(seeking, &pos, NULL, 0x123456789a, NULL); ok(hr == S_OK, "ConvertTimeFormat failed: %08x\n", hr); - ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos); + ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%s)\n", wine_dbgstr_longlong(pos)); pos = 0xdeadbeef; hr = IMediaSeeking_ConvertTimeFormat(seeking, &pos, &TIME_FORMAT_MEDIA_TIME, 0x123456789a, NULL); ok(hr == S_OK, "ConvertTimeFormat failed: %08x\n", hr); - ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos); + ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%s)\n", wine_dbgstr_longlong(pos)); pos = 0xdeadbeef; hr = IMediaSeeking_ConvertTimeFormat(seeking, &pos, NULL, 0x123456789a, &TIME_FORMAT_MEDIA_TIME); ok(hr == S_OK, "ConvertTimeFormat failed: %08x\n", hr); - ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos); + ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%s)\n", wine_dbgstr_longlong(pos)); hr = IMediaSeeking_GetCurrentPosition(seeking, &pos); ok(hr == S_OK, "GetCurrentPosition failed: %08x\n", hr); - ok(pos == 0, "Position != 0 (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos); + ok(pos == 0, "Position != 0 (%s)\n", wine_dbgstr_longlong(pos)); hr = IMediaSeeking_SetPositions(seeking, NULL, AM_SEEKING_ReturnTime, NULL, AM_SEEKING_NoPositioning); ok(hr == S_OK, "SetPositions failed: %08x\n", hr); @@ -606,7 +606,7 @@ pos = 0xdeadbeef; hr = IMediaSeeking_GetCurrentPosition(seeking, &pos); ok(hr == S_OK, "GetCurrentPosition failed: %08x\n", hr); - ok(pos == 0, "Position != 0 (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos); + ok(pos == 0, "Position != 0 (%s)\n", wine_dbgstr_longlong(pos)); hr = IMediaControl_GetState(control, 1000, NULL); ok(hr == E_POINTER, "GetState expected %08x, got %08x\n", E_POINTER, hr);
7 years, 3 months
1
0
0
0
[akhaldi] 75858: [QUARTZ] Sync with Wine Staging 2.16. CORE-13762 84f5761 quartz: Use standard wine_dbgstr_longlong. e994c62 quartz: Use nAvgBytesPerSec to calculate length. e1d14d2 quartz: Restore...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:45:04 2017 New Revision: 75858 URL:
http://svn.reactos.org/svn/reactos?rev=75858&view=rev
Log: [QUARTZ] Sync with Wine Staging 2.16. CORE-13762 84f5761 quartz: Use standard wine_dbgstr_longlong. e994c62 quartz: Use nAvgBytesPerSec to calculate length. e1d14d2 quartz: Restore a comment explaining mediatime. bf9eaac quartz: Small readability fix. Modified: trunk/reactos/dll/directx/wine/quartz/avisplit.c trunk/reactos/dll/directx/wine/quartz/dsoundrender.c trunk/reactos/dll/directx/wine/quartz/filesource.c trunk/reactos/dll/directx/wine/quartz/quartz_private.h trunk/reactos/dll/directx/wine/quartz/vmr9.c trunk/reactos/dll/directx/wine/quartz/waveparser.c Modified: trunk/reactos/dll/directx/wine/quartz/avisplit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/av…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/avisplit.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/avisplit.c [iso-8859-1] Sat Sep 16 20:45:04 2017 @@ -558,7 +558,7 @@ TRACE("bIndexType: %u\n", pIndex->bIndexType); TRACE("nEntriesInUse: %u\n", pIndex->nEntriesInUse); TRACE("dwChunkId: %.4s\n", (char *)&pIndex->dwChunkId); - TRACE("qwBaseOffset: %x%08x\n", (DWORD)(pIndex->qwBaseOffset >> 32), (DWORD)pIndex->qwBaseOffset); + TRACE("qwBaseOffset: %s\n", wine_dbgstr_longlong(pIndex->qwBaseOffset)); TRACE("dwReserved_3: %u\n", pIndex->dwReserved_3); if (pIndex->bIndexType != AVI_INDEX_OF_CHUNKS @@ -578,7 +578,7 @@ { BOOL keyframe = !(pIndex->aIndex[x].dwSize >> 31); DWORDLONG offset = pIndex->qwBaseOffset + pIndex->aIndex[x].dwOffset; - TRACE("dwOffset: %x%08x\n", (DWORD)(offset >> 32), (DWORD)offset); + TRACE("dwOffset: %s\n", wine_dbgstr_longlong(offset)); TRACE("dwSize: %u\n", (pIndex->aIndex[x].dwSize & ~(1u << 31))); TRACE("Frame is a keyframe: %s\n", keyframe ? "yes" : "no"); } @@ -629,9 +629,9 @@ } else if (temp2 != chunkid) { - ERR("Faulty index or bug in handling: Wanted FCC: %s, Abs FCC: %s (@ %x), Rel FCC: %s (@ %.0x%08x)\n", + ERR("Faulty index or bug in handling: Wanted FCC: %s, Abs FCC: %s (@ %x), Rel FCC: %s (@ %s)\n", debugstr_an((char *)&chunkid, 4), debugstr_an((char *)&temp, 4), offset, - debugstr_an((char *)&temp2, 4), (DWORD)((mov_pos + offset) >> 32), (DWORD)(mov_pos + offset)); + debugstr_an((char *)&temp2, 4), wine_dbgstr_longlong(mov_pos + offset)); relative = -1; } else @@ -828,7 +828,7 @@ stream->stdindex = CoTaskMemRealloc(stream->stdindex, sizeof(*stream->stdindex) * stream->entries); for (x = 0; x < pIndex->nEntriesInUse; ++x) { - TRACE("qwOffset: %x%08x\n", (DWORD)(pIndex->aIndex[x].qwOffset >> 32), (DWORD)pIndex->aIndex[x].qwOffset); + TRACE("qwOffset: %s\n", wine_dbgstr_longlong(pIndex->aIndex[x].qwOffset)); TRACE("dwSize: %u\n", pIndex->aIndex[x].dwSize); TRACE("dwDuration: %u (unreliable)\n", pIndex->aIndex[x].dwDuration); @@ -1117,7 +1117,7 @@ pAviSplit->EndOfFile = This->rtStop = MEDIATIME_FROM_BYTES(pos); if (pos > total) { - ERR("File smaller (%x%08x) then EndOfFile (%x%08x)\n", (DWORD)(total >> 32), (DWORD)total, (DWORD)(pAviSplit->EndOfFile >> 32), (DWORD)pAviSplit->EndOfFile); + ERR("File smaller (%s) then EndOfFile (%s)\n", wine_dbgstr_longlong(total), wine_dbgstr_longlong(pAviSplit->EndOfFile)); return E_FAIL; } Modified: trunk/reactos/dll/directx/wine/quartz/dsoundrender.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/ds…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/dsoundrender.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/dsoundrender.c [iso-8859-1] Sat Sep 16 20:45:04 2017 @@ -97,9 +97,9 @@ static DWORD pos_from_time(DSoundRenderImpl *This, REFERENCE_TIME time) { WAVEFORMATEX *wfx = (WAVEFORMATEX*)This->renderer.pInputPin->pin.mtCurrent.pbFormat; REFERENCE_TIME ret = time; - ret *= wfx->nSamplesPerSec; + ret *= wfx->nAvgBytesPerSec; ret /= 10000000; - ret *= wfx->nBlockAlign; + ret -= ret % wfx->nBlockAlign; return ret; } @@ -406,7 +406,7 @@ TRACE("Format = %p\n", format); TRACE("wFormatTag = %x %x\n", format->wFormatTag, WAVE_FORMAT_PCM); TRACE("nChannels = %d\n", format->nChannels); - TRACE("nSamplesPerSec = %d\n", format->nAvgBytesPerSec); + TRACE("nSamplesPerSec = %d\n", format->nSamplesPerSec); TRACE("nAvgBytesPerSec = %d\n", format->nAvgBytesPerSec); TRACE("nBlockAlign = %d\n", format->nBlockAlign); TRACE("wBitsPerSample = %d\n", format->wBitsPerSample); 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] Sat Sep 16 20:45:04 2017 @@ -1320,7 +1320,7 @@ HRESULT hr = S_OK; FileAsyncReader *This = impl_from_IAsyncReader(iface); - TRACE("(%x%08x, %d, %p)\n", (ULONG)(llPosition >> 32), (ULONG)llPosition, lLength, pBuffer); + TRACE("(%s, %d, %p)\n", wine_dbgstr_longlong(llPosition), lLength, pBuffer); ZeroMemory(&ovl, sizeof(ovl)); Modified: trunk/reactos/dll/directx/wine/quartz/quartz_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/qu…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/quartz_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/quartz_private.h [iso-8859-1] Sat Sep 16 20:45:04 2017 @@ -52,6 +52,7 @@ #include "pin.h" #include "parser.h" +/* see IAsyncReader::Request on MSDN for the explanation of this */ #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000) #define SEC_FROM_MEDIATIME(time) ((time) / 10000000) #define BYTES_FROM_MEDIATIME(time) SEC_FROM_MEDIATIME(time) Modified: trunk/reactos/dll/directx/wine/quartz/vmr9.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/vm…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/vmr9.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/vmr9.c [iso-8859-1] Sat Sep 16 20:45:04 2017 @@ -365,7 +365,7 @@ ERR("Format type %s not supported\n", debugstr_guid(&pmt->formattype)); return S_FALSE; } - if (This->bmiheader.biCompression) + if (This->bmiheader.biCompression != BI_RGB) return S_FALSE; return S_OK; } Modified: trunk/reactos/dll/directx/wine/quartz/waveparser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/wa…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/waveparser.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/waveparser.c [iso-8859-1] Sat Sep 16 20:45:04 2017 @@ -27,9 +27,8 @@ ParserImpl Parser; LONGLONG StartOfFile; /* in media time */ LONGLONG EndOfFile; - DWORD dwSampleSize; - DWORD nSamplesPerSec; - DWORD dwLength; + DWORD nAvgBytesPerSec; + DWORD nBlockAlign; } WAVEParserImpl; static inline WAVEParserImpl *impl_from_IMediaSeeking( IMediaSeeking *iface ) @@ -46,7 +45,7 @@ { LONGLONG duration = BYTES_FROM_MEDIATIME(bytepos - This->StartOfFile); duration *= 10000000; - duration /= (This->dwSampleSize * This->nSamplesPerSec); + duration /= This->nAvgBytesPerSec; return duration; } @@ -55,11 +54,11 @@ { LONGLONG bytepos; - bytepos = (This->dwSampleSize * This->nSamplesPerSec); + bytepos = This->nAvgBytesPerSec; bytepos *= duration; bytepos /= 10000000; + bytepos -= bytepos % This->nBlockAlign; bytepos += BYTES_FROM_MEDIATIME(This->StartOfFile); - bytepos -= bytepos % This->dwSampleSize; return MEDIATIME_FROM_BYTES(bytepos); } @@ -236,7 +235,6 @@ PIN_INFO piOutput; AM_MEDIA_TYPE amt; WAVEParserImpl * pWAVEParser = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); - LONGLONG length, avail; piOutput.dir = PINDIR_OUTPUT; piOutput.pFilter = &pWAVEParser->Parser.filter.IBaseFilter_iface; @@ -305,10 +303,8 @@ props->cbPrefix = 0; props->cbBuffer = 4096; props->cBuffers = 3; - pWAVEParser->dwSampleSize = ((WAVEFORMATEX*)amt.pbFormat)->nBlockAlign; - IAsyncReader_Length(This->pReader, &length, &avail); - pWAVEParser->dwLength = length / (ULONGLONG)pWAVEParser->dwSampleSize; - pWAVEParser->nSamplesPerSec = ((WAVEFORMATEX*)amt.pbFormat)->nSamplesPerSec; + pWAVEParser->nBlockAlign = ((WAVEFORMATEX*)amt.pbFormat)->nBlockAlign; + pWAVEParser->nAvgBytesPerSec = ((WAVEFORMATEX*)amt.pbFormat)->nAvgBytesPerSec; hr = Parser_AddPin(&(pWAVEParser->Parser), &piOutput, props, &amt); CoTaskMemFree(amt.pbFormat);
7 years, 3 months
1
0
0
0
[akhaldi] 75857: [DPLAYX_WINETEST] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:44:56 2017 New Revision: 75857 URL:
http://svn.reactos.org/svn/reactos?rev=75857&view=rev
Log: [DPLAYX_WINETEST] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/rostests/winetests/dplayx/dplayx.c Modified: trunk/rostests/winetests/dplayx/dplayx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dplayx/dplayx.c…
============================================================================== --- trunk/rostests/winetests/dplayx/dplayx.c [iso-8859-1] (original) +++ trunk/rostests/winetests/dplayx/dplayx.c [iso-8859-1] Sat Sep 16 20:44:56 2017 @@ -1262,7 +1262,7 @@ /* Regular operation */ hr = IDirectPlayX_Open( pDP_server, &dpsd_server, DPOPEN_CREATE ); - checkHR( DP_OK, hr ); + todo_wine checkHR( DP_OK, hr ); /* Opening twice */ hr = IDirectPlayX_Open( pDP_server, &dpsd_server, DPOPEN_CREATE ); @@ -1288,15 +1288,15 @@ /* - Checking how strict dplay is with sizes */ dpsd.dwSize = 0; hr = IDirectPlayX_Open( pDP, &dpsd, DPOPEN_JOIN ); - todo_wine checkHR( DPERR_INVALIDPARAMS, hr ); + checkHR( DPERR_INVALIDPARAMS, hr ); dpsd.dwSize = sizeof(DPSESSIONDESC2)-1; hr = IDirectPlayX_Open( pDP, &dpsd, DPOPEN_JOIN ); - todo_wine checkHR( DPERR_INVALIDPARAMS, hr ); + checkHR( DPERR_INVALIDPARAMS, hr ); dpsd.dwSize = sizeof(DPSESSIONDESC2)+1; hr = IDirectPlayX_Open( pDP, &dpsd, DPOPEN_JOIN ); - todo_wine checkHR( DPERR_INVALIDPARAMS, hr ); + checkHR( DPERR_INVALIDPARAMS, hr ); dpsd.dwSize = sizeof(DPSESSIONDESC2); hr = IDirectPlayX_Open( pDP, &dpsd, DPOPEN_JOIN ); @@ -1331,7 +1331,7 @@ dpsd_server.dwSize = 0; hr = IDirectPlayX_Open( pDP_server, &dpsd_server, DPOPEN_CREATE ); - todo_wine checkHR( DPERR_INVALIDPARAMS, hr ); + checkHR( DPERR_INVALIDPARAMS, hr ); dpsd_server.dwSize = sizeof(DPSESSIONDESC2);
7 years, 3 months
1
0
0
0
[akhaldi] 75856: [DPLAYX] Sync with Wine Staging 2.16. CORE-13762 6a6f336 dplayx: Implement IDirectPlayLobby3 EnumAddressTypes. 2ef274b dplayx: Implement IDirectPlay4 EnumConnections. 4f4b3be dplay...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:44:50 2017 New Revision: 75856 URL:
http://svn.reactos.org/svn/reactos?rev=75856&view=rev
Log: [DPLAYX] Sync with Wine Staging 2.16. CORE-13762 6a6f336 dplayx: Implement IDirectPlayLobby3 EnumAddressTypes. 2ef274b dplayx: Implement IDirectPlay4 EnumConnections. 4f4b3be dplayx: First name server address may be null. Modified: trunk/reactos/dll/directx/wine/dplayx/dplay.c trunk/reactos/dll/directx/wine/dplayx/dplobby.c trunk/reactos/dll/directx/wine/dplayx/name_server.c Modified: trunk/reactos/dll/directx/wine/dplayx/dplay.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/dp…
============================================================================== --- trunk/reactos/dll/directx/wine/dplayx/dplay.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dplayx/dplay.c [iso-8859-1] Sat Sep 16 20:44:50 2017 @@ -4466,8 +4466,8 @@ const GUID *application, LPDPENUMCONNECTIONSCALLBACK enumcb, void *context, DWORD flags ) { IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); - FIXME( "(%p)->(%p,%p,%p,0x%08x): stub\n", This, application, enumcb, context, flags ); - return DP_OK; + return IDirectPlayX_EnumConnections( &This->IDirectPlay4A_iface, application, enumcb, context, + flags ); } static HRESULT WINAPI IDirectPlay3AImpl_EnumGroupsInGroup( IDirectPlay3A *iface, DPID group, Modified: trunk/reactos/dll/directx/wine/dplayx/dplobby.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/dp…
============================================================================== --- trunk/reactos/dll/directx/wine/dplayx/dplobby.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dplayx/dplobby.c [iso-8859-1] Sat Sep 16 20:44:50 2017 @@ -815,8 +815,9 @@ static HRESULT WINAPI IDirectPlayLobby3Impl_EnumAddressTypes( IDirectPlayLobby3 *iface, LPDPLENUMADDRESSTYPESCALLBACK enumaddrtypecb, REFGUID sp, void *context, DWORD flags ) { - FIXME(":stub\n"); - return DPERR_OUTOFMEMORY; + IDirectPlayLobbyImpl *This = impl_from_IDirectPlayLobby3( iface ); + return IDirectPlayLobby_EnumAddressTypes( &This->IDirectPlayLobby3A_iface, enumaddrtypecb, sp, + context, flags ); } /******************************************************************** Modified: trunk/reactos/dll/directx/wine/dplayx/name_server.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dplayx/na…
============================================================================== --- trunk/reactos/dll/directx/wine/dplayx/name_server.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dplayx/name_server.c [iso-8859-1] Sat Sep 16 20:44:50 2017 @@ -147,7 +147,10 @@ * in place. */ #if 1 - return lpCache->first.lpQHFirst->lpNSAddrHdr; + if ( lpCache->first.lpQHFirst ) + return lpCache->first.lpQHFirst->lpNSAddrHdr; + + return NULL; #else /* FIXME: Should convert over to this */ return lpCache->bNsIsLocal ? lpCache->lpLocalAddrHdr
7 years, 3 months
1
0
0
0
[akhaldi] 75855: [DINPUT] Sync with Wine Staging 2.16. CORE-13762 5214b47 dinput: Do not wait for hook thread startup in IDirectInput8::Initialize. 83a3887 dinput: Avoid possible deadlock when CS a...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:44:43 2017 New Revision: 75855 URL:
http://svn.reactos.org/svn/reactos?rev=75855&view=rev
Log: [DINPUT] Sync with Wine Staging 2.16. CORE-13762 5214b47 dinput: Do not wait for hook thread startup in IDirectInput8::Initialize. 83a3887 dinput: Avoid possible deadlock when CS are acquired in different order. 49fdde1 dinput: Use proper size for combobox controls. b50d1fa dinput: Limit axes while remaping broken devices. Modified: trunk/reactos/dll/directx/wine/dinput/device.c trunk/reactos/dll/directx/wine/dinput/dinput.rc trunk/reactos/dll/directx/wine/dinput/dinput_main.c trunk/reactos/dll/directx/wine/dinput/dinput_private.h trunk/reactos/dll/directx/wine/dinput/joystick_linux.c Modified: trunk/reactos/dll/directx/wine/dinput/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/de…
============================================================================== --- trunk/reactos/dll/directx/wine/dinput/device.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dinput/device.c [iso-8859-1] Sat Sep 16 20:44:43 2017 @@ -976,9 +976,9 @@ EnterCriticalSection(&This->crit); res = This->acquired ? S_FALSE : DI_OK; This->acquired = 1; + LeaveCriticalSection(&This->crit); if (res == DI_OK) - check_dinput_hooks(iface); - LeaveCriticalSection(&This->crit); + check_dinput_hooks(iface, TRUE); return res; } @@ -1004,9 +1004,9 @@ EnterCriticalSection(&This->crit); res = !This->acquired ? DI_NOEFFECT : DI_OK; This->acquired = 0; + LeaveCriticalSection(&This->crit); if (res == DI_OK) - check_dinput_hooks(iface); - LeaveCriticalSection(&This->crit); + check_dinput_hooks(iface, FALSE); return res; } Modified: trunk/reactos/dll/directx/wine/dinput/dinput.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/di…
============================================================================== --- trunk/reactos/dll/directx/wine/dinput/dinput.rc [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dinput/dinput.rc [iso-8859-1] Sat Sep 16 20:44:43 2017 @@ -50,8 +50,8 @@ DEFPUSHBUTTON "OK", IDOK, 10, 236, 50, 14 PUSHBUTTON "Cancel", IDCANCEL, 65, 236, 50, 14 PUSHBUTTON "Reset", IDC_RESET, 210, 236, 50, 14 - COMBOBOX IDC_PLAYERCOMBO, 10, 50, 90, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS - COMBOBOX IDC_CONTROLLERCOMBO, 10, 20, 90, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS + COMBOBOX IDC_PLAYERCOMBO, 10, 50, 90, 60, CBS_DROPDOWNLIST | CBS_HASSTRINGS + COMBOBOX IDC_CONTROLLERCOMBO, 10, 20, 90, 60, CBS_DROPDOWNLIST | CBS_HASSTRINGS LTEXT "Player", IDC_PLAYERTEXT, 10, 40, 90, 8, SS_LEFT LTEXT "Device", IDC_DEVICETEXT, 10, 10, 90, 8, SS_LEFT LTEXT "Actions", IDC_ACTIONTEXT, 10, 70, 90, 8, SS_LEFT Modified: trunk/reactos/dll/directx/wine/dinput/dinput_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/di…
============================================================================== --- trunk/reactos/dll/directx/wine/dinput/dinput_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dinput/dinput_main.c [iso-8859-1] Sat Sep 16 20:44:43 2017 @@ -1754,7 +1754,7 @@ return hook_thread_id != 0; } -void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface) +void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface, BOOL acquired) { static HHOOK callwndproc_hook; static ULONG foreground_cnt; @@ -1764,7 +1764,7 @@ if (dev->dwCoopLevel & DISCL_FOREGROUND) { - if (dev->acquired) + if (acquired) foreground_cnt++; else foreground_cnt--; Modified: trunk/reactos/dll/directx/wine/dinput/dinput_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/di…
============================================================================== --- trunk/reactos/dll/directx/wine/dinput/dinput_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dinput/dinput_private.h [iso-8859-1] Sat Sep 16 20:44:43 2017 @@ -85,7 +85,7 @@ extern const struct dinput_device joystick_linuxinput_device DECLSPEC_HIDDEN; extern const struct dinput_device joystick_osx_device DECLSPEC_HIDDEN; -extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W) DECLSPEC_HIDDEN; +extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W, BOOL) DECLSPEC_HIDDEN; extern void check_dinput_events(void) DECLSPEC_HIDDEN; typedef int (*DI_EVENT_PROC)(LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM); Modified: trunk/reactos/dll/directx/wine/dinput/joystick_linux.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/jo…
============================================================================== --- trunk/reactos/dll/directx/wine/dinput/joystick_linux.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dinput/joystick_linux.c [iso-8859-1] Sat Sep 16 20:44:43 2017 @@ -233,10 +233,14 @@ /* If no axes were configured but there are axes assume a 1-to-1 (wii controller) */ if (joydev.axis_count && !found_axes) { + int axes_limit = min(joydev.axis_count, 8); /* generic driver limit */ + ERR("Incoherent joystick data, advertised %d axes, detected 0. Assuming 1-to-1.\n", - joydev.axis_count); - for (j = 0; j < joydev.axis_count; j++) + joydev.axis_count); + for (j = 0; j < axes_limit; j++) joydev.dev_axes_map[j] = j; + + joydev.axis_count = axes_limit; } }
7 years, 3 months
1
0
0
0
[akhaldi] 75854: [D3DRM_WINETEST] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:44:31 2017 New Revision: 75854 URL:
http://svn.reactos.org/svn/reactos?rev=75854&view=rev
Log: [D3DRM_WINETEST] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/rostests/winetests/d3drm/d3drm.c 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] Sat Sep 16 20:44:31 2017 @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <limits.h> + #define COBJMACROS #include <d3d.h> #include <initguid.h> @@ -40,9 +42,37 @@ return IUnknown_Release( object ); } -static BOOL match_float(float a, float b) +static BOOL compare_float(float f, float g, unsigned int ulps) { - return (a - b) < 0.000001f; + int x = *(int *)&f; + int y = *(int *)&g; + + if (x < 0) + x = INT_MIN - x; + if (y < 0) + y = INT_MIN - y; + + if (abs(x - y) > ulps) + return FALSE; + + return TRUE; +} + +#define check_vector(a, b, c, d, e) check_vector_(__LINE__, a, b, c, d, e) +static void check_vector_(unsigned int line, const D3DVECTOR *v, float x, float y, float z, unsigned int ulps) +{ + BOOL ret = compare_float(U1(v)->x, x, ulps) + && compare_float(U2(v)->y, y, ulps) + && compare_float(U3(v)->z, z, ulps); + + ok_(__FILE__, line)(ret, "Got unexpected vector {%.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e}.\n", + U1(v)->x, U2(v)->y, U3(v)->z, x, y, z); +} + +#define vector_eq(a, b) vector_eq_(__LINE__, a, b) +static void vector_eq_(unsigned int line, const D3DVECTOR *left, const D3DVECTOR *right) +{ + check_vector_(line, left, U1(right)->x, U2(right)->y, U3(right)->z, 0); } static D3DRMMATRIX4D identity = { @@ -51,6 +81,133 @@ { 0.0f, 0.0f, 1.0f, 0.0f }, { 0.0f, 0.0f, 0.0f, 1.0f } }; + +static HWND create_window(void) +{ + RECT r = {0, 0, 640, 480}; + + AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW | WS_VISIBLE, FALSE); + + return CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, r.right - r.left, r.bottom - r.top, NULL, NULL, NULL, NULL); +} + +#define test_class_name(a, b) test_class_name_(__LINE__, a, b) +static void test_class_name_(unsigned int line, IDirect3DRMObject *object, const char *name) +{ + char cname[64] = {0}; + DWORD size, size2; + HRESULT hr; + + hr = IDirect3DRMObject_GetClassName(object, NULL, cname); + ok_(__FILE__, line)(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DRMViewport_GetClassName(object, NULL, NULL); + ok_(__FILE__, line)(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + size = 0; + hr = IDirect3DRMObject_GetClassName(object, &size, NULL); + ok_(__FILE__, line)(hr == D3DRM_OK, "Failed to get classname size, hr %#x.\n", hr); + ok_(__FILE__, line)(size == strlen(name) + 1, "wrong size: %u\n", size); + + size = size2 = !!*name; + hr = IDirect3DRMObject_GetClassName(object, &size, cname); + ok_(__FILE__, line)(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok_(__FILE__, line)(size == size2, "Got size %u.\n", size); + + size = sizeof(cname); + hr = IDirect3DRMObject_GetClassName(object, &size, cname); + ok_(__FILE__, line)(hr == D3DRM_OK, "Failed to get classname, hr %#x.\n", hr); + ok_(__FILE__, line)(size == strlen(name) + 1, "wrong size: %u\n", size); + ok_(__FILE__, line)(!strcmp(cname, name), "Expected cname to be \"%s\", but got \"%s\".\n", name, cname); + + size = strlen(name) + 1; + hr = IDirect3DRMObject_GetClassName(object, &size, cname); + ok_(__FILE__, line)(hr == D3DRM_OK, "Failed to get classname, hr %#x.\n", hr); + ok_(__FILE__, line)(size == strlen(name) + 1, "wrong size: %u\n", size); + ok_(__FILE__, line)(!strcmp(cname, name), "Expected cname to be \"%s\", but got \"%s\".\n", name, cname); + + size = strlen(name); + strcpy(cname, "XXX"); + hr = IDirect3DRMObject_GetClassName(object, &size, cname); + ok_(__FILE__, line)(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok_(__FILE__, line)(size == strlen(name), "Wrong classname size: %u.\n", size); + ok_(__FILE__, line)(!strcmp(cname, "XXX"), "Expected unchanged buffer, but got \"%s\".\n", cname); +} + +#define test_object_name(a) test_object_name_(__LINE__, a) +static void test_object_name_(unsigned int line, IDirect3DRMObject *object) +{ + char name[64] = {0}; + HRESULT hr; + DWORD size; + + hr = IDirect3DRMObject_GetName(object, NULL, NULL); + ok_(__FILE__, line)(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + name[0] = 0x1f; + hr = IDirect3DRMObject_GetName(object, NULL, name); + ok_(__FILE__, line)(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok_(__FILE__, line)(name[0] == 0x1f, "Unexpected buffer contents, %#x.\n", name[0]); + + /* Name is not set yet. */ + size = 100; + hr = IDirect3DRMObject_GetName(object, &size, NULL); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get name size, hr %#x.\n", hr); + ok_(__FILE__, line)(size == 0, "Unexpected size %u.\n", size); + + size = sizeof(name); + name[0] = 0x1f; + hr = IDirect3DRMObject_GetName(object, &size, name); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get name size, hr %#x.\n", hr); + ok_(__FILE__, line)(size == 0, "Unexpected size %u.\n", size); + ok_(__FILE__, line)(name[0] == 0, "Unexpected name \"%s\".\n", name); + + size = 0; + name[0] = 0x1f; + hr = IDirect3DRMObject_GetName(object, &size, name); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get name size, hr %#x.\n", hr); + ok_(__FILE__, line)(size == 0, "Unexpected size %u.\n", size); + ok_(__FILE__, line)(name[0] == 0x1f, "Unexpected name \"%s\".\n", name); + + hr = IDirect3DRMObject_SetName(object, NULL); + ok_(__FILE__, line)(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DRMObject_SetName(object, "name"); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to set a name, hr %#x.\n", hr); + + size = 0; + hr = IDirect3DRMObject_GetName(object, &size, NULL); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get name size, hr %#x.\n", hr); + ok_(__FILE__, line)(size == strlen("name") + 1, "Unexpected size %u.\n", size); + + size = strlen("name") + 1; + hr = IDirect3DRMObject_GetName(object, &size, name); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get name size, hr %#x.\n", hr); + ok_(__FILE__, line)(size == strlen("name") + 1, "Unexpected size %u.\n", size); + ok_(__FILE__, line)(!strcmp(name, "name"), "Unexpected name \"%s\".\n", name); + + size = 2; + name[0] = 0x1f; + hr = IDirect3DRMObject_GetName(object, &size, name); + ok_(__FILE__, line)(hr == E_INVALIDARG, "Failed to get object name, hr %#x.\n", hr); + ok_(__FILE__, line)(size == 2, "Unexpected size %u.\n", size); + ok_(__FILE__, line)(name[0] == 0x1f, "Got unexpected name \"%s\".\n", name); + + hr = IDirect3DRMObject_SetName(object, NULL); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to set object name, hr %#x.\n", hr); + + size = 1; + hr = IDirect3DRMObject_GetName(object, &size, NULL); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get name size, hr %#x.\n", hr); + ok_(__FILE__, line)(size == 0, "Unexpected size %u.\n", size); + + size = 1; + name[0] = 0x1f; + hr = IDirect3DRMObject_GetName(object, &size, name); + ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get name size, hr %#x.\n", hr); + ok_(__FILE__, line)(size == 0, "Unexpected size %u.\n", size); + ok_(__FILE__, line)(name[0] == 0, "Got unexpected name \"%s\".\n", name); +} static char data_bad_version[] = "xof 0302txt 0064\n" @@ -203,6 +360,7 @@ HRESULT hr; IDirect3DRM *d3drm; IDirect3DRMMeshBuilder *pMeshBuilder; + IDirect3DRMMeshBuilder3 *meshbuilder3; IDirect3DRMMesh *mesh; D3DRMLOADMEMORY info; int val; @@ -214,7 +372,7 @@ char name[10]; DWORD size; D3DCOLOR color; - CHAR cname[64] = {0}; + IUnknown *unk; hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); @@ -222,18 +380,33 @@ hr = IDirect3DRM_CreateMeshBuilder(d3drm, &pMeshBuilder); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMeshBuilder interface (hr = %x)\n", hr); - hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof(cname); - hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Builder"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Builder"), "Expected cname to be \"Builder\", but got \"%s\"\n", cname); + hr = IDirect3DRMMeshBuilder_QueryInterface(pMeshBuilder, &IID_IDirect3DRMObject, (void **)&unk); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, %#x.\n", hr); + ok(unk == (IUnknown *)pMeshBuilder, "Unexpected interface pointer.\n"); + IUnknown_Release(unk); + + hr = IDirect3DRMMeshBuilder_QueryInterface(pMeshBuilder, &IID_IDirect3DRMVisual, (void **)&unk); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMVisual, %#x.\n", hr); + ok(unk == (IUnknown *)pMeshBuilder, "Unexpected interface pointer.\n"); + IUnknown_Release(unk); + + hr = IDirect3DRMMeshBuilder_QueryInterface(pMeshBuilder, &IID_IDirect3DRMMeshBuilder3, (void **)&meshbuilder3); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMMeshBuilder3, %#x.\n", hr); + + hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder3, &IID_IDirect3DRMObject, (void **)&unk); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, %#x.\n", hr); + ok(unk == (IUnknown *)pMeshBuilder, "Unexpected interface pointer.\n"); + IUnknown_Release(unk); + + hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder3, &IID_IDirect3DRMVisual, (void **)&unk); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMVisual, %#x.\n", hr); + ok(unk == (IUnknown *)pMeshBuilder, "Unexpected interface pointer.\n"); + IUnknown_Release(unk); + + IDirect3DRMMeshBuilder3_Release(meshbuilder3); + + test_class_name((IDirect3DRMObject *)pMeshBuilder, "Builder"); + test_object_name((IDirect3DRMObject *)pMeshBuilder); info.lpMemory = data_bad_version; info.dSize = strlen(data_bad_version); @@ -285,18 +458,10 @@ /* Check that Load method generated default normals */ hr = IDirect3DRMMeshBuilder_GetVertices(pMeshBuilder, NULL, NULL, &val2, n, NULL, NULL); ok(hr == D3DRM_OK, "Cannot get vertices information (hr = %x)\n", hr); - ok(match_float(U1(n[0]).x, 0.577350f), "Wrong component n[0].x = %f (expected %f)\n", U1(n[0]).x, 0.577350f); - ok(match_float(U2(n[0]).y, 0.577350f), "Wrong component n[0].y = %f (expected %f)\n", U2(n[0]).y, 0.577350f); - ok(match_float(U3(n[0]).z, 0.577350f), "Wrong component n[0].z = %f (expected %f)\n", U3(n[0]).z, 0.577350f); - ok(match_float(U1(n[1]).x, -0.229416f), "Wrong component n[1].x = %f (expected %f)\n", U1(n[1]).x, -0.229416f); - ok(match_float(U2(n[1]).y, 0.688247f), "Wrong component n[1].y = %f (expected %f)\n", U2(n[1]).y, 0.688247f); - ok(match_float(U3(n[1]).z, 0.688247f), "Wrong component n[1].z = %f (expected %f)\n", U3(n[1]).z, 0.688247f); - ok(match_float(U1(n[2]).x, -0.229416f), "Wrong component n[2].x = %f (expected %f)\n", U1(n[2]).x, -0.229416f); - ok(match_float(U2(n[2]).y, 0.688247f), "Wrong component n[2].y = %f (expected %f)\n", U2(n[2]).y, 0.688247f); - ok(match_float(U3(n[2]).z, 0.688247f), "Wrong component n[2].z = %f (expected %f)\n", U3(n[2]).z, 0.688247f); - ok(match_float(U1(n[3]).x, -0.577350f), "Wrong component n[3].x = %f (expected %f)\n", U1(n[3]).x, -0.577350f); - ok(match_float(U2(n[3]).y, 0.577350f), "Wrong component n[3].y = %f (expected %f)\n", U2(n[3]).y, 0.577350f); - ok(match_float(U3(n[3]).z, 0.577350f), "Wrong component n[3].z = %f (expected %f)\n", U3(n[3]).z, 0.577350f); + check_vector(&n[0], 0.577350f, 0.577350f, 0.577350f, 32); + check_vector(&n[1], -0.229416f, 0.688247f, 0.688247f, 32); + check_vector(&n[2], -0.229416f, 0.688247f, 0.688247f, 32); + check_vector(&n[3], -0.577350f, 0.577350f, 0.577350f, 32); /* Check that Load method generated default texture coordinates (0.0f, 0.0f) for each vertex */ valu = 1.23f; @@ -392,24 +557,12 @@ ok(val1 == 3, "Wrong number of vertices %d (must be 3)\n", val1); ok(val2 == 3, "Wrong number of normals %d (must be 3)\n", val2); ok(val3 == 8, "Wrong number of face data bytes %d (must be 8)\n", val3); - ok(U1(v[0]).x == 0.1f, "Wrong component v[0].x = %f (expected 0.1)\n", U1(v[0]).x); - ok(U2(v[0]).y == 0.2f, "Wrong component v[0].y = %f (expected 0.2)\n", U2(v[0]).y); - ok(U3(v[0]).z == 0.3f, "Wrong component v[0].z = %f (expected 0.3)\n", U3(v[0]).z); - ok(U1(v[1]).x == 0.4f, "Wrong component v[1].x = %f (expected 0.4)\n", U1(v[1]).x); - ok(U2(v[1]).y == 0.5f, "Wrong component v[1].y = %f (expected 0.5)\n", U2(v[1]).y); - ok(U3(v[1]).z == 0.6f, "Wrong component v[1].z = %f (expected 0.6)\n", U3(v[1]).z); - ok(U1(v[2]).x == 0.7f, "Wrong component v[2].x = %f (expected 0.7)\n", U1(v[2]).x); - ok(U2(v[2]).y == 0.8f, "Wrong component v[2].y = %f (expected 0.8)\n", U2(v[2]).y); - ok(U3(v[2]).z == 0.9f, "Wrong component v[2].z = %f (expected 0.9)\n", U3(v[2]).z); - ok(U1(n[0]).x == 1.1f, "Wrong component n[0].x = %f (expected 1.1)\n", U1(n[0]).x); - ok(U2(n[0]).y == 1.2f, "Wrong component n[0].y = %f (expected 1.2)\n", U2(n[0]).y); - ok(U3(n[0]).z == 1.3f, "Wrong component n[0].z = %f (expected 1.3)\n", U3(n[0]).z); - ok(U1(n[1]).x == 1.4f, "Wrong component n[1].x = %f (expected 1.4)\n", U1(n[1]).x); - ok(U2(n[1]).y == 1.5f, "Wrong component n[1].y = %f (expected 1.5)\n", U2(n[1]).y); - ok(U3(n[1]).z == 1.6f, "Wrong component n[1].z = %f (expected 1.6)\n", U3(n[1]).z); - ok(U1(n[2]).x == 1.7f, "Wrong component n[2].x = %f (expected 1.7)\n", U1(n[2]).x); - ok(U2(n[2]).y == 1.8f, "Wrong component n[2].y = %f (expected 1.8)\n", U2(n[2]).y); - ok(U3(n[2]).z == 1.9f, "Wrong component n[2].z = %f (expected 1.9)\n", U3(n[2]).z); + check_vector(&v[0], 0.1f, 0.2f, 0.3f, 32); + check_vector(&v[1], 0.4f, 0.5f, 0.6f, 32); + check_vector(&v[2], 0.7f, 0.8f, 0.9f, 32); + check_vector(&n[0], 1.1f, 1.2f, 1.3f, 32); + check_vector(&n[1], 1.4f, 1.5f, 1.6f, 32); + check_vector(&n[2], 1.7f, 1.8f, 1.9f, 32); ok(f[0] == 3 , "Wrong component f[0] = %d (expected 3)\n", f[0]); ok(f[1] == 0 , "Wrong component f[1] = %d (expected 0)\n", f[1]); ok(f[2] == 0 , "Wrong component f[2] = %d (expected 0)\n", f[2]); @@ -472,25 +625,14 @@ ok(hr == D3DRM_OK, "Cannot get vertices information (hr = %x)\n", hr); ok(val2 == 3, "Wrong number of normals %d (must be 3)\n", val2); ok(val1 == 3, "Wrong number of vertices %d (must be 3)\n", val1); - ok(U1(v[0]).x == 0.1f*2, "Wrong component v[0].x = %f (expected %f)\n", U1(v[0]).x, 0.1f*2); - ok(U2(v[0]).y == 0.2f*3, "Wrong component v[0].y = %f (expected %f)\n", U2(v[0]).y, 0.2f*3); - ok(U3(v[0]).z == 0.3f*4, "Wrong component v[0].z = %f (expected %f)\n", U3(v[0]).z, 0.3f*4); - ok(U1(v[1]).x == 0.4f*2, "Wrong component v[1].x = %f (expected %f)\n", U1(v[1]).x, 0.4f*2); - ok(U2(v[1]).y == 0.5f*3, "Wrong component v[1].y = %f (expected %f)\n", U2(v[1]).y, 0.5f*3); - ok(U3(v[1]).z == 0.6f*4, "Wrong component v[1].z = %f (expected %f)\n", U3(v[1]).z, 0.6f*4); - ok(U1(v[2]).x == 0.7f*2, "Wrong component v[2].x = %f (expected %f)\n", U1(v[2]).x, 0.7f*2); - ok(U2(v[2]).y == 0.8f*3, "Wrong component v[2].y = %f (expected %f)\n", U2(v[2]).y, 0.8f*3); - ok(U3(v[2]).z == 0.9f*4, "Wrong component v[2].z = %f (expected %f)\n", U3(v[2]).z, 0.9f*4); + + check_vector(&v[0], 0.1f * 2, 0.2f * 3, 0.3f * 4, 32); + check_vector(&v[1], 0.4f * 2, 0.5f * 3, 0.6f * 4, 32); + check_vector(&v[2], 0.7f * 2, 0.8f * 3, 0.9f * 4, 32); /* Normals are not affected by Scale */ - ok(U1(n[0]).x == 1.1f, "Wrong component n[0].x = %f (expected %f)\n", U1(n[0]).x, 1.1f); - ok(U2(n[0]).y == 1.2f, "Wrong component n[0].y = %f (expected %f)\n", U2(n[0]).y, 1.2f); - ok(U3(n[0]).z == 1.3f, "Wrong component n[0].z = %f (expected %f)\n", U3(n[0]).z, 1.3f); - ok(U1(n[1]).x == 1.4f, "Wrong component n[1].x = %f (expected %f)\n", U1(n[1]).x, 1.4f); - ok(U2(n[1]).y == 1.5f, "Wrong component n[1].y = %f (expected %f)\n", U2(n[1]).y, 1.5f); - ok(U3(n[1]).z == 1.6f, "Wrong component n[1].z = %f (expected %f)\n", U3(n[1]).z, 1.6f); - ok(U1(n[2]).x == 1.7f, "Wrong component n[2].x = %f (expected %f)\n", U1(n[2]).x, 1.7f); - ok(U2(n[2]).y == 1.8f, "Wrong component n[2].y = %f (expected %f)\n", U2(n[2]).y, 1.8f); - ok(U3(n[2]).z == 1.9f, "Wrong component n[2].z = %f (expected %f)\n", U3(n[2]).z, 1.9f); + check_vector(&n[0], 1.1f, 1.2f, 1.3f, 32); + check_vector(&n[1], 1.4f, 1.5f, 1.6f, 32); + check_vector(&n[2], 1.7f, 1.8f, 1.9f, 32); IDirect3DRMMeshBuilder_Release(pMeshBuilder); @@ -507,8 +649,6 @@ int val; DWORD val1; D3DVALUE valu, valv; - DWORD size; - CHAR cname[64] = {0}; hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); @@ -523,18 +663,8 @@ hr = IDirect3DRM3_CreateMeshBuilder(d3drm3, &pMeshBuilder3); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMeshBuilder3 interface (hr = %x)\n", hr); - hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof(cname); - hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Builder"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Builder"), "Expected cname to be \"Builder\", but got \"%s\"\n", cname); + test_class_name((IDirect3DRMObject *)pMeshBuilder3, "Builder"); + test_object_name((IDirect3DRMObject *)pMeshBuilder3); info.lpMemory = data_bad_version; info.dSize = strlen(data_bad_version); @@ -613,8 +743,7 @@ HRESULT hr; IDirect3DRM *d3drm; IDirect3DRMMesh *mesh; - DWORD size; - CHAR cname[64] = {0}; + IUnknown *unk; hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); @@ -622,18 +751,16 @@ hr = IDirect3DRM_CreateMesh(d3drm, &mesh); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMesh interface (hr = %x)\n", hr); - hr = IDirect3DRMMesh_GetClassName(mesh, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMMesh_GetClassName(mesh, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMMesh_GetClassName(mesh, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof(cname); - hr = IDirect3DRMMesh_GetClassName(mesh, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Mesh"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Mesh"), "Expected cname to be \"Mesh\", but got \"%s\"\n", cname); + test_class_name((IDirect3DRMObject *)mesh, "Mesh"); + test_object_name((IDirect3DRMObject *)mesh); + + hr = IDirect3DRMMesh_QueryInterface(mesh, &IID_IDirect3DRMObject, (void **)&unk); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, %#x.\n", hr); + IUnknown_Release(unk); + + hr = IDirect3DRMMesh_QueryInterface(mesh, &IID_IDirect3DRMVisual, (void **)&unk); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMVisual, %#x.\n", hr); + IUnknown_Release(unk); IDirect3DRMMesh_Release(mesh); @@ -649,12 +776,13 @@ IDirect3DRMMeshBuilder2 *MeshBuilder2; IDirect3DRMMeshBuilder3 *MeshBuilder3; IDirect3DRMFace *face1; + IDirect3DRMObject *obj; IDirect3DRMFace2 *face2; IDirect3DRMFaceArray *array1; D3DRMLOADMEMORY info; D3DVECTOR v1[4], n1[4], v2[4], n2[4]; + D3DCOLOR color; DWORD count; - CHAR cname[64] = {0}; int icount; hr = Direct3DRMCreate(&d3drm); @@ -669,18 +797,13 @@ return; } - hr = IDirect3DRMFace_GetClassName(face1, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMFace_GetClassName(face1, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - count = 1; - hr = IDirect3DRMFace_GetClassName(face1, &count, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - count = sizeof(cname); - hr = IDirect3DRMFace_GetClassName(face1, &count, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(count == sizeof("Face"), "wrong size: %u\n", count); - ok(!strcmp(cname, "Face"), "Expected cname to be \"Face\", but got \"%s\"\n", cname); + hr = IDirect3DRMFace_QueryInterface(face1, &IID_IDirect3DRMObject, (void **)&obj); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, %#x.\n", hr); + ok(obj == (IDirect3DRMObject *)face1, "Unexpected interface pointer.\n"); + IDirect3DRMObject_Release(obj); + + test_class_name((IDirect3DRMObject *)face1, "Face"); + test_object_name((IDirect3DRMObject *)face1); icount = IDirect3DRMFace_GetVertexCount(face1); ok(!icount, "wrong VertexCount: %i\n", icount); @@ -751,18 +874,18 @@ hr = IDirect3DRMMeshBuilder3_CreateFace(MeshBuilder3, &face2); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMFace2 interface (hr = %x)\n", hr); - hr = IDirect3DRMFace2_GetClassName(face2, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMFace2_GetClassName(face2, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - count = 1; - hr = IDirect3DRMFace2_GetClassName(face2, &count, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - count = sizeof(cname); - hr = IDirect3DRMFace2_GetClassName(face2, &count, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(count == sizeof("Face"), "wrong size: %u\n", count); - ok(!strcmp(cname, "Face"), "Expected cname to be \"Face\", but got \"%s\"\n", cname); + hr = IDirect3DRMFace2_QueryInterface(face2, &IID_IDirect3DRMObject, (void **)&obj); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, %#x.\n", hr); + + hr = IDirect3DRMFace2_QueryInterface(face2, &IID_IDirect3DRMFace, (void **)&face1); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, %#x.\n", hr); + ok(obj == (IDirect3DRMObject *)face1, "Unexpected interface pointer.\n"); + + IDirect3DRMFace_Release(face1); + IDirect3DRMObject_Release(obj); + + test_class_name((IDirect3DRMObject *)face2, "Face"); + test_object_name((IDirect3DRMObject *)face2); icount = IDirect3DRMMeshBuilder3_GetFaceCount(MeshBuilder3); todo_wine @@ -828,47 +951,29 @@ 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", - U1(v2[0]).x, U1(v1[0]).x); - ok(U2(v2[0]).y == U2(v1[0]).y, "Wrong component v2[0].y = %f (expected %f)\n", - U2(v2[0]).y, U2(v1[0]).y); - ok(U3(v2[0]).z == U3(v1[0]).z, "Wrong component v2[0].z = %f (expected %f)\n", - U3(v2[0]).z, U3(v1[0]).z); - ok(U1(v2[1]).x == U1(v1[1]).x, "Wrong component v2[1].x = %f (expected %f)\n", - U1(v2[1]).x, U1(v1[1]).x); - ok(U2(v2[1]).y == U2(v1[1]).y, "Wrong component v2[1].y = %f (expected %f)\n", - U2(v2[1]).y, U2(v1[1]).y); - ok(U3(v2[1]).z == U3(v1[1]).z, "Wrong component v2[1].z = %f (expected %f)\n", - U3(v2[1]).z, U3(v1[1]).z); - ok(U1(v2[2]).x == U1(v1[2]).x, "Wrong component v2[2].x = %f (expected %f)\n", - U1(v2[2]).x, U1(v1[2]).x); - ok(U2(v2[2]).y == U2(v1[2]).y, "Wrong component v2[2].y = %f (expected %f)\n", - U2(v2[2]).y, U2(v1[2]).y); - ok(U3(v2[2]).z == U3(v1[2]).z, "Wrong component v2[2].z = %f (expected %f)\n", - U3(v2[2]).z, U3(v1[2]).z); - - ok(U1(n2[0]).x == U1(n1[0]).x, "Wrong component n2[0].x = %f (expected %f)\n", - U1(n2[0]).x, U1(n1[0]).x); - ok(U2(n2[0]).y == U2(n1[0]).y, "Wrong component n2[0].y = %f (expected %f)\n", - U2(n2[0]).y, U2(n1[0]).y); - ok(U3(n2[0]).z == U3(n1[0]).z, "Wrong component n2[0].z = %f (expected %f)\n", - U3(n2[0]).z, U3(n1[0]).z); - ok(U1(n2[1]).x == U1(n1[1]).x, "Wrong component n2[1].x = %f (expected %f)\n", - U1(n2[1]).x, U1(n1[1]).x); - ok(U2(n2[1]).y == U2(n1[1]).y, "Wrong component n2[1].y = %f (expected %f)\n", - U2(n2[1]).y, U2(n1[1]).y); - ok(U3(n2[1]).z == U3(n1[1]).z, "Wrong component n2[1].z = %f (expected %f)\n", - U3(n2[1]).z, U3(n1[1]).z); - ok(U1(n2[2]).x == U1(n1[2]).x, "Wrong component n2[2].x = %f (expected %f)\n", - U1(n2[2]).x, U1(n1[2]).x); - ok(U2(n2[2]).y == U2(n1[2]).y, "Wrong component n2[2].y = %f (expected %f)\n", - U2(n2[2]).y, U2(n1[2]).y); - ok(U3(n2[2]).z == U3(n1[2]).z, "Wrong component n2[2].z = %f (expected %f)\n", - U3(n2[2]).z, U3(n1[2]).z); + + vector_eq(&v1[0], &v2[0]); + vector_eq(&v1[1], &v2[1]); + vector_eq(&v1[2], &v2[2]); + + vector_eq(&n1[0], &n2[0]); + vector_eq(&n1[1], &n2[1]); + vector_eq(&n1[2], &n2[2]); IDirect3DRMFace_Release(face); IDirect3DRMFaceArray_Release(array1); } + + /* Setting face color. */ + hr = IDirect3DRMFace2_SetColor(face2, 0x1f180587); + ok(SUCCEEDED(hr), "Failed to set face color, hr %#x.\n", hr); + color = IDirect3DRMFace2_GetColor(face2); + ok(color == 0x1f180587, "Unexpected color %8x.\n", color); + + hr = IDirect3DRMFace2_SetColorRGB(face2, 0.5f, 0.5f, 0.5f); + ok(SUCCEEDED(hr), "Failed to set color, hr %#x.\n", hr); + color = IDirect3DRMFace2_GetColor(face2); + ok(color == 0xff7f7f7f, "Unexpected color %8x.\n", color); IDirect3DRMFace2_Release(face2); IDirect3DRMMeshBuilder3_Release(MeshBuilder3); @@ -894,29 +999,23 @@ IDirect3DRMLight *light1; IDirect3DRMLight *light_tmp; IDirect3DRMLightArray *light_array; + IDirect3DRMFrame3 *frame3; + DWORD count, options; + ULONG ref, ref2; D3DCOLOR color; - DWORD count; - CHAR cname[64] = {0}; hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); + ref = get_refcount((IUnknown *)d3drm); hr = IDirect3DRM_CreateFrame(d3drm, NULL, &pFrameC); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMFrame interface (hr = %x)\n", hr); CHECK_REFCOUNT(pFrameC, 1); - - hr = IDirect3DRMFrame_GetClassName(pFrameC, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMFrame_GetClassName(pFrameC, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - count = 1; - hr = IDirect3DRMFrame_GetClassName(pFrameC, &count, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - count = sizeof(cname); - hr = IDirect3DRMFrame_GetClassName(pFrameC, &count, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(count == sizeof("Frame"), "wrong size: %u\n", count); - ok(!strcmp(cname, "Frame"), "Expected cname to be \"Frame\", but got \"%s\"\n", cname); + ref2 = get_refcount((IUnknown *)d3drm); + ok(ref2 > ref, "Expected d3drm object to be referenced.\n"); + + test_class_name((IDirect3DRMObject *)pFrameC, "Frame"); + test_object_name((IDirect3DRMObject *)pFrameC); hr = IDirect3DRMFrame_GetParent(pFrameC, NULL); ok(hr == D3DRMERR_BADVALUE, "Should fail and return D3DRM_BADVALUE (hr = %x)\n", hr); @@ -1229,6 +1328,42 @@ color = IDirect3DRMFrame_GetSceneBackground(pFrameP1); ok(color == 0xff7f7f7f, "wrong color (%x)\n", color); + /* Traversal options. */ + hr = IDirect3DRMFrame_QueryInterface(pFrameP2, &IID_IDirect3DRMFrame3, (void **)&frame3); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMFrame3 interface, hr %#x.\n", hr); + + hr = IDirect3DRMFrame3_GetTraversalOptions(frame3, NULL); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + options = 0; + hr = IDirect3DRMFrame3_GetTraversalOptions(frame3, &options); + ok(SUCCEEDED(hr), "Failed to get traversal options, hr %#x.\n", hr); + ok(options == (D3DRMFRAME_RENDERENABLE | D3DRMFRAME_PICKENABLE), "Unexpected default options %#x.\n", options); + + hr = IDirect3DRMFrame3_SetTraversalOptions(frame3, 0); + ok(SUCCEEDED(hr), "Unexpected hr %#x.\n", hr); + + hr = IDirect3DRMFrame3_SetTraversalOptions(frame3, 0xf0000000); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + hr = IDirect3DRMFrame3_SetTraversalOptions(frame3, 0xf0000000 | D3DRMFRAME_PICKENABLE); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + options = 0xf; + hr = IDirect3DRMFrame3_GetTraversalOptions(frame3, &options); + ok(SUCCEEDED(hr), "Failed to get traversal options, hr %#x.\n", hr); + ok(options == 0, "Unexpected traversal options %#x.\n", options); + + hr = IDirect3DRMFrame3_SetTraversalOptions(frame3, D3DRMFRAME_PICKENABLE); + ok(SUCCEEDED(hr), "Failed to set traversal options, hr %#x.\n", hr); + + options = 0; + hr = IDirect3DRMFrame3_GetTraversalOptions(frame3, &options); + ok(SUCCEEDED(hr), "Failed to get traversal options, hr %#x.\n", hr); + ok(options == D3DRMFRAME_PICKENABLE, "Unexpected traversal options %#x.\n", options); + + IDirect3DRMFrame3_Release(frame3); + /* Cleanup */ IDirect3DRMFrame_Release(pFrameP2); CHECK_REFCOUNT(pFrameC, 1); @@ -1369,6 +1504,8 @@ "Expected callback = %p, context = %p. Got callback = %p, context = %p.\n", d3drm_corder[i].callback, d3drm_corder[i].context, corder[i].callback, corder[i].context); } + + IDirect3DRM_Release(d3drm); } static void test_object(void) @@ -1377,19 +1514,34 @@ { REFCLSID clsid; REFIID iid; - BOOL todo; + BOOL takes_d3drm_ref; } tests[] = { - { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice, FALSE }, - { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice2, FALSE }, - { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice3, FALSE }, - { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMWinDevice, FALSE }, - { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture, FALSE }, - { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture2, FALSE }, - { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture3, FALSE }, - { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport, FALSE }, - { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport2, FALSE }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice2 }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice3 }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMWinDevice }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture2 }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture3 }, + { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport }, + { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport2 }, + { &CLSID_CDirect3DRMFace, &IID_IDirect3DRMFace }, + { &CLSID_CDirect3DRMFace, &IID_IDirect3DRMFace2 }, + { &CLSID_CDirect3DRMMeshBuilder, &IID_IDirect3DRMMeshBuilder, TRUE }, + { &CLSID_CDirect3DRMMeshBuilder, &IID_IDirect3DRMMeshBuilder2, TRUE }, + { &CLSID_CDirect3DRMMeshBuilder, &IID_IDirect3DRMMeshBuilder3, TRUE }, + { &CLSID_CDirect3DRMFrame, &IID_IDirect3DRMFrame, TRUE }, + { &CLSID_CDirect3DRMFrame, &IID_IDirect3DRMFrame2, TRUE }, + { &CLSID_CDirect3DRMFrame, &IID_IDirect3DRMFrame3, TRUE }, + { &CLSID_CDirect3DRMLight, &IID_IDirect3DRMLight, TRUE }, + { &CLSID_CDirect3DRMMaterial, &IID_IDirect3DRMMaterial, TRUE }, + { &CLSID_CDirect3DRMMaterial, &IID_IDirect3DRMMaterial2, TRUE }, + { &CLSID_CDirect3DRMMesh, &IID_IDirect3DRMMesh, TRUE }, + { &CLSID_CDirect3DRMAnimation, &IID_IDirect3DRMAnimation, TRUE }, + { &CLSID_CDirect3DRMAnimation, &IID_IDirect3DRMAnimation2, TRUE }, + { &CLSID_CDirect3DRMWrap, &IID_IDirect3DRMWrap }, }; IDirect3DRM *d3drm1; IDirect3DRM2 *d3drm2; @@ -1425,12 +1577,15 @@ ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr == D3DRMERR_BADVALUE, got %#x.\n", i, hr); hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown); - todo_wine_if(tests[i].todo) ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr); if (SUCCEEDED(hr)) { ref2 = get_refcount((IUnknown *)d3drm1); - ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + if (tests[i].takes_d3drm_ref) + ok(ref2 > ref1, "Test %u: expected ref2 > ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + else + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); ref4 = get_refcount((IUnknown *)d3drm3); @@ -1449,7 +1604,10 @@ hr = IDirect3DRM2_CreateObject(d3drm2, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown); ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr); ref2 = get_refcount((IUnknown *)d3drm1); - ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + if (tests[i].takes_d3drm_ref) + ok(ref2 > ref1, "Test %u: expected ref2 > ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + else + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); ref3 = get_refcount((IUnknown *)d3drm2); ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); ref4 = get_refcount((IUnknown *)d3drm3); @@ -1465,7 +1623,10 @@ hr = IDirect3DRM3_CreateObject(d3drm3, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown); ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr); ref2 = get_refcount((IUnknown *)d3drm1); - ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + if (tests[i].takes_d3drm_ref) + ok(ref2 > ref1, "Test %u: expected ref2 > ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + else + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); ref3 = get_refcount((IUnknown *)d3drm2); ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); ref4 = get_refcount((IUnknown *)d3drm3); @@ -1505,11 +1666,10 @@ GUID driver; HWND window; RECT rc; - DWORD size, data, ref1, ref2, ref3, ref4; + DWORD data, ref1, ref2, ref3, ref4; DWORD initial_ref1, initial_ref2, initial_ref3, device_ref, frame_ref, frame_ref2, viewport_ref; - CHAR cname[64] = {0}; - - window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0); + + window = create_window(); GetClientRect(window, &rc); hr = Direct3DRMCreate(&d3drm1); @@ -1792,18 +1952,8 @@ IDirect3DRMObject_Release(obj); IDirect3DRMObject_Release(obj2); - hr = IDirect3DRMViewport_GetClassName(viewport, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMViewport_GetClassName(viewport, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMViewport_GetClassName(viewport, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof(cname); - hr = IDirect3DRMViewport_GetClassName(viewport, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Viewport"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Viewport"), "Expected cname to be \"Viewport\", but got \"%s\"\n", cname); + test_class_name((IDirect3DRMObject *)viewport, "Viewport"); + test_object_name((IDirect3DRMObject *)viewport); /* AppData */ hr = IDirect3DRMViewport_SetAppData(viewport, 0); @@ -2013,8 +2163,7 @@ IDirect3DRMDevice3_Release(device3); IDirect3DRMDevice_Release(device1); ref4 = get_refcount((IUnknown *)d3drm1); - todo_wine ok(ref4 > initial_ref1, "Expected ref4 > initial_ref1, got initial_ref1 = %u, ref4 = %u.\n", initial_ref1, - ref4); + ok(ref4 > initial_ref1, "Expected ref4 > initial_ref1, got initial_ref1 = %u, ref4 = %u.\n", initial_ref1, ref4); ref4 = get_refcount((IUnknown *)d3drm2); ok(ref4 == initial_ref2, "Expected ref4 == initial_ref2, got initial_ref2 = %u, ref4 = %u.\n", initial_ref2, ref4); ref4 = get_refcount((IUnknown *)d3drm3); @@ -2026,8 +2175,7 @@ IDirect3DRMFrame3_Release(frame3); ref4 = get_refcount((IUnknown *)d3drm1); - todo_wine ok(ref4 > initial_ref1, "Expected ref4 > initial_ref1, got initial_ref1 = %u, ref4 = %u.\n", initial_ref1, - ref4); + ok(ref4 > initial_ref1, "Expected ref4 > initial_ref1, got initial_ref1 = %u, ref4 = %u.\n", initial_ref1, ref4); ref4 = get_refcount((IUnknown *)d3drm2); ok(ref4 == initial_ref2, "Expected ref4 == initial_ref2, got initial_ref2 = %u, ref4 = %u.\n", initial_ref2, ref4); ref4 = get_refcount((IUnknown *)d3drm3); @@ -2050,13 +2198,12 @@ static void test_Light(void) { + IDirect3DRMObject *object; HRESULT hr; IDirect3DRM *d3drm; IDirect3DRMLight *light; D3DRMLIGHTTYPE type; D3DCOLOR color; - DWORD size; - CHAR cname[64] = {0}; hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); @@ -2064,18 +2211,12 @@ hr = IDirect3DRM_CreateLightRGB(d3drm, D3DRMLIGHT_SPOT, 0.5, 0.5, 0.5, &light); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMLight interface (hr = %x)\n", hr); - hr = IDirect3DRMLight_GetClassName(light, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMLight_GetClassName(light, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMLight_GetClassName(light, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof(cname); - hr = IDirect3DRMLight_GetClassName(light, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Light"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Light"), "Expected cname to be \"Light\", but got \"%s\"\n", cname); + hr = IDirect3DRMLight_QueryInterface(light, &IID_IDirect3DRMObject, (void **)&object); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, hr %#x.\n", hr); + IDirect3DRMObject_Release(object); + + test_class_name((IDirect3DRMObject *)light, "Light"); + test_object_name((IDirect3DRMObject *)light); type = IDirect3DRMLight_GetType(light); ok(type == D3DRMLIGHT_SPOT, "wrong type (%u)\n", type); @@ -2110,8 +2251,6 @@ IDirect3DRM3 *d3drm3; IDirect3DRMMaterial2 *material2; D3DVALUE r, g, b; - DWORD size; - CHAR cname[64] = {0}; hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); @@ -2126,18 +2265,8 @@ hr = IDirect3DRM3_CreateMaterial(d3drm3, 18.5f, &material2); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMaterial2 interface (hr = %x)\n", hr); - hr = IDirect3DRMMaterial2_GetClassName(material2, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMMaterial2_GetClassName(material2, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMMaterial2_GetClassName(material2, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof(cname); - hr = IDirect3DRMMaterial2_GetClassName(material2, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Material"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Material"), "Expected cname to be \"Material\", but got \"%s\"\n", cname); + test_class_name((IDirect3DRMObject *)material2, "Material"); + test_object_name((IDirect3DRMObject *)material2); r = IDirect3DRMMaterial2_GetPower(material2); ok(r == 18.5f, "wrong power (%f)\n", r); @@ -2192,6 +2321,7 @@ IDirect3DRMTexture *texture1; IDirect3DRMTexture2 *texture2; IDirect3DRMTexture3 *texture3; + IDirectDrawSurface *surface; D3DRMIMAGE initimg = { @@ -2208,8 +2338,6 @@ *d3drm_img = NULL; DWORD pixel[4] = { 20000, 30000, 10000, 0 }; - DWORD size; - CHAR cname[64] = {0}; ULONG ref1, ref2, ref3, ref4; hr = Direct3DRMCreate(&d3drm1); @@ -2340,55 +2468,24 @@ ref4 = get_refcount((IUnknown *)d3drm3); ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4); + /* Created from image, GetSurface() does not work. */ + hr = IDirect3DRMTexture3_GetSurface(texture3, 0, NULL); + ok(hr == D3DRMERR_BADVALUE, "GetSurface() expected to fail, %#x\n", hr); + + hr = IDirect3DRMTexture3_GetSurface(texture3, 0, &surface); + ok(hr == D3DRMERR_NOTCREATEDFROMDDS, "GetSurface() expected to fail, %#x\n", hr); + /* Test all failures together */ - hr = IDirect3DRMTexture_GetClassName(texture1, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMTexture_GetClassName(texture1, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMTexture2_GetClassName(texture2, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMTexture2_GetClassName(texture2, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMTexture3_GetClassName(texture3, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMTexture3_GetClassName(texture3, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMTexture_GetClassName(texture1, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMTexture2_GetClassName(texture2, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMTexture3_GetClassName(texture3, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof("Texture") - 1; - strcpy(cname, "test"); - hr = IDirect3DRMTexture_GetClassName(texture1, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - ok(size == sizeof("Texture") - 1, "wrong size: %u\n", size); - ok(!strcmp(cname, "test"), "Expected cname to be \"test\", but got \"%s\"\n", cname); - hr = IDirect3DRMTexture2_GetClassName(texture2, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - ok(size == sizeof("Texture") - 1, "wrong size: %u\n", size); - ok(!strcmp(cname, "test"), "Expected cname to be \"test\", but got \"%s\"\n", cname); - hr = IDirect3DRMTexture3_GetClassName(texture3, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - ok(size == sizeof("Texture") - 1, "wrong size: %u\n", size); - ok(!strcmp(cname, "test"), "Expected cname to be \"test\", but got \"%s\"\n", cname); + test_class_name((IDirect3DRMObject *)texture1, "Texture"); + test_class_name((IDirect3DRMObject *)texture2, "Texture"); + test_class_name((IDirect3DRMObject *)texture3, "Texture"); + test_object_name((IDirect3DRMObject *)texture1); + test_object_name((IDirect3DRMObject *)texture2); + test_object_name((IDirect3DRMObject *)texture3); d3drm_img = IDirect3DRMTexture_GetImage(texture1); ok(!!d3drm_img, "Failed to get image.\n"); ok(d3drm_img == &initimg, "Expected image returned == %p, got %p.\n", &initimg, d3drm_img); - - size = sizeof(cname); - hr = IDirect3DRMTexture_GetClassName(texture1, &size, cname); - ok(SUCCEEDED(hr), "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Texture"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Texture"), "Expected cname to be \"Texture\", but got \"%s\"\n", cname); - size = sizeof("Texture"); - hr = IDirect3DRMTexture_GetClassName(texture1, &size, cname); - ok(SUCCEEDED(hr), "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Texture"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Texture"), "Expected cname to be \"Texture\", but got \"%s\"\n", cname); IDirect3DRMTexture_Release(texture1); ref2 = get_refcount((IUnknown *)d3drm1); @@ -2403,17 +2500,6 @@ ok(!!d3drm_img, "Failed to get image.\n"); ok(d3drm_img == &initimg, "Expected image returned == %p, got %p.\n", &initimg, d3drm_img); - size = sizeof(cname); - hr = IDirect3DRMTexture2_GetClassName(texture2, &size, cname); - ok(SUCCEEDED(hr), "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Texture"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Texture"), "Expected cname to be \"Texture\", but got \"%s\"\n", cname); - size = sizeof("Texture"); - hr = IDirect3DRMTexture2_GetClassName(texture2, &size, cname); - ok(SUCCEEDED(hr), "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Texture"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Texture"), "Expected cname to be \"Texture\", but got \"%s\"\n", cname); - IDirect3DRMTexture2_Release(texture2); ref2 = get_refcount((IUnknown *)d3drm1); ok(ref2 - 1 == ref1, "expected (ref2 - 1) == ref1, got ref1 = %u, ref2 = %u.\n", ref1, ref2); @@ -2426,17 +2512,6 @@ d3drm_img = IDirect3DRMTexture3_GetImage(texture3); ok(!!d3drm_img, "Failed to get image.\n"); ok(d3drm_img == &initimg, "Expected image returned == %p, got %p.\n", &initimg, d3drm_img); - - size = sizeof(cname); - hr = IDirect3DRMTexture3_GetClassName(texture3, &size, cname); - ok(SUCCEEDED(hr), "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Texture"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Texture"), "Expected cname to be \"Texture\", but got \"%s\"\n", cname); - size = sizeof("Texture"); - hr = IDirect3DRMTexture3_GetClassName(texture3, &size, cname); - ok(SUCCEEDED(hr), "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Texture"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Texture"), "Expected cname to be \"Texture\", but got \"%s\"\n", cname); IDirect3DRMTexture3_Release(texture3); ref2 = get_refcount((IUnknown *)d3drm1); @@ -2595,10 +2670,8 @@ GUID driver; HWND window; RECT rc; - DWORD size; - CHAR cname[64] = {0}; - - window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0); + + window = create_window(); GetClientRect(window, &rc); hr = Direct3DRMCreate(&d3drm); @@ -2614,18 +2687,8 @@ hr = IDirect3DRM3_CreateDeviceFromClipper(d3drm, pClipper, &driver, rc.right, rc.bottom, &device); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMDevice interface (hr = %x)\n", hr); - hr = IDirect3DRMDevice_GetClassName(device, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMDevice_GetClassName(device, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMDevice_GetClassName(device, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof(cname); - hr = IDirect3DRMDevice_GetClassName(device, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Device"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Device"), "Expected cname to be \"Device\", but got \"%s\"\n", cname); + test_class_name((IDirect3DRMObject *)device, "Device"); + test_object_name((IDirect3DRMObject *)device); /* WinDevice */ if (FAILED(hr = IDirect3DRMDevice_QueryInterface(device, &IID_IDirect3DRMWinDevice, (void **)&win_device))) @@ -2634,19 +2697,8 @@ goto cleanup; } - hr = IDirect3DRMWinDevice_GetClassName(win_device, NULL, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMWinDevice_GetClassName(win_device, NULL, NULL); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = 1; - hr = IDirect3DRMWinDevice_GetClassName(win_device, &size, cname); - ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - size = sizeof(cname); - hr = IDirect3DRMWinDevice_GetClassName(win_device, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(size == sizeof("Device"), "wrong size: %u\n", size); - ok(!strcmp(cname, "Device"), "Expected cname to be \"Device\", but got \"%s\"\n", cname); - + test_class_name((IDirect3DRMObject *)win_device, "Device"); + test_object_name((IDirect3DRMObject *)win_device); IDirect3DRMWinDevice_Release(win_device); cleanup: @@ -3184,7 +3236,7 @@ GUID driver; RECT rc; - window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0); + window = create_window(); GetClientRect(window, &rc); hr = DirectDrawCreateClipper(0, &clipper, NULL); ok(hr == DD_OK, "Cannot get IDirectDrawClipper interface (hr = %x)\n", hr); @@ -3263,7 +3315,7 @@ ULONG ref1, ref2, cref1, cref2; RECT rc; - window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 500, 400, 0, 0, 0, 0); + window = create_window(); GetClientRect(window, &rc); hr = DirectDrawCreateClipper(0, &clipper, NULL); ok(hr == DD_OK, "Cannot get IDirectDrawClipper interface (hr = %x).\n", hr); @@ -3434,7 +3486,7 @@ 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); + window = create_window(); GetClientRect(window, &rc); hr = DirectDrawCreateClipper(0, &clipper, NULL); ok(hr == DD_OK, "Cannot get IDirectDrawClipper interface (hr = %x).\n", hr); @@ -3612,7 +3664,7 @@ 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); + window = create_window(); GetClientRect(window, &rc); hr = DirectDrawCreateClipper(0, &clipper, NULL); ok(hr == DD_OK, "Cannot get IDirectDrawClipper interface (hr = %x).\n", hr); @@ -3790,7 +3842,7 @@ 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); + window = create_window(); GetClientRect(window, &rc); hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); @@ -3962,7 +4014,7 @@ 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); + window = create_window(); GetClientRect(window, &rc); hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); @@ -4144,7 +4196,7 @@ 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); + window = create_window(); GetClientRect(window, &rc); hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); @@ -4441,7 +4493,7 @@ 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); + window = create_window(); GetClientRect(window, &rc); hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirect3D, (void **)&d3d1); @@ -4778,7 +4830,7 @@ 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); + window = create_window(); GetClientRect(window, &rc); hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirect3D2, (void **)&d3d2); @@ -5061,7 +5113,7 @@ 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); + window = create_window(); GetClientRect(window, &rc); hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirect3D2, (void **)&d3d2); @@ -6141,7 +6193,7 @@ D3DCOLOR ret_color; RECT rc; - window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); + window = create_window(); GetClientRect(window, &rc); hr = DirectDrawCreate(NULL, &ddraw, NULL); @@ -6343,7 +6395,7 @@ D3DCOLOR ret_color; RECT rc; - window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); + window = create_window(); GetClientRect(window, &rc); hr = DirectDrawCreate(NULL, &ddraw1, NULL); @@ -6535,6 +6587,726 @@ DestroyWindow(window); } +static void test_create_texture_from_surface(void) +{ + D3DRMIMAGE testimg = + { + 0, 0, 0, 0, 0, + TRUE, 0, (void *)0xcafebabe, NULL, + 0x000000ff, 0x0000ff00, 0x00ff0000, 0, 0, NULL + }; + IDirectDrawSurface *surface = NULL, *surface2 = NULL, *ds = NULL; + IDirect3DRMTexture *texture1; + IDirect3DRMTexture2 *texture2; + IDirect3DRMTexture3 *texture3; + IDirectDraw *ddraw = NULL; + IDirect3DRM *d3drm1 = NULL; + IDirect3DRM2 *d3drm2 = NULL; + IDirect3DRM3 *d3drm3 = NULL; + ULONG ref1, ref2, ref3; + D3DRMIMAGE *image; + DDSURFACEDESC desc; + HWND window; + HRESULT hr; + RECT rc; + + hr = DirectDrawCreate(NULL, &ddraw, NULL); + ok(hr == DD_OK, "Cannot get IDirectDraw interface (hr = %x).\n", hr); + + window = create_window(); + 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); + + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRM2 interface (hr = %x).\n", hr); + + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRM3 interface (hr = %x).\n", hr); + + /* Create a surface and use it to create a texture. */ + 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 = IDirectDraw_CreateSurface(ddraw, &desc, &surface2, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Test NULL params */ + texture1 = (IDirect3DRMTexture *)0xdeadbeef; + hr = IDirect3DRM_CreateTextureFromSurface(d3drm1, NULL, &texture1); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + ok(!texture1, "Expected texture returned == NULL, got %p.\n", texture1); + + hr = IDirect3DRM_CreateTextureFromSurface(d3drm1, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + texture2 = (IDirect3DRMTexture2 *)0xdeadbeef; + hr = IDirect3DRM2_CreateTextureFromSurface(d3drm2, NULL, &texture2); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + ok(!texture2, "Expected texture returned == NULL, got %p.\n", texture2); + + hr = IDirect3DRM2_CreateTextureFromSurface(d3drm2, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + texture3 = (IDirect3DRMTexture3 *)0xdeadbeef; + hr = IDirect3DRM3_CreateTextureFromSurface(d3drm3, NULL, &texture3); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + ok(!texture3, "Expected texture returned == NULL, got %p.\n", texture3); + + hr = IDirect3DRM3_CreateTextureFromSurface(d3drm3, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + ok(get_refcount((IUnknown *)surface) == 1, "Unexpected surface refcount.\n"); + hr = IDirect3DRM_CreateTextureFromSurface(d3drm1, surface, &texture1); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + ok(get_refcount((IUnknown *)surface) == 2, "Unexpected surface refcount.\n"); + image = IDirect3DRMTexture_GetImage(texture1); + ok(image == NULL, "Unexpected image, %p.\n", image); + hr = IDirect3DRMTexture_InitFromSurface(texture1, NULL); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + IDirect3DRMTexture_Release(texture1); + + ok(get_refcount((IUnknown *)surface) == 1, "Unexpected surface refcount.\n"); + hr = IDirect3DRM2_CreateTextureFromSurface(d3drm2, surface, &texture2); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + ok(get_refcount((IUnknown *)surface) == 2, "Unexpected surface refcount.\n"); + image = IDirect3DRMTexture2_GetImage(texture2); + ok(image == NULL, "Unexpected image, %p.\n", image); + hr = IDirect3DRMTexture2_InitFromSurface(texture2, NULL); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + IDirect3DRMTexture_Release(texture2); + + ok(get_refcount((IUnknown *)surface) == 1, "Unexpected surface refcount.\n"); + hr = IDirect3DRM3_CreateTextureFromSurface(d3drm3, surface, &texture3); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + ok(get_refcount((IUnknown *)surface) == 2, "Unexpected surface refcount.\n"); + image = IDirect3DRMTexture3_GetImage(texture3); + ok(image == NULL, "Unexpected image, %p.\n", image); + hr = IDirect3DRMTexture3_InitFromSurface(texture3, NULL); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + hr = IDirect3DRMTexture3_GetSurface(texture3, 0, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRMTexture3_GetSurface(texture3, 0, &ds); + ok(SUCCEEDED(hr), "Failed to get surface, hr %#x.\n", hr); + ok(ds == surface, "Expected same surface back.\n"); + IDirectDrawSurface_Release(ds); + + /* Init already initialized texture with same surface. */ + hr = IDirect3DRMTexture3_InitFromSurface(texture3, surface); + ok(hr == D3DRMERR_BADOBJECT, "Expected a failure, hr %#x.\n", hr); + + /* Init already initialized texture with different surface. */ + hr = IDirect3DRMTexture3_InitFromSurface(texture3, surface2); + ok(hr == D3DRMERR_BADOBJECT, "Expected a failure, hr %#x.\n", hr); + + hr = IDirect3DRMTexture3_GetSurface(texture3, 0, &ds); + ok(SUCCEEDED(hr), "Failed to get surface, hr %#x.\n", hr); + ok(ds == surface, "Expected same surface back.\n"); + IDirectDrawSurface_Release(ds); + + ref1 = get_refcount((IUnknown *)d3drm1); + ref2 = get_refcount((IUnknown *)d3drm2); + ref3 = get_refcount((IUnknown *)d3drm3); + hr = IDirect3DRMTexture3_InitFromImage(texture3, &testimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected a failure, hr %#x.\n", hr); + ok(ref1 < get_refcount((IUnknown *)d3drm1), "Expected d3drm1 reference taken.\n"); + ok(ref2 == get_refcount((IUnknown *)d3drm2), "Expected d3drm2 reference unchanged.\n"); + ok(ref3 == get_refcount((IUnknown *)d3drm3), "Expected d3drm3 reference unchanged.\n"); + /* Release leaked reference to d3drm1 */ + IDirect3DRM_Release(d3drm1); + + IDirect3DRMTexture_Release(texture3); + + /* Create from image, initialize from surface. */ + hr = IDirect3DRM3_CreateTexture(d3drm3, &testimg, &texture3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture3 interface (hr = %#x)\n", hr); + + ref1 = get_refcount((IUnknown *)d3drm1); + ref2 = get_refcount((IUnknown *)d3drm2); + ref3 = get_refcount((IUnknown *)d3drm3); + hr = IDirect3DRMTexture3_InitFromSurface(texture3, surface); + ok(hr == D3DRMERR_BADOBJECT, "Expected a failure, hr %#x.\n", hr); + ok(ref1 < get_refcount((IUnknown *)d3drm1), "Expected d3drm1 reference taken.\n"); + ok(ref2 == get_refcount((IUnknown *)d3drm2), "Expected d3drm2 reference unchanged.\n"); + ok(ref3 == get_refcount((IUnknown *)d3drm3), "Expected d3drm3 reference unchanged.\n"); + /* Release leaked reference to d3drm1 */ + IDirect3DRM_Release(d3drm1); + IDirect3DRMTexture3_Release(texture3); + + IDirectDrawSurface_Release(surface2); + IDirectDrawSurface_Release(surface); + IDirect3DRM3_Release(d3drm3); + IDirect3DRM2_Release(d3drm2); + IDirect3DRM_Release(d3drm1); + IDirectDraw_Release(ddraw); +} + +static void test_animation(void) +{ + IDirect3DRMAnimation2 *animation2; + IDirect3DRMAnimation *animation; + D3DRMANIMATIONOPTIONS options; + IDirect3DRMObject *obj, *obj2; + D3DRMANIMATIONKEY keys[10]; + IDirect3DRMFrame3 *frame3; + IDirect3DRMFrame *frame; + D3DRMANIMATIONKEY key; + IDirect3DRM *d3drm1; + D3DRMQUATERNION q; + DWORD count, i; + HRESULT hr; + D3DVECTOR v; + + hr = Direct3DRMCreate(&d3drm1); + ok(SUCCEEDED(hr), "Failed to create IDirect3DRM instance, hr 0x%08x.\n", hr); + + hr = IDirect3DRM_CreateAnimation(d3drm1, NULL); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr 0x%08x.\n", hr); + + CHECK_REFCOUNT(d3drm1, 1); + hr = IDirect3DRM_CreateAnimation(d3drm1, &animation); + ok(SUCCEEDED(hr), "Failed to create animation hr 0x%08x.\n", hr); + CHECK_REFCOUNT(d3drm1, 2); + + test_class_name((IDirect3DRMObject *)animation, "Animation"); + + hr = IDirect3DRMAnimation_QueryInterface(animation, &IID_IDirect3DRMAnimation2, (void **)&animation2); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMAnimation2, hr 0x%08x.\n", hr); + ok(animation != (void *)animation2, "Expected different interface pointer.\n"); + + hr = IDirect3DRMAnimation_QueryInterface(animation, &IID_IDirect3DRMObject, (void **)&obj); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, hr 0x%08x.\n", hr); + + hr = IDirect3DRMAnimation2_QueryInterface(animation2, &IID_IDirect3DRMObject, (void **)&obj2); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, hr 0x%08x.\n", hr); + + ok(obj == obj2 && obj == (IDirect3DRMObject *)animation, "Unexpected object pointer.\n"); + + IDirect3DRMObject_Release(obj); + IDirect3DRMObject_Release(obj2); + + /* Set animated frame, get it back. */ + hr = IDirect3DRM_CreateFrame(d3drm1, NULL, &frame); + ok(SUCCEEDED(hr), "Failed to create a frame, hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_SetFrame(animation, NULL); + ok(SUCCEEDED(hr), "Failed to reset frame, hr %#x.\n", hr); + + CHECK_REFCOUNT(frame, 1); + hr = IDirect3DRMAnimation_SetFrame(animation, frame); + ok(SUCCEEDED(hr), "Failed to set a frame, hr %#x.\n", hr); + CHECK_REFCOUNT(frame, 1); + + hr = IDirect3DRMAnimation2_GetFrame(animation2, NULL); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + hr = IDirect3DRMAnimation2_GetFrame(animation2, &frame3); + ok(SUCCEEDED(hr), "Failed to get the frame, %#x.\n", hr); + ok(frame3 != (void *)frame, "Unexpected interface pointer.\n"); + CHECK_REFCOUNT(frame, 2); + + IDirect3DRMFrame3_Release(frame3); + + hr = IDirect3DRMAnimation_SetFrame(animation, NULL); + ok(SUCCEEDED(hr), "Failed to reset frame, hr %#x.\n", hr); + + hr = IDirect3DRMFrame_QueryInterface(frame, &IID_IDirect3DRMFrame3, (void **)&frame3); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRMFrame3, hr %#x.\n", hr); + + CHECK_REFCOUNT(frame3, 2); + hr = IDirect3DRMAnimation2_SetFrame(animation2, frame3); + ok(SUCCEEDED(hr), "Failed to set a frame, hr %#x.\n", hr); + CHECK_REFCOUNT(frame3, 2); + + IDirect3DRMFrame3_Release(frame3); + IDirect3DRMFrame_Release(frame); + + /* Animation options. */ + options = IDirect3DRMAnimation_GetOptions(animation); + ok(options == (D3DRMANIMATION_CLOSED | D3DRMANIMATION_LINEARPOSITION), + "Unexpected default options %#x.\n", options); + + /* Undefined mask value */ + hr = IDirect3DRMAnimation_SetOptions(animation, 0xf0000000); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + options = IDirect3DRMAnimation_GetOptions(animation); + ok(options == (D3DRMANIMATION_CLOSED | D3DRMANIMATION_LINEARPOSITION), + "Unexpected default options %#x.\n", options); + + /* Ambiguous mask */ + hr = IDirect3DRMAnimation_SetOptions(animation, D3DRMANIMATION_OPEN | D3DRMANIMATION_CLOSED); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_SetOptions(animation, D3DRMANIMATION_LINEARPOSITION | D3DRMANIMATION_SPLINEPOSITION); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_SetOptions(animation, D3DRMANIMATION_SCALEANDROTATION | D3DRMANIMATION_POSITION); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + options = IDirect3DRMAnimation_GetOptions(animation); + ok(options == (D3DRMANIMATION_CLOSED | D3DRMANIMATION_LINEARPOSITION), + "Unexpected default options %#x.\n", options); + + /* Mask contains undefined bits together with valid one. */ + hr = IDirect3DRMAnimation_SetOptions(animation, 0xf0000000 | D3DRMANIMATION_OPEN); + ok(SUCCEEDED(hr), "Failed to set animation options, hr %#x.\n", hr); + + options = IDirect3DRMAnimation_GetOptions(animation); + ok(options == (0xf0000000 | D3DRMANIMATION_OPEN), "Unexpected animation options %#x.\n", options); + + hr = IDirect3DRMAnimation_SetOptions(animation, D3DRMANIMATION_SCALEANDROTATION); + ok(SUCCEEDED(hr), "Failed to set animation options, hr %#x.\n", hr); + + options = IDirect3DRMAnimation_GetOptions(animation); + ok(options == D3DRMANIMATION_SCALEANDROTATION, "Unexpected options %#x.\n", options); + + hr = IDirect3DRMAnimation_SetOptions(animation, D3DRMANIMATION_OPEN); + ok(SUCCEEDED(hr), "Failed to set animation options, hr %#x.\n", hr); + + options = IDirect3DRMAnimation_GetOptions(animation); + ok(options == D3DRMANIMATION_OPEN, "Unexpected options %#x.\n", options); + + hr = IDirect3DRMAnimation_SetOptions(animation, 0); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + options = IDirect3DRMAnimation_GetOptions(animation); + ok(options == D3DRMANIMATION_OPEN, "Unexpected options %#x.\n", options); + + /* Key management. */ + hr = IDirect3DRMAnimation_AddPositionKey(animation, 0.0f, 1.0f, 0.0f, 0.0f); + ok(SUCCEEDED(hr), "Failed to add position key, hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_AddScaleKey(animation, 0.0f, 1.0f, 2.0f, 1.0f); + ok(SUCCEEDED(hr), "Failed to add scale key, hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_AddPositionKey(animation, 0.0f, 2.0f, 0.0f, 0.0f); + ok(SUCCEEDED(hr), "Failed to add position key, hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_AddPositionKey(animation, 99.0f, 3.0f, 1.0f, 0.0f); + ok(SUCCEEDED(hr), "Failed to add position key, hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_AddPositionKey(animation, 80.0f, 4.0f, 1.0f, 0.0f); + ok(SUCCEEDED(hr), "Failed to add position key, hr %#x.\n", hr); + + v.x = 1.0f; + v.y = 0.0f; + v.z = 0.0f; + D3DRMQuaternionFromRotation(&q, &v, 1.0f); + + /* NULL quaternion pointer leads to a crash on Windows. */ + hr = IDirect3DRMAnimation_AddRotateKey(animation, 0.0f, &q); + ok(SUCCEEDED(hr), "Failed to add rotation key, hr %#.x\n", hr); + + count = 0; + memset(keys, 0, sizeof(keys)); + hr = IDirect3DRMAnimation2_GetKeys(animation2, 0.0f, 99.0f, &count, keys); + ok(SUCCEEDED(hr), "Failed to get animation keys, hr %#x.\n", hr); + ok(count == 6, "Unexpected key count %u.\n", count); + + ok(keys[0].dwKeyType == D3DRMANIMATION_ROTATEKEY, "Unexpected key type %u.\n", keys[0].dwKeyType); + ok(keys[1].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[1].dwKeyType); + ok(keys[2].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[2].dwKeyType); + ok(keys[3].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[3].dwKeyType); + ok(keys[4].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[4].dwKeyType); + ok(keys[5].dwKeyType == D3DRMANIMATION_SCALEKEY, "Unexpected key type %u.\n", keys[5].dwKeyType); + + /* Relative order, keys are returned sorted by time. */ + ok(keys[1].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[1].dvTime); + ok(keys[2].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[2].dvTime); + ok(keys[3].dvTime == 80.0f, "Unexpected key time %.8e.\n", keys[3].dvTime); + ok(keys[4].dvTime == 99.0f, "Unexpected key time %.8e.\n", keys[4].dvTime); + + /* For keys with same time, order they were added in is kept. */ + ok(keys[1].dvPositionKey.x == 1.0f, "Unexpected key position x %.8e.\n", keys[1].dvPositionKey.x); + ok(keys[2].dvPositionKey.x == 2.0f, "Unexpected key position x %.8e.\n", keys[2].dvPositionKey.x); + ok(keys[3].dvPositionKey.x == 4.0f, "Unexpected key position x %.8e.\n", keys[3].dvPositionKey.x); + ok(keys[4].dvPositionKey.x == 3.0f, "Unexpected key position x %.8e.\n", keys[4].dvPositionKey.x); + + for (i = 0; i < count; i++) + { + ok(keys[i].dwSize == sizeof(*keys), "%u: unexpected dwSize value %u.\n", i, keys[i].dwSize); + + todo_wine + { + switch (keys[i].dwKeyType) + { + case D3DRMANIMATION_ROTATEKEY: + ok((keys[i].dwID & 0xf0000000) == 0x40000000, "%u: unexpected id mask %#x.\n", i, keys[i].dwID); + break; + case D3DRMANIMATION_POSITIONKEY: + ok((keys[i].dwID & 0xf0000000) == 0x80000000, "%u: unexpected id mask %#x.\n", i, keys[i].dwID); + break; + case D3DRMANIMATION_SCALEKEY: + ok((keys[i].dwID & 0xf0000000) == 0xc0000000, "%u: unexpected id mask %#x.\n", i, keys[i].dwID); + break; + default: + ok(0, "%u: unknown key type %d.\n", i, keys[i].dwKeyType); + } + } + } + + /* No keys in this range. */ + count = 10; + hr = IDirect3DRMAnimation2_GetKeys(animation2, 100.0f, 200.0f, &count, NULL); + ok(hr == D3DRMERR_NOSUCHKEY, "Unexpected hr %#x.\n", hr); + ok(count == 0, "Unexpected key count %u.\n", count); + + count = 10; + hr = IDirect3DRMAnimation2_GetKeys(animation2, 100.0f, 200.0f, &count, keys); + ok(hr == D3DRMERR_NOSUCHKEY, "Unexpected hr %#x.\n", hr); + ok(count == 0, "Unexpected key count %u.\n", count); + + count = 10; + hr = IDirect3DRMAnimation2_GetKeys(animation2, 0.0f, 0.0f, &count, NULL); + ok(SUCCEEDED(hr), "Failed to get animation keys, hr %#x.\n", hr); + ok(count == 4, "Unexpected key count %u.\n", count); + + hr = IDirect3DRMAnimation2_GetKeys(animation2, 0.0f, 100.0f, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + /* Time is 0-based. */ + hr = IDirect3DRMAnimation2_GetKeys(animation2, -100.0f, -50.0f, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Unexpected hr %#x.\n", hr); + + count = 10; + hr = IDirect3DRMAnimation2_GetKeys(animation2, -100.0f, -50.0f, &count, NULL); + ok(hr == D3DRMERR_NOSUCHKEY, "Unexpected hr %#x.\n", hr); + ok(count == 0, "Unexpected key count %u.\n", count); + + count = 10; + hr = IDirect3DRMAnimation2_GetKeys(animation2, -100.0f, 100.0f, &count, NULL); + ok(SUCCEEDED(hr), "Failed to get animation keys, hr %#x.\n", hr); + ok(count == 6, "Unexpected key count %u.\n", count); + + /* AddKey() tests. */ + hr = IDirect3DRMAnimation2_AddKey(animation2, NULL); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + memset(&key, 0, sizeof(key)); + key.dwKeyType = D3DRMANIMATION_POSITIONKEY; + hr = IDirect3DRMAnimation2_AddKey(animation2, &key); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + memset(&key, 0, sizeof(key)); + key.dwSize = sizeof(key) - 1; + key.dwKeyType = D3DRMANIMATION_POSITIONKEY; + hr = IDirect3DRMAnimation2_AddKey(animation2, &key); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + memset(&key, 0, sizeof(key)); + key.dwSize = sizeof(key) + 1; + key.dwKeyType = D3DRMANIMATION_POSITIONKEY; + hr = IDirect3DRMAnimation2_AddKey(animation2, &key); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + memset(&key, 0, sizeof(key)); + key.dwSize = sizeof(key); + key.dwKeyType = D3DRMANIMATION_POSITIONKEY; + key.dvPositionKey.x = 8.0f; + hr = IDirect3DRMAnimation2_AddKey(animation2, &key); + ok(SUCCEEDED(hr), "Failed to add key, hr %#x.\n", hr); + + /* Delete tests. */ + hr = IDirect3DRMAnimation_AddRotateKey(animation, 0.0f, &q); + ok(SUCCEEDED(hr), "Failed to add rotation key, hr %#.x\n", hr); + + hr = IDirect3DRMAnimation_AddScaleKey(animation, 0.0f, 1.0f, 2.0f, 1.0f); + ok(SUCCEEDED(hr), "Failed to add scale key, hr %#x.\n", hr); + + count = 0; + memset(keys, 0, sizeof(keys)); + hr = IDirect3DRMAnimation2_GetKeys(animation2, -1000.0f, 1000.0f, &count, keys); + ok(SUCCEEDED(hr), "Failed to get key count, hr %#x.\n", hr); + ok(count == 9, "Unexpected key count %u.\n", count); + + ok(keys[0].dwKeyType == D3DRMANIMATION_ROTATEKEY, "Unexpected key type %u.\n", keys[0].dwKeyType); + ok(keys[1].dwKeyType == D3DRMANIMATION_ROTATEKEY, "Unexpected key type %u.\n", keys[1].dwKeyType); + ok(keys[2].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[2].dwKeyType); + ok(keys[3].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[3].dwKeyType); + ok(keys[4].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[4].dwKeyType); + ok(keys[5].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[5].dwKeyType); + ok(keys[6].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[6].dwKeyType); + ok(keys[7].dwKeyType == D3DRMANIMATION_SCALEKEY, "Unexpected key type %u.\n", keys[7].dwKeyType); + ok(keys[8].dwKeyType == D3DRMANIMATION_SCALEKEY, "Unexpected key type %u.\n", keys[8].dwKeyType); + + ok(keys[0].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[0].dvTime); + ok(keys[1].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[1].dvTime); + ok(keys[2].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[2].dvTime); + ok(keys[3].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[3].dvTime); + ok(keys[4].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[4].dvTime); + ok(keys[5].dvTime == 80.0f, "Unexpected key time %.8e.\n", keys[5].dvTime); + ok(keys[6].dvTime == 99.0f, "Unexpected key time %.8e.\n", keys[6].dvTime); + ok(keys[7].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[7].dvTime); + ok(keys[8].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[8].dvTime); + + hr = IDirect3DRMAnimation_DeleteKey(animation, -100.0f); + ok(SUCCEEDED(hr), "Failed to delete keys, hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_DeleteKey(animation, 100.0f); + ok(SUCCEEDED(hr), "Failed to delete keys, hr %#x.\n", hr); + + /* Only first Position keys are not removed. */ + hr = IDirect3DRMAnimation_DeleteKey(animation, 0.0f); + ok(SUCCEEDED(hr), "Failed to delete keys, hr %#x.\n", hr); + + count = 0; + memset(keys, 0, sizeof(keys)); + hr = IDirect3DRMAnimation2_GetKeys(animation2, 0.0f, 100.0f, &count, keys); + ok(SUCCEEDED(hr), "Failed to get key count, hr %#x.\n", hr); + ok(count == 6, "Unexpected key count %u.\n", count); + + ok(keys[0].dwKeyType == D3DRMANIMATION_ROTATEKEY, "Unexpected key type %u.\n", keys[0].dwKeyType); + ok(keys[1].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[1].dwKeyType); + ok(keys[2].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[2].dwKeyType); + ok(keys[3].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[3].dwKeyType); + ok(keys[4].dwKeyType == D3DRMANIMATION_POSITIONKEY, "Unexpected key type %u.\n", keys[4].dwKeyType); + ok(keys[5].dwKeyType == D3DRMANIMATION_SCALEKEY, "Unexpected key type %u.\n", keys[5].dwKeyType); + + ok(keys[0].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[0].dvTime); + ok(keys[1].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[1].dvTime); + ok(keys[2].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[2].dvTime); + ok(keys[3].dvTime == 80.0f, "Unexpected key time %.8e.\n", keys[3].dvTime); + ok(keys[4].dvTime == 99.0f, "Unexpected key time %.8e.\n", keys[4].dvTime); + ok(keys[5].dvTime == 0.0f, "Unexpected key time %.8e.\n", keys[5].dvTime); + + hr = IDirect3DRMAnimation_DeleteKey(animation, 0.0f); + ok(SUCCEEDED(hr), "Failed to delete keys, hr %#x.\n", hr); + + count = 0; + hr = IDirect3DRMAnimation2_GetKeys(animation2, 0.0f, 100.0f, &count, NULL); + ok(SUCCEEDED(hr), "Failed to get key count, hr %#x.\n", hr); + ok(count == 3, "Unexpected key count %u.\n", count); + + IDirect3DRMAnimation2_Release(animation2); + IDirect3DRMAnimation_Release(animation); + + IDirect3DRM_Release(d3drm1); +} + +static void test_animation_qi(void) +{ + static const struct qi_test tests[] = + { + { &IID_IDirect3DRMAnimation2, &IID_IUnknown, &IID_IDirect3DRMAnimation2, S_OK }, + { &IID_IDirect3DRMAnimation, &IID_IUnknown, &IID_IDirect3DRMAnimation, S_OK }, + { &IID_IDirect3DRM, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDevice, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObject, &IID_IUnknown, &IID_IDirect3DRMAnimation, S_OK }, + { &IID_IDirect3DRMDevice2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDevice3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewport, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewport2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRM3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRM2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMVisual, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMesh, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFace, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFace2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMLight, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMaterial, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMaterial2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationSet, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationSet2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObjectArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDeviceArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewportArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFrameArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMVisualArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMLightArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMPickedArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFaceArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMUserVisual, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMShadow, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMShadow2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMInterpolator, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMProgressiveMesh, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMPicked2Array, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMClippedVisual, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawClipper, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface7, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface4, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice7, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D7, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw7, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw4, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DLight, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IUnknown, &IID_IUnknown, NULL, S_OK }, + }; + IDirect3DRMAnimation2 *animation2; + IDirect3DRMAnimation *animation; + IDirect3DRM3 *d3drm3; + IDirect3DRM *d3drm1; + IUnknown *unknown; + HRESULT hr; + + hr = Direct3DRMCreate(&d3drm1); + ok(SUCCEEDED(hr), "Failed to create d3drm instance, hr %#x.\n", hr); + + hr = IDirect3DRM_CreateAnimation(d3drm1, &animation); + ok(SUCCEEDED(hr), "Failed to create animation hr %#x.\n", hr); + + hr = IDirect3DRMAnimation_QueryInterface(animation, &IID_IUnknown, (void **)&unknown); + ok(SUCCEEDED(hr), "Failed to get IUnknown from animation, hr %#x.\n", hr); + IDirect3DRMAnimation_Release(animation); + + test_qi("animation_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + IUnknown_Release(unknown); + + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); + ok(SUCCEEDED(hr), "Failed to get IDirect3DRM3, hr %#x.\n", hr); + + hr = IDirect3DRM3_CreateAnimation(d3drm3, &animation2); + ok(SUCCEEDED(hr), "Failed to create animation hr %#x.\n", hr); + + hr = IDirect3DRMAnimation2_QueryInterface(animation2, &IID_IUnknown, (void **)&unknown); + ok(SUCCEEDED(hr), "Failed to get IUnknown from animation, hr %#x.\n", hr); + IDirect3DRMAnimation2_Release(animation2); + + test_qi("animation2_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + IUnknown_Release(unknown); + + IDirect3DRM3_Release(d3drm3); + IDirect3DRM_Release(d3drm1); +} + +static void test_wrap(void) +{ + IDirect3DRMWrap *wrap; + IDirect3DRM *d3drm1; + HRESULT hr; + + hr = Direct3DRMCreate(&d3drm1); + ok(SUCCEEDED(hr), "Failed to create IDirect3DRM instance, hr %#x.\n", hr); + + hr = IDirect3DRM_CreateObject(d3drm1, &CLSID_CDirect3DRMWrap, NULL, &IID_IDirect3DRMWrap, (void **)&wrap); + ok(SUCCEEDED(hr), "Failed to create wrap instance, hr %#x.\n", hr); + + test_class_name((IDirect3DRMObject *)wrap, ""); + + IDirect3DRMWrap_Release(wrap); + IDirect3DRM_Release(d3drm1); +} + +static void test_wrap_qi(void) +{ + static const struct qi_test tests[] = + { + { &IID_IDirect3DRMWrap, &IID_IUnknown, &IID_IDirect3DRMWrap, S_OK }, + { &IID_IDirect3DRM, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDevice, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObject, &IID_IUnknown, &IID_IDirect3DRMWrap, S_OK }, + { &IID_IDirect3DRMDevice2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDevice3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewport, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewport2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRM3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRM2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMVisual, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMesh, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMeshBuilder3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFace, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFace2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMLight, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMTexture3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMaterial, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMMaterial2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimation, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimation2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationSet, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationSet2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMObjectArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMDeviceArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMViewportArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFrameArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMVisualArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMLightArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMPickedArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMFaceArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMAnimationArray, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMUserVisual, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMShadow, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMShadow2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMInterpolator, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMProgressiveMesh, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMPicked2Array, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DRMClippedVisual, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawClipper, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface7, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface4, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDrawSurface, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice7, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DDevice, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D7, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3D, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw7, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw4, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw3, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw2, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirectDraw, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IDirect3DLight, NULL, NULL, CLASS_E_CLASSNOTAVAILABLE }, + { &IID_IUnknown, &IID_IUnknown, NULL, S_OK }, + }; + IDirect3DRMWrap *wrap; + IDirect3DRM *d3drm1; + IUnknown *unknown; + HRESULT hr; + + hr = Direct3DRMCreate(&d3drm1); + ok(SUCCEEDED(hr), "Failed to create d3drm instance, hr %#x.\n", hr); + + hr = IDirect3DRM_CreateObject(d3drm1, &CLSID_CDirect3DRMWrap, NULL, &IID_IDirect3DRMWrap, (void **)&wrap); + ok(SUCCEEDED(hr), "Failed to create wrap instance, hr %#x.\n", hr); + + hr = IDirect3DRMWrap_QueryInterface(wrap, &IID_IUnknown, (void **)&unknown); + ok(SUCCEEDED(hr), "Failed to get IUnknown from wrap (hr = %#x)\n", hr); + IDirect3DRMWrap_Release(wrap); + test_qi("wrap_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + IUnknown_Release(unknown); + + IDirect3DRM_Release(d3drm1); +} START_TEST(d3drm) { test_MeshBuilder(); @@ -6568,4 +7340,9 @@ test_viewport_qi(); test_viewport_clear1(); test_viewport_clear2(); + test_create_texture_from_surface(); + test_animation(); + test_animation_qi(); + test_wrap(); + test_wrap_qi(); }
7 years, 3 months
1
0
0
0
[akhaldi] 75853: [D3DRM] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:44:24 2017 New Revision: 75853 URL:
http://svn.reactos.org/svn/reactos?rev=75853&view=rev
Log: [D3DRM] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm.c trunk/reactos/dll/directx/wine/d3drm/d3drm_main.c 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/light.c trunk/reactos/dll/directx/wine/d3drm/material.c trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c trunk/reactos/dll/directx/wine/d3drm/texture.c trunk/reactos/dll/directx/wine/d3drm/viewport.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
Modified: trunk/reactos/dll/directx/wine/d3drm/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/dev…
Modified: trunk/reactos/dll/directx/wine/d3drm/face.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/fac…
Modified: trunk/reactos/dll/directx/wine/d3drm/frame.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/fra…
Modified: trunk/reactos/dll/directx/wine/d3drm/light.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/lig…
Modified: trunk/reactos/dll/directx/wine/d3drm/material.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/mat…
Modified: trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/mes…
Modified: trunk/reactos/dll/directx/wine/d3drm/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/tex…
Modified: trunk/reactos/dll/directx/wine/d3drm/viewport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/vie…
7 years, 3 months
1
0
0
0
[akhaldi] 75852: [PSDK] Update d3drmobj.h. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:44:16 2017 New Revision: 75852 URL:
http://svn.reactos.org/svn/reactos?rev=75852&view=rev
Log: [PSDK] Update d3drmobj.h. CORE-13762 Modified: trunk/reactos/sdk/include/psdk/d3drmobj.h Modified: trunk/reactos/sdk/include/psdk/d3drmobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/d3drmobj.…
============================================================================== --- trunk/reactos/sdk/include/psdk/d3drmobj.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/d3drmobj.h [iso-8859-1] Sat Sep 16 20:44:16 2017 @@ -2335,7 +2335,7 @@ #define IDirect3DRMFace_GetVertexCount(p) (p)->lpVtbl->GetVertexCount(p) #define IDirect3DRMFace_GetVertexIndex(p,a) (p)->lpVtbl->GetVertexIndex(p,a) #define IDirect3DRMFace_GetTextureCoordinateIndex(p,a) (p)->lpVtbl->GetTextureCoordinateIndex(p,a) -#define IDirect3DRMFace_GetColor(p,a) (p)->lpVtbl->GetColor(p,a) +#define IDirect3DRMFace_GetColor(p) (p)->lpVtbl->GetColor(p) #else /*** IUnknown methods ***/ #define IDirect3DRMFace_QueryInterface(p,a,b) (p)->QueryInterface(a,b) @@ -2368,7 +2368,7 @@ #define IDirect3DRMFace_GetVertexCount(p) (p)->GetVertexCount() #define IDirect3DRMFace_GetVertexIndex(p,a) (p)->GetVertexIndex(a) #define IDirect3DRMFace_GetTextureCoordinateIndex(p,a) (p)->GetTextureCoordinateIndex(a) -#define IDirect3DRMFace_GetColor(p,a) (p)->GetColor(a) +#define IDirect3DRMFace_GetColor(p) (p)->GetColor() #endif /***************************************************************************** @@ -2445,7 +2445,7 @@ #define IDirect3DRMFace2_GetVertexCount(p) (p)->lpVtbl->GetVertexCount(p) #define IDirect3DRMFace2_GetVertexIndex(p,a) (p)->lpVtbl->GetVertexIndex(p,a) #define IDirect3DRMFace2_GetTextureCoordinateIndex(p,a) (p)->lpVtbl->GetTextureCoordinateIndex(p,a) -#define IDirect3DRMFace2_GetColor(p,a) (p)->lpVtbl->GetColor(p,a) +#define IDirect3DRMFace2_GetColor(p) (p)->lpVtbl->GetColor(p) #else /*** IUnknown methods ***/ #define IDirect3DRMFace2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) @@ -2478,7 +2478,7 @@ #define IDirect3DRMFace2_GetVertexCount(p) (p)->GetVertexCount() #define IDirect3DRMFace2_GetVertexIndex(p,a) (p)->GetVertexIndex(a) #define IDirect3DRMFace2_GetTextureCoordinateIndex(p,a) (p)->GetTextureCoordinateIndex(a) -#define IDirect3DRMFace2_GetColor(p,a) (p)->GetColor(a) +#define IDirect3DRMFace2_GetColor(p) (p)->GetColor() #endif /*****************************************************************************
7 years, 3 months
1
0
0
0
[akhaldi] 75851: [D3DCOMPILER_43] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 16 20:44:11 2017 New Revision: 75851 URL:
http://svn.reactos.org/svn/reactos?rev=75851&view=rev
Log: [D3DCOMPILER_43] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/compiler.c Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/compiler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
============================================================================== --- trunk/reactos/dll/directx/wine/d3dcompiler_43/compiler.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3dcompiler_43/compiler.c [iso-8859-1] Sat Sep 16 20:44:11 2017 @@ -466,8 +466,8 @@ { HRESULT hr; - TRACE("data %p, datasize %lu, filename %s, defines %p, include %p, sflags %#x,\n" - "shader %p, error_messages %p\n", + TRACE("data %p, datasize %lu, filename %s, defines %p, include %p, sflags %#x, " + "shader %p, error_messages %p.\n", data, datasize, debugstr_a(filename), defines, include, flags, shader, error_messages); EnterCriticalSection(&wpp_mutex); @@ -695,9 +695,9 @@ { HRESULT hr; - TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n" - "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p,\n" - "secondary_data_size %lu, shader %p, error_messages %p\n", + TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, " + "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p, " + "secondary_data_size %lu, shader %p, error_messages %p.\n", data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint), debugstr_a(target), sflags, eflags, secondary_flags, secondary_data, secondary_data_size, shader, error_messages); @@ -723,8 +723,8 @@ const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages) { - TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n" - "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p\n", + TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, " + "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p.\n", data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint), debugstr_a(target), sflags, eflags, shader, error_messages);
7 years, 3 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
29
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Results per page:
10
25
50
100
200