Wine-Devel
Threads by month
- ----- 2026 -----
- 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
- 4 participants
- 84544 discussions
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
---
dlls/mmdevapi/tests/render.c | 7 +++++++
dlls/winealsa.drv/mmdevdrv.c | 9 +++++++--
dlls/wineandroid.drv/mmdevdrv.c | 9 +++++++--
dlls/winecoreaudio.drv/mmdevdrv.c | 9 +++++++--
dlls/wineoss.drv/mmdevdrv.c | 9 +++++++--
dlls/winepulse.drv/mmdevdrv.c | 9 +++++++--
6 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c
index 8d52f483333..e58cc449d86 100644
--- a/dlls/mmdevapi/tests/render.c
+++ b/dlls/mmdevapi/tests/render.c
@@ -140,6 +140,7 @@ static void test_audioclient(void)
WAVEFORMATEX *pwfx, *pwfx2;
REFERENCE_TIME t1, t2;
HANDLE handle;
+ BOOL offload_capable;
hr = IMMDevice_Activate(dev, &IID_IAudioClient2, CLSCTX_INPROC_SERVER,
NULL, (void**)&ac2);
@@ -253,6 +254,12 @@ static void test_audioclient(void)
hr = IAudioClient_QueryInterface(ac, &IID_IAudioClient2, (void**)&ac2);
ok(hr == S_OK, "Failed to query IAudioClient2 interface: %08x\n", hr);
+ hr = IAudioClient2_IsOffloadCapable(ac2, AudioCategory_BackgroundCapableMedia, NULL);
+ ok(hr == E_INVALIDARG, "IsOffloadCapable gave wrong error: %08x\n", hr);
+
+ hr = IAudioClient2_IsOffloadCapable(ac2, AudioCategory_BackgroundCapableMedia, &offload_capable);
+ ok(hr == S_OK, "IsOffloadCapable failed: %08x\n", hr);
+
IAudioClient2_Release(ac2);
test_uninitialized(ac);
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index 2c3165385e6..233b0dfda11 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -2661,9 +2661,14 @@ static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
{
ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+ TRACE("(%p)->(0x%x, %p)\n", This, category, offload_capable);
- return E_NOTIMPL;
+ if(!offload_capable)
+ return E_INVALIDARG;
+
+ *offload_capable = FALSE;
+
+ return S_OK;
}
static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
diff --git a/dlls/wineandroid.drv/mmdevdrv.c b/dlls/wineandroid.drv/mmdevdrv.c
index 4e9ada3f55b..8ee1bb12d35 100644
--- a/dlls/wineandroid.drv/mmdevdrv.c
+++ b/dlls/wineandroid.drv/mmdevdrv.c
@@ -1620,9 +1620,14 @@ static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
{
ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+ TRACE("(%p)->(0x%x, %p)\n", This, category, offload_capable);
- return E_NOTIMPL;
+ if(!offload_capable)
+ return E_INVALIDARG;
+
+ *offload_capable = FALSE;
+
+ return S_OK;
}
static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c
index dd2ad916f8d..f32c1d5e417 100644
--- a/dlls/winecoreaudio.drv/mmdevdrv.c
+++ b/dlls/winecoreaudio.drv/mmdevdrv.c
@@ -2228,9 +2228,14 @@ static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
{
ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+ TRACE("(%p)->(0x%x, %p)\n", This, category, offload_capable);
- return E_NOTIMPL;
+ if(!offload_capable)
+ return E_INVALIDARG;
+
+ *offload_capable = FALSE;
+
+ return S_OK;
}
static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index 50c7db2c7c1..9b1cdf3fa7c 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -1785,9 +1785,14 @@ static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
{
ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+ TRACE("(%p)->(0x%x, %p)\n", This, category, offload_capable);
- return E_NOTIMPL;
+ if(!offload_capable)
+ return E_INVALIDARG;
+
+ *offload_capable = FALSE;
+
+ return S_OK;
}
static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index b8386cfe553..e384955b019 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -2233,9 +2233,14 @@ static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
{
ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+ TRACE("(%p)->(0x%x, %p)\n", This, category, offload_capable);
- return E_NOTIMPL;
+ if(!offload_capable)
+ return E_INVALIDARG;
+
+ *offload_capable = FALSE;
+
+ return S_OK;
}
static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
--
2.28.0
2
1
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
---
dlls/mmdevapi/devenum.c | 3 +-
dlls/mmdevapi/tests/render.c | 11 +++
dlls/winealsa.drv/mmdevdrv.c | 144 ++++++++++++++++++-----------
dlls/wineandroid.drv/mmdevdrv.c | 147 ++++++++++++++++++------------
dlls/winecoreaudio.drv/mmdevdrv.c | 144 ++++++++++++++++++-----------
dlls/wineoss.drv/mmdevdrv.c | 145 ++++++++++++++++++-----------
dlls/winepulse.drv/mmdevdrv.c | 142 ++++++++++++++++++-----------
7 files changed, 463 insertions(+), 273 deletions(-)
diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c
index 82e1bb96c2a..5b7d6e76a78 100644
--- a/dlls/mmdevapi/devenum.c
+++ b/dlls/mmdevapi/devenum.c
@@ -591,7 +591,8 @@ static HRESULT WINAPI MMDevice_Activate(IMMDevice *iface, REFIID riid, DWORD cls
if (!ppv)
return E_POINTER;
- if (IsEqualIID(riid, &IID_IAudioClient)){
+ if (IsEqualIID(riid, &IID_IAudioClient) ||
+ IsEqualIID(riid, &IID_IAudioClient2)){
hr = drvs.pGetAudioEndpoint(&This->devguid, iface, (IAudioClient**)ppv);
}else if (IsEqualIID(riid, &IID_IAudioEndpointVolume) ||
IsEqualIID(riid, &IID_IAudioEndpointVolumeEx))
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c
index 50a43229a05..8d52f483333 100644
--- a/dlls/mmdevapi/tests/render.c
+++ b/dlls/mmdevapi/tests/render.c
@@ -133,6 +133,7 @@ static void test_uninitialized(IAudioClient *ac)
static void test_audioclient(void)
{
IAudioClient *ac;
+ IAudioClient2 *ac2;
IUnknown *unk;
HRESULT hr;
ULONG ref;
@@ -140,6 +141,11 @@ static void test_audioclient(void)
REFERENCE_TIME t1, t2;
HANDLE handle;
+ hr = IMMDevice_Activate(dev, &IID_IAudioClient2, CLSCTX_INPROC_SERVER,
+ NULL, (void**)&ac2);
+ ok(hr == S_OK, "IAudioClient2 Activation failed with %08x\n", hr);
+ IAudioClient2_Release(ac2);
+
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER,
NULL, (void**)&ac);
ok(hr == S_OK, "Activation failed with %08x\n", hr);
@@ -244,6 +250,11 @@ static void test_audioclient(void)
"IsFormatSupported(0xffffffff) call returns %08x\n", hr);
}
+ hr = IAudioClient_QueryInterface(ac, &IID_IAudioClient2, (void**)&ac2);
+ ok(hr == S_OK, "Failed to query IAudioClient2 interface: %08x\n", hr);
+
+ IAudioClient2_Release(ac2);
+
test_uninitialized(ac);
hr = IAudioClient_Initialize(ac, 3, 0, 5000000, 0, pwfx, NULL);
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index 714d6ab9b16..2c3165385e6 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -88,7 +88,7 @@ typedef struct _AudioSessionWrapper {
} AudioSessionWrapper;
struct ACImpl {
- IAudioClient IAudioClient_iface;
+ IAudioClient2 IAudioClient2_iface;
IAudioRenderClient IAudioRenderClient_iface;
IAudioCaptureClient IAudioCaptureClient_iface;
IAudioClock IAudioClock_iface;
@@ -172,7 +172,7 @@ static const WCHAR drv_key_devicesW[] = {'S','o','f','t','w','a','r','e','\\',
'w','i','n','e','a','l','s','a','.','d','r','v','\\','d','e','v','i','c','e','s',0};
static const WCHAR guidW[] = {'g','u','i','d',0};
-static const IAudioClientVtbl AudioClient_Vtbl;
+static const IAudioClient2Vtbl AudioClient2_Vtbl;
static const IAudioRenderClientVtbl AudioRenderClient_Vtbl;
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl;
static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl;
@@ -185,9 +185,9 @@ static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl;
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client);
-static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface)
+static inline ACImpl *impl_from_IAudioClient2(IAudioClient2 *iface)
{
- return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface);
+ return CONTAINING_RECORD(iface, ACImpl, IAudioClient2_iface);
}
static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface)
@@ -788,7 +788,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
if(!This)
return E_OUTOFMEMORY;
- This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl;
+ This->IAudioClient2_iface.lpVtbl = &AudioClient2_Vtbl;
This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl;
This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl;
This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl;
@@ -804,7 +804,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
return E_UNEXPECTED;
}
- hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient_iface, &This->pUnkFTMarshal);
+ hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient2_iface, &This->pUnkFTMarshal);
if (FAILED(hr)) {
HeapFree(GetProcessHeap(), 0, This);
return hr;
@@ -851,22 +851,24 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
This->parent = dev;
IMMDevice_AddRef(This->parent);
- *out = &This->IAudioClient_iface;
- IAudioClient_AddRef(&This->IAudioClient_iface);
+ *out = (IAudioClient *)&This->IAudioClient2_iface;
+ IAudioClient2_AddRef(&This->IAudioClient2_iface);
return S_OK;
}
-static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient2 *iface,
REFIID riid, void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
- if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient))
+ if(IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IAudioClient) ||
+ IsEqualIID(riid, &IID_IAudioClient2))
*ppv = iface;
else if(IsEqualIID(riid, &IID_IMarshal))
return IUnknown_QueryInterface(This->pUnkFTMarshal, riid, ppv);
@@ -879,18 +881,18 @@ static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
return E_NOINTERFACE;
}
-static ULONG WINAPI AudioClient_AddRef(IAudioClient *iface)
+static ULONG WINAPI AudioClient_AddRef(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedIncrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
return ref;
}
-static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
+static ULONG WINAPI AudioClient_Release(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedDecrement(&This->ref);
@@ -907,7 +909,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
CloseHandle(event);
}
- IAudioClient_Stop(iface);
+ IAudioClient2_Stop(iface);
IMMDevice_Release(This->parent);
IUnknown_Release(This->pUnkFTMarshal);
This->lock.DebugInfo->Spare[0] = 0;
@@ -1236,12 +1238,12 @@ static void silence_buffer(ACImpl *This, BYTE *buffer, UINT32 frames)
memset(buffer, 0, frames * This->fmt->nBlockAlign);
}
-static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_Initialize(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration,
REFERENCE_TIME period, const WAVEFORMATEX *fmt,
const GUID *sessionguid)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
snd_pcm_sw_params_t *sw_params = NULL;
snd_pcm_format_t format;
unsigned int rate, alsa_period_us;
@@ -1528,10 +1530,10 @@ exit:
return hr;
}
-static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient2 *iface,
UINT32 *out)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, out);
@@ -1552,10 +1554,10 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient2 *iface,
REFERENCE_TIME *latency)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, latency);
@@ -1585,10 +1587,10 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient2 *iface,
UINT32 *out)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, out);
@@ -1612,11 +1614,11 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *fmt,
WAVEFORMATEX **out)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
snd_pcm_format_mask_t *formats = NULL;
snd_pcm_format_t format;
HRESULT hr = S_OK;
@@ -1763,10 +1765,10 @@ exit:
return hr;
}
-static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient2 *iface,
WAVEFORMATEX **pwfx)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
WAVEFORMATEXTENSIBLE *fmt;
snd_pcm_format_mask_t *formats;
unsigned int max_rate, max_channels;
@@ -1894,10 +1896,10 @@ exit:
return hr;
}
-static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient2 *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod);
@@ -2392,9 +2394,9 @@ static int alsa_rewind_best_effort(ACImpl *This)
return len;
}
-static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Start(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -2460,9 +2462,9 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Stop(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -2488,9 +2490,9 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Reset(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -2535,10 +2537,10 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient2 *iface,
HANDLE event)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, event);
@@ -2570,10 +2572,10 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
+static HRESULT WINAPI AudioClient_GetService(IAudioClient2 *iface, REFIID riid,
void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
@@ -2654,7 +2656,38 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
return E_NOINTERFACE;
}
-static const IAudioClientVtbl AudioClient_Vtbl =
+static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
+ AUDIO_STREAM_CATEGORY category, BOOL *offload_capable)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
+ const AudioClientProperties *prop)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p)\n", This, prop);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface,
+ const WAVEFORMATEX *format, BOOL event_driven, REFERENCE_TIME *min_duration,
+ REFERENCE_TIME *max_duration)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p, %u, %p, %p)\n", This, format, event_driven, min_duration, max_duration);
+
+ return E_NOTIMPL;
+}
+
+static const IAudioClient2Vtbl AudioClient2_Vtbl =
{
AudioClient_QueryInterface,
AudioClient_AddRef,
@@ -2670,7 +2703,10 @@ static const IAudioClientVtbl AudioClient_Vtbl =
AudioClient_Stop,
AudioClient_Reset,
AudioClient_SetEventHandle,
- AudioClient_GetService
+ AudioClient_GetService,
+ AudioClient_IsOffloadCapable,
+ AudioClient_SetClientProperties,
+ AudioClient_GetBufferSizeLimits,
};
static HRESULT WINAPI AudioRenderClient_QueryInterface(
@@ -2701,13 +2737,13 @@ static HRESULT WINAPI AudioRenderClient_QueryInterface(
static ULONG WINAPI AudioRenderClient_AddRef(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_AddRef(&This->IAudioClient_iface);
+ return AudioClient_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioRenderClient_Release(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_Release(&This->IAudioClient_iface);
+ return AudioClient_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
@@ -2867,13 +2903,13 @@ static HRESULT WINAPI AudioCaptureClient_QueryInterface(
static ULONG WINAPI AudioCaptureClient_AddRef(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioCaptureClient_Release(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
@@ -3042,13 +3078,13 @@ static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface,
static ULONG WINAPI AudioClock_AddRef(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock_Release(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
@@ -3160,13 +3196,13 @@ static HRESULT WINAPI AudioClock2_QueryInterface(IAudioClock2 *iface,
static ULONG WINAPI AudioClock2_AddRef(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock2_Release(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface,
@@ -3205,7 +3241,7 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
ret->client = client;
if(client){
ret->session = client->session;
- AudioClient_AddRef(&client->IAudioClient_iface);
+ AudioClient_AddRef(&client->IAudioClient2_iface);
}
return ret;
@@ -3253,7 +3289,7 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface)
EnterCriticalSection(&This->client->lock);
This->client->session_wrapper = NULL;
LeaveCriticalSection(&This->client->lock);
- AudioClient_Release(&This->client->IAudioClient_iface);
+ AudioClient_Release(&This->client->IAudioClient2_iface);
}
HeapFree(GetProcessHeap(), 0, This);
}
@@ -3595,13 +3631,13 @@ static HRESULT WINAPI AudioStreamVolume_QueryInterface(
static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioStreamVolume_GetChannelCount(
diff --git a/dlls/wineandroid.drv/mmdevdrv.c b/dlls/wineandroid.drv/mmdevdrv.c
index eac55f9e290..4e9ada3f55b 100644
--- a/dlls/wineandroid.drv/mmdevdrv.c
+++ b/dlls/wineandroid.drv/mmdevdrv.c
@@ -107,7 +107,7 @@ typedef struct _AudioSessionWrapper {
} AudioSessionWrapper;
struct ACImpl {
- IAudioClient IAudioClient_iface;
+ IAudioClient2 IAudioClient2_iface;
IAudioRenderClient IAudioRenderClient_iface;
IAudioCaptureClient IAudioCaptureClient_iface;
IAudioClock IAudioClock_iface;
@@ -174,7 +174,7 @@ static struct list g_sessions = LIST_INIT(g_sessions);
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client);
-static const IAudioClientVtbl AudioClient_Vtbl;
+static const IAudioClient2Vtbl AudioClient2_Vtbl;
static const IAudioRenderClientVtbl AudioRenderClient_Vtbl;
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl;
static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl;
@@ -185,9 +185,9 @@ static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl;
static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl;
static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl;
-static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface)
+static inline ACImpl *impl_from_IAudioClient2(IAudioClient2 *iface)
{
- return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface);
+ return CONTAINING_RECORD(iface, ACImpl, IAudioClient2_iface);
}
static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface)
@@ -377,7 +377,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
if(!This)
return E_OUTOFMEMORY;
- hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient_iface, &This->pUnkFTMarshal);
+ hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient2_iface, &This->pUnkFTMarshal);
if (FAILED(hr)) {
HeapFree(GetProcessHeap(), 0, This);
return hr;
@@ -385,7 +385,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
This->dataflow = flow;
- This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl;
+ This->IAudioClient2_iface.lpVtbl = &AudioClient2_Vtbl;
This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl;
This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl;
This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl;
@@ -398,23 +398,24 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
This->parent = dev;
IMMDevice_AddRef(This->parent);
- IAudioClient_AddRef(&This->IAudioClient_iface);
-
- *out = &This->IAudioClient_iface;
+ *out = (IAudioClient *)&This->IAudioClient2_iface;
+ IAudioClient2_AddRef(&This->IAudioClient2_iface);
return S_OK;
}
-static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient2 *iface,
REFIID riid, void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
- if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient))
+ if(IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IAudioClient) ||
+ IsEqualIID(riid, &IID_IAudioClient2))
*ppv = iface;
else if(IsEqualIID(riid, &IID_IMarshal))
return IUnknown_QueryInterface(This->pUnkFTMarshal, riid, ppv);
@@ -426,18 +427,18 @@ static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
return E_NOINTERFACE;
}
-static ULONG WINAPI AudioClient_AddRef(IAudioClient *iface)
+static ULONG WINAPI AudioClient_AddRef(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedIncrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
return ref;
}
-static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
+static ULONG WINAPI AudioClient_Release(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedDecrement(&This->ref);
@@ -454,7 +455,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
CloseHandle(event);
}
- IAudioClient_Stop(iface);
+ IAudioClient2_Stop(iface);
IMMDevice_Release(This->parent);
IUnknown_Release(This->pUnkFTMarshal);
@@ -784,12 +785,12 @@ static HRESULT try_open_capture_device(SLAndroidDataFormat_PCM_EX *pcm, unsigned
return S_OK;
}
-static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_Initialize(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration,
REFERENCE_TIME period, const WAVEFORMATEX *fmt,
const GUID *sessionguid)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
int i, num_buffers;
HRESULT hr;
SLresult sr;
@@ -1019,10 +1020,10 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient2 *iface,
UINT32 *frames)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, frames);
@@ -1045,10 +1046,10 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient2 *iface,
REFERENCE_TIME *latency)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, latency);
@@ -1071,10 +1072,10 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient2 *iface,
UINT32 *numpad)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, numpad);
@@ -1097,11 +1098,11 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *pwfx,
WAVEFORMATEX **outpwfx)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
SLAndroidDataFormat_PCM_EX pcm;
HRESULT hr;
@@ -1133,7 +1134,7 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
if(FAILED(hr)){
if(outpwfx){
- hr = IAudioClient_GetMixFormat(iface, outpwfx);
+ hr = IAudioClient2_GetMixFormat(iface, outpwfx);
if(FAILED(hr))
return hr;
return S_FALSE;
@@ -1147,10 +1148,10 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
return hr;
}
-static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient2 *iface,
WAVEFORMATEX **pwfx)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
WAVEFORMATEXTENSIBLE *fmt;
TRACE("(%p)->(%p)\n", This, pwfx);
@@ -1185,10 +1186,10 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient2 *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod);
@@ -1342,9 +1343,9 @@ static void CALLBACK sl_period_callback(void *user, BOOLEAN timer)
SetEvent(This->event);
}
-static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Start(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
SLresult sr;
TRACE("(%p)\n", This);
@@ -1396,9 +1397,9 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Stop(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
SLresult sr;
TRACE("(%p)\n", This);
@@ -1438,9 +1439,9 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Reset(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
SLresult sr;
TRACE("(%p)\n", This);
@@ -1495,10 +1496,10 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient2 *iface,
HANDLE event)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, event);
@@ -1530,10 +1531,10 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
+static HRESULT WINAPI AudioClient_GetService(IAudioClient2 *iface, REFIID riid,
void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
@@ -1614,7 +1615,38 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
return E_NOINTERFACE;
}
-static const IAudioClientVtbl AudioClient_Vtbl =
+static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
+ AUDIO_STREAM_CATEGORY category, BOOL *offload_capable)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
+ const AudioClientProperties *prop)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p)\n", This, prop);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface,
+ const WAVEFORMATEX *format, BOOL event_driven, REFERENCE_TIME *min_duration,
+ REFERENCE_TIME *max_duration)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p, %u, %p, %p)\n", This, format, event_driven, min_duration, max_duration);
+
+ return E_NOTIMPL;
+}
+
+static const IAudioClient2Vtbl AudioClient2_Vtbl =
{
AudioClient_QueryInterface,
AudioClient_AddRef,
@@ -1630,7 +1662,10 @@ static const IAudioClientVtbl AudioClient_Vtbl =
AudioClient_Stop,
AudioClient_Reset,
AudioClient_SetEventHandle,
- AudioClient_GetService
+ AudioClient_GetService,
+ AudioClient_IsOffloadCapable,
+ AudioClient_SetClientProperties,
+ AudioClient_GetBufferSizeLimits,
};
static HRESULT WINAPI AudioRenderClient_QueryInterface(
@@ -1660,13 +1695,13 @@ static HRESULT WINAPI AudioRenderClient_QueryInterface(
static ULONG WINAPI AudioRenderClient_AddRef(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_AddRef(&This->IAudioClient_iface);
+ return AudioClient_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioRenderClient_Release(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_Release(&This->IAudioClient_iface);
+ return AudioClient_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
@@ -1827,13 +1862,13 @@ static HRESULT WINAPI AudioCaptureClient_QueryInterface(
static ULONG WINAPI AudioCaptureClient_AddRef(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioCaptureClient_Release(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
@@ -2005,13 +2040,13 @@ static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface,
static ULONG WINAPI AudioClock_AddRef(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock_Release(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
@@ -2101,13 +2136,13 @@ static HRESULT WINAPI AudioClock2_QueryInterface(IAudioClock2 *iface,
static ULONG WINAPI AudioClock2_AddRef(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock2_Release(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface,
@@ -2146,7 +2181,7 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
ret->client = client;
if(client){
ret->session = client->session;
- AudioClient_AddRef(&client->IAudioClient_iface);
+ AudioClient_AddRef(&client->IAudioClient2_iface);
}
return ret;
@@ -2194,7 +2229,7 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface)
EnterCriticalSection(&This->client->lock);
This->client->session_wrapper = NULL;
LeaveCriticalSection(&This->client->lock);
- AudioClient_Release(&This->client->IAudioClient_iface);
+ AudioClient_Release(&This->client->IAudioClient2_iface);
}
HeapFree(GetProcessHeap(), 0, This);
}
@@ -2537,13 +2572,13 @@ static HRESULT WINAPI AudioStreamVolume_QueryInterface(
static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioStreamVolume_GetChannelCount(
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c
index 860d33fa3ba..dd2ad916f8d 100644
--- a/dlls/winecoreaudio.drv/mmdevdrv.c
+++ b/dlls/winecoreaudio.drv/mmdevdrv.c
@@ -130,7 +130,7 @@ typedef struct _AudioSessionWrapper {
} AudioSessionWrapper;
struct ACImpl {
- IAudioClient IAudioClient_iface;
+ IAudioClient2 IAudioClient2_iface;
IAudioRenderClient IAudioRenderClient_iface;
IAudioCaptureClient IAudioCaptureClient_iface;
IAudioClock IAudioClock_iface;
@@ -173,7 +173,7 @@ struct ACImpl {
OSSpinLock lock;
};
-static const IAudioClientVtbl AudioClient_Vtbl;
+static const IAudioClient2Vtbl AudioClient2_Vtbl;
static const IAudioRenderClientVtbl AudioRenderClient_Vtbl;
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl;
static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl;
@@ -212,9 +212,9 @@ static struct list g_sessions = LIST_INIT(g_sessions);
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client);
static HRESULT ca_setvol(ACImpl *This, UINT32 index);
-static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface)
+static inline ACImpl *impl_from_IAudioClient2(IAudioClient2 *iface)
{
- return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface);
+ return CONTAINING_RECORD(iface, ACImpl, IAudioClient2_iface);
}
static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface)
@@ -674,7 +674,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
if(!This)
return E_OUTOFMEMORY;
- This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl;
+ This->IAudioClient2_iface.lpVtbl = &AudioClient2_Vtbl;
This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl;
This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl;
This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl;
@@ -694,7 +694,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
This->lock = 0;
- hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient_iface, &This->pUnkFTMarshal);
+ hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient2_iface, &This->pUnkFTMarshal);
if (FAILED(hr)) {
HeapFree(GetProcessHeap(), 0, This);
return hr;
@@ -710,22 +710,24 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
return AUDCLNT_E_DEVICE_INVALIDATED;
}
- *out = &This->IAudioClient_iface;
- IAudioClient_AddRef(&This->IAudioClient_iface);
+ *out = (IAudioClient *)&This->IAudioClient2_iface;
+ IAudioClient2_AddRef(&This->IAudioClient2_iface);
return S_OK;
}
-static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient2 *iface,
REFIID riid, void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
- if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient))
+ if(IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IAudioClient) ||
+ IsEqualIID(riid, &IID_IAudioClient2))
*ppv = iface;
else if(IsEqualIID(riid, &IID_IMarshal))
return IUnknown_QueryInterface(This->pUnkFTMarshal, riid, ppv);
@@ -738,18 +740,18 @@ static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
return E_NOINTERFACE;
}
-static ULONG WINAPI AudioClient_AddRef(IAudioClient *iface)
+static ULONG WINAPI AudioClient_AddRef(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedIncrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
return ref;
}
-static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
+static ULONG WINAPI AudioClient_Release(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedDecrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
@@ -1295,12 +1297,12 @@ static HRESULT ca_setup_audiounit(EDataFlow dataflow, AudioComponentInstance uni
return S_OK;
}
-static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_Initialize(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration,
REFERENCE_TIME period, const WAVEFORMATEX *fmt,
const GUID *sessionguid)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr;
OSStatus sc;
int i;
@@ -1499,10 +1501,10 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient2 *iface,
UINT32 *frames)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, frames);
@@ -1577,10 +1579,10 @@ static HRESULT ca_get_max_stream_latency(ACImpl *This, UInt32 *max)
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient2 *iface,
REFERENCE_TIME *out)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
UInt32 latency, stream_latency, size;
AudioObjectPropertyAddress addr;
OSStatus sc;
@@ -1642,10 +1644,10 @@ static HRESULT AudioClient_GetCurrentPadding_nolock(ACImpl *This,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient2 *iface,
UINT32 *numpad)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr;
TRACE("(%p)->(%p)\n", This, numpad);
@@ -1662,11 +1664,11 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
return hr;
}
-static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *pwfx,
WAVEFORMATEX **outpwfx)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
AudioStreamBasicDescription dev_desc;
AudioConverterRef converter;
AudioComponentInstance unit;
@@ -1729,7 +1731,7 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
unsupported:
if(outpwfx){
- hr = IAudioClient_GetMixFormat(&This->IAudioClient_iface, outpwfx);
+ hr = IAudioClient2_GetMixFormat(&This->IAudioClient2_iface, outpwfx);
if(FAILED(hr))
return hr;
return S_FALSE;
@@ -1854,10 +1856,10 @@ static void convert_channel_layout(const AudioChannelLayout *ca_layout, WAVEFORM
fmt->dwChannelMask = ca_mask;
}
-static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient2 *iface,
WAVEFORMATEX **pwfx)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
WAVEFORMATEXTENSIBLE *fmt;
OSStatus sc;
UInt32 size;
@@ -1972,10 +1974,10 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient2 *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod);
@@ -1998,9 +2000,9 @@ void CALLBACK ca_period_cb(void *user, BOOLEAN timer)
SetEvent(This->event);
}
-static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Start(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -2037,9 +2039,9 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Stop(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -2062,9 +2064,9 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Reset(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -2102,10 +2104,10 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient2 *iface,
HANDLE event)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, event);
@@ -2137,10 +2139,10 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
+static HRESULT WINAPI AudioClient_GetService(IAudioClient2 *iface, REFIID riid,
void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
@@ -2221,7 +2223,38 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
return E_NOINTERFACE;
}
-static const IAudioClientVtbl AudioClient_Vtbl =
+static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
+ AUDIO_STREAM_CATEGORY category, BOOL *offload_capable)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
+ const AudioClientProperties *prop)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p)\n", This, prop);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface,
+ const WAVEFORMATEX *format, BOOL event_driven, REFERENCE_TIME *min_duration,
+ REFERENCE_TIME *max_duration)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p, %u, %p, %p)\n", This, format, event_driven, min_duration, max_duration);
+
+ return E_NOTIMPL;
+}
+
+static const IAudioClient2Vtbl AudioClient2_Vtbl =
{
AudioClient_QueryInterface,
AudioClient_AddRef,
@@ -2237,7 +2270,10 @@ static const IAudioClientVtbl AudioClient_Vtbl =
AudioClient_Stop,
AudioClient_Reset,
AudioClient_SetEventHandle,
- AudioClient_GetService
+ AudioClient_GetService,
+ AudioClient_IsOffloadCapable,
+ AudioClient_SetClientProperties,
+ AudioClient_GetBufferSizeLimits,
};
static HRESULT WINAPI AudioRenderClient_QueryInterface(
@@ -2268,13 +2304,13 @@ static HRESULT WINAPI AudioRenderClient_QueryInterface(
static ULONG WINAPI AudioRenderClient_AddRef(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_AddRef(&This->IAudioClient_iface);
+ return AudioClient_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioRenderClient_Release(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_Release(&This->IAudioClient_iface);
+ return AudioClient_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
@@ -2425,13 +2461,13 @@ static HRESULT WINAPI AudioCaptureClient_QueryInterface(
static ULONG WINAPI AudioCaptureClient_AddRef(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioCaptureClient_Release(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
@@ -2593,13 +2629,13 @@ static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface,
static ULONG WINAPI AudioClock_AddRef(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock_Release(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
@@ -2689,13 +2725,13 @@ static HRESULT WINAPI AudioClock2_QueryInterface(IAudioClock2 *iface,
static ULONG WINAPI AudioClock2_AddRef(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock2_Release(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface,
@@ -2734,7 +2770,7 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
ret->client = client;
if(client){
ret->session = client->session;
- AudioClient_AddRef(&client->IAudioClient_iface);
+ AudioClient2_AddRef(&client->IAudioClient2_iface);
}
return ret;
@@ -2782,7 +2818,7 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface)
OSSpinLockLock(&This->client->lock);
This->client->session_wrapper = NULL;
OSSpinLockUnlock(&This->client->lock);
- AudioClient_Release(&This->client->IAudioClient_iface);
+ AudioClient_Release(&This->client->IAudioClient2_iface);
}
HeapFree(GetProcessHeap(), 0, This);
}
@@ -3177,13 +3213,13 @@ static HRESULT WINAPI AudioStreamVolume_QueryInterface(
static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioStreamVolume_GetChannelCount(
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index 0c97b85f3a9..50c7db2c7c1 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -90,7 +90,7 @@ typedef struct _AudioSessionWrapper {
} AudioSessionWrapper;
struct ACImpl {
- IAudioClient IAudioClient_iface;
+ IAudioClient2 IAudioClient2_iface;
IAudioRenderClient IAudioRenderClient_iface;
IAudioCaptureClient IAudioCaptureClient_iface;
IAudioClock IAudioClock_iface;
@@ -168,7 +168,7 @@ static struct list g_sessions = LIST_INIT(g_sessions);
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client);
-static const IAudioClientVtbl AudioClient_Vtbl;
+static const IAudioClient2Vtbl AudioClient2_Vtbl;
static const IAudioRenderClientVtbl AudioRenderClient_Vtbl;
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl;
static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl;
@@ -179,9 +179,9 @@ static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl;
static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl;
static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl;
-static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface)
+static inline ACImpl *impl_from_IAudioClient2(IAudioClient2 *iface)
{
- return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface);
+ return CONTAINING_RECORD(iface, ACImpl, IAudioClient2_iface);
}
static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface)
@@ -605,7 +605,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
if(!This)
return E_OUTOFMEMORY;
- hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient_iface, &This->pUnkFTMarshal);
+ hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient2_iface, &This->pUnkFTMarshal);
if (FAILED(hr)) {
HeapFree(GetProcessHeap(), 0, This);
return hr;
@@ -652,7 +652,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
TRACE("min_channels: %d\n", This->ai.min_channels);
TRACE("max_channels: %d\n", This->ai.max_channels);
- This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl;
+ This->IAudioClient2_iface.lpVtbl = &AudioClient2_Vtbl;
This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl;
This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl;
This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl;
@@ -665,23 +665,24 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
This->parent = dev;
IMMDevice_AddRef(This->parent);
- IAudioClient_AddRef(&This->IAudioClient_iface);
-
- *out = &This->IAudioClient_iface;
+ *out = (IAudioClient *)&This->IAudioClient2_iface;
+ IAudioClient2_AddRef(&This->IAudioClient2_iface);
return S_OK;
}
-static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient2 *iface,
REFIID riid, void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
- if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient))
+ if(IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IAudioClient) ||
+ IsEqualIID(riid, &IID_IAudioClient2))
*ppv = iface;
else if(IsEqualIID(riid, &IID_IMarshal))
return IUnknown_QueryInterface(This->pUnkFTMarshal, riid, ppv);
@@ -693,18 +694,18 @@ static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
return E_NOINTERFACE;
}
-static ULONG WINAPI AudioClient_AddRef(IAudioClient *iface)
+static ULONG WINAPI AudioClient_AddRef(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedIncrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
return ref;
}
-static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
+static ULONG WINAPI AudioClient_Release(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedDecrement(&This->ref);
@@ -721,7 +722,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
CloseHandle(event);
}
- IAudioClient_Stop(iface);
+ IAudioClient2_Stop(iface);
IMMDevice_Release(This->parent);
IUnknown_Release(This->pUnkFTMarshal);
This->lock.DebugInfo->Spare[0] = 0;
@@ -1028,12 +1029,12 @@ static HRESULT get_audio_session(const GUID *sessionguid,
return S_OK;
}
-static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_Initialize(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration,
REFERENCE_TIME period, const WAVEFORMATEX *fmt,
const GUID *sessionguid)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
int i;
HRESULT hr;
@@ -1158,10 +1159,10 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient2 *iface,
UINT32 *frames)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, frames);
@@ -1184,10 +1185,10 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient2 *iface,
REFERENCE_TIME *latency)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, latency);
@@ -1210,10 +1211,10 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient2 *iface,
UINT32 *numpad)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, numpad);
@@ -1236,11 +1237,11 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *pwfx,
WAVEFORMATEX **outpwfx)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
int fd = -1;
HRESULT ret;
@@ -1282,10 +1283,10 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
return ret;
}
-static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient2 *iface,
WAVEFORMATEX **pwfx)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
WAVEFORMATEXTENSIBLE *fmt;
int formats;
@@ -1375,10 +1376,10 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient2 *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod);
@@ -1559,9 +1560,9 @@ static void CALLBACK oss_period_callback(void *user, BOOLEAN timer)
SetEvent(This->event);
}
-static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Start(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -1596,9 +1597,9 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Stop(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -1622,9 +1623,9 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Reset(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)\n", This);
@@ -1660,10 +1661,10 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return S_OK;
}
-static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient2 *iface,
HANDLE event)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p)\n", This, event);
@@ -1695,10 +1696,10 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
+static HRESULT WINAPI AudioClient_GetService(IAudioClient2 *iface, REFIID riid,
void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
@@ -1779,7 +1780,38 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
return E_NOINTERFACE;
}
-static const IAudioClientVtbl AudioClient_Vtbl =
+static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
+ AUDIO_STREAM_CATEGORY category, BOOL *offload_capable)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
+ const AudioClientProperties *prop)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p)\n", This, prop);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface,
+ const WAVEFORMATEX *format, BOOL event_driven, REFERENCE_TIME *min_duration,
+ REFERENCE_TIME *max_duration)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p, %u, %p, %p)\n", This, format, event_driven, min_duration, max_duration);
+
+ return E_NOTIMPL;
+}
+
+static const IAudioClient2Vtbl AudioClient2_Vtbl =
{
AudioClient_QueryInterface,
AudioClient_AddRef,
@@ -1795,7 +1827,10 @@ static const IAudioClientVtbl AudioClient_Vtbl =
AudioClient_Stop,
AudioClient_Reset,
AudioClient_SetEventHandle,
- AudioClient_GetService
+ AudioClient_GetService,
+ AudioClient_IsOffloadCapable,
+ AudioClient_SetClientProperties,
+ AudioClient_GetBufferSizeLimits,
};
static HRESULT WINAPI AudioRenderClient_QueryInterface(
@@ -1825,13 +1860,13 @@ static HRESULT WINAPI AudioRenderClient_QueryInterface(
static ULONG WINAPI AudioRenderClient_AddRef(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_AddRef(&This->IAudioClient_iface);
+ return AudioClient_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioRenderClient_Release(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_Release(&This->IAudioClient_iface);
+ return AudioClient_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
@@ -1991,13 +2026,13 @@ static HRESULT WINAPI AudioCaptureClient_QueryInterface(
static ULONG WINAPI AudioCaptureClient_AddRef(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioCaptureClient_Release(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
@@ -2167,13 +2202,13 @@ static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface,
static ULONG WINAPI AudioClock_AddRef(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock_Release(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
@@ -2276,13 +2311,13 @@ static HRESULT WINAPI AudioClock2_QueryInterface(IAudioClock2 *iface,
static ULONG WINAPI AudioClock2_AddRef(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock2_Release(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface,
@@ -2321,7 +2356,7 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
ret->client = client;
if(client){
ret->session = client->session;
- AudioClient_AddRef(&client->IAudioClient_iface);
+ AudioClient_AddRef(&client->IAudioClient2_iface);
}
return ret;
@@ -2369,7 +2404,7 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface)
EnterCriticalSection(&This->client->lock);
This->client->session_wrapper = NULL;
LeaveCriticalSection(&This->client->lock);
- AudioClient_Release(&This->client->IAudioClient_iface);
+ AudioClient_Release(&This->client->IAudioClient2_iface);
}
HeapFree(GetProcessHeap(), 0, This);
}
@@ -2712,13 +2747,13 @@ static HRESULT WINAPI AudioStreamVolume_QueryInterface(
static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioStreamVolume_GetChannelCount(
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index e34c5ea5916..b8386cfe553 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -157,7 +157,7 @@ typedef struct _ACPacket {
} ACPacket;
struct ACImpl {
- IAudioClient IAudioClient_iface;
+ IAudioClient2 IAudioClient2_iface;
IAudioRenderClient IAudioRenderClient_iface;
IAudioCaptureClient IAudioCaptureClient_iface;
IAudioClock IAudioClock_iface;
@@ -198,7 +198,7 @@ struct ACImpl {
static const WCHAR defaultW[] = {'P','u','l','s','e','a','u','d','i','o',0};
-static const IAudioClientVtbl AudioClient_Vtbl;
+static const IAudioClient2Vtbl AudioClient2_Vtbl;
static const IAudioRenderClientVtbl AudioRenderClient_Vtbl;
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl;
static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl;
@@ -210,9 +210,9 @@ static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl;
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client);
-static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface)
+static inline ACImpl *impl_from_IAudioClient2(IAudioClient2 *iface)
{
- return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface);
+ return CONTAINING_RECORD(iface, ACImpl, IAudioClient2_iface);
}
static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface)
@@ -1228,7 +1228,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
if (!This)
return E_OUTOFMEMORY;
- This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl;
+ This->IAudioClient2_iface.lpVtbl = &AudioClient2_Vtbl;
This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl;
This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl;
This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl;
@@ -1239,23 +1239,23 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
for (i = 0; i < PA_CHANNELS_MAX; ++i)
This->vol[i] = 1.f;
- hr = CoCreateFreeThreadedMarshaler((IUnknown*)&This->IAudioClient_iface, &This->marshal);
+ hr = CoCreateFreeThreadedMarshaler((IUnknown*)&This->IAudioClient2_iface, &This->marshal);
if (hr) {
HeapFree(GetProcessHeap(), 0, This);
return hr;
}
IMMDevice_AddRef(This->parent);
- *out = &This->IAudioClient_iface;
- IAudioClient_AddRef(&This->IAudioClient_iface);
+ *out = (IAudioClient *)&This->IAudioClient2_iface;
+ IAudioClient2_AddRef(&This->IAudioClient2_iface);
return S_OK;
}
-static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient2 *iface,
REFIID riid, void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
@@ -1263,7 +1263,9 @@ static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
return E_POINTER;
*ppv = NULL;
- if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient))
+ if (IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IAudioClient) ||
+ IsEqualIID(riid, &IID_IAudioClient2))
*ppv = iface;
if (*ppv) {
IUnknown_AddRef((IUnknown*)*ppv);
@@ -1277,18 +1279,18 @@ static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
return E_NOINTERFACE;
}
-static ULONG WINAPI AudioClient_AddRef(IAudioClient *iface)
+static ULONG WINAPI AudioClient_AddRef(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedIncrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
return ref;
}
-static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
+static ULONG WINAPI AudioClient_Release(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
ULONG ref;
ref = InterlockedDecrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
@@ -1587,12 +1589,12 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt)
return S_OK;
}
-static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_Initialize(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration,
REFERENCE_TIME period, const WAVEFORMATEX *fmt,
const GUID *sessionguid)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr = S_OK;
UINT32 bufsize_bytes;
@@ -1711,10 +1713,10 @@ exit:
return hr;
}
-static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient2 *iface,
UINT32 *out)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr;
TRACE("(%p)->(%p)\n", This, out);
@@ -1731,10 +1733,10 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
return hr;
}
-static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient2 *iface,
REFERENCE_TIME *latency)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
const pa_buffer_attr *attr;
REFERENCE_TIME lat;
HRESULT hr;
@@ -1781,10 +1783,10 @@ static void ACImpl_GetCapturePad(ACImpl *This, UINT32 *out)
*out = This->held_bytes / pa_frame_size(&This->ss);
}
-static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient2 *iface,
UINT32 *out)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr;
TRACE("(%p)->(%p)\n", This, out);
@@ -1809,11 +1811,11 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient2 *iface,
AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *fmt,
WAVEFORMATEX **out)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr = S_OK;
WAVEFORMATEX *closest = NULL;
BOOL exclusive;
@@ -1962,10 +1964,10 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
return hr;
}
-static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient2 *iface,
WAVEFORMATEX **pwfx)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
WAVEFORMATEXTENSIBLE *fmt = &pulse_fmt[This->dataflow == eCapture];
TRACE("(%p)->(%p)\n", This, pwfx);
@@ -1980,10 +1982,10 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient2 *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod);
@@ -1998,9 +2000,9 @@ static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface,
return S_OK;
}
-static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Start(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr = S_OK;
int success;
pa_operation *o;
@@ -2049,9 +2051,9 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
return hr;
}
-static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Stop(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr = S_OK;
pa_operation *o;
int success;
@@ -2088,9 +2090,9 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return hr;
}
-static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
+static HRESULT WINAPI AudioClient_Reset(IAudioClient2 *iface)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr = S_OK;
TRACE("(%p)\n", This);
@@ -2143,10 +2145,10 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return hr;
}
-static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
+static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient2 *iface,
HANDLE event)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr;
TRACE("(%p)->(%p)\n", This, event);
@@ -2171,10 +2173,10 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
return hr;
}
-static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
+static HRESULT WINAPI AudioClient_GetService(IAudioClient2 *iface, REFIID riid,
void **ppv)
{
- ACImpl *This = impl_from_IAudioClient(iface);
+ ACImpl *This = impl_from_IAudioClient2(iface);
HRESULT hr;
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
@@ -2226,7 +2228,38 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
return E_NOINTERFACE;
}
-static const IAudioClientVtbl AudioClient_Vtbl =
+static HRESULT WINAPI AudioClient_IsOffloadCapable(IAudioClient2 *iface,
+ AUDIO_STREAM_CATEGORY category, BOOL *offload_capable)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(0x%x, %p)\n", This, category, offload_capable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface,
+ const AudioClientProperties *prop)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p)\n", This, prop);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface,
+ const WAVEFORMATEX *format, BOOL event_driven, REFERENCE_TIME *min_duration,
+ REFERENCE_TIME *max_duration)
+{
+ ACImpl *This = impl_from_IAudioClient2(iface);
+
+ FIXME("(%p)->(%p, %u, %p, %p)\n", This, format, event_driven, min_duration, max_duration);
+
+ return E_NOTIMPL;
+}
+
+static const IAudioClient2Vtbl AudioClient2_Vtbl =
{
AudioClient_QueryInterface,
AudioClient_AddRef,
@@ -2242,7 +2275,10 @@ static const IAudioClientVtbl AudioClient_Vtbl =
AudioClient_Stop,
AudioClient_Reset,
AudioClient_SetEventHandle,
- AudioClient_GetService
+ AudioClient_GetService,
+ AudioClient_IsOffloadCapable,
+ AudioClient_SetClientProperties,
+ AudioClient_GetBufferSizeLimits,
};
static HRESULT WINAPI AudioRenderClient_QueryInterface(
@@ -2273,13 +2309,13 @@ static HRESULT WINAPI AudioRenderClient_QueryInterface(
static ULONG WINAPI AudioRenderClient_AddRef(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_AddRef(&This->IAudioClient_iface);
+ return AudioClient_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioRenderClient_Release(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
- return AudioClient_Release(&This->IAudioClient_iface);
+ return AudioClient_Release(&This->IAudioClient2_iface);
}
static void alloc_tmp_buffer(ACImpl *This, UINT32 bytes)
@@ -2438,13 +2474,13 @@ static HRESULT WINAPI AudioCaptureClient_QueryInterface(
static ULONG WINAPI AudioCaptureClient_AddRef(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioCaptureClient_Release(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
@@ -2586,13 +2622,13 @@ static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface,
static ULONG WINAPI AudioClock_AddRef(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock_Release(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
@@ -2690,13 +2726,13 @@ static HRESULT WINAPI AudioClock2_QueryInterface(IAudioClock2 *iface,
static ULONG WINAPI AudioClock2_AddRef(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioClock2_Release(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface,
@@ -2746,13 +2782,13 @@ static HRESULT WINAPI AudioStreamVolume_QueryInterface(
static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_AddRef(&This->IAudioClient_iface);
+ return IAudioClient2_AddRef(&This->IAudioClient2_iface);
}
static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
- return IAudioClient_Release(&This->IAudioClient_iface);
+ return IAudioClient2_Release(&This->IAudioClient2_iface);
}
static HRESULT WINAPI AudioStreamVolume_GetChannelCount(
@@ -2904,7 +2940,7 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
ret->client = client;
if (client) {
ret->session = client->session;
- AudioClient_AddRef(&client->IAudioClient_iface);
+ AudioClient_AddRef(&client->IAudioClient2_iface);
}
return ret;
@@ -2950,7 +2986,7 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface)
if (!ref) {
if (This->client) {
This->client->session_wrapper = NULL;
- AudioClient_Release(&This->client->IAudioClient_iface);
+ AudioClient_Release(&This->client->IAudioClient2_iface);
}
HeapFree(GetProcessHeap(), 0, This);
}
--
2.28.0
2
1
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
---
include/audioclient.idl | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/include/audioclient.idl b/include/audioclient.idl
index 4759f3ef46f..132e78a602b 100644
--- a/include/audioclient.idl
+++ b/include/audioclient.idl
@@ -151,6 +151,35 @@ interface IAudioClient2 : IAudioClient
);
}
+[
+ local,
+ pointer_default(unique),
+ uuid(7ed4ee07-8e67-4cd4-8c1a-2b7a5987ad42),
+ object,
+]
+interface IAudioClient3 : IAudioClient2
+{
+ HRESULT GetSharedModeEnginePeriod(
+ [in] const WAVEFORMATEX *format,
+ [out] UINT32 *default_period_frames,
+ [out] UINT32 *unit_period_frames,
+ [out] UINT32 *min_period_frames,
+ [out] UINT32 *max_period_frames
+ );
+
+ HRESULT GetCurrentSharedModeEnginePeriod(
+ [out] WAVEFORMATEX **cur_format,
+ [out] UINT32 *cur_period_frames
+ );
+
+ HRESULT InitializeSharedAudioStream(
+ [in] DWORD flags,
+ [in] UINT32 period_frames,
+ [in] const WAVEFORMATEX *format,
+ [in] const GUID *session_guid
+ );
+}
+
[
local,
pointer_default(unique),
--
2.28.0
1
0
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
---
I did not try building the winecoreaudio and wineandroid changes in
this series.
include/audioclient.idl | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/include/audioclient.idl b/include/audioclient.idl
index 0628444bef3..4759f3ef46f 100644
--- a/include/audioclient.idl
+++ b/include/audioclient.idl
@@ -111,6 +111,46 @@ interface IAudioClient : IUnknown
);
}
+typedef enum _AUDCLNT_STREAMOPTIONS
+{
+ AUDCLNT_STREAMOPTIONS_NONE = 0,
+ AUDCLNT_STREAMOPTIONS_RAW = 1,
+ AUDCLNT_STREAMOPTIONS_MATCH_FORMAT = 2,
+} AUDCLNT_STREAMOPTIONS;
+
+typedef struct _AudioClientProperties
+{
+ UINT32 cbSize;
+ BOOL bIsOffload;
+ AUDIO_STREAM_CATEGORY eCategory;
+ AUDCLNT_STREAMOPTIONS Options;
+} AudioClientProperties;
+
+[
+ local,
+ pointer_default(unique),
+ uuid(726778cd-f60a-4eda-82de-e47610cd78aa),
+ object,
+]
+interface IAudioClient2 : IAudioClient
+{
+ HRESULT IsOffloadCapable(
+ AUDIO_STREAM_CATEGORY category,
+ [out] BOOL *offload_capable
+ );
+
+ HRESULT SetClientProperties(
+ [in] const AudioClientProperties *prop
+ );
+
+ HRESULT GetBufferSizeLimits(
+ [in] const WAVEFORMATEX *format,
+ BOOL event_driven,
+ [out] REFERENCE_TIME *min_duration,
+ [out] REFERENCE_TIME *max_duration
+ );
+}
+
[
local,
pointer_default(unique),
--
2.28.0
1
0
[PATCH] wined3d: Correct off-by-one errors when comparing against ARRAY_SIZE.
by Zebediah Figura Oct. 1, 2020
by Zebediah Figura Oct. 1, 2020
Oct. 1, 2020
Spotted by Alex Henrie.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wined3d/shader.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 0166746bfd2..d3921d5a981 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2059,7 +2059,7 @@ static void shader_dump_resource_type(struct wined3d_string_buffer *buffer, enum
/* WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY */ "texturecubearray",
};
- if (type <= ARRAY_SIZE(resource_type_names))
+ if (type < ARRAY_SIZE(resource_type_names))
shader_addline(buffer, "%s", resource_type_names[type]);
else
shader_addline(buffer, "unknown");
@@ -2080,7 +2080,7 @@ static void shader_dump_data_type(struct wined3d_string_buffer *buffer, enum win
/* WINED3D_DATA_OPAQUE */ "(opaque)",
};
- if (type <= ARRAY_SIZE(data_type_names))
+ if (type < ARRAY_SIZE(data_type_names))
shader_addline(buffer, "%s", data_type_names[type]);
else
shader_addline(buffer, "(unknown)");
--
2.28.0
2
1
[PATCH v3 2/2] d3d11/tests: Add a test for rendering with deferred contexts.
by Zebediah Figura Oct. 1, 2020
by Zebediah Figura Oct. 1, 2020
Oct. 1, 2020
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/d3d11/tests/d3d11.c | 103 +++++++++++++++++++++++++++++++++++++++
1 file changed, 103 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 82a165c62d7..e1a6dd6159b 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -30237,6 +30237,108 @@ static void test_deferred_context_state(void)
release_test_context(&test_context);
}
+static void test_deferred_context_rendering(void)
+{
+ ID3D11DeviceContext *immediate, *deferred;
+ struct d3d11_test_context test_context;
+ D3D11_TEXTURE2D_DESC texture_desc;
+ ID3D11CommandList *list1, *list2;
+ ID3D11RenderTargetView *rtv;
+ ID3D11Texture2D *texture;
+ ID3D11Device *device;
+ DWORD color;
+ HRESULT hr;
+
+ static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ static const float green[] = {0.0f, 1.0f, 0.0f, 1.0f};
+ static const float blue[] = {0.0f, 0.0f, 1.0f, 1.0f};
+
+ if (!init_test_context(&test_context, NULL))
+ return;
+
+ device = test_context.device;
+ immediate = test_context.immediate_context;
+
+ ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, white);
+
+ hr = ID3D11Device_CreateDeferredContext(device, 0, &deferred);
+ todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
+ if (hr != S_OK)
+ {
+ release_test_context(&test_context);
+ return;
+ }
+
+ ID3D11DeviceContext_ClearRenderTargetView(deferred, test_context.backbuffer_rtv, green);
+
+ hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list1);
+ ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
+
+ hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list2);
+ ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
+
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(color == 0xffffffff, "Got unexpected color %#08x.\n", color);
+
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list1, TRUE);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color);
+
+ ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, white);
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list1, TRUE);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color);
+
+ ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, white);
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list2, TRUE);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(color == 0xffffffff, "Got unexpected color %#08x.\n", color);
+
+ ID3D11CommandList_Release(list2);
+
+ ID3D11DeviceContext_ExecuteCommandList(deferred, list1, TRUE);
+ hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list2);
+ ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
+
+ ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, white);
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list2, TRUE);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color);
+
+ ID3D11CommandList_Release(list2);
+ ID3D11CommandList_Release(list1);
+ ID3D11DeviceContext_Release(deferred);
+
+ ID3D11Texture2D_GetDesc(test_context.backbuffer, &texture_desc);
+ hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture);
+ ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr);
+ hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)texture, NULL, &rtv);
+ ok(hr == S_OK, "Failed to create view, hr %#x.\n", hr);
+
+ ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, white);
+ ID3D11DeviceContext_ClearRenderTargetView(immediate, rtv, green);
+
+ hr = ID3D11Device_CreateDeferredContext(device, 0, &deferred);
+ ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
+
+ ID3D11DeviceContext_CopyResource(deferred, (ID3D11Resource *)test_context.backbuffer, (ID3D11Resource *)texture);
+
+ hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list1);
+ ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
+
+ ID3D11DeviceContext_ClearRenderTargetView(immediate, rtv, blue);
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list1, TRUE);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(color == 0xffff0000, "Got unexpected color %#08x.\n", color);
+
+ ID3D11CommandList_Release(list1);
+ ID3D11DeviceContext_Release(deferred);
+
+ ID3D11RenderTargetView_Release(rtv);
+ ID3D11Texture2D_Release(texture);
+ release_test_context(&test_context);
+}
+
START_TEST(d3d11)
{
unsigned int argc, i;
@@ -30401,6 +30503,7 @@ START_TEST(d3d11)
queue_test(test_independent_blend);
queue_test(test_dual_source_blend);
queue_test(test_deferred_context_state);
+ queue_test(test_deferred_context_rendering);
run_queued_tests();
}
--
2.28.0
3
2
[PATCH vkd3d v2 1/5] tests: Introduce a custom format and parser for shader-based tests.
by Zebediah Figura Oct. 1, 2020
by Zebediah Figura Oct. 1, 2020
Oct. 1, 2020
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
Makefile.am | 18 ++-
tests/.gitignore | 1 +
tests/d3d12.c | 101 ------------
tests/d3d12_crosstest.h | 1 +
tests/d3d12_test_utils.h | 103 ++++++++++++-
tests/shader_runner_d3d12.c | 300 ++++++++++++++++++++++++++++++++++++
6 files changed, 417 insertions(+), 107 deletions(-)
create mode 100644 tests/shader_runner_d3d12.c
diff --git a/Makefile.am b/Makefile.am
index 22a245e9..5e2ea3ea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,6 +46,9 @@ vkd3d_cross_tests = \
tests/d3d12 \
tests/d3d12_invalid_usage
+vkd3d_shader_runners = \
+ tests/shader_runner_d3d12
+
vkd3d_test_headers = \
tests/d3d12_crosstest.h \
tests/d3d12_test_utils.h
@@ -151,13 +154,18 @@ vkd3d_compiler_LDADD = libvkd3d-shader.la @NCURSES_LIBS@
LDADD = libvkd3d.la libvkd3d-utils.la
AM_DEFAULT_SOURCE_EXT = .c
+
+TEST_EXTENSIONS = .shader_test
+
if BUILD_TESTS
-check_PROGRAMS = $(vkd3d_tests) $(vkd3d_cross_tests)
+check_PROGRAMS = $(vkd3d_tests) $(vkd3d_cross_tests) $(vkd3d_shader_runners)
TESTS = $(vkd3d_tests) $(vkd3d_cross_tests)
tests_d3d12_LDADD = $(LDADD) @PTHREAD_LIBS@ @VULKAN_LIBS@
tests_d3d12_invalid_usage_LDADD = $(LDADD) @VULKAN_LIBS@
+tests_shader_runner_d3d12_LDADD = $(LDADD) @VULKAN_LIBS@
tests_vkd3d_api_LDADD = libvkd3d.la @VULKAN_LIBS@
tests_vkd3d_shader_api_LDADD = libvkd3d-shader.la
+SHADER_TEST_LOG_COMPILER = tests/shader_runner_d3d12
endif
if BUILD_DEMOS
@@ -239,7 +247,7 @@ if HAVE_CROSSTARGET32
CROSS32_CC = @CROSSCC32@
CROSS32_DLLTOOL = @CROSSTARGET32(a)-dlltool
CROSS32_IMPLIBS = $(cross_implibs:=.cross32.a)
-CROSS32_EXEFILES = $(vkd3d_cross_tests:=.cross32.exe) $(vkd3d_demos:=.cross32.exe)
+CROSS32_EXEFILES = $(vkd3d_cross_tests:=.cross32.exe) $(vkd3d_demos:=.cross32.exe) $(vkd3d_shader_runners:=.cross32.exe)
CROSS32_FILES = $(CROSS32_IMPLIBS) $(CROSS32_EXEFILES)
CLEANFILES += $(CROSS32_FILES)
@@ -254,7 +262,7 @@ $(CROSS32_IMPLIBS): %.cross32.a: %.cross32.def
$(CROSS32_EXEFILES): %.cross32.exe: %.c $(CROSS32_IMPLIBS) $(widl_headers)
$(AM_V_CCLD)depbase=`echo $@ | $(SED) 's![^/]*$$!$(DEPDIR)/&!;s!\.exe$$!!'`; \
- $(CROSS32_CC) $(CROSS_CFLAGS) -MT $@ -MD -MP -MF $$depbase.Tpo -o $@ $< $(CROSS32_IMPLIBS) -ldxgi -lgdi32 && \
+ $(CROSS32_CC) $(CROSS_CFLAGS) -MT $@ -MD -MP -MF $$depbase.Tpo -o $@ $< $(CROSS32_IMPLIBS) -ldxgi -lgdi32 -ld3dcompiler_47 && \
$(am__mv) $$depbase.Tpo $$depbase.Po
else
crosstest32:
@@ -264,7 +272,7 @@ if HAVE_CROSSTARGET64
CROSS64_CC = @CROSSCC64@
CROSS64_DLLTOOL = @CROSSTARGET64(a)-dlltool
CROSS64_IMPLIBS = $(cross_implibs:=.cross64.a)
-CROSS64_EXEFILES = $(vkd3d_cross_tests:=.cross64.exe) $(vkd3d_demos:=.cross64.exe)
+CROSS64_EXEFILES = $(vkd3d_cross_tests:=.cross64.exe) $(vkd3d_demos:=.cross64.exe) $(vkd3d_shader_runners:=.cross64.exe)
CROSS64_FILES = $(CROSS64_IMPLIBS) $(CROSS64_EXEFILES)
CLEANFILES += $(CROSS64_FILES)
@@ -279,7 +287,7 @@ $(CROSS64_IMPLIBS): %.cross64.a: %.cross64.def
$(CROSS64_EXEFILES): %.cross64.exe: %.c $(CROSS64_IMPLIBS) $(widl_headers)
$(AM_V_CCLD)depbase=`echo $@ | sed 's![^/]*$$!$(DEPDIR)/&!;s!\.exe$$!!'`; \
- $(CROSS64_CC) $(CROSS_CFLAGS) -MT $@ -MD -MP -MF $$depbase.Tpo -o $@ $< $(CROSS64_IMPLIBS) -ldxgi -lgdi32 && \
+ $(CROSS64_CC) $(CROSS_CFLAGS) -MT $@ -MD -MP -MF $$depbase.Tpo -o $@ $< $(CROSS64_IMPLIBS) -ldxgi -lgdi32 -ld3dcompiler_47 && \
$(am__mv) $$depbase.Tpo $$depbase.Po
else
crosstest64:
diff --git a/tests/.gitignore b/tests/.gitignore
index 1854d55b..94d003dd 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,5 +1,6 @@
/d3d12
/d3d12_invalid_usage
+/shader_runner_d3d12
/vkd3d_api
/vkd3d_common
/vkd3d_shader_api
diff --git a/tests/d3d12.c b/tests/d3d12.c
index f0b2d545..5554178e 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -31,11 +31,6 @@ struct vec2
float x, y;
};
-struct vec4
-{
- float x, y, z, w;
-};
-
struct uvec4
{
unsigned int x, y, z, w;
@@ -46,39 +41,6 @@ struct ivec4
int x, y, z, w;
};
-static bool compare_float(float f, float g, unsigned int ulps)
-{
- int x, y;
- union
- {
- float f;
- int i;
- } u;
-
- u.f = f;
- x = u.i;
- u.f = g;
- y = u.i;
-
- if (x < 0)
- x = INT_MIN - x;
- if (y < 0)
- y = INT_MIN - y;
-
- if (abs(x - y) > ulps)
- return false;
-
- return true;
-}
-
-static bool compare_vec4(const struct vec4 *v1, const struct vec4 *v2, unsigned int ulps)
-{
- return compare_float(v1->x, v2->x, ulps)
- && compare_float(v1->y, v2->y, ulps)
- && compare_float(v1->z, v2->z, ulps)
- && compare_float(v1->w, v2->w, ulps);
-}
-
static bool compare_uvec4(const struct uvec4* v1, const struct uvec4 *v2)
{
return v1->x == v2->x && v1->y == v2->y && v1->z == v2->z && v1->w == v2->w;
@@ -408,11 +370,6 @@ static float get_readback_float(struct resource_readback *rb, unsigned int x, un
return *(float *)get_readback_data(rb, x, y, 0, sizeof(float));
}
-static const struct vec4 *get_readback_vec4(struct resource_readback *rb, unsigned int x, unsigned int y)
-{
- return get_readback_data(rb, x, y, 0, sizeof(struct vec4));
-}
-
static const struct uvec4 *get_readback_uvec4(struct resource_readback *rb, unsigned int x, unsigned int y)
{
return get_readback_data(rb, x, y, 0, sizeof(struct uvec4));
@@ -582,37 +539,6 @@ static void check_sub_resource_uint64_(unsigned int line, ID3D12Resource *textur
release_resource_readback(&rb);
}
-#define check_sub_resource_vec4(a, b, c, d, e, f) check_sub_resource_vec4_(__LINE__, a, b, c, d, e, f)
-static void check_sub_resource_vec4_(unsigned int line, ID3D12Resource *texture,
- unsigned int sub_resource_idx, ID3D12CommandQueue *queue, ID3D12GraphicsCommandList *command_list,
- const struct vec4 *expected, unsigned int max_diff)
-{
- struct resource_readback rb;
- unsigned int x = 0, y;
- bool all_match = true;
- struct vec4 got = {0};
-
- get_texture_readback_with_command_list(texture, sub_resource_idx, &rb, queue, command_list);
- for (y = 0; y < rb.height; ++y)
- {
- for (x = 0; x < rb.width; ++x)
- {
- got = *get_readback_vec4(&rb, x, y);
- if (!compare_vec4(&got, expected, max_diff))
- {
- all_match = false;
- break;
- }
- }
- if (!all_match)
- break;
- }
- release_resource_readback(&rb);
-
- ok_(line)(all_match, "Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e} at (%u, %u).\n",
- got.x, got.y, got.z, got.w, expected->x, expected->y, expected->z, expected->w, x, y);
-}
-
#define check_sub_resource_uvec4(a, b, c, d, e) check_sub_resource_uvec4_(__LINE__, a, b, c, d, e)
static void check_sub_resource_uvec4_(unsigned int line, ID3D12Resource *texture,
unsigned int sub_resource_idx, ID3D12CommandQueue *queue, ID3D12GraphicsCommandList *command_list,
@@ -750,33 +676,6 @@ static ID3D12RootSignature *create_cb_root_signature_(unsigned int line,
return root_signature;
}
-#define create_32bit_constants_root_signature(a, b, c, e) \
- create_32bit_constants_root_signature_(__LINE__, a, b, c, e, 0)
-static ID3D12RootSignature *create_32bit_constants_root_signature_(unsigned int line,
- ID3D12Device *device, unsigned int reg_idx, unsigned int element_count,
- D3D12_SHADER_VISIBILITY shader_visibility, D3D12_ROOT_SIGNATURE_FLAGS flags)
-{
- D3D12_ROOT_SIGNATURE_DESC root_signature_desc;
- ID3D12RootSignature *root_signature = NULL;
- D3D12_ROOT_PARAMETER root_parameter;
- HRESULT hr;
-
- root_parameter.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
- root_parameter.Constants.ShaderRegister = reg_idx;
- root_parameter.Constants.RegisterSpace = 0;
- root_parameter.Constants.Num32BitValues = element_count;
- root_parameter.ShaderVisibility = shader_visibility;
-
- memset(&root_signature_desc, 0, sizeof(root_signature_desc));
- root_signature_desc.NumParameters = 1;
- root_signature_desc.pParameters = &root_parameter;
- root_signature_desc.Flags = flags;
- hr = create_root_signature(device, &root_signature_desc, &root_signature);
- ok_(line)(SUCCEEDED(hr), "Failed to create root signature, hr %#x.\n", hr);
-
- return root_signature;
-}
-
#define create_texture_root_signature(a, b, c, d) create_texture_root_signature_(__LINE__, a, b, c, d, NULL)
static ID3D12RootSignature *create_texture_root_signature_(unsigned int line,
ID3D12Device *device, D3D12_SHADER_VISIBILITY shader_visibility,
diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h
index 7ff835ad..f7a31804 100644
--- a/tests/d3d12_crosstest.h
+++ b/tests/d3d12_crosstest.h
@@ -46,6 +46,7 @@ typedef int HRESULT;
#define WIDL_C_INLINE_WRAPPERS
#include "vkd3d_d3d12.h"
#include "vkd3d_d3d12sdklayers.h"
+#include "vkd3d_d3dcompiler.h"
#include <inttypes.h>
#include <limits.h>
diff --git a/tests/d3d12_test_utils.h b/tests/d3d12_test_utils.h
index e4c8e586..ece48966 100644
--- a/tests/d3d12_test_utils.h
+++ b/tests/d3d12_test_utils.h
@@ -19,6 +19,11 @@
#ifndef __VKD3D_D3D12_TEST_UTILS_H
#define __VKD3D_D3D12_TEST_UTILS_H
+struct vec4
+{
+ float x, y, z, w;
+};
+
#define wait_queue_idle(a, b) wait_queue_idle_(__LINE__, a, b)
static void wait_queue_idle_(unsigned int line, ID3D12Device *device, ID3D12CommandQueue *queue);
static ID3D12Device *create_device(void);
@@ -53,6 +58,31 @@ static void set_viewport(D3D12_VIEWPORT *vp, float x, float y,
vp->MaxDepth = max_depth;
}
+static bool compare_float(float f, float g, unsigned int ulps)
+{
+ int x, y;
+ union
+ {
+ float f;
+ int i;
+ } u;
+
+ u.f = f;
+ x = u.i;
+ u.f = g;
+ y = u.i;
+
+ if (x < 0)
+ x = INT_MIN - x;
+ if (y < 0)
+ y = INT_MIN - y;
+
+ if (abs(x - y) > ulps)
+ return false;
+
+ return true;
+}
+
static bool compare_uint(unsigned int x, unsigned int y, unsigned int max_diff)
{
unsigned int diff = x > y ? x - y : y - x;
@@ -68,6 +98,14 @@ static bool compare_color(DWORD c1, DWORD c2, BYTE max_diff)
&& compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff);
}
+static bool compare_vec4(const struct vec4 *v1, const struct vec4 *v2, unsigned int ulps)
+{
+ return compare_float(v1->x, v2->x, ulps)
+ && compare_float(v1->y, v2->y, ulps)
+ && compare_float(v1->z, v2->z, ulps)
+ && compare_float(v1->w, v2->w, ulps);
+}
+
static D3D12_SHADER_BYTECODE shader_bytecode(const DWORD *code, size_t size)
{
D3D12_SHADER_BYTECODE shader_bytecode = { code, size };
@@ -501,6 +539,11 @@ static unsigned int get_readback_uint(struct resource_readback *rb,
return *(unsigned int *)get_readback_data(rb, x, y, z, sizeof(unsigned int));
}
+static const struct vec4 *get_readback_vec4(struct resource_readback *rb, unsigned int x, unsigned int y)
+{
+ return get_readback_data(rb, x, y, 0, sizeof(struct vec4));
+}
+
static void release_resource_readback(struct resource_readback *rb)
{
D3D12_RANGE range = {0, 0};
@@ -554,6 +597,37 @@ static inline void check_sub_resource_uint_(unsigned int line, ID3D12Resource *t
release_resource_readback(&rb);
}
+#define check_sub_resource_vec4(a, b, c, d, e, f) check_sub_resource_vec4_(__LINE__, a, b, c, d, e, f)
+static inline void check_sub_resource_vec4_(unsigned int line, ID3D12Resource *texture,
+ unsigned int sub_resource_idx, ID3D12CommandQueue *queue, ID3D12GraphicsCommandList *command_list,
+ const struct vec4 *expected, unsigned int max_diff)
+{
+ struct resource_readback rb;
+ unsigned int x = 0, y;
+ bool all_match = true;
+ struct vec4 got = {0};
+
+ get_texture_readback_with_command_list(texture, sub_resource_idx, &rb, queue, command_list);
+ for (y = 0; y < rb.height; ++y)
+ {
+ for (x = 0; x < rb.width; ++x)
+ {
+ got = *get_readback_vec4(&rb, x, y);
+ if (!compare_vec4(&got, expected, max_diff))
+ {
+ all_match = false;
+ break;
+ }
+ }
+ if (!all_match)
+ break;
+ }
+ release_resource_readback(&rb);
+
+ ok_(line)(all_match, "Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e} at (%u, %u).\n",
+ got.x, got.y, got.z, got.w, expected->x, expected->y, expected->z, expected->w, x, y);
+}
+
#define create_default_buffer(a, b, c, d) create_default_buffer_(__LINE__, a, b, c, d)
static inline ID3D12Resource *create_default_buffer_(unsigned int line, ID3D12Device *device,
size_t size, D3D12_RESOURCE_FLAGS resource_flags, D3D12_RESOURCE_STATES initial_resource_state)
@@ -595,7 +669,7 @@ static ID3D12Resource *create_default_texture_(unsigned int line, ID3D12Device *
#define create_default_texture(a, b, c, d, e, f) create_default_texture2d_(__LINE__, a, b, c, 1, 1, d, e, f)
#define create_default_texture2d(a, b, c, d, e, f, g, h) create_default_texture2d_(__LINE__, a, b, c, d, e, f, g, h)
-static ID3D12Resource *create_default_texture2d_(unsigned int line, ID3D12Device *device,
+static inline ID3D12Resource *create_default_texture2d_(unsigned int line, ID3D12Device *device,
unsigned int width, unsigned int height, unsigned int array_size, unsigned int miplevel_count,
DXGI_FORMAT format, D3D12_RESOURCE_FLAGS flags, D3D12_RESOURCE_STATES initial_state)
{
@@ -646,6 +720,33 @@ static ID3D12RootSignature *create_empty_root_signature_(unsigned int line,
return root_signature;
}
+#define create_32bit_constants_root_signature(a, b, c, e) \
+ create_32bit_constants_root_signature_(__LINE__, a, b, c, e, 0)
+static inline ID3D12RootSignature *create_32bit_constants_root_signature_(unsigned int line,
+ ID3D12Device *device, unsigned int reg_idx, unsigned int element_count,
+ D3D12_SHADER_VISIBILITY shader_visibility, D3D12_ROOT_SIGNATURE_FLAGS flags)
+{
+ D3D12_ROOT_SIGNATURE_DESC root_signature_desc;
+ ID3D12RootSignature *root_signature = NULL;
+ D3D12_ROOT_PARAMETER root_parameter;
+ HRESULT hr;
+
+ root_parameter.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
+ root_parameter.Constants.ShaderRegister = reg_idx;
+ root_parameter.Constants.RegisterSpace = 0;
+ root_parameter.Constants.Num32BitValues = element_count;
+ root_parameter.ShaderVisibility = shader_visibility;
+
+ memset(&root_signature_desc, 0, sizeof(root_signature_desc));
+ root_signature_desc.NumParameters = 1;
+ root_signature_desc.pParameters = &root_parameter;
+ root_signature_desc.Flags = flags;
+ hr = create_root_signature(device, &root_signature_desc, &root_signature);
+ ok_(line)(SUCCEEDED(hr), "Failed to create root signature, hr %#x.\n", hr);
+
+ return root_signature;
+}
+
static void init_pipeline_state_desc(D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc,
ID3D12RootSignature *root_signature, DXGI_FORMAT rt_format,
const D3D12_SHADER_BYTECODE *vs, const D3D12_SHADER_BYTECODE *ps,
diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c
new file mode 100644
index 00000000..f323a547
--- /dev/null
+++ b/tests/shader_runner_d3d12.c
@@ -0,0 +1,300 @@
+/*
+ * Copyright 2020 Zebediah Figura 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
+ */
+
+/*
+ * This application contains code derived from piglit, the license for which
+ * follows:
+ *
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "d3d12_crosstest.h"
+#include <errno.h>
+
+static bool vkd3d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size)
+{
+ size_t new_capacity, max_capacity;
+ void *new_elements;
+
+ if (element_count <= *capacity)
+ return true;
+
+ max_capacity = ~(size_t)0 / element_size;
+ if (max_capacity < element_count)
+ return false;
+
+ new_capacity = max(*capacity, 4);
+ while (new_capacity < element_count && new_capacity <= max_capacity / 2)
+ new_capacity *= 2;
+
+ if (new_capacity < element_count)
+ new_capacity = element_count;
+
+ if (!(new_elements = realloc(*elements, new_capacity * element_size)))
+ return false;
+
+ *elements = new_elements;
+ *capacity = new_capacity;
+
+ return true;
+}
+
+struct shader_context
+{
+ struct test_context c;
+
+ ID3D10Blob *ps_code;
+
+ uint32_t *uniforms;
+ size_t uniform_count;
+};
+
+static ID3D10Blob *compile_shader(const char *source, const char *target)
+{
+ ID3D10Blob *blob = NULL, *errors = NULL;
+ HRESULT hr;
+
+ hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", target, 0, 0, &blob, &errors);
+ ok(hr == S_OK, "Failed to compile shader, hr %#x.\n", hr);
+ if (errors)
+ {
+ if (vkd3d_test_state.debug_level)
+ trace("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors));
+ ID3D10Blob_Release(errors);
+ }
+ return blob;
+}
+
+enum parse_state
+{
+ STATE_NONE,
+ STATE_SHADER_PIXEL,
+ STATE_TEST,
+};
+
+static bool match_string(const char *line, const char *token, const char **const rest)
+{
+ size_t len = strlen(token);
+
+ if (strncmp(line, token, len) || !isspace(line[len]))
+ return false;
+ if (rest)
+ {
+ *rest = line + len;
+ while (isspace(**rest))
+ ++*rest;
+ }
+ return true;
+}
+
+static void parse_test_directive(struct shader_context *context, const char *line)
+{
+ const char *const orig_line = line;
+
+ if (match_string(line, "draw quad", &line))
+ {
+ D3D12_SHADER_BYTECODE ps
+ = {ID3D10Blob_GetBufferPointer(context->ps_code), ID3D10Blob_GetBufferSize(context->ps_code)};
+ ID3D12GraphicsCommandList *command_list = context->c.list;
+ static const float clear_color[4];
+ ID3D12PipelineState *pso;
+
+ context->c.root_signature = create_32bit_constants_root_signature(context->c.device,
+ 0, context->uniform_count, D3D12_SHADER_VISIBILITY_ALL);
+
+ pso = create_pipeline_state(context->c.device, context->c.root_signature,
+ context->c.render_target_desc.Format, NULL, &ps, NULL);
+
+ ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context->c.root_signature);
+ ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstants(command_list, 0,
+ context->uniform_count, context->uniforms, 0);
+ ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context->c.rtv, false, NULL);
+ ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context->c.scissor_rect);
+ ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context->c.viewport);
+ ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+ ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context->c.rtv, clear_color, 0, NULL);
+ ID3D12GraphicsCommandList_SetPipelineState(command_list, pso);
+ ID3D12GraphicsCommandList_DrawInstanced(command_list, 3, 1, 0, 0);
+ ID3D12PipelineState_Release(pso);
+ transition_resource_state(command_list, context->c.render_target,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ }
+ else if (match_string(line, "probe all rgba", &line))
+ {
+ unsigned int ulps;
+ struct vec4 v;
+ int ret;
+
+ ret = sscanf(line, "( %f , %f , %f , %f ) %u", &v.x, &v.y, &v.z, &v.w, &ulps);
+ if (ret < 4)
+ goto err;
+ if (ret < 5)
+ ulps = 0;
+ check_sub_resource_vec4(context->c.render_target, 0, context->c.queue, context->c.list, &v, ulps);
+ reset_command_list(context->c.list, context->c.allocator);
+ }
+ else if (match_string(line, "uniform", &line))
+ {
+ unsigned int offset;
+
+ if (!sscanf(line, "%u", &offset))
+ goto err;
+ line = strchr(line, ' ') + 1;
+
+ if (match_string(line, "float4", &line))
+ {
+ struct vec4 v;
+
+ if (sscanf(line, "%f %f %f %f", &v.x, &v.y, &v.z, &v.w) < 4)
+ goto err;
+ if (offset + 4 > context->uniform_count)
+ {
+ context->uniform_count = offset + 4;
+ context->uniforms = realloc(context->uniforms, context->uniform_count * sizeof(*context->uniforms));
+ }
+ memcpy(context->uniforms + offset, &v, sizeof(v));
+ }
+ }
+ else
+ {
+ goto err;
+ }
+
+ return;
+
+err:
+ fprintf(stderr, "Ignoring malformed line '%s'.\n", orig_line);
+}
+
+START_TEST(shader_runner_d3d12)
+{
+ static const struct test_context_desc desc =
+ {
+ .no_root_signature = true,
+ .rt_format = DXGI_FORMAT_R32G32B32A32_FLOAT,
+ };
+ size_t shader_source_size = 0, shader_source_len = 0;
+ enum parse_state state = STATE_NONE;
+ struct shader_context context;
+ const char *filename = NULL;
+ char *shader_source = NULL;
+ unsigned int i;
+ char line[256];
+ FILE *f;
+
+ parse_args(argc, argv);
+ enable_d3d12_debug_layer(argc, argv);
+ init_adapter_info();
+
+ for (i = 1; i < argc; ++i)
+ {
+ if (argv[i][0] != '-')
+ {
+ filename = argv[i];
+ break;
+ }
+ }
+
+ if (!filename)
+ {
+ fprintf(stderr, "Usage: %s [file]\n", argv[0]);
+ return;
+ }
+
+ if (!(f = fopen(filename, "r")))
+ {
+ fprintf(stderr, "Unable to open '%s' for reading: %s\n", argv[1], strerror(errno));
+ return;
+ }
+
+ memset(&context, 0, sizeof(context));
+ init_test_context(&context.c, &desc);
+
+ while (fgets(line, sizeof(line), f))
+ {
+ if (line[0] == '[')
+ {
+ switch (state)
+ {
+ case STATE_NONE:
+ case STATE_TEST:
+ break;
+
+ case STATE_SHADER_PIXEL:
+ if (!(context.ps_code = compile_shader(shader_source, "ps_4_0")))
+ return;
+ shader_source_len = 0;
+ break;
+ }
+
+ if (!strcmp(line, "[pixel shader]\n"))
+ state = STATE_SHADER_PIXEL;
+ else if (!strcmp(line, "[test]\n"))
+ state = STATE_TEST;
+ }
+ else
+ {
+ switch (state)
+ {
+ case STATE_NONE:
+ if (line[0] != '#')
+ fprintf(stderr, "Ignoring line '%s' in %s.\n", line, argv[1]);
+ break;
+
+ case STATE_SHADER_PIXEL:
+ {
+ size_t len = strlen(line);
+
+ vkd3d_array_reserve((void **)&shader_source, &shader_source_size, shader_source_len + len + 1, 1);
+ memcpy(shader_source + shader_source_len, line, len + 1);
+ shader_source_len += len;
+ break;
+ }
+
+ case STATE_TEST:
+ if (line[0] != '#')
+ parse_test_directive(&context, line);
+ break;
+ }
+ }
+ }
+
+ ID3D10Blob_Release(context.ps_code);
+ destroy_test_context(&context.c);
+
+ fclose(f);
+}
--
2.28.0
2
9
[PATCH vkd3d] vkd3d-shader: Correct an off-by-one error when comparing against ARRAY_SIZE.
by Zebediah Figura Oct. 1, 2020
by Zebediah Figura Oct. 1, 2020
Oct. 1, 2020
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
libs/vkd3d-shader/trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c
index 9ff18e77..a510f3a2 100644
--- a/libs/vkd3d-shader/trace.c
+++ b/libs/vkd3d-shader/trace.c
@@ -520,7 +520,7 @@ static void shader_dump_resource_type(struct vkd3d_string_buffer *buffer, enum v
/* VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY */ "texturecubearray",
};
- if (type <= ARRAY_SIZE(resource_type_names))
+ if (type < ARRAY_SIZE(resource_type_names))
shader_addline(buffer, "%s", resource_type_names[type]);
else
shader_addline(buffer, "unknown");
--
2.28.0
2
1
Oct. 1, 2020
IP Address controls (SysIPAddress32) should set focus to the edit box
upon WM_SETFOCUS.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49924
Signed-off-by: Hirofumi Katayama <katayama.hirofumi.mz(a)gmail.com>
---
https://github.com/reactos/reactos/commit/0733d96d9d90337c9c0537c0406650c9a…
https://jira.reactos.org/browse/CORE-3479
1
0
[PATCH v2 1/8] user32/tests: Add concurrency tests for SetForegroundWindow.
by Rémi Bernon Oct. 1, 2020
by Rémi Bernon Oct. 1, 2020
Oct. 1, 2020
When calling SetForegroundWindow for a window in another thread, an
internal message is posted to the thread's message queue.
If this thread then calls SetForegroundWindow before processing its
messages it will execute the corresponding set_active_window first,
but then overwrite the active window later, when processing its internal
messages.
This is not always the correct behavior and these tests help determine
what should actually be done in various situations.
This aims to check the following sequences, with A being a separate
thread that created three windows, and B being the main test thread
with some windows initially in background:
* window A0, A1, or A2 is foreground, then:
* B sets foreground to window A0
* A sets foreground to window A1
As well as these sequences where foreground is also temporarily switched
to window B0:
* window A0, A1, or A2 is foreground, then:
* B sets foreground to window B0
* B sets foreground to window A0
* B sets foreground to window B0
* A sets foreground to window A1
In addition, we also do tests with additional SetActiveWindow / SetFocus
calls to check their influence.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
Another try at this. Back to message filtering, as it's a more generic
solution than last time counter.
It still needs to be able to filter these internal messages so we have
to change get_message request handler a bit. We don't provide any way
to specifically remove messages though.
v2: * Remove cross-process test and the related debugger patch, the
results are the same as cross-thread.
* Trace counted messages in the test so we can compare traces, add
more test traces too.
* Send a WM_USER message too, to validate that we shouldn't process
sent messages while filtering internal messages.
* Filter internal WM_WINE_SETACTIVEWINDOW messages using a thread
local flag and a call to peek_message.
* Add a fix for the additional focus messages received when calling
SetFocus, even if the window already has focus, fixing the last
remaining todo in the test.
Supersedes: 191845-191849
dlls/user32/tests/win.c | 290 +++++++++++++++++++++++++++++++++-------
1 file changed, 238 insertions(+), 52 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 843da8900f1..bbc3fbfb1d9 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3240,40 +3240,180 @@ static void test_SetActiveWindow(HWND hwnd)
DestroyWindow(hwnd2);
}
-struct create_window_thread_params
+static int test_sfw_msg_count;
+
+static LRESULT WINAPI test_sfw_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
- HWND window;
- HANDLE window_created;
- HANDLE test_finished;
+ switch (msg)
+ {
+ case WM_NCACTIVATE: trace("%p WM_NCACTIVATE %d %p\n", hwnd, (DWORD)wparam, (HWND)lparam); test_sfw_msg_count++; break;
+ case WM_ACTIVATE: trace("%p WM_ACTIVATE %d %p\n", hwnd, (DWORD)wparam, (HWND)lparam); test_sfw_msg_count++; break;
+ case WM_SETFOCUS: trace("%p WM_SETFOCUS %p %d\n", hwnd, (HWND)wparam, (DWORD)lparam); test_sfw_msg_count++; break;
+ case WM_KILLFOCUS: trace("%p WM_KILLFOCUS %p %d\n", hwnd, (HWND)wparam, (DWORD)lparam); test_sfw_msg_count++; break;
+ case WM_USER: trace("%p WM_USER %d %d\n", hwnd, (DWORD)wparam, (DWORD)lparam); test_sfw_msg_count++; break;
+ }
+
+ return DefWindowProcA( hwnd, msg, wparam, lparam );
+}
+
+struct test_sfw_test_desc
+{
+ int initial_window;
+ BOOL steal_foreground;
+ BOOL call_set_active_window;
+ BOOL call_set_focus;
+
+ BOOL todo_msgcount_before_set_foreground;
+ int msgcount_before_set_foreground;
+ BOOL todo_msgcount_after_set_foreground;
+ int msgcount_after_set_foreground;
+ BOOL todo_msgcount_after_peek_message;
+ int msgcount_after_peek_message;
+ BOOL todo_expected_window;
+ int expected_window;
+};
+
+static struct test_sfw_test_desc test_sfw_tests[] = {
+ {1, FALSE, FALSE, FALSE, FALSE, 0, FALSE, 0, FALSE, 7, FALSE, 0},
+ {1, TRUE, FALSE, FALSE, FALSE, 0, TRUE, 1, TRUE, 7, TRUE, 0},
+ {1, FALSE, TRUE, FALSE, FALSE, 0, FALSE, 0, FALSE, 7, FALSE, 0},
+ {1, TRUE, TRUE, FALSE, FALSE, 0, TRUE, 1, TRUE, 7, TRUE, 0},
+ {1, FALSE, FALSE, TRUE, FALSE, 0, FALSE, 0, FALSE, 7, FALSE, 0},
+ {1, TRUE, FALSE, TRUE, FALSE, 0, TRUE, 1, TRUE, 7, TRUE, 0},
+
+ {2, FALSE, FALSE, FALSE, FALSE, 0, FALSE, 6, TRUE, 1, TRUE, 1},
+ {2, TRUE, FALSE, FALSE, FALSE, 0, FALSE, 6, TRUE, 1, TRUE, 1},
+ {2, FALSE, TRUE, FALSE, FALSE, 6, FALSE, 0, TRUE, 1, TRUE, 1},
+ {2, TRUE, TRUE, FALSE, FALSE, 6, TRUE, 1, TRUE, 7, TRUE, 0},
+ {2, FALSE, FALSE, TRUE, TRUE, 8, FALSE, 0, TRUE, 1, TRUE, 1},
+ {2, TRUE, FALSE, TRUE, TRUE, 8, TRUE, 1, TRUE, 7, TRUE, 0},
+
+ {0, FALSE, FALSE, FALSE, FALSE, 0, FALSE, 6, FALSE, 1, FALSE, 1},
+ {0, TRUE, FALSE, FALSE, FALSE, 0, FALSE, 6, TRUE, 1, TRUE, 1},
+ {0, FALSE, TRUE, FALSE, FALSE, 6, FALSE, 0, FALSE, 1, FALSE, 1},
+ {0, TRUE, TRUE, FALSE, FALSE, 6, TRUE, 1, FALSE, 7, FALSE, 0},
+ {0, FALSE, FALSE, TRUE, TRUE, 8, FALSE, 0, FALSE, 1, FALSE, 1},
+ {0, TRUE, FALSE, TRUE, TRUE, 8, TRUE, 1, FALSE, 7, FALSE, 0},
};
-static DWORD WINAPI create_window_thread(void *param)
+static DWORD WINAPI test_sfw_thread( void *param )
{
- struct create_window_thread_params *p = param;
+ HANDLE test_sfw_ready, test_sfw_start, test_sfw_done;
+ WNDPROC wndprocs[3];
+ HWND windows[3];
DWORD res;
BOOL ret;
+ MSG msg;
+ int i;
+
+ test_sfw_ready = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_sfw_ready" );
+ test_sfw_start = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_sfw_start" );
+ test_sfw_done = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_sfw_done" );
- p->window = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
+ windows[1] = CreateWindowA( "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0 );
+ windows[2] = CreateWindowA( "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0 );
+ windows[0] = CreateWindowA( "static", "test_sfw_window", WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0 );
+ trace( "window[0]:%p windows[1]:%p windows[2]:%p\n", windows[0], windows[1], windows[2] );
- ret = SetEvent(p->window_created);
+ ret = SetEvent( test_sfw_ready );
ok(ret, "SetEvent failed, last error %#x.\n", GetLastError());
- res = WaitForSingleObject(p->test_finished, INFINITE);
+ /* wait for the initial state to be clean */
+
+ res = WaitForSingleObject( test_sfw_start, INFINITE );
ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
+ ret = ResetEvent( test_sfw_start );
+ ok( ret, "ResetEvent failed, last error %#x.\n", GetLastError() );
+
+ for (i = 0; i < ARRAY_SIZE(windows); ++i)
+ wndprocs[i] = (WNDPROC)SetWindowLongPtrA( windows[i], GWLP_WNDPROC, (LONG_PTR)test_sfw_wndproc );
+
+ flush_events( TRUE );
+
+ for (i = 0; i < ARRAY_SIZE(test_sfw_tests); ++i)
+ {
+ struct test_sfw_test_desc *test = test_sfw_tests + i;
+ HWND initial_window = windows[test->initial_window];
+ HWND expected_window = windows[test->expected_window];
+ trace( "running test %d\n", i );
+
+ SetForegroundWindow( initial_window );
+ flush_events( TRUE );
+ check_wnd_state( initial_window, initial_window, initial_window, 0 );
+
+ ret = SetEvent( test_sfw_ready );
+ ok( ret, "SetEvent failed, last error %#x.\n", GetLastError() );
+
+ res = WaitForSingleObject( test_sfw_start, INFINITE );
+ ok( res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError() );
+ ret = ResetEvent( test_sfw_start );
+ ok( ret, "ResetEvent failed, last error %#x.\n", GetLastError() );
+
+ test_sfw_msg_count = 0;
+ trace( "%d: before SetForegroundWindow\n", i );
+ if (test->call_set_active_window) SetActiveWindow( windows[1] );
+ if (test->call_set_focus) SetFocus( windows[1] );
+ todo_wine_if( test->todo_msgcount_before_set_foreground )
+ ok( test_sfw_msg_count == test->msgcount_before_set_foreground,
+ "%d: Unexpected number of messages received before SetForegroundWindow: %d\n", i, test_sfw_msg_count );
+
+ test_sfw_msg_count = 0;
+ trace( "%d: calling SetForegroundWindow\n", i );
+ SetForegroundWindow( windows[1] );
+ todo_wine_if( test->todo_msgcount_after_set_foreground )
+ ok( test_sfw_msg_count == test->msgcount_after_set_foreground,
+ "%d: Unexpected number of messages received after SetForegroundWindow: %d\n", i, test_sfw_msg_count );
+
+ ok( GetForegroundWindow() == windows[1], "%d: GetForegroundWindow() returned %p\n", i,
+ GetForegroundWindow() );
+ ok( GetActiveWindow() == windows[1], "%d: GetActiveWindow() returned %p\n", i, GetActiveWindow() );
+ ok( GetFocus() == windows[1], "%d: GetFocus() returned %p\n", i, GetFocus() );
+
+ test_sfw_msg_count = 0;
+ trace( "%d: calling PeekMessageA\n", i );
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
+ todo_wine_if( test->todo_msgcount_after_peek_message )
+ ok( test_sfw_msg_count == test->msgcount_after_peek_message,
+ "%d: Unexpected number of messages received after PeekMessageA: %d\n", i, test_sfw_msg_count );
+
+ todo_wine_if( test->todo_expected_window )
+ ok( GetForegroundWindow() == expected_window, "%d: GetForegroundWindow() returned %p\n", i,
+ GetForegroundWindow() );
+ todo_wine_if( test->todo_expected_window )
+ ok( GetActiveWindow() == expected_window, "%d: GetActiveWindow() returned %p\n", i, GetActiveWindow() );
+ todo_wine_if( test->todo_expected_window )
+ ok( GetFocus() == expected_window, "%d: GetFocus() returned %p\n", i, GetFocus() );
+ trace( "%d: done\n", i );
+
+ res = WaitForSingleObject( test_sfw_done, INFINITE );
+ ok( res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError() );
+ ret = ResetEvent( test_sfw_done );
+ ok( ret, "ResetEvent failed, last error %#x.\n", GetLastError() );
+ }
+
+ for (i = 0; i < ARRAY_SIZE(windows); ++i)
+ SetWindowLongPtrA( windows[i], GWLP_WNDPROC, (LONG_PTR)wndprocs[i] );
+
+ for (i = 0; i < ARRAY_SIZE(windows); ++i) DestroyWindow( windows[i] );
+
+ CloseHandle( test_sfw_ready );
+ CloseHandle( test_sfw_start );
+ CloseHandle( test_sfw_done );
- DestroyWindow(p->window);
return 0;
}
-static void test_SetForegroundWindow(HWND hwnd)
+static void test_SetForegroundWindow( HWND hwnd )
{
- struct create_window_thread_params thread_params;
- HANDLE thread;
+ HANDLE thread = 0;
+ HANDLE test_sfw_ready, test_sfw_start, test_sfw_done;
DWORD res, tid;
- BOOL ret;
+ HWND test_sfw_window;
HWND hwnd2;
- MSG msg;
LONG style;
+ BOOL ret;
+ MSG msg;
+ int i;
flush_events( TRUE );
ShowWindow(hwnd, SW_HIDE);
@@ -3347,50 +3487,96 @@ static void test_SetForegroundWindow(HWND hwnd)
DestroyWindow(hwnd2);
check_wnd_state(hwnd, hwnd, hwnd, 0);
- hwnd2 = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
- check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
+ hwnd2 = CreateWindowA( "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0 );
+ check_wnd_state( hwnd2, hwnd2, hwnd2, 0 );
- thread_params.window_created = CreateEventW(NULL, FALSE, FALSE, NULL);
- ok(!!thread_params.window_created, "CreateEvent failed, last error %#x.\n", GetLastError());
- thread_params.test_finished = CreateEventW(NULL, FALSE, FALSE, NULL);
- ok(!!thread_params.test_finished, "CreateEvent failed, last error %#x.\n", GetLastError());
- thread = CreateThread(NULL, 0, create_window_thread, &thread_params, 0, &tid);
- ok(!!thread, "Failed to create thread, last error %#x.\n", GetLastError());
- res = WaitForSingleObject(thread_params.window_created, INFINITE);
- ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
- check_wnd_state(hwnd2, thread_params.window, hwnd2, 0);
+ test_sfw_ready = CreateEventA( NULL, FALSE, FALSE, "test_sfw_ready" );
+ ok( !!test_sfw_ready, "CreateEvent failed, last error %#x.\n", GetLastError() );
+ test_sfw_start = CreateEventA( NULL, FALSE, FALSE, "test_sfw_start" );
+ ok( !!test_sfw_start, "CreateEvent failed, last error %#x.\n", GetLastError() );
+ test_sfw_done = CreateEventA( NULL, FALSE, FALSE, "test_sfw_done" );
+ ok( !!test_sfw_done, "CreateEvent failed, last error %#x.\n", GetLastError() );
- SetForegroundWindow(hwnd2);
- check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
+ thread = CreateThread( NULL, 0, test_sfw_thread, NULL, 0, &tid );
+ ok( !!thread, "Failed to create thread, last error %#x.\n", GetLastError() );
- while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
- if (0) check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
+ res = WaitForSingleObject( test_sfw_ready, INFINITE );
+ ok( res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError() );
+ ret = ResetEvent( test_sfw_ready );
+ ok( ret, "ResetEvent failed, last error %#x.\n", GetLastError() );
+
+ test_sfw_window = FindWindowA( "static", "test_sfw_window" );
+ ok( test_sfw_window != NULL, "FindWindowA failed to find test window, last error %#x\n", GetLastError() );
+ check_wnd_state( hwnd2, test_sfw_window, hwnd2, 0 );
+
+ /* ensure initial state is consistent, with hwnd as active / foreground / focus window */
+
+ SetForegroundWindow( hwnd2 );
+ check_wnd_state( hwnd2, hwnd2, hwnd2, 0 );
+
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
+ if (0) check_wnd_state( hwnd2, hwnd2, hwnd2, 0 );
/* FIXME: these tests are failing because of a race condition
- * between internal focus state applied immediately and X11 focus
- * message coming late */
- todo_wine ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow());
- todo_wine ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus());
+ * between internal process focus state applied immediately and
+ * X11 focus message coming late */
+ todo_wine
+ ok( GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow() );
+ todo_wine
+ ok( GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus() );
- SetForegroundWindow(hwnd);
- check_wnd_state(hwnd, hwnd, hwnd, 0);
- style = GetWindowLongA(hwnd2, GWL_STYLE) | WS_CHILD;
- ok(SetWindowLongA(hwnd2, GWL_STYLE, style), "SetWindowLong failed\n");
- ok(SetForegroundWindow(hwnd2), "SetForegroundWindow failed\n");
- check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
+ SetForegroundWindow( hwnd );
+ check_wnd_state( hwnd, hwnd, hwnd, 0 );
+ style = GetWindowLongA( hwnd2, GWL_STYLE ) | WS_CHILD;
+ ok( SetWindowLongA( hwnd2, GWL_STYLE, style ), "SetWindowLong failed\n" );
+ ok( SetForegroundWindow( hwnd2 ), "SetForegroundWindow failed\n" );
+ check_wnd_state( hwnd2, hwnd2, hwnd2, 0 );
- SetForegroundWindow(hwnd);
- check_wnd_state(hwnd, hwnd, hwnd, 0);
- ok(SetWindowLongA(hwnd2, GWL_STYLE, style & (~WS_POPUP)), "SetWindowLong failed\n");
- ok(!SetForegroundWindow(hwnd2), "SetForegroundWindow failed\n");
- check_wnd_state(hwnd, hwnd, hwnd, 0);
+ SetForegroundWindow( hwnd );
+ check_wnd_state( hwnd, hwnd, hwnd, 0 );
+ ok( SetWindowLongA( hwnd2, GWL_STYLE, style & (~WS_POPUP) ), "SetWindowLong failed\n" );
+ ok( !SetForegroundWindow( hwnd2 ), "SetForegroundWindow failed\n" );
+ check_wnd_state( hwnd, hwnd, hwnd, 0 );
- SetEvent(thread_params.test_finished);
- WaitForSingleObject(thread, INFINITE);
- CloseHandle(thread_params.test_finished);
- CloseHandle(thread_params.window_created);
- CloseHandle(thread);
- DestroyWindow(hwnd2);
+ res = SetEvent( test_sfw_start );
+ ok( res, "SetEvent failed, last error %#x.\n", GetLastError() );
+
+ /* now run the tests */
+
+ for (i = 0; i < ARRAY_SIZE(test_sfw_tests); ++i)
+ {
+ struct test_sfw_test_desc *test = test_sfw_tests + i;
+
+ while (MsgWaitForMultipleObjects( 1, &test_sfw_ready, FALSE, INFINITE, QS_SENDMESSAGE ) != WAIT_OBJECT_0)
+ {
+ while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE ))
+ DispatchMessageA( &msg );
+ }
+
+ ret = ResetEvent( test_sfw_ready );
+ ok( ret, "ResetEvent failed, last error %#x.\n", GetLastError() );
+
+ if (test->steal_foreground) SetForegroundWindow( hwnd );
+ SetForegroundWindow( test_sfw_window );
+ if (test->steal_foreground) SetForegroundWindow( hwnd );
+ SendNotifyMessageW( test_sfw_window, WM_USER, 0, 0 );
+
+ res = SetEvent( test_sfw_start );
+ ok( res, "SetEvent failed, last error %#x.\n", GetLastError() );
+
+ ret = SetEvent( test_sfw_done );
+ ok( res, "SetEvent failed, last error %#x.\n", GetLastError() );
+ }
+
+ WaitForSingleObject( thread, INFINITE );
+ CloseHandle( thread );
+
+ CloseHandle( test_sfw_start );
+ CloseHandle( test_sfw_done );
+ CloseHandle( test_sfw_ready );
+
+ DestroyWindow( hwnd2 );
+ flush_events( TRUE );
}
static WNDPROC old_button_proc;
@@ -12040,7 +12226,7 @@ START_TEST(win)
test_Expose();
test_layered_window();
- test_SetForegroundWindow(hwndMain);
+ test_SetForegroundWindow( hwndMain );
test_handles( hwndMain );
test_winregion();
test_map_points();
--
2.28.0
2
15