Wine-devel
Threads by month
- ----- 2026 -----
- 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
April 2020
- 87 participants
- 854 discussions
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/adsldp/tests/ldap.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/dlls/adsldp/tests/ldap.c b/dlls/adsldp/tests/ldap.c
index 208a9fa2fe..e76bd2e0b6 100644
--- a/dlls/adsldp/tests/ldap.c
+++ b/dlls/adsldp/tests/ldap.c
@@ -505,7 +505,6 @@ todo_wine
hr = IDirectorySearch_ExecuteSearch(ds, (WCHAR *)L"(objectClass=*)", NULL, ~0, &sh);
ok(hr == S_OK, "got %#x\n", hr);
- if (hr != S_OK) goto fail;
hr = IDirectorySearch_GetNextRow(ds, sh);
ok(hr == S_OK, "got %#x\n", hr);
@@ -517,7 +516,6 @@ todo_wine
ok(hr == S_OK, "got %#x\n", hr);
IDirectorySearch_Release(ds);
-fail:
IDirectoryObject_Release(dirobj);
}
--
2.25.2
1
0
[PATCH 5/7] adsldp: Recognize ADS_SEARCHPREF_CACHE_RESULTS in IDirectorySearch::SetSearchPreference().
by Dmitry Timoshkov 06 Apr '20
by Dmitry Timoshkov 06 Apr '20
06 Apr '20
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/adsldp/adsldp.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c
index 952e4931d4..f2773262a6 100644
--- a/dlls/adsldp/adsldp.c
+++ b/dlls/adsldp/adsldp.c
@@ -401,6 +401,7 @@ typedef struct
{
ADS_SCOPEENUM scope;
int pagesize;
+ BOOL cache_results;
} search;
} LDAP_namespace;
@@ -1228,6 +1229,19 @@ static HRESULT WINAPI search_SetSearchPreference(IDirectorySearch *iface, PADS_S
prefs[i].dwStatus = ADS_STATUS_S_OK;
break;
+ case ADS_SEARCHPREF_CACHE_RESULTS:
+ if (prefs[i].vValue.dwType != ADSTYPE_BOOLEAN)
+ {
+ FIXME("ADS_SEARCHPREF_CACHE_RESULTS: not supportd dwType %d\n", prefs[i].vValue.dwType);
+ prefs[i].dwStatus = ADS_STATUS_INVALID_SEARCHPREFVALUE;
+ break;
+ }
+
+ TRACE("CACHE_RESULTS: %d\n", prefs[i].vValue.u.Boolean);
+ ldap->search.cache_results = prefs[i].vValue.u.Boolean;
+ prefs[i].dwStatus = ADS_STATUS_S_OK;
+ break;
+
default:
FIXME("pref %d, type %u: stub\n", prefs[i].dwSearchPref, prefs[i].vValue.dwType);
prefs[i].dwStatus = ADS_STATUS_INVALID_SEARCHPREF;
@@ -1728,6 +1742,7 @@ static HRESULT LDAPNamespace_create(REFIID riid, void **obj)
ldap->attrs = NULL;
ldap->search.scope = ADS_SCOPE_SUBTREE;
ldap->search.pagesize = 0;
+ ldap->search.cache_results = TRUE;
ldap->at = NULL;
ldap->at_single_count = 0;
ldap->at_multiple_count = 0;
--
2.25.2
1
0
This fixes 'supported == user_count' comparison if the server has duplicate
control OIDs in the returned list.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/wldap32/option.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlls/wldap32/option.c b/dlls/wldap32/option.c
index 87eb779953..cf948bf037 100644
--- a/dlls/wldap32/option.c
+++ b/dlls/wldap32/option.c
@@ -439,10 +439,15 @@ static BOOL is_supported_server_ctrls( WLDAP32_LDAP *ld, LDAPControl **ctrls )
for (n = 0; n < user_count; n++)
{
+ TRACE("looking for %s\n", debugstr_a(ctrls[n]->ldctl_oid));
+
for (i = 0; i < server_count; i++)
{
if (!strncmp( ctrls[n]->ldctl_oid, ld->ld_server_ctrls[i]->bv_val, ld->ld_server_ctrls[i]->bv_len))
+ {
supported++;
+ break;
+ }
}
}
--
2.25.2
1
0
06 Apr '20
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/adsldp/adsldp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c
index 550f78bd9a..a4467c0abe 100644
--- a/dlls/adsldp/adsldp.c
+++ b/dlls/adsldp/adsldp.c
@@ -1317,7 +1317,7 @@ static HRESULT WINAPI search_GetNextRow(IDirectorySearch *iface, ADS_SEARCH_HAND
if (ldap_ctx->pos >= ldap_ctx->count)
return S_ADS_NOMORE_ROWS;
- ldap_ctx->entry = ldap_next_entry(ldap->ld, ldap_ctx->res);
+ ldap_ctx->entry = ldap_next_entry(ldap->ld, ldap_ctx->entry);
}
if (!ldap_ctx->entry)
--
2.25.2
1
0
[PATCH v2 3/4] qasf: Implement IFileSourceFilter_Load() for WM ASF reader.
by Jactry Zeng 06 Apr '20
by Jactry Zeng 06 Apr '20
06 Apr '20
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
dlls/qasf/asfreader.c | 26 +++++++-
dlls/qasf/tests/asfreader.c | 123 ++++++++++++++++++++++++++++++++++++
2 files changed, 147 insertions(+), 2 deletions(-)
diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c
index 8388d79a31..6630d7badc 100644
--- a/dlls/qasf/asfreader.c
+++ b/dlls/qasf/asfreader.c
@@ -26,6 +26,9 @@ struct asf_reader
{
struct strmbase_filter filter;
IFileSourceFilter IFileSourceFilter_iface;
+
+ AM_MEDIA_TYPE type;
+ LPOLESTR filename;
};
static inline struct asf_reader *impl_reader_from_strmbase_filter(struct strmbase_filter *iface)
@@ -47,6 +50,9 @@ static void asf_reader_destroy(struct strmbase_filter *iface)
{
struct asf_reader *filter = impl_reader_from_strmbase_filter(iface);
+ free(filter->filename);
+ FreeMediaType(&filter->type);
+
strmbase_filter_cleanup(&filter->filter);
free(filter);
}
@@ -95,9 +101,25 @@ static ULONG WINAPI filesourcefilter_Release(IFileSourceFilter *iface)
static HRESULT WINAPI filesourcefilter_Load(IFileSourceFilter * iface, LPCOLESTR filename, const AM_MEDIA_TYPE *type)
{
- FIXME("(%p, %s, %p): stub.\n", iface, debugstr_w(filename), type);
+ struct asf_reader *This = impl_reader_from_IFileSourceFilter(iface);
- return E_NOTIMPL;
+ TRACE("(%p, %s, %p).\n", iface, debugstr_w(filename), type);
+ strmbase_dump_media_type(type);
+
+ if (!filename)
+ return E_POINTER;
+
+ if (This->filename)
+ return E_FAIL;
+
+ This->filename = wcsdup(filename);
+ if (!This->filename)
+ return E_OUTOFMEMORY;
+
+ if (type)
+ CopyMediaType(&This->type, type);
+
+ return S_OK;
}
static HRESULT WINAPI filesourcefilter_GetCurFile(IFileSourceFilter *iface, LPOLESTR *filename, AM_MEDIA_TYPE *type)
diff --git a/dlls/qasf/tests/asfreader.c b/dlls/qasf/tests/asfreader.c
index b3f61a352a..c90956c85e 100644
--- a/dlls/qasf/tests/asfreader.c
+++ b/dlls/qasf/tests/asfreader.c
@@ -27,6 +27,7 @@
#include "initguid.h"
+DEFINE_GUID(IID_TESTIID, 0x22222222, 0x2222, 0x2222, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22);
DEFINE_GUID(IID_IWMHeaderInfo, 0x96406bda, 0x2b2b, 0x11d3, 0xb3, 0x6b, 0x00, 0xc0, 0x4f, 0x61, 0x08, 0xff);
DEFINE_GUID(IID_IWMReaderAdvanced, 0x96406bea, 0x2b2b, 0x11d3, 0xb3, 0x6b, 0x00, 0xc0, 0x4f, 0x61, 0x08, 0xff);
DEFINE_GUID(IID_IWMReaderAdvanced2, 0xae14a945, 0xb90c, 0x4d0d, 0x91, 0x27, 0x80, 0xd6, 0x65, 0xf7, 0xd7, 0x3e);
@@ -181,12 +182,134 @@ static void test_aggregation(void)
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
}
+static void test_filesourcefilter(void)
+{
+ IFileSourceFilter *filesource;
+ IFilterGraph2 *graph;
+ IEnumPins *enumpins;
+ IBaseFilter *filter;
+ AM_MEDIA_TYPE type;
+ LPOLESTR olepath;
+ IPin *pins[4];
+ HRESULT hr;
+ ULONG ref;
+
+ hr = CoCreateInstance(&CLSID_WMAsfReader, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IBaseFilter, (void **)&filter);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ ref = get_refcount(filter);
+ ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ hr = IBaseFilter_QueryInterface(filter, &IID_IFileSourceFilter, (void **)&filesource);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = get_refcount(filesource);
+ ok(ref == 2, "Got unexpected refcount %d.\n", ref);
+ ref = get_refcount(filter);
+ ok(ref == 2, "Got unexpected refcount %d.\n", ref);
+
+ hr = IFileSourceFilter_Load(filesource, NULL, NULL);
+ ok(hr == E_POINTER, "Got hr %#x.\n", hr);
+
+ olepath = (void *)0xdeadbeef;
+ memset(&type, 0x22, sizeof(type));
+ hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type);
+ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ todo_wine ok(!olepath, "Got %s.\n", wine_dbgstr_w(olepath));
+ todo_wine ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n",
+ wine_dbgstr_guid(&type.majortype));
+ todo_wine ok(IsEqualGUID(&type.subtype, &MEDIASUBTYPE_NULL), "Got subtype %s.\n",
+ wine_dbgstr_guid(&type.subtype));
+ ok(type.bFixedSizeSamples == 0x22222222, "Got fixed size %d.\n", type.bFixedSizeSamples);
+ ok(type.bTemporalCompression == 0x22222222, "Got temporal compression %d.\n", type.bTemporalCompression);
+ todo_wine ok(!type.lSampleSize, "Got sample size %u.\n", type.lSampleSize);
+ ok(IsEqualIID(&type.formattype, &IID_TESTIID), "Got format type %s.\n", wine_dbgstr_guid(&type.formattype));
+ todo_wine ok(!type.pUnk, "Got pUnk %p.\n", type.pUnk);
+ todo_wine ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat);
+ ok(type.pbFormat == (BYTE *)0x22222222, "Got format block %p.\n", type.pbFormat);
+
+ hr = IFileSourceFilter_Load(filesource, L"nonexistent.wmv", NULL);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IFileSourceFilter_GetCurFile(filesource, NULL, NULL);
+ todo_wine ok(hr == E_POINTER, "Got hr %#x.\n", hr);
+
+ hr = IFileSourceFilter_Load(filesource, L"nonexistent2.wmv", NULL);
+ ok(hr == E_FAIL, "Got hr %#x.\n", hr);
+
+ olepath = (void *)0xdeadbeef;
+ memset(&type, 0x22, sizeof(type));
+ hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type);
+ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ if (SUCCEEDED(hr))
+ {
+ ok(!wcscmp(olepath, L"nonexistent.wmv"), "Expected path %s, got %s.\n",
+ wine_dbgstr_w(L"nonexistent.wmv"), wine_dbgstr_w(olepath));
+ ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n",
+ wine_dbgstr_guid(&type.majortype));
+ ok(IsEqualGUID(&type.subtype, &MEDIASUBTYPE_NULL), "Got subtype %s.\n",
+ wine_dbgstr_guid(&type.subtype));
+ ok(type.bFixedSizeSamples == 0x22222222, "Got fixed size %d.\n", type.bFixedSizeSamples);
+ ok(type.bTemporalCompression == 0x22222222, "Got temporal compression %d.\n", type.bTemporalCompression);
+ ok(!type.lSampleSize, "Got sample size %u.\n", type.lSampleSize);
+ ok(IsEqualIID(&type.formattype, &IID_TESTIID), "Got format type %s.\n", wine_dbgstr_guid(&type.formattype));
+ ok(!type.pUnk, "Got pUnk %p.\n", type.pUnk);
+ ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat);
+ ok(type.pbFormat == (BYTE *)0x22222222, "Got format block %p.\n", type.pbFormat);
+ CoTaskMemFree(olepath);
+ }
+
+ hr = IBaseFilter_EnumPins(filter, &enumpins);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IEnumPins_Next(enumpins, 1, pins, NULL);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ IEnumPins_Release(enumpins);
+
+ hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IFilterGraph2, (void **)&graph);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IFilterGraph2_AddFilter(graph, filter, NULL);
+ todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) ||
+ broken(hr == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND)) /* win2008 */,
+ "Got hr %#x.\n", hr);
+
+ hr = IFileSourceFilter_Load(filesource, L"nonexistent2.wmv", NULL);
+ ok(hr == E_FAIL, "Got hr %#x.\n", hr);
+
+ olepath = (void *)0xdeadbeef;
+ memset(&type, 0x22, sizeof(type));
+ hr = IFileSourceFilter_GetCurFile(filesource, &olepath, &type);
+ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ if (SUCCEEDED(hr))
+ {
+ ok(!wcscmp(olepath, L"nonexistent.wmv"), "Expected path %s, got %s.\n",
+ wine_dbgstr_w(L"nonexistent.wmv"), wine_dbgstr_w(olepath));
+ ok(IsEqualGUID(&type.majortype, &MEDIATYPE_NULL), "Got majortype %s.\n",
+ wine_dbgstr_guid(&type.majortype));
+ ok(IsEqualGUID(&type.subtype, &MEDIASUBTYPE_NULL), "Got subtype %s.\n",
+ wine_dbgstr_guid(&type.subtype));
+ ok(type.bFixedSizeSamples == 0x22222222, "Got fixed size %d.\n", type.bFixedSizeSamples);
+ ok(type.bTemporalCompression == 0x22222222, "Got temporal compression %d.\n", type.bTemporalCompression);
+ ok(!type.lSampleSize, "Got sample size %u.\n", type.lSampleSize);
+ ok(IsEqualIID(&type.formattype, &IID_TESTIID), "Got format type %s.\n", wine_dbgstr_guid(&type.formattype));
+ ok(!type.pUnk, "Got pUnk %p.\n", type.pUnk);
+ ok(!type.cbFormat, "Got format size %u.\n", type.cbFormat);
+ ok(type.pbFormat == (BYTE *)0x22222222, "Got format block %p.\n", type.pbFormat);
+ CoTaskMemFree(olepath);
+ }
+
+ ref = IFilterGraph2_Release(graph);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ IBaseFilter_Release(filter);
+ ref = IFileSourceFilter_Release(filesource);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
START_TEST(asfreader)
{
CoInitializeEx(NULL, COINIT_MULTITHREADED);
test_interfaces();
test_aggregation();
+ test_filesourcefilter();
CoUninitialize();
}
--
2.26.0
2
1
06 Apr '20
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
dlls/qasf/asfreader.c | 67 +++++++++++++++++++++++++++++++++++++
dlls/qasf/tests/asfreader.c | 2 +-
2 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c
index e5dbd1d052..8388d79a31 100644
--- a/dlls/qasf/asfreader.c
+++ b/dlls/qasf/asfreader.c
@@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qasf);
struct asf_reader
{
struct strmbase_filter filter;
+ IFileSourceFilter IFileSourceFilter_iface;
};
static inline struct asf_reader *impl_reader_from_strmbase_filter(struct strmbase_filter *iface)
@@ -32,6 +33,11 @@ static inline struct asf_reader *impl_reader_from_strmbase_filter(struct strmbas
return CONTAINING_RECORD(iface, struct asf_reader, filter);
}
+static inline struct asf_reader *impl_reader_from_IFileSourceFilter(IFileSourceFilter *iface)
+{
+ return CONTAINING_RECORD(iface, struct asf_reader, IFileSourceFilter_iface);
+}
+
static struct strmbase_pin *asf_reader_get_pin(struct strmbase_filter *iface, unsigned int index)
{
return NULL;
@@ -45,10 +51,69 @@ static void asf_reader_destroy(struct strmbase_filter *iface)
free(filter);
}
+static HRESULT asf_reader_query_interface(struct strmbase_filter *iface, REFIID iid, void **out)
+{
+ struct asf_reader *filter = impl_reader_from_strmbase_filter(iface);
+
+ if (IsEqualGUID(iid, &IID_IFileSourceFilter))
+ {
+ *out = &filter->IFileSourceFilter_iface;
+ IUnknown_AddRef((IUnknown *)*out);
+ return S_OK;
+ }
+
+ return E_NOINTERFACE;
+}
+
static struct strmbase_filter_ops filter_ops =
{
.filter_get_pin = asf_reader_get_pin,
.filter_destroy = asf_reader_destroy,
+ .filter_query_interface = asf_reader_query_interface,
+};
+
+static HRESULT WINAPI filesourcefilter_QueryInterface(IFileSourceFilter *iface, REFIID riid, void **out)
+{
+ struct asf_reader *This = impl_reader_from_IFileSourceFilter(iface);
+
+ return IBaseFilter_QueryInterface(&This->filter.IBaseFilter_iface, riid, out);
+}
+
+static ULONG WINAPI filesourcefilter_AddRef(IFileSourceFilter *iface)
+{
+ struct asf_reader *This = impl_reader_from_IFileSourceFilter(iface);
+
+ return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface);
+}
+
+static ULONG WINAPI filesourcefilter_Release(IFileSourceFilter *iface)
+{
+ struct asf_reader *This = impl_reader_from_IFileSourceFilter(iface);
+
+ return IBaseFilter_Release(&This->filter.IBaseFilter_iface);
+}
+
+static HRESULT WINAPI filesourcefilter_Load(IFileSourceFilter * iface, LPCOLESTR filename, const AM_MEDIA_TYPE *type)
+{
+ FIXME("(%p, %s, %p): stub.\n", iface, debugstr_w(filename), type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI filesourcefilter_GetCurFile(IFileSourceFilter *iface, LPOLESTR *filename, AM_MEDIA_TYPE *type)
+{
+ FIXME("(%p, %p, %p): stub.\n", iface, filename, type);
+
+ return E_NOTIMPL;
+}
+
+static const IFileSourceFilterVtbl filesourcefilter_vtbl =
+{
+ filesourcefilter_QueryInterface,
+ filesourcefilter_AddRef,
+ filesourcefilter_Release,
+ filesourcefilter_Load,
+ filesourcefilter_GetCurFile
};
HRESULT asf_reader_create(IUnknown *outer, IUnknown **out)
@@ -60,6 +125,8 @@ HRESULT asf_reader_create(IUnknown *outer, IUnknown **out)
strmbase_filter_init(&object->filter, outer, &CLSID_WMAsfReader, &filter_ops);
+ object->IFileSourceFilter_iface.lpVtbl = &filesourcefilter_vtbl;
+
TRACE("Created WM ASF reader %p.\n", object);
*out = &object->filter.IUnknown_inner;
diff --git a/dlls/qasf/tests/asfreader.c b/dlls/qasf/tests/asfreader.c
index 2b8e8f6f00..b3f61a352a 100644
--- a/dlls/qasf/tests/asfreader.c
+++ b/dlls/qasf/tests/asfreader.c
@@ -71,7 +71,7 @@ static void test_interfaces(void)
check_interface(filter, &IID_IBaseFilter, TRUE);
check_interface(filter, &IID_IMediaFilter, TRUE);
- todo_wine check_interface(filter, &IID_IFileSourceFilter, TRUE);
+ check_interface(filter, &IID_IFileSourceFilter, TRUE);
check_interface(filter, &IID_IPersist, TRUE);
check_interface(filter, &IID_IUnknown, TRUE);
--
2.26.0
2
1
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
dlls/qasf/Makefile.in | 3 +-
dlls/qasf/asfreader.c | 67 +++++++++++++
dlls/qasf/qasf_classes.idl | 7 ++
dlls/qasf/qasf_main.c | 3 +
dlls/qasf/qasf_private.h | 1 +
dlls/qasf/tests/Makefile.in | 3 +-
dlls/qasf/tests/asfreader.c | 192 ++++++++++++++++++++++++++++++++++++
7 files changed, 274 insertions(+), 2 deletions(-)
create mode 100644 dlls/qasf/asfreader.c
create mode 100644 dlls/qasf/tests/asfreader.c
diff --git a/dlls/qasf/Makefile.in b/dlls/qasf/Makefile.in
index dd02f5a344..fe22071ac0 100644
--- a/dlls/qasf/Makefile.in
+++ b/dlls/qasf/Makefile.in
@@ -5,7 +5,8 @@ EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
dmowrapper.c \
- qasf_main.c
+ qasf_main.c \
+ asfreader.c
IDL_SRCS = \
qasf_classes.idl
diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c
new file mode 100644
index 0000000000..e5dbd1d052
--- /dev/null
+++ b/dlls/qasf/asfreader.c
@@ -0,0 +1,67 @@
+/*
+ * WM ASF reader
+ *
+ * Copyright 2020 Jactry Zeng for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "qasf_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(qasf);
+
+struct asf_reader
+{
+ struct strmbase_filter filter;
+};
+
+static inline struct asf_reader *impl_reader_from_strmbase_filter(struct strmbase_filter *iface)
+{
+ return CONTAINING_RECORD(iface, struct asf_reader, filter);
+}
+
+static struct strmbase_pin *asf_reader_get_pin(struct strmbase_filter *iface, unsigned int index)
+{
+ return NULL;
+}
+
+static void asf_reader_destroy(struct strmbase_filter *iface)
+{
+ struct asf_reader *filter = impl_reader_from_strmbase_filter(iface);
+
+ strmbase_filter_cleanup(&filter->filter);
+ free(filter);
+}
+
+static struct strmbase_filter_ops filter_ops =
+{
+ .filter_get_pin = asf_reader_get_pin,
+ .filter_destroy = asf_reader_destroy,
+};
+
+HRESULT asf_reader_create(IUnknown *outer, IUnknown **out)
+{
+ struct asf_reader *object;
+
+ if (!(object = calloc(1, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ strmbase_filter_init(&object->filter, outer, &CLSID_WMAsfReader, &filter_ops);
+
+ TRACE("Created WM ASF reader %p.\n", object);
+ *out = &object->filter.IUnknown_inner;
+
+ return S_OK;
+}
diff --git a/dlls/qasf/qasf_classes.idl b/dlls/qasf/qasf_classes.idl
index 0acf380691..b6f6c58fed 100644
--- a/dlls/qasf/qasf_classes.idl
+++ b/dlls/qasf/qasf_classes.idl
@@ -25,3 +25,10 @@
uuid(94297043-bd82-4dfd-b0de-8177739c6d20),
]
coclass DMOWrapperFilter {}
+
+[
+ helpstring("WM ASF Reader"),
+ threading(both),
+ uuid(187463a0-5bb7-11d3-acbe-0080c75e246e),
+]
+coclass WMAsfReader {}
diff --git a/dlls/qasf/qasf_main.c b/dlls/qasf/qasf_main.c
index 5df23649f0..34550ced25 100644
--- a/dlls/qasf/qasf_main.c
+++ b/dlls/qasf/qasf_main.c
@@ -99,6 +99,7 @@ static const IClassFactoryVtbl class_factory_vtbl =
};
static struct class_factory dmo_wrapper_cf = {{&class_factory_vtbl}, dmo_wrapper_create};
+static struct class_factory asf_reader_cf = {{&class_factory_vtbl}, asf_reader_create};
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
{
@@ -116,6 +117,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
if (IsEqualGUID(clsid, &CLSID_DMOWrapperFilter))
return IClassFactory_QueryInterface(&dmo_wrapper_cf.IClassFactory_iface, iid, out);
+ if (IsEqualIID(clsid, &CLSID_WMAsfReader))
+ return IClassFactory_QueryInterface(&asf_reader_cf.IClassFactory_iface, iid, out);
FIXME("%s not available, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(clsid));
return CLASS_E_CLASSNOTAVAILABLE;
diff --git a/dlls/qasf/qasf_private.h b/dlls/qasf/qasf_private.h
index bdb2e433b2..d1fc0d998c 100644
--- a/dlls/qasf/qasf_private.h
+++ b/dlls/qasf/qasf_private.h
@@ -30,5 +30,6 @@
#include "wine/strmbase.h"
HRESULT dmo_wrapper_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
+HRESULT asf_reader_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
#endif /* QASF_PRIVATE_H */
diff --git a/dlls/qasf/tests/Makefile.in b/dlls/qasf/tests/Makefile.in
index 793f0d2c4b..203db45740 100644
--- a/dlls/qasf/tests/Makefile.in
+++ b/dlls/qasf/tests/Makefile.in
@@ -2,4 +2,5 @@ TESTDLL = qasf.dll
IMPORTS = strmbase dmoguids strmiids uuid msdmo ole32
C_SRCS = \
- dmowrapper.c
+ dmowrapper.c \
+ asfreader.c
diff --git a/dlls/qasf/tests/asfreader.c b/dlls/qasf/tests/asfreader.c
new file mode 100644
index 0000000000..2b8e8f6f00
--- /dev/null
+++ b/dlls/qasf/tests/asfreader.c
@@ -0,0 +1,192 @@
+/*
+ * WM ASF reader unit tests
+ *
+ * Copyright 2019 Zebediah Figura
+ * Copyright 2020 Jactry Zeng for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define COBJMACROS
+
+#include "dshow.h"
+#include "wine/strmbase.h"
+#include "wine/test.h"
+
+#include "initguid.h"
+
+DEFINE_GUID(IID_IWMHeaderInfo, 0x96406bda, 0x2b2b, 0x11d3, 0xb3, 0x6b, 0x00, 0xc0, 0x4f, 0x61, 0x08, 0xff);
+DEFINE_GUID(IID_IWMReaderAdvanced, 0x96406bea, 0x2b2b, 0x11d3, 0xb3, 0x6b, 0x00, 0xc0, 0x4f, 0x61, 0x08, 0xff);
+DEFINE_GUID(IID_IWMReaderAdvanced2, 0xae14a945, 0xb90c, 0x4d0d, 0x91, 0x27, 0x80, 0xd6, 0x65, 0xf7, 0xd7, 0x3e);
+
+static IBaseFilter *create_asf_reader(void)
+{
+ IBaseFilter *filter = NULL;
+ HRESULT hr;
+
+ hr = CoCreateInstance(&CLSID_WMAsfReader, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IBaseFilter, (void **)&filter);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ return filter;
+}
+
+static ULONG get_refcount(void *iface)
+{
+ IUnknown *unknown = iface;
+ IUnknown_AddRef(unknown);
+ return IUnknown_Release(unknown);
+}
+
+#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
+static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
+{
+ IUnknown *iface = iface_ptr;
+ HRESULT hr, expected_hr;
+ IUnknown *unk;
+
+ expected_hr = supported ? S_OK : E_NOINTERFACE;
+
+ hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
+ ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ if (SUCCEEDED(hr))
+ IUnknown_Release(unk);
+}
+
+static void test_interfaces(void)
+{
+ IBaseFilter *filter = create_asf_reader();
+
+ check_interface(filter, &IID_IBaseFilter, TRUE);
+ check_interface(filter, &IID_IMediaFilter, TRUE);
+ todo_wine check_interface(filter, &IID_IFileSourceFilter, TRUE);
+ check_interface(filter, &IID_IPersist, TRUE);
+ check_interface(filter, &IID_IUnknown, TRUE);
+
+ check_interface(filter, &IID_IAMFilterMiscFlags, FALSE);
+ check_interface(filter, &IID_IMediaSeeking, FALSE);
+ check_interface(filter, &IID_IReferenceClock, FALSE);
+ check_interface(filter, &IID_IQualityControl, FALSE);
+ todo_wine check_interface(filter, &IID_IServiceProvider, TRUE);
+ todo_wine check_interface(filter, &IID_IWMHeaderInfo, TRUE);
+ todo_wine check_interface(filter, &IID_IWMReaderAdvanced, TRUE);
+ todo_wine check_interface(filter, &IID_IWMReaderAdvanced2, TRUE);
+
+ IBaseFilter_Release(filter);
+}
+
+static const GUID test_iid = {0x33333333};
+static LONG outer_ref = 1;
+
+static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
+{
+ if (IsEqualGUID(iid, &IID_IUnknown) ||
+ IsEqualGUID(iid, &IID_IBaseFilter) ||
+ IsEqualGUID(iid, &test_iid))
+ {
+ *out = (IUnknown *)0xdeadbeef;
+ return S_OK;
+ }
+ ok(0, "Unexpected call %s.\n", wine_dbgstr_guid(iid));
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI outer_AddRef(IUnknown *iface)
+{
+ return InterlockedIncrement(&outer_ref);
+}
+
+static ULONG WINAPI outer_Release(IUnknown *iface)
+{
+ return InterlockedDecrement(&outer_ref);
+}
+
+static const IUnknownVtbl outer_vtbl =
+{
+ outer_QueryInterface,
+ outer_AddRef,
+ outer_Release,
+};
+
+static IUnknown test_outer = {&outer_vtbl};
+
+static void test_aggregation(void)
+{
+ IBaseFilter *filter, *filter2;
+ IUnknown *unk, *unk2;
+ HRESULT hr;
+ ULONG ref;
+
+ filter = (IBaseFilter *)0xdeadbeef;
+ hr = CoCreateInstance(&CLSID_WMAsfReader, &test_outer, CLSCTX_INPROC_SERVER,
+ &IID_IBaseFilter, (void **)&filter);
+ ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
+ ok(!filter, "Got interface %p.\n", filter);
+
+ hr = CoCreateInstance(&CLSID_WMAsfReader, &test_outer, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (void **)&unk);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+ ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
+ ref = get_refcount(unk);
+ ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+
+ ref = IUnknown_AddRef(unk);
+ ok(ref == 2, "Got unexpected refcount %d.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+
+ ref = IUnknown_Release(unk);
+ ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+
+ hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
+ IUnknown_Release(unk2);
+
+ hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
+
+ hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2);
+
+ hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
+ ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
+ ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
+
+ hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
+
+ IBaseFilter_Release(filter);
+ ref = IUnknown_Release(unk);
+ ok(!ref, "Got unexpected refcount %d.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+}
+
+START_TEST(asfreader)
+{
+ CoInitializeEx(NULL, COINIT_MULTITHREADED);
+
+ test_interfaces();
+ test_aggregation();
+
+ CoUninitialize();
+}
--
2.26.0
2
1
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
dlls/qasf/Makefile.in | 3 +-
dlls/qasf/qasf_classes.idl | 7 ++
dlls/qasf/qasf_main.c | 3 +
dlls/qasf/qasf_private.h | 1 +
dlls/qasf/tests/Makefile.in | 3 +-
dlls/qasf/tests/wmasf.c | 182 ++++++++++++++++++++++++++++++++++++
dlls/qasf/wmasf.c | 67 +++++++++++++
7 files changed, 264 insertions(+), 2 deletions(-)
create mode 100644 dlls/qasf/tests/wmasf.c
create mode 100644 dlls/qasf/wmasf.c
diff --git a/dlls/qasf/Makefile.in b/dlls/qasf/Makefile.in
index dd02f5a344..d7e0168fab 100644
--- a/dlls/qasf/Makefile.in
+++ b/dlls/qasf/Makefile.in
@@ -5,7 +5,8 @@ EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
dmowrapper.c \
- qasf_main.c
+ qasf_main.c \
+ wmasf.c
IDL_SRCS = \
qasf_classes.idl
diff --git a/dlls/qasf/qasf_classes.idl b/dlls/qasf/qasf_classes.idl
index 0acf380691..b6f6c58fed 100644
--- a/dlls/qasf/qasf_classes.idl
+++ b/dlls/qasf/qasf_classes.idl
@@ -25,3 +25,10 @@
uuid(94297043-bd82-4dfd-b0de-8177739c6d20),
]
coclass DMOWrapperFilter {}
+
+[
+ helpstring("WM ASF Reader"),
+ threading(both),
+ uuid(187463a0-5bb7-11d3-acbe-0080c75e246e),
+]
+coclass WMAsfReader {}
diff --git a/dlls/qasf/qasf_main.c b/dlls/qasf/qasf_main.c
index 5df23649f0..17301b2494 100644
--- a/dlls/qasf/qasf_main.c
+++ b/dlls/qasf/qasf_main.c
@@ -99,6 +99,7 @@ static const IClassFactoryVtbl class_factory_vtbl =
};
static struct class_factory dmo_wrapper_cf = {{&class_factory_vtbl}, dmo_wrapper_create};
+static struct class_factory wmasf_reader_cf = {{&class_factory_vtbl}, wmasf_reader_create};
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
{
@@ -116,6 +117,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
if (IsEqualGUID(clsid, &CLSID_DMOWrapperFilter))
return IClassFactory_QueryInterface(&dmo_wrapper_cf.IClassFactory_iface, iid, out);
+ if (IsEqualIID(clsid, &CLSID_WMAsfReader))
+ return IClassFactory_QueryInterface(&wmasf_reader_cf.IClassFactory_iface, iid, out);
FIXME("%s not available, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(clsid));
return CLASS_E_CLASSNOTAVAILABLE;
diff --git a/dlls/qasf/qasf_private.h b/dlls/qasf/qasf_private.h
index bdb2e433b2..6564194c9e 100644
--- a/dlls/qasf/qasf_private.h
+++ b/dlls/qasf/qasf_private.h
@@ -30,5 +30,6 @@
#include "wine/strmbase.h"
HRESULT dmo_wrapper_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
+HRESULT wmasf_reader_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
#endif /* QASF_PRIVATE_H */
diff --git a/dlls/qasf/tests/Makefile.in b/dlls/qasf/tests/Makefile.in
index 793f0d2c4b..b622ccf599 100644
--- a/dlls/qasf/tests/Makefile.in
+++ b/dlls/qasf/tests/Makefile.in
@@ -2,4 +2,5 @@ TESTDLL = qasf.dll
IMPORTS = strmbase dmoguids strmiids uuid msdmo ole32
C_SRCS = \
- dmowrapper.c
+ dmowrapper.c \
+ wmasf.c
diff --git a/dlls/qasf/tests/wmasf.c b/dlls/qasf/tests/wmasf.c
new file mode 100644
index 0000000000..b82aa3a053
--- /dev/null
+++ b/dlls/qasf/tests/wmasf.c
@@ -0,0 +1,182 @@
+/*
+ * WM ASF reader unit tests
+ *
+ * Copyright 2019 Zebediah Figura
+ * Copyright 2020 Jactry Zeng for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define COBJMACROS
+
+#include "dshow.h"
+#include "wine/strmbase.h"
+#include "wine/test.h"
+
+static IBaseFilter *create_wmasf_reader(void)
+{
+ IBaseFilter *filter = NULL;
+ HRESULT hr;
+
+ hr = CoCreateInstance(&CLSID_WMAsfReader, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IBaseFilter, (void **)&filter);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ return filter;
+}
+
+#define expected_ref(obj,ref) expect_ref_((IUnknown*)obj, ref, __LINE__)
+static void expect_ref_(IUnknown* obj, ULONG expected_refcount, int line)
+{
+ ULONG refcount;
+ IUnknown_AddRef(obj);
+ refcount = IUnknown_Release(obj);
+ ok_(__FILE__, line)(refcount == expected_refcount, "Unexpected refcount %d, expected %d.\n",
+ refcount, expected_refcount);
+}
+
+#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
+static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
+{
+ IUnknown *iface = iface_ptr;
+ HRESULT hr, expected_hr;
+ IUnknown *unk;
+
+ expected_hr = supported ? S_OK : E_NOINTERFACE;
+
+ hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
+ ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ if (SUCCEEDED(hr))
+ IUnknown_Release(unk);
+}
+
+static void test_interfaces(void)
+{
+ IBaseFilter *filter = create_wmasf_reader();
+
+ check_interface(filter, &IID_IBaseFilter, TRUE);
+ check_interface(filter, &IID_IMediaFilter, TRUE);
+ todo_wine check_interface(filter, &IID_IFileSourceFilter, TRUE);
+ check_interface(filter, &IID_IPersist, TRUE);
+ check_interface(filter, &IID_IUnknown, TRUE);
+
+ check_interface(filter, &IID_IAMFilterMiscFlags, FALSE);
+ check_interface(filter, &IID_IMediaSeeking, FALSE);
+
+ IBaseFilter_Release(filter);
+}
+
+static const GUID test_iid = {0x33333333};
+static LONG outer_ref = 1;
+
+static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
+{
+ if (IsEqualGUID(iid, &IID_IUnknown) ||
+ IsEqualGUID(iid, &IID_IBaseFilter) ||
+ IsEqualGUID(iid, &test_iid))
+ {
+ *out = (IUnknown *)0xdeadbeef;
+ return S_OK;
+ }
+ ok(0, "Unexpected call %s.\n", wine_dbgstr_guid(iid));
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI outer_AddRef(IUnknown *iface)
+{
+ return InterlockedIncrement(&outer_ref);
+}
+
+static ULONG WINAPI outer_Release(IUnknown *iface)
+{
+ return InterlockedDecrement(&outer_ref);
+}
+
+static const IUnknownVtbl outer_vtbl =
+{
+ outer_QueryInterface,
+ outer_AddRef,
+ outer_Release,
+};
+
+static IUnknown test_outer = {&outer_vtbl};
+
+static void test_aggregation(void)
+{
+ IBaseFilter *filter, *filter2;
+ IUnknown *unk, *unk2;
+ HRESULT hr;
+ ULONG ref;
+
+ filter = (IBaseFilter *)0xdeadbeef;
+ hr = CoCreateInstance(&CLSID_WMAsfReader, &test_outer, CLSCTX_INPROC_SERVER,
+ &IID_IBaseFilter, (void **)&filter);
+ ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
+ ok(!filter, "Got interface %p.\n", filter);
+
+ hr = CoCreateInstance(&CLSID_WMAsfReader, &test_outer, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (void **)&unk);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+ ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
+ expected_ref(unk, 1);
+
+ ref = IUnknown_AddRef(unk);
+ ok(ref == 2, "Got unexpected refcount %d.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+
+ ref = IUnknown_Release(unk);
+ ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+
+ hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
+ IUnknown_Release(unk2);
+
+ hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
+
+ hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2);
+
+ hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
+ ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
+ ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
+
+ hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
+
+ IBaseFilter_Release(filter);
+ ref = IUnknown_Release(unk);
+ ok(!ref, "Got unexpected refcount %d.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+}
+
+START_TEST(wmasf)
+{
+ CoInitializeEx(NULL, COINIT_MULTITHREADED);
+
+ test_interfaces();
+ test_aggregation();
+
+ CoUninitialize();
+}
diff --git a/dlls/qasf/wmasf.c b/dlls/qasf/wmasf.c
new file mode 100644
index 0000000000..04aaf21367
--- /dev/null
+++ b/dlls/qasf/wmasf.c
@@ -0,0 +1,67 @@
+/*
+ * WM ASF reader
+ *
+ * Copyright 2020 Jactry Zeng for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "qasf_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(qasf);
+
+struct wmasf_reader
+{
+ struct strmbase_filter filter;
+};
+
+static inline struct wmasf_reader *impl_reader_from_strmbase_filter(struct strmbase_filter *iface)
+{
+ return CONTAINING_RECORD(iface, struct wmasf_reader, filter);
+}
+
+static struct strmbase_pin *wmasf_reader_get_pin(struct strmbase_filter *iface, unsigned int index)
+{
+ return NULL;
+}
+
+static void wmasf_reader_destroy(struct strmbase_filter *iface)
+{
+ struct wmasf_reader *filter = impl_reader_from_strmbase_filter(iface);
+
+ strmbase_filter_cleanup(&filter->filter);
+ free(filter);
+}
+
+static struct strmbase_filter_ops filter_ops =
+{
+ .filter_get_pin = wmasf_reader_get_pin,
+ .filter_destroy = wmasf_reader_destroy,
+};
+
+HRESULT wmasf_reader_create(IUnknown *outer, IUnknown **out)
+{
+ struct wmasf_reader *object;
+
+ if (!(object = calloc(sizeof(*object), 1)))
+ return E_OUTOFMEMORY;
+
+ strmbase_filter_init(&object->filter, outer, &CLSID_WMAsfReader, &filter_ops);
+
+ TRACE("Created WM ASF reader %p.\n", object);
+ *out = &object->filter.IUnknown_inner;
+
+ return S_OK;
+}
--
2.26.0
4
4
05 Apr '20
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
The Vulkan loader just added exports for
vkGetPhysicalDeviceSurfaceCapabilities2KHR and
vkGetPhysicalDeviceSurfaceFormats2KHR
(see https://github.com/KhronosGroup/Vulkan-Loader/issues/342) and it
will take time for this version to filter down to users.
Until it does, emulate the functions using the original non-2 versions.
dlls/winemac.drv/vulkan.c | 32 +++++
dlls/winevulkan/make_vulkan | 7 +-
dlls/winevulkan/vulkan_thunks.c | 46 +++++++
dlls/winevulkan/vulkan_thunks.h | 19 +++
dlls/winex11.drv/vulkan.c | 60 ++++++++
include/wine/vulkan.h | 234 ++++++++++++++++++--------------
include/wine/vulkan_driver.h | 8 +-
7 files changed, 301 insertions(+), 105 deletions(-)
diff --git a/dlls/winemac.drv/vulkan.c b/dlls/winemac.drv/vulkan.c
index 360dd02f7b..5d15eeda2b 100644
--- a/dlls/winemac.drv/vulkan.c
+++ b/dlls/winemac.drv/vulkan.c
@@ -86,7 +86,9 @@ static void (*pvkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocati
static VkResult (*pvkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *);
static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *);
static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *);
+static VkResult (*pvkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *);
+static VkResult (*pvkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
static VkResult (*pvkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *);
@@ -122,7 +124,9 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
LOAD_FUNCPTR(vkEnumerateInstanceExtensionProperties)
LOAD_FUNCPTR(vkGetDeviceProcAddr)
LOAD_FUNCPTR(vkGetInstanceProcAddr)
+ LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceCapabilities2KHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceCapabilitiesKHR)
+ LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceFormats2KHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceFormatsKHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfacePresentModesKHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceSupportKHR)
@@ -441,6 +445,19 @@ static void *macdrv_vkGetInstanceProcAddr(VkInstance instance, const char *name)
return pvkGetInstanceProcAddr(instance, name);
}
+static VkResult macdrv_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice phys_dev,
+ const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, VkSurfaceCapabilities2KHR *capabilities)
+{
+ VkPhysicalDeviceSurfaceInfo2KHR surface_info_host;
+
+ TRACE("%p, %p, %p\n", phys_dev, surface_info, capabilities);
+
+ surface_info_host = *surface_info;
+ surface_info_host.surface = surface_from_handle(surface_info->surface)->surface;
+
+ return pvkGetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev, &surface_info_host, capabilities);
+}
+
static VkResult macdrv_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *capabilities)
{
@@ -452,6 +469,19 @@ static VkResult macdrv_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevic
capabilities);
}
+static VkResult macdrv_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice phys_dev,
+ const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, uint32_t *count, VkSurfaceFormat2KHR *formats)
+{
+ VkPhysicalDeviceSurfaceInfo2KHR surface_info_host;
+
+ TRACE("%p, %p, %p, %p\n", phys_dev, surface_info, count, formats);
+
+ surface_info_host = *surface_info;
+ surface_info_host.surface = surface_from_handle(surface_info->surface)->surface;
+
+ return pvkGetPhysicalDeviceSurfaceFormats2KHR(phys_dev, &surface_info_host, count, formats);
+}
+
static VkResult macdrv_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, uint32_t *count, VkSurfaceFormatKHR *formats)
{
@@ -542,7 +572,9 @@ static const struct vulkan_funcs vulkan_funcs =
macdrv_vkGetDeviceProcAddr,
macdrv_vkGetInstanceProcAddr,
NULL,
+ macdrv_vkGetPhysicalDeviceSurfaceCapabilities2KHR,
macdrv_vkGetPhysicalDeviceSurfaceCapabilitiesKHR,
+ macdrv_vkGetPhysicalDeviceSurfaceFormats2KHR,
macdrv_vkGetPhysicalDeviceSurfaceFormatsKHR,
macdrv_vkGetPhysicalDeviceSurfacePresentModesKHR,
macdrv_vkGetPhysicalDeviceSurfaceSupportKHR,
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
index 3593410041..fa1aa754c7 100755
--- a/dlls/winevulkan/make_vulkan
+++ b/dlls/winevulkan/make_vulkan
@@ -95,7 +95,6 @@ BLACKLISTED_EXTENSIONS = [
"VK_EXT_validation_features",
"VK_EXT_validation_flags",
"VK_KHR_display", # Needs WSI work.
- "VK_KHR_get_surface_capabilities2",
"VK_KHR_surface_protected_capabilities",
# Device extensions
@@ -138,7 +137,7 @@ CORE_EXTENSIONS = [
# Functions part of our winevulkan graphics driver interface.
# DRIVER_VERSION should be bumped on any change to driver interface
# in FUNCTION_OVERRIDES
-DRIVER_VERSION = 7
+DRIVER_VERSION = 8
# Table of functions for which we have a special implementation.
# These are regular device / instance functions for which we need
@@ -185,6 +184,10 @@ FUNCTION_OVERRIDES = {
"vkGetPhysicalDeviceSurfaceFormatsKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkGetPhysicalDeviceSurfacePresentModesKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
+ # VK_KHR_get_surface_capabilities2
+ "vkGetPhysicalDeviceSurfaceCapabilities2KHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
+ "vkGetPhysicalDeviceSurfaceFormats2KHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
+
# VK_KHR_win32_surface
"vkCreateWin32SurfaceKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkGetPhysicalDeviceWin32PresentationSupportKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c
index fecf9ab502..2e33ab1e32 100644
--- a/dlls/winevulkan/vulkan_thunks.c
+++ b/dlls/winevulkan/vulkan_thunks.c
@@ -1159,6 +1159,15 @@ static inline void convert_VkPhysicalDeviceProperties2_host_to_win(const VkPhysi
convert_VkPhysicalDeviceProperties_host_to_win(&in->properties, &out->properties);
}
+static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win_to_host(const VkPhysicalDeviceSurfaceInfo2KHR *in, VkPhysicalDeviceSurfaceInfo2KHR_host *out)
+{
+ if (!in) return;
+
+ out->sType = in->sType;
+ out->pNext = in->pNext;
+ out->surface = in->surface;
+}
+
static inline void convert_VkPipelineExecutableInfoKHR_win_to_host(const VkPipelineExecutableInfoKHR *in, VkPipelineExecutableInfoKHR_host *out)
{
if (!in) return;
@@ -4348,12 +4357,46 @@ static VkResult WINAPI wine_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesC
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(physicalDevice->phys_dev, pCombinationCount, pCombinations);
}
+static VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities)
+{
+#if defined(USE_STRUCT_CONVERSION)
+ VkResult result;
+ VkPhysicalDeviceSurfaceInfo2KHR_host pSurfaceInfo_host;
+ TRACE("%p, %p, %p\n", physicalDevice, pSurfaceInfo, pSurfaceCapabilities);
+
+ convert_VkPhysicalDeviceSurfaceInfo2KHR_win_to_host(pSurfaceInfo, &pSurfaceInfo_host);
+ result = physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice->phys_dev, &pSurfaceInfo_host, pSurfaceCapabilities);
+
+ return result;
+#else
+ TRACE("%p, %p, %p\n", physicalDevice, pSurfaceInfo, pSurfaceCapabilities);
+ return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice->phys_dev, pSurfaceInfo, pSurfaceCapabilities);
+#endif
+}
+
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities)
{
TRACE("%p, 0x%s, %p\n", physicalDevice, wine_dbgstr_longlong(surface), pSurfaceCapabilities);
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice->phys_dev, surface, pSurfaceCapabilities);
}
+static VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats)
+{
+#if defined(USE_STRUCT_CONVERSION)
+ VkResult result;
+ VkPhysicalDeviceSurfaceInfo2KHR_host pSurfaceInfo_host;
+ TRACE("%p, %p, %p, %p\n", physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
+
+ convert_VkPhysicalDeviceSurfaceInfo2KHR_win_to_host(pSurfaceInfo, &pSurfaceInfo_host);
+ result = physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice->phys_dev, &pSurfaceInfo_host, pSurfaceFormatCount, pSurfaceFormats);
+
+ return result;
+#else
+ TRACE("%p, %p, %p, %p\n", physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
+ return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice->phys_dev, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
+#endif
+}
+
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats)
{
TRACE("%p, 0x%s, %p, %p\n", physicalDevice, wine_dbgstr_longlong(surface), pSurfaceFormatCount, pSurfaceFormats);
@@ -4986,7 +5029,9 @@ static const struct vulkan_func vk_instance_dispatch_table[] =
{"vkGetPhysicalDeviceSparseImageFormatProperties2", &wine_vkGetPhysicalDeviceSparseImageFormatProperties2},
{"vkGetPhysicalDeviceSparseImageFormatProperties2KHR", &wine_vkGetPhysicalDeviceSparseImageFormatProperties2KHR},
{"vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV", &wine_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV},
+ {"vkGetPhysicalDeviceSurfaceCapabilities2KHR", &wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR},
{"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", &wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR},
+ {"vkGetPhysicalDeviceSurfaceFormats2KHR", &wine_vkGetPhysicalDeviceSurfaceFormats2KHR},
{"vkGetPhysicalDeviceSurfaceFormatsKHR", &wine_vkGetPhysicalDeviceSurfaceFormatsKHR},
{"vkGetPhysicalDeviceSurfacePresentModesKHR", &wine_vkGetPhysicalDeviceSurfacePresentModesKHR},
{"vkGetPhysicalDeviceSurfaceSupportKHR", &wine_vkGetPhysicalDeviceSurfaceSupportKHR},
@@ -5170,6 +5215,7 @@ static const char * const vk_instance_extensions[] =
"VK_KHR_external_memory_capabilities",
"VK_KHR_external_semaphore_capabilities",
"VK_KHR_get_physical_device_properties2",
+ "VK_KHR_get_surface_capabilities2",
"VK_KHR_surface",
"VK_KHR_win32_surface",
};
diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h
index 01c1efb277..6805113bba 100644
--- a/dlls/winevulkan/vulkan_thunks.h
+++ b/dlls/winevulkan/vulkan_thunks.h
@@ -726,6 +726,13 @@ typedef struct VkPhysicalDeviceProperties2_host
VkPhysicalDeviceProperties_host properties;
} VkPhysicalDeviceProperties2_host;
+typedef struct VkPhysicalDeviceSurfaceInfo2KHR_host
+{
+ VkStructureType sType;
+ const void *pNext;
+ VkSurfaceKHR surface;
+} VkPhysicalDeviceSurfaceInfo2KHR_host;
+
typedef struct VkPipelineExecutableInfoKHR_host
{
VkStructureType sType;
@@ -1359,7 +1366,17 @@ struct vulkan_instance_funcs
void (*p_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *);
void (*p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *);
VkResult (*p_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV)(VkPhysicalDevice, uint32_t *, VkFramebufferMixedSamplesCombinationNV *);
+#if defined(USE_STRUCT_CONVERSION)
+ VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR_host *, VkSurfaceCapabilities2KHR *);
+#else
+ VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *);
+#endif
VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *);
+#if defined(USE_STRUCT_CONVERSION)
+ VkResult (*p_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR_host *, uint32_t *, VkSurfaceFormat2KHR *);
+#else
+ VkResult (*p_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
+#endif
VkResult (*p_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
VkResult (*p_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *);
VkResult (*p_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *);
@@ -1637,7 +1654,9 @@ struct vulkan_instance_funcs
USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties2) \
USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties2KHR) \
USE_VK_FUNC(vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV) \
+ USE_VK_FUNC(vkGetPhysicalDeviceSurfaceCapabilities2KHR) \
USE_VK_FUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR) \
+ USE_VK_FUNC(vkGetPhysicalDeviceSurfaceFormats2KHR) \
USE_VK_FUNC(vkGetPhysicalDeviceSurfaceFormatsKHR) \
USE_VK_FUNC(vkGetPhysicalDeviceSurfacePresentModesKHR) \
USE_VK_FUNC(vkGetPhysicalDeviceSurfaceSupportKHR) \
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
index 28ae1a9e0e..caef8c9928 100644
--- a/dlls/winex11.drv/vulkan.c
+++ b/dlls/winex11.drv/vulkan.c
@@ -85,7 +85,9 @@ static VkResult (*pvkGetDeviceGroupSurfacePresentModesKHR)(VkDevice, VkSurfaceKH
static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *);
static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *);
static VkResult (*pvkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkRect2D *);
+static VkResult (*pvkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *);
+static VkResult (*pvkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
static VkResult (*pvkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *);
@@ -122,7 +124,9 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
LOAD_FUNCPTR(vkEnumerateInstanceExtensionProperties)
LOAD_FUNCPTR(vkGetDeviceProcAddr)
LOAD_FUNCPTR(vkGetInstanceProcAddr)
+ LOAD_OPTIONAL_FUNCPTR(vkGetPhysicalDeviceSurfaceCapabilities2KHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceCapabilitiesKHR)
+ LOAD_OPTIONAL_FUNCPTR(vkGetPhysicalDeviceSurfaceFormats2KHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceFormatsKHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfacePresentModesKHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceSupportKHR)
@@ -456,6 +460,25 @@ static VkResult X11DRV_vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice
return pvkGetPhysicalDevicePresentRectanglesKHR(phys_dev, x11_surface->surface, count, rects);
}
+static VkResult X11DRV_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice phys_dev,
+ const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, VkSurfaceCapabilities2KHR *capabilities)
+{
+ VkPhysicalDeviceSurfaceInfo2KHR surface_info_host;
+ TRACE("%p, %p, %p\n", phys_dev, surface_info, capabilities);
+
+ surface_info_host = *surface_info;
+ surface_info_host.surface = surface_from_handle(surface_info->surface)->surface;
+
+ if (pvkGetPhysicalDeviceSurfaceCapabilities2KHR)
+ return pvkGetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev, &surface_info_host, capabilities);
+
+ /* Until the loader version exporting this function is common, emulate it using the older non-2 version. */
+ if (surface_info->pNext || capabilities->pNext)
+ FIXME("Emulating vkGetPhysicalDeviceSurfaceCapabilities2KHR with vkGetPhysicalDeviceSurfaceCapabilitiesKHR, pNext is ignored.\n");
+
+ return pvkGetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev, surface_info_host.surface, &capabilities->surfaceCapabilities);
+}
+
static VkResult X11DRV_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *capabilities)
{
@@ -466,6 +489,41 @@ static VkResult X11DRV_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevic
return pvkGetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev, x11_surface->surface, capabilities);
}
+static VkResult X11DRV_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice phys_dev,
+ const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, uint32_t *count, VkSurfaceFormat2KHR *formats)
+{
+ VkPhysicalDeviceSurfaceInfo2KHR surface_info_host = *surface_info;
+ VkSurfaceFormatKHR *formats_host;
+ uint32_t i;
+ VkResult result;
+ TRACE("%p, %p, %p, %p\n", phys_dev, surface_info, count, formats);
+
+ surface_info_host = *surface_info;
+ surface_info_host.surface = surface_from_handle(surface_info->surface)->surface;
+
+ if (pvkGetPhysicalDeviceSurfaceFormats2KHR)
+ return pvkGetPhysicalDeviceSurfaceFormats2KHR(phys_dev, &surface_info_host, count, formats);
+
+ /* Until the loader version exporting this function is common, emulate it using the older non-2 version. */
+ if (surface_info->pNext)
+ FIXME("Emulating vkGetPhysicalDeviceSurfaceFormats2KHR with vkGetPhysicalDeviceSurfaceFormatsKHR, pNext is ignored.\n");
+
+ if (!formats)
+ return pvkGetPhysicalDeviceSurfaceFormatsKHR(phys_dev, surface_info_host.surface, count, NULL);
+
+ formats_host = heap_calloc(*count, sizeof(*formats_host));
+ if (!formats_host) return VK_ERROR_OUT_OF_HOST_MEMORY;
+ result = pvkGetPhysicalDeviceSurfaceFormatsKHR(phys_dev, surface_info_host.surface, count, formats_host);
+ if (result == VK_SUCCESS || result == VK_INCOMPLETE)
+ {
+ for (i = 0; i < *count; i++)
+ formats[i].surfaceFormat = formats_host[i];
+ }
+
+ heap_free(formats_host);
+ return result;
+}
+
static VkResult X11DRV_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, uint32_t *count, VkSurfaceFormatKHR *formats)
{
@@ -557,7 +615,9 @@ static const struct vulkan_funcs vulkan_funcs =
X11DRV_vkGetDeviceProcAddr,
X11DRV_vkGetInstanceProcAddr,
X11DRV_vkGetPhysicalDevicePresentRectanglesKHR,
+ X11DRV_vkGetPhysicalDeviceSurfaceCapabilities2KHR,
X11DRV_vkGetPhysicalDeviceSurfaceCapabilitiesKHR,
+ X11DRV_vkGetPhysicalDeviceSurfaceFormats2KHR,
X11DRV_vkGetPhysicalDeviceSurfaceFormatsKHR,
X11DRV_vkGetPhysicalDeviceSurfacePresentModesKHR,
X11DRV_vkGetPhysicalDeviceSurfaceSupportKHR,
diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h
index fe804fd23e..c6d72c49fa 100644
--- a/include/wine/vulkan.h
+++ b/include/wine/vulkan.h
@@ -198,6 +198,8 @@
#define VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME "VK_KHR_performance_query"
#define VK_KHR_MAINTENANCE2_SPEC_VERSION 1
#define VK_KHR_MAINTENANCE2_EXTENSION_NAME "VK_KHR_maintenance2"
+#define VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION 1
+#define VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME "VK_KHR_get_surface_capabilities2"
#define VK_KHR_VARIABLE_POINTERS_SPEC_VERSION 1
#define VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME "VK_KHR_variable_pointers"
#define VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION 1
@@ -2348,6 +2350,9 @@ typedef enum VkStructureType
VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO = 1000117001,
VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO = 1000117002,
VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO = 1000117003,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000,
+ VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001,
+ VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES = 1000120000,
VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS = 1000127000,
VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO = 1000127001,
@@ -4083,20 +4088,6 @@ typedef struct VkSubresourceLayout
VkDeviceSize WINE_VK_ALIGN(8) depthPitch;
} VkSubresourceLayout;
-typedef struct VkSurfaceCapabilitiesKHR
-{
- uint32_t minImageCount;
- uint32_t maxImageCount;
- VkExtent2D currentExtent;
- VkExtent2D minImageExtent;
- VkExtent2D maxImageExtent;
- uint32_t maxImageArrayLayers;
- VkSurfaceTransformFlagsKHR supportedTransforms;
- VkSurfaceTransformFlagBitsKHR currentTransform;
- VkCompositeAlphaFlagsKHR supportedCompositeAlpha;
- VkImageUsageFlags supportedUsageFlags;
-} VkSurfaceCapabilitiesKHR;
-
typedef struct VkSurfaceFormatKHR
{
VkFormat format;
@@ -4673,6 +4664,13 @@ typedef struct VkPhysicalDeviceSparseProperties
VkBool32 residencyNonResidentStrict;
} VkPhysicalDeviceSparseProperties;
+typedef struct VkPhysicalDeviceSurfaceInfo2KHR
+{
+ VkStructureType sType;
+ const void *pNext;
+ VkSurfaceKHR WINE_VK_ALIGN(8) surface;
+} VkPhysicalDeviceSurfaceInfo2KHR;
+
typedef struct VkPhysicalDeviceTimelineSemaphoreFeaturesKHR
{
VkStructureType sType;
@@ -4965,6 +4963,20 @@ typedef struct VkSubpassSampleLocationsEXT
VkSampleLocationsInfoEXT sampleLocationsInfo;
} VkSubpassSampleLocationsEXT;
+typedef struct VkSurfaceCapabilitiesKHR
+{
+ uint32_t minImageCount;
+ uint32_t maxImageCount;
+ VkExtent2D currentExtent;
+ VkExtent2D minImageExtent;
+ VkExtent2D maxImageExtent;
+ uint32_t maxImageArrayLayers;
+ VkSurfaceTransformFlagsKHR supportedTransforms;
+ VkSurfaceTransformFlagBitsKHR currentTransform;
+ VkCompositeAlphaFlagsKHR supportedCompositeAlpha;
+ VkImageUsageFlags supportedUsageFlags;
+} VkSurfaceCapabilitiesKHR;
+
typedef struct VkSwapchainCreateInfoKHR
{
VkStructureType sType;
@@ -5537,20 +5549,26 @@ typedef struct VkSubpassDescriptionDepthStencilResolveKHR
const VkAttachmentReference2KHR *pDepthStencilResolveAttachment;
} VkSubpassDescriptionDepthStencilResolveKHR;
-typedef struct VkVertexInputBindingDivisorDescriptionEXT
+typedef struct VkSurfaceCapabilities2KHR
{
- uint32_t binding;
- uint32_t divisor;
-} VkVertexInputBindingDivisorDescriptionEXT;
+ VkStructureType sType;
+ void *pNext;
+ VkSurfaceCapabilitiesKHR surfaceCapabilities;
+} VkSurfaceCapabilities2KHR;
-typedef struct VkWin32SurfaceCreateInfoKHR
+typedef struct VkViewportWScalingNV
+{
+ float xcoeff;
+ float ycoeff;
+} VkViewportWScalingNV;
+
+typedef struct VkWriteDescriptorSetInlineUniformBlockEXT
{
VkStructureType sType;
const void *pNext;
- VkWin32SurfaceCreateFlagsKHR flags;
- HINSTANCE hinstance;
- HWND hwnd;
-} VkWin32SurfaceCreateInfoKHR;
+ uint32_t dataSize;
+ const void *pData;
+} VkWriteDescriptorSetInlineUniformBlockEXT;
typedef struct VkBindImageMemoryDeviceGroupInfo
{
@@ -5781,13 +5799,13 @@ typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV
VkBool32 representativeFragmentTestEnable;
} VkPipelineRepresentativeFragmentTestStateCreateInfoNV;
-typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT
+typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV
{
VkStructureType sType;
const void *pNext;
- uint32_t vertexBindingDivisorCount;
- const VkVertexInputBindingDivisorDescriptionEXT *pVertexBindingDivisors;
-} VkPipelineVertexInputDivisorStateCreateInfoEXT;
+ uint32_t exclusiveScissorCount;
+ const VkRect2D *pExclusiveScissors;
+} VkPipelineViewportExclusiveScissorStateCreateInfoNV;
typedef struct VkPresentRegionsKHR
{
@@ -5852,13 +5870,14 @@ typedef struct VkSpecializationInfo
const void *pData;
} VkSpecializationInfo;
-typedef struct VkWriteDescriptorSetInlineUniformBlockEXT
+typedef struct VkWin32SurfaceCreateInfoKHR
{
VkStructureType sType;
const void *pNext;
- uint32_t dataSize;
- const void *pData;
-} VkWriteDescriptorSetInlineUniformBlockEXT;
+ VkWin32SurfaceCreateFlagsKHR flags;
+ HINSTANCE hinstance;
+ HWND hwnd;
+} VkWin32SurfaceCreateInfoKHR;
typedef struct VkAttachmentSampleLocationsEXT
{
@@ -6005,12 +6024,29 @@ typedef struct VkPipelineShaderStageCreateInfo
const VkSpecializationInfo *pSpecializationInfo;
} VkPipelineShaderStageCreateInfo;
-typedef struct VkQueueFamilyCheckpointPropertiesNV
+typedef struct VkPipelineViewportWScalingStateCreateInfoNV
{
VkStructureType sType;
- void *pNext;
- VkPipelineStageFlags checkpointExecutionStageMask;
-} VkQueueFamilyCheckpointPropertiesNV;
+ const void *pNext;
+ VkBool32 viewportWScalingEnable;
+ uint32_t viewportCount;
+ const VkViewportWScalingNV *pViewportWScalings;
+} VkPipelineViewportWScalingStateCreateInfoNV;
+
+typedef struct VkRayTracingPipelineCreateInfoNV
+{
+ VkStructureType sType;
+ const void *pNext;
+ VkPipelineCreateFlags flags;
+ uint32_t stageCount;
+ const VkPipelineShaderStageCreateInfo *pStages;
+ uint32_t groupCount;
+ const VkRayTracingShaderGroupCreateInfoNV *pGroups;
+ uint32_t maxRecursionDepth;
+ VkPipelineLayout WINE_VK_ALIGN(8) layout;
+ VkPipeline WINE_VK_ALIGN(8) basePipelineHandle;
+ int32_t basePipelineIndex;
+} VkRayTracingPipelineCreateInfoNV;
typedef struct VkRenderPassSampleLocationsBeginInfoEXT
{
@@ -6043,11 +6079,11 @@ typedef struct VkSubpassDescription
const uint32_t *pPreserveAttachments;
} VkSubpassDescription;
-typedef struct VkViewportWScalingNV
+typedef struct VkVertexInputBindingDivisorDescriptionEXT
{
- float xcoeff;
- float ycoeff;
-} VkViewportWScalingNV;
+ uint32_t binding;
+ uint32_t divisor;
+} VkVertexInputBindingDivisorDescriptionEXT;
typedef struct VkAccelerationStructureInfoNV
{
@@ -6108,28 +6144,33 @@ typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT
VkBool32 vertexAttributeInstanceRateZeroDivisor;
} VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT;
-typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV
+typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT
{
VkStructureType sType;
const void *pNext;
- uint32_t exclusiveScissorCount;
- const VkRect2D *pExclusiveScissors;
-} VkPipelineViewportExclusiveScissorStateCreateInfoNV;
+ uint32_t vertexBindingDivisorCount;
+ const VkVertexInputBindingDivisorDescriptionEXT *pVertexBindingDivisors;
+} VkPipelineVertexInputDivisorStateCreateInfoEXT;
-typedef struct VkRayTracingPipelineCreateInfoNV
+typedef struct VkRenderPassCreateInfo
{
VkStructureType sType;
const void *pNext;
- VkPipelineCreateFlags flags;
- uint32_t stageCount;
- const VkPipelineShaderStageCreateInfo *pStages;
- uint32_t groupCount;
- const VkRayTracingShaderGroupCreateInfoNV *pGroups;
- uint32_t maxRecursionDepth;
- VkPipelineLayout WINE_VK_ALIGN(8) layout;
- VkPipeline WINE_VK_ALIGN(8) basePipelineHandle;
- int32_t basePipelineIndex;
-} VkRayTracingPipelineCreateInfoNV;
+ VkRenderPassCreateFlags flags;
+ uint32_t attachmentCount;
+ const VkAttachmentDescription *pAttachments;
+ uint32_t subpassCount;
+ const VkSubpassDescription *pSubpasses;
+ uint32_t dependencyCount;
+ const VkSubpassDependency *pDependencies;
+} VkRenderPassCreateInfo;
+
+typedef struct VkSparseImageMemoryBindInfo
+{
+ VkImage WINE_VK_ALIGN(8) image;
+ uint32_t bindCount;
+ const VkSparseImageMemoryBind *pBinds;
+} VkSparseImageMemoryBindInfo;
typedef struct VkAccelerationStructureCreateInfoNV
{
@@ -6186,34 +6227,21 @@ typedef struct VkPipelineLayoutCreateInfo
const VkPushConstantRange *pPushConstantRanges;
} VkPipelineLayoutCreateInfo;
-typedef struct VkRenderPassCreateInfo
-{
- VkStructureType sType;
- const void *pNext;
- VkRenderPassCreateFlags flags;
- uint32_t attachmentCount;
- const VkAttachmentDescription *pAttachments;
- uint32_t subpassCount;
- const VkSubpassDescription *pSubpasses;
- uint32_t dependencyCount;
- const VkSubpassDependency *pDependencies;
-} VkRenderPassCreateInfo;
-
-typedef struct VkDeviceQueueGlobalPriorityCreateInfoEXT
-{
- VkStructureType sType;
- const void *pNext;
- VkQueueGlobalPriorityEXT globalPriority;
-} VkDeviceQueueGlobalPriorityCreateInfoEXT;
-
-typedef struct VkPipelineViewportWScalingStateCreateInfoNV
+typedef struct VkBindSparseInfo
{
VkStructureType sType;
const void *pNext;
- VkBool32 viewportWScalingEnable;
- uint32_t viewportCount;
- const VkViewportWScalingNV *pViewportWScalings;
-} VkPipelineViewportWScalingStateCreateInfoNV;
+ uint32_t waitSemaphoreCount;
+ const VkSemaphore *pWaitSemaphores;
+ uint32_t bufferBindCount;
+ const VkSparseBufferMemoryBindInfo *pBufferBinds;
+ uint32_t imageOpaqueBindCount;
+ const VkSparseImageOpaqueMemoryBindInfo *pImageOpaqueBinds;
+ uint32_t imageBindCount;
+ const VkSparseImageMemoryBindInfo *pImageBinds;
+ uint32_t signalSemaphoreCount;
+ const VkSemaphore *pSignalSemaphores;
+} VkBindSparseInfo;
typedef struct VkGraphicsPipelineCreateInfo
{
@@ -6238,29 +6266,6 @@ typedef struct VkGraphicsPipelineCreateInfo
int32_t basePipelineIndex;
} VkGraphicsPipelineCreateInfo;
-typedef struct VkSparseImageMemoryBindInfo
-{
- VkImage WINE_VK_ALIGN(8) image;
- uint32_t bindCount;
- const VkSparseImageMemoryBind *pBinds;
-} VkSparseImageMemoryBindInfo;
-
-typedef struct VkBindSparseInfo
-{
- VkStructureType sType;
- const void *pNext;
- uint32_t waitSemaphoreCount;
- const VkSemaphore *pWaitSemaphores;
- uint32_t bufferBindCount;
- const VkSparseBufferMemoryBindInfo *pBufferBinds;
- uint32_t imageOpaqueBindCount;
- const VkSparseImageOpaqueMemoryBindInfo *pImageOpaqueBinds;
- uint32_t imageBindCount;
- const VkSparseImageMemoryBindInfo *pImageBinds;
- uint32_t signalSemaphoreCount;
- const VkSemaphore *pSignalSemaphores;
-} VkBindSparseInfo;
-
typedef struct VkPhysicalDeviceShaderCorePropertiesAMD
{
VkStructureType sType;
@@ -6281,6 +6286,27 @@ typedef struct VkPhysicalDeviceShaderCorePropertiesAMD
uint32_t vgprAllocationGranularity;
} VkPhysicalDeviceShaderCorePropertiesAMD;
+typedef struct VkSurfaceFormat2KHR
+{
+ VkStructureType sType;
+ void *pNext;
+ VkSurfaceFormatKHR surfaceFormat;
+} VkSurfaceFormat2KHR;
+
+typedef struct VkDeviceQueueGlobalPriorityCreateInfoEXT
+{
+ VkStructureType sType;
+ const void *pNext;
+ VkQueueGlobalPriorityEXT globalPriority;
+} VkDeviceQueueGlobalPriorityCreateInfoEXT;
+
+typedef struct VkQueueFamilyCheckpointPropertiesNV
+{
+ VkStructureType sType;
+ void *pNext;
+ VkPipelineStageFlags checkpointExecutionStageMask;
+} VkQueueFamilyCheckpointPropertiesNV;
+
typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice, const VkAcquireNextImageInfoKHR *, uint32_t *);
typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImageKHR)(VkDevice, VkSwapchainKHR, uint64_t, VkSemaphore, VkFence, uint32_t *);
typedef VkResult (VKAPI_PTR *PFN_vkAcquirePerformanceConfigurationINTEL)(VkDevice, const VkPerformanceConfigurationAcquireInfoINTEL *, VkPerformanceConfigurationINTEL *);
@@ -6520,7 +6546,9 @@ typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkP
typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *);
typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *);
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV)(VkPhysicalDevice, uint32_t *, VkFramebufferMixedSamplesCombinationNV *);
+typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *);
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *);
+typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *);
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *);
@@ -6808,7 +6836,9 @@ void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice
void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties);
void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties);
VkResult VKAPI_CALL vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice, uint32_t *pCombinationCount, VkFramebufferMixedSamplesCombinationNV *pCombinations);
+VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities);
VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities);
+VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats);
VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats);
VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes);
VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported);
diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h
index 02f504e9ae..187cde70ad 100644
--- a/include/wine/vulkan_driver.h
+++ b/include/wine/vulkan_driver.h
@@ -39,7 +39,7 @@
#define __WINE_VULKAN_DRIVER_H
/* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */
-#define WINE_VULKAN_DRIVER_VERSION 7
+#define WINE_VULKAN_DRIVER_VERSION 8
struct vulkan_funcs
{
@@ -58,7 +58,9 @@ struct vulkan_funcs
void * (*p_vkGetDeviceProcAddr)(VkDevice, const char *);
void * (*p_vkGetInstanceProcAddr)(VkInstance, const char *);
VkResult (*p_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkRect2D *);
+ VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *);
VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *);
+ VkResult (*p_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
VkResult (*p_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
VkResult (*p_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *);
VkResult (*p_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *);
@@ -116,8 +118,12 @@ static inline void *get_vulkan_driver_instance_proc_addr(
return vulkan_funcs->p_vkGetInstanceProcAddr;
if (!strcmp(name, "GetPhysicalDevicePresentRectanglesKHR"))
return vulkan_funcs->p_vkGetPhysicalDevicePresentRectanglesKHR;
+ if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilities2KHR"))
+ return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceCapabilities2KHR;
if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilitiesKHR"))
return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
+ if (!strcmp(name, "GetPhysicalDeviceSurfaceFormats2KHR"))
+ return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceFormats2KHR;
if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR"))
return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceFormatsKHR;
if (!strcmp(name, "GetPhysicalDeviceSurfacePresentModesKHR"))
--
2.24.1
3
4
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/quartz/quartz_private.h | 2 +-
dlls/quartz/videorenderer.c | 17 +++++++----------
dlls/quartz/vmr9.c | 20 +++++++++-----------
dlls/quartz/window.c | 3 +--
4 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h
index 3274714eea1..b0fb91c665a 100644
--- a/dlls/quartz/quartz_private.h
+++ b/dlls/quartz/quartz_private.h
@@ -111,7 +111,7 @@ struct video_window_ops
void video_window_cleanup(struct video_window *window) DECLSPEC_HIDDEN;
HRESULT video_window_create_window(struct video_window *window) DECLSPEC_HIDDEN;
-HRESULT video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl,
+void video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl,
struct strmbase_filter *filter, struct strmbase_pin *pin, const struct video_window_ops *ops) DECLSPEC_HIDDEN;
void video_window_unregister_class(void) DECLSPEC_HIDDEN;
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c
index 3888d010e6e..54a646fbc04 100644
--- a/dlls/quartz/videorenderer.c
+++ b/dlls/quartz/videorenderer.c
@@ -714,27 +714,24 @@ HRESULT video_renderer_create(IUnknown *outer, IUnknown **out)
strmbase_renderer_init(&object->renderer, outer, &CLSID_VideoRenderer, L"In", &renderer_ops);
object->IOverlay_iface.lpVtbl = &overlay_vtbl;
- hr = video_window_init(&object->baseControlWindow, &IVideoWindow_VTable,
+ video_window_init(&object->baseControlWindow, &IVideoWindow_VTable,
&object->renderer.filter, &object->renderer.sink.pin, &window_ops);
- if (FAILED(hr))
- goto fail;
-
basic_video_init(&object->baseControlVideo, &object->renderer.filter,
&object->renderer.sink.pin, &renderer_BaseControlVideoFuncTable);
if (FAILED(hr = video_window_create_window(&object->baseControlWindow)))
- goto fail;
+ {
+ video_window_cleanup(&object->baseControlWindow);
+ strmbase_renderer_cleanup(&object->renderer);
+ free(object);
+ return hr;
+ }
object->run_event = CreateEventW(NULL, TRUE, FALSE, NULL);
TRACE("Created video renderer %p.\n", object);
*out = &object->renderer.filter.IUnknown_inner;
return S_OK;
-
-fail:
- strmbase_renderer_cleanup(&object->renderer);
- free(object);
- return hr;
}
HRESULT video_renderer_default_create(IUnknown *outer, IUnknown **out)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index 82727adb870..389166db3ed 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -2318,13 +2318,17 @@ static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid)
object->IVMRWindowlessControl9_iface.lpVtbl = &VMR9_WindowlessControl_Vtbl;
object->IOverlay_iface.lpVtbl = &overlay_vtbl;
- hr = video_window_init(&object->baseControlWindow, &IVideoWindow_VTable,
+ video_window_init(&object->baseControlWindow, &IVideoWindow_VTable,
&object->renderer.filter, &object->renderer.sink.pin, &window_ops);
- if (FAILED(hr))
- goto fail;
if (FAILED(hr = video_window_create_window(&object->baseControlWindow)))
- goto fail;
+ {
+ video_window_cleanup(&object->baseControlWindow);
+ strmbase_renderer_cleanup(&object->renderer);
+ FreeLibrary(object->hD3d9);
+ free(object);
+ return hr;
+ }
basic_video_init(&object->baseControlVideo, &object->renderer.filter,
&object->renderer.sink.pin, &renderer_BaseControlVideoFuncTable);
@@ -2333,13 +2337,7 @@ static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid)
TRACE("Created VMR %p.\n", object);
*out = &object->renderer.filter.IUnknown_inner;
- return hr;
-
-fail:
- strmbase_renderer_cleanup(&object->renderer);
- FreeLibrary(object->hD3d9);
- free(object);
- return hr;
+ return S_OK;
}
HRESULT vmr7_create(IUnknown *outer, IUnknown **out)
diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c
index 7e8aba8a263..61673cab048 100644
--- a/dlls/quartz/window.c
+++ b/dlls/quartz/window.c
@@ -662,7 +662,7 @@ void video_window_unregister_class(void)
ERR("Failed to unregister class, error %u.\n", GetLastError());
}
-HRESULT video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl,
+void video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl,
struct strmbase_filter *owner, struct strmbase_pin *pin, const struct video_window_ops *ops)
{
memset(window, 0, sizeof(*window));
@@ -671,7 +671,6 @@ HRESULT video_window_init(struct video_window *window, const IVideoWindowVtbl *v
window->AutoShow = OATRUE;
window->pFilter = owner;
window->pPin = pin;
- return S_OK;
}
void video_window_cleanup(struct video_window *window)
--
2.26.0
1
3