Wine-devel
Threads by month
- ----- 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
July 2021
- 86 participants
- 642 discussions
[PATCH 1/2] qedit/tests: Check the Sample Grabber's buffer during and after flushing.
by Gabriel Ivăncescu 04 Oct '22
by Gabriel Ivăncescu 04 Oct '22
04 Oct '22
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
dlls/qedit/tests/samplegrabber.c | 234 +++++++++++++++++++++++++++++++
1 file changed, 234 insertions(+)
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c
index 8e68e3e..e66180f 100644
--- a/dlls/qedit/tests/samplegrabber.c
+++ b/dlls/qedit/tests/samplegrabber.c
@@ -1036,6 +1036,239 @@ static void test_connect_pin(void)
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
+struct frame_thread_params
+{
+ IMemInputPin *sink;
+ IMediaSample *sample;
+ DWORD delay;
+};
+
+static DWORD WINAPI frame_thread(void *arg)
+{
+ struct frame_thread_params *params = arg;
+ HRESULT hr;
+
+ if (params->delay)
+ {
+ if (winetest_debug > 1) trace("%04x: Sleeping %u ms.\n", GetCurrentThreadId(), params->delay);
+ Sleep(params->delay);
+ }
+ if (winetest_debug > 1) trace("%04x: Sending frame.\n", GetCurrentThreadId());
+ hr = IMemInputPin_Receive(params->sink, params->sample);
+ if (winetest_debug > 1) trace("%04x: Returned %#x.\n", GetCurrentThreadId(), hr);
+ IMediaSample_Release(params->sample);
+ free(params);
+ return hr;
+}
+
+static HANDLE send_frame_time(IMemInputPin *sink, REFERENCE_TIME start_time, unsigned char color, DWORD delay)
+{
+ struct frame_thread_params *params = malloc(sizeof(*params));
+ IMemAllocator *allocator;
+ REFERENCE_TIME end_time;
+ IMediaSample *sample;
+ HANDLE thread;
+ HRESULT hr;
+ BYTE *data;
+
+ hr = IMemInputPin_GetAllocator(sink, &allocator);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
+ if (hr == VFW_E_NOT_COMMITTED)
+ {
+ IMemAllocator_Commit(allocator);
+ hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
+ }
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IMediaSample_GetPointer(sample, &data);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ memset(data, 0x55, 32 * 16 * 2);
+
+ hr = IMediaSample_SetActualDataLength(sample, 32 * 16 * 2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ start_time *= 10000000;
+ end_time = start_time + 10000000;
+ hr = IMediaSample_SetTime(sample, &start_time, &end_time);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ params->sink = sink;
+ params->sample = sample;
+ params->delay = delay;
+ thread = CreateThread(NULL, 0, frame_thread, params, 0, NULL);
+
+ IMemAllocator_Release(allocator);
+ return thread;
+}
+
+static HANDLE send_frame(IMemInputPin *sink, DWORD delay)
+{
+ return send_frame_time(sink, 0, 0x55, delay); /* purple */
+}
+
+static HRESULT join_thread_(int line, HANDLE thread)
+{
+ DWORD ret;
+ ok_(__FILE__, line)(!WaitForSingleObject(thread, 1000), "Wait failed.\n");
+ GetExitCodeThread(thread, &ret);
+ CloseHandle(thread);
+ return ret;
+}
+#define join_thread(a) join_thread_(__LINE__, a)
+
+static void test_buffer_flush(void)
+{
+ AM_MEDIA_TYPE req_mt =
+ {
+ .majortype = MEDIATYPE_Video,
+ .subtype = MEDIASUBTYPE_RGB565,
+ .formattype = FORMAT_VideoInfo,
+ .bTemporalCompression = TRUE,
+ };
+ LONG buf[(32 * 16 * 2) / sizeof(LONG)], size = sizeof(buf);
+ IPin *sink, *source, *renderer_pin;
+ struct testfilter testsource;
+ ISampleGrabber *grabber;
+ IMediaControl *control;
+ IFilterGraph2 *graph;
+ IMemInputPin *input;
+ IBaseFilter *filter;
+ OAFilterState state;
+ IMediaFilter *mf;
+ HANDLE thread;
+ DWORD ticks;
+ unsigned i;
+ HRESULT hr;
+ ULONG ref;
+
+ testfilter_init(&testsource);
+ CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IFilterGraph2, (void **)&graph);
+ CoCreateInstance(&CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IBaseFilter, (void **)&filter);
+ IFilterGraph2_AddFilter(graph, filter, L"sink");
+ IBaseFilter_FindPin(filter, L"In", &renderer_pin);
+ IBaseFilter_Release(filter);
+
+ filter = create_sample_grabber();
+ IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source");
+ IFilterGraph2_AddFilter(graph, filter, L"sample grabber");
+ IBaseFilter_FindPin(filter, L"In", &sink);
+ IBaseFilter_FindPin(filter, L"Out", &source);
+ IBaseFilter_QueryInterface(filter, &IID_ISampleGrabber, (void **)&grabber);
+ IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
+ IPin_QueryInterface(sink, &IID_IMemInputPin, (void **)&input);
+
+ ISampleGrabber_SetMediaType(grabber, &req_mt);
+ ISampleGrabber_SetBufferSamples(grabber, TRUE);
+
+ testsource.sink_mt = &req_mt;
+ hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IFilterGraph2_ConnectDirect(graph, source, renderer_pin, &req_mt);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ IPin_Release(renderer_pin);
+
+ IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&mf);
+ IMediaFilter_SetSyncSource(mf, NULL);
+ IMediaFilter_Release(mf);
+
+ hr = IMemInputPin_ReceiveCanBlock(input);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = ISampleGrabber_GetCurrentBuffer(grabber, &size, buf);
+ ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
+
+ hr = IMediaControl_Pause(control);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ hr = IMediaControl_GetState(control, 0, &state);
+ ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
+
+ thread = send_frame(input, 0);
+ hr = IMediaControl_GetState(control, 1000, &state);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
+
+ for (i = 0; i < 3; i++)
+ {
+ ticks = GetTickCount();
+ hr = ISampleGrabber_GetCurrentBuffer(grabber, &size, buf);
+ ticks = GetTickCount() - ticks;
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(ticks < 100, "Got %u ticks.\n", ticks);
+ ok(size == sizeof(buf), "Got size %d.\n", size);
+ }
+
+ hr = IMediaControl_Stop(control);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = join_thread(thread);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IMediaControl_GetState(control, 1000, &state);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(state == State_Stopped, "Got state %d.\n", state);
+ hr = ISampleGrabber_GetCurrentBuffer(grabber, &size, buf);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IMediaControl_Pause(control);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ hr = IMediaControl_GetState(control, 0, &state);
+ ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
+
+ thread = send_frame(input, 0);
+ hr = IMediaControl_GetState(control, 1000, &state);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
+
+ for (i = 0; i < 3; i++)
+ {
+ ticks = GetTickCount();
+ hr = ISampleGrabber_GetCurrentBuffer(grabber, &size, buf);
+ ticks = GetTickCount() - ticks;
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(ticks < 100, "Got %u ticks.\n", ticks);
+ ok(size == sizeof(buf), "Got size %d.\n", size);
+ }
+
+ IPin_BeginFlush(sink);
+ hr = join_thread(thread);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = ISampleGrabber_GetCurrentBuffer(grabber, &size, buf);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ IPin_EndFlush(sink);
+
+ hr = IMediaControl_GetState(control, 0, &state);
+ todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
+
+ ticks = GetTickCount();
+ thread = send_frame(input, 150);
+ hr = ISampleGrabber_GetCurrentBuffer(grabber, &size, buf);
+ ticks = GetTickCount() - ticks;
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(ticks < 100, "Got %u ticks.\n", ticks);
+ ok(size == sizeof(buf), "Got size %d.\n", size);
+
+ hr = IMediaControl_GetState(control, 1000, &state);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Stop(control);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = join_thread(thread);
+ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ IPin_Release(sink);
+ IPin_Release(source);
+ IMemInputPin_Release(input);
+ IMediaControl_Release(control);
+ ref = IFilterGraph2_Release(graph);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ISampleGrabber_Release(grabber);
+ ref = IBaseFilter_Release(filter);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ref = IBaseFilter_Release(&testsource.filter.IBaseFilter_iface);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
START_TEST(samplegrabber)
{
IBaseFilter *filter;
@@ -1059,6 +1292,7 @@ START_TEST(samplegrabber)
test_aggregation();
test_media_types();
test_connect_pin();
+ test_buffer_flush();
CoUninitialize();
}
--
2.21.0
5
7
24 Jan '22
To help gdb reload symbol files from /proc/<pid>/maps, making it
possible to load debug info for ELF and PE modules for Wine processes.
When sourced (from ~/.gdbinit for instance), this adds a new
"load-symbol-files" command (with an "lsf" alias), which automatically
calls add-symbol-file on every mapped file that can be read as ELF or
PE, with the correct section offset.
The command has to be run manually, for instance after executing for
a while, to load new modules that may have been loaded, as there's no
way for gdb to be notified of such changes automatically.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
This is some script I've been using for a while, and more or less broken
versions are also used by other people, so I figured maybe it would be
better to have a proper working version officially distributed with Wine
source instead, as it's pretty useful for debugging Wine under gdb.
It's still a bit manual to use, as gdb cannot easily be notified of
dynamic library loading [1], but I think it's much better than having
nothing.
[1] in theory there's ways to do it using systemtap probes, but it's
going to be hard to make it work, especially for PE modules.
tools/gdbinit.py | 108 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 108 insertions(+)
create mode 100644 tools/gdbinit.py
diff --git a/tools/gdbinit.py b/tools/gdbinit.py
new file mode 100644
index 00000000000..265d97722b7
--- /dev/null
+++ b/tools/gdbinit.py
@@ -0,0 +1,108 @@
+#!/bin/env python3
+
+# Copyright 2021 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
+
+from __future__ import print_function
+
+import gdb
+import re
+import subprocess
+import sys
+
+class LoadSymbolFiles(gdb.Command):
+ 'Command to load symbol files directly from /proc/<pid>/maps.'
+
+ def __init__(self):
+ sup = super(LoadSymbolFiles, self)
+ sup.__init__('load-symbol-files', gdb.COMMAND_FILES, gdb.COMPLETE_NONE,
+ False)
+
+ self.libs = {}
+ gdb.execute('alias -a lsf = load-symbol-files', True)
+
+ def invoke(self, arg, from_tty):
+ pid = gdb.selected_inferior().pid
+ if not pid in self.libs: self.libs[pid] = {}
+
+ def command(cmd, confirm=from_tty):
+ to_string = not from_tty
+ gdb.execute(cmd, from_tty=confirm, to_string=to_string)
+
+ def execute(cmd):
+ return subprocess.check_output(cmd, stderr=subprocess.STDOUT) \
+ .decode('utf-8')
+
+ # load mappings addresses
+ libs = {}
+ with open('/proc/{}/maps'.format(pid), 'r') as maps:
+ for line in maps:
+ addr, _, _, _, node, path = re.split(r'\s+', line, 5)
+ path = path.strip()
+ if node == '0': continue
+ if path in libs: continue
+ libs[path] = int(addr.split('-')[0], 16)
+
+ # unload symbol file if address changed
+ for k in set(libs) & set(self.libs[pid]):
+ if libs[k] != self.libs[pid][k]:
+ command('remove-symbol-file "{}"'.format(k), confirm=False)
+ del self.libs[k]
+
+ # load symbol file for new mappings
+ for k in set(libs) - set(self.libs[pid]):
+ if arg is not None and re.search(arg, k) is None: continue
+ addr = self.libs[pid][k] = libs[k]
+ offs = None
+
+ try:
+ out = execute(['file', k])
+ except:
+ continue
+
+ # try loading mapping as ELF
+ try:
+ out = execute(['readelf', '-l', k])
+ for line in out.split('\n'):
+ if not 'LOAD' in line: continue
+ base = int(line.split()[2], 16)
+ break
+
+ out = execute(['objdump', '-h', k])
+ for line in out.split('\n'):
+ if not '.text' in line: continue
+ offs = int(line.split()[3], 16) - base
+ break
+ if offs is None: continue
+
+ # try again, assuming mapping is PE
+ except:
+ try:
+ out = execute(['objdump', '-h', k])
+ for line in out.split('\n'):
+ if not '.text' in line: continue
+ offs = int(line.split()[5], 16)
+ break
+ if offs is None: continue
+
+ except:
+ continue
+
+ command('add-symbol-file "{}" 0x{:x}'.format(k, addr + offs),
+ confirm=False)
+
+
+LoadSymbolFiles()
--
2.31.0
3
7
I'm sending this as an RFC for now as there's been some discussion
already about how to handle PE dependencies. I think the approach I'm
taking here, by including FAudio headers directly in the source and
loading it dynamically is the easiest way, and the least disruptive for
building and running Wine, if not the cleanest. All the other solutions
have higher friction, either on third party packages, or on the system
distribution.
Upstream FAudio now has a pure Win32 backend, which makes it much easier
to build as PE. This was never a requirement, and this series should
work too with the SDL2 backend, as it tries to load Wine Mono SDL2 and
FAudio as a fallback after trying from the prefix system libraries.
It could help the transition though, and is going to be required anyway
to support WMA decoding. Right now, with or without the Win32 backend,
this would also introduce a functional regression as although supported
by the new FAudio Win32 backend, it also depends on the WMA decoder MF
transform to be implemented, which isn't the case yet in Wine.
Cheers,
Rémi Bernon (5):
xactengine3_7: Move sources to xaudio2_7.
xaudio2_7: Load FAudio dynamically.
xaudio2_7: Import FAudio headers for private use.
xaudio2_7: Build with msvcrt.
xaudio2_7: Use msvcrt allocation functions.
configure.ac | 55 -
dlls/x3daudio1_0/Makefile.in | 4 +-
dlls/x3daudio1_1/Makefile.in | 4 +-
dlls/x3daudio1_2/Makefile.in | 4 +-
dlls/x3daudio1_3/Makefile.in | 4 +-
dlls/x3daudio1_4/Makefile.in | 4 +-
dlls/x3daudio1_5/Makefile.in | 4 +-
dlls/x3daudio1_6/Makefile.in | 4 +-
dlls/x3daudio1_7/Makefile.in | 4 +-
dlls/xactengine2_0/Makefile.in | 6 +-
dlls/xactengine2_4/Makefile.in | 6 +-
dlls/xactengine2_7/Makefile.in | 6 +-
dlls/xactengine2_9/Makefile.in | 6 +-
dlls/xactengine3_0/Makefile.in | 6 +-
dlls/xactengine3_1/Makefile.in | 6 +-
dlls/xactengine3_2/Makefile.in | 6 +-
dlls/xactengine3_3/Makefile.in | 6 +-
dlls/xactengine3_4/Makefile.in | 6 +-
dlls/xactengine3_5/Makefile.in | 6 +-
dlls/xactengine3_6/Makefile.in | 6 +-
dlls/xactengine3_7/Makefile.in | 5 +-
dlls/xapofx1_1/Makefile.in | 4 +-
dlls/xapofx1_2/Makefile.in | 4 +-
dlls/xapofx1_3/Makefile.in | 4 +-
dlls/xapofx1_4/Makefile.in | 4 +-
dlls/xapofx1_5/Makefile.in | 4 +-
dlls/xaudio2_0/Makefile.in | 4 +-
dlls/xaudio2_1/Makefile.in | 4 +-
dlls/xaudio2_2/Makefile.in | 4 +-
dlls/xaudio2_3/Makefile.in | 4 +-
dlls/xaudio2_4/Makefile.in | 4 +-
dlls/xaudio2_5/Makefile.in | 4 +-
dlls/xaudio2_6/Makefile.in | 4 +-
dlls/xaudio2_7/FAudio/F3DAudio.h | 262 ++++
dlls/xaudio2_7/FAudio/FACT.h | 814 ++++++++++
dlls/xaudio2_7/FAudio/FACT3D.h | 127 ++
dlls/xaudio2_7/FAudio/FAPO.h | 207 +++
dlls/xaudio2_7/FAudio/FAPOBase.h | 264 ++++
dlls/xaudio2_7/FAudio/FAPOFX.h | 178 +++
dlls/xaudio2_7/FAudio/FAudio.h | 1322 +++++++++++++++++
dlls/xaudio2_7/FAudio/FAudioFX.h | 308 ++++
dlls/xaudio2_7/Makefile.in | 4 +-
dlls/xaudio2_7/compat.c | 92 +-
dlls/xaudio2_7/faudio.c | 326 ++++
dlls/xaudio2_7/x3daudio.c | 35 +-
.../xact_classes.idl | 0
dlls/{xactengine3_7 => xaudio2_7}/xact_dll.c | 182 ++-
dlls/xaudio2_7/xapo.c | 29 +-
dlls/xaudio2_7/xapofx.c | 21 +-
dlls/xaudio2_7/xaudio_allocator.c | 2 -
dlls/xaudio2_7/xaudio_dll.c | 267 ++--
dlls/xaudio2_7/xaudio_private.h | 149 +-
dlls/xaudio2_8/Makefile.in | 4 +-
dlls/xaudio2_9/Makefile.in | 4 +-
54 files changed, 4298 insertions(+), 505 deletions(-)
create mode 100644 dlls/xaudio2_7/FAudio/F3DAudio.h
create mode 100644 dlls/xaudio2_7/FAudio/FACT.h
create mode 100644 dlls/xaudio2_7/FAudio/FACT3D.h
create mode 100644 dlls/xaudio2_7/FAudio/FAPO.h
create mode 100644 dlls/xaudio2_7/FAudio/FAPOBase.h
create mode 100644 dlls/xaudio2_7/FAudio/FAPOFX.h
create mode 100644 dlls/xaudio2_7/FAudio/FAudio.h
create mode 100644 dlls/xaudio2_7/FAudio/FAudioFX.h
create mode 100644 dlls/xaudio2_7/faudio.c
rename dlls/{xactengine3_7 => xaudio2_7}/xact_classes.idl (100%)
rename dlls/{xactengine3_7 => xaudio2_7}/xact_dll.c (87%)
--
2.31.0
16
85
[PATCH v2] include: Remove interfaces already define in msxml6.idl
by Alistair Leslie-Hughes 10 Aug '21
by Alistair Leslie-Hughes 10 Aug '21
10 Aug '21
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msxml3/factory.c | 1 +
dlls/msxml3/tests/saxreader.c | 1 +
dlls/msxml3/tests/schema.c | 5 ++
dlls/msxml3/uuid.c | 11 ++++
include/msxml2.idl | 109 ----------------------------------
include/msxml6.idl | 24 ++++----
6 files changed, 30 insertions(+), 121 deletions(-)
diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c
index 445cfbf730d..b8452ff4b4e 100644
--- a/dlls/msxml3/factory.c
+++ b/dlls/msxml3/factory.c
@@ -35,6 +35,7 @@
#include "ole2.h"
#include "msxml.h"
#include "msxml2.h"
+#include "msxml6.h"
#include "xmlparser.h"
/* undef the #define in msxml2 so that we can access the v.2 version
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index e401aafc87d..05e9d2c3468 100644
--- a/dlls/msxml3/tests/saxreader.c
+++ b/dlls/msxml3/tests/saxreader.c
@@ -29,6 +29,7 @@
#include "windows.h"
#include "ole2.h"
#include "msxml2.h"
+#include "msxml6.h"
#include "msxml2did.h"
#include "ocidl.h"
#include "dispex.h"
diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c
index b66be76c159..cb95394aa39 100644
--- a/dlls/msxml3/tests/schema.c
+++ b/dlls/msxml3/tests/schema.c
@@ -32,6 +32,11 @@
#include "dispex.h"
#include "cguid.h"
+DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+
#include "wine/test.h"
#define EXPECT_HR(hr,hr_exp) \
diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c
index 4abbe5e4763..333d4f3d3c7 100644
--- a/dlls/msxml3/uuid.c
+++ b/dlls/msxml3/uuid.c
@@ -41,6 +41,17 @@
#include "initguid.h"
#include "msxml2.h"
+/* Cannot include msxml6 here since we will get a duplicate LIBID_MSXML2 error. */
+DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_MXNamespaceManager60, 0x88d96a11, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+
/*
* Note that because of a #define in msxml2.h, we end up initializing
* CLSID_DOMDocument2 to be the v.3 version independent DOMDocument
diff --git a/include/msxml2.idl b/include/msxml2.idl
index 916e0e8ab3d..1d1ba7a5248 100644
--- a/include/msxml2.idl
+++ b/include/msxml2.idl
@@ -1612,15 +1612,6 @@ coclass FreeThreadedDOMDocument40
[default, source] dispinterface XMLDOMDocumentEvents;
}
-[
- uuid(88d96a06-f192-11d4-a65f-0040963251e5),
-]
-coclass FreeThreadedDOMDocument60
-{
- [default] interface IXMLDOMDocument3;
- [default, source] dispinterface XMLDOMDocumentEvents;
-}
-
[
helpstring("Free threaded XML DOM Document"),
progid("Msxml2.FreeThreadedDOMDocument"),
@@ -1662,14 +1653,6 @@ coclass XMLHTTP40
[default] interface IXMLHTTPRequest;
}
-[
- uuid(88d96a0a-f192-11d4-a65f-0040963251e5)
-]
-coclass XMLHTTP60
-{
- [default] interface IXMLHTTPRequest;
-}
-
[
helpstring("XML HTTP"),
progid("Msxml2.XMLHTTP"),
@@ -1702,14 +1685,6 @@ coclass ServerXMLHTTP40
[default] interface IServerXMLHTTPRequest2;
}
-[
- uuid(88d96a0b-f192-11d4-a65f-0040963251e5)
-]
-coclass ServerXMLHTTP60
-{
- [default] interface IServerXMLHTTPRequest2;
-}
-
[
helpstring("Server XML HTTP"),
progid("Msxml2.ServerXMLHTTP"),
@@ -1750,14 +1725,6 @@ coclass XMLSchemaCache40
[default] interface IXMLDOMSchemaCollection2;
}
-[
- uuid(88d96a07-f192-11d4-a65f-0040963251e5)
-]
-coclass XMLSchemaCache60
-{
- [default] interface IXMLDOMSchemaCollection2;
-}
-
[
helpstring("XML Schema Cache"),
progid("Msxml2.XMLSchemaCache"),
@@ -1798,14 +1765,6 @@ coclass XSLTemplate40
[default] interface IXSLTemplate;
}
-[
- uuid(88d96a08-f192-11d4-a65f-0040963251e5)
-]
-coclass XSLTemplate60
-{
- [default] interface IXSLTemplate;
-}
-
[
helpstring("XSL Template"),
progid("Msxml2.XSLTemplate"),
@@ -3297,15 +3256,6 @@ coclass SAXXMLReader40
interface ISAXXMLReader;
}
-[
- uuid(88d96a0c-f192-11d4-a65f-0040963251e5)
-]
-coclass SAXXMLReader60
-{
- [default] interface IVBSAXXMLReader;
- interface ISAXXMLReader;
-}
-
[
helpstring("SAX XML Reader"),
progid("Msxml2.SAXXMLReader"),
@@ -3380,26 +3330,6 @@ coclass MXHTMLWriter40
interface IVBSAXLexicalHandler;
}
-[
- uuid(88d96a10-f192-11d4-a65f-0040963251e5)
-]
-coclass MXHTMLWriter60
-{
- [default] interface IMXWriter;
-
- interface ISAXContentHandler;
- interface ISAXDeclHandler;
- interface ISAXDTDHandler;
- interface ISAXErrorHandler;
- interface ISAXLexicalHandler;
-
- interface IVBSAXContentHandler;
- interface IVBSAXDeclHandler;
- interface IVBSAXDTDHandler;
- interface IVBSAXErrorHandler;
- interface IVBSAXLexicalHandler;
-}
-
[
helpstring("MXXMLWriter 3.0"),
progid("Msxml2.MXXMLWriter.3.0"),
@@ -3444,26 +3374,6 @@ coclass MXXMLWriter40
interface IVBSAXLexicalHandler;
}
-[
- uuid(88d96a0f-f192-11d4-a65f-0040963251e5)
-]
-coclass MXXMLWriter60
-{
- [default] interface IMXWriter;
-
- interface ISAXContentHandler;
- interface ISAXDeclHandler;
- interface ISAXDTDHandler;
- interface ISAXErrorHandler;
- interface ISAXLexicalHandler;
-
- interface IVBSAXContentHandler;
- interface IVBSAXDeclHandler;
- interface IVBSAXDTDHandler;
- interface IVBSAXErrorHandler;
- interface IVBSAXLexicalHandler;
-}
-
[
helpstring("MXXMLWriter"),
progid("Msxml2.MXXMLWriter"),
@@ -3506,15 +3416,6 @@ coclass MXNamespaceManager40
interface IMXNamespaceManager;
}
-[
- uuid(88d96a11-f192-11d4-a65f-0040963251e5)
-]
-coclass MXNamespaceManager60
-{
- [default] interface IVBMXNamespaceManager;
- interface IMXNamespaceManager;
-}
-
[
helpstring("SAXAttributes 3.0"),
progid("Msxml2.SAXAttributes.3.0"),
@@ -3539,16 +3440,6 @@ coclass SAXAttributes40
interface ISAXAttributes;
}
-[
- uuid(88d96a0e-f192-11d4-a65f-0040963251e5)
-]
-coclass SAXAttributes60
-{
- [default] interface IMXAttributes;
- interface IVBSAXAttributes;
- interface ISAXAttributes;
-}
-
[
helpstring("SAXAttributes"),
progid("Msxml2.SAXAttributes"),
diff --git a/include/msxml6.idl b/include/msxml6.idl
index 4948de39f1f..e6a0a5feda5 100644
--- a/include/msxml6.idl
+++ b/include/msxml6.idl
@@ -3048,18 +3048,6 @@ coclass DOMDocument60
[default, source] dispinterface XMLDOMDocumentEvents;
}
-[
- helpstring("Free threaded XML DOM Document 6.0"),
- progid("Msxml2.FreeThreadedDOMDocument.6.0"),
- threading(both),
- uuid(88d96a06-f192-11d4-a65f-0040963251e5),
-]
-coclass FreeThreadedDOMDocument60
-{
- [default] interface IXMLDOMDocument3;
- [default, source] dispinterface XMLDOMDocumentEvents;
-}
-
[
helpstring("SAX XML Reader 6.0"),
progid("Msxml2.SAXXMLReader.6.0"),
@@ -3165,6 +3153,18 @@ coclass XSLTemplate60
[default] interface IXSLTemplate;
}
+[
+ helpstring("Free threaded XML DOM Document 6.0"),
+ progid("Msxml2.FreeThreadedDOMDocument.6.0"),
+ threading(both),
+ uuid(88d96a06-f192-11d4-a65f-0040963251e5),
+]
+coclass FreeThreadedDOMDocument60
+{
+ [default] interface IXMLDOMDocument3;
+ [default, source] dispinterface XMLDOMDocumentEvents;
+}
+
[
helpstring("XML HTTP 6.0"),
progid("Msxml2.XMLHTTP.6.0"),
--
2.30.2
3
3
IRequestDictionary had the wrong UUID specified (IResponse one).
Found by using MIDL instead of WIDL to compile Wine headers:
duplicated IID caused compilation error in MIDL.
Signed-off-by: Andrew Boyarshin <andrew.boyarshin(a)gmail.com>
---
dlls/msxml3/tests/domdoc.c | 2 +-
include/asptlb.idl | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index df30104a1560..a7890d56f71f 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -13170,7 +13170,7 @@ static HRESULT WINAPI transformdest_QueryInterface(IUnknown *iface, REFIID riid,
IsEqualIID(riid, &IID_IServiceProvider) ||
IsEqualIID(riid, &IID_IStream) ||
IsEqualIID(riid, &IID_ISequentialStream) ||
- IsEqualIID(riid, &IID_IRequestDictionary);
+ IsEqualIID(riid, &IID_IResponse);
todo_wine_if(IsEqualIID(riid, &IID_IXMLDOMDocument))
ok(known_iid, "Unexpected riid %s\n", wine_dbgstr_guid(riid));
diff --git a/include/asptlb.idl b/include/asptlb.idl
index b38bc5d1fe9c..07f250702dd6 100644
--- a/include/asptlb.idl
+++ b/include/asptlb.idl
@@ -23,7 +23,7 @@ import "oaidl.idl";
[
object,
dual,
- uuid(D97A6DA0-A864-11cf-83BE-00A0C90C2BD8)
+ uuid(D97A6DA0-A85F-11DF-83AE-00A0C90C2BD8)
]
interface IRequestDictionary : IDispatch
{
--
2.32.0.windows.1
2
1
Based on the DXVA AV1 specs
https://www.microsoft.com/en-us/download/details.aspx?id=101577
The structures and the associated define are available in Windows SDK
since at least 10.0.20231.0.
The GUIDs were present in previous SDKs as well.
---
include/dxva.h | 279 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 279 insertions(+)
diff --git a/include/dxva.h b/include/dxva.h
index 4f18f2e60da..b474bd87111 100644
--- a/include/dxva.h
+++ b/include/dxva.h
@@ -563,6 +563,285 @@ typedef struct _DXVA_Status_VPx
USHORT wNumMbsAffected;
} DXVA_Status_VPx, *LPDXVA_Status_VPx;
+
+#define _DIRECTX_AV1_VA_
+
+/* AV1 decoder GUIDs */
+DEFINE_GUID(DXVA_ModeAV1_VLD_Profile0, 0xb8be4ccb, 0xcf53, 0x46ba, 0x8d, 0x59, 0xd6, 0xb8, 0xa6, 0xda, 0x5d, 0x2a);
+DEFINE_GUID(DXVA_ModeAV1_VLD_Profile1, 0x6936ff0f, 0x45b1, 0x4163, 0x9c, 0xc1, 0x64, 0x6e, 0xf6, 0x94, 0x61, 0x08);
+DEFINE_GUID(DXVA_ModeAV1_VLD_Profile2, 0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8);
+DEFINE_GUID(DXVA_ModeAV1_VLD_12bit_Profile2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0);
+DEFINE_GUID(DXVA_ModeAV1_VLD_12bit_Profile2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8);
+
+/* AV1 picture entry data structure */
+typedef struct _DXVA_PicEntry_AV1 {
+ UINT width;
+ UINT height;
+
+ // Global motion parameters
+ INT wmmat[6];
+ union {
+ struct {
+ UCHAR wminvalid : 1;
+ UCHAR wmtype : 2;
+ UCHAR Reserved : 5;
+ };
+ UCHAR GlobalMotionFlags;
+ };
+ UCHAR Index;
+ USHORT Reserved16Bits;
+} DXVA_PicEntry_AV1, *LPDXVA_PicEntry_AV1;
+
+/* AV1 picture parameters data structure */
+typedef struct _DXVA_PicParams_AV1 {
+ UINT width;
+ UINT height;
+
+ UINT max_width;
+ UINT max_height;
+
+ UCHAR CurrPicTextureIndex;
+ UCHAR superres_denom;
+ UCHAR bitdepth;
+ UCHAR seq_profile;
+
+ // Tiles:
+ struct {
+ UCHAR cols;
+ UCHAR rows;
+ USHORT context_update_id;
+ USHORT widths[64];
+ USHORT heights[64];
+ } tiles;
+
+ // Coding Tools
+ union {
+ struct {
+ UINT use_128x128_superblock : 1;
+ UINT intra_edge_filter : 1;
+ UINT interintra_compound : 1;
+ UINT masked_compound : 1;
+ UINT warped_motion : 1;
+ UINT dual_filter : 1;
+ UINT jnt_comp : 1;
+ UINT screen_content_tools : 1;
+ UINT integer_mv : 1;
+ UINT cdef : 1;
+ UINT restoration : 1;
+ UINT film_grain : 1;
+ UINT intrabc : 1;
+ UINT high_precision_mv : 1;
+ UINT switchable_motion_mode : 1;
+ UINT filter_intra : 1;
+ UINT disable_frame_end_update_cdf : 1;
+ UINT disable_cdf_update : 1;
+ UINT reference_mode : 1;
+ UINT skip_mode : 1;
+ UINT reduced_tx_set : 1;
+ UINT superres : 1;
+ UINT tx_mode : 2;
+ UINT use_ref_frame_mvs : 1;
+ UINT enable_ref_frame_mvs : 1;
+ UINT reference_frame_update : 1;
+ UINT Reserved : 5;
+ };
+ UINT32 CodingParamToolFlags;
+ } coding;
+
+ // Format & Picture Info flags
+ union {
+ struct {
+ UCHAR frame_type : 2;
+ UCHAR show_frame : 1;
+ UCHAR showable_frame : 1;
+ UCHAR subsampling_x : 1;
+ UCHAR subsampling_y : 1;
+ UCHAR mono_chrome : 1;
+ UCHAR Reserved : 1;
+ };
+ UCHAR FormatAndPictureInfoFlags;
+ } format;
+
+ // References
+ UCHAR primary_ref_frame;
+ UCHAR order_hint;
+ UCHAR order_hint_bits;
+
+ DXVA_PicEntry_AV1 frame_refs[7];
+ UCHAR RefFrameMapTextureIndex[8];
+
+ // Loop filter parameters
+ struct {
+ UCHAR filter_level[2];
+ UCHAR filter_level_u;
+ UCHAR filter_level_v;
+
+ UCHAR sharpness_level;
+ union {
+ struct {
+ UCHAR mode_ref_delta_enabled : 1;
+ UCHAR mode_ref_delta_update : 1;
+ UCHAR delta_lf_multi : 1;
+ UCHAR delta_lf_present : 1;
+ UCHAR Reserved : 4;
+ };
+ UCHAR ControlFlags;
+ } DUMMYUNIONNAME;
+ CHAR ref_deltas[8];
+ CHAR mode_deltas[2];
+ UCHAR delta_lf_res;
+ UCHAR frame_restoration_type[3];
+ USHORT log2_restoration_unit_size[3];
+ UINT16 Reserved16Bits;
+ } loop_filter;
+
+ // Quantization
+ struct {
+ union {
+ struct {
+ UCHAR delta_q_present : 1;
+ UCHAR delta_q_res : 2;
+ UCHAR Reserved : 5;
+ };
+ UCHAR ControlFlags;
+ } DUMMYUNIONNAME;
+
+ UCHAR base_qindex;
+ CHAR y_dc_delta_q;
+ CHAR u_dc_delta_q;
+ CHAR v_dc_delta_q;
+ CHAR u_ac_delta_q;
+ CHAR v_ac_delta_q;
+ // using_qmatrix:
+ UCHAR qm_y;
+ UCHAR qm_u;
+ UCHAR qm_v;
+ UINT16 Reserved16Bits;
+ } quantization;
+
+ // Cdef parameters
+ struct {
+ union {
+ struct {
+ UCHAR damping : 2;
+ UCHAR bits : 2;
+ UCHAR Reserved : 4;
+ };
+ UCHAR ControlFlags;
+ } DUMMYUNIONNAME;
+
+ union {
+ struct {
+ UCHAR primary : 6;
+ UCHAR secondary : 2;
+ };
+ UCHAR combined;
+ } y_strengths[8];
+
+ union {
+ struct {
+ UCHAR primary : 6;
+ UCHAR secondary : 2;
+ };
+ UCHAR combined;
+ } uv_strengths[8];
+
+ } cdef;
+
+ UCHAR interp_filter;
+
+ // Segmentation
+ struct {
+ union {
+ struct {
+ UCHAR enabled : 1;
+ UCHAR update_map : 1;
+ UCHAR update_data : 1;
+ UCHAR temporal_update : 1;
+ UCHAR Reserved : 4;
+ };
+ UCHAR ControlFlags;
+ } DUMMYUNIONNAME;
+ UCHAR Reserved24Bits[3];
+
+ union {
+ struct {
+ UCHAR alt_q : 1;
+ UCHAR alt_lf_y_v : 1;
+ UCHAR alt_lf_y_h : 1;
+ UCHAR alt_lf_u : 1;
+ UCHAR alt_lf_v : 1;
+ UCHAR ref_frame : 1;
+ UCHAR skip : 1;
+ UCHAR globalmv : 1;
+ };
+ UCHAR mask;
+ } feature_mask[8];
+
+ SHORT feature_data[8][8];
+
+ } segmentation;
+
+ struct {
+ union {
+ struct {
+ USHORT apply_grain : 1;
+ USHORT scaling_shift_minus8 : 2;
+ USHORT chroma_scaling_from_luma : 1;
+ USHORT ar_coeff_lag : 2;
+ USHORT ar_coeff_shift_minus6 : 2;
+ USHORT grain_scale_shift : 2;
+ USHORT overlap_flag : 1;
+ USHORT clip_to_restricted_range : 1;
+ USHORT matrix_coeff_is_identity : 1;
+ USHORT Reserved : 3;
+ };
+ USHORT ControlFlags;
+ } DUMMYUNIONNAME;
+
+ USHORT grain_seed;
+ UCHAR scaling_points_y[14][2];
+ UCHAR num_y_points;
+ UCHAR scaling_points_cb[10][2];
+ UCHAR num_cb_points;
+ UCHAR scaling_points_cr[10][2];
+ UCHAR num_cr_points;
+ UCHAR ar_coeffs_y[24];
+ UCHAR ar_coeffs_cb[25];
+ UCHAR ar_coeffs_cr[25];
+ UCHAR cb_mult;
+ UCHAR cb_luma_mult;
+ UCHAR cr_mult;
+ UCHAR cr_luma_mult;
+ UCHAR Reserved8Bits;
+ SHORT cb_offset;
+ SHORT cr_offset;
+ } film_grain;
+
+ UINT Reserved32Bits;
+ UINT StatusReportFeedbackNumber;
+} DXVA_PicParams_AV1, *LPDXVA_PicParams_AV1;
+
+/* AV1 tile data structure */
+typedef struct _DXVA_Tile_AV1 {
+ UINT DataOffset;
+ UINT DataSize;
+ USHORT row;
+ USHORT column;
+ USHORT Reserved16Bits;
+ UCHAR anchor_frame;
+ UCHAR Reserved8Bits;
+} DXVA_Tile_AV1, *LPDXVA_Tile_AV1;
+
+typedef struct _DXVA_Status_AV1 {
+ UINT StatusReportFeedbackNumber;
+ DXVA_PicEntry_AV1 CurrPic;
+ UCHAR bBufType;
+ UCHAR bStatus;
+ UCHAR bReserved8Bits;
+ USHORT wNumMbsAffected;
+} DXVA_Status_AV1, *LPDXVA_Status_AV1;
+
#include <poppack.h>
typedef enum _DXVA_VideoChromaSubsampling
--
2.26.2
4
7
[PATCH] combase: When looking up an apartment which has a given creator thread ID use multi-threaded apartment only if the thread doesn't have an apartment-threaded one.
by Dmitry Timoshkov 06 Aug '21
by Dmitry Timoshkov 06 Aug '21
06 Aug '21
CoIncrementMTAUsage() always creates the MTA if it doesn't already exist,
and mta->tid may accidently match the apt->tid of the apartment-threaded
apartment of the thread.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/combase/apartment.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/combase/apartment.c b/dlls/combase/apartment.c
index 108d6a71c5c..690bc69db1b 100644
--- a/dlls/combase/apartment.c
+++ b/dlls/combase/apartment.c
@@ -663,13 +663,20 @@ struct apartment * apartment_findfromtid(DWORD tid)
EnterCriticalSection(&apt_cs);
LIST_FOR_EACH_ENTRY(apt, &apts, struct apartment, entry)
{
- if (apt->tid == tid)
+ if (apt != mta && apt->tid == tid)
{
result = apt;
apartment_addref(result);
break;
}
}
+
+ if (!result && mta && mta->tid == tid)
+ {
+ result = mta;
+ apartment_addref(result);
+ }
+
LeaveCriticalSection(&apt_cs);
return result;
--
2.31.1
2
1
[PATCH] ole32/tests: Add more tests for CoIncrementMTAUsage/CoDecrementMTAUsage.
by Dmitry Timoshkov 06 Aug '21
by Dmitry Timoshkov 06 Aug '21
06 Aug '21
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/ole32/tests/compobj.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index d1e947e393f..1d46a5b9c13 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -4098,6 +4098,25 @@ static void test_mta_usage(void)
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE);
+
+ hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ test_apt_type(APTTYPE_MAINSTA, APTTYPEQUALIFIER_NONE);
+
+ cookie = 0;
+ hr = pCoIncrementMTAUsage(&cookie);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(cookie != NULL, "Unexpected cookie %p.\n", cookie);
+
+ test_apt_type(APTTYPE_MAINSTA, APTTYPEQUALIFIER_NONE);
+
+ hr = pCoDecrementMTAUsage(cookie);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ CoUninitialize();
+
+ test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE);
}
static void test_CoCreateInstanceFromApp(void)
--
2.31.1
3
3
05 Aug '21
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=50210
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/d3dx11_42/Makefile.in | 1 +
dlls/d3dx11_43/Makefile.in | 1 +
dlls/d3dx11_43/main.c | 9 -
dlls/d3dx11_43/tests/d3dx11.c | 668 ++++++++++++++++++++++++++++++++++
dlls/d3dx11_43/texture.c | 176 +++++++++
5 files changed, 846 insertions(+), 9 deletions(-)
diff --git a/dlls/d3dx11_42/Makefile.in b/dlls/d3dx11_42/Makefile.in
index dbc31e2407d..410d4555d2f 100644
--- a/dlls/d3dx11_42/Makefile.in
+++ b/dlls/d3dx11_42/Makefile.in
@@ -1,6 +1,7 @@
EXTRADEFS = -DD3DX11_SDK_VERSION=42
MODULE = d3dx11_42.dll
IMPORTS = d3dcompiler
+DELAYIMPORTS = windowscodecs
PARENTSRC = ../d3dx11_43
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
diff --git a/dlls/d3dx11_43/Makefile.in b/dlls/d3dx11_43/Makefile.in
index b69f3f1ce02..ed23958a671 100644
--- a/dlls/d3dx11_43/Makefile.in
+++ b/dlls/d3dx11_43/Makefile.in
@@ -2,6 +2,7 @@ EXTRADEFS = -DD3DX11_SDK_VERSION=43
MODULE = d3dx11_43.dll
IMPORTLIB = d3dx11
IMPORTS = d3dcompiler
+DELAYIMPORTS = windowscodecs
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
diff --git a/dlls/d3dx11_43/main.c b/dlls/d3dx11_43/main.c
index 950f6d76f5c..00c1db35e42 100644
--- a/dlls/d3dx11_43/main.c
+++ b/dlls/d3dx11_43/main.c
@@ -66,12 +66,3 @@ HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *filename, ID3DX11ThreadP
return E_NOTIMPL;
}
-
-HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump,
- D3DX11_IMAGE_INFO *img_info, HRESULT *hresult)
-{
- FIXME("src_data %p, src_data_size %lu, pump %p, img_info %p, hresult %p stub!\n",
- src_data, src_data_size, pump, img_info, hresult);
-
- return E_NOTIMPL;
-}
diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c
index 06924877da4..a53c79a25b9 100644
--- a/dlls/d3dx11_43/tests/d3dx11.c
+++ b/dlls/d3dx11_43/tests/d3dx11.c
@@ -25,6 +25,646 @@
static WCHAR temp_dir[MAX_PATH];
+/* 1x1 1bpp bmp image */
+static const BYTE test_bmp_1bpp[] =
+{
+ 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00,
+ 0x00, 0x00
+};
+static const BYTE test_bmp_1bpp_data[] =
+{
+ 0xf3, 0xf2, 0xf1, 0xff
+};
+
+/* 1x1 4bpp bmp image */
+static const BYTE test_bmp_4bpp[] =
+{
+ 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00,
+ 0x00, 0x00
+};
+static const BYTE test_bmp_4bpp_data[] =
+{
+ 0xf3, 0xf2, 0xf1, 0xff
+};
+
+/* 1x1 8bpp bmp image */
+static const BYTE test_bmp_8bpp[] =
+{
+ 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00,
+ 0x00, 0x00
+};
+static const BYTE test_bmp_8bpp_data[] =
+{
+ 0xf3, 0xf2, 0xf1, 0xff
+};
+
+/* 1x1 16bpp bmp image */
+static const BYTE test_bmp_16bpp[] =
+{
+ 0x42, 0x4d, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x42, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_bmp_16bpp_data[] =
+{
+ 0x84, 0x84, 0x73, 0xff
+};
+
+/* 1x1 24bpp bmp image */
+static const BYTE test_bmp_24bpp[] =
+{
+ 0x42, 0x4d, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x84, 0x84, 0x00, 0x00, 0x00
+};
+static const BYTE test_bmp_24bpp_data[] =
+{
+ 0x84, 0x84, 0x73, 0xff
+};
+
+/* 2x2 32bpp XRGB bmp image */
+static const BYTE test_bmp_32bpp_xrgb[] =
+{
+ 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2,
+ 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x00
+};
+static const BYTE test_bmp_32bpp_xrgb_data[] =
+{
+ 0xc2, 0xb2, 0xa2, 0xff, 0xc3, 0xb3, 0xa3, 0xff, 0xc0, 0xb0, 0xa0, 0xff, 0xc1, 0xb1, 0xa1, 0xff
+
+};
+
+/* 2x2 32bpp ARGB bmp image */
+static const BYTE test_bmp_32bpp_argb[] =
+{
+ 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2,
+ 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x01
+};
+static const BYTE test_bmp_32bpp_argb_data[] =
+{
+ 0xc2, 0xb2, 0xa2, 0xff, 0xc3, 0xb3, 0xa3, 0xff, 0xc0, 0xb0, 0xa0, 0xff, 0xc1, 0xb1, 0xa1, 0xff
+
+};
+
+/* 1x1 8bpp gray png image */
+static const BYTE test_png_8bpp_gray[] =
+{
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7e, 0x9b,
+ 0x55, 0x00, 0x00, 0x00, 0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0x0f, 0x00, 0x01,
+ 0x01, 0x01, 0x00, 0x1b, 0xb6, 0xee, 0x56, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
+ 0x42, 0x60, 0x82
+};
+static const BYTE test_png_8bpp_gray_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff
+};
+
+/* 1x1 jpg image */
+static const BYTE test_jpg[] =
+{
+ 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x01, 0x2c,
+ 0x01, 0x2c, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05,
+ 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x07, 0x0c, 0x08, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0b,
+ 0x0b, 0x09, 0x0c, 0x11, 0x0f, 0x12, 0x12, 0x11, 0x0f, 0x11, 0x11, 0x13, 0x16, 0x1c, 0x17, 0x13,
+ 0x14, 0x1a, 0x15, 0x11, 0x11, 0x18, 0x21, 0x18, 0x1a, 0x1d, 0x1d, 0x1f, 0x1f, 0x1f, 0x13, 0x17,
+ 0x22, 0x24, 0x22, 0x1e, 0x24, 0x1c, 0x1e, 0x1f, 0x1e, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x05, 0x05,
+ 0x05, 0x07, 0x06, 0x07, 0x0e, 0x08, 0x08, 0x0e, 0x1e, 0x14, 0x11, 0x14, 0x1e, 0x1e, 0x1e, 0x1e,
+ 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
+ 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
+ 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0xff, 0xc0,
+ 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11,
+ 0x01, 0xff, 0xc4, 0x00, 0x15, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xc4, 0x00, 0x14, 0x10, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc4,
+ 0x00, 0x14, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xc4, 0x00, 0x14, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01,
+ 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xb2, 0xc0, 0x07, 0xff, 0xd9
+};
+static const BYTE test_jpg_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff
+};
+
+/* 1x1 gif image */
+static const BYTE test_gif[] =
+{
+ 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x01, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44,
+ 0x01, 0x00, 0x3b
+};
+static const BYTE test_gif_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff
+};
+
+/* 1x1 tiff image */
+static const BYTE test_tiff[] =
+{
+ 0x49, 0x49, 0x2a, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xfe, 0x00,
+ 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x03, 0x01,
+ 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x03, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x02, 0x00, 0x1b, 0x00, 0x00, 0x00, 0xd8, 0x00,
+ 0x00, 0x00, 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x12, 0x01,
+ 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x01, 0x03, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x16, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00,
+ 0x00, 0x00, 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1a, 0x01,
+ 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2f, 0x6d, 0x65,
+ 0x68, 0x2f, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74,
+ 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48,
+ 0x00, 0x00, 0x00, 0x01
+};
+static const BYTE test_tiff_data[] =
+{
+ 0x00, 0x00, 0x00, 0xff
+};
+
+/* 1x1 alpha dds image */
+static const BYTE test_dds_alpha[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff
+};
+static const BYTE test_dds_alpha_data[] =
+{
+ 0xff
+};
+
+/* 1x1 luminance dds image */
+static const BYTE test_dds_luminance[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x82
+};
+static const BYTE test_dds_luminance_data[] =
+{
+ 0x82, 0x82, 0x82, 0xff
+};
+
+/* 1x1 16bpp dds image */
+static const BYTE test_dds_16bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
+ 0xe0, 0x03, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0e, 0x42
+};
+static const BYTE test_dds_16bpp_data[] =
+{
+ 0x84, 0x84, 0x73, 0xff
+};
+
+/* 1x1 24bpp dds image */
+static const BYTE test_dds_24bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
+ 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x70, 0x81, 0x83
+};
+static const BYTE test_dds_24bpp_data[] =
+{
+ 0x83, 0x81, 0x70, 0xff
+};
+
+/* 1x1 32bpp dds image */
+static const BYTE test_dds_32bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
+ 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x70, 0x81, 0x83, 0xff
+};
+static const BYTE test_dds_32bpp_data[] =
+{
+ 0x83, 0x81, 0x70, 0xff
+};
+
+/* 1x1 64bpp dds image */
+static const BYTE test_dds_64bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xff, 0xff
+};
+static const BYTE test_dds_64bpp_data[] =
+{
+ 0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xff, 0xff
+};
+
+/* 1x1 96bpp dds image */
+static const BYTE test_dds_96bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x31, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e
+};
+static const BYTE test_dds_96bpp_data[] =
+{
+ 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e
+};
+
+/* 1x1 128bpp dds image */
+static const BYTE test_dds_128bpp[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e, 0x00, 0x00, 0x80, 0x3f
+};
+static const BYTE test_dds_128bpp_data[] =
+{
+ 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e, 0x00, 0x00, 0x80, 0x3f
+
+};
+
+/* 4x4 DXT1 dds image */
+static const BYTE test_dds_dxt1[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x2a, 0x31, 0xf5, 0xbc, 0xe3, 0x6e, 0x2a, 0x3a
+};
+static const BYTE test_dds_dxt1_data[] =
+{
+ 0x2a, 0x31, 0xf5, 0xbc, 0xe3, 0x6e, 0x2a, 0x3a
+};
+
+/* 4x4 DXT2 dds image */
+static const BYTE test_dds_dxt2[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b,
+ 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55
+};
+static const BYTE test_dds_dxt2_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b
+
+};
+
+/* 1x3 DXT3 dds image */
+static const BYTE test_dds_dxt3[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x92, 0x38, 0x84, 0x00, 0xff, 0x55, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x53, 0x8b, 0x53, 0x8b, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_dds_dxt3_data[] =
+{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4e, 0x92, 0xd6, 0x83, 0x00, 0xaa, 0x55, 0x55
+
+};
+
+/* 4x4 DXT4 dds image */
+static const BYTE test_dds_dxt4[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b,
+ 0xff, 0x00, 0x40, 0x02, 0x24, 0x49, 0x92, 0x24, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55,
+ 0xff, 0x00, 0x48, 0x92, 0x24, 0x49, 0x92, 0x24, 0xce, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55
+};
+static const BYTE test_dds_dxt4_data[] =
+{
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b
+
+};
+
+/* 4x2 DXT5 dds image */
+static const BYTE test_dds_dxt5[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50
+};
+static const BYTE test_dds_dxt5_data[] =
+{
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x05, 0x05
+
+};
+
+/* 4x4 BC4 dds image */
+static const BYTE test_dds_bc4[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x42, 0x43, 0x34, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xd9, 0x15, 0xbc, 0x41, 0x5b, 0xa3, 0x3d, 0x3a, 0x8f, 0x3d, 0x45, 0x81, 0x20, 0x45, 0x81, 0x20,
+ 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_dds_bc4_data[] =
+{
+ 0xd9, 0x15, 0xbc, 0x41, 0x5b, 0xa3, 0x3d, 0x3a
+};
+
+/* 6x3 BC5 dds image */
+static const BYTE test_dds_bc5[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x42, 0x43, 0x35, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x9f, 0x28, 0x73, 0xac, 0xd5, 0x80, 0xaa, 0xd5, 0x70, 0x2c, 0x4e, 0xd6, 0x76, 0x1d, 0xd6, 0x76,
+ 0xd5, 0x0f, 0xc3, 0x50, 0x96, 0xcf, 0x53, 0x96, 0xdf, 0x16, 0xc3, 0x50, 0x96, 0xcf, 0x53, 0x96,
+ 0x83, 0x55, 0x08, 0x83, 0x30, 0x08, 0x83, 0x30, 0x79, 0x46, 0x31, 0x1c, 0xc3, 0x31, 0x1c, 0xc3,
+ 0x6d, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_dds_bc5_data[] =
+{
+ 0x95, 0x35, 0xe2, 0xa3, 0xf5, 0xd2, 0x28, 0x68, 0x65, 0x32, 0x7c, 0x4e, 0xdb, 0xe4, 0x56, 0x0a,
+ 0xb9, 0x33, 0xaf, 0xf0, 0x52, 0xbe, 0xed, 0x27, 0xb4, 0x2e, 0xa6, 0x60, 0x4e, 0xb6, 0x5d, 0x3f
+
+};
+
+/* 4x4 DXT1 cube map */
+static const BYTE test_dds_cube[] =
+{
+ 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
+ 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55,
+ 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7,
+ 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00,
+ 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55,
+ 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7,
+ 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00,
+ 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55,
+ 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7,
+ 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00
+};
+static const BYTE test_dds_cube_data[] =
+{
+ 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7
+};
+
+static const struct test_image
+{
+ const BYTE *data;
+ unsigned int size;
+ const BYTE *expected_data;
+ D3DX11_IMAGE_INFO expected_info;
+}
+test_image[] =
+{
+ {
+ test_bmp_1bpp, sizeof(test_bmp_1bpp), test_bmp_1bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_4bpp, sizeof(test_bmp_4bpp), test_bmp_4bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_8bpp, sizeof(test_bmp_8bpp), test_bmp_8bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_16bpp, sizeof(test_bmp_16bpp), test_bmp_16bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_24bpp, sizeof(test_bmp_24bpp), test_bmp_24bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_32bpp_xrgb, sizeof(test_bmp_32bpp_xrgb), test_bmp_32bpp_xrgb_data,
+ {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_bmp_32bpp_argb, sizeof(test_bmp_32bpp_argb), test_bmp_32bpp_argb_data,
+ {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}
+ },
+ {
+ test_png_8bpp_gray, sizeof(test_png_8bpp_gray), test_png_8bpp_gray_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_PNG}
+ },
+ {
+ test_jpg, sizeof(test_jpg), test_jpg_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_JPG}
+ },
+ {
+ test_gif, sizeof(test_gif), test_gif_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_GIF}
+ },
+ {
+ test_tiff, sizeof(test_tiff), test_tiff_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_TIFF}
+ },
+ {
+ test_dds_alpha, sizeof(test_dds_alpha), test_dds_alpha_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_luminance, sizeof(test_dds_luminance), test_dds_luminance_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_16bpp, sizeof(test_dds_16bpp), test_dds_16bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_24bpp, sizeof(test_dds_24bpp), test_dds_24bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_32bpp, sizeof(test_dds_32bpp), test_dds_32bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_64bpp, sizeof(test_dds_64bpp), test_dds_64bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R16G16B16A16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_96bpp, sizeof(test_dds_96bpp), test_dds_96bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_128bpp, sizeof(test_dds_128bpp), test_dds_128bpp_data,
+ {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32A32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt1, sizeof(test_dds_dxt1), test_dds_dxt1_data,
+ {4, 4, 1, 1, 1, 0, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt2, sizeof(test_dds_dxt2), test_dds_dxt2_data,
+ {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt3, sizeof(test_dds_dxt3), test_dds_dxt3_data,
+ {1, 3, 1, 1, 2, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt4, sizeof(test_dds_dxt4), test_dds_dxt4_data,
+ {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC3_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_dxt5, sizeof(test_dds_dxt5), test_dds_dxt5_data,
+ {4, 2, 1, 1, 1, 0, DXGI_FORMAT_BC3_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_bc4, sizeof(test_dds_bc4), test_dds_bc4_data,
+ {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC4_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_bc5, sizeof(test_dds_bc5), test_dds_bc5_data,
+ {6, 3, 1, 1, 3, 0, DXGI_FORMAT_BC5_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+ {
+ test_dds_cube, sizeof(test_dds_cube), test_dds_cube_data,
+ {4, 4, 1, 6, 3, 0x4, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}
+ },
+};
+
+static void check_image_info(D3DX11_IMAGE_INFO *image_info, const struct test_image *image, unsigned int line)
+{
+ ok_(__FILE__, line)(image_info->Width == image->expected_info.Width,
+ "Got unexpected Width %u, expected %u.\n",
+ image_info->Width, image->expected_info.Width);
+ ok_(__FILE__, line)(image_info->Height == image->expected_info.Height,
+ "Got unexpected Height %u, expected %u.\n",
+ image_info->Height, image->expected_info.Height);
+ ok_(__FILE__, line)(image_info->Depth == image->expected_info.Depth,
+ "Got unexpected Depth %u, expected %u.\n",
+ image_info->Depth, image->expected_info.Depth);
+ ok_(__FILE__, line)(image_info->ArraySize == image->expected_info.ArraySize,
+ "Got unexpected ArraySize %u, expected %u.\n",
+ image_info->ArraySize, image->expected_info.ArraySize);
+ ok_(__FILE__, line)(image_info->MipLevels == image->expected_info.MipLevels,
+ "Got unexpected MipLevels %u, expected %u.\n",
+ image_info->MipLevels, image->expected_info.MipLevels);
+ ok_(__FILE__, line)(image_info->MiscFlags == image->expected_info.MiscFlags,
+ "Got unexpected MiscFlags %#x, expected %#x.\n",
+ image_info->MiscFlags, image->expected_info.MiscFlags);
+ ok_(__FILE__, line)(image_info->Format == image->expected_info.Format,
+ "Got unexpected Format %#x, expected %#x.\n",
+ image_info->Format, image->expected_info.Format);
+ ok_(__FILE__, line)(image_info->ResourceDimension == image->expected_info.ResourceDimension,
+ "Got unexpected ResourceDimension %u, expected %u.\n",
+ image_info->ResourceDimension, image->expected_info.ResourceDimension);
+ ok_(__FILE__, line)(image_info->ImageFileFormat == image->expected_info.ImageFileFormat,
+ "Got unexpected ImageFileFormat %u, expected %u.\n",
+ image_info->ImageFileFormat, image->expected_info.ImageFileFormat);
+}
+
static BOOL create_file(const WCHAR *filename, const char *data, unsigned int size, WCHAR *out_path)
{
WCHAR path[MAX_PATH];
@@ -404,10 +1044,38 @@ static void test_D3DX11CompileFromFile(void)
delete_directory(L"include");
}
+static void test_get_image_info(void)
+{
+ D3DX11_IMAGE_INFO image_info;
+ unsigned int i;
+ DWORD dword;
+ HRESULT hr;
+
+ hr = D3DX11GetImageInfoFromMemory(test_image[0].data, 0, NULL, &image_info, NULL);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ hr = D3DX11GetImageInfoFromMemory(NULL, test_image[0].size, NULL, &image_info, NULL);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ hr = D3DX11GetImageInfoFromMemory(&dword, sizeof(dword), NULL, &image_info, NULL);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+
+ for (i = 0; i < ARRAY_SIZE(test_image); ++i)
+ {
+ winetest_push_context("Test %u", i);
+
+ hr = D3DX11GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ if (hr == S_OK)
+ check_image_info(&image_info, test_image + i, __LINE__);
+
+ winetest_pop_context();
+ }
+}
+
START_TEST(d3dx11)
{
test_D3DX11CreateAsyncMemoryLoader();
test_D3DX11CreateAsyncFileLoader();
test_D3DX11CreateAsyncResourceLoader();
test_D3DX11CompileFromFile();
+ test_get_image_info();
}
diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c
index ee6808d76d6..8addf4f84d3 100644
--- a/dlls/d3dx11_43/texture.c
+++ b/dlls/d3dx11_43/texture.c
@@ -15,14 +15,190 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define COBJMACROS
#include "d3dx11.h"
#include "d3dcompiler.h"
+#include "wincodec.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
+HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT sdk_version, IWICImagingFactory **imaging_factory);
+
+static const struct
+{
+ const GUID *wic_container_guid;
+ D3DX11_IMAGE_FILE_FORMAT d3dx_file_format;
+}
+file_formats[] =
+{
+ { &GUID_ContainerFormatBmp, D3DX11_IFF_BMP },
+ { &GUID_ContainerFormatJpeg, D3DX11_IFF_JPG },
+ { &GUID_ContainerFormatPng, D3DX11_IFF_PNG },
+ { &GUID_ContainerFormatDds, D3DX11_IFF_DDS },
+ { &GUID_ContainerFormatTiff, D3DX11_IFF_TIFF },
+ { &GUID_ContainerFormatGif, D3DX11_IFF_GIF },
+ { &GUID_ContainerFormatWmp, D3DX11_IFF_WMP },
+};
+
+static D3DX11_IMAGE_FILE_FORMAT wic_container_guid_to_file_format(GUID *container_format)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(file_formats); ++i)
+ {
+ if (IsEqualGUID(file_formats[i].wic_container_guid, container_format))
+ return file_formats[i].d3dx_file_format;
+ }
+ return D3DX11_IFF_FORCE_DWORD;
+}
+
+static D3D11_RESOURCE_DIMENSION wic_dimension_to_d3dx11_dimension(WICDdsDimension wic_dimension)
+{
+ switch (wic_dimension)
+ {
+ case WICDdsTexture1D:
+ return D3D11_RESOURCE_DIMENSION_TEXTURE1D;
+ case WICDdsTexture2D:
+ case WICDdsTextureCube:
+ return D3D11_RESOURCE_DIMENSION_TEXTURE2D;
+ case WICDdsTexture3D:
+ return D3D11_RESOURCE_DIMENSION_TEXTURE3D;
+ default:
+ return D3D11_RESOURCE_DIMENSION_UNKNOWN;
+ }
+}
+
+static const DXGI_FORMAT to_be_converted_format[] =
+{
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_R8_UNORM,
+ DXGI_FORMAT_R8G8_UNORM,
+ DXGI_FORMAT_B5G6R5_UNORM,
+ DXGI_FORMAT_B4G4R4A4_UNORM,
+ DXGI_FORMAT_B5G5R5A1_UNORM,
+ DXGI_FORMAT_B8G8R8X8_UNORM,
+ DXGI_FORMAT_B8G8R8A8_UNORM
+};
+
+static DXGI_FORMAT get_d3dx11_dds_format(DXGI_FORMAT format)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(to_be_converted_format); ++i)
+ {
+ if (format == to_be_converted_format[i])
+ return DXGI_FORMAT_R8G8B8A8_UNORM;
+ }
+ return format;
+}
+
+HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump,
+ D3DX11_IMAGE_INFO *img_info, HRESULT *hresult)
+{
+ IWICBitmapFrameDecode *frame = NULL;
+ IWICImagingFactory *factory = NULL;
+ IWICDdsDecoder *dds_decoder = NULL;
+ IWICBitmapDecoder *decoder = NULL;
+ WICDdsParameters dds_params;
+ IWICStream *stream = NULL;
+ unsigned int frame_count;
+ GUID container_format;
+ HRESULT hr;
+
+ TRACE("src_data %p, src_data_size %lu, pump %p, img_info %p, hresult %p.\n",
+ src_data, src_data_size, pump, img_info, hresult);
+
+ if (!src_data || !src_data_size || !img_info)
+ return E_FAIL;
+ if (pump)
+ FIXME("Thread pump is not supported yet.\n");
+
+ WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
+ IWICImagingFactory_CreateStream(factory, &stream);
+ hr = IWICStream_InitializeFromMemory(stream, (BYTE *)src_data, src_data_size);
+ if (FAILED(hr))
+ {
+ WARN("Failed to initialize stream.\n");
+ goto end;
+ }
+ hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder);
+ if (FAILED(hr))
+ goto end;
+
+ hr = IWICBitmapDecoder_GetContainerFormat(decoder, &container_format);
+ if (FAILED(hr))
+ goto end;
+ img_info->ImageFileFormat = wic_container_guid_to_file_format(&container_format);
+ if (img_info->ImageFileFormat == D3DX11_IFF_FORCE_DWORD)
+ {
+ hr = E_FAIL;
+ WARN("Unsupported image file format %s.\n", debugstr_guid(&container_format));
+ goto end;
+ }
+
+ hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
+ if (FAILED(hr) || !frame_count)
+ goto end;
+ hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
+ if (FAILED(hr))
+ goto end;
+ hr = IWICBitmapFrameDecode_GetSize(frame, &img_info->Width, &img_info->Height);
+ if (FAILED(hr))
+ goto end;
+
+ if (img_info->ImageFileFormat == D3DX11_IFF_DDS)
+ {
+ hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder);
+ if (FAILED(hr))
+ goto end;
+ hr = IWICDdsDecoder_GetParameters(dds_decoder, &dds_params);
+ if (FAILED(hr))
+ goto end;
+ img_info->ArraySize = dds_params.ArraySize;
+ img_info->Depth = dds_params.Depth;
+ img_info->MipLevels = dds_params.MipLevels;
+ img_info->ResourceDimension = wic_dimension_to_d3dx11_dimension(dds_params.Dimension);
+ img_info->Format = get_d3dx11_dds_format(dds_params.DxgiFormat);
+ img_info->MiscFlags = 0;
+ if (dds_params.Dimension == WICDdsTextureCube)
+ {
+ img_info->MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;
+ img_info->ArraySize *= 6;
+ }
+ }
+ else
+ {
+ img_info->ArraySize = 1;
+ img_info->Depth = 1;
+ img_info->MipLevels = 1;
+ img_info->ResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D;
+ img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ img_info->MiscFlags = 0;
+ }
+
+end:
+ if (dds_decoder)
+ IWICDdsDecoder_Release(dds_decoder);
+ if (frame)
+ IWICBitmapFrameDecode_Release(frame);
+ if (decoder)
+ IWICBitmapDecoder_Release(decoder);
+ if (stream)
+ IWICStream_Release(stream);
+ if (factory)
+ IWICImagingFactory_Release(factory);
+
+ if (hr != S_OK)
+ {
+ WARN("Invalid or unsupported image file.\n");
+ return E_FAIL;
+ }
+ return S_OK;
+}
+
HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, const void *data,
SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump,
ID3D11ShaderResourceView **view, HRESULT *hresult)
--
2.30.2
2
2
[PATCH] oleaut32: Fix locale settings caching in VARIANT_GetLocalisedNumberChars().
by Francois Gouget 05 Aug '21
by Francois Gouget 05 Aug '21
05 Aug '21
Don't cache locale data coming from the registry because it could change
at any time.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
Previously the settings of the first VarParseNumFromStr(LOCALE_USER_DEFAULT)
call ended up being cached and used for all the remaining tests, thus
causing many of them to fail.
There's a comment that says the caching is because all these lookups are
slow. And I guess the common case it likely to be the one that's no
longer cached: i.e. getting the current user's preferences from the
registry.
But all in all that case does not seem that slow (roughly 1.1 us per
call) so unless it's called millions of times it should be ok. Also
checking the registry key's last modification time would not make it
much faster (I expect at most x2).
---
dlls/oleaut32/tests/vartest.c | 12 +++---------
dlls/oleaut32/variant.c | 16 +++++++++++-----
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c
index bed4de469df..89859988f1f 100644
--- a/dlls/oleaut32/tests/vartest.c
+++ b/dlls/oleaut32/tests/vartest.c
@@ -2198,7 +2198,7 @@ static void test_VarParseNumFromStrMisc(void)
/* But SMONDECIMALSEP has no default! */
SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONDECIMALSEP, L"");
hres = wconvert_str(L"3.9", ARRAY_SIZE(rgb), NUMPRS_DECIMAL|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0);
- todo_wine EXPECTFAIL;
+ EXPECTFAIL;
SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, L".");
SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONDECIMALSEP, L".");
@@ -2206,9 +2206,7 @@ static void test_VarParseNumFromStrMisc(void)
SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, L" ");
hres = wconvert_str(L"1 000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS, &np, rgb, LOCALE_USER_DEFAULT, 0);
- if (broken(1)) /* FIXME Reenable once Wine is less broken */
EXPECT(1,NUMPRS_THOUSANDS,NUMPRS_THOUSANDS,5,0,3);
- todo_wine ok(np.dwOutFlags == NUMPRS_THOUSANDS, "Got dwOutFlags=%08x\n", np.dwOutFlags);
EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */
EXPECTRGB(4,FAILDIG);
@@ -2225,9 +2223,7 @@ static void test_VarParseNumFromStrMisc(void)
SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHOUSANDSEP, L" ");
hres = wconvert_str(L"1|000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS, &np, rgb, LOCALE_USER_DEFAULT, 0);
- if (broken(1)) /* FIXME Reenable once Wine is less broken */
EXPECT(1,NUMPRS_THOUSANDS,NUMPRS_THOUSANDS,5,0,3);
- todo_wine ok(np.dwOutFlags == NUMPRS_THOUSANDS, "Got dwOutFlags=%08x\n", np.dwOutFlags);
EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */
EXPECTRGB(4,FAILDIG);
@@ -2235,9 +2231,7 @@ static void test_VarParseNumFromStrMisc(void)
EXPECTFAIL;
hres = wconvert_str(L"1|000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY, &np, rgb, LOCALE_USER_DEFAULT, 0);
- if (broken(1)) /* FIXME Reenable once Wine is less broken */
EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY,NUMPRS_THOUSANDS,5,0,3);
- todo_wine ok(np.dwOutFlags == NUMPRS_THOUSANDS, "Got dwOutFlags=%08x\n", np.dwOutFlags);
EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */
EXPECTRGB(4,FAILDIG);
@@ -2298,14 +2292,14 @@ static void test_VarParseNumFromStrMisc(void)
SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, L"\xa0");
hres = wconvert_str(L"1 000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0);
- todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS,5,0,3);
+ EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS,5,0,3);
EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */
EXPECTRGB(4,FAILDIG);
/* Regular thousands separators also have precedence over the currency ones */
hres = wconvert_str(L"1\xa0\x30\x30\x30", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0);
- todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS,5,0,3);
+ EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_THOUSANDS,5,0,3);
EXPECTRGB(0,1); /* Don't test extra digits, see "1,000" test */
EXPECTRGB(4,FAILDIG);
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index e4993de75a5..15fc7f9042e 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -1529,8 +1529,11 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
EnterCriticalSection(&cache_cs);
/* Asking for default locale entries is very expensive: It is a registry
- server call. So cache one locally, as Microsoft does it too */
- if(lcid == lastLcid && dwFlags == lastFlags)
+ * server call. So cache one locally, as Microsoft does it too.
+ * Note: Data in the registry could change at any time so only cache when
+ * LOCALE_NOUSEROVERRIDE is used.
+ */
+ if (lctype && lcid == lastLcid && dwFlags == lastFlags)
{
memcpy(lpChars, &lastChars, sizeof(defaultChars));
LeaveCriticalSection(&cache_cs);
@@ -1557,9 +1560,12 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
TRACE("lcid 0x%x, cCurrencyLocal=%d,%d %s\n", lcid, lpChars->cCurrencyLocal,
lpChars->cCurrencyLocal2, wine_dbgstr_w(buff));
- memcpy(&lastChars, lpChars, sizeof(defaultChars));
- lastLcid = lcid;
- lastFlags = dwFlags;
+ if (lctype)
+ {
+ memcpy(&lastChars, lpChars, sizeof(defaultChars));
+ lastLcid = lcid;
+ lastFlags = dwFlags;
+ }
LeaveCriticalSection(&cache_cs);
}
--
2.20.1
1
4