Wine-Devel
Threads by month
- ----- 2026 -----
- 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
- 10 participants
- 84519 discussions
[PATCH 1/6] winegstreamer: Stub implement WMA decoder DMO / MF transform.
by Rémi Bernon Feb. 2, 2022
by Rémi Bernon Feb. 2, 2022
Feb. 2, 2022
Final Fantasy XIV intro videos require media_object_GetStreamCount and
property_bag_Write to return S_OK in order to not get stuck. This could
be done in a separate commit but would cause a temporary regression.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/mf/tests/mf.c | 1 -
dlls/winegstreamer/Makefile.in | 5 +-
dlls/winegstreamer/gst_private.h | 1 +
dlls/winegstreamer/main.c | 26 +
dlls/winegstreamer/mfplat.c | 28 +-
dlls/winegstreamer/quartz_parser.c | 2 +-
dlls/winegstreamer/winegstreamer_classes.idl | 6 +
dlls/winegstreamer/wma_decoder.c | 553 +++++++++++++++++++
dlls/wmadmod/tests/wmadmod.c | 5 -
9 files changed, 617 insertions(+), 10 deletions(-)
create mode 100644 dlls/winegstreamer/wma_decoder.c
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 8ba93656a7d..0bf81e0c878 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -5743,7 +5743,6 @@ static void test_wma_decoder(void)
&transform, &class_id))
goto failed;
- todo_wine
check_interface(transform, &IID_IMediaObject, TRUE);
/* check default media types */
diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in
index 062fe57bdbb..1706effbd20 100644
--- a/dlls/winegstreamer/Makefile.in
+++ b/dlls/winegstreamer/Makefile.in
@@ -2,7 +2,7 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = winegstreamer.dll
UNIXLIB = winegstreamer.so
IMPORTLIB = winegstreamer
-IMPORTS = strmbase ole32
+IMPORTS = strmbase ole32 msdmo
DELAYIMPORTS = mfplat
EXTRAINCL = $(GSTREAMER_CFLAGS)
EXTRALIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS)
@@ -16,7 +16,8 @@ C_SRCS = \
wg_parser.c \
wm_asyncreader.c \
wm_reader.c \
- wm_syncreader.c
+ wm_syncreader.c \
+ wma_decoder.c
IDL_SRCS = \
winegstreamer_classes.idl
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 9e1d67417d4..222bce3b2c7 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -102,6 +102,7 @@ HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
+HRESULT wma_decoder_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format, bool wm);
bool amt_to_wg_format(const AM_MEDIA_TYPE *mt, struct wg_format *format);
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index ac9a3201792..260dd208e2f 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -25,7 +25,9 @@
#include "gst_private.h"
#include "winternl.h"
#include "rpcproxy.h"
+#include "dmoreg.h"
#include "gst_guids.h"
+#include "wmcodecdsp.h"
static unixlib_handle_t unix_handle;
@@ -339,6 +341,7 @@ static struct class_factory avi_splitter_cf = {{&class_factory_vtbl}, avi_splitt
static struct class_factory decodebin_parser_cf = {{&class_factory_vtbl}, decodebin_parser_create};
static struct class_factory mpeg_splitter_cf = {{&class_factory_vtbl}, mpeg_splitter_create};
static struct class_factory wave_parser_cf = {{&class_factory_vtbl}, wave_parser_create};
+static struct class_factory wma_decoder_cf = {{&class_factory_vtbl}, wma_decoder_create};
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
{
@@ -361,6 +364,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
factory = &mpeg_splitter_cf;
else if (IsEqualGUID(clsid, &CLSID_WAVEParser))
factory = &wave_parser_cf;
+ else if (IsEqualGUID(clsid, &CLSID_WMADecMediaObject))
+ factory = &wma_decoder_cf;
else
{
FIXME("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(clsid));
@@ -522,6 +527,19 @@ static const REGFILTER2 reg_decodebin_parser =
HRESULT WINAPI DllRegisterServer(void)
{
+ DMO_PARTIAL_MEDIATYPE wma_decoder_output[2] =
+ {
+ {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_PCM},
+ {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_IEEE_FLOAT},
+ };
+ DMO_PARTIAL_MEDIATYPE wma_decoder_input[4] =
+ {
+ {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_MSAUDIO1},
+ {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO2},
+ {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO3},
+ {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO_LOSSLESS},
+ };
+
IFilterMapper2 *mapper;
HRESULT hr;
@@ -543,6 +561,10 @@ HRESULT WINAPI DllRegisterServer(void)
IFilterMapper2_Release(mapper);
+ if (FAILED(hr = DMORegister(L"WMA Decoder DMO", &CLSID_WMADecMediaObject, &DMOCATEGORY_AUDIO_DECODER,
+ 0, ARRAY_SIZE(wma_decoder_input), wma_decoder_input, ARRAY_SIZE(wma_decoder_output), wma_decoder_output)))
+ return hr;
+
return mfplat_DllRegisterServer();
}
@@ -566,5 +588,9 @@ HRESULT WINAPI DllUnregisterServer(void)
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_WAVEParser);
IFilterMapper2_Release(mapper);
+
+ if (FAILED(hr = DMOUnregister(&CLSID_WMADecMediaObject, &DMOCATEGORY_AUDIO_DECODER)))
+ return hr;
+
return S_OK;
}
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 5404728ba83..6a58f444204 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -21,6 +21,7 @@
#include "ks.h"
#include "ksmedia.h"
+#include "wmcodecdsp.h"
#include "initguid.h"
#include "mfapi.h"
@@ -442,6 +443,20 @@ static const GUID *audio_converter_supported_types[] =
&MFAudioFormat_Float,
};
+static WCHAR wma_decoderW[] = L"WMAudio Decoder MFT";
+static const GUID *wma_decoder_input_types[] =
+{
+ &MEDIASUBTYPE_MSAUDIO1,
+ &MFAudioFormat_WMAudioV8,
+ &MFAudioFormat_WMAudioV9,
+ &MFAudioFormat_WMAudio_Lossless,
+};
+static const GUID *wma_decoder_output_types[] =
+{
+ &MFAudioFormat_PCM,
+ &MFAudioFormat_Float,
+};
+
static const struct mft
{
const GUID *clsid;
@@ -467,13 +482,24 @@ mfts[] =
ARRAY_SIZE(audio_converter_supported_types),
audio_converter_supported_types,
},
+ {
+ &CLSID_WMADecMediaObject,
+ &MFT_CATEGORY_AUDIO_DECODER,
+ wma_decoderW,
+ MFT_ENUM_FLAG_SYNCMFT,
+ &MFMediaType_Audio,
+ ARRAY_SIZE(wma_decoder_input_types),
+ wma_decoder_input_types,
+ ARRAY_SIZE(wma_decoder_output_types),
+ wma_decoder_output_types,
+ },
};
HRESULT mfplat_DllRegisterServer(void)
{
unsigned int i, j;
HRESULT hr;
- MFT_REGISTER_TYPE_INFO input_types[2], output_types[2];
+ MFT_REGISTER_TYPE_INFO input_types[4], output_types[2];
for (i = 0; i < ARRAY_SIZE(mfts); i++)
{
diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c
index 8532fc1af8b..e8d56d54785 100644
--- a/dlls/winegstreamer/quartz_parser.c
+++ b/dlls/winegstreamer/quartz_parser.c
@@ -29,8 +29,8 @@
#include "dvdmedia.h"
#include "mmreg.h"
#include "ks.h"
-#include "initguid.h"
#include "wmcodecdsp.h"
+#include "initguid.h"
#include "ksmedia.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl
index 072ec90eea4..90dc1dc839b 100644
--- a/dlls/winegstreamer/winegstreamer_classes.idl
+++ b/dlls/winegstreamer/winegstreamer_classes.idl
@@ -67,3 +67,9 @@ coclass GStreamerByteStreamHandler {}
uuid(6a170414-aad9-4693-b806-3a0c47c570d6)
]
coclass WINEAudioConverter { }
+
+[
+ threading(both),
+ uuid(2eeb4adf-4578-4d10-bca7-bb955f56320a)
+]
+coclass CWMADecMediaObject {};
diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c
new file mode 100644
index 00000000000..f034c34395e
--- /dev/null
+++ b/dlls/winegstreamer/wma_decoder.c
@@ -0,0 +1,553 @@
+/* WMA Decoder DMO / MF Transform
+ *
+ * Copyright 2022 Rémi Bernon 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 "gst_private.h"
+
+#include "mfapi.h"
+#include "mferror.h"
+#include "mfobjects.h"
+#include "mftransform.h"
+#include "wmcodecdsp.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wmadec);
+
+struct wma_decoder
+{
+ IUnknown IUnknown_inner;
+ IMFTransform IMFTransform_iface;
+ IMediaObject IMediaObject_iface;
+ IPropertyBag IPropertyBag_iface;
+ IUnknown *outer;
+ LONG refcount;
+};
+
+static inline struct wma_decoder *impl_from_IUnknown(IUnknown *iface)
+{
+ return CONTAINING_RECORD(iface, struct wma_decoder, IUnknown_inner);
+}
+
+static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID iid, void **out)
+{
+ struct wma_decoder *decoder = impl_from_IUnknown(iface);
+
+ TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
+
+ if (IsEqualGUID(iid, &IID_IUnknown))
+ *out = &decoder->IUnknown_inner;
+ else if (IsEqualGUID(iid, &IID_IMFTransform))
+ *out = &decoder->IMFTransform_iface;
+ else if (IsEqualGUID(iid, &IID_IMediaObject))
+ *out = &decoder->IMediaObject_iface;
+ else if (IsEqualIID(iid, &IID_IPropertyBag))
+ *out = &decoder->IPropertyBag_iface;
+ else
+ {
+ *out = NULL;
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ return E_NOINTERFACE;
+ }
+
+ IUnknown_AddRef((IUnknown *)*out);
+ return S_OK;
+}
+
+static ULONG WINAPI unknown_AddRef(IUnknown *iface)
+{
+ struct wma_decoder *decoder = impl_from_IUnknown(iface);
+ ULONG refcount = InterlockedIncrement(&decoder->refcount);
+
+ TRACE("iface %p increasing refcount to %u.\n", decoder, refcount);
+
+ return refcount;
+}
+
+static ULONG WINAPI unknown_Release(IUnknown *iface)
+{
+ struct wma_decoder *decoder = impl_from_IUnknown(iface);
+ ULONG refcount = InterlockedDecrement(&decoder->refcount);
+
+ TRACE("iface %p decreasing refcount to %u.\n", decoder, refcount);
+
+ if (!refcount)
+ free(decoder);
+
+ return refcount;
+}
+
+static const IUnknownVtbl unknown_vtbl =
+{
+ unknown_QueryInterface,
+ unknown_AddRef,
+ unknown_Release,
+};
+
+static struct wma_decoder *impl_from_IMFTransform(IMFTransform *iface)
+{
+ return CONTAINING_RECORD(iface, struct wma_decoder, IMFTransform_iface);
+}
+
+static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, void **out)
+{
+ struct wma_decoder *decoder = impl_from_IMFTransform(iface);
+ return IUnknown_QueryInterface(decoder->outer, iid, out);
+}
+
+static ULONG WINAPI transform_AddRef(IMFTransform *iface)
+{
+ struct wma_decoder *decoder = impl_from_IMFTransform(iface);
+ return IUnknown_AddRef(decoder->outer);
+}
+
+static ULONG WINAPI transform_Release(IMFTransform *iface)
+{
+ struct wma_decoder *decoder = impl_from_IMFTransform(iface);
+ return IUnknown_Release(decoder->outer);
+}
+
+static HRESULT WINAPI transform_GetStreamLimits(IMFTransform *iface, DWORD *input_minimum,
+ DWORD *input_maximum, DWORD *output_minimum, DWORD *output_maximum)
+{
+ FIXME("iface %p, input_minimum %p, input_maximum %p, output_minimum %p, output_maximum %p stub!\n",
+ iface, input_minimum, input_maximum, output_minimum, output_maximum);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs)
+{
+ FIXME("iface %p, inputs %p, outputs %p stub!\n", iface, inputs, outputs);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs,
+ DWORD output_size, DWORD *outputs)
+{
+ FIXME("iface %p, input_size %u, inputs %p, output_size %u, outputs %p stub!\n", iface,
+ input_size, inputs, output_size, outputs);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
+{
+ FIXME("iface %p, id %u, info %p stub!\n", iface, id, info);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
+{
+ FIXME("iface %p, id %u, info %p stub!\n", iface, id, info);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
+{
+ FIXME("iface %p, attributes %p stub!\n", iface, attributes);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetInputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes)
+{
+ FIXME("iface %p, id %u, attributes %p stub!\n", iface, id, attributes);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes)
+{
+ FIXME("iface %p, id %u, attributes %p stub!\n", iface, id, attributes);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_DeleteInputStream(IMFTransform *iface, DWORD id)
+{
+ FIXME("iface %p, id %u stub!\n", iface, id);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids)
+{
+ FIXME("iface %p, streams %u, ids %p stub!\n", iface, streams, ids);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
+ IMFMediaType **type)
+{
+ FIXME("iface %p, id %u, index %u, type %p stub!\n", iface, id, index, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
+ IMFMediaType **type)
+{
+ FIXME("iface %p, id %u, index %u, type %p stub!\n", iface, id, index, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
+{
+ FIXME("iface %p, id %u, type %p, flags %#x stub!\n", iface, id, type, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
+{
+ FIXME("iface %p, id %u, type %p, flags %#x stub!\n", iface, id, type, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
+{
+ FIXME("iface %p, id %u, type %p stub!\n", iface, id, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
+{
+ FIXME("iface %p, id %u, type %p stub!\n", iface, id, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags)
+{
+ FIXME("iface %p, id %u, flags %p stub!\n", iface, id, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_GetOutputStatus(IMFTransform *iface, DWORD *flags)
+{
+ FIXME("iface %p, flags %p stub!\n", iface, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper)
+{
+ FIXME("iface %p, lower %s, upper %s stub!\n", iface, wine_dbgstr_longlong(lower),
+ wine_dbgstr_longlong(upper));
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event)
+{
+ FIXME("iface %p, id %u, event %p stub!\n", iface, id, event);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param)
+{
+ FIXME("iface %p, message %#x, param %p stub!\n", iface, message, (void *)param);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
+{
+ FIXME("iface %p, id %u, sample %p, flags %#x stub!\n", iface, id, sample, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
+ MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status)
+{
+ FIXME("iface %p, flags %#x, count %u, samples %p, status %p stub!\n", iface, flags, count, samples, status);
+ return E_NOTIMPL;
+}
+
+static const IMFTransformVtbl transform_vtbl =
+{
+ transform_QueryInterface,
+ transform_AddRef,
+ transform_Release,
+ transform_GetStreamLimits,
+ transform_GetStreamCount,
+ transform_GetStreamIDs,
+ transform_GetInputStreamInfo,
+ transform_GetOutputStreamInfo,
+ transform_GetAttributes,
+ transform_GetInputStreamAttributes,
+ transform_GetOutputStreamAttributes,
+ transform_DeleteInputStream,
+ transform_AddInputStreams,
+ transform_GetInputAvailableType,
+ transform_GetOutputAvailableType,
+ transform_SetInputType,
+ transform_SetOutputType,
+ transform_GetInputCurrentType,
+ transform_GetOutputCurrentType,
+ transform_GetInputStatus,
+ transform_GetOutputStatus,
+ transform_SetOutputBounds,
+ transform_ProcessEvent,
+ transform_ProcessMessage,
+ transform_ProcessInput,
+ transform_ProcessOutput,
+};
+
+static inline struct wma_decoder *impl_from_IMediaObject(IMediaObject *iface)
+{
+ return CONTAINING_RECORD(iface, struct wma_decoder, IMediaObject_iface);
+}
+
+static HRESULT WINAPI media_object_QueryInterface(IMediaObject *iface, REFIID iid, void **obj)
+{
+ struct wma_decoder *decoder = impl_from_IMediaObject(iface);
+ return IUnknown_QueryInterface(decoder->outer, iid, obj);
+}
+
+static ULONG WINAPI media_object_AddRef(IMediaObject *iface)
+{
+ struct wma_decoder *decoder = impl_from_IMediaObject(iface);
+ return IUnknown_AddRef(decoder->outer);
+}
+
+static ULONG WINAPI media_object_Release(IMediaObject *iface)
+{
+ struct wma_decoder *decoder = impl_from_IMediaObject(iface);
+ return IUnknown_Release(decoder->outer);
+}
+
+static HRESULT WINAPI media_object_GetStreamCount(IMediaObject *iface, DWORD *input, DWORD *output)
+{
+ FIXME("iface %p, input %p, output %p semi-stub!\n", iface, input, output);
+ *input = *output = 1;
+ return S_OK;
+}
+
+static HRESULT WINAPI media_object_GetInputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
+{
+ FIXME("iface %p, index %u, flags %p stub!\n", iface, index, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetOutputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
+{
+ FIXME("iface %p, index %u, flags %p stub!\n", iface, index, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetInputType(IMediaObject *iface, DWORD index, DWORD type_index,
+ DMO_MEDIA_TYPE *type)
+{
+ FIXME("iface %p, index %u, type_index %u, type %p stub!\n", iface, index, type_index, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetOutputType(IMediaObject *iface, DWORD index, DWORD type_index,
+ DMO_MEDIA_TYPE *type)
+{
+ FIXME("iface %p, index %u, type_index %u, type %p stub!\n", iface, index, type_index, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index,
+ const DMO_MEDIA_TYPE *type, DWORD flags)
+{
+ FIXME("iface %p, index %u, type %p, flags %#x stub!\n", iface, index, type, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD index,
+ const DMO_MEDIA_TYPE *type, DWORD flags)
+{
+ FIXME("iface %p, index %u, type %p, flags %#x stub!\n", iface, index, type, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type)
+{
+ FIXME("iface %p, index %u, type %p stub!\n", iface, index, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type)
+{
+ FIXME("iface %p, index %u, type %p stub!\n", iface, index, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size,
+ DWORD *lookahead, DWORD *alignment)
+{
+ FIXME("iface %p, index %u, size %p, lookahead %p, alignment %p stub!\n", iface, index, size,
+ lookahead, alignment);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment)
+{
+ FIXME("iface %p, index %u, size %p, alignment %p stub!\n", iface, index, size, alignment);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
+{
+ FIXME("iface %p, index %u, latency %p stub!\n", iface, index, latency);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_SetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME latency)
+{
+ FIXME("iface %p, index %u, latency %s stub!\n", iface, index, wine_dbgstr_longlong(latency));
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_Flush(IMediaObject *iface)
+{
+ FIXME("iface %p stub!\n", iface);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_Discontinuity(IMediaObject *iface, DWORD index)
+{
+ FIXME("iface %p, index %u stub!\n", iface, index);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_AllocateStreamingResources(IMediaObject *iface)
+{
+ FIXME("iface %p stub!\n", iface);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_FreeStreamingResources(IMediaObject *iface)
+{
+ FIXME("iface %p stub!\n", iface);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_GetInputStatus(IMediaObject *iface, DWORD index, DWORD *flags)
+{
+ FIXME("iface %p, index %u, flags %p stub!\n", iface, index, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_ProcessInput(IMediaObject *iface, DWORD index,
+ IMediaBuffer *buffer, DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME timelength)
+{
+ FIXME("iface %p, index %u, buffer %p, flags %#x, timestamp %s, timelength %s stub!\n", iface,
+ index, buffer, flags, wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(timelength));
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count,
+ DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status)
+{
+ FIXME("iface %p, flags %#x, count %u, buffers %p, status %p stub!\n", iface, flags, count, buffers, status);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_object_Lock(IMediaObject *iface, LONG lock)
+{
+ FIXME("iface %p, lock %d stub!\n", iface, lock);
+ return E_NOTIMPL;
+}
+
+static const IMediaObjectVtbl media_object_vtbl =
+{
+ media_object_QueryInterface,
+ media_object_AddRef,
+ media_object_Release,
+ media_object_GetStreamCount,
+ media_object_GetInputStreamInfo,
+ media_object_GetOutputStreamInfo,
+ media_object_GetInputType,
+ media_object_GetOutputType,
+ media_object_SetInputType,
+ media_object_SetOutputType,
+ media_object_GetInputCurrentType,
+ media_object_GetOutputCurrentType,
+ media_object_GetInputSizeInfo,
+ media_object_GetOutputSizeInfo,
+ media_object_GetInputMaxLatency,
+ media_object_SetInputMaxLatency,
+ media_object_Flush,
+ media_object_Discontinuity,
+ media_object_AllocateStreamingResources,
+ media_object_FreeStreamingResources,
+ media_object_GetInputStatus,
+ media_object_ProcessInput,
+ media_object_ProcessOutput,
+ media_object_Lock,
+};
+
+static inline struct wma_decoder *impl_from_IPropertyBag(IPropertyBag *iface)
+{
+ return CONTAINING_RECORD(iface, struct wma_decoder, IPropertyBag_iface);
+}
+
+static HRESULT WINAPI property_bag_QueryInterface(IPropertyBag *iface, REFIID iid, void **out)
+{
+ struct wma_decoder *filter = impl_from_IPropertyBag(iface);
+ return IUnknown_QueryInterface(filter->outer, iid, out);
+}
+
+static ULONG WINAPI property_bag_AddRef(IPropertyBag *iface)
+{
+ struct wma_decoder *filter = impl_from_IPropertyBag(iface);
+ return IUnknown_AddRef(filter->outer);
+}
+
+static ULONG WINAPI property_bag_Release(IPropertyBag *iface)
+{
+ struct wma_decoder *filter = impl_from_IPropertyBag(iface);
+ return IUnknown_Release(filter->outer);
+}
+
+static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, const WCHAR *prop_name, VARIANT *value,
+ IErrorLog *error_log)
+{
+ FIXME("iface %p, prop_name %s, value %p, error_log %p stub!\n", iface, debugstr_w(prop_name), value, error_log);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI property_bag_Write(IPropertyBag *iface, const WCHAR *prop_name, VARIANT *value)
+{
+ FIXME("iface %p, prop_name %s, value %p stub!\n", iface, debugstr_w(prop_name), value);
+ return S_OK;
+}
+
+static const IPropertyBagVtbl property_bag_vtbl =
+{
+ property_bag_QueryInterface,
+ property_bag_AddRef,
+ property_bag_Release,
+ property_bag_Read,
+ property_bag_Write,
+};
+
+HRESULT wma_decoder_create(IUnknown *outer, IUnknown **out)
+{
+ struct wma_decoder *decoder;
+
+ TRACE("outer %p, out %p.\n", outer, out);
+
+ if (!(decoder = calloc(1, sizeof(*decoder))))
+ return E_OUTOFMEMORY;
+
+ decoder->IUnknown_inner.lpVtbl = &unknown_vtbl;
+ decoder->IMFTransform_iface.lpVtbl = &transform_vtbl;
+ decoder->IMediaObject_iface.lpVtbl = &media_object_vtbl;
+ decoder->IPropertyBag_iface.lpVtbl = &property_bag_vtbl;
+ decoder->refcount = 1;
+ decoder->outer = outer ? outer : &decoder->IUnknown_inner;
+
+ *out = &decoder->IUnknown_inner;
+ TRACE("Created decoder %p\n", *out);
+ return S_OK;
+}
diff --git a/dlls/wmadmod/tests/wmadmod.c b/dlls/wmadmod/tests/wmadmod.c
index e95e297eaca..b49b609dac3 100644
--- a/dlls/wmadmod/tests/wmadmod.c
+++ b/dlls/wmadmod/tests/wmadmod.c
@@ -52,11 +52,8 @@ static void test_DMOGetTypes(void)
hr = DMOGetTypes( &CLSID_CWMADecMediaObject, ARRAY_SIZE(input), &input_count, input,
ARRAY_SIZE(output), &output_count, output );
- todo_wine
ok( hr == S_OK, "DMOGetTypes returned %#lx\n", hr );
- todo_wine
ok( input_count == ARRAY_SIZE(expect_input), "got input_count %lu\n", input_count );
- todo_wine
ok( output_count == ARRAY_SIZE(expect_output), "got output_count %lu\n", output_count );
for (i = 0; i < input_count; ++i)
@@ -135,9 +132,7 @@ static void test_interfaces(void)
hr = CoCreateInstance( &CLSID_CWMADecMediaObject, &outer, CLSCTX_INPROC_SERVER, &IID_IUnknown,
(void **)&unknown );
- todo_wine
ok( hr == S_OK, "CoCreateInstance returned %#lx\n", hr );
- if (FAILED(hr)) return;
hr = IUnknown_QueryInterface( unknown, &IID_IMFTransform, (void **)&transform );
ok( hr == S_OK, "QueryInterface returned %#lx\n", hr );
hr = IUnknown_QueryInterface( unknown, &IID_IMediaObject, (void **)&media_object );
--
2.34.1
2
13
Feb. 2, 2022
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmsynth/tests/Makefile.in | 1 -
dlls/dmsynth/tests/dmsynth.c | 104 ++++++++++++++++-----------------
2 files changed, 52 insertions(+), 53 deletions(-)
diff --git a/dlls/dmsynth/tests/Makefile.in b/dlls/dmsynth/tests/Makefile.in
index b082aa5dcc5..5f2fce7b8b1 100644
--- a/dlls/dmsynth/tests/Makefile.in
+++ b/dlls/dmsynth/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = dmsynth.dll
IMPORTS = oleaut32 ole32 uuid
diff --git a/dlls/dmsynth/tests/dmsynth.c b/dlls/dmsynth/tests/dmsynth.c
index 59ced1f0f21..5f2e9e95364 100644
--- a/dlls/dmsynth/tests/dmsynth.c
+++ b/dlls/dmsynth/tests/dmsynth.c
@@ -67,81 +67,81 @@ static void test_dmsynth(void)
DMUS_PORTCAPS caps;
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (LPVOID*)&dmsynth);
- ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
+ ok(hr == S_OK, "CoCreateInstance returned: %#lx\n", hr);
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink,
(void **)&dmsynth_sink);
- ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
+ ok(hr == S_OK, "CoCreateInstance returned: %#lx\n", hr);
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink,
(void **)&dmsynth_sink2);
- ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
+ ok(hr == S_OK, "CoCreateInstance returned: %#lx\n", hr);
hr = IDirectMusicSynth_QueryInterface(dmsynth, &IID_IKsControl, (LPVOID*)&control_synth);
- ok(hr == S_OK, "IDirectMusicSynth_QueryInterface returned: %x\n", hr);
+ ok(hr == S_OK, "IDirectMusicSynth_QueryInterface returned: %#lx\n", hr);
S(U(property)).Id = 0;
S(U(property)).Flags = KSPROPERTY_TYPE_GET;
S(U(property)).Set = GUID_DMUS_PROP_INSTRUMENT2;
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
- ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
- ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
- ok(value == TRUE, "Return value: %u, should be 1\n", value);
+ ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
+ ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
+ ok(value == TRUE, "Return value: %lu, should be 1\n", value);
S(U(property)).Set = GUID_DMUS_PROP_DLS2;
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
- ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
- ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
- ok(value == TRUE, "Return value: %u, should be 1\n", value);
+ ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
+ ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
+ ok(value == TRUE, "Return value: %lu, should be 1\n", value);
S(U(property)).Set = GUID_DMUS_PROP_GM_Hardware;
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
- ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
- ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
- ok(value == FALSE, "Return value: %u, should be 0\n", value);
+ ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
+ ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
+ ok(value == FALSE, "Return value: %lu, should be 0\n", value);
S(U(property)).Set = GUID_DMUS_PROP_GS_Hardware;
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
- ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
- ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
- ok(value == FALSE, "Return value: %u, should be 0\n", value);
+ ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
+ ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
+ ok(value == FALSE, "Return value: %lu, should be 0\n", value);
S(U(property)).Set = GUID_DMUS_PROP_XG_Hardware;
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
- ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
- ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
- ok(value == FALSE, "Return value: %u, should be 0\n", value);
+ ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
+ ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
+ ok(value == FALSE, "Return value: %lu, should be 0\n", value);
hr = IDirectMusicSynthSink_QueryInterface(dmsynth_sink, &IID_IKsControl, (LPVOID*)&control_sink);
- ok(hr == S_OK, "IDirectMusicSynthSink_QueryInterface returned: %x\n", hr);
+ ok(hr == S_OK, "IDirectMusicSynthSink_QueryInterface returned: %#lx\n", hr);
S(U(property)).Set = GUID_DMUS_PROP_SinkUsesDSound;
hr = IKsControl_KsProperty(control_sink, &property, sizeof(property), &value, sizeof(value), &bytes);
- ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
- ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
- ok(value == TRUE, "Return value: %u, should be 1\n", value);
+ ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
+ ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
+ ok(value == TRUE, "Return value: %lu, should be 1\n", value);
/* Synth isn't fully initialized yet */
hr = IDirectMusicSynth_Activate(dmsynth, TRUE);
- ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_Activate returned: %x\n", hr);
+ ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_Activate returned: %#lx\n", hr);
/* Synth has no default clock */
hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock_synth);
- ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
+ ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_GetLatencyClock returned: %#lx\n", hr);
/* SynthSink has a default clock */
hr = IDirectMusicSynthSink_GetLatencyClock(dmsynth_sink, &clock_sink);
- ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
+ ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %#lx\n", hr);
ok(clock_sink != NULL, "No clock returned\n");
ref_clock_sink = get_refcount(clock_sink);
/* This will Init() the SynthSink and finish initializing the Synth */
hr = IDirectMusicSynthSink_Init(dmsynth_sink2, NULL);
- ok(hr == S_OK, "IDirectMusicSynthSink_Init returned: %x\n", hr);
+ ok(hr == S_OK, "IDirectMusicSynthSink_Init returned: %#lx\n", hr);
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink2);
- ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
+ ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %#lx\n", hr);
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink);
- ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
+ ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %#lx\n", hr);
/* Check clocks are the same */
hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock_synth);
- ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
+ ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %#lx\n", hr);
ok(clock_synth != NULL, "No clock returned\n");
ok(clock_synth == clock_sink, "Synth and SynthSink clocks are not the same\n");
ref_clock_synth = get_refcount(clock_synth);
@@ -149,13 +149,13 @@ static void test_dmsynth(void)
/* GetPortCaps */
hr = IDirectMusicSynth_GetPortCaps(dmsynth, NULL);
- ok(hr == E_INVALIDARG, "GetPortCaps failed: %#x\n", hr);
+ ok(hr == E_INVALIDARG, "GetPortCaps failed: %#lx\n", hr);
memset(&caps, 0, sizeof(caps));
hr = IDirectMusicSynth_GetPortCaps(dmsynth, &caps);
- ok(hr == E_INVALIDARG, "GetPortCaps failed: %#x\n", hr);
+ ok(hr == E_INVALIDARG, "GetPortCaps failed: %#lx\n", hr);
caps.dwSize = sizeof(caps) + 1;
hr = IDirectMusicSynth_GetPortCaps(dmsynth, &caps);
- ok(hr == S_OK, "GetPortCaps failed: %#x\n", hr);
+ ok(hr == S_OK, "GetPortCaps failed: %#lx\n", hr);
if (control_synth)
IDirectMusicSynth_Release(control_synth);
@@ -184,38 +184,38 @@ static void test_COM(void)
hr = CoCreateInstance(&CLSID_DirectMusicSynth, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void**)&dms8);
ok(hr == CLASS_E_NOAGGREGATION,
- "DirectMusicSynth create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr);
+ "DirectMusicSynth create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", hr);
ok(!dms8, "dms8 = %p\n", dms8);
/* Invalid RIID */
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectMusicObject, (void**)&dms8);
- ok(hr == E_NOINTERFACE, "DirectMusicSynth create failed: %08x, expected E_NOINTERFACE\n", hr);
+ ok(hr == E_NOINTERFACE, "DirectMusicSynth create failed: %#lx, expected E_NOINTERFACE\n", hr);
/* Same refcount for all DirectMusicSynth interfaces */
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectMusicSynth8, (void**)&dms8);
- ok(hr == S_OK, "DirectMusicSynth create failed: %08x, expected S_OK\n", hr);
+ ok(hr == S_OK, "DirectMusicSynth create failed: %#lx, expected S_OK\n", hr);
refcount = IDirectMusicSynth8_AddRef(dms8);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
+ ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
hr = IDirectMusicSynth8_QueryInterface(dms8, &IID_IKsControl, (void**)&iksc);
- ok(hr == S_OK, "QueryInterface for IID_IKsControl failed: %08x\n", hr);
+ ok(hr == S_OK, "QueryInterface for IID_IKsControl failed: %#lx\n", hr);
refcount = IKsControl_AddRef(iksc);
- ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
+ ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
IKsControl_Release(iksc);
hr = IDirectMusicSynth8_QueryInterface(dms8, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
+ ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
refcount = IUnknown_AddRef(unk);
- ok(refcount == 5, "refcount == %u, expected 5\n", refcount);
+ ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
IUnknown_Release(unk);
/* Unsupported interfaces */
hr = IDirectMusicSynth8_QueryInterface(dms8, &IID_IDirectMusicSynthSink, (void**)&unk);
- ok(hr == E_NOINTERFACE, "QueryInterface for IID_IDirectMusicSynthSink failed: %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "QueryInterface for IID_IDirectMusicSynthSink failed: %#lx\n", hr);
hr = IDirectMusicSynth8_QueryInterface(dms8, &IID_IReferenceClock, (void**)&unk);
- ok(hr == E_NOINTERFACE, "QueryInterface for IID_IReferenceClock failed: %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "QueryInterface for IID_IReferenceClock failed: %#lx\n", hr);
while (IDirectMusicSynth8_Release(dms8));
}
@@ -232,36 +232,36 @@ static void test_COM_synthsink(void)
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void**)&dmss);
ok(hr == CLASS_E_NOAGGREGATION,
- "DirectMusicSynthSink create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr);
+ "DirectMusicSynthSink create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", hr);
ok(!dmss, "dmss = %p\n", dmss);
/* Invalid RIID */
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectMusicObject, (void**)&dmss);
- ok(hr == E_NOINTERFACE, "DirectMusicSynthSink create failed: %08x, expected E_NOINTERFACE\n", hr);
+ ok(hr == E_NOINTERFACE, "DirectMusicSynthSink create failed: %#lx, expected E_NOINTERFACE\n", hr);
/* Same refcount for all DirectMusicSynthSink interfaces */
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectMusicSynthSink, (void**)&dmss);
- ok(hr == S_OK, "DirectMusicSynthSink create failed: %08x, expected S_OK\n", hr);
+ ok(hr == S_OK, "DirectMusicSynthSink create failed: %#lx, expected S_OK\n", hr);
refcount = IDirectMusicSynthSink_AddRef(dmss);
- ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
+ ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
hr = IDirectMusicSynthSink_QueryInterface(dmss, &IID_IKsControl, (void**)&iksc);
- ok(hr == S_OK, "QueryInterface for IID_IKsControl failed: %08x\n", hr);
+ ok(hr == S_OK, "QueryInterface for IID_IKsControl failed: %#lx\n", hr);
refcount = IKsControl_AddRef(iksc);
- ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
+ ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
IKsControl_Release(iksc);
hr = IDirectMusicSynthSink_QueryInterface(dmss, &IID_IUnknown, (void**)&unk);
- ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
+ ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
refcount = IUnknown_AddRef(unk);
- ok(refcount == 5, "refcount == %u, expected 5\n", refcount);
+ ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
IUnknown_Release(unk);
/* Unsupported interfaces */
hr = IDirectMusicSynthSink_QueryInterface(dmss, &IID_IReferenceClock, (void**)&unk);
- ok(hr == E_NOINTERFACE, "QueryInterface for IID_IReferenceClock failed: %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "QueryInterface for IID_IReferenceClock failed: %#lx\n", hr);
while (IDirectMusicSynthSink_Release(dmss));
}
--
2.34.1
1
0
Feb. 2, 2022
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/msvcrt/concurrency.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
3
2
Feb. 2, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/kernel32/winerror.mc | 50 +++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/dlls/kernel32/winerror.mc b/dlls/kernel32/winerror.mc
index 5359e07173c..6b5dadc8f76 100644
--- a/dlls/kernel32/winerror.mc
+++ b/dlls/kernel32/winerror.mc
@@ -3740,6 +3740,36 @@ SymbolicName=ERROR_NOT_CONNECTED
Language=ENU
This network connection does not exist.
.
+MessageId=10004
+SymbolicName=WSAEINTR
+Language=ENU
+Call interrupted.
+.
+MessageId=10009
+SymbolicName=WSAEBADF
+Language=ENU
+Invalid file handle.
+.
+MessageId=10013
+SymbolicName=WSAEACCES
+Language=ENU
+Access denied.
+.
+MessageId=10014
+SymbolicName=WSAEFAULT
+Language=ENU
+Invalid pointer address.
+.
+MessageId=10022
+SymbolicName=WSAEFAULT
+Language=ENU
+Invalid argument.
+.
+MessageId=10024
+SymbolicName=WSAEMFILE
+Language=ENU
+Too many open files.
+.
MessageId=10054
SymbolicName=WSAECONNRESET
Language=ENU
@@ -3750,6 +3780,26 @@ SymbolicName=WSAECONNREFUSED
Language=ENU
Connection refused.
.
+MessageId=11001
+SymbolicName=WSAHOST_NOT_FOUND
+Language=ENU
+Host not found.
+.
+MessageId=11002
+SymbolicName=WSATRY_AGAIN
+Language=ENU
+Nonauthoritative host not found.
+.
+MessageId=11003
+SymbolicName=WSANO_RECOVERY
+Language=ENU
+Nonrecoverable error.
+.
+MessageId=11004
+SymbolicName=WSANO_DATA
+Language=ENU
+Name valid, no data record.
+.
MessageId=0x100
Severity=CoError
Facility=Trust
--
2.34.1
2
2
Feb. 2, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
v2: fixed copy-paste mistake
dlls/kernel32/winerror.mc | 50 +++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/dlls/kernel32/winerror.mc b/dlls/kernel32/winerror.mc
index 5359e07173c..da36b0f59bc 100644
--- a/dlls/kernel32/winerror.mc
+++ b/dlls/kernel32/winerror.mc
@@ -3740,6 +3740,36 @@ SymbolicName=ERROR_NOT_CONNECTED
Language=ENU
This network connection does not exist.
.
+MessageId=10004
+SymbolicName=WSAEINTR
+Language=ENU
+Call interrupted.
+.
+MessageId=10009
+SymbolicName=WSAEBADF
+Language=ENU
+Invalid file handle.
+.
+MessageId=10013
+SymbolicName=WSAEACCES
+Language=ENU
+Access denied.
+.
+MessageId=10014
+SymbolicName=WSAEFAULT
+Language=ENU
+Invalid pointer address.
+.
+MessageId=10022
+SymbolicName=WSAEINVAL
+Language=ENU
+Invalid argument.
+.
+MessageId=10024
+SymbolicName=WSAEMFILE
+Language=ENU
+Too many open files.
+.
MessageId=10054
SymbolicName=WSAECONNRESET
Language=ENU
@@ -3750,6 +3780,26 @@ SymbolicName=WSAECONNREFUSED
Language=ENU
Connection refused.
.
+MessageId=11001
+SymbolicName=WSAHOST_NOT_FOUND
+Language=ENU
+Host not found.
+.
+MessageId=11002
+SymbolicName=WSATRY_AGAIN
+Language=ENU
+Nonauthoritative host not found.
+.
+MessageId=11003
+SymbolicName=WSANO_RECOVERY
+Language=ENU
+Nonrecoverable error.
+.
+MessageId=11004
+SymbolicName=WSANO_DATA
+Language=ENU
+Name valid, no data record.
+.
MessageId=0x100
Severity=CoError
Facility=Trust
--
2.34.1
1
0
Feb. 2, 2022
The following series:
- extends current test harness by adding interactive tests capability
- fixes a couple of bugs (with tests in interactive mode)
A+
V1->V2: moved some changes across individual patch to let every step
succeeeds
---
Eric Pouech (7):
programs/cmd/tests: don't output more data than available
programs/cmd/tests: added ability to run tests in interactive mode
programs/cmd/tests: some interactive test about input echo
programs/cmd/tests: added support for multi-line input
programs/cmd: handle white space only lines within ( ) block
programs/cmd: expand commandline before parsing it (interactive mode)
programs/cmd: detect badly quoted operand in 'if' statement
programs/cmd/builtins.c | 10 ++
programs/cmd/tests/batch.c | 111 ++++++++++++++----
programs/cmd/tests/interactive_builtins.cmd | 42 +++++++
.../cmd/tests/interactive_builtins.cmd.exp | 67 +++++++++++
programs/cmd/tests/rsrc.rc | 10 ++
programs/cmd/wcmdmain.c | 34 ++++--
6 files changed, 244 insertions(+), 30 deletions(-)
create mode 100644 programs/cmd/tests/interactive_builtins.cmd
create mode 100644 programs/cmd/tests/interactive_builtins.cmd.exp
1
7
Feb. 2, 2022
From: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
---
v5: Rebased on top of current git.
libs/vkd3d-shader/hlsl.y | 19 ++++++++++++++++++-
tests/round.shader_test | 13 +++++++++++++
tests/shader_runner.c | 8 ++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index be24a749..8d7b1243 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -1570,6 +1570,18 @@ static const struct hlsl_ir_function_decl *find_function_call(struct hlsl_ctx *c
return args.decl;
}
+static struct hlsl_ir_node *intrinsic_float_convert_arg(struct hlsl_ctx *ctx,
+ const struct parse_initializer *params, struct hlsl_ir_node *arg, const struct vkd3d_shader_location *loc)
+{
+ struct hlsl_type *type = arg->data_type;
+
+ if (type->base_type == HLSL_TYPE_FLOAT || type->base_type == HLSL_TYPE_HALF)
+ return arg;
+
+ type = hlsl_get_numeric_type(ctx, type->type, HLSL_TYPE_FLOAT, type->dimx, type->dimy);
+ return add_implicit_conversion(ctx, params->instrs, arg, type, loc);
+}
+
static bool intrinsic_abs(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
{
@@ -1675,7 +1687,12 @@ static bool intrinsic_pow(struct hlsl_ctx *ctx,
static bool intrinsic_round(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
{
- return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_ROUND, params->args[0], loc);
+ struct hlsl_ir_node *arg;
+
+ if (!(arg = intrinsic_float_convert_arg(ctx, params, params->args[0], loc)))
+ return false;
+
+ return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_ROUND, arg, loc);
}
static bool intrinsic_saturate(struct hlsl_ctx *ctx,
diff --git a/tests/round.shader_test b/tests/round.shader_test
index d8eb11b7..cc5a6975 100644
--- a/tests/round.shader_test
+++ b/tests/round.shader_test
@@ -24,3 +24,16 @@ float4 main(uniform float4 u) : sv_target
uniform 0 float4 -0.5 6.5 7.5 3.4
draw quad
probe all rgba (6.0, 8.0, 0.0, 3.0) 4
+
+
+
+[pixel shader]
+float4 main(uniform int4 u) : sv_target
+{
+ return round(u);
+}
+
+[test]
+uniform 0 int4 -1 0 2 10
+draw quad
+probe all rgba (-1.0, 0.0, 2.0, 10.0) 4
diff --git a/tests/shader_runner.c b/tests/shader_runner.c
index 5af4628e..558d074d 100644
--- a/tests/shader_runner.c
+++ b/tests/shader_runner.c
@@ -368,6 +368,14 @@ static void parse_test_directive(struct shader_context *context, const char *lin
fatal_error("Malformed float constant '%s'.\n", line);
set_uniforms(context, offset, 1, &f);
}
+ else if (match_string(line, "int4", &line))
+ {
+ int v[4];
+
+ if (sscanf(line, "%d %d %d %d", &v[0], &v[1], &v[2], &v[3]) < 4)
+ fatal_error("Malformed int4 constant '%s'.\n", line);
+ set_uniforms(context, offset, 4, v);
+ }
else if (match_string(line, "int", &line))
{
int i;
--
2.34.1
2
9
NtFlushProcessWriteBuffers is the NT equivalent of Linux membarrier()
system call. The .NET Framework garbage collector uses it to
synchronize with other threads, and thus is required to avoid silent
memory corruption.
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
---
Notes:
This is a naive implementation of the barrier system call.
The memory overhead for each NtFlushProcessWriteBuffers call is:
- 1 event object
- N APC objects (where N = <number of threads in process> - 1)
Possible directions for improvements include:
- Don't allocate any memory, so that it won't fail on out-of-memory
conditions.
- This also means we don't allocate APC objects. Currently
- Use membarrier() on Linux.
- Use TLB shootdown IPI instead of APC. (Is this a correct method?)
dlls/ntdll/unix/server.c | 63 +++++++++++++++++++++++++++++++++++++++
dlls/ntdll/unix/virtual.c | 10 -------
server/protocol.def | 16 +++++++++-
server/thread.c | 59 ++++++++++++++++++++++++++++++++----
4 files changed, 131 insertions(+), 17 deletions(-)
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index 9d0594d3374..26e2c288440 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -108,6 +108,15 @@ static int initial_cwd = -1;
static pid_t server_pid;
static pthread_mutex_t fd_cache_mutex = PTHREAD_MUTEX_INITIALIZER;
+#define PROC_MEM_BARRIER_MAGIC 0x626d654dUL
+
+struct proc_mem_barrier_cb
+{
+ ULONG magic;
+ volatile LONG count;
+ HANDLE event;
+};
+
/* atomically exchange a 64-bit value */
static inline LONG64 interlocked_xchg64( LONG64 *dest, LONG64 val )
{
@@ -574,6 +583,18 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO
if (!self) NtClose( wine_server_ptr_handle(call->dup_handle.dst_process) );
break;
}
+ case APC_MEMORY_BARRIER:
+ {
+ struct proc_mem_barrier_cb *cb = wine_server_get_ptr( call->memory_barrier.cb );
+
+ assert( cb->magic == PROC_MEM_BARRIER_MAGIC );
+
+ MemoryBarrier();
+ result->type = call->type;
+ if (!InterlockedDecrement( &cb->count ))
+ NtSetEvent( cb->event, NULL );
+ break;
+ }
default:
server_protocol_error( "get_apc_request: bad type %d\n", call->type );
break;
@@ -603,6 +624,9 @@ unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT
pthread_sigmask( SIG_BLOCK, &server_block_set, &old_set );
for (;;)
{
+ /* ensure writes so far are visible to other threads */
+ MemoryBarrier();
+
SERVER_START_REQ( select )
{
req->flags = flags;
@@ -1729,3 +1753,42 @@ NTSTATUS WINAPI NtClose( HANDLE handle )
}
return ret;
}
+
+
+/**********************************************************************
+ * NtFlushProcessWriteBuffers (NTDLL.@)
+ */
+void WINAPI NtFlushProcessWriteBuffers(void)
+{
+ for (;;)
+ {
+ NTSTATUS ret;
+ LARGE_INTEGER timeout;
+ struct proc_mem_barrier_cb cb = { PROC_MEM_BARRIER_MAGIC };
+
+ ret = NtCreateEvent( &cb.event, EVENT_ALL_ACCESS, NULL, SynchronizationEvent, FALSE );
+ if (ret == STATUS_SUCCESS)
+ {
+ MemoryBarrier();
+ SERVER_START_REQ( flush_process_write_buffers )
+ {
+ req->cb = wine_server_client_ptr( &cb );
+ ret = wine_server_call( req );
+ InterlockedAdd( &cb.count, reply->count );
+ }
+ SERVER_END_REQ;
+
+ while (cb.count)
+ NtWaitForSingleObject( cb.event, FALSE, NULL );
+ MemoryBarrier(); /* read cb.count before end of barrier */
+
+ NtClose( cb.event );
+ memset( &cb, 0, sizeof(cb) );
+ if (ret == STATUS_SUCCESS) break;
+ }
+
+ /* NtFlushProcessWriteBuffers cannot fail */
+ timeout.QuadPart = -100 * (ULONGLONG)10000;
+ NtDelayExecution( FALSE, &timeout );
+ }
+}
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 94b300c5057..3e2d985f8d0 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -4935,16 +4935,6 @@ NTSTATUS WINAPI NtFlushInstructionCache( HANDLE handle, const void *addr, SIZE_T
}
-/**********************************************************************
- * NtFlushProcessWriteBuffers (NTDLL.@)
- */
-void WINAPI NtFlushProcessWriteBuffers(void)
-{
- static int once = 0;
- if (!once++) FIXME( "stub\n" );
-}
-
-
/**********************************************************************
* NtCreatePagingFile (NTDLL.@)
*/
diff --git a/server/protocol.def b/server/protocol.def
index 02e73047f9b..907cb2f5298 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -502,7 +502,8 @@ enum apc_type
APC_MAP_VIEW,
APC_UNMAP_VIEW,
APC_CREATE_THREAD,
- APC_DUP_HANDLE
+ APC_DUP_HANDLE,
+ APC_MEMORY_BARRIER
};
typedef struct
@@ -611,6 +612,11 @@ typedef union
unsigned int attributes; /* object attributes */
unsigned int options; /* duplicate options */
} dup_handle;
+ struct
+ {
+ enum apc_type type; /* APC_MEMORY_BARRIER */
+ client_ptr_t cb; /* address of control block */
+ } memory_barrier;
} apc_call_t;
typedef union
@@ -1592,6 +1598,14 @@ enum server_fd_type
@END
+/* Issue APC_MEMORY_BARRIER on other threads in the same process */
+(a)REQ(flush_process_write_buffers)
+ client_ptr_t cb; /* address of control block */
+(a)REPLY
+ data_size_t count; /* number of threads signaled */
+(a)END
+
+
struct thread_info
{
timeout_t start_time;
diff --git a/server/thread.c b/server/thread.c
index 467ccd1f0db..4f02f6a5118 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1151,6 +1151,21 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
return 1;
}
+static void withdraw_apc( struct thread_apc *apc )
+{
+ if (apc->call.type == APC_MEMORY_BARRIER && apc->result.type != apc->call.type && apc->owner)
+ {
+ struct process *process = (struct process *)apc->owner;
+
+ /* Re-queue APC to another thread to balance the proc_mem_barrier_cb counter */
+ if (queue_apc( process, NULL, apc ))
+ return;
+ }
+
+ apc->executed = 1;
+ wake_up( &apc->obj, 0 );
+}
+
/* queue an async procedure call */
int thread_queue_apc( struct process *process, struct thread *thread, struct object *owner, const apc_call_t *call_data )
{
@@ -1175,8 +1190,7 @@ void thread_cancel_apc( struct thread *thread, struct object *owner, enum apc_ty
{
if (apc->owner != owner) continue;
list_remove( &apc->entry );
- apc->executed = 1;
- wake_up( &apc->obj, 0 );
+ withdraw_apc( apc );
release_object( apc );
return;
}
@@ -1205,8 +1219,7 @@ static void clear_apc_queue( struct list *queue )
{
struct thread_apc *apc = LIST_ENTRY( ptr, struct thread_apc, entry );
list_remove( &apc->entry );
- apc->executed = 1;
- wake_up( &apc->obj, 0 );
+ withdraw_apc( apc );
release_object( apc );
}
}
@@ -1669,8 +1682,7 @@ DECL_HANDLER(select)
reply->call = apc->call;
else
{
- apc->executed = 1;
- wake_up( &apc->obj, 0 );
+ withdraw_apc( apc );
}
release_object( apc );
}
@@ -2011,3 +2023,38 @@ DECL_HANDLER(get_next_thread)
set_error( STATUS_NO_MORE_ENTRIES );
release_object( process );
}
+
+/* issue APC_MEMORY_BARRIER on other threads in the same process */
+DECL_HANDLER(flush_process_write_buffers)
+{
+ struct process *process = current->process;
+ struct thread *thread;
+ apc_call_t call;
+
+ memset( &call, 0, sizeof(call) );
+ call.memory_barrier.type = APC_MEMORY_BARRIER;
+ call.memory_barrier.cb = req->cb;
+
+ reply->count = 0;
+
+ LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry )
+ {
+ struct thread_apc *apc;
+ int success;
+
+ if (thread == current || thread->state == TERMINATED) continue;
+
+ if (!(apc = create_apc( &process->obj, &call ))) break;
+
+ if ((success = queue_apc( NULL, thread, apc )))
+ reply->count++;
+
+ release_object( apc );
+
+ if (!success)
+ {
+ set_error( STATUS_UNSUCCESSFUL );
+ break;
+ }
+ }
+}
--
2.34.1
1
0
Signed-off-by: André Zwing <nerv(a)dawncrow.de>
---
dlls/ntdll/ntdll.spec | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index afb945d4665..29174965394 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -52,7 +52,7 @@
@ stdcall EtwEventSetInformation(int64 long ptr long)
@ stdcall EtwEventUnregister(int64)
@ stdcall EtwEventWrite(int64 ptr long ptr)
-@ stdcall EtwEventWriteString(int64 long int64 ptr)
+@ stdcall EtwEventWriteString(int64 long int64 wstr)
@ stdcall EtwEventWriteTransfer(int64 ptr ptr ptr long ptr)
@ stdcall EtwGetTraceEnableFlags(int64)
@ stdcall EtwGetTraceEnableLevel(int64)
@@ -594,7 +594,7 @@
@ stub RtlDeleteNoSplay
@ stub RtlDeleteOwnersRanges
@ stub RtlDeleteRange
-@ stdcall RtlDeleteRegistryValue(long ptr ptr)
+@ stdcall RtlDeleteRegistryValue(long ptr wstr)
@ stdcall RtlDeleteResource(ptr)
@ stdcall RtlDeleteSecurityObject(ptr)
@ stdcall RtlDeleteTimer(ptr ptr ptr)
@@ -1089,7 +1089,7 @@
@ stdcall RtlWow64IsWowGuestMachineSupported(long ptr)
@ stdcall -arch=win64 RtlWow64SetThreadContext(long ptr)
@ stub RtlWriteMemoryStream
-@ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long)
+@ stdcall RtlWriteRegistryValue(long ptr wstr long ptr long)
@ stub RtlZeroHeap
@ stdcall RtlZeroMemory(ptr long)
@ stdcall RtlZombifyActivationContext(ptr)
--
2.25.1
1
0
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/bcrypt/Makefile.in | 1 -
dlls/bcrypt/bcrypt_main.c | 127 ++++++++++++++++++++------------------
dlls/bcrypt/gnutls.c | 14 ++---
3 files changed, 73 insertions(+), 69 deletions(-)
diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in
index 3396c872df9..9f3510361c4 100644
--- a/dlls/bcrypt/Makefile.in
+++ b/dlls/bcrypt/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = bcrypt.dll
IMPORTS = advapi32
IMPORTLIB = bcrypt
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 6319a26dd4d..9fb9b6adf87 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -39,34 +39,37 @@ static unixlib_handle_t bcrypt_handle;
#define UNIX_CALL( func, params ) __wine_unix_call( bcrypt_handle, unix_ ## func, params )
-NTSTATUS WINAPI BCryptAddContextFunction(ULONG table, LPCWSTR context, ULONG iface, LPCWSTR function, ULONG pos)
+NTSTATUS WINAPI BCryptAddContextFunction( ULONG table, const WCHAR *ctx, ULONG iface, const WCHAR *func, ULONG pos )
{
- FIXME("%08x, %s, %08x, %s, %u: stub\n", table, debugstr_w(context), iface, debugstr_w(function), pos);
+ FIXME( "%#lx, %s, %#lx, %s, %lu: stub\n", table, debugstr_w(ctx), iface, debugstr_w(func), pos );
return STATUS_SUCCESS;
}
-NTSTATUS WINAPI BCryptAddContextFunctionProvider(ULONG table, LPCWSTR context, ULONG iface, LPCWSTR function, LPCWSTR provider, ULONG pos)
+NTSTATUS WINAPI BCryptAddContextFunctionProvider( ULONG table, const WCHAR *ctx, ULONG iface, const WCHAR *func,
+ const WCHAR *provider, ULONG pos )
{
- FIXME("%08x, %s, %08x, %s, %s, %u: stub\n", table, debugstr_w(context), iface, debugstr_w(function), debugstr_w(provider), pos);
+ FIXME( "%#lx, %s, %#lx, %s, %s, %lu: stub\n", table, debugstr_w(ctx), iface, debugstr_w(func),
+ debugstr_w(provider), pos );
return STATUS_SUCCESS;
}
-NTSTATUS WINAPI BCryptRemoveContextFunction(ULONG table, LPCWSTR context, ULONG iface, LPCWSTR function)
+NTSTATUS WINAPI BCryptRemoveContextFunction( ULONG table, const WCHAR *ctx, ULONG iface, const WCHAR *func )
{
- FIXME("%08x, %s, %08x, %s: stub\n", table, debugstr_w(context), iface, debugstr_w(function));
+ FIXME( "%#lx, %s, %#lx, %s: stub\n", table, debugstr_w(ctx), iface, debugstr_w(func) );
return STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS WINAPI BCryptRemoveContextFunctionProvider(ULONG table, LPCWSTR context, ULONG iface, LPCWSTR function, LPCWSTR provider)
+NTSTATUS WINAPI BCryptRemoveContextFunctionProvider( ULONG table, const WCHAR *ctx, ULONG iface, const WCHAR *func,
+ const WCHAR *provider )
{
- FIXME("%08x, %s, %08x, %s, %s: stub\n", table, debugstr_w(context), iface, debugstr_w(function), debugstr_w(provider));
+ FIXME( "%#lx, %s, %#lx, %s, %s: stub\n", table, debugstr_w(ctx), iface, debugstr_w(func), debugstr_w(provider) );
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS WINAPI BCryptEnumContextFunctions( ULONG table, const WCHAR *ctx, ULONG iface, ULONG *buflen,
CRYPT_CONTEXT_FUNCTIONS **buffer )
{
- FIXME( "%u, %s, %u, %p, %p\n", table, debugstr_w(ctx), iface, buflen, buffer );
+ FIXME( "%#lx, %s, %#lx, %p, %p\n", table, debugstr_w(ctx), iface, buflen, buffer );
return STATUS_NOT_IMPLEMENTED;
}
@@ -75,15 +78,15 @@ void WINAPI BCryptFreeBuffer( void *buffer )
FIXME( "%p\n", buffer );
}
-NTSTATUS WINAPI BCryptRegisterProvider(LPCWSTR provider, ULONG flags, PCRYPT_PROVIDER_REG reg)
+NTSTATUS WINAPI BCryptRegisterProvider( const WCHAR *provider, ULONG flags, CRYPT_PROVIDER_REG *reg )
{
- FIXME("%s, %08x, %p: stub\n", debugstr_w(provider), flags, reg);
+ FIXME( "%s, %#lx, %p: stub\n", debugstr_w(provider), flags, reg );
return STATUS_SUCCESS;
}
-NTSTATUS WINAPI BCryptUnregisterProvider(LPCWSTR provider)
+NTSTATUS WINAPI BCryptUnregisterProvider( const WCHAR *provider )
{
- FIXME("%s: stub\n", debugstr_w(provider));
+ FIXME( "%s: stub\n", debugstr_w(provider) );
return STATUS_NOT_IMPLEMENTED;
}
@@ -146,7 +149,7 @@ NTSTATUS WINAPI BCryptEnumAlgorithms( ULONG type, ULONG *ret_count, BCRYPT_ALGOR
BCRYPT_ALGORITHM_IDENTIFIER *list;
ULONG i, count = 0;
- TRACE( "%08x, %p, %p, %08x\n", type, ret_count, ret_list, flags );
+ TRACE( "%#lx, %p, %p, %#lx\n", type, ret_count, ret_list, flags );
if (!ret_count || !ret_list || (type & ~supported)) return STATUS_INVALID_PARAMETER;
@@ -175,7 +178,7 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG c
const DWORD supported_flags = BCRYPT_USE_SYSTEM_PREFERRED_RNG;
struct algorithm *algorithm = handle;
- TRACE("%p, %p, %u, %08x - semi-stub\n", handle, buffer, count, flags);
+ TRACE("%p, %p, %lu, %#lx - semi-stub\n", handle, buffer, count, flags);
if (!algorithm)
{
@@ -192,7 +195,7 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG c
return STATUS_INVALID_PARAMETER;
if (flags & ~supported_flags)
- FIXME("unsupported flags %08x\n", flags & ~supported_flags);
+ FIXME("unsupported flags %#lx\n", flags & ~supported_flags);
if (algorithm)
FIXME("ignoring selected algorithm\n");
@@ -211,19 +214,20 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG c
return STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR id, LPCWSTR implementation, DWORD flags )
+NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, const WCHAR *id, const WCHAR *implementation,
+ DWORD flags )
{
const DWORD supported_flags = BCRYPT_ALG_HANDLE_HMAC_FLAG | BCRYPT_HASH_REUSABLE_FLAG;
struct algorithm *alg;
enum alg_id alg_id;
ULONG i;
- TRACE( "%p, %s, %s, %08x\n", handle, wine_dbgstr_w(id), wine_dbgstr_w(implementation), flags );
+ TRACE( "%p, %s, %s, %#lx\n", handle, wine_dbgstr_w(id), wine_dbgstr_w(implementation), flags );
if (!handle || !id) return STATUS_INVALID_PARAMETER;
if (flags & ~supported_flags)
{
- FIXME( "unsupported flags %08x\n", flags & ~supported_flags);
+ FIXME( "unsupported flags %#lx\n", flags & ~supported_flags );
return STATUS_NOT_IMPLEMENTED;
}
@@ -261,7 +265,7 @@ NTSTATUS WINAPI BCryptCloseAlgorithmProvider( BCRYPT_ALG_HANDLE handle, DWORD fl
{
struct algorithm *alg = handle;
- TRACE( "%p, %08x\n", handle, flags );
+ TRACE( "%p, %#lx\n", handle, flags );
if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE;
alg->hdr.magic = 0;
@@ -729,11 +733,12 @@ static NTSTATUS get_key_property( const struct key *key, const WCHAR *prop, UCHA
}
}
-NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *buffer, ULONG count, ULONG *res, ULONG flags )
+NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, const WCHAR *prop, UCHAR *buffer, ULONG count, ULONG *res,
+ ULONG flags )
{
struct object *object = handle;
- TRACE( "%p, %s, %p, %u, %p, %08x\n", handle, wine_dbgstr_w(prop), buffer, count, res, flags );
+ TRACE( "%p, %s, %p, %lu, %p, %#lx\n", handle, wine_dbgstr_w(prop), buffer, count, res, flags );
if (!object) return STATUS_INVALID_HANDLE;
if (!prop || !res) return STATUS_INVALID_PARAMETER;
@@ -756,7 +761,7 @@ NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *bu
return get_hash_property( hash, prop, buffer, count, res );
}
default:
- WARN( "unknown magic %08x\n", object->magic );
+ WARN( "unknown magic %#lx\n", object->magic );
return STATUS_INVALID_HANDLE;
}
}
@@ -829,11 +834,10 @@ NTSTATUS WINAPI BCryptCreateHash( BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDL
struct hash *hash;
NTSTATUS status;
- TRACE( "%p, %p, %p, %u, %p, %u, %08x\n", algorithm, handle, object, object_len,
- secret, secret_len, flags );
+ TRACE( "%p, %p, %p, %lu, %p, %lu, %#lx\n", algorithm, handle, object, object_len, secret, secret_len, flags );
if (flags & ~BCRYPT_HASH_REUSABLE_FLAG)
{
- FIXME( "unimplemented flags %08x\n", flags );
+ FIXME( "unimplemented flags %#lx\n", flags );
return STATUS_NOT_IMPLEMENTED;
}
@@ -851,7 +855,7 @@ NTSTATUS WINAPI BCryptDuplicateHash( BCRYPT_HASH_HANDLE handle, BCRYPT_HASH_HAND
struct hash *hash_orig = handle;
struct hash *hash_copy;
- TRACE( "%p, %p, %p, %u, %u\n", handle, handle_copy, object, objectlen, flags );
+ TRACE( "%p, %p, %p, %lu, %#lx\n", handle, handle_copy, object, objectlen, flags );
if (!hash_orig || hash_orig->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
if (!handle_copy) return STATUS_INVALID_PARAMETER;
@@ -894,7 +898,7 @@ NTSTATUS WINAPI BCryptHashData( BCRYPT_HASH_HANDLE handle, UCHAR *input, ULONG s
{
struct hash *hash = handle;
- TRACE( "%p, %p, %u, %08x\n", handle, input, size, flags );
+ TRACE( "%p, %p, %lu, %#lx\n", handle, input, size, flags );
if (!hash || hash->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
if (!input) return STATUS_SUCCESS;
@@ -928,7 +932,7 @@ NTSTATUS WINAPI BCryptFinishHash( BCRYPT_HASH_HANDLE handle, UCHAR *output, ULON
{
struct hash *hash = handle;
- TRACE( "%p, %p, %u, %08x\n", handle, output, size, flags );
+ TRACE( "%p, %p, %lu, %#lx\n", handle, output, size, flags );
if (!hash || hash->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
if (!output) return STATUS_INVALID_PARAMETER;
@@ -943,7 +947,7 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
struct hash *hash;
NTSTATUS status;
- TRACE( "%p, %p, %u, %p, %u, %p, %u\n", algorithm, secret, secret_len, input, input_len, output, output_len );
+ TRACE( "%p, %p, %lu, %p, %lu, %p, %lu\n", algorithm, secret, secret_len, input, input_len, output, output_len );
if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE;
@@ -1037,7 +1041,7 @@ static NTSTATUS key_import( BCRYPT_ALG_HANDLE algorithm, const WCHAR *type, BCRY
if (header->dwMagic != BCRYPT_KEY_DATA_BLOB_MAGIC) return STATUS_INVALID_PARAMETER;
if (header->dwVersion != BCRYPT_KEY_DATA_BLOB_VERSION1)
{
- FIXME( "unknown key data blob version %u\n", header->dwVersion );
+ FIXME( "unknown key data blob version %lu\n", header->dwVersion );
return STATUS_INVALID_PARAMETER;
}
len = header->cbKeyData;
@@ -1533,7 +1537,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
ULONG block_size, size;
struct key *key;
- TRACE( "%p, %p, %p, %u, %p, %u, %08x\n", algorithm, handle, object, object_len, secret, secret_len, flags );
+ TRACE( "%p, %p, %p, %lu, %p, %lu, %#lx\n", algorithm, handle, object, object_len, secret, secret_len, flags );
if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE;
if (object) FIXME( "ignoring object buffer\n" );
@@ -1550,17 +1554,17 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
{
if (secret_len > (size = key_lengths.dwMaxLength / 8))
{
- WARN( "secret_len %u exceeds key max length %u, setting to maximum.\n", secret_len, size );
+ WARN( "secret_len %lu exceeds key max length %lu, setting to maximum\n", secret_len, size );
secret_len = size;
}
else if (secret_len < (size = key_lengths.dwMinLength / 8))
{
- WARN( "secret_len %u is less than minimum key length %u.\n", secret_len, size );
+ WARN( "secret_len %lu is less than minimum key length %lu\n", secret_len, size );
return STATUS_INVALID_PARAMETER;
}
else if (key_lengths.dwIncrement && (secret_len * 8 - key_lengths.dwMinLength) % key_lengths.dwIncrement)
{
- WARN( "secret_len %u is not a valid key length.\n", secret_len );
+ WARN( "secret_len %lu is not a valid key length\n", secret_len );
return STATUS_INVALID_PARAMETER;
}
}
@@ -1592,7 +1596,7 @@ NTSTATUS WINAPI BCryptGenerateKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_H
NTSTATUS status;
ULONG size;
- TRACE( "%p, %p, %u, %08x\n", algorithm, handle, key_len, flags );
+ TRACE( "%p, %p, %lu, %#lx\n", algorithm, handle, key_len, flags );
if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE;
if (!handle) return STATUS_INVALID_PARAMETER;
@@ -1626,20 +1630,20 @@ NTSTATUS WINAPI BCryptFinalizeKeyPair( BCRYPT_KEY_HANDLE handle, ULONG flags )
{
struct key *key = handle;
- TRACE( "%p, %08x\n", key, flags );
+ TRACE( "%p, %#lx\n", key, flags );
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
return UNIX_CALL( key_asymmetric_generate, key );
}
-NTSTATUS WINAPI BCryptImportKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE decrypt_key, LPCWSTR type,
- BCRYPT_KEY_HANDLE *key, PUCHAR object, ULONG object_len, PUCHAR input,
+NTSTATUS WINAPI BCryptImportKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE decrypt_key, const WCHAR *type,
+ BCRYPT_KEY_HANDLE *key, UCHAR *object, ULONG object_len, UCHAR *input,
ULONG input_len, ULONG flags )
{
struct algorithm *alg = algorithm;
- TRACE("%p, %p, %s, %p, %p, %u, %p, %u, %u\n", algorithm, decrypt_key, debugstr_w(type), key, object,
- object_len, input, input_len, flags);
+ TRACE( "%p, %p, %s, %p, %p, %lu, %p, %lu, %#lx\n", algorithm, decrypt_key, debugstr_w(type), key, object,
+ object_len, input, input_len, flags );
if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE;
if (!key || !type || !input) return STATUS_INVALID_PARAMETER;
@@ -1653,12 +1657,12 @@ NTSTATUS WINAPI BCryptImportKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE
return key_import( algorithm, type, key, object, object_len, input, input_len );
}
-NTSTATUS WINAPI BCryptExportKey( BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE encrypt_key, LPCWSTR type,
- PUCHAR output, ULONG output_len, ULONG *size, ULONG flags )
+NTSTATUS WINAPI BCryptExportKey( BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE encrypt_key, const WCHAR *type,
+ UCHAR *output, ULONG output_len, ULONG *size, ULONG flags )
{
struct key *key = export_key;
- TRACE("%p, %p, %s, %p, %u, %p, %u\n", key, encrypt_key, debugstr_w(type), output, output_len, size, flags);
+ TRACE( "%p, %p, %s, %p, %lu, %p, %#lx\n", key, encrypt_key, debugstr_w(type), output, output_len, size, flags );
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
if (!type || !size) return STATUS_INVALID_PARAMETER;
@@ -1738,7 +1742,7 @@ NTSTATUS WINAPI BCryptDuplicateKey( BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE
struct key *key_copy;
NTSTATUS status;
- TRACE( "%p, %p, %p, %u, %08x\n", handle, handle_copy, object, object_len, flags );
+ TRACE( "%p, %p, %p, %lu, %#lx\n", handle, handle_copy, object, object_len, flags );
if (object) FIXME( "ignoring object buffer\n" );
if (!key_orig || key_orig->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
@@ -1760,7 +1764,7 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
{
struct algorithm *alg = algorithm;
- TRACE( "%p, %p, %s, %p, %p, %u, %08x\n", algorithm, decrypt_key, debugstr_w(type), ret_key, input,
+ TRACE( "%p, %p, %s, %p, %p, %lu, %#lx\n", algorithm, decrypt_key, debugstr_w(type), ret_key, input,
input_len, flags );
if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE;
@@ -1780,7 +1784,7 @@ NTSTATUS WINAPI BCryptSignHash( BCRYPT_KEY_HANDLE handle, void *padding, UCHAR *
struct key_asymmetric_sign_params params;
struct key *key = handle;
- TRACE( "%p, %p, %p, %u, %p, %u, %p, %08x\n", handle, padding, input, input_len, output, output_len,
+ TRACE( "%p, %p, %p, %lu, %p, %lu, %p, %#lx\n", handle, padding, input, input_len, output, output_len,
ret_len, flags );
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
@@ -1807,7 +1811,7 @@ NTSTATUS WINAPI BCryptVerifySignature( BCRYPT_KEY_HANDLE handle, void *padding,
struct key_asymmetric_verify_params params;
struct key *key = handle;
- TRACE( "%p, %p, %p, %u, %p, %u, %08x\n", handle, padding, hash, hash_len, signature, signature_len, flags );
+ TRACE( "%p, %p, %p, %lu, %p, %lu, %#lx\n", handle, padding, hash, hash_len, signature, signature_len, flags );
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
if (!hash || !hash_len || !signature || !signature_len) return STATUS_INVALID_PARAMETER;
@@ -1841,7 +1845,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
struct key *key = handle;
NTSTATUS ret;
- TRACE( "%p, %p, %u, %p, %p, %u, %p, %u, %p, %08x\n", handle, input, input_len, padding, iv, iv_len, output,
+ TRACE( "%p, %p, %lu, %p, %p, %lu, %p, %lu, %p, %#lx\n", handle, input, input_len, padding, iv, iv_len, output,
output_len, ret_len, flags );
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
@@ -1852,7 +1856,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
}
if (flags & ~BCRYPT_BLOCK_PADDING)
{
- FIXME( "flags %08x not implemented\n", flags );
+ FIXME( "flags %#lx not implemented\n", flags );
return STATUS_NOT_IMPLEMENTED;
}
@@ -1868,13 +1872,13 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
struct key_asymmetric_decrypt_params params;
struct key *key = handle;
- TRACE( "%p, %p, %u, %p, %p, %u, %p, %u, %p, %08x\n", handle, input, input_len, padding, iv, iv_len, output,
+ TRACE( "%p, %p, %lu, %p, %p, %lu, %p, %lu, %p, %#lx\n", handle, input, input_len, padding, iv, iv_len, output,
output_len, ret_len, flags );
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
if (flags & ~BCRYPT_BLOCK_PADDING)
{
- FIXME( "flags %08x not supported\n", flags );
+ FIXME( "flags %#lx not supported\n", flags );
return STATUS_NOT_IMPLEMENTED;
}
@@ -1900,7 +1904,7 @@ NTSTATUS WINAPI BCryptSetProperty( BCRYPT_HANDLE handle, const WCHAR *prop, UCHA
{
struct object *object = handle;
- TRACE( "%p, %s, %p, %u, %08x\n", handle, debugstr_w(prop), value, size, flags );
+ TRACE( "%p, %s, %p, %lu, %#lx\n", handle, debugstr_w(prop), value, size, flags );
if (!object) return STATUS_INVALID_HANDLE;
@@ -1917,7 +1921,7 @@ NTSTATUS WINAPI BCryptSetProperty( BCRYPT_HANDLE handle, const WCHAR *prop, UCHA
return set_key_property( key, prop, value, size, flags );
}
default:
- WARN( "unknown magic %08x\n", object->magic );
+ WARN( "unknown magic %#lx\n", object->magic );
return STATUS_INVALID_HANDLE;
}
}
@@ -1930,7 +1934,7 @@ NTSTATUS WINAPI BCryptDeriveKeyCapi( BCRYPT_HASH_HANDLE handle, BCRYPT_ALG_HANDL
NTSTATUS status;
ULONG len;
- TRACE( "%p, %p, %p, %u, %08x\n", handle, halg, key, keylen, flags );
+ TRACE( "%p, %p, %p, %lu, %#lx\n", handle, halg, key, keylen, flags );
if (!key || !keylen) return STATUS_INVALID_PARAMETER;
if (!hash || hash->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
@@ -2025,7 +2029,7 @@ NTSTATUS WINAPI BCryptDeriveKeyPBKDF2( BCRYPT_ALG_HANDLE handle, UCHAR *pwd, ULO
UCHAR *partial;
NTSTATUS status;
- TRACE( "%p, %p, %u, %p, %u, %s, %p, %u, %08x\n", handle, pwd, pwd_len, salt, salt_len,
+ TRACE( "%p, %p, %lu, %p, %lu, %s, %p, %lu, %#lx\n", handle, pwd, pwd_len, salt, salt_len,
wine_dbgstr_longlong(iterations), dk, dk_len, flags );
if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE;
@@ -2068,13 +2072,14 @@ NTSTATUS WINAPI BCryptDeriveKeyPBKDF2( BCRYPT_ALG_HANDLE handle, UCHAR *pwd, ULO
return STATUS_SUCCESS;
}
-NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_HANDLE publickey, BCRYPT_SECRET_HANDLE *handle, ULONG flags)
+NTSTATUS WINAPI BCryptSecretAgreement( BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_HANDLE publickey,
+ BCRYPT_SECRET_HANDLE *handle, ULONG flags )
{
struct key *privkey = privatekey;
struct key *pubkey = publickey;
struct secret *secret;
- FIXME( "%p, %p, %p, %08x\n", privatekey, publickey, handle, flags );
+ FIXME( "%p, %p, %p, %#lx\n", privatekey, publickey, handle, flags );
if (!privkey || privkey->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
if (!pubkey || pubkey->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
@@ -2099,12 +2104,12 @@ NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE handle)
return STATUS_SUCCESS;
}
-NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCryptBufferDesc *parameter,
- PUCHAR derived, ULONG derived_size, ULONG *result, ULONG flags)
+NTSTATUS WINAPI BCryptDeriveKey( BCRYPT_SECRET_HANDLE handle, const WCHAR *kdf, BCryptBufferDesc *parameter,
+ UCHAR *derived, ULONG derived_size, ULONG *result, ULONG flags )
{
struct secret *secret = handle;
- FIXME( "%p, %s, %p, %p, %d, %p, %08x\n", secret, debugstr_w(kdf), parameter, derived, derived_size, result, flags );
+ FIXME( "%p, %s, %p, %p, %lu, %p, %#lx\n", secret, debugstr_w(kdf), parameter, derived, derived_size, result, flags );
if (!secret || secret->hdr.magic != MAGIC_SECRET) return STATUS_INVALID_HANDLE;
if (!kdf) return STATUS_INVALID_PARAMETER;
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
index 56479197bf5..e1b32be32a4 100644
--- a/dlls/bcrypt/gnutls.c
+++ b/dlls/bcrypt/gnutls.c
@@ -688,7 +688,7 @@ static NTSTATUS export_gnutls_pubkey_ecc( gnutls_privkey_t gnutls_key, enum alg_
if (*pubkey_len < sizeof(*ecc_blob) + size * 2)
{
- FIXME( "wrong pubkey len %u / %u\n", *pubkey_len, (ULONG)sizeof(*ecc_blob) + size * 2 );
+ FIXME( "wrong pubkey len %u / %lu\n", *pubkey_len, sizeof(*ecc_blob) + size * 2 );
pgnutls_perror( ret );
free( x.data ); free( y.data );
return STATUS_BUFFER_TOO_SMALL;
@@ -730,7 +730,7 @@ static NTSTATUS export_gnutls_pubkey_dsa( gnutls_privkey_t gnutls_key, ULONG bit
if (*pubkey_len < sizeof(*dsa_blob) + bitlen / 8 * 3)
{
- FIXME( "wrong pubkey len %u / %u\n", *pubkey_len, (ULONG)sizeof(*dsa_blob) + bitlen / 8 * 3 );
+ FIXME( "wrong pubkey len %u / %lu\n", *pubkey_len, sizeof(*dsa_blob) + bitlen / 8 * 3 );
pgnutls_perror( ret );
free( p.data ); free( q.data ); free( g.data ); free( y.data );
return STATUS_NO_MEMORY;
@@ -1506,7 +1506,7 @@ static NTSTATUS key_asymmetric_verify( void *args )
case ALG_ID_ECDSA_P256:
case ALG_ID_ECDSA_P384:
{
- if (flags) FIXME( "flags %08x not supported\n", flags );
+ if (flags) FIXME( "flags %#x not supported\n", flags );
/* only the hash size must match, not the actual hash function */
switch (params->hash_len)
@@ -1540,7 +1540,7 @@ static NTSTATUS key_asymmetric_verify( void *args )
}
case ALG_ID_DSA:
{
- if (flags) FIXME( "flags %08x not supported\n", flags );
+ if (flags) FIXME( "flags %#x not supported\n", flags );
if (params->hash_len != 20)
{
FIXME( "hash size %u not supported\n", params->hash_len );
@@ -1674,7 +1674,7 @@ static NTSTATUS key_asymmetric_sign( void *args )
}
else if (key->alg_id == ALG_ID_DSA)
{
- if (flags) FIXME( "flags %08x not supported\n", flags );
+ if (flags) FIXME( "flags %#x not supported\n", flags );
if (params->input_len != 20)
{
FIXME( "hash size %u not supported\n", params->input_len );
@@ -1698,12 +1698,12 @@ static NTSTATUS key_asymmetric_sign( void *args )
}
else if (!flags)
{
- WARN( "invalid flags %08x\n", flags );
+ WARN( "invalid flags %#x\n", flags );
return STATUS_INVALID_PARAMETER;
}
else
{
- FIXME( "flags %08x not implemented\n", flags );
+ FIXME( "flags %#x not implemented\n", flags );
return STATUS_NOT_IMPLEMENTED;
}
--
2.30.2
1
0