Wine-devel
Threads by month
- ----- 2026 -----
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
November 2020
- 73 participants
- 650 discussions
02 Dec '20
Serves as a wrapper of audioconvert, and roughly fills the roll of Windows' CLSID_CResamplerMediaObject to convert audio to the format accepted by the streaming audio renderer.
Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
---
v2: Fix intermediate compile errors.
---
dlls/winegstreamer/Makefile.in | 1 +
dlls/winegstreamer/audioconvert.c | 378 +++++++++++++++++++
dlls/winegstreamer/gst_private.h | 2 +
dlls/winegstreamer/mfplat.c | 77 ++++
dlls/winegstreamer/winegstreamer_classes.idl | 6 +
5 files changed, 464 insertions(+)
create mode 100644 dlls/winegstreamer/audioconvert.c
diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in
index e578d194f7f..0b3229160b9 100644
--- a/dlls/winegstreamer/Makefile.in
+++ b/dlls/winegstreamer/Makefile.in
@@ -6,6 +6,7 @@ EXTRALIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS)
PARENTSRC = ../strmbase
C_SRCS = \
+ audioconvert.c \
filter.c \
gst_cbs.c \
gstdemux.c \
diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
new file mode 100644
index 00000000000..91fa556cb88
--- /dev/null
+++ b/dlls/winegstreamer/audioconvert.c
@@ -0,0 +1,378 @@
+#include "config.h"
+
+#include "gst_private.h"
+
+#include "mfapi.h"
+#include "mferror.h"
+#include "mfidl.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
+
+static const GUID *raw_types[] = {
+ &MFAudioFormat_PCM,
+ &MFAudioFormat_Float,
+};
+
+struct audio_converter
+{
+ IMFTransform IMFTransform_iface;
+ LONG refcount;
+};
+
+static struct audio_converter *impl_audio_converter_from_IMFTransform(IMFTransform *iface)
+{
+ return CONTAINING_RECORD(iface, struct audio_converter, IMFTransform_iface);
+}
+
+static HRESULT WINAPI audio_converter_QueryInterface(IMFTransform *iface, REFIID riid, void **obj)
+{
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
+
+ if (IsEqualIID(riid, &IID_IMFTransform) ||
+ IsEqualIID(riid, &IID_IUnknown))
+ {
+ *obj = iface;
+ IMFTransform_AddRef(iface);
+ return S_OK;
+ }
+
+ WARN("Unsupported %s.\n", debugstr_guid(riid));
+ *obj = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI audio_converter_AddRef(IMFTransform *iface)
+{
+ struct audio_converter *transform = impl_audio_converter_from_IMFTransform(iface);
+ ULONG refcount = InterlockedIncrement(&transform->refcount);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ return refcount;
+}
+
+static ULONG WINAPI audio_converter_Release(IMFTransform *iface)
+{
+ struct audio_converter *transform = impl_audio_converter_from_IMFTransform(iface);
+ ULONG refcount = InterlockedDecrement(&transform->refcount);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ if (!refcount)
+ {
+ heap_free(transform);
+ }
+
+ return refcount;
+}
+
+static HRESULT WINAPI audio_converter_GetStreamLimits(IMFTransform *iface, DWORD *input_minimum, DWORD *input_maximum,
+ DWORD *output_minimum, DWORD *output_maximum)
+{
+ TRACE("%p, %p, %p, %p, %p.\n", iface, input_minimum, input_maximum, output_minimum, output_maximum);
+
+ *input_minimum = *input_maximum = *output_minimum = *output_maximum = 1;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI audio_converter_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs)
+{
+ TRACE("%p, %p, %p.\n", iface, inputs, outputs);
+
+ *inputs = *outputs = 1;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI audio_converter_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs,
+ DWORD output_size, DWORD *outputs)
+{
+ TRACE("%p %u %p %u %p.\n", iface, input_size, inputs, output_size, outputs);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
+{
+ FIXME("%p %u %p.\n", iface, id, info);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
+{
+ FIXME("%p %u %p.\n", iface, id, info);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
+{
+ FIXME("%p, %p.\n", iface, attributes);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
+ IMFAttributes **attributes)
+{
+ FIXME("%p, %u, %p.\n", iface, id, attributes);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
+ IMFAttributes **attributes)
+{
+ FIXME("%p, %u, %p.\n", iface, id, attributes);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_DeleteInputStream(IMFTransform *iface, DWORD id)
+{
+ TRACE("%p, %u.\n", iface, id);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids)
+{
+ TRACE("%p, %u, %p.\n", iface, streams, ids);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
+ IMFMediaType **type)
+{
+ IMFMediaType *ret;
+ HRESULT hr;
+
+ TRACE("%p, %u, %u, %p.\n", iface, id, index, type);
+
+ if (id != 0)
+ return MF_E_INVALIDSTREAMNUMBER;
+
+ if (index >= ARRAY_SIZE(raw_types))
+ return MF_E_NO_MORE_TYPES;
+
+ if (FAILED(hr = MFCreateMediaType(&ret)))
+ return hr;
+
+ if (FAILED(hr = IMFMediaType_SetGUID(ret, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio)))
+ {
+ IMFMediaType_Release(ret);
+ return hr;
+ }
+
+ if (FAILED(hr = IMFMediaType_SetGUID(ret, &MF_MT_SUBTYPE, raw_types[index])))
+ {
+ IMFMediaType_Release(ret);
+ return hr;
+ }
+
+ *type = ret;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI audio_converter_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
+ IMFMediaType **type)
+{
+ IMFMediaType *output_type;
+ HRESULT hr;
+
+ static const DWORD rates[] = {44100, 48000};
+ static const DWORD channel_cnts[] = {1, 2, 6};
+ static const DWORD sizes[] = {16, 24, 32};
+ const GUID *subtype;
+ DWORD rate, channels, bps;
+
+ TRACE("%p, %u, %u, %p.\n", iface, id, index, type);
+
+ if (id != 0)
+ return MF_E_INVALIDSTREAMNUMBER;
+
+ if (index >= (2/*rates*/ * 3/*layouts*/ * 3/*bps PCM*/) + (2 * 3))
+ return MF_E_NO_MORE_TYPES;
+
+ if (FAILED(hr = MFCreateMediaType(&output_type)))
+ return hr;
+
+ if (index < 2 * 3 * 3)
+ {
+ subtype = &MFAudioFormat_PCM;
+ rate = rates[index % 2];
+ channels = channel_cnts[(index / 2) % 3];
+ bps = sizes[(index / (2*3)) % 3];
+ }
+ else
+ {
+ index -= (2 * 3 * 3);
+ subtype = &MFAudioFormat_Float;
+ bps = 32;
+ rate = rates[index % 2];
+ channels = channel_cnts[(index / 2) % 3];
+ }
+
+
+ if (FAILED(hr = IMFMediaType_SetGUID(output_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio)))
+ goto fail;
+ if (FAILED(hr = IMFMediaType_SetGUID(output_type, &MF_MT_SUBTYPE, subtype)))
+ goto fail;
+ if (FAILED(hr = IMFMediaType_SetUINT32(output_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, rate)))
+ goto fail;
+ if (FAILED(hr = IMFMediaType_SetUINT32(output_type, &MF_MT_AUDIO_NUM_CHANNELS, channels)))
+ goto fail;
+ if (FAILED(hr = IMFMediaType_SetUINT32(output_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, bps)))
+ goto fail;
+
+ if (FAILED(hr = IMFMediaType_SetUINT32(output_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, channels * bps / 8)))
+ goto fail;
+ if (FAILED(hr = IMFMediaType_SetUINT32(output_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, rate * channels * bps / 8)))
+ goto fail;
+ if (FAILED(hr = IMFMediaType_SetUINT32(output_type, &MF_MT_AUDIO_CHANNEL_MASK,
+ channels == 1 ? SPEAKER_FRONT_CENTER :
+ channels == 2 ? SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT :
+ /*channels == 6*/ 0x3F)))
+ goto fail;
+ if (FAILED(hr = IMFMediaType_SetUINT32(output_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE)))
+ goto fail;
+
+ *type = output_type;
+
+ return S_OK;
+ fail:
+ IMFMediaType_Release(output_type);
+ return hr;
+}
+
+static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
+{
+ FIXME("%p, %u, %p, %#x.\n", iface, id, type, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
+{
+ FIXME("%p, %u, %p, %#x.\n", iface, id, type, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
+{
+ FIXME("%p, %u, %p.\n", iface, id, type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
+{
+ FIXME("%p, %u, %p.\n", iface, id, type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags)
+{
+ FIXME("%p, %u, %p.\n", iface, id, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_GetOutputStatus(IMFTransform *iface, DWORD *flags)
+{
+ FIXME("%p, %p.\n", iface, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper)
+{
+ FIXME("%p, %s, %s.\n", iface, wine_dbgstr_longlong(lower), wine_dbgstr_longlong(upper));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event)
+{
+ TRACE("%p, %u, %p.\n", iface, id, event);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param)
+{
+ FIXME("%p, %u.\n", iface, message);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI audio_converter_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
+{
+ FIXME("%p, %u, %p, %#x.\n", iface, id, sample, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI audio_converter_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
+ MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status)
+{
+ FIXME("%p, %#x, %u, %p, %p.\n", iface, flags, count, samples, status);
+
+ return E_NOTIMPL;
+}
+
+static const IMFTransformVtbl audio_converter_vtbl =
+{
+ audio_converter_QueryInterface,
+ audio_converter_AddRef,
+ audio_converter_Release,
+ audio_converter_GetStreamLimits,
+ audio_converter_GetStreamCount,
+ audio_converter_GetStreamIDs,
+ audio_converter_GetInputStreamInfo,
+ audio_converter_GetOutputStreamInfo,
+ audio_converter_GetAttributes,
+ audio_converter_GetInputStreamAttributes,
+ audio_converter_GetOutputStreamAttributes,
+ audio_converter_DeleteInputStream,
+ audio_converter_AddInputStreams,
+ audio_converter_GetInputAvailableType,
+ audio_converter_GetOutputAvailableType,
+ audio_converter_SetInputType,
+ audio_converter_SetOutputType,
+ audio_converter_GetInputCurrentType,
+ audio_converter_GetOutputCurrentType,
+ audio_converter_GetInputStatus,
+ audio_converter_GetOutputStatus,
+ audio_converter_SetOutputBounds,
+ audio_converter_ProcessEvent,
+ audio_converter_ProcessMessage,
+ audio_converter_ProcessInput,
+ audio_converter_ProcessOutput,
+};
+
+HRESULT audio_converter_create(REFIID riid, void **ret)
+{
+ struct audio_converter *object;
+ HRESULT hr;
+
+ TRACE("%s %p\n", debugstr_guid(riid), ret);
+
+ if (!(object = heap_alloc_zero(sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ object->IMFTransform_iface.lpVtbl = &audio_converter_vtbl;
+ object->refcount = 1;
+
+ *ret = &object->IMFTransform_iface;
+ return S_OK;
+}
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 28e424439d8..7889c996204 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -84,4 +84,6 @@ IMFSample *mf_sample_from_gst_buffer(GstBuffer *in) DECLSPEC_HIDDEN;
HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN;
+HRESULT audio_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN;
+
#endif /* __GST_PRIVATE_INCLUDED__ */
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 3d224a5accc..909fb8b3572 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -405,6 +405,8 @@ failed:
static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}};
+static GUID CLSID_WINEAudioConverter = {0x6a170414,0xaad9,0x4693,{0xb8,0x06,0x3a,0x0c,0x47,0xc5,0x70,0xd6}};
+
static const struct class_object
{
const GUID *clsid;
@@ -414,6 +416,7 @@ class_objects[] =
{
{ &CLSID_VideoProcessorMFT, &video_processor_create },
{ &CLSID_GStreamerByteStreamHandler, &winegstreamer_stream_handler_create },
+ { &CLSID_WINEAudioConverter, &audio_converter_create },
};
HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj)
@@ -442,6 +445,80 @@ HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj)
return CLASS_E_CLASSNOTAVAILABLE;
}
+static WCHAR audio_converterW[] = {'A','u','d','i','o',' ','C','o','n','v','e','r','t','e','r',0};
+const GUID *audio_converter_supported_types[] =
+{
+ &MFAudioFormat_PCM,
+ &MFAudioFormat_Float,
+};
+
+static const struct mft
+{
+ const GUID *clsid;
+ const GUID *category;
+ LPWSTR name;
+ const UINT32 flags;
+ const GUID *major_type;
+ const UINT32 input_types_count;
+ const GUID **input_types;
+ const UINT32 output_types_count;
+ const GUID **output_types;
+ IMFAttributes *attributes;
+}
+mfts[] =
+{
+ {
+ &CLSID_WINEAudioConverter,
+ &MFT_CATEGORY_AUDIO_EFFECT,
+ audio_converterW,
+ MFT_ENUM_FLAG_SYNCMFT,
+ &MFMediaType_Audio,
+ ARRAY_SIZE(audio_converter_supported_types),
+ audio_converter_supported_types,
+ ARRAY_SIZE(audio_converter_supported_types),
+ audio_converter_supported_types,
+ NULL
+ },
+};
+
+HRESULT mfplat_DllRegisterServer(void)
+{
+ unsigned int i;
+ HRESULT hr;
+
+ for (i = 0; i < ARRAY_SIZE(mfts); i++)
+ {
+ const struct mft *cur = &mfts[i];
+
+ MFT_REGISTER_TYPE_INFO *input_types, *output_types;
+ input_types = heap_alloc(cur->input_types_count * sizeof(input_types[0]));
+ output_types = heap_alloc(cur->output_types_count * sizeof(output_types[0]));
+ for (i = 0; i < cur->input_types_count; i++)
+ {
+ input_types[i].guidMajorType = *(cur->major_type);
+ input_types[i].guidSubtype = *(cur->input_types[i]);
+ }
+ for (i = 0; i < cur->output_types_count; i++)
+ {
+ output_types[i].guidMajorType = *(cur->major_type);
+ output_types[i].guidSubtype = *(cur->output_types[i]);
+ }
+
+ hr = MFTRegister(*(cur->clsid), *(cur->category), cur->name, cur->flags, cur->input_types_count,
+ input_types, cur->output_types_count, output_types, cur->attributes);
+
+ heap_free(input_types);
+ heap_free(output_types);
+
+ if (FAILED(hr))
+ {
+ FIXME("Failed to register MFT, hr %#x\n", hr);
+ return hr;
+ }
+ }
+ return S_OK;
+}
+
static const struct
{
const GUID *subtype;
diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl
index 1dc4ba9a10b..cf1fc69f38a 100644
--- a/dlls/winegstreamer/winegstreamer_classes.idl
+++ b/dlls/winegstreamer/winegstreamer_classes.idl
@@ -61,3 +61,9 @@ coclass VideoProcessorMFT {}
uuid(317df618-5e5a-468a-9f15-d827a9a08162)
]
coclass GStreamerByteStreamHandler {}
+
+[
+ threading(both),
+ uuid(6a170414-aad9-4693-b806-3a0c47c570d6)
+]
+coclass WINEAudioConverter { }
--
2.29.2
2
25
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/windowscodecs/info.c | 172 +++++++++++++--------------------
dlls/windowscodecs/pngformat.c | 21 ++--
2 files changed, 75 insertions(+), 118 deletions(-)
diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
index 34e14087f94..db6d25b46b3 100644
--- a/dlls/windowscodecs/info.c
+++ b/dlls/windowscodecs/info.c
@@ -35,26 +35,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
-static const WCHAR mimetypes_valuename[] = {'M','i','m','e','T','y','p','e','s',0};
-static const WCHAR author_valuename[] = {'A','u','t','h','o','r',0};
-static const WCHAR friendlyname_valuename[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
-static const WCHAR pixelformats_keyname[] = {'P','i','x','e','l','F','o','r','m','a','t','s',0};
-static const WCHAR formats_keyname[] = {'F','o','r','m','a','t','s',0};
-static const WCHAR containerformat_valuename[] = {'C','o','n','t','a','i','n','e','r','F','o','r','m','a','t',0};
-static const WCHAR metadataformat_valuename[] = {'M','e','t','a','d','a','t','a','F','o','r','m','a','t',0};
-static const WCHAR vendor_valuename[] = {'V','e','n','d','o','r',0};
-static const WCHAR version_valuename[] = {'V','e','r','s','i','o','n',0};
-static const WCHAR specversion_valuename[] = {'S','p','e','c','V','e','r','s','i','o','n',0};
-static const WCHAR bitsperpixel_valuename[] = {'B','i','t','L','e','n','g','t','h',0};
-static const WCHAR channelcount_valuename[] = {'C','h','a','n','n','e','l','C','o','u','n','t',0};
-static const WCHAR channelmasks_keyname[] = {'C','h','a','n','n','e','l','M','a','s','k','s',0};
-static const WCHAR numericrepresentation_valuename[] = {'N','u','m','e','r','i','c','R','e','p','r','e','s','e','n','t','a','t','i','o','n',0};
-static const WCHAR supportstransparency_valuename[] = {'S','u','p','p','o','r','t','s','T','r','a','n','s','p','a','r','e','n','c','y',0};
-static const WCHAR requiresfullstream_valuename[] = {'R','e','q','u','i','r','e','s','F','u','l','l','S','t','r','e','a','m',0};
-static const WCHAR supportspadding_valuename[] = {'S','u','p','p','o','r','t','s','P','a','d','d','i','n','g',0};
-static const WCHAR fileextensions_valuename[] = {'F','i','l','e','E','x','t','e','n','s','i','o','n','s',0};
-static const WCHAR containers_keyname[] = {'C','o','n','t','a','i','n','e','r','s',0};
-
typedef struct {
IWICComponentInfo IWICComponentInfo_iface;
LONG ref;
@@ -308,8 +288,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetAuthor(IWICBitmapDecoderInfo *iface,
TRACE("(%p,%u,%p,%p)\n", iface, cchAuthor, wzAuthor, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- cchAuthor, wzAuthor, pcchActual);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", cchAuthor, wzAuthor, pcchActual);
}
static HRESULT WINAPI BitmapDecoderInfo_GetVendorGUID(IWICBitmapDecoderInfo *iface, GUID *pguidVendor)
@@ -318,7 +297,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetVendorGUID(IWICBitmapDecoderInfo *ifa
TRACE("(%p,%p)\n", iface, pguidVendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, pguidVendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", pguidVendor);
}
static HRESULT WINAPI BitmapDecoderInfo_GetVersion(IWICBitmapDecoderInfo *iface, UINT cchVersion,
@@ -328,7 +307,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetVersion(IWICBitmapDecoderInfo *iface,
TRACE("(%p,%u,%p,%p)\n", iface, cchVersion, wzVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"Version",
cchVersion, wzVersion, pcchActual);
}
@@ -339,7 +318,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetSpecVersion(IWICBitmapDecoderInfo *if
TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
cchSpecVersion, wzSpecVersion, pcchActual);
}
@@ -350,7 +329,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetFriendlyName(IWICBitmapDecoderInfo *i
TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
cchFriendlyName, wzFriendlyName, pcchActual);
}
@@ -359,7 +338,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetContainerFormat(IWICBitmapDecoderInfo
{
BitmapDecoderInfo *This = impl_from_IWICBitmapDecoderInfo(iface);
TRACE("(%p,%p)\n", iface, pguidContainerFormat);
- return ComponentInfo_GetGUIDValue(This->classkey, containerformat_valuename, pguidContainerFormat);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"ContainerFormat", pguidContainerFormat);
}
static HRESULT WINAPI BitmapDecoderInfo_GetPixelFormats(IWICBitmapDecoderInfo *iface,
@@ -367,7 +346,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetPixelFormats(IWICBitmapDecoderInfo *i
{
BitmapDecoderInfo *This = impl_from_IWICBitmapDecoderInfo(iface);
TRACE("(%p,%u,%p,%p)\n", iface, cFormats, pguidPixelFormats, pcActual);
- return ComponentInfo_GetGuidList(This->classkey, formats_keyname, cFormats, pguidPixelFormats, pcActual);
+ return ComponentInfo_GetGuidList(This->classkey, L"Formats", cFormats, pguidPixelFormats, pcActual);
}
static HRESULT WINAPI BitmapDecoderInfo_GetColorManagementVersion(IWICBitmapDecoderInfo *iface,
@@ -398,7 +377,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetMimeTypes(IWICBitmapDecoderInfo *ifac
TRACE("(%p,%u,%p,%p)\n", iface, cchMimeTypes, wzMimeTypes, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, mimetypes_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"MimeTypes",
cchMimeTypes, wzMimeTypes, pcchActual);
}
@@ -409,7 +388,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetFileExtensions(IWICBitmapDecoderInfo
TRACE("(%p,%u,%p,%p)\n", iface, cchFileExtensions, wzFileExtensions, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, fileextensions_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FileExtensions",
cchFileExtensions, wzFileExtensions, pcchActual);
}
@@ -577,19 +556,12 @@ static void read_bitmap_patterns(BitmapDecoderInfo *info)
WCHAR subkeyname[11];
LONG res;
HKEY patternskey, patternkey;
- static const WCHAR uintformatW[] = {'%','u',0};
- static const WCHAR patternsW[] = {'P','a','t','t','e','r','n','s',0};
- static const WCHAR positionW[] = {'P','o','s','i','t','i','o','n',0};
- static const WCHAR lengthW[] = {'L','e','n','g','t','h',0};
- static const WCHAR patternW[] = {'P','a','t','t','e','r','n',0};
- static const WCHAR maskW[] = {'M','a','s','k',0};
- static const WCHAR endofstreamW[] = {'E','n','d','O','f','S','t','r','e','a','m',0};
UINT i;
WICBitmapPattern *patterns;
BYTE *patterns_ptr;
DWORD length, valuesize;
- res = RegOpenKeyExW(info->classkey, patternsW, 0, KEY_READ, &patternskey);
+ res = RegOpenKeyExW(info->classkey, L"Patterns", 0, KEY_READ, &patternskey);
if (res != ERROR_SUCCESS) return;
res = RegQueryInfoKeyW(patternskey, NULL, NULL, NULL, &pattern_count, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -609,25 +581,25 @@ static void read_bitmap_patterns(BitmapDecoderInfo *info)
for (i=0; res == ERROR_SUCCESS && i < pattern_count; i++)
{
- swprintf(subkeyname, 11, uintformatW, i);
+ swprintf(subkeyname, 11, L"%u", i);
res = RegOpenKeyExW(patternskey, subkeyname, 0, KEY_READ, &patternkey);
if (res != ERROR_SUCCESS) break;
valuesize = sizeof(ULONG);
- res = RegGetValueW(patternkey, NULL, lengthW, RRF_RT_DWORD, NULL, &length, &valuesize);
+ res = RegGetValueW(patternkey, NULL, L"Length", RRF_RT_DWORD, NULL, &length, &valuesize);
if (res == ERROR_SUCCESS)
{
patterns_size += length*2;
patterns[i].Length = length;
valuesize = sizeof(BOOL);
- res = RegGetValueW(patternkey, NULL, endofstreamW, RRF_RT_DWORD, NULL,
+ res = RegGetValueW(patternkey, NULL, L"EndOfStream", RRF_RT_DWORD, NULL,
&patterns[i].EndOfStream, &valuesize);
if (res) patterns[i].EndOfStream = 0;
patterns[i].Position.QuadPart = 0;
valuesize = sizeof(ULARGE_INTEGER);
- res = RegGetValueW(patternkey, NULL, positionW, RRF_RT_DWORD|RRF_RT_QWORD, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Position", RRF_RT_DWORD|RRF_RT_QWORD, NULL,
&patterns[i].Position, &valuesize);
}
@@ -645,14 +617,14 @@ static void read_bitmap_patterns(BitmapDecoderInfo *info)
for (i=0; res == ERROR_SUCCESS && i < pattern_count; i++)
{
- swprintf(subkeyname, 11, uintformatW, i);
+ swprintf(subkeyname, 11, L"%u", i);
res = RegOpenKeyExW(patternskey, subkeyname, 0, KEY_READ, &patternkey);
if (res != ERROR_SUCCESS) break;
length = patterns[i].Length;
patterns[i].Pattern = patterns_ptr;
valuesize = length;
- res = RegGetValueW(patternkey, NULL, patternW, RRF_RT_REG_BINARY, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Pattern", RRF_RT_REG_BINARY, NULL,
patterns[i].Pattern, &valuesize);
patterns_ptr += length;
@@ -660,7 +632,7 @@ static void read_bitmap_patterns(BitmapDecoderInfo *info)
{
patterns[i].Mask = patterns_ptr;
valuesize = length;
- res = RegGetValueW(patternkey, NULL, maskW, RRF_RT_REG_BINARY, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Mask", RRF_RT_REG_BINARY, NULL,
patterns[i].Mask, &valuesize);
patterns_ptr += length;
}
@@ -798,8 +770,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetAuthor(IWICBitmapEncoderInfo *iface,
TRACE("(%p,%u,%p,%p)\n", iface, cchAuthor, wzAuthor, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- cchAuthor, wzAuthor, pcchActual);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", cchAuthor, wzAuthor, pcchActual);
}
static HRESULT WINAPI BitmapEncoderInfo_GetVendorGUID(IWICBitmapEncoderInfo *iface, GUID *pguidVendor)
@@ -808,7 +779,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetVendorGUID(IWICBitmapEncoderInfo *ifa
TRACE("(%p,%p)\n", iface, pguidVendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, pguidVendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", pguidVendor);
}
static HRESULT WINAPI BitmapEncoderInfo_GetVersion(IWICBitmapEncoderInfo *iface, UINT cchVersion,
@@ -818,7 +789,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetVersion(IWICBitmapEncoderInfo *iface,
TRACE("(%p,%u,%p,%p)\n", iface, cchVersion, wzVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"Version",
cchVersion, wzVersion, pcchActual);
}
@@ -829,7 +800,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetSpecVersion(IWICBitmapEncoderInfo *if
TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
cchSpecVersion, wzSpecVersion, pcchActual);
}
@@ -840,7 +811,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetFriendlyName(IWICBitmapEncoderInfo *i
TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
cchFriendlyName, wzFriendlyName, pcchActual);
}
@@ -849,7 +820,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetContainerFormat(IWICBitmapEncoderInfo
{
BitmapEncoderInfo *This = impl_from_IWICBitmapEncoderInfo(iface);
TRACE("(%p,%p)\n", iface, pguidContainerFormat);
- return ComponentInfo_GetGUIDValue(This->classkey, containerformat_valuename, pguidContainerFormat);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"ContainerFormat", pguidContainerFormat);
}
static HRESULT WINAPI BitmapEncoderInfo_GetPixelFormats(IWICBitmapEncoderInfo *iface,
@@ -857,7 +828,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetPixelFormats(IWICBitmapEncoderInfo *i
{
BitmapEncoderInfo *This = impl_from_IWICBitmapEncoderInfo(iface);
TRACE("(%p,%u,%p,%p)\n", iface, cFormats, pguidPixelFormats, pcActual);
- return ComponentInfo_GetGuidList(This->classkey, formats_keyname, cFormats, pguidPixelFormats, pcActual);
+ return ComponentInfo_GetGuidList(This->classkey, L"Formats", cFormats, pguidPixelFormats, pcActual);
}
static HRESULT WINAPI BitmapEncoderInfo_GetColorManagementVersion(IWICBitmapEncoderInfo *iface,
@@ -888,7 +859,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetMimeTypes(IWICBitmapEncoderInfo *ifac
TRACE("(%p,%u,%p,%p)\n", iface, cchMimeTypes, wzMimeTypes, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, mimetypes_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"MimeTypes",
cchMimeTypes, wzMimeTypes, pcchActual);
}
@@ -899,7 +870,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetFileExtensions(IWICBitmapEncoderInfo
TRACE("(%p,%u,%p,%p)\n", iface, cchFileExtensions, wzFileExtensions, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, fileextensions_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FileExtensions",
cchFileExtensions, wzFileExtensions, pcchActual);
}
@@ -1089,8 +1060,7 @@ static HRESULT WINAPI FormatConverterInfo_GetAuthor(IWICFormatConverterInfo *ifa
TRACE("(%p,%u,%p,%p)\n", iface, cchAuthor, wzAuthor, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- cchAuthor, wzAuthor, pcchActual);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", cchAuthor, wzAuthor, pcchActual);
}
static HRESULT WINAPI FormatConverterInfo_GetVendorGUID(IWICFormatConverterInfo *iface, GUID *pguidVendor)
@@ -1099,7 +1069,7 @@ static HRESULT WINAPI FormatConverterInfo_GetVendorGUID(IWICFormatConverterInfo
TRACE("(%p,%p)\n", iface, pguidVendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, pguidVendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", pguidVendor);
}
static HRESULT WINAPI FormatConverterInfo_GetVersion(IWICFormatConverterInfo *iface, UINT cchVersion,
@@ -1109,7 +1079,7 @@ static HRESULT WINAPI FormatConverterInfo_GetVersion(IWICFormatConverterInfo *if
TRACE("(%p,%u,%p,%p)\n", iface, cchVersion, wzVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"Version",
cchVersion, wzVersion, pcchActual);
}
@@ -1120,7 +1090,7 @@ static HRESULT WINAPI FormatConverterInfo_GetSpecVersion(IWICFormatConverterInfo
TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
cchSpecVersion, wzSpecVersion, pcchActual);
}
@@ -1131,7 +1101,7 @@ static HRESULT WINAPI FormatConverterInfo_GetFriendlyName(IWICFormatConverterInf
TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
cchFriendlyName, wzFriendlyName, pcchActual);
}
@@ -1162,7 +1132,7 @@ static BOOL ConverterSupportsFormat(IWICFormatConverterInfo *iface, const WCHAR
/* Avoid testing using IWICFormatConverter_GetPixelFormats because that
would be O(n). A registry test should do better. */
- res = RegOpenKeyExW(This->classkey, pixelformats_keyname, 0, KEY_READ, &formats_key);
+ res = RegOpenKeyExW(This->classkey, L"PixelFormats", 0, KEY_READ, &formats_key);
if (res != ERROR_SUCCESS) return FALSE;
res = RegOpenKeyExW(formats_key, formatguid, 0, KEY_READ, &guid_key);
@@ -1311,8 +1281,7 @@ static HRESULT WINAPI PixelFormatInfo_GetAuthor(IWICPixelFormatInfo2 *iface, UIN
TRACE("(%p,%u,%p,%p)\n", iface, cchAuthor, wzAuthor, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- cchAuthor, wzAuthor, pcchActual);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", cchAuthor, wzAuthor, pcchActual);
}
static HRESULT WINAPI PixelFormatInfo_GetVendorGUID(IWICPixelFormatInfo2 *iface, GUID *pguidVendor)
@@ -1321,7 +1290,7 @@ static HRESULT WINAPI PixelFormatInfo_GetVendorGUID(IWICPixelFormatInfo2 *iface,
TRACE("(%p,%p)\n", iface, pguidVendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, pguidVendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", pguidVendor);
}
static HRESULT WINAPI PixelFormatInfo_GetVersion(IWICPixelFormatInfo2 *iface, UINT cchVersion,
@@ -1331,7 +1300,7 @@ static HRESULT WINAPI PixelFormatInfo_GetVersion(IWICPixelFormatInfo2 *iface, UI
TRACE("(%p,%u,%p,%p)\n", iface, cchVersion, wzVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"Version",
cchVersion, wzVersion, pcchActual);
}
@@ -1342,7 +1311,7 @@ static HRESULT WINAPI PixelFormatInfo_GetSpecVersion(IWICPixelFormatInfo2 *iface
TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
cchSpecVersion, wzSpecVersion, pcchActual);
}
@@ -1353,7 +1322,7 @@ static HRESULT WINAPI PixelFormatInfo_GetFriendlyName(IWICPixelFormatInfo2 *ifac
TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
cchFriendlyName, wzFriendlyName, pcchActual);
}
@@ -1384,7 +1353,7 @@ static HRESULT WINAPI PixelFormatInfo_GetBitsPerPixel(IWICPixelFormatInfo2 *ifac
TRACE("(%p,%p)\n", iface, puiBitsPerPixel);
- return ComponentInfo_GetDWORDValue(This->classkey, bitsperpixel_valuename, puiBitsPerPixel);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"BitLength", puiBitsPerPixel);
}
static HRESULT WINAPI PixelFormatInfo_GetChannelCount(IWICPixelFormatInfo2 *iface,
@@ -1394,13 +1363,12 @@ static HRESULT WINAPI PixelFormatInfo_GetChannelCount(IWICPixelFormatInfo2 *ifac
TRACE("(%p,%p)\n", iface, puiChannelCount);
- return ComponentInfo_GetDWORDValue(This->classkey, channelcount_valuename, puiChannelCount);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"ChannelCount", puiChannelCount);
}
static HRESULT WINAPI PixelFormatInfo_GetChannelMask(IWICPixelFormatInfo2 *iface,
UINT uiChannelIndex, UINT cbMaskBuffer, BYTE *pbMaskBuffer, UINT *pcbActual)
{
- static const WCHAR uintformatW[] = {'%','u',0};
PixelFormatInfo *This = impl_from_IWICPixelFormatInfo2(iface);
UINT channel_count;
HRESULT hr;
@@ -1420,11 +1388,11 @@ static HRESULT WINAPI PixelFormatInfo_GetChannelMask(IWICPixelFormatInfo2 *iface
if (SUCCEEDED(hr))
{
- swprintf(valuename, 11, uintformatW, uiChannelIndex);
+ swprintf(valuename, 11, L"%u", uiChannelIndex);
cbData = cbMaskBuffer;
- ret = RegGetValueW(This->classkey, channelmasks_keyname, valuename, RRF_RT_REG_BINARY, NULL, pbMaskBuffer, &cbData);
+ ret = RegGetValueW(This->classkey, L"ChannelMasks", valuename, RRF_RT_REG_BINARY, NULL, pbMaskBuffer, &cbData);
if (ret == ERROR_SUCCESS || ret == ERROR_MORE_DATA)
*pcbActual = cbData;
@@ -1445,7 +1413,7 @@ static HRESULT WINAPI PixelFormatInfo_SupportsTransparency(IWICPixelFormatInfo2
TRACE("(%p,%p)\n", iface, pfSupportsTransparency);
- return ComponentInfo_GetDWORDValue(This->classkey, supportstransparency_valuename, (DWORD*)pfSupportsTransparency);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"SupportsTransparency", (DWORD*)pfSupportsTransparency);
}
static HRESULT WINAPI PixelFormatInfo_GetNumericRepresentation(IWICPixelFormatInfo2 *iface,
@@ -1455,7 +1423,7 @@ static HRESULT WINAPI PixelFormatInfo_GetNumericRepresentation(IWICPixelFormatIn
TRACE("(%p,%p)\n", iface, pNumericRepresentation);
- return ComponentInfo_GetDWORDValue(This->classkey, numericrepresentation_valuename, pNumericRepresentation);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"NumericRepresentation", pNumericRepresentation);
}
static const IWICPixelFormatInfo2Vtbl PixelFormatInfo_Vtbl = {
@@ -1622,8 +1590,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetAuthor(IWICMetadataReaderInfo *iface
TRACE("(%p,%u,%p,%p)\n", iface, length, author, actual_length);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- length, author, actual_length);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", length, author, actual_length);
}
static HRESULT WINAPI MetadataReaderInfo_GetVendorGUID(IWICMetadataReaderInfo *iface,
@@ -1633,7 +1600,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetVendorGUID(IWICMetadataReaderInfo *i
TRACE("(%p,%p)\n", iface, vendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, vendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", vendor);
}
static HRESULT WINAPI MetadataReaderInfo_GetVersion(IWICMetadataReaderInfo *iface,
@@ -1643,8 +1610,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetVersion(IWICMetadataReaderInfo *ifac
TRACE("(%p,%u,%p,%p)\n", iface, length, version, actual_length);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
- length, version, actual_length);
+ return ComponentInfo_GetStringValue(This->classkey, L"Version", length, version, actual_length);
}
static HRESULT WINAPI MetadataReaderInfo_GetSpecVersion(IWICMetadataReaderInfo *iface,
@@ -1654,7 +1620,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetSpecVersion(IWICMetadataReaderInfo *
TRACE("(%p,%u,%p,%p)\n", iface, length, version, actual_length);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
length, version, actual_length);
}
@@ -1665,7 +1631,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetFriendlyName(IWICMetadataReaderInfo
TRACE("(%p,%u,%p,%p)\n", iface, length, name, actual_length);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
length, name, actual_length);
}
@@ -1674,7 +1640,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetMetadataFormat(IWICMetadataReaderInf
{
MetadataReaderInfo *This = impl_from_IWICMetadataReaderInfo(iface);
TRACE("(%p,%p)\n", iface, format);
- return ComponentInfo_GetGUIDValue(This->classkey, metadataformat_valuename, format);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"MetadataFormat", format);
}
static HRESULT WINAPI MetadataReaderInfo_GetContainerFormats(IWICMetadataReaderInfo *iface,
@@ -1716,7 +1682,7 @@ static HRESULT WINAPI MetadataReaderInfo_DoesRequireFullStream(IWICMetadataReade
{
MetadataReaderInfo *This = impl_from_IWICMetadataReaderInfo(iface);
TRACE("(%p,%p)\n", iface, param);
- return ComponentInfo_GetDWORDValue(This->classkey, requiresfullstream_valuename, (DWORD *)param);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"RequiresFullStream", (DWORD *)param);
}
static HRESULT WINAPI MetadataReaderInfo_DoesSupportPadding(IWICMetadataReaderInfo *iface,
@@ -1724,7 +1690,7 @@ static HRESULT WINAPI MetadataReaderInfo_DoesSupportPadding(IWICMetadataReaderIn
{
MetadataReaderInfo *This = impl_from_IWICMetadataReaderInfo(iface);
TRACE("(%p,%p)\n", iface, param);
- return ComponentInfo_GetDWORDValue(This->classkey, supportspadding_valuename, (DWORD *)param);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"SupportsPadding", (DWORD *)param);
}
static HRESULT WINAPI MetadataReaderInfo_DoesRequireFixedSize(IWICMetadataReaderInfo *iface,
@@ -1864,17 +1830,12 @@ static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_gui
WCHAR subkeyname[11], guidkeyname[39];
LONG res;
HKEY containers_key, guid_key, patternkey;
- static const WCHAR uintformatW[] = {'%','u',0};
- static const WCHAR patternW[] = {'P','a','t','t','e','r','n',0};
- static const WCHAR positionW[] = {'P','o','s','i','t','i','o','n',0};
- static const WCHAR maskW[] = {'M','a','s','k',0};
- static const WCHAR dataoffsetW[] = {'D','a','t','a','O','f','f','s','e','t',0};
UINT i;
WICMetadataPattern *patterns;
BYTE *patterns_ptr;
DWORD length, valuesize;
- res = RegOpenKeyExW(info->classkey, containers_keyname, 0, KEY_READ, &containers_key);
+ res = RegOpenKeyExW(info->classkey, L"Containers", 0, KEY_READ, &containers_key);
if (res != ERROR_SUCCESS) return;
StringFromGUID2(container_guid, guidkeyname, 39);
@@ -1900,24 +1861,24 @@ static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_gui
for (i=0; res == ERROR_SUCCESS && i < pattern_count; i++)
{
- swprintf(subkeyname, 11, uintformatW, i);
+ swprintf(subkeyname, 11, L"%u", i);
res = RegOpenKeyExW(guid_key, subkeyname, 0, KEY_READ, &patternkey);
if (res != ERROR_SUCCESS) break;
- res = RegGetValueW(patternkey, NULL, patternW, RRF_RT_REG_BINARY, NULL, NULL, &length);
+ res = RegGetValueW(patternkey, NULL, L"Pattern", RRF_RT_REG_BINARY, NULL, NULL, &length);
if (res == ERROR_SUCCESS)
{
patterns_size += length*2;
patterns[i].Length = length;
valuesize = sizeof(DWORD64);
- res = RegGetValueW(patternkey, NULL, dataoffsetW, RRF_RT_DWORD|RRF_RT_QWORD, NULL,
+ res = RegGetValueW(patternkey, NULL, L"DataOffset", RRF_RT_DWORD|RRF_RT_QWORD, NULL,
&patterns[i].DataOffset, &valuesize);
if (res) patterns[i].DataOffset.QuadPart = 0;
patterns[i].Position.QuadPart = 0;
valuesize = sizeof(DWORD64);
- res = RegGetValueW(patternkey, NULL, positionW, RRF_RT_DWORD|RRF_RT_QWORD, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Position", RRF_RT_DWORD|RRF_RT_QWORD, NULL,
&patterns[i].Position, &valuesize);
}
@@ -1935,14 +1896,14 @@ static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_gui
for (i=0; res == ERROR_SUCCESS && i < pattern_count; i++)
{
- swprintf(subkeyname, 11, uintformatW, i);
+ swprintf(subkeyname, 11, L"%u", i);
res = RegOpenKeyExW(guid_key, subkeyname, 0, KEY_READ, &patternkey);
if (res != ERROR_SUCCESS) break;
length = patterns[i].Length;
patterns[i].Pattern = patterns_ptr;
valuesize = length;
- res = RegGetValueW(patternkey, NULL, patternW, RRF_RT_REG_BINARY, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Pattern", RRF_RT_REG_BINARY, NULL,
patterns[i].Pattern, &valuesize);
patterns_ptr += length;
@@ -1950,7 +1911,7 @@ static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_gui
{
patterns[i].Mask = patterns_ptr;
valuesize = length;
- res = RegGetValueW(patternkey, NULL, maskW, RRF_RT_REG_BINARY, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Mask", RRF_RT_REG_BINARY, NULL,
patterns[i].Mask, &valuesize);
patterns_ptr += length;
}
@@ -1977,13 +1938,13 @@ static BOOL read_metadata_info(MetadataReaderInfo *info)
GUID *formats;
HRESULT hr;
- hr = ComponentInfo_GetGuidList(info->classkey, containers_keyname, 0, NULL, &format_count);
+ hr = ComponentInfo_GetGuidList(info->classkey, L"Containers", 0, NULL, &format_count);
if (FAILED(hr)) return TRUE;
formats = heap_calloc(format_count, sizeof(*formats));
if (!formats) return FALSE;
- hr = ComponentInfo_GetGuidList(info->classkey, containers_keyname, format_count, formats,
+ hr = ComponentInfo_GetGuidList(info->classkey, L"Containers", format_count, formats,
&format_count);
if (FAILED(hr))
{
@@ -2034,9 +1995,6 @@ static HRESULT MetadataReaderInfo_Constructor(HKEY classkey, REFCLSID clsid, Com
return S_OK;
}
-static const WCHAR clsid_keyname[] = {'C','L','S','I','D',0};
-static const WCHAR instance_keyname[] = {'I','n','s','t','a','n','c','e',0};
-
struct category {
WICComponentType type;
const GUID *catid;
@@ -2094,7 +2052,7 @@ HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
return S_OK;
}
- res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, KEY_READ, &clsidkey);
+ res = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_READ, &clsidkey);
if (res != ERROR_SUCCESS)
{
LeaveCriticalSection(&component_info_cache_cs);
@@ -2107,7 +2065,7 @@ HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
res = RegOpenKeyExW(clsidkey, guidstring, 0, KEY_READ, &catidkey);
if (res == ERROR_SUCCESS)
{
- res = RegOpenKeyExW(catidkey, instance_keyname, 0, KEY_READ, &instancekey);
+ res = RegOpenKeyExW(catidkey, L"Instance", 0, KEY_READ, &instancekey);
if (res == ERROR_SUCCESS)
{
StringFromGUID2(clsid, guidstring, 39);
@@ -2388,7 +2346,7 @@ HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnkn
if (options) FIXME("ignoring flags %x\n", options);
- res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, KEY_READ, &clsidkey);
+ res = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_READ, &clsidkey);
if (res != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(res);
@@ -2412,7 +2370,7 @@ HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnkn
res = RegOpenKeyExW(clsidkey, guidstring, 0, KEY_READ, &catidkey);
if (res == ERROR_SUCCESS)
{
- res = RegOpenKeyExW(catidkey, instance_keyname, 0, KEY_READ, &instancekey);
+ res = RegOpenKeyExW(catidkey, L"Instance", 0, KEY_READ, &instancekey);
if (res == ERROR_SUCCESS)
{
i=0;
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index d14490560aa..89701bbab77 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -114,7 +114,6 @@ static HRESULT LoadGamaMetadata(IStream *stream, const GUID *preferred_vendor,
BYTE *data;
ULONG data_size;
ULONG gamma;
- static const WCHAR ImageGamma[] = {'I','m','a','g','e','G','a','m','m','a',0};
LPWSTR name;
MetadataItem *result;
@@ -132,7 +131,7 @@ static HRESULT LoadGamaMetadata(IStream *stream, const GUID *preferred_vendor,
HeapFree(GetProcessHeap(), 0, data);
result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem));
- name = HeapAlloc(GetProcessHeap(), 0, sizeof(ImageGamma));
+ name = HeapAlloc(GetProcessHeap(), 0, sizeof(L"ImageGamma"));
if (!result || !name)
{
HeapFree(GetProcessHeap(), 0, result);
@@ -144,7 +143,7 @@ static HRESULT LoadGamaMetadata(IStream *stream, const GUID *preferred_vendor,
PropVariantInit(&result[0].id);
PropVariantInit(&result[0].value);
- memcpy(name, ImageGamma, sizeof(ImageGamma));
+ memcpy(name, L"ImageGamma", sizeof(L"ImageGamma"));
result[0].id.vt = VT_LPWSTR;
result[0].id.u.pwszVal = name;
@@ -176,14 +175,14 @@ static HRESULT LoadChrmMetadata(IStream *stream, const GUID *preferred_vendor,
BYTE *data;
ULONG data_size;
static const WCHAR names[8][12] = {
- {'W','h','i','t','e','P','o','i','n','t','X',0},
- {'W','h','i','t','e','P','o','i','n','t','Y',0},
- {'R','e','d','X',0},
- {'R','e','d','Y',0},
- {'G','r','e','e','n','X',0},
- {'G','r','e','e','n','Y',0},
- {'B','l','u','e','X',0},
- {'B','l','u','e','Y',0},
+ L"WhitePointX",
+ L"WhitePointY",
+ L"RedX",
+ L"RedY",
+ L"GreenX",
+ L"GreenY",
+ L"BlueX",
+ L"BlueY",
};
LPWSTR dyn_names[8] = {0};
MetadataItem *result;
--
2.26.2
2
1
02 Dec '20
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
Odd one as it has also non-inlined ascii strings so I've kept the WCHAR
string variables too.
dlls/windowscodecs/regsvr.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index 2fb03a2e1e9..5ab43353320 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -147,37 +147,36 @@ static HRESULT unregister_pixelformats(struct regsvr_pixelformat const *list);
/***********************************************************************
* static string constants
*/
-static const WCHAR clsid_keyname[] = {
- 'C', 'L', 'S', 'I', 'D', 0 };
+static const WCHAR clsid_keyname[] = L"CLSID";
static const char author_valuename[] = "Author";
static const char friendlyname_valuename[] = "FriendlyName";
-static const WCHAR vendor_valuename[] = {'V','e','n','d','o','r',0};
-static const WCHAR containerformat_valuename[] = {'C','o','n','t','a','i','n','e','r','F','o','r','m','a','t',0};
+static const WCHAR vendor_valuename[] = L"Vendor";
+static const WCHAR containerformat_valuename[] = L"ContainerFormat";
static const char version_valuename[] = "Version";
static const char mimetypes_valuename[] = "MimeTypes";
static const char extensions_valuename[] = "FileExtensions";
-static const WCHAR formats_keyname[] = {'F','o','r','m','a','t','s',0};
-static const WCHAR patterns_keyname[] = {'P','a','t','t','e','r','n','s',0};
-static const WCHAR instance_keyname[] = {'I','n','s','t','a','n','c','e',0};
-static const WCHAR clsid_valuename[] = {'C','L','S','I','D',0};
+static const WCHAR formats_keyname[] = L"Formats";
+static const WCHAR patterns_keyname[] = L"Patterns";
+static const WCHAR instance_keyname[] = L"Instance";
+static const WCHAR clsid_valuename[] = L"CLSID";
static const char length_valuename[] = "Length";
static const char position_valuename[] = "Position";
static const char pattern_valuename[] = "Pattern";
static const char mask_valuename[] = "Mask";
static const char endofstream_valuename[] = "EndOfStream";
-static const WCHAR pixelformats_keyname[] = {'P','i','x','e','l','F','o','r','m','a','t','s',0};
-static const WCHAR metadataformat_valuename[] = {'M','e','t','a','d','a','t','a','F','o','r','m','a','t',0};
+static const WCHAR pixelformats_keyname[] = L"PixelFormats";
+static const WCHAR metadataformat_valuename[] = L"MetadataFormat";
static const char specversion_valuename[] = "SpecVersion";
static const char requiresfullstream_valuename[] = "RequiresFullStream";
static const char supportspadding_valuename[] = "SupportsPadding";
static const char requiresfixedsize_valuename[] = "FixedSize";
-static const WCHAR containers_keyname[] = {'C','o','n','t','a','i','n','e','r','s',0};
+static const WCHAR containers_keyname[] = L"Containers";
static const char dataoffset_valuename[] = "DataOffset";
static const char bitsperpixel_valuename[] = "BitLength";
static const char channelcount_valuename[] = "ChannelCount";
static const char numericrepresentation_valuename[] = "NumericRepresentation";
static const char supportstransparency_valuename[] = "SupportsTransparency";
-static const WCHAR channelmasks_keyname[] = {'C','h','a','n','n','e','l','M','a','s','k','s',0};
+static const WCHAR channelmasks_keyname[] = L"ChannelMasks";
/***********************************************************************
* register_decoders
@@ -305,8 +304,7 @@ static HRESULT register_decoders(struct regsvr_decoder const *list)
for (i=0; list->patterns[i].length; i++)
{
HKEY pattern_key;
- static const WCHAR int_format[] = {'%','i',0};
- swprintf(buf, 39, int_format, i);
+ swprintf(buf, 39, L"%i", i);
res = RegCreateKeyExW(patterns_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &pattern_key, NULL);
if (res != ERROR_SUCCESS) break;
@@ -851,8 +849,7 @@ static HRESULT register_metadatareaders(struct regsvr_metadatareader const *list
for (i=0; container->patterns[i].length; i++)
{
HKEY pattern_key;
- static const WCHAR int_format[] = {'%','i',0};
- swprintf(buf, 39, int_format, i);
+ swprintf(buf, 39, L"%i", i);
res = RegCreateKeyExW(format_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &pattern_key, NULL);
if (res != ERROR_SUCCESS) break;
@@ -1031,7 +1028,6 @@ static HRESULT register_pixelformats(struct regsvr_pixelformat const *list)
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
if (list->channelmasks) {
- static const WCHAR valuename_format[] = {'%','d',0};
HKEY masks_key;
UINT i, mask_size;
WCHAR mask_valuename[11];
@@ -1043,7 +1039,7 @@ static HRESULT register_pixelformats(struct regsvr_pixelformat const *list)
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
for (i=0; i < list->channelcount; i++)
{
- swprintf(mask_valuename, ARRAY_SIZE(mask_valuename), valuename_format, i);
+ swprintf(mask_valuename, ARRAY_SIZE(mask_valuename), L"%d", i);
res = RegSetValueExW(masks_key, mask_valuename, 0, REG_BINARY,
list->channelmasks[i], mask_size);
if (res != ERROR_SUCCESS) break;
--
2.26.2
2
1
[PATCH] windowscodecs: Use wide-char string literals in metadataquery.c.
by Michael Stefaniuc 02 Dec '20
by Michael Stefaniuc 02 Dec '20
02 Dec '20
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/windowscodecs/metadataquery.c | 241 +++++++++--------------------
1 file changed, 71 insertions(+), 170 deletions(-)
diff --git a/dlls/windowscodecs/metadataquery.c b/dlls/windowscodecs/metadataquery.c
index 189187fb2ab..2761a520083 100644
--- a/dlls/windowscodecs/metadataquery.c
+++ b/dlls/windowscodecs/metadataquery.c
@@ -103,7 +103,6 @@ static HRESULT WINAPI mqr_GetContainerFormat(IWICMetadataQueryReader *iface, GUI
static HRESULT WINAPI mqr_GetLocation(IWICMetadataQueryReader *iface, UINT len, WCHAR *location, UINT *ret_len)
{
- static const WCHAR rootW[] = { '/',0 };
QueryReader *This = impl_from_IWICMetadataQueryReader(iface);
const WCHAR *root;
UINT actual_len;
@@ -112,7 +111,7 @@ static HRESULT WINAPI mqr_GetLocation(IWICMetadataQueryReader *iface, UINT len,
if (!ret_len) return E_INVALIDARG;
- root = This->root ? This->root : rootW;
+ root = This->root ? This->root : L"/";
actual_len = lstrlenW(root) + 1;
if (location)
@@ -636,101 +635,56 @@ HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const W
return S_OK;
}
-static const WCHAR bmpW[] = { 'b','m','p',0 };
-static const WCHAR pngW[] = { 'p','n','g',0 };
-static const WCHAR icoW[] = { 'i','c','o',0 };
-static const WCHAR jpgW[] = { 'j','p','g',0 };
-static const WCHAR tiffW[] = { 't','i','f','f',0 };
-static const WCHAR gifW[] = { 'g','i','f',0 };
-static const WCHAR wmphotoW[] = { 'w','m','p','h','o','t','o',0 };
-static const WCHAR unknownW[] = { 'u','n','k','n','o','w','n',0 };
-static const WCHAR ifdW[] = { 'i','f','d',0 };
-static const WCHAR subW[] = { 's','u','b',0 };
-static const WCHAR exifW[] = { 'e','x','i','f',0 };
-static const WCHAR gpsW[] = { 'g','p','s',0 };
-static const WCHAR interopW[] = { 'i','n','t','e','r','o','p',0 };
-static const WCHAR app0W[] = { 'a','p','p','0',0 };
-static const WCHAR app1W[] = { 'a','p','p','1',0 };
-static const WCHAR app13W[] = { 'a','p','p','1','3',0 };
-static const WCHAR iptcW[] = { 'i','p','t','c',0 };
-static const WCHAR irbW[] = { 'i','r','b',0 };
-static const WCHAR _8bimiptcW[] = { '8','b','i','m','i','p','t','c',0 };
-static const WCHAR _8bimResInfoW[] = { '8','b','i','m','R','e','s','I','n','f','o',0 };
-static const WCHAR _8bimiptcdigestW[] = { '8','b','i','m','i','p','t','c','d','i','g','e','s','t',0 };
-static const WCHAR xmpW[] = { 'x','m','p',0 };
-static const WCHAR thumbW[] = { 't','h','u','m','b',0 };
-static const WCHAR tEXtW[] = { 't','E','X','t',0 };
-static const WCHAR xmpstructW[] = { 'x','m','p','s','t','r','u','c','t',0 };
-static const WCHAR xmpbagW[] = { 'x','m','p','b','a','g',0 };
-static const WCHAR xmpseqW[] = { 'x','m','p','s','e','q',0 };
-static const WCHAR xmpaltW[] = { 'x','m','p','a','l','t',0 };
-static const WCHAR logscrdescW[] = { 'l','o','g','s','c','r','d','e','s','c',0 };
-static const WCHAR imgdescW[] = { 'i','m','g','d','e','s','c',0 };
-static const WCHAR grctlextW[] = { 'g','r','c','t','l','e','x','t',0 };
-static const WCHAR appextW[] = { 'a','p','p','e','x','t',0 };
-static const WCHAR chrominanceW[] = { 'c','h','r','o','m','i','n','a','n','c','e',0 };
-static const WCHAR luminanceW[] = { 'l','u','m','i','n','a','n','c','e',0 };
-static const WCHAR comW[] = { 'c','o','m',0 };
-static const WCHAR commentextW[] = { 'c','o','m','m','e','n','t','e','x','t',0 };
-static const WCHAR gAMAW[] = { 'g','A','M','A',0 };
-static const WCHAR bKGDW[] = { 'b','K','G','D',0 };
-static const WCHAR iTXtW[] = { 'i','T','X','t',0 };
-static const WCHAR cHRMW[] = { 'c','H','R','M',0 };
-static const WCHAR hISTW[] = { 'h','I','S','T',0 };
-static const WCHAR iCCPW[] = { 'i','C','C','P',0 };
-static const WCHAR sRGBW[] = { 's','R','G','B',0 };
-static const WCHAR tIMEW[] = { 't','I','M','E',0 };
-
static const struct
{
const GUID *guid;
const WCHAR *name;
} guid2name[] =
{
- { &GUID_ContainerFormatBmp, bmpW },
- { &GUID_ContainerFormatPng, pngW },
- { &GUID_ContainerFormatIco, icoW },
- { &GUID_ContainerFormatJpeg, jpgW },
- { &GUID_ContainerFormatTiff, tiffW },
- { &GUID_ContainerFormatGif, gifW },
- { &GUID_ContainerFormatWmp, wmphotoW },
- { &GUID_MetadataFormatUnknown, unknownW },
- { &GUID_MetadataFormatIfd, ifdW },
- { &GUID_MetadataFormatSubIfd, subW },
- { &GUID_MetadataFormatExif, exifW },
- { &GUID_MetadataFormatGps, gpsW },
- { &GUID_MetadataFormatInterop, interopW },
- { &GUID_MetadataFormatApp0, app0W },
- { &GUID_MetadataFormatApp1, app1W },
- { &GUID_MetadataFormatApp13, app13W },
- { &GUID_MetadataFormatIPTC, iptcW },
- { &GUID_MetadataFormatIRB, irbW },
- { &GUID_MetadataFormat8BIMIPTC, _8bimiptcW },
- { &GUID_MetadataFormat8BIMResolutionInfo, _8bimResInfoW },
- { &GUID_MetadataFormat8BIMIPTCDigest, _8bimiptcdigestW },
- { &GUID_MetadataFormatXMP, xmpW },
- { &GUID_MetadataFormatThumbnail, thumbW },
- { &GUID_MetadataFormatChunktEXt, tEXtW },
- { &GUID_MetadataFormatXMPStruct, xmpstructW },
- { &GUID_MetadataFormatXMPBag, xmpbagW },
- { &GUID_MetadataFormatXMPSeq, xmpseqW },
- { &GUID_MetadataFormatXMPAlt, xmpaltW },
- { &GUID_MetadataFormatLSD, logscrdescW },
- { &GUID_MetadataFormatIMD, imgdescW },
- { &GUID_MetadataFormatGCE, grctlextW },
- { &GUID_MetadataFormatAPE, appextW },
- { &GUID_MetadataFormatJpegChrominance, chrominanceW },
- { &GUID_MetadataFormatJpegLuminance, luminanceW },
- { &GUID_MetadataFormatJpegComment, comW },
- { &GUID_MetadataFormatGifComment, commentextW },
- { &GUID_MetadataFormatChunkgAMA, gAMAW },
- { &GUID_MetadataFormatChunkbKGD, bKGDW },
- { &GUID_MetadataFormatChunkiTXt, iTXtW },
- { &GUID_MetadataFormatChunkcHRM, cHRMW },
- { &GUID_MetadataFormatChunkhIST, hISTW },
- { &GUID_MetadataFormatChunkiCCP, iCCPW },
- { &GUID_MetadataFormatChunksRGB, sRGBW },
- { &GUID_MetadataFormatChunktIME, tIMEW }
+ { &GUID_ContainerFormatBmp, L"bmp" },
+ { &GUID_ContainerFormatPng, L"png" },
+ { &GUID_ContainerFormatIco, L"ico" },
+ { &GUID_ContainerFormatJpeg, L"jpg" },
+ { &GUID_ContainerFormatTiff, L"tiff" },
+ { &GUID_ContainerFormatGif, L"gif" },
+ { &GUID_ContainerFormatWmp, L"wmphoto" },
+ { &GUID_MetadataFormatUnknown, L"unknown" },
+ { &GUID_MetadataFormatIfd, L"ifd" },
+ { &GUID_MetadataFormatSubIfd, L"sub" },
+ { &GUID_MetadataFormatExif, L"exif" },
+ { &GUID_MetadataFormatGps, L"gps" },
+ { &GUID_MetadataFormatInterop, L"interop" },
+ { &GUID_MetadataFormatApp0, L"app0" },
+ { &GUID_MetadataFormatApp1, L"app1" },
+ { &GUID_MetadataFormatApp13, L"app13" },
+ { &GUID_MetadataFormatIPTC, L"iptc" },
+ { &GUID_MetadataFormatIRB, L"irb" },
+ { &GUID_MetadataFormat8BIMIPTC, L"8bimiptc" },
+ { &GUID_MetadataFormat8BIMResolutionInfo, L"8bimResInfo" },
+ { &GUID_MetadataFormat8BIMIPTCDigest, L"8bimiptcdigest" },
+ { &GUID_MetadataFormatXMP, L"xmp" },
+ { &GUID_MetadataFormatThumbnail, L"thumb" },
+ { &GUID_MetadataFormatChunktEXt, L"tEXt" },
+ { &GUID_MetadataFormatXMPStruct, L"xmpstruct" },
+ { &GUID_MetadataFormatXMPBag, L"xmpbag" },
+ { &GUID_MetadataFormatXMPSeq, L"xmpseq" },
+ { &GUID_MetadataFormatXMPAlt, L"xmpalt" },
+ { &GUID_MetadataFormatLSD, L"logscrdesc" },
+ { &GUID_MetadataFormatIMD, L"imgdesc" },
+ { &GUID_MetadataFormatGCE, L"grctlext" },
+ { &GUID_MetadataFormatAPE, L"appext" },
+ { &GUID_MetadataFormatJpegChrominance, L"chrominance" },
+ { &GUID_MetadataFormatJpegLuminance, L"luminance" },
+ { &GUID_MetadataFormatJpegComment, L"com" },
+ { &GUID_MetadataFormatGifComment, L"commentext" },
+ { &GUID_MetadataFormatChunkgAMA, L"gAMA" },
+ { &GUID_MetadataFormatChunkbKGD, L"bKGD" },
+ { &GUID_MetadataFormatChunkiTXt, L"iTXt" },
+ { &GUID_MetadataFormatChunkcHRM, L"cHRM" },
+ { &GUID_MetadataFormatChunkhIST, L"hIST" },
+ { &GUID_MetadataFormatChunkiCCP, L"iCCP" },
+ { &GUID_MetadataFormatChunksRGB, L"sRGB" },
+ { &GUID_MetadataFormatChunktIME, L"tIME" }
};
HRESULT WINAPI WICMapGuidToShortName(REFGUID guid, UINT len, WCHAR *name, UINT *ret_len)
@@ -784,91 +738,38 @@ HRESULT WINAPI WICMapShortNameToGuid(PCWSTR name, GUID *guid)
return WINCODEC_ERR_PROPERTYNOTFOUND;
}
-static const WCHAR rdf[] = { 'r','d','f',0 };
-static const WCHAR rdf_scheme[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','0','2','/','2','2','-','r','d','f','-','s','y','n','t','a','x','-','n','s','#',0 };
-static const WCHAR dc[] = { 'd','c',0 };
-static const WCHAR dc_scheme[] = { 'h','t','t','p',':','/','/','p','u','r','l','.','o','r','g','/','d','c','/','e','l','e','m','e','n','t','s','/','1','.','1','/',0 };
-static const WCHAR xmp[] = { 'x','m','p',0 };
-static const WCHAR xmp_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/',0 };
-static const WCHAR xmpidq[] = { 'x','m','p','i','d','q',0 };
-static const WCHAR xmpidq_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','m','p','/','I','d','e','n','t','i','f','i','e','r','/','q','u','a','l','/','1','.','0','/',0 };
-static const WCHAR xmpRights[] = { 'x','m','p','R','i','g','h','t','s',0 };
-static const WCHAR xmpRights_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','r','i','g','h','t','s','/',0 };
-static const WCHAR xmpMM[] = { 'x','m','p','M','M',0 };
-static const WCHAR xmpMM_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','m','m','/',0 };
-static const WCHAR xmpBJ[] = { 'x','m','p','B','J',0 };
-static const WCHAR xmpBJ_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','b','j','/',0 };
-static const WCHAR xmpTPg[] = { 'x','m','p','T','P','g',0 };
-static const WCHAR xmpTPg_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','t','/','p','g','/',0 };
-static const WCHAR pdf[] = { 'p','d','f',0 };
-static const WCHAR pdf_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','p','d','f','/','1','.','3','/',0 };
-static const WCHAR photoshop[] = { 'p','h','o','t','o','s','h','o','p',0 };
-static const WCHAR photoshop_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','p','h','o','t','o','s','h','o','p','/','1','.','0','/',0 };
-static const WCHAR tiff[] = { 't','i','f','f',0 };
-static const WCHAR tiff_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','t','i','f','f','/','1','.','0','/',0 };
-static const WCHAR exif[] = { 'e','x','i','f',0 };
-static const WCHAR exif_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','e','x','i','f','/','1','.','0','/',0 };
-static const WCHAR stDim[] = { 's','t','D','i','m',0 };
-static const WCHAR stDim_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','D','i','m','e','n','s','i','o','n','s','#',0 };
-static const WCHAR xapGImg[] = { 'x','a','p','G','I','m','g',0 };
-static const WCHAR xapGImg_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','g','/','i','m','g','/',0 };
-static const WCHAR stEvt[] = { 's','t','E','v','t',0 };
-static const WCHAR stEvt_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','R','e','s','o','u','r','c','e','E','v','e','n','t','#',0 };
-static const WCHAR stRef[] = { 's','t','R','e','f',0 };
-static const WCHAR stRef_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','R','e','s','o','u','r','c','e','R','e','f','#',0 };
-static const WCHAR stVer[] = { 's','t','V','e','r',0 };
-static const WCHAR stVer_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','V','e','r','s','i','o','n','#',0 };
-static const WCHAR stJob[] = { 's','t','J','o','b',0 };
-static const WCHAR stJob_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','J','o','b','#',0 };
-static const WCHAR aux[] = { 'a','u','x',0 };
-static const WCHAR aux_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','e','x','i','f','/','1','.','0','/','a','u','x','/',0 };
-static const WCHAR crs[] = { 'c','r','s',0 };
-static const WCHAR crs_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','c','a','m','e','r','a','-','r','a','w','-','s','e','t','t','i','n','g','s','/','1','.','0','/',0 };
-static const WCHAR xmpDM[] = { 'x','m','p','D','M',0 };
-static const WCHAR xmpDM_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','m','p','/','1','.','0','/','D','y','n','a','m','i','c','M','e','d','i','a','/',0 };
-static const WCHAR Iptc4xmpCore[] = { 'I','p','t','c','4','x','m','p','C','o','r','e',0 };
-static const WCHAR Iptc4xmpCore_scheme[] = { 'h','t','t','p',':','/','/','i','p','t','c','.','o','r','g','/','s','t','d','/','I','p','t','c','4','x','m','p','C','o','r','e','/','1','.','0','/','x','m','l','n','s','/',0 };
-static const WCHAR MicrosoftPhoto[] = { 'M','i','c','r','o','s','o','f','t','P','h','o','t','o',0 };
-static const WCHAR MicrosoftPhoto_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','p','h','o','t','o','/','1','.','0','/',0 };
-static const WCHAR MP[] = { 'M','P',0 };
-static const WCHAR MP_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','p','h','o','t','o','/','1','.','2','/',0 };
-static const WCHAR MPRI[] = { 'M','P','R','I',0 };
-static const WCHAR MPRI_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','p','h','o','t','o','/','1','.','2','/','t','/','R','e','g','i','o','n','I','n','f','o','#',0 };
-static const WCHAR MPReg[] = { 'M','P','R','e','g',0 };
-static const WCHAR MPReg_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','p','h','o','t','o','/','1','.','2','/','t','/','R','e','g','i','o','n','#',0 };
-
static const struct
{
const WCHAR *name;
const WCHAR *schema;
} name2schema[] =
{
- { rdf, rdf_scheme },
- { dc, dc_scheme },
- { xmp, xmp_scheme },
- { xmpidq, xmpidq_scheme },
- { xmpRights, xmpRights_scheme },
- { xmpMM, xmpMM_scheme },
- { xmpBJ, xmpBJ_scheme },
- { xmpTPg, xmpTPg_scheme },
- { pdf, pdf_scheme },
- { photoshop, photoshop_scheme },
- { tiff, tiff_scheme },
- { exif, exif_scheme },
- { stDim, stDim_scheme },
- { xapGImg, xapGImg_scheme },
- { stEvt, stEvt_scheme },
- { stRef, stRef_scheme },
- { stVer, stVer_scheme },
- { stJob, stJob_scheme },
- { aux, aux_scheme },
- { crs, crs_scheme },
- { xmpDM, xmpDM_scheme },
- { Iptc4xmpCore, Iptc4xmpCore_scheme },
- { MicrosoftPhoto, MicrosoftPhoto_scheme },
- { MP, MP_scheme },
- { MPRI, MPRI_scheme },
- { MPReg, MPReg_scheme }
+ { L"rdf", L"http://www.w3.org/1999/02/22-rdf-syntax-ns#" },
+ { L"dc", L"http://purl.org/dc/elements/1.1/" },
+ { L"xmp", L"http://ns.adobe.com/xap/1.0/" },
+ { L"xmpidq", L"http://ns.adobe.com/xmp/Identifier/qual/1.0/" },
+ { L"xmpRights", L"http://ns.adobe.com/xap/1.0/rights/" },
+ { L"xmpMM", L"http://ns.adobe.com/xap/1.0/mm/" },
+ { L"xmpBJ", L"http://ns.adobe.com/xap/1.0/bj/" },
+ { L"xmpTPg", L"http://ns.adobe.com/xap/1.0/t/pg/" },
+ { L"pdf", L"http://ns.adobe.com/pdf/1.3/" },
+ { L"photoshop", L"http://ns.adobe.com/photoshop/1.0/" },
+ { L"tiff", L"http://ns.adobe.com/tiff/1.0/" },
+ { L"exif", L"http://ns.adobe.com/exif/1.0/" },
+ { L"stDim", L"http://ns.adobe.com/xap/1.0/sType/Dimensions#" },
+ { L"xapGImg", L"http://ns.adobe.com/xap/1.0/g/img/" },
+ { L"stEvt", L"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" },
+ { L"stRef", L"http://ns.adobe.com/xap/1.0/sType/ResourceRef#" },
+ { L"stVer", L"http://ns.adobe.com/xap/1.0/sType/Version#" },
+ { L"stJob", L"http://ns.adobe.com/xap/1.0/sType/Job#" },
+ { L"aux", L"http://ns.adobe.com/exif/1.0/aux/" },
+ { L"crs", L"http://ns.adobe.com/camera-raw-settings/1.0/" },
+ { L"xmpDM", L"http://ns.adobe.com/xmp/1.0/DynamicMedia/" },
+ { L"Iptc4xmpCore", L"http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" },
+ { L"MicrosoftPhoto", L"http://ns.microsoft.com/photo/1.0/" },
+ { L"MP", L"http://ns.microsoft.com/photo/1.2/" },
+ { L"MPRI", L"http://ns.microsoft.com/photo/1.2/t/RegionInfo#" },
+ { L"MPReg", L"http://ns.microsoft.com/photo/1.2/t/Region#" }
};
static const WCHAR *map_shortname_to_schema(const GUID *format, const WCHAR *name)
--
2.26.2
2
1
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/shdocvw/shdocvw_main.c | 7 ++-----
dlls/shdocvw/shlinstobj.c | 11 +++--------
dlls/shdocvw/tests/shortcut.c | 4 +---
3 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/dlls/shdocvw/shdocvw_main.c b/dlls/shdocvw/shdocvw_main.c
index ac3913dd239..8c5dd8279c7 100644
--- a/dlls/shdocvw/shdocvw_main.c
+++ b/dlls/shdocvw/shdocvw_main.c
@@ -43,10 +43,8 @@ static HINSTANCE ieframe_instance;
static HINSTANCE get_ieframe_instance(void)
{
- static const WCHAR ieframe_dllW[] = {'i','e','f','r','a','m','e','.','d','l','l',0};
-
if(!ieframe_instance)
- ieframe_instance = LoadLibraryW(ieframe_dllW);
+ ieframe_instance = LoadLibraryW(L"ieframe.dll");
return ieframe_instance;
}
@@ -276,10 +274,9 @@ DWORD WINAPI SetQueryNetSessionCount(DWORD arg)
static void* fetch_shlwapi_ordinal(UINT_PTR ord)
{
- static const WCHAR shlwapiW[] = {'s','h','l','w','a','p','i','.','d','l','l','\0'};
static HANDLE h;
- if (!h && !(h = GetModuleHandleW(shlwapiW))) return NULL;
+ if (!h && !(h = GetModuleHandleW(L"shlwapi.dll"))) return NULL;
return (void*)GetProcAddress(h, (const char*)ord);
}
diff --git a/dlls/shdocvw/shlinstobj.c b/dlls/shdocvw/shlinstobj.c
index 189c27cad58..f148a27619e 100644
--- a/dlls/shdocvw/shlinstobj.c
+++ b/dlls/shdocvw/shlinstobj.c
@@ -357,12 +357,7 @@ static HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag *
HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid,
LPVOID *ppvClassObj)
{
- WCHAR wszInstanceKey[] = { 'C','L','S','I','D','\\','{','0','0','0','0','0','0','0','0','-',
- '0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0',
- '0','0','0','0','}','\\','I','n','s','t','a','n','c','e', 0 };
- static const WCHAR wszCLSID[] = { 'C','L','S','I','D',0 };
- static const WCHAR wszInitPropertyBag[] =
- { 'I','n','i','t','P','r','o','p','e','r','t','y','B','a','g',0 };
+ WCHAR wszInstanceKey[] = L"CLSID\\{00000000-0000-0000-0000-000000000000}\\Instance";
WCHAR wszCLSIDInstance[CHARS_IN_GUID];
CLSID clsidInstance;
HKEY hInstanceKey, hInitPropertyBagKey;
@@ -382,7 +377,7 @@ HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid,
/* If there is no 'Instance' subkey, then it's not a Shell Instance Object. */
return CLASS_E_CLASSNOTAVAILABLE;
- if (ERROR_SUCCESS != RegQueryValueExW(hInstanceKey, wszCLSID, NULL, &dwType, (LPBYTE)wszCLSIDInstance, &cbBytes) ||
+ if (ERROR_SUCCESS != RegQueryValueExW(hInstanceKey, L"CLSID", NULL, &dwType, (BYTE *)wszCLSIDInstance, &cbBytes) ||
FAILED(CLSIDFromString(wszCLSIDInstance, &clsidInstance)))
{
/* 'Instance' should have a 'CLSID' value with a well-formed clsid-string. */
@@ -392,7 +387,7 @@ HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid,
}
/* Try to open the 'InitPropertyBag' subkey. */
- res = RegOpenKeyExW(hInstanceKey, wszInitPropertyBag, 0, KEY_READ, &hInitPropertyBagKey);
+ res = RegOpenKeyExW(hInstanceKey, L"InitPropertyBag", 0, KEY_READ, &hInitPropertyBagKey);
RegCloseKey(hInstanceKey);
if (res != ERROR_SUCCESS) {
/* Besides 'InitPropertyBag's, shell instance objects might be initialized by streams.
diff --git a/dlls/shdocvw/tests/shortcut.c b/dlls/shdocvw/tests/shortcut.c
index cb62c25892a..5cf1c4bad7f 100644
--- a/dlls/shdocvw/tests/shortcut.c
+++ b/dlls/shdocvw/tests/shortcut.c
@@ -165,9 +165,7 @@ static void test_ShortcutFolder(void) {
CLSID clsid;
const CLSID CLSID_WineTest =
{ 0x9b352ebf, 0x2765, 0x45c1, { 0xb4, 0xc6, 0x85, 0xcc, 0x7f, 0x7a, 0xbc, 0x64 } };
- WCHAR wszWineTestFolder[] = {
- ':',':','{','9','B','3','5','2','E','B','F','-','2','7','6','5','-','4','5','C','1','-',
- 'B','4','C','6','-','8','5','C','C','7','F','7','A','B','C','6','4','}',0 };
+ static WCHAR wszWineTestFolder[] = L"::{9B352EBF-2765-45C1-B4C6-85CC7F7ABC64}";
/* First, we register all the necessary registry keys/values for our 'WineTest'
* shell object. */
--
2.26.2
2
1
[PATCH vkd3d v2 1/3] vkd3d-compiler: Do not validate the target type when preprocessing.
by Zebediah Figura 01 Dec '20
by Zebediah Figura 01 Dec '20
01 Dec '20
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
programs/vkd3d-compiler/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c
index cec2ebb1..b79396e9 100644
--- a/programs/vkd3d-compiler/main.c
+++ b/programs/vkd3d-compiler/main.c
@@ -483,7 +483,7 @@ static bool parse_command_line(int argc, char **argv, struct options *options)
if (options->print_target_types)
return true;
- if (!validate_target_type(options->source_type, options->target_type))
+ if (!options->preprocess_only && !validate_target_type(options->source_type, options->target_type))
{
fprintf(stderr, "Target type '%s' is invalid for source type '%s'.\n",
get_target_type_info(options->target_type)->name,
--
2.29.2
3
8
[PATCH] windowscodecs: Don't make variables const just to cast the const away.
by Michael Stefaniuc 01 Dec '20
by Michael Stefaniuc 01 Dec '20
01 Dec '20
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
Of course the strings could be inlined with the cast kept but that
doesn't seems to be the preferred way.
dlls/windowscodecs/bmpencode.c | 4 ++--
dlls/windowscodecs/encoder.c | 40 +++++++++++++++++-----------------
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c
index 342f2c897e8..4bbeb4c27dd 100644
--- a/dlls/windowscodecs/bmpencode.c
+++ b/dlls/windowscodecs/bmpencode.c
@@ -77,7 +77,7 @@ typedef struct BmpFrameEncode {
BOOL committed;
} BmpFrameEncode;
-static const WCHAR wszEnableV5Header32bppBGRA[] = {'E','n','a','b','l','e','V','5','H','e','a','d','e','r','3','2','b','p','p','B','G','R','A',0};
+static WCHAR wszEnableV5Header32bppBGRA[] = L"EnableV5Header32bppBGRA";
static inline BmpFrameEncode *impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
{
@@ -562,7 +562,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
HRESULT hr;
static const PROPBAG2 opts[1] =
{
- { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszEnableV5Header32bppBGRA },
+ { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, wszEnableV5Header32bppBGRA },
};
TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions);
diff --git a/dlls/windowscodecs/encoder.c b/dlls/windowscodecs/encoder.c
index 869588baec1..b634db6f0c2 100644
--- a/dlls/windowscodecs/encoder.c
+++ b/dlls/windowscodecs/encoder.c
@@ -31,28 +31,28 @@
WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
-static const WCHAR wszPngInterlaceOption[] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0};
-static const WCHAR wszPngFilterOption[] = {'F','i','l','t','e','r','O','p','t','i','o','n',0};
-static const WCHAR wszTiffCompressionMethod[] = {'T','i','f','f','C','o','m','p','r','e','s','s','i','o','n','M','e','t','h','o','d',0};
-static const WCHAR wszCompressionQuality[] = {'C','o','m','p','r','e','s','s','i','o','n','Q','u','a','l','i','t','y',0};
-static const WCHAR wszImageQuality[] = {'I','m','a','g','e','Q','u','a','l','i','t','y',0};
-static const WCHAR wszBitmapTransform[] = {'B','i','t','m','a','p','T','r','a','n','s','f','o','r','m',0};
-static const WCHAR wszLuminance[] = {'L','u','m','i','n','a','n','c','e',0};
-static const WCHAR wszChrominance[] = {'C','h','r','o','m','i','n','a','n','c','e',0};
-static const WCHAR wszJpegYCrCbSubsampling[] = {'J','p','e','g','Y','C','r','C','b','S','u','b','s','a','m','p','l','i','n','g',0};
-static const WCHAR wszSuppressApp0[] = {'S','u','p','p','r','e','s','s','A','p','p','0',0};
+static WCHAR wszPngInterlaceOption[] = L"InterlaceOption";
+static WCHAR wszPngFilterOption[] = L"FilterOption";
+static WCHAR wszTiffCompressionMethod[] = L"TiffCompressionMethod";
+static WCHAR wszCompressionQuality[] = L"CompressionQuality";
+static WCHAR wszImageQuality[] = L"ImageQuality";
+static WCHAR wszBitmapTransform[] = L"BitmapTransform";
+static WCHAR wszLuminance[] = L"Luminance";
+static WCHAR wszChrominance[] = L"Chrominance";
+static WCHAR wszJpegYCrCbSubsampling[] = L"JpegYCrCbSubsampling";
+static WCHAR wszSuppressApp0[] = L"SuppressApp0";
static const PROPBAG2 encoder_option_properties[ENCODER_OPTION_END] = {
- { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszPngInterlaceOption },
- { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, (LPOLESTR)wszPngFilterOption },
- { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, (LPOLESTR)wszTiffCompressionMethod },
- { PROPBAG2_TYPE_DATA, VT_R4, 0, 0, (LPOLESTR)wszCompressionQuality },
- { PROPBAG2_TYPE_DATA, VT_R4, 0, 0, (LPOLESTR)wszImageQuality },
- { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, (LPOLESTR)wszBitmapTransform },
- { PROPBAG2_TYPE_DATA, VT_I4 | VT_ARRAY, 0, 0, (LPOLESTR)wszLuminance },
- { PROPBAG2_TYPE_DATA, VT_I4 | VT_ARRAY, 0, 0, (LPOLESTR)wszChrominance },
- { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, (LPOLESTR)wszJpegYCrCbSubsampling },
- { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszSuppressApp0 }
+ { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, wszPngInterlaceOption },
+ { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, wszPngFilterOption },
+ { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, wszTiffCompressionMethod },
+ { PROPBAG2_TYPE_DATA, VT_R4, 0, 0, wszCompressionQuality },
+ { PROPBAG2_TYPE_DATA, VT_R4, 0, 0, wszImageQuality },
+ { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, wszBitmapTransform },
+ { PROPBAG2_TYPE_DATA, VT_I4 | VT_ARRAY, 0, 0, wszLuminance },
+ { PROPBAG2_TYPE_DATA, VT_I4 | VT_ARRAY, 0, 0, wszChrominance },
+ { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, wszJpegYCrCbSubsampling },
+ { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, wszSuppressApp0 }
};
typedef struct CommonEncoder {
--
2.26.2
2
1
To compute format_namespace length and write to an existing buffer.
Also add explicit abi_prefix parameter.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
This series adds support for WinRT contracts type and attribute parsing,
and generation of MIDL-compatible #ifdefs to the generated header files.
Each contract generates a predefined macro, guarding the corresponding
versioned elements, which can be redefined to change the targeted
contract version.
tools/widl/header.c | 2 +-
tools/widl/parser.y | 2 +-
tools/widl/typetree.c | 58 +++++++++++++++++++++---------------------
tools/widl/widltypes.h | 3 ++-
4 files changed, 33 insertions(+), 32 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 015bbe2ece7..a892243fb54 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -132,7 +132,7 @@ static void write_guid(FILE *f, const char *guid_prefix, const char *name, const
static void write_uuid_decl(FILE *f, type_t *type, const UUID *uuid)
{
- char *name = format_namespace(type->namespace, "", "::", type->name);
+ char *name = format_namespace(type->namespace, "", "::", type->name, use_abi_namespace ? "ABI" : NULL);
fprintf(f, "#ifdef __CRT_UUID_DECL\n");
fprintf(f, "__CRT_UUID_DECL(%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
"0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n",
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 160e4029a6e..1bbb2e78f7e 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1922,7 +1922,7 @@ type_t *reg_type(type_t *type, const char *name, struct namespace *namespace, in
if (is_global_namespace(namespace))
type->c_name = name;
else
- type->c_name = format_namespace(namespace, "__x_", "_C", name);
+ type->c_name = format_namespace(namespace, "__x_", "_C", name, use_abi_namespace ? "ABI" : NULL);
nt->type = type;
nt->t = t;
nt->next = namespace->type_hash[hash];
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index c0547b36a96..d211fa8d277 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -89,41 +89,41 @@ const char *type_get_name(const type_t *type, enum name_type name_type)
return NULL;
}
-static char *append_namespace(char *ptr, struct namespace *namespace, const char *separator)
+#define append_buf(f, ...) \
+ do { \
+ int r = f(buf + ret, max(ret, len) - ret, ## __VA_ARGS__); \
+ assert(r >= 0); \
+ ret += r; \
+ } while(0)
+
+static int append_namespace(char *buf, size_t len, struct namespace *namespace, const char *separator, const char *abi_prefix)
{
- if(is_global_namespace(namespace)) {
- if(!use_abi_namespace)
- return ptr;
- strcpy(ptr, "ABI");
- strcat(ptr, separator);
- return ptr + strlen(ptr);
- }
-
- ptr = append_namespace(ptr, namespace->parent, separator);
- strcpy(ptr, namespace->name);
- strcat(ptr, separator);
- return ptr + strlen(ptr);
+ const char *name = namespace && !is_global_namespace(namespace) ? namespace->name : abi_prefix;
+ int ret = 0;
+ if (!name) return 0;
+ if (namespace && !is_global_namespace(namespace)) append_buf(append_namespace, namespace->parent, separator, abi_prefix);
+ append_buf(snprintf, "%s%s", name, separator);
+ return ret;
}
-char *format_namespace(struct namespace *namespace, const char *prefix, const char *separator, const char *suffix)
+static int format_namespace_buffer(char *buf, size_t len, struct namespace *namespace, const char *prefix,
+ const char *separator, const char *suffix, const char *abi_prefix)
{
- unsigned len = strlen(prefix) + strlen(suffix);
- unsigned sep_len = strlen(separator);
- struct namespace *iter;
- char *ret, *ptr;
-
- if(use_abi_namespace && !is_global_namespace(namespace))
- len += 3 /* strlen("ABI") */ + sep_len;
-
- for(iter = namespace; !is_global_namespace(iter); iter = iter->parent)
- len += strlen(iter->name) + sep_len;
+ int ret = 0;
+ append_buf(snprintf, "%s", prefix);
+ append_buf(append_namespace, namespace, separator, abi_prefix);
+ append_buf(snprintf, "%s", suffix);
+ return ret;
+}
- ret = xmalloc(len+1);
- strcpy(ret, prefix);
- ptr = append_namespace(ret + strlen(ret), namespace, separator);
- strcpy(ptr, suffix);
+#undef append_buf
- return ret;
+char *format_namespace(struct namespace *namespace, const char *prefix, const char *separator, const char *suffix, const char *abi_prefix)
+{
+ int len = format_namespace_buffer(NULL, 0, namespace, prefix, separator, suffix, abi_prefix);
+ char *buf = xmalloc(len + 1);
+ format_namespace_buffer(buf, len + 1, namespace, prefix, separator, suffix, abi_prefix);
+ return buf;
}
type_t *type_new_function(var_list_t *args)
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index b02b80e122c..7a43e517698 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -613,7 +613,8 @@ var_list_t *append_var(var_list_t *list, var_t *var);
void init_loc_info(loc_info_t *);
-char *format_namespace(struct namespace *namespace, const char *prefix, const char *separator, const char *suffix);
+char *format_namespace(struct namespace *namespace, const char *prefix, const char *separator, const char *suffix,
+ const char *abi_prefix);
static inline enum type_type type_get_type_detect_alias(const type_t *type)
{
--
2.29.2
2
4
WM_DEVICECHANGE's lParam can be either a pointer to a variant of
DEV_BROADCAST_HDR or an immediate value (usually 0) depending on
the wParam's value.
This fixes a crash when broadcasting WM_DEVICECHANGE with
wParam = DBT_DEVNODES_CHANGED, lParam = 0.
Signed-off-by: Arkadiusz Hiler <ahiler(a)codeweavers.com>
---
dlls/user32/message.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index d8ebbfd32e3..f7ce262f90d 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -1023,7 +1023,7 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
case WM_DEVICECHANGE:
{
DEV_BROADCAST_HDR *header = (DEV_BROADCAST_HDR *)lparam;
- push_data( data, header, header->dbch_size );
+ if ((wparam & 0x8000) && header) push_data( data, header, header->dbch_size );
return 0;
}
case WM_WINE_KEYBOARD_LL_HOOK:
@@ -1426,6 +1426,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
if (!get_buffer_space( buffer, sizeof(BOOL) )) return FALSE;
break;
case WM_DEVICECHANGE:
+ if (!(*wparam & 0x8000)) return TRUE;
minsize = sizeof(DEV_BROADCAST_HDR);
break;
case WM_WINE_KEYBOARD_LL_HOOK:
--
2.29.2
2
4
This fixes an issue when, if an external font path was modified in the
Windows key, it was then not considered as external anymore, but still
present in the external key, and then dropped from both on update.
This now forcefully updates the font path in both keys if needed.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
This series doesn't improve performance much, maybe ~10ms over ~800ms
for prefix startup, but it's not completely obvious.
The goal here is to reduce the registry pressure on process and prefix
startup, by loading fonts from the system rather than enumerating the
registry, when possible, and using the registry font cache only for the
volatile application fonts.
This also makes all processes rely on FreeType font loading to list the
system fonts, which will bring more leverage to incoming optimizations
of that part of the code.
dlls/gdi32/font.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index db87a283b13..28179aec54a 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -7958,8 +7958,8 @@ void font_init(void)
HKEY key = load_external_font_keys();
load_system_bitmap_fonts();
load_file_system_fonts();
- load_registry_fonts();
font_funcs->load_fonts();
+ load_registry_fonts();
update_external_font_keys( key );
RegCloseKey( key );
}
--
2.29.2
2
11