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
January 2020
- 75 participants
- 595 discussions
In the unlikely event that we are hotplugging not from an IAsyncReader, we
already have the ACM wrapper and l3codeca.acm available to do the same thing.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winegstreamer/Makefile.in | 4 +-
dlls/winegstreamer/gst_cbs.c | 24 --
dlls/winegstreamer/gst_cbs.h | 13 -
dlls/winegstreamer/gst_guids.h | 1 -
dlls/winegstreamer/gst_private.h | 7 -
dlls/winegstreamer/gstdemux.c | 14 +-
dlls/winegstreamer/gsttffilter.c | 628 -------------------------------
dlls/winegstreamer/main.c | 35 --
8 files changed, 2 insertions(+), 724 deletions(-)
delete mode 100644 dlls/winegstreamer/gsttffilter.c
diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in
index 08adb2b6d5d..c536f2521c0 100644
--- a/dlls/winegstreamer/Makefile.in
+++ b/dlls/winegstreamer/Makefile.in
@@ -10,14 +10,12 @@ C_SRCS = \
filter.c \
gst_cbs.c \
gstdemux.c \
- gsttffilter.c \
main.c \
mediatype.c \
mfplat.c \
pin.c \
qualitycontrol.c \
- seeking.c \
- transform.c
+ seeking.c
IDL_SRCS = mfplat.idl
diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c
index c8ba812c8a7..e7a4b41d55f 100644
--- a/dlls/winegstreamer/gst_cbs.c
+++ b/dlls/winegstreamer/gst_cbs.c
@@ -188,19 +188,6 @@ GstFlowReturn got_data_sink_wrapper(GstPad *pad, GstObject *parent, GstBuffer *b
return cbdata.u.got_data_sink_data.ret;
}
-GstFlowReturn got_data_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf)
-{
- struct cb_data cbdata = { GOT_DATA };
-
- cbdata.u.got_data_data.pad = pad;
- cbdata.u.got_data_data.parent = parent;
- cbdata.u.got_data_data.buf = buf;
-
- call_cb(&cbdata);
-
- return cbdata.u.got_data_data.ret;
-}
-
void removed_decoded_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user)
{
struct cb_data cbdata = { REMOVED_DECODED_PAD };
@@ -249,17 +236,6 @@ void release_sample_wrapper(gpointer data)
call_cb(&cbdata);
}
-void Gstreamer_transform_pad_added_wrapper(GstElement *filter, GstPad *pad, gpointer user)
-{
- struct cb_data cbdata = { TRANSFORM_PAD_ADDED };
-
- cbdata.u.transform_pad_added_data.filter = filter;
- cbdata.u.transform_pad_added_data.pad = pad;
- cbdata.u.transform_pad_added_data.user = user;
-
- call_cb(&cbdata);
-}
-
gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query)
{
struct cb_data cbdata = { QUERY_SINK };
diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h
index 100a8dece44..46f8add57c4 100644
--- a/dlls/winegstreamer/gst_cbs.h
+++ b/dlls/winegstreamer/gst_cbs.h
@@ -39,12 +39,10 @@ enum CB_TYPE {
EVENT_SRC,
EVENT_SINK,
GOT_DATA_SINK,
- GOT_DATA,
REMOVED_DECODED_PAD,
AUTOPLUG_BLACKLIST,
UNKNOWN_TYPE,
RELEASE_SAMPLE,
- TRANSFORM_PAD_ADDED,
QUERY_SINK
};
@@ -105,12 +103,6 @@ struct cb_data {
GstBuffer *buf;
GstFlowReturn ret;
} got_data_sink_data;
- struct got_data_data {
- GstPad *pad;
- GstObject *parent;
- GstBuffer *buf;
- GstFlowReturn ret;
- } got_data_data;
struct removed_decoded_pad_data {
GstElement *bin;
GstPad *pad;
@@ -133,11 +125,6 @@ struct cb_data {
struct release_sample_data {
gpointer data;
} release_sample_data;
- struct transform_pad_added_data {
- GstElement *filter;
- GstPad *pad;
- gpointer user;
- } transform_pad_added_data;
struct query_sink_data {
GstPad *pad;
GstObject *parent;
diff --git a/dlls/winegstreamer/gst_guids.h b/dlls/winegstreamer/gst_guids.h
index e50ecb48519..b5ed3139b60 100644
--- a/dlls/winegstreamer/gst_guids.h
+++ b/dlls/winegstreamer/gst_guids.h
@@ -19,6 +19,5 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-DEFINE_GUID(CLSID_Gstreamer_Mp3, 0x728dcf55, 0x128f, 0x4dd1, 0xad, 0x22, 0xbe, 0xcf, 0xa6, 0x6c, 0xe7, 0xaa);
DEFINE_GUID(CLSID_Gstreamer_Splitter, 0xf9d8d64e, 0xa144, 0x47dc, 0x8e, 0xe0, 0xf5, 0x34, 0x98, 0x37, 0x2c, 0x29);
DEFINE_GUID(WINESUBTYPE_Gstreamer, 0xffffffff, 0x128f, 0x4dd1, 0xad, 0x22, 0xbe, 0xcf, 0xa6, 0x6c, 0xe7, 0xaa);
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 7108a32e401..353ff0bbd5b 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -37,20 +37,13 @@
IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
-IUnknown * CALLBACK Gstreamer_Mp3_create(IUnknown *pUnkOuter, HRESULT *phr);
IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *pUnkOuter, HRESULT *phr);
IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
BOOL init_gstreamer(void) DECLSPEC_HIDDEN;
-GstFlowReturn got_data(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN;
-GstFlowReturn request_buffer(GstPad *pad, guint64 ofs, guint size, GstCaps *caps, GstBuffer **buf) DECLSPEC_HIDDEN;
-void Gstreamer_transform_pad_added(GstElement *filter, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
-
void start_dispatch_thread(void) DECLSPEC_HIDDEN;
-extern const char *media_quark_string DECLSPEC_HIDDEN;
-
extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN;
extern HRESULT mfplat_can_unload_now(void) DECLSPEC_HIDDEN;
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index f9eed906b6e..0b5fee30273 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -97,7 +97,7 @@ static inline struct gstdemux *impl_from_strmbase_filter(struct strmbase_filter
return CONTAINING_RECORD(iface, struct gstdemux, filter);
}
-const char* media_quark_string = "media-sample";
+static const char *media_quark_string = "media-sample";
static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
static const IMediaSeekingVtbl GST_Seeking_Vtbl;
@@ -2313,12 +2313,6 @@ void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user)
cbdata->u.got_data_sink_data.ret = got_data_sink(data->pad, data->parent, data->buf);
break;
}
- case GOT_DATA:
- {
- struct got_data_data *data = &cbdata->u.got_data_data;
- cbdata->u.got_data_data.ret = got_data(data->pad, data->parent, data->buf);
- break;
- }
case REMOVED_DECODED_PAD:
{
struct removed_decoded_pad_data *data = &cbdata->u.removed_decoded_pad_data;
@@ -2344,12 +2338,6 @@ void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user)
release_sample(data->data);
break;
}
- case TRANSFORM_PAD_ADDED:
- {
- struct transform_pad_added_data *data = &cbdata->u.transform_pad_added_data;
- Gstreamer_transform_pad_added(data->filter, data->pad, data->user);
- break;
- }
case QUERY_SINK:
{
struct query_sink_data *data = &cbdata->u.query_sink_data;
diff --git a/dlls/winegstreamer/gsttffilter.c b/dlls/winegstreamer/gsttffilter.c
deleted file mode 100644
index 21feefe09d2..00000000000
--- a/dlls/winegstreamer/gsttffilter.c
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- * GStreamer wrapper filter
- *
- * Copyright 2010 Maarten Lankhorst for CodeWeavers
- * Copyright 2010 Aric Stewart for CodeWeavers
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- */
-
-#include "config.h"
-
-#include <gst/gst.h>
-#include <gst/video/video.h>
-#include <gst/audio/audio.h>
-
-#include "gst_private.h"
-#include "gst_guids.h"
-#include "gst_cbs.h"
-
-#include "uuids.h"
-#include "mmreg.h"
-#include "windef.h"
-#include "winbase.h"
-#include "dshow.h"
-#include "strmif.h"
-#include "vfwmsgs.h"
-#include "dvdmedia.h"
-#include "ks.h"
-#include "ksmedia.h"
-#include "msacm.h"
-
-#include <assert.h>
-
-#include "wine/unicode.h"
-#include "wine/debug.h"
-
-#include "initguid.h"
-DEFINE_GUID(WMMEDIASUBTYPE_MP3, 0x00000055, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
-
-WINE_DEFAULT_DEBUG_CHANNEL(gstreamer);
-
-struct typeinfo {
- GstCaps *caps;
- const char *type;
-};
-
-static gboolean match_element(GstPluginFeature *feature, gpointer gdata)
-{
- struct typeinfo *data = (struct typeinfo*)gdata;
- GstElementFactory *factory;
- const GList *list;
-
- if (!GST_IS_ELEMENT_FACTORY(feature))
- return FALSE;
- factory = GST_ELEMENT_FACTORY(feature);
- if (!strstr(gst_element_factory_get_klass(factory), data->type))
- return FALSE;
- for (list = gst_element_factory_get_static_pad_templates(factory); list; list = list->next) {
- GstStaticPadTemplate *pad = (GstStaticPadTemplate*)list->data;
- GstCaps *caps;
- gboolean ret;
- if (pad->direction != GST_PAD_SINK)
- continue;
- caps = gst_static_caps_get(&pad->static_caps);
- ret = gst_caps_is_always_compatible(caps, data->caps);
- gst_caps_unref(caps);
- if (ret)
- return TRUE;
- }
- return FALSE;
-}
-
-static const char *Gstreamer_FindMatch(const char *strcaps)
-{
- struct typeinfo data;
- GList *list, *copy;
- guint bestrank = 0;
- GstElementFactory *bestfactory = NULL;
- GstCaps *caps = gst_caps_from_string(strcaps);
-
- TRACE("%s\n", strcaps);
-
- data.caps = caps;
- data.type = "Decoder";
- copy = gst_registry_feature_filter(gst_registry_get(), match_element, 0, &data);
- for (list = copy; list; list = list->next) {
- GstElementFactory *factory = (GstElementFactory*)list->data;
- guint rank;
- rank = gst_plugin_feature_get_rank(GST_PLUGIN_FEATURE(factory));
- if (rank > bestrank || !bestrank) {
- bestrank = rank;
- bestfactory = factory;
- }
- }
- gst_caps_unref(caps);
- g_list_free(copy);
-
- if (!bestfactory) {
- ERR("Could not find plugin for %s\n", strcaps);
- return NULL;
- }
- return gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(bestfactory));
-}
-
-typedef struct GstTfImpl {
- TransformFilter tf;
- const char *gstreamer_name;
- GstElement *filter;
- GstPad *my_src, *my_sink, *their_src, *their_sink;
- LONG cbBuffer;
-} GstTfImpl;
-
-static HRESULT WINAPI Gstreamer_transform_ProcessBegin(TransformFilter *iface)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- int ret;
-
- mark_wine_thread();
-
- ret = gst_element_set_state(This->filter, GST_STATE_PLAYING);
- TRACE("Returned: %i\n", ret);
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_DecideBufferSize(TransformFilter *tf, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
-{
- GstTfImpl *This = (GstTfImpl*)tf;
- ALLOCATOR_PROPERTIES actual;
-
- TRACE("%p, %p, %p\n", This, pAlloc, ppropInputRequest);
-
- if (!ppropInputRequest->cbAlign)
- ppropInputRequest->cbAlign = 1;
-
- ppropInputRequest->cbBuffer = This->cbBuffer;
-
- if (ppropInputRequest->cBuffers < 2)
- ppropInputRequest->cBuffers = 2;
-
- return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual);
-}
-
-GstFlowReturn got_data(GstPad *pad, GstObject *parent, GstBuffer *buf)
-{
- GstTfImpl *This = gst_pad_get_element_private(pad);
- IMediaSample *sample = (IMediaSample *) gst_mini_object_get_qdata(GST_MINI_OBJECT(buf), g_quark_from_static_string(media_quark_string));
- REFERENCE_TIME tStart, tStop;
- HRESULT hr;
-
- TRACE("%p, %p\n", pad, buf);
-
- if(!sample){
- GstMapInfo info;
- BYTE *ptr;
-
- gst_buffer_map(buf, &info, GST_MAP_READ);
-
- hr = BaseOutputPinImpl_GetDeliveryBuffer(&This->tf.source, &sample, NULL, NULL, 0);
- if (FAILED(hr)) {
- ERR("Could not get output buffer: %08x\n", hr);
- return GST_FLOW_FLUSHING;
- }
-
- IMediaSample_SetActualDataLength(sample, info.size);
-
- IMediaSample_GetPointer(sample, &ptr);
-
- memcpy(ptr, info.data, info.size);
-
- gst_buffer_unmap(buf, &info);
- }
-
- if (GST_BUFFER_PTS_IS_VALID(buf) &&
- GST_BUFFER_DURATION_IS_VALID(buf)) {
- tStart = buf->pts / 100;
- tStop = tStart + buf->duration / 100;
- IMediaSample_SetTime(sample, &tStart, &tStop);
- }
- else
- IMediaSample_SetTime(sample, NULL, NULL);
- if (GST_BUFFER_OFFSET_IS_VALID(buf) &&
- GST_BUFFER_OFFSET_END_IS_VALID(buf)) {
- tStart = buf->offset / 100;
- tStop = buf->offset_end / 100;
- IMediaSample_SetMediaTime(sample, &tStart, &tStop);
- }
- else
- IMediaSample_SetMediaTime(sample, NULL, NULL);
-
- IMediaSample_SetDiscontinuity(sample, GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_DISCONT));
- IMediaSample_SetPreroll(sample, GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_LIVE));
- IMediaSample_SetSyncPoint(sample, !GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_DELTA_UNIT));
- IMediaSample_SetActualDataLength(sample, gst_buffer_get_size(buf));
-
- hr = IMemInputPin_Receive(This->tf.source.pMemInputPin, sample);
- IMediaSample_Release(sample);
- gst_buffer_unref(buf);
- if (FAILED(hr))
- return GST_FLOW_FLUSHING;
- return GST_FLOW_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_ProcessData(TransformFilter *iface, IMediaSample *sample)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- REFERENCE_TIME tStart, tStop;
- BYTE *data;
- GstBuffer *buf;
- HRESULT hr;
- DWORD bufsize;
- int ret;
-
- TRACE("%p, %p\n", This, sample);
-
- mark_wine_thread();
-
- IMediaSample_GetPointer(sample, &data);
-
- IMediaSample_AddRef(sample);
- bufsize = IMediaSample_GetActualDataLength(sample);
- buf = gst_buffer_new_wrapped_full(0, data, bufsize, 0, bufsize, sample, release_sample_wrapper);
- if (!buf) {
- IMediaSample_Release(sample);
- return S_OK;
- }
-
- IMediaSample_AddRef(sample);
- gst_mini_object_set_qdata(GST_MINI_OBJECT(buf), g_quark_from_static_string(media_quark_string), sample, release_sample_wrapper);
-
- buf->duration = buf->pts = -1;
- hr = IMediaSample_GetTime(sample, &tStart, &tStop);
- if (SUCCEEDED(hr)) {
- buf->pts = tStart * 100;
- if (hr == S_OK)
- buf->duration = (tStop - tStart)*100;
- }
- if (IMediaSample_GetMediaTime(sample, &tStart, &tStop) == S_OK) {
- buf->offset = tStart * 100;
- buf->offset_end = tStop * 100;
- }
- if (IMediaSample_IsDiscontinuity(sample) == S_OK)
- GST_BUFFER_FLAG_SET(buf, GST_BUFFER_FLAG_DISCONT);
- if (IMediaSample_IsPreroll(sample) == S_OK)
- GST_BUFFER_FLAG_SET(buf, GST_BUFFER_FLAG_LIVE);
- if (IMediaSample_IsSyncPoint(sample) != S_OK)
- GST_BUFFER_FLAG_SET(buf, GST_BUFFER_FLAG_DELTA_UNIT);
- ret = gst_pad_push(This->my_src, buf);
- if (ret)
- WARN("Sending returned: %i\n", ret);
- if (ret == GST_FLOW_FLUSHING)
- return VFW_E_WRONG_STATE;
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_ProcessEnd(TransformFilter *iface)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- int ret;
-
- mark_wine_thread();
-
- ret = gst_element_set_state(This->filter, GST_STATE_READY);
- TRACE("Returned: %i\n", ret);
- return S_OK;
-}
-
-void Gstreamer_transform_pad_added(GstElement *filter, GstPad *pad, gpointer user)
-{
- GstTfImpl *This = (GstTfImpl*)user;
- int ret;
-
- TRACE("%p %p %p\n", This, filter, pad);
-
- if (!GST_PAD_IS_SRC(pad))
- return;
-
- ret = gst_pad_link(pad, This->my_sink);
- if (ret < 0)
- WARN("Failed to link with %i\n", ret);
- This->their_src = pad;
-}
-
-static HRESULT Gstreamer_transform_ConnectInput(GstTfImpl *This, const AM_MEDIA_TYPE *amt, GstCaps *capsin, GstCaps *capsout)
-{
- GstIterator *it;
- BOOL done = FALSE, found = FALSE;
- int ret;
-
- TRACE("%p %p %p %p\n", This, amt, capsin, capsout);
-
- mark_wine_thread();
-
- This->filter = gst_element_factory_make(This->gstreamer_name, NULL);
- if (!This->filter) {
- ERR("Could not make %s filter\n", This->gstreamer_name);
- return E_FAIL;
- }
- This->my_src = gst_pad_new("yuvsrc", GST_PAD_SRC);
- gst_pad_set_element_private (This->my_src, This);
- gst_pad_set_active(This->my_src, 1);
-
- This->my_sink = gst_pad_new("yuvsink", GST_PAD_SINK);
- gst_pad_set_chain_function(This->my_sink, got_data_wrapper);
- gst_pad_set_element_private (This->my_sink, This);
- gst_pad_set_active(This->my_sink, 1);
-
- it = gst_element_iterate_sink_pads(This->filter);
- while (!done) {
- GValue item = {0};
-
- switch (gst_iterator_next(it, &item)) {
- case GST_ITERATOR_RESYNC:
- gst_iterator_resync (it);
- break;
- case GST_ITERATOR_OK:
- This->their_sink = g_value_get_object(&item);
- gst_object_ref(This->their_sink);
- g_value_reset(&item);
- case GST_ITERATOR_ERROR:
- case GST_ITERATOR_DONE:
- done = TRUE;
- break;
- }
- }
- gst_iterator_free(it);
- if (!This->their_sink) {
- ERR("Could not find sink on filter %s\n", This->gstreamer_name);
- return E_FAIL;
- }
-
- it = gst_element_iterate_src_pads(This->filter);
- gst_iterator_resync(it);
- done = FALSE;
- while (!done) {
- GValue item = {0};
-
- switch (gst_iterator_next(it, &item)) {
- case GST_ITERATOR_RESYNC:
- gst_iterator_resync (it);
- break;
- case GST_ITERATOR_OK:
- This->their_src = g_value_get_object(&item);
- gst_object_ref(This->their_src);
- g_value_reset(&item);
- case GST_ITERATOR_ERROR:
- case GST_ITERATOR_DONE:
- done = TRUE;
- break;
- }
- }
- gst_iterator_free(it);
- found = !!This->their_src;
- if (!found)
- g_signal_connect(This->filter, "pad-added", G_CALLBACK(Gstreamer_transform_pad_added_wrapper), This);
- ret = gst_pad_link(This->my_src, This->their_sink);
- if (ret < 0) {
- WARN("Failed to link with %i\n", ret);
- return E_FAIL;
- }
-
- ret = gst_pad_set_caps(This->my_src, capsin);
- if (ret < 0) {
- WARN("Failed to set caps on own source with %i\n", ret);
- return E_FAIL;
- }
-
- if (found)
- Gstreamer_transform_pad_added(This->filter, This->their_src, This);
-
- if (!gst_pad_is_linked(This->my_sink))
- return E_FAIL;
-
- ret = gst_pad_set_caps(This->my_sink, capsout);
- if (ret < 0) {
- WARN("Failed to set caps on own sink with %i\n", ret);
- return E_FAIL;
- }
-
- TRACE("Connected\n");
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_Cleanup(TransformFilter *tf, PIN_DIRECTION dir)
-{
- GstTfImpl *This = (GstTfImpl*)tf;
-
- TRACE("%p 0x%x\n", This, dir);
-
- mark_wine_thread();
-
- if (dir == PINDIR_INPUT)
- {
- if (This->filter) {
- gst_element_set_state(This->filter, GST_STATE_NULL);
- gst_object_unref(This->filter);
- }
- This->filter = NULL;
- if (This->my_src) {
- gst_pad_unlink(This->my_src, This->their_sink);
- gst_object_unref(This->my_src);
- gst_object_unref(This->their_sink);
- }
- if (This->my_sink) {
- gst_pad_unlink(This->their_src, This->my_sink);
- gst_object_unref(This->my_sink);
- gst_object_unref(This->their_src);
- }
- This->my_sink = This->my_src = This->their_sink = This->their_src = NULL;
- }
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_EndOfStream(TransformFilter *iface)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- TRACE("%p\n", This);
- mark_wine_thread();
-
- gst_pad_push_event(This->my_src, gst_event_new_eos());
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_BeginFlush(TransformFilter *iface)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- TRACE("%p\n", This);
- mark_wine_thread();
-
- gst_pad_push_event(This->my_src, gst_event_new_flush_start());
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_EndFlush(TransformFilter *iface)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- TRACE("%p\n", This);
- mark_wine_thread();
-
- gst_pad_push_event(This->my_src, gst_event_new_flush_stop(TRUE));
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_NewSegment(TransformFilter *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- const GstSegment segment = { GST_SEGMENT_FLAG_NONE, 1.0, dRate, GST_FORMAT_TIME, 0, 0, 0, tStop <= tStart ? -1 : tStop * 100, 0, tStart*100, -1 };
-
- TRACE("%p\n", This);
- mark_wine_thread();
-
- gst_pad_push_event(This->my_src, gst_event_new_segment(&segment));
-
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_transform_QOS(TransformFilter *iface, IBaseFilter *sender, Quality qm)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- REFERENCE_TIME late = qm.Late;
-
- TRACE("%p %p { 0x%x %u %s %s }\n", This, sender,
- qm.Type, qm.Proportion,
- wine_dbgstr_longlong(qm.Late),
- wine_dbgstr_longlong(qm.TimeStamp));
-
- mark_wine_thread();
-
- if (qm.Late < 0 && -qm.Late > qm.TimeStamp)
- late = -qm.TimeStamp;
- gst_pad_push_event(This->my_sink, gst_event_new_qos(late <= 0 ? GST_QOS_TYPE_OVERFLOW : GST_QOS_TYPE_UNDERFLOW, 1000. / qm.Proportion, late * 100, qm.TimeStamp * 100));
- return TransformFilterImpl_Notify(iface, sender, qm);
-}
-
-static HRESULT Gstreamer_transform_create(IUnknown *outer, const CLSID *clsid,
- const char *name, const TransformFilterFuncTable *vtbl, void **obj)
-{
- GstTfImpl *This;
-
- if (FAILED(strmbase_transform_create(sizeof(GstTfImpl), outer, clsid, vtbl, (IBaseFilter **)&This)))
- return E_OUTOFMEMORY;
-
- This->gstreamer_name = name;
- *obj = &This->tf.filter.IUnknown_inner;
-
- TRACE("returning %p\n", This);
-
- return S_OK;
-}
-
-static HRESULT WINAPI Gstreamer_Mp3_QueryConnect(TransformFilter *iface, const AM_MEDIA_TYPE *amt)
-{
- GstTfImpl *This = (GstTfImpl*)iface;
- TRACE("%p %p\n", This, amt);
-
- if ( (!IsEqualGUID(&amt->majortype, &MEDIATYPE_Audio) &&
- !IsEqualGUID(&amt->majortype, &MEDIATYPE_Stream)) ||
- (!IsEqualGUID(&amt->subtype, &MEDIASUBTYPE_MPEG1AudioPayload) &&
- !IsEqualGUID(&amt->subtype, &WMMEDIASUBTYPE_MP3))
- || !IsEqualGUID(&amt->formattype, &FORMAT_WaveFormatEx)){
- return S_FALSE;
- }
-
- return S_OK;
-}
-
-static HRESULT mp3_decoder_connect_sink(TransformFilter *tf, const AM_MEDIA_TYPE *amt)
-{
- GstTfImpl *This = (GstTfImpl*)tf;
- GstCaps *capsin, *capsout;
- AM_MEDIA_TYPE *outpmt = &This->tf.pmt;
- WAVEFORMATEX *wfx, *wfxin;
- HRESULT hr;
- int layer;
-
- mark_wine_thread();
-
- if (Gstreamer_Mp3_QueryConnect(&This->tf, amt) == S_FALSE || !amt->pbFormat)
- return VFW_E_TYPE_NOT_ACCEPTED;
-
- wfxin = (WAVEFORMATEX*)amt->pbFormat;
- switch (wfxin->wFormatTag) {
- case WAVE_FORMAT_MPEGLAYER3:
- layer = 3;
- break;
- case WAVE_FORMAT_MPEG: {
- MPEG1WAVEFORMAT *mpgformat = (MPEG1WAVEFORMAT*)wfxin;
- layer = mpgformat->fwHeadLayer;
- break;
- }
- default:
- FIXME("Unhandled tag %x\n", wfxin->wFormatTag);
- return E_FAIL;
- }
-
- FreeMediaType(outpmt);
- CopyMediaType(outpmt, amt);
-
- outpmt->subtype = MEDIASUBTYPE_PCM;
- outpmt->formattype = FORMAT_WaveFormatEx;
- outpmt->cbFormat = sizeof(*wfx);
- CoTaskMemFree(outpmt->pbFormat);
- wfx = CoTaskMemAlloc(outpmt->cbFormat);
- outpmt->pbFormat = (BYTE*)wfx;
- wfx->wFormatTag = WAVE_FORMAT_PCM;
- wfx->wBitsPerSample = 16;
- wfx->nSamplesPerSec = wfxin->nSamplesPerSec;
- wfx->nChannels = wfxin->nChannels;
- wfx->nBlockAlign = wfx->wBitsPerSample * wfx->nChannels / 8;
- wfx->cbSize = 0;
- wfx->nAvgBytesPerSec = wfx->nSamplesPerSec * wfx->nBlockAlign;
-
- capsin = gst_caps_new_simple("audio/mpeg",
- "mpegversion", G_TYPE_INT, 1,
- "layer", G_TYPE_INT, layer,
- "rate", G_TYPE_INT, wfx->nSamplesPerSec,
- "channels", G_TYPE_INT, wfx->nChannels,
- NULL);
- capsout = gst_caps_new_simple("audio/x-raw",
- "format", G_TYPE_STRING, "S16LE",
- "rate", G_TYPE_INT, wfx->nSamplesPerSec,
- "channels", G_TYPE_INT, wfx->nChannels,
- NULL);
-
- hr = Gstreamer_transform_ConnectInput(This, amt, capsin, capsout);
- gst_caps_unref(capsin);
- gst_caps_unref(capsout);
-
- This->cbBuffer = wfx->nAvgBytesPerSec / 4;
-
- return hr;
-}
-
-static const TransformFilterFuncTable Gstreamer_Mp3_vtbl = {
- .pfnDecideBufferSize = Gstreamer_transform_DecideBufferSize,
- .pfnStartStreaming = Gstreamer_transform_ProcessBegin,
- .pfnReceive = Gstreamer_transform_ProcessData,
- .pfnStopStreaming = Gstreamer_transform_ProcessEnd,
- .pfnCheckInputType = Gstreamer_Mp3_QueryConnect,
- .transform_connect_sink = mp3_decoder_connect_sink,
- .pfnBreakConnect = Gstreamer_transform_Cleanup,
- .pfnEndOfStream = Gstreamer_transform_EndOfStream,
- .pfnBeginFlush = Gstreamer_transform_BeginFlush,
- .pfnEndFlush = Gstreamer_transform_EndFlush,
- .pfnNewSegment = Gstreamer_transform_NewSegment,
- .pfnNotify = Gstreamer_transform_QOS,
-};
-
-IUnknown * CALLBACK Gstreamer_Mp3_create(IUnknown *punkouter, HRESULT *phr)
-{
- const char *plugin;
- IUnknown *obj = NULL;
-
- TRACE("%p %p\n", punkouter, phr);
-
- if (!init_gstreamer())
- {
- *phr = E_FAIL;
- return NULL;
- }
-
- mark_wine_thread();
-
- plugin = Gstreamer_FindMatch("audio/mpeg, mpegversion=(int) 1");
- if (!plugin)
- {
- *phr = E_FAIL;
- return NULL;
- }
-
- *phr = Gstreamer_transform_create(punkouter, &CLSID_Gstreamer_Mp3, plugin, &Gstreamer_Mp3_vtbl, (LPVOID*)&obj);
-
- TRACE("returning %p\n", obj);
-
- return obj;
-}
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index 3e0ef28afb6..59c2bd974d4 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -38,8 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(gstreamer);
static const WCHAR wGstreamer_Splitter[] =
{'G','S','t','r','e','a','m','e','r',' ','s','p','l','i','t','t','e','r',' ','f','i','l','t','e','r',0};
-static const WCHAR wGstreamer_Mp3[] =
-{'G','S','t','r','e','a','m','e','r',' ','M','p','3',' ','f','i','l','t','e','r',0};
static const WCHAR wave_parserW[] =
{'W','a','v','e',' ','P','a','r','s','e','r',0};
static const WCHAR avi_splitterW[] =
@@ -94,32 +92,6 @@ static const AMOVIESETUP_FILTER amfSplitter =
amfSplitPin
};
-AMOVIESETUP_PIN amfMp3Pin[] =
-{ { wNull,
- FALSE, FALSE, FALSE, FALSE,
- &GUID_NULL,
- NULL,
- 1,
- amfMTaudio
- },
- {
- wNull,
- FALSE, TRUE, FALSE, FALSE,
- &GUID_NULL,
- NULL,
- 1,
- amfMTaudio
- },
-};
-
-AMOVIESETUP_FILTER const amfMp3 =
-{ &CLSID_Gstreamer_Mp3,
- wGstreamer_Mp3,
- MERIT_NORMAL,
- 2,
- amfMp3Pin
-};
-
static const AMOVIESETUP_MEDIATYPE wave_parser_sink_type_data[] =
{
{&MEDIATYPE_Stream, &MEDIASUBTYPE_WAVE},
@@ -260,13 +232,6 @@ FactoryTemplate const g_Templates[] = {
NULL,
&amfSplitter,
},
- {
- wGstreamer_Mp3,
- &CLSID_Gstreamer_Mp3,
- Gstreamer_Mp3_create,
- NULL,
- &amfMp3,
- },
{
wave_parserW,
&CLSID_WAVEParser,
--
2.25.0
1
4
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
include/Makefile.in | 1 +
include/xact3wb.h | 64 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+)
create mode 100644 include/xact3wb.h
diff --git a/include/Makefile.in b/include/Makefile.in
index 8284d6fdf3..b1e7d0084f 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -772,6 +772,7 @@ SOURCES = \
wtypes.idl \
wuapi.idl \
x3daudio.h \
+ xact3wb.h \
xapo.idl \
xapofx.h \
xaudio2.idl \
diff --git a/include/xact3wb.h b/include/xact3wb.h
new file mode 100644
index 0000000000..d283efc112
--- /dev/null
+++ b/include/xact3wb.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2020 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#ifndef __XACT3WB_H__
+#define __XACT3WB_H__
+
+typedef union WAVEBANKMINIWAVEFORMAT
+{
+ struct
+ {
+ DWORD wFormatTag : 2;
+ DWORD nChannels : 3;
+ DWORD nSamplesPerSec : 18;
+ DWORD wBlockAlign : 8;
+ DWORD wBitsPerSample : 1;
+ } DUMMYSTRUCTNAME;
+
+ DWORD dwValue;
+} WAVEBANKMINIWAVEFORMAT;
+
+typedef struct WAVEBANKREGION
+{
+ DWORD dwOffset;
+ DWORD dwLength;
+} WAVEBANKREGION;
+
+typedef struct WAVEBANKSAMPLEREGION
+{
+ DWORD dwStartSample;
+ DWORD dwTotalSamples;
+} WAVEBANKSAMPLEREGION;
+
+typedef struct WAVEBANKENTRY
+{
+ union
+ {
+ struct
+ {
+ DWORD dwFlags : 4;
+ DWORD Duration : 28;
+ } DUMMYSTRUCTNAME;
+ DWORD dwFlagsAndDuration;
+ } DUMMYUNIONNAME;
+
+ WAVEBANKMINIWAVEFORMAT Format;
+ WAVEBANKREGION PlayRegion;
+ WAVEBANKSAMPLEREGION LoopRegion;
+} WAVEBANKENTRY;
+
+#endif /* __XACT3WB_H__ */
--
2.24.1
1
0
From: Ethan Lee <elee(a)codeweavers.com>
v2: Use a xact3wb.h for the structures that use :X syntax, which is the
same as windows.
#if 0 these structures and removed the union part with a equal size value.
Windows only exposes the lastest IXACT3Engine, we'll have to use a
private idl to define the other versions.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
include/Makefile.in | 1 +
include/xact3.idl | 556 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 557 insertions(+)
create mode 100644 include/xact3.idl
diff --git a/include/Makefile.in b/include/Makefile.in
index b1e7d0084f..acfbfe329a 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -772,6 +772,7 @@ SOURCES = \
wtypes.idl \
wuapi.idl \
x3daudio.h \
+ xact3.idl \
xact3wb.h \
xapo.idl \
xapofx.h \
diff --git a/include/xact3.idl b/include/xact3.idl
new file mode 100644
index 0000000000..a355015cac
--- /dev/null
+++ b/include/xact3.idl
@@ -0,0 +1,556 @@
+/*
+ * Copyright (c) 2018 Ethan Lee for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "unknwn.idl";
+import "xaudio2.idl";
+
+cpp_quote("#include \"xact3wb.h\"")
+
+[
+ uuid(bcc782bc-6492-4c22-8c35-f5d72fe73c6e)
+]
+coclass XACTEngine
+{
+ interface IUnknown;
+}
+
+interface IXACT3Engine;
+interface IXACT3SoundBank;
+interface IXACT3WaveBank;
+interface IXACT3Cue;
+interface IXACT3Wave;
+
+typedef WORD XACTCATEGORY;
+typedef BYTE XACTCHANNEL;
+typedef WORD XACTINDEX;
+typedef BYTE XACTINSTANCELIMIT;
+typedef BYTE XACTLOOPCOUNT;
+typedef BYTE XACTNOTIFICATIONTYPE;
+typedef SHORT XACTPITCH;
+typedef LONG XACTTIME;
+typedef WORD XACTVARIABLEINDEX;
+typedef FLOAT XACTVARIABLEVALUE;
+typedef BYTE XACTVARIATIONWEIGHT;
+typedef FLOAT XACTVOLUME;
+
+typedef struct XACT_RENDERER_DETAILS
+{
+ WCHAR rendererID[0xFF];
+ WCHAR displayName[0xFF];
+ BOOL defaultDevice;
+} XACT_RENDERER_DETAILS;
+
+typedef BOOL (__stdcall *XACT_READFILE_CALLBACK)(
+ HANDLE hFile,
+ LPVOID lpBuffer,
+ DWORD nNumberOfBytesRead,
+ LPDWORD lpNumberOfBytesRead,
+ void* lpOverlapped
+);
+typedef BOOL (__stdcall *XACT_GETOVERLAPPEDRESULT_CALLBACK)(
+ HANDLE hFile,
+ void* lpOverlapped,
+ LPDWORD lpNumberOfBytesTransferred,
+ BOOL bWait
+);
+typedef struct XACT_FILEIO_CALLBACKS
+{
+ XACT_READFILE_CALLBACK readFileCallback;
+ XACT_GETOVERLAPPEDRESULT_CALLBACK getOverlappedResultCallback;
+} XACT_FILEIO_CALLBACKS;
+
+typedef struct XACT_NOTIFICATION XACT_NOTIFICATION;
+typedef void (__stdcall *XACT_NOTIFICATION_CALLBACK)(
+ const XACT_NOTIFICATION *pNotification
+);
+
+typedef struct XACT_RUNTIME_PARAMETERS
+{
+ DWORD lookAheadTime;
+ void* pGlobalSettingsBuffer;
+ DWORD globalSettingsBufferSize;
+ DWORD globalSettingsFlags;
+ DWORD globalSettingsAllocAttributes;
+ XACT_FILEIO_CALLBACKS fileIOCallbacks;
+ XACT_NOTIFICATION_CALLBACK fnNotificationCallback;
+ LPCWSTR pRendererID;
+ IXAudio2 *pXAudio2;
+ IXAudio2MasteringVoice *pMasteringVoice;
+} XACT_RUNTIME_PARAMETERS;
+
+typedef struct XACT_STREAMING_PARAMETERS
+{
+ HANDLE file;
+ DWORD offset;
+ DWORD flags;
+ WORD packetSize;
+} XACT_STREAMING_PARAMETERS;
+
+/* defined in xact3wb.h */
+cpp_quote("#if 0")
+
+typedef struct WAVEBANKREGION
+{
+ DWORD dwOffset;
+ DWORD dwLength;
+} WAVEBANKREGION;
+
+typedef struct WAVEBANKSAMPLEREGION
+{
+ DWORD dwStartSample;
+ DWORD dwTotalSamples;
+} WAVEBANKSAMPLEREGION;
+
+typedef union WAVEBANKMINIWAVEFORMAT
+{
+ DWORD dwValue;
+} WAVEBANKMINIWAVEFORMAT;
+
+typedef struct WAVEBANKENTRY
+{
+ DWORD dwFlagsAndDuration; /* Is a union */
+ WAVEBANKMINIWAVEFORMAT Format;
+ WAVEBANKREGION PlayRegion;
+ WAVEBANKSAMPLEREGION LoopRegion;
+} WAVEBANKENTRY;
+
+cpp_quote("#endif")
+
+typedef struct XACT_WAVE_PROPERTIES
+{
+ char friendlyName[64];
+ WAVEBANKMINIWAVEFORMAT format;
+ DWORD durationInSamples;
+ WAVEBANKSAMPLEREGION loopRegion;
+ BOOL streaming;
+} XACT_WAVE_PROPERTIES;
+
+cpp_quote("#if 0")
+typedef struct XACT_WAVE_INSTANCE_PROPERTIES
+{
+ XACT_WAVE_PROPERTIES waveProperties; /* properties is a keyword for midl */
+ BOOL backgroundMusic;
+} XACT_WAVE_INSTANCE_PROPERTIES;
+cpp_quote("#endif")
+
+cpp_quote("typedef struct XACT_WAVE_INSTANCE_PROPERTIES")
+cpp_quote("{")
+cpp_quote(" XACT_WAVE_PROPERTIES properties;")
+cpp_quote(" BOOL backgroundMusic;")
+cpp_quote("} XACT_WAVE_INSTANCE_PROPERTIES;")
+
+typedef struct XACT_CUE_PROPERTIES
+{
+ char friendlyName[0xFF];
+ BOOL interactive;
+ XACTINDEX iaVariableIndex;
+ XACTINDEX numVariations;
+ XACTINSTANCELIMIT maxInstances;
+ XACTINSTANCELIMIT currentInstances;
+} XACT_CUE_PROPERTIES;
+
+typedef struct XACT_TRACK_PROPERTIES
+{
+ XACTTIME duration;
+ XACTINDEX numVariations;
+ XACTCHANNEL numChannels;
+ XACTINDEX waveVariation;
+ XACTLOOPCOUNT loopCount;
+} XACT_TRACK_PROPERTIES;
+
+typedef struct XACT_VARIATION_PROPERTIES
+{
+ XACTINDEX index;
+ XACTVARIATIONWEIGHT weight;
+ XACTVARIABLEVALUE iaVariableMin;
+ XACTVARIABLEVALUE iaVariableMax;
+ BOOL linger;
+} XACT_VARIATION_PROPERTIES;
+
+typedef struct XACT_SOUND_PROPERTIES
+{
+ XACTCATEGORY category;
+ BYTE priority;
+ XACTPITCH pitch;
+ XACTVOLUME volume;
+ XACTINDEX numTracks;
+ XACT_TRACK_PROPERTIES arrTrackProperties[1];
+} XACT_SOUND_PROPERTIES;
+
+typedef struct XACT_SOUND_VARIATION_PROPERTIES
+{
+ XACT_VARIATION_PROPERTIES variationProperties;
+ XACT_SOUND_PROPERTIES soundProperties;
+} XACT_SOUND_VARIATION_PROPERTIES;
+
+typedef struct XACT_CUE_INSTANCE_PROPERTIES
+{
+ DWORD allocAttributes;
+ XACT_CUE_PROPERTIES cueProperties;
+ XACT_SOUND_VARIATION_PROPERTIES activeVariationProperties;
+} XACT_CUE_INSTANCE_PROPERTIES;
+
+cpp_quote("#include <pshpack1.h>")
+
+typedef struct XACT_NOTIFICATION_DESCRIPTION
+{
+ XACTNOTIFICATIONTYPE type;
+ BYTE flags;
+ IXACT3SoundBank *pSoundBank;
+ IXACT3WaveBank *pWaveBank;
+ IXACT3Cue *pCue;
+ IXACT3Wave *pWave;
+ XACTINDEX cueIndex;
+ XACTINDEX waveIndex;
+ void* pvContext;
+} XACT_NOTIFICATION_DESCRIPTION;
+
+typedef struct XACT_NOTIFICATION_CUE
+{
+ XACTINDEX cueIndex;
+ IXACT3SoundBank *pSoundBank;
+ IXACT3Cue *pCue;
+} XACT_NOTIFICATION_CUE;
+
+typedef struct XACT_NOTIFICATION_MARKER
+{
+ XACTINDEX cueIndex;
+ IXACT3SoundBank *pSoundBank;
+ IXACT3Cue *pCue;
+ DWORD marker;
+} XACT_NOTIFICATION_MARKER;
+
+typedef struct XACT_NOTIFICATION_SOUNDBANK
+{
+ IXACT3SoundBank *pSoundBank;
+} XACT_NOTIFICATION_SOUNDBANK;
+
+typedef struct XACT_NOTIFICATION_WAVEBANK
+{
+ IXACT3WaveBank *pWaveBank;
+} XACT_NOTIFICATION_WAVEBANK;
+
+typedef struct XACT_NOTIFICATION_VARIABLE
+{
+ XACTINDEX cueIndex;
+ IXACT3SoundBank *pSoundBank;
+ IXACT3Cue *pCue;
+ XACTVARIABLEINDEX variableIndex;
+ XACTVARIABLEVALUE variableValue;
+ BOOL local;
+} XACT_NOTIFICATION_VARIABLE;
+
+typedef struct XACT_NOTIFICATION_GUI
+{
+ DWORD reserved;
+} XACT_NOTIFICATION_GUI;
+
+typedef struct XACT_NOTIFICATION_WAVE
+{
+ IXACT3WaveBank *pWaveBank;
+ XACTINDEX waveIndex;
+ XACTINDEX cueIndex;
+ IXACT3SoundBank *pSoundBank;
+ IXACT3Cue *pCue;
+ IXACT3Wave *pWave;
+} XACT_NOTIFICATION_WAVE;
+
+struct XACT_NOTIFICATION
+{
+ XACTNOTIFICATIONTYPE type;
+ LONG timeStamp;
+ PVOID pvContext;
+ union
+ {
+ XACT_NOTIFICATION_CUE cue;
+ XACT_NOTIFICATION_MARKER marker;
+ XACT_NOTIFICATION_SOUNDBANK soundBank;
+ XACT_NOTIFICATION_WAVEBANK waveBank;
+ XACT_NOTIFICATION_VARIABLE variable;
+ XACT_NOTIFICATION_GUI gui;
+ XACT_NOTIFICATION_WAVE wave;
+ };
+};
+
+cpp_quote("#include <poppack.h>")
+
+static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEDESTROYED = 4;
+static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED = 6;
+static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED = 7;
+static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEDESTROYED = 16;
+
+[
+ object,
+ local,
+ uuid(b1ee676a-d9cd-4d2a-89a8-fa53eb9e480b),
+]
+interface IXACT3Engine : IUnknown
+{
+ HRESULT GetRendererCount([out] XACTINDEX *pnRendererCount);
+
+ HRESULT GetRendererDetails(
+ XACTINDEX nRendererIndex,
+ [out] XACT_RENDERER_DETAILS *pRendererDetails);
+
+ HRESULT GetFinalMixFormat([out] WAVEFORMATEXTENSIBLE *pFinalMixFormat);
+
+ HRESULT Initialize([in] const XACT_RUNTIME_PARAMETERS *pParams);
+
+ HRESULT ShutDown();
+
+ HRESULT DoWork();
+
+ HRESULT CreateSoundBank(
+ [in] const void* pvBuffer,
+ DWORD dwSize,
+ DWORD dwFlags,
+ DWORD dwAllocAttributes,
+ [out] IXACT3SoundBank **ppSoundBank);
+
+ HRESULT CreateInMemoryWaveBank(
+ [in] const void* pvBuffer,
+ DWORD dwSize,
+ DWORD dwFlags,
+ DWORD dwAllocAttributes,
+ [out] IXACT3WaveBank **ppWaveBank);
+
+ HRESULT CreateStreamingWaveBank(
+ [in] const XACT_STREAMING_PARAMETERS *pParms,
+ [out] IXACT3WaveBank **ppWaveBank);
+
+ HRESULT PrepareWave(
+ DWORD dwFlags,
+ [in] LPCSTR szWavePath,
+ WORD wStreamingPacketSize,
+ DWORD dwAlignment,
+ DWORD dwPlayOffset,
+ XACTLOOPCOUNT nLoopCount,
+ [out] IXACT3Wave **ppWave);
+
+ HRESULT PrepareInMemoryWave(
+ DWORD dwFlags,
+ WAVEBANKENTRY entry,
+ [in] DWORD *pdwSeekTable,
+ [in] BYTE *pbWaveData,
+ DWORD dwPlayOffset,
+ XACTLOOPCOUNT nLoopCount,
+ [out] IXACT3Wave **ppWave);
+
+ HRESULT PrepareStreamingWave(
+ DWORD dwFlags,
+ WAVEBANKENTRY entry,
+ XACT_STREAMING_PARAMETERS streamingParams,
+ DWORD dwAlignment,
+ [in] DWORD *pdwSeekTable,
+ DWORD dwPlayOffset,
+ XACTLOOPCOUNT nLoopCount,
+ [out] IXACT3Wave **ppWave);
+
+ HRESULT RegisterNotification(
+ [in] const XACT_NOTIFICATION_DESCRIPTION *pNotificationDesc);
+
+ HRESULT UnRegisterNotification(
+ [in] const XACT_NOTIFICATION_DESCRIPTION *pNotificationDesc);
+
+ XACTCATEGORY GetCategory(
+ [in] LPCSTR szFriendlyName);
+
+ HRESULT Stop(XACTCATEGORY nCategory, DWORD dwFlags);
+
+ HRESULT SetVolume(XACTCATEGORY nCategory, XACTVOLUME nVolume);
+
+ HRESULT Pause(XACTCATEGORY nCategory, BOOL fPause);
+
+ XACTVARIABLEINDEX GetGlobalVariableIndex([in] LPCSTR szFriendlyName);
+
+ HRESULT SetGlobalVariable(
+ XACTVARIABLEINDEX nIndex,
+ XACTVARIABLEVALUE nValue);
+
+ HRESULT GetGlobalVariable(
+ XACTVARIABLEINDEX nIndex,
+ [out] XACTVARIABLEVALUE *nValue);
+}
+
+[
+ object,
+ local
+]
+interface IXACT3SoundBank
+{
+ XACTINDEX GetCueIndex([in] LPCSTR szFriendlyName);
+
+ HRESULT GetNumCues([out] XACTINDEX *pnNumCues);
+
+ HRESULT GetCueProperties(
+ XACTINDEX nCueIndex,
+ [out] XACT_CUE_PROPERTIES *pProperties);
+
+ HRESULT Prepare(
+ XACTINDEX nCueIndex,
+ DWORD dwFlags,
+ XACTTIME timeOffset,
+ [out] IXACT3Cue **ppCue);
+
+ HRESULT Play(
+ XACTINDEX nCueIndex,
+ DWORD dwFlags,
+ XACTTIME timeOffset,
+ [out] IXACT3Cue **ppCue);
+
+ HRESULT Stop(XACTINDEX nCueIndex, DWORD dwFlags);
+
+ HRESULT Destroy();
+
+ HRESULT GetState([out] DWORD *pdwState);
+}
+
+[
+ object,
+ local
+]
+interface IXACT3WaveBank
+{
+ HRESULT Destroy();
+
+ HRESULT GetNumWaves([out] XACTINDEX *pnNumWaves);
+
+ XACTINDEX GetWaveIndex([in] LPCSTR szFriendlyName);
+
+ HRESULT GetWaveProperties(
+ XACTINDEX nWaveIndex,
+ [out] XACT_WAVE_PROPERTIES *pWaveProperties);
+
+ HRESULT Prepare(
+ XACTINDEX nWaveIndex,
+ DWORD dwFlags,
+ DWORD dwPlayOffset,
+ XACTLOOPCOUNT nLoopCount,
+ [out] IXACT3Wave **ppWave);
+
+ HRESULT Play(
+ XACTINDEX nWaveIndex,
+ DWORD dwFlags,
+ DWORD dwPlayOffset,
+ XACTLOOPCOUNT nLoopCount,
+ [out] IXACT3Wave **ppWave);
+
+ HRESULT Stop(XACTINDEX nWaveIndex, DWORD dwFlags);
+
+ HRESULT GetState([out] DWORD *pdwState);
+}
+
+[
+ object,
+ local
+]
+interface IXACT34Cue
+{
+ HRESULT Play();
+
+ HRESULT Stop(DWORD dwFlags);
+
+ HRESULT GetState([out] DWORD *pdwState);
+
+ HRESULT Destroy();
+
+ HRESULT SetMatrixCoefficients(
+ UINT32 uSrcChannelCount,
+ UINT32 uDstChannelCount,
+ [in] float *pMatrixCoefficients);
+
+ XACTVARIABLEINDEX GetVariableIndex([in] LPCSTR szFriendlyName);
+
+ HRESULT SetVariable(XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue);
+
+ HRESULT GetVariable(
+ XACTVARIABLEINDEX nIndex,
+ [out] XACTVARIABLEVALUE *nValue);
+
+ HRESULT Pause(BOOL fPause);
+
+ HRESULT GetProperties([out] XACT_CUE_INSTANCE_PROPERTIES **ppProperties);
+}
+
+[
+ object,
+ local
+]
+interface IXACT3Cue
+{
+ HRESULT Play();
+
+ HRESULT Stop(DWORD dwFlags);
+
+ HRESULT GetState([out] DWORD *pdwState);
+
+ HRESULT Destroy();
+
+ HRESULT SetMatrixCoefficients(
+ UINT32 uSrcChannelCount,
+ UINT32 uDstChannelCount,
+ [in] float *pMatrixCoefficients);
+
+ XACTVARIABLEINDEX GetVariableIndex([in] LPCSTR szFriendlyName);
+
+ HRESULT SetVariable(XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue);
+
+ HRESULT GetVariable(
+ XACTVARIABLEINDEX nIndex,
+ [out] XACTVARIABLEVALUE *nValue);
+
+ HRESULT Pause(BOOL fPause);
+
+ HRESULT GetProperties([out] XACT_CUE_INSTANCE_PROPERTIES **ppProperties);
+
+ HRESULT SetOutputVoices([in] const XAUDIO2_VOICE_SENDS *pSendList);
+
+ HRESULT SetOutputVoiceMatrix(
+ [in] IXAudio2Voice *pDestinationVoice,
+ UINT32 SourceChannels,
+ UINT32 DestinationChannels,
+ [in, size_is(SourceChannels * DestinationChannels)] const float *pLevelMatrix);
+}
+
+[
+ object,
+ local
+]
+interface IXACT3Wave
+{
+ HRESULT Destroy();
+
+ HRESULT Play();
+
+ HRESULT Stop(DWORD dwFlags);
+
+ HRESULT Pause(BOOL fPause);
+
+ HRESULT GetState([out] DWORD *pdwState);
+
+ HRESULT SetPitch(XACTPITCH pitch);
+
+ HRESULT SetVolume(XACTVOLUME volume);
+
+ HRESULT SetMatrixCoefficients(
+ UINT32 uSrcChannelCount,
+ UINT32 uDstChannelCount,
+ [in] float *pMatrixCoefficients);
+
+ HRESULT GetProperties([out] XACT_WAVE_INSTANCE_PROPERTIES *pProperties);
+}
--
2.24.1
2
1
[PATCH 1/2] testbot: Share code to access the latest reference WineTest reports.
by Francois Gouget 28 Jan '20
by Francois Gouget 28 Jan '20
28 Jan '20
Also take the latest WineTest reports snapshot when the corresponding
task completes rather than when the build task they depend on completes.
This way the snapshot is taken closest to when the reference reports are
needed.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/UpdateTaskLogs | 12 ++--
testbot/bin/WineRunBuild.pl | 31 ---------
testbot/bin/WineRunTask.pl | 34 ++++-----
testbot/bin/WineRunWineTest.pl | 65 +++--------------
testbot/lib/WineTestBot/LogUtils.pm | 104 +++++++++++++++++++++++++++-
testbot/lib/WineTestBot/Tasks.pm | 30 ++++++++
6 files changed, 160 insertions(+), 116 deletions(-)
diff --git a/testbot/bin/UpdateTaskLogs b/testbot/bin/UpdateTaskLogs
index f5205f23d8..5f858dece6 100755
--- a/testbot/bin/UpdateTaskLogs
+++ b/testbot/bin/UpdateTaskLogs
@@ -230,15 +230,11 @@ sub DoUpdateLatestReport($$$)
# Add the reference report to latest/
Debug("latest: Adding $RefReportName from ". Path2TaskKey($SrcReportPath) ."\n");
- foreach my $Suffix ("", ".err")
+ my $ErrMessages = UpdateLatestReport($Task, $ReportName, $SrcReportPath);
+ foreach my $ErrMessage (@$ErrMessages)
{
- unlink("$LatestReportPath$Suffix");
- if (-f "$SrcReportPath$Suffix" and
- !link("$SrcReportPath$Suffix", "$LatestReportPath$Suffix"))
- {
- Error "Could not replace 'latest/$RefReportName$Suffix': $!\n";
- $Rc = 1;
- }
+ Error "$ErrMessage\n";
+ $Rc = 1;
}
$LatestReports{$RefReportName} = $LatestReportPath;
}
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 9fc5bffe24..6b68c0dc47 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -496,37 +496,6 @@ Debug(Elapsed($Start), " Disconnecting\n");
$TA->Disconnect();
-#
-# Grab a copy of the reference logs
-#
-
-# Note that this may be a bit inaccurate right after a Wine commit.
-# See WineSendLog.pl for more details.
-my $LatestDir = "$DataDir/latest";
-foreach my $TestStep (@{$Job->Steps->GetItems()})
-{
- if (($TestStep->PreviousNo || 0) == $Step->No and
- $TestStep->FileType =~ /^exe/)
- {
- foreach my $TestTask (@{$TestStep->Tasks->GetItems()})
- {
- my $RefReport = $TestTask->GetRefReportName($TestStep->FileType .".report");
- for my $Suffix ("", ".err")
- {
- if (-f "$LatestDir/$RefReport$Suffix")
- {
- unlink "$StepDir/$RefReport$Suffix";
- if (!link "$LatestDir/$RefReport$Suffix", "$StepDir/$RefReport$Suffix")
- {
- Error "Could not link '$RefReport$Suffix': $!\n";
- }
- }
- }
- }
- }
-}
-
-
#
# Wrap up
#
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 7c8c5704fe..2b54048bac 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -45,7 +45,6 @@ use WineTestBot::Engine::Notify;
use WineTestBot::Jobs;
use WineTestBot::Log;
use WineTestBot::LogUtils;
-use WineTestBot::Missions;
use WineTestBot::Utils;
use WineTestBot::VMs;
@@ -195,7 +194,6 @@ my $OldUMask = umask(002);
my $TaskDir = $Task->CreateDir();
umask($OldUMask);
my $VM = $Task->VM;
-my $RptFileName = $Step->FileType .".report";
my $Start = Time();
@@ -224,6 +222,8 @@ sub LogTaskError($)
umask($OldUMask);
}
+my $ReportNames;
+
sub WrapUpAndExit($;$$$$)
{
my ($Status, $TestFailures, $Retry, $TimedOut, $Reason) = @_;
@@ -299,22 +299,11 @@ sub WrapUpAndExit($;$$$$)
$VM->Save();
}
+ # Update the 'latest/' reference WineTest results
if ($Step->Type eq 'suite' and $Status eq 'completed' and !$TimedOut)
{
- # Keep the old report if the new one is missing
- if (-f "$TaskDir/$RptFileName" and !-z "$TaskDir/$RptFileName")
- {
- # Update the VM's reference WineTest results for WineSendLog.pl
- my $RefReport = "$DataDir/latest/". $Task->GetRefReportName($RptFileName);
- unlink($RefReport);
- link("$TaskDir/$RptFileName", $RefReport);
-
- unlink("$RefReport.err");
- if (-f "$TaskDir/$RptFileName.err" and !-z "$TaskDir/$RptFileName.err")
- {
- link("$TaskDir/$RptFileName.err", "$RefReport.err");
- }
- }
+ my $ErrMessages = UpdateLatestReports($Task, $ReportNames);
+ Error("$_\n") for (@$ErrMessages);
}
my $Result = $VM->Name .": ". $VM->Status ." Status: $Status Failures: ". (defined $TestFailures ? $TestFailures : "unset");
@@ -420,12 +409,11 @@ if ($Step->FileType ne "exe32" and $Step->FileType ne "exe64")
FatalError("Unexpected file type '". $Step->FileType ."' found for ". $Step->Type ." step\n");
}
-my ($ErrMessage, $Missions) = ParseMissionStatement($Task->Missions);
+(my $ErrMessage, $ReportNames, my $TaskMissions) = $Task->GetReportNames();
FatalError "$ErrMessage\n" if (defined $ErrMessage);
-FatalError "Empty mission statement\n" if (!@$Missions);
-FatalError "Cannot specify missions for multiple tasks\n" if (@$Missions > 1);
-FatalError "Cannot specify multiple missions\n" if (@{$Missions->[0]->{Missions}} > 1);
-my $Mission = $Missions->[0]->{Missions}->[0];
+FatalError "Cannot specify multiple missions\n" if (@{$TaskMissions->{Missions}} > 1);
+my $Mission = $TaskMissions->{Missions}->[0];
+my $RptFileName = $ReportNames->[0];
#
@@ -567,6 +555,10 @@ if ($TA->GetFile($RptFileName, "$TaskDir/$RptFileName"))
}
else
{
+ # Grab a copy of the reference report
+ my $ErrMessages = SnapshotLatestReport($Task, $RptFileName);
+ LogTaskError("$_\n") for (@$ErrMessages);
+
# $LogInfo->{Failures} can legitimately be undefined in case of a timeout
$TaskFailures += $LogInfo->{Failures} || 0;
if (@{$LogInfo->{Extra}} and open(my $Log, ">", "$TaskDir/$RptFileName.err"))
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 6ca1d284fe..9a0a4ebafc 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -43,7 +43,6 @@ $Name0 =~ s+^.*/++;
use WineTestBot::Config;
use WineTestBot::Engine::Notify;
use WineTestBot::Jobs;
-use WineTestBot::Missions;
use WineTestBot::PatchUtils;
use WineTestBot::Log;
use WineTestBot::LogUtils;
@@ -218,7 +217,7 @@ sub LogTaskError($)
}
}
-my $TaskMissions;
+my $ReportNames;
sub WrapUpAndExit($;$$$$)
{
@@ -295,26 +294,11 @@ sub WrapUpAndExit($;$$$$)
$VM->Save();
}
+ # Update the 'latest/' reference WineTest results
if ($Step->Type eq 'suite' and $Status eq 'completed' and !$TimedOut)
{
- foreach my $Mission (@{$TaskMissions->{Missions}})
- {
- # Keep the old report if the new one is missing
- my $RptFileName = GetMissionBaseName($Mission) .".report";
- if (-f "$TaskDir/$RptFileName" and !-z "$TaskDir/$RptFileName")
- {
- # Update the VM's reference WineTest results for WineSendLog.pl
- my $RefReport = "$DataDir/latest/". $Task->VM->Name ."_$RptFileName";
- unlink($RefReport);
- link("$TaskDir/$RptFileName", $RefReport);
-
- unlink("$RefReport.err");
- if (-f "$TaskDir/$RptFileName.err" and !-z "$TaskDir/$RptFileName.err")
- {
- link("$TaskDir/$RptFileName.err", "$RefReport.err");
- }
- }
- }
+ my $ErrMessages = UpdateLatestReports($Task, $ReportNames);
+ Error("$_\n") for (@$ErrMessages);
}
my $Result = $VM->Name .": ". $VM->Status ." Status: $Status Failures: ". (defined $TestFailures ? $TestFailures : "unset");
@@ -421,11 +405,8 @@ if (($Step->Type eq "suite" and $Step->FileType ne "none") or
FatalError("Unexpected file type '". $Step->FileType ."' found for ". $Step->Type ." step\n");
}
-my ($ErrMessage, $Missions) = ParseMissionStatement($Task->Missions);
+(my $ErrMessage, $ReportNames, my $_TaskMissions) = $Task->GetReportNames();
FatalError "$ErrMessage\n" if (defined $ErrMessage);
-FatalError "Empty mission statement\n" if (!@$Missions);
-FatalError "Cannot specify missions for multiple tasks\n" if (@$Missions > 1);
-$TaskMissions = $Missions->[0];
#
@@ -570,9 +551,8 @@ elsif (!defined $TAError)
# Grab the test reports if any
#
-foreach my $Mission (@{$TaskMissions->{Missions}})
+foreach my $RptFileName (@$ReportNames)
{
- my $RptFileName = GetMissionBaseName($Mission) .".report";
Debug(Elapsed($Start), " Retrieving '$RptFileName'\n");
if ($TA->GetFile($RptFileName, "$TaskDir/$RptFileName"))
{
@@ -589,6 +569,10 @@ foreach my $Mission (@{$TaskMissions->{Missions}})
}
else
{
+ # Grab a copy of the reference report
+ my $ErrMessages = SnapshotLatestReport($Task, $RptFileName);
+ LogTaskError("$_\n") for (@$ErrMessages);
+
# $LogInfo->{Failures} can legitimately be undefined in case of a timeout
$TaskFailures += $LogInfo->{Failures} || 0;
if (@{$LogInfo->{Extra}} and open(my $Log, ">", "$TaskDir/$RptFileName.err"))
@@ -617,35 +601,6 @@ Debug(Elapsed($Start), " Disconnecting\n");
$TA->Disconnect();
-#
-# Grab a copy of the reference logs
-#
-
-# Note that this may be a bit inaccurate right after a Wine commit.
-# See WineSendLog.pl for more details.
-if ($NewStatus eq 'completed')
-{
- my $LatestDir = "$DataDir/latest";
- my $StepDir = $Step->GetDir();
- foreach my $Mission (@{$TaskMissions->{Missions}})
- {
- my $RptFileName = GetMissionBaseName($Mission) .".report";
- my $RefReport = $Task->GetRefReportName($RptFileName);
- for my $Suffix ("", ".err")
- {
- if (-f "$LatestDir/$RefReport$Suffix")
- {
- unlink "$StepDir/$RefReport$Suffix";
- if (!link "$LatestDir/$RefReport$Suffix", "$StepDir/$RefReport$Suffix")
- {
- Error "Could not link '$RefReport$Suffix': $!\n";
- }
- }
- }
- }
-}
-
-
#
# Wrap up
#
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 4d0d99bfab..5b567bc23b 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -29,7 +29,8 @@ WineTestBot::LogUtils - Provides functions to parse task logs
use Exporter 'import';
our @EXPORT = qw(GetLogFileNames GetLogLabel GetLogErrors TagNewErrors
GetLogLineCategory GetReportLineCategory
- ParseTaskLog ParseWineTestReport);
+ ParseTaskLog ParseWineTestReport
+ SnapshotLatestReport UpdateLatestReport UpdateLatestReports);
use Algorithm::Diff;
use File::Basename;
@@ -873,6 +874,11 @@ sub GetLogErrors($)
return $LogInfo;
}
+
+#
+# New error detection
+#
+
sub _DumpDiff($$)
{
my ($Label, $Diff) = @_;
@@ -1031,4 +1037,100 @@ sub TagNewErrors($$)
}
}
+
+#
+# Reference report management
+#
+
+=pod
+=over 12
+
+=item C<SnapshotLatestReport()>
+
+Takes a snapshot of the reference WineTest results for the specified Task.
+
+The reference report is used to identify new failures, even long after the task has been
+run (and the reference report replaced by a newer version).
+
+Note also that comparing reports in this way may be a bit inaccurate right
+after a Wine commit due to delays in getting new WineTest results, etc.
+See WineSendLog.pl for more details.
+
+=back
+=cut
+
+sub SnapshotLatestReport($$)
+{
+ my ($Task, $ReportName) = @_;
+
+ my @ErrMessages;
+ my $TaskDir = $Task->GetDir();
+ my $RefReportName = $Task->GetRefReportName($ReportName);
+ foreach my $Suffix ("", ".err")
+ {
+ next if (!-f "$DataDir/latest/$RefReportName$Suffix");
+
+ # FIXME: The reference reports are stored at the step level!
+ if (!link("$DataDir/latest/$RefReportName$Suffix",
+ "$TaskDir/../$RefReportName$Suffix"))
+ {
+ push @ErrMessages, "Could not create the '../$RefReportName$Suffix' link: $!";
+ }
+ }
+
+ return \@ErrMessages;
+}
+
+sub UpdateLatestReport($$$)
+{
+ my ($Task, $ReportName, $SrcReportPath) = @_;
+ my @ErrMessages;
+
+ my $RefReportName = $Task->GetRefReportName($ReportName);
+ foreach my $Suffix ("", ".err")
+ {
+ # Add the new reference file even if it is empty.
+ next if (!-f "$SrcReportPath$Suffix");
+
+ unlink "$DataDir/latest/$RefReportName$Suffix";
+ if (!link("$SrcReportPath$Suffix",
+ "$DataDir/latest/$RefReportName$Suffix"))
+ {
+ push @ErrMessages, "Could not create the '$RefReportName$Suffix' link: $!";
+ }
+ }
+
+ return \@ErrMessages;
+}
+
+=pod
+=over 12
+
+=item C<UpdateLatestReports()>
+
+Adds the Task's WineTest results to the set of reference reports.
+
+The reference reports will then be used to detect new failures in the other
+tasks.
+
+This must be called after SnapshotLatestReport() otherwise a WineTest task
+would compare its results to itself.
+
+=back
+=cut
+
+sub UpdateLatestReports($$)
+{
+ my ($Task, $ReportNames) = @_;
+
+ my @ErrMessages;
+ my $TaskDir = $Task->GetDir();
+ foreach my $ReportName (@$ReportNames)
+ {
+ next if (!-f "$TaskDir/$ReportName" or -z _);
+ push @ErrMessages, @{UpdateLatestReport($Task, $ReportName, "$TaskDir/$ReportName")};
+ }
+ return \@ErrMessages;
+}
+
1;
diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm
index 0c26904e15..1a46f0d57c 100644
--- a/testbot/lib/WineTestBot/Tasks.pm
+++ b/testbot/lib/WineTestBot/Tasks.pm
@@ -70,6 +70,7 @@ our @ISA = qw(WineTestBot::WineTestBotItem);
use File::Path;
use ObjectModel::BackEnd;
use WineTestBot::Config;
+use WineTestBot::Missions;
sub InitializeNew($$)
@@ -108,6 +109,35 @@ sub RmTree($)
rmtree($Dir);
}
+sub GetReportNames($)
+{
+ my ($self) = @_;
+
+ my ($ErrMessage, $Missions) = ParseMissionStatement($self->Missions);
+ return ($ErrMessage, undef, undef) if (defined $ErrMessage);
+ if (!@$Missions)
+ {
+ my @TaskKey = $self->GetMasterKey();
+ return ("Task @TaskKey has no mission", undef, undef);
+ }
+ if (@$Missions > 1)
+ {
+ my @TaskKey = $self->GetMasterKey();
+ return ("Task @TaskKey should not have missions for multiple tasks\n", undef);
+ }
+ my $TaskMissions = $Missions->[0];
+
+ my @ReportNames;
+ foreach my $Mission (@{$TaskMissions->{Missions}})
+ {
+ if ($Mission->{test} ne "build")
+ {
+ push @ReportNames, GetMissionBaseName($Mission) .".report";
+ }
+ }
+ return (undef, \@ReportNames, $TaskMissions);
+}
+
sub GetRefReportName($$)
{
my ($self, $ReportName) = @_;
--
2.20.1
1
1
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
include/Makefile.in | 1 +
include/xact3wb.h | 64 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+)
create mode 100644 include/xact3wb.h
diff --git a/include/Makefile.in b/include/Makefile.in
index 8284d6fdf3..b1e7d0084f 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -772,6 +772,7 @@ SOURCES = \
wtypes.idl \
wuapi.idl \
x3daudio.h \
+ xact3wb.h \
xapo.idl \
xapofx.h \
xaudio2.idl \
diff --git a/include/xact3wb.h b/include/xact3wb.h
new file mode 100644
index 0000000000..d283efc112
--- /dev/null
+++ b/include/xact3wb.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2020 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#ifndef __XACT3WB_H__
+#define __XACT3WB_H__
+
+typedef union WAVEBANKMINIWAVEFORMAT
+{
+ struct
+ {
+ DWORD wFormatTag : 2;
+ DWORD nChannels : 3;
+ DWORD nSamplesPerSec : 18;
+ DWORD wBlockAlign : 8;
+ DWORD wBitsPerSample : 1;
+ } DUMMYSTRUCTNAME;
+
+ DWORD dwValue;
+} WAVEBANKMINIWAVEFORMAT;
+
+typedef struct WAVEBANKREGION
+{
+ DWORD dwOffset;
+ DWORD dwLength;
+} WAVEBANKREGION;
+
+typedef struct WAVEBANKSAMPLEREGION
+{
+ DWORD dwStartSample;
+ DWORD dwTotalSamples;
+} WAVEBANKSAMPLEREGION;
+
+typedef struct WAVEBANKENTRY
+{
+ union
+ {
+ struct
+ {
+ DWORD dwFlags : 4;
+ DWORD Duration : 28;
+ } DUMMYSTRUCTNAME;
+ DWORD dwFlagsAndDuration;
+ } DUMMYUNIONNAME;
+
+ WAVEBANKMINIWAVEFORMAT Format;
+ WAVEBANKREGION PlayRegion;
+ WAVEBANKSAMPLEREGION LoopRegion;
+} WAVEBANKENTRY;
+
+#endif /* __XACT3WB_H__ */
--
2.24.1
1
0
28 Jan '20
Allows Wine internal messages with pointer arguments to be sent
asynchronously.
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
dlls/user32/message.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 1336865112..2717d91dbb 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2829,6 +2829,9 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags,
break;
case MSG_NOTIFY:
info.flags = ISMEX_NOTIFY;
+ if (!unpack_message( info.msg.hwnd, info.msg.message, &info.msg.wParam,
+ &info.msg.lParam, &buffer, size ))
+ continue;
break;
case MSG_CALLBACK:
info.flags = ISMEX_CALLBACK;
@@ -3128,7 +3131,7 @@ static BOOL put_message_in_queue( const struct send_message_info *info, size_t *
}
memset( &data, 0, sizeof(data) );
- if (info->type == MSG_OTHER_PROCESS)
+ if (info->type == MSG_OTHER_PROCESS || info->type == MSG_NOTIFY)
{
*reply_size = pack_message( info->hwnd, info->msg, info->wparam, info->lparam, &data );
if (data.count == -1)
--
2.24.1
1
1
28 Jan '20
Visual Studio idl's support functions pointers within struct's.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
tools/widl/parser.y | 5 ++---
tools/widl/typegen.c | 12 ++++++++++++
tools/widl/typegen.h | 1 +
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 5f6eb50878..090fb00339 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -2521,9 +2521,6 @@ static void check_field_common(const type_t *container_type,
case TYPE_VOID:
reason = "cannot derive from void *";
break;
- case TYPE_FUNCTION:
- reason = "cannot be a function pointer";
- break;
case TYPE_BITFIELD:
reason = "cannot be a bit-field";
break;
@@ -2575,6 +2572,7 @@ static void check_field_common(const type_t *container_type,
error_loc_info(&arg->loc_info, "undefined type declaration \"enum %s\"\n", type->name);
}
case TGT_USER_TYPE:
+ case TGT_FUNCTION_POINTER:
case TGT_IFACE_POINTER:
case TGT_BASIC:
case TGT_RANGE:
@@ -2659,6 +2657,7 @@ static void check_remoting_args(const var_t *func)
case TGT_INVALID:
/* already error'd before we get here */
case TGT_CTXT_HANDLE_POINTER:
+ case TGT_FUNCTION_POINTER:
case TGT_POINTER:
case TGT_ARRAY:
/* OK */
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 9b8aa1a322..c2f1ca9359 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -367,6 +367,7 @@ enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *att
case TYPE_ARRAY:
return TGT_ARRAY;
case TYPE_FUNCTION:
+ return TGT_FUNCTION_POINTER;
case TYPE_COCLASS:
case TYPE_INTERFACE:
case TYPE_MODULE:
@@ -598,6 +599,7 @@ unsigned char get_struct_fc(const type_t *type)
case TGT_INVALID:
case TGT_CTXT_HANDLE:
case TGT_CTXT_HANDLE_POINTER:
+ case TGT_FUNCTION_POINTER:
/* checking after parsing should mean that we don't get here. if we do,
* it's a checker bug */
assert(0);
@@ -690,6 +692,7 @@ static unsigned char get_array_fc(const type_t *type)
break;
case TGT_CTXT_HANDLE:
case TGT_CTXT_HANDLE_POINTER:
+ case TGT_FUNCTION_POINTER:
case TGT_STRING:
case TGT_INVALID:
case TGT_ARRAY:
@@ -743,6 +746,7 @@ static int type_has_pointers(const type_t *type)
case TGT_CTXT_HANDLE_POINTER:
case TGT_STRING:
case TGT_IFACE_POINTER:
+ case TGT_FUNCTION_POINTER:
case TGT_BASIC:
case TGT_ENUM:
case TGT_RANGE:
@@ -795,6 +799,7 @@ static int type_has_full_pointer(const type_t *type, const attr_list_t *attrs,
}
case TGT_CTXT_HANDLE:
case TGT_CTXT_HANDLE_POINTER:
+ case TGT_FUNCTION_POINTER:
case TGT_STRING:
case TGT_IFACE_POINTER:
case TGT_BASIC:
@@ -1037,6 +1042,7 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned
case TGT_CTXT_HANDLE:
buffer_size = 20;
break;
+ case TGT_FUNCTION_POINTER:
case TGT_POINTER:
if (get_pointer_fc( var->declspec.type, var->attrs, !is_return ) == FC_RP)
{
@@ -1083,6 +1089,7 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned
case TGT_POINTER:
case TGT_CTXT_HANDLE:
case TGT_CTXT_HANDLE_POINTER:
+ case TGT_FUNCTION_POINTER:
*flags |= MustFree;
server_size = pointer_size;
break;
@@ -3635,6 +3642,7 @@ static unsigned int write_type_tfs(FILE *file, const attr_list_t *attrs,
return write_union_tfs(file, attrs, type, typeformat_offset);
case TGT_ENUM:
case TGT_BASIC:
+ case TGT_FUNCTION_POINTER:
/* nothing to do */
return 0;
case TGT_RANGE:
@@ -4176,6 +4184,7 @@ void write_parameter_conf_or_var_exprs(FILE *file, int indent, const char *local
case TGT_USER_TYPE:
case TGT_CTXT_HANDLE:
case TGT_CTXT_HANDLE_POINTER:
+ case TGT_FUNCTION_POINTER:
case TGT_STRING:
case TGT_BASIC:
case TGT_ENUM:
@@ -4435,6 +4444,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
phase, var, start_offset);
break;
}
+ case TGT_FUNCTION_POINTER:
case TGT_POINTER:
{
const type_t *ref = type_pointer_get_ref_type(type);
@@ -4526,6 +4536,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
case TGT_IFACE_POINTER:
case TGT_CTXT_HANDLE:
case TGT_CTXT_HANDLE_POINTER:
+ case TGT_FUNCTION_POINTER:
print_phase_function(file, indent, "Pointer", local_var_prefix, phase, var, start_offset);
break;
case TGT_INVALID:
@@ -4762,6 +4773,7 @@ void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char
break;
case TGT_CTXT_HANDLE:
case TGT_CTXT_HANDLE_POINTER:
+ case TGT_FUNCTION_POINTER:
case TGT_INVALID:
case TGT_STRING:
/* not initialised */
diff --git a/tools/widl/typegen.h b/tools/widl/typegen.h
index 95ad601768..c388e62434 100644
--- a/tools/widl/typegen.h
+++ b/tools/widl/typegen.h
@@ -58,6 +58,7 @@ enum typegen_type
TGT_STRUCT,
TGT_UNION,
TGT_RANGE,
+ TGT_FUNCTION_POINTER,
};
typedef int (*type_pred_t)(const type_t *);
--
2.17.1
2
1
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
---
v2: Add missing todo_wine
---
programs/find/tests/find.c | 120 ++++++++++++++++++++++++++++++++++---
1 file changed, 111 insertions(+), 9 deletions(-)
diff --git a/programs/find/tests/find.c b/programs/find/tests/find.c
index 147b59c8ce..b8345034b5 100644
--- a/programs/find/tests/find.c
+++ b/programs/find/tests/find.c
@@ -180,10 +180,44 @@ static void run_find_stdin_(const WCHAR *commandline, const BYTE *input, int inp
heap_free(child_output);
}
+static void run_find_file_(const WCHAR *commandline, const BYTE *input, int input_len, const BYTE *out_expected, int out_expected_len, int exitcode_expected, const char *file, int line)
+{
+ char path_temp_file[MAX_PATH];
+ char path_temp_dir[MAX_PATH];
+ HANDLE handle_file;
+ WCHAR commandline_new[MAX_PATH];
+ BYTE *out_expected_new;
+ char header[MAX_PATH];
+ int header_len;
+
+ GetTempPathA(ARRAY_SIZE(path_temp_dir), path_temp_dir);
+ GetTempFileNameA(path_temp_dir, "", 0, path_temp_file);
+ handle_file = CreateFileA(path_temp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
+ write_to_handle(handle_file, input, input_len);
+ CloseHandle(handle_file);
+
+ wsprintfW(commandline_new, L"%s %hs", commandline, path_temp_file);
+
+ CharUpperA(path_temp_file);
+ wsprintfA(header, "\r\n---------- %s\r\n", path_temp_file);
+ header_len = lstrlenA(header);
+ out_expected_new = heap_alloc(header_len + out_expected_len);
+ memcpy(out_expected_new, header, header_len);
+ memcpy(out_expected_new + header_len, out_expected, out_expected_len);
+
+ run_find_stdin_(commandline_new, (BYTE*)"", 0, out_expected_new, header_len + out_expected_len, exitcode_expected, file, line);
+ heap_free(out_expected_new);
+
+ DeleteFileA(path_temp_file);
+}
+
#define run_find_stdin_str(commandline, input, out_expected, exitcode_expected) \
- run_find_stdin_str_(commandline, input, out_expected, exitcode_expected, __FILE__, __LINE__)
+ run_find_str_(commandline, input, out_expected, exitcode_expected, 0, __FILE__, __LINE__)
-static void run_find_stdin_str_(const char *commandline, const char *input, const char *out_expected, int exitcode_expected, const char *file, int line)
+#define run_find_file_str(commandline, input, out_expected, exitcode_expected) \
+ run_find_str_(commandline, input, out_expected, exitcode_expected, 1, __FILE__, __LINE__)
+
+static void run_find_str_(const char *commandline, const char *input, const char *out_expected, int exitcode_expected, BOOL is_file, const char *file, int line)
{
WCHAR *commandlineW;
int len_commandlineW;
@@ -193,15 +227,20 @@ static void run_find_stdin_str_(const char *commandline, const char *input, cons
commandlineW = heap_alloc(len_commandlineW * sizeof(WCHAR));
MultiByteToWideChar(CP_UTF8, 0, commandline, -1, commandlineW, len_commandlineW);
- run_find_stdin_(commandlineW, (BYTE *)input, lstrlenA(input), (BYTE *)out_expected, lstrlenA(out_expected), exitcode_expected, file, line);
-
+ if (is_file)
+ run_find_file_(commandlineW, (BYTE *)input, lstrlenA(input), (BYTE *)out_expected, lstrlenA(out_expected), exitcode_expected, file, line);
+ else
+ run_find_stdin_(commandlineW, (BYTE *)input, lstrlenA(input), (BYTE *)out_expected, lstrlenA(out_expected), exitcode_expected, file, line);
heap_free(commandlineW);
}
#define run_find_stdin_unicode(input, out_expected, exitcode_expected) \
- run_find_stdin_unicode_(input, sizeof(input), out_expected, sizeof(out_expected), exitcode_expected, __FILE__, __LINE__)
+ run_find_unicode_(input, sizeof(input), out_expected, sizeof(out_expected), exitcode_expected, 0, __FILE__, __LINE__)
-static void run_find_stdin_unicode_(const BYTE *input, int input_len, const BYTE *out_expected, int out_expected_len, int exitcode_expected, const char *file, int line)
+#define run_find_file_unicode(input, out_expected, exitcode_expected) \
+ run_find_unicode_(input, sizeof(input), out_expected, sizeof(out_expected), exitcode_expected, 1, __FILE__, __LINE__)
+
+static void run_find_unicode_(const BYTE *input, int input_len, const BYTE *out_expected, int out_expected_len, int exitcode_expected, BOOL is_file, const char *file, int line)
{
/* Need "test" as char and quoted wchar */
static const WCHAR wstr_quoted_test[] = { '"','t', 'e', 's', 't','"',0 };
@@ -219,7 +258,10 @@ static void run_find_stdin_unicode_(const BYTE *input, int input_len, const BYTE
exitcode_expected = 1;
}
- run_find_stdin_(wstr_quoted_test, input, input_len, out_expected_mangled, out_expected_mangled_len, exitcode_expected, file, line);
+ if (is_file)
+ run_find_file_(wstr_quoted_test, input, input_len, out_expected_mangled, out_expected_mangled_len, exitcode_expected, file, line);
+ else
+ run_find_stdin_(wstr_quoted_test, input, input_len, out_expected_mangled, out_expected_mangled_len, exitcode_expected, file, line);
}
static void test_errors(void)
@@ -230,6 +272,8 @@ static void test_errors(void)
todo_wine /* Quotes are not properly passed into wine yet */
run_find_stdin_str("\"test", "", "FIND: Parameter format not correct\r\n", 2);
run_find_stdin_str("\"test\" /XYZ", "", "FIND: Invalid switch\r\n", 2);
+ todo_wine
+ run_find_stdin_str("\"test\" C:\\doesnotexist.dat", "", "File not found - C:\\DOESNOTEXIST.DAT\r\n", 1);
}
static void test_singleline_without_switches(void)
@@ -272,7 +316,7 @@ static const BYTE str_rus_utf8_nobom[] = { 0xD0,0xBF,0xD1,0x
static const BYTE str_en_utf8_bom[] = { 0xEF,0xBB,0xBF,'e','n','t','e','s','t','\r','\n' };
static const BYTE str_en_utf8_nobom[] = { 'e','n','t','e','s','t','\r','\n' };
-static void test_unicode_support(void)
+static void test_unicode_support_stdin(void)
{
/* Test unicode support on STDIN
* Those depend on the active codepage - e.g. 932 (japanese) behaves different from 1252 (latin)
@@ -302,6 +346,62 @@ static void test_unicode_support(void)
run_find_stdin_unicode(str_jap_utf16le_bom, str_jap_utf16le_bom, 0);
}
+static void test_file_search(void)
+{
+ todo_wine
+ run_find_file_str("\"\"", "test", "", 1);
+ todo_wine
+ run_find_file_str("\"test\"", "", "", 1);
+ todo_wine
+ run_find_file_str("\"test\"", "test", "test\r\n", 0);
+ todo_wine
+ run_find_file_str("\"test\"", "test2", "test2\r\n", 0);
+ todo_wine
+ run_find_file_str("\"test\"", "test\r2", "test\r2\r\n", 0);
+ todo_wine
+ run_find_file_str("\"test2\"", "test", "", 1);
+ todo_wine
+ run_find_file_str("\"test\"", "test\nother\ntest2\ntest3", "test\r\ntest2\r\ntest3\r\n", 0);
+}
+
+static void test_unicode_support_file(void)
+{
+ /* Test unicode support on files */
+
+ /* Test UTF-8 BOM */
+ todo_wine
+ run_find_file_unicode(str_en_utf8_nobom, str_en_utf8_nobom, 0);
+ todo_wine
+ run_find_file_unicode(str_en_utf8_bom, str_en_utf8_bom, 0);
+
+ /* Test russian characters */
+ todo_wine
+ run_find_file_unicode(str_rus_utf8_bom, str_rus_utf8_bom, 0);
+ todo_wine
+ run_find_file_unicode(str_rus_utf8_nobom, str_rus_utf8_nobom, 0);
+
+ /* Test japanese characters */
+ todo_wine
+ run_find_file_unicode(str_jap_utf8_nobom, str_jap_utf8_nobom, 0);
+ todo_wine
+ run_find_file_unicode(str_jap_utf8_bom, str_jap_utf8_bom, 0);
+ todo_wine
+ run_find_file_unicode(str_jap_shiftjis, str_jap_shiftjis, 0);
+
+ /* Test unsupported encodings */
+ todo_wine
+ run_find_file_unicode(str_jap_utf16le_nobom, str_empty, 1);
+ todo_wine
+ run_find_file_unicode(str_jap_utf16be_bom, str_empty, 1);
+ todo_wine
+ run_find_file_unicode(str_jap_utf16be_nobom, str_empty, 1);
+
+ /* Test utf16le */
+ todo_wine
+ run_find_file_unicode(str_jap_utf16le_bom, str_jap_utf16le_bom, 0);
+}
+
+
START_TEST(find)
{
if (PRIMARYLANGID(GetUserDefaultUILanguage()) != LANG_ENGLISH)
@@ -314,5 +414,7 @@ START_TEST(find)
}
test_singleline_without_switches();
test_multiline();
- test_unicode_support();
+ test_unicode_support_stdin();
+ test_file_search();
+ test_unicode_support_file();
}
--
2.25.0
1
0
28 Jan '20
Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
---
dlls/bcrypt/tests/bcrypt.c | 75 ++++++++++++++++++++++++++++++++++----
include/bcrypt.h | 12 ++++++
2 files changed, 80 insertions(+), 7 deletions(-)
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 198acbf721..47bb58d3d1 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -62,6 +62,9 @@ static NTSTATUS (WINAPI *pBCryptOpenAlgorithmProvider)(BCRYPT_ALG_HANDLE *, LPCW
static NTSTATUS (WINAPI *pBCryptSetProperty)(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG);
static NTSTATUS (WINAPI *pBCryptSignHash)(BCRYPT_KEY_HANDLE, void *, UCHAR *, ULONG, UCHAR *, ULONG, ULONG *, ULONG);
static NTSTATUS (WINAPI *pBCryptVerifySignature)(BCRYPT_KEY_HANDLE, VOID *, UCHAR *, ULONG, UCHAR *, ULONG, ULONG);
+static NTSTATUS (WINAPI *pBCryptSecretAgreement)(BCRYPT_KEY_HANDLE, BCRYPT_KEY_HANDLE, BCRYPT_SECRET_HANDLE *, ULONG);
+static NTSTATUS (WINAPI *pBCryptDestroySecret)(BCRYPT_SECRET_HANDLE);
+static NTSTATUS (WINAPI *pBCryptDeriveKey)(BCRYPT_SECRET_HANDLE, LPCWSTR, BCryptBufferDesc *, PUCHAR, ULONG, ULONG *, ULONG);
static void test_BCryptGenRandom(void)
{
@@ -1923,13 +1926,29 @@ static void test_RSA_SIGN(void)
static BYTE eccprivkey[] =
{
- 0x45, 0x43, 0x4b, 0x32, 0x20, 0x00, 0x00, 0x00, 0xfb, 0xbd, 0x3d, 0x20, 0x1b, 0x6d, 0x66, 0xb3,
- 0x7c, 0x9f, 0x89, 0xf3, 0xe4, 0x41, 0x16, 0xa5, 0x68, 0x52, 0x77, 0xac, 0xab, 0x55, 0xb2, 0x6c,
- 0xb0, 0x23, 0x55, 0xcb, 0x96, 0x14, 0xfd, 0x0b, 0x1c, 0xef, 0xdf, 0x07, 0x6d, 0x31, 0xaf, 0x39,
- 0xce, 0x8c, 0x8f, 0x9d, 0x75, 0xd0, 0x7b, 0xea, 0x81, 0xdc, 0x40, 0x21, 0x1f, 0x58, 0x22, 0x5f,
- 0x72, 0x55, 0xfc, 0x58, 0x8a, 0xeb, 0x88, 0x5d, 0x02, 0x09, 0x90, 0xd2, 0xe3, 0x36, 0xac, 0xfe,
- 0x83, 0x13, 0x6c, 0x88, 0x1a, 0xab, 0x9b, 0xdd, 0xaa, 0x8a, 0xee, 0x69, 0x9a, 0x6a, 0x62, 0x86,
- 0x6a, 0x13, 0x69, 0x88, 0xb7, 0xd5, 0xa3, 0xcd
+ 0x45, 0x43, 0x4b, 0x32, 0x20, 0x00, 0x00, 0x00,
+ 0xfb, 0xbd, 0x3d, 0x20, 0x1b, 0x6d, 0x66, 0xb3, 0x7c, 0x9f, 0x89, 0xf3, 0xe4, 0x41, 0x16, 0xa5,
+ 0x68, 0x52, 0x77, 0xac, 0xab, 0x55, 0xb2, 0x6c, 0xb0, 0x23, 0x55, 0xcb, 0x96, 0x14, 0xfd, 0x0b,
+ 0x1c, 0xef, 0xdf, 0x07, 0x6d, 0x31, 0xaf, 0x39, 0xce, 0x8c, 0x8f, 0x9d, 0x75, 0xd0, 0x7b, 0xea,
+ 0x81, 0xdc, 0x40, 0x21, 0x1f, 0x58, 0x22, 0x5f, 0x72, 0x55, 0xfc, 0x58, 0x8a, 0xeb, 0x88, 0x5d,
+ 0x02, 0x09, 0x90, 0xd2, 0xe3, 0x36, 0xac, 0xfe, 0x83, 0x13, 0x6c, 0x88, 0x1a, 0xab, 0x9b, 0xdd,
+ 0xaa, 0x8a, 0xee, 0x69, 0x9a, 0x6a, 0x62, 0x86, 0x6a, 0x13, 0x69, 0x88, 0xb7, 0xd5, 0xa3, 0xcd
+};
+
+static BYTE ecdh_pubkey[] =
+{
+ 0x45, 0x43, 0x4b, 0x31, 0x20, 0x00, 0x00, 0x00,
+ 0x07, 0x61, 0x9d, 0x49, 0x63, 0x6b, 0x96, 0x94, 0xd1, 0x8f, 0xd1, 0x48, 0xcc, 0xcf, 0x72, 0x4d,
+ 0xff, 0x43, 0xf4, 0x97, 0x0f, 0xa3, 0x8a, 0x72, 0xe9, 0xe0, 0xba, 0x87, 0x6d, 0xc3, 0x62, 0x15,
+ 0xae, 0x65, 0xdd, 0x31, 0x51, 0xfc, 0x3b, 0xc9, 0x59, 0xa1, 0x0a, 0x92, 0x17, 0x2b, 0x64, 0x55,
+ 0x03, 0x3e, 0x62, 0x1d, 0xac, 0x3e, 0x37, 0x40, 0x6a, 0x4c, 0xb6, 0x21, 0x3f, 0x73, 0x5c, 0xf5
+};
+
+/* little endian */
+static BYTE ecdh_secret[] =
+{
+ 0x48, 0xb0, 0x11, 0xdb, 0x69, 0x4e, 0xb4, 0xf4, 0xf5, 0x3e, 0xe1, 0x9b, 0xca, 0x00, 0x04, 0xc8,
+ 0x9b, 0x69, 0xaf, 0xd1, 0xaf, 0x1f, 0xc2, 0xd7, 0x83, 0x0a, 0xb7, 0xf8, 0x4f, 0x24, 0x32, 0x8e,
};
static void test_ECDH(void)
@@ -1938,6 +1957,7 @@ static void test_ECDH(void)
BCRYPT_ECCKEY_BLOB *ecckey;
BCRYPT_ALG_HANDLE alg;
BCRYPT_KEY_HANDLE key, privkey, pubkey;
+ BCRYPT_SECRET_HANDLE secret;
NTSTATUS status;
ULONG size;
@@ -2008,6 +2028,44 @@ static void test_ECDH(void)
ok(!memcmp(buf, eccprivkey, size), "wrong data\n");
HeapFree(GetProcessHeap(), 0, buf);
+ status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &pubkey, ecdh_pubkey, sizeof(ecdh_pubkey), 0);
+ ok(status == STATUS_SUCCESS, "got %08x\n", status);
+
+ status = pBCryptSecretAgreement(privkey, pubkey, &secret, 0);
+ ok(status == STATUS_SUCCESS, "got %08x\n", status);
+
+ if (status != STATUS_SUCCESS)
+ {
+ goto derive_end;
+ }
+
+ /* verify result on windows 10 */
+ status = pBCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, NULL, 0, &size, 0);
+
+ if (status == STATUS_NOT_SUPPORTED)
+ {
+ win_skip("BCRYPT_KDF_RAW_SECRET not supported\n");
+ goto derive_end;
+ }
+
+ todo_wine ok(status == STATUS_SUCCESS, "got %08x\n", status);
+
+ if (status != STATUS_SUCCESS)
+ {
+ goto derive_end;
+ }
+
+ ok(size == 32, "size of secret key incorrect, got %u, expected 32\n", size);
+ buf = HeapAlloc(GetProcessHeap(), 0, size);
+ status = pBCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buf, size, &size, 0);
+ ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(!(memcmp(ecdh_secret, buf, size)), "wrong data\n");
+ HeapFree(GetProcessHeap(), 0, buf);
+
+ derive_end:
+
+ pBCryptDestroySecret(secret);
+ pBCryptDestroyKey(pubkey);
pBCryptDestroyKey(privkey);
pBCryptCloseAlgorithmProvider(alg, 0);
}
@@ -2284,6 +2342,9 @@ START_TEST(bcrypt)
pBCryptSetProperty = (void *)GetProcAddress(module, "BCryptSetProperty");
pBCryptSignHash = (void *)GetProcAddress(module, "BCryptSignHash");
pBCryptVerifySignature = (void *)GetProcAddress(module, "BCryptVerifySignature");
+ pBCryptSecretAgreement = (void *)GetProcAddress(module, "BCryptSecretAgreement");
+ pBCryptDestroySecret = (void *)GetProcAddress(module, "BCryptDestroySecret");
+ pBCryptDeriveKey = (void *)GetProcAddress(module, "BCryptDeriveKey");
test_BCryptGenRandom();
test_BCryptGetFipsAlgorithmMode();
diff --git a/include/bcrypt.h b/include/bcrypt.h
index 4546aea394..f393dc6e5c 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -92,6 +92,12 @@ typedef LONG NTSTATUS;
#define BCRYPT_CHAIN_MODE_CFB L"ChainingModeCFB"
#define BCRYPT_CHAIN_MODE_CCM L"ChainingModeCCM"
#define BCRYPT_CHAIN_MODE_GCM L"ChainingModeGCM"
+
+#define BCRYPT_KDF_HASH L"HASH"
+#define BCRYPT_KDF_HMAC L"HMAC"
+#define BCRYPT_KDF_TLS_PRF L"TLS_PRF"
+#define BCRYPT_KDF_SP80056A_CONCAT L"SP800_56A_CONCAT"
+#define BCRYPT_KDF_RAW_SECRET L"TRUNCATE"
#else
static const WCHAR BCRYPT_ALGORITHM_NAME[] = {'A','l','g','o','r','i','t','h','m','N','a','m','e',0};
static const WCHAR BCRYPT_AUTH_TAG_LENGTH[] = {'A','u','t','h','T','a','g','L','e','n','g','t','h',0};
@@ -146,6 +152,12 @@ static const WCHAR BCRYPT_CHAIN_MODE_ECB[] = {'C','h','a','i','n','i','n','g','M
static const WCHAR BCRYPT_CHAIN_MODE_CFB[] = {'C','h','a','i','n','i','n','g','M','o','d','e','C','F','B',0};
static const WCHAR BCRYPT_CHAIN_MODE_CCM[] = {'C','h','a','i','n','i','n','g','M','o','d','e','C','C','M',0};
static const WCHAR BCRYPT_CHAIN_MODE_GCM[] = {'C','h','a','i','n','i','n','g','M','o','d','e','G','C','M',0};
+
+static const WCHAR BCRYPT_KDF_HASH[] = {'H','A','S','H',0};
+static const WCHAR BCRYPT_KDF_HMAC[] = {'H','M','A','C',0};
+static const WCHAR BCRYPT_KDF_TLS_PRF[] = {'T','L','S','_','P','R','F',0};
+static const WCHAR BCRYPT_KDF_SP80056A_CONCAT[] = {'S','P','8','0','0','_','5','6','A','_','C','O','N','C','A','T',0};
+static const WCHAR BCRYPT_KDF_RAW_SECRET[] = {'T','R','U','N','C','A','T','E',0};
#endif
#define BCRYPT_ECDSA_PUBLIC_P256_MAGIC 0x31534345
--
2.24.1
4
15
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
---
programs/find/tests/find.c | 119 ++++++++++++++++++++++++++++++++++---
1 file changed, 110 insertions(+), 9 deletions(-)
diff --git a/programs/find/tests/find.c b/programs/find/tests/find.c
index 147b59c8ce..b9a8a12375 100644
--- a/programs/find/tests/find.c
+++ b/programs/find/tests/find.c
@@ -180,10 +180,44 @@ static void run_find_stdin_(const WCHAR *commandline, const BYTE *input, int inp
heap_free(child_output);
}
+static void run_find_file_(const WCHAR *commandline, const BYTE *input, int input_len, const BYTE *out_expected, int out_expected_len, int exitcode_expected, const char *file, int line)
+{
+ char path_temp_file[MAX_PATH];
+ char path_temp_dir[MAX_PATH];
+ HANDLE handle_file;
+ WCHAR commandline_new[MAX_PATH];
+ BYTE *out_expected_new;
+ char header[MAX_PATH];
+ int header_len;
+
+ GetTempPathA(ARRAY_SIZE(path_temp_dir), path_temp_dir);
+ GetTempFileNameA(path_temp_dir, "", 0, path_temp_file);
+ handle_file = CreateFileA(path_temp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
+ write_to_handle(handle_file, input, input_len);
+ CloseHandle(handle_file);
+
+ wsprintfW(commandline_new, L"%s %hs", commandline, path_temp_file);
+
+ CharUpperA(path_temp_file);
+ wsprintfA(header, "\r\n---------- %s\r\n", path_temp_file);
+ header_len = lstrlenA(header);
+ out_expected_new = heap_alloc(header_len + out_expected_len);
+ memcpy(out_expected_new, header, header_len);
+ memcpy(out_expected_new + header_len, out_expected, out_expected_len);
+
+ run_find_stdin_(commandline_new, (BYTE*)"", 0, out_expected_new, header_len + out_expected_len, exitcode_expected, file, line);
+ heap_free(out_expected_new);
+
+ DeleteFileA(path_temp_file);
+}
+
#define run_find_stdin_str(commandline, input, out_expected, exitcode_expected) \
- run_find_stdin_str_(commandline, input, out_expected, exitcode_expected, __FILE__, __LINE__)
+ run_find_str_(commandline, input, out_expected, exitcode_expected, 0, __FILE__, __LINE__)
-static void run_find_stdin_str_(const char *commandline, const char *input, const char *out_expected, int exitcode_expected, const char *file, int line)
+#define run_find_file_str(commandline, input, out_expected, exitcode_expected) \
+ run_find_str_(commandline, input, out_expected, exitcode_expected, 1, __FILE__, __LINE__)
+
+static void run_find_str_(const char *commandline, const char *input, const char *out_expected, int exitcode_expected, BOOL is_file, const char *file, int line)
{
WCHAR *commandlineW;
int len_commandlineW;
@@ -193,15 +227,20 @@ static void run_find_stdin_str_(const char *commandline, const char *input, cons
commandlineW = heap_alloc(len_commandlineW * sizeof(WCHAR));
MultiByteToWideChar(CP_UTF8, 0, commandline, -1, commandlineW, len_commandlineW);
- run_find_stdin_(commandlineW, (BYTE *)input, lstrlenA(input), (BYTE *)out_expected, lstrlenA(out_expected), exitcode_expected, file, line);
-
+ if (is_file)
+ run_find_file_(commandlineW, (BYTE *)input, lstrlenA(input), (BYTE *)out_expected, lstrlenA(out_expected), exitcode_expected, file, line);
+ else
+ run_find_stdin_(commandlineW, (BYTE *)input, lstrlenA(input), (BYTE *)out_expected, lstrlenA(out_expected), exitcode_expected, file, line);
heap_free(commandlineW);
}
#define run_find_stdin_unicode(input, out_expected, exitcode_expected) \
- run_find_stdin_unicode_(input, sizeof(input), out_expected, sizeof(out_expected), exitcode_expected, __FILE__, __LINE__)
+ run_find_unicode_(input, sizeof(input), out_expected, sizeof(out_expected), exitcode_expected, 0, __FILE__, __LINE__)
-static void run_find_stdin_unicode_(const BYTE *input, int input_len, const BYTE *out_expected, int out_expected_len, int exitcode_expected, const char *file, int line)
+#define run_find_file_unicode(input, out_expected, exitcode_expected) \
+ run_find_unicode_(input, sizeof(input), out_expected, sizeof(out_expected), exitcode_expected, 1, __FILE__, __LINE__)
+
+static void run_find_unicode_(const BYTE *input, int input_len, const BYTE *out_expected, int out_expected_len, int exitcode_expected, BOOL is_file, const char *file, int line)
{
/* Need "test" as char and quoted wchar */
static const WCHAR wstr_quoted_test[] = { '"','t', 'e', 's', 't','"',0 };
@@ -219,7 +258,10 @@ static void run_find_stdin_unicode_(const BYTE *input, int input_len, const BYTE
exitcode_expected = 1;
}
- run_find_stdin_(wstr_quoted_test, input, input_len, out_expected_mangled, out_expected_mangled_len, exitcode_expected, file, line);
+ if (is_file)
+ run_find_file_(wstr_quoted_test, input, input_len, out_expected_mangled, out_expected_mangled_len, exitcode_expected, file, line);
+ else
+ run_find_stdin_(wstr_quoted_test, input, input_len, out_expected_mangled, out_expected_mangled_len, exitcode_expected, file, line);
}
static void test_errors(void)
@@ -230,6 +272,7 @@ static void test_errors(void)
todo_wine /* Quotes are not properly passed into wine yet */
run_find_stdin_str("\"test", "", "FIND: Parameter format not correct\r\n", 2);
run_find_stdin_str("\"test\" /XYZ", "", "FIND: Invalid switch\r\n", 2);
+ run_find_stdin_str("\"test\" C:\\doesnotexist.dat", "", "File not found - C:\\DOESNOTEXIST.DAT\r\n", 1);
}
static void test_singleline_without_switches(void)
@@ -272,7 +315,7 @@ static const BYTE str_rus_utf8_nobom[] = { 0xD0,0xBF,0xD1,0x
static const BYTE str_en_utf8_bom[] = { 0xEF,0xBB,0xBF,'e','n','t','e','s','t','\r','\n' };
static const BYTE str_en_utf8_nobom[] = { 'e','n','t','e','s','t','\r','\n' };
-static void test_unicode_support(void)
+static void test_unicode_support_stdin(void)
{
/* Test unicode support on STDIN
* Those depend on the active codepage - e.g. 932 (japanese) behaves different from 1252 (latin)
@@ -302,6 +345,62 @@ static void test_unicode_support(void)
run_find_stdin_unicode(str_jap_utf16le_bom, str_jap_utf16le_bom, 0);
}
+static void test_file_search(void)
+{
+ todo_wine
+ run_find_file_str("\"\"", "test", "", 1);
+ todo_wine
+ run_find_file_str("\"test\"", "", "", 1);
+ todo_wine
+ run_find_file_str("\"test\"", "test", "test\r\n", 0);
+ todo_wine
+ run_find_file_str("\"test\"", "test2", "test2\r\n", 0);
+ todo_wine
+ run_find_file_str("\"test\"", "test\r2", "test\r2\r\n", 0);
+ todo_wine
+ run_find_file_str("\"test2\"", "test", "", 1);
+ todo_wine
+ run_find_file_str("\"test\"", "test\nother\ntest2\ntest3", "test\r\ntest2\r\ntest3\r\n", 0);
+}
+
+static void test_unicode_support_file(void)
+{
+ /* Test unicode support on files */
+
+ /* Test UTF-8 BOM */
+ todo_wine
+ run_find_file_unicode(str_en_utf8_nobom, str_en_utf8_nobom, 0);
+ todo_wine
+ run_find_file_unicode(str_en_utf8_bom, str_en_utf8_bom, 0);
+
+ /* Test russian characters */
+ todo_wine
+ run_find_file_unicode(str_rus_utf8_bom, str_rus_utf8_bom, 0);
+ todo_wine
+ run_find_file_unicode(str_rus_utf8_nobom, str_rus_utf8_nobom, 0);
+
+ /* Test japanese characters */
+ todo_wine
+ run_find_file_unicode(str_jap_utf8_nobom, str_jap_utf8_nobom, 0);
+ todo_wine
+ run_find_file_unicode(str_jap_utf8_bom, str_jap_utf8_bom, 0);
+ todo_wine
+ run_find_file_unicode(str_jap_shiftjis, str_jap_shiftjis, 0);
+
+ /* Test unsupported encodings */
+ todo_wine
+ run_find_file_unicode(str_jap_utf16le_nobom, str_empty, 1);
+ todo_wine
+ run_find_file_unicode(str_jap_utf16be_bom, str_empty, 1);
+ todo_wine
+ run_find_file_unicode(str_jap_utf16be_nobom, str_empty, 1);
+
+ /* Test utf16le */
+ todo_wine
+ run_find_file_unicode(str_jap_utf16le_bom, str_jap_utf16le_bom, 0);
+}
+
+
START_TEST(find)
{
if (PRIMARYLANGID(GetUserDefaultUILanguage()) != LANG_ENGLISH)
@@ -314,5 +413,7 @@ START_TEST(find)
}
test_singleline_without_switches();
test_multiline();
- test_unicode_support();
+ test_unicode_support_stdin();
+ test_file_search();
+ test_unicode_support_file();
}
--
2.25.0
2
1