Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
December 2019
- 73 participants
- 1394 messages
[PATCH 3/4] ole32: Improve maximum storage size returned for generic composite monikers.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/ole32/compositemoniker.c | 2 +-
dlls/ole32/tests/moniker.c | 28 ++++++++++++++++++----------
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/dlls/ole32/compositemoniker.c b/dlls/ole32/compositemoniker.c
index 5f5c8c7deb..5914008fe3 100644
--- a/dlls/ole32/compositemoniker.c
+++ b/dlls/ole32/compositemoniker.c
@@ -315,7 +315,7 @@ CompositeMonikerImpl_GetSizeMax(IMoniker* iface,ULARGE_INTEGER* pcbSize)
IMoniker_Release(pmk);
- pcbSize->QuadPart = ptmpSize.QuadPart + sizeof(CLSID);
+ pcbSize->QuadPart += ptmpSize.QuadPart + sizeof(CLSID);
}
IEnumMoniker_Release(enumMk);
diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c
index e04be638a6..8b88ae4a0d 100644
--- a/dlls/ole32/tests/moniker.c
+++ b/dlls/ole32/tests/moniker.c
@@ -1345,15 +1345,16 @@ static void test_moniker(
const BYTE *expected_moniker_marshal_data, unsigned int sizeof_expected_moniker_marshal_data,
const BYTE *expected_moniker_saved_data, unsigned int sizeof_expected_moniker_saved_data,
const BYTE *expected_moniker_comparison_data, unsigned int sizeof_expected_moniker_comparison_data,
- LPCWSTR expected_display_name)
+ int expected_max_size, LPCWSTR expected_display_name)
{
+ ULARGE_INTEGER max_size;
IStream * stream;
IROTData * rotdata;
HRESULT hr;
HGLOBAL hglobal;
LPBYTE moniker_data;
DWORD moniker_size;
- DWORD i;
+ DWORD i, moniker_type;
BOOL same;
BYTE buffer[128];
IMoniker * moniker_proxy;
@@ -1423,6 +1424,13 @@ static void test_moniker(
ok_ole_success(hr, CreateStreamOnHGlobal);
/* Saving */
+ moniker_type = 0;
+ IMoniker_IsSystemMoniker(moniker, &moniker_type);
+
+ hr = IMoniker_GetSizeMax(moniker, &max_size);
+ ok(hr == S_OK, "Failed to get max size, hr %#x.\n", hr);
+todo_wine_if(moniker_type == MKSYS_GENERICCOMPOSITE)
+ ok(expected_max_size == max_size.u.LowPart, "%s: unexpected max size %u.\n", testname, max_size.u.LowPart);
hr = IMoniker_Save(moniker, stream, TRUE);
ok_ole_success(hr, IMoniker_Save);
@@ -1541,7 +1549,7 @@ static void test_class_moniker(void)
expected_class_moniker_marshal_data, sizeof(expected_class_moniker_marshal_data),
expected_class_moniker_saved_data, sizeof(expected_class_moniker_saved_data),
expected_class_moniker_comparison_data, sizeof(expected_class_moniker_comparison_data),
- expected_class_moniker_display_name);
+ sizeof(expected_class_moniker_saved_data), expected_class_moniker_display_name);
/* Hashing */
@@ -1684,7 +1692,7 @@ static void test_item_moniker(void)
expected_item_moniker_marshal_data2, sizeof(expected_item_moniker_marshal_data2),
expected_item_moniker_saved_data2, sizeof(expected_item_moniker_saved_data2),
expected_item_moniker_comparison_data2, sizeof(expected_item_moniker_comparison_data2),
- L"Test");
+ 46, L"Test");
IMoniker_Release(moniker);
@@ -1695,7 +1703,7 @@ static void test_item_moniker(void)
expected_item_moniker_marshal_data3, sizeof(expected_item_moniker_marshal_data3),
expected_item_moniker_saved_data3, sizeof(expected_item_moniker_saved_data3),
expected_item_moniker_comparison_data2, sizeof(expected_item_moniker_comparison_data2),
- L"Test");
+ 50, L"Test");
IMoniker_Release(moniker);
@@ -1706,7 +1714,7 @@ static void test_item_moniker(void)
expected_item_moniker_marshal_data4, sizeof(expected_item_moniker_marshal_data4),
expected_item_moniker_saved_data4, sizeof(expected_item_moniker_saved_data4),
expected_item_moniker_comparison_data4, sizeof(expected_item_moniker_comparison_data4),
- L"&&Test");
+ 58, L"&&Test");
IMoniker_Release(moniker);
@@ -1717,7 +1725,7 @@ static void test_item_moniker(void)
expected_item_moniker_marshal_data5, sizeof(expected_item_moniker_marshal_data5),
expected_item_moniker_saved_data5, sizeof(expected_item_moniker_saved_data5),
expected_item_moniker_comparison_data5, sizeof(expected_item_moniker_comparison_data5),
- L"abTest");
+ 58, L"abTest");
IMoniker_Release(moniker);
@@ -1728,7 +1736,7 @@ static void test_item_moniker(void)
expected_item_moniker_marshal_data, sizeof(expected_item_moniker_marshal_data),
expected_item_moniker_saved_data, sizeof(expected_item_moniker_saved_data),
expected_item_moniker_comparison_data, sizeof(expected_item_moniker_comparison_data),
- expected_display_name);
+ 54, expected_display_name);
/* Hashing */
@@ -1793,7 +1801,7 @@ static void test_anti_moniker(void)
expected_anti_moniker_marshal_data, sizeof(expected_anti_moniker_marshal_data),
expected_anti_moniker_saved_data, sizeof(expected_anti_moniker_saved_data),
expected_anti_moniker_comparison_data, sizeof(expected_anti_moniker_comparison_data),
- expected_display_name);
+ 20, expected_display_name);
/* Hashing */
hr = IMoniker_Hash(moniker, &hash);
@@ -1863,7 +1871,7 @@ static void test_generic_composite_moniker(void)
expected_gc_moniker_marshal_data, sizeof(expected_gc_moniker_marshal_data),
expected_gc_moniker_saved_data, sizeof(expected_gc_moniker_saved_data),
expected_gc_moniker_comparison_data, sizeof(expected_gc_moniker_comparison_data),
- expected_display_name);
+ 160, expected_display_name);
/* Hashing */
--
2.24.0
Dec. 13, 2019
[PATCH 2/4] ole32: Properly handle NULL delimiter for item monikers.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/ole32/itemmoniker.c | 135 +++++++++++++++++-------------
dlls/ole32/tests/moniker.c | 165 ++++++++++++++++++++++++++++++++++---
2 files changed, 230 insertions(+), 70 deletions(-)
diff --git a/dlls/ole32/itemmoniker.c b/dlls/ole32/itemmoniker.c
index 3bf1201362..2d325ff50c 100644
--- a/dlls/ole32/itemmoniker.c
+++ b/dlls/ole32/itemmoniker.c
@@ -31,6 +31,7 @@
#include "winuser.h"
#include "winnls.h"
#include "wine/debug.h"
+#include "wine/heap.h"
#include "ole2.h"
#include "moniker.h"
@@ -227,35 +228,44 @@ static HRESULT WINAPI ItemMonikerImpl_Load(IMoniker* iface,IStream* pStm)
/******************************************************************************
* ItemMoniker_Save
******************************************************************************/
-static HRESULT WINAPI ItemMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
+static HRESULT WINAPI ItemMonikerImpl_Save(IMoniker *iface, IStream *stream, BOOL fClearDirty)
{
ItemMonikerImpl *This = impl_from_IMoniker(iface);
- HRESULT res;
- CHAR *itemNameA,*itemDelimiterA;
+ int str_len;
+ HRESULT hr;
+ char *str;
+
+ TRACE("(%p, %p, %d)\n", iface, stream, fClearDirty);
/* data written by this function are : 1) DWORD : size of item delimiter string ('\0' included ) */
/* 2) String (type A): item delimiter string ('\0' included) */
/* 3) DWORD : size of item name string ('\0' included) */
/* 4) String (type A): item name string ('\0' included) */
+ if (This->itemDelimiter)
+ {
+ str_len = WideCharToMultiByte(CP_ACP, 0, This->itemDelimiter, -1, NULL, 0, NULL, NULL);
+ str = heap_alloc(str_len);
+ WideCharToMultiByte(CP_ACP, 0, This->itemDelimiter, -1, str, str_len, NULL, NULL);
- DWORD nameLength = WideCharToMultiByte( CP_ACP, 0, This->itemName, -1, NULL, 0, NULL, NULL);
- DWORD delimiterLength = WideCharToMultiByte( CP_ACP, 0, This->itemDelimiter, -1, NULL, 0, NULL, NULL);
- itemNameA=HeapAlloc(GetProcessHeap(),0,nameLength);
- itemDelimiterA=HeapAlloc(GetProcessHeap(),0,delimiterLength);
- WideCharToMultiByte( CP_ACP, 0, This->itemName, -1, itemNameA, nameLength, NULL, NULL);
- WideCharToMultiByte( CP_ACP, 0, This->itemDelimiter, -1, itemDelimiterA, delimiterLength, NULL, NULL);
-
- TRACE("%p, %s\n", pStm, fClearDirty ? "TRUE" : "FALSE");
+ hr = IStream_Write(stream, &str_len, sizeof(str_len), NULL);
+ hr = IStream_Write(stream, str, str_len, NULL);
- res=IStream_Write(pStm,&delimiterLength,sizeof(DWORD),NULL);
- res=IStream_Write(pStm,itemDelimiterA,delimiterLength * sizeof(CHAR),NULL);
- res=IStream_Write(pStm,&nameLength,sizeof(DWORD),NULL);
- res=IStream_Write(pStm,itemNameA,nameLength * sizeof(CHAR),NULL);
+ heap_free(str);
+ }
+ else
+ {
+ str_len = 0;
+ hr = IStream_Write(stream, &str_len, sizeof(str_len), NULL);
+ }
- HeapFree(GetProcessHeap(), 0, itemNameA);
- HeapFree(GetProcessHeap(), 0, itemDelimiterA);
+ str_len = WideCharToMultiByte(CP_ACP, 0, This->itemName, -1, NULL, 0, NULL, NULL);
+ str = heap_alloc(str_len);
+ WideCharToMultiByte(CP_ACP, 0, This->itemName, -1, str, str_len, NULL, NULL);
+ hr = IStream_Write(stream, &str_len, sizeof(str_len), NULL);
+ hr = IStream_Write(stream, str, str_len, NULL);
+ heap_free(str);
- return res;
+ return hr;
}
/******************************************************************************
@@ -264,7 +274,6 @@ static HRESULT WINAPI ItemMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL
static HRESULT WINAPI ItemMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
{
ItemMonikerImpl *This = impl_from_IMoniker(iface);
- DWORD delimiterLength=lstrlenW(This->itemDelimiter)+1;
DWORD nameLength=lstrlenW(This->itemName)+1;
TRACE("(%p,%p)\n",iface,pcbSize);
@@ -275,10 +284,12 @@ static HRESULT WINAPI ItemMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER
/* for more details see ItemMonikerImpl_Save comments */
pcbSize->u.LowPart = sizeof(DWORD) + /* DWORD which contains delimiter length */
- delimiterLength*4 + /* item delimiter string */
sizeof(DWORD) + /* DWORD which contains item name length */
nameLength*4 + /* item name string */
18; /* strange, but true */
+ if (This->itemDelimiter)
+ pcbSize->u.LowPart += (lstrlenW(This->itemDelimiter) + 1) * 4;
+
pcbSize->u.HighPart=0;
return S_OK;
@@ -683,6 +694,7 @@ static HRESULT WINAPI ItemMonikerImpl_GetDisplayName(IMoniker* iface,
LPOLESTR *ppszDisplayName)
{
ItemMonikerImpl *This = impl_from_IMoniker(iface);
+ SIZE_T size;
TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName);
@@ -693,12 +705,18 @@ static HRESULT WINAPI ItemMonikerImpl_GetDisplayName(IMoniker* iface,
return E_INVALIDARG;
}
- *ppszDisplayName=CoTaskMemAlloc(sizeof(WCHAR)*(lstrlenW(This->itemDelimiter)+lstrlenW(This->itemName)+1));
+ size = lstrlenW(This->itemName) + 1;
+ if (This->itemDelimiter)
+ size += lstrlenW(This->itemDelimiter);
+ size *= sizeof(WCHAR);
+ *ppszDisplayName = CoTaskMemAlloc(size);
if (*ppszDisplayName==NULL)
return E_OUTOFMEMORY;
- lstrcpyW(*ppszDisplayName,This->itemDelimiter);
+ (*ppszDisplayName)[0] = 0;
+ if (This->itemDelimiter)
+ lstrcatW(*ppszDisplayName, This->itemDelimiter);
lstrcatW(*ppszDisplayName,This->itemName);
TRACE("-- %s\n", debugstr_w(*ppszDisplayName));
@@ -806,32 +824,34 @@ static ULONG WINAPI ItemMonikerROTDataImpl_Release(IROTData* iface)
/******************************************************************************
* ItemMonikerIROTData_GetComparisonData
******************************************************************************/
-static HRESULT WINAPI ItemMonikerROTDataImpl_GetComparisonData(IROTData* iface,
- BYTE* pbData,
- ULONG cbMax,
- ULONG* pcbData)
+static HRESULT WINAPI ItemMonikerROTDataImpl_GetComparisonData(IROTData *iface, BYTE *buffer, ULONG max_len,
+ ULONG *data_len)
{
ItemMonikerImpl *This = impl_from_IROTData(iface);
- int len = (lstrlenW(This->itemName)+1);
- int i;
- LPWSTR pszItemName;
- LPWSTR pszItemDelimiter;
+ int name_len = lstrlenW(This->itemName);
+ int delim_len, i;
+ WCHAR *ptrW;
- TRACE("(%p, %u, %p)\n", pbData, cbMax, pcbData);
+ TRACE("(%p, %p, %u, %p)\n", iface, buffer, max_len, data_len);
- *pcbData = sizeof(CLSID) + sizeof(WCHAR) + len * sizeof(WCHAR);
- if (cbMax < *pcbData)
+ delim_len = This->itemDelimiter && This->itemDelimiter[0] ? lstrlenW(This->itemDelimiter) : 0;
+ *data_len = sizeof(CLSID) + sizeof(WCHAR) + (delim_len + name_len) * sizeof(WCHAR);
+ if (max_len < *data_len)
return E_OUTOFMEMORY;
/* write CLSID */
- memcpy(pbData, &CLSID_ItemMoniker, sizeof(CLSID));
+ memcpy(buffer, &CLSID_ItemMoniker, sizeof(CLSID));
+ buffer += sizeof(CLSID);
+
/* write delimiter */
- pszItemDelimiter = (LPWSTR)(pbData+sizeof(CLSID));
- *pszItemDelimiter = *This->itemDelimiter;
+ for (i = 0, ptrW = (WCHAR *)buffer; i < delim_len; ++i)
+ ptrW[i] = towupper(This->itemDelimiter[i]);
+ buffer += (delim_len * sizeof(WCHAR));
+
/* write name */
- pszItemName = pszItemDelimiter + 1;
- for (i = 0; i < len; i++)
- pszItemName[i] = towupper(This->itemName[i]);
+ for (i = 0, ptrW = (WCHAR *)buffer; i < name_len; ++i)
+ ptrW[i] = towupper(This->itemName[i]);
+ ptrW[i] = 0;
return S_OK;
}
@@ -879,38 +899,37 @@ static const IROTDataVtbl VT_ROTDataImpl =
/******************************************************************************
* ItemMoniker_Construct (local function)
*******************************************************************************/
-static HRESULT ItemMonikerImpl_Construct(ItemMonikerImpl* This, LPCOLESTR lpszDelim,LPCOLESTR lpszItem)
+static HRESULT ItemMonikerImpl_Construct(ItemMonikerImpl* This, const WCHAR *delimiter, const WCHAR *name)
{
+ int str_len;
- int sizeStr1=lstrlenW(lpszItem), sizeStr2;
- static const OLECHAR emptystr[1];
- LPCOLESTR delim;
-
- TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszDelim),debugstr_w(lpszItem));
+ TRACE("(%p, %s, %s)\n", This, debugstr_w(delimiter), debugstr_w(name));
/* Initialize the virtual function table. */
This->IMoniker_iface.lpVtbl = &VT_ItemMonikerImpl;
This->IROTData_iface.lpVtbl = &VT_ROTDataImpl;
This->ref = 0;
This->pMarshal = NULL;
+ This->itemDelimiter = NULL;
- This->itemName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr1+1));
+ str_len = (lstrlenW(name) + 1) * sizeof(WCHAR);
+ This->itemName = heap_alloc(str_len);
if (!This->itemName)
return E_OUTOFMEMORY;
- lstrcpyW(This->itemName,lpszItem);
-
- if (!lpszDelim)
- FIXME("lpszDelim is NULL. Using empty string which is possibly wrong.\n");
+ memcpy(This->itemName, name, str_len);
- delim = lpszDelim ? lpszDelim : emptystr;
-
- sizeStr2=lstrlenW(delim);
- This->itemDelimiter=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr2+1));
- if (!This->itemDelimiter) {
- HeapFree(GetProcessHeap(),0,This->itemName);
- return E_OUTOFMEMORY;
+ if (delimiter)
+ {
+ str_len = (lstrlenW(delimiter) + 1) * sizeof(WCHAR);
+ This->itemDelimiter = heap_alloc(str_len);
+ if (!This->itemDelimiter)
+ {
+ heap_free(This->itemName);
+ return E_OUTOFMEMORY;
+ }
+ memcpy(This->itemDelimiter, delimiter, str_len);
}
- lstrcpyW(This->itemDelimiter,delim);
+
return S_OK;
}
diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c
index cbffad4dfa..e04be638a6 100644
--- a/dlls/ole32/tests/moniker.c
+++ b/dlls/ole32/tests/moniker.c
@@ -1147,14 +1147,62 @@ static const BYTE expected_item_moniker_comparison_data[] =
{
0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
- 0x21,0x00,0x54,0x00,0x45,0x00,0x53,0x00,
- 0x54,0x00,0x00,0x00,
+ '!',0x00, 'T',0x00, 'E',0x00, 'S',0x00,
+ 'T',0x00,0x00,0x00,
+};
+
+static const BYTE expected_item_moniker_comparison_data2[] =
+{
+ 0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 'T',0x00, 'E',0x00, 'S',0x00, 'T',0x00,
+ 0x00,0x00,
+};
+
+static const BYTE expected_item_moniker_comparison_data4[] =
+{
+ 0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ '&',0x00, '&',0x00, 'T',0x00, 'E',0x00,
+ 'S',0x00, 'T',0x00,0x00,0x00,
+};
+
+static const BYTE expected_item_moniker_comparison_data5[] =
+{
+ 0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 'A',0x00, 'B',0x00, 'T',0x00, 'E',0x00,
+ 'S',0x00, 'T',0x00,0x00,0x00,
};
static const BYTE expected_item_moniker_saved_data[] =
{
- 0x02,0x00,0x00,0x00,0x21,0x00,0x05,0x00,
- 0x00,0x00,0x54,0x65,0x73,0x74,0x00,
+ 0x02,0x00,0x00,0x00, '!',0x00,0x05,0x00,
+ 0x00,0x00, 'T', 'e', 's', 't',0x00,
+};
+
+static const BYTE expected_item_moniker_saved_data2[] =
+{
+ 0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,
+ 'T', 'e', 's', 't',0x00,
+};
+
+static const BYTE expected_item_moniker_saved_data3[] =
+{
+ 0x01,0x00,0x00,0x00,0x00,0x05,0x00,0x00,
+ 0x00,'T', 'e', 's', 't',0x00,
+};
+
+static const BYTE expected_item_moniker_saved_data4[] =
+{
+ 0x03,0x00,0x00,0x00, '&', '&',0x00,0x05,
+ 0x00,0x00,0x00, 'T', 'e', 's', 't',0x00,
+};
+
+static const BYTE expected_item_moniker_saved_data5[] =
+{
+ 0x03,0x00,0x00,0x00, 'a', 'b',0x00,0x05,
+ 0x00,0x00,0x00, 'T', 'e', 's', 't',0x00,
};
static const BYTE expected_item_moniker_marshal_data[] =
@@ -1165,8 +1213,56 @@ static const BYTE expected_item_moniker_marshal_data[] =
0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,
- 0x02,0x00,0x00,0x00,0x21,0x00,0x05,0x00,
- 0x00,0x00,0x54,0x65,0x73,0x74,0x00,
+ 0x02,0x00,0x00,0x00, '!',0x00,0x05,0x00,
+ 0x00,0x00, 'T', 'e', 's', 't',0x00,
+};
+
+static const BYTE expected_item_moniker_marshal_data2[] =
+{
+ 0x4d,0x45,0x4f,0x57,0x04,0x00,0x00,0x00,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 0x00,0x00,0x00,0x00,0x2e,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,
+ 'T', 'e', 's', 't',0x00,
+};
+
+static const BYTE expected_item_moniker_marshal_data3[] =
+{
+ 0x4d,0x45,0x4f,0x57,0x04,0x00,0x00,0x00,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x00,
+ 0x01,0x00,0x00,0x00,0x00,0x05,0x00,0x00,
+ 0x00, 'T', 'e', 's', 't',0x00,
+};
+
+static const BYTE expected_item_moniker_marshal_data4[] =
+{
+ 0x4d,0x45,0x4f,0x57,0x04,0x00,0x00,0x00,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 0x00,0x00,0x00,0x00,0x3a,0x00,0x00,0x00,
+ 0x03,0x00,0x00,0x00, '&', '&',0x00,0x05,
+ 0x00,0x00,0x00, 'T', 'e', 's', 't',0x00,
+};
+
+static const BYTE expected_item_moniker_marshal_data5[] =
+{
+ 0x4d,0x45,0x4f,0x57,0x04,0x00,0x00,0x00,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
+ 0x00,0x00,0x00,0x00,0x3a,0x00,0x00,0x00,
+ 0x03,0x00,0x00,0x00, 'a', 'b',0x00,0x05,
+ 0x00,0x00,0x00, 'T', 'e', 's', 't',0x00,
};
static const BYTE expected_anti_moniker_marshal_data[] =
@@ -1237,11 +1333,11 @@ static const BYTE expected_gc_moniker_comparison_data[] =
0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
- 0x21,0x00,0x54,0x00,0x45,0x00,0x53,0x00,
- 0x54,0x00,0x00,0x00,0x04,0x03,0x00,0x00,
+ '!',0x00, 'T',0x00, 'E',0x00, 'S',0x00,
+ 'T',0x00,0x00,0x00,0x04,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x46,0x23,0x00,0x57,0x00,
- 0x49,0x00,0x4e,0x00,0x45,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x46, '#',0x00, 'W',0x00,
+ 'I',0x00, 'N',0x00, 'E',0x00,0x00,0x00,
};
static void test_moniker(
@@ -1274,7 +1370,8 @@ static void test_moniker(
hr = IMoniker_GetDisplayName(moniker, bindctx, NULL, &display_name);
ok_ole_success(hr, IMoniker_GetDisplayName);
- ok(!lstrcmpW(display_name, expected_display_name), "%s: display name wasn't what was expected\n", testname);
+ ok(!lstrcmpW(display_name, expected_display_name), "%s: unexpected display name %s, %s.\n", testname,
+ wine_dbgstr_w(display_name), wine_dbgstr_w(expected_display_name));
CoTaskMemFree(display_name);
IBindCtx_Release(bindctx);
@@ -1580,10 +1677,54 @@ static void test_item_moniker(void)
static const WCHAR wszObjectName[] = {'T','e','s','t',0};
static const WCHAR expected_display_name[] = { '!','T','e','s','t',0 };
+ hr = CreateItemMoniker(NULL, wszObjectName, &moniker);
+ ok(hr == S_OK, "Failed to create item moniker, hr %#x.\n", hr);
+
+ test_moniker("item moniker 2", moniker,
+ expected_item_moniker_marshal_data2, sizeof(expected_item_moniker_marshal_data2),
+ expected_item_moniker_saved_data2, sizeof(expected_item_moniker_saved_data2),
+ expected_item_moniker_comparison_data2, sizeof(expected_item_moniker_comparison_data2),
+ L"Test");
+
+ IMoniker_Release(moniker);
+
+ hr = CreateItemMoniker(L"", wszObjectName, &moniker);
+ ok(hr == S_OK, "Failed to create item moniker, hr %#x.\n", hr);
+
+ test_moniker("item moniker 3", moniker,
+ expected_item_moniker_marshal_data3, sizeof(expected_item_moniker_marshal_data3),
+ expected_item_moniker_saved_data3, sizeof(expected_item_moniker_saved_data3),
+ expected_item_moniker_comparison_data2, sizeof(expected_item_moniker_comparison_data2),
+ L"Test");
+
+ IMoniker_Release(moniker);
+
+ hr = CreateItemMoniker(L"&&", wszObjectName, &moniker);
+ ok(hr == S_OK, "Failed to create item moniker, hr %#x.\n", hr);
+
+ test_moniker("item moniker 4", moniker,
+ expected_item_moniker_marshal_data4, sizeof(expected_item_moniker_marshal_data4),
+ expected_item_moniker_saved_data4, sizeof(expected_item_moniker_saved_data4),
+ expected_item_moniker_comparison_data4, sizeof(expected_item_moniker_comparison_data4),
+ L"&&Test");
+
+ IMoniker_Release(moniker);
+
+ hr = CreateItemMoniker(L"ab", wszObjectName, &moniker);
+ ok(hr == S_OK, "Failed to create item moniker, hr %#x.\n", hr);
+
+ test_moniker("item moniker 5", moniker,
+ expected_item_moniker_marshal_data5, sizeof(expected_item_moniker_marshal_data5),
+ expected_item_moniker_saved_data5, sizeof(expected_item_moniker_saved_data5),
+ expected_item_moniker_comparison_data5, sizeof(expected_item_moniker_comparison_data5),
+ L"abTest");
+
+ IMoniker_Release(moniker);
+
hr = CreateItemMoniker(wszDelimiter, wszObjectName, &moniker);
ok_ole_success(hr, CreateItemMoniker);
- test_moniker("item moniker", moniker,
+ test_moniker("item moniker 1", moniker,
expected_item_moniker_marshal_data, sizeof(expected_item_moniker_marshal_data),
expected_item_moniker_saved_data, sizeof(expected_item_moniker_saved_data),
expected_item_moniker_comparison_data, sizeof(expected_item_moniker_comparison_data),
--
2.24.0
Dec. 13, 2019
[PATCH 1/4] ole32: Use more appropriate type for codepage arguments.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/ole32/stg_prop.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index 84eaa2aac4..8421353155 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -130,7 +130,7 @@ static void PropertyStorage_DestroyDictionaries(PropertyStorage_impl *);
* string using PropertyStorage_StringCopy.
*/
static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
- const PROPVARIANT *propvar, LCID targetCP, LCID srcCP);
+ const PROPVARIANT *propvar, UINT targetCP, UINT srcCP);
/* Copies the string src, which is encoded using code page srcCP, and returns
* it in *dst, in the code page specified by targetCP. The returned string is
@@ -139,8 +139,8 @@ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
* is CP_UNICODE, the returned string is in fact an LPWSTR.
* Returns S_OK on success, something else on failure.
*/
-static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst,
- LCID targetCP);
+static HRESULT PropertyStorage_StringCopy(LPCSTR src, UINT srcCP, LPSTR *dst,
+ UINT targetCP);
static const IPropertyStorageVtbl IPropertyStorage_Vtbl;
@@ -533,8 +533,7 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple(
return hr;
}
-static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst,
- LCID dstCP)
+static HRESULT PropertyStorage_StringCopy(LPCSTR src, UINT srcCP, LPSTR *dst, UINT dstCP)
{
HRESULT hr = S_OK;
int len;
@@ -617,8 +616,8 @@ static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst,
return hr;
}
-static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
- const PROPVARIANT *propvar, LCID targetCP, LCID srcCP)
+static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop, const PROPVARIANT *propvar,
+ UINT targetCP, UINT srcCP)
{
HRESULT hr = S_OK;
@@ -644,7 +643,7 @@ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
* a version 1-only property.
*/
static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This,
- PROPID propid, const PROPVARIANT *propvar, LCID lcid)
+ PROPID propid, const PROPVARIANT *propvar, UINT cp)
{
HRESULT hr = S_OK;
PROPVARIANT *prop = PropertyStorage_FindProperty(This, propid);
@@ -665,8 +664,7 @@ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This,
if (prop)
{
PropVariantClear(prop);
- hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage,
- lcid);
+ hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage, cp);
}
else
{
@@ -674,8 +672,7 @@ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This,
sizeof(PROPVARIANT));
if (prop)
{
- hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage,
- lcid);
+ hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage, cp);
if (SUCCEEDED(hr))
{
dictionary_insert(This->propid_to_prop, UlongToPtr(propid), prop);
@@ -699,7 +696,7 @@ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This,
* Doesn't validate id.
*/
static HRESULT PropertyStorage_StoreNameWithId(PropertyStorage_impl *This,
- LPCSTR srcName, LCID cp, PROPID id)
+ LPCSTR srcName, UINT cp, PROPID id)
{
LPSTR name;
HRESULT hr;
--
2.24.0
Dec. 13, 2019
Re: [PATCH 5/7] ddraw/tests: Avoid reference leaks in render-target tests.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62120
Your paranoid android.
=== w8 (32 bit report) ===
ddraw:
0cfc:ddraw2: unhandled exception c0000005 at 69DF3599
=== w8 (32 bit report) ===
ddraw:
ddraw4.c:3500: Test failed: Got unexpected hr 0x887601c2.
Dec. 13, 2019
Re: [PATCH 4/7] ddraw/tests: Use flags to indicate broken render-target tests.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62119
Your paranoid android.
=== w1064v1507 (32 bit report) ===
ddraw:
0c9c:ddraw2: unhandled exception c0000005 at 730B7F2E
=== w1064v1809 (32 bit report) ===
ddraw:
ddraw4.c:15936: Test failed: WM_KILLFOCUS was not received.
ddraw4.c:16113: Test failed: Got unexpected hr 0x887600e1.
ddraw4.c:16116: Test failed: Got unexpected hr 0x887600ff.
1984:ddraw4: unhandled exception c0000005 at 00489FAF
=== w864 (64 bit report) ===
ddraw:
ddraw7.c:3135: Test failed: Failed to create surface, hr 0x887601c2.
0c20:ddraw7: unhandled exception c0000005 at 00000000004EC418
Dec. 13, 2019
[PATCH] wine.inf: add powershell location to the path (resend)
by Louis Lenders
(now with signed-off header)
On win7 the location of powershell is present in the path (could not check on other versions)
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com>
---
loader/wine.inf.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index d324461c6e..d62fd5065b 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -624,7 +624,7 @@ HKLM,%Control%\Session Manager,HeapDeCommitTotalFreeThreshold,0x00040002,0
HKLM,%Control%\Session Manager,HeapSegmentCommit,0x00040002,0
HKLM,%Control%\Session Manager,HeapSegmentReserve,0x00040002,0
HKLM,%Control%\Session Manager\Environment,"ComSpec",0x00020000,"%11%\cmd.exe"
-HKLM,%Control%\Session Manager\Environment,"PATH",0x00020002,"%11%;%10%;%11%\wbem"
+HKLM,%Control%\Session Manager\Environment,"PATH",0x00020002,"%11%;%10%;%11%\wbem;%11%\WindowsPowershell\v1.0"
HKLM,%Control%\Session Manager\Environment,"PATHEXT",,".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH"
HKLM,%Control%\Session Manager\Environment,"SystemDrive",2,"c:"
HKLM,%Control%\Session Manager\Environment,"SYSTEMROOT",,"%10%"
--
2.24.0
Dec. 13, 2019
Re: [PATCH 3/7] ddraw/tests: Pass in device to check for in render-target testing.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62118
Your paranoid android.
=== w864 (64 bit report) ===
ddraw:
ddraw1.c:3178: Test failed: Failed to create surface, hr 0x887601c2.
0c50:ddraw1: unhandled exception c0000005 at 000000000043A15A
Dec. 13, 2019
Re: [PATCH 2/7] ddraw/tests: Pass in device to create with create_device.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62117
Your paranoid android.
=== w2008s64 (32 bit report) ===
ddraw:
ddraw1.c:2827: Test failed: Expected message 0x46, but didn't receive it.
ddraw1.c:2830: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768).
ddraw1.c:2834: Test failed: Got unexpected screen size 1024x768.
=== w8 (32 bit report) ===
ddraw:
ddraw2.c:3262: Test failed: Got unexpected hr 0x887601c2.
=== w864 (64 bit report) ===
ddraw:
ddraw2.c:3244: Test failed: Failed to create surface, hr 0x887601c2.
0e8c:ddraw2: unhandled exception c0000005 at 000000000046E7CA
Dec. 13, 2019
[PATCH v3 3/3] msado15: Prevent Multiple Open/Close of a _Recordset.
by Alistair Leslie-Hughes
Currently closing twice or Close/Release would cause a crash.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 15 +++++++++++----
dlls/msado15/tests/msado15.c | 3 +++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index 9bf6b60df1..0dc8a496c0 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -664,9 +664,12 @@ static void close_recordset( struct recordset *recordset )
{
ULONG row, col, col_count = get_column_count( recordset );
- recordset->fields->recordset = NULL;
- Fields_Release( &recordset->fields->Fields_iface );
- recordset->fields = NULL;
+ if (recordset->fields)
+ {
+ recordset->fields->recordset = NULL;
+ Fields_Release( &recordset->fields->Fields_iface );
+ recordset->fields = NULL;
+ }
for (row = 0; row < recordset->count; row++)
for (col = 0; col < col_count; col++) VariantClear( &recordset->data[row * col_count + col] );
@@ -674,6 +677,7 @@ static void close_recordset( struct recordset *recordset )
recordset->count = recordset->allocated = recordset->index = 0;
heap_free( recordset->data );
recordset->data = NULL;
+ recordset->state = adStateClosed;
}
static ULONG WINAPI recordset_Release( _Recordset *iface )
@@ -916,8 +920,9 @@ static HRESULT WINAPI recordset_Close( _Recordset *iface )
TRACE( "%p\n", recordset );
+ if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
+
close_recordset( recordset );
- recordset->state = adStateClosed;
return S_OK;
}
@@ -971,6 +976,8 @@ static HRESULT WINAPI recordset_Open( _Recordset *iface, VARIANT source, VARIANT
FIXME( "%p, %s, %s, %d, %d, %d\n", recordset, debugstr_variant(&source), debugstr_variant(&active_connection),
cursor_type, lock_type, options );
+ if (recordset->state == adStateOpen) return MAKE_ADO_HRESULT( adErrObjectOpen );
+
recordset->state = adStateOpen;
return S_OK;
}
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 1fae811d10..b80600a676 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -96,6 +96,9 @@ static void test_Recordset(void)
ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
ISupportErrorInfo_Release(errorinfo);
+ hr = _Recordset_Close( recordset );
+ ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
+
refs = _Recordset_Release( recordset );
ok( !refs, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
[PATCH v3 2/3] msado15: Add ISupportErrorInfo support to _Recordset.
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 61 +++++++++++++++++++++++++++++++-----
dlls/msado15/tests/msado15.c | 5 +++
2 files changed, 58 insertions(+), 8 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index 4b61b552f0..9bf6b60df1 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -34,14 +34,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msado15);
struct fields;
struct recordset
{
- _Recordset Recordset_iface;
- LONG refs;
- LONG state;
- struct fields *fields;
- LONG count;
- LONG allocated;
- LONG index;
- VARIANT *data;
+ _Recordset Recordset_iface;
+ ISupportErrorInfo ISupportErrorInfo_iface;
+ LONG refs;
+ LONG state;
+ struct fields *fields;
+ LONG count;
+ LONG allocated;
+ LONG index;
+ VARIANT *data;
};
struct fields
@@ -646,6 +647,11 @@ static inline struct recordset *impl_from_Recordset( _Recordset *iface )
return CONTAINING_RECORD( iface, struct recordset, Recordset_iface );
}
+static inline struct recordset *impl_from_ISupportErrorInfo( ISupportErrorInfo *iface )
+{
+ return CONTAINING_RECORD( iface, struct recordset, ISupportErrorInfo_iface );
+}
+
static ULONG WINAPI recordset_AddRef( _Recordset *iface )
{
struct recordset *recordset = impl_from_Recordset( iface );
@@ -686,6 +692,7 @@ static ULONG WINAPI recordset_Release( _Recordset *iface )
static HRESULT WINAPI recordset_QueryInterface( _Recordset *iface, REFIID riid, void **obj )
{
+ struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %s, %p\n", iface, debugstr_guid(riid), obj );
if (IsEqualIID(riid, &IID_IUnknown) ||
@@ -698,6 +705,10 @@ static HRESULT WINAPI recordset_QueryInterface( _Recordset *iface, REFIID riid,
{
*obj = iface;
}
+ else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
+ {
+ *obj = &recordset->ISupportErrorInfo_iface;
+ }
else
{
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
@@ -1235,6 +1246,39 @@ static HRESULT WINAPI recordset_Save( _Recordset *iface, VARIANT destination, Pe
return E_NOTIMPL;
}
+static HRESULT WINAPI supporterror_QueryInterface( ISupportErrorInfo *iface, REFIID riid, void **obj )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_QueryInterface( &recordset->Recordset_iface, riid, obj );
+}
+
+static ULONG WINAPI supporterror_AddRef( ISupportErrorInfo *iface )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_AddRef( &recordset->Recordset_iface );
+}
+
+static ULONG WINAPI supporterror_Release( ISupportErrorInfo *iface )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_Release( &recordset->Recordset_iface );
+}
+
+static HRESULT WINAPI supporterror_InterfaceSupportsErrorInfo( ISupportErrorInfo *iface, REFIID riid )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ FIXME( "%p, %s\n", recordset, debugstr_guid(riid) );
+ return S_FALSE;
+}
+
+static const struct ISupportErrorInfoVtbl support_error_vtbl =
+{
+ supporterror_QueryInterface,
+ supporterror_AddRef,
+ supporterror_Release,
+ supporterror_InterfaceSupportsErrorInfo
+};
+
static const struct _RecordsetVtbl recordset_vtbl =
{
recordset_QueryInterface,
@@ -1330,6 +1374,7 @@ HRESULT Recordset_create( void **obj )
if (!(recordset = heap_alloc_zero( sizeof(*recordset) ))) return E_OUTOFMEMORY;
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
+ recordset->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl;
recordset->refs = 1;
recordset->index = -1;
recordset->state = adStateClosed;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index d6bb50f44e..1fae811d10 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -46,6 +46,7 @@ static LONG get_refs_recordset( _Recordset *recordset )
static void test_Recordset(void)
{
_Recordset *recordset;
+ ISupportErrorInfo *errorinfo;
Fields *fields, *fields2;
LONG refs, count, state;
HRESULT hr;
@@ -91,6 +92,10 @@ static void test_Recordset(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( !count, "got %d\n", count );
+ hr = _Recordset_QueryInterface(recordset, &IID_ISupportErrorInfo, (void**)&errorinfo);
+ ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
+ ISupportErrorInfo_Release(errorinfo);
+
refs = _Recordset_Release( recordset );
ok( !refs, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
[PATCH v3 1/3] msado15: Implement _Recordset get_State
by Alistair Leslie-Hughes
Please Ignore the last patchset, the _Open wasn't meant to be sent.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 7 +++++--
dlls/msado15/tests/msado15.c | 7 ++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index e854b3e824..4b61b552f0 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -1050,8 +1050,10 @@ static HRESULT WINAPI recordset_get_Status( _Recordset *iface, LONG *status )
static HRESULT WINAPI recordset_get_State( _Recordset *iface, LONG *state )
{
- FIXME( "%p, %p\n", iface, state );
- return E_NOTIMPL;
+ struct recordset *recordset = impl_from_Recordset( iface );
+ TRACE( "%p, %p\n", recordset, state );
+ *state = recordset->state;
+ return S_OK;
}
static HRESULT WINAPI recordset__xClone( _Recordset *iface, _Recordset **obj )
@@ -1330,6 +1332,7 @@ HRESULT Recordset_create( void **obj )
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
recordset->refs = 1;
recordset->index = -1;
+ recordset->state = adStateClosed;
*obj = &recordset->Recordset_iface;
TRACE( "returning iface %p\n", *obj );
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index f9a5377c50..d6bb50f44e 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -47,12 +47,17 @@ static void test_Recordset(void)
{
_Recordset *recordset;
Fields *fields, *fields2;
- LONG refs, count;
+ LONG refs, count, state;
HRESULT hr;
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
ok( hr == S_OK, "got %08x\n", hr );
+ state = -1;
+ hr = _Recordset_get_State( recordset, &state );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( state == adStateClosed, "got %d\n", state );
+
/* handing out fields object increases recordset refcount */
refs = get_refs_recordset( recordset );
ok( refs == 1, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
[PATCH 7/7] ddraw: Add Ramp device as possible return from surface QI.
by Jeff Smith
Signed-off-by: Jeff Smith <whydoubt(a)gmail.com>
---
dlls/ddraw/surface.c | 3 ++-
dlls/ddraw/tests/ddraw1.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index fda42f2982..0fe5a7c48c 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -216,7 +216,8 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
{
if (IsEqualGUID(riid, &IID_D3DDEVICE_WineD3D)
|| IsEqualGUID(riid, &IID_IDirect3DHALDevice)
- || IsEqualGUID(riid, &IID_IDirect3DRGBDevice))
+ || IsEqualGUID(riid, &IID_IDirect3DRGBDevice)
+ || (IsEqualGUID(riid, &IID_IDirect3DRampDevice) && This->version < 3))
{
wined3d_mutex_lock();
if (!This->device1)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index fbf6e4d9d9..3b148a96e7 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -4149,6 +4149,7 @@ static void test_rt_caps(void)
{
test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL", TRUE);
test_rt_caps_riid(&IID_IDirect3DRGBDevice, "RGB", FALSE);
+ test_rt_caps_riid(&IID_IDirect3DRampDevice, "Ramp", FALSE);
}
static void test_primary_caps(void)
--
2.23.0
Dec. 13, 2019
[PATCH 6/7] ddraw/tests: Consider multiple devices in render-target tests.
by Jeff Smith
Adds testing of devices besides HAL and TnLHal to render-target tests.
Depending on the version of ddraw, this may include RGB, Ramp, or MMX.
Signed-off-by: Jeff Smith <whydoubt(a)gmail.com>
---
dlls/ddraw/tests/ddraw1.c | 31 ++++++++++++++++++-------
dlls/ddraw/tests/ddraw2.c | 45 ++++++++++++++++++++++++++----------
dlls/ddraw/tests/ddraw4.c | 48 +++++++++++++++++++++++++++------------
dlls/ddraw/tests/ddraw7.c | 48 ++++++++++++++++++++++++++++-----------
4 files changed, 125 insertions(+), 47 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 8407290259..fbf6e4d9d9 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -3884,7 +3884,7 @@ static void test_unsupported_formats(void)
DestroyWindow(window);
}
-static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
+static void test_rt_caps_riid(REFCLSID riid, const char *device_name, BOOL is_hal)
{
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
@@ -3918,18 +3918,21 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
+ TRUE
},
{
NULL,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
+ FALSE, TRUE
},
{
NULL,
DDSCAPS_OFFSCREENPLAIN,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
NULL,
@@ -3948,18 +3951,21 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY,
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
+ TRUE
},
{
NULL,
DDSCAPS_3DDEVICE,
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
+ FALSE, TRUE
},
{
NULL,
0,
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
NULL,
@@ -3978,6 +3984,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
0,
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
+ TRUE
},
{
&p8_fmt,
@@ -3991,6 +3998,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
&p8_fmt,
@@ -4064,6 +4072,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
IDirectDrawSurface *surface;
DDSURFACEDESC surface_desc;
IDirect3DDevice *device;
+ HRESULT expected_hr;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
@@ -4096,19 +4105,24 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
"Test %s %u: Got unexpected caps %#x, expected %#x.\n",
device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
+ expected_hr = test_data[i].create_device_hr;
+ if (expected_hr == D3DERR_SURFACENOTINVIDMEM && !is_hal)
+ expected_hr = D3D_OK;
hr = IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device);
- ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
- device_name, i, hr, test_data[i].create_device_hr);
+ todo_wine_if(test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM && !is_hal)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
if (hr == DDERR_NOPALETTEATTACHED)
{
+ expected_hr = (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) ? DDERR_INVALIDPIXELFORMAT :
+ is_hal ? D3DERR_SURFACENOTINVIDMEM : D3D_OK;
hr = IDirectDrawSurface_SetPalette(surface, palette);
ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
refcount = IDirectDrawPalette_AddRef(palette) - 1;
hr = IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device);
- if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ todo_wine_if(!is_hal)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
/* If QueryInterface is successful, it adds multiple references to palette,
* none of which are released by IDirect3DDevice_Release. */
while (IDirectDrawPalette_Release(palette) > refcount) ;
@@ -4133,7 +4147,8 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
static void test_rt_caps(void)
{
- test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL");
+ test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL", TRUE);
+ test_rt_caps_riid(&IID_IDirect3DRGBDevice, "RGB", FALSE);
}
static void test_primary_caps(void)
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 0fc8e1859e..28f0c5f994 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -4303,7 +4303,7 @@ static void test_unsupported_formats(void)
DestroyWindow(window);
}
-static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
+static void test_rt_caps_riid(REFCLSID riid, const char *device_name, BOOL is_hal)
{
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
@@ -4340,6 +4340,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ TRUE
},
{
NULL,
@@ -4347,6 +4348,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ FALSE, TRUE
},
{
NULL,
@@ -4354,6 +4356,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
NULL,
@@ -4375,6 +4378,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ TRUE
},
{
NULL,
@@ -4382,6 +4386,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ FALSE, TRUE
},
{
NULL,
@@ -4389,6 +4394,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
NULL,
@@ -4410,13 +4416,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ TRUE
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY,
DDERR_NOPALETTEATTACHED,
- DDERR_INVALIDCAPS,
+ DDERR_NOPALETTEATTACHED,
FALSE, TRUE /* AMD r200 */
},
{
@@ -4425,13 +4432,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDERR_NOPALETTEATTACHED,
- DDERR_INVALIDCAPS,
+ DDERR_NOPALETTEATTACHED,
},
{
&p8_fmt,
@@ -4511,6 +4519,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
IDirectDrawSurface *surface, *rt, *expected_rt, *tmp;
DDSURFACEDESC surface_desc;
IDirect3DDevice2 *device;
+ HRESULT expected_hr;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
@@ -4543,19 +4552,24 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
"Test %s %u: Got unexpected caps %#x, expected %#x.\n",
device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
+ expected_hr = test_data[i].create_device_hr;
+ if (expected_hr == D3DERR_SURFACENOTINVIDMEM && !is_hal)
+ expected_hr = D3D_OK;
hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device);
- ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
- device_name, i, hr, test_data[i].create_device_hr);
+ todo_wine_if(test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM && !is_hal)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
if (hr == DDERR_NOPALETTEATTACHED)
{
+ expected_hr = (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) ? DDERR_INVALIDPIXELFORMAT :
+ is_hal ? D3DERR_SURFACENOTINVIDMEM : D3D_OK;
hr = IDirectDrawSurface_SetPalette(surface, palette);
ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
refcount = IDirectDrawPalette_AddRef(palette);
hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device);
- if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ todo_wine_if(!is_hal)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
/* If CreateDevice is successful, it adds multiple references to palette,
* only one of which is released by IDirect3DDevice2_Release. */
if (FAILED(hr)) refcount--;
@@ -4598,9 +4612,13 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
device_name, i, test_data[i].caps_in, hr);
+ expected_hr = test_data[i].set_rt_hr;
+ if (expected_hr == DDERR_NOPALETTEATTACHED && is_hal)
+ expected_hr = DDERR_INVALIDCAPS;
hr = IDirect3DDevice2_SetRenderTarget(device, rt, 0);
- ok(hr == test_data[i].set_rt_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
- device_name, i, hr, test_data[i].set_rt_hr);
+ todo_wine_if(expected_hr == DDERR_NOPALETTEATTACHED)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
expected_rt = rt;
else
@@ -4640,7 +4658,10 @@ done:
static void test_rt_caps(void)
{
- test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL");
+ test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL", TRUE);
+ test_rt_caps_riid(&IID_IDirect3DMMXDevice, "MMX", FALSE);
+ test_rt_caps_riid(&IID_IDirect3DRGBDevice, "RGB", FALSE);
+ test_rt_caps_riid(&IID_IDirect3DRampDevice, "Ramp", FALSE);
}
static void test_primary_caps(void)
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 2df735abea..3c1e96dbb4 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -5921,7 +5921,7 @@ static void test_unsupported_formats(void)
DestroyWindow(window);
}
-static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
+static void test_rt_caps_riid(REFCLSID riid, const char *device_name, BOOL is_hal)
{
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
@@ -5958,6 +5958,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ TRUE
},
{
NULL,
@@ -5965,6 +5966,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ FALSE, TRUE
},
{
NULL,
@@ -5972,6 +5974,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
NULL,
@@ -5993,6 +5996,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ TRUE
},
{
NULL,
@@ -6000,6 +6004,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ FALSE, TRUE
},
{
NULL,
@@ -6007,6 +6012,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
NULL,
@@ -6028,13 +6034,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ TRUE
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY,
DDERR_NOPALETTEATTACHED,
- DDERR_INVALIDCAPS,
+ DDERR_NOPALETTEATTACHED,
FALSE, TRUE /* AMD r200 */
},
{
@@ -6043,13 +6050,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDERR_NOPALETTEATTACHED,
- DDERR_INVALIDCAPS,
+ DDERR_NOPALETTEATTACHED,
},
{
&p8_fmt,
@@ -6064,7 +6072,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- FALSE, FALSE, TRUE
+ TRUE, FALSE, TRUE
},
{
&z_fmt,
@@ -6072,7 +6080,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- FALSE, FALSE, TRUE
+ FALSE, TRUE, TRUE
},
{
&z_fmt,
@@ -6080,6 +6088,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
&z_fmt,
@@ -6128,6 +6137,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
IDirectDrawSurface4 *surface, *rt, *expected_rt, *tmp;
DDSURFACEDESC2 surface_desc;
IDirect3DDevice3 *device;
+ HRESULT expected_hr;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
@@ -6155,19 +6165,24 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
"Test %s %u: Got unexpected caps %#x, expected %#x.\n",
device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
+ expected_hr = test_data[i].create_device_hr;
+ if (expected_hr == D3DERR_SURFACENOTINVIDMEM && !is_hal)
+ expected_hr = D3D_OK;
hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL);
- ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
- device_name, i, hr, test_data[i].create_device_hr);
+ todo_wine_if(test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM && !is_hal)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
if (hr == DDERR_NOPALETTEATTACHED)
{
+ expected_hr = (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) ? DDERR_INVALIDPIXELFORMAT :
+ is_hal ? D3DERR_SURFACENOTINVIDMEM : D3D_OK;
hr = IDirectDrawSurface4_SetPalette(surface, palette);
ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
refcount = IDirectDrawPalette_AddRef(palette);
hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL);
- if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ todo_wine_if(!is_hal)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
/* If CreateDevice is successful, it adds multiple references to palette,
* only one of which is released by IDirect3DDevice3_Release. */
if (FAILED(hr)) refcount--;
@@ -6205,11 +6220,15 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
device_name, i, test_data[i].caps_in, hr);
+ expected_hr = test_data[i].set_rt_hr;
+ if (expected_hr == DDERR_NOPALETTEATTACHED && is_hal)
+ expected_hr = DDERR_INVALIDCAPS;
hr = IDirect3DDevice3_SetRenderTarget(device, rt, 0);
- ok(hr == test_data[i].set_rt_hr || broken(
+ todo_wine_if(expected_hr == DDERR_NOPALETTEATTACHED)
+ ok(hr == expected_hr || broken(
test_data[i].broken_set_target_ok && hr == D3D_OK),
"Test %s %u: Got unexpected hr %#x, expected %#x.\n",
- device_name, i, hr, test_data[i].set_rt_hr);
+ device_name, i, hr, expected_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
expected_rt = rt;
else
@@ -6241,7 +6260,8 @@ done:
static void test_rt_caps(void)
{
- test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL");
+ test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL", TRUE);
+ test_rt_caps_riid(&IID_IDirect3DRGBDevice, "RGB", FALSE);
}
static void test_primary_caps(void)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 7a073296ca..6aed30bfe6 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -5657,7 +5657,7 @@ static void test_unsupported_formats(void)
DestroyWindow(window);
}
-static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
+static void test_rt_caps_riid(REFCLSID riid, const char *device_name, BOOL is_hal)
{
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
@@ -5696,6 +5696,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ TRUE
},
{
NULL,
@@ -5703,6 +5704,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ FALSE, TRUE
},
{
NULL,
@@ -5710,6 +5712,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
NULL,
@@ -5732,6 +5735,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ TRUE
},
{
NULL,
@@ -5739,6 +5743,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
+ FALSE, TRUE
},
{
NULL,
@@ -5746,6 +5751,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
NULL,
@@ -5768,13 +5774,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ TRUE
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY,
DDERR_NOPALETTEATTACHED,
- DDERR_INVALIDCAPS,
+ DDERR_NOPALETTEATTACHED,
FALSE, TRUE /* AMD r200 */
},
{
@@ -5783,13 +5790,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDERR_NOPALETTEATTACHED,
- DDERR_INVALIDCAPS,
+ DDERR_NOPALETTEATTACHED,
},
{
&p8_fmt,
@@ -5804,6 +5812,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
+ TRUE
},
{
&z_fmt,
@@ -5811,6 +5820,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
+ FALSE, TRUE
},
{
&z_fmt,
@@ -5818,6 +5828,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
+ FALSE, TRUE
},
{
&z_fmt,
@@ -5875,6 +5886,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
IDirectDrawSurface7 *surface, *rt, *expected_rt, *tmp;
DDSURFACEDESC2 surface_desc;
IDirect3DDevice7 *device;
+ HRESULT expected_hr;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
@@ -5902,18 +5914,23 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
"Test %s %u: Got unexpected caps %#x, expected %#x.\n",
device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
+ expected_hr = test_data[i].create_device_hr;
+ if (expected_hr == D3DERR_SURFACENOTINVIDMEM && !is_hal)
+ expected_hr = D3D_OK;
hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device);
- ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
- device_name, i, hr, test_data[i].create_device_hr);
+ todo_wine_if(test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM && !is_hal)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
if (hr == DDERR_NOPALETTEATTACHED)
{
+ expected_hr = (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) ? DDERR_INVALIDPIXELFORMAT :
+ is_hal ? D3DERR_SURFACENOTINVIDMEM : E_FAIL;
hr = IDirectDrawSurface7_SetPalette(surface, palette);
ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device);
- if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ todo_wine_if(!is_hal)
+ ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, expected_hr);
}
if (FAILED(hr))
{
@@ -5947,12 +5964,16 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
device_name, i, test_data[i].caps_in, hr);
+ expected_hr = test_data[i].set_rt_hr;
+ if (expected_hr == DDERR_NOPALETTEATTACHED && is_hal)
+ expected_hr = DDERR_INVALIDCAPS;
hr = IDirect3DDevice7_SetRenderTarget(device, rt, 0);
- ok(hr == test_data[i].set_rt_hr || broken(
+ todo_wine_if(expected_hr == DDERR_NOPALETTEATTACHED)
+ ok(hr == expected_hr || broken(
(test_data[i].broken_set_target_ok && hr == D3D_OK) ||
(test_data[i].broken_set_target_ivpf && hr == DDERR_INVALIDPIXELFORMAT)),
"Test %s %u: Got unexpected hr %#x, expected %#x.\n",
- device_name, i, hr, test_data[i].set_rt_hr);
+ device_name, i, hr, expected_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
expected_rt = rt;
else
@@ -5984,8 +6005,9 @@ done:
static void test_rt_caps(void)
{
- test_rt_caps_riid(&IID_IDirect3DTnLHalDevice, "TnLHal");
- test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL");
+ test_rt_caps_riid(&IID_IDirect3DTnLHalDevice, "TnLHal", TRUE);
+ test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL", TRUE);
+ test_rt_caps_riid(&IID_IDirect3DRGBDevice, "RGB", FALSE);
}
static void test_primary_caps(void)
--
2.23.0
Dec. 13, 2019
[PATCH 5/7] ddraw/tests: Avoid reference leaks in render-target tests.
by Jeff Smith
Signed-off-by: Jeff Smith <whydoubt(a)gmail.com>
---
dlls/ddraw/tests/ddraw1.c | 7 ++++++-
dlls/ddraw/tests/ddraw2.c | 28 +++++++++++++++++-----------
dlls/ddraw/tests/ddraw4.c | 28 +++++++++++++++++-----------
dlls/ddraw/tests/ddraw7.c | 23 ++++++++++++-----------
4 files changed, 52 insertions(+), 34 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 66b84edf45..8407290259 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -4103,11 +4103,15 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
{
hr = IDirectDrawSurface_SetPalette(surface, palette);
ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
+ refcount = IDirectDrawPalette_AddRef(palette) - 1;
hr = IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device);
if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
else
ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ /* If QueryInterface is successful, it adds multiple references to palette,
+ * none of which are released by IDirect3DDevice_Release. */
+ while (IDirectDrawPalette_Release(palette) > refcount) ;
}
if (SUCCEEDED(hr))
{
@@ -4120,7 +4124,8 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
device_name, i, refcount);
}
- IDirectDrawPalette_Release(palette);
+ refcount = IDirectDrawPalette_Release(palette);
+ ok(refcount == 0, "The palette object was not properly freed, refcount %u.\n", refcount);
refcount = IDirectDraw_Release(ddraw);
ok(refcount == 0, "The ddraw object was not properly freed, refcount %u.\n", refcount);
DestroyWindow(window);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 2bd56b7afd..0fc8e1859e 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -4546,18 +4546,23 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device);
ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
device_name, i, hr, test_data[i].create_device_hr);
+ if (hr == DDERR_NOPALETTEATTACHED)
+ {
+ hr = IDirectDrawSurface_SetPalette(surface, palette);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
+ refcount = IDirectDrawPalette_AddRef(palette);
+ hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device);
+ if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
+ ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ else
+ ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ /* If CreateDevice is successful, it adds multiple references to palette,
+ * only one of which is released by IDirect3DDevice2_Release. */
+ if (FAILED(hr)) refcount--;
+ while (IDirectDrawPalette_Release(palette) > refcount) ;
+ }
if (FAILED(hr))
{
- if (hr == DDERR_NOPALETTEATTACHED)
- {
- hr = IDirectDrawSurface_SetPalette(surface, palette);
- ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device);
- if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- }
IDirectDrawSurface_Release(surface);
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -4623,7 +4628,8 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
device_name, i, refcount);
}
- IDirectDrawPalette_Release(palette);
+ refcount = IDirectDrawPalette_Release(palette);
+ ok(refcount == 0, "The palette object was not properly freed, refcount %u.\n", refcount);
IDirect3D2_Release(d3d);
done:
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 0ab8c74dab..2df735abea 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -6158,18 +6158,23 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL);
ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
device_name, i, hr, test_data[i].create_device_hr);
+ if (hr == DDERR_NOPALETTEATTACHED)
+ {
+ hr = IDirectDrawSurface4_SetPalette(surface, palette);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
+ refcount = IDirectDrawPalette_AddRef(palette);
+ hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL);
+ if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
+ ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ else
+ ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ /* If CreateDevice is successful, it adds multiple references to palette,
+ * only one of which is released by IDirect3DDevice3_Release. */
+ if (FAILED(hr)) refcount--;
+ while (IDirectDrawPalette_Release(palette) > refcount) ;
+ }
if (FAILED(hr))
{
- if (hr == DDERR_NOPALETTEATTACHED)
- {
- hr = IDirectDrawSurface4_SetPalette(surface, palette);
- ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL);
- if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- }
IDirectDrawSurface4_Release(surface);
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -6224,7 +6229,8 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
device_name, i, refcount);
}
- IDirectDrawPalette_Release(palette);
+ refcount = IDirectDrawPalette_Release(palette);
+ ok(refcount == 0, "The palette object was not properly freed, refcount %u.\n", refcount);
IDirect3D3_Release(d3d);
done:
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index f2552ad491..7a073296ca 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -5905,18 +5905,18 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device);
ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
device_name, i, hr, test_data[i].create_device_hr);
+ if (hr == DDERR_NOPALETTEATTACHED)
+ {
+ hr = IDirectDrawSurface7_SetPalette(surface, palette);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
+ hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device);
+ if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
+ ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ else
+ ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
+ }
if (FAILED(hr))
{
- if (hr == DDERR_NOPALETTEATTACHED)
- {
- hr = IDirectDrawSurface7_SetPalette(surface, palette);
- ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device);
- if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
- }
IDirectDrawSurface7_Release(surface);
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -5972,7 +5972,8 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
device_name, i, refcount);
}
- IDirectDrawPalette_Release(palette);
+ refcount = IDirectDrawPalette_Release(palette);
+ ok(refcount == 0, "The palette object was not properly freed, refcount %u.\n", refcount);
IDirect3D7_Release(d3d);
done:
--
2.23.0
Dec. 13, 2019
[PATCH 4/7] ddraw/tests: Use flags to indicate broken render-target tests.
by Jeff Smith
Signed-off-by: Jeff Smith <whydoubt(a)gmail.com>
---
dlls/ddraw/tests/ddraw1.c | 35 +++++++---------------
dlls/ddraw/tests/ddraw2.c | 63 +++++++++------------------------------
dlls/ddraw/tests/ddraw4.c | 41 ++++++++++---------------
dlls/ddraw/tests/ddraw7.c | 43 +++++++++++---------------
4 files changed, 59 insertions(+), 123 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 9b0ee8e553..66b84edf45 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -3908,7 +3908,8 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DWORD caps_in;
DWORD caps_out;
HRESULT create_device_hr;
- BOOL create_may_fail;
+ BOOL broken_create_surface;
+ BOOL broken_surface_caps;
}
test_data[] =
{
@@ -3917,126 +3918,112 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
- FALSE,
},
{
NULL,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
- FALSE,
},
{
NULL,
DDSCAPS_OFFSCREENPLAIN,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
- FALSE,
},
{
NULL,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
D3DERR_SURFACENOTINVIDMEM,
- FALSE,
},
{
NULL,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
- FALSE,
},
{
NULL,
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY,
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
- FALSE,
},
{
NULL,
DDSCAPS_3DDEVICE,
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
- FALSE,
},
{
NULL,
0,
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
- FALSE,
},
{
NULL,
DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
D3DERR_SURFACENOTINVIDMEM,
- FALSE,
},
{
NULL,
DDSCAPS_SYSTEMMEMORY,
DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
- FALSE,
},
{
&p8_fmt,
0,
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
- FALSE,
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
- ~0U /* AMD r200 */ ,
+ DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY,
DDERR_NOPALETTEATTACHED,
- FALSE,
+ FALSE, TRUE /* AMD r200 */
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
- FALSE,
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDERR_NOPALETTEATTACHED,
- FALSE,
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
- FALSE,
},
{
NULL,
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER,
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
- TRUE /* AMD Evergreen */,
+ TRUE
},
{
NULL,
DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER,
- ~0U /* AMD Evergreen */,
+ DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
- FALSE,
+ FALSE, TRUE
},
{
NULL,
DDSCAPS_ZBUFFER,
- ~0U /* AMD Evergreen */,
+ DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
- FALSE,
+ FALSE, TRUE
},
{
NULL,
@@ -4095,7 +4082,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr) || broken(test_data[i].create_may_fail),
+ ok(SUCCEEDED(hr) || broken(test_data[i].broken_create_surface),
"Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
device_name, i, test_data[i].caps_in, hr);
if (FAILED(hr))
@@ -4105,7 +4092,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc);
ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr);
- ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out,
+ ok(surface_desc.ddsCaps.dwCaps == test_data[i].caps_out || broken(test_data[i].broken_surface_caps),
"Test %s %u: Got unexpected caps %#x, expected %#x.\n",
device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 3c5485af96..2bd56b7afd 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -4329,8 +4329,8 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DWORD caps_out;
HRESULT create_device_hr;
HRESULT set_rt_hr;
- HRESULT alternative_set_rt_hr;
- BOOL create_may_fail;
+ BOOL broken_create_surface;
+ BOOL broken_surface_caps;
}
test_data[] =
{
@@ -4340,8 +4340,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
- FALSE,
},
{
NULL,
@@ -4349,8 +4347,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
- FALSE,
},
{
NULL,
@@ -4358,8 +4354,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
},
{
NULL,
@@ -4367,8 +4361,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
D3DERR_SURFACENOTINVIDMEM,
D3D_OK,
- D3D_OK,
- FALSE,
},
{
NULL,
@@ -4376,8 +4368,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
},
{
NULL,
@@ -4385,8 +4375,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
- FALSE,
},
{
NULL,
@@ -4394,8 +4382,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
- FALSE,
},
{
NULL,
@@ -4403,8 +4389,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
},
{
NULL,
@@ -4412,8 +4396,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
D3DERR_SURFACENOTINVIDMEM,
D3D_OK,
- D3D_OK,
- FALSE,
},
{
NULL,
@@ -4421,8 +4403,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
},
{
&p8_fmt,
@@ -4430,17 +4410,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
- ~0U /* AMD r200 */,
+ DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY,
DDERR_NOPALETTEATTACHED,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
+ FALSE, TRUE /* AMD r200 */
},
{
&p8_fmt,
@@ -4448,8 +4425,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
},
{
&p8_fmt,
@@ -4457,8 +4432,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDERR_NOPALETTEATTACHED,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
},
{
&p8_fmt,
@@ -4466,8 +4439,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- FALSE,
},
{
NULL,
@@ -4475,26 +4446,23 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- DDERR_INVALIDCAPS,
- TRUE /* AMD Evergreen */,
+ TRUE
},
{
NULL,
DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER,
- ~0U /* AMD Evergreen */,
+ DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- DDERR_INVALIDCAPS,
- FALSE,
+ FALSE, TRUE
},
{
NULL,
DDSCAPS_ZBUFFER,
- ~0U /* AMD Evergreen */,
- DDERR_INVALIDCAPS,
+ DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- FALSE,
+ FALSE, TRUE
},
{
NULL,
@@ -4502,8 +4470,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- DDERR_INVALIDPIXELFORMAT,
- TRUE /* Nvidia Kepler */,
+ TRUE /* Nvidia Kepler */
},
{
NULL,
@@ -4511,8 +4478,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
- TRUE /* Nvidia Kepler */,
+ TRUE /* Nvidia Kepler */
},
};
@@ -4563,7 +4529,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr) || broken(test_data[i].create_may_fail),
+ ok(SUCCEEDED(hr) || broken(test_data[i].broken_create_surface),
"Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
device_name, i, test_data[i].caps_in, hr);
if (FAILED(hr))
@@ -4573,7 +4539,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc);
ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr);
- ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out,
+ ok(surface_desc.ddsCaps.dwCaps == test_data[i].caps_out || broken(test_data[i].broken_surface_caps),
"Test %s %u: Got unexpected caps %#x, expected %#x.\n",
device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
@@ -4628,8 +4594,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice2_SetRenderTarget(device, rt, 0);
- ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr),
- "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ ok(hr == test_data[i].set_rt_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
device_name, i, hr, test_data[i].set_rt_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
expected_rt = rt;
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index b4b2f15b34..0ab8c74dab 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -5945,7 +5945,10 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DWORD caps_in;
DWORD caps_out;
HRESULT create_device_hr;
- HRESULT set_rt_hr, alternative_set_rt_hr;
+ HRESULT set_rt_hr;
+ BOOL broken_create_surface;
+ BOOL broken_surface_caps;
+ BOOL broken_set_target_ok;
}
test_data[] =
{
@@ -5955,7 +5958,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -5963,7 +5965,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -5971,7 +5972,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
NULL,
@@ -5979,7 +5979,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
D3DERR_SURFACENOTINVIDMEM,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -5987,7 +5986,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
NULL,
@@ -5995,7 +5993,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -6003,7 +6000,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -6011,7 +6007,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
NULL,
@@ -6019,7 +6014,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
D3DERR_SURFACENOTINVIDMEM,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -6027,7 +6021,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&p8_fmt,
@@ -6035,15 +6028,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
- ~0U /* AMD r200 */,
+ DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY,
DDERR_NOPALETTEATTACHED,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
+ FALSE, TRUE /* AMD r200 */
},
{
&p8_fmt,
@@ -6051,7 +6043,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&p8_fmt,
@@ -6059,7 +6050,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDERR_NOPALETTEATTACHED,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&p8_fmt,
@@ -6067,7 +6057,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&z_fmt,
@@ -6075,7 +6064,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- D3D_OK /* r200 */,
+ FALSE, FALSE, TRUE
},
{
&z_fmt,
@@ -6083,7 +6072,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- D3D_OK /* r200 */,
+ FALSE, FALSE, TRUE
},
{
&z_fmt,
@@ -6091,7 +6080,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&z_fmt,
@@ -6099,7 +6087,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- D3D_OK /* r200 */,
+ FALSE, FALSE, TRUE
},
{
&z_fmt,
@@ -6107,7 +6095,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
};
@@ -6154,14 +6141,17 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ ok(SUCCEEDED(hr) || broken(test_data[i].broken_create_surface),
+ "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
device_name, i, test_data[i].caps_in, hr);
+ if (FAILED(hr))
+ continue;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &surface_desc);
ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr);
- ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out,
+ ok(surface_desc.ddsCaps.dwCaps == test_data[i].caps_out || broken(test_data[i].broken_surface_caps),
"Test %s %u: Got unexpected caps %#x, expected %#x.\n",
device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
@@ -6211,7 +6201,8 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice3_SetRenderTarget(device, rt, 0);
- ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr),
+ ok(hr == test_data[i].set_rt_hr || broken(
+ test_data[i].broken_set_target_ok && hr == D3D_OK),
"Test %s %u: Got unexpected hr %#x, expected %#x.\n",
device_name, i, hr, test_data[i].set_rt_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 94618c0178..f2552ad491 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -5682,7 +5682,11 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DWORD caps_in;
DWORD caps_out;
HRESULT create_device_hr;
- HRESULT set_rt_hr, alternative_set_rt_hr;
+ HRESULT set_rt_hr;
+ BOOL broken_create_surface;
+ BOOL broken_surface_caps;
+ BOOL broken_set_target_ok;
+ BOOL broken_set_target_ivpf;
}
test_data[] =
{
@@ -5692,7 +5696,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -5700,7 +5703,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -5708,7 +5710,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
NULL,
@@ -5716,7 +5717,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
D3DERR_SURFACENOTINVIDMEM,
DDERR_INVALIDPARAMS,
- D3D_OK,
+ FALSE, FALSE, TRUE
},
{
NULL,
@@ -5724,7 +5725,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
NULL,
@@ -5732,7 +5732,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -5740,7 +5739,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
D3D_OK,
D3D_OK,
- D3D_OK,
},
{
NULL,
@@ -5748,7 +5746,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
NULL,
@@ -5756,7 +5753,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
D3DERR_SURFACENOTINVIDMEM,
DDERR_INVALIDPARAMS,
- D3D_OK,
+ FALSE, FALSE, TRUE
},
{
NULL,
@@ -5764,7 +5761,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&p8_fmt,
@@ -5772,15 +5768,14 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&p8_fmt,
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE,
- ~0U /* AMD r200 */,
+ DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY,
DDERR_NOPALETTEATTACHED,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
+ FALSE, TRUE /* AMD r200 */
},
{
&p8_fmt,
@@ -5788,7 +5783,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&p8_fmt,
@@ -5796,7 +5790,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE,
DDERR_NOPALETTEATTACHED,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&p8_fmt,
@@ -5804,7 +5797,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&z_fmt,
@@ -5812,7 +5804,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- DDERR_INVALIDPIXELFORMAT,
},
{
&z_fmt,
@@ -5820,7 +5811,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDPIXELFORMAT,
- DDERR_INVALIDPIXELFORMAT,
},
{
&z_fmt,
@@ -5828,7 +5818,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
{
&z_fmt,
@@ -5836,7 +5825,7 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER,
DDERR_INVALIDCAPS,
DDERR_INVALIDPARAMS,
- DDERR_INVALIDPIXELFORMAT,
+ FALSE, FALSE, FALSE, TRUE
},
{
&z_fmt,
@@ -5844,7 +5833,6 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
- DDERR_INVALIDCAPS,
},
};
@@ -5900,14 +5888,17 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ ok(SUCCEEDED(hr) || broken(test_data[i].broken_create_surface),
+ "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
device_name, i, test_data[i].caps_in, hr);
+ if (FAILED(hr))
+ continue;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc);
ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr);
- ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out,
+ ok(surface_desc.ddsCaps.dwCaps == test_data[i].caps_out || broken(test_data[i].broken_surface_caps),
"Test %s %u: Got unexpected caps %#x, expected %#x.\n",
device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
@@ -5957,7 +5948,9 @@ static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice7_SetRenderTarget(device, rt, 0);
- ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr),
+ ok(hr == test_data[i].set_rt_hr || broken(
+ (test_data[i].broken_set_target_ok && hr == D3D_OK) ||
+ (test_data[i].broken_set_target_ivpf && hr == DDERR_INVALIDPIXELFORMAT)),
"Test %s %u: Got unexpected hr %#x, expected %#x.\n",
device_name, i, hr, test_data[i].set_rt_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
--
2.23.0
Dec. 13, 2019
[PATCH 3/7] ddraw/tests: Pass in device to check for in render-target testing.
by Jeff Smith
This allows the test to be performed on devices other than HAL.
Signed-off-by: Jeff Smith <whydoubt(a)gmail.com>
---
dlls/ddraw/tests/ddraw1.c | 40 +++++++++++++----------
dlls/ddraw/tests/ddraw2.c | 61 +++++++++++++++++++---------------
dlls/ddraw/tests/ddraw4.c | 57 ++++++++++++++++++--------------
dlls/ddraw/tests/ddraw7.c | 69 +++++++++++++++++++++++----------------
4 files changed, 129 insertions(+), 98 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 862c98353e..9b0ee8e553 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -3884,7 +3884,7 @@ static void test_unsupported_formats(void)
DestroyWindow(window);
}
-static void test_rt_caps(void)
+static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
{
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
@@ -4057,9 +4057,9 @@ static void test_rt_caps(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device(ddraw, window, DDSCL_NORMAL, riid)))
{
- skip("Failed to create a 3D device, skipping test.\n");
+ skip("Failed to create a (%s) 3D device, skipping test.\n", device_name);
IDirectDraw_Release(ddraw);
DestroyWindow(window);
return;
@@ -4096,40 +4096,41 @@ static void test_rt_caps(void)
surface_desc.dwHeight = 480;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr) || broken(test_data[i].create_may_fail),
- "Test %u: Failed to create surface with caps %#x, hr %#x.\n",
- i, test_data[i].caps_in, hr);
+ "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ device_name, i, test_data[i].caps_in, hr);
if (FAILED(hr))
continue;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc);
- ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr);
ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out,
- "Test %u: Got unexpected caps %#x, expected %#x.\n",
- i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
+ "Test %s %u: Got unexpected caps %#x, expected %#x.\n",
+ device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
- hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device);
- ok(hr == test_data[i].create_device_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n",
- i, hr, test_data[i].create_device_hr);
+ hr = IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device);
+ ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, test_data[i].create_device_hr);
if (hr == DDERR_NOPALETTEATTACHED)
{
hr = IDirectDrawSurface_SetPalette(surface, palette);
- ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr);
- hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
+ hr = IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device);
if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
}
if (SUCCEEDED(hr))
{
refcount = IDirect3DDevice_Release(device);
- ok(refcount == 1, "Test %u: Got unexpected refcount %u.\n", i, refcount);
+ ok(refcount == 1, "Test %s %u: Got unexpected refcount %u.\n", device_name, i, refcount);
}
refcount = IDirectDrawSurface_Release(surface);
- ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount);
+ ok(refcount == 0, "Test %s %u: The surface was not properly freed, refcount %u.\n",
+ device_name, i, refcount);
}
IDirectDrawPalette_Release(palette);
@@ -4138,6 +4139,11 @@ static void test_rt_caps(void)
DestroyWindow(window);
}
+static void test_rt_caps(void)
+{
+ test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL");
+}
+
static void test_primary_caps(void)
{
const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY;
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index fbce6cb9c2..3c5485af96 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -4303,7 +4303,7 @@ static void test_unsupported_formats(void)
DestroyWindow(window);
}
-static void test_rt_caps(void)
+static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
{
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
@@ -4519,9 +4519,9 @@ static void test_rt_caps(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device(ddraw, window, DDSCL_NORMAL, riid)))
{
- skip("Failed to create a 3D device, skipping test.\n");
+ skip("Failed to create a (%s) 3D device, skipping test.\n", device_name);
IDirectDraw2_Release(ddraw);
DestroyWindow(window);
return;
@@ -4564,33 +4564,33 @@ static void test_rt_caps(void)
surface_desc.dwHeight = 480;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr) || broken(test_data[i].create_may_fail),
- "Test %u: Failed to create surface with caps %#x, hr %#x.\n",
- i, test_data[i].caps_in, hr);
+ "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ device_name, i, test_data[i].caps_in, hr);
if (FAILED(hr))
continue;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc);
- ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr);
ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out,
- "Test %u: Got unexpected caps %#x, expected %#x.\n",
- i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
+ "Test %s %u: Got unexpected caps %#x, expected %#x.\n",
+ device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
- hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device);
- ok(hr == test_data[i].create_device_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n",
- i, hr, test_data[i].create_device_hr);
+ hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device);
+ ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, test_data[i].create_device_hr);
if (FAILED(hr))
{
if (hr == DDERR_NOPALETTEATTACHED)
{
hr = IDirectDrawSurface_SetPalette(surface, palette);
- ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr);
- hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
+ hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device);
if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
}
IDirectDrawSurface_Release(surface);
@@ -4601,10 +4601,10 @@ static void test_rt_caps(void)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create surface, hr %#x.\n", i, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device);
- ok(SUCCEEDED(hr), "Test %u: Failed to create device, hr %#x.\n", i, hr);
+ hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr);
}
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -4624,13 +4624,13 @@ static void test_rt_caps(void)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &rt, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n",
- i, test_data[i].caps_in, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice2_SetRenderTarget(device, rt, 0);
ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr),
- "Test %u: Got unexpected hr %#x, expected %#x.\n",
- i, hr, test_data[i].set_rt_hr);
+ "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, test_data[i].set_rt_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
expected_rt = rt;
else
@@ -4641,19 +4641,21 @@ static void test_rt_caps(void)
if (hr == DDERR_INVALIDPIXELFORMAT)
{
refcount = IDirectDrawSurface_AddRef(rt);
- ok(refcount == 2, "Test %u: Got unexpected refcount %u.\n", i, refcount);
+ ok(refcount == 2, "Test %s %u: Got unexpected refcount %u.\n", device_name, i, refcount);
}
hr = IDirect3DDevice2_GetRenderTarget(device, &tmp);
- ok(SUCCEEDED(hr), "Test %u: Failed to get render target, hr %#x.\n", i, hr);
- ok(tmp == expected_rt, "Test %u: Got unexpected rt %p.\n", i, tmp);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to get render target, hr %#x.\n", device_name, i, hr);
+ ok(tmp == expected_rt, "Test %s %u: Got unexpected rt %p.\n", device_name, i, tmp);
IDirectDrawSurface_Release(tmp);
IDirectDrawSurface_Release(rt);
refcount = IDirect3DDevice2_Release(device);
- ok(refcount == 0, "Test %u: The device was not properly freed, refcount %u.\n", i, refcount);
+ ok(refcount == 0, "Test %s %u: The device was not properly freed, refcount %u.\n",
+ device_name, i, refcount);
refcount = IDirectDrawSurface_Release(surface);
- ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount);
+ ok(refcount == 0, "Test %s %u: The surface was not properly freed, refcount %u.\n",
+ device_name, i, refcount);
}
IDirectDrawPalette_Release(palette);
@@ -4665,6 +4667,11 @@ done:
DestroyWindow(window);
}
+static void test_rt_caps(void)
+{
+ test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL");
+}
+
static void test_primary_caps(void)
{
const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY;
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 4e4f21686c..b4b2f15b34 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -5921,7 +5921,7 @@ static void test_unsupported_formats(void)
DestroyWindow(window);
}
-static void test_rt_caps(void)
+static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
{
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
@@ -6124,7 +6124,7 @@ static void test_rt_caps(void)
}
memset(&z_fmt, 0, sizeof(z_fmt));
- hr = IDirect3D3_EnumZBufferFormats(d3d, &IID_IDirect3DHALDevice, enum_z_fmt, &z_fmt);
+ hr = IDirect3D3_EnumZBufferFormats(d3d, riid, enum_z_fmt, &z_fmt);
if (FAILED(hr) || !z_fmt.dwSize)
{
skip("No depth buffer formats available, skipping test.\n");
@@ -6154,31 +6154,31 @@ static void test_rt_caps(void)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n",
- i, test_data[i].caps_in, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ device_name, i, test_data[i].caps_in, hr);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &surface_desc);
- ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr);
ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out,
- "Test %u: Got unexpected caps %#x, expected %#x.\n",
- i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
+ "Test %s %u: Got unexpected caps %#x, expected %#x.\n",
+ device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
- hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL);
- ok(hr == test_data[i].create_device_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n",
- i, hr, test_data[i].create_device_hr);
+ hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL);
+ ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, test_data[i].create_device_hr);
if (FAILED(hr))
{
if (hr == DDERR_NOPALETTEATTACHED)
{
hr = IDirectDrawSurface4_SetPalette(surface, palette);
- ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr);
- hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
+ hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL);
if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
}
IDirectDrawSurface4_Release(surface);
@@ -6189,10 +6189,10 @@ static void test_rt_caps(void)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create surface, hr %#x.\n", i, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create device, hr %#x.\n", i, hr);
+ hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr);
}
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -6207,28 +6207,30 @@ static void test_rt_caps(void)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &rt, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n",
- i, test_data[i].caps_in, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice3_SetRenderTarget(device, rt, 0);
ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr),
- "Test %u: Got unexpected hr %#x, expected %#x.\n",
- i, hr, test_data[i].set_rt_hr);
+ "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, test_data[i].set_rt_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
expected_rt = rt;
else
expected_rt = surface;
hr = IDirect3DDevice3_GetRenderTarget(device, &tmp);
- ok(SUCCEEDED(hr), "Test %u: Failed to get render target, hr %#x.\n", i, hr);
- ok(tmp == expected_rt, "Test %u: Got unexpected rt %p.\n", i, tmp);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to get render target, hr %#x.\n", device_name, i, hr);
+ ok(tmp == expected_rt, "Test %s %u: Got unexpected rt %p.\n", device_name, i, tmp);
IDirectDrawSurface4_Release(tmp);
IDirectDrawSurface4_Release(rt);
refcount = IDirect3DDevice3_Release(device);
- ok(refcount == 0, "Test %u: The device was not properly freed, refcount %u.\n", i, refcount);
+ ok(refcount == 0, "Test %s %u: The device was not properly freed, refcount %u.\n",
+ device_name, i, refcount);
refcount = IDirectDrawSurface4_Release(surface);
- ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount);
+ ok(refcount == 0, "Test %s %u: The surface was not properly freed, refcount %u.\n",
+ device_name, i, refcount);
}
IDirectDrawPalette_Release(palette);
@@ -6240,6 +6242,11 @@ done:
DestroyWindow(window);
}
+static void test_rt_caps(void)
+{
+ test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL");
+}
+
static void test_primary_caps(void)
{
const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY;
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 03c109125f..94618c0178 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -5657,13 +5657,12 @@ static void test_unsupported_formats(void)
DestroyWindow(window);
}
-static void test_rt_caps(void)
+static void test_rt_caps_riid(REFCLSID riid, const char *device_name)
{
- const GUID *devtype = &IID_IDirect3DHALDevice;
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
IDirectDraw7 *ddraw;
- struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice, FALSE };
+ struct { REFCLSID riid; BOOL present; } device_data = { riid, FALSE };
DDPIXELFORMAT z_fmt;
IDirect3D7 *d3d;
unsigned int i;
@@ -5863,11 +5862,15 @@ static void test_rt_caps(void)
hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &device_data);
ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr);
- if (device_data.present)
- devtype = device_data.riid;
+ if (!device_data.present)
+ {
+ skip("Failed to enumerate %s device, skipping test.\n", device_name);
+ IDirect3D7_Release(d3d);
+ goto done;
+ }
memset(&z_fmt, 0, sizeof(z_fmt));
- hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt);
+ hr = IDirect3D7_EnumZBufferFormats(d3d, riid, enum_z_fmt, &z_fmt);
if (FAILED(hr) || !z_fmt.dwSize)
{
skip("No depth buffer formats available, skipping test.\n");
@@ -5897,31 +5900,31 @@ static void test_rt_caps(void)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n",
- i, test_data[i].caps_in, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ device_name, i, test_data[i].caps_in, hr);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc);
- ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr);
ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out,
- "Test %u: Got unexpected caps %#x, expected %#x.\n",
- i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
+ "Test %s %u: Got unexpected caps %#x, expected %#x.\n",
+ device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
- hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device);
- ok(hr == test_data[i].create_device_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n",
- i, hr, test_data[i].create_device_hr);
+ hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device);
+ ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, test_data[i].create_device_hr);
if (FAILED(hr))
{
if (hr == DDERR_NOPALETTEATTACHED)
{
hr = IDirectDrawSurface7_SetPalette(surface, palette);
- ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr);
- hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr);
+ hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device);
if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)
- ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
else
- ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr);
}
IDirectDrawSurface7_Release(surface);
@@ -5932,10 +5935,10 @@ static void test_rt_caps(void)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create surface, hr %#x.\n", i, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device);
- ok(SUCCEEDED(hr), "Test %u: Failed to create device, hr %#x.\n", i, hr);
+ hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr);
}
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -5950,28 +5953,30 @@ static void test_rt_caps(void)
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &rt, NULL);
- ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n",
- i, test_data[i].caps_in, hr);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n",
+ device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice7_SetRenderTarget(device, rt, 0);
ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr),
- "Test %u: Got unexpected hr %#x, expected %#x.\n",
- i, hr, test_data[i].set_rt_hr);
+ "Test %s %u: Got unexpected hr %#x, expected %#x.\n",
+ device_name, i, hr, test_data[i].set_rt_hr);
if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT)
expected_rt = rt;
else
expected_rt = surface;
hr = IDirect3DDevice7_GetRenderTarget(device, &tmp);
- ok(SUCCEEDED(hr), "Test %u: Failed to get render target, hr %#x.\n", i, hr);
- ok(tmp == expected_rt, "Test %u: Got unexpected rt %p.\n", i, tmp);
+ ok(SUCCEEDED(hr), "Test %s %u: Failed to get render target, hr %#x.\n", device_name, i, hr);
+ ok(tmp == expected_rt, "Test %s %u: Got unexpected rt %p.\n", device_name, i, tmp);
IDirectDrawSurface7_Release(tmp);
IDirectDrawSurface7_Release(rt);
refcount = IDirect3DDevice7_Release(device);
- ok(refcount == 0, "Test %u: The device was not properly freed, refcount %u.\n", i, refcount);
+ ok(refcount == 0, "Test %s %u: The device was not properly freed, refcount %u.\n",
+ device_name, i, refcount);
refcount = IDirectDrawSurface7_Release(surface);
- ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount);
+ ok(refcount == 0, "Test %s %u: The surface was not properly freed, refcount %u.\n",
+ device_name, i, refcount);
}
IDirectDrawPalette_Release(palette);
@@ -5983,6 +5988,12 @@ done:
DestroyWindow(window);
}
+static void test_rt_caps(void)
+{
+ test_rt_caps_riid(&IID_IDirect3DTnLHalDevice, "TnLHal");
+ test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL");
+}
+
static void test_primary_caps(void)
{
const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY;
--
2.23.0
Dec. 13, 2019
[PATCH 2/7] ddraw/tests: Pass in device to create with create_device.
by Jeff Smith
This allows the function to create devices other than HAL.
Signed-off-by: Jeff Smith <whydoubt(a)gmail.com>
---
dlls/ddraw/tests/ddraw1.c | 75 +++++++++++----------
dlls/ddraw/tests/ddraw2.c | 81 ++++++++++++-----------
dlls/ddraw/tests/ddraw4.c | 101 ++++++++++++++--------------
dlls/ddraw/tests/ddraw7.c | 135 +++++++++++++++++++++-----------------
4 files changed, 210 insertions(+), 182 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 3a27e91aa1..862c98353e 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -513,7 +513,7 @@ static IDirectDraw *create_ddraw(void)
return ddraw;
}
-static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coop_level)
+static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coop_level, REFCLSID riid)
{
/* Prefer 16 bit depth buffers because Nvidia gives us an unpadded D24 buffer if we ask
* for 24 bit and handles such buffers incorrectly in DDBLT_DEPTHFILL. AMD only supports
@@ -573,7 +573,7 @@ static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coo
if (FAILED(hr))
continue;
- if (SUCCEEDED(IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device)))
+ if (SUCCEEDED(IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device)))
break;
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
@@ -583,6 +583,11 @@ static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coo
return device;
}
+static IDirect3DDevice *create_device_hal(IDirectDraw *ddraw, HWND window, DWORD coop_level)
+{
+ return create_device(ddraw, window, coop_level, &IID_IDirect3DHALDevice);
+}
+
static IDirect3DViewport *create_viewport(IDirect3DDevice *device, UINT x, UINT y, UINT w, UINT h)
{
IDirect3DViewport *viewport;
@@ -1093,7 +1098,7 @@ static void test_coop_level_d3d_state(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -1165,7 +1170,7 @@ static void test_surface_interface_mismatch(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -1288,7 +1293,7 @@ static void test_viewport_object(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -1514,7 +1519,7 @@ static void test_zenable(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -1651,7 +1656,7 @@ static void test_ck_rgba(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -1809,7 +1814,7 @@ static void test_ck_default(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -1965,7 +1970,7 @@ static void test_ck_complex(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2193,7 +2198,7 @@ static void test_surface_qi(void)
/* Try to create a D3D device to see if the ddraw implementation supports
* D3D. 64-bit ddraw in particular doesn't seem to support D3D, and
* doesn't support e.g. the IDirect3DTexture interfaces. */
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -2276,7 +2281,7 @@ static void test_device_qi(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -3584,7 +3589,7 @@ static void test_clear_rect_count(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -3816,7 +3821,7 @@ static void test_unsupported_formats(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -4052,7 +4057,7 @@ static void test_rt_caps(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -4335,7 +4340,7 @@ static void test_surface_lock(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -4415,7 +4420,7 @@ static void test_surface_discard(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -5945,7 +5950,7 @@ static void test_material(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -6179,7 +6184,7 @@ static void test_lighting(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -6603,7 +6608,7 @@ static void test_specular_lighting(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -7502,7 +7507,7 @@ static void test_texturemapblend(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -7892,7 +7897,7 @@ static void test_viewport_clear_rect(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -8108,7 +8113,7 @@ static void test_color_fill(void)
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
is_warp = ddraw_is_warp(ddraw);
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -8530,7 +8535,7 @@ static void test_colorkey_precision(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -8953,7 +8958,7 @@ static void test_shademode(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -9520,7 +9525,7 @@ static void test_blt(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -9685,7 +9690,7 @@ static void test_cross_device_blt(void)
window = create_window();
ddraw = create_ddraw();
- if (!(device = create_device(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
{
skip("Failed to create a 3D device.\n");
IDirectDraw_Release(ddraw);
@@ -9695,7 +9700,7 @@ static void test_cross_device_blt(void)
window2 = create_window();
ddraw2 = create_ddraw();
- if (!(device2 = create_device(ddraw2, window2, DDSCL_NORMAL)))
+ if (!(device2 = create_device_hal(ddraw2, window2, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
IDirectDraw_Release(ddraw2);
@@ -10245,7 +10250,7 @@ static void test_transform_vertices(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -11002,7 +11007,7 @@ static void test_texture_load(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -11642,7 +11647,7 @@ static void test_depth_readback(void)
return;
}
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirectDraw_Release(ddraw);
@@ -11747,7 +11752,7 @@ static void test_clear(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -12050,7 +12055,7 @@ static void test_execute_data(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -12216,7 +12221,7 @@ static void test_viewport(void)
0, 0, 640, 480, 0, 0, 0, 0);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -12474,7 +12479,7 @@ static void test_find_device(void)
hr = IDirect3D_FindDevice(d3d, &search, &result);
window = create_window();
- device = create_device(ddraw, window, DDSCL_NORMAL);
+ device = create_device_hal(ddraw, window, DDSCL_NORMAL);
if (hr == D3D_OK)
ok(!!device, "Failed to create a 3D device.\n");
else
@@ -12687,7 +12692,7 @@ static void test_alphatest(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
IDirectDraw_Release(ddraw);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 97f21798d3..fbce6cb9c2 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -342,7 +342,7 @@ static IDirectDraw2 *create_ddraw(void)
return ddraw2;
}
-static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD coop_level)
+static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD coop_level, REFCLSID riid)
{
/* Prefer 16 bit depth buffers because Nvidia gives us an unpadded D24 buffer if we ask
* for 24 bit and handles such buffers incorrectly in DDBLT_DEPTHFILL. AMD only supports
@@ -410,7 +410,7 @@ static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD c
if (FAILED(hr))
continue;
- if (SUCCEEDED(IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device)))
+ if (SUCCEEDED(IDirect3D2_CreateDevice(d3d, riid, surface, &device)))
break;
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
@@ -421,6 +421,11 @@ static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD c
return device;
}
+static IDirect3DDevice2 *create_device_hal(IDirectDraw2 *ddraw, HWND window, DWORD coop_level)
+{
+ return create_device(ddraw, window, coop_level, &IID_IDirect3DHALDevice);
+}
+
static IDirect3DViewport2 *create_viewport(IDirect3DDevice2 *device, UINT x, UINT y, UINT w, UINT h)
{
IDirect3DViewport2 *viewport;
@@ -940,7 +945,7 @@ static void test_coop_level_d3d_state(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -1043,7 +1048,7 @@ static void test_surface_interface_mismatch(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -1177,7 +1182,7 @@ static void test_depth_blit(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -1443,7 +1448,7 @@ static void test_viewport_object(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw_Release(ddraw);
@@ -1679,7 +1684,7 @@ static void test_zenable(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -1781,7 +1786,7 @@ static void test_ck_rgba(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -1912,7 +1917,7 @@ static void test_ck_default(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -2016,7 +2021,7 @@ static void test_ck_complex(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2244,7 +2249,7 @@ static void test_surface_qi(void)
/* Try to create a D3D device to see if the ddraw implementation supports
* D3D. 64-bit ddraw in particular doesn't seem to support D3D, and
* doesn't support e.g. the IDirect3DTexture interfaces. */
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -2326,7 +2331,7 @@ static void test_device_qi(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -3721,7 +3726,7 @@ static void test_clear_rect_count(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -3983,7 +3988,7 @@ static void test_lighting_interface_versions(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -4235,7 +4240,7 @@ static void test_unsupported_formats(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -4514,7 +4519,7 @@ static void test_rt_caps(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -4862,7 +4867,7 @@ static void test_surface_lock(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -4942,7 +4947,7 @@ static void test_surface_discard(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -6893,7 +6898,7 @@ static void test_material(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -7110,7 +7115,7 @@ static void test_lighting(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -7469,7 +7474,7 @@ static void test_specular_lighting(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -8335,7 +8340,7 @@ static void test_texturemapblend(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -8637,7 +8642,7 @@ static void test_viewport_clear_rect(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -8853,7 +8858,7 @@ static void test_color_fill(void)
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
is_warp = ddraw_is_warp(ddraw);
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -9271,7 +9276,7 @@ static void test_colorkey_precision(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -9671,7 +9676,7 @@ static void test_shademode(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -10219,7 +10224,7 @@ static void test_blt(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -10384,7 +10389,7 @@ static void test_cross_device_blt(void)
window = create_window();
ddraw = create_ddraw();
- if (!(device = create_device(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
{
skip("Failed to create a 3D device.\n");
IDirectDraw2_Release(ddraw);
@@ -10394,7 +10399,7 @@ static void test_cross_device_blt(void)
window2 = create_window();
ddraw2 = create_ddraw();
- if (!(device2 = create_device(ddraw2, window2, DDSCL_NORMAL)))
+ if (!(device2 = create_device_hal(ddraw2, window2, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
IDirectDraw2_Release(ddraw2);
@@ -10859,7 +10864,7 @@ static void test_draw_primitive(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -10939,7 +10944,7 @@ static void test_edge_antialiasing_blending(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
DestroyWindow(window);
@@ -11217,7 +11222,7 @@ static void test_transform_vertices(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -12546,7 +12551,7 @@ static void test_set_render_state(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -12617,7 +12622,7 @@ static void test_depth_readback(void)
ok(!!window, "Failed to create a window.\n");
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirectDraw2_Release(ddraw);
@@ -12734,7 +12739,7 @@ static void test_clear(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -13066,7 +13071,7 @@ static void test_viewport(void)
0, 0, 640, 480, NULL, NULL, NULL, NULL);
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@@ -13342,7 +13347,7 @@ static void test_find_device(void)
hr = IDirect3D2_FindDevice(d3d, &search, &result);
window = create_window();
- device = create_device(ddraw, window, DDSCL_NORMAL);
+ device = create_device_hal(ddraw, window, DDSCL_NORMAL);
if (hr == D3D_OK)
ok(!!device, "Failed to create a 3D device.\n");
else
@@ -13552,7 +13557,7 @@ static void test_alphatest(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
- if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
IDirectDraw2_Release(ddraw);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 2c0a9e7f05..4e4f21686c 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -330,7 +330,7 @@ static IDirectDraw4 *create_ddraw(void)
return ddraw4;
}
-static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
+static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level, REFCLSID riid)
{
IDirectDrawSurface4 *surface, *ds;
IDirect3DDevice3 *device = NULL;
@@ -412,7 +412,7 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
return NULL;
}
- hr = IDirect3D3_CreateDevice(d3d3, &IID_IDirect3DHALDevice, surface, &device, NULL);
+ hr = IDirect3D3_CreateDevice(d3d3, riid, surface, &device, NULL);
IDirect3D3_Release(d3d3);
IDirectDrawSurface4_Release(surface);
if (FAILED(hr))
@@ -421,6 +421,11 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
return device;
}
+static IDirect3DDevice3 *create_device_hal(HWND window, DWORD coop_level)
+{
+ return create_device(window, coop_level, &IID_IDirect3DHALDevice);
+}
+
static IDirect3DViewport3 *create_viewport(IDirect3DDevice3 *device, UINT x, UINT y, UINT w, UINT h)
{
IDirect3DViewport3 *viewport;
@@ -633,7 +638,7 @@ static void test_process_vertices(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1131,7 +1136,7 @@ static void test_coop_level_d3d_state(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1353,7 +1358,7 @@ static void test_depth_blit(void)
D3DRECT d3drect;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1612,7 +1617,7 @@ static void test_viewport_object(void)
} desc;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1926,7 +1931,7 @@ static void test_zenable(void)
UINT i, j;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2025,7 +2030,7 @@ static void test_ck_rgba(void)
UINT i;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2157,7 +2162,7 @@ static void test_ck_default(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2258,7 +2263,7 @@ static void test_ck_complex(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
+ if (!(device = create_device_hal(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2488,7 +2493,7 @@ static void test_surface_qi(void)
/* Try to create a D3D device to see if the ddraw implementation supports
* D3D. 64-bit ddraw in particular doesn't seem to support D3D, and
* doesn't support e.g. the IDirect3DTexture interfaces. */
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2570,7 +2575,7 @@ static void test_device_qi(void)
HWND window;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -3934,7 +3939,7 @@ static void test_vb_discard(void)
unsigned int i;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -4041,7 +4046,7 @@ static void test_draw_strided(void)
static D3DRECT clear_rect = {{0}, {0}, {640}, {480}};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -4214,7 +4219,7 @@ static void test_lighting(void)
*dst_data;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -4696,7 +4701,7 @@ static void test_specular_lighting(void)
WORD *indices;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -4883,7 +4888,7 @@ static void test_clear_rect_count(void)
static D3DRECT clear_rect = {{0}, {0}, {640}, {480}};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -5189,7 +5194,7 @@ static void test_lighting_interface_versions(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -5624,7 +5629,7 @@ static void test_block_formats_creation(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -5848,7 +5853,7 @@ static void test_unsupported_formats(void)
static const DWORD caps[] = {0, DDSCAPS_SYSTEMMEMORY, DDSCAPS_VIDEOMEMORY};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -6563,7 +6568,7 @@ static void test_surface_discard(void)
unsigned int i;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -8733,7 +8738,7 @@ static void test_material(void)
static D3DRECT clear_rect = {{0}, {0}, {640}, {480}};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -9319,7 +9324,7 @@ static void test_vb_writeonly(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -9671,7 +9676,7 @@ static void test_texturemapblend(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -10183,7 +10188,7 @@ static void test_signed_formats(void)
D3DDEVICEDESC device_desc, hel_desc;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -10494,7 +10499,7 @@ static void test_color_fill(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -10882,7 +10887,7 @@ static void test_texcoordindex(void)
DWORD *ptr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -11107,7 +11112,7 @@ static void test_colorkey_precision(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -11517,7 +11522,7 @@ static void test_shademode(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -12097,7 +12102,7 @@ static void test_blt(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -12266,7 +12271,7 @@ static void test_cross_device_blt(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
+ if (!(device = create_device_hal(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
{
skip("Failed to create a 3D device.\n");
DestroyWindow(window);
@@ -12274,7 +12279,7 @@ static void test_cross_device_blt(void)
}
window2 = create_window();
- if (!(device2 = create_device(window2, DDSCL_NORMAL)))
+ if (!(device2 = create_device_hal(window2, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
IDirect3DDevice3_Release(device);
@@ -12413,7 +12418,7 @@ static void test_color_clamping(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -12844,7 +12849,7 @@ static void test_draw_primitive(void)
void *data;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -12975,7 +12980,7 @@ static void test_edge_antialiasing_blending(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
DestroyWindow(window);
@@ -13263,7 +13268,7 @@ static void test_transform_vertices(void)
}
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
DestroyWindow(window);
@@ -14665,7 +14670,7 @@ static void test_vb_refcount(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -14779,7 +14784,7 @@ static void test_compute_sphere_visibility(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -14827,7 +14832,7 @@ static void test_texture_stages_limits(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -14877,7 +14882,7 @@ static void test_set_render_state(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -14970,7 +14975,7 @@ static void test_map_synchronisation(void)
window = create_window();
ok(!!window, "Failed to create a window.\n");
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
DestroyWindow(window);
@@ -15146,7 +15151,7 @@ static void test_depth_readback(void)
window = create_window();
ok(!!window, "Failed to create a window.\n");
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
DestroyWindow(window);
@@ -15271,7 +15276,7 @@ static void test_clear(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -15588,7 +15593,7 @@ static void test_viewport(void)
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -15862,7 +15867,7 @@ static void test_find_device(void)
hr = IDirect3D3_FindDevice(d3d, &search, &result);
window = create_window();
- device = create_device(window, DDSCL_NORMAL);
+ device = create_device_hal(window, DDSCL_NORMAL);
if (hr == D3D_OK)
ok(!!device, "Failed to create a 3D device.\n");
else
@@ -15975,7 +15980,7 @@ static void test_sysmem_draw(void)
window = create_window();
ok(!!window, "Failed to create a window.\n");
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -16214,7 +16219,7 @@ static void test_alphatest(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
DestroyWindow(window);
@@ -16807,7 +16812,7 @@ static void test_surface_format_conversion_alpha(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index d921746152..03c109125f 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -348,7 +348,7 @@ static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7
return DDENUMRET_OK;
}
-static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
+static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level, REFCLSID riid)
{
IDirectDrawSurface7 *surface, *ds;
IDirect3DDevice7 *device = NULL;
@@ -357,8 +357,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
IDirectDraw7 *ddraw;
IDirect3D7 *d3d7;
HRESULT hr;
- struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice, FALSE };
- const GUID *devtype = &IID_IDirect3DHALDevice;
+ struct { REFCLSID riid; BOOL present; } device_data = { riid, FALSE };
if (!(ddraw = create_ddraw()))
return NULL;
@@ -399,10 +398,15 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &device_data);
ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr);
- if (device_data.present) devtype = device_data.riid;
+ if (!device_data.present)
+ {
+ IDirect3D7_Release(d3d7);
+ IDirectDrawSurface7_Release(surface);
+ return NULL;
+ }
memset(&z_fmt, 0, sizeof(z_fmt));
- hr = IDirect3D7_EnumZBufferFormats(d3d7, devtype, enum_z_fmt, &z_fmt);
+ hr = IDirect3D7_EnumZBufferFormats(d3d7, riid, enum_z_fmt, &z_fmt);
if (FAILED(hr) || !z_fmt.dwSize)
{
IDirect3D7_Release(d3d7);
@@ -436,7 +440,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
return NULL;
}
- hr = IDirect3D7_CreateDevice(d3d7, devtype, surface, &device);
+ hr = IDirect3D7_CreateDevice(d3d7, riid, surface, &device);
IDirect3D7_Release(d3d7);
IDirectDrawSurface7_Release(surface);
if (FAILED(hr))
@@ -445,6 +449,15 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
return device;
}
+static IDirect3DDevice7 *create_device_hal(HWND window, DWORD coop_level)
+{
+ IDirect3DDevice7 *device;
+ device = create_device(window, coop_level, &IID_IDirect3DTnLHalDevice);
+ if (!device)
+ device = create_device(window, coop_level, &IID_IDirect3DHALDevice);
+ return device;
+}
+
struct message
{
UINT message;
@@ -536,7 +549,7 @@ static void test_process_vertices(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1072,7 +1085,7 @@ static void test_coop_level_d3d_state(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1302,7 +1315,7 @@ static void test_depth_blit(void)
HWND window;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1448,7 +1461,7 @@ static void test_texture_load_ckey(void)
IDirect3D7 *d3d;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1545,7 +1558,7 @@ static void test_zenable(void)
UINT i, j;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1636,7 +1649,7 @@ static void test_ck_rgba(void)
UINT i;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1756,7 +1769,7 @@ static void test_ck_default(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -1850,7 +1863,7 @@ static void test_ck_complex(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
+ if (!(device = create_device_hal(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2134,7 +2147,7 @@ static void test_surface_qi(void)
/* Try to create a D3D device to see if the ddraw implementation supports
* D3D. 64-bit ddraw in particular doesn't seem to support D3D, and
* doesn't support e.g. the IDirect3DTexture interfaces. */
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -2216,7 +2229,7 @@ static void test_device_qi(void)
HWND window;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -3579,7 +3592,7 @@ static void test_vb_discard(void)
unsigned int i;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -3684,7 +3697,7 @@ static void test_draw_strided(void)
D3DDRAWPRIMITIVESTRIDEDDATA strided;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -3853,7 +3866,7 @@ static void test_lighting(void)
*dst_data;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -4355,7 +4368,7 @@ static void test_specular_lighting(void)
} *dst_data;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -4516,7 +4529,7 @@ static void test_clear_rect_count(void)
D3DRECT rect = {{0}, {0}, {640}, {480}};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -4720,7 +4733,7 @@ static void test_fog_special(void)
IDirectDrawSurface7 *rt;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -4913,7 +4926,7 @@ static void test_lighting_interface_versions(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -5352,7 +5365,7 @@ static void test_block_formats_creation(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -5576,7 +5589,7 @@ static void test_unsupported_formats(void)
static const DWORD caps[] = {0, DDSCAPS_SYSTEMMEMORY, DDSCAPS_VIDEOMEMORY};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -6374,7 +6387,7 @@ static void test_surface_discard(void)
unsigned int i;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -6701,7 +6714,7 @@ static void test_flip(void)
IDirectDrawSurface7_Release(frontbuffer);
}
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
goto done;
@@ -8549,7 +8562,7 @@ static void test_material(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -9072,7 +9085,7 @@ static void test_vb_writeonly(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -9569,7 +9582,7 @@ static void test_fog_interpolation(void)
D3DDEVICEDESC7 caps;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -9724,7 +9737,7 @@ static void test_fog_process_vertices(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -9909,7 +9922,7 @@ static void test_negative_fixedfunction_fog(void)
D3DDEVICEDESC7 caps;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -10021,7 +10034,7 @@ static void test_table_fog_zw(void)
unsigned int i;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -10180,7 +10193,7 @@ static void test_signed_formats(void)
D3DDEVICEDESC7 device_desc;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -10470,7 +10483,7 @@ static void test_color_fill(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -10862,7 +10875,7 @@ static void test_texcoordindex(void)
DWORD *ptr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -11100,7 +11113,7 @@ static void test_colorkey_precision(void)
DDBLTFX fx;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -11500,7 +11513,7 @@ static void test_shademode(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -12090,7 +12103,7 @@ static void test_blt(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -12259,7 +12272,7 @@ static void test_cross_device_blt(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
+ if (!(device = create_device_hal(window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
{
skip("Failed to create a 3D device.\n");
DestroyWindow(window);
@@ -12267,7 +12280,7 @@ static void test_cross_device_blt(void)
}
window2 = create_window();
- if (!(device2 = create_device(window2, DDSCL_NORMAL)))
+ if (!(device2 = create_device_hal(window2, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
IDirect3DDevice7_Release(device);
@@ -12404,7 +12417,7 @@ static void test_color_clamping(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -12835,7 +12848,7 @@ static void test_draw_primitive(void)
void *data;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -12962,7 +12975,7 @@ static void test_edge_antialiasing_blending(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
DestroyWindow(window);
@@ -14005,7 +14018,7 @@ static void test_vb_refcount(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -14127,7 +14140,7 @@ static void test_compute_sphere_visibility(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -14174,7 +14187,7 @@ static void test_clip_planes_limits(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -14245,7 +14258,7 @@ static void test_texture_stages_limits(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -14292,7 +14305,7 @@ static void test_set_render_state(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -14383,7 +14396,7 @@ static void test_map_synchronisation(void)
window = create_window();
ok(!!window, "Failed to create a window.\n");
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
DestroyWindow(window);
@@ -14566,7 +14579,7 @@ static void test_depth_readback(void)
window = create_window();
ok(!!window, "Failed to create a window.\n");
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
DestroyWindow(window);
@@ -14703,7 +14716,7 @@ static void test_clear(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -14974,7 +14987,7 @@ static void test_viewport(void)
window = CreateWindowA("static", "d3d7_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -15193,7 +15206,7 @@ static void test_device_load(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -15652,7 +15665,7 @@ static void test_color_vertex(void)
window = CreateWindowA("static", "d3d7_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -15791,7 +15804,7 @@ static void test_sysmem_draw(void)
window = create_window();
ok(!!window, "Failed to create a window.\n");
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -16019,7 +16032,7 @@ static void test_multiply_transform(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -16123,7 +16136,7 @@ static void test_alphatest(void)
};
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device.\n");
DestroyWindow(window);
@@ -16354,7 +16367,7 @@ static void test_begin_end_state_block(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create 3D device.\n");
DestroyWindow(window);
@@ -16775,7 +16788,7 @@ static void test_surface_format_conversion_alpha(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@@ -16982,7 +16995,7 @@ static void test_compressed_surface_stretch(void)
HRESULT hr;
window = create_window();
- if (!(device = create_device(window, DDSCL_NORMAL)))
+ if (!(device = create_device_hal(window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
--
2.23.0
Dec. 13, 2019
[PATCH 1/7] ddraw/tests: Pass in device to look for when enumerating.
by Jeff Smith
This makes it possible to scan for devices other than HAL.
Signed-off-by: Jeff Smith <whydoubt(a)gmail.com>
---
dlls/ddraw/tests/ddraw7.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 470464951c..d921746152 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -339,10 +339,10 @@ static IDirectDraw7 *create_ddraw(void)
static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7 *desc, void *ctx)
{
- BOOL *hal_ok = ctx;
- if (IsEqualGUID(&desc->deviceGUID, &IID_IDirect3DTnLHalDevice))
+ struct { REFCLSID riid; BOOL present; } *device_data = ctx;
+ if (IsEqualGUID(&desc->deviceGUID, device_data->riid))
{
- *hal_ok = TRUE;
+ device_data->present = TRUE;
return DDENUMRET_CANCEL;
}
return DDENUMRET_OK;
@@ -357,7 +357,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
IDirectDraw7 *ddraw;
IDirect3D7 *d3d7;
HRESULT hr;
- BOOL hal_ok = FALSE;
+ struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice, FALSE };
const GUID *devtype = &IID_IDirect3DHALDevice;
if (!(ddraw = create_ddraw()))
@@ -397,9 +397,9 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
return NULL;
}
- hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &hal_ok);
+ hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &device_data);
ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr);
- if (hal_ok) devtype = &IID_IDirect3DTnLHalDevice;
+ if (device_data.present) devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt));
hr = IDirect3D7_EnumZBufferFormats(d3d7, devtype, enum_z_fmt, &z_fmt);
@@ -5650,7 +5650,7 @@ static void test_rt_caps(void)
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
IDirectDraw7 *ddraw;
- BOOL hal_ok = FALSE;
+ struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice, FALSE };
DDPIXELFORMAT z_fmt;
IDirect3D7 *d3d;
unsigned int i;
@@ -5848,10 +5848,10 @@ static void test_rt_caps(void)
goto done;
}
- hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &hal_ok);
+ hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &device_data);
ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr);
- if (hal_ok)
- devtype = &IID_IDirect3DTnLHalDevice;
+ if (device_data.present)
+ devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt));
hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt);
@@ -6133,7 +6133,7 @@ static void test_surface_lock(void)
DDSURFACEDESC2 ddsd;
ULONG refcount;
DDPIXELFORMAT z_fmt;
- BOOL hal_ok = FALSE;
+ struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice, FALSE };
const GUID *devtype = &IID_IDirect3DHALDevice;
D3DDEVICEDESC7 device_desc;
BOOL cubemap_supported;
@@ -6254,10 +6254,10 @@ static void test_surface_lock(void)
goto done;
}
- hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &hal_ok);
+ hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &device_data);
ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr);
- if (hal_ok)
- devtype = &IID_IDirect3DTnLHalDevice;
+ if (device_data.present)
+ devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt));
hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt);
--
2.23.0
Dec. 13, 2019
[PATCH v2 3/3] msado15: Add ISupportErrorInfo support to _Recordset.
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 61 +++++++++++++++++++++++++++++++-----
dlls/msado15/tests/msado15.c | 5 +++
2 files changed, 58 insertions(+), 8 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index 4b61b552f0..9bf6b60df1 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -34,14 +34,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msado15);
struct fields;
struct recordset
{
- _Recordset Recordset_iface;
- LONG refs;
- LONG state;
- struct fields *fields;
- LONG count;
- LONG allocated;
- LONG index;
- VARIANT *data;
+ _Recordset Recordset_iface;
+ ISupportErrorInfo ISupportErrorInfo_iface;
+ LONG refs;
+ LONG state;
+ struct fields *fields;
+ LONG count;
+ LONG allocated;
+ LONG index;
+ VARIANT *data;
};
struct fields
@@ -646,6 +647,11 @@ static inline struct recordset *impl_from_Recordset( _Recordset *iface )
return CONTAINING_RECORD( iface, struct recordset, Recordset_iface );
}
+static inline struct recordset *impl_from_ISupportErrorInfo( ISupportErrorInfo *iface )
+{
+ return CONTAINING_RECORD( iface, struct recordset, ISupportErrorInfo_iface );
+}
+
static ULONG WINAPI recordset_AddRef( _Recordset *iface )
{
struct recordset *recordset = impl_from_Recordset( iface );
@@ -686,6 +692,7 @@ static ULONG WINAPI recordset_Release( _Recordset *iface )
static HRESULT WINAPI recordset_QueryInterface( _Recordset *iface, REFIID riid, void **obj )
{
+ struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %s, %p\n", iface, debugstr_guid(riid), obj );
if (IsEqualIID(riid, &IID_IUnknown) ||
@@ -698,6 +705,10 @@ static HRESULT WINAPI recordset_QueryInterface( _Recordset *iface, REFIID riid,
{
*obj = iface;
}
+ else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
+ {
+ *obj = &recordset->ISupportErrorInfo_iface;
+ }
else
{
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
@@ -1235,6 +1246,39 @@ static HRESULT WINAPI recordset_Save( _Recordset *iface, VARIANT destination, Pe
return E_NOTIMPL;
}
+static HRESULT WINAPI supporterror_QueryInterface( ISupportErrorInfo *iface, REFIID riid, void **obj )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_QueryInterface( &recordset->Recordset_iface, riid, obj );
+}
+
+static ULONG WINAPI supporterror_AddRef( ISupportErrorInfo *iface )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_AddRef( &recordset->Recordset_iface );
+}
+
+static ULONG WINAPI supporterror_Release( ISupportErrorInfo *iface )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_Release( &recordset->Recordset_iface );
+}
+
+static HRESULT WINAPI supporterror_InterfaceSupportsErrorInfo( ISupportErrorInfo *iface, REFIID riid )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ FIXME( "%p, %s\n", recordset, debugstr_guid(riid) );
+ return S_FALSE;
+}
+
+static const struct ISupportErrorInfoVtbl support_error_vtbl =
+{
+ supporterror_QueryInterface,
+ supporterror_AddRef,
+ supporterror_Release,
+ supporterror_InterfaceSupportsErrorInfo
+};
+
static const struct _RecordsetVtbl recordset_vtbl =
{
recordset_QueryInterface,
@@ -1330,6 +1374,7 @@ HRESULT Recordset_create( void **obj )
if (!(recordset = heap_alloc_zero( sizeof(*recordset) ))) return E_OUTOFMEMORY;
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
+ recordset->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl;
recordset->refs = 1;
recordset->index = -1;
recordset->state = adStateClosed;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index d6bb50f44e..1fae811d10 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -46,6 +46,7 @@ static LONG get_refs_recordset( _Recordset *recordset )
static void test_Recordset(void)
{
_Recordset *recordset;
+ ISupportErrorInfo *errorinfo;
Fields *fields, *fields2;
LONG refs, count, state;
HRESULT hr;
@@ -91,6 +92,10 @@ static void test_Recordset(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( !count, "got %d\n", count );
+ hr = _Recordset_QueryInterface(recordset, &IID_ISupportErrorInfo, (void**)&errorinfo);
+ ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
+ ISupportErrorInfo_Release(errorinfo);
+
refs = _Recordset_Release( recordset );
ok( !refs, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
[PATCH v2 2/3] msado15: Implement _Connection Open
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/Makefile.in | 2 +-
dlls/msado15/connection.c | 38 ++++++++++++++++++++++++++++++++++++--
dlls/msado15/main.c | 1 +
3 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/dlls/msado15/Makefile.in b/dlls/msado15/Makefile.in
index 9852e0863d..e64da60547 100644
--- a/dlls/msado15/Makefile.in
+++ b/dlls/msado15/Makefile.in
@@ -1,5 +1,5 @@
MODULE = msado15.dll
-IMPORTS = oleaut32
+IMPORTS = oleaut32 ole32
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c
index 73b225628c..2408000abc 100644
--- a/dlls/msado15/connection.c
+++ b/dlls/msado15/connection.c
@@ -21,6 +21,7 @@
#include "winbase.h"
#define COBJMACROS
#include "objbase.h"
+#include "msdasc.h"
#include "msado15_backcompat.h"
#include "wine/debug.h"
@@ -34,6 +35,8 @@ struct connection
{
_Connection Connection_iface;
ISupportErrorInfo ISupportErrorInfo_iface;
+ IDataInitialize *datainit;
+ IDBInitialize *dbinit;
LONG refs;
ObjectStateEnum state;
LONG timeout;
@@ -61,6 +64,11 @@ static ULONG WINAPI connection_Release( _Connection *iface )
LONG refs = InterlockedDecrement( &connection->refs );
if (!refs)
{
+ if (connection->dbinit)
+ IDBInitialize_Release(connection->dbinit);
+ if (connection->datainit)
+ IDataInitialize_Release(connection->datainit);
+
TRACE( "destroying %p\n", connection );
heap_free( connection );
}
@@ -203,9 +211,33 @@ static HRESULT WINAPI connection_RollbackTrans( _Connection *iface )
static HRESULT WINAPI connection_Open( _Connection *iface, BSTR connect_str, BSTR userid, BSTR password,
LONG options )
{
- FIXME( "%p, %s, %s, %p, %08x\n", iface, debugstr_w(connect_str), debugstr_w(userid),
+ struct connection *connection = impl_from_Connection( iface );
+ HRESULT hr;
+
+ TRACE( "%p, %s, %s, %p, %08x\n", iface, debugstr_w(connect_str), debugstr_w(userid),
password, options );
- return E_NOTIMPL;
+
+ hr = CoCreateInstance(&CLSID_MSDAINITIALIZE, NULL, CLSCTX_INPROC_SERVER, &IID_IDataInitialize,(void**)&connection->datainit);
+ if (FAILED(hr))
+ {
+ WARN("Failed to create IDataInitialize object\n");
+ return hr;
+ }
+
+ hr = IDataInitialize_GetDataSource(connection->datainit, NULL, CLSCTX_INPROC_SERVER, connect_str,
+ &IID_IDBInitialize, (IUnknown**)&connection->dbinit);
+ if (FAILED(hr))
+ {
+ WARN("Failed to create IDBInitialize object\n");
+
+ IDataInitialize_Release(connection->datainit);
+ connection->datainit = NULL;
+ return hr;
+ }
+
+ connection->state = adStateOpen;
+
+ return hr;
}
static HRESULT WINAPI connection_get_Errors( _Connection *iface, Errors **obj )
@@ -392,6 +424,8 @@ HRESULT Connection_create( void **obj )
connection->refs = 1;
connection->state = adStateClosed;
connection->timeout = 30;
+ connection->datainit = NULL;
+ connection->dbinit = NULL;
*obj = &connection->Connection_iface;
TRACE( "returning iface %p\n", *obj );
diff --git a/dlls/msado15/main.c b/dlls/msado15/main.c
index 3115474b84..83c4a20566 100644
--- a/dlls/msado15/main.c
+++ b/dlls/msado15/main.c
@@ -21,6 +21,7 @@
#include "winbase.h"
#include "initguid.h"
#define COBJMACROS
+#include "msdasc.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "msado15_backcompat.h"
--
2.17.1
Dec. 13, 2019
[PATCH v2 1/3] msado15: Implement _Recordset get_State
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 7 +++++--
dlls/msado15/tests/msado15.c | 7 ++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index e854b3e824..4b61b552f0 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -1050,8 +1050,10 @@ static HRESULT WINAPI recordset_get_Status( _Recordset *iface, LONG *status )
static HRESULT WINAPI recordset_get_State( _Recordset *iface, LONG *state )
{
- FIXME( "%p, %p\n", iface, state );
- return E_NOTIMPL;
+ struct recordset *recordset = impl_from_Recordset( iface );
+ TRACE( "%p, %p\n", recordset, state );
+ *state = recordset->state;
+ return S_OK;
}
static HRESULT WINAPI recordset__xClone( _Recordset *iface, _Recordset **obj )
@@ -1330,6 +1332,7 @@ HRESULT Recordset_create( void **obj )
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
recordset->refs = 1;
recordset->index = -1;
+ recordset->state = adStateClosed;
*obj = &recordset->Recordset_iface;
TRACE( "returning iface %p\n", *obj );
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index f9a5377c50..d6bb50f44e 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -47,12 +47,17 @@ static void test_Recordset(void)
{
_Recordset *recordset;
Fields *fields, *fields2;
- LONG refs, count;
+ LONG refs, count, state;
HRESULT hr;
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
ok( hr == S_OK, "got %08x\n", hr );
+ state = -1;
+ hr = _Recordset_get_State( recordset, &state );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( state == adStateClosed, "got %d\n", state );
+
/* handing out fields object increases recordset refcount */
refs = get_refs_recordset( recordset );
ok( refs == 1, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
Re: [PATCH 3/3] msado15: Add ISupportErrorInfo support to _Recordset.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62110
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/msado15/tests/msado15.c:93
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/msado15/tests/msado15.c:93
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/msado15/tests/msado15.c:93
Task: Patch failed to apply
Dec. 13, 2019
[PATCH 3/3] msado15: Add ISupportErrorInfo support to _Recordset.
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 61 +++++++++++++++++++++++++++++++-----
dlls/msado15/tests/msado15.c | 5 +++
2 files changed, 58 insertions(+), 8 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index 8a5f7aad41..0dc8a496c0 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -34,14 +34,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msado15);
struct fields;
struct recordset
{
- _Recordset Recordset_iface;
- LONG refs;
- LONG state;
- struct fields *fields;
- LONG count;
- LONG allocated;
- LONG index;
- VARIANT *data;
+ _Recordset Recordset_iface;
+ ISupportErrorInfo ISupportErrorInfo_iface;
+ LONG refs;
+ LONG state;
+ struct fields *fields;
+ LONG count;
+ LONG allocated;
+ LONG index;
+ VARIANT *data;
};
struct fields
@@ -646,6 +647,11 @@ static inline struct recordset *impl_from_Recordset( _Recordset *iface )
return CONTAINING_RECORD( iface, struct recordset, Recordset_iface );
}
+static inline struct recordset *impl_from_ISupportErrorInfo( ISupportErrorInfo *iface )
+{
+ return CONTAINING_RECORD( iface, struct recordset, ISupportErrorInfo_iface );
+}
+
static ULONG WINAPI recordset_AddRef( _Recordset *iface )
{
struct recordset *recordset = impl_from_Recordset( iface );
@@ -690,6 +696,7 @@ static ULONG WINAPI recordset_Release( _Recordset *iface )
static HRESULT WINAPI recordset_QueryInterface( _Recordset *iface, REFIID riid, void **obj )
{
+ struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %s, %p\n", iface, debugstr_guid(riid), obj );
if (IsEqualIID(riid, &IID_IUnknown) ||
@@ -702,6 +709,10 @@ static HRESULT WINAPI recordset_QueryInterface( _Recordset *iface, REFIID riid,
{
*obj = iface;
}
+ else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
+ {
+ *obj = &recordset->ISupportErrorInfo_iface;
+ }
else
{
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
@@ -1242,6 +1253,39 @@ static HRESULT WINAPI recordset_Save( _Recordset *iface, VARIANT destination, Pe
return E_NOTIMPL;
}
+static HRESULT WINAPI supporterror_QueryInterface( ISupportErrorInfo *iface, REFIID riid, void **obj )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_QueryInterface( &recordset->Recordset_iface, riid, obj );
+}
+
+static ULONG WINAPI supporterror_AddRef( ISupportErrorInfo *iface )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_AddRef( &recordset->Recordset_iface );
+}
+
+static ULONG WINAPI supporterror_Release( ISupportErrorInfo *iface )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ return recordset_Release( &recordset->Recordset_iface );
+}
+
+static HRESULT WINAPI supporterror_InterfaceSupportsErrorInfo( ISupportErrorInfo *iface, REFIID riid )
+{
+ struct recordset *recordset = impl_from_ISupportErrorInfo( iface );
+ FIXME( "%p, %s\n", recordset, debugstr_guid(riid) );
+ return S_FALSE;
+}
+
+static const struct ISupportErrorInfoVtbl support_error_vtbl =
+{
+ supporterror_QueryInterface,
+ supporterror_AddRef,
+ supporterror_Release,
+ supporterror_InterfaceSupportsErrorInfo
+};
+
static const struct _RecordsetVtbl recordset_vtbl =
{
recordset_QueryInterface,
@@ -1337,6 +1381,7 @@ HRESULT Recordset_create( void **obj )
if (!(recordset = heap_alloc_zero( sizeof(*recordset) ))) return E_OUTOFMEMORY;
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
+ recordset->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl;
recordset->refs = 1;
recordset->index = -1;
recordset->state = adStateClosed;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index d3c1f30f6d..c25c7fc3cb 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -46,6 +46,7 @@ static LONG get_refs_recordset( _Recordset *recordset )
static void test_Recordset(void)
{
_Recordset *recordset;
+ ISupportErrorInfo *errorinfo;
Fields *fields, *fields2;
LONG refs, count, state;
HRESULT hr;
@@ -93,6 +94,10 @@ static void test_Recordset(void)
hr = _Recordset_Close( recordset );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
+
+ hr = _Recordset_QueryInterface(recordset, &IID_ISupportErrorInfo, (void**)&errorinfo);
+ ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
+ ISupportErrorInfo_Release(errorinfo);
refs = _Recordset_Release( recordset );
ok( !refs, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
[PATCH 2/3] msado15: Implement _Connection Open
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/Makefile.in | 2 +-
dlls/msado15/connection.c | 38 ++++++++++++++++++++++++++++++++++++--
dlls/msado15/main.c | 1 +
3 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/dlls/msado15/Makefile.in b/dlls/msado15/Makefile.in
index 9852e0863d..e64da60547 100644
--- a/dlls/msado15/Makefile.in
+++ b/dlls/msado15/Makefile.in
@@ -1,5 +1,5 @@
MODULE = msado15.dll
-IMPORTS = oleaut32
+IMPORTS = oleaut32 ole32
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c
index 73b225628c..2408000abc 100644
--- a/dlls/msado15/connection.c
+++ b/dlls/msado15/connection.c
@@ -21,6 +21,7 @@
#include "winbase.h"
#define COBJMACROS
#include "objbase.h"
+#include "msdasc.h"
#include "msado15_backcompat.h"
#include "wine/debug.h"
@@ -34,6 +35,8 @@ struct connection
{
_Connection Connection_iface;
ISupportErrorInfo ISupportErrorInfo_iface;
+ IDataInitialize *datainit;
+ IDBInitialize *dbinit;
LONG refs;
ObjectStateEnum state;
LONG timeout;
@@ -61,6 +64,11 @@ static ULONG WINAPI connection_Release( _Connection *iface )
LONG refs = InterlockedDecrement( &connection->refs );
if (!refs)
{
+ if (connection->dbinit)
+ IDBInitialize_Release(connection->dbinit);
+ if (connection->datainit)
+ IDataInitialize_Release(connection->datainit);
+
TRACE( "destroying %p\n", connection );
heap_free( connection );
}
@@ -203,9 +211,33 @@ static HRESULT WINAPI connection_RollbackTrans( _Connection *iface )
static HRESULT WINAPI connection_Open( _Connection *iface, BSTR connect_str, BSTR userid, BSTR password,
LONG options )
{
- FIXME( "%p, %s, %s, %p, %08x\n", iface, debugstr_w(connect_str), debugstr_w(userid),
+ struct connection *connection = impl_from_Connection( iface );
+ HRESULT hr;
+
+ TRACE( "%p, %s, %s, %p, %08x\n", iface, debugstr_w(connect_str), debugstr_w(userid),
password, options );
- return E_NOTIMPL;
+
+ hr = CoCreateInstance(&CLSID_MSDAINITIALIZE, NULL, CLSCTX_INPROC_SERVER, &IID_IDataInitialize,(void**)&connection->datainit);
+ if (FAILED(hr))
+ {
+ WARN("Failed to create IDataInitialize object\n");
+ return hr;
+ }
+
+ hr = IDataInitialize_GetDataSource(connection->datainit, NULL, CLSCTX_INPROC_SERVER, connect_str,
+ &IID_IDBInitialize, (IUnknown**)&connection->dbinit);
+ if (FAILED(hr))
+ {
+ WARN("Failed to create IDBInitialize object\n");
+
+ IDataInitialize_Release(connection->datainit);
+ connection->datainit = NULL;
+ return hr;
+ }
+
+ connection->state = adStateOpen;
+
+ return hr;
}
static HRESULT WINAPI connection_get_Errors( _Connection *iface, Errors **obj )
@@ -392,6 +424,8 @@ HRESULT Connection_create( void **obj )
connection->refs = 1;
connection->state = adStateClosed;
connection->timeout = 30;
+ connection->datainit = NULL;
+ connection->dbinit = NULL;
*obj = &connection->Connection_iface;
TRACE( "returning iface %p\n", *obj );
diff --git a/dlls/msado15/main.c b/dlls/msado15/main.c
index 3115474b84..83c4a20566 100644
--- a/dlls/msado15/main.c
+++ b/dlls/msado15/main.c
@@ -21,6 +21,7 @@
#include "winbase.h"
#include "initguid.h"
#define COBJMACROS
+#include "msdasc.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "msado15_backcompat.h"
--
2.17.1
Dec. 13, 2019
[PATCH 1/3] msado15: Implement _Recordset get_State
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 7 +++++--
dlls/msado15/tests/msado15.c | 7 ++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index f0bb1591aa..8a5f7aad41 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -1057,8 +1057,10 @@ static HRESULT WINAPI recordset_get_Status( _Recordset *iface, LONG *status )
static HRESULT WINAPI recordset_get_State( _Recordset *iface, LONG *state )
{
- FIXME( "%p, %p\n", iface, state );
- return E_NOTIMPL;
+ struct recordset *recordset = impl_from_Recordset( iface );
+ TRACE( "%p, %p\n", recordset, state );
+ *state = recordset->state;
+ return S_OK;
}
static HRESULT WINAPI recordset__xClone( _Recordset *iface, _Recordset **obj )
@@ -1337,6 +1339,7 @@ HRESULT Recordset_create( void **obj )
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
recordset->refs = 1;
recordset->index = -1;
+ recordset->state = adStateClosed;
*obj = &recordset->Recordset_iface;
TRACE( "returning iface %p\n", *obj );
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 494f1be463..d3c1f30f6d 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -47,12 +47,17 @@ static void test_Recordset(void)
{
_Recordset *recordset;
Fields *fields, *fields2;
- LONG refs, count;
+ LONG refs, count, state;
HRESULT hr;
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
ok( hr == S_OK, "got %08x\n", hr );
+ state = -1;
+ hr = _Recordset_get_State( recordset, &state );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( state == adStateClosed, "got %d\n", state );
+
/* handing out fields object increases recordset refcount */
refs = get_refs_recordset( recordset );
ok( refs == 1, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
[PATCH v3 8/8] strmbase: Get rid of the "vtbl" parameter to strmbase_sink_init().
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qcap/avico.c | 24 +-------
dlls/qcap/avimux.c | 23 +-------
dlls/qcap/smartteefilter.c | 23 +-------
dlls/qedit/samplegrabber.c | 24 +-------
dlls/strmbase/pin.c | 101 +++++++++++++++++++-------------
dlls/strmbase/renderer.c | 25 +-------
dlls/strmbase/transform.c | 27 +--------
dlls/winegstreamer/gstdemux.c | 34 ++---------
dlls/wineqtdecoder/qtsplitter.c | 25 +-------
include/wine/strmbase.h | 25 +-------
10 files changed, 73 insertions(+), 258 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c
index ecda162be86..53b8526f449 100644
--- a/dlls/qcap/avico.c
+++ b/dlls/qcap/avico.c
@@ -272,27 +272,6 @@ static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = {
AVICompressorPropertyBag_Save
};
-static const IPinVtbl AVICompressorInputPinVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
{
AVICompressor *This = impl_from_strmbase_pin(base);
@@ -517,8 +496,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;
- strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl,
- &compressor->filter, sink_name, &sink_ops, NULL);
+ strmbase_sink_init(&compressor->sink, &compressor->filter, sink_name, &sink_ops, NULL);
strmbase_source_init(&compressor->source, &compressor->filter, source_name, &source_ops);
*phr = S_OK;
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c
index c17d91322bf..e402479fb17 100644
--- a/dlls/qcap/avimux.c
+++ b/dlls/qcap/avimux.c
@@ -1500,27 +1500,6 @@ static inline AviMux* impl_from_in_IPin(IPin *iface)
return impl_from_strmbase_filter(pin->filter);
}
-static const IPinVtbl AviMuxIn_PinVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BasePinImpl_NewSegment
-};
-
static inline AviMuxIn* AviMuxIn_from_IAMStreamControl(IAMStreamControl *iface)
{
return CONTAINING_RECORD(iface, AviMuxIn, IAMStreamControl_iface);
@@ -1825,7 +1804,7 @@ static HRESULT create_input_pin(AviMux *avimux)
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- strmbase_sink_init(&object->pin, &AviMuxIn_PinVtbl, &avimux->filter, name, &sink_ops, NULL);
+ strmbase_sink_init(&object->pin, &avimux->filter, name, &sink_ops, NULL);
object->pin.IMemInputPin_iface.lpVtbl = &AviMuxIn_MemInputPinVtbl;
object->IAMStreamControl_iface.lpVtbl = &AviMuxIn_AMStreamControlVtbl;
object->IPropertyBag_iface.lpVtbl = &AviMuxIn_PropertyBagVtbl;
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c
index e1fcea55f91..5339cb5134f 100644
--- a/dlls/qcap/smartteefilter.c
+++ b/dlls/qcap/smartteefilter.c
@@ -81,27 +81,6 @@ static const struct strmbase_filter_ops filter_ops =
.filter_destroy = smart_tee_destroy,
};
-static const IPinVtbl SmartTeeFilterInputVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
{
SmartTeeFilter *This = impl_from_strmbase_pin(base);
@@ -358,7 +337,7 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
memset(object, 0, sizeof(*object));
strmbase_filter_init(&object->filter, outer, &CLSID_SmartTee, &filter_ops);
- strmbase_sink_init(&object->sink, &SmartTeeFilterInputVtbl, &object->filter, inputW, &sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, inputW, &sink_ops, NULL);
hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER,
&IID_IMemAllocator, (void **)&object->sink.pAllocator);
if (FAILED(hr))
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c
index 91b8d9dce64..bbd43e79bfd 100644
--- a/dlls/qedit/samplegrabber.c
+++ b/dlls/qedit/samplegrabber.c
@@ -473,28 +473,6 @@ static const IMemInputPinVtbl IMemInputPin_VTable =
SampleGrabber_IMemInputPin_ReceiveCanBlock,
};
-static const IPinVtbl sink_vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static inline SG_Impl *impl_from_sink_pin(struct strmbase_pin *iface)
{
return CONTAINING_RECORD(iface, SG_Impl, sink.pin);
@@ -663,7 +641,7 @@ HRESULT SampleGrabber_create(IUnknown *outer, void **out)
obj->ISampleGrabber_iface.lpVtbl = &ISampleGrabber_VTable;
obj->IMemInputPin_iface.lpVtbl = &IMemInputPin_VTable;
- strmbase_sink_init(&obj->sink, &sink_vtbl, &obj->filter, L"In", &sink_ops, NULL);
+ strmbase_sink_init(&obj->sink, &obj->filter, L"In", &sink_ops, NULL);
strmbase_source_init(&obj->source, &obj->filter, L"Out", &source_ops);
obj->mtype.majortype = GUID_NULL;
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index 177d52740dc..6f22f249766 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -82,7 +82,7 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int ind
return VFW_S_NO_MORE_ITEMS;
}
-HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out)
+static HRESULT WINAPI pin_QueryInterface(IPin *iface, REFIID iid, void **out)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
HRESULT hr;
@@ -107,19 +107,19 @@ HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out)
return S_OK;
}
-ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
+static ULONG WINAPI pin_AddRef(IPin *iface)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
return IBaseFilter_AddRef(&pin->filter->IBaseFilter_iface);
}
-ULONG WINAPI BasePinImpl_Release(IPin *iface)
+static ULONG WINAPI pin_Release(IPin *iface)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
return IBaseFilter_Release(&pin->filter->IBaseFilter_iface);
}
-HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
+static HRESULT WINAPI pin_ConnectedTo(IPin * iface, IPin ** ppPin)
{
struct strmbase_pin *This = impl_from_IPin(iface);
HRESULT hr;
@@ -145,7 +145,7 @@ HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
return hr;
}
-HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI pin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
{
struct strmbase_pin *This = impl_from_IPin(iface);
HRESULT hr;
@@ -171,7 +171,7 @@ HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt
return hr;
}
-HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info)
+static HRESULT WINAPI pin_QueryPinInfo(IPin *iface, PIN_INFO *info)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -184,7 +184,7 @@ HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
+static HRESULT WINAPI pin_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -195,7 +195,7 @@ HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id)
+static HRESULT WINAPI pin_QueryId(IPin *iface, WCHAR **id)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -209,7 +209,7 @@ HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
{
struct strmbase_pin *This = impl_from_IPin(iface);
@@ -219,7 +219,7 @@ HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
return (This->pFuncsTable->pin_query_accept(This, pmt) == S_OK ? S_OK : S_FALSE);
}
-HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)
+static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
AM_MEDIA_TYPE mt;
@@ -235,7 +235,7 @@ HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_me
return enum_media_types_create(pin, enum_media_types);
}
-HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin)
+static HRESULT WINAPI pin_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
{
struct strmbase_pin *This = impl_from_IPin(iface);
@@ -244,14 +244,6 @@ HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin,
return E_NOTIMPL; /* to tell caller that all input pins connected to all output pins */
}
-HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
-{
- TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
- iface, debugstr_time(start), debugstr_time(stop), rate);
-
- return S_OK;
-}
-
/*** OutputPin implementation ***/
static inline struct strmbase_source *impl_source_from_IPin( IPin *iface )
@@ -420,26 +412,33 @@ static HRESULT WINAPI source_EndFlush(IPin *iface)
return E_UNEXPECTED;
}
+static HRESULT WINAPI source_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+{
+ TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
+ iface, debugstr_time(start), debugstr_time(stop), rate);
+ return S_OK;
+}
+
static const IPinVtbl source_vtbl =
{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
+ pin_QueryInterface,
+ pin_AddRef,
+ pin_Release,
source_Connect,
source_ReceiveConnection,
source_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
+ pin_ConnectedTo,
+ pin_ConnectionMediaType,
+ pin_QueryPinInfo,
+ pin_QueryDirection,
+ pin_QueryId,
+ pin_QueryAccept,
+ pin_EnumMediaTypes,
+ pin_QueryInternalConnections,
source_EndOfStream,
source_BeginFlush,
source_EndFlush,
- BasePinImpl_NewSegment,
+ source_NewSegment,
};
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This,
@@ -617,14 +616,14 @@ static struct strmbase_sink *impl_sink_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_sink, pin.IPin_iface);
}
-HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
+static HRESULT WINAPI sink_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
{
ERR("(%p)->(%p, %p) outgoing connection on an input pin!\n", iface, pin, pmt);
return E_UNEXPECTED;
}
-HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
PIN_DIRECTION pindirReceive;
@@ -678,7 +677,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP
return hr;
}
-HRESULT WINAPI BaseInputPinImpl_Disconnect(IPin *iface)
+static HRESULT WINAPI sink_Disconnect(IPin *iface)
{
struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -711,7 +710,7 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused)
return IPin_EndOfStream( pin );
}
-HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
+static HRESULT WINAPI sink_EndOfStream(IPin *iface)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr = S_OK;
@@ -736,7 +735,7 @@ static HRESULT deliver_beginflush(IPin* pin, LPVOID unused)
return IPin_BeginFlush( pin );
}
-HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
+static HRESULT WINAPI sink_BeginFlush(IPin *iface)
{
struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -762,7 +761,7 @@ static HRESULT deliver_endflush(IPin* pin, LPVOID unused)
return IPin_EndFlush( pin );
}
-HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
+static HRESULT WINAPI sink_EndFlush(IPin * iface)
{
struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -795,7 +794,7 @@ static HRESULT deliver_newsegment(IPin *pin, LPVOID data)
return IPin_NewSegment(pin, args->tStart, args->tStop, args->rate);
}
-HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+static HRESULT WINAPI sink_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
{
struct strmbase_sink *pin = impl_sink_from_IPin(iface);
newsegmentargs args;
@@ -813,6 +812,28 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
return SendFurther(pin, deliver_newsegment, &args);
}
+static const IPinVtbl sink_vtbl =
+{
+ pin_QueryInterface,
+ pin_AddRef,
+ pin_Release,
+ sink_Connect,
+ sink_ReceiveConnection,
+ sink_Disconnect,
+ pin_ConnectedTo,
+ pin_ConnectionMediaType,
+ pin_QueryPinInfo,
+ pin_QueryDirection,
+ pin_QueryId,
+ pin_QueryAccept,
+ pin_EnumMediaTypes,
+ pin_QueryInternalConnections,
+ sink_EndOfStream,
+ sink_BeginFlush,
+ sink_EndFlush,
+ sink_NewSegment,
+};
+
/*** IMemInputPin implementation ***/
static inline struct strmbase_sink *impl_from_IMemInputPin(IMemInputPin *iface)
@@ -944,11 +965,11 @@ static const IMemInputPinVtbl MemInputPin_Vtbl =
MemInputPin_ReceiveCanBlock
};
-void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
+void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_sink_ops *func_table, IMemAllocator *allocator)
{
memset(pin, 0, sizeof(*pin));
- pin->pin.IPin_iface.lpVtbl = vtbl;
+ pin->pin.IPin_iface.lpVtbl = &sink_vtbl;
pin->pin.filter = filter;
pin->pin.dir = PINDIR_INPUT;
lstrcpyW(pin->pin.name, name);
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index a3ede130d63..642f9d66715 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -40,28 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
}
-static const IPinVtbl BaseRenderer_InputPin_Vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static struct strmbase_pin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index)
{
struct strmbase_renderer *filter = impl_from_strmbase_filter(iface);
@@ -436,8 +414,7 @@ HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown
filter->pFuncsTable = ops;
- strmbase_sink_init(&filter->sink, &BaseRenderer_InputPin_Vtbl, &filter->filter,
- sink_name, &sink_ops, NULL);
+ strmbase_sink_init(&filter->sink, &filter->filter, sink_name, &sink_ops, NULL);
hr = CreatePosPassThru(outer ? outer : (IUnknown *)&filter->filter.IBaseFilter_iface,
TRUE, &filter->sink.pin.IPin_iface, &filter->pPosition);
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index 69dc93affe1..74be6b107e5 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -26,8 +26,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
static const WCHAR wcsInputPinName[] = {'I','n',0};
static const WCHAR wcsOutputPinName[] = {'O','u','t',0};
-static const IPinVtbl TransformFilter_InputPin_Vtbl;
-
static inline TransformFilter *impl_from_strmbase_filter(struct strmbase_filter *iface)
{
return CONTAINING_RECORD(iface, TransformFilter, filter);
@@ -403,8 +401,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid,
filter->pFuncsTable = func_table;
ZeroMemory(&filter->pmt, sizeof(filter->pmt));
- strmbase_sink_init(&filter->sink, &TransformFilter_InputPin_Vtbl, &filter->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&filter->sink, &filter->filter, wcsInputPinName, &sink_ops, NULL);
strmbase_source_init(&filter->source, &filter->filter, wcsOutputPinName, &source_ops);
filter->source_IQualityControl_iface.lpVtbl = &source_qc_vtbl;
@@ -454,25 +451,3 @@ HRESULT strmbase_transform_create(LONG filter_size, IUnknown *outer, const CLSID
CoTaskMemFree(pTf);
return E_FAIL;
}
-
-static const IPinVtbl TransformFilter_InputPin_Vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 1eae0dae9af..3945d9da8fa 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -97,7 +97,6 @@ const char* media_quark_string = "media-sample";
static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
static const IMediaSeekingVtbl GST_Seeking_Vtbl;
-static const IPinVtbl GST_InputPin_Vtbl;
static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl;
static struct gstdemux_source *create_pin(struct gstdemux *filter, const WCHAR *name);
@@ -1502,8 +1501,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_Gstreamer_Splitter, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, wcsInputPinName, &sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->init_gst = gstdecoder_init_gst;
@@ -1967,27 +1965,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
return S_OK;
}
-static const IPinVtbl GST_InputPin_Vtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
pthread_mutex_t cb_list_lock = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cb_list_cond = PTHREAD_COND_INITIALIZER;
struct list cb_list = LIST_INIT(cb_list);
@@ -2235,8 +2212,7 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &wave_parser_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &wave_parser_sink_ops, NULL);
object->init_gst = wave_parser_init_gst;
*phr = S_OK;
@@ -2339,8 +2315,7 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &avi_splitter_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &avi_splitter_sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->init_gst = avi_splitter_init_gst;
*phr = S_OK;
@@ -2475,8 +2450,7 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &mpeg_splitter_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &mpeg_splitter_sink_ops, NULL);
object->IAMStreamSelect_iface.lpVtbl = &stream_select_vtbl;
object->duration_event = CreateEventW(NULL, FALSE, FALSE, NULL);
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index df6e8ea5d24..1421e0bf53c 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -171,7 +171,6 @@ typedef struct QTSplitter {
HANDLE splitterThread;
} QTSplitter;
-static const IPinVtbl QT_InputPin_Vtbl;
static const IBaseFilterVtbl QT_Vtbl;
static const IMediaSeekingVtbl QT_Seeking_Vtbl;
@@ -421,8 +420,7 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
ZeroMemory(This,sizeof(*This));
strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops);
- strmbase_sink_init(&This->pInputPin.pin, &QT_InputPin_Vtbl, &This->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&This->pInputPin.pin, &This->filter, wcsInputPinName, &sink_ops, NULL);
InitializeCriticalSection(&This->csReceive);
This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive");
@@ -1030,27 +1028,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static const IPinVtbl QT_InputPin_Vtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static inline QTOutPin *impl_source_from_strmbase_pin(struct strmbase_pin *iface)
{
return CONTAINING_RECORD(iface, QTOutPin, pin.pin);
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index c01ef6133f4..48d7638ae16 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -103,20 +103,6 @@ struct strmbase_sink_ops
/* Base Pin */
HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt);
-LONG WINAPI BasePinImpl_GetMediaTypeVersion(struct strmbase_pin *pin);
-HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out);
-ULONG WINAPI BasePinImpl_AddRef(IPin *iface);
-ULONG WINAPI BasePinImpl_Release(IPin *iface);
-HRESULT WINAPI BaseInputPinImpl_Disconnect(IPin * iface);
-HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin);
-HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin * iface, PIN_INFO * pInfo);
-HRESULT WINAPI BasePinImpl_QueryDirection(IPin * iface, PIN_DIRECTION * pPinDir);
-HRESULT WINAPI BasePinImpl_QueryId(IPin * iface, LPWSTR * Id);
-HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum);
-HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin);
-HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *pin,
IMediaSample **sample, REFERENCE_TIME *start, REFERENCE_TIME *stop, DWORD flags);
@@ -130,16 +116,7 @@ void strmbase_source_cleanup(struct strmbase_source *pin);
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_source_ops *func_table);
-/* Base Input Pin */
-HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
-void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
+void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator);
void strmbase_sink_cleanup(struct strmbase_sink *pin);
--
2.24.0
Dec. 13, 2019
[PATCH v3 7/8] wineqtdecoder: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 33 ++++-----------------------------
1 file changed, 4 insertions(+), 29 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index 01ec4c2cede..df6e8ea5d24 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -1030,31 +1030,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static HRESULT WINAPI QTInPin_EndOfStream(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_BeginFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_EndFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- BasePinImpl_NewSegment(iface, tStart, tStop, dRate);
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
@@ -1070,10 +1045,10 @@ static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- QTInPin_EndOfStream,
- QTInPin_BeginFlush,
- QTInPin_EndFlush,
- QTInPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
static inline QTOutPin *impl_source_from_strmbase_pin(struct strmbase_pin *iface)
--
2.24.0
Dec. 13, 2019
[PATCH v3 6/8] winegstreamer: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winegstreamer/gstdemux.c | 36 ++++-------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index fb60d69e2ac..1eae0dae9af 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1967,34 +1967,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
return S_OK;
}
-static HRESULT WINAPI GSTInPin_EndOfStream(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_BeginFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_EndFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_NewSegment(IPin *iface, REFERENCE_TIME start,
- REFERENCE_TIME stop, double rate)
-{
- FIXME("iface %p, start %s, stop %s, rate %.16e, stub!\n",
- iface, wine_dbgstr_longlong(start), wine_dbgstr_longlong(stop), rate);
-
- BasePinImpl_NewSegment(iface, start, stop, rate);
- return S_OK;
-}
-
static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
@@ -2010,10 +1982,10 @@ static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- GSTInPin_EndOfStream,
- GSTInPin_BeginFlush,
- GSTInPin_EndFlush,
- GSTInPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
pthread_mutex_t cb_list_lock = PTHREAD_MUTEX_INITIALIZER;
--
2.24.0
Dec. 13, 2019
[PATCH v3 5/8] strmbase/renderer: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/renderer.c | 137 ++++++++++++++++++---------------------
1 file changed, 63 insertions(+), 74 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index 7b9736ccfb2..a3ede130d63 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -40,77 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
}
-static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface)
-{
- struct strmbase_renderer *filter = impl_from_IPin(iface);
- IFilterGraph *graph = filter->filter.filterInfo.pGraph;
- IMediaEventSink *event_sink;
- HRESULT hr = S_OK;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&filter->csRenderLock);
- filter->eos = TRUE;
-
- if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph,
- &IID_IMediaEventSink, (void **)&event_sink)))
- {
- IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK,
- (LONG_PTR)&filter->filter.IBaseFilter_iface);
- IMediaEventSink_Release(event_sink);
- }
- RendererPosPassThru_EOS(filter->pPosition);
- SetEvent(filter->state_event);
-
- if (filter->pFuncsTable->pfnEndOfStream)
- hr = filter->pFuncsTable->pfnEndOfStream(filter);
- LeaveCriticalSection(&filter->csRenderLock);
- return hr;
-}
-
-static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface)
-{
- struct strmbase_renderer *pFilter = impl_from_IPin(iface);
- HRESULT hr;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&pFilter->filter.csFilter);
- hr = BaseInputPinImpl_BeginFlush(iface);
- if (SUCCEEDED(hr))
- {
- BaseRendererImpl_ClearPendingSample(pFilter);
- SetEvent(pFilter->flush_event);
- }
- LeaveCriticalSection(&pFilter->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
-{
- struct strmbase_renderer *pFilter = impl_from_IPin(iface);
- HRESULT hr;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&pFilter->filter.csFilter);
- EnterCriticalSection(&pFilter->csRenderLock);
- pFilter->eos = FALSE;
- hr = BaseInputPinImpl_EndFlush(iface);
- if (SUCCEEDED(hr))
- {
- QualityControlRender_Start(pFilter->qcimpl, pFilter->stream_start);
- RendererPosPassThru_ResetMediaTime(pFilter->pPosition);
- ResetEvent(pFilter->flush_event);
-
- if (pFilter->pFuncsTable->pfnEndFlush)
- hr = pFilter->pFuncsTable->pfnEndFlush(pFilter);
- }
- LeaveCriticalSection(&pFilter->csRenderLock);
- LeaveCriticalSection(&pFilter->filter.csFilter);
- return hr;
-}
-
static const IPinVtbl BaseRenderer_InputPin_Vtbl =
{
BasePinImpl_QueryInterface,
@@ -127,9 +56,9 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl =
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- BaseRenderer_InputPin_EndOfStream,
- BaseRenderer_InputPin_BeginFlush,
- BaseRenderer_InputPin_EndFlush,
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
@@ -289,6 +218,63 @@ static void sink_disconnect(struct strmbase_sink *iface)
filter->pFuncsTable->pfnBreakConnect(filter);
}
+static HRESULT sink_eos(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+ IFilterGraph *graph = filter->filter.filterInfo.pGraph;
+ IMediaEventSink *event_sink;
+ HRESULT hr;
+
+ EnterCriticalSection(&filter->csRenderLock);
+
+ filter->eos = TRUE;
+
+ if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph,
+ &IID_IMediaEventSink, (void **)&event_sink)))
+ {
+ IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK,
+ (LONG_PTR)&filter->filter.IBaseFilter_iface);
+ IMediaEventSink_Release(event_sink);
+ }
+ RendererPosPassThru_EOS(filter->pPosition);
+ SetEvent(filter->state_event);
+
+ if (filter->pFuncsTable->pfnEndOfStream)
+ hr = filter->pFuncsTable->pfnEndOfStream(filter);
+
+ LeaveCriticalSection(&filter->csRenderLock);
+ return hr;
+}
+
+static HRESULT sink_begin_flush(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+
+ BaseRendererImpl_ClearPendingSample(filter);
+ SetEvent(filter->flush_event);
+
+ return S_OK;
+}
+
+static HRESULT sink_end_flush(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ EnterCriticalSection(&filter->csRenderLock);
+
+ filter->eos = FALSE;
+ QualityControlRender_Start(filter->qcimpl, filter->stream_start);
+ RendererPosPassThru_ResetMediaTime(filter->pPosition);
+ ResetEvent(filter->flush_event);
+
+ if (filter->pFuncsTable->pfnEndFlush)
+ hr = filter->pFuncsTable->pfnEndFlush(filter);
+
+ LeaveCriticalSection(&filter->csRenderLock);
+ return hr;
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
@@ -297,6 +283,9 @@ static const struct strmbase_sink_ops sink_ops =
.pfnReceive = BaseRenderer_Receive,
.sink_connect = sink_connect,
.sink_disconnect = sink_disconnect,
+ .sink_eos = sink_eos,
+ .sink_begin_flush = sink_begin_flush,
+ .sink_end_flush = sink_end_flush,
};
void strmbase_renderer_cleanup(struct strmbase_renderer *filter)
--
2.24.0
Dec. 13, 2019
[PATCH v3 4/8] strmbase/transform: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/transform.c | 116 ++++++++++++++++++--------------------
1 file changed, 54 insertions(+), 62 deletions(-)
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index 993e30202bc..69dc93affe1 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -229,6 +229,52 @@ static void sink_disconnect(struct strmbase_sink *iface)
filter->pFuncsTable->pfnBreakConnect(filter, PINDIR_INPUT);
}
+static HRESULT sink_eos(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+
+ if (filter->source.pin.peer)
+ return IPin_EndOfStream(filter->source.pin.peer);
+ return VFW_E_NOT_CONNECTED;
+}
+
+static HRESULT sink_begin_flush(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ if (filter->pFuncsTable->pfnBeginFlush)
+ hr = filter->pFuncsTable->pfnBeginFlush(filter);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_BeginFlush(filter->source.pin.peer);
+ return hr;
+}
+
+static HRESULT sink_end_flush(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ if (filter->pFuncsTable->pfnEndFlush)
+ hr = filter->pFuncsTable->pfnEndFlush(filter);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_EndFlush(filter->source.pin.peer);
+ return hr;
+}
+
+static HRESULT sink_new_segment(struct strmbase_sink *iface,
+ REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ if (filter->pFuncsTable->pfnNewSegment)
+ hr = filter->pFuncsTable->pfnNewSegment(filter, start, stop, rate);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_NewSegment(filter->source.pin.peer, start, stop, rate);
+ return hr;
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
@@ -237,6 +283,10 @@ static const struct strmbase_sink_ops sink_ops =
.pfnReceive = TransformFilter_Input_Receive,
.sink_connect = sink_connect,
.sink_disconnect = sink_disconnect,
+ .sink_eos = sink_eos,
+ .sink_begin_flush = sink_begin_flush,
+ .sink_end_flush = sink_end_flush,
+ .sink_new_segment = sink_new_segment,
};
static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
@@ -405,64 +455,6 @@ HRESULT strmbase_transform_create(LONG filter_size, IUnknown *outer, const CLSID
return E_FAIL;
}
-static HRESULT WINAPI TransformFilter_InputPin_EndOfStream(IPin * iface)
-{
- TransformFilter *filter = impl_from_sink_IPin(iface);
-
- TRACE("iface %p.\n", iface);
-
- if (filter->source.pin.peer)
- return IPin_EndOfStream(filter->source.pin.peer);
- return VFW_E_NOT_CONNECTED;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_BeginFlush(IPin * iface)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("(%p)->()\n", iface);
-
- EnterCriticalSection(&pTransform->filter.csFilter);
- if (pTransform->pFuncsTable->pfnBeginFlush)
- hr = pTransform->pFuncsTable->pfnBeginFlush(pTransform);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_BeginFlush(iface);
- LeaveCriticalSection(&pTransform->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_EndFlush(IPin * iface)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("(%p)->()\n", iface);
-
- EnterCriticalSection(&pTransform->filter.csFilter);
- if (pTransform->pFuncsTable->pfnEndFlush)
- hr = pTransform->pFuncsTable->pfnEndFlush(pTransform);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_EndFlush(iface);
- LeaveCriticalSection(&pTransform->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
- iface, debugstr_time(tStart), debugstr_time(tStop), dRate);
-
- if (pTransform->pFuncsTable->pfnNewSegment)
- hr = pTransform->pFuncsTable->pfnNewSegment(pTransform, tStart, tStop, dRate);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_NewSegment(iface, tStart, tStop, dRate);
- return hr;
-}
-
static const IPinVtbl TransformFilter_InputPin_Vtbl =
{
BasePinImpl_QueryInterface,
@@ -479,8 +471,8 @@ static const IPinVtbl TransformFilter_InputPin_Vtbl =
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- TransformFilter_InputPin_EndOfStream,
- TransformFilter_InputPin_BeginFlush,
- TransformFilter_InputPin_EndFlush,
- TransformFilter_InputPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
--
2.24.0
Dec. 13, 2019
[PATCH v3 3/8] strmbase: Introduce callbacks for streaming events.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
v3: call sink_begin_flush()/sink_end_flush() in a more sensible place
dlls/strmbase/pin.c | 42 +++++++++++++++++++++++++++++------------
include/wine/strmbase.h | 4 ++++
2 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index 3dd00b27ccc..177d52740dc 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -718,6 +718,9 @@ HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
TRACE("(%p)->()\n", This);
+ if (This->pFuncsTable->sink_eos)
+ return This->pFuncsTable->sink_eos(This);
+
EnterCriticalSection(&This->pin.filter->csFilter);
if (This->flushing)
hr = S_FALSE;
@@ -735,15 +738,21 @@ static HRESULT deliver_beginflush(IPin* pin, LPVOID unused)
HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
{
- struct strmbase_sink *This = impl_sink_from_IPin(iface);
+ struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr;
- TRACE("(%p) semi-stub\n", This);
- EnterCriticalSection(&This->pin.filter->csFilter);
- This->flushing = TRUE;
+ TRACE("pin %p.\n", pin);
- hr = SendFurther(This, deliver_beginflush, NULL);
- LeaveCriticalSection(&This->pin.filter->csFilter);
+ EnterCriticalSection(&pin->pin.filter->csFilter);
+
+ pin->flushing = TRUE;
+
+ if (pin->pFuncsTable->sink_begin_flush)
+ hr = pin->pFuncsTable->sink_begin_flush(pin);
+ else
+ hr = SendFurther(pin, deliver_beginflush, NULL);
+
+ LeaveCriticalSection(&pin->pin.filter->csFilter);
return hr;
}
@@ -755,15 +764,21 @@ static HRESULT deliver_endflush(IPin* pin, LPVOID unused)
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
{
- struct strmbase_sink *This = impl_sink_from_IPin(iface);
+ struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr;
- TRACE("(%p)->()\n", This);
- EnterCriticalSection(&This->pin.filter->csFilter);
- This->flushing = FALSE;
+ TRACE("pin %p.\n", pin);
- hr = SendFurther(This, deliver_endflush, NULL);
- LeaveCriticalSection(&This->pin.filter->csFilter);
+ EnterCriticalSection(&pin->pin.filter->csFilter);
+
+ pin->flushing = FALSE;
+
+ if (pin->pFuncsTable->sink_end_flush)
+ hr = pin->pFuncsTable->sink_end_flush(pin);
+ else
+ hr = SendFurther(pin, deliver_endflush, NULL);
+
+ LeaveCriticalSection(&pin->pin.filter->csFilter);
return hr;
}
@@ -788,6 +803,9 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
iface, debugstr_time(start), debugstr_time(stop), rate);
+ if (pin->pFuncsTable->sink_new_segment)
+ return pin->pFuncsTable->sink_new_segment(pin, start, stop, rate);
+
args.tStart = start;
args.tStop = stop;
args.rate = rate;
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index 83ad2e0bd6e..c01ef6133f4 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -95,6 +95,10 @@ struct strmbase_sink_ops
BaseInputPin_Receive pfnReceive;
HRESULT (*sink_connect)(struct strmbase_sink *pin, IPin *peer, const AM_MEDIA_TYPE *mt);
void (*sink_disconnect)(struct strmbase_sink *pin);
+ HRESULT (*sink_eos)(struct strmbase_sink *pin);
+ HRESULT (*sink_begin_flush)(struct strmbase_sink *pin);
+ HRESULT (*sink_end_flush)(struct strmbase_sink *pin);
+ HRESULT (*sink_new_segment)(struct strmbase_sink *pin, REFERENCE_TIME start, REFERENCE_TIME stop, double rate);
};
/* Base Pin */
--
2.24.0
Dec. 13, 2019
[PATCH v3 2/8] wineqtdecoder: Use base sink connection methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 206 ++++++++++++--------------------
1 file changed, 75 insertions(+), 131 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index c8a34cbf95e..01ec4c2cede 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -228,7 +228,6 @@ static struct strmbase_pin *qt_splitter_get_pin(struct strmbase_filter *base, un
static void qt_splitter_destroy(struct strmbase_filter *iface)
{
QTSplitter *filter = impl_from_strmbase_filter(iface);
- IPin *peer = NULL;
EnterCriticalSection(&filter->csReceive);
/* Don't need to clean up output pins, disconnecting input pin will do that */
@@ -285,13 +284,15 @@ static HRESULT qt_splitter_start_stream(struct strmbase_filter *iface, REFERENCE
EnterCriticalSection(&filter->csReceive);
if (filter->pVideo_Pin)
- pin_hr = BaseOutputPinImpl_Active(&filter->pVideo_Pin->pin);
- if (SUCCEEDED(pin_hr))
- hr = pin_hr;
+ {
+ if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->pVideo_Pin->pin)))
+ hr = pin_hr;
+ }
if (filter->pAudio_Pin)
- pin_hr = BaseOutputPinImpl_Active(&filter->pAudio_Pin->pin);
- if (SUCCEEDED(pin_hr))
- hr = pin_hr;
+ {
+ if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->pAudio_Pin->pin)))
+ hr = pin_hr;
+ }
SetEvent(filter->runEvent);
LeaveCriticalSection(&filter->csReceive);
@@ -331,10 +332,75 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_FALSE;
}
+static HRESULT QT_Process_Movie(QTSplitter *filter);
+
+static HRESULT qt_splitter_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
+{
+ QTSplitter *filter = impl_from_strmbase_filter(iface->pin.filter);
+ ALLOCATOR_PROPERTIES props;
+ IMemAllocator *allocator;
+ HRESULT hr = S_OK;
+
+ filter->pInputPin.pReader = NULL;
+
+ if (FAILED(hr = IPin_QueryInterface(peer, &IID_IAsyncReader, (void **)&filter->pInputPin.pReader)))
+ return hr;
+
+ if (FAILED(hr = QT_Process_Movie(filter)))
+ {
+ IAsyncReader_Release(filter->pInputPin.pReader);
+ filter->pInputPin.pReader = NULL;
+ return hr;
+ }
+
+ filter->pInputPin.pAlloc = NULL;
+ props.cBuffers = 8;
+ props.cbAlign = 1;
+ props.cbBuffer = filter->outputSize + props.cbAlign;
+ props.cbPrefix = 0;
+
+ /* Some applications depend on IAsyncReader::RequestAllocator() passing a
+ * non-NULL preferred allocator. */
+ hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
+ &IID_IMemAllocator, (void **)&allocator);
+ if (FAILED(hr))
+ goto err;
+
+ hr = IAsyncReader_RequestAllocator(filter->pInputPin.pReader, allocator, &props, &filter->pInputPin.pAlloc);
+ IMemAllocator_Release(allocator);
+ if (FAILED(hr))
+ {
+ WARN("Failed to get allocator, hr %#x.\n", hr);
+ goto err;
+ }
+
+ if (FAILED(hr = IMemAllocator_Commit(filter->pInputPin.pAlloc)))
+ {
+ WARN("Failed to commit allocator, hr %#x.\n", hr);
+ goto err;
+ }
+
+ return S_OK;
+err:
+ QT_RemoveOutputPins(filter);
+ IAsyncReader_Release(filter->pInputPin.pReader);
+ return hr;
+}
+
+static void qt_splitter_sink_disconnect(struct strmbase_sink *iface)
+{
+ QTSplitter *filter = impl_from_strmbase_filter(iface->pin.filter);
+
+ IMemAllocator_Decommit(filter->pInputPin.pAlloc);
+ QT_RemoveOutputPins(filter);
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
.base.pin_get_media_type = strmbase_pin_get_media_type,
+ .sink_connect = qt_splitter_sink_connect,
+ .sink_disconnect = qt_splitter_sink_disconnect,
};
IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
@@ -964,128 +1030,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
-{
- HRESULT hr = S_OK;
- ALLOCATOR_PROPERTIES props;
- QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.filter);
- IMemAllocator *pAlloc;
-
- TRACE("(%p/%p)->(%p, %p)\n", This, iface, pReceivePin, pmt);
-
- EnterCriticalSection(&filter->filter.csFilter);
- This->pReader = NULL;
-
- if (This->pin.pin.peer)
- hr = VFW_E_ALREADY_CONNECTED;
- else if (IPin_QueryAccept(iface, pmt) != S_OK)
- hr = VFW_E_TYPE_NOT_ACCEPTED;
- else
- {
- PIN_DIRECTION pindirReceive;
- IPin_QueryDirection(pReceivePin, &pindirReceive);
- if (pindirReceive != PINDIR_OUTPUT)
- hr = VFW_E_INVALID_DIRECTION;
- }
-
- if (FAILED(hr))
- {
- LeaveCriticalSection(&filter->filter.csFilter);
- return hr;
- }
-
- hr = IPin_QueryInterface(pReceivePin, &IID_IAsyncReader, (LPVOID *)&This->pReader);
- if (FAILED(hr))
- {
- LeaveCriticalSection(&filter->filter.csFilter);
- TRACE("Input source is not an AsyncReader\n");
- return hr;
- }
-
- LeaveCriticalSection(&filter->filter.csFilter);
- EnterCriticalSection(&filter->filter.csFilter);
- hr = QT_Process_Movie(filter);
- if (FAILED(hr))
- {
- IAsyncReader_Release(This->pReader);
- This->pReader = NULL;
- LeaveCriticalSection(&filter->filter.csFilter);
- TRACE("Unable to process movie\n");
- return hr;
- }
-
- This->pAlloc = NULL;
- props.cBuffers = 8;
- props.cbAlign = 1;
- props.cbBuffer = filter->outputSize + props.cbAlign;
- props.cbPrefix = 0;
- hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
- &IID_IMemAllocator, (LPVOID *)&pAlloc);
- if (SUCCEEDED(hr))
- {
- /* A certain IAsyncReader::RequestAllocator expects to be passed
- non-NULL preferred allocator */
- hr = IAsyncReader_RequestAllocator(This->pReader, pAlloc, &props, &This->pAlloc);
- if (FAILED(hr))
- WARN("Can't get an allocator, got %08x\n", hr);
- IMemAllocator_Release(pAlloc);
- }
-
- if (SUCCEEDED(hr))
- {
- CopyMediaType(&This->pin.mt, pmt);
- This->pin.peer = pReceivePin;
- IPin_AddRef(pReceivePin);
- hr = IMemAllocator_Commit(This->pAlloc);
- }
- else
- {
- QT_RemoveOutputPins(filter);
- if (This->pReader)
- IAsyncReader_Release(This->pReader);
- This->pReader = NULL;
- if (This->pAlloc)
- IMemAllocator_Release(This->pAlloc);
- This->pAlloc = NULL;
- }
- TRACE("Size: %i\n", props.cbBuffer);
- LeaveCriticalSection(&filter->filter.csFilter);
-
- return hr;
-}
-
-static HRESULT WINAPI QTInPin_Disconnect(IPin *iface)
-{
- HRESULT hr;
- QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.pin.filter);
- FILTER_STATE state;
- TRACE("()\n");
-
- hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state);
- EnterCriticalSection(&filter->filter.csFilter);
- if (This->pin.pin.peer)
- {
- QTSplitter *Parser = impl_from_strmbase_filter(This->pin.pin.filter);
-
- if (SUCCEEDED(hr) && state == State_Stopped)
- {
- IMemAllocator_Decommit(This->pAlloc);
- IPin_Disconnect(This->pin.pin.peer);
- IPin_Release(This->pin.pin.peer);
- This->pin.pin.peer = NULL;
- hr = QT_RemoveOutputPins(Parser);
- }
- else
- hr = VFW_E_NOT_STOPPED;
- }
- else
- hr = S_FALSE;
- LeaveCriticalSection(&filter->filter.csFilter);
- return hr;
-}
-
static HRESULT WINAPI QTInPin_EndOfStream(IPin *iface)
{
FIXME("iface %p, stub!\n", iface);
@@ -1116,8 +1060,8 @@ static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
- QTInPin_ReceiveConnection,
- QTInPin_Disconnect,
+ BaseInputPinImpl_ReceiveConnection,
+ BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
--
2.24.0
Dec. 13, 2019
[PATCH v3 1/8] wineqtdecoder: Store the sink as a strmbase_sink structure.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 43 ++++++++++++++-------------------
1 file changed, 18 insertions(+), 25 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index d861110f5f1..c8a34cbf95e 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -138,7 +138,7 @@ typedef struct QTOutPin {
} QTOutPin;
typedef struct QTInPin {
- struct strmbase_pin pin;
+ struct strmbase_sink pin;
GUID subType;
IAsyncReader *pReader;
@@ -199,7 +199,7 @@ static inline QTSplitter *impl_from_IBaseFilter( IBaseFilter *iface )
static inline QTInPin *impl_from_IPin(IPin *iface)
{
- return CONTAINING_RECORD(iface, QTInPin, pin.IPin_iface);
+ return CONTAINING_RECORD(iface, QTInPin, pin.pin.IPin_iface);
}
/*
@@ -211,7 +211,7 @@ static struct strmbase_pin *qt_splitter_get_pin(struct strmbase_filter *base, un
QTSplitter *filter = impl_from_strmbase_filter(base);
if (index == 0)
- return &filter->pInputPin.pin;
+ return &filter->pInputPin.pin.pin;
else if (index == 1)
{
if (filter->pVideo_Pin)
@@ -232,18 +232,15 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
EnterCriticalSection(&filter->csReceive);
/* Don't need to clean up output pins, disconnecting input pin will do that */
+ if (filter->pInputPin.pin.pin.peer)
+ IPin_Disconnect(filter->pInputPin.pin.pin.peer);
- if (filter->pInputPin.pin.peer)
- IPin_Disconnect(filter->pInputPin.pin.peer);
-
- FreeMediaType(&filter->pInputPin.pin.mt);
if (filter->pInputPin.pAlloc)
IMemAllocator_Release(filter->pInputPin.pAlloc);
filter->pInputPin.pAlloc = NULL;
if (filter->pInputPin.pReader)
IAsyncReader_Release(filter->pInputPin.pReader);
filter->pInputPin.pReader = NULL;
- filter->pInputPin.pin.IPin_iface.lpVtbl = NULL;
if (filter->pQTMovie)
{
@@ -274,6 +271,7 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
filter->csReceive.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&filter->csReceive);
+ strmbase_sink_cleanup(&filter->pInputPin.pin);
strmbase_filter_cleanup(&filter->filter);
CoTaskMemFree(filter);
@@ -333,10 +331,10 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_FALSE;
}
-static const BasePinFuncTable sink_ops =
+static const struct strmbase_sink_ops sink_ops =
{
- .pin_query_accept = sink_query_accept,
- .pin_get_media_type = strmbase_pin_get_media_type,
+ .base.pin_query_accept = sink_query_accept,
+ .base.pin_get_media_type = strmbase_pin_get_media_type,
};
IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
@@ -357,6 +355,8 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
ZeroMemory(This,sizeof(*This));
strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops);
+ strmbase_sink_init(&This->pInputPin.pin, &QT_InputPin_Vtbl, &This->filter,
+ wcsInputPinName, &sink_ops, NULL);
InitializeCriticalSection(&This->csReceive);
This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive");
@@ -366,13 +366,6 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
This->aSession = NULL;
This->runEvent = CreateEventW(NULL, 0, 0, NULL);
- This->pInputPin.pin.dir = PINDIR_INPUT;
- This->pInputPin.pin.filter = &This->filter;
- lstrcpynW(This->pInputPin.pin.name, wcsInputPinName, ARRAY_SIZE(This->pInputPin.pin.name));
- This->pInputPin.pin.IPin_iface.lpVtbl = &QT_InputPin_Vtbl;
- This->pInputPin.pin.peer = NULL;
- This->pInputPin.pin.pFuncsTable = &sink_ops;
-
*phr = S_OK;
return &This->filter.IUnknown_inner;
}
@@ -984,7 +977,7 @@ static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
EnterCriticalSection(&filter->filter.csFilter);
This->pReader = NULL;
- if (This->pin.peer)
+ if (This->pin.pin.peer)
hr = VFW_E_ALREADY_CONNECTED;
else if (IPin_QueryAccept(iface, pmt) != S_OK)
hr = VFW_E_TYPE_NOT_ACCEPTED;
@@ -1066,22 +1059,22 @@ static HRESULT WINAPI QTInPin_Disconnect(IPin *iface)
{
HRESULT hr;
QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.filter);
+ QTSplitter *filter = impl_from_strmbase_filter(This->pin.pin.filter);
FILTER_STATE state;
TRACE("()\n");
hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state);
EnterCriticalSection(&filter->filter.csFilter);
- if (This->pin.peer)
+ if (This->pin.pin.peer)
{
- QTSplitter *Parser = impl_from_strmbase_filter(This->pin.filter);
+ QTSplitter *Parser = impl_from_strmbase_filter(This->pin.pin.filter);
if (SUCCEEDED(hr) && state == State_Stopped)
{
IMemAllocator_Decommit(This->pAlloc);
- IPin_Disconnect(This->pin.peer);
- IPin_Release(This->pin.peer);
- This->pin.peer = NULL;
+ IPin_Disconnect(This->pin.pin.peer);
+ IPin_Release(This->pin.pin.peer);
+ This->pin.pin.peer = NULL;
hr = QT_RemoveOutputPins(Parser);
}
else
--
2.24.0
Dec. 13, 2019
[PATCH v2 2/2] gdiplus: GdipGraphicsClear() should overwrite pixels, not alpha blend
by Damjan Jovanovic
All sample code in the Python Pyglet library suffers from terrible
text corruption, caused by the inability to erase the background
between rendering sequential font glyphs, resulting in leftovers
from previous letters mixing with the image of new letters.
This is because it attempts to erase the background by calling
GdipGraphicsClear() with ARGB color 0x00000000 (completely
transparent black), and in our gdiplus alpha blending that into
the background has no effect. It should be using
CompositeModeSourceCopy to overwrite the background with that brush
instead.
Try 2 split the patch.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30506
Signed-off-by: Damjan Jovanovic <damjan.jov(a)gmail.com>
---
dlls/gdiplus/graphics.c | 4 ++++
dlls/gdiplus/tests/image.c | 43 ++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+)
Dec. 13, 2019
[PATCH v2 1/2] gdiplus: start implementing CompositingModeSourceCopy
by Damjan Jovanovic
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30506
Signed-off-by: Damjan Jovanovic <damjan.jov(a)gmail.com>
---
dlls/gdiplus/graphics.c | 22 +++++++++++++++-------
dlls/gdiplus/tests/image.c | 4 ++--
2 files changed, 17 insertions(+), 9 deletions(-)
Dec. 13, 2019
Re: [PATCH vkd3d 1/2] vkd3d: Add queries for KHR_timeline_semaphore extension.
by Conor McCarthy
On Fri, Dec 13, 2019 at 5:03 AM Rémi Bernon <rbernon(a)codeweavers.com> wrote:
> +
> + timeline_semaphore = &info->timeline_semaphore_properties;
> + TRACE(" VkPhysicalDeviceTimelineSemaphorePropertiesKHR:\n");
> + TRACE(" maxTimelineSemaphoreValueDifference: %u.\n",
> timeline_semaphore->maxTimelineSemaphoreValueDifference);
> }
>
maxTimelineSemaphoreValueDifference is declared as uint64_t, so this causes
a format argument warning.
Conor
Dec. 13, 2019
[PATCH 3/3] configure: Remove no-longer-needed check for mach-o/dyld_images.h header file.
by Ken Thomases
Signed-off-by: Ken Thomases <ken(a)codeweavers.com>
---
configure.ac | 8 --------
1 file changed, 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7fc85841caf..2117e500f90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -648,14 +648,6 @@ AC_CHECK_HEADERS([linux/ipx.h linux/irda.h linux/rtnetlink.h],,,
# include <linux/types.h>
#endif])
-AC_CHECK_HEADERS([mach-o/dyld_images.h],,,
- [#ifdef HAVE_STDBOOL_H
- # include <stdbool.h>
- #endif
- #ifdef HAVE_STDINT_H
- # include <stdint.h>
- #endif])
-
AC_CHECK_HEADERS([resolv.h],,,
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
--
2.21.0
Dec. 13, 2019
[PATCH 2/3] dbghelp: Fix reading the target's dyld image info, based on its CPU architecture.
by Ken Thomases
Signed-off-by: Ken Thomases <ken(a)codeweavers.com>
---
dlls/dbghelp/macho_module.c | 134 ++++++++++++++++++++++++++----------
1 file changed, 97 insertions(+), 37 deletions(-)
diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c
index 8eda11ab91c..f957439d435 100644
--- a/dlls/dbghelp/macho_module.c
+++ b/dlls/dbghelp/macho_module.c
@@ -60,23 +60,39 @@
#include <mach-o/nlist.h>
#include <mach-o/dyld.h>
-#ifdef HAVE_MACH_O_DYLD_IMAGES_H
-#include <mach-o/dyld_images.h>
-#else
-struct dyld_image_info {
- const struct mach_header *imageLoadAddress;
- const char *imageFilePath;
- uintptr_t imageFileModDate;
+struct dyld_image_info32 {
+ uint32_t /* const struct mach_header* */ imageLoadAddress;
+ uint32_t /* const char* */ imageFilePath;
+ uint32_t /* uintptr_t */ imageFileModDate;
};
-struct dyld_all_image_infos {
- uint32_t version;
- uint32_t infoArrayCount;
- const struct dyld_image_info *infoArray;
- void* notification;
- int processDetachedFromSharedRegion;
+struct dyld_all_image_infos32 {
+ uint32_t version;
+ uint32_t infoArrayCount;
+ uint32_t /* const struct dyld_image_info* */ infoArray;
+};
+
+struct dyld_image_info64 {
+ uint64_t /* const struct mach_header* */ imageLoadAddress;
+ uint64_t /* const char* */ imageFilePath;
+ uint64_t /* uintptr_t */ imageFileModDate;
+};
+
+struct dyld_all_image_infos64 {
+ uint32_t version;
+ uint32_t infoArrayCount;
+ uint64_t /* const struct dyld_image_info* */ infoArray;
+};
+
+union wine_image_info {
+ struct dyld_image_info32 info32;
+ struct dyld_image_info64 info64;
+};
+
+union wine_all_image_infos {
+ struct dyld_all_image_infos32 infos32;
+ struct dyld_all_image_infos64 infos64;
};
-#endif
#ifdef WORDS_BIGENDIAN
#define swap_ulong_be_to_host(n) (n)
@@ -1649,8 +1665,8 @@ static BOOL macho_enum_modules_internal(const struct process* pcs,
const WCHAR* main_name,
enum_modules_cb cb, void* user)
{
- struct dyld_all_image_infos image_infos;
- struct dyld_image_info* info_array = NULL;
+ union wine_all_image_infos image_infos;
+ union wine_image_info* info_array = NULL;
unsigned long len;
int i;
char bufstr[256];
@@ -1660,31 +1676,55 @@ static BOOL macho_enum_modules_internal(const struct process* pcs,
TRACE("(%p/%p, %s, %p, %p)\n", pcs, pcs->handle, debugstr_w(main_name), cb,
user);
+ if (pcs->is_64bit)
+ len = sizeof(image_infos.infos64);
+ else
+ len = sizeof(image_infos.infos32);
if (!pcs->dbg_hdr_addr ||
!ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr,
- &image_infos, sizeof(image_infos), NULL) ||
- !image_infos.infoArray)
+ &image_infos, len, NULL))
goto done;
- TRACE("Process has %u image infos at %p\n", image_infos.infoArrayCount, image_infos.infoArray);
+ if (!pcs->is_64bit)
+ {
+ struct dyld_all_image_infos32 temp = image_infos.infos32;
+ image_infos.infos64.infoArrayCount = temp.infoArrayCount;
+ image_infos.infos64.infoArray = temp.infoArray;
+ }
+ if (!image_infos.infos64.infoArray)
+ goto done;
+ TRACE("Process has %u image infos at %p\n", image_infos.infos64.infoArrayCount, (void*)image_infos.infos64.infoArray);
- len = image_infos.infoArrayCount * sizeof(info_array[0]);
+ if (pcs->is_64bit)
+ len = sizeof(info_array->info64);
+ else
+ len = sizeof(info_array->info32);
+ len *= image_infos.infos64.infoArrayCount;
info_array = HeapAlloc(GetProcessHeap(), 0, len);
if (!info_array ||
- !ReadProcessMemory(pcs->handle, image_infos.infoArray,
+ !ReadProcessMemory(pcs->handle, (void*)image_infos.infos64.infoArray,
info_array, len, NULL))
goto done;
TRACE("... read image infos\n");
- for (i = 0; i < image_infos.infoArrayCount; i++)
+ for (i = 0; i < image_infos.infos64.infoArrayCount; i++)
{
- if (info_array[i].imageFilePath != NULL &&
- ReadProcessMemory(pcs->handle, info_array[i].imageFilePath, bufstr, sizeof(bufstr), NULL))
+ struct dyld_image_info64 info;
+ if (pcs->is_64bit)
+ info = info_array[i].info64;
+ else
+ {
+ struct dyld_image_info32 *info32 = &info_array->info32 + i;
+ info.imageLoadAddress = info32->imageLoadAddress;
+ info.imageFilePath = info32->imageFilePath;
+ }
+ if (info.imageFilePath &&
+ ReadProcessMemory(pcs->handle, (void*)info.imageFilePath, bufstr, sizeof(bufstr), NULL))
{
bufstr[sizeof(bufstr) - 1] = '\0';
TRACE("[%d] image file %s\n", i, debugstr_a(bufstr));
MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW));
if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name);
- if (!cb(bufstrW, (unsigned long)info_array[i].imageLoadAddress, user)) break;
+ if (!cb(bufstrW, info.imageLoadAddress, user)) break;
}
}
@@ -1764,27 +1804,47 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in
WCHAR *loader = get_wine_loader_name(pcs);
BOOL ret = FALSE;
ULONG_PTR dyld_image_info_address;
- struct dyld_all_image_infos image_infos;
- struct dyld_image_info image_info;
+ union wine_all_image_infos image_infos;
+ union wine_image_info image_info;
uint32_t len;
char path[PATH_MAX];
BOOL got_path = FALSE;
+ if (pcs->is_64bit)
+ len = sizeof(image_infos.infos64);
+ else
+ len = sizeof(image_infos.infos32);
dyld_image_info_address = get_dyld_image_info_address(pcs);
if (dyld_image_info_address &&
- ReadProcessMemory(pcs->handle, (void*)dyld_image_info_address, &image_infos, sizeof(image_infos), NULL) &&
- image_infos.infoArray && image_infos.infoArrayCount &&
- ReadProcessMemory(pcs->handle, image_infos.infoArray, &image_info, sizeof(image_info), NULL) &&
- image_info.imageFilePath)
+ ReadProcessMemory(pcs->handle, (void*)dyld_image_info_address, &image_infos, len, NULL))
{
- for (len = sizeof(path); len > 0; len /= 2)
+ if (pcs->is_64bit)
+ len = sizeof(image_info.info64);
+ else
{
- if (ReadProcessMemory(pcs->handle, image_info.imageFilePath, path, len, NULL))
+ struct dyld_all_image_infos32 temp = image_infos.infos32;
+ image_infos.infos64.infoArrayCount = temp.infoArrayCount;
+ image_infos.infos64.infoArray = temp.infoArray;
+ len = sizeof(image_info.info32);
+ }
+ if (image_infos.infos64.infoArray && image_infos.infos64.infoArrayCount &&
+ ReadProcessMemory(pcs->handle, (void*)image_infos.infos64.infoArray, &image_info, len, NULL))
+ {
+ if (!pcs->is_64bit)
+ {
+ struct dyld_image_info32 temp = image_info.info32;
+ image_info.info64.imageLoadAddress = temp.imageLoadAddress;
+ image_info.info64.imageFilePath = temp.imageFilePath;
+ }
+ for (len = sizeof(path); image_info.info64.imageFilePath && len > 0; len /= 2)
{
- path[len - 1] = 0;
- got_path = TRUE;
- TRACE("got executable path from target's dyld image info: %s\n", debugstr_a(path));
- break;
+ if (ReadProcessMemory(pcs->handle, (void*)image_info.info64.imageFilePath, path, len, NULL))
+ {
+ path[len - 1] = 0;
+ got_path = TRUE;
+ TRACE("got executable path from target's dyld image info: %s\n", debugstr_a(path));
+ break;
+ }
}
}
}
--
2.21.0
Dec. 13, 2019
[PATCH 1/3] dbghelp: Fix reading the address of the target's dyld image info from its PEB.
by Ken Thomases
Signed-off-by: Ken Thomases <ken(a)codeweavers.com>
---
dlls/dbghelp/macho_module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c
index 9d83b006b7c..8eda11ab91c 100644
--- a/dlls/dbghelp/macho_module.c
+++ b/dlls/dbghelp/macho_module.c
@@ -1366,7 +1366,7 @@ static ULONG_PTR get_dyld_image_info_address(struct process* pcs)
if (status == STATUS_SUCCESS)
{
/* Read dyld image info address from PEB */
- if (!pcs->is_64bit)
+ if (pcs->is_64bit)
ret = ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0],
&dyld_image_info_address, sizeof(dyld_image_info_address), NULL);
else
--
2.21.0
Dec. 13, 2019
[PATCH 2/2] msado15: Implement _Recordset get_State
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 7 +++++--
dlls/msado15/tests/msado15.c | 7 ++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index f0bb1591aa..8a5f7aad41 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -1057,8 +1057,10 @@ static HRESULT WINAPI recordset_get_Status( _Recordset *iface, LONG *status )
static HRESULT WINAPI recordset_get_State( _Recordset *iface, LONG *state )
{
- FIXME( "%p, %p\n", iface, state );
- return E_NOTIMPL;
+ struct recordset *recordset = impl_from_Recordset( iface );
+ TRACE( "%p, %p\n", recordset, state );
+ *state = recordset->state;
+ return S_OK;
}
static HRESULT WINAPI recordset__xClone( _Recordset *iface, _Recordset **obj )
@@ -1337,6 +1339,7 @@ HRESULT Recordset_create( void **obj )
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
recordset->refs = 1;
recordset->index = -1;
+ recordset->state = adStateClosed;
*obj = &recordset->Recordset_iface;
TRACE( "returning iface %p\n", *obj );
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 494f1be463..d3c1f30f6d 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -47,12 +47,17 @@ static void test_Recordset(void)
{
_Recordset *recordset;
Fields *fields, *fields2;
- LONG refs, count;
+ LONG refs, count, state;
HRESULT hr;
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
ok( hr == S_OK, "got %08x\n", hr );
+ state = -1;
+ hr = _Recordset_get_State( recordset, &state );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( state == adStateClosed, "got %d\n", state );
+
/* handing out fields object increases recordset refcount */
refs = get_refs_recordset( recordset );
ok( refs == 1, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
[PATCH 1/2] msado15: Prevent Multiple Open/Close of a _Recordset.
by Alistair Leslie-Hughes
Currently closing twice or Close/Release would cause a crash.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/recordset.c | 15 +++++++++++----
dlls/msado15/tests/msado15.c | 3 +++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index e854b3e824..f0bb1591aa 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -658,9 +658,12 @@ static void close_recordset( struct recordset *recordset )
{
ULONG row, col, col_count = get_column_count( recordset );
- recordset->fields->recordset = NULL;
- Fields_Release( &recordset->fields->Fields_iface );
- recordset->fields = NULL;
+ if (recordset->fields)
+ {
+ recordset->fields->recordset = NULL;
+ Fields_Release( &recordset->fields->Fields_iface );
+ recordset->fields = NULL;
+ }
for (row = 0; row < recordset->count; row++)
for (col = 0; col < col_count; col++) VariantClear( &recordset->data[row * col_count + col] );
@@ -668,6 +671,7 @@ static void close_recordset( struct recordset *recordset )
recordset->count = recordset->allocated = recordset->index = 0;
heap_free( recordset->data );
recordset->data = NULL;
+ recordset->state = adStateClosed;
}
static ULONG WINAPI recordset_Release( _Recordset *iface )
@@ -905,8 +909,9 @@ static HRESULT WINAPI recordset_Close( _Recordset *iface )
TRACE( "%p\n", recordset );
+ if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
+
close_recordset( recordset );
- recordset->state = adStateClosed;
return S_OK;
}
@@ -960,6 +965,8 @@ static HRESULT WINAPI recordset_Open( _Recordset *iface, VARIANT source, VARIANT
FIXME( "%p, %s, %s, %d, %d, %d\n", recordset, debugstr_variant(&source), debugstr_variant(&active_connection),
cursor_type, lock_type, options );
+ if (recordset->state == adStateOpen) return MAKE_ADO_HRESULT( adErrObjectOpen );
+
recordset->state = adStateOpen;
return S_OK;
}
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index f9a5377c50..494f1be463 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -86,6 +86,9 @@ static void test_Recordset(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( !count, "got %d\n", count );
+ hr = _Recordset_Close( recordset );
+ ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
+
refs = _Recordset_Release( recordset );
ok( !refs, "got %d\n", refs );
--
2.17.1
Dec. 13, 2019
Re: [PATCH 1/3] dmloader: Get rid of single use debugstr_dmreturn()
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62086
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/dmloader/debug.c:43
error: patch failed: dlls/dmloader/debug.h:39
Task: Patch failed to apply
Dec. 13, 2019
[PATCH 3/3] dmloader: Simplify tracing of DMUS_CONTAINED_OBJF_KEEP flag
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/debug.c | 30 ++----------------------------
1 file changed, 2 insertions(+), 28 deletions(-)
diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c
index 30e3fd69cc..1be92e72af 100644
--- a/dlls/dmloader/debug.c
+++ b/dlls/dmloader/debug.c
@@ -43,33 +43,6 @@ const char *resolve_STREAM_SEEK (DWORD flag) {
}
}
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- static char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++) {
- if ((flags & names[i].val)) {
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- ptr = &buffer[0];
- return ptr;
-}
-
-/* dump DMUS_CONTAINED_OBJF flags */
-static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_CONTAINED_OBJF_KEEP)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) {
if (pHeader) {
char buffer[1024], *ptr = buffer;
@@ -90,7 +63,8 @@ const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT
ptr += sprintf(ptr, "DMUS_IO_CONTAINED_OBJECT_HEADER (%p):", pHeader);
ptr += sprintf(ptr, "\n - guidClassID = %s", debugstr_dmguid(&pHeader->guidClassID));
- ptr += sprintf(ptr, "\n - dwFlags = %s", debugstr_DMUS_CONTAINED_OBJF_FLAGS (pHeader->dwFlags));
+ ptr += sprintf(ptr, "\n - dwFlags = %#x%s", pHeader->dwFlags,
+ pHeader->dwFlags & DMUS_CONTAINED_OBJF_KEEP ? " (DMUS_CONTAINED_OBJF_KEEP)" : "");
ptr += sprintf(ptr, "\n - ckid = %s", debugstr_fourcc (pHeader->ckid));
ptr += sprintf(ptr, "\n - fccType = %s", debugstr_fourcc (pHeader->fccType));
--
2.23.0
Dec. 12, 2019
[PATCH 2/3] dmloader: Simplify tracing of the DMUS_CONTAINER_NOLOADS flag
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/debug.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c
index 398ce690d1..30e3fd69cc 100644
--- a/dlls/dmloader/debug.c
+++ b/dlls/dmloader/debug.c
@@ -62,14 +62,6 @@ static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t n
return ptr;
}
-/* dump DMUS_CONTAINER flags */
-static const char *debugstr_DMUS_CONTAINER_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_CONTAINER_NOLOADS)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
/* dump DMUS_CONTAINED_OBJF flags */
static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
@@ -81,10 +73,11 @@ static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) {
const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) {
if (pHeader) {
char buffer[1024], *ptr = buffer;
-
+
ptr += sprintf(ptr, "DMUS_IO_CONTAINER_HEADER (%p):", pHeader);
- ptr += sprintf(ptr, "\n - dwFlags = %s", debugstr_DMUS_CONTAINER_FLAGS(pHeader->dwFlags));
-
+ ptr += sprintf(ptr, "\n - dwFlags = %#x%s", pHeader->dwFlags,
+ pHeader->dwFlags & DMUS_CONTAINER_NOLOADS ? " (DMUS_CONTAINER_NOLOADS)" : "");
+
return wine_dbg_sprintf("%s", buffer);
} else {
return wine_dbg_sprintf("(NULL)");
--
2.23.0
Dec. 12, 2019
[PATCH 1/3] dmloader: Get rid of single use debugstr_dmreturn()
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/debug.c | 148 -----------------------------------------
dlls/dmloader/debug.h | 2 -
dlls/dmloader/loader.c | 2 +-
3 files changed, 1 insertion(+), 151 deletions(-)
diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c
index 0d274394aa..398ce690d1 100644
--- a/dlls/dmloader/debug.c
+++ b/dlls/dmloader/debug.c
@@ -43,154 +43,6 @@ const char *resolve_STREAM_SEEK (DWORD flag) {
}
}
-/* returns name of given error code */
-const char *debugstr_dmreturn (DWORD code) {
- static const flag_info codes[] = {
- FE(S_OK),
- FE(S_FALSE),
- FE(DMUS_S_PARTIALLOAD),
- FE(DMUS_S_PARTIALDOWNLOAD),
- FE(DMUS_S_REQUEUE),
- FE(DMUS_S_FREE),
- FE(DMUS_S_END),
- FE(DMUS_S_STRING_TRUNCATED),
- FE(DMUS_S_LAST_TOOL),
- FE(DMUS_S_OVER_CHORD),
- FE(DMUS_S_UP_OCTAVE),
- FE(DMUS_S_DOWN_OCTAVE),
- FE(DMUS_S_NOBUFFERCONTROL),
- FE(DMUS_S_GARBAGE_COLLECTED),
- FE(E_NOTIMPL),
- FE(E_NOINTERFACE),
- FE(E_POINTER),
- FE(CLASS_E_NOAGGREGATION),
- FE(CLASS_E_CLASSNOTAVAILABLE),
- FE(REGDB_E_CLASSNOTREG),
- FE(E_OUTOFMEMORY),
- FE(E_FAIL),
- FE(E_INVALIDARG),
- FE(DMUS_E_DRIVER_FAILED),
- FE(DMUS_E_PORTS_OPEN),
- FE(DMUS_E_DEVICE_IN_USE),
- FE(DMUS_E_INSUFFICIENTBUFFER),
- FE(DMUS_E_BUFFERNOTSET),
- FE(DMUS_E_BUFFERNOTAVAILABLE),
- FE(DMUS_E_NOTADLSCOL),
- FE(DMUS_E_INVALIDOFFSET),
- FE(DMUS_E_ALREADY_LOADED),
- FE(DMUS_E_INVALIDPOS),
- FE(DMUS_E_INVALIDPATCH),
- FE(DMUS_E_CANNOTSEEK),
- FE(DMUS_E_CANNOTWRITE),
- FE(DMUS_E_CHUNKNOTFOUND),
- FE(DMUS_E_INVALID_DOWNLOADID),
- FE(DMUS_E_NOT_DOWNLOADED_TO_PORT),
- FE(DMUS_E_ALREADY_DOWNLOADED),
- FE(DMUS_E_UNKNOWN_PROPERTY),
- FE(DMUS_E_SET_UNSUPPORTED),
- FE(DMUS_E_GET_UNSUPPORTED),
- FE(DMUS_E_NOTMONO),
- FE(DMUS_E_BADARTICULATION),
- FE(DMUS_E_BADINSTRUMENT),
- FE(DMUS_E_BADWAVELINK),
- FE(DMUS_E_NOARTICULATION),
- FE(DMUS_E_NOTPCM),
- FE(DMUS_E_BADWAVE),
- FE(DMUS_E_BADOFFSETTABLE),
- FE(DMUS_E_UNKNOWNDOWNLOAD),
- FE(DMUS_E_NOSYNTHSINK),
- FE(DMUS_E_ALREADYOPEN),
- FE(DMUS_E_ALREADYCLOSED),
- FE(DMUS_E_SYNTHNOTCONFIGURED),
- FE(DMUS_E_SYNTHACTIVE),
- FE(DMUS_E_CANNOTREAD),
- FE(DMUS_E_DMUSIC_RELEASED),
- FE(DMUS_E_BUFFER_EMPTY),
- FE(DMUS_E_BUFFER_FULL),
- FE(DMUS_E_PORT_NOT_CAPTURE),
- FE(DMUS_E_PORT_NOT_RENDER),
- FE(DMUS_E_DSOUND_NOT_SET),
- FE(DMUS_E_ALREADY_ACTIVATED),
- FE(DMUS_E_INVALIDBUFFER),
- FE(DMUS_E_WAVEFORMATNOTSUPPORTED),
- FE(DMUS_E_SYNTHINACTIVE),
- FE(DMUS_E_DSOUND_ALREADY_SET),
- FE(DMUS_E_INVALID_EVENT),
- FE(DMUS_E_UNSUPPORTED_STREAM),
- FE(DMUS_E_ALREADY_INITED),
- FE(DMUS_E_INVALID_BAND),
- FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK),
- FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK),
- FE(DMUS_E_INVALID_TRACK_HDR),
- FE(DMUS_E_INVALID_TOOL_HDR),
- FE(DMUS_E_ALL_TOOLS_FAILED),
- FE(DMUS_E_ALL_TRACKS_FAILED),
- FE(DMUS_E_NOT_FOUND),
- FE(DMUS_E_NOT_INIT),
- FE(DMUS_E_TYPE_DISABLED),
- FE(DMUS_E_TYPE_UNSUPPORTED),
- FE(DMUS_E_TIME_PAST),
- FE(DMUS_E_TRACK_NOT_FOUND),
- FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT),
- FE(DMUS_E_NO_MASTER_CLOCK),
- FE(DMUS_E_LOADER_NOCLASSID),
- FE(DMUS_E_LOADER_BADPATH),
- FE(DMUS_E_LOADER_FAILEDOPEN),
- FE(DMUS_E_LOADER_FORMATNOTSUPPORTED),
- FE(DMUS_E_LOADER_FAILEDCREATE),
- FE(DMUS_E_LOADER_OBJECTNOTFOUND),
- FE(DMUS_E_LOADER_NOFILENAME),
- FE(DMUS_E_INVALIDFILE),
- FE(DMUS_E_ALREADY_EXISTS),
- FE(DMUS_E_OUT_OF_RANGE),
- FE(DMUS_E_SEGMENT_INIT_FAILED),
- FE(DMUS_E_ALREADY_SENT),
- FE(DMUS_E_CANNOT_FREE),
- FE(DMUS_E_CANNOT_OPEN_PORT),
- FE(DMUS_E_CANNOT_CONVERT),
- FE(DMUS_E_DESCEND_CHUNK_FAIL),
- FE(DMUS_E_NOT_LOADED),
- FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE),
- FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE),
- FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT),
- FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32),
- FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR),
- FE(DMUS_E_SCRIPT_INVALID_FILE),
- FE(DMUS_E_INVALID_SCRIPTTRACK),
- FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND),
- FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND),
- FE(DMUS_E_SCRIPT_CONTENT_READONLY),
- FE(DMUS_E_SCRIPT_NOT_A_REFERENCE),
- FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED),
- FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK),
- FE(DMUS_E_INVALID_LYRICSTRACK),
- FE(DMUS_E_INVALID_PARAMCONTROLTRACK),
- FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR),
- FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR),
- FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE),
- FE(DMUS_E_AUDIOPATHS_NOT_VALID),
- FE(DMUS_E_AUDIOPATHS_IN_USE),
- FE(DMUS_E_NO_AUDIOPATH_CONFIG),
- FE(DMUS_E_AUDIOPATH_INACTIVE),
- FE(DMUS_E_AUDIOPATH_NOBUFFER),
- FE(DMUS_E_AUDIOPATH_NOPORT),
- FE(DMUS_E_NO_AUDIOPATH),
- FE(DMUS_E_INVALIDCHUNK),
- FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER),
- FE(DMUS_E_INVALID_CONTAINER_OBJECT)
- };
-
- unsigned int i;
- for (i = 0; i < ARRAY_SIZE(codes); i++) {
- if (code == codes[i].val)
- return codes[i].name;
- }
-
- /* if we didn't find it, return value */
- return wine_dbg_sprintf("0x%08X", code);
-}
-
-
/* generic flag-dumping function */
static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
static char buffer[128] = "", *ptr = &buffer[0];
diff --git a/dlls/dmloader/debug.h b/dlls/dmloader/debug.h
index fec35cfbff..43f48e832c 100644
--- a/dlls/dmloader/debug.h
+++ b/dlls/dmloader/debug.h
@@ -39,8 +39,6 @@ typedef struct {
extern BOOL IS_VALID_DMFORM (FOURCC chunkID) DECLSPEC_HIDDEN;
/* translate STREAM_SEEK flag to string */
extern const char *resolve_STREAM_SEEK (DWORD flag) DECLSPEC_HIDDEN;
-/* returns name of given error code */
-extern const char *debugstr_dmreturn (DWORD code) DECLSPEC_HIDDEN;
extern const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) DECLSPEC_HIDDEN;
extern const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader) DECLSPEC_HIDDEN;
diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index 60dd6f844b..a267d2d6b2 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -396,7 +396,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
/* load */
result = IPersistStream_Load (pPersistStream, pStream);
if (result != S_OK) {
- WARN(": failed to (completely) load object (%s)\n", debugstr_dmreturn(result));
+ WARN(": failed to (completely) load object (%08x)\n", result);
return result;
}
/* get descriptor */
--
2.23.0
Dec. 12, 2019
[PATCH] testbot/LogUtils: Fix the ParseTaskLog() Perl documentation formatting.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/lib/WineTestBot/LogUtils.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 4a17857f8..17a028604 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -81,6 +81,7 @@ Either 'ok' if the task was successful or a code indicating why it failed.
=item NoLog
Contains an error message if the task log could not be read.
+=back
=back
=cut
--
2.20.1
Dec. 12, 2019
Re: [PATCH] urlmon/tests: Fix the spelling of a comment.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62074
Your paranoid android.
=== w2003std (task log) ===
Task errors:
The task timed out
=== w1064v1809_ar (32 bit report) ===
urlmon:
protocol.c:1185: Test failed: unexpected call ReportResult
protocol.c:1193: Test failed: hrResult = 00000000, expected: 80004004
protocol.c:3318: Test failed: Read failed: 00000001
=== w1064v1809_ja (32 bit report) ===
urlmon:
protocol.c:903: Test failed: unexpected call ReportProgress_CONNECTING
Dec. 12, 2019
Re: [PATCH] quartz: Fix the name of a type in a comment.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62077
Your paranoid android.
=== debian10 (32 bit report) ===
quartz:
Unhandled exception: page fault on execute access to 0x00ba0904 in 32-bit code (0x00ba0904).
=== debian10 (32 bit WoW report) ===
quartz:
Unhandled exception: page fault on execute access to 0x00b8bf04 in 32-bit code (0x00b8bf04).
=== debian10 (64 bit WoW report) ===
quartz:
Unhandled exception: page fault on execute access to 0x00b87b74 in 32-bit code (0x00b87b74).
Dec. 12, 2019
[PATCH] dswave: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
Patch 174775 is now fully superseded with this one.
dlls/dswave/dmobject.c | 247 ++++++++++++++++++++++++++++++-
dlls/dswave/dmobject.h | 14 +-
dlls/dswave/dswave.c | 3 +-
dlls/dswave/dswave_main.c | 271 +----------------------------------
dlls/dswave/dswave_private.h | 21 ---
5 files changed, 256 insertions(+), 300 deletions(-)
diff --git a/dlls/dswave/dmobject.c b/dlls/dswave/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dswave/dmobject.c
+++ b/dlls/dswave/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dswave/dmobject.h b/dlls/dswave/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dswave/dmobject.h
+++ b/dlls/dswave/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dswave/dswave.c b/dlls/dswave/dswave.c
index 4f1481ce5b..a561660cfa 100644
--- a/dlls/dswave/dswave.c
+++ b/dlls/dswave/dswave.c
@@ -124,7 +124,8 @@ static HRESULT WINAPI wave_IDirectMusicObject_ParseDescriptor(IDirectMusicObject
if (FAILED(hr))
return hr;
- TRACE("returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC(desc));
+ TRACE("returning descriptor:\n");
+ dump_DMUS_OBJECTDESC(desc);
return S_OK;
}
diff --git a/dlls/dswave/dswave_main.c b/dlls/dswave/dswave_main.c
index 4f3a73d9e9..12df6da861 100644
--- a/dlls/dswave/dswave_main.c
+++ b/dlls/dswave/dswave_main.c
@@ -35,6 +35,7 @@
#include "dmusici.h"
#include "dswave_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dswave);
@@ -176,273 +177,3 @@ HRESULT WINAPI DllUnregisterServer(void)
{
return __wine_unregister_resources( instance );
}
-
-/******************************************************************
- * Helper functions
- *
- *
- */
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion(const DMUS_VERSION *version)
-{
- if (!version)
- return "'null'";
- return wine_dbg_sprintf("'%hu,%hu,%hu,%hu'",
- HIWORD(version->dwVersionMS), LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
-
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++)
- {
- if ((flags & names[i].val) || /* standard flag*/
- ((!flags) && (!names[i].val))) { /* zero value only */
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- return wine_dbg_sprintf("%s", buffer);
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-/* dump whole DMUS_OBJECTDESC struct */
-const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
- if (pDesc) {
- char buffer[1024] = "", *ptr = &buffer[0];
-
- ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc);
- ptr += sprintf(ptr, " - dwSize = %d\n", pDesc->dwSize);
- ptr += sprintf(ptr, " - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS) ptr += sprintf(ptr, " - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT) ptr += sprintf(ptr, " - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE) ptr += sprintf(ptr, " - ftDate = FIXME\n");
- if (pDesc->dwValidData & DMUS_OBJ_VERSION) ptr += sprintf(ptr, " - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_NAME) ptr += sprintf(ptr, " - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) ptr += sprintf(ptr, " - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME) ptr += sprintf(ptr, " - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY) ptr += sprintf(ptr, " - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream);
-
- return wine_dbg_sprintf("%s", buffer);
- } else {
- return wine_dbg_sprintf("(NULL)");
- }
-}
diff --git a/dlls/dswave/dswave_private.h b/dlls/dswave/dswave_private.h
index 3554cde36c..10560d0254 100644
--- a/dlls/dswave/dswave_private.h
+++ b/dlls/dswave/dswave_private.h
@@ -60,25 +60,4 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-/* dump whole DMUS_OBJECTDESC struct */
-extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DSWAVE_PRIVATE_H */
--
2.23.0
Dec. 12, 2019
[PATCH] dmusic: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmusic/buffer.c | 1 +
dlls/dmusic/clock.c | 1 +
dlls/dmusic/dmobject.c | 247 ++++++++++++++++++++++++++++++++++-
dlls/dmusic/dmobject.h | 14 +-
dlls/dmusic/dmusic.c | 1 +
dlls/dmusic/dmusic_main.c | 239 +--------------------------------
dlls/dmusic/dmusic_private.h | 12 --
dlls/dmusic/download.c | 1 +
dlls/dmusic/instrument.c | 1 +
dlls/dmusic/port.c | 1 +
10 files changed, 260 insertions(+), 258 deletions(-)
diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c
index 9b0ca848a6..e17bad90dc 100644
--- a/dlls/dmusic/buffer.c
+++ b/dlls/dmusic/buffer.c
@@ -20,6 +20,7 @@
*/
#include "dmusic_private.h"
+#include "dmobject.h"
#include "initguid.h"
#include "dmksctrl.h"
diff --git a/dlls/dmusic/clock.c b/dlls/dmusic/clock.c
index 2086bfa3f1..8a4cc9112a 100644
--- a/dlls/dmusic/clock.c
+++ b/dlls/dmusic/clock.c
@@ -19,6 +19,7 @@
*/
#include "dmusic_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
diff --git a/dlls/dmusic/dmobject.c b/dlls/dmusic/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmusic/dmobject.c
+++ b/dlls/dmusic/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmusic/dmobject.h b/dlls/dmusic/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmusic/dmobject.h
+++ b/dlls/dmusic/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c
index cc798ce4d9..0d1f5269a4 100644
--- a/dlls/dmusic/dmusic.c
+++ b/dlls/dmusic/dmusic.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include "dmusic_private.h"
+#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
diff --git a/dlls/dmusic/dmusic_main.c b/dlls/dmusic/dmusic_main.c
index 0951cb9e95..b7b1a8bc2d 100644
--- a/dlls/dmusic/dmusic_main.c
+++ b/dlls/dmusic/dmusic_main.c
@@ -35,6 +35,7 @@
#include "dmusici.h"
#include "dmusic_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
@@ -215,207 +216,6 @@ int even_or_odd (DWORD number) {
return (number & 0x1); /* basically, check if bit 0 is set ;) */
}
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion(const DMUS_VERSION *version)
-{
- if (!version)
- return "'null'";
- return wine_dbg_sprintf("'%hu,%hu,%hu,%hu'",
- HIWORD(version->dwVersionMS), LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
-
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
/* generic flag-dumping function */
static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
char buffer[128] = "", *ptr = &buffer[0];
@@ -436,43 +236,6 @@ static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t n
return wine_dbg_sprintf("%s", buffer);
}
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-/* Dump whole DMUS_OBJECTDESC struct */
-void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc)
-{
- TRACE("DMUS_OBJECTDESC (%p):\n", desc);
- TRACE(" - dwSize = %d\n", desc->dwSize);
- TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (desc->dwValidData));
- if (desc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
- if (desc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
- if (desc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = FIXME\n");
- if (desc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&desc->vVersion));
- if (desc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(desc->wszName));
- if (desc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
- if (desc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
- if (desc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
- if (desc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", desc->pStream);
-}
-
/* Dump DMUS_PORTPARAMS flags */
static const char* debugstr_DMUS_PORTPARAMS_FLAGS(DWORD flagmask)
{
diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h
index 4863aad80b..ea6b7482f3 100644
--- a/dlls/dmusic/dmusic_private.h
+++ b/dlls/dmusic/dmusic_private.h
@@ -242,13 +242,7 @@ typedef struct {
const char* name;
} flag_info;
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
/* dwPatch from MIDILOCALE */
extern DWORD MIDILOCALE2Patch (const MIDILOCALE *pLocale) DECLSPEC_HIDDEN;
@@ -257,12 +251,6 @@ extern void Patch2MIDILOCALE (DWORD dwPatch, LPMIDILOCALE pLocale) DECLSPEC_HIDD
/* check whether the given DWORD is even (return 0) or odd (return 1) */
extern int even_or_odd (DWORD number) DECLSPEC_HIDDEN;
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-/* Dump whole DMUS_OBJECTDESC struct */
-extern void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc) DECLSPEC_HIDDEN;
/* Dump whole DMUS_PORTPARAMS struct */
extern void dump_DMUS_PORTPARAMS(LPDMUS_PORTPARAMS params) DECLSPEC_HIDDEN;
diff --git a/dlls/dmusic/download.c b/dlls/dmusic/download.c
index a88ec2c584..6ce650d780 100644
--- a/dlls/dmusic/download.c
+++ b/dlls/dmusic/download.c
@@ -19,6 +19,7 @@
*/
#include "dmusic_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c
index 87b31c1ed6..baa4a2f571 100644
--- a/dlls/dmusic/instrument.c
+++ b/dlls/dmusic/instrument.c
@@ -19,6 +19,7 @@
*/
#include "dmusic_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c
index 91913a716f..7bd2afdb9a 100644
--- a/dlls/dmusic/port.c
+++ b/dlls/dmusic/port.c
@@ -21,6 +21,7 @@
#include <assert.h>
#include "dmusic_private.h"
+#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
--
2.23.0
Dec. 12, 2019
[PATCH] dmstyle: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmstyle/dmobject.c | 247 ++++++++++++++++++++++++++++-
dlls/dmstyle/dmobject.h | 14 +-
dlls/dmstyle/dmstyle_main.c | 1 +
dlls/dmstyle/dmutils.c | 302 +-----------------------------------
dlls/dmstyle/dmutils.h | 26 ----
5 files changed, 255 insertions(+), 335 deletions(-)
diff --git a/dlls/dmstyle/dmobject.c b/dlls/dmstyle/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmstyle/dmobject.c
+++ b/dlls/dmstyle/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmstyle/dmobject.h b/dlls/dmstyle/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmstyle/dmobject.h
+++ b/dlls/dmstyle/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dmstyle/dmstyle_main.c b/dlls/dmstyle/dmstyle_main.c
index 11e3f62ea9..60f7c3bfbf 100644
--- a/dlls/dmstyle/dmstyle_main.c
+++ b/dlls/dmstyle/dmstyle_main.c
@@ -33,6 +33,7 @@
#include "dmusici.h"
#include "dmstyle_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
diff --git a/dlls/dmstyle/dmutils.c b/dlls/dmstyle/dmutils.c
index 70b810a8df..d12d64f76d 100644
--- a/dlls/dmstyle/dmutils.c
+++ b/dlls/dmstyle/dmutils.c
@@ -38,9 +38,9 @@
#include "dmusics.h"
#include "dmutils.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmfile);
-WINE_DECLARE_DEBUG_CHANNEL(dmime);
HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) {
@@ -215,303 +215,3 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-static const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- static char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++) {
- if ((flags & names[i].val)) {
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- ptr = &buffer[0];
- return ptr;
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *pDesc)
-{
- if (!TRACE_ON(dmime))
- return;
-
- if (pDesc) {
- TRACE_(dmime)("DMUS_OBJECTDESC (%p):", pDesc);
- TRACE_(dmime)(" - dwSize = 0x%08X\n", pDesc->dwSize);
- TRACE_(dmime)(" - dwValidData = 0x%08X ( %s)\n", pDesc->dwValidData, debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS)
- TRACE_(dmime)(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
- TRACE_(dmime)(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE)
- TRACE_(dmime)(" - ftDate = %s\n", debugstr_filetime (&pDesc->ftDate));
- if (pDesc->dwValidData & DMUS_OBJ_VERSION)
- TRACE_(dmime)(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_NAME)
- TRACE_(dmime)(" - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
- TRACE_(dmime)(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
- TRACE_(dmime)(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY)
- TRACE_(dmime)(" - llMemLength = 0x%s - pbMemData = %p\n", wine_dbgstr_longlong(pDesc->llMemLength),
- pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM)
- TRACE_(dmime)(" - pStream = %p\n", pDesc->pStream);
- }
-}
diff --git a/dlls/dmstyle/dmutils.h b/dlls/dmstyle/dmutils.h
index f2b469806f..2f13c4b1f4 100644
--- a/dlls/dmstyle/dmutils.h
+++ b/dlls/dmstyle/dmutils.h
@@ -34,30 +34,4 @@ extern HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_C
extern HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
extern HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicObject** ppObject) DECLSPEC_HIDDEN;
-/**
- * Debug utilities
- */
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-/* used for initialising structs */
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-
-/* dump whole DMUS_OBJECTDESC struct */
-extern void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMUTILS_H */
--
2.23.0
Dec. 12, 2019
[PATCH] dmscript: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmscript/dmobject.c | 247 +++++++++++++++++++++++++++-
dlls/dmscript/dmobject.h | 14 +-
dlls/dmscript/dmscript_main.c | 272 +------------------------------
dlls/dmscript/dmscript_private.h | 21 ---
dlls/dmscript/script.c | 3 +-
dlls/dmscript/scripttrack.c | 1 +
6 files changed, 257 insertions(+), 301 deletions(-)
diff --git a/dlls/dmscript/dmobject.c b/dlls/dmscript/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmscript/dmobject.c
+++ b/dlls/dmscript/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmscript/dmobject.h b/dlls/dmscript/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmscript/dmobject.h
+++ b/dlls/dmscript/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dmscript/dmscript_main.c b/dlls/dmscript/dmscript_main.c
index 55bc11b29a..163dd67185 100644
--- a/dlls/dmscript/dmscript_main.c
+++ b/dlls/dmscript/dmscript_main.c
@@ -34,6 +34,7 @@
#include "dmusici.h"
#include "dmscript_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
@@ -236,274 +237,3 @@ HRESULT WINAPI DllUnregisterServer(void)
{
return __wine_unregister_resources( instance );
}
-
-/******************************************************************
- * Helper functions
- *
- *
- */
-
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion(const DMUS_VERSION *version)
-{
- if (!version)
- return "'null'";
- return wine_dbg_sprintf("'%hu,%hu,%hu,%hu'",
- HIWORD(version->dwVersionMS), LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
-
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++)
- {
- if ((flags & names[i].val) || /* standard flag*/
- ((!flags) && (!names[i].val))) { /* zero value only */
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- return wine_dbg_sprintf("%s", buffer);
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-/* dump whole DMUS_OBJECTDESC struct */
-const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
- if (pDesc) {
- char buffer[1024] = "", *ptr = &buffer[0];
-
- ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc);
- ptr += sprintf(ptr, " - dwSize = %d\n", pDesc->dwSize);
- ptr += sprintf(ptr, " - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS) ptr += sprintf(ptr, " - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT) ptr += sprintf(ptr, " - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE) ptr += sprintf(ptr, " - ftDate = FIXME\n");
- if (pDesc->dwValidData & DMUS_OBJ_VERSION) ptr += sprintf(ptr, " - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_NAME) ptr += sprintf(ptr, " - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) ptr += sprintf(ptr, " - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME) ptr += sprintf(ptr, " - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY) ptr += sprintf(ptr, " - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream);
-
- return wine_dbg_sprintf("%s", buffer);
- } else {
- return wine_dbg_sprintf("(NULL)");
- }
-}
diff --git a/dlls/dmscript/dmscript_private.h b/dlls/dmscript/dmscript_private.h
index 1ff88a9ef7..a6723e36aa 100644
--- a/dlls/dmscript/dmscript_private.h
+++ b/dlls/dmscript/dmscript_private.h
@@ -64,25 +64,4 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-/* dump whole DMUS_OBJECTDESC struct */
-extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMSCRIPT_PRIVATE_H */
diff --git a/dlls/dmscript/script.c b/dlls/dmscript/script.c
index 94fd28207b..a3eceafb5e 100644
--- a/dlls/dmscript/script.c
+++ b/dlls/dmscript/script.c
@@ -234,7 +234,8 @@ static HRESULT WINAPI script_IDirectMusicObject_ParseDescriptor(IDirectMusicObje
desc->dwValidData |= DMUS_OBJ_CLASS;
}
- TRACE("returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC(desc));
+ TRACE("returning descriptor:\n");
+ dump_DMUS_OBJECTDESC(desc);
return S_OK;
}
diff --git a/dlls/dmscript/scripttrack.c b/dlls/dmscript/scripttrack.c
index 608e36bd90..ad5617f414 100644
--- a/dlls/dmscript/scripttrack.c
+++ b/dlls/dmscript/scripttrack.c
@@ -18,6 +18,7 @@
*/
#include "dmscript_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
--
2.23.0
Dec. 12, 2019
Re: [PATCH] user32: Fix the spelling of a comment.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62075
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
user32:
clipboard.c:833: Test failed: 6: gle 5
clipboard.c:838: Test failed: 6.0: got 0000 instead of 0008
clipboard.c:868: Test failed: 6: gle 1418
Dec. 12, 2019
[PATCH] iphlpapi: Use res_getservers() if available to get the DNS server list.
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
configure.ac | 15 +++++++++++++
dlls/iphlpapi/iphlpapi_main.c | 42 +++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+)
diff --git a/configure.ac b/configure.ac
index d53321a8f7f..5b9a787e18a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1544,6 +1544,21 @@ then
AC_DEFINE(HAVE_RESOLV, 1)
AC_SUBST(RESOLV_LIBS,$ac_cv_have_resolv) ;;
esac
+
+ if test "x$ac_cv_have_resolv" != "xnot found"
+ then
+ AC_CACHE_CHECK([for res_getservers],wine_cv_have_res_getservers,
+ [ac_save_LIBS="$LIBS"
+ test "x$ac_cv_have_resolv" = "xnone required" || \
+ LIBS="$ac_cv_have_resolv $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[#include <resolv.h>]],[[res_getservers(NULL, NULL, 0);]])],[wine_cv_have_res_getservers=yes],[wine_cv_have_res_getservers=no])
+ LIBS="$ac_save_LIBS"])
+ if test "$wine_cv_have_res_getservers" = "yes"
+ then
+ AC_DEFINE(HAVE_RES_GETSERVERS, 1, [Define to 1 if you have the `res_getservers' function.])
+ fi
+ fi
fi
dnl **** Check for LittleCMS ***
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index 8c7c9018c48..f90879e0523 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -1281,6 +1281,47 @@ static void initialise_resolver(void)
LeaveCriticalSection(&res_init_cs);
}
+#ifdef HAVE_RES_GETSERVERS
+static int get_dns_servers( SOCKADDR_STORAGE *servers, int num, BOOL ip4_only )
+{
+ struct __res_state *state = &_res;
+ int i, found = 0, total;
+ SOCKADDR_STORAGE *addr = servers;
+ union res_sockaddr_union *buf;
+
+ initialise_resolver();
+
+ total = res_getservers( state, NULL, 0 );
+
+ if ((!servers || !num) && !ip4_only) return total;
+
+ buf = HeapAlloc( GetProcessHeap(), 0, total * sizeof(union res_sockaddr_union) );
+ total = res_getservers( state, buf, total );
+
+ for (i = 0; i < total; i++)
+ {
+ if (buf[i].sin6.sin6_family == AF_INET6 && ip4_only) continue;
+ if (buf[i].sin.sin_family != AF_INET && buf[i].sin6.sin6_family != AF_INET6) continue;
+
+ found++;
+ if (!servers || !num) continue;
+
+ if (buf[i].sin6.sin6_family == AF_INET6)
+ {
+ sockaddr_in6_to_WS_storage( addr, &buf[i].sin6 );
+ }
+ else
+ {
+ sockaddr_in_to_WS_storage( addr, &buf[i].sin );
+ }
+ if (++addr >= servers + num) break;
+ }
+
+ HeapFree( GetProcessHeap(), 0, buf );
+ return found;
+}
+#else
+
static int get_dns_servers( SOCKADDR_STORAGE *servers, int num, BOOL ip4_only )
{
int i, ip6_count = 0;
@@ -1316,6 +1357,7 @@ static int get_dns_servers( SOCKADDR_STORAGE *servers, int num, BOOL ip4_only )
}
return addr - servers;
}
+#endif
#elif defined(HAVE___RES_GET_STATE) && defined(HAVE___RES_GETSERVERS)
static int get_dns_servers( SOCKADDR_STORAGE *servers, int num, BOOL ip4_only )
--
2.24.0
Dec. 12, 2019
[PATCH] quartz: Fix the name of a type in a comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/quartz/filtergraph.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index d5442e21fc1..1ed41bdcec5 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -176,7 +176,7 @@ typedef struct _IFilterGraphImpl {
/* IFilterMapper2 */
/* IQueueCommand */
/* IRegisterServiceProvider */
- /* IResourceMananger */
+ /* IResourceManager */
/* IServiceProvider */
/* IVideoFrameStep */
--
2.20.1
Dec. 12, 2019
[PATCH] shell32: Tweak / fix the MS-DOS name in a comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
Codespell and Wikipedia say it should have a hyphen.
dlls/shell32/iconcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c
index 44422ab4ff5..d1be5408fbb 100644
--- a/dlls/shell32/iconcache.c
+++ b/dlls/shell32/iconcache.c
@@ -876,7 +876,7 @@ HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD l
}
if( hIcon == (HICON)1 )
- *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
+ *lpiIcon = 2; /* MS-DOS icon - we found .exe but no icons in it */
else
*lpiIcon = 6; /* generic icon - found nothing */
--
2.20.1
Dec. 12, 2019
[PATCH] user32: Fix the spelling of a comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/user32/sysparams.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index b407b518117..2ff5b2f9099 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -2133,7 +2133,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
/* Tell it "disabled" */
if (lpAnimInfo && lpAnimInfo->cbSize == sizeof(ANIMATIONINFO))
{
- lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
+ lpAnimInfo->iMinAnimate = 0; /* Minimize and restore animation is disabled (nonzero == enabled) */
ret = TRUE;
}
break;
--
2.20.1
Dec. 12, 2019
[PATCH] urlmon/tests: Fix the spelling of a comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/urlmon/tests/protocol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c
index 5788ff9160a..84dd5345be4 100644
--- a/dlls/urlmon/tests/protocol.c
+++ b/dlls/urlmon/tests/protocol.c
@@ -3160,7 +3160,7 @@ static void test_file_protocol(void) {
lstrcatW(buf, fragmentW);
test_file_protocol_url(buf);
- /* Fragment part is considered a part of the file name, if the file exsists. */
+ /* Fragment part is considered a part of the file name, if the file exists. */
len = lstrlenW(file_name_buf);
lstrcpyW(file_name_buf+len, fragmentW);
file = CreateFileW(wszIndexHtml, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
--
2.20.1
Dec. 12, 2019
[PATCH] winevulkan: Fix the spelling of an ERR() message.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/winevulkan/vulkan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
index 725bdf019e2..59472bcef89 100644
--- a/dlls/winevulkan/vulkan.c
+++ b/dlls/winevulkan/vulkan.c
@@ -1050,7 +1050,7 @@ VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t count,
command_buffers = heap_calloc(num_command_buffers, sizeof(*submits_host));
if (!command_buffers)
{
- ERR("Unable to allocate memory for comman buffers!\n");
+ ERR("Unable to allocate memory for command buffers!\n");
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto done;
}
--
2.20.1
Dec. 12, 2019
[PATCH] winevulkan: Fix the spelling of a make_vulkan comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/winevulkan/make_vulkan | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
index b8335ca3ad6..f9b1e1cf961 100755
--- a/dlls/winevulkan/make_vulkan
+++ b/dlls/winevulkan/make_vulkan
@@ -235,7 +235,7 @@ class VkBaseType(object):
Args:
name (:obj:'str'): Name of the base type.
- _type (:obj:'str'): Underlaying type
+ _type (:obj:'str'): Underlying type
alias (bool): type is an alias or not.
requires (:obj:'str', optional): Other types required.
Often bitmask values pull in a *FlagBits type.
--
2.20.1
Dec. 12, 2019
[PATCH] shlwapi: Fix the spelling of a couple of comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/shlwapi/ordinal.c | 2 +-
dlls/shlwapi/tests/ordinal.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c
index fbdd83a4251..c5c4fa14add 100644
--- a/dlls/shlwapi/ordinal.c
+++ b/dlls/shlwapi/ordinal.c
@@ -4635,7 +4635,7 @@ static const struct objcompat_entry objcompat_table[] = {
* in registry for CLSID under ShellCompatibility subkey.
*
* PARAMS
- * pUnk: pointer to object IUnknown interface, idetifies CLSID
+ * pUnk: pointer to object IUnknown interface, identifies CLSID
* clsid: pointer to CLSID to retrieve data for
*
* RETURNS
diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c
index 6781b09432f..135d82ead1c 100644
--- a/dlls/shlwapi/tests/ordinal.c
+++ b/dlls/shlwapi/tests/ordinal.c
@@ -1485,7 +1485,7 @@ static void test_IConnectionPoint(void)
rc = pConnectToConnectionPoint(NULL, &IID_NULL, FALSE, (IUnknown*)container, &cookie, NULL);
ok(rc == S_OK, "pConnectToConnectionPoint failed with %x\n",rc);
-/* MSDN says this should be required but it crashs on XP
+/* MSDN says this should be required but it crashes on XP
IUnknown_Release(point);
*/
ref = IUnknown_Release((IUnknown*)container);
--
2.20.1
Dec. 12, 2019
[PATCH 3/3] iphlpapi: Implement some more IpStatistics on BSD.
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/iphlpapi/ipstats.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index df25d6468d5..dd6a57015f2 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -951,21 +951,26 @@ DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS stats, DWORD family)
/* ip.forwarding is 0 or 1 on BSD */
stats->u.dwForwarding = ip_forwarding+1;
stats->dwDefaultTTL = ip_ttl;
- stats->dwInDelivers = ip_stat.ips_delivered;
- stats->dwInHdrErrors = ip_stat.ips_badhlen + ip_stat.ips_badsum + ip_stat.ips_tooshort + ip_stat.ips_badlen;
- stats->dwInAddrErrors = ip_stat.ips_cantforward;
stats->dwInReceives = ip_stat.ips_total;
+ stats->dwInHdrErrors = ip_stat.ips_badhlen + ip_stat.ips_badsum + ip_stat.ips_tooshort + ip_stat.ips_badlen +
+ ip_stat.ips_badvers + ip_stat.ips_badoptions;
+ /* ips_badaddr also includes outgoing packets with a bad address, but we can't account for that right now */
+ stats->dwInAddrErrors = ip_stat.ips_cantforward + ip_stat.ips_badaddr + ip_stat.ips_notmember;
stats->dwForwDatagrams = ip_stat.ips_forward;
stats->dwInUnknownProtos = ip_stat.ips_noproto;
stats->dwInDiscards = ip_stat.ips_fragdropped;
+ stats->dwInDelivers = ip_stat.ips_delivered;
+ stats->dwOutRequests = ip_stat.ips_localout;
+ /*stats->dwRoutingDiscards = 0;*/ /* FIXME */
stats->dwOutDiscards = ip_stat.ips_odropped;
+ stats->dwOutNoRoutes = ip_stat.ips_noroute;
+ stats->dwReasmTimeout = ip_stat.ips_fragtimeout;
+ stats->dwReasmReqds = ip_stat.ips_fragments;
stats->dwReasmOks = ip_stat.ips_reassembled;
+ stats->dwReasmFails = ip_stat.ips_fragments - ip_stat.ips_reassembled;
stats->dwFragOks = ip_stat.ips_fragmented;
stats->dwFragFails = ip_stat.ips_cantfrag;
- stats->dwReasmTimeout = ip_stat.ips_fragtimeout;
- stats->dwOutNoRoutes = ip_stat.ips_noroute;
- stats->dwOutRequests = ip_stat.ips_localout;
- stats->dwReasmReqds = ip_stat.ips_fragments;
+ stats->dwFragCreates = ip_stat.ips_ofragments;
ret = NO_ERROR;
}
#else
--
2.24.0
Dec. 12, 2019
[PATCH 2/3] iphlpapi: Correct Forwarding value from GetIpStatistics(Ex)() on *BSD.
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/iphlpapi/ipstats.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index b885957d1f2..df25d6468d5 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -948,7 +948,8 @@ DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS stats, DWORD family)
return ERROR_NOT_SUPPORTED;
}
- stats->u.dwForwarding = ip_forwarding;
+ /* ip.forwarding is 0 or 1 on BSD */
+ stats->u.dwForwarding = ip_forwarding+1;
stats->dwDefaultTTL = ip_ttl;
stats->dwInDelivers = ip_stat.ips_delivered;
stats->dwInHdrErrors = ip_stat.ips_badhlen + ip_stat.ips_badsum + ip_stat.ips_tooshort + ip_stat.ips_badlen;
--
2.24.0
Dec. 12, 2019
[PATCH 1/3] iphlpapi: Set the SpecificPortBind bit if the caller wants it on BSD.
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/iphlpapi/ipstats.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 5a5275305d5..b885957d1f2 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -2575,6 +2575,7 @@ DWORD build_udp_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE
{
row.liCreateTimestamp.QuadPart = 0; /* FIXME */
row.u.dwFlags = 0;
+ row.u.SpecificPortBind = !(pINData->inp_flags & INP_ANONPORT);
memset( &row.OwningModuleInfo, 0, sizeof(row.OwningModuleInfo) );
}
if (!(table = append_udp_row( class, heap, flags, table, &count, &row, row_size ))) break;
--
2.24.0
Dec. 12, 2019
Re: [PATCH] gdiplus: GdipGraphicsClear() should overwrite pixels, not alpha blend
by Vincent Povirk (they/them)
Can you split off the implementation of CompositingModeSourceCopy into
a separate patch?
Dec. 12, 2019
[PATCH] gdiplus: GdipGraphicsClear() should overwrite pixels, not alpha blend
by Damjan Jovanovic
All sample code in the Python Pyglet library suffers from terrible
text corruption, caused by the inability to erase the background
between rendering sequential font glyphs, resulting in leftovers
from previous letters mixing with the image of new letters.
This is because it attempts to erase the background by calling
GdipGraphicsClear() with ARGB color 0x00000000 (completely
transparent black), and in our gdiplus alpha blending that into
the background has no effect. It should be using
CompositeModeSourceCopy to overwrite the background with that brush
instead.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30506
Signed-off-by: Damjan Jovanovic <damjan.jov(a)gmail.com>
---
dlls/gdiplus/graphics.c | 26 +++++++++++++++------
dlls/gdiplus/tests/image.c | 47 ++++++++++++++++++++++++++++++++++++--
2 files changed, 64 insertions(+), 9 deletions(-)
Dec. 12, 2019
Re: [PATCH v2 5/8] strmbase/renderer: Use base sink streaming methods.
by Alexandre Julliard
Zebediah Figura <z.figura12(a)gmail.com> writes:
> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
> ---
> dlls/strmbase/renderer.c | 142 +++++++++++++++++++--------------------
> 1 file changed, 68 insertions(+), 74 deletions(-)
This breaks tests:
../../../tools/runtest -q -P wine -T ../../.. -M quartz.dll -p quartz_test.exe vmr7 && touch vmr7.ok
vmr7.c:544: Tests skipped: Mixing mode is not supported.
vmr7.c:610: Tests skipped: Mixing mode is not supported.
vmr7.c:675: Tests skipped: Mixing mode is not supported.
vmr7.c:1215: Test failed: Got hr 0.
vmr7.c:1238: Test failed: Got hr 0.
make: *** [Makefile:668: vmr7.ok] Error 2
--
Alexandre Julliard
julliard(a)winehq.org
Dec. 12, 2019
[PATCH vkd3d 2/2] vkd3d: Support wait-before-signal for fences using timeline semaphores.
by Rémi Bernon
This fixes some fixme messages when playing The Turing Test.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
libs/vkd3d/command.c | 142 ++++++++++++++++++++++++++++++++-----
libs/vkd3d/vkd3d_private.h | 1 +
2 files changed, 125 insertions(+), 18 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index 8a7ff668..48b5d4f2 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -623,6 +623,34 @@ create_fence:
return vr;
}
+static VkResult d3d12_fence_create_vk_timeline_semaphore(struct d3d12_fence *fence, VkSemaphore *vk_semaphore,
+ uint64_t initial_value)
+{
+ struct d3d12_device *device = fence->device;
+ const struct vkd3d_vk_device_procs *vk_procs;
+ VkSemaphoreCreateInfo semaphore_info;
+ VkSemaphoreTypeCreateInfoKHR semaphore_type_info;
+ VkResult vr;
+
+ vk_procs = &device->vk_procs;
+
+ semaphore_type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR;
+ semaphore_type_info.pNext = NULL;
+ semaphore_type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE_KHR;
+ semaphore_type_info.initialValue = initial_value;
+
+ semaphore_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
+ semaphore_info.pNext = &semaphore_type_info;
+ semaphore_info.flags = 0;
+ if ((vr = VK_CALL(vkCreateSemaphore(device->vk_device, &semaphore_info, NULL, vk_semaphore))) < 0)
+ {
+ WARN("Failed to create Vulkan semaphore, vr %d.\n", vr);
+ *vk_semaphore = VK_NULL_HANDLE;
+ }
+
+ return vr;
+}
+
static void d3d12_fence_garbage_collect_vk_semaphores_locked(struct d3d12_fence *fence,
bool destroy_all)
{
@@ -682,6 +710,9 @@ static void d3d12_fence_destroy_vk_objects(struct d3d12_fence *fence)
fence->old_vk_fences[i] = VK_NULL_HANDLE;
}
+ if (fence->vk_timeline_semaphore)
+ VK_CALL(vkDestroySemaphore(device->vk_device, fence->vk_timeline_semaphore, NULL));
+
d3d12_fence_garbage_collect_vk_semaphores_locked(fence, true);
pthread_mutex_unlock(&fence->mutex);
@@ -1044,9 +1075,26 @@ static HRESULT STDMETHODCALLTYPE d3d12_fence_SetEventOnCompletion(ID3D12Fence *i
static HRESULT STDMETHODCALLTYPE d3d12_fence_Signal(ID3D12Fence *iface, UINT64 value)
{
struct d3d12_fence *fence = impl_from_ID3D12Fence(iface);
+ const struct vkd3d_vk_device_procs *vk_procs = &fence->device->vk_procs;
+ VkSemaphoreSignalInfoKHR signal_info;
+ VkResult vr;
TRACE("iface %p, value %#"PRIx64".\n", iface, value);
+ if (fence->vk_timeline_semaphore)
+ {
+ signal_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR;
+ signal_info.pNext = NULL;
+ signal_info.semaphore = fence->vk_timeline_semaphore;
+ signal_info.value = value;
+
+ if ((vr = VK_CALL(vkSignalSemaphoreKHR(fence->device->vk_device, &signal_info))) < 0)
+ {
+ ERR("Failed to signal semaphore, vr %d.\n", vr);
+ return hresult_from_vk_result(vr);
+ }
+ }
+
return d3d12_fence_signal(fence, value, VK_NULL_HANDLE);
}
@@ -1081,6 +1129,7 @@ static HRESULT d3d12_fence_init(struct d3d12_fence *fence, struct d3d12_device *
UINT64 initial_value, D3D12_FENCE_FLAGS flags)
{
HRESULT hr;
+ VkResult vr;
int rc;
fence->ID3D12Fence_iface.lpVtbl = &d3d12_fence_vtbl;
@@ -1116,6 +1165,16 @@ static HRESULT d3d12_fence_init(struct d3d12_fence *fence, struct d3d12_device *
d3d12_device_add_ref(fence->device = device);
+ if (!device->vk_info.KHR_timeline_semaphore)
+ {
+ fence->vk_timeline_semaphore = VK_NULL_HANDLE;
+ }
+ else if ((vr = d3d12_fence_create_vk_timeline_semaphore(fence, &fence->vk_timeline_semaphore, initial_value)) < 0)
+ {
+ ERR("Failed to create Vulkan timeline semaphore, vr %d.\n", vr);
+ return hresult_from_vk_result(vr);
+ }
+
return S_OK;
}
@@ -5904,6 +5963,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Signal(ID3D12CommandQueue *
struct d3d12_device *device;
struct d3d12_fence *fence;
VkSubmitInfo submit_info;
+ VkTimelineSemaphoreSubmitInfoKHR timeline_info;
uint64_t sequence_number;
VkQueue vk_queue;
VkResult vr;
@@ -5930,7 +5990,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Signal(ID3D12CommandQueue *
goto fail;
}
- if ((vr = vkd3d_queue_create_vk_semaphore_locked(vkd3d_queue, device, &vk_semaphore)) < 0)
+ if (fence->vk_timeline_semaphore)
+ {
+ vk_semaphore = fence->vk_timeline_semaphore;
+ }
+ else if ((vr = vkd3d_queue_create_vk_semaphore_locked(vkd3d_queue, device, &vk_semaphore)) < 0)
{
ERR("Failed to create Vulkan semaphore, vr %d.\n", vr);
vk_semaphore = VK_NULL_HANDLE;
@@ -5946,6 +6010,18 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Signal(ID3D12CommandQueue *
submit_info.signalSemaphoreCount = vk_semaphore ? 1 : 0;
submit_info.pSignalSemaphores = &vk_semaphore;
+ if (vk_semaphore == fence->vk_timeline_semaphore)
+ {
+ timeline_info.sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR;
+ timeline_info.pNext = NULL;
+ timeline_info.waitSemaphoreValueCount = 0;
+ timeline_info.pWaitSemaphoreValues = NULL;
+ timeline_info.signalSemaphoreValueCount = 1;
+ timeline_info.pSignalSemaphoreValues = &value;
+
+ submit_info.pNext = &timeline_info;
+ }
+
if ((vr = VK_CALL(vkQueueSubmit(vk_queue, 1, &submit_info, vk_fence))) >= 0)
{
sequence_number = ++vkd3d_queue->submitted_sequence_number;
@@ -5963,7 +6039,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Signal(ID3D12CommandQueue *
goto fail_vkresult;
}
- if (vk_semaphore && SUCCEEDED(hr = d3d12_fence_add_vk_semaphore(fence, vk_semaphore, vk_fence, value)))
+ if (vk_semaphore == fence->vk_timeline_semaphore)
+ vk_semaphore = VK_NULL_HANDLE;
+ else if (vk_semaphore && SUCCEEDED(hr = d3d12_fence_add_vk_semaphore(fence, vk_semaphore, vk_fence, value)))
vk_semaphore = VK_NULL_HANDLE;
vr = VK_CALL(vkGetFenceStatus(device->vk_device, vk_fence));
@@ -6013,6 +6091,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Wait(ID3D12CommandQueue *if
struct vkd3d_queue *queue;
struct d3d12_fence *fence;
VkSubmitInfo submit_info;
+ VkTimelineSemaphoreSubmitInfoKHR timeline_info;
+ VkSemaphore vk_semaphore;
VkQueue vk_queue;
VkResult vr;
HRESULT hr;
@@ -6024,23 +6104,30 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Wait(ID3D12CommandQueue *if
fence = unsafe_impl_from_ID3D12Fence(fence_iface);
- semaphore = d3d12_fence_acquire_vk_semaphore(fence, value, &completed_value);
- if (!semaphore && completed_value >= value)
+ if ((vk_semaphore = fence->vk_timeline_semaphore))
{
- /* We don't get a Vulkan semaphore if the fence was signaled on CPU. */
- TRACE("Already signaled %p, value %#"PRIx64".\n", fence, completed_value);
- return S_OK;
+ semaphore = NULL;
}
-
- if (!(vk_queue = vkd3d_queue_acquire(queue)))
+ else if ((semaphore = d3d12_fence_acquire_vk_semaphore(fence, value, &completed_value)))
{
- ERR("Failed to acquire queue %p.\n", queue);
- hr = E_FAIL;
- goto fail;
+ vk_semaphore = semaphore->vk_semaphore;
}
-
- if (!semaphore)
+ else
{
+ if (completed_value >= value)
+ {
+ /* We don't get a Vulkan semaphore if the fence was signaled on CPU. */
+ TRACE("Already signaled %p, value %#"PRIx64".\n", fence, completed_value);
+ return S_OK;
+ }
+
+ if (!(vk_queue = vkd3d_queue_acquire(queue)))
+ {
+ ERR("Failed to acquire queue %p.\n", queue);
+ hr = E_FAIL;
+ goto fail;
+ }
+
if (command_queue->last_waited_fence == fence && command_queue->last_waited_fence_value >= value)
{
WARN("Already waited on fence %p, value %#"PRIx64".\n", fence, value);
@@ -6055,16 +6142,35 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Wait(ID3D12CommandQueue *if
return S_OK;
}
+ if (!(vk_queue = vkd3d_queue_acquire(queue)))
+ {
+ ERR("Failed to acquire queue %p.\n", queue);
+ hr = E_FAIL;
+ goto fail;
+ }
+
submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
submit_info.pNext = NULL;
submit_info.waitSemaphoreCount = 1;
- submit_info.pWaitSemaphores = &semaphore->vk_semaphore;
+ submit_info.pWaitSemaphores = &vk_semaphore;
submit_info.pWaitDstStageMask = &wait_stage_mask;
submit_info.commandBufferCount = 0;
submit_info.pCommandBuffers = NULL;
submit_info.signalSemaphoreCount = 0;
submit_info.pSignalSemaphores = NULL;
+ if (vk_semaphore == fence->vk_timeline_semaphore)
+ {
+ timeline_info.sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR;
+ timeline_info.pNext = NULL;
+ timeline_info.waitSemaphoreValueCount = 1;
+ timeline_info.pWaitSemaphoreValues = &value;
+ timeline_info.signalSemaphoreValueCount = 0;
+ timeline_info.pSignalSemaphoreValues = NULL;
+
+ submit_info.pNext = &timeline_info;
+ }
+
if (!vkd3d_array_reserve((void **)&queue->semaphores, &queue->semaphores_size,
queue->semaphore_count + 1, sizeof(*queue->semaphores)))
{
@@ -6074,7 +6180,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Wait(ID3D12CommandQueue *if
goto fail;
}
- if ((vr = VK_CALL(vkQueueSubmit(vk_queue, 1, &submit_info, VK_NULL_HANDLE))) >= 0)
+ if ((vr = VK_CALL(vkQueueSubmit(vk_queue, 1, &submit_info, VK_NULL_HANDLE))) >= 0 && semaphore)
{
queue->semaphores[queue->semaphore_count].vk_semaphore = semaphore->vk_semaphore;
queue->semaphores[queue->semaphore_count].sequence_number = queue->submitted_sequence_number + 1;
@@ -6093,11 +6199,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Wait(ID3D12CommandQueue *if
goto fail;
}
- d3d12_fence_remove_vk_semaphore(fence, semaphore);
+ if (semaphore) d3d12_fence_remove_vk_semaphore(fence, semaphore);
return S_OK;
fail:
- d3d12_fence_release_vk_semaphore(fence, semaphore);
+ if (semaphore) d3d12_fence_release_vk_semaphore(fence, semaphore);
return hr;
}
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 84abcb8d..d9290db7 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -357,6 +357,7 @@ struct d3d12_fence
LONG pending_worker_operation_count;
VkFence old_vk_fences[VKD3D_MAX_VK_SYNC_OBJECTS];
+ VkSemaphore vk_timeline_semaphore;
struct d3d12_device *device;
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d 1/2] vkd3d: Add queries for KHR_timeline_semaphore extension.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
libs/vkd3d/device.c | 23 +++++++++++++++++++++++
libs/vkd3d/vkd3d_private.h | 3 +++
libs/vkd3d/vulkan_procs.h | 3 +++
3 files changed, 29 insertions(+)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index 757d4ac8..3f99ef9a 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -127,6 +127,7 @@ static const struct vkd3d_optional_extension_info optional_device_extensions[] =
VK_EXTENSION(KHR_IMAGE_FORMAT_LIST, KHR_image_format_list),
VK_EXTENSION(KHR_MAINTENANCE3, KHR_maintenance3),
VK_EXTENSION(KHR_PUSH_DESCRIPTOR, KHR_push_descriptor),
+ VK_EXTENSION(KHR_TIMELINE_SEMAPHORE, KHR_timeline_semaphore),
/* EXT extensions */
VK_EXTENSION(EXT_CONDITIONAL_RENDERING, EXT_conditional_rendering),
VK_EXTENSION(EXT_DEBUG_MARKER, EXT_debug_marker),
@@ -664,6 +665,7 @@ struct vkd3d_physical_device_info
VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT texel_buffer_alignment_properties;
VkPhysicalDeviceTransformFeedbackPropertiesEXT xfb_properties;
VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_divisor_properties;
+ VkPhysicalDeviceTimelineSemaphorePropertiesKHR timeline_semaphore_properties;
VkPhysicalDeviceProperties2KHR properties2;
@@ -675,6 +677,7 @@ struct vkd3d_physical_device_info
VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT texel_buffer_alignment_features;
VkPhysicalDeviceTransformFeedbackFeaturesEXT xfb_features;
VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT vertex_divisor_features;
+ VkPhysicalDeviceTimelineSemaphoreFeaturesKHR timeline_semaphore_features;
VkPhysicalDeviceFeatures2 features2;
};
@@ -693,8 +696,10 @@ static void vkd3d_physical_device_info_init(struct vkd3d_physical_device_info *i
VkPhysicalDeviceDepthClipEnableFeaturesEXT *depth_clip_features;
VkPhysicalDeviceMaintenance3Properties *maintenance3_properties;
VkPhysicalDeviceTransformFeedbackPropertiesEXT *xfb_properties;
+ VkPhysicalDeviceTimelineSemaphorePropertiesKHR *timeline_semaphore_properties;
VkPhysicalDevice physical_device = device->vk_physical_device;
VkPhysicalDeviceTransformFeedbackFeaturesEXT *xfb_features;
+ VkPhysicalDeviceTimelineSemaphoreFeaturesKHR *timeline_semaphore_features;
struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
memset(info, 0, sizeof(*info));
@@ -710,6 +715,8 @@ static void vkd3d_physical_device_info_init(struct vkd3d_physical_device_info *i
vertex_divisor_properties = &info->vertex_divisor_properties;
xfb_features = &info->xfb_features;
xfb_properties = &info->xfb_properties;
+ timeline_semaphore_properties = &info->timeline_semaphore_properties;
+ timeline_semaphore_features = &info->timeline_semaphore_features;
info->features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
@@ -727,6 +734,8 @@ static void vkd3d_physical_device_info_init(struct vkd3d_physical_device_info *i
vk_prepend_struct(&info->features2, xfb_features);
vertex_divisor_features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT;
vk_prepend_struct(&info->features2, vertex_divisor_features);
+ timeline_semaphore_features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR;
+ vk_prepend_struct(&info->features2, timeline_semaphore_features);
if (vulkan_info->KHR_get_physical_device_properties2)
VK_CALL(vkGetPhysicalDeviceFeatures2KHR(physical_device, &info->features2));
@@ -745,6 +754,8 @@ static void vkd3d_physical_device_info_init(struct vkd3d_physical_device_info *i
vk_prepend_struct(&info->properties2, xfb_properties);
vertex_divisor_properties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT;
vk_prepend_struct(&info->properties2, vertex_divisor_properties);
+ timeline_semaphore_properties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR;
+ vk_prepend_struct(&info->properties2, timeline_semaphore_properties);
if (vulkan_info->KHR_get_physical_device_properties2)
VK_CALL(vkGetPhysicalDeviceProperties2KHR(physical_device, &info->properties2));
@@ -817,6 +828,7 @@ static void vkd3d_trace_physical_device_limits(const struct vkd3d_physical_devic
const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *buffer_alignment;
const VkPhysicalDeviceMaintenance3Properties *maintenance3;
const VkPhysicalDeviceTransformFeedbackPropertiesEXT *xfb;
+ const VkPhysicalDeviceTimelineSemaphorePropertiesKHR *timeline_semaphore;
TRACE("Device limits:\n");
TRACE(" maxImageDimension1D: %u.\n", limits->maxImageDimension1D);
@@ -1021,6 +1033,10 @@ static void vkd3d_trace_physical_device_limits(const struct vkd3d_physical_devic
divisor_properties = &info->vertex_divisor_properties;
TRACE(" VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT:\n");
TRACE(" maxVertexAttribDivisor: %u.\n", divisor_properties->maxVertexAttribDivisor);
+
+ timeline_semaphore = &info->timeline_semaphore_properties;
+ TRACE(" VkPhysicalDeviceTimelineSemaphorePropertiesKHR:\n");
+ TRACE(" maxTimelineSemaphoreValueDifference: %u.\n", timeline_semaphore->maxTimelineSemaphoreValueDifference);
}
static void vkd3d_trace_physical_device_features(const struct vkd3d_physical_device_info *info)
@@ -1033,6 +1049,7 @@ static void vkd3d_trace_physical_device_features(const struct vkd3d_physical_dev
const VkPhysicalDeviceDepthClipEnableFeaturesEXT *depth_clip_features;
const VkPhysicalDeviceFeatures *features = &info->features2.features;
const VkPhysicalDeviceTransformFeedbackFeaturesEXT *xfb;
+ const VkPhysicalDeviceTimelineSemaphoreFeaturesKHR *timeline_semaphore;
TRACE("Device features:\n");
TRACE(" robustBufferAccess: %#x.\n", features->robustBufferAccess);
@@ -1165,6 +1182,10 @@ static void vkd3d_trace_physical_device_features(const struct vkd3d_physical_dev
divisor_features->vertexAttributeInstanceRateDivisor);
TRACE(" vertexAttributeInstanceRateZeroDivisor: %#x.\n",
divisor_features->vertexAttributeInstanceRateZeroDivisor);
+
+ timeline_semaphore = &info->timeline_semaphore_features;
+ TRACE(" VkPhysicalDeviceTimelineSemaphoreFeaturesKHR:\n");
+ TRACE(" timelineSemaphore: %#x.\n", timeline_semaphore->timelineSemaphore);
}
static void vkd3d_init_feature_level(struct vkd3d_vulkan_info *vk_info,
@@ -1294,6 +1315,8 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
vulkan_info->transform_feedback_queries = physical_device_info->xfb_properties.transformFeedbackQueries;
vulkan_info->max_vertex_attrib_divisor = max(physical_device_info->vertex_divisor_properties.maxVertexAttribDivisor, 1);
+ vulkan_info->max_timeline_semaphore_value_difference = max(physical_device_info->timeline_semaphore_properties.maxTimelineSemaphoreValueDifference, 1);
+
device->feature_options.DoublePrecisionFloatShaderOps = features->shaderFloat64;
device->feature_options.OutputMergerLogicOp = features->logicOp;
/* SPV_KHR_16bit_storage */
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 0c031d20..84abcb8d 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -100,6 +100,7 @@ struct vkd3d_vulkan_info
bool KHR_image_format_list;
bool KHR_maintenance3;
bool KHR_push_descriptor;
+ bool KHR_timeline_semaphore;
/* EXT device extensions */
bool EXT_conditional_rendering;
bool EXT_debug_marker;
@@ -116,6 +117,8 @@ struct vkd3d_vulkan_info
bool vertex_attrib_zero_divisor;
unsigned int max_vertex_attrib_divisor;
+ uint64_t max_timeline_semaphore_value_difference;
+
VkPhysicalDeviceLimits device_limits;
VkPhysicalDeviceSparseProperties sparse_properties;
diff --git a/libs/vkd3d/vulkan_procs.h b/libs/vkd3d/vulkan_procs.h
index ec29eb45..d080278a 100644
--- a/libs/vkd3d/vulkan_procs.h
+++ b/libs/vkd3d/vulkan_procs.h
@@ -206,6 +206,9 @@ VK_DEVICE_EXT_PFN(vkCmdBindTransformFeedbackBuffersEXT)
VK_DEVICE_EXT_PFN(vkCmdEndQueryIndexedEXT)
VK_DEVICE_EXT_PFN(vkCmdEndTransformFeedbackEXT)
+/* VK_KHR_timeline_semaphore */
+VK_DEVICE_EXT_PFN(vkSignalSemaphoreKHR)
+
#undef VK_INSTANCE_PFN
#undef VK_INSTANCE_EXT_PFN
#undef VK_DEVICE_PFN
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d] vkd3d: Save and restore the last stencil reference value.
by Rémi Bernon
This fixes The Turing Test rendering on NVIDIA GPUs.
It also fixes this Vulkan validation error:
Dynamic stencil reference state not set for this command buffer..
The Vulkan spec states: If the VkPipeline object bound to the pipeline
bind point used by this command requires any dynamic state, that state
must have been set for commandBuffer.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
libs/vkd3d/command.c | 5 +++++
libs/vkd3d/vkd3d_private.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index c6e08744..b0147607 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -2397,6 +2397,7 @@ static void d3d12_command_list_reset_state(struct d3d12_command_list *list,
list->is_predicated = false;
+ list->current_stencil_ref = 0;
list->current_framebuffer = VK_NULL_HANDLE;
list->current_pipeline = VK_NULL_HANDLE;
list->pso_render_pass = VK_NULL_HANDLE;
@@ -2602,6 +2603,8 @@ static bool d3d12_command_list_update_graphics_pipeline(struct d3d12_command_lis
VK_CALL(vkCmdBindPipeline(list->vk_command_buffer, list->state->vk_bind_point, vk_pipeline));
list->current_pipeline = vk_pipeline;
+ VK_CALL(vkCmdSetStencilReference(list->vk_command_buffer, VK_STENCIL_FRONT_AND_BACK, list->current_stencil_ref));
+
return true;
}
@@ -3793,6 +3796,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_OMSetStencilRef(ID3D12GraphicsC
TRACE("iface %p, stencil_ref %u.\n", iface, stencil_ref);
+ list->current_stencil_ref = stencil_ref;
+
vk_procs = &list->device->vk_procs;
VK_CALL(vkCmdSetStencilReference(list->vk_command_buffer, VK_STENCIL_FRONT_AND_BACK, stencil_ref));
}
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index d9290db7..a5ffbb4b 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -961,6 +961,7 @@ struct d3d12_command_list
bool is_predicated;
+ uint32_t current_stencil_ref;
VkFramebuffer current_framebuffer;
VkPipeline current_pipeline;
VkRenderPass pso_render_pass;
--
2.24.0
Dec. 12, 2019
Re: [PATCH 5/5] wined3d: Store Vulkan physical device memory properties in the wined3d_adapter_vk structure.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62063
Your paranoid android.
=== debian10 (32 bit report) ===
d3d11:
d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
Report errors:
d3d11:d3d11 has no test summary line (early exit of the main process?)
d3d11:d3d11 has unaccounted for failure messages
d3d11:d3d11 has unaccounted for todo messages
d3d11:d3d11 has unaccounted for skip messages
d3d11:d3d11 returned success despite having failures
=== debian10 (32 bit Chinese:China report) ===
d3d11:
d3d11.c:17958: Test failed: Got {0x00000001, 0xffffffff, 0x00000000, 0x00000000}, expected {0x00000001, 0x00000000, 0x00000000, 0x00000000} at (0, 0), sub-resource 0.
=== debian10 (build log) ===
X Error of failed request: GLXBadFBConfig
Major opcode of failed request: 150 (GLX)
Minor opcode of failed request: 34 ()
=== debian10 (32 bit WoW report) ===
d3d11:
d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
Dec. 12, 2019
Re: [PATCH 4/5] wined3d: Introduce WINED3D_BIND_INDIRECT_BUFFER.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62062
Your paranoid android.
=== debian10 (32 bit report) ===
d3d11:
d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian10 (32 bit Chinese:China report) ===
d3d11:
d3d11.c:17958: Test failed: Got {0x00000001, 0xffffffff, 0x00000000, 0x00000000}, expected {0x00000001, 0x00000000, 0x00000000, 0x00000000} at (0, 0), sub-resource 0.
Report errors:
d3d11:d3d11 has no test summary line (early exit of the main process?)
d3d11:d3d11 has unaccounted for failure messages
d3d11:d3d11 has unaccounted for todo messages
d3d11:d3d11 has unaccounted for skip messages
d3d11:d3d11 returned success despite having failures
=== debian10 (build log) ===
X Error of failed request: GLXBadFBConfig
Major opcode of failed request: 150 (GLX)
Minor opcode of failed request: 34 ()
=== debian10 (32 bit WoW report) ===
d3d11:
d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
d3d11.c:16860: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
=== debian10 (64 bit WoW report) ===
d3d11:
d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
d3d11.c:17958: Test failed: Got {0x00000001, 0xffffffff, 0x00000000, 0x00000000}, expected {0x00000001, 0x00000000, 0x00000000, 0x00000000} at (0, 0), sub-resource 0.
Dec. 12, 2019
Re: [PATCH] tests: Trace elapsed time when $WINETEST_TIME is set.
by Francois Gouget
On Thu, 5 Dec 2019, Francois Gouget wrote:
> This simplifies narrowing down where a test gets stuck or is slow if
> it times out but prints few messages.
>
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48094
> Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
> ---
>
> If this approach is acceptable I'll add support for it on the TestBot
> and on the test.winehq.org site: allowing to set $WINETEST_TIME and
> recognizing the modified failure lines.
What's the status on this patch?
Should I use a different approach?
--
Francois Gouget <fgouget(a)codeweavers.com>
Dec. 12, 2019
[PATCH 5/5] wined3d: Store Vulkan physical device memory properties in the wined3d_adapter_vk structure.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/adapter_vk.c | 12 ++++++------
dlls/wined3d/wined3d_private.h | 1 +
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index 94eb1382c56..4ec68013017 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -1100,9 +1100,10 @@ static enum wined3d_display_driver guess_display_driver(enum wined3d_pci_vendor
}
}
-static void adapter_vk_init_driver_info(struct wined3d_adapter *adapter,
- const VkPhysicalDeviceProperties *properties, const VkPhysicalDeviceMemoryProperties *memory_properties)
+static void adapter_vk_init_driver_info(struct wined3d_adapter_vk *adapter_vk,
+ const VkPhysicalDeviceProperties *properties)
{
+ const VkPhysicalDeviceMemoryProperties *memory_properties = &adapter_vk->memory_properties;
const struct wined3d_gpu_description *gpu_description;
struct wined3d_gpu_description description;
UINT64 vram_bytes, sysmem_bytes;
@@ -1144,7 +1145,7 @@ static void adapter_vk_init_driver_info(struct wined3d_adapter *adapter,
gpu_description = &description;
}
- wined3d_driver_info_init(&adapter->driver_info, gpu_description, vram_bytes, sysmem_bytes);
+ wined3d_driver_info_init(&adapter_vk->a.driver_info, gpu_description, vram_bytes, sysmem_bytes);
}
static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter *adapter, uint32_t wined3d_creation_flags)
@@ -1162,7 +1163,6 @@ static BOOL wined3d_adapter_vk_init(struct wined3d_adapter_vk *adapter_vk,
unsigned int ordinal, unsigned int wined3d_creation_flags)
{
struct wined3d_vk_info *vk_info = &adapter_vk->vk_info;
- VkPhysicalDeviceMemoryProperties memory_properties;
struct wined3d_adapter *adapter = &adapter_vk->a;
VkPhysicalDeviceIDProperties id_properties;
VkPhysicalDeviceProperties2 properties2;
@@ -1193,9 +1193,9 @@ static BOOL wined3d_adapter_vk_init(struct wined3d_adapter_vk *adapter_vk,
VK_CALL(vkGetPhysicalDeviceProperties(adapter_vk->physical_device, &properties2.properties));
adapter_vk->device_limits = properties2.properties.limits;
- VK_CALL(vkGetPhysicalDeviceMemoryProperties(adapter_vk->physical_device, &memory_properties));
+ VK_CALL(vkGetPhysicalDeviceMemoryProperties(adapter_vk->physical_device, &adapter_vk->memory_properties));
- adapter_vk_init_driver_info(adapter, &properties2.properties, &memory_properties);
+ adapter_vk_init_driver_info(adapter_vk, &properties2.properties);
adapter->vram_bytes_used = 0;
TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->driver_info.vram_bytes));
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 60ddf74a0ec..444b576b63f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2919,6 +2919,7 @@ struct wined3d_adapter_vk
VkPhysicalDevice physical_device;
VkPhysicalDeviceLimits device_limits;
+ VkPhysicalDeviceMemoryProperties memory_properties;
};
static inline struct wined3d_adapter_vk *wined3d_adapter_vk(struct wined3d_adapter *adapter)
--
2.11.0
Dec. 12, 2019
[PATCH 4/5] wined3d: Introduce WINED3D_BIND_INDIRECT_BUFFER.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d11/buffer.c | 2 +-
dlls/d3d11/d3d11_private.h | 25 ++++++++++++++++++++++---
dlls/d3d11/texture.c | 6 +++---
dlls/wined3d/buffer.c | 4 ++++
dlls/wined3d/utils.c | 1 +
include/wine/wined3d.h | 1 +
6 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c
index ed9ee133118..f2b950f357f 100644
--- a/dlls/d3d11/buffer.c
+++ b/dlls/d3d11/buffer.c
@@ -448,7 +448,7 @@ static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *dev
wined3d_desc.byte_width = buffer->desc.ByteWidth;
wined3d_desc.usage = wined3d_usage_from_d3d11(buffer->desc.Usage);
- wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(buffer->desc.BindFlags);
+ wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(buffer->desc.BindFlags, buffer->desc.MiscFlags);
wined3d_desc.access = wined3d_access_from_d3d11(buffer->desc.Usage, buffer->desc.CPUAccessFlags);
wined3d_desc.misc_flags = buffer->desc.MiscFlags;
wined3d_desc.structure_byte_stride = buffer->desc.StructureByteStride;
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index 22196809b64..1e8d86fede0 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -92,14 +92,33 @@ HRESULT d3d_set_private_data(struct wined3d_private_store *store,
HRESULT d3d_set_private_data_interface(struct wined3d_private_store *store,
REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
-static inline unsigned int wined3d_bind_flags_from_d3d11(UINT bind_flags)
+static inline unsigned int wined3d_bind_flags_from_d3d11(UINT bind_flags, UINT misc_flags)
{
- return bind_flags;
+ unsigned int wined3d_flags = bind_flags & (D3D11_BIND_VERTEX_BUFFER
+ | D3D11_BIND_INDEX_BUFFER
+ | D3D11_BIND_CONSTANT_BUFFER
+ | D3D11_BIND_SHADER_RESOURCE
+ | D3D11_BIND_STREAM_OUTPUT
+ | D3D11_BIND_RENDER_TARGET
+ | D3D11_BIND_DEPTH_STENCIL
+ | D3D11_BIND_UNORDERED_ACCESS);
+
+ if (misc_flags & D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS)
+ wined3d_flags |= WINED3D_BIND_INDIRECT_BUFFER;
+
+ return wined3d_flags;
}
static inline UINT d3d11_bind_flags_from_wined3d(unsigned int bind_flags)
{
- return bind_flags;
+ return bind_flags & (WINED3D_BIND_VERTEX_BUFFER
+ | WINED3D_BIND_INDEX_BUFFER
+ | WINED3D_BIND_CONSTANT_BUFFER
+ | WINED3D_BIND_SHADER_RESOURCE
+ | WINED3D_BIND_STREAM_OUTPUT
+ | WINED3D_BIND_RENDER_TARGET
+ | WINED3D_BIND_DEPTH_STENCIL
+ | WINED3D_BIND_UNORDERED_ACCESS);
}
/* ID3D11Texture1D, ID3D10Texture1D */
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
index d54f22f35c9..36d07beb23d 100644
--- a/dlls/d3d11/texture.c
+++ b/dlls/d3d11/texture.c
@@ -454,7 +454,7 @@ HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DE
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
wined3d_desc.multisample_quality = 0;
wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
- wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
+ wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags, desc->MiscFlags);
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
wined3d_desc.width = desc->Width;
@@ -1008,7 +1008,7 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
wined3d_desc.multisample_type = desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3D_MULTISAMPLE_NONE;
wined3d_desc.multisample_quality = desc->SampleDesc.Quality;
wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
- wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
+ wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags, desc->MiscFlags);
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
wined3d_desc.width = desc->Width;
@@ -1467,7 +1467,7 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
wined3d_desc.multisample_quality = 0;
wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
- wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
+ wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags, desc->MiscFlags);
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
wined3d_desc.width = desc->Width;
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 35248ce9fa5..5da6aec4fb8 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1300,6 +1300,10 @@ GLenum wined3d_buffer_gl_binding_from_bind_flags(const struct wined3d_gl_info *g
if (bind_flags & WINED3D_BIND_STREAM_OUTPUT)
return GL_TRANSFORM_FEEDBACK_BUFFER;
+ if (bind_flags & WINED3D_BIND_INDIRECT_BUFFER
+ && gl_info->supported[ARB_DRAW_INDIRECT])
+ return GL_DRAW_INDIRECT_BUFFER;
+
if (bind_flags & ~(WINED3D_BIND_VERTEX_BUFFER | WINED3D_BIND_INDEX_BUFFER))
FIXME("Unhandled bind flags %#x.\n", bind_flags);
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 453bee62565..d5fe1c239bf 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4687,6 +4687,7 @@ const char *wined3d_debug_bind_flags(DWORD bind_flags)
BIND_FLAG_TO_STR(WINED3D_BIND_RENDER_TARGET);
BIND_FLAG_TO_STR(WINED3D_BIND_DEPTH_STENCIL);
BIND_FLAG_TO_STR(WINED3D_BIND_UNORDERED_ACCESS);
+ BIND_FLAG_TO_STR(WINED3D_BIND_INDIRECT_BUFFER);
#undef BIND_FLAG_TO_STR
if (bind_flags)
FIXME("Unrecognised bind flag(s) %#x.\n", bind_flags);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index db88e110327..9cdf18633c7 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -914,6 +914,7 @@ enum wined3d_shader_type
#define WINED3D_BIND_RENDER_TARGET 0x00000020
#define WINED3D_BIND_DEPTH_STENCIL 0x00000040
#define WINED3D_BIND_UNORDERED_ACCESS 0x00000080
+#define WINED3D_BIND_INDIRECT_BUFFER 0x00000100
#define WINED3DUSAGE_SOFTWAREPROCESSING 0x00000010
#define WINED3DUSAGE_DONOTCLIP 0x00000020
--
2.11.0
Dec. 12, 2019
[PATCH 3/5] wined3d: Avoid accessing gl_info in wined3d_buffer_init().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/buffer.c | 36 ++++++++++++------------------------
1 file changed, 12 insertions(+), 24 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 89dab8ebfdd..35248ce9fa5 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1311,9 +1311,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d
void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_buffer_ops *buffer_ops)
{
const struct wined3d_format *format = wined3d_get_format(device->adapter, WINED3DFMT_UNKNOWN, desc->bind_flags);
- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct wined3d_resource *resource = &buffer->resource;
- BOOL dynamic_buffer_ok;
HRESULT hr;
TRACE("buffer %p, device %p, desc byte_width %u, usage %s, bind_flags %s, "
@@ -1364,28 +1362,6 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d
buffer->locations = WINED3D_LOCATION_SYSMEM;
}
- /* Observations show that draw_primitive_immediate_mode() is faster on
- * dynamic vertex buffers than converting + draw_primitive_arrays().
- * (Half-Life 2 and others.) */
- dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE];
-
- if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT])
- {
- TRACE("Not creating a BO because GL_ARB_vertex_buffer is not supported.\n");
- }
- else if (!(desc->access & WINED3D_RESOURCE_ACCESS_GPU))
- {
- TRACE("Not creating a BO because the buffer is not GPU accessible.\n");
- }
- else if (!dynamic_buffer_ok && (resource->usage & WINED3DUSAGE_DYNAMIC))
- {
- TRACE("Not creating a BO because the buffer has dynamic usage and no GL support.\n");
- }
- else
- {
- buffer->flags |= WINED3D_BUFFER_USE_BO;
- }
-
if (buffer->locations & WINED3D_LOCATION_SYSMEM || !(buffer->flags & WINED3D_BUFFER_USE_BO))
{
if (!wined3d_resource_prepare_sysmem(&buffer->resource))
@@ -1557,6 +1533,18 @@ HRESULT wined3d_buffer_gl_init(struct wined3d_buffer_gl *buffer_gl, struct wined
TRACE("buffer_gl %p, device %p, desc %p, data %p, parent %p, parent_ops %p.\n",
buffer_gl, device, desc, data, parent, parent_ops);
+ /* Observations show that draw_primitive_immediate_mode() is faster on
+ * dynamic vertex buffers than converting + draw_primitive_arrays().
+ * (Half-Life 2 and others.) */
+ if (!(desc->access & WINED3D_RESOURCE_ACCESS_GPU))
+ TRACE("Not creating a BO because the buffer is not GPU accessible.\n");
+ else if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT])
+ TRACE("Not creating a BO because GL_ARB_vertex_buffer is not supported.\n");
+ else if (!(gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE])
+ && (desc->usage & WINED3DUSAGE_DYNAMIC))
+ TRACE("Not creating a BO because the buffer has dynamic usage and no GL support.\n");
+ else
+ buffer_gl->b.flags |= WINED3D_BUFFER_USE_BO;
buffer_gl->buffer_type_hint = wined3d_buffer_gl_binding_from_bind_flags(gl_info, desc->bind_flags);
return wined3d_buffer_init(&buffer_gl->b, device, desc, data, parent, parent_ops, &wined3d_buffer_gl_ops);
--
2.11.0
Dec. 12, 2019
[PATCH 2/5] wined3d: Destroy GPU resources from the CS thread in adapter_vk_uninit_3d().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/adapter_vk.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index 4a501292824..94eb1382c56 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -448,27 +448,42 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device)
return WINED3D_OK;
}
-static void adapter_vk_uninit_3d(struct wined3d_device *device)
+static void adapter_vk_uninit_3d_cs(void *object)
{
+ struct wined3d_device_vk *device_vk = object;
struct wined3d_context_vk *context_vk;
+ struct wined3d_device *device;
struct wined3d_shader *shader;
- TRACE("device %p.\n", device);
+ TRACE("device_vk %p.\n", device_vk);
- context_vk = &wined3d_device_vk(device)->context_vk;
+ context_vk = &device_vk->context_vk;
+ device = &device_vk->d;
LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry)
{
device->shader_backend->shader_destroy(shader);
}
+ device->blitter->ops->blitter_destroy(device->blitter, NULL);
+ device->shader_backend->shader_free_private(device, &context_vk->c);
wined3d_device_destroy_default_samplers(device, &context_vk->c);
+}
- device->blitter->ops->blitter_destroy(device->blitter, NULL);
+static void adapter_vk_uninit_3d(struct wined3d_device *device)
+{
+ struct wined3d_context_vk *context_vk;
+ struct wined3d_device_vk *device_vk;
+
+ TRACE("device %p.\n", device);
+ device_vk = wined3d_device_vk(device);
+ context_vk = &device_vk->context_vk;
+
+ wined3d_cs_destroy_object(device->cs, adapter_vk_uninit_3d_cs, device_vk);
wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
+
device_context_remove(device, &context_vk->c);
- device->shader_backend->shader_free_private(device, NULL);
wined3d_context_vk_cleanup(context_vk);
}
--
2.11.0
Dec. 12, 2019
[PATCH 1/5] wined3d: Pass a pointer to the counter buffer to wined3d_view_gl_destroy().
by Henri Verbeet
If adapter_gl_destroy_unordered_access_view() is called before
wined3d_unordered_access_view_gl_cs_init() has finished executing, the
"counter_bo" field may still be 0. More generally, we shouldn't access
the "counter_bo" field from outside the CS thread.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/adapter_gl.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index a8a8e93c0b2..7e6f8a2817c 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -4801,7 +4801,7 @@ struct wined3d_view_gl_destroy_ctx
{
struct wined3d_device *device;
const struct wined3d_gl_view *gl_view;
- GLuint counter_bo;
+ GLuint *counter_bo;
void *object;
struct wined3d_view_gl_destroy_ctx *free;
};
@@ -4825,7 +4825,7 @@ static void wined3d_view_gl_destroy_object(void *object)
gl_info->gl_ops.gl.p_glDeleteTextures(1, &ctx->gl_view->name);
}
if (ctx->counter_bo)
- GL_EXTCALL(glDeleteBuffers(1, &ctx->counter_bo));
+ GL_EXTCALL(glDeleteBuffers(1, ctx->counter_bo));
checkGLcall("delete resources");
context_release(context);
}
@@ -4835,7 +4835,7 @@ static void wined3d_view_gl_destroy_object(void *object)
}
static void wined3d_view_gl_destroy(struct wined3d_device *device,
- const struct wined3d_gl_view *gl_view, GLuint counter_bo, void *object)
+ const struct wined3d_gl_view *gl_view, GLuint *counter_bo, void *object)
{
struct wined3d_view_gl_destroy_ctx *ctx, c;
@@ -4867,7 +4867,7 @@ static void adapter_gl_destroy_rendertarget_view(struct wined3d_rendertarget_vie
if (swapchain_count)
wined3d_device_incref(device);
wined3d_rendertarget_view_cleanup(&view_gl->v);
- wined3d_view_gl_destroy(device, &view_gl->gl_view, 0, view_gl);
+ wined3d_view_gl_destroy(device, &view_gl->gl_view, NULL, view_gl);
if (swapchain_count)
wined3d_device_decref(device);
}
@@ -4913,7 +4913,7 @@ static void adapter_gl_destroy_shader_resource_view(struct wined3d_shader_resour
if (swapchain_count)
wined3d_device_incref(device);
wined3d_shader_resource_view_cleanup(&view_gl->v);
- wined3d_view_gl_destroy(device, &view_gl->gl_view, 0, view_gl);
+ wined3d_view_gl_destroy(device, &view_gl->gl_view, NULL, view_gl);
if (swapchain_count)
wined3d_device_decref(device);
}
@@ -4959,7 +4959,7 @@ static void adapter_gl_destroy_unordered_access_view(struct wined3d_unordered_ac
if (swapchain_count)
wined3d_device_incref(device);
wined3d_unordered_access_view_cleanup(&view_gl->v);
- wined3d_view_gl_destroy(device, &view_gl->gl_view, view_gl->counter_bo, view_gl);
+ wined3d_view_gl_destroy(device, &view_gl->gl_view, &view_gl->counter_bo, view_gl);
if (swapchain_count)
wined3d_device_decref(device);
}
--
2.11.0
Dec. 12, 2019
Re: [PATCH] wined3d: Fix the spelling of some comments.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH] ieframe/tests: Fix a typo in ok() message.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 9/9] jscript/tests: Add initial tests for the script TypeInfo.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 8/9] jscript: Implement ScriptTypeComp_BindType.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 7/9] jscript: Implement ScriptTypeComp_Bind.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 6/9] jscript: Implement ScriptTypeInfo_GetTypeComp.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 5/9] jscript: Implement ScriptTypeInfo_GetIDsOfNames.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 4/9] jscript: Implement ScriptTypeInfo_GetVarDesc.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 3/9] jscript: Implement ScriptTypeInfo_GetFuncDesc.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 2/9] jscript: Implement ScriptTypeInfo_GetTypeAttr.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH v4 1/9] jscript: Store the necessary function and variable info in the TypeInfo.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 12, 2019
Re: [PATCH] ntoskrnl.exe/tests: Fix typos in ok() messages.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62050
Your paranoid android.
=== w7u (task log) ===
Task errors:
The previous 1 run(s) terminated abnormally
=== w8 (task log) ===
Task errors:
The previous 1 run(s) terminated abnormally
Dec. 12, 2019
[PATCH] ole32: Fix typos in comments.
by Andrey Gusev
Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com>
---
dlls/ole32/compobj.c | 2 +-
dlls/ole32/storage32.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index a91067fcb7..daa405356f 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -4763,7 +4763,7 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
* PARAMS
* pszName [I] String representing the object.
* pBindOptions [I] Parameters affecting the binding to the named object.
- * riid [I] Interface to bind to on the objecct.
+ * riid [I] Interface to bind to on the object.
* ppv [O] On output, the interface riid of the object represented
* by pszName.
*
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 515880ec36..6b05669a5e 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -8622,7 +8622,7 @@ end:
* pwcsName [ I] Unicode string with filename (can be relative or NULL)
* grfMode [ I] Access mode for opening the new storage object (see STGM_ constants)
* reserved [ ?] unused?, usually 0
- * ppstgOpen [IO] A pointer to IStorage pointer to the new onject
+ * ppstgOpen [IO] A pointer to IStorage pointer to the new object
*
* RETURNS
* S_OK if the file was successfully created
--
2.23.0
Dec. 12, 2019
[PATCH 5/5] msado15: Implement _Recordset_Open and _Recordset_Close.
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msado15/recordset.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index b214f9d077..e854b3e824 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -901,8 +901,13 @@ static HRESULT WINAPI recordset_CancelUpdate( _Recordset *iface )
static HRESULT WINAPI recordset_Close( _Recordset *iface )
{
- FIXME( "%p\n", iface );
- return E_NOTIMPL;
+ struct recordset *recordset = impl_from_Recordset( iface );
+
+ TRACE( "%p\n", recordset );
+
+ close_recordset( recordset );
+ recordset->state = adStateClosed;
+ return S_OK;
}
static HRESULT WINAPI recordset_Delete( _Recordset *iface, AffectEnum affect_records )
@@ -950,9 +955,13 @@ static HRESULT WINAPI recordset_MoveLast( _Recordset *iface )
static HRESULT WINAPI recordset_Open( _Recordset *iface, VARIANT source, VARIANT active_connection,
CursorTypeEnum cursor_type, LockTypeEnum lock_type, LONG options )
{
- FIXME( "%p, %s, %s, %d, %d, %d\n", iface, debugstr_variant(&source), debugstr_variant(&active_connection),
+ struct recordset *recordset = impl_from_Recordset( iface );
+
+ FIXME( "%p, %s, %s, %d, %d, %d\n", recordset, debugstr_variant(&source), debugstr_variant(&active_connection),
cursor_type, lock_type, options );
- return E_NOTIMPL;
+
+ recordset->state = adStateOpen;
+ return S_OK;
}
static HRESULT WINAPI recordset_Requery( _Recordset *iface, LONG options )
--
2.20.1
Dec. 12, 2019
[PATCH 4/5] msado15: Implement Field_get_Value and Field_put_Value.
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msado15/recordset.c | 67 +++++++++++++++++++++++++++++++++++++---
1 file changed, 62 insertions(+), 5 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index b262243d89..b214f9d077 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -36,7 +36,12 @@ struct recordset
{
_Recordset Recordset_iface;
LONG refs;
+ LONG state;
struct fields *fields;
+ LONG count;
+ LONG allocated;
+ LONG index;
+ VARIANT *data;
};
struct fields
@@ -187,16 +192,51 @@ static HRESULT WINAPI field_get_Type( Field *iface, DataTypeEnum *type )
return S_OK;
}
+static LONG get_column_count( struct recordset *recordset )
+{
+ return recordset->fields->count;
+}
+
static HRESULT WINAPI field_get_Value( Field *iface, VARIANT *val )
{
- FIXME( "%p, %p\n", iface, val );
- return E_NOTIMPL;
+ struct field *field = impl_from_Field( iface );
+ ULONG row = field->recordset->index, col = field->index, col_count;
+ VARIANT copy;
+ HRESULT hr;
+
+ TRACE( "%p, %p\n", field, val );
+
+ if (field->recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
+ if (field->recordset->index < 0) return MAKE_ADO_HRESULT( adErrNoCurrentRecord );
+
+ col_count = get_column_count( field->recordset );
+
+ VariantInit( © );
+ if ((hr = VariantCopy( ©, &field->recordset->data[row * col_count + col] )) != S_OK) return hr;
+
+ *val = copy;
+ return S_OK;
}
static HRESULT WINAPI field_put_Value( Field *iface, VARIANT val )
{
- FIXME( "%p, %s\n", iface, debugstr_variant(&val) );
- return E_NOTIMPL;
+ struct field *field = impl_from_Field( iface );
+ ULONG row = field->recordset->index, col = field->index, col_count;
+ VARIANT copy;
+ HRESULT hr;
+
+ TRACE( "%p, %s\n", field, debugstr_variant(&val) );
+
+ if (field->recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
+ if (field->recordset->index < 0) return MAKE_ADO_HRESULT( adErrNoCurrentRecord );
+
+ col_count = get_column_count( field->recordset );
+
+ VariantInit( © );
+ if ((hr = VariantCopy( ©, &val )) != S_OK) return hr;
+
+ field->recordset->data[row * col_count + col] = copy;
+ return S_OK;
}
static HRESULT WINAPI field_get_Precision( Field *iface, unsigned char *precision )
@@ -614,6 +654,22 @@ static ULONG WINAPI recordset_AddRef( _Recordset *iface )
return refs;
}
+static void close_recordset( struct recordset *recordset )
+{
+ ULONG row, col, col_count = get_column_count( recordset );
+
+ recordset->fields->recordset = NULL;
+ Fields_Release( &recordset->fields->Fields_iface );
+ recordset->fields = NULL;
+
+ for (row = 0; row < recordset->count; row++)
+ for (col = 0; col < col_count; col++) VariantClear( &recordset->data[row * col_count + col] );
+
+ recordset->count = recordset->allocated = recordset->index = 0;
+ heap_free( recordset->data );
+ recordset->data = NULL;
+}
+
static ULONG WINAPI recordset_Release( _Recordset *iface )
{
struct recordset *recordset = impl_from_Recordset( iface );
@@ -622,7 +678,7 @@ static ULONG WINAPI recordset_Release( _Recordset *iface )
if (!refs)
{
TRACE( "destroying %p\n", recordset );
- recordset->fields->recordset = NULL;
+ close_recordset( recordset );
heap_free( recordset );
}
return refs;
@@ -1264,6 +1320,7 @@ HRESULT Recordset_create( void **obj )
if (!(recordset = heap_alloc_zero( sizeof(*recordset) ))) return E_OUTOFMEMORY;
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
recordset->refs = 1;
+ recordset->index = -1;
*obj = &recordset->Recordset_iface;
TRACE( "returning iface %p\n", *obj );
--
2.20.1
Dec. 12, 2019
[PATCH 3/5] msado15: Implement Field_get_Attributes and Field_get_DefinedSize.
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msado15/recordset.c | 16 ++++++++++++----
dlls/msado15/tests/msado15.c | 22 +++++++++++++++++++++-
2 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index ff06b8789a..b262243d89 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -147,14 +147,22 @@ static HRESULT WINAPI field_get_ActualSize( Field *iface, LONG *size )
static HRESULT WINAPI field_get_Attributes( Field *iface, LONG *attrs )
{
- TRACE( "%p, %p\n", iface, attrs );
- return E_NOTIMPL;
+ struct field *field = impl_from_Field( iface );
+
+ TRACE( "%p, %p\n", field, attrs );
+
+ *attrs = field->attrs;
+ return S_OK;
}
static HRESULT WINAPI field_get_DefinedSize( Field *iface, LONG *size )
{
- FIXME( "%p, %p\n", iface, size );
- return E_NOTIMPL;
+ struct field *field = impl_from_Field( iface );
+
+ TRACE( "%p, %p\n", field, size );
+
+ *size = field->defined_size;
+ return S_OK;
}
static HRESULT WINAPI field_get_Name( Field *iface, BSTR *str )
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 800eb236fe..f9a5377c50 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -101,7 +101,9 @@ static void test_Fields(void)
Field *field, *field2;
VARIANT val, index;
BSTR name;
- LONG refs, count;
+ LONG refs, count, size;
+ DataTypeEnum type;
+ FieldAttributeEnum attrs;
HRESULT hr;
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
@@ -164,6 +166,24 @@ static void test_Fields(void)
Field_Release( field2 );
SysFreeString( name );
+ /* verify values set with _Append */
+ hr = Field_get_Name( field, &name );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( !lstrcmpW( name, L"field" ), "got %s\n", wine_dbgstr_w(name) );
+ SysFreeString( name );
+ type = 0xdead;
+ hr = Field_get_Type( field, &type );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( type == adInteger, "got %d\n", type );
+ size = -1;
+ hr = Field_get_DefinedSize( field, &size );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( size == 4, "got %d\n", size );
+ attrs = 0xdead;
+ hr = Field_get_Attributes( field, &attrs );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( !attrs, "got %d\n", attrs );
+
Field_Release( field );
Fields_Release( fields );
_Recordset_Release( recordset );
--
2.20.1
Dec. 12, 2019
[PATCH 2/5] msado15: Implement Fields_get_Item.
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msado15/recordset.c | 42 ++++++++++++++++++++++++++++++++++--
dlls/msado15/tests/msado15.c | 42 ++++++++++++++++++++++++++++++++++--
2 files changed, 80 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index a20d5920da..ff06b8789a 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -433,10 +433,48 @@ static HRESULT WINAPI fields_Refresh( Fields *iface )
return E_NOTIMPL;
}
+static HRESULT map_index( struct fields *fields, VARIANT *index, ULONG *ret )
+{
+ ULONG i;
+
+ if (V_VT( index ) != VT_BSTR)
+ {
+ FIXME( "variant type %u not supported\n", V_VT( index ) );
+ return E_INVALIDARG;
+ }
+
+ for (i = 0; i < fields->count; i++)
+ {
+ BSTR name;
+ BOOL match;
+ HRESULT hr;
+
+ if ((hr = Field_get_Name( fields->field[i], &name )) != S_OK) return hr;
+ match = !wcsicmp( V_BSTR( index ), name );
+ SysFreeString( name );
+ if (match)
+ {
+ *ret = i;
+ return S_OK;
+ }
+ }
+
+ return E_INVALIDARG;
+}
+
static HRESULT WINAPI fields_get_Item( Fields *iface, VARIANT index, Field **obj )
{
- FIXME( "%p, %s, %p\n", iface, debugstr_variant(&index), obj );
- return E_NOTIMPL;
+ struct fields *fields = impl_from_Fields( iface );
+ HRESULT hr;
+ ULONG i;
+
+ TRACE( "%p, %s, %p\n", fields, debugstr_variant(&index), obj );
+
+ if ((hr = map_index( fields, &index, &i )) != S_OK) return hr;
+
+ Field_AddRef( fields->field[i] );
+ *obj = fields->field[i];
+ return S_OK;
}
static BOOL resize_fields( struct fields *fields, ULONG count )
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 03b2828d9f..800eb236fe 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -25,6 +25,12 @@
#define MAKE_ADO_HRESULT( err ) MAKE_HRESULT( SEVERITY_ERROR, FACILITY_CONTROL, err )
+static LONG get_refs_field( Field *field )
+{
+ Field_AddRef( field );
+ return Field_Release( field );
+}
+
static LONG get_refs_fields( Fields *fields )
{
Fields_AddRef( fields );
@@ -92,9 +98,10 @@ static void test_Fields(void)
{
_Recordset *recordset;
Fields *fields;
- VARIANT val;
+ Field *field, *field2;
+ VARIANT val, index;
BSTR name;
- LONG count;
+ LONG refs, count;
HRESULT hr;
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
@@ -127,6 +134,37 @@ static void test_Fields(void)
hr = Fields_get_Count( fields, &count );
ok( count == 2, "got %d\n", count );
+ /* handing out field object doesn't add reference to fields or recordset object */
+ name = SysAllocString( L"field" );
+ V_VT( &index ) = VT_BSTR;
+ V_BSTR( &index ) = name;
+ refs = get_refs_recordset( recordset );
+ ok( refs == 2, "got %d\n", refs );
+ refs = get_refs_fields( fields );
+ ok( refs == 1, "got %d\n", refs );
+ hr = Fields_get_Item( fields, index, &field );
+ ok( hr == S_OK, "got %08x\n", hr );
+ refs = get_refs_field( field );
+ ok( refs == 1, "got %d\n", refs );
+ refs = get_refs_recordset( recordset );
+ ok( refs == 2, "got %d\n", refs );
+ refs = get_refs_fields( fields );
+ ok( refs == 1, "got %d\n", refs );
+
+ /* calling get_Item again returns the same object and adds reference */
+ hr = Fields_get_Item( fields, index, &field2 );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( field2 == field, "expected same object\n" );
+ refs = get_refs_field( field2 );
+ ok( refs == 2, "got %d\n", refs );
+ refs = get_refs_recordset( recordset );
+ ok( refs == 2, "got %d\n", refs );
+ refs = get_refs_fields( fields );
+ ok( refs == 1, "got %d\n", refs );
+ Field_Release( field2 );
+ SysFreeString( name );
+
+ Field_Release( field );
Fields_Release( fields );
_Recordset_Release( recordset );
}
--
2.20.1
Dec. 12, 2019
[PATCH 1/5] msado15: Implement Field_get_Name and Field_get_Type.
by Hans Leidekker
Applies after 175712.
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msado15/recordset.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index 78d13d1577..a20d5920da 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -159,14 +159,24 @@ static HRESULT WINAPI field_get_DefinedSize( Field *iface, LONG *size )
static HRESULT WINAPI field_get_Name( Field *iface, BSTR *str )
{
- FIXME( "%p, %p\n", iface, str );
- return E_NOTIMPL;
+ struct field *field = impl_from_Field( iface );
+ BSTR name;
+
+ TRACE( "%p, %p\n", field, str );
+
+ if (!(name = SysAllocString( field->name ))) return E_OUTOFMEMORY;
+ *str = name;
+ return S_OK;
}
static HRESULT WINAPI field_get_Type( Field *iface, DataTypeEnum *type )
{
- FIXME( "%p, %p\n", iface, type );
- return E_NOTIMPL;
+ struct field *field = impl_from_Field( iface );
+
+ TRACE( "%p, %p\n", field, type );
+
+ *type = field->type;
+ return S_OK;
}
static HRESULT WINAPI field_get_Value( Field *iface, VARIANT *val )
--
2.20.1
Dec. 12, 2019
[PATCH] ieframe/tests: Fix a typo in ok() message.
by Andrey Gusev
Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com>
---
dlls/ieframe/tests/webbrowser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c
index 9ec54a7077..0195851bda 100644
--- a/dlls/ieframe/tests/webbrowser.c
+++ b/dlls/ieframe/tests/webbrowser.c
@@ -2665,7 +2665,7 @@ static void test_Extent(IWebBrowser2 *unk)
trace("dpi: %d / %d\n", dpi_y, dpi_y);
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
- ok(hres == S_OK, "Could not get IOleObkect: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IOleObject: %08x\n", hres);
if(FAILED(hres))
return;
--
2.23.0
Dec. 12, 2019
Re: [PATCH 2/2] msado15: Add _Command stub interface.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=62049
Your paranoid android.
=== debian10 (32 bit report) ===
msado15:
msado15.c:456: Test failed: got 80040154
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040385b).
Report errors:
msado15:msado15 crashed (c0000005)
=== debian10 (32 bit French report) ===
msado15:
msado15.c:456: Test failed: got 80040154
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040385b).
Report errors:
msado15:msado15 crashed (c0000005)
=== debian10 (32 bit Japanese:Japan report) ===
msado15:
msado15.c:456: Test failed: got 80040154
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040385b).
Report errors:
msado15:msado15 crashed (c0000005)
=== debian10 (32 bit Chinese:China report) ===
msado15:
msado15.c:456: Test failed: got 80040154
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040385b).
Report errors:
msado15:msado15 crashed (c0000005)
=== debian10 (32 bit WoW report) ===
msado15:
msado15.c:456: Test failed: got 80040154
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040385b).
Report errors:
msado15:msado15 crashed (c0000005)
=== debian10 (64 bit WoW report) ===
msado15:
msado15.c:456: Test failed: got 80040154
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040385b).
Report errors:
msado15:msado15 crashed (c0000005)
Dec. 12, 2019