Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
December 2019
- 73 participants
- 1394 messages
Re: [PATCH 2/5] winegstreamer: Store the sink as a strmbase_sink structure.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61838
Your paranoid android.
=== debian10 (32 bit report) ===
qcap:
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7e03dd37).
Report errors:
qcap:qcap crashed (c0000005)
=== debian10 (32 bit Chinese:China report) ===
qcap:
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7e248d37).
Report errors:
qcap:qcap crashed (c0000005)
=== debian10 (32 bit WoW report) ===
qcap:
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7e03dd37).
Report errors:
qcap:qcap crashed (c0000005)
=== debian10 (64 bit WoW report) ===
qcap:
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7e040d37).
Report errors:
qcap:qcap crashed (c0000005)
Dec. 11, 2019
Re: [PATCH 1/5] qcap/avimux: Use strmbase sink connection methods.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61837
Your paranoid android.
=== debian10 (32 bit report) ===
qcap:
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7e04cd37).
Report errors:
qcap:qcap crashed (c0000005)
=== debian10 (32 bit Chinese:China report) ===
qcap:
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7e2b7d37).
Report errors:
qcap:qcap crashed (c0000005)
=== debian10 (32 bit WoW report) ===
qcap:
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7dfdad37).
Report errors:
qcap:qcap crashed (c0000005)
=== debian10 (64 bit WoW report) ===
qcap:
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7e040d37).
Report errors:
qcap:qcap crashed (c0000005)
Dec. 11, 2019
[PATCH 5/5] qedit/samplegrabber: Use strmbase sink connection methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qedit/samplegrabber.c | 74 ++++++++++++++++----------------------
1 file changed, 30 insertions(+), 44 deletions(-)
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c
index c65ab9caa70..91b8d9dce64 100644
--- a/dlls/qedit/samplegrabber.c
+++ b/dlls/qedit/samplegrabber.c
@@ -446,49 +446,6 @@ SampleGrabber_IMemInputPin_ReceiveCanBlock(IMemInputPin *iface)
return This->memOutput ? IMemInputPin_ReceiveCanBlock(This->memOutput) : S_OK;
}
-/* IPin - input pin */
-static HRESULT WINAPI
-SampleGrabber_In_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_MEDIA_TYPE *type)
-{
- SG_Impl *filter = CONTAINING_RECORD(iface, SG_Impl, sink.pin.IPin_iface);
-
- TRACE("filter %p, connector %p, type %p.\n", filter, connector, type);
-
- if (!connector)
- return E_POINTER;
- if (filter->sink.pin.peer)
- return VFW_E_ALREADY_CONNECTED;
- if (filter->filter.state != State_Stopped)
- return VFW_E_NOT_STOPPED;
- if (type) {
- TRACE("Media type: %s/%s ssize: %u format: %s (%u bytes)\n",
- debugstr_guid(&type->majortype), debugstr_guid(&type->subtype),
- type->lSampleSize,
- debugstr_guid(&type->formattype), type->cbFormat);
- if (!IsEqualGUID(&type->formattype, &FORMAT_None) &&
- !IsEqualGUID(&type->formattype, &GUID_NULL) &&
- !type->pbFormat)
- return VFW_E_INVALIDMEDIATYPE;
- if (!IsEqualGUID(&filter->mtype.majortype,&GUID_NULL) &&
- !IsEqualGUID(&filter->mtype.majortype,&type->majortype))
- return VFW_E_TYPE_NOT_ACCEPTED;
- if (!IsEqualGUID(&filter->mtype.subtype,&MEDIASUBTYPE_None) &&
- !IsEqualGUID(&filter->mtype.subtype,&type->subtype))
- return VFW_E_TYPE_NOT_ACCEPTED;
- if (!IsEqualGUID(&filter->mtype.formattype,&GUID_NULL) &&
- !IsEqualGUID(&filter->mtype.formattype,&FORMAT_None) &&
- !IsEqualGUID(&filter->mtype.formattype,&type->formattype))
- return VFW_E_TYPE_NOT_ACCEPTED;
-
- FreeMediaType(&filter->mtype);
- CopyMediaType(&filter->mtype, type);
- CopyMediaType(&filter->sink.pin.mt, type);
- }
- IPin_AddRef(filter->sink.pin.peer = connector);
-
- return S_OK;
-}
-
static const ISampleGrabberVtbl ISampleGrabber_VTable =
{
SampleGrabber_ISampleGrabber_QueryInterface,
@@ -522,7 +479,7 @@ static const IPinVtbl sink_vtbl =
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
- SampleGrabber_In_IPin_ReceiveConnection,
+ BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
@@ -574,11 +531,40 @@ static HRESULT sample_grabber_sink_get_media_type(struct strmbase_pin *iface,
return VFW_S_NO_MORE_ITEMS;
}
+static HRESULT sample_grabber_sink_connect(struct strmbase_sink *iface,
+ IPin *peer, const AM_MEDIA_TYPE *mt)
+{
+ SG_Impl *filter = impl_from_sink_pin(&iface->pin);
+
+ if (!IsEqualGUID(&mt->formattype, &FORMAT_None)
+ && !IsEqualGUID(&mt->formattype, &GUID_NULL) && !mt->pbFormat)
+ return VFW_E_INVALIDMEDIATYPE;
+
+ if (!IsEqualGUID(&filter->mtype.majortype, &GUID_NULL)
+ && !IsEqualGUID(&filter->mtype.majortype, &mt->majortype))
+ return VFW_E_TYPE_NOT_ACCEPTED;
+
+ if (!IsEqualGUID(&filter->mtype.subtype,&MEDIASUBTYPE_None)
+ && !IsEqualGUID(&filter->mtype.subtype, &mt->subtype))
+ return VFW_E_TYPE_NOT_ACCEPTED;
+
+ if (!IsEqualGUID(&filter->mtype.formattype, &GUID_NULL)
+ && !IsEqualGUID(&filter->mtype.formattype, &FORMAT_None)
+ && !IsEqualGUID(&filter->mtype.formattype, &mt->formattype))
+ return VFW_E_TYPE_NOT_ACCEPTED;
+
+ FreeMediaType(&filter->mtype);
+ CopyMediaType(&filter->mtype, mt);
+
+ return S_OK;
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_interface = sample_grabber_sink_query_interface,
.base.pin_query_accept = sample_grabber_sink_query_accept,
.base.pin_get_media_type = sample_grabber_sink_get_media_type,
+ .sink_connect = sample_grabber_sink_connect,
};
static inline SG_Impl *impl_from_source_pin(struct strmbase_pin *iface)
--
2.24.0
Dec. 11, 2019
[PATCH 4/5] qcap/avico: Use base sink connection methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qcap/avico.c | 58 ++++++++++++++---------------------------------
1 file changed, 17 insertions(+), 41 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c
index f822d4e4616..ecda162be86 100644
--- a/dlls/qcap/avico.c
+++ b/dlls/qcap/avico.c
@@ -272,52 +272,13 @@ static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = {
AVICompressorPropertyBag_Save
};
-static inline AVICompressor *impl_from_IPin(IPin *iface)
-{
- return impl_from_strmbase_filter(CONTAINING_RECORD(iface, struct strmbase_pin, IPin_iface)->filter);
-}
-
-static HRESULT WINAPI AVICompressorIn_ReceiveConnection(IPin *iface,
- IPin *pConnector, const AM_MEDIA_TYPE *pmt)
-{
- AVICompressor *This = impl_from_IPin(iface);
- HRESULT hres;
-
- TRACE("(%p)->(%p AM_MEDIA_TYPE(%p))\n", This, pConnector, pmt);
-
- hres = BaseInputPinImpl_ReceiveConnection(iface, pConnector, pmt);
- if(FAILED(hres))
- return hres;
-
- hres = fill_format_info(This, (VIDEOINFOHEADER*)pmt->pbFormat);
- if(FAILED(hres))
- BaseInputPinImpl_Disconnect(iface);
- return hres;
-}
-
-static HRESULT WINAPI AVICompressorIn_Disconnect(IPin *iface)
-{
- AVICompressor *This = impl_from_IPin(iface);
- HRESULT hres;
-
- TRACE("(%p)\n", This);
-
- hres = BaseInputPinImpl_Disconnect(iface);
- if(FAILED(hres))
- return hres;
-
- heap_free(This->videoinfo);
- This->videoinfo = NULL;
- return S_OK;
-}
-
static const IPinVtbl AVICompressorInputPinVtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
- AVICompressorIn_ReceiveConnection,
- AVICompressorIn_Disconnect,
+ BaseInputPinImpl_ReceiveConnection,
+ BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
@@ -465,12 +426,27 @@ static HRESULT WINAPI AVICompressorIn_Receive(struct strmbase_sink *base, IMedia
return hres;
}
+static HRESULT sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
+{
+ AVICompressor *filter = impl_from_strmbase_pin(&iface->pin);
+ return fill_format_info(filter, (VIDEOINFOHEADER *)mt->pbFormat);
+}
+
+static void sink_disconnect(struct strmbase_sink *iface)
+{
+ AVICompressor *filter = impl_from_strmbase_pin(&iface->pin);
+ heap_free(filter->videoinfo);
+ filter->videoinfo = NULL;
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
.base.pin_get_media_type = strmbase_pin_get_media_type,
.base.pin_query_interface = sink_query_interface,
.pfnReceive = AVICompressorIn_Receive,
+ .sink_connect = sink_connect,
+ .sink_disconnect = sink_disconnect,
};
static HRESULT source_get_media_type(struct strmbase_pin *base, unsigned int iPosition, AM_MEDIA_TYPE *amt)
--
2.24.0
Dec. 11, 2019
[PATCH 3/5] winegstreamer: Use base sink connection methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winegstreamer/gstdemux.c | 182 ++++++++++++++--------------------
1 file changed, 74 insertions(+), 108 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 589a7b7af17..fb60d69e2ac 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1343,6 +1343,11 @@ static const struct strmbase_filter_ops filter_ops =
.filter_wait_state = gstdemux_wait_state,
};
+static inline struct gstdemux *impl_from_strmbase_sink(struct strmbase_sink *iface)
+{
+ return CONTAINING_RECORD(iface, struct gstdemux, sink);
+}
+
static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
{
if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Stream))
@@ -1350,10 +1355,71 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_FALSE;
}
+static HRESULT gstdemux_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *pmt)
+{
+ struct gstdemux *filter = impl_from_strmbase_sink(iface);
+ IMemAllocator *allocator = NULL;
+ ALLOCATOR_PROPERTIES props;
+ HRESULT hr = S_OK;
+
+ mark_wine_thread();
+
+ props.cBuffers = 8;
+ props.cbBuffer = 16384;
+ props.cbAlign = 1;
+ props.cbPrefix = 0;
+
+ filter->reader = NULL;
+ filter->alloc = NULL;
+ if (FAILED(hr = IPin_QueryInterface(peer, &IID_IAsyncReader, (void **)&filter->reader)))
+ return hr;
+
+ if (FAILED(hr = GST_Connect(filter, peer, &props)))
+ goto err;
+
+ /* Some applications depend on IAsyncReader::RequestAllocator() passing a
+ * non-NULL preferred allocator. */
+ hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
+ &IID_IMemAllocator, (void **)&allocator);
+ if (FAILED(hr))
+ goto err;
+ hr = IAsyncReader_RequestAllocator(filter->reader, allocator, &props, &filter->alloc);
+ IMemAllocator_Release(allocator);
+ if (FAILED(hr))
+ {
+ WARN("Failed to get allocator, hr %#x.\n", hr);
+ goto err;
+ }
+
+ if (FAILED(hr = IMemAllocator_Commit(filter->alloc)))
+ {
+ WARN("Failed to commit allocator, hr %#x.\n", hr);
+ goto err;
+ }
+
+ return S_OK;
+err:
+ GST_RemoveOutputPins(filter);
+ IAsyncReader_Release(filter->reader);
+ return hr;
+}
+
+static void gstdemux_sink_disconnect(struct strmbase_sink *iface)
+{
+ struct gstdemux *filter = impl_from_strmbase_sink(iface);
+
+ mark_wine_thread();
+
+ IMemAllocator_Decommit(filter->alloc);
+ GST_RemoveOutputPins(filter);
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
.base.pin_get_media_type = strmbase_pin_get_media_type,
+ .sink_connect = gstdemux_sink_connect,
+ .sink_disconnect = gstdemux_sink_disconnect,
};
static BOOL gstdecoder_init_gst(struct gstdemux *filter)
@@ -1901,112 +1967,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
return S_OK;
}
-static inline struct gstdemux *impl_from_sink_IPin(IPin *iface)
-{
- return CONTAINING_RECORD(iface, struct gstdemux, sink.pin.IPin_iface);
-}
-
-static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
-{
- struct gstdemux *filter = impl_from_sink_IPin(iface);
- PIN_DIRECTION pindirReceive;
- HRESULT hr = S_OK;
-
- TRACE("filter %p, peer %p, mt %p.\n", filter, pReceivePin, pmt);
- strmbase_dump_media_type(pmt);
-
- mark_wine_thread();
-
- EnterCriticalSection(&filter->filter.csFilter);
- if (!filter->sink.pin.peer)
- {
- ALLOCATOR_PROPERTIES props;
- IMemAllocator *pAlloc = NULL;
-
- props.cBuffers = 8;
- props.cbBuffer = 16384;
- props.cbAlign = 1;
- props.cbPrefix = 0;
-
- if (IPin_QueryAccept(iface, pmt) != S_OK)
- hr = VFW_E_TYPE_NOT_ACCEPTED;
-
- if (SUCCEEDED(hr)) {
- IPin_QueryDirection(pReceivePin, &pindirReceive);
- if (pindirReceive != PINDIR_OUTPUT) {
- ERR("Can't connect from non-output pin\n");
- hr = VFW_E_INVALID_DIRECTION;
- }
- }
-
- filter->reader = NULL;
- filter->alloc = NULL;
- if (SUCCEEDED(hr))
- hr = IPin_QueryInterface(pReceivePin, &IID_IAsyncReader, (LPVOID *)&filter->reader);
- if (SUCCEEDED(hr))
- hr = GST_Connect(filter, pReceivePin, &props);
-
- /* A certain IAsyncReader::RequestAllocator expects to be passed
- non-NULL preferred allocator */
- if (SUCCEEDED(hr))
- hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
- &IID_IMemAllocator, (LPVOID *)&pAlloc);
- if (SUCCEEDED(hr)) {
- hr = IAsyncReader_RequestAllocator(filter->reader, pAlloc, &props, &filter->alloc);
- if (FAILED(hr))
- WARN("Can't get an allocator, got %08x\n", hr);
- }
- if (pAlloc)
- IMemAllocator_Release(pAlloc);
- if (SUCCEEDED(hr)) {
- CopyMediaType(&filter->sink.pin.mt, pmt);
- filter->sink.pin.peer = pReceivePin;
- IPin_AddRef(pReceivePin);
- hr = IMemAllocator_Commit(filter->alloc);
- } else {
- GST_RemoveOutputPins(filter);
- if (filter->reader)
- IAsyncReader_Release(filter->reader);
- filter->reader = NULL;
- if (filter->alloc)
- IMemAllocator_Release(filter->alloc);
- filter->alloc = NULL;
- }
- TRACE("Size: %i\n", props.cbBuffer);
- } else
- hr = VFW_E_ALREADY_CONNECTED;
- LeaveCriticalSection(&filter->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI GSTInPin_Disconnect(IPin *iface)
-{
- struct gstdemux *filter = impl_from_sink_IPin(iface);
- HRESULT hr;
- FILTER_STATE state;
-
- TRACE("filter %p.\n", filter);
-
- mark_wine_thread();
-
- hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state);
- EnterCriticalSection(&filter->filter.csFilter);
- if (filter->sink.pin.peer)
- {
- if (SUCCEEDED(hr) && state == State_Stopped) {
- IMemAllocator_Decommit(filter->alloc);
- IPin_Disconnect(filter->sink.pin.peer);
- IPin_Release(filter->sink.pin.peer);
- filter->sink.pin.peer = NULL;
- hr = GST_RemoveOutputPins(filter);
- } else
- hr = VFW_E_NOT_STOPPED;
- } else
- hr = S_FALSE;
- LeaveCriticalSection(&filter->filter.csFilter);
- return hr;
-}
-
static HRESULT WINAPI GSTInPin_EndOfStream(IPin *iface)
{
FIXME("iface %p, stub!\n", iface);
@@ -2040,8 +2000,8 @@ static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
- GSTInPin_ReceiveConnection,
- GSTInPin_Disconnect,
+ BaseInputPinImpl_ReceiveConnection,
+ BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
@@ -2220,6 +2180,8 @@ static const struct strmbase_sink_ops wave_parser_sink_ops =
{
.base.pin_query_accept = wave_parser_sink_query_accept,
.base.pin_get_media_type = strmbase_pin_get_media_type,
+ .sink_connect = gstdemux_sink_connect,
+ .sink_disconnect = gstdemux_sink_disconnect,
};
static BOOL wave_parser_init_gst(struct gstdemux *filter)
@@ -2322,6 +2284,8 @@ static const struct strmbase_sink_ops avi_splitter_sink_ops =
{
.base.pin_query_accept = avi_splitter_sink_query_accept,
.base.pin_get_media_type = strmbase_pin_get_media_type,
+ .sink_connect = gstdemux_sink_connect,
+ .sink_disconnect = gstdemux_sink_disconnect,
};
static BOOL avi_splitter_init_gst(struct gstdemux *filter)
@@ -2430,6 +2394,8 @@ static const struct strmbase_sink_ops mpeg_splitter_sink_ops =
{
.base.pin_query_accept = mpeg_splitter_sink_query_accept,
.base.pin_get_media_type = strmbase_pin_get_media_type,
+ .sink_connect = gstdemux_sink_connect,
+ .sink_disconnect = gstdemux_sink_disconnect,
};
static BOOL mpeg_splitter_init_gst(struct gstdemux *filter)
--
2.24.0
Dec. 11, 2019
[PATCH 2/5] winegstreamer: Store the sink as a strmbase_sink structure.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winegstreamer/gstdemux.c | 83 ++++++++++++++---------------------
1 file changed, 34 insertions(+), 49 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index e7d0313d7ce..589a7b7af17 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -52,7 +52,7 @@ struct gstdemux
struct strmbase_filter filter;
IAMStreamSelect IAMStreamSelect_iface;
- struct strmbase_pin sink;
+ struct strmbase_sink sink;
IAsyncReader *reader;
IMemAllocator *alloc;
struct gstdemux_source **ppPins;
@@ -1184,7 +1184,7 @@ static struct strmbase_pin *gstdemux_get_pin(struct strmbase_filter *base, unsig
struct gstdemux *filter = impl_from_strmbase_filter(base);
if (!index)
- return &filter->sink;
+ return &filter->sink.pin;
else if (index <= filter->cStreams)
return &filter->ppPins[index - 1]->pin.pin;
return NULL;
@@ -1199,28 +1199,27 @@ static void gstdemux_destroy(struct strmbase_filter *iface)
CloseHandle(filter->duration_event);
/* Don't need to clean up output pins, disconnecting input pin will do that */
- if (filter->sink.peer)
+ if (filter->sink.pin.peer)
{
- hr = IPin_Disconnect(filter->sink.peer);
+ hr = IPin_Disconnect(filter->sink.pin.peer);
assert(hr == S_OK);
- hr = IPin_Disconnect(&filter->sink.IPin_iface);
+ hr = IPin_Disconnect(&filter->sink.pin.IPin_iface);
assert(hr == S_OK);
}
- FreeMediaType(&filter->sink.mt);
if (filter->alloc)
IMemAllocator_Release(filter->alloc);
filter->alloc = NULL;
if (filter->reader)
IAsyncReader_Release(filter->reader);
filter->reader = NULL;
- filter->sink.IPin_iface.lpVtbl = NULL;
if (filter->bus)
{
gst_bus_set_sync_handler(filter->bus, NULL, NULL, NULL);
gst_object_unref(filter->bus);
}
+ strmbase_sink_cleanup(&filter->sink);
strmbase_filter_cleanup(&filter->filter);
heap_free(filter);
}
@@ -1351,10 +1350,10 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_FALSE;
}
-static const BasePinFuncTable sink_ops =
+static const struct strmbase_sink_ops sink_ops =
{
- .pin_query_accept = sink_query_accept,
- .pin_get_media_type = strmbase_pin_get_media_type,
+ .base.pin_query_accept = sink_query_accept,
+ .base.pin_get_media_type = strmbase_pin_get_media_type,
};
static BOOL gstdecoder_init_gst(struct gstdemux *filter)
@@ -1437,13 +1436,10 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_Gstreamer_Splitter, &filter_ops);
+ strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
+ wcsInputPinName, &sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
- object->sink.dir = PINDIR_INPUT;
- object->sink.filter = &object->filter;
- lstrcpynW(object->sink.name, wcsInputPinName, ARRAY_SIZE(object->sink.name));
- object->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl;
- object->sink.pFuncsTable = &sink_ops;
object->init_gst = gstdecoder_init_gst;
*phr = S_OK;
@@ -1907,7 +1903,7 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
static inline struct gstdemux *impl_from_sink_IPin(IPin *iface)
{
- return CONTAINING_RECORD(iface, struct gstdemux, sink.IPin_iface);
+ return CONTAINING_RECORD(iface, struct gstdemux, sink.pin.IPin_iface);
}
static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
@@ -1922,7 +1918,7 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
mark_wine_thread();
EnterCriticalSection(&filter->filter.csFilter);
- if (!filter->sink.peer)
+ if (!filter->sink.pin.peer)
{
ALLOCATOR_PROPERTIES props;
IMemAllocator *pAlloc = NULL;
@@ -1963,8 +1959,8 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
if (pAlloc)
IMemAllocator_Release(pAlloc);
if (SUCCEEDED(hr)) {
- CopyMediaType(&filter->sink.mt, pmt);
- filter->sink.peer = pReceivePin;
+ CopyMediaType(&filter->sink.pin.mt, pmt);
+ filter->sink.pin.peer = pReceivePin;
IPin_AddRef(pReceivePin);
hr = IMemAllocator_Commit(filter->alloc);
} else {
@@ -1995,13 +1991,13 @@ static HRESULT WINAPI GSTInPin_Disconnect(IPin *iface)
hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state);
EnterCriticalSection(&filter->filter.csFilter);
- if (filter->sink.peer)
+ if (filter->sink.pin.peer)
{
if (SUCCEEDED(hr) && state == State_Stopped) {
IMemAllocator_Decommit(filter->alloc);
- IPin_Disconnect(filter->sink.peer);
- IPin_Release(filter->sink.peer);
- filter->sink.peer = NULL;
+ IPin_Disconnect(filter->sink.pin.peer);
+ IPin_Release(filter->sink.pin.peer);
+ filter->sink.pin.peer = NULL;
hr = GST_RemoveOutputPins(filter);
} else
hr = VFW_E_NOT_STOPPED;
@@ -2220,10 +2216,10 @@ static HRESULT wave_parser_sink_query_accept(struct strmbase_pin *iface, const A
return S_FALSE;
}
-static const BasePinFuncTable wave_parser_sink_ops =
+static const struct strmbase_sink_ops wave_parser_sink_ops =
{
- .pin_query_accept = wave_parser_sink_query_accept,
- .pin_get_media_type = strmbase_pin_get_media_type,
+ .base.pin_query_accept = wave_parser_sink_query_accept,
+ .base.pin_get_media_type = strmbase_pin_get_media_type,
};
static BOOL wave_parser_init_gst(struct gstdemux *filter)
@@ -2305,12 +2301,8 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops);
-
- object->sink.dir = PINDIR_INPUT;
- object->sink.filter = &object->filter;
- lstrcpynW(object->sink.name, sink_name, ARRAY_SIZE(object->sink.name));
- object->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl;
- object->sink.pFuncsTable = &wave_parser_sink_ops;
+ strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
+ sink_name, &wave_parser_sink_ops, NULL);
object->init_gst = wave_parser_init_gst;
*phr = S_OK;
@@ -2326,10 +2318,10 @@ static HRESULT avi_splitter_sink_query_accept(struct strmbase_pin *iface, const
return S_FALSE;
}
-static const BasePinFuncTable avi_splitter_sink_ops =
+static const struct strmbase_sink_ops avi_splitter_sink_ops =
{
- .pin_query_accept = avi_splitter_sink_query_accept,
- .pin_get_media_type = strmbase_pin_get_media_type,
+ .base.pin_query_accept = avi_splitter_sink_query_accept,
+ .base.pin_get_media_type = strmbase_pin_get_media_type,
};
static BOOL avi_splitter_init_gst(struct gstdemux *filter)
@@ -2411,13 +2403,9 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops);
-
+ strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
+ sink_name, &avi_splitter_sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
- object->sink.dir = PINDIR_INPUT;
- object->sink.filter = &object->filter;
- lstrcpynW(object->sink.name, sink_name, ARRAY_SIZE(object->sink.name));
- object->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl;
- object->sink.pFuncsTable = &avi_splitter_sink_ops;
object->init_gst = avi_splitter_init_gst;
*phr = S_OK;
@@ -2438,10 +2426,10 @@ static HRESULT mpeg_splitter_sink_query_accept(struct strmbase_pin *iface, const
return S_FALSE;
}
-static const BasePinFuncTable mpeg_splitter_sink_ops =
+static const struct strmbase_sink_ops mpeg_splitter_sink_ops =
{
- .pin_query_accept = mpeg_splitter_sink_query_accept,
- .pin_get_media_type = strmbase_pin_get_media_type,
+ .base.pin_query_accept = mpeg_splitter_sink_query_accept,
+ .base.pin_get_media_type = strmbase_pin_get_media_type,
};
static BOOL mpeg_splitter_init_gst(struct gstdemux *filter)
@@ -2549,14 +2537,11 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops);
+ strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
+ sink_name, &mpeg_splitter_sink_ops, NULL);
object->IAMStreamSelect_iface.lpVtbl = &stream_select_vtbl;
object->duration_event = CreateEventW(NULL, FALSE, FALSE, NULL);
- object->sink.dir = PINDIR_INPUT;
- object->sink.filter = &object->filter;
- lstrcpynW(object->sink.name, sink_name, ARRAY_SIZE(object->sink.name));
- object->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl;
- object->sink.pFuncsTable = &mpeg_splitter_sink_ops;
object->init_gst = mpeg_splitter_init_gst;
*phr = S_OK;
--
2.24.0
Dec. 11, 2019
[PATCH 1/5] qcap/avimux: Use strmbase sink connection methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qcap/avimux.c | 71 ++++++++++++++++------------------------------
1 file changed, 25 insertions(+), 46 deletions(-)
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c
index 63e98e8877b..c17d91322bf 100644
--- a/dlls/qcap/avimux.c
+++ b/dlls/qcap/avimux.c
@@ -1410,41 +1410,15 @@ static HRESULT WINAPI AviMuxIn_Receive(struct strmbase_sink *base, IMediaSample
return hr;
}
-static const struct strmbase_sink_ops sink_ops =
-{
- .base.pin_query_interface = sink_query_interface,
- .base.pin_query_accept = sink_query_accept,
- .base.pin_get_media_type = strmbase_pin_get_media_type,
- .pfnReceive = AviMuxIn_Receive,
-};
-
-static inline AviMux* impl_from_in_IPin(IPin *iface)
+static HRESULT avi_mux_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *pmt)
{
- struct strmbase_pin *pin = CONTAINING_RECORD(iface, struct strmbase_pin, IPin_iface);
- return impl_from_strmbase_filter(pin->filter);
-}
-
-static inline AviMuxIn* AviMuxIn_from_IPin(IPin *iface)
-{
- return CONTAINING_RECORD(iface, AviMuxIn, pin.pin.IPin_iface);
-}
-
-static HRESULT WINAPI AviMuxIn_ReceiveConnection(IPin *iface,
- IPin *pConnector, const AM_MEDIA_TYPE *pmt)
-{
- AviMux *This = impl_from_in_IPin(iface);
- AviMuxIn *avimuxin = AviMuxIn_from_IPin(iface);
+ AviMuxIn *avimuxin = impl_sink_from_strmbase_pin(&iface->pin);
+ AviMux *This = impl_from_strmbase_filter(iface->pin.filter);
HRESULT hr;
- TRACE("pin %p, pConnector %p, pmt %p.\n", avimuxin, pConnector, pmt);
-
if(!pmt)
return E_POINTER;
- hr = BaseInputPinImpl_ReceiveConnection(iface, pConnector, pmt);
- if(FAILED(hr))
- return hr;
-
if(IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) &&
IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
ALLOCATOR_PROPERTIES req, act;
@@ -1468,10 +1442,8 @@ static HRESULT WINAPI AviMuxIn_ReceiveConnection(IPin *iface,
hr = IMemAllocator_SetProperties(avimuxin->samples_allocator, &req, &act);
if(SUCCEEDED(hr))
hr = IMemAllocator_Commit(avimuxin->samples_allocator);
- if(FAILED(hr)) {
- BaseInputPinImpl_Disconnect(iface);
+ if (FAILED(hr))
return hr;
- }
size = pmt->cbFormat - FIELD_OFFSET(VIDEOINFOHEADER, bmiHeader);
avimuxin->strf = CoTaskMemAlloc(sizeof(RIFFCHUNK) + ALIGN(FIELD_OFFSET(BITMAPINFO, bmiColors[vih->bmiHeader.biClrUsed])));
@@ -1489,23 +1461,15 @@ static HRESULT WINAPI AviMuxIn_ReceiveConnection(IPin *iface,
return create_input_pin(This);
}
-static HRESULT WINAPI AviMuxIn_Disconnect(IPin *iface)
+static void avi_mux_sink_disconnect(struct strmbase_sink *iface)
{
- AviMuxIn *avimuxin = AviMuxIn_from_IPin(iface);
+ AviMuxIn *avimuxin = impl_sink_from_strmbase_pin(&iface->pin);
IMediaSample **prev, *cur;
- HRESULT hr;
-
- TRACE("pin %p.\n", avimuxin);
-
- hr = BaseInputPinImpl_Disconnect(iface);
- if(FAILED(hr))
- return hr;
IMemAllocator_Decommit(avimuxin->samples_allocator);
while(avimuxin->samples_head) {
cur = avimuxin->samples_head;
- hr = IMediaSample_GetPointer(cur, (BYTE**)&prev);
- if(FAILED(hr))
+ if (FAILED(IMediaSample_GetPointer(cur, (BYTE **)&prev)))
break;
prev--;
@@ -1518,7 +1482,22 @@ static HRESULT WINAPI AviMuxIn_Disconnect(IPin *iface)
}
CoTaskMemFree(avimuxin->strf);
avimuxin->strf = NULL;
- return hr;
+}
+
+static const struct strmbase_sink_ops sink_ops =
+{
+ .base.pin_query_interface = sink_query_interface,
+ .base.pin_query_accept = sink_query_accept,
+ .base.pin_get_media_type = strmbase_pin_get_media_type,
+ .pfnReceive = AviMuxIn_Receive,
+ .sink_connect = avi_mux_sink_connect,
+ .sink_disconnect = avi_mux_sink_disconnect,
+};
+
+static inline AviMux* impl_from_in_IPin(IPin *iface)
+{
+ struct strmbase_pin *pin = CONTAINING_RECORD(iface, struct strmbase_pin, IPin_iface);
+ return impl_from_strmbase_filter(pin->filter);
}
static const IPinVtbl AviMuxIn_PinVtbl = {
@@ -1526,8 +1505,8 @@ static const IPinVtbl AviMuxIn_PinVtbl = {
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
- AviMuxIn_ReceiveConnection,
- AviMuxIn_Disconnect,
+ BaseInputPinImpl_ReceiveConnection,
+ BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
--
2.24.0
Dec. 11, 2019
Re: [PATCH] urlmon/tests: Fix the spelling of a variable name.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61833
Your paranoid android.
=== w8adm (32 bit report) ===
urlmon:
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 1: status = 200
url.c:1484: Test failed: progress 2: status = 200
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
url.c:1480: Test failed: progress 2: hres = 1, expected 0
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
=== w864 (32 bit report) ===
urlmon:
url.c:1484: Test failed: progress 32: status = 200
=== w1064v1507 (32 bit report) ===
urlmon:
url.c:3675: Test failed: expected OnProgress_DOWNLOADINGDATA
url.c:1879: Test failed: binding failed: 800c0006, expected 00000000
url.c:1890: Test failed: res = 00002f4f, expected 00000000
url.c:3209: Test failed: expected OnProgress_SENDINGREQUEST
url.c:3217: Test failed: expected OnProgress_MIMETYPEAVAILABLE
url.c:3218: Test failed: expected OnProgress_BEGINDOWNLOADDATA
url.c:3219: Test failed: expected OnProgress_ENDDOWNLOADDATA
url.c:3231: Test failed: expected OnDataAvailable
=== w1064v1809 (32 bit report) ===
urlmon:
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 2: status = 200
=== w1064v1809_2scr (32 bit report) ===
urlmon:
url.c:1484: Test failed: progress 32: status = 200
=== w1064v1809_ar (32 bit report) ===
urlmon:
url.c:3675: Test failed: expected OnProgress_DOWNLOADINGDATA
=== w1064v1809_he (32 bit report) ===
urlmon:
url.c:3675: Test failed: expected OnProgress_DOWNLOADINGDATA
=== w1064v1809_ja (32 bit report) ===
urlmon:
url.c:3675: Test failed: expected OnProgress_DOWNLOADINGDATA
=== w864 (64 bit report) ===
urlmon:
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 1: status = 200
url.c:1484: Test failed: progress 2: status = 200
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
=== w1064v1507 (64 bit report) ===
urlmon:
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 1: status = 200
url.c:1484: Test failed: progress 2: status = 200
url.c:3675: Test failed: expected OnProgress_DOWNLOADINGDATA
url.c:1879: Test failed: binding failed: 800c0006, expected 00000000
url.c:1890: Test failed: res = 00002f4f, expected 00000000
url.c:3209: Test failed: expected OnProgress_SENDINGREQUEST
url.c:3217: Test failed: expected OnProgress_MIMETYPEAVAILABLE
url.c:3218: Test failed: expected OnProgress_BEGINDOWNLOADDATA
url.c:3219: Test failed: expected OnProgress_ENDDOWNLOADDATA
url.c:3231: Test failed: expected OnDataAvailable
=== w1064v1809 (64 bit report) ===
urlmon:
url.c:1484: Test failed: progress 32: status = 200
url.c:1484: Test failed: progress 32: status = 200
Dec. 11, 2019
[PATCH] msvcrt: Implement _ispunct_l().
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
.../api-ms-win-crt-string-l1-1-0.spec | 2 +-
dlls/msvcr100/msvcr100.spec | 2 +-
dlls/msvcr110/msvcr110.spec | 2 +-
dlls/msvcr120/msvcr120.spec | 2 +-
dlls/msvcr120_app/msvcr120_app.spec | 2 +-
dlls/msvcr80/msvcr80.spec | 2 +-
dlls/msvcr90/msvcr90.spec | 2 +-
dlls/msvcrt/ctype.c | 8 ++++++++
dlls/ucrtbase/ucrtbase.spec | 2 +-
9 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec b/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec
index ead56fbcb5a..42f3ed34ab4 100644
--- a/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec
+++ b/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec
@@ -16,7 +16,7 @@
@ cdecl _isleadbyte_l(long ptr) ucrtbase._isleadbyte_l
@ cdecl _islower_l(long ptr) ucrtbase._islower_l
@ cdecl _isprint_l(long ptr) ucrtbase._isprint_l
-@ stub _ispunct_l
+@ cdecl _ispunct_l(long ptr) ucrtbase._ispunct_l
@ cdecl _isspace_l(long ptr) ucrtbase._isspace_l
@ cdecl _isupper_l(long ptr) ucrtbase._isupper_l
@ cdecl _iswalnum_l(long ptr) ucrtbase._iswalnum_l
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 63c3a9d8a06..560e14b33b8 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -1013,7 +1013,7 @@
@ cdecl _isnan(double) MSVCRT__isnan
@ cdecl -arch=x86_64 _isnanf(float) MSVCRT__isnanf
@ cdecl _isprint_l(long ptr) MSVCRT__isprint_l
-@ stub _ispunct_l
+@ cdecl _ispunct_l(long ptr) MSVCRT__ispunct_l
@ cdecl _isspace_l(long ptr) MSVCRT__isspace_l
@ cdecl _isupper_l(long ptr) MSVCRT__isupper_l
@ cdecl _iswalnum_l(long ptr) MSVCRT__iswalnum_l
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 366c7717463..2316535e5d1 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -1359,7 +1359,7 @@
@ cdecl _isnan(double) MSVCRT__isnan
@ cdecl -arch=x86_64 _isnanf(float) MSVCRT__isnanf
@ cdecl _isprint_l(long ptr) MSVCRT__isprint_l
-@ stub _ispunct_l
+@ cdecl _ispunct_l(long ptr) MSVCRT__ispunct_l
@ cdecl _isspace_l(long ptr) MSVCRT__isspace_l
@ cdecl _isupper_l(long ptr) MSVCRT__isupper_l
@ cdecl _iswalnum_l(long ptr) MSVCRT__iswalnum_l
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 07ff5abdff5..903f4b7ce38 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -1364,7 +1364,7 @@
@ cdecl _isnan(double) MSVCRT__isnan
@ cdecl -arch=x86_64 _isnanf(float) MSVCRT__isnanf
@ cdecl _isprint_l(long ptr) MSVCRT__isprint_l
-@ stub _ispunct_l
+@ cdecl _ispunct_l(long ptr) MSVCRT__ispunct_l
@ cdecl _isspace_l(long ptr) MSVCRT__isspace_l
@ cdecl _isupper_l(long ptr) MSVCRT__isupper_l
@ cdecl _iswalnum_l(long ptr) MSVCRT__iswalnum_l
diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec
index 89d240b567e..63a4ccfacf2 100644
--- a/dlls/msvcr120_app/msvcr120_app.spec
+++ b/dlls/msvcr120_app/msvcr120_app.spec
@@ -1229,7 +1229,7 @@
@ cdecl _isnan(double) msvcr120._isnan
@ cdecl -arch=x86_64 _isnanf(float) msvcr120._isnanf
@ cdecl _isprint_l(long ptr) msvcr120._isprint_l
-@ stub _ispunct_l
+@ cdecl _ispunct_l(long ptr) msvcr120._ispunct_l
@ cdecl _isspace_l(long ptr) msvcr120._isspace_l
@ cdecl _isupper_l(long ptr) msvcr120._isupper_l
@ cdecl _iswalnum_l(long ptr) msvcr120._iswalnum_l
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index 14ed7f35532..402e6efc109 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -685,7 +685,7 @@
@ cdecl _isnan(double) MSVCRT__isnan
@ cdecl -arch=x86_64 _isnanf(float) MSVCRT__isnanf
@ cdecl _isprint_l(long ptr) MSVCRT__isprint_l
-@ stub _ispunct_l
+@ cdecl _ispunct_l(long ptr) MSVCRT__ispunct_l
@ cdecl _isspace_l(long ptr) MSVCRT__isspace_l
@ cdecl _isupper_l(long ptr) MSVCRT__isupper_l
@ cdecl _iswalnum_l(long ptr) MSVCRT__iswalnum_l
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index acb976a7b02..8a079abe254 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -663,7 +663,7 @@
@ cdecl _isnan(double) MSVCRT__isnan
@ cdecl -arch=x86_64 _isnanf(float) MSVCRT__isnanf
@ cdecl _isprint_l(long ptr) MSVCRT__isprint_l
-@ stub _ispunct_l
+@ cdecl _ispunct_l(long ptr) MSVCRT__ispunct_l
@ cdecl _isspace_l(long ptr) MSVCRT__isspace_l
@ cdecl _isupper_l(long ptr) MSVCRT__isupper_l
@ cdecl _iswalnum_l(long ptr) MSVCRT__iswalnum_l
diff --git a/dlls/msvcrt/ctype.c b/dlls/msvcrt/ctype.c
index 3b037aa8de2..9e2d029950e 100644
--- a/dlls/msvcrt/ctype.c
+++ b/dlls/msvcrt/ctype.c
@@ -244,6 +244,14 @@ int CDECL MSVCRT_ispunct(int c)
return MSVCRT__isctype( c, MSVCRT__PUNCT );
}
+/*********************************************************************
+ * _ispunct_l (MSVCR80.@)
+ */
+int CDECL MSVCRT__ispunct_l(int c, MSVCRT__locale_t locale)
+{
+ return MSVCRT__isctype_l( c, MSVCRT__PUNCT, locale );
+}
+
/*********************************************************************
* _isspace_l (MSVCRT.@)
*/
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index a262cc63459..1293dd62f16 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -503,7 +503,7 @@
@ cdecl _isnan(double) MSVCRT__isnan
@ cdecl -arch=x86_64 _isnanf(float) MSVCRT__isnanf
@ cdecl _isprint_l(long ptr) MSVCRT__isprint_l
-@ stub _ispunct_l
+@ cdecl _ispunct_l(long ptr) MSVCRT__ispunct_l
@ cdecl _isspace_l(long ptr) MSVCRT__isspace_l
@ cdecl _isupper_l(long ptr) MSVCRT__isupper_l
@ cdecl _iswalnum_l(long ptr) MSVCRT__iswalnum_l
--
2.24.0
Dec. 11, 2019
[PATCH] msvcrt: Fix the btowc() function.
by Chip Davis
This function returns WEOF on conversion failure. It should only operate
on ASCII characters in the C locale. Finally, it should use the current
codepage, instead of the current locale, to do conversions.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/msvcrt/locale.c | 6 ++++--
dlls/msvcrt/tests/string.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 11ad9ed5f5f..57783d9d4b6 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -787,9 +787,11 @@ MSVCRT_wint_t CDECL MSVCRT_btowc(int c)
unsigned char letter = c;
MSVCRT_wchar_t ret;
- if(!MultiByteToWideChar(get_locinfo()->lc_handle[MSVCRT_LC_CTYPE],
+ if(!get_locinfo()->lc_codepage)
+ return c <= 127 ? c : MSVCRT_WEOF;
+ if(!MultiByteToWideChar(get_locinfo()->lc_codepage,
0, (LPCSTR)&letter, 1, &ret, 1))
- return 0;
+ return MSVCRT_WEOF;
return ret;
}
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index f4c4657791c..fe27c826f3e 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -87,6 +87,7 @@ static int (__cdecl *p_wcslwr_s)(wchar_t*,size_t);
static errno_t (__cdecl *p_mbsupr_s)(unsigned char *str, size_t numberOfElements);
static errno_t (__cdecl *p_mbslwr_s)(unsigned char *str, size_t numberOfElements);
static int (__cdecl *p_wctob)(wint_t);
+static wint_t (__cdecl *p_btowc)(int);
static size_t (__cdecl *p_wcrtomb)(char*, wchar_t, mbstate_t*);
static int (__cdecl *p_wcrtomb_s)(size_t*, char*, size_t, wchar_t, mbstate_t*);
static int (__cdecl *p_tolower)(int);
@@ -2829,6 +2830,42 @@ static void test_wctob(void)
_setmbcp(cp);
}
+static void test_btowc(void)
+{
+ wint_t ret;
+ int cp = _getmbcp();
+
+ if(!p_btowc || !setlocale(LC_ALL, "chinese-traditional")) {
+ win_skip("Skipping btowc tests\n");
+ return;
+ }
+
+ ret = p_btowc(0x81);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ ret = p_btowc(0x61);
+ ok(ret == 0xe0, "ret = %x\n", ret);
+
+ _setmbcp(1250);
+ ret = p_btowc(0x61);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ setlocale(LC_ALL, "C");
+ ret = p_btowc(0x61);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ ret = p_btowc(0x81);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ ret = p_btowc(0x9f);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ ret = p_btowc(0xe0);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ _setmbcp(cp);
+}
+
static void test_wctomb(void)
{
mbstate_t state;
@@ -4007,6 +4044,7 @@ START_TEST(string)
p_wcslwr_s = (void*)GetProcAddress(hMsvcrt, "_wcslwr_s");
p_mbsupr_s = (void*)GetProcAddress(hMsvcrt, "_mbsupr_s");
p_mbslwr_s = (void*)GetProcAddress(hMsvcrt, "_mbslwr_s");
+ p_btowc = (void*)GetProcAddress(hMsvcrt, "btowc");
p_wctob = (void*)GetProcAddress(hMsvcrt, "wctob");
p_wcrtomb = (void*)GetProcAddress(hMsvcrt, "wcrtomb");
p_wcrtomb_s = (void*)GetProcAddress(hMsvcrt, "wcrtomb_s");
--
2.24.0
Dec. 11, 2019
[PATCH] usp10: Fix the spelling of some index array variables and function.
by Francois Gouget
Indices is the plural used by related APIs so use it for consistency.
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/usp10/bidi.c | 14 +++++------
dlls/usp10/shape.c | 48 ++++++++++++++++++-------------------
dlls/usp10/usp10.c | 18 +++++++-------
dlls/usp10/usp10_internal.h | 4 ++--
4 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/dlls/usp10/bidi.c b/dlls/usp10/bidi.c
index 7de2be51d7c..34ca955dcb1 100644
--- a/dlls/usp10/bidi.c
+++ b/dlls/usp10/bidi.c
@@ -1149,7 +1149,7 @@ BOOL BIDI_DetermineLevels(
return TRUE;
}
-/* reverse cch indexes */
+/* reverse cch indices */
static void reverse(int *pidx, int cch)
{
int temp;
@@ -1185,7 +1185,7 @@ static void reverse(int *pidx, int cch)
Note: this should be applied a line at a time
-------------------------------------------------------------------------*/
-int BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse)
+int BIDI_ReorderV2lLevel(int level, int *pIndices, const BYTE* plevel, int cch, BOOL fReverse)
{
int ich = 0;
@@ -1200,19 +1200,19 @@ int BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B
}
else if (plevel[ich] > level)
{
- ich += BIDI_ReorderV2lLevel(level + 1, pIndexs + ich, plevel + ich,
+ ich += BIDI_ReorderV2lLevel(level + 1, pIndices + ich, plevel + ich,
cch - ich, fReverse) - 1;
}
}
if (fReverse)
{
- reverse(pIndexs, ich);
+ reverse(pIndices, ich);
}
return ich;
}
/* Applies the reorder in reverse. Taking an already reordered string and returning the original */
-int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse)
+int BIDI_ReorderL2vLevel(int level, int *pIndices, const BYTE* plevel, int cch, BOOL fReverse)
{
int ich = 0;
int newlevel = -1;
@@ -1229,7 +1229,7 @@ int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B
}
if (fReverse)
{
- reverse(pIndexs, ich);
+ reverse(pIndices, ich);
}
if (newlevel >= 0)
@@ -1239,7 +1239,7 @@ int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B
if (plevel[ich] < level)
break;
else if (plevel[ich] > level)
- ich += BIDI_ReorderL2vLevel(level + 1, pIndexs + ich, plevel + ich,
+ ich += BIDI_ReorderL2vLevel(level + 1, pIndices + ich, plevel + ich,
cch - ich, fReverse) - 1;
}
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index 3827000122a..86e80aacd5f 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -805,7 +805,7 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
}
}
- /* renumber trailing indexes */
+ /* renumber trailing indices */
for (i = target_index; i < chars && i >= 0; i += cluster_dir)
{
if (pwLogClust[i] != target_glyph)
@@ -1971,7 +1971,7 @@ static void SecondReorder_Like_Tamil(const WCHAR *chars, const IndicSyllable *s,
}
-static inline void shift_syllable_glyph_indexs(IndicSyllable *glyph_index, INT index, INT shift)
+static inline void shift_syllable_glyph_indices(IndicSyllable *glyph_index, INT index, INT shift)
{
if (shift == 0)
return;
@@ -2005,7 +2005,7 @@ static void Apply_Indic_BasicForm(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
if (nextIndex > GSUB_E_NOGLYPH)
{
UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
- shift_syllable_glyph_indexs(glyph_index,index,*pcGlyphs - prevCount);
+ shift_syllable_glyph_indices(glyph_index,index,*pcGlyphs - prevCount);
index = nextIndex;
}
else
@@ -2040,7 +2040,7 @@ static void Apply_Indic_PreBase(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa,
if (nextIndex > GSUB_E_NOGLYPH)
{
UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
- shift_syllable_glyph_indexs(glyph_index, index + glyph_index->start + g_offset, (*pcGlyphs - prevCount));
+ shift_syllable_glyph_indices(glyph_index, index + glyph_index->start + g_offset, (*pcGlyphs - prevCount));
g_offset += (*pcGlyphs - prevCount);
}
@@ -2060,7 +2060,7 @@ static void Apply_Indic_Rphf(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WC
if (nextIndex > GSUB_E_NOGLYPH)
{
UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
- shift_syllable_glyph_indexs(glyph_index,glyph_index->ralf,*pcGlyphs - prevCount);
+ shift_syllable_glyph_indices(glyph_index,glyph_index->ralf,*pcGlyphs - prevCount);
}
}
}
@@ -2108,7 +2108,7 @@ static void Apply_Indic_PostBase(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa
if (nextIndex > GSUB_E_NOGLYPH)
{
UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
- shift_syllable_glyph_indexs(glyph_index,index+glyph_index->start+g_offset, (*pcGlyphs - prevCount));
+ shift_syllable_glyph_indices(glyph_index,index+glyph_index->start+g_offset, (*pcGlyphs - prevCount));
g_offset += (*pcGlyphs - prevCount);
}
else if (!modern)
@@ -2138,70 +2138,70 @@ static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa,
BOOL pref = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "pref") != NULL);
BOOL blwf = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "blwf") != NULL);
BOOL half = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "half") != NULL);
- IndicSyllable glyph_indexs;
+ IndicSyllable glyph_indices;
for (c = 0; c < syllable_count; c++)
{
int old_end;
- memcpy(&glyph_indexs, &syllables[c], sizeof(IndicSyllable));
- shift_syllable_glyph_indexs(&glyph_indexs, -1, overall_shift);
- old_end = glyph_indexs.end;
+ memcpy(&glyph_indices, &syllables[c], sizeof(IndicSyllable));
+ shift_syllable_glyph_indices(&glyph_indices, -1, overall_shift);
+ old_end = glyph_indices.end;
if (locl)
{
TRACE("applying feature locl\n");
- Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, locl);
+ Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, locl);
}
if (nukt)
{
TRACE("applying feature nukt\n");
- Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, nukt);
+ Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, nukt);
}
if (akhn)
{
TRACE("applying feature akhn\n");
- Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, akhn);
+ Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, akhn);
}
if (rphf)
- Apply_Indic_Rphf(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs);
+ Apply_Indic_Rphf(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices);
if (rkrf)
{
TRACE("applying feature rkrf\n");
- Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, rkrf);
+ Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, rkrf);
}
if (pref)
- Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, modern, "pref");
+ Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, modern, "pref");
if (blwf)
{
if (!modern)
- Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, "blwf");
+ Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, "blwf");
- Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, modern, "blwf");
+ Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, modern, "blwf");
}
if (half)
- Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, "half");
+ Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, "half");
if (pstf)
{
TRACE("applying feature pstf\n");
- Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, pstf);
+ Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, pstf);
}
if (vatu)
{
TRACE("applying feature vatu\n");
- Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, vatu);
+ Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, vatu);
}
if (cjct)
{
TRACE("applying feature cjct\n");
- Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indexs, cjct);
+ Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, cjct);
}
if (second_reorder)
- second_reorder(pwChars, &syllables[c], pwOutGlyphs, &glyph_indexs, lexical);
+ second_reorder(pwChars, &syllables[c], pwOutGlyphs, &glyph_indices, lexical);
- overall_shift += glyph_indexs.end - old_end;
+ overall_shift += glyph_indices.end - old_end;
}
}
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 3cc6665c2b9..f66e85cc485 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -3748,7 +3748,7 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB
*/
HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *logtovis)
{
- int* indexs;
+ int* indices;
int ich;
TRACE("(%d, %p, %p, %p)\n", runs, level, vistolog, logtovis);
@@ -3756,31 +3756,31 @@ HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *log
if (!level || (!vistolog && !logtovis))
return E_INVALIDARG;
- if (!(indexs = heap_calloc(runs, sizeof(*indexs))))
+ if (!(indices = heap_calloc(runs, sizeof(*indices))))
return E_OUTOFMEMORY;
if (vistolog)
{
for( ich = 0; ich < runs; ich++)
- indexs[ich] = ich;
+ indices[ich] = ich;
ich = 0;
while (ich < runs)
- ich += BIDI_ReorderV2lLevel(0, indexs+ich, level+ich, runs - ich, FALSE);
- memcpy(vistolog, indexs, runs * sizeof(*vistolog));
+ ich += BIDI_ReorderV2lLevel(0, indices+ich, level+ich, runs - ich, FALSE);
+ memcpy(vistolog, indices, runs * sizeof(*vistolog));
}
if (logtovis)
{
for( ich = 0; ich < runs; ich++)
- indexs[ich] = ich;
+ indices[ich] = ich;
ich = 0;
while (ich < runs)
- ich += BIDI_ReorderL2vLevel(0, indexs+ich, level+ich, runs - ich, FALSE);
- memcpy(logtovis, indexs, runs * sizeof(*logtovis));
+ ich += BIDI_ReorderL2vLevel(0, indices+ich, level+ich, runs - ich, FALSE);
+ memcpy(logtovis, indices, runs * sizeof(*logtovis));
}
- heap_free(indexs);
+ heap_free(indices);
return S_OK;
}
diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h
index bd55d8694f1..7f31e8f83f6 100644
--- a/dlls/usp10/usp10_internal.h
+++ b/dlls/usp10/usp10_internal.h
@@ -253,8 +253,8 @@ BOOL BIDI_DetermineLevels(const WCHAR *string, unsigned int count, const SCRIPT_
const SCRIPT_CONTROL *c, WORD *levels, WORD *overrides) DECLSPEC_HIDDEN;
BOOL BIDI_GetStrengths(const WCHAR *string, unsigned int count,
const SCRIPT_CONTROL *c, WORD *strength) DECLSPEC_HIDDEN;
-INT BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
-INT BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
+INT BIDI_ReorderV2lLevel(int level, int *pIndices, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
+INT BIDI_ReorderL2vLevel(int level, int *pIndices, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
void SHAPE_ContextualShaping(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust) DECLSPEC_HIDDEN;
void SHAPE_ApplyDefaultOpentypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, INT cChars, WORD *pwLogClust) DECLSPEC_HIDDEN;
void SHAPE_ApplyOpenTypePositions(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WORD* pwGlyphs, INT cGlyphs, int *piAdvance, GOFFSET *pGoffset ) DECLSPEC_HIDDEN;
--
2.20.1
Dec. 11, 2019
[PATCH] urlmon/tests: Fix the spelling of a variable name.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/urlmon/tests/stream.c | 4 ++--
dlls/urlmon/tests/url.c | 18 +++++++++---------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/urlmon/tests/stream.c b/dlls/urlmon/tests/stream.c
index 6717198b311..bf8867290f8 100644
--- a/dlls/urlmon/tests/stream.c
+++ b/dlls/urlmon/tests/stream.c
@@ -204,7 +204,7 @@ static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallback *iface, DWOR
DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
{
HRESULT hres;
- DWORD readed;
+ DWORD read;
BYTE buf[512];
CHECK_EXPECT2(OnDataAvailable);
@@ -230,7 +230,7 @@ static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallback *iface, DWOR
}
if(U(*pstgmed).pstm) {
- do hres = IStream_Read(U(*pstgmed).pstm, buf, 512, &readed);
+ do hres = IStream_Read(U(*pstgmed).pstm, buf, 512, &read);
while(hres == S_OK);
ok(hres == S_FALSE || hres == E_PENDING, "IStream_Read returned %08x\n", hres);
}
diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c
index 287eb2702e4..7c8d1abdb76 100644
--- a/dlls/urlmon/tests/url.c
+++ b/dlls/urlmon/tests/url.c
@@ -1988,7 +1988,7 @@ static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallbackEx *iface, DW
DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
{
HRESULT hres;
- DWORD readed;
+ DWORD read;
BYTE buf[512];
CHAR clipfmt[512];
@@ -2075,8 +2075,8 @@ static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallbackEx *iface, DW
if(callback_read) {
do {
- hres = IStream_Read(stream, buf, 512, &readed);
- if(test_protocol == HTTP_TEST && emulate_protocol && readed)
+ hres = IStream_Read(stream, buf, 512, &read);
+ if(test_protocol == HTTP_TEST && emulate_protocol && read)
ok(buf[0] == (use_cache_file && !(bindf&BINDF_ASYNCHRONOUS) ? 'X' : '?'), "buf[0] = '%c'\n", buf[0]);
}while(hres == S_OK);
ok(hres == S_FALSE || hres == E_PENDING, "IStream_Read returned %08x\n", hres);
@@ -3245,7 +3245,7 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
if(unk) {
BYTE buf[512];
- DWORD readed;
+ DWORD read;
IStream *stream;
hres = IUnknown_QueryInterface(unk, &IID_IStream, (void**)&stream);
@@ -3253,14 +3253,14 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
IUnknown_Release(unk);
do {
- readed = 0xdeadbeef;
- hres = IStream_Read(stream, buf, sizeof(buf), &readed);
- ok(readed != 0xdeadbeef, "readed = 0xdeadbeef\n");
- if(emulate_protocol && test_protocol == HTTP_TEST && readed)
+ read = 0xdeadbeef;
+ hres = IStream_Read(stream, buf, sizeof(buf), &read);
+ ok(read != 0xdeadbeef, "read = 0xdeadbeef\n");
+ if(emulate_protocol && test_protocol == HTTP_TEST && read)
ok(buf[0] == (use_cache_file && !(bindf&BINDF_ASYNCHRONOUS) ? 'X' : '?'), "buf[0] = '%c'\n", buf[0]);
}while(hres == S_OK);
ok(hres == S_FALSE, "IStream_Read returned %08x\n", hres);
- ok(!readed, "readed = %d\n", readed);
+ ok(!read, "read = %d\n", read);
IStream_Release(stream);
}
--
2.20.1
Dec. 11, 2019
[PATCH] shell32: Fix the spelling of a variable name.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/shell32/assoc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c
index d3f20c225b5..a501dea2e79 100644
--- a/dlls/shell32/assoc.c
+++ b/dlls/shell32/assoc.c
@@ -890,7 +890,7 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
IApplicationAssociationRegistrationImpl *This = impl_from_IApplicationAssociationRegistration(iface);
static WCHAR urlassoc[] = {'U','r','l','A','s','s','o','c','i','a','t','i','o','n','s',0};
static WCHAR mimeassoc[] = {'M','I','M','E','A','s','s','o','c','i','a','t','i','o','n','s',0};
- static WCHAR assocations[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
+ static WCHAR associations[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','\\','S','h','e','l','l','\\',
'A','s','s','o','c','i','a','t','i','o','n','s',0};
static WCHAR slash[] = {'\\',0};
@@ -940,7 +940,7 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
}
else
{
- ret = RegOpenKeyExW(HKEY_CURRENT_USER, assocations, 0, KEY_READ, &hkey);
+ ret = RegOpenKeyExW(HKEY_CURRENT_USER, associations, 0, KEY_READ, &hkey);
if(ret == ERROR_SUCCESS)
{
if(type == AT_URLPROTOCOL)
--
2.20.1
Dec. 11, 2019
[PATCH] d3dx9_36: Fix the spelling of a comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/d3dx9_36/txc_compress_dxtn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3dx9_36/txc_compress_dxtn.c b/dlls/d3dx9_36/txc_compress_dxtn.c
index 86fd8e0aff0..7f10de8076b 100644
--- a/dlls/d3dx9_36/txc_compress_dxtn.c
+++ b/dlls/d3dx9_36/txc_compress_dxtn.c
@@ -450,7 +450,7 @@ static void encodedxt5alpha(GLubyte *blkaddr, GLubyte srccolors[4][4][4],
if ((alphabase[0] > alphabase[1]) && !(alphaabsmin && alphaabsmax)) { /* one color, either max or min */
/* shortcut here since it is a very common case (and also avoids later problems) */
/* || (alphabase[0] == alphabase[1] && !alphaabsmin && !alphaabsmax) */
- /* could also thest for alpha0 == alpha1 (and not min/max), but probably not common, so don't bother */
+ /* could also test for alpha0 == alpha1 (and not min/max), but probably not common, so don't bother */
*blkaddr++ = srccolors[0][0][3];
blkaddr++;
--
2.20.1
Dec. 11, 2019
[PATCH] vbscript/tests: Fix the spelling of a vbscript comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/vbscript/tests/lang.vbs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 6eebe287fee..fb9f96e4277 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -1573,7 +1573,7 @@ sub test_dotIdentifiers
end sub
call test_dotIdentifiers
-' Test End statements not required to be preceeded by a newline or separator
+' Test End statements not required to be preceded by a newline or separator
Sub EndTestSub
x = 1 End Sub
--
2.20.1
Dec. 11, 2019
[PATCH] winemac.drv: Fix the spelling of a couple of comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/winemac.drv/display.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c
index bafdb425897..b58a9d172b4 100644
--- a/dlls/winemac.drv/display.c
+++ b/dlls/winemac.drv/display.c
@@ -1468,12 +1468,12 @@ static BOOL macdrv_init_adapter(HKEY video_hkey, int video_index, int gpu_index,
RegCreateKeyExW(HKEY_CURRENT_CONFIG, adapter_keyW, 0, NULL, REG_OPTION_VOLATILE, KEY_WRITE, NULL, &hkey, NULL);
/* Write GPU instance path so that we can find the GPU instance via adapters quickly. Another way is trying to match
- * them via the GUID in Device Paramters/VideoID, but it would required enumrating all GPU instances */
+ * them via the GUID in Device Parameters/VideoID, but it would require enumerating all GPU instances */
sprintfW(bufferW, gpu_instance_fmtW, gpu->vendor_id, gpu->device_id, gpu->subsys_id, gpu->revision_id, gpu_index);
if (RegSetValueExW(hkey, gpu_idW, 0, REG_SZ, (const BYTE *)bufferW, (lstrlenW(bufferW) + 1) * sizeof(WCHAR)))
goto done;
- /* Write all monitor instances paths under this adapter */
+ /* Write all monitor instance paths under this adapter */
for (i = 0; i < monitor_count; i++)
{
sprintfW(key_nameW, mointor_id_fmtW, i);
--
2.20.1
Dec. 11, 2019
[PATCH] dmime/tests: Fix the spelling of a performance ok() message.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/dmime/tests/performance.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dmime/tests/performance.c b/dlls/dmime/tests/performance.c
index 073625f04b1..1d17e5200e5 100644
--- a/dlls/dmime/tests/performance.c
+++ b/dlls/dmime/tests/performance.c
@@ -472,7 +472,7 @@ static void test_notification_type(void)
IDirectMusicPerformance8_FreePMsg(perf, (DMUS_PMSG*)msg);
}
todo_wine ok(prime_segment8 == segment8, "Wrong end segment\n");
- todo_wine ok(found_end, "Didn't recieve DMUS_NOTIFICATION_SEGEND message\n");
+ todo_wine ok(found_end, "Didn't receive DMUS_NOTIFICATION_SEGEND message\n");
CloseHandle(messages);
--
2.20.1
Dec. 11, 2019
[PATCH] winex11.drv: Fix the spelling of a WARN() message.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/winex11.drv/xrandr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c
index 56168573471..930e0282be8 100644
--- a/dlls/winex11.drv/xrandr.c
+++ b/dlls/winex11.drv/xrandr.c
@@ -622,7 +622,7 @@ fallback:
if (output_info)
pXRRFreeOutputInfo( output_info );
- WARN("Primary is set to a disconneted XRandR output.\n");
+ WARN("Primary is set to a disconnected XRandR output.\n");
for (i = 0; i < resources->ncrtc; ++i)
{
crtc_info = pXRRGetCrtcInfo( gdi_display, resources, resources->crtcs[i] );
--
2.20.1
Dec. 11, 2019
Re: [PATCH] dmloader: Fix the spelling of a TRACE() message and a comment.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
On 12/10/19 9:21 AM, Francois Gouget wrote:
> Signed-off-by: Francois Gouget <fgouget(a)free.fr>
> ---
> dlls/dmloader/loader.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
> index 9048c02dfc7..60dd6f844b9 100644
> --- a/dlls/dmloader/loader.c
> +++ b/dlls/dmloader/loader.c
> @@ -168,7 +168,7 @@ static struct cache_entry *find_cache_object(IDirectMusicLoaderImpl *This, DMUS_
> struct cache_entry *existing;
>
> /*
> - * The Object is looked for the the following order.
> + * The Object is looked up in the following order.
> * 1. DMUS_OBJ_OBJECT
> * 2. DMUS_OBJ_STREAM
> * 3. DMUS_OBJ_MEMORY
> @@ -682,7 +682,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if
> entry = find_cache_object(This, &desc);
> if (entry) {
> if ((entry->Desc.dwValidData & DMUS_OBJ_LOADED) && entry->pObject) {
> - TRACE("Object already laoded.\n");
> + TRACE("Object already loaded.\n");
> return S_FALSE;
> }
>
>
Dec. 10, 2019
[PATCH] configure: Silence -Wincompatible-library-redeclaration warning.
by Jacek Caban
This is noisy on clang and we can't change declarations due to long
double type incompatibility.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
Dec. 10, 2019
[PATCH] wine.inf: install powershell.exe in WindowsPowerShell/v1.0/
by Louis Lenders
https://bugs.winehq.org/show_bug.cgi?id=47820
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com>
---
loader/wine.inf.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index c830525379..71e95dfa7b 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -2675,6 +2675,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,gecko\plugin,npmshtml.dll
11,Speech\Common,sapi.dll
11,wbem,mofcomp.exe
+11,WindowsPowerShell\v1.0,powershell.exe
10,syswow64,stdole2.tlb
11,,iexplore.exe
11,,winetest.exe,-
@@ -2759,6 +2760,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,wbem,wbemprox.dll
11,wbem,wmic.exe
11,wbem,wmiutils.dll
+11,WindowsPowerShell\v1.0,powershell.exe
; empty folders to make sure the parent dirs are not removed
16410,Microsoft,
16412,Microsoft,
--
2.24.0
Dec. 10, 2019
Re: [PATCH 1/5] wined3d: Introduce wined3d_device_apply_stateblock().
by Zebediah Figura
On 12/10/19 2:39 AM, Matteo Bruni wrote:
> On Sat, Dec 7, 2019 at 5:11 PM Zebediah Figura <z.figura12(a)gmail.com> wrote:
>>
>> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
>> ---
>> dlls/wined3d/device.c | 93 +++++++++++++++++++++++++++++++++++++++
>> dlls/wined3d/wined3d.spec | 1 +
>> include/wine/wined3d.h | 1 +
>> 3 files changed, 95 insertions(+)
>>
>> diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
>> index 0ae841d4e35..50029dfbec2 100644
>> --- a/dlls/wined3d/device.c
>> +++ b/dlls/wined3d/device.c
>> @@ -3829,6 +3829,99 @@ struct wined3d_texture * CDECL wined3d_device_get_texture(const struct wined3d_d
>> return device->state.textures[stage];
>> }
>>
>> +void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
>> + struct wined3d_stateblock *stateblock)
>> +{
>> + const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
>> + const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
>> + unsigned int i, j;
>> +
>> + TRACE("device %p, stateblock %p.\n", device, stateblock);
>> +
>> + wined3d_stateblock_init_contained_states(stateblock);
>> +
>> + wined3d_device_set_vertex_shader(device, state->vs);
>> + wined3d_device_set_pixel_shader(device, state->ps);
>
> Can we make use of the stateblock flags to only update the changed
> states instead of all of them?
I think so. I mostly didn't do it because it was less code, but it's
probably worth not making lots of redundant calls to wined3d_device_set_*().
>
>> + for (i = 0; i < d3d_info->limits.vs_uniform_count; ++i)
>> + wined3d_device_set_vs_consts_f(device, i, 1, &state->vs_consts_f[i]);
>
> Either only update the changed constants or set all of them in one go, IMO.
...good point :D
>
> Somewhat related, I have a few patches optimizing / improving our
> handling of those flags but I don't expect them to be ready before
> code freeze (and I don't want to conflict with your patches,
> especially now).
>
Dec. 10, 2019
Re: [PATCH 3/5] d3d9: Handle multisample depth resolve in d3d9_device_SetRenderState().
by Zebediah Figura
On 12/10/19 8:38 AM, Henri Verbeet wrote:
> On Sat, 7 Dec 2019 at 19:41, Zebediah Figura <z.figura12(a)gmail.com> wrote:
>> +static void resolve_depth_buffer(struct d3d9_device *device)
>> +{
>> + const struct wined3d_stateblock_state *state = wined3d_stateblock_get_state(device->state);
>> + struct wined3d_rendertarget_view *wined3d_dsv;
>> + struct wined3d_resource *dst_resource;
>> + struct wined3d_texture *dst_texture;
>> + struct wined3d_resource_desc desc;
>> + struct d3d9_surface *d3d9_dsv;
>> +
>> + if (!(dst_texture = state->textures[0]))
>> + return;
>> + dst_resource = wined3d_texture_get_resource(dst_texture);
>> + wined3d_resource_get_desc(dst_resource, &desc);
>> + if (desc.format != WINED3DFMT_D24_UNORM_S8_UINT
>> + && desc.format != WINED3DFMT_X8D24_UNORM
>> + && desc.format != MAKEFOURCC('D','F','1','6')
>> + && desc.format != MAKEFOURCC('D','F','2','4')
>> + && desc.format != WINED3DFMT_INTZ)
>> + return;
>> +
>> + if (!(wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
>> + return;
>> + d3d9_dsv = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
>> +
>> + wined3d_device_resolve_sub_resource(device->wined3d_device, dst_resource, 0,
>> + wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d9_dsv->sub_resource_idx, desc.format);
>> +}
> If we're going to implement this in d3d9 (but note that the feature is
> supported by d3d8 as well), it would be best to implement the
> corresponding feature query in d3d9 instead of wined3d as well.
Right, I have patches for d3d8 too; I was just taking care of one module
at a time.
Anyway, I'll move the feature query too, thanks.
On the other hand, if exposing a single helper from wined3d is
preferable, I'm happy to take that approach instead. (Or doing it in
wined3d_stateblock_set_render_state(), but that feels a little awkward
to me.)
> Note that you can't (currently) create DF16/24 resources. Checking for
> those isn't necessarily an issue, but in that case please just add en
> entry for them to the wined3d_format_id enumeration.
>
Sure, will do.
Dec. 10, 2019
Re: [PATCH v2 3/6] d3d9: Use wined3d_stateblock_get_state() in d3d9_device_GetRenderState().
by Zebediah Figura
On 12/10/19 2:34 AM, Matteo Bruni wrote:
> On Thu, Nov 28, 2019 at 6:54 AM Zebediah Figura <z.figura12(a)gmail.com> wrote:
>>
>> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
>> ---
>> dlls/d3d9/device.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
>> index 2d66c569938..51b7f4d6f59 100644
>> --- a/dlls/d3d9/device.c
>> +++ b/dlls/d3d9/device.c
>> @@ -2329,6 +2329,7 @@ static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface,
>> D3DRENDERSTATETYPE state, DWORD *value)
>> {
>> struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
>> + const struct wined3d_stateblock_state *device_state;
>> struct wined3d_color factor;
>>
>> TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
>> @@ -2344,7 +2345,8 @@ static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface,
>> }
>>
>> wined3d_mutex_lock();
>> - *value = wined3d_device_get_render_state(device->wined3d_device, state);
>> + device_state = wined3d_stateblock_get_state(device->state);
>> + *value = device_state->rs[state];
>> wined3d_mutex_unlock();
>>
>> return D3D_OK;
>
> Just a couple of comments WRT potential future improvements. Obviously
> they apply to the other d3d* versions too.
>
> The state for the stateblock isn't going to change from underneath so
> it could be stored in the d3d9 device once and for all instead of
> getting it from wined3d every time it's needed. It doesn't matter a
> lot I guess (and it's certainly not urgent anyway), especially for
> those Get*() methods, but it would be one less inter-module function
> call per API call.
>
Good point, thanks. I hadn't thought of that.
Dec. 10, 2019
Re:
by Jacek Caban
Hi Gabriel,
On 12/10/19 6:17 PM, Gabriel Ivăncescu wrote:
> On 12/10/19 5:35 PM, Jacek Caban wrote:
>> On 12/9/19 4:29 PM, Gabriel Ivăncescu wrote:
>>> +enum memid_type {
>>> + memid_invalid,
>>> + memid_inherited,
>>> + memid_func,
>>> + memid_var
>>> +};
>>> +
>>> +static inline enum memid_type get_memid_type(const ScriptTypeInfo
>>> *typeinfo, MEMBERID memid)
>>> +{
>>> + if (memid <= 0) return memid_invalid;
>>> + if (memid & DISPID_FUNCTION_MASK)
>>> + {
>>> + memid &= ~DISPID_FUNCTION_MASK;
>>> + if (memid >= typeinfo->func_memid_map_cnt)
>>> + return memid_inherited;
>>> + if (typeinfo->func_memid_map[memid] == ~0)
>>> + return memid_invalid;
>>> + return memid_func;
>>> + }
>>> + if (memid > typeinfo->num_vars)
>>> + return memid_inherited;
>>> + return memid_var;
>>> +}
>>
>>
>> It seems that could let default ITypeInfo handle invalid IDs and you
>> could just forward all calls to unknown IDs to it. You don't need a
>> new map for that, you could just use a binary search on funcs.
>>
>>
>> Thanks,
>>
>> Jacek
>>
>
> Sure, that sounds like a good approach as well. I'll look into it
> tomorrow.
>
> I have a question, though, about jscript (similar patch for jscript,
> not sent yet to mailing list). In jscript, variables and functions can
> be deleted, and so currently I have a map of memids for both vars and
> functions (just one map for both).
>
> Should I also use a binary search there (needed for both variables and
> functions), or rather keep the single map for both, which I think is
> slightly simpler code?
>
> Currently I identify whether an element in the map is a variable or a
> function by looking at where it points to: if it points within the
> bounds of the function array, then it's a function. So no extra fields
> needed, other than the map itself.
>
> This is all for jscript of course (not vbscript or this patch, but
> related).
I'm not sure without looking at the code, but two binary searches seem fine.
Thanks,
Jacek
Dec. 10, 2019