Wine-Devel
Threads by month
- ----- 2026 -----
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
November 2019
- 85 participants
- 778 discussions
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/strmbase/transform.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index f4c2c4be72..608ccc55d2 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -29,11 +29,6 @@ static const WCHAR wcsOutputPinName[] = {'O','u','t',0};
static const IPinVtbl TransformFilter_InputPin_Vtbl;
static const IPinVtbl TransformFilter_OutputPin_Vtbl;
-static inline TransformFilter *impl_from_IBaseFilter( IBaseFilter *iface )
-{
- return CONTAINING_RECORD(iface, TransformFilter, filter.IBaseFilter_iface);
-}
-
static inline TransformFilter *impl_from_strmbase_filter(struct strmbase_filter *iface)
{
return CONTAINING_RECORD(iface, TransformFilter, filter);
--
2.24.0
1
0
[PATCH 1/5] strmbase: Rename the "mtCurrent" field of struct strmbase_pin to "mt".
by Zebediah Figura Nov. 18, 2019
by Zebediah Figura Nov. 18, 2019
Nov. 18, 2019
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qcap/avico.c | 4 ++--
dlls/qcap/avimux.c | 2 +-
dlls/qcap/smartteefilter.c | 4 ++--
dlls/quartz/dsoundrender.c | 14 +++++++-------
dlls/quartz/filesource.c | 4 ++--
dlls/quartz/tests/videorenderer.c | 4 ++--
dlls/quartz/tests/vmr7.c | 4 ++--
dlls/quartz/tests/vmr9.c | 4 ++--
dlls/quartz/videorenderer.c | 4 ++--
dlls/quartz/vmr9.c | 6 +++---
dlls/strmbase/pin.c | 20 ++++++++++----------
dlls/winegstreamer/gstdemux.c | 4 ++--
dlls/wineqtdecoder/qtsplitter.c | 4 ++--
include/wine/strmbase.h | 2 +-
14 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c
index 95e51f6e63..8eae692dca 100644
--- a/dlls/qcap/avico.c
+++ b/dlls/qcap/avico.c
@@ -470,7 +470,7 @@ static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *
if((This->driver_flags & VIDCF_TEMPORAL) && !(This->driver_flags & VIDCF_FASTTEMPORALC))
FIXME("Unsupported temporal compression\n");
- src_videoinfo = (VIDEOINFOHEADER *)This->sink.pin.mtCurrent.pbFormat;
+ src_videoinfo = (VIDEOINFOHEADER *)This->sink.pin.mt.pbFormat;
This->videoinfo->bmiHeader.biSizeImage = This->max_frame_size;
res = ICCompress(This->hic, sync_point ? ICCOMPRESS_KEYFRAME : 0, &This->videoinfo->bmiHeader, buf,
&src_videoinfo->bmiHeader, ptr, 0, &comp_flags, This->frame_cnt, 0, 0, NULL, NULL);
@@ -539,7 +539,7 @@ static HRESULT source_get_media_type(struct strmbase_pin *base, unsigned int iPo
amt->subtype = MEDIASUBTYPE_PCM;
amt->bFixedSizeSamples = FALSE;
amt->bTemporalCompression = (This->driver_flags & VIDCF_TEMPORAL) != 0;
- amt->lSampleSize = This->sink.pin.mtCurrent.lSampleSize;
+ amt->lSampleSize = This->sink.pin.mt.lSampleSize;
amt->formattype = FORMAT_VideoInfo;
amt->pUnk = NULL;
amt->cbFormat = This->videoinfo_size;
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c
index 8f7fe13285..e8067dd61d 100644
--- a/dlls/qcap/avimux.c
+++ b/dlls/qcap/avimux.c
@@ -1416,7 +1416,7 @@ static HRESULT WINAPI AviMuxIn_Receive(BaseInputPin *base, IMediaSample *pSample
size = IMediaSample_GetActualDataLength(pSample);
}
- if(!avimuxin->pin.pin.mtCurrent.bTemporalCompression)
+ if(!avimuxin->pin.pin.mt.bTemporalCompression)
flags |= AM_SAMPLE_SPLICEPOINT;
hr = IMediaSample_GetTime(pSample, &start, &stop);
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c
index a4d0a435ef..d3acf47e7e 100644
--- a/dlls/qcap/smartteefilter.c
+++ b/dlls/qcap/smartteefilter.c
@@ -142,7 +142,7 @@ static HRESULT sink_get_media_type(struct strmbase_pin *base,
EnterCriticalSection(&This->filter.csFilter);
if (This->sink.pin.peer)
{
- CopyMediaType(amt, &This->sink.pin.mtCurrent);
+ CopyMediaType(amt, &This->sink.pin.mt);
hr = S_OK;
}
else
@@ -331,7 +331,7 @@ static HRESULT source_get_media_type(struct strmbase_pin *iface,
if (!filter->sink.pin.peer)
hr = VFW_E_NOT_CONNECTED;
else if (!index)
- CopyMediaType(mt, &filter->sink.pin.mtCurrent);
+ CopyMediaType(mt, &filter->sink.pin.mt);
else
hr = VFW_S_NO_MORE_ITEMS;
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c
index ed257c373f..fca1a710de 100644
--- a/dlls/quartz/dsoundrender.c
+++ b/dlls/quartz/dsoundrender.c
@@ -92,14 +92,14 @@ static inline DSoundRenderImpl *impl_from_IAMDirectSound(IAMDirectSound *iface)
}
static REFERENCE_TIME time_from_pos(DSoundRenderImpl *This, DWORD pos) {
- WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mtCurrent.pbFormat;
+ WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mt.pbFormat;
REFERENCE_TIME ret = 10000000;
ret = ret * pos / wfx->nAvgBytesPerSec;
return ret;
}
static DWORD pos_from_time(DSoundRenderImpl *This, REFERENCE_TIME time) {
- WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mtCurrent.pbFormat;
+ WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mt.pbFormat;
REFERENCE_TIME ret = time;
ret *= wfx->nAvgBytesPerSec;
ret /= 10000000;
@@ -108,7 +108,7 @@ static DWORD pos_from_time(DSoundRenderImpl *This, REFERENCE_TIME time) {
}
static void DSoundRender_UpdatePositions(DSoundRenderImpl *This, DWORD *seqwritepos, DWORD *minwritepos) {
- WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mtCurrent.pbFormat;
+ WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mt.pbFormat;
BYTE *buf1, *buf2;
DWORD size1, size2, playpos, writepos, old_writepos, old_playpos, adv;
BOOL writepos_set = This->writepos < This->buf_size;
@@ -146,7 +146,7 @@ static void DSoundRender_UpdatePositions(DSoundRenderImpl *This, DWORD *seqwrite
static HRESULT DSoundRender_GetWritePos(DSoundRenderImpl *This, DWORD *ret_writepos, REFERENCE_TIME write_at, DWORD *pfree, DWORD *skip)
{
- WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mtCurrent.pbFormat;
+ WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mt.pbFormat;
DWORD writepos, min_writepos, playpos;
REFERENCE_TIME max_lag = 50 * 10000;
REFERENCE_TIME min_lag = 25 * 10000;
@@ -314,7 +314,7 @@ static HRESULT WINAPI DSoundRender_PrepareReceive(struct strmbase_renderer *ifac
if (IMediaSample_GetMediaType(pSample, &amt) == S_OK)
{
- AM_MEDIA_TYPE *orig = &This->renderer.sink.pin.mtCurrent;
+ AM_MEDIA_TYPE *orig = &This->renderer.sink.pin.mt;
WAVEFORMATEX *origfmt = (WAVEFORMATEX *)orig->pbFormat;
WAVEFORMATEX *newfmt = (WAVEFORMATEX *)amt->pbFormat;
@@ -434,7 +434,7 @@ static void dsound_render_start_stream(struct strmbase_renderer *iface)
static HRESULT WINAPI DSoundRender_CompleteConnect(struct strmbase_renderer *iface, IPin *pReceivePin)
{
DSoundRenderImpl *This = impl_from_strmbase_renderer(iface);
- const AM_MEDIA_TYPE *pmt = &This->renderer.sink.pin.mtCurrent;
+ const AM_MEDIA_TYPE *pmt = &This->renderer.sink.pin.mt;
HRESULT hr = S_OK;
WAVEFORMATEX *format;
DSBUFFERDESC buf_desc;
@@ -937,7 +937,7 @@ static HRESULT WINAPI ReferenceClock_GetTime(IReferenceClock *iface,
DWORD writepos1, writepos2;
EnterCriticalSection(&This->renderer.filter.csFilter);
DSoundRender_UpdatePositions(This, &writepos1, &writepos2);
- if (This->renderer.sink.pin.mtCurrent.pbFormat)
+ if (This->renderer.sink.pin.mt.pbFormat)
{
*pTime = This->play_time + time_from_pos(This, This->last_playpos);
hr = S_OK;
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index 8a921954dd..59f1cc5a18 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -651,7 +651,7 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_sourc
This->pin.peer = pReceivePin;
IPin_AddRef(pReceivePin);
- CopyMediaType(&This->pin.mtCurrent, pmt);
+ CopyMediaType(&This->pin.mt, pmt);
hr = IPin_ReceiveConnection(pReceivePin, &This->pin.IPin_iface, pmt);
@@ -659,7 +659,7 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_sourc
{
IPin_Release(This->pin.peer);
This->pin.peer = NULL;
- FreeMediaType(&This->pin.mtCurrent);
+ FreeMediaType(&This->pin.mt);
}
TRACE(" -- %x\n", hr);
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index b7b1cb405e..e7c0e15edd 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -574,14 +574,14 @@ static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface
iface->pin.peer = peer;
IPin_AddRef(peer);
- CopyMediaType(&iface->pin.mtCurrent, mt);
+ CopyMediaType(&iface->pin.mt, mt);
if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt)))
{
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
IPin_Release(peer);
iface->pin.peer = NULL;
- FreeMediaType(&iface->pin.mtCurrent);
+ FreeMediaType(&iface->pin.mt);
}
return hr;
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c
index 0d72689078..73017290fb 100644
--- a/dlls/quartz/tests/vmr7.c
+++ b/dlls/quartz/tests/vmr7.c
@@ -933,14 +933,14 @@ static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface
iface->pin.peer = peer;
IPin_AddRef(peer);
- CopyMediaType(&iface->pin.mtCurrent, mt);
+ CopyMediaType(&iface->pin.mt, mt);
if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt)))
{
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
IPin_Release(peer);
iface->pin.peer = NULL;
- FreeMediaType(&iface->pin.mtCurrent);
+ FreeMediaType(&iface->pin.mt);
}
return hr;
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index fa63b5b85c..e30da6b782 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -937,14 +937,14 @@ static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface
iface->pin.peer = peer;
IPin_AddRef(peer);
- CopyMediaType(&iface->pin.mtCurrent, mt);
+ CopyMediaType(&iface->pin.mt, mt);
if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt)))
{
ok(hr == VFW_E_TYPE_NOT_ACCEPTED || hr == E_FAIL, "Got hr %#x.\n", hr);
IPin_Release(peer);
iface->pin.peer = NULL;
- FreeMediaType(&iface->pin.mtCurrent);
+ FreeMediaType(&iface->pin.mt);
}
return hr;
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c
index 449bd31f68..18e5f618b0 100644
--- a/dlls/quartz/videorenderer.c
+++ b/dlls/quartz/videorenderer.c
@@ -394,7 +394,7 @@ static HRESULT WINAPI VideoRenderer_GetSourceRect(BaseControlVideo* iface, RECT
static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo* iface, LONG *pBufferSize, LONG *pDIBImage)
{
VideoRendererImpl *This = impl_from_BaseControlVideo(iface);
- AM_MEDIA_TYPE *amt = &This->renderer.sink.pin.mtCurrent;
+ AM_MEDIA_TYPE *amt = &This->renderer.sink.pin.mt;
BITMAPINFOHEADER *bmiHeader;
LONG needed_size;
char *ptr;
@@ -464,7 +464,7 @@ static VIDEOINFOHEADER* WINAPI VideoRenderer_GetVideoFormat(BaseControlVideo* if
TRACE("(%p/%p)\n", This, iface);
- pmt = &This->renderer.sink.pin.mtCurrent;
+ pmt = &This->renderer.sink.pin.mt;
if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
return (VIDEOINFOHEADER*)pmt->pbFormat;
} else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index a2ed46d05d..36c91c2ef7 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -198,7 +198,7 @@ static DWORD VMR9_SendSampleData(struct quartz_vmr *This, VMR9PresentationInfo *
TRACE("%p %p %d\n", This, data, size);
- amt = &This->renderer.sink.pin.mtCurrent;
+ amt = &This->renderer.sink.pin.mt;
if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
{
@@ -609,7 +609,7 @@ static HRESULT WINAPI VMR9_GetSourceRect(BaseControlVideo* This, RECT *pSourceRe
static HRESULT WINAPI VMR9_GetStaticImage(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage)
{
struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This);
- AM_MEDIA_TYPE *amt = &pVMR9->renderer.sink.pin.mtCurrent;
+ AM_MEDIA_TYPE *amt = &pVMR9->renderer.sink.pin.mt;
BITMAPINFOHEADER *bmiHeader;
LONG needed_size;
char *ptr;
@@ -679,7 +679,7 @@ static VIDEOINFOHEADER* WINAPI VMR9_GetVideoFormat(BaseControlVideo* This)
TRACE("(%p/%p)\n", pVMR9, This);
- pmt = &pVMR9->renderer.sink.pin.mtCurrent;
+ pmt = &pVMR9->renderer.sink.pin.mt;
if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
return (VIDEOINFOHEADER*)pmt->pbFormat;
} else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index 9a88246a7f..c7f1ed2af4 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -196,8 +196,8 @@ HRESULT WINAPI BasePinImpl_Disconnect(IPin * iface)
{
IPin_Release(This->peer);
This->peer = NULL;
- FreeMediaType(&This->mtCurrent);
- ZeroMemory(&This->mtCurrent, sizeof(This->mtCurrent));
+ FreeMediaType(&This->mt);
+ ZeroMemory(&This->mt, sizeof(This->mt));
hr = S_OK;
}
else
@@ -245,7 +245,7 @@ HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt
{
if (This->peer)
{
- CopyMediaType(pmt, &This->mtCurrent);
+ CopyMediaType(pmt, &This->mt);
strmbase_dump_media_type(pmt);
hr = S_OK;
}
@@ -456,8 +456,8 @@ HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface)
{
IPin_Release(This->pin.peer);
This->pin.peer = NULL;
- FreeMediaType(&This->pin.mtCurrent);
- ZeroMemory(&This->pin.mtCurrent, sizeof(This->pin.mtCurrent));
+ FreeMediaType(&This->pin.mt);
+ ZeroMemory(&This->pin.mt, sizeof(This->pin.mt));
hr = S_OK;
}
else
@@ -643,7 +643,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This,
This->pin.peer = pReceivePin;
IPin_AddRef(pReceivePin);
- CopyMediaType(&This->pin.mtCurrent, pmt);
+ CopyMediaType(&This->pin.mt, pmt);
hr = IPin_ReceiveConnection(pReceivePin, &This->pin.IPin_iface, pmt);
@@ -678,7 +678,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This,
{
IPin_Release(This->pin.peer);
This->pin.peer = NULL;
- FreeMediaType(&This->pin.mtCurrent);
+ FreeMediaType(&This->pin.mt);
}
TRACE(" -- %x\n", hr);
@@ -699,7 +699,7 @@ void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, str
void strmbase_source_cleanup(struct strmbase_source *pin)
{
- FreeMediaType(&pin->pin.mtCurrent);
+ FreeMediaType(&pin->pin.mt);
if (pin->pAllocator)
IMemAllocator_Release(pin->pAllocator);
pin->pAllocator = NULL;
@@ -750,7 +750,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP
if (SUCCEEDED(hr))
{
- CopyMediaType(&This->pin.mtCurrent, pmt);
+ CopyMediaType(&This->pin.mt, pmt);
This->pin.peer = pReceivePin;
IPin_AddRef(pReceivePin);
}
@@ -999,7 +999,7 @@ void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl, struct strmbase
void strmbase_sink_cleanup(BaseInputPin *pin)
{
- FreeMediaType(&pin->pin.mtCurrent);
+ FreeMediaType(&pin->pin.mt);
if (pin->pAllocator)
IMemAllocator_Release(pin->pAllocator);
pin->pAllocator = NULL;
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 79328a025a..394b919df9 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1231,7 +1231,7 @@ static void gstdemux_destroy(struct strmbase_filter *iface)
assert(hr == S_OK);
}
- FreeMediaType(&filter->sink.mtCurrent);
+ FreeMediaType(&filter->sink.mt);
if (filter->alloc)
IMemAllocator_Release(filter->alloc);
filter->alloc = NULL;
@@ -2037,7 +2037,7 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
if (pAlloc)
IMemAllocator_Release(pAlloc);
if (SUCCEEDED(hr)) {
- CopyMediaType(&filter->sink.mtCurrent, pmt);
+ CopyMediaType(&filter->sink.mt, pmt);
filter->sink.peer = pReceivePin;
IPin_AddRef(pReceivePin);
hr = IMemAllocator_Commit(filter->alloc);
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index 99539e5c89..a7da3b37d6 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -241,7 +241,7 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
IPin_Release(peer);
}
- FreeMediaType(&filter->pInputPin.pin.mtCurrent);
+ FreeMediaType(&filter->pInputPin.pin.mt);
if (filter->pInputPin.pAlloc)
IMemAllocator_Release(filter->pInputPin.pAlloc);
filter->pInputPin.pAlloc = NULL;
@@ -1120,7 +1120,7 @@ static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
if (SUCCEEDED(hr))
{
- CopyMediaType(&This->pin.mtCurrent, pmt);
+ CopyMediaType(&This->pin.mt, pmt);
This->pin.peer = pReceivePin;
IPin_AddRef(pReceivePin);
hr = IMemAllocator_Commit(This->pAlloc);
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index f87b726d0a..01a2bc79c3 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -37,7 +37,7 @@ struct strmbase_pin
PIN_DIRECTION dir;
WCHAR name[128];
IPin *peer;
- AM_MEDIA_TYPE mtCurrent;
+ AM_MEDIA_TYPE mt;
const struct BasePinFuncTable* pFuncsTable;
};
--
2.24.0
2
5
Nov. 18, 2019
Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
---
Required for Star Wars Jedi: Fallen Order bought from Steam to run.
---
dlls/setupapi/query.c | 14 ++++++++++++++
dlls/setupapi/setupapi.spec | 1 +
2 files changed, 15 insertions(+)
diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c
index ea1b969618..c960a6a2ba 100644
--- a/dlls/setupapi/query.c
+++ b/dlls/setupapi/query.c
@@ -717,3 +717,17 @@ BOOL WINAPI SetupQueryInfOriginalFileInformationW(
return TRUE;
}
+
+/***********************************************************************
+ * SetupGetInfDriverStoreLocationW (SETUPAPI.@)
+ */
+BOOL WINAPI SetupGetInfDriverStoreLocationW(
+ PCWSTR FileName, PSP_ALTPLATFORM_INFO AlternativePlatformInfo,
+ PCWSTR LocaleName, PWSTR ReturnBuffer, DWORD ReturnBufferSize,
+ PDWORD RequiredSize)
+{
+ FIXME("stub!: %s %p %s %p %u %p\n", debugstr_w(FileName), AlternativePlatformInfo, debugstr_w(LocaleName), ReturnBuffer, ReturnBufferSize, RequiredSize);
+
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
\ No newline at end of file
diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec
index 1d09b0e7e5..8b6928f647 100644
--- a/dlls/setupapi/setupapi.spec
+++ b/dlls/setupapi/setupapi.spec
@@ -421,6 +421,7 @@
@ stdcall SetupGetFileCompressionInfoW(wstr ptr ptr ptr ptr)
@ stdcall SetupGetFileQueueCount(long long ptr)
@ stdcall SetupGetFileQueueFlags(long ptr)
+@ stdcall SetupGetInfDriverStoreLocationW(wstr ptr wstr ptr long ptr)
@ stdcall SetupGetInfFileListA(str long ptr long ptr)
@ stdcall SetupGetInfFileListW(wstr long ptr long ptr)
@ stdcall SetupGetInfInformationA(ptr long ptr long ptr)
--
2.23.0
1
0
[PATCH v6 1/2] vkd3d: Add Win32-compatible define for PATH_MAX.
by Hans-Kristian Arntzen Nov. 18, 2019
by Hans-Kristian Arntzen Nov. 18, 2019
Nov. 18, 2019
Signed-off-by: Hans-Kristian Arntzen <post(a)arntzen-software.no>
---
libs/vkd3d/device.c | 2 +-
libs/vkd3d/utils.c | 8 ++++----
libs/vkd3d/vkd3d_private.h | 8 +++++++-
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index 0624318..cc8e282 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -453,7 +453,7 @@ static HRESULT vkd3d_instance_init(struct vkd3d_instance *instance,
bool *user_extension_supported = NULL;
VkApplicationInfo application_info;
VkInstanceCreateInfo instance_info;
- char application_name[PATH_MAX];
+ char application_name[VKD3D_PATH_MAX];
uint32_t extension_count;
const char **extensions;
VkInstance vk_instance;
diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c
index cf0448d..64eb845 100644
--- a/libs/vkd3d/utils.c
+++ b/libs/vkd3d/utils.c
@@ -830,7 +830,7 @@ HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs,
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
-bool vkd3d_get_program_name(char program_name[PATH_MAX])
+bool vkd3d_get_program_name(char program_name[VKD3D_PATH_MAX])
{
char *name, *p, *real_path = NULL;
@@ -856,15 +856,15 @@ bool vkd3d_get_program_name(char program_name[PATH_MAX])
name = program_invocation_name;
}
- strncpy(program_name, name, PATH_MAX);
- program_name[PATH_MAX - 1] = '\0';
+ strncpy(program_name, name, VKD3D_PATH_MAX);
+ program_name[VKD3D_PATH_MAX - 1] = '\0';
free(real_path);
return true;
}
#else
-bool vkd3d_get_program_name(char program_name[PATH_MAX])
+bool vkd3d_get_program_name(char program_name[VKD3D_PATH_MAX])
{
*program_name = '\0';
return false;
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 84b5ff2..a90f7e5 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -54,6 +54,12 @@
#define VKD3D_MAX_SHADER_STAGES 5u
#define VKD3D_MAX_VK_SYNC_OBJECTS 4u
+#ifdef _WIN32
+#define VKD3D_PATH_MAX _MAX_PATH
+#else
+#define VKD3D_PATH_MAX PATH_MAX
+#endif
+
struct d3d12_command_list;
struct d3d12_device;
struct d3d12_resource;
@@ -1271,7 +1277,7 @@ HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs,
extern const char vkd3d_build[];
-bool vkd3d_get_program_name(char program_name[PATH_MAX]) DECLSPEC_HIDDEN;
+bool vkd3d_get_program_name(char program_name[VKD3D_PATH_MAX]) DECLSPEC_HIDDEN;
static inline void vkd3d_set_thread_name(const char *name)
{
--
2.24.0
1
1
Nov. 18, 2019
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48104
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
---
dlls/ddraw/tests/ddraw7.c | 191 +++++++++++++++++++++++----------
dlls/wined3d/device.c | 7 +-
dlls/wined3d/state.c | 15 ++-
dlls/wined3d/wined3d_private.h | 8 ++
4 files changed, 159 insertions(+), 62 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 143f6d4b6b..20b0e09a95 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -277,7 +277,8 @@ static D3DCOLOR get_surface_color(IDirectDrawSurface7 *surface, UINT x, UINT y)
return color;
}
-static void check_rect(IDirectDrawSurface7 *surface, RECT r, const char *message)
+#define check_rect(a, b, c) check_rect_(__LINE__, a, b, c)
+static void check_rect_(unsigned int line, IDirectDrawSurface7 *surface, RECT r, const char *message)
{
LONG x_coords[2][2] =
{
@@ -308,7 +309,7 @@ static void check_rect(IDirectDrawSurface7 *surface, RECT r, const char *message
if (x < 0 || x >= 640 || y < 0 || y >= 480)
continue;
color = get_surface_color(surface, x, y);
- ok(color == expected, "%s: Pixel (%d, %d) has color %08x, expected %08x.\n",
+ ok_(__FILE__, line)(color == expected, "%s: Pixel (%d, %d) has color %08x, expected %08x.\n",
message, x, y, color, expected);
}
}
@@ -543,17 +544,17 @@ static void test_process_vertices(void)
}
hr = IDirect3DDevice7_GetDirect3D(device, &d3d7);
- ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc));
vb_desc.dwSize = sizeof(vb_desc);
vb_desc.dwFVF = D3DFVF_XYZ;
vb_desc.dwNumVertices = 4;
hr = IDirect3D7_CreateVertexBuffer(d3d7, &vb_desc, &src_vb, 0);
- ok(SUCCEEDED(hr), "Failed to create source vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(src_vb, 0, (void **)&src_data, NULL);
- ok(SUCCEEDED(hr), "Failed to lock source vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
src_data[0].x = 0.0f;
src_data[0].y = 0.0f;
src_data[0].z = 0.0f;
@@ -567,7 +568,7 @@ static void test_process_vertices(void)
src_data[3].y = -0.5f;
src_data[3].z = 0.25f;
hr = IDirect3DVertexBuffer7_Unlock(src_vb);
- ok(SUCCEEDED(hr), "Failed to unlock source vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc));
vb_desc.dwSize = sizeof(vb_desc);
@@ -575,7 +576,7 @@ static void test_process_vertices(void)
vb_desc.dwNumVertices = 4;
/* MSDN says that the last parameter must be 0 - check that. */
hr = IDirect3D7_CreateVertexBuffer(d3d7, &vb_desc, &dst_vb1, 4);
- ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc));
vb_desc.dwSize = sizeof(vb_desc);
@@ -583,7 +584,7 @@ static void test_process_vertices(void)
vb_desc.dwNumVertices = 5;
/* MSDN says that the last parameter must be 0 - check that. */
hr = IDirect3D7_CreateVertexBuffer(d3d7, &vb_desc, &dst_vb2, 12345678);
- ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
memset(&vp, 0, sizeof(vp));
vp.dwX = 64;
@@ -593,15 +594,15 @@ static void test_process_vertices(void)
vp.dvMinZ = 0.0f;
vp.dvMaxZ = 1.0f;
hr = IDirect3DDevice7_SetViewport(device, &vp);
- ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0);
- ok(SUCCEEDED(hr), "Failed to process vertices, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb2, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0);
- ok(SUCCEEDED(hr), "Failed to process vertices, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL);
- ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
ok(compare_vec4(&dst_data[0], +1.280e+2f, +1.280e+2f, +0.000e+0f, +1.000e+0f, 4096),
"Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n",
dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w);
@@ -615,10 +616,10 @@ static void test_process_vertices(void)
"Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n",
dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w);
hr = IDirect3DVertexBuffer7_Unlock(dst_vb1);
- ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb2, 0, (void **)&dst_data2, NULL);
- ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
/* Small thing without much practical meaning, but I stumbled upon it,
* so let's check for it: If the output vertex buffer has no RHW value,
* the RHW value of the last vertex is written into the next vertex. */
@@ -626,7 +627,62 @@ static void test_process_vertices(void)
"Got unexpected vertex 4 {%.8e, %.8e, %.8e}.\n",
dst_data2[4].x, dst_data2[4].y, dst_data2[4].z);
hr = IDirect3DVertexBuffer7_Unlock(dst_vb2);
- ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+
+ /* Test degenerate viewport z ranges. */
+ vp.dvMinZ = 0.0f;
+ vp.dvMaxZ = 0.0f;
+ hr = IDirect3DDevice7_SetViewport(device, &vp);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb2, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+ ok(compare_vec4(&dst_data[0], +1.280e+2f, +1.280e+2f, +0.000e+0f, +1.000e+0f, 4096),
+ "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n",
+ dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w);
+ ok(compare_vec4(&dst_data[1], +1.920e+2f, +6.400e+1f, +1.000e-3f, +1.000e+0f, 4096),
+ "Got unexpected vertex 1 {%.8e, %.8e, %.8e, %.8e}.\n",
+ dst_data[1].x, dst_data[1].y, dst_data[1].z, dst_data[1].w);
+ ok(compare_vec4(&dst_data[2], +6.400e+1f, +1.920e+2f, +5.000e-4f, +1.000e+0f, 4096),
+ "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n",
+ dst_data[2].x, dst_data[2].y, dst_data[2].z, dst_data[2].w);
+ ok(compare_vec4(&dst_data[3], +1.600e+2f, +1.600e+2f, +2.500e-4f, +1.000e+0f, 4096),
+ "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n",
+ dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w);
+ hr = IDirect3DVertexBuffer7_Unlock(dst_vb1);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+
+ vp.dvMinZ = 1.0f;
+ vp.dvMaxZ = 0.0f;
+ hr = IDirect3DDevice7_SetViewport(device, &vp);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb2, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+ ok(compare_vec4(&dst_data[0], +1.280e+2f, +1.280e+2f, +1.000e+0f, +1.000e+0f, 4096),
+ "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n",
+ dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w);
+ ok(compare_vec4(&dst_data[1], +1.920e+2f, +6.400e+1f, +1.001e+0f, +1.000e+0f, 4096),
+ "Got unexpected vertex 1 {%.8e, %.8e, %.8e, %.8e}.\n",
+ dst_data[1].x, dst_data[1].y, dst_data[1].z, dst_data[1].w);
+ ok(compare_vec4(&dst_data[2], +6.400e+1f, +1.920e+2f, +1.0005e+0f, +1.000e+0f, 4096),
+ "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n",
+ dst_data[2].x, dst_data[2].y, dst_data[2].z, dst_data[2].w);
+ ok(compare_vec4(&dst_data[3], +1.600e+2f, +1.600e+2f, +1.00025e+0f, +1.000e+0f, 4096),
+ "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n",
+ dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w);
+ hr = IDirect3DVertexBuffer7_Unlock(dst_vb1);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
/* Try a more complicated viewport, same vertices. */
memset(&vp, 0, sizeof(vp));
@@ -637,13 +693,13 @@ static void test_process_vertices(void)
vp.dvMinZ = -2.0f;
vp.dvMaxZ = 4.0f;
hr = IDirect3DDevice7_SetViewport(device, &vp);
- ok(SUCCEEDED(hr), "Failed to set viewport, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0);
- ok(SUCCEEDED(hr), "Failed to process vertices, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL);
- ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
ok(compare_vec4(&dst_data[0], +1.330e+2f, +7.000e+1f, -2.000e+0f, +1.000e+0f, 4096),
"Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n",
dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w);
@@ -657,20 +713,20 @@ static void test_process_vertices(void)
"Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n",
dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w);
hr = IDirect3DVertexBuffer7_Unlock(dst_vb1);
- ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &world);
- ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &view);
- ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &proj);
- ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_ProcessVertices(dst_vb1, D3DVOP_TRANSFORM, 0, 4, src_vb, 0, device, 0);
- ok(SUCCEEDED(hr), "Failed to process vertices, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer7_Lock(dst_vb1, 0, (void **)&dst_data, NULL);
- ok(SUCCEEDED(hr), "Failed to lock destination vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
ok(compare_vec4(&dst_data[0], +2.560e+2f, +7.000e+1f, -2.000e+0f, +3.333e-1f, 4096),
"Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n",
dst_data[0].x, dst_data[0].y, dst_data[0].z, dst_data[0].w);
@@ -684,7 +740,7 @@ static void test_process_vertices(void)
"Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n",
dst_data[3].x, dst_data[3].y, dst_data[3].z, dst_data[3].w);
hr = IDirect3DVertexBuffer7_Unlock(dst_vb1);
- ok(SUCCEEDED(hr), "Failed to unlock destination vertex buffer, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirect3DVertexBuffer7_Release(dst_vb2);
IDirect3DVertexBuffer7_Release(dst_vb1);
@@ -14877,24 +14933,27 @@ static void test_viewport(void)
static struct
{
D3DVIEWPORT7 vp;
+ float expected_z;
RECT expected_rect;
const char *message;
}
tests[] =
{
- {{ 0, 0, 640, 480}, { 0, 120, 479, 359}, "Viewport (0, 0) - (640, 480)"},
- {{ 0, 0, 320, 240}, { 0, 60, 239, 179}, "Viewport (0, 0) - (320, 240)"},
- {{ 0, 0, 1280, 960}, { 0, 240, 639, 479}, "Viewport (0, 0) - (1280, 960)"},
- {{ 0, 0, 2000, 1600}, {-10, -10, -10, -10}, "Viewport (0, 0) - (2000, 1600)"},
- {{100, 100, 640, 480}, {100, 220, 579, 459}, "Viewport (100, 100) - (640, 480)"},
- {{ 0, 0, 8192, 8192}, {-10, -10, -10, -10}, "Viewport (0, 0) - (8192, 8192)"},
+ {{ 0, 0, 640, 480}, 0.001f, { 0, 120, 479, 359}, "Viewport (0, 0) - (640, 480)"},
+ {{ 0, 0, 640, 480, 0.5f, 0.0f}, 0.501f,
+ {0, 120, 479, 359}, "Viewport (0, 0, 0.5) - (640, 480, 0.0)"},
+ {{ 0, 0, 320, 240}, 0.001f, { 0, 60, 239, 179}, "Viewport (0, 0) - (320, 240)"},
+ {{ 0, 0, 1280, 960}, 0.001f, { 0, 240, 639, 479}, "Viewport (0, 0) - (1280, 960)"},
+ {{ 0, 0, 2000, 1600}, 0.001f, {-10, -10, -10, -10}, "Viewport (0, 0) - (2000, 1600)"},
+ {{100, 100, 640, 480}, 0.001f, {100, 220, 579, 459}, "Viewport (100, 100) - (640, 480)"},
+ {{ 0, 0, 8192, 8192}, 0.001f, {-10, -10, -10, -10}, "Viewport (0, 0) - (8192, 8192)"},
};
static struct vec3 quad[] =
{
- {-1.5f, -0.5f, 0.1f},
- {-1.5f, 0.5f, 0.1f},
- { 0.5f, -0.5f, 0.1f},
- { 0.5f, 0.5f, 0.1f},
+ {-1.5f, -0.5f, 1.0f},
+ {-1.5f, 0.5f, 1.0f},
+ { 0.5f, -0.5f, 1.0f},
+ { 0.5f, 0.5f, 1.0f},
};
static const struct vec2 rt_sizes[] =
{
@@ -14902,6 +14961,7 @@ static void test_viewport(void)
};
IDirectDrawSurface7 *rt, *ds;
DDSURFACEDESC2 surface_desc;
+ const float z_eps = 0.0001;
IDirect3DDevice7 *device;
IDirectDraw7 *ddraw;
DDPIXELFORMAT z_fmt;
@@ -14921,18 +14981,16 @@ static void test_viewport(void)
}
hr = IDirect3DDevice7_GetDirect3D(device, &d3d);
- ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw);
- ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirect3D7_Release(d3d);
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE);
- ok(SUCCEEDED(hr), "Failed to disable depth test, hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
- ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetViewport(device, NULL);
- ok(hr == E_INVALIDARG, "Setting NULL viewport data returned unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
ds = get_depth_stencil(device);
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -14951,56 +15009,79 @@ static void test_viewport(void)
surface_desc.dwHeight = rt_sizes[i].y;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &rt, NULL);
- ok(SUCCEEDED(hr), "Failed to create render target, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U4(surface_desc).ddpfPixelFormat = z_fmt;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &ds, NULL);
- ok(SUCCEEDED(hr), "Failed to create depth buffer, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
hr = IDirectDrawSurface7_AddAttachedSurface(rt, ds);
- ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
hr = IDirect3DDevice7_SetRenderTarget(device, rt, 0);
- ok(SUCCEEDED(hr), "Failed to set render target, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
}
else
{
hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
- ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
}
for (j = 0; j < ARRAY_SIZE(tests); ++j)
{
- hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0);
- ok(SUCCEEDED(hr), "Failed to clear, hr %#x (i %u, j %u).\n", hr, i, j);
+ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000,
+ tests[j].expected_z - z_eps, 0);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_GREATER);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, !i);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
hr = IDirect3DDevice7_SetViewport(device, &tests[j].vp);
if (tests[j].vp.dwX + tests[j].vp.dwWidth > rt_sizes[i].x
|| tests[j].vp.dwY + tests[j].vp.dwHeight > rt_sizes[i].y)
{
- ok(hr == E_INVALIDARG, "Setting the viewport returned unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
continue;
}
else
{
- ok(SUCCEEDED(hr), "Failed to set the viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
}
hr = IDirect3DDevice7_BeginScene(device);
- ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0);
- ok(SUCCEEDED(hr), "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
hr = IDirect3DDevice7_EndScene(device);
- ok(SUCCEEDED(hr), "Failed to end scene, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
check_rect(rt, tests[j].expected_rect, tests[j].message);
+
+ if (!i)
+ {
+ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000,
+ tests[j].expected_z + z_eps, 0);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_LESS);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+
+ hr = IDirect3DDevice7_BeginScene(device);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ hr = IDirect3DDevice7_EndScene(device);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+
+ check_rect(rt, tests[j].expected_rect, tests[j].message);
+ }
}
hr = IDirectDrawSurface7_DeleteAttachedSurface(rt, 0, ds);
- ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
IDirectDrawSurface7_Release(ds);
-
IDirectDrawSurface7_Release(rt);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3049be69ef..c3628362df 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3573,6 +3573,7 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
struct lights_settings ls;
unsigned int vertex_size;
BOOL do_clip, lighting;
+ float min_z, max_z;
unsigned int i;
BYTE *dest_ptr;
HRESULT hr;
@@ -3656,6 +3657,8 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
init_transformed_lights(&ls, state, device->adapter->d3d_info.wined3d_creation_flags
& WINED3D_LEGACY_FFP_LIGHTING, lighting);
+ wined3d_z_range_from_viewport(&min_z, &max_z, &vp);
+
for (i = 0; i < dwCount; ++i)
{
const struct wined3d_stream_info_element *position_element = &stream_info->elements[WINED3D_FFP_POSITION];
@@ -3728,11 +3731,11 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
x *= vp.width / 2;
y *= vp.height / 2;
- z *= vp.max_z - vp.min_z;
+ z *= max_z - min_z;
x += vp.width / 2 + vp.x;
y += vp.height / 2 + vp.y;
- z += vp.min_z;
+ z += min_z;
rhw = 1 / rhw;
} else {
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 0f84cc22f7..e99dba208e 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4037,6 +4037,7 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
struct wined3d_viewport vp[WINED3D_MAX_VIEWPORTS];
+ float min_z, max_z;
if (gl_info->supported[ARB_VIEWPORT_ARRAY])
{
@@ -4048,8 +4049,9 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine
get_viewports(context, state, state->viewport_count, vp);
for (i = 0; i < state->viewport_count; ++i)
{
- depth_ranges[i * 2] = vp[i].min_z;
- depth_ranges[i * 2 + 1] = vp[i].max_z;
+ wined3d_z_range_from_viewport(&min_z, &max_z, &vp[i]);
+ depth_ranges[i * 2] = min_z;
+ depth_ranges[i * 2 + 1] = max_z;
viewports[i * 4] = vp[i].x;
viewports[i * 4 + 1] = vp[i].y;
@@ -4073,7 +4075,8 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine
else
{
get_viewports(context, state, 1, vp);
- gl_info->gl_ops.gl.p_glDepthRange(vp[0].min_z, vp[0].max_z);
+ wined3d_z_range_from_viewport(&min_z, &max_z, &vp[0]);
+ gl_info->gl_ops.gl.p_glDepthRange(min_z, max_z);
gl_info->gl_ops.gl.p_glViewport(vp[0].x, vp[0].y, vp[0].width, vp[0].height);
}
checkGLcall("setting clip space and viewport");
@@ -4090,6 +4093,7 @@ static void viewport_miscpart_cc(struct wined3d_context *context,
GLdouble depth_ranges[2 * WINED3D_MAX_VIEWPORTS];
GLfloat viewports[4 * WINED3D_MAX_VIEWPORTS];
unsigned int i, reset_count = 0;
+ float min_z, max_z;
get_viewports(context, state, state->viewport_count, vp);
@@ -4097,8 +4101,9 @@ static void viewport_miscpart_cc(struct wined3d_context *context,
for (i = 0; i < state->viewport_count; ++i)
{
- depth_ranges[i * 2] = vp[i].min_z;
- depth_ranges[i * 2 + 1] = vp[i].max_z;
+ wined3d_z_range_from_viewport(&min_z, &max_z, &vp[i]);
+ depth_ranges[i * 2] = min_z;
+ depth_ranges[i * 2 + 1] = max_z;
viewports[i * 4] = vp[i].x + pixel_center_offset;
viewports[i * 4 + 1] = vp[i].y + pixel_center_offset;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8ca2e73703..f52509488a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -5345,6 +5345,14 @@ static inline BOOL wined3d_resource_check_fbo_attached(const struct wined3d_stat
return FALSE;
}
+static inline void wined3d_z_range_from_viewport(float *min_z, float *max_z, const struct wined3d_viewport *vp)
+{
+ *min_z = vp->min_z;
+
+ /* The magic constant is derived from tests */
+ *max_z = vp->min_z + max(vp->max_z - vp->min_z, 0.001f);
+}
+
/* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
#define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
--
2.23.0
3
3
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
---
dlls/ddraw/tests/ddraw7.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 7c46f33cb7a..8875fde7f89 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -16593,7 +16593,7 @@ static void test_surface_format_conversion_alpha(void)
{16}, {0x0000f800}, {0x000007e0}, {0x0000001f}, {0x00000000}
},
"R5G6B5", 2, 4, 4, 0, TRUE,
- /* Looks broken for sysmem texture convertions on Windows (at
+ /* Looks broken for sysmem texture conversions on Windows (at
* least with hardware device), the result is either error from
* _Blt() or a copy of the source data without any conversion. */
},
--
2.21.0
5
13
[PATCH v3 8/9] d3dx9: Implement recording parameters to parameter block.
by Paul Gofman Nov. 18, 2019
by Paul Gofman Nov. 18, 2019
Nov. 18, 2019
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
---
v2 (basically redid the whole thing):
- get rid of separate set_dirty() calls;
- do not update parameter data while recording blocks;
- record string parameters update as well.
v3:
- fix refcounting logic in _SetTexture(): current texture in param->data
is irrelevant when settign texture to parameter block.
dlls/d3dx9_36/effect.c | 242 +++++++++++++++++++++++++----------
dlls/d3dx9_36/tests/effect.c | 38 ++++--
2 files changed, 205 insertions(+), 75 deletions(-)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index d5b2c35937..7aba622e58 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -36,6 +36,7 @@ static const char parameter_block_magic_string[4] = {'@', '!', '#', '\xFE'};
#define PARAMETER_FLAG_SHARED 1
#define INITIAL_POOL_SIZE 16
+#define INITIAL_PARAM_BLOCK_SIZE 1024
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
@@ -153,6 +154,15 @@ struct d3dx_parameter_block
{
char magic_string[ARRAY_SIZE(parameter_block_magic_string)];
struct list entry;
+ size_t buffer_size;
+ size_t current_size;
+ BYTE *buffer;
+};
+
+struct d3dx_recorded_parameter
+{
+ struct d3dx_parameter *param;
+ unsigned int bytes;
};
struct d3dx_effect
@@ -704,11 +714,27 @@ static void free_technique(struct d3dx_technique *technique)
technique->name = NULL;
}
+static unsigned int get_recorded_parameter_size(const struct d3dx_recorded_parameter *record)
+{
+ return sizeof(*record) + record->bytes;
+}
+
static void free_parameter_block(struct d3dx_parameter_block *block)
{
+ struct d3dx_recorded_parameter *record;
+
if (!block)
return;
+ record = (struct d3dx_recorded_parameter *)block->buffer;
+ while ((BYTE *)record < block->buffer + block->current_size)
+ {
+ free_parameter_object_data(record->param, record + 1, record->bytes);
+ record = (struct d3dx_recorded_parameter *)((BYTE *)record + get_recorded_parameter_size(record));
+ }
+ assert((BYTE *)record == block->buffer + block->current_size);
+
+ heap_free(block->buffer);
heap_free(block);
}
@@ -776,14 +802,12 @@ static void get_vector(struct d3dx_parameter *param, D3DXVECTOR4 *vector)
}
}
-static void set_vector(struct d3dx_parameter *param, const D3DXVECTOR4 *vector)
+static void set_vector(struct d3dx_parameter *param, const D3DXVECTOR4 *vector, void *dst_data)
{
UINT i;
for (i = 0; i < param->columns; ++i)
- {
- set_number((FLOAT *)param->data + i, param->type, (FLOAT *)vector + i, D3DXPT_FLOAT);
- }
+ set_number((FLOAT *)dst_data + i, param->type, (FLOAT *)vector + i, D3DXPT_FLOAT);
}
static void get_matrix(struct d3dx_parameter *param, D3DXMATRIX *matrix, BOOL transpose)
@@ -804,31 +828,33 @@ static void get_matrix(struct d3dx_parameter *param, D3DXMATRIX *matrix, BOOL tr
}
}
-static void set_matrix(struct d3dx_parameter *param, const D3DXMATRIX *matrix)
+static void set_matrix(struct d3dx_parameter *param, const D3DXMATRIX *matrix, void *dst_data)
{
UINT i, k;
if (param->type == D3DXPT_FLOAT)
{
if (param->columns == 4)
- memcpy(param->data, matrix->u.m, param->rows * 4 * sizeof(float));
+ {
+ memcpy(dst_data, matrix->u.m, param->rows * 4 * sizeof(float));
+ }
else
+ {
for (i = 0; i < param->rows; ++i)
- memcpy((float *)param->data + i * param->columns, matrix->u.m + i, param->columns * sizeof(float));
+ memcpy((float *)dst_data + i * param->columns, matrix->u.m + i, param->columns * sizeof(float));
+ }
return;
}
for (i = 0; i < param->rows; ++i)
{
for (k = 0; k < param->columns; ++k)
- {
- set_number((FLOAT *)param->data + i * param->columns + k, param->type,
+ set_number((FLOAT *)dst_data + i * param->columns + k, param->type,
&matrix->u.m[i][k], D3DXPT_FLOAT);
- }
}
}
-static void set_matrix_transpose(struct d3dx_parameter *param, const D3DXMATRIX *matrix)
+static void set_matrix_transpose(struct d3dx_parameter *param, const D3DXMATRIX *matrix, void *dst_data)
{
UINT i, k;
@@ -836,7 +862,7 @@ static void set_matrix_transpose(struct d3dx_parameter *param, const D3DXMATRIX
{
for (k = 0; k < param->columns; ++k)
{
- set_number((FLOAT *)param->data + i * param->columns + k, param->type,
+ set_number((FLOAT *)dst_data + i * param->columns + k, param->type,
&matrix->u.m[k][i], D3DXPT_FLOAT);
}
}
@@ -855,7 +881,8 @@ static HRESULT set_string(char **param_data, const char *string)
return D3D_OK;
}
-static HRESULT set_value(struct d3dx_parameter *param, const void *data, unsigned int bytes)
+static HRESULT set_value(struct d3dx_parameter *param, const void *data, unsigned int bytes,
+ void *dst_data)
{
unsigned int i, count;
@@ -871,7 +898,7 @@ static HRESULT set_value(struct d3dx_parameter *param, const void *data, unsigne
case D3DXPT_TEXTURECUBE:
for (i = 0; i < count; ++i)
{
- IUnknown *old_texture = ((IUnknown **)param->data)[i];
+ IUnknown *old_texture = ((IUnknown **)dst_data)[i];
IUnknown *new_texture = ((IUnknown **)data)[i];
if (new_texture == old_texture)
@@ -888,7 +915,7 @@ static HRESULT set_value(struct d3dx_parameter *param, const void *data, unsigne
case D3DXPT_INT:
case D3DXPT_FLOAT:
TRACE("Copy %u bytes.\n", bytes);
- memcpy(param->data, data, bytes);
+ memcpy(dst_data, data, bytes);
break;
case D3DXPT_STRING:
@@ -896,7 +923,7 @@ static HRESULT set_value(struct d3dx_parameter *param, const void *data, unsigne
HRESULT hr;
for (i = 0; i < count; ++i)
- if (FAILED(hr = set_string(&((char **)param->data)[i], ((const char **)data)[i])))
+ if (FAILED(hr = set_string(&((char **)dst_data)[i], ((const char **)data)[i])))
return hr;
break;
}
@@ -1246,6 +1273,43 @@ static ULONG64 next_effect_update_version(struct d3dx_effect *effect)
return next_update_version(get_version_counter_ptr(effect));
}
+static void *record_parameter(struct d3dx_effect *effect, struct d3dx_parameter *param, unsigned int bytes)
+{
+ struct d3dx_parameter_block *block = effect->current_parameter_block;
+ struct d3dx_recorded_parameter new_record, *record;
+ unsigned int new_size, alloc_size;
+
+ new_record.param = param;
+ new_record.bytes = bytes;
+ new_size = block->current_size + get_recorded_parameter_size(&new_record);
+
+ if (new_size > block->buffer_size)
+ {
+ BYTE *new_alloc;
+
+ alloc_size = max(block->buffer_size * 2, max(new_size, INITIAL_PARAM_BLOCK_SIZE));
+ if (block->buffer_size)
+ new_alloc = heap_realloc(block->buffer, alloc_size);
+ else
+ new_alloc = heap_alloc(alloc_size);
+
+ if (!new_alloc)
+ {
+ ERR("Out of memory.\n");
+ return param->data;
+ }
+ /* Data update functions may want to free some references upon setting value. */
+ memset(new_alloc + block->buffer_size, 0, alloc_size - block->buffer_size);
+
+ block->buffer_size = alloc_size;
+ block->buffer = new_alloc;
+ }
+ record = (struct d3dx_recorded_parameter *)(block->buffer + block->current_size);
+ *record = new_record;
+ block->current_size = new_size;
+ return record + 1;
+}
+
static void set_dirty(struct d3dx_parameter *param)
{
struct d3dx_shared_data *shared_data;
@@ -1258,6 +1322,17 @@ static void set_dirty(struct d3dx_parameter *param)
top_param->update_version = new_update_version;
}
+static void *parameter_get_update_data(struct d3dx_effect *effect, struct d3dx_parameter *param,
+ unsigned int bytes, BOOL value_changed)
+{
+ assert(bytes <= param->bytes);
+
+ if (value_changed && !effect->current_parameter_block)
+ set_dirty(param);
+
+ return effect->current_parameter_block ? record_parameter(effect, param, bytes) : param->data;
+}
+
static void d3dx9_set_light_parameter(enum LIGHT_TYPE op, D3DLIGHT9 *light, void *value)
{
static const struct
@@ -2362,10 +2437,7 @@ static HRESULT WINAPI d3dx_effect_SetValue(ID3DXEffect *iface, D3DXHANDLE parame
}
if (data && param->bytes <= bytes)
- {
- set_dirty(param);
- return set_value(param, data, bytes);
- }
+ return set_value(param, data, bytes, parameter_get_update_data(effect, param, param->bytes, TRUE));
WARN("Invalid argument specified.\n");
@@ -2446,8 +2518,8 @@ static HRESULT WINAPI d3dx_effect_SetBool(ID3DXEffect *iface, D3DXHANDLE paramet
if (param && !param->element_count && param->rows == 1 && param->columns == 1)
{
- set_number(param->data, param->type, &b, D3DXPT_BOOL);
- set_dirty(param);
+ set_number(parameter_get_update_data(effect, param, sizeof(int), TRUE),
+ param->type, &b, D3DXPT_BOOL);
return D3D_OK;
}
@@ -2479,6 +2551,7 @@ static HRESULT WINAPI d3dx_effect_SetBoolArray(ID3DXEffect *iface, D3DXHANDLE pa
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
+ void *data;
TRACE("iface %p, parameter %p, b %p, count %u.\n", iface, parameter, b, count);
@@ -2493,12 +2566,12 @@ static HRESULT WINAPI d3dx_effect_SetBoolArray(ID3DXEffect *iface, D3DXHANDLE pa
case D3DXPC_SCALAR:
case D3DXPC_VECTOR:
case D3DXPC_MATRIX_ROWS:
+ data = parameter_get_update_data(effect, param, size * sizeof(int), TRUE);
for (i = 0; i < size; ++i)
{
/* don't crop the input, use D3DXPT_INT instead of D3DXPT_BOOL */
- set_number((DWORD *)param->data + i, param->type, &b[i], D3DXPT_INT);
+ set_number((DWORD *)data + i, param->type, &b[i], D3DXPT_INT);
}
- set_dirty(param);
return D3D_OK;
case D3DXPC_OBJECT:
@@ -2556,9 +2629,8 @@ static HRESULT WINAPI d3dx_effect_SetInt(ID3DXEffect *iface, D3DXHANDLE paramete
DWORD value;
set_number(&value, param->type, &n, D3DXPT_INT);
- if (value != *(DWORD *)param->data)
- set_dirty(param);
- *(DWORD *)param->data = value;
+ *(DWORD *)parameter_get_update_data(effect, param, sizeof(int),
+ value != *(DWORD *)param->data) = value;
return D3D_OK;
}
@@ -2567,14 +2639,19 @@ static HRESULT WINAPI d3dx_effect_SetInt(ID3DXEffect *iface, D3DXHANDLE paramete
&& ((param->class == D3DXPC_VECTOR && param->columns != 2)
|| (param->class == D3DXPC_MATRIX_ROWS && param->rows != 2 && param->columns == 1)))
{
+ void *data;
+
TRACE("Vector fixup.\n");
- *(float *)param->data = ((n & 0xff0000) >> 16) * INT_FLOAT_MULTI_INVERSE;
- ((float *)param->data)[1] = ((n & 0xff00) >> 8) * INT_FLOAT_MULTI_INVERSE;
- ((float *)param->data)[2] = (n & 0xff) * INT_FLOAT_MULTI_INVERSE;
+ data = parameter_get_update_data(effect, param,
+ min(4, param->rows * param->columns) * sizeof(float), TRUE);
+
+ *(float *)data = ((n & 0xff0000) >> 16) * INT_FLOAT_MULTI_INVERSE;
+ ((float *)data)[1] = ((n & 0xff00) >> 8) * INT_FLOAT_MULTI_INVERSE;
+ ((float *)data)[2] = (n & 0xff) * INT_FLOAT_MULTI_INVERSE;
if (param->rows * param->columns > 3)
- ((float *)param->data)[3] = ((n & 0xff000000) >> 24) * INT_FLOAT_MULTI_INVERSE;
- set_dirty(param);
+ ((float *)data)[3] = ((n & 0xff000000) >> 24) * INT_FLOAT_MULTI_INVERSE;
+
return D3D_OK;
}
}
@@ -2626,6 +2703,7 @@ static HRESULT WINAPI d3dx_effect_SetIntArray(ID3DXEffect *iface, D3DXHANDLE par
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
+ void *data;
TRACE("iface %p, parameter %p, n %p, count %u.\n", iface, parameter, n, count);
@@ -2640,9 +2718,9 @@ static HRESULT WINAPI d3dx_effect_SetIntArray(ID3DXEffect *iface, D3DXHANDLE par
case D3DXPC_SCALAR:
case D3DXPC_VECTOR:
case D3DXPC_MATRIX_ROWS:
+ data = parameter_get_update_data(effect, param, size * sizeof(int), TRUE);
for (i = 0; i < size; ++i)
- set_number((DWORD *)param->data + i, param->type, &n[i], D3DXPT_INT);
- set_dirty(param);
+ set_number((DWORD *)data + i, param->type, &n[i], D3DXPT_INT);
return D3D_OK;
case D3DXPC_OBJECT:
@@ -2696,9 +2774,8 @@ static HRESULT WINAPI d3dx_effect_SetFloat(ID3DXEffect *iface, D3DXHANDLE parame
DWORD value;
set_number(&value, param->type, &f, D3DXPT_FLOAT);
- if (value != *(DWORD *)param->data)
- set_dirty(param);
- *(DWORD *)param->data = value;
+ *(DWORD *)parameter_get_update_data(effect, param, sizeof(float),
+ value != *(DWORD *)param->data) = value;
return D3D_OK;
}
@@ -2731,6 +2808,7 @@ static HRESULT WINAPI d3dx_effect_SetFloatArray(ID3DXEffect *iface, D3DXHANDLE p
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
struct d3dx_parameter *param = get_valid_parameter(effect, parameter);
+ void *data;
TRACE("iface %p, parameter %p, f %p, count %u.\n", iface, parameter, f, count);
@@ -2745,9 +2823,9 @@ static HRESULT WINAPI d3dx_effect_SetFloatArray(ID3DXEffect *iface, D3DXHANDLE p
case D3DXPC_SCALAR:
case D3DXPC_VECTOR:
case D3DXPC_MATRIX_ROWS:
+ data = parameter_get_update_data(effect, param, size * sizeof(float), TRUE);
for (i = 0; i < size; ++i)
- set_number((DWORD *)param->data + i, param->type, &f[i], D3DXPT_FLOAT);
- set_dirty(param);
+ set_number((DWORD *)data + i, param->type, &f[i], D3DXPT_FLOAT);
return D3D_OK;
case D3DXPC_OBJECT:
@@ -2804,7 +2882,6 @@ static HRESULT WINAPI d3dx_effect_SetVector(ID3DXEffect *iface, D3DXHANDLE param
{
case D3DXPC_SCALAR:
case D3DXPC_VECTOR:
- set_dirty(param);
if (param->type == D3DXPT_INT && param->bytes == 4)
{
DWORD tmp;
@@ -2815,16 +2892,17 @@ static HRESULT WINAPI d3dx_effect_SetVector(ID3DXEffect *iface, D3DXHANDLE param
tmp += ((DWORD)(max(min(vector->x, 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 16;
tmp += ((DWORD)(max(min(vector->w, 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 24;
- *(int *)param->data = tmp;
+ *(int *)parameter_get_update_data(effect, param, sizeof(int), TRUE) = tmp;
return D3D_OK;
}
if (param->type == D3DXPT_FLOAT)
{
- memcpy(param->data, vector, param->columns * sizeof(float));
+ memcpy(parameter_get_update_data(effect, param, param->columns * sizeof(float), TRUE),
+ vector, param->columns * sizeof(float));
return D3D_OK;
}
- set_vector(param, vector);
+ set_vector(param, vector, parameter_get_update_data(effect, param, param->columns * sizeof(float), TRUE));
return D3D_OK;
case D3DXPC_MATRIX_ROWS:
@@ -2897,26 +2975,34 @@ static HRESULT WINAPI d3dx_effect_SetVectorArray(ID3DXEffect *iface, D3DXHANDLE
if (param && param->element_count && param->element_count >= count)
{
unsigned int i;
+ BYTE *data;
TRACE("Class %s.\n", debug_d3dxparameter_class(param->class));
switch (param->class)
{
case D3DXPC_VECTOR:
- set_dirty(param);
+ data = (BYTE *)parameter_get_update_data(effect, param,
+ count * param->columns * sizeof(float), TRUE);
+
if (param->type == D3DXPT_FLOAT)
{
if (param->columns == 4)
- memcpy(param->data, vector, count * 4 * sizeof(float));
+ {
+ memcpy(data, vector, count * 4 * sizeof(float));
+ }
else
+ {
for (i = 0; i < count; ++i)
- memcpy((float *)param->data + param->columns * i, vector + i,
+ memcpy((float *)data + param->columns * i, vector + i,
param->columns * sizeof(float));
+ }
return D3D_OK;
}
for (i = 0; i < count; ++i)
- set_vector(¶m->members[i], &vector[i]);
+ set_vector(¶m->members[i], &vector[i], data + i * param->columns * sizeof(float));
+
return D3D_OK;
case D3DXPC_SCALAR:
@@ -2991,8 +3077,8 @@ static HRESULT WINAPI d3dx_effect_SetMatrix(ID3DXEffect *iface, D3DXHANDLE param
switch (param->class)
{
case D3DXPC_MATRIX_ROWS:
- set_matrix(param, matrix);
- set_dirty(param);
+ set_matrix(param, matrix, parameter_get_update_data(effect, param,
+ param->rows * param->columns * sizeof(float), TRUE));
return D3D_OK;
case D3DXPC_SCALAR:
@@ -3057,15 +3143,20 @@ static HRESULT WINAPI d3dx_effect_SetMatrixArray(ID3DXEffect *iface, D3DXHANDLE
if (param && param->element_count >= count)
{
unsigned int i;
+ BYTE *data;
TRACE("Class %s.\n", debug_d3dxparameter_class(param->class));
switch (param->class)
{
case D3DXPC_MATRIX_ROWS:
- set_dirty(param);
+ data = parameter_get_update_data(effect, param, count * param->rows
+ * param->columns * sizeof(float), TRUE);
+
for (i = 0; i < count; ++i)
- set_matrix(¶m->members[i], &matrix[i]);
+ set_matrix(¶m->members[i], &matrix[i],
+ data + i * param->rows * param->columns * sizeof(float));
+
return D3D_OK;
case D3DXPC_SCALAR:
@@ -3137,13 +3228,18 @@ static HRESULT WINAPI d3dx_effect_SetMatrixPointerArray(ID3DXEffect *iface, D3DX
if (param && count <= param->element_count)
{
unsigned int i;
+ BYTE *data;
switch (param->class)
{
case D3DXPC_MATRIX_ROWS:
- set_dirty(param);
+ data = parameter_get_update_data(effect, param, count * param->rows
+ * param->columns * sizeof(float), TRUE);
+
for (i = 0; i < count; ++i)
- set_matrix(¶m->members[i], matrix[i]);
+ set_matrix(¶m->members[i], matrix[i], data + i * param->rows
+ * param->columns * sizeof(float));
+
return D3D_OK;
case D3DXPC_SCALAR:
@@ -3217,8 +3313,8 @@ static HRESULT WINAPI d3dx_effect_SetMatrixTranspose(ID3DXEffect *iface, D3DXHAN
switch (param->class)
{
case D3DXPC_MATRIX_ROWS:
- set_dirty(param);
- set_matrix_transpose(param, matrix);
+ set_matrix_transpose(param, matrix, parameter_get_update_data(effect, param,
+ param->rows * param->columns * sizeof(float), TRUE));
return D3D_OK;
case D3DXPC_SCALAR:
@@ -3287,15 +3383,20 @@ static HRESULT WINAPI d3dx_effect_SetMatrixTransposeArray(ID3DXEffect *iface, D3
if (param && param->element_count >= count)
{
unsigned int i;
+ BYTE *data;
TRACE("Class %s.\n", debug_d3dxparameter_class(param->class));
switch (param->class)
{
case D3DXPC_MATRIX_ROWS:
- set_dirty(param);
+ data = parameter_get_update_data(effect, param, count * param->rows
+ * param->columns * sizeof(float), TRUE);
+
for (i = 0; i < count; ++i)
- set_matrix_transpose(¶m->members[i], &matrix[i]);
+ set_matrix_transpose(¶m->members[i], &matrix[i], data
+ + i * param->rows * param->columns * sizeof(float));
+
return D3D_OK;
case D3DXPC_SCALAR:
@@ -3367,13 +3468,18 @@ static HRESULT WINAPI d3dx_effect_SetMatrixTransposePointerArray(ID3DXEffect *if
if (param && count <= param->element_count)
{
unsigned int i;
+ BYTE *data;
switch (param->class)
{
case D3DXPC_MATRIX_ROWS:
- set_dirty(param);
+ data = parameter_get_update_data(effect, param, count * param->rows
+ * param->columns * sizeof(float), TRUE);
+
for (i = 0; i < count; ++i)
- set_matrix_transpose(¶m->members[i], matrix[i]);
+ set_matrix_transpose(¶m->members[i], matrix[i], data
+ + i * param->rows * param->columns * sizeof(float));
+
return D3D_OK;
case D3DXPC_SCALAR:
@@ -3440,10 +3546,7 @@ static HRESULT WINAPI d3dx_effect_SetString(ID3DXEffect *iface, D3DXHANDLE param
TRACE("iface %p, parameter %p, string %s.\n", iface, parameter, debugstr_a(string));
if (param && param->type == D3DXPT_STRING)
- {
- set_dirty(param);
- return set_string(param->data, string);
- }
+ return set_string(parameter_get_update_data(effect, param, sizeof(void *), TRUE), string);
WARN("Parameter not found.\n");
@@ -3482,7 +3585,11 @@ static HRESULT WINAPI d3dx_effect_SetTexture(ID3DXEffect *iface, D3DXHANDLE para
|| param->type == D3DXPT_TEXTURE2D || param->type == D3DXPT_TEXTURE3D
|| param->type == D3DXPT_TEXTURECUBE))
{
- IDirect3DBaseTexture9 *old_texture = *(IDirect3DBaseTexture9 **)param->data;
+ IDirect3DBaseTexture9 **data = parameter_get_update_data(effect, param,
+ sizeof(void *), texture != *(IDirect3DBaseTexture9 **)param->data);
+ IDirect3DBaseTexture9 *old_texture = *data;
+
+ *data = texture;
if (texture == old_texture)
return D3D_OK;
@@ -3492,9 +3599,6 @@ static HRESULT WINAPI d3dx_effect_SetTexture(ID3DXEffect *iface, D3DXHANDLE para
if (old_texture)
IDirect3DBaseTexture9_Release(old_texture);
- *(IDirect3DBaseTexture9 **)param->data = texture;
- set_dirty(param);
-
return D3D_OK;
}
@@ -4135,6 +4239,10 @@ static D3DXHANDLE WINAPI d3dx_effect_EndParameterBlock(ID3DXEffect *iface)
return NULL;
}
ret = effect->current_parameter_block;
+
+ ret->buffer = heap_realloc(ret->buffer, ret->current_size);
+ ret->buffer_size = ret->current_size;
+
effect->current_parameter_block = NULL;
list_add_tail(&effect->parameter_block_list, &ret->entry);
return (D3DXHANDLE)ret;
diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c
index 86cad3e0cf..d86ae2acb5 100644
--- a/dlls/d3dx9_36/tests/effect.c
+++ b/dlls/d3dx9_36/tests/effect.c
@@ -8019,13 +8019,13 @@ static void test_effect_parameter_block(void)
static const float float_array_zero[4];
IDirect3DTexture9 *texture, *tex_test;
ID3DXEffect *effect, *effect2;
+ D3DXMATRIX mat, mat_arr[2];
D3DXHANDLE block, handle;
IDirect3DDevice9 *device;
ID3DXEffectPool *pool;
float float_array[4];
float float_value;
IDirect3D9 *d3d;
- D3DXMATRIX mat;
ULONG refcount;
HWND window;
HRESULT hr;
@@ -8112,9 +8112,7 @@ static void test_effect_parameter_block(void)
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = effect->lpVtbl->GetTexture(effect, "tex1", (IDirect3DBaseTexture9 **)&tex_test);
- todo_wine ok(hr == D3D_OK && !tex_test, "Got unexpected hr %#x, tex_test %p.\n", hr, tex_test);
- if (tex_test)
- IDirect3DTexture9_Release(tex_test);
+ ok(hr == D3D_OK && !tex_test, "Got unexpected hr %#x, tex_test %p.\n", hr, tex_test);
/* Child parameters and array members are recorded separately (the whole parameter is not
* updated when parameter block is applied).
@@ -8126,13 +8124,13 @@ static void test_effect_parameter_block(void)
hr = effect->lpVtbl->SetFloat(effect, "ts1[0].fv", 28.0f);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
- todo_wine ok(hr == D3D_OK && float_value == 12.0, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
+ ok(hr == D3D_OK && float_value == 12.0, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
float_array[0] = -29.0f;
hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v2", float_array, 1);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 1);
- todo_wine ok(hr == D3D_OK && float_array[0] == 13.0, "Got unexpected hr %#x, float_array[0] %g.\n",
+ ok(hr == D3D_OK && float_array[0] == 13.0, "Got unexpected hr %#x, float_array[0] %g.\n",
hr, float_array[0]);
memset(&mat, 0, sizeof(mat));
@@ -8140,13 +8138,13 @@ static void test_effect_parameter_block(void)
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- todo_wine ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
+ ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
hr = effect->lpVtbl->SetMatrix(effect, "m3x2column", &test_mat);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- todo_wine ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
+ ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
hr = effect2->lpVtbl->SetFloat(effect2, "arr2[1]", -1.0f);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
@@ -8238,6 +8236,30 @@ static void test_effect_parameter_block(void)
refcount = pool->lpVtbl->Release(pool);
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
+ hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_float, sizeof(test_effect_parameter_value_blob_float),
+ NULL, NULL, 0, NULL, &effect, NULL);
+ hr = effect->lpVtbl->BeginParameterBlock(effect);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ mat_arr[0] = mat_arr[1] = test_mat;
+ hr = effect->lpVtbl->SetMatrixArray(effect, "f33_2", mat_arr, 2);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ block = effect->lpVtbl->EndParameterBlock(effect);
+ ok(!!block, "Got unexpected block %p.\n", block);
+
+ memset(mat_arr, 0, sizeof(mat_arr));
+ hr = effect->lpVtbl->SetMatrixArray(effect, "f33_2", mat_arr, 2);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
+ todo_wine ok(hr == D3D_OK, "Got result %#x.\n", hr);
+
+ hr = effect->lpVtbl->GetMatrixArray(effect, "f33_2", mat_arr, 2);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ todo_wine ok(!memcmp(&mat_arr[0], &test_mat, sizeof(test_mat))
+ && !memcmp(&mat_arr[1], &test_mat, sizeof(test_mat)), "Got unexpected matrix array.\n");
+
+ refcount = effect->lpVtbl->Release(effect);
+ ok(!refcount, "Got unexpected refcount %u.\n", refcount);
+
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
IDirect3D9_Release(d3d);
--
2.23.0
2
2
[PATCH] msvcp140/tests: Test _Stat() against the actual permissions of the system directory.
by Sven Baars Nov. 18, 2019
by Sven Baars Nov. 18, 2019
Nov. 18, 2019
Signed-off-by: Sven Baars <sven.wine(a)gmail.com>
---
Supercedes 173786
dlls/msvcp140/tests/msvcp140.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c
index 8ad172495d..751b1beed8 100644
--- a/dlls/msvcp140/tests/msvcp140.c
+++ b/dlls/msvcp140/tests/msvcp140.c
@@ -786,8 +786,9 @@ static void test_Current_set(void)
static void test_Stat(void)
{
- int i, perms, ret;
+ int i, perms, expected_perms, ret;
HANDLE file;
+ DWORD attr;
enum file_type val;
WCHAR test_dirW[] = {'w','i','n','e','_','t','e','s','t','_','d','i','r',0};
WCHAR test_f1W[] = {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','f','1',0};
@@ -889,10 +890,12 @@ static void test_Stat(void)
}
GetSystemDirectoryW(sys_path, MAX_PATH);
+ attr = GetFileAttributesW(sys_path);
+ expected_perms = (attr & FILE_ATTRIBUTE_READONLY) ? 0555 : 0777;
perms = 0xdeadbeef;
val = p_Stat(sys_path, &perms);
ok(directory_file == val, "_Stat(): expect: regular, got %d\n", val);
- ok(0777 == perms, "_Stat(): perms expect: 0777, got 0%o\n", perms);
+ ok(perms == expected_perms, "_Stat(): perms expect: 0%o, got 0%o\n", expected_perms, perms);
if(ret) {
todo_wine ok(DeleteFileW(test_f1_linkW), "expect wine_test_dir/f1_link to exist\n");
--
2.17.1
2
1
[PATCH 2/2] kernel32: Autoinitialize geographic values when launching any program.
by João Diogo Ferreira Nov. 18, 2019
by João Diogo Ferreira Nov. 18, 2019
Nov. 18, 2019
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46196
Signed-off-by: João Diogo Craveiro Ferreira <devilj(a)outlook.pt>
---
V8: Use a fallback in case we don't get the right nation ID.
Supersedes: 173826
---
dlls/kernel32/kernel_main.c | 3 +++
dlls/kernel32/kernel_private.h | 1 +
dlls/kernel32/locale.c | 12 ++++++++++++
3 files changed, 16 insertions(+)
diff --git a/dlls/kernel32/kernel_main.c b/dlls/kernel32/kernel_main.c
index dfa66f0295..206972c210 100644
--- a/dlls/kernel32/kernel_main.c
+++ b/dlls/kernel32/kernel_main.c
@@ -88,6 +88,9 @@ static BOOL process_attach( HMODULE module )
/* Setup registry locale information */
LOCALE_InitRegistry();
+ /* Setup registry geographic information */
+ LOCALE_InitGeo();
+
/* Setup registry timezone information */
TIMEZONE_InitRegistry();
diff --git a/dlls/kernel32/kernel_private.h b/dlls/kernel32/kernel_private.h
index cd6c63efa3..e9f5f51029 100644
--- a/dlls/kernel32/kernel_private.h
+++ b/dlls/kernel32/kernel_private.h
@@ -75,6 +75,7 @@ extern void COMPUTERNAME_Init(void) DECLSPEC_HIDDEN;
/* locale.c */
extern void LOCALE_Init(void) DECLSPEC_HIDDEN;
extern void LOCALE_InitRegistry(void) DECLSPEC_HIDDEN;
+extern void LOCALE_InitGeo(void) DECLSPEC_HIDDEN;
/* time.c */
extern void TIMEZONE_InitRegistry(void) DECLSPEC_HIDDEN;
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 0f91728e84..208c792e39 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -845,6 +845,18 @@ void LOCALE_InitRegistry(void)
NtClose( hkey );
}
+/* Initialize the geographic information in the registry. */
+void LOCALE_InitGeo(void)
+{
+ GEOID id = GEOID_NOT_AVAILABLE;
+ static const GEOID fallback = 244; /* United States */
+
+ GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_IGEOID|LOCALE_RETURN_NUMBER,
+ (WCHAR *)&id, sizeof(id) / sizeof(WCHAR));
+
+ if (!SetUserGeoID(id) || GetUserGeoID(GEOCLASS_NATION) == GEOID_NOT_AVAILABLE)
+ SetUserGeoID(fallback);
+}
#ifdef __APPLE__
/***********************************************************************
--
2.24.0
2
1
Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr>
--
See
https://jira.reactos.org/browse/CORE-11713
---
dlls/shell32/classes.c | 7 ++++++-
dlls/shell32/folders.c | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/classes.c b/dlls/shell32/classes.c
index 653b551..4e57125 100644
--- a/dlls/shell32/classes.c
+++ b/dlls/shell32/classes.c
@@ -309,7 +309,12 @@ BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, int* picon_idx
ret = HCR_RegGetDefaultIconA(hkey, szDest, len, picon_idx);
RegCloseKey(hkey);
}
- TRACE("-- %s %i\n", szDest, *picon_idx);
+
+ if (ret)
+ TRACE("-- %s %i\n", szDest, *picon_idx);
+ else
+ TRACE("-- not found\n");
+
return ret;
}
diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c
index 5bb1a33..d429075 100644
--- a/dlls/shell32/folders.c
+++ b/dlls/shell32/folders.c
@@ -248,7 +248,7 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UIN
{
static const WCHAR drive[] = { 'D','r','i','v','e',0 };
- int icon_idx = -1;
+ icon_idx = -1;
if (_ILGetDrive(pSimplePidl, sTemp, MAX_PATH))
{
--
2.10.0.windows.1
1
0