ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2016
----- 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
18 participants
358 discussions
Start a n
N
ew thread
[akhaldi] 71766: [INCLUDE/WINE] Update winternl.h. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 16:07:18 2016 New Revision: 71766 URL:
http://svn.reactos.org/svn/reactos?rev=71766&view=rev
Log: [INCLUDE/WINE] Update winternl.h. CORE-11368 Modified: trunk/reactos/sdk/include/reactos/wine/winternl.h Modified: trunk/reactos/sdk/include/reactos/wine/winternl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/wine/w…
============================================================================== --- trunk/reactos/sdk/include/reactos/wine/winternl.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/wine/winternl.h [iso-8859-1] Sat Jul 2 16:07:18 2016 @@ -543,6 +543,23 @@ WCHAR FileName[ANYSIZE_ARRAY]; } FILE_ID_BOTH_DIRECTORY_INFORMATION, *PFILE_ID_BOTH_DIRECTORY_INFORMATION; +typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + LARGE_INTEGER FileId; + GUID LockingTransactionId; + ULONG TxInfoFlags; + WCHAR FileName[ANYSIZE_ARRAY]; +} FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION; + typedef struct _FILE_BASIC_INFORMATION { LARGE_INTEGER CreationTime; LARGE_INTEGER LastAccessTime; @@ -683,6 +700,34 @@ ULONG NamedPipeState; ULONG NamedPipeEnd; } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION; + +typedef struct _FILE_OBJECTID_INFORMATION { + LONGLONG FileReference; + UCHAR ObjectId[16]; + union { + struct { + UCHAR BirthVolumeId[16]; + UCHAR BirthObjectId[16]; + UCHAR DomainId[16]; + } DUMMYSTRUCTNAME; + UCHAR ExtendedInfo[48]; + } DUMMYUNIONNAME; +} FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION; + +typedef struct _FILE_QUOTA_INFORMATION { + ULONG NextEntryOffset; + ULONG SidLength; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER QuotaUsed; + LARGE_INTEGER QuotaThreshold; + LARGE_INTEGER QuotaLimit; + SID Sid; +} FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION; + +typedef struct _FILE_REPARSE_POINT_INFORMATION { + LONGLONG FileReference; + ULONG Tag; +} FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION; #define FILE_PIPE_DISCONNECTED_STATE 0x01 #define FILE_PIPE_LISTENING_STATE 0x02 @@ -2383,11 +2428,14 @@ NTSYSAPI NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD); NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID); NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID); +NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID); NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID); NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID); +NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID); NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*); NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL); NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL); +NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL); NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE); NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER); NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN); @@ -2414,6 +2462,7 @@ NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG); NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN); NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN); +NTSYSAPI LONG WINAPI RtlCompareUnicodeStrings(const WCHAR*,SIZE_T,const WCHAR*,SIZE_T,BOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID); NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT); NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
8 years, 5 months
1
0
0
0
[akhaldi] 71765: [QUARTZ_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:56:56 2016 New Revision: 71765 URL:
http://svn.reactos.org/svn/reactos?rev=71765&view=rev
Log: [QUARTZ_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/rostests/winetests/quartz/avisplitter.c trunk/rostests/winetests/quartz/filtermapper.c Modified: trunk/rostests/winetests/quartz/avisplitter.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/quartz/avisplit…
============================================================================== --- trunk/rostests/winetests/quartz/avisplitter.c [iso-8859-1] (original) +++ trunk/rostests/winetests/quartz/avisplitter.c [iso-8859-1] Sat Jul 2 15:56:56 2016 @@ -169,6 +169,137 @@ IBaseFilter_Release(base); } +static void test_filesourcefilter(void) +{ + static const WCHAR prefix[] = {'w','i','n',0}; + static const struct + { + const char *label; + const char *data; + DWORD size; + const GUID *subtype; + } + tests[] = + { + { + "AVI", + "\x52\x49\x46\x46xxxx\x41\x56\x49\x20", + 12, + &MEDIASUBTYPE_Avi, + }, + { + "MPEG1 System", + "\x00\x00\x01\xBA\x21\x00\x01\x00\x01\x80\x00\x01\x00\x00\x01\xBB", + 16, + &MEDIASUBTYPE_MPEG1System, + }, + { + "MPEG1 Video", + "\x00\x00\x01\xB3", + 4, + &MEDIASUBTYPE_MPEG1Video, + }, + { + "MPEG1 Audio", + "\xFF\xE0", + 2, + &MEDIASUBTYPE_MPEG1Audio, + }, + { + "MPEG2 Program", + "\x00\x00\x01\xBA\x40", + 5, + &MEDIASUBTYPE_MPEG2_PROGRAM, + }, + { + "WAVE", + "\x52\x49\x46\x46xxxx\x57\x41\x56\x45", + 12, + &MEDIASUBTYPE_WAVE, + }, + { + "unknown format", + "Hello World", + 11, + NULL, /* FIXME: should be &MEDIASUBTYPE_NULL */ + }, + }; + WCHAR path[MAX_PATH], temp[MAX_PATH]; + IFileSourceFilter *filesource; + DWORD ret, written; + IBaseFilter *base; + AM_MEDIA_TYPE mt; + OLECHAR *olepath; + BOOL success; + HANDLE file; + HRESULT hr; + int i; + + ret = GetTempPathW(MAX_PATH, temp); + ok(ret, "GetTempPathW failed with error %u\n", GetLastError()); + ret = GetTempFileNameW(temp, prefix, 0, path); + ok(ret, "GetTempFileNameW failed with error %u\n", GetLastError()); + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + trace("Running test for %s\n", tests[i].label); + + file = CreateFileW(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFileW failed with error %u\n", GetLastError()); + success = WriteFile(file, tests[i].data, tests[i].size, &written, NULL); + ok(success, "WriteFile failed with error %u\n", GetLastError()); + ok(written == tests[i].size, "could not write test data\n"); + CloseHandle(file); + + hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, + &IID_IBaseFilter, (void **)&base); + ok(hr == S_OK, "CoCreateInstance failed with %08x\n", hr); + hr = IBaseFilter_QueryInterface(base, &IID_IFileSourceFilter, (void **)&filesource); + ok(hr == S_OK, "IBaseFilter_QueryInterface failed with %08x\n", hr); + + olepath = (void *)0xdeadbeef; + hr = IFileSourceFilter_GetCurFile(filesource, &olepath, NULL); + ok(hr == S_OK, "expected S_OK, got %08x\n", hr); + ok(olepath == NULL, "expected NULL, got %p\n", olepath); + + hr = IFileSourceFilter_Load(filesource, NULL, NULL); + ok(hr == E_POINTER, "expected E_POINTER, got %08x\n", hr); + + hr = IFileSourceFilter_Load(filesource, path, NULL); + ok(hr == S_OK, "IFileSourceFilter_Load failed with %08x\n", hr); + + hr = IFileSourceFilter_GetCurFile(filesource, NULL, &mt); + ok(hr == E_POINTER, "expected E_POINTER, got %08x\n", hr); + + olepath = NULL; + hr = IFileSourceFilter_GetCurFile(filesource, &olepath, NULL); + ok(hr == S_OK, "expected S_OK, got %08x\n", hr); + CoTaskMemFree(olepath); + + olepath = NULL; + memset(&mt, 0x11, sizeof(mt)); + hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &mt); + ok(hr == S_OK, "expected S_OK, got %08x\n", hr); + ok(!lstrcmpW(olepath, path), + "expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(olepath)); + if (tests[i].subtype) + { + ok(IsEqualGUID(&mt.majortype, &MEDIATYPE_Stream), + "expected MEDIATYPE_Stream, got %s\n", wine_dbgstr_guid(&mt.majortype)); + ok(IsEqualGUID(&mt.subtype, tests[i].subtype), + "expected %s, got %s\n", wine_dbgstr_guid(tests[i].subtype), wine_dbgstr_guid(&mt.subtype)); + } + CoTaskMemFree(olepath); + + IFileSourceFilter_Release(filesource); + IBaseFilter_Release(base); + + success = DeleteFileW(path); + ok(success, "DeleteFileW failed with error %u\n", GetLastError()); + } +} + static const WCHAR wfile[] = {'t','e','s','t','.','a','v','i',0}; static const char afile[] = "test.avi"; @@ -462,6 +593,7 @@ test_query_interface(); test_basefilter(); + test_filesourcefilter(); test_threads(); release_avisplitter(); Modified: trunk/rostests/winetests/quartz/filtermapper.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/quartz/filterma…
============================================================================== --- trunk/rostests/winetests/quartz/filtermapper.c [iso-8859-1] (original) +++ trunk/rostests/winetests/quartz/filtermapper.c [iso-8859-1] Sat Jul 2 15:56:56 2016 @@ -593,7 +593,7 @@ ok(pmapper != &unk_outer.IUnknown_iface, "pmapper = %p, expected not %p\n", pmapper, &unk_outer.IUnknown_iface); hr = IUnknown_QueryInterface(pmapper, &IID_IUnknown, (void **)&punk); - ok(hr == S_OK, "CoCreateInstance returned %x\n", hr); + ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); ok(punk != &unk_outer.IUnknown_iface, "punk = %p, expected not %p\n", punk, &unk_outer.IUnknown_iface); IUnknown_Release(punk); @@ -603,7 +603,7 @@ unk_outer.Release_called = 0; hr = IUnknown_QueryInterface(pmapper, &IID_IFilterMapper, (void **)&punk); - ok(hr == S_OK, "CoCreateInstance returned %x\n", hr); + ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); ok(punk != &unk_outer.IUnknown_iface, "punk = %p, expected not %p\n", punk, &unk_outer.IUnknown_iface); IUnknown_Release(punk); @@ -613,7 +613,7 @@ unk_outer.Release_called = 0; hr = IUnknown_QueryInterface(pmapper, &IID_IFilterMapper2, (void **)&punk); - ok(hr == S_OK, "CoCreateInstance returned %x\n", hr); + ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); ok(punk != &unk_outer.IUnknown_iface, "punk = %p, expected not %p\n", punk, &unk_outer.IUnknown_iface); IUnknown_Release(punk); @@ -623,7 +623,7 @@ unk_outer.Release_called = 0; hr = IUnknown_QueryInterface(pmapper, &IID_IFilterMapper3, (void **)&punk); - ok(hr == S_OK, "CoCreateInstance returned %x\n", hr); + ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); ok(punk != &unk_outer.IUnknown_iface, "punk = %p, expected not %p\n", punk, &unk_outer.IUnknown_iface); IUnknown_Release(punk);
8 years, 5 months
1
0
0
0
[akhaldi] 71764: [QUARTZ] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:56:39 2016 New Revision: 71764 URL:
http://svn.reactos.org/svn/reactos?rev=71764&view=rev
Log: [QUARTZ] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/directx/wine/quartz/acmwrapper.c trunk/reactos/dll/directx/wine/quartz/avidec.c trunk/reactos/dll/directx/wine/quartz/dsoundrender.c trunk/reactos/dll/directx/wine/quartz/filesource.c trunk/reactos/dll/directx/wine/quartz/filtermapper.c trunk/reactos/dll/directx/wine/quartz/pin.c trunk/reactos/dll/directx/wine/quartz/videorenderer.c trunk/reactos/dll/directx/wine/quartz/vmr9.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/quartz/acmwrapper.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/ac…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/acmwrapper.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/acmwrapper.c [iso-8859-1] Sat Jul 2 15:56:39 2016 @@ -36,7 +36,7 @@ static inline ACMWrapperImpl *impl_from_TransformFilter( TransformFilter *iface ) { - return CONTAINING_RECORD(iface, ACMWrapperImpl, tf.filter); + return CONTAINING_RECORD(iface, ACMWrapperImpl, tf); } static HRESULT WINAPI ACMWrapper_Receive(TransformFilter *tf, IMediaSample *pSample) Modified: trunk/reactos/dll/directx/wine/quartz/avidec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/av…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/avidec.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/avidec.c [iso-8859-1] Sat Jul 2 15:56:39 2016 @@ -34,7 +34,7 @@ static inline AVIDecImpl *impl_from_TransformFilter( TransformFilter *iface ) { - return CONTAINING_RECORD(iface, AVIDecImpl, tf.filter); + return CONTAINING_RECORD(iface, AVIDecImpl, tf); } static HRESULT WINAPI AVIDec_StartStreaming(TransformFilter* pTransformFilter) 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 Jul 2 15:56:39 2016 @@ -387,7 +387,7 @@ else if (jitter < 0) jitter = 0; q.Type = (jitter > 0 ? Famine : Flood); - q.Proportion = 1.; + q.Proportion = 1000; q.Late = jitter; q.TimeStamp = tStart; IQualityControl_Notify((IQualityControl *)This->renderer.qcimpl, (IBaseFilter*)This, q); 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 Jul 2 15:56:39 2016 @@ -598,6 +598,9 @@ TRACE("(%s, %p)\n", debugstr_w(pszFileName), pmt); + if (!pszFileName) + return E_POINTER; + /* open file */ /* FIXME: check the sharing values that native uses */ hFile = CreateFileW(pszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); @@ -637,8 +640,8 @@ hr = GetClassMediaFile(pReader, pszFileName, &This->pmt->majortype, &This->pmt->subtype, NULL); if (FAILED(hr)) { - memcpy(&This->pmt->majortype, &MEDIATYPE_Stream, sizeof(GUID)); - memcpy(&This->pmt->subtype, &MEDIASUBTYPE_NULL, sizeof(GUID)); + This->pmt->majortype = MEDIATYPE_Stream; + This->pmt->subtype = MEDIASUBTYPE_NULL; hr = S_OK; } } @@ -751,7 +754,7 @@ return CONTAINING_RECORD(iface, FileAsyncReader, pin); } -static inline BaseOutputPin *impl_BaseOututPin_from_BasePin(BasePin *iface) +static inline BaseOutputPin *impl_BaseOutputPin_from_BasePin(BasePin *iface) { return CONTAINING_RECORD(iface, BaseOutputPin, pin); } @@ -867,7 +870,7 @@ * doesn't need the IMemInputPin interface on the receiving pin */ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(BasePin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) { - BaseOutputPin *This = impl_BaseOututPin_from_BasePin(iface); + BaseOutputPin *This = impl_BaseOutputPin_from_BasePin(iface); HRESULT hr; TRACE("(%p, %p)\n", pReceivePin, pmt); Modified: trunk/reactos/dll/directx/wine/quartz/filtermapper.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/fi…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/filtermapper.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/filtermapper.c [iso-8859-1] Sat Jul 2 15:56:39 2016 @@ -1141,7 +1141,8 @@ HRESULT hr; TRACE("(%p/%p)->(%p, %x, %s, %s, %s, %s, %s, %s, %s) stub!\n", - iface,This, + This, + iface, ppEnum, dwMerit, bInputNeeded ? "true" : "false", Modified: trunk/reactos/dll/directx/wine/quartz/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/pi…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/pin.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/pin.c [iso-8859-1] Sat Jul 2 15:56:39 2016 @@ -20,8 +20,6 @@ #include "quartz_private.h" -static const IPinVtbl PullPin_Vtbl; - #define ALIGNDOWN(value,boundary) ((value)/(boundary)*(boundary)) #define ALIGNUP(value,boundary) (ALIGNDOWN((value)+(boundary)-1, (boundary))) Modified: trunk/reactos/dll/directx/wine/quartz/videorenderer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/vi…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/videorenderer.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/videorenderer.c [iso-8859-1] Sat Jul 2 15:56:39 2016 @@ -164,7 +164,7 @@ AdjustWindowRectEx(&This->WindowPos, style, FALSE, style_ex); - TRACE("WindowPos: %d %d %d %d\n", This->WindowPos.left, This->WindowPos.top, This->WindowPos.right, This->WindowPos.bottom); + TRACE("WindowPos: %s\n", wine_dbgstr_rect(&This->WindowPos)); SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL, This->WindowPos.left, This->WindowPos.top, @@ -222,8 +222,8 @@ return E_FAIL; } - TRACE("Src Rect: %d %d %d %d\n", This->SourceRect.left, This->SourceRect.top, This->SourceRect.right, This->SourceRect.bottom); - TRACE("Dst Rect: %d %d %d %d\n", This->DestRect.left, This->DestRect.top, This->DestRect.right, This->DestRect.bottom); + TRACE("Src Rect: %s\n", wine_dbgstr_rect(&This->SourceRect)); + TRACE("Dst Rect: %s\n", wine_dbgstr_rect(&This->DestRect)); StretchDIBits(This->baseControlWindow.baseWindow.hDC, This->DestRect.left, This->DestRect.top, This->DestRect.right -This->DestRect.left, This->DestRect.bottom - This->DestRect.top, This->SourceRect.left, This->SourceRect.top, @@ -410,9 +410,7 @@ VideoRendererImpl *This = impl_from_BaseWindow(iface); static RECT defRect; - defRect.left = defRect.top = 0; - defRect.right = This->VideoWidth; - defRect.bottom = This->VideoHeight; + SetRect(&defRect, 0, 0, This->VideoWidth, This->VideoHeight); return defRect; } @@ -576,10 +574,7 @@ { VideoRendererImpl *This = impl_from_BaseControlVideo(iface); - This->SourceRect.left = 0; - This->SourceRect.top = 0; - This->SourceRect.right = This->VideoWidth; - This->SourceRect.bottom = This->VideoHeight; + SetRect(&This->SourceRect, 0, 0, This->VideoWidth, This->VideoHeight); return S_OK; } @@ -592,10 +587,7 @@ if (!GetClientRect(This->baseControlWindow.baseWindow.hWnd, &rect)) return E_FAIL; - This->DestRect.left = 0; - This->DestRect.top = 0; - This->DestRect.right = rect.right; - This->DestRect.bottom = rect.bottom; + SetRect(&This->DestRect, 0, 0, rect.right, rect.bottom); return S_OK; } 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 Jul 2 15:56:39 2016 @@ -227,8 +227,8 @@ width = bmiHeader->biWidth; height = bmiHeader->biHeight; - TRACE("Src Rect: %d %d %d %d\n", This->source_rect.left, This->source_rect.top, This->source_rect.right, This->source_rect.bottom); - TRACE("Dst Rect: %d %d %d %d\n", This->target_rect.left, This->target_rect.top, This->target_rect.right, This->target_rect.bottom); + TRACE("Src Rect: %s\n", wine_dbgstr_rect(&This->source_rect)); + TRACE("Dst Rect: %s\n", wine_dbgstr_rect(&This->target_rect)); hr = IDirect3DSurface9_LockRect(info->lpSurf, &lock, NULL, D3DLOCK_DISCARD); if (FAILED(hr)) @@ -335,9 +335,9 @@ This->bmiheader = format->bmiHeader; TRACE("Resolution: %dx%d\n", format->bmiHeader.biWidth, format->bmiHeader.biHeight); - This->source_rect.right = This->VideoWidth = format->bmiHeader.biWidth; - This->source_rect.bottom = This->VideoHeight = format->bmiHeader.biHeight; - This->source_rect.top = This->source_rect.left = 0; + This->VideoWidth = format->bmiHeader.biWidth; + This->VideoHeight = format->bmiHeader.biHeight; + SetRect(&This->source_rect, 0, 0, This->VideoWidth, This->VideoHeight); } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) { @@ -346,9 +346,9 @@ This->bmiheader = format->bmiHeader; TRACE("Resolution: %dx%d\n", format->bmiHeader.biWidth, format->bmiHeader.biHeight); - This->source_rect.right = This->VideoWidth = format->bmiHeader.biWidth; - This->source_rect.bottom = This->VideoHeight = format->bmiHeader.biHeight; - This->source_rect.top = This->source_rect.left = 0; + This->VideoWidth = format->bmiHeader.biWidth; + This->VideoHeight = format->bmiHeader.biHeight; + SetRect(&This->source_rect, 0, 0, This->VideoWidth, This->VideoHeight); } else { @@ -408,9 +408,7 @@ hr = IVMRSurfaceAllocatorEx9_InitializeDevice(This->allocator, This->cookie, &info, &buffers); if (SUCCEEDED(hr)) { - This->source_rect.left = This->source_rect.top = 0; - This->source_rect.right = This->bmiheader.biWidth; - This->source_rect.bottom = This->bmiheader.biHeight; + SetRect(&This->source_rect, 0, 0, This->bmiheader.biWidth, This->bmiheader.biHeight); This->num_surfaces = buffers; } @@ -526,9 +524,7 @@ struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This); static RECT defRect; - defRect.left = defRect.top = 0; - defRect.right = pVMR9->VideoWidth; - defRect.bottom = pVMR9->VideoHeight; + SetRect(&defRect, 0, 0, pVMR9->VideoWidth, pVMR9->VideoHeight); return defRect; } @@ -670,10 +666,7 @@ { struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); - pVMR9->source_rect.left = 0; - pVMR9->source_rect.top = 0; - pVMR9->source_rect.right = pVMR9->VideoWidth; - pVMR9->source_rect.bottom = pVMR9->VideoHeight; + SetRect(&pVMR9->source_rect, 0, 0, pVMR9->VideoWidth, pVMR9->VideoHeight); return S_OK; } @@ -686,10 +679,7 @@ if (!GetClientRect(pVMR9->baseControlWindow.baseWindow.hWnd, &rect)) return E_FAIL; - pVMR9->target_rect.left = 0; - pVMR9->target_rect.top = 0; - pVMR9->target_rect.right = rect.right; - pVMR9->target_rect.bottom = rect.bottom; + SetRect(&pVMR9->target_rect, 0, 0, rect.right, rect.bottom); return S_OK; } @@ -1761,8 +1751,7 @@ This->target_rect = *dest; if (This->baseControlWindow.baseWindow.hWnd) { - FIXME("Output rectangle: starting at %dx%d, up to point %dx%d\n", - dest->left, dest->top, dest->right, dest->bottom); + FIXME("Output rectangle: %s\n", wine_dbgstr_rect(dest)); SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL, dest->left, dest->top, dest->right - dest->left, dest->bottom-dest->top, SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOOWNERZORDER|SWP_NOREDRAW); @@ -1966,7 +1955,7 @@ This->target_rect = *dest; if (This->baseControlWindow.baseWindow.hWnd) { - FIXME("Output rectangle: starting at %dx%d, up to point %dx%d\n", dest->left, dest->top, dest->right, dest->bottom); + FIXME("Output rectangle: %s\n", wine_dbgstr_rect(dest)); SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL, dest->left, dest->top, dest->right - dest->left, dest->bottom-dest->top, SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOOWNERZORDER|SWP_NOREDRAW); } @@ -2584,14 +2573,9 @@ return hr; } - target_rect = This->pVMR9->target_rect; - target_rect.right -= target_rect.left; - target_rect.bottom -= target_rect.top; - target_rect.left = target_rect.top = 0; - - /* Flip */ - target_rect.top = target_rect.bottom; - target_rect.bottom = 0; + /* Move rect to origin and flip it */ + SetRect(&target_rect, 0, This->pVMR9->target_rect.bottom - This->pVMR9->target_rect.top, + This->pVMR9->target_rect.right - This->pVMR9->target_rect.left, 0); hr = IDirect3DDevice9_StretchRect(This->d3d9_dev, surface, &This->pVMR9->source_rect, target, &target_rect, D3DTEXF_LINEAR); if (FAILED(hr)) @@ -2610,7 +2594,7 @@ TRACE("(%p/%p/%p)->(...) stub\n", iface, This, This->pVMR9); GetWindowRect(This->pVMR9->baseControlWindow.baseWindow.hWnd, &output); - TRACE("Output rectangle: starting at %dx%d, up to point %dx%d\n", output.left, output.top, output.right, output.bottom); + TRACE("Output rectangle: %s\n", wine_dbgstr_rect(&output)); /* This might happen if we don't have active focus (eg on a different virtual desktop) */ if (!This->d3d9_dev) 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 Jul 2 15:56:39 2016 @@ -39,7 +39,7 @@ reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/qedit # Synced to WineStaging-1.9.11 -reactos/dll/directx/wine/quartz # Synced to WineStaging-1.9.4 +reactos/dll/directx/wine/quartz # Synced to WineStaging-1.9.11 reactos/dll/directx/wine/wined3d # Synced to WineStaging-1.9.4 reactos/dll/win32/activeds # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71763: [QEDIT_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:52:42 2016 New Revision: 71763 URL:
http://svn.reactos.org/svn/reactos?rev=71763&view=rev
Log: [QEDIT_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/rostests/winetests/qedit/mediadet.c Modified: trunk/rostests/winetests/qedit/mediadet.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/qedit/mediadet.…
============================================================================== --- trunk/rostests/winetests/qedit/mediadet.c [iso-8859-1] (original) +++ trunk/rostests/winetests/qedit/mediadet.c [iso-8859-1] Sat Jul 2 15:52:42 2016 @@ -353,6 +353,174 @@ DeleteFileW(test_sound_avi_filename); } +static HRESULT WINAPI ms_QueryInterface(IMediaSample *iface, REFIID riid, + void **ppvObject) +{ + return E_NOTIMPL; +} + +static ULONG WINAPI ms_AddRef(IMediaSample *iface) +{ + return 2; +} + +static ULONG WINAPI ms_Release(IMediaSample *iface) +{ + return 1; +} + +static HRESULT WINAPI ms_GetPointer(IMediaSample *iface, BYTE **ppBuffer) +{ + return E_NOTIMPL; +} + +static LONG WINAPI ms_GetSize(IMediaSample *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_GetTime(IMediaSample *iface, REFERENCE_TIME *pTimeStart, + REFERENCE_TIME *pTimeEnd) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_SetTime(IMediaSample *iface, REFERENCE_TIME *pTimeStart, + REFERENCE_TIME *pTimeEnd) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_IsSyncPoint(IMediaSample *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_SetSyncPoint(IMediaSample *iface, BOOL bIsSyncPoint) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_IsPreroll(IMediaSample *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_SetPreroll(IMediaSample *iface, BOOL bIsPreroll) +{ + return E_NOTIMPL; +} + +static LONG WINAPI ms_GetActualDataLength(IMediaSample *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_SetActualDataLength(IMediaSample *iface, LONG length) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_GetMediaType(IMediaSample *iface, AM_MEDIA_TYPE + **ppMediaType) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_SetMediaType(IMediaSample *iface, AM_MEDIA_TYPE *pMediaType) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_IsDiscontinuity(IMediaSample *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_SetDiscontinuity(IMediaSample *iface, BOOL bDiscontinuity) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_GetMediaTime(IMediaSample *iface, LONGLONG *pTimeStart, + LONGLONG *pTimeEnd) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ms_SetMediaTime(IMediaSample *iface, LONGLONG *pTimeStart, + LONGLONG *pTimeEnd) +{ + return E_NOTIMPL; +} + +static const IMediaSampleVtbl my_sample_vt = { + ms_QueryInterface, + ms_AddRef, + ms_Release, + ms_GetPointer, + ms_GetSize, + ms_GetTime, + ms_SetTime, + ms_IsSyncPoint, + ms_SetSyncPoint, + ms_IsPreroll, + ms_SetPreroll, + ms_GetActualDataLength, + ms_SetActualDataLength, + ms_GetMediaType, + ms_SetMediaType, + ms_IsDiscontinuity, + ms_SetDiscontinuity, + ms_GetMediaTime, + ms_SetMediaTime +}; + +static IMediaSample my_sample = { &my_sample_vt }; + +static BOOL samplecb_called = FALSE; + +static HRESULT WINAPI sgcb_QueryInterface(ISampleGrabberCB *iface, REFIID riid, + void **ppvObject) +{ + return E_NOTIMPL; +} + +static ULONG WINAPI sgcb_AddRef(ISampleGrabberCB *iface) +{ + return E_NOTIMPL; +} + +static ULONG WINAPI sgcb_Release(ISampleGrabberCB *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI sgcb_SampleCB(ISampleGrabberCB *iface, double SampleTime, + IMediaSample *pSample) +{ + ok(pSample == &my_sample, "Got wrong IMediaSample: %p, expected %p\n", pSample, &my_sample); + samplecb_called = TRUE; + return E_NOTIMPL; +} + +static HRESULT WINAPI sgcb_BufferCB(ISampleGrabberCB *iface, double SampleTime, + BYTE *pBuffer, LONG BufferLen) +{ + ok(0, "BufferCB should not have been called\n"); + return E_NOTIMPL; +} + +static const ISampleGrabberCBVtbl sgcb_vt = { + sgcb_QueryInterface, + sgcb_AddRef, + sgcb_Release, + sgcb_SampleCB, + sgcb_BufferCB +}; + +static ISampleGrabberCB my_sg_cb = { &sgcb_vt }; + static void test_samplegrabber(void) { struct unk_impl unk_obj = {{&unk_vtbl}, 19, NULL}; @@ -361,8 +529,12 @@ IMediaFilter *mf; IPersist *persist; IUnknown *unk; + IPin *pin; + IMemInputPin *inpin; + IEnumPins *pins; ULONG refcount; HRESULT hr; + FILTER_STATE fstate; /* COM aggregation */ hr = CoCreateInstance(&CLSID_SampleGrabber, &unk_obj.IUnknown_iface, CLSCTX_INPROC_SERVER, @@ -414,6 +586,31 @@ refcount = IUnknown_AddRef(unk); ok(refcount == 7, "refcount == %u, expected 7\n", refcount); refcount = IUnknown_Release(unk); + + hr = ISampleGrabber_SetCallback(sg, &my_sg_cb, 0); + ok(hr == S_OK, "SetCallback failed: %08x\n", hr); + + hr = IBaseFilter_GetState(bf, 100, &fstate); + ok(hr == S_OK, "Failed to get filter state: %08x\n", hr); + ok(fstate == State_Stopped, "Got wrong filter state: %u\n", fstate); + + hr = IBaseFilter_EnumPins(bf, &pins); + ok(hr == S_OK, "EnumPins create failed: %08x, expected S_OK\n", hr); + + hr = IEnumPins_Next(pins, 1, &pin, NULL); + ok(hr == S_OK, "Next failed: %08x\n", hr); + + IEnumPins_Release(pins); + + hr = IPin_QueryInterface(pin, &IID_IMemInputPin, (void**)&inpin); + ok(hr == S_OK, "QueryInterface(IMemInputPin) failed: %08x\n", hr); + + hr = IMemInputPin_Receive(inpin, &my_sample); + ok(hr == S_OK, "Receive failed: %08x\n", hr); + ok(samplecb_called == TRUE, "SampleCB should have been called\n"); + + IMemInputPin_Release(inpin); + IPin_Release(pin); /* Interfaces that native does not support */ hr = ISampleGrabber_QueryInterface(sg, &IID_IMediaPosition, (void**)&unk);
8 years, 5 months
1
0
0
0
[akhaldi] 71762: [QEDIT] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:52:21 2016 New Revision: 71762 URL:
http://svn.reactos.org/svn/reactos?rev=71762&view=rev
Log: [QEDIT] Sync with Wine Staging 1.9.11. CORE-11368 Added: trunk/reactos/dll/directx/wine/qedit/timeline.c (with props) Modified: trunk/reactos/dll/directx/wine/qedit/CMakeLists.txt trunk/reactos/dll/directx/wine/qedit/main.c trunk/reactos/dll/directx/wine/qedit/mediadet.c trunk/reactos/dll/directx/wine/qedit/qedit_classes.idl trunk/reactos/dll/directx/wine/qedit/qedit_classes.rgs trunk/reactos/dll/directx/wine/qedit/qedit_private.h trunk/reactos/dll/directx/wine/qedit/samplegrabber.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/qedit/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/CMa…
============================================================================== --- trunk/reactos/dll/directx/wine/qedit/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/qedit/CMakeLists.txt [iso-8859-1] Sat Jul 2 15:52:21 2016 @@ -7,6 +7,7 @@ main.c mediadet.c samplegrabber.c + timeline.c qedit_private.h) add_library(qedit SHARED Modified: trunk/reactos/dll/directx/wine/qedit/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/mai…
============================================================================== --- trunk/reactos/dll/directx/wine/qedit/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/qedit/main.c [iso-8859-1] Sat Jul 2 15:52:21 2016 @@ -56,6 +56,7 @@ static const struct object_creation_info object_creation[] = { + { &CLSID_AMTimeline, AMTimeline_create }, { &CLSID_MediaDet, MediaDet_create }, { &CLSID_SampleGrabber, SampleGrabber_create }, }; Modified: trunk/reactos/dll/directx/wine/qedit/mediadet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/med…
============================================================================== --- trunk/reactos/dll/directx/wine/qedit/mediadet.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/qedit/mediadet.c [iso-8859-1] Sat Jul 2 15:52:21 2016 @@ -102,7 +102,6 @@ { MD_cleanup(This); CoTaskMemFree(This); - return 0; } return ref; @@ -630,7 +629,7 @@ HRESULT MediaDet_create(IUnknown * pUnkOuter, LPVOID * ppv) { MediaDetImpl* obj = NULL; - TRACE("(%p,%p)\n", ppv, pUnkOuter); + TRACE("(%p,%p)\n", pUnkOuter, ppv); obj = CoTaskMemAlloc(sizeof(MediaDetImpl)); if (NULL == obj) { Modified: trunk/reactos/dll/directx/wine/qedit/qedit_classes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/qed…
============================================================================== --- trunk/reactos/dll/directx/wine/qedit/qedit_classes.idl [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/qedit/qedit_classes.idl [iso-8859-1] Sat Jul 2 15:52:21 2016 @@ -22,6 +22,12 @@ [ threading(both), + uuid(78530B75-61F9-11D2-8CAD-00A024580902) +] +coclass AMTimeline { interface IAMTimeline; interface IPersistStream; interface IAMSetErrorLog; } + +[ + threading(both), uuid(65bd0711-24d2-4ff7-9324-ed2e5d3abafa) ] coclass MediaDet { interface IMediaDet; } Modified: trunk/reactos/dll/directx/wine/qedit/qedit_classes.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/qed…
============================================================================== --- trunk/reactos/dll/directx/wine/qedit/qedit_classes.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/qedit/qedit_classes.rgs [iso-8859-1] Sat Jul 2 15:52:21 2016 @@ -5,6 +5,10 @@ } NoRemove CLSID { + '{78530B75-61F9-11D2-8CAD-00A024580902}' = s 'AMTimeline' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } '{65BD0711-24D2-4FF7-9324-ED2E5D3ABAFA}' = s 'MediaDet' { InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } Modified: trunk/reactos/dll/directx/wine/qedit/qedit_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/qed…
============================================================================== --- trunk/reactos/dll/directx/wine/qedit/qedit_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/qedit/qedit_private.h [iso-8859-1] Sat Jul 2 15:52:21 2016 @@ -39,6 +39,7 @@ #include <wine/debug.h> WINE_DEFAULT_DEBUG_CHANNEL(qedit); +HRESULT AMTimeline_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT MediaDet_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT SampleGrabber_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/directx/wine/qedit/samplegrabber.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/sam…
============================================================================== --- trunk/reactos/dll/directx/wine/qedit/samplegrabber.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/qedit/samplegrabber.c [iso-8859-1] Sat Jul 2 15:52:21 2016 @@ -80,7 +80,6 @@ if (This->mtype.pbFormat) CoTaskMemFree(This->mtype.pbFormat); CoTaskMemFree(This); - return 0; } return refCount; } @@ -323,7 +322,6 @@ { SampleGrabber_cleanup(This); CoTaskMemFree(This); - return 0; } return ref; } @@ -755,7 +753,7 @@ TRACE("(%p)->(%p) output = %p, grabber = %p\n", This, sample, This->memOutput, This->grabberIface); if (!sample) return E_POINTER; - if ((This->filter.state != State_Running) || (This->oneShot == OneShot_Past)) + if (This->oneShot == OneShot_Past) return S_FALSE; SampleGrabber_callback(This, sample); hr = This->memOutput ? IMemInputPin_Receive(This->memOutput, sample) : S_OK; @@ -1250,7 +1248,7 @@ ISeekingPassThru *passthru; HRESULT hr; - TRACE("(%p,%p)\n", ppv, pUnkOuter); + TRACE("(%p,%p)\n", pUnkOuter, ppv); obj = CoTaskMemAlloc(sizeof(SG_Impl)); if (NULL == obj) { Added: trunk/reactos/dll/directx/wine/qedit/timeline.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/tim…
============================================================================== --- trunk/reactos/dll/directx/wine/qedit/timeline.c (added) +++ trunk/reactos/dll/directx/wine/qedit/timeline.c [iso-8859-1] Sat Jul 2 15:52:21 2016 @@ -0,0 +1,792 @@ +/* DirectShow Timeline object (QEDIT.DLL) + * + * Copyright 2016 Alex Henrie + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "qedit_private.h" + +typedef struct { + IUnknown IUnknown_inner; + IAMTimeline IAMTimeline_iface; + IUnknown *outer_unk; + LONG ref; +} TimelineImpl; + +static inline TimelineImpl *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, TimelineImpl, IUnknown_inner); +} + +static inline TimelineImpl *impl_from_IAMTimeline(IAMTimeline *iface) +{ + return CONTAINING_RECORD(iface, TimelineImpl, IAMTimeline_iface); +} + +typedef struct { + IAMTimelineObj IAMTimelineObj_iface; + LONG ref; + TIMELINE_MAJOR_TYPE timeline_type; +} TimelineObjImpl; + +static inline TimelineObjImpl *impl_from_IAMTimelineObj(IAMTimelineObj *iface) +{ + return CONTAINING_RECORD(iface, TimelineObjImpl, IAMTimelineObj_iface); +} + +static const IAMTimelineObjVtbl IAMTimelineObj_VTable; + +/* Timeline inner IUnknown */ + +static HRESULT WINAPI Timeline_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +{ + TimelineImpl *This = impl_from_IUnknown(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + + *ppv = NULL; + if (IsEqualIID(riid, &IID_IUnknown)) + *ppv = &This->IUnknown_inner; + else if (IsEqualIID(riid, &IID_IAMTimeline)) + *ppv = &This->IAMTimeline_iface; + else + WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppv); + + if (!*ppv) + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI Timeline_AddRef(IUnknown *iface) +{ + TimelineImpl *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) new ref = %u\n", This, ref); + + return ref; +} + +static ULONG WINAPI Timeline_Release(IUnknown *iface) +{ + TimelineImpl *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) new ref = %u\n", This, ref); + + if (ref == 0) + CoTaskMemFree(This); + + return ref; +} + +static const IUnknownVtbl timeline_vtbl = +{ + Timeline_QueryInterface, + Timeline_AddRef, + Timeline_Release, +}; + +/* IAMTimeline implementation */ + +static HRESULT WINAPI Timeline_IAMTimeline_QueryInterface(IAMTimeline *iface, REFIID riid, void **ppv) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); +} + +static ULONG WINAPI Timeline_IAMTimeline_AddRef(IAMTimeline *iface) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + return IUnknown_AddRef(This->outer_unk); +} + +static ULONG WINAPI Timeline_IAMTimeline_Release(IAMTimeline *iface) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + return IUnknown_Release(This->outer_unk); +} + +static HRESULT WINAPI Timeline_IAMTimeline_CreateEmptyNode(IAMTimeline *iface, IAMTimelineObj **obj, + TIMELINE_MAJOR_TYPE type) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + TimelineObjImpl* obj_impl; + + TRACE("(%p)->(%p,%d)\n", This, obj, type); + + if (!obj) + return E_POINTER; + + switch (type) + { + case TIMELINE_MAJOR_TYPE_COMPOSITE: + case TIMELINE_MAJOR_TYPE_TRACK: + case TIMELINE_MAJOR_TYPE_SOURCE: + case TIMELINE_MAJOR_TYPE_TRANSITION: + case TIMELINE_MAJOR_TYPE_EFFECT: + case TIMELINE_MAJOR_TYPE_GROUP: + break; + default: + return E_INVALIDARG; + } + + obj_impl = CoTaskMemAlloc(sizeof(TimelineObjImpl)); + if (!obj_impl) { + *obj = NULL; + return E_OUTOFMEMORY; + } + + obj_impl->ref = 1; + obj_impl->IAMTimelineObj_iface.lpVtbl = &IAMTimelineObj_VTable; + obj_impl->timeline_type = type; + + *obj = &obj_impl->IAMTimelineObj_iface; + return S_OK; +} + +static HRESULT WINAPI Timeline_IAMTimeline_AddGroup(IAMTimeline *iface, IAMTimelineObj *group) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, group); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_RemGroupFromList(IAMTimeline *iface, IAMTimelineObj *group) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, group); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetGroup(IAMTimeline *iface, IAMTimelineObj **group, LONG index) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p,%d): not implemented!\n", This, group, index); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetGroupCount(IAMTimeline *iface, LONG *count) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_ClearAllGroups(IAMTimeline *iface) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p): not implemented!\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetInsertMode(IAMTimeline *iface, LONG *mode) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, mode); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_SetInsertMode(IAMTimeline *iface, LONG mode) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%d): not implemented!\n", This, mode); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_EnableTransitions(IAMTimeline *iface, BOOL enabled) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%d): not implemented!\n", This, enabled); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_TransitionsEnabled(IAMTimeline *iface, BOOL *enabled) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, enabled); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_EnableEffects(IAMTimeline *iface, BOOL enabled) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%d): not implemented!\n", This, enabled); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_EffectsEnabled(IAMTimeline *iface, BOOL *enabled) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, enabled); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_SetInterestRange(IAMTimeline *iface, REFERENCE_TIME start, + REFERENCE_TIME stop) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%s,%s): not implemented!\n", This, wine_dbgstr_longlong(start), + wine_dbgstr_longlong(stop)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetDuration(IAMTimeline *iface, REFERENCE_TIME *duration) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, duration); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetDuration2(IAMTimeline *iface, double *duration) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, duration); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_SetDefaultFPS(IAMTimeline *iface, double fps) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%f): not implemented!\n", This, fps); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetDefaultFPS(IAMTimeline *iface, double *fps) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, fps); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_IsDirty(IAMTimeline *iface, BOOL *dirty) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, dirty); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetDirtyRange(IAMTimeline *iface, REFERENCE_TIME *start, + REFERENCE_TIME *stop) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p,%p): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetCountOfType(IAMTimeline *iface, LONG group, LONG *value, + LONG *value_with_comps, TIMELINE_MAJOR_TYPE type) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%d,%p,%p,%04x): not implemented!\n", This, group, value, value_with_comps, type); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_ValidateSourceNames(IAMTimeline *iface, LONG flags, IMediaLocator *override, + LONG_PTR notify_event) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%d,%p,%lx): not implemented!\n", This, flags, override, notify_event); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_SetDefaultTransition(IAMTimeline *iface, GUID *guid) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%s): not implemented!\n", This, wine_dbgstr_guid(guid)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetDefaultTransition(IAMTimeline *iface, GUID *guid) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%s): not implemented!\n", This, wine_dbgstr_guid(guid)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_SetDefaultEffect(IAMTimeline *iface, GUID *guid) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%s): not implemented!\n", This, wine_dbgstr_guid(guid)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetDefaultEffect(IAMTimeline *iface, GUID *guid) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%s): not implemented!\n", This, wine_dbgstr_guid(guid)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_SetDefaultTransitionB(IAMTimeline *iface, BSTR guidb) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, guidb); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetDefaultTransitionB(IAMTimeline *iface, BSTR *guidb) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, guidb); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_SetDefaultEffectB(IAMTimeline *iface, BSTR guidb) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, guidb); + return E_NOTIMPL; +} + +static HRESULT WINAPI Timeline_IAMTimeline_GetDefaultEffectB(IAMTimeline *iface, BSTR *guidb) +{ + TimelineImpl *This = impl_from_IAMTimeline(iface); + FIXME("(%p)->(%p): not implemented!\n", This, guidb); + return E_NOTIMPL; +} + +static const IAMTimelineVtbl IAMTimeline_VTable = +{ + Timeline_IAMTimeline_QueryInterface, + Timeline_IAMTimeline_AddRef, + Timeline_IAMTimeline_Release, + Timeline_IAMTimeline_CreateEmptyNode, + Timeline_IAMTimeline_AddGroup, + Timeline_IAMTimeline_RemGroupFromList, + Timeline_IAMTimeline_GetGroup, + Timeline_IAMTimeline_GetGroupCount, + Timeline_IAMTimeline_ClearAllGroups, + Timeline_IAMTimeline_GetInsertMode, + Timeline_IAMTimeline_SetInsertMode, + Timeline_IAMTimeline_EnableTransitions, + Timeline_IAMTimeline_TransitionsEnabled, + Timeline_IAMTimeline_EnableEffects, + Timeline_IAMTimeline_EffectsEnabled, + Timeline_IAMTimeline_SetInterestRange, + Timeline_IAMTimeline_GetDuration, + Timeline_IAMTimeline_GetDuration2, + Timeline_IAMTimeline_SetDefaultFPS, + Timeline_IAMTimeline_GetDefaultFPS, + Timeline_IAMTimeline_IsDirty, + Timeline_IAMTimeline_GetDirtyRange, + Timeline_IAMTimeline_GetCountOfType, + Timeline_IAMTimeline_ValidateSourceNames, + Timeline_IAMTimeline_SetDefaultTransition, + Timeline_IAMTimeline_GetDefaultTransition, + Timeline_IAMTimeline_SetDefaultEffect, + Timeline_IAMTimeline_GetDefaultEffect, + Timeline_IAMTimeline_SetDefaultTransitionB, + Timeline_IAMTimeline_GetDefaultTransitionB, + Timeline_IAMTimeline_SetDefaultEffectB, + Timeline_IAMTimeline_GetDefaultEffectB, +}; + +HRESULT AMTimeline_create(IUnknown *pUnkOuter, LPVOID *ppv) +{ + TimelineImpl* obj = NULL; + + TRACE("(%p,%p)\n", pUnkOuter, ppv); + + obj = CoTaskMemAlloc(sizeof(TimelineImpl)); + if (NULL == obj) { + *ppv = NULL; + return E_OUTOFMEMORY; + } + ZeroMemory(obj, sizeof(TimelineImpl)); + + obj->ref = 1; + obj->IUnknown_inner.lpVtbl = &timeline_vtbl; + obj->IAMTimeline_iface.lpVtbl = &IAMTimeline_VTable; + + if (pUnkOuter) + obj->outer_unk = pUnkOuter; + else + obj->outer_unk = &obj->IUnknown_inner; + + *ppv = &obj->IUnknown_inner; + return S_OK; +} + +/* IAMTimelineObj implementation */ + +static HRESULT WINAPI TimelineObj_QueryInterface(IAMTimelineObj *iface, REFIID riid, void **ppv) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + + *ppv = NULL; + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAMTimelineObj)) + *ppv = &This->IAMTimelineObj_iface; + else + WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppv); + + if (!*ppv) + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI TimelineObj_AddRef(IAMTimelineObj *iface) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) new ref = %u\n", This, ref); + + return ref; +} + +static ULONG WINAPI TimelineObj_Release(IAMTimelineObj *iface) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) new ref = %u\n", This, ref); + + if (!ref) + CoTaskMemFree(This); + + return ref; +} + +static HRESULT WINAPI TimelineObj_GetStartStop(IAMTimelineObj *iface, REFERENCE_TIME *start, REFERENCE_TIME *stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p,%p): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetStartStop2(IAMTimelineObj *iface, REFTIME *start, REFTIME *stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p,%p): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_FixTimes(IAMTimelineObj *iface, REFERENCE_TIME *start, REFERENCE_TIME *stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p,%p): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_FixTimes2(IAMTimelineObj *iface, REFTIME *start, REFTIME *stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p,%p): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetStartStop(IAMTimelineObj *iface, REFERENCE_TIME start, REFERENCE_TIME stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%s,%s): not implemented!\n", This, wine_dbgstr_longlong(start), wine_dbgstr_longlong(stop)); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetStartStop2(IAMTimelineObj *iface, REFTIME start, REFTIME stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%f,%f): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetPropertySetter(IAMTimelineObj *iface, IPropertySetter **setter) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, setter); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetPropertySetter(IAMTimelineObj *iface, IPropertySetter *setter) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, setter); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetSubObject(IAMTimelineObj *iface, IUnknown **obj) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, obj); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetSubObject(IAMTimelineObj *iface, IUnknown *obj) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, obj); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetSubObjectGUID(IAMTimelineObj *iface, GUID guid) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%s): not implemented!\n", This, wine_dbgstr_guid(&guid)); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetSubObjectGUIDB(IAMTimelineObj *iface, BSTR guidb) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%s): not implemented!\n", This, wine_dbgstr_w(guidb)); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetSubObjectGUID(IAMTimelineObj *iface, GUID *guid) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, guid); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetSubObjectGUIDB(IAMTimelineObj *iface, BSTR *guidb) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, guidb); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetSubObjectLoaded(IAMTimelineObj *iface, BOOL *loaded) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, loaded); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetTimelineType(IAMTimelineObj *iface, TIMELINE_MAJOR_TYPE *type) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + TRACE("(%p)->(%p)\n", This, type); + if (!type) return E_POINTER; + *type = This->timeline_type; + return S_OK; +} + +static HRESULT WINAPI TimelineObj_SetTimelineType(IAMTimelineObj *iface, TIMELINE_MAJOR_TYPE type) +{ + /* MSDN says that this function is "not supported" */ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + TRACE("(%p)->(%d)\n", This, type); + if (type != This->timeline_type) return E_INVALIDARG; + return S_OK; +} + +static HRESULT WINAPI TimelineObj_GetUserID(IAMTimelineObj *iface, LONG *id) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetUserID(IAMTimelineObj *iface, LONG id) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%d): not implemented!\n", This, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetGenID(IAMTimelineObj *iface, LONG *id) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetUserName(IAMTimelineObj *iface, BSTR *name) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, name); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetUserName(IAMTimelineObj *iface, BSTR name) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%s): not implemented!\n", This, wine_dbgstr_w(name)); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetUserData(IAMTimelineObj *iface, BYTE *data, LONG *size) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p,%p): not implemented!\n", This, data, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetUserData(IAMTimelineObj *iface, BYTE *data, LONG size) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p,%d): not implemented!\n", This, data, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetMuted(IAMTimelineObj *iface, BOOL *muted) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, muted); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetMuted(IAMTimelineObj *iface, BOOL muted) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%d): not implemented!\n", This, muted); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetLocked(IAMTimelineObj *iface, BOOL *locked) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, locked); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetLocked(IAMTimelineObj *iface, BOOL locked) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%d): not implemented!\n", This, locked); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetDirtyRange(IAMTimelineObj *iface, REFERENCE_TIME *start, REFERENCE_TIME *stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p,%p): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetDirtyRange2(IAMTimelineObj *iface, REFTIME *start, REFTIME *stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p,%p): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetDirtyRange(IAMTimelineObj *iface, REFERENCE_TIME start, REFERENCE_TIME stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%s,%s): not implemented!\n", This, wine_dbgstr_longlong(start), wine_dbgstr_longlong(stop)); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_SetDirtyRange2(IAMTimelineObj *iface, REFTIME start, REFTIME stop) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%f,%f): not implemented!\n", This, start, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_ClearDirty(IAMTimelineObj *iface) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p): not implemented!\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_Remove(IAMTimelineObj *iface) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p): not implemented!\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_RemoveAll(IAMTimelineObj *iface) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p): not implemented!\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetTimelineNoRef(IAMTimelineObj *iface, IAMTimeline **timeline) +{ + /* MSDN says that this function is "not supported" */ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + TRACE("(%p)->(%p)\n", This, timeline); + if (!timeline) return E_POINTER; + *timeline = NULL; + return E_NOINTERFACE; +} + +static HRESULT WINAPI TimelineObj_GetGroupIBelongTo(IAMTimelineObj *iface, IAMTimelineGroup **group) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, group); + return E_NOTIMPL; +} + +static HRESULT WINAPI TimelineObj_GetEmbedDepth(IAMTimelineObj *iface, LONG *depth) +{ + TimelineObjImpl *This = impl_from_IAMTimelineObj(iface); + FIXME("(%p)->(%p): not implemented!\n", This, depth); + return E_NOTIMPL; +} + +static const IAMTimelineObjVtbl IAMTimelineObj_VTable = +{ + TimelineObj_QueryInterface, + TimelineObj_AddRef, + TimelineObj_Release, + TimelineObj_GetStartStop, + TimelineObj_GetStartStop2, + TimelineObj_FixTimes, + TimelineObj_FixTimes2, + TimelineObj_SetStartStop, + TimelineObj_SetStartStop2, + TimelineObj_GetPropertySetter, + TimelineObj_SetPropertySetter, + TimelineObj_GetSubObject, + TimelineObj_SetSubObject, + TimelineObj_SetSubObjectGUID, + TimelineObj_SetSubObjectGUIDB, + TimelineObj_GetSubObjectGUID, + TimelineObj_GetSubObjectGUIDB, + TimelineObj_GetSubObjectLoaded, + TimelineObj_GetTimelineType, + TimelineObj_SetTimelineType, + TimelineObj_GetUserID, + TimelineObj_SetUserID, + TimelineObj_GetGenID, + TimelineObj_GetUserName, + TimelineObj_SetUserName, + TimelineObj_GetUserData, + TimelineObj_SetUserData, + TimelineObj_GetMuted, + TimelineObj_SetMuted, + TimelineObj_GetLocked, + TimelineObj_SetLocked, + TimelineObj_GetDirtyRange, + TimelineObj_GetDirtyRange2, + TimelineObj_SetDirtyRange, + TimelineObj_SetDirtyRange2, + TimelineObj_ClearDirty, + TimelineObj_Remove, + TimelineObj_RemoveAll, + TimelineObj_GetTimelineNoRef, + TimelineObj_GetGroupIBelongTo, + TimelineObj_GetEmbedDepth, +}; Propchange: trunk/reactos/dll/directx/wine/qedit/timeline.c ------------------------------------------------------------------------------ svn:eol-style = native 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 Jul 2 15:52:21 2016 @@ -38,7 +38,7 @@ reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29 reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.9.4 -reactos/dll/directx/wine/qedit # Synced to WineStaging-1.9.4 +reactos/dll/directx/wine/qedit # Synced to WineStaging-1.9.11 reactos/dll/directx/wine/quartz # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/wined3d # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71761: [PSDK] Update qedit.idl. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:42:23 2016 New Revision: 71761 URL:
http://svn.reactos.org/svn/reactos?rev=71761&view=rev
Log: [PSDK] Update qedit.idl. CORE-11368 Modified: trunk/reactos/sdk/include/dxsdk/qedit.idl Modified: trunk/reactos/sdk/include/dxsdk/qedit.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/dxsdk/qedit.id…
============================================================================== --- trunk/reactos/sdk/include/dxsdk/qedit.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/dxsdk/qedit.idl [iso-8859-1] Sat Jul 2 15:42:23 2016 @@ -160,16 +160,658 @@ }; [ - uuid(78530B68-61F9-11D2-8CAD-00A024580902), - version(1.0), -] -library DexterLib -{ - [ - uuid(65BD0711-24D2-4ff7-9324-ED2E5D3ABAFA), - ] - coclass MediaDet - { - [default] interface IMediaDet; - }; -}; + uuid(65BD0711-24D2-4ff7-9324-ED2E5D3ABAFA), +] +coclass MediaDet +{ + [default] interface IMediaDet; +}; + +[ + object, + uuid(288581E0-66CE-11d2-918F-00C0DF10D434), + odl, + pointer_default(unique) +] +interface IMediaLocator : IUnknown +{ + HRESULT FindMediaFile( + BSTR input, + BSTR filter, + BSTR * output, + long flags + ); + + HRESULT AddFoundLocation( + BSTR dir + ); +}; + +typedef struct +{ + BSTR name; + DISPID dispID; + LONG nValues; +} DEXTER_PARAM; + +typedef struct +{ + VARIANT v; + REFERENCE_TIME rt; + DWORD dwInterp; +} DEXTER_VALUE; + +[ + object, + uuid(AE9472BD-B0C3-11D2-8D24-00A0C9441E20), + pointer_default(unique) +] +interface IPropertySetter : IUnknown +{ + HRESULT LoadXML( + [in] IUnknown * pxml + ); + + HRESULT PrintXML( + [out] char * xml, + [in] int size, + [out] int * printed, + [in] int indent + ); + + HRESULT CloneProps( + [out] IPropertySetter ** setter, + [in] REFERENCE_TIME start, + [in] REFERENCE_TIME stop + ); + + HRESULT AddProp( + [in] DEXTER_PARAM param, + [in] DEXTER_VALUE * value + ); + + HRESULT GetProps( + [out] LONG * params, + [out] DEXTER_PARAM ** param, + [out] DEXTER_VALUE ** value + ); + + HRESULT FreeProps( + [in] LONG params, + [in] DEXTER_PARAM * param, + [in] DEXTER_VALUE * value + ); + + HRESULT ClearProps(); + + HRESULT SaveToBlob( + [out] LONG * size, + [out] BYTE ** blob + ); + + HRESULT LoadFromBlob( + [in] LONG size, + [in] BYTE * blob + ); + + HRESULT SetProps( + [in] IUnknown * target, + [in] REFERENCE_TIME now + ); +}; + +[ + object, + uuid(E43E73A2-0EFA-11d3-9601-00A0C9441E20), + odl, + pointer_default(unique) +] +interface IAMErrorLog : IUnknown +{ + HRESULT LogError( + long severity, + BSTR error_str, + long error_code, + long hresult, + [in] VARIANT * extra + ); +}; + +[ + object, + uuid(963566DA-BE21-4eaf-88E9-35704F8F52A1), + odl, + pointer_default(unique) +] +interface IAMSetErrorLog : IUnknown +{ + [propget] HRESULT ErrorLog( + [out, retval] IAMErrorLog ** log + ); + + [propput] HRESULT ErrorLog( + [in] IAMErrorLog * log + ); +}; + +interface IAMTimeline; +interface IAMTimelineGroup; +interface IAMTimelineObj; +interface IAMTimelineSrc; + +typedef enum +{ + TIMELINE_MAJOR_TYPE_COMPOSITE = 1, + TIMELINE_MAJOR_TYPE_TRACK = 2, + TIMELINE_MAJOR_TYPE_SOURCE = 4, + TIMELINE_MAJOR_TYPE_TRANSITION = 8, + TIMELINE_MAJOR_TYPE_EFFECT = 16, + TIMELINE_MAJOR_TYPE_GROUP = 128 +} TIMELINE_MAJOR_TYPE; + +[ + object, + uuid(78530B74-61F9-11D2-8CAD-00A024580902), + odl, + pointer_default(unique) +] +interface IAMTimeline : IUnknown +{ + HRESULT CreateEmptyNode( + [out] IAMTimelineObj ** obj, + TIMELINE_MAJOR_TYPE type + ); + + HRESULT AddGroup( + IAMTimelineObj * group + ); + + HRESULT RemGroupFromList( + IAMTimelineObj * group + ); + + HRESULT GetGroup( + [out] IAMTimelineObj ** group, + long index + ); + + HRESULT GetGroupCount( + long * count + ); + + HRESULT ClearAllGroups(); + + HRESULT GetInsertMode( + long * mode + ); + + HRESULT SetInsertMode( + long mode + ); + + HRESULT EnableTransitions( + BOOL enabled + ); + + HRESULT TransitionsEnabled( + BOOL * enabled + ); + + HRESULT EnableEffects( + BOOL enabled + ); + + HRESULT EffectsEnabled( + BOOL * enabled + ); + + HRESULT SetInterestRange( + REFERENCE_TIME start, + REFERENCE_TIME stop + ); + + HRESULT GetDuration( + REFERENCE_TIME * duration + ); + + HRESULT GetDuration2( + double * duration + ); + + HRESULT SetDefaultFPS( + double fps + ); + + HRESULT GetDefaultFPS( + double * fps + ); + + HRESULT IsDirty( + BOOL * dirty + ); + + HRESULT GetDirtyRange( + REFERENCE_TIME * start, + REFERENCE_TIME * stop + ); + + HRESULT GetCountOfType( + long group, + long * value, + long * value_with_comps, + TIMELINE_MAJOR_TYPE type + ); + + HRESULT ValidateSourceNames( + long flags, + IMediaLocator * override, + LONG_PTR notify_event + ); + + HRESULT SetDefaultTransition( + GUID * guid + ); + + HRESULT GetDefaultTransition( + GUID * guid + ); + + HRESULT SetDefaultEffect( + GUID * guid + ); + + HRESULT GetDefaultEffect( + GUID * guid + ); + + HRESULT SetDefaultTransitionB( + BSTR guidb + ); + + HRESULT GetDefaultTransitionB( + [out,retval] BSTR * guidb + ); + + HRESULT SetDefaultEffectB( + BSTR guidb + ); + + HRESULT GetDefaultEffectB( + [out,retval] BSTR * guidb + ); +}; + +[ + uuid(78530B75-61F9-11D2-8CAD-00A024580902) +] +coclass AMTimeline +{ + [default] interface IAMTimeline; + interface IPersistStream; + interface IAMSetErrorLog; +}; + +[ + object, + uuid(9EED4F00-B8A6-11d2-8023-00C0DF10D434), + odl, + pointer_default(unique) +] +interface IAMTimelineGroup : IUnknown +{ + HRESULT SetTimeline( + IAMTimeline * timeline + ); + + HRESULT GetTimeline( + [out] IAMTimeline ** timeline + ); + + HRESULT GetPriority( + long * priority + ); + + HRESULT GetMediaType( + [out] AM_MEDIA_TYPE * + ); + + HRESULT SetMediaType( + [in] AM_MEDIA_TYPE * + ); + + HRESULT SetOutputFPS( + double fps + ); + + HRESULT GetOutputFPS( + double * fps + ); + + HRESULT SetGroupName( + BSTR name + ); + + HRESULT GetGroupName( + [out,retval] BSTR * name + ); + + HRESULT SetPreviewMode( + BOOL preview + ); + + HRESULT GetPreviewMode( + BOOL * preview + ); + + HRESULT SetMediaTypeForVB( + [in] long type + ); + + HRESULT GetOutputBuffering( + [out] int * buffer + ); + + HRESULT SetOutputBuffering( + [in] int buffer + ); + + HRESULT SetSmartRecompressFormat( + long * format + ); + + HRESULT GetSmartRecompressFormat( + long ** format + ); + + HRESULT IsSmartRecompressFormatSet( + BOOL * set + ); + + HRESULT IsRecompressFormatDirty( + BOOL * dirty + ); + + HRESULT ClearRecompressFormatDirty(); + + HRESULT SetRecompFormatFromSource( + IAMTimelineSrc * source + ); +}; + +[ + object, + local, + uuid(78530B77-61F9-11D2-8CAD-00A024580902), + odl, + pointer_default(unique) +] +interface IAMTimelineObj : IUnknown +{ + HRESULT GetStartStop( + REFERENCE_TIME * start, + REFERENCE_TIME * stop + ); + + HRESULT GetStartStop2( + REFTIME * start, REFTIME * stop + ); + + HRESULT FixTimes( + REFERENCE_TIME * start, REFERENCE_TIME * stop + ); + + HRESULT FixTimes2( + REFTIME * start, REFTIME * stop + ); + + HRESULT SetStartStop( + REFERENCE_TIME start, + REFERENCE_TIME stop + ); + + HRESULT SetStartStop2( + REFTIME start, + REFTIME stop + ); + + HRESULT GetPropertySetter( + [out,retval] IPropertySetter ** setter + ); + + HRESULT SetPropertySetter( + IPropertySetter * setter + ); + + HRESULT GetSubObject( + [out,retval] IUnknown ** obj + ); + + HRESULT SetSubObject( + IUnknown * obj + ); + + HRESULT SetSubObjectGUID( + GUID guid + ); + + HRESULT SetSubObjectGUIDB( + BSTR guidb + ); + + HRESULT GetSubObjectGUID( + GUID * guid + ); + + HRESULT GetSubObjectGUIDB( + [out,retval] BSTR * guidb + ); + + HRESULT GetSubObjectLoaded( + BOOL * loaded + ); + + HRESULT GetTimelineType( + TIMELINE_MAJOR_TYPE * type + ); + + HRESULT SetTimelineType( + TIMELINE_MAJOR_TYPE type + ); + + HRESULT GetUserID( + long * id + ); + + HRESULT SetUserID( + long id + ); + + HRESULT GetGenID( + long * id + ); + + HRESULT GetUserName( + [out,retval] BSTR * name + ); + + HRESULT SetUserName( + BSTR name + ); + + HRESULT GetUserData( + BYTE * data, + long * size + ); + + HRESULT SetUserData( + BYTE * data, + long size + ); + + HRESULT GetMuted( + BOOL * muted + ); + + HRESULT SetMuted( + BOOL muted + ); + + HRESULT GetLocked( + BOOL * locked + ); + + HRESULT SetLocked( + BOOL locked + ); + + HRESULT GetDirtyRange( + REFERENCE_TIME * start, + REFERENCE_TIME * stop + ); + + HRESULT GetDirtyRange2( + REFTIME * start, + REFTIME * stop + ); + + HRESULT SetDirtyRange( + REFERENCE_TIME start, + REFERENCE_TIME stop + ); + + HRESULT SetDirtyRange2( + REFTIME start, + REFTIME stop + ); + + HRESULT ClearDirty(); + + HRESULT Remove(); + + HRESULT RemoveAll(); + + HRESULT GetTimelineNoRef( + IAMTimeline ** timeline + ); + + HRESULT GetGroupIBelongTo( + [out] IAMTimelineGroup ** group + ); + + HRESULT GetEmbedDepth( + long * depth + ); +}; + +[ + object, + uuid(78530B79-61F9-11D2-8CAD-00A024580902), + odl, + pointer_default(unique) +] +interface IAMTimelineSrc : IUnknown +{ + HRESULT GetMediaTimes( + REFERENCE_TIME * start, + REFERENCE_TIME * stop + ); + + HRESULT GetMediaTimes2( + REFTIME * start, + REFTIME * stop + ); + + HRESULT ModifyStopTime( + REFERENCE_TIME stop + ); + + HRESULT ModifyStopTime2( + REFTIME stop + ); + + HRESULT FixMediaTimes( + REFERENCE_TIME * start, + REFERENCE_TIME * stop + ); + + HRESULT FixMediaTimes2( + REFTIME * start, + REFTIME * stop + ); + + HRESULT SetMediaTimes( + REFERENCE_TIME Start, + REFERENCE_TIME Stop + ); + + HRESULT SetMediaTimes2( + REFTIME Start, + REFTIME Stop + ); + + HRESULT SetMediaLength( + REFERENCE_TIME length + ); + + HRESULT SetMediaLength2( + REFTIME length + ); + + HRESULT GetMediaLength( + REFERENCE_TIME * length + ); + + HRESULT GetMediaLength2( + REFTIME * length + ); + + HRESULT GetMediaName( + [out,retval] BSTR * name + ); + + HRESULT SetMediaName( + BSTR name + ); + + HRESULT SpliceWithNext( + IAMTimelineObj * next + ); + + HRESULT GetStreamNumber( + long * num + ); + + HRESULT SetStreamNumber( + long num + ); + + HRESULT IsNormalRate( + BOOL * normal + ); + + HRESULT GetDefaultFPS( + double * fps + ); + + HRESULT SetDefaultFPS( + double fps + ); + + HRESULT GetStretchMode( + int * mode + ); + + HRESULT SetStretchMode( + int mode + ); +}; + +enum +{ + E_NOTINTREE = 0x80040400, + E_RENDER_ENGINE_IS_BROKEN = 0x80040401, + E_MUST_INIT_RENDERER = 0x80040402, + E_NOTDETERMINED = 0x80040403, + E_NO_TIMELINE = 0x80040404, + S_WARN_OUTPUTRESET = 40404 +};
8 years, 5 months
1
0
0
0
[akhaldi] 71760: [DMUSIC] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:40:22 2016 New Revision: 71760 URL:
http://svn.reactos.org/svn/reactos?rev=71760&view=rev
Log: [DMUSIC] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/directx/wine/dmusic/buffer.c trunk/reactos/dll/directx/wine/dmusic/dmusic_private.h trunk/reactos/dll/directx/wine/dmusic/port.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/dmusic/buffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dmusic/bu…
============================================================================== --- trunk/reactos/dll/directx/wine/dmusic/buffer.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dmusic/buffer.c [iso-8859-1] Sat Jul 2 15:40:22 2016 @@ -132,8 +132,25 @@ static HRESULT WINAPI IDirectMusicBufferImpl_PackUnstructured(LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD cb, LPBYTE lpb) { IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); + DWORD new_write_pos = This->write_pos + sizeof(DMUS_EVENTHEADER) + cb; + DMUS_EVENTHEADER header; FIXME("(%p, 0x%s, %d, %d, %p): stub\n", This, wine_dbgstr_longlong(rt), dwChannelGroup, cb, lpb); + + if (new_write_pos > This->size) + return DMUS_E_BUFFER_FULL; + + if (!This->write_pos) + This->start_time = rt; + + header.cbEvent = cb; + header.dwChannelGroup = dwChannelGroup; + header.rtDelta = rt - This->start_time; + header.dwFlags = 0; + + memcpy(This->data + This->write_pos, &header, sizeof(header)); + memcpy(This->data + This->write_pos + sizeof(header), lpb, cb); + This->write_pos = new_write_pos; return S_OK; } Modified: trunk/reactos/dll/directx/wine/dmusic/dmusic_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dmusic/dm…
============================================================================== --- trunk/reactos/dll/directx/wine/dmusic/dmusic_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dmusic/dmusic_private.h [iso-8859-1] Sat Jul 2 15:40:22 2016 @@ -37,6 +37,7 @@ #include <objbase.h> #include <dmusici.h> #include <dmusics.h> +#include <dmksctrl.h> #include <wine/debug.h> #include <wine/list.h> @@ -171,6 +172,7 @@ IDirectMusicPort IDirectMusicPort_iface; IDirectMusicPortDownload IDirectMusicPortDownload_iface; IDirectMusicThru IDirectMusicThru_iface; + IKsControl IKsControl_iface; LONG ref; /* IDirectMusicPort fields */ Modified: trunk/reactos/dll/directx/wine/dmusic/port.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dmusic/po…
============================================================================== --- trunk/reactos/dll/directx/wine/dmusic/port.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dmusic/port.c [iso-8859-1] Sat Jul 2 15:40:22 2016 @@ -43,6 +43,11 @@ return CONTAINING_RECORD(iface, SynthPortImpl, IDirectMusicThru_iface); } +static inline SynthPortImpl *impl_from_SynthPortImpl_IKsControl(IKsControl *iface) +{ + return CONTAINING_RECORD(iface, SynthPortImpl, IKsControl_iface); +} + /* IDirectMusicDownloadedInstrument IUnknown part follows: */ static HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface(IDirectMusicDownloadedInstrument *iface, REFIID riid, VOID **ret_iface) { @@ -140,6 +145,10 @@ } else if (IsEqualGUID(riid, &IID_IDirectMusicThru)) { *ret_iface = &This->IDirectMusicThru_iface; IDirectMusicThru_AddRef((LPDIRECTMUSICTHRU)*ret_iface); + return S_OK; + } else if (IsEqualGUID(riid, &IID_IKsControl)) { + *ret_iface = &This->IKsControl_iface; + IKsControl_AddRef((IKsControl*)*ret_iface); return S_OK; } @@ -671,6 +680,75 @@ SynthPortImpl_IDirectMusicThru_ThruChannel }; +static HRESULT WINAPI SynthPortImpl_IKsControl_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) +{ + SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface); + + return IDirectMusicPort_QueryInterface(&This->IDirectMusicPort_iface, riid, ppobj); +} + +static ULONG WINAPI SynthPortImpl_IKsControl_AddRef(IKsControl* iface) +{ + SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface); + + return IDirectMusicPort_AddRef(&This->IDirectMusicPort_iface); +} + +static ULONG WINAPI SynthPortImpl_IKsControl_Release(IKsControl* iface) +{ + SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface); + + return IDirectMusicPort_Release(&This->IDirectMusicPort_iface); +} + +static HRESULT WINAPI SynthPortImpl_IKsControl_KsProperty(IKsControl* iface, PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, + ULONG DataLength, ULONG* BytesReturned) +{ + TRACE("(%p)->(%p, %u, %p, %u, %p)\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned); + + TRACE("Property = %s - %u - %u\n", debugstr_guid(&Property->Set), Property->Id, Property->Flags); + + if (Property->Flags != KSPROPERTY_TYPE_GET) + { + FIXME("Property flags %u not yet supported\n", Property->Flags); + return S_FALSE; + } + + if (DataLength < sizeof(DWORD)) + return E_NOT_SUFFICIENT_BUFFER; + + FIXME("Unknown property %s\n", debugstr_guid(&Property->Set)); + *(DWORD*)PropertyData = FALSE; + *BytesReturned = sizeof(DWORD); + + return S_OK; +} + +static HRESULT WINAPI SynthPortImpl_IKsControl_KsMethod(IKsControl* iface, PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, + ULONG DataLength, ULONG* BytesReturned) +{ + FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Method, MethodLength, MethodData, DataLength, BytesReturned); + + return E_NOTIMPL; +} + +static HRESULT WINAPI SynthPortImpl_IKsControl_KsEvent(IKsControl* iface, PKSEVENT Event, ULONG EventLength, LPVOID EventData, + ULONG DataLength, ULONG* BytesReturned) +{ + FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Event, EventLength, EventData, DataLength, BytesReturned); + + return E_NOTIMPL; +} + +static const IKsControlVtbl SynthPortImpl_IKsControl_Vtbl = { + SynthPortImpl_IKsControl_QueryInterface, + SynthPortImpl_IKsControl_AddRef, + SynthPortImpl_IKsControl_Release, + SynthPortImpl_IKsControl_KsProperty, + SynthPortImpl_IKsControl_KsMethod, + SynthPortImpl_IKsControl_KsEvent +}; + HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device) { SynthPortImpl *obj; @@ -688,6 +766,7 @@ obj->IDirectMusicPort_iface.lpVtbl = &SynthPortImpl_DirectMusicPort_Vtbl; obj->IDirectMusicPortDownload_iface.lpVtbl = &SynthPortImpl_DirectMusicPortDownload_Vtbl; obj->IDirectMusicThru_iface.lpVtbl = &SynthPortImpl_DirectMusicThru_Vtbl; + obj->IKsControl_iface.lpVtbl = &SynthPortImpl_IKsControl_Vtbl; obj->ref = 0; /* Will be inited by QueryInterface */ obj->fActive = FALSE; obj->params = *port_params; 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 Jul 2 15:40:22 2016 @@ -32,7 +32,7 @@ reactos/dll/directx/wine/devenum # Synced to WineStaging-1.9.11 reactos/dll/directx/wine/dinput # Synced to WineStaging-1.9.11 reactos/dll/directx/wine/dinput8 # Synced to WineStaging-1.9.4 -reactos/dll/directx/wine/dmusic # Synced to WineStaging-1.9.4 +reactos/dll/directx/wine/dmusic # Synced to WineStaging-1.9.11 reactos/dll/directx/wine/dplay # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/dplayx # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
8 years, 5 months
1
0
0
0
[akhaldi] 71759: [DINPUT] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:38:59 2016 New Revision: 71759 URL:
http://svn.reactos.org/svn/reactos?rev=71759&view=rev
Log: [DINPUT] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/directx/wine/dinput/device.c trunk/reactos/dll/directx/wine/dinput/device_private.h trunk/reactos/dll/directx/wine/dinput/effect_linuxinput.c trunk/reactos/dll/directx/wine/dinput/joystick_linux.c trunk/reactos/dll/directx/wine/dinput/joystick_osx.c trunk/reactos/media/doc/README.WINE 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 Jul 2 15:38:59 2016 @@ -764,7 +764,6 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, LPCDIDATAFORMAT df) { - static const WCHAR emptyW[] = { 0 }; IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); DIDATAFORMAT data_format; DIOBJECTDATAFORMAT *obj_df = NULL; @@ -855,7 +854,10 @@ dps.diph.dwHeaderSize = sizeof(DIPROPHEADER); dps.diph.dwObj = 0; dps.diph.dwHow = DIPH_DEVICE; - lstrcpynW(dps.wsz, (dwFlags & DIDSAM_NOUSER) ? emptyW : username, sizeof(dps.wsz)/sizeof(WCHAR)); + if (dwFlags & DIDSAM_NOUSER) + dps.wsz[0] = '\0'; + else + lstrcpynW(dps.wsz, username, sizeof(dps.wsz)/sizeof(WCHAR)); IDirectInputDevice8_SetProperty(iface, DIPROP_USERNAME, &dps.diph); /* Save the settings to disk */ @@ -1095,9 +1097,6 @@ /* Free action mapping */ HeapFree(GetProcessHeap(), 0, This->action_map); - /* Free username */ - HeapFree(GetProcessHeap(), 0, This->username); - EnterCriticalSection( &This->dinput->crit ); list_remove( &This->entry ); LeaveCriticalSection( &This->dinput->crit ); @@ -1255,9 +1254,7 @@ if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM; - ps->wsz[0] = 0; - if (This->username) - lstrcpynW(ps->wsz, This->username, sizeof(ps->wsz)/sizeof(WCHAR)); + lstrcpynW(ps->wsz, This->username, sizeof(ps->wsz)/sizeof(WCHAR)); break; } case (DWORD_PTR) DIPROP_VIDPID: @@ -1339,14 +1336,7 @@ if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM; - if (!This->username) - This->username = HeapAlloc(GetProcessHeap(), 0, sizeof(ps->wsz)); - if (!This->username) - return DIERR_OUTOFMEMORY; - - This->username[0] = 0; - if (ps->wsz) - lstrcpynW(This->username, ps->wsz, sizeof(ps->wsz)/sizeof(WCHAR)); + lstrcpynW(This->username, ps->wsz, sizeof(This->username)/sizeof(WCHAR)); break; } default: Modified: trunk/reactos/dll/directx/wine/dinput/device_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/de…
============================================================================== --- trunk/reactos/dll/directx/wine/dinput/device_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dinput/device_private.h [iso-8859-1] Sat Jul 2 15:38:59 2016 @@ -73,7 +73,7 @@ /* Action mapping */ int num_actions; /* number of actions mapped */ ActionMap *action_map; /* array of mappings */ - WCHAR *username; /* set by 'SetActionMap' */ + WCHAR username[MAX_PATH]; }; extern BOOL get_app_key(HKEY*, HKEY*) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/directx/wine/dinput/effect_linuxinput.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/ef…
============================================================================== --- trunk/reactos/dll/directx/wine/dinput/effect_linuxinput.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dinput/effect_linuxinput.c [iso-8859-1] Sat Jul 2 15:38:59 2016 @@ -67,6 +67,11 @@ return CONTAINING_RECORD(iface, LinuxInputEffectImpl, IDirectInputEffect_iface); } +static double ff_effect_direction_to_rad(unsigned int dir) +{ + return (dir & 0xffff) * M_PI / 0x8000; +} + /****************************************************************************** * LinuxInputEffectImpl */ @@ -172,8 +177,10 @@ return diErr; else { if (peff->dwFlags & DIEFF_CARTESIAN) { - peff->rglDirection[0] = sin(M_PI * 3 * This->effect.direction / 0x7FFF) * 1000; - peff->rglDirection[1] = cos(M_PI * 3 * This->effect.direction / 0x7FFF) * 1000; + /* rotate so 0 points right */ + double angle = ff_effect_direction_to_rad(This->effect.direction + 0xc000); + peff->rglDirection[0] = sin(angle) * 1000; + peff->rglDirection[1] = -cos(angle) * 1000; } else { /* Polar and spherical coordinates are the same for two or less * axes. @@ -505,9 +512,11 @@ /* One condition block. This needs to be rotated to direction, * and expanded to separate x and y conditions. */ int i; - double factor[2]; - factor[0] = asin((This->effect.direction * 3.0 * M_PI) / 0x7FFF); - factor[1] = acos((This->effect.direction * 3.0 * M_PI) / 0x7FFF); + double factor[2], angle; + /* rotate so 0 points right */ + angle = ff_effect_direction_to_rad(This->effect.direction + 0xc000); + factor[0] = sin(angle); + factor[1] = -cos(angle); for (i = 0; i < 2; ++i) { This->effect.u.condition[i].center = (int)(factor[i] * (tsp->lOffset / 10) * 32); This->effect.u.condition[i].right_coeff = (int)(factor[i] * (tsp->lPositiveCoefficient / 10) * 32); 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 Jul 2 15:38:59 2016 @@ -143,7 +143,7 @@ #ifdef JSIOCGAXES if (ioctl(fd, JSIOCGAXES, &joydev.axis_count) < 0) { - WARN("ioctl(%s,JSIOCGAXES) failed: %s, defauting to 2\n", joydev.device, strerror(errno)); + WARN("ioctl(%s,JSIOCGAXES) failed: %s, defaulting to 2\n", joydev.device, strerror(errno)); joydev.axis_count = 2; } #else @@ -153,7 +153,7 @@ #ifdef JSIOCGBUTTONS if (ioctl(fd, JSIOCGBUTTONS, &joydev.button_count) < 0) { - WARN("ioctl(%s,JSIOCGBUTTONS) failed: %s, defauting to 2\n", joydev.device, strerror(errno)); + WARN("ioctl(%s,JSIOCGBUTTONS) failed: %s, defaulting to 2\n", joydev.device, strerror(errno)); joydev.button_count = 2; } #else Modified: trunk/reactos/dll/directx/wine/dinput/joystick_osx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/jo…
============================================================================== --- trunk/reactos/dll/directx/wine/dinput/joystick_osx.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dinput/joystick_osx.c [iso-8859-1] Sat Jul 2 15:38:59 2016 @@ -1474,7 +1474,7 @@ TRACE("%p %s %p\n", This, debugstr_guid(guid), out); - if(IsEqualIID(guid, &IID_IDirectInputEffect)){ + if(IsEqualIID(guid, &IID_IUnknown) || IsEqualIID(guid, &IID_IDirectInputEffect)){ *out = iface; IDirectInputEffect_AddRef(iface); return S_OK; 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 Jul 2 15:38:59 2016 @@ -30,7 +30,7 @@ reactos/dll/directx/wine/d3dxof # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/ddraw # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/devenum # Synced to WineStaging-1.9.11 -reactos/dll/directx/wine/dinput # Synced to WineStaging-1.9.4 +reactos/dll/directx/wine/dinput # Synced to WineStaging-1.9.11 reactos/dll/directx/wine/dinput8 # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/dmusic # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/dplay # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71758: [D3DRM_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:34:17 2016 New Revision: 71758 URL:
http://svn.reactos.org/svn/reactos?rev=71758&view=rev
Log: [D3DRM_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 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 Jul 2 15:34:17 2016 @@ -994,6 +994,8 @@ ok(hr == D3DRM_OK, "Cannot get parent frame (hr = %x)\n", hr); ok(pFrameTmp == pFrameP1, "pFrameTmp = %p\n", pFrameTmp); CHECK_REFCOUNT(pFrameP1, 2); + IDirect3DRMFrame_Release(pFrameTmp); + CHECK_REFCOUNT(pFrameP1, 1); /* Add child to second parent */ hr = IDirect3DRM_CreateFrame(d3drm, NULL, &pFrameP2); @@ -1037,6 +1039,8 @@ ok(pFrameTmp == pFrameP2, "pFrameTmp = %p\n", pFrameTmp); CHECK_REFCOUNT(pFrameP2, 2); CHECK_REFCOUNT(pFrameC, 2); + IDirect3DRMFrame_Release(pFrameTmp); + CHECK_REFCOUNT(pFrameP2, 1); /* Add child again */ hr = IDirect3DRMFrame_AddChild(pFrameP2, pFrameC); @@ -1088,7 +1092,7 @@ hr = IDirect3DRMFrame_AddChild(pFrameP2, pFrameP1); ok(hr == D3DRM_OK, "Cannot add child frame (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); frame_array = NULL; hr = IDirect3DRMFrame_GetChildren(pFrameP2, &frame_array); @@ -1111,11 +1115,11 @@ /* [Add/Delete]Visual with NULL pointer */ hr = IDirect3DRMFrame_AddVisual(pFrameP1, NULL); ok(hr == D3DRMERR_BADOBJECT, "Should have returned D3DRMERR_BADOBJECT (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); hr = IDirect3DRMFrame_DeleteVisual(pFrameP1, NULL); ok(hr == D3DRMERR_BADOBJECT, "Should have returned D3DRMERR_BADOBJECT (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); /* Create Visual */ hr = IDirect3DRM_CreateMeshBuilder(d3drm, &mesh_builder); @@ -1125,7 +1129,7 @@ /* Add Visual to first parent */ hr = IDirect3DRMFrame_AddVisual(pFrameP1, visual1); ok(hr == D3DRM_OK, "Cannot add visual (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); CHECK_REFCOUNT(visual1, 2); visual_array = NULL; @@ -1145,17 +1149,17 @@ /* Delete Visual */ hr = IDirect3DRMFrame_DeleteVisual(pFrameP1, visual1); ok(hr == D3DRM_OK, "Cannot delete visual (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); IDirect3DRMMeshBuilder_Release(mesh_builder); /* [Add/Delete]Light with NULL pointer */ hr = IDirect3DRMFrame_AddLight(pFrameP1, NULL); ok(hr == D3DRMERR_BADOBJECT, "Should have returned D3DRMERR_BADOBJECT (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); hr = IDirect3DRMFrame_DeleteLight(pFrameP1, NULL); ok(hr == D3DRMERR_BADOBJECT, "Should have returned D3DRMERR_BADOBJECT (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); /* Create Light */ hr = IDirect3DRM_CreateLightRGB(d3drm, D3DRMLIGHT_SPOT, 0.1, 0.2, 0.3, &light1); @@ -1164,7 +1168,7 @@ /* Add Light to first parent */ hr = IDirect3DRMFrame_AddLight(pFrameP1, light1); ok(hr == D3DRM_OK, "Cannot add light (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); CHECK_REFCOUNT(light1, 2); light_array = NULL; @@ -1184,7 +1188,7 @@ /* Delete Light */ hr = IDirect3DRMFrame_DeleteLight(pFrameP1, light1); ok(hr == D3DRM_OK, "Cannot delete light (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); IDirect3DRMLight_Release(light1); /* Test SceneBackground on first parent */ @@ -1203,13 +1207,258 @@ /* Cleanup */ IDirect3DRMFrame_Release(pFrameP2); - CHECK_REFCOUNT(pFrameC, 2); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameC, 1); + CHECK_REFCOUNT(pFrameP1, 1); IDirect3DRMFrame_Release(pFrameC); IDirect3DRMFrame_Release(pFrameP1); IDirect3DRM_Release(d3drm); +} + +struct destroy_context +{ + IDirect3DRMObject *obj; + unsigned int test_idx; + int called; +}; + +struct callback_order +{ + void *callback; + void *context; +} corder[3], d3drm_corder[3]; + +static void CDECL destroy_callback(IDirect3DRMObject *obj, void *arg) +{ + struct destroy_context *ctxt = arg; + ok(ctxt->called == 1 || ctxt->called == 2, "got called counter %d\n", ctxt->called); + ok(obj == ctxt->obj, "called with %p, expected %p\n", obj, ctxt->obj); + d3drm_corder[ctxt->called].callback = &destroy_callback; + d3drm_corder[ctxt->called++].context = ctxt; +} + +static void CDECL destroy_callback1(IDirect3DRMObject *obj, void *arg) +{ + struct destroy_context *ctxt = (struct destroy_context*)arg; + ok(ctxt->called == 0, "got called counter %d\n", ctxt->called); + ok(obj == ctxt->obj, "called with %p, expected %p\n", obj, ctxt->obj); + d3drm_corder[ctxt->called].callback = &destroy_callback1; + d3drm_corder[ctxt->called++].context = ctxt; +} + +static void test_destroy_callback(unsigned int test_idx, REFCLSID clsid, REFIID iid) +{ + struct destroy_context context; + IDirect3DRMObject *obj; + IUnknown *unknown; + IDirect3DRM *d3drm; + HRESULT hr; + int i; + + hr = Direct3DRMCreate(&d3drm); + ok(SUCCEEDED(hr), "Test %u: Cannot get IDirect3DRM interface (hr = %x).\n", test_idx, hr); + + hr = IDirect3DRM_CreateObject(d3drm, clsid, NULL, iid, (void **)&unknown); + ok(hr == D3DRM_OK, "Test %u: Cannot get IDirect3DRMObject interface (hr = %x).\n", test_idx, hr); + hr = IUnknown_QueryInterface(unknown, &IID_IDirect3DRMObject, (void**)&obj); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + IUnknown_Release(unknown); + + context.called = 0; + context.test_idx = test_idx; + context.obj = obj; + + hr = IDirect3DRMObject_AddDestroyCallback(obj, NULL, &context); + ok(hr == D3DRMERR_BADVALUE, "Test %u: expected D3DRMERR_BADVALUE (hr = %x).\n", test_idx, hr); + + hr = IDirect3DRMObject_AddDestroyCallback(obj, destroy_callback, &context); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + corder[2].callback = &destroy_callback; + corder[2].context = &context; + + /* same callback added twice */ + hr = IDirect3DRMObject_AddDestroyCallback(obj, destroy_callback, &context); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + corder[1].callback = &destroy_callback; + corder[1].context = &context; + + hr = IDirect3DRMObject_DeleteDestroyCallback(obj, destroy_callback1, NULL); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + + hr = IDirect3DRMObject_DeleteDestroyCallback(obj, destroy_callback1, &context); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + + /* add one more */ + hr = IDirect3DRMObject_AddDestroyCallback(obj, destroy_callback1, &context); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + corder[0].callback = &destroy_callback1; + corder[0].context = &context; + + hr = IDirect3DRMObject_DeleteDestroyCallback(obj, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Test %u: expected D3DRM_BADVALUE (hr = %x).\n", test_idx, hr); + + context.called = 0; + IDirect3DRMObject_Release(obj); + ok(context.called == 3, "Test %u: got %d, expected 3.\n", test_idx, context.called); + for (i = 0; i < context.called; i++) + { + ok(corder[i].callback == d3drm_corder[i].callback + && corder[i].context == d3drm_corder[i].context, + "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); + } + + /* test this pattern - add cb1, add cb2, add cb1, delete cb1 */ + hr = IDirect3DRM_CreateObject(d3drm, clsid, NULL, iid, (void **)&unknown); + ok(hr == D3DRM_OK, "Test %u: Cannot get IDirect3DRMObject interface (hr = %x).\n", test_idx, hr); + hr = IUnknown_QueryInterface(unknown, &IID_IDirect3DRMObject, (void**)&obj); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + IUnknown_Release(unknown); + + hr = IDirect3DRMObject_AddDestroyCallback(obj, destroy_callback, &context); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + corder[1].callback = &destroy_callback; + corder[1].context = &context; + + hr = IDirect3DRMObject_AddDestroyCallback(obj, destroy_callback1, &context); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + corder[0].callback = &destroy_callback1; + corder[0].context = &context; + + hr = IDirect3DRMObject_AddDestroyCallback(obj, destroy_callback, &context); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + + hr = IDirect3DRMObject_DeleteDestroyCallback(obj, destroy_callback, &context); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + + context.called = 0; + hr = IDirect3DRMObject_QueryInterface(obj, &IID_IDirect3DRMObject, (void**)&context.obj); + ok(hr == D3DRM_OK, "Test %u: expected D3DRM_OK (hr = %x).\n", test_idx, hr); + IDirect3DRMObject_Release(context.obj); + IUnknown_Release(unknown); + ok(context.called == 2, "Test %u: got %d, expected 2.\n", test_idx, context.called); + for (i = 0; i < context.called; i++) + { + ok(corder[i].callback == d3drm_corder[i].callback + && corder[i].context == d3drm_corder[i].context, + "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); + } +} + +static void test_object(void) +{ + static const struct + { + REFCLSID clsid; + REFIID iid; + BOOL todo; + } + tests[] = + { + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice, TRUE }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice2, TRUE }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice3, TRUE }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMWinDevice, TRUE }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture, FALSE }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture2, FALSE }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture3, FALSE }, + { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport, TRUE }, + { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport2, TRUE }, + }; + IDirect3DRM *d3drm1; + IDirect3DRM2 *d3drm2; + IDirect3DRM3 *d3drm3; + IUnknown *unknown = (IUnknown *)0xdeadbeef; + HRESULT hr; + ULONG ref1, ref2, ref3, ref4; + int i; + + hr = Direct3DRMCreate(&d3drm1); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRM interface (hr = %#x).\n", hr); + ref1 = get_refcount((IUnknown *)d3drm1); + 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); + + hr = IDirect3DRM_CreateObject(d3drm1, &CLSID_DirectDraw, NULL, &IID_IDirectDraw, (void **)&unknown); + ok(hr == CLASSFACTORY_E_FIRST, "Expected hr == CLASSFACTORY_E_FIRST, got %#x.\n", hr); + ok(!unknown, "Expected object returned == NULL, got %p.\n", unknown); + + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + { + unknown = (IUnknown *)0xdeadbeef; + hr = IDirect3DRM_CreateObject(d3drm1, NULL, NULL, tests[i].iid, (void **)&unknown); + ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr == D3DRMERR_BADVALUE, got %#x.\n", i, hr); + ok(!unknown, "Expected object returned == NULL, got %p.\n", unknown); + unknown = (IUnknown *)0xdeadbeef; + hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL, NULL, (void **)&unknown); + ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr == D3DRMERR_BADVALUE, got %#x.\n", i, hr); + ok(!unknown, "Expected object returned == NULL, got %p.\n", unknown); + hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL, NULL, NULL); + 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); + 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); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + IUnknown_Release(unknown); + ref2 = get_refcount((IUnknown *)d3drm1); + 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); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + + /* test Add/Destroy callbacks */ + test_destroy_callback(i, tests[i].clsid, tests[i].iid); + + 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); + 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); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + IUnknown_Release(unknown); + ref2 = get_refcount((IUnknown *)d3drm1); + 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); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + + 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); + 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); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + IUnknown_Release(unknown); + ref2 = get_refcount((IUnknown *)d3drm1); + 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); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + } + } + + IDirect3DRM_Release(d3drm1); + IDirect3DRM2_Release(d3drm2); + IDirect3DRM3_Release(d3drm3); } static void test_Viewport(void) @@ -1220,10 +1469,12 @@ IDirect3DRMDevice *device; IDirect3DRMFrame *frame; IDirect3DRMViewport *viewport; + IDirect3DRMViewport2 *viewport2; + IDirect3DRMObject *obj, *obj2; GUID driver; HWND window; RECT rc; - DWORD size; + DWORD size, data; CHAR cname[64] = {0}; window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0); @@ -1247,6 +1498,22 @@ hr = IDirect3DRM_CreateViewport(d3drm, device, frame, rc.left, rc.top, rc.right, rc.bottom, &viewport); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMViewport interface (hr = %x)\n", hr); + + hr = IDirect3DRMViewport_QueryInterface(viewport, &IID_IDirect3DRMObject, (void**)&obj); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + ok((IDirect3DRMObject*)viewport == obj, "got object pointer %p, expected %p\n", obj, viewport); + + hr = IDirect3DRMViewport_QueryInterface(viewport, &IID_IDirect3DRMViewport2, (void**)&viewport2); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + + hr = IDirect3DRMViewport2_QueryInterface(viewport2, &IID_IDirect3DRMObject, (void**)&obj2); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + ok(obj == obj2, "got object pointer %p, expected %p\n", obj2, obj); + ok((IUnknown*)viewport != (IUnknown*)viewport2, "got viewport1 %p, viewport2 %p\n", viewport, viewport2); + + IDirect3DRMViewport2_Release(viewport2); + IDirect3DRMObject_Release(obj); + IDirect3DRMObject_Release(obj2); hr = IDirect3DRMViewport_GetClassName(viewport, NULL, cname); ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); @@ -1261,7 +1528,26 @@ ok(size == sizeof("Viewport"), "wrong size: %u\n", size); ok(!strcmp(cname, "Viewport"), "Expected cname to be \"Viewport\", but got \"%s\"\n", cname); - IDirect3DRMViewport_Release(viewport); + /* AppData */ + hr = IDirect3DRMViewport_SetAppData(viewport, 0); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + + hr = IDirect3DRMViewport_SetAppData(viewport, 0); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + + hr = IDirect3DRMViewport_SetAppData(viewport, 1); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + + hr = IDirect3DRMViewport_SetAppData(viewport, 1); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + + hr = IDirect3DRMViewport_QueryInterface(viewport, &IID_IDirect3DRMViewport2, (void**)&viewport2); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + + data = IDirect3DRMViewport2_GetAppData(viewport2); + ok(data == 1, "got %x\n", data); + IDirect3DRMViewport2_Release(viewport2); + IDirect3DRMFrame_Release(frame); IDirect3DRMDevice_Release(device); IDirectDrawClipper_Release(pClipper); @@ -1408,40 +1694,403 @@ static void test_Texture(void) { HRESULT hr; - IDirect3DRM *d3drm; - IDirect3DRMTexture *texture; - D3DRMIMAGE initimg = { + IDirect3DRM *d3drm1; + IDirect3DRM2 *d3drm2; + IDirect3DRM3 *d3drm3; + IDirect3DRMTexture *texture1; + IDirect3DRMTexture2 *texture2; + IDirect3DRMTexture3 *texture3; + + D3DRMIMAGE initimg = + { 2, 2, 1, 1, 32, TRUE, 2 * sizeof(DWORD), NULL, NULL, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000, 0, NULL - }; + }, + testimg = + { + 0, 0, 0, 0, 0, + TRUE, 0, (void *)0xcafebabe, NULL, + 0x000000ff, 0x0000ff00, 0x00ff0000, 0, 0, NULL + }, + *d3drm_img = NULL; + DWORD pixel[4] = { 20000, 30000, 10000, 0 }; DWORD size; CHAR cname[64] = {0}; - - hr = Direct3DRMCreate(&d3drm); - ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); + ULONG ref1, ref2, ref3, ref4; + + hr = Direct3DRMCreate(&d3drm1); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRM interface (hr = %x)\n", hr); + ref1 = get_refcount((IUnknown *)d3drm1); + + 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); + + /* Test NULL params */ + texture1 = (IDirect3DRMTexture *)0xdeadbeef; + hr = IDirect3DRM_CreateTexture(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_CreateTexture(d3drm1, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + texture2 = (IDirect3DRMTexture2 *)0xdeadbeef; + hr = IDirect3DRM2_CreateTexture(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_CreateTexture(d3drm2, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + texture3 = (IDirect3DRMTexture3 *)0xdeadbeef; + hr = IDirect3DRM3_CreateTexture(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_CreateTexture(d3drm3, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + /* Tests for validation of D3DRMIMAGE struct */ + hr = IDirect3DRM_CreateTexture(d3drm1, &testimg, &texture1); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture interface (hr = %#x)\n", hr); + hr = IDirect3DRM2_CreateTexture(d3drm2, &testimg, &texture2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %#x)\n", hr); + hr = IDirect3DRM3_CreateTexture(d3drm3, &testimg, &texture3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture3 interface (hr = %#x)\n", hr); + IDirect3DRMTexture_Release(texture1); + IDirect3DRMTexture2_Release(texture2); + IDirect3DRMTexture3_Release(texture3); + + testimg.rgb = 0; + testimg.palette = (void *)0xdeadbeef; + testimg.palette_size = 0x39; + hr = IDirect3DRM_CreateTexture(d3drm1, &testimg, &texture1); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture interface (hr = %#x)\n", hr); + hr = IDirect3DRM2_CreateTexture(d3drm2, &testimg, &texture2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %#x)\n", hr); + hr = IDirect3DRM3_CreateTexture(d3drm3, &testimg, &texture3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture3 interface (hr = %#x)\n", hr); + IDirect3DRMTexture_Release(texture1); + IDirect3DRMTexture2_Release(texture2); + IDirect3DRMTexture3_Release(texture3); + + initimg.rgb = 0; + texture1 = (IDirect3DRMTexture *)0xdeadbeef; + hr = IDirect3DRM_CreateTexture(d3drm1, &initimg, &texture1); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + ok(!texture1, "Expected texture == NULL, got %p.\n", texture1); + texture2 = (IDirect3DRMTexture2 *)0xdeadbeef; + hr = IDirect3DRM2_CreateTexture(d3drm2, &initimg, &texture2); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + ok(!texture2, "Expected texture == NULL, got %p.\n", texture2); + texture3 = (IDirect3DRMTexture3 *)0xdeadbeef; + hr = IDirect3DRM3_CreateTexture(d3drm3, &initimg, &texture3); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + ok(!texture3, "Expected texture == NULL, got %p.\n", texture3); + initimg.rgb = 1; + initimg.red_mask = 0; + hr = IDirect3DRM_CreateTexture(d3drm1, &initimg, &texture1); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRM2_CreateTexture(d3drm2, &initimg, &texture2); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRM3_CreateTexture(d3drm3, &initimg, &texture3); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + initimg.red_mask = 0x000000ff; + initimg.green_mask = 0; + hr = IDirect3DRM_CreateTexture(d3drm1, &initimg, &texture1); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRM2_CreateTexture(d3drm2, &initimg, &texture2); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRM3_CreateTexture(d3drm3, &initimg, &texture3); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + initimg.green_mask = 0x0000ff00; + initimg.blue_mask = 0; + hr = IDirect3DRM_CreateTexture(d3drm1, &initimg, &texture1); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRM2_CreateTexture(d3drm2, &initimg, &texture2); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRM3_CreateTexture(d3drm3, &initimg, &texture3); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + initimg.blue_mask = 0x00ff0000; + initimg.buffer1 = NULL; + hr = IDirect3DRM_CreateTexture(d3drm1, &initimg, &texture1); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRM2_CreateTexture(d3drm2, &initimg, &texture2); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRM3_CreateTexture(d3drm3, &initimg, &texture3); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); initimg.buffer1 = &pixel; - hr = IDirect3DRM_CreateTexture(d3drm, &initimg, &texture); - ok(hr == D3DRM_OK, "Cannot get IDirect3DRMTexture interface (hr = %x)\n", hr); - - hr = IDirect3DRMTexture_GetClassName(texture, NULL, cname); + hr = IDirect3DRM_CreateTexture(d3drm1, &initimg, &texture1); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture interface (hr = %#x)\n", hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 > ref1, "expected ref2 > ref1, got ref1 = %u , ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4); + hr = IDirect3DRM2_CreateTexture(d3drm2, &initimg, &texture2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %#x)\n", hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 > ref1 + 1, "expected ref2 > (ref1 + 1), got ref1 = %u , ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4); + hr = IDirect3DRM3_CreateTexture(d3drm3, &initimg, &texture3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture3 interface (hr = %#x)\n", hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 > ref1 + 2, "expected ref2 > (ref1 + 2), got ref1 = %u , ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4); + + /* Test all failures together */ + hr = IDirect3DRMTexture_GetClassName(texture1, NULL, cname); ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); - hr = IDirect3DRMTexture_GetClassName(texture, NULL, NULL); + 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(texture, &size, cname); + 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); + + 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(texture, &size, cname); - ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); + 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(texture); - - IDirect3DRM_Release(d3drm); + 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); + ok(ref2 - 2 == ref1, "expected (ref2 - 2) == ref1, got ref1 = %u, ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4); + + d3drm_img = NULL; + d3drm_img = IDirect3DRMTexture2_GetImage(texture2); + 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); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4); + + d3drm_img = NULL; + 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); + ok(ref2 == ref1, "expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4); + + /* InitFromImage tests */ + /* Tests for validation of D3DRMIMAGE struct */ + testimg.rgb = 1; + testimg.palette = NULL; + testimg.palette_size = 0; + hr = IDirect3DRM2_CreateObject(d3drm2, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture2, + (void **)&texture2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %#x).\n", hr); + hr = IDirect3DRM3_CreateObject(d3drm3, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture3, + (void **)&texture3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture3 interface (hr = %#x).\n", hr); + hr = IDirect3DRMTexture2_InitFromImage(texture2, &testimg); + ok(SUCCEEDED(hr), "Cannot initialize IDirect3DRMTexture2 interface (hr = %#x)\n", hr); + hr = IDirect3DRMTexture3_InitFromImage(texture3, &testimg); + ok(SUCCEEDED(hr), "Cannot initialize IDirect3DRMTexture3 interface (hr = %#x)\n", hr); + IDirect3DRMTexture2_Release(texture2); + IDirect3DRMTexture3_Release(texture3); + + testimg.rgb = 0; + testimg.palette = (void *)0xdeadbeef; + testimg.palette_size = 0x39; + hr = IDirect3DRM2_CreateObject(d3drm2, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture2, + (void **)&texture2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %#x).\n", hr); + hr = IDirect3DRM3_CreateObject(d3drm3, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture3, + (void **)&texture3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture3 interface (hr = %#x).\n", hr); + hr = IDirect3DRMTexture2_InitFromImage(texture2, &testimg); + ok(SUCCEEDED(hr), "Cannot initialize IDirect3DRMTexture2 interface (hr = %#x)\n", hr); + hr = IDirect3DRMTexture3_InitFromImage(texture3, &testimg); + ok(SUCCEEDED(hr), "Cannot initialize IDirect3DRMTexture3 interface (hr = %#x)\n", hr); + IDirect3DRMTexture2_Release(texture2); + IDirect3DRMTexture3_Release(texture3); + + hr = IDirect3DRM2_CreateObject(d3drm2, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture2, + (void **)&texture2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %#x).\n", hr); + ref2 = get_refcount((IUnknown *)texture2); + hr = IDirect3DRMTexture2_InitFromImage(texture2, NULL); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + ref3 = get_refcount((IUnknown *)texture2); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); + + hr = IDirect3DRM3_CreateObject(d3drm3, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture3, + (void **)&texture3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture3 interface (hr = %#x).\n", hr); + ref2 = get_refcount((IUnknown *)texture3); + hr = IDirect3DRMTexture3_InitFromImage(texture3, NULL); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + ref3 = get_refcount((IUnknown *)texture3); + ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3); + + initimg.rgb = 0; + hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + hr = IDirect3DRMTexture3_InitFromImage(texture3, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + initimg.rgb = 1; + initimg.red_mask = 0; + hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + hr = IDirect3DRMTexture3_InitFromImage(texture3, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + initimg.red_mask = 0x000000ff; + initimg.green_mask = 0; + hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + hr = IDirect3DRMTexture3_InitFromImage(texture3, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + initimg.green_mask = 0x0000ff00; + initimg.blue_mask = 0; + hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + hr = IDirect3DRMTexture3_InitFromImage(texture3, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + initimg.blue_mask = 0x00ff0000; + initimg.buffer1 = NULL; + hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + hr = IDirect3DRMTexture3_InitFromImage(texture3, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + initimg.buffer1 = &pixel; + + d3drm_img = NULL; + hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg); + ok(SUCCEEDED(hr), "Cannot initialize IDirect3DRMTexture2 from image (hr = %#x).\n", hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 > ref1, "expected ref2 > ref1, got ref1 = %u , ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4); + + hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + /* Release leaked reference to d3drm1 */ + IDirect3DRM_Release(d3drm1); + + d3drm_img = IDirect3DRMTexture2_GetImage(texture2); + ok(!!d3drm_img, "Failed to get image.\n"); + ok(d3drm_img == &initimg, "Expected image returned == %p, got %p.\n", &initimg, d3drm_img); + IDirect3DRMTexture2_Release(texture2); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 == ref1, "expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4); + + d3drm_img = NULL; + hr = IDirect3DRMTexture3_InitFromImage(texture3, &initimg); + ok(SUCCEEDED(hr), "Cannot initialize IDirect3DRMTexture3 from image (hr = %#x).\n", hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 > ref1, "expected ref2 > ref1, got ref1 = %u , ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4); + + hr = IDirect3DRMTexture3_InitFromImage(texture3, &initimg); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + IDirect3DRM_Release(d3drm1); + + 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); + IDirect3DRMTexture3_Release(texture3); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 == ref1, "expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4); + + IDirect3DRM3_Release(d3drm3); + IDirect3DRM2_Release(d3drm2); + IDirect3DRM_Release(d3drm1); } static void test_Device(void) @@ -4100,6 +4749,7 @@ test_Face(); test_Frame(); test_Device(); + test_object(); test_Viewport(); test_Light(); test_Material2();
8 years, 5 months
1
0
0
0
[akhaldi] 71757: [D3DRM] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 15:33:46 2016 New Revision: 71757 URL:
http://svn.reactos.org/svn/reactos?rev=71757&view=rev
Log: [D3DRM] Sync with Wine Staging 1.9.11. CORE-11368 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/meshbuilder.c trunk/reactos/dll/directx/wine/d3drm/texture.c trunk/reactos/dll/directx/wine/d3drm/viewport.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/d3drm.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/d3drm.c [iso-8859-1] Sat Jul 2 15:33:46 2016 @@ -3,6 +3,7 @@ * * Copyright 2010, 2012 Christian Costa * Copyright 2011 André Hentschel + * Copyright 2016 Aaryaman Vasishta * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -127,10 +128,12 @@ static HRESULT WINAPI d3drm1_CreateObject(IDirect3DRM *iface, REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) { - FIXME("iface %p, clsid %s, outer %p, iid %s, out %p stub!\n", + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + + TRACE("iface %p, clsid %s, outer %p, iid %s, out %p.\n", iface, debugstr_guid(clsid), outer, debugstr_guid(iid), out); - return E_NOTIMPL; + return IDirect3DRM3_CreateObject(&d3drm->IDirect3DRM3_iface, clsid, outer, iid, out); } static HRESULT WINAPI d3drm1_CreateFrame(IDirect3DRM *iface, @@ -181,9 +184,25 @@ static HRESULT WINAPI d3drm1_CreateTexture(IDirect3DRM *iface, D3DRMIMAGE *image, IDirect3DRMTexture **texture) { - FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); - - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + IDirect3DRMTexture3 *texture3; + HRESULT hr; + + TRACE("iface %p, image %p, texture %p.\n", iface, image, texture); + + if (!texture) + return D3DRMERR_BADVALUE; + + if (FAILED(hr = IDirect3DRM3_CreateTexture(&d3drm->IDirect3DRM3_iface, image, &texture3))) + { + *texture = NULL; + return hr; + } + + hr = IDirect3DRMTexture3_QueryInterface(texture3, &IID_IDirect3DRMTexture, (void **)texture); + IDirect3DRMTexture3_Release(texture3); + + return hr; } static HRESULT WINAPI d3drm1_CreateLight(IDirect3DRM *iface, @@ -391,17 +410,33 @@ static HRESULT WINAPI d3drm1_LoadTexture(IDirect3DRM *iface, const char *filename, IDirect3DRMTexture **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object, iface))) + return hr; + + *texture = &object->IDirect3DRMTexture_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm1_LoadTextureFromResource(IDirect3DRM *iface, HRSRC resource, IDirect3DRMTexture **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, resource %p, texture %p stub!\n", iface, resource, texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object, iface))) + return hr; + + *texture = &object->IDirect3DRMTexture_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm1_SetSearchPath(IDirect3DRM *iface, const char *path) @@ -567,10 +602,12 @@ static HRESULT WINAPI d3drm2_CreateObject(IDirect3DRM2 *iface, REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) { - FIXME("iface %p, clsid %s, outer %p, iid %s, out %p stub!\n", + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + + TRACE("iface %p, clsid %s, outer %p, iid %s, out %p.\n", iface, debugstr_guid(clsid), outer, debugstr_guid(iid), out); - return E_NOTIMPL; + return IDirect3DRM3_CreateObject(&d3drm->IDirect3DRM3_iface, clsid, outer, iid, out); } static HRESULT WINAPI d3drm2_CreateFrame(IDirect3DRM2 *iface, @@ -621,9 +658,25 @@ static HRESULT WINAPI d3drm2_CreateTexture(IDirect3DRM2 *iface, D3DRMIMAGE *image, IDirect3DRMTexture2 **texture) { - FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); - - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + IDirect3DRMTexture3 *texture3; + HRESULT hr; + + TRACE("iface %p, image %p, texture %p.\n", iface, image, texture); + + if (!texture) + return D3DRMERR_BADVALUE; + + if (FAILED(hr = IDirect3DRM3_CreateTexture(&d3drm->IDirect3DRM3_iface, image, &texture3))) + { + *texture = NULL; + return hr; + } + + hr = IDirect3DRMTexture3_QueryInterface(texture3, &IID_IDirect3DRMTexture2, (void **)texture); + IDirect3DRMTexture3_Release(texture3); + + return hr; } static HRESULT WINAPI d3drm2_CreateLight(IDirect3DRM2 *iface, @@ -809,18 +862,36 @@ static HRESULT WINAPI d3drm2_LoadTexture(IDirect3DRM2 *iface, const char *filename, IDirect3DRMTexture2 **texture) { + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object, &d3drm->IDirect3DRM_iface))) + return hr; + + *texture = &object->IDirect3DRMTexture2_iface; + + return hr; } static HRESULT WINAPI d3drm2_LoadTextureFromResource(IDirect3DRM2 *iface, HMODULE module, const char *resource_name, const char *resource_type, IDirect3DRMTexture2 **texture) { + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, resource_name %s, resource_type %s, texture %p stub!\n", iface, debugstr_a(resource_name), debugstr_a(resource_type), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object, &d3drm->IDirect3DRM_iface))) + return hr; + + *texture = &object->IDirect3DRMTexture2_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm2_SetSearchPath(IDirect3DRM2 *iface, const char *path) @@ -994,10 +1065,51 @@ static HRESULT WINAPI d3drm3_CreateObject(IDirect3DRM3 *iface, REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) { - FIXME("iface %p, clsid %s, outer %p, iid %s, out %p stub!\n", + struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); + IUnknown *object; + HRESULT hr; + + TRACE("iface %p, clsid %s, outer %p, iid %s, out %p.\n", iface, debugstr_guid(clsid), outer, debugstr_guid(iid), out); - return E_NOTIMPL; + if (!out) + return D3DRMERR_BADVALUE; + + if (!clsid || !iid) + { + *out = NULL; + return D3DRMERR_BADVALUE; + } + + if (outer) + { + FIXME("COM aggregation for outer IUnknown (%p) not implemented. Returning E_NOTIMPL.\n", outer); + *out = NULL; + return E_NOTIMPL; + } + + if (IsEqualGUID(clsid, &CLSID_CDirect3DRMTexture)) + { + struct d3drm_texture *texture; + if (FAILED(hr = d3drm_texture_create(&texture, &d3drm->IDirect3DRM_iface))) + { + *out = NULL; + return hr; + } + object = (IUnknown *)&texture->IDirect3DRMTexture3_iface; + } + else + { + FIXME("%s not implemented. Returning CLASSFACTORY_E_FIRST.\n", debugstr_guid(clsid)); + *out = NULL; + return CLASSFACTORY_E_FIRST; + } + + if (FAILED(hr = IUnknown_QueryInterface(object, iid, out))) + *out = NULL; + IUnknown_Release(object); + + return hr; } static HRESULT WINAPI d3drm3_CreateFrame(IDirect3DRM3 *iface, @@ -1046,9 +1158,28 @@ static HRESULT WINAPI d3drm3_CreateTexture(IDirect3DRM3 *iface, D3DRMIMAGE *image, IDirect3DRMTexture3 **texture) { - FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); - - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); + struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); + struct d3drm_texture *object; + HRESULT hr; + + TRACE("iface %p, image %p, texture %p.\n", iface, image, texture); + + if (!texture) + return D3DRMERR_BADVALUE; + + if (FAILED(hr = d3drm_texture_create(&object, &d3drm->IDirect3DRM_iface))) + return hr; + + *texture = &object->IDirect3DRMTexture3_iface; + + if (FAILED(IDirect3DRMTexture3_InitFromImage(*texture, image))) + { + IDirect3DRMTexture3_Release(*texture); + *texture = NULL; + return D3DRMERR_BADVALUE; + } + + return D3DRM_OK; } static HRESULT WINAPI d3drm3_CreateLight(IDirect3DRM3 *iface, @@ -1284,18 +1415,36 @@ static HRESULT WINAPI d3drm3_LoadTexture(IDirect3DRM3 *iface, const char *filename, IDirect3DRMTexture3 **texture) { + struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object, &d3drm->IDirect3DRM_iface))) + return hr; + + *texture = &object->IDirect3DRMTexture3_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm3_LoadTextureFromResource(IDirect3DRM3 *iface, HMODULE module, const char *resource_name, const char *resource_type, IDirect3DRMTexture3 **texture) { + struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, module %p, resource_name %s, resource_type %s, texture %p stub!\n", iface, module, debugstr_a(resource_name), debugstr_a(resource_type), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object, &d3drm->IDirect3DRM_iface))) + return hr; + + *texture = &object->IDirect3DRMTexture3_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm3_SetSearchPath(IDirect3DRM3 *iface, const char *path) Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/d3drm_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/d3drm_main.c [iso-8859-1] Sat Jul 2 15:33:46 2016 @@ -34,3 +34,67 @@ } return TRUE; } + +void d3drm_object_init(struct d3drm_object *object) +{ + object->ref = 1; + object->appdata = 0; + list_init(&object->destroy_callbacks); +} + +struct destroy_callback +{ + struct list entry; + D3DRMOBJECTCALLBACK cb; + void *ctx; +}; + +HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) +{ + struct destroy_callback *callback; + + if (!cb) + return D3DRMERR_BADVALUE; + + callback = HeapAlloc(GetProcessHeap(), 0, sizeof(*callback)); + if (!callback) + return E_OUTOFMEMORY; + + callback->cb = cb; + callback->ctx = ctx; + + list_add_head(&object->destroy_callbacks, &callback->entry); + return D3DRM_OK; +} + +HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) +{ + struct destroy_callback *callback; + + if (!cb) + return D3DRMERR_BADVALUE; + + LIST_FOR_EACH_ENTRY(callback, &object->destroy_callbacks, struct destroy_callback, entry) + { + if (callback->cb == cb && callback->ctx == ctx) + { + list_remove(&callback->entry); + HeapFree(GetProcessHeap(), 0, callback); + break; + } + } + + return D3DRM_OK; +} + +void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object) +{ + struct destroy_callback *callback, *callback2; + + LIST_FOR_EACH_ENTRY_SAFE(callback, callback2, &object->destroy_callbacks, struct destroy_callback, entry) + { + callback->cb(iface, callback->ctx); + list_remove(&callback->entry); + HeapFree(GetProcessHeap(), 0, callback); + } +} Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h [iso-8859-1] Sat Jul 2 15:33:46 2016 @@ -38,9 +38,33 @@ #include <wine/debug.h> WINE_DEFAULT_DEBUG_CHANNEL(d3drm); +#include "wine/list.h" + struct d3drm_device; +struct d3drm_object +{ + LONG ref; + DWORD appdata; + struct list destroy_callbacks; +}; + +struct d3drm_texture +{ + struct d3drm_object obj; + IDirect3DRMTexture IDirect3DRMTexture_iface; + IDirect3DRMTexture2 IDirect3DRMTexture2_iface; + IDirect3DRMTexture3 IDirect3DRMTexture3_iface; + IDirect3DRM *d3drm; + D3DRMIMAGE *image; +}; + +void d3drm_object_init(struct d3drm_object *object) DECLSPEC_HIDDEN; +HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN; +HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN; +void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object) DECLSPEC_HIDDEN; HRESULT d3drm_device_create(struct d3drm_device **out) DECLSPEC_HIDDEN; +HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) DECLSPEC_HIDDEN; IDirect3DRMDevice *IDirect3DRMDevice_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN; IDirect3DRMDevice2 *IDirect3DRMDevice2_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN; IDirect3DRMDevice3 *IDirect3DRMDevice3_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN; @@ -51,7 +75,6 @@ HRESULT Direct3DRMMeshBuilder_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMMaterial_create(IDirect3DRMMaterial2** ret_iface) DECLSPEC_HIDDEN; -HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HIDDEN; HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data, D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/mes…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/meshbuilder.c [iso-8859-1] Sat Jul 2 15:33:46 2016 @@ -1056,7 +1056,7 @@ return hr; } - TRACE("Mesh name is '%s'\n", This->name ? This->name : ""); + TRACE("Mesh name is %s\n", debugstr_a(This->name)); This->nb_normals = 0; @@ -1149,6 +1149,7 @@ IDirectXFileObject *child; DWORD i = 0; float* values; + struct d3drm_texture *texture_object; TRACE("Process MeshMaterialList\n"); @@ -1286,13 +1287,12 @@ if (file != INVALID_HANDLE_VALUE) { CloseHandle(file); - - hr = Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown**)&This->materials[i].texture); - if (FAILED(hr)) + if (FAILED(hr = d3drm_texture_create(&texture_object, NULL))) { IDirectXFileData_Release(data); goto end; } + This->materials[i].texture = &texture_object->IDirect3DRMTexture3_iface; } } } Modified: trunk/reactos/dll/directx/wine/d3drm/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/tex…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/texture.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/texture.c [iso-8859-1] Sat Jul 2 15:33:46 2016 @@ -20,15 +20,6 @@ #include "d3drm_private.h" -struct d3drm_texture -{ - IDirect3DRMTexture IDirect3DRMTexture_iface; - IDirect3DRMTexture2 IDirect3DRMTexture2_iface; - IDirect3DRMTexture3 IDirect3DRMTexture3_iface; - LONG ref; - DWORD app_data; -}; - static inline struct d3drm_texture *impl_from_IDirect3DRMTexture(IDirect3DRMTexture *iface) { return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture_iface); @@ -42,6 +33,31 @@ static inline struct d3drm_texture *impl_from_IDirect3DRMTexture3(IDirect3DRMTexture3 *iface) { return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture3_iface); +} + +static void d3drm_texture_destroy(struct d3drm_texture *texture) +{ + TRACE("texture %p is being destroyed.\n", texture); + + d3drm_object_cleanup((IDirect3DRMObject*)&texture->IDirect3DRMTexture3_iface, &texture->obj); + if (texture->image) + IDirect3DRM_Release(texture->d3drm); + HeapFree(GetProcessHeap(), 0, texture); +} + +static BOOL d3drm_validate_image(D3DRMIMAGE *image) +{ + if (!image + || !image->red_mask + || !image->green_mask + || !image->blue_mask + || !image->buffer1 + || !(image->rgb || (image->palette && image->palette_size))) + { + return FALSE; + } + + return TRUE; } static HRESULT WINAPI d3drm_texture1_QueryInterface(IDirect3DRMTexture *iface, REFIID riid, void **out) @@ -84,17 +100,21 @@ static HRESULT WINAPI d3drm_texture1_AddDestroyCallback(IDirect3DRMTexture *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return IDirect3DRMTexture3_AddDestroyCallback(&texture->IDirect3DRMTexture3_iface, cb, ctx); } static HRESULT WINAPI d3drm_texture1_DeleteDestroyCallback(IDirect3DRMTexture *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return IDirect3DRMTexture3_DeleteDestroyCallback(&texture->IDirect3DRMTexture3_iface, cb, ctx); } static HRESULT WINAPI d3drm_texture1_SetAppData(IDirect3DRMTexture *iface, DWORD data) @@ -380,17 +400,21 @@ static HRESULT WINAPI d3drm_texture2_AddDestroyCallback(IDirect3DRMTexture2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return IDirect3DRMTexture3_AddDestroyCallback(&texture->IDirect3DRMTexture3_iface, cb, ctx); } static HRESULT WINAPI d3drm_texture2_DeleteDestroyCallback(IDirect3DRMTexture2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return IDirect3DRMTexture3_DeleteDestroyCallback(&texture->IDirect3DRMTexture3_iface, cb, ctx); } static HRESULT WINAPI d3drm_texture2_SetAppData(IDirect3DRMTexture2 *iface, DWORD data) @@ -604,9 +628,11 @@ static HRESULT WINAPI d3drm_texture2_InitFromImage(IDirect3DRMTexture2 *iface, D3DRMIMAGE *image) { - FIXME("iface %p, image %p stub!\n", iface, image); - - return E_NOTIMPL; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + + TRACE("iface %p, image %p.\n", iface, image); + + return IDirect3DRMTexture3_InitFromImage(&texture->IDirect3DRMTexture3_iface, image); } static HRESULT WINAPI d3drm_texture2_InitFromResource2(IDirect3DRMTexture2 *iface, @@ -699,7 +725,7 @@ static ULONG WINAPI d3drm_texture3_AddRef(IDirect3DRMTexture3 *iface) { struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); - ULONG refcount = InterlockedIncrement(&texture->ref); + ULONG refcount = InterlockedIncrement(&texture->obj.ref); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -709,12 +735,12 @@ static ULONG WINAPI d3drm_texture3_Release(IDirect3DRMTexture3 *iface) { struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); - ULONG refcount = InterlockedDecrement(&texture->ref); + ULONG refcount = InterlockedDecrement(&texture->obj.ref); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) - HeapFree(GetProcessHeap(), 0, texture); + d3drm_texture_destroy(texture); return refcount; } @@ -730,17 +756,21 @@ static HRESULT WINAPI d3drm_texture3_AddDestroyCallback(IDirect3DRMTexture3 *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return d3drm_object_add_destroy_callback(&texture->obj, cb, ctx); } static HRESULT WINAPI d3drm_texture3_DeleteDestroyCallback(IDirect3DRMTexture3 *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return d3drm_object_delete_destroy_callback(&texture->obj, cb, ctx); } static HRESULT WINAPI d3drm_texture3_SetAppData(IDirect3DRMTexture3 *iface, DWORD data) @@ -749,7 +779,7 @@ TRACE("iface %p, data %#x.\n", iface, data); - texture->app_data = data; + texture->obj.appdata = data; return D3DRM_OK; } @@ -760,7 +790,7 @@ TRACE("iface %p.\n", iface); - return texture->app_data; + return texture->obj.appdata; } static HRESULT WINAPI d3drm_texture3_SetName(IDirect3DRMTexture3 *iface, const char *name) @@ -781,7 +811,7 @@ { TRACE("iface %p, size %p, name %p.\n", iface, size, name); - if (!size || *size < strlen("Texture") || !name) + if (!size || *size < sizeof("Texture") || !name) return E_INVALIDARG; strcpy(name, "Texture"); @@ -885,51 +915,66 @@ static D3DRMIMAGE * WINAPI d3drm_texture3_GetImage(IDirect3DRMTexture3 *iface) { + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + + TRACE("iface %p.\n", iface); + + return texture->image; +} + +static DWORD WINAPI d3drm_texture3_GetShades(IDirect3DRMTexture3 *iface) +{ FIXME("iface %p stub!\n", iface); - return NULL; -} - -static DWORD WINAPI d3drm_texture3_GetShades(IDirect3DRMTexture3 *iface) + return 0; +} + +static DWORD WINAPI d3drm_texture3_GetColors(IDirect3DRMTexture3 *iface) { FIXME("iface %p stub!\n", iface); return 0; } -static DWORD WINAPI d3drm_texture3_GetColors(IDirect3DRMTexture3 *iface) +static DWORD WINAPI d3drm_texture3_GetDecalScale(IDirect3DRMTexture3 *iface) { FIXME("iface %p stub!\n", iface); return 0; } -static DWORD WINAPI d3drm_texture3_GetDecalScale(IDirect3DRMTexture3 *iface) +static BOOL WINAPI d3drm_texture3_GetDecalTransparency(IDirect3DRMTexture3 *iface) { FIXME("iface %p stub!\n", iface); + return FALSE; +} + +static D3DCOLOR WINAPI d3drm_texture3_GetDecalTransparentColor(IDirect3DRMTexture3 *iface) +{ + FIXME("iface %p stub!\n", iface); + return 0; } -static BOOL WINAPI d3drm_texture3_GetDecalTransparency(IDirect3DRMTexture3 *iface) -{ - FIXME("iface %p stub!\n", iface); - - return FALSE; -} - -static D3DCOLOR WINAPI d3drm_texture3_GetDecalTransparentColor(IDirect3DRMTexture3 *iface) -{ - FIXME("iface %p stub!\n", iface); - - return 0; -} - static HRESULT WINAPI d3drm_texture3_InitFromImage(IDirect3DRMTexture3 *iface, D3DRMIMAGE *image) { - FIXME("iface %p, image %p stub!\n", iface, image); - - return E_NOTIMPL; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + + TRACE("iface %p, image %p.\n", iface, image); + + if (!d3drm_validate_image(image)) + return D3DRMERR_BADOBJECT; + + /* d3drm intentionally leaks a reference to IDirect3DRM here if texture has already been initialized. */ + IDirect3DRM_AddRef(texture->d3drm); + + if (texture->image) + return D3DRMERR_BADOBJECT; + + texture->image = image; + + return D3DRM_OK; } static HRESULT WINAPI d3drm_texture3_InitFromResource2(IDirect3DRMTexture3 *iface, @@ -1029,12 +1074,11 @@ d3drm_texture3_SetValidationCallback, }; -HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown **out) +HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) { struct d3drm_texture *object; - HRESULT hr; - - TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + + TRACE("texture %p.\n", texture); if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; @@ -1042,10 +1086,11 @@ object->IDirect3DRMTexture_iface.lpVtbl = &d3drm_texture1_vtbl; object->IDirect3DRMTexture2_iface.lpVtbl = &d3drm_texture2_vtbl; object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl; - object->ref = 1; - - hr = IDirect3DRMTexture3_QueryInterface(&object->IDirect3DRMTexture3_iface, riid, (void **)out); - IDirect3DRMTexture3_Release(&object->IDirect3DRMTexture3_iface); - - return hr; -} + object->d3drm = d3drm; + + d3drm_object_init(&object->obj); + + *texture = object; + + return D3DRM_OK; +} Modified: trunk/reactos/dll/directx/wine/d3drm/viewport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/vie…
============================================================================== --- trunk/reactos/dll/directx/wine/d3drm/viewport.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3drm/viewport.c [iso-8859-1] Sat Jul 2 15:33:46 2016 @@ -22,9 +22,9 @@ struct d3drm_viewport { + struct d3drm_object obj; IDirect3DRMViewport IDirect3DRMViewport_iface; IDirect3DRMViewport2 IDirect3DRMViewport2_iface; - LONG ref; D3DVALUE back; D3DVALUE front; D3DVALUE field; @@ -48,6 +48,7 @@ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IDirect3DRMViewport) + || IsEqualGUID(riid, &IID_IDirect3DRMObject) || IsEqualGUID(riid, &IID_IUnknown)) { *out = &viewport->IDirect3DRMViewport_iface; @@ -70,7 +71,7 @@ static ULONG WINAPI d3drm_viewport1_AddRef(IDirect3DRMViewport *iface) { struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); - ULONG refcount = InterlockedIncrement(&viewport->ref); + ULONG refcount = InterlockedIncrement(&viewport->obj.ref); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -80,12 +81,15 @@ static ULONG WINAPI d3drm_viewport1_Release(IDirect3DRMViewport *iface) { struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); - ULONG refcount = InterlockedDecrement(&viewport->ref); + ULONG refcount = InterlockedDecrement(&viewport->obj.ref); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) + { + d3drm_object_cleanup((IDirect3DRMObject*)iface, &viewport->obj); HeapFree(GetProcessHeap(), 0, viewport); + } return refcount; } @@ -101,31 +105,39 @@ static HRESULT WINAPI d3drm_viewport1_AddDestroyCallback(IDirect3DRMViewport *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return IDirect3DRMViewport2_AddDestroyCallback(&viewport->IDirect3DRMViewport2_iface, cb, ctx); } static HRESULT WINAPI d3drm_viewport1_DeleteDestroyCallback(IDirect3DRMViewport *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return IDirect3DRMViewport2_DeleteDestroyCallback(&viewport->IDirect3DRMViewport2_iface, cb, ctx); } static HRESULT WINAPI d3drm_viewport1_SetAppData(IDirect3DRMViewport *iface, DWORD data) { - FIXME("iface %p, data %#x stub!\n", iface, data); - - return E_NOTIMPL; + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, data %#x\n", iface, data); + + return IDirect3DRMViewport2_SetAppData(&viewport->IDirect3DRMViewport2_iface, data); } static DWORD WINAPI d3drm_viewport1_GetAppData(IDirect3DRMViewport *iface) { - FIXME("iface %p.\n", iface); - - return 0; + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMViewport2_GetAppData(&viewport->IDirect3DRMViewport2_iface); } static HRESULT WINAPI d3drm_viewport1_SetName(IDirect3DRMViewport *iface, const char *name) @@ -454,31 +466,40 @@ static HRESULT WINAPI d3drm_viewport2_AddDestroyCallback(IDirect3DRMViewport2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return d3drm_object_add_destroy_callback(&viewport->obj, cb, ctx); } static HRESULT WINAPI d3drm_viewport2_DeleteDestroyCallback(IDirect3DRMViewport2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx) { - FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); - - return E_NOTIMPL; + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx); + + return d3drm_object_delete_destroy_callback(&viewport->obj, cb, ctx); } static HRESULT WINAPI d3drm_viewport2_SetAppData(IDirect3DRMViewport2 *iface, DWORD data) { - FIXME("iface %p, data %#x stub!\n", iface, data); - - return E_NOTIMPL; + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p, data %#x\n", iface, data); + + viewport->obj.appdata = data; + return S_OK; } static DWORD WINAPI d3drm_viewport2_GetAppData(IDirect3DRMViewport2 *iface) { - FIXME("iface %p stub!\n", iface); - - return 0; + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p\n", iface); + + return viewport->obj.appdata; } static HRESULT WINAPI d3drm_viewport2_SetName(IDirect3DRMViewport2 *iface, const char *name) @@ -810,7 +831,7 @@ object->IDirect3DRMViewport_iface.lpVtbl = &d3drm_viewport1_vtbl; object->IDirect3DRMViewport2_iface.lpVtbl = &d3drm_viewport2_vtbl; - object->ref = 1; + d3drm_object_init(&object->obj); if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2)) *out = (IUnknown *)&object->IDirect3DRMViewport2_iface; 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 Jul 2 15:33:46 2016 @@ -25,7 +25,7 @@ reactos/dll/directx/wine/d3d8 # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/d3d9 # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-1.9.4 -reactos/dll/directx/wine/d3drm # Synced to WineStaging-1.9.4 +reactos/dll/directx/wine/d3drm # Synced to WineStaging-1.9.11 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/d3dxof # Synced to WineStaging-1.9.4 reactos/dll/directx/wine/ddraw # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
35
36
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Results per page:
10
25
50
100
200