Compare commits

..

66 Commits
v7.14 ... v7.20

Author SHA1 Message Date
Alistair Leslie-Hughes
acb054627a Release v7.20 2022-11-01 10:26:30 +11:00
Alistair Leslie-Hughes
f07f287395 Updated mfplat-streaming-support patchset
Re-enabled.

0065 Disabled until it can properly be rebased.

Patch 0055 - Helps some games which request ARB32 output but doesn't always draw well.
2022-10-25 13:35:44 +11:00
Alistair Leslie-Hughes
8703ad8375 Rebase against 65797763b3ac4fcab7ffc83a4f95b2e87c81f58a. 2022-10-25 11:28:21 +11:00
Alistair Leslie-Hughes
1f500db5b7 Updated nvcuda-CUDA_Support patchset
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53809
2022-10-21 14:54:58 +11:00
Alistair Leslie-Hughes
1deec9df95 Small change 2022-10-20 21:45:55 +11:00
Alistair Leslie-Hughes
a8e296715c Updated URL's to gitlab 2022-10-20 21:24:52 +11:00
Alistair Leslie-Hughes
43d5c1e0f5 Rebase against e72a16b57f66b63a16bb3d1619ac4d42632cb141. 2022-10-20 11:18:53 +11:00
Alistair Leslie-Hughes
41a3c56c50 Release v7.19 2022-10-17 12:17:38 +11:00
Zebediah Figura
5be23b8ae8 Rebase against e3f00bf7c944f1cde6151fde969f2b49649c3de7. 2022-10-16 16:22:20 -05:00
Zebediah Figura
769ddd9f00 ntdll-Junction_Points: Updates from Erich E. Hoover. 2022-10-16 16:22:16 -05:00
Zebediah Figura
aabde22767 Rebase against fded20df6c7422e85dbcd5a20475fd0c5d38d3c6. 2022-10-13 19:46:39 -05:00
Zebediah Figura
ca3220cbd6 Rebase against f87ad783e23a2b6f5e9b8cf78dbf99bad4471a25. 2022-10-13 16:00:57 -05:00
Alistair Leslie-Hughes
ff6cef5d72 Rebase against f87ad783e23a2b6f5e9b8cf78dbf99bad4471a25. 2022-10-13 08:52:08 +11:00
Alistair Leslie-Hughes
d2b7b686f1 Fix Rebase 2022-10-12 13:52:20 +11:00
Alistair Leslie-Hughes
c5c29f9395 Rebase against 4312be1646cad32548f855e25823857092bf31dc. 2022-10-12 11:27:25 +11:00
Zebediah Figura
08ad410761 secur32-InitializeSecurityContext: Remove patch set.
Fixed upstream by c1993458ac.
2022-10-10 22:28:33 -05:00
Zebediah Figura
e6f9a449cd Rebase against 16c6c249a5134de2422fbd3471ead7425c968301. 2022-10-10 22:27:34 -05:00
Alistair Leslie-Hughes
0ea57a0262 Updated wined3d-bindless-texture patchset 2022-09-30 09:31:13 +10:00
Alistair Leslie-Hughes
4f75966580 Updated ntdll-DOS_Attributes patchset
Fixes: https://bugs.winehq.org/show_bug.cgi?id=53715
2022-09-30 09:31:13 +10:00
Zebediah Figura
9f9285256f mfplat-streaming-support: Remove patch 0067.
Upstreamed as 2d7c37da495c.
2022-09-29 16:04:31 -05:00
Alistair Leslie-Hughes
21009111bd Rebase against 2a4ec7dafc7ee38108f6a9f626a7c39e6b6777e0. 2022-09-27 10:29:23 +10:00
Alistair Leslie-Hughes
fe476e7241 Release v7.18 2022-09-24 09:52:05 +10:00
Alistair Leslie-Hughes
29e810ed54 Merge pull request #84 from Gcenx/patch-3
macOS.yml: Remove wine-devel action
2022-09-24 08:43:52 +10:00
Dean M Greer
1dc3666fd0 macOS.yml: Remove wine-devel action
Since gitlab.winehq.org hosts it’s own macOS runner this is no longer required
2022-09-23 10:40:26 -04:00
Alistair Leslie-Hughes
78837ecadc Rebase against 52a83ffe4ef1ef58520b09f8d2144dcf291b622b. 2022-09-23 14:18:51 +10:00
Alistair Leslie-Hughes
626e3d77cd Rebase against e2a5bf7540a3b1f5b3889f6339795e5edf7f590f. 2022-09-22 09:57:30 +10:00
Alistair Leslie-Hughes
5013933ea5 Rebase against b07e06e297dd8bca67fc1ee523fc235cecebbf1e. 2022-09-21 09:21:47 +10:00
Alistair Leslie-Hughes
c10d599428 Rebase against cb0e4f5f4f7dc10a0933349ad780a11405cd736e. 2022-09-20 08:49:48 +10:00
Alistair Leslie-Hughes
1d75f6950a Rebase against f5b92137257b9564dca623ee9578c49b4495e220. 2022-09-17 08:35:46 +10:00
Zebediah Figura
ffaf883b19 Rebase against 7feaa6795a26c97b5ce4327a23129eb20a049859. 2022-09-14 17:30:59 -05:00
Zebediah Figura
19c062dbc7 dwrite-FontFallback: Remove remaining patches.
Per Nikolay, these are upstream now.

They would appear to be obviated by a10ae49292 and b783100773.
2022-09-14 10:34:47 -05:00
Zebediah Figura
1ed196f0ef ntdll-Junction_Points: Updates from Erich E. Hoover.
Includes a fundamental rewrite of the way reparse points are stored.
2022-09-12 10:58:36 -05:00
Zebediah Figura
533337e25e server-unix_name: Rebase and re-enable. 2022-09-11 17:05:58 -05:00
Zebediah Figura
7e2f1d392c mfplat-streaming-support: Remove patch 0080.
Per private correspondence with Rémi, this is correctly implemented upstream in
a different way, on the wg_transform side.
2022-09-11 17:05:58 -05:00
Zebediah Figura
129ce257fd mfplat-streaming-support: Remove patch 0041.
Per private correspondence with Rémi, this will probably be submitted a
different way upstream. Since it's only API cleanup, there's no reason to keep
it around in wine-staging.
2022-09-11 17:05:58 -05:00
Zebediah Figura
a27ba94091 mfplat-streaming-support: Remove patch 0042.
This patch looks questionable and, per private correspondence with Rémi, was probably a red herring.
2022-09-11 17:05:58 -05:00
Zebediah Figura
d490a981e1 mfplat-streaming-support: Remove patch 0083.
Per private correspondence with Rémi, this doesn't seem to be necessary.
2022-09-11 17:05:58 -05:00
Zebediah Figura
092bc29352 mfplat-streaming-support: Remove more patches which were already implemented upstream.
I missed these the first time; thanks Rémi for pointing them out.
2022-09-11 17:05:58 -05:00
Zebediah Figura
2ee26de43f dwrite-FontFallback: Drop some patches.
These are superseded and/or no longer useful upstream, per private correspondence with Nikolay.
2022-09-11 17:05:58 -05:00
Alistair Leslie-Hughes
6d46b1e13f Release v7.17 2022-09-10 11:15:18 +10:00
Alistair Leslie-Hughes
64d7f6c5f3 Rebase against 1d0f66a3c6c6cf77ab49c834ba0d05f5232f637d. 2022-09-09 08:53:46 +10:00
Zebediah Figura
99fc74eb6c mfplat-streaming-support: Remove patch 0044.
This was based on a misreading of the documentation; see the following thread:

https://gitlab.winehq.org/wine/wine/-/merge_requests/242#note_2170
2022-09-03 15:56:35 -05:00
Zebediah Figura
73351fd593 mfplat-streaming-support: Remove transform patches already implemented or superseded upstream. 2022-09-03 15:54:56 -05:00
Zebediah Figura
34b3ffed35 mfplat-streaming-support: Remove patch 0036.
This was fixed upstream by 6dc35196, which rewrote the relevant code and
propagates failure from SetOutputType().
2022-09-03 15:34:17 -05:00
Zebediah Figura
d6a9c88bf3 mfplat-streaming-support: Remove more hacks.
These are not going in the right direction, and accordingly we don't want them
in wine-staging.
2022-09-03 15:21:09 -05:00
Zebediah Figura
c61fed05c0 mfplat-streaming-support: Remove hacks obviated by the ASF reader implementation. 2022-09-03 15:21:09 -05:00
Zebediah Figura
55c3361918 mfplat-streaming-support: Remove hacks for the Proton runtime environment.
Upstream Wine doesn't need these.
2022-09-03 15:21:09 -05:00
Zebediah Figura
4ecbce03f5 msxml3-FreeThreadedXMLHTTP60: Fix a whitespace error. 2022-09-03 15:21:09 -05:00
Zebediah Figura
b4004c7c84 nvcuda-CUDA_Support: Fix a whitespace error. 2022-09-03 15:21:09 -05:00
Zebediah Figura
6f59ab8034 windows.networking.connectivity-new-dll: Fix a whitespace error. 2022-09-03 15:21:09 -05:00
Zebediah Figura
4966b421fc windows.networking.connectivity-new-dll: Remove manual WinRT class registration.
widl generates these now.
2022-09-03 15:21:09 -05:00
Zebediah Figura
57a12e6845 Rebase against 7546b4a63d437c2f7f8673cae9341d358f84f1a5. 2022-09-01 17:13:59 -05:00
Alistair Leslie-Hughes
aa2eb6eed6 Release v7.16 2022-08-29 13:47:16 +10:00
Alistair Leslie-Hughes
4ae0f97bc7 Rebase against a4930f003f45ab82c4c05746cbd29cbd4af09735. 2022-08-29 10:59:27 +10:00
Alistair Leslie-Hughes
b31a964e1e Rebase against 4e55dfb7c5e26d45794406a4ce8e50a6bc725b74. 2022-08-25 15:32:33 +10:00
Alistair Leslie-Hughes
fa8d0abc9d Updated winepulse-aux_channels patchset
Add a reference to proton report which this patch would help.
2022-08-18 20:07:09 +10:00
Alistair Leslie-Hughes
2c5c068424 Rebase against 4a3c7e2758ac10b7947e859015f2a755d25fd7fe. 2022-08-18 08:18:00 +10:00
Alistair Leslie-Hughes
e893644049 Rebase against 4608e1e1257a377cd554a0e885368e3feb7d286f. 2022-08-17 08:24:50 +10:00
Alistair Leslie-Hughes
afbc5756c9 Rebase against b4a5556da983c7ebc8a25b228100c08947024c59. 2022-08-16 10:15:01 +10:00
Alistair Leslie-Hughes
552b03f70a Release v7.15 2022-08-14 14:16:57 +10:00
Alistair Leslie-Hughes
1f218b6822 Added wined3d-adapter_create_output Patchset 2022-08-14 13:51:20 +10:00
Alistair Leslie-Hughes
d9e4a75d19 Added dsdmo-fx-support patchset 2022-08-13 15:59:13 +10:00
Alistair Leslie-Hughes
0106909ec5 Added ntdll-wine-frames patchset 2022-08-12 13:34:16 +10:00
Alistair Leslie-Hughes
ec592e937b Rebase against 8e27f6c2ef327d6d643e29a271245e76aa6f4792. 2022-08-11 08:24:04 +10:00
Alistair Leslie-Hughes
4bc5bffe2f Rebase against 7b51216198237c04a8994cda1bdb45fdb4482b32. 2022-08-09 07:58:38 +10:00
Alistair Leslie-Hughes
f2648a9a40 Rebase against e43288348de170fef5dfd122675ba367dd7ea0ec. 2022-08-05 10:35:39 +10:00
219 changed files with 3681 additions and 22121 deletions

View File

@@ -64,60 +64,3 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/wine
make -j$(sysctl -n hw.ncpu 2>/dev/null)
wine-devel:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
brew update
brew install --cask xquartz
brew install bison \
gphoto2 \
gst-plugins-base \
mingw-w64 \
molten-vk \
mpg123
- name: Add bison & krb5 to $PATH
run: |
set -eu
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix krb5)/bin" >> $GITHUB_PATH
- name: Get upstream-commit
run: |
mkdir $GITHUB_WORKSPACE/wine
cd wine
git init
git fetch git://source.winehq.org/git/wine.git $($GITHUB_WORKSPACE/patches/patchinstall.sh --upstream-commit) --depth=1
git checkout $($GITHUB_WORKSPACE/patches/patchinstall.sh --upstream-commit)
- name: Configure wine64
env:
LDFLAGS: "-Wl,-rpath,/opt/X11/lib"
# Avoid weird linker errors with Xcode 10 and later
MACOSX_DEPLOYMENT_TARGET: "10.14"
run: |
cd $GITHUB_WORKSPACE/wine
cd $GITHUB_WORKSPACE/wine
./configure --enable-win64 \
--without-alsa \
--without-capi \
--without-dbus \
--without-inotify \
--without-oss \
--without-pulse \
--without-udev \
--without-v4l2 \
--x-include=/opt/X11/include \
--x-lib=/opt/X11/lib
- name: Build wine64
run: |
cd $GITHUB_WORKSPACE/wine
make -j$(sysctl -n hw.ncpu 2>/dev/null)

View File

@@ -94,17 +94,17 @@ proper implementation. In the event that this happens, we add the patches to
wine-staging instead, and keep them updated and maintained as well as attempt to
clean them up to be upstreamed. We also both write and verify patches which fix
various bugs that may not have patches, and in turn allow them run better using
WINE. This includes testing on various hardware, games, and applications.
WINE. This includes testing on various hardware, games and applications.
Any expenses for applications, games, or hardware which we do not own comes out
of pocket. In order to alleviate these expenses, we are now accepting donations.
This in turn allows us to continue to perform testing, provide fixes, and get
them upstreamed, ultimately aiming to provide a better experience for all WINE
users. All of our work is provided publicly for free and can be found at
<https://github.com/wine-staging/wine-staging>. We do not expect to be paid for
<https://gitlab.winehq.org/wine/wine-staging>. We do not expect to be paid for
any of the work provided, nor will donators receive any special benefits or
compensation.
Donations are recieved through Patreon. Anyone interested may donate here:
https://www.patreon.com/winestaging
https://www.patreon.com/winestaging

View File

@@ -1,4 +1,4 @@
From 12a9a9cb506aede4748611c8fa3339afcee7c070 Mon Sep 17 00:00:00 2001
From eddc40dbf4048ceea1fda7f842adad340865723b Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 5 Jul 2019 13:20:23 +0800
Subject: [PATCH] cryptext: Implement CryptExtOpenCER.
@@ -17,29 +17,29 @@ Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
create mode 100644 dlls/cryptext/tests/cryptext.c
diff --git a/configure b/configure
index 20bcb96a2a6..b8fd60dbb53 100755
index 6425e4da5f8..c97671cdfc6 100755
--- a/configure
+++ b/configure
@@ -20910,6 +20910,7 @@ wine_fn_config_makefile dlls/crypt32/tests enable_tests
@@ -21346,6 +21346,7 @@ wine_fn_config_makefile dlls/crypt32/tests enable_tests
wine_fn_config_makefile dlls/cryptdlg enable_cryptdlg
wine_fn_config_makefile dlls/cryptdll enable_cryptdll
wine_fn_config_makefile dlls/cryptext enable_cryptext
+wine_fn_config_makefile dlls/cryptext/tests enable_tests
wine_fn_config_makefile dlls/cryptnet enable_cryptnet
wine_fn_config_makefile dlls/cryptnet/tests enable_tests
wine_fn_config_makefile dlls/cryptsp enable_cryptsp
wine_fn_config_makefile dlls/cryptowinrt enable_cryptowinrt
diff --git a/configure.ac b/configure.ac
index 6cbd947bf31..c68c5975e63 100644
index b5a3b0069fb..73b1b1c8c2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2361,6 +2361,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests)
@@ -2450,6 +2450,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptdlg)
WINE_CONFIG_MAKEFILE(dlls/cryptdll)
WINE_CONFIG_MAKEFILE(dlls/cryptext)
+WINE_CONFIG_MAKEFILE(dlls/cryptext/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptnet)
WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptsp)
WINE_CONFIG_MAKEFILE(dlls/cryptowinrt)
diff --git a/dlls/cryptext/Makefile.in b/dlls/cryptext/Makefile.in
index 0ec2b8a2045..76accca43eb 100644
--- a/dlls/cryptext/Makefile.in
@@ -67,7 +67,7 @@ index ee3e155f457..24b4794c198 100644
@ stub CryptExtOpenCRLW
@ stub CryptExtOpenCTL
diff --git a/dlls/cryptext/cryptext_main.c b/dlls/cryptext/cryptext_main.c
index 537ba66cd3b..f9e34d1f8c5 100644
index 537ba66cd3b..a4314518eac 100644
--- a/dlls/cryptext/cryptext_main.c
+++ b/dlls/cryptext/cryptext_main.c
@@ -22,10 +22,29 @@
@@ -161,7 +161,7 @@ index 00000000000..522fc60a4af
+ cryptext.c
diff --git a/dlls/cryptext/tests/cryptext.c b/dlls/cryptext/tests/cryptext.c
new file mode 100644
index 00000000000..cc62a772b59
index 00000000000..ab1007dbd82
--- /dev/null
+++ b/dlls/cryptext/tests/cryptext.c
@@ -0,0 +1,61 @@
@@ -227,5 +227,5 @@ index 00000000000..cc62a772b59
+ test_CryptExtOpenCER();
+}
--
2.34.1
2.35.1

View File

@@ -1,116 +0,0 @@
From 861cd6c6409efce4eb03aad3bc01f5df772e77fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 6 Feb 2016 01:15:07 +0100
Subject: [PATCH] ddraw: Don't set HWTRANSFORMANDLIGHT flag on d3d7 RGB device.
---
dlls/ddraw/ddraw.c | 9 +++++++++
dlls/ddraw/tests/ddraw7.c | 18 ++++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 705d0335d95..1d916f93c4f 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -49,6 +49,7 @@ static struct enum_device_entry
char interface_name[100];
char device_name[100];
const GUID *device_guid;
+ DWORD remove_caps;
} device_list7[] =
{
/* T&L HAL device */
@@ -56,6 +57,7 @@ static struct enum_device_entry
"WINE Direct3D7 Hardware Transform and Lighting acceleration using WineD3D",
"Wine D3D7 T&L HAL",
&IID_IDirect3DTnLHalDevice,
+ 0,
},
/* HAL device */
@@ -63,6 +65,7 @@ static struct enum_device_entry
"WINE Direct3D7 Hardware acceleration using WineD3D",
"Direct3D HAL",
&IID_IDirect3DHALDevice,
+ 0,
},
/* RGB device */
@@ -70,6 +73,7 @@ static struct enum_device_entry
"WINE Direct3D7 RGB Software Emulation using WineD3D",
"Wine D3D7 RGB",
&IID_IDirect3DRGBDevice,
+ D3DDEVCAPS_HWTRANSFORMANDLIGHT,
},
};
@@ -3749,6 +3753,7 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
{
struct ddraw *ddraw = impl_from_IDirect3D7(iface);
D3DDEVICEDESC7 device_desc7;
+ DWORD dev_caps;
HRESULT hr;
size_t i;
@@ -3765,11 +3770,15 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
return hr;
}
+ dev_caps = device_desc7.dwDevCaps;
+
for (i = 0; i < ARRAY_SIZE(device_list7); i++)
{
HRESULT ret;
device_desc7.deviceGUID = *device_list7[i].device_guid;
+ device_desc7.dwDevCaps = dev_caps & ~device_list7[i].remove_caps;
+
ret = callback(device_list7[i].interface_name, device_list7[i].device_name, &device_desc7, context);
if (ret != DDENUMRET_OK)
{
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index d641595baa2..54cc18b74f2 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -577,6 +577,19 @@ static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const G
return device;
}
+static HRESULT WINAPI enum_devtype_software_cb(char *desc_str, char *name, D3DDEVICEDESC7 *desc, void *ctx)
+{
+ BOOL *software_ok = ctx;
+ if (IsEqualGUID(&desc->deviceGUID, &IID_IDirect3DRGBDevice))
+ {
+ ok(!(desc->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT),
+ "RGB emulation device shouldn't have HWTRANSFORMANDLIGHT flag\n");
+ *software_ok = TRUE;
+ return DDENUMRET_CANCEL;
+ }
+ return DDENUMRET_OK;
+}
+
static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
{
const GUID *device_guid = &IID_IDirect3DHALDevice;
@@ -6719,6 +6732,7 @@ static void test_surface_lock(void)
ULONG refcount;
DDPIXELFORMAT z_fmt;
BOOL hal_ok = FALSE;
+ BOOL software_ok = FALSE;
const GUID *devtype = &IID_IDirect3DHALDevice;
D3DDEVICEDESC7 device_desc;
BOOL cubemap_supported;
@@ -6844,6 +6858,10 @@ static void test_surface_lock(void)
if (hal_ok)
devtype = &IID_IDirect3DTnLHalDevice;
+ hr = IDirect3D7_EnumDevices(d3d, enum_devtype_software_cb, &software_ok);
+ ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr);
+ if (!software_ok) win_skip("RGB device not found, unable to check flags\n");
+
memset(&z_fmt, 0, sizeof(z_fmt));
hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt);
if (FAILED(hr) || !z_fmt.dwSize)
--
2.20.1

View File

@@ -8,3 +8,4 @@
# The Sims Online
Fixes: [19153] Resident Evil 1 fails to start (needs IDirect3D3::EnumDevices() to return a device named "RGB Emulation")
Depends: ddraw-Device_Caps
Disabled: True

View File

@@ -1,69 +0,0 @@
From b1690a5bc6ea4cf670f3117f8caf9e229cd1f47d Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Sun, 20 May 2018 21:40:39 -0700
Subject: [PATCH] dwrite: Test IDWriteTextFormat with nonexistent font
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/tests/layout.c | 45 ++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index d19f91311db..d89ccc9d995 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -3290,6 +3290,51 @@ todo_wine
ok(metrics.lineCount == 1, "Unexpected line count %u.\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
+ IDWriteTextFormat_Release(format);
+
+ /* nonexistent font */
+ hr = IDWriteFactory_CreateTextFormat(factory, L"Blah!", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
+ DWRITE_FONT_STRETCH_NORMAL, 10.0, L"en-us", &format);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ count = 0;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+todo_wine
+ ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth);
+todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+
+ IDWriteTextLayout_Release(layout);
+
IDWriteTextFormat_Release(format);
IDWriteFactory_Release(factory);
}
--
2.17.1

View File

@@ -1,332 +0,0 @@
From 79b9dda91ac0e33add2252f9ad5c10ba752ddabb Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Wed, 23 May 2018 00:01:42 -0700
Subject: [PATCH] dwrite: Test GetMetrics with custom fontcollection
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/tests/layout.c | 280 ++++++++++++++++++++++++++++++++++++-
1 file changed, 279 insertions(+), 1 deletion(-)
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 9a450495146..9f1051b4905 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -3363,7 +3363,7 @@ todo_wine
DWRITE_FONT_STRETCH_NORMAL, 10.0, L"en-us", &format);
ok(hr == S_OK, "got 0x%08x\n", hr);
- hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout);
+ hr = IDWriteFactory_CreateTextLayout(factory, L"A", 4, format, 500.0, 1000.0, &layout);
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 0;
@@ -4546,6 +4546,7 @@ static void test_SetWordWrapping(void)
/* Collection dedicated to fallback testing */
static const WCHAR g_blahfontW[] = {'B','l','a','h',0};
+static const WCHAR g_fontNotInCollectionW[] = {'n','o','t','B','l','a','h',0};
static HRESULT WINAPI fontcollection_QI(IDWriteFontCollection *iface, REFIID riid, void **obj)
{
if (IsEqualIID(riid, &IID_IDWriteFontCollection) || IsEqualIID(riid, &IID_IUnknown)) {
@@ -4607,6 +4608,9 @@ static HRESULT WINAPI fontcollection_FindFamilyName(IDWriteFontCollection *iface
*index = 123456;
*exists = TRUE;
return S_OK;
+ } else if (!lstrcmpW(name, g_fontNotInCollectionW)) {
+ *exists = FALSE;
+ return S_OK;
}
ok(0, "unexpected call, name %s\n", wine_dbgstr_w(name));
return E_NOTIMPL;
@@ -6405,6 +6409,279 @@ static void test_layout_range_length(void)
IDWriteFactory_Release(factory);
}
+static void test_GetMetrics_with_custom_fontcollection(void)
+{
+ static const WCHAR emptystringW[] = {0};
+ static const WCHAR mappedW[] = {'a','b','c','d',0};
+ static const WCHAR notmappedW[] = {'a',0xffff,'b',0}; // u+ffff = not a unicode character
+ DWRITE_CLUSTER_METRICS clusters[4];
+ DWRITE_TEXT_METRICS metrics;
+ IDWriteTextFormat *format;
+ IDWriteTextLayout *layout;
+ IDWriteFactory *factory;
+ UINT32 count, i;
+ FLOAT width;
+ HRESULT hr;
+
+ factory = create_factory();
+
+ /* font is in font collection */
+ hr = IDWriteFactory_CreateTextFormat(factory, g_blahfontW, &fallbackcollection,
+ DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
+ DWRITE_FONT_STRETCH_NORMAL, 10.0, L"en-us", &format);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ /* text is mapped by fontfallback */
+ hr = IDWriteFactory_CreateTextLayout(factory, mappedW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* text is not mapped by fontfallback */
+ hr = IDWriteFactory_CreateTextLayout(factory, notmappedW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* empty string */
+ hr = IDWriteFactory_CreateTextLayout(factory, emptystringW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* zero-length empty string */
+ hr = IDWriteFactory_CreateTextLayout(factory, emptystringW, 0, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 0, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ IDWriteTextFormat_Release(format);
+
+ /* font not in font collection */
+ hr = IDWriteFactory_CreateTextFormat(factory, g_fontNotInCollectionW, &fallbackcollection,
+ DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
+ DWRITE_FONT_STRETCH_NORMAL, 10.0, L"en-us", &format);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ /* text is mapped by fontfallback */
+ hr = IDWriteFactory_CreateTextLayout(factory, mappedW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ todo_wine
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* text is not mapped by fontfallback */
+ hr = IDWriteFactory_CreateTextLayout(factory, notmappedW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ todo_wine
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* empty string */
+ hr = IDWriteFactory_CreateTextLayout(factory, emptystringW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ todo_wine
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* zero-length empty string */
+ hr = IDWriteFactory_CreateTextLayout(factory, emptystringW, 0, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 0, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ todo_wine
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ IDWriteTextFormat_Release(format);
+
+ IDWriteFactory_Release(factory);
+}
+
START_TEST(layout)
{
IDWriteFactory *factory;
@@ -6438,6 +6715,7 @@ START_TEST(layout)
test_SetFontStretch();
test_SetStrikethrough();
test_GetMetrics();
+ test_GetMetrics_with_custom_fontcollection();
test_SetFlowDirection();
test_SetDrawingEffect();
test_GetLineMetrics();
--
2.20.1

View File

@@ -1,311 +0,0 @@
From bf4cc6cfca946ff719763bb7be25fe268577f0d3 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Mon, 21 May 2018 18:13:00 -0700
Subject: [PATCH] dwrite: Use font fallback when mapping characters
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/analyzer.c | 77 +++++++++++++++++++++++++++++---------
dlls/dwrite/layout.c | 6 +++
dlls/dwrite/tests/layout.c | 54 ++++----------------------
3 files changed, 73 insertions(+), 64 deletions(-)
diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c
index 7ffcfa8070c..aab309c2a8c 100644
--- a/dlls/dwrite/analyzer.c
+++ b/dlls/dwrite/analyzer.c
@@ -2094,6 +2094,7 @@ static HRESULT fallback_get_fallback_font(struct dwrite_fontfallback *fallback,
IDWriteFont **mapped_font)
{
const struct fallback_mapping *mapping;
+ IDWriteFontCollection *collection;
HRESULT hr;
UINT32 i;
@@ -2105,9 +2106,15 @@ static HRESULT fallback_get_fallback_font(struct dwrite_fontfallback *fallback,
return E_FAIL;
}
+ if (mapping->collection) {
+ collection = mapping->collection;
+ } else {
+ collection = (IDWriteFontCollection *)fallback->systemcollection;
+ }
+
/* Now let's see what fallback can handle. Pick first font that could be created. */
for (i = 0; i < mapping->families_count; i++) {
- hr = create_matching_font((IDWriteFontCollection *)fallback->systemcollection, mapping->families[i],
+ hr = create_matching_font(collection, mapping->families[i],
weight, style, stretch, mapped_font);
if (hr == S_OK) {
TRACE("Created fallback font using family %s.\n", debugstr_w(mapping->families[i]));
@@ -2164,32 +2171,66 @@ static HRESULT WINAPI fontfallback_MapCharacters(IDWriteFontFallback1 *iface, ID
if (basefamily && *basefamily) {
hr = create_matching_font(basecollection, basefamily, weight, style, stretch, ret_font);
- if (FAILED(hr))
- goto done;
-
- hr = fallback_map_characters(*ret_font, text, length, mapped_length);
- if (FAILED(hr))
- goto done;
+ if (SUCCEEDED(hr)) {
+ hr = fallback_map_characters(*ret_font, text, length, mapped_length);
+ if (FAILED(hr)) {
+ IDWriteFont_Release(*ret_font);
+ *ret_font = NULL;
+ WARN("Mapping with requested family %s failed, hr %#x.\n", debugstr_w(basefamily), hr);
+ }
+ }
}
if (!*mapped_length) {
- IDWriteFont *mapped_font;
+ if (*ret_font) {
+ IDWriteFont_Release(*ret_font);
+ *ret_font = NULL;
+ }
- hr = fallback_get_fallback_font(fallback, text, length, weight, style, stretch, mapped_length, &mapped_font);
+ hr = fallback_get_fallback_font(fallback, text, length, weight, style, stretch, mapped_length, ret_font);
if (FAILED(hr)) {
- /* fallback wasn't found, keep base font if any, so we can get at least some visual output */
- if (*ret_font) {
- *mapped_length = length;
- hr = S_OK;
- }
+ WARN("Mapping with fallback families failed, hr %#x.\n", hr);
}
- else {
- if (*ret_font)
- IDWriteFont_Release(*ret_font);
- *ret_font = mapped_font;
+ }
+
+ /**
+ * This is a rough hack. We search the system font collection because
+ * the system fontfallback, which would have been searched above, is not
+ * fully implemented as it isn't populated with any system fonts. Once
+ * implemented, the block below can be removed.
+ * */
+ if (!*mapped_length) {
+ IDWriteFontFamily *family;
+ IDWriteFont *font;
+ UINT32 i, count = IDWriteFontCollection_GetFontFamilyCount((IDWriteFontCollection *)fallback->systemcollection);
+ for (i = 0; i < count; i++) {
+ hr = IDWriteFontCollection_GetFontFamily((IDWriteFontCollection *)fallback->systemcollection, i, &family);
+ if (FAILED(hr)) {
+ ERR("Failed to get font family.\n");
+ continue;
+ }
+
+ hr = IDWriteFontFamily_GetFirstMatchingFont(family, weight, stretch, style, &font);
+ IDWriteFontFamily_Release(family);
+ if (FAILED(hr)) {
+ continue;
+ }
+
+ hr = fallback_map_characters(font, text, length, mapped_length);
+ if (SUCCEEDED(hr) && mapped_length > 0) {
+ *ret_font = font;
+ break;
+ }
+
+ IDWriteFont_Release(font);
}
}
+ if (!*mapped_length) {
+ *mapped_length = length == 0 ? 0 : 1;
+ hr = S_OK;
+ }
+
done:
free(buff);
return hr;
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index ba80c3f70e8..c7845f9b675 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -725,6 +725,12 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
goto fatal;
}
+ if (!font) {
+ hr = E_FAIL;
+ WARN("Failed to create font face, hr %#x.\n", hr);
+ goto fatal;
+ }
+
hr = IDWriteFont_CreateFontFace(font, &run->run.fontFace);
IDWriteFont_Release(font);
if (FAILED(hr)) {
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 3efedd3df95..07687c76c60 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -3366,35 +3366,23 @@ static void test_GetMetrics(void)
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
-todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
-todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
-todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
-todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
-todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
-todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
-todo_wine
ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth);
-todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
-todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
-todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
@@ -4688,16 +4676,12 @@ static void test_MapCharacters(void)
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
- todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
IDWriteFont_Release(font);
-}
+
/* same Latin text, full length */
g_source = L"abc";
mappedlength = 0;
@@ -4705,16 +4689,12 @@ if (font) {
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 3, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
- todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
IDWriteFont_Release(font);
-}
+
/* string 'a\x3058b' */
g_source = str2W;
mappedlength = 0;
@@ -4722,32 +4702,24 @@ if (font) {
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
- todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
IDWriteFont_Release(font);
-}
+
g_source = str2W;
mappedlength = 0;
scale = 0.0f;
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 2, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
- todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
IDWriteFont_Release(font);
-}
+
/* Try with explicit collection, Tahoma will be forced. */
/* 1. Latin part */
g_source = str2W;
@@ -4770,7 +4742,10 @@ if (font) {
IDWriteLocalizedStrings_Release(strings);
IDWriteFont_Release(font);
- /* 2. Hiragana character, force Tahoma font does not support Japanese */
+ /**
+ * 2. Hiragana character. Tahoma is requested, but it doesn't support
+ * Japanese. A NULL font is returned if there is no fallback for Japanese.
+ */
g_source = str2W;
mappedlength = 0;
scale = 0.0f;
@@ -4780,7 +4755,6 @@ if (font) {
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 1.0f, "got %f\n", scale);
- ok(font != NULL, "got %p\n", font);
exists = FALSE;
hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists);
@@ -6667,34 +6641,22 @@ static void test_GetMetrics_with_custom_fontcollection(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 9999;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
- todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
- todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
- todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
- todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
- todo_wine
ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
- todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
- todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
- todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
--
2.35.1

View File

@@ -1,128 +0,0 @@
From 838b8a5edeca6c06c20bdc301f4d5d658e835cc9 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Wed, 23 May 2018 05:59:20 -0700
Subject: [PATCH 5/6] dwrite: Use MapCharacters for non-visual characters
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/layout.c | 22 +++++++++++++++-------
dlls/dwrite/tests/layout.c | 24 ------------------------
2 files changed, 15 insertions(+), 31 deletions(-)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index df3f3beabb..5d06bf9348 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -822,7 +822,8 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
LIST_FOR_EACH_ENTRY(r, &layout->runs, struct layout_run, entry) {
struct regular_layout_run *run = &r->u.regular;
IDWriteFont *font;
- UINT32 length;
+ UINT32 length, mapped_length;
+ FLOAT scale;
if (r->kind == LAYOUT_RUN_INLINE)
continue;
@@ -830,12 +831,19 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
range = get_layout_range_by_pos(layout, run->descr.textPosition);
if (run->sa.shapes == DWRITE_SCRIPT_SHAPES_NO_VISUAL) {
- IDWriteFontCollection *collection;
-
- collection = range->collection ? range->collection : sys_collection;
-
- if (FAILED(hr = create_matching_font(collection, range->fontfamily, range->weight, range->style,
- range->stretch, &font))) {
+ hr = IDWriteFontFallback_MapCharacters(fallback,
+ (IDWriteTextAnalysisSource *)&layout->IDWriteTextAnalysisSource1_iface,
+ run->descr.textPosition,
+ run->descr.stringLength,
+ range->collection,
+ range->fontfamily,
+ range->weight,
+ range->style,
+ range->stretch,
+ &mapped_length,
+ &font,
+ &scale);
+ if (FAILED(hr)) {
WARN("%s: failed to create matching font for non visual run, family %s, collection %p\n",
debugstr_rundescr(&run->descr), debugstr_w(range->fontfamily), range->collection);
break;
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 430bb1f0eb..cf1d5d7060 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -5713,34 +5713,22 @@ static void test_GetMetrics_with_custom_fontcollection(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 9999;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
- todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
- todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
- todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
- todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
- todo_wine
ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
- todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
- todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
- todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
@@ -5749,34 +5737,22 @@ static void test_GetMetrics_with_custom_fontcollection(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 9999;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
- todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
- todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
- todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
- todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
- todo_wine
ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
- todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
- todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
- todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
--
2.18.0

View File

@@ -1,96 +0,0 @@
From a0f4bde380003f7a8e3b713028215bf985dbb3c0 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Wed, 23 May 2018 07:03:44 -0700
Subject: [PATCH 6/6] dwrite: Use MapCharacters for dummy line metrics
Fixes: https://bugs.winehq.org/show_bug.cgi?id=44052
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/layout.c | 29 +++++++++++++++++++++++++++++
dlls/dwrite/tests/layout.c | 8 --------
2 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index 5d06bf9348..2213717f92 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -1808,8 +1808,11 @@ static HRESULT layout_set_dummy_line_metrics(struct dwrite_textlayout *layout, U
DWRITE_FONT_METRICS fontmetrics;
struct layout_range *range;
IDWriteFontFace *fontface;
+ IDWriteFontFallback *fallback;
IDWriteFont *font;
HRESULT hr;
+ UINT32 mapped_length;
+ FLOAT scale;
range = get_layout_range_by_pos(layout, pos);
hr = create_matching_font(range->collection,
@@ -1818,8 +1821,34 @@ static HRESULT layout_set_dummy_line_metrics(struct dwrite_textlayout *layout, U
range->style,
range->stretch,
&font);
+
+ if (FAILED(hr)) {
+ if (layout->format.fallback) {
+ fallback = layout->format.fallback;
+ IDWriteFontFallback_AddRef(fallback);
+ } else if (FAILED(hr = IDWriteFactory7_GetSystemFontFallback(layout->factory, &fallback))) {
+ WARN("Failed to get system fallback, hr %#x.\n", hr);
+ return hr;
+ }
+
+ hr = IDWriteFontFallback_MapCharacters(fallback,
+ (IDWriteTextAnalysisSource *)&layout->IDWriteTextAnalysisSource1_iface,
+ pos,
+ layout->len,
+ range->collection,
+ range->fontfamily,
+ range->weight,
+ range->style,
+ range->stretch,
+ &mapped_length,
+ &font,
+ &scale);
+ IDWriteFontFallback_Release(fallback);
+ }
if (FAILED(hr))
return hr;
+ if (font == NULL)
+ return S_OK;
hr = IDWriteFont_CreateFontFace(font, &fontface);
IDWriteFont_Release(font);
if (FAILED(hr))
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index cf1d5d7060..6ed7b3c334 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -5767,24 +5767,16 @@ static void test_GetMetrics_with_custom_fontcollection(void)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
- todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
- todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
- todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
- todo_wine
ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
- todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
- todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
--
2.18.0

View File

@@ -1,2 +0,0 @@
Fixes: [44052] - Support for font fallback.
Disabled: True

View File

@@ -1,4 +1,4 @@
From a791c331b23e717a5f6c0397e4c290e8e8abd2f2 Mon Sep 17 00:00:00 2001
From 9829e3c307e8019a3a2b9204d1133833863da5f1 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Sat, 7 Jul 2018 12:57:47 +0200
Subject: [PATCH] server: Create eventfd descriptors for pseudo-fd objects and
@@ -11,10 +11,10 @@ Subject: [PATCH] server: Create eventfd descriptors for pseudo-fd objects and
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/server/fd.c b/server/fd.c
index 880a5037925..c6db8d13265 100644
index 6a1b89b0e54..8ba704344cf 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -102,6 +102,7 @@
@@ -97,6 +97,7 @@
#include "handle.h"
#include "process.h"
#include "request.h"
@@ -22,7 +22,7 @@ index 880a5037925..c6db8d13265 100644
#include "winternl.h"
#include "winioctl.h"
@@ -205,6 +206,7 @@ struct fd
@@ -198,6 +199,7 @@ struct fd
struct completion *completion; /* completion object attached to this fd */
apc_param_t comp_key; /* completion key to set in completion events */
unsigned int comp_flags; /* completion flags */
@@ -30,8 +30,8 @@ index 880a5037925..c6db8d13265 100644
};
static void fd_dump( struct object *obj, int verbose );
@@ -1606,6 +1608,9 @@ static void fd_destroy( struct object *obj )
free( fd->unlink_name );
@@ -1668,6 +1670,9 @@ static void fd_destroy( struct object *obj )
if (fd->unix_fd != -1) close( fd->unix_fd );
free( fd->unix_name );
}
+
@@ -40,7 +40,7 @@ index 880a5037925..c6db8d13265 100644
}
/* check if the desired access is possible without violating */
@@ -1723,6 +1728,7 @@ static struct fd *alloc_fd_object(void)
@@ -1784,6 +1789,7 @@ static struct fd *alloc_fd_object(void)
fd->poll_index = -1;
fd->completion = NULL;
fd->comp_flags = 0;
@@ -48,7 +48,7 @@ index 880a5037925..c6db8d13265 100644
init_async_queue( &fd->read_q );
init_async_queue( &fd->write_q );
init_async_queue( &fd->wait_q );
@@ -1763,11 +1769,15 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
@@ -1823,11 +1829,15 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
fd->completion = NULL;
fd->comp_flags = 0;
fd->no_fd_status = STATUS_BAD_DEVICE_TYPE;
@@ -64,7 +64,7 @@ index 880a5037925..c6db8d13265 100644
return fd;
}
@@ -2293,6 +2303,9 @@ void set_fd_signaled( struct fd *fd, int signaled )
@@ -2268,6 +2278,9 @@ void set_fd_signaled( struct fd *fd, int signaled )
if (fd->comp_flags & FILE_SKIP_SET_EVENT_ON_HANDLE) return;
fd->signaled = signaled;
if (signaled) wake_up( fd->user, 0 );
@@ -74,7 +74,7 @@ index 880a5037925..c6db8d13265 100644
}
/* check if events are pending and if yes return which one(s) */
@@ -2318,6 +2331,15 @@ int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry )
@@ -2293,6 +2306,15 @@ int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry )
return ret;
}
@@ -91,7 +91,7 @@ index 880a5037925..c6db8d13265 100644
{
int events = 0;
diff --git a/server/file.h b/server/file.h
index 80f2191c050..224048a4292 100644
index 0ffe0e2c8dc..b5b1e2a1077 100644
--- a/server/file.h
+++ b/server/file.h
@@ -106,6 +106,7 @@ extern char *dup_fd_name( struct fd *root, const char *name );
@@ -103,7 +103,7 @@ index 80f2191c050..224048a4292 100644
extern void default_poll_event( struct fd *fd, int event );
extern void fd_cancel_async( struct fd *fd, struct async *async );
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 6b4401810dc..27f4497bfe2 100644
index b8ec17a787a..e01b28f725a 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -168,7 +168,7 @@ static const struct object_ops pipe_server_ops =
@@ -125,5 +125,5 @@ index 6b4401810dc..27f4497bfe2 100644
no_signal, /* signal */
pipe_end_get_fd, /* get_fd */
--
2.33.0
2.35.1

View File

@@ -1,4 +1,4 @@
From cc964cf26e79a89fb3d7345847a23d93368e3eed Mon Sep 17 00:00:00 2001
From c4a4d47fb07faee6ef6d20b967e21eafe6a60ea4 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 9 Jul 2019 14:13:28 +1000
Subject: [PATCH] user32: Do not enumerate the registry in
@@ -13,10 +13,10 @@ not the complete list from the registry.
3 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 06756b5551e..99abab38ccf 100644
index bb7477ed482..55ab8d246e7 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -521,7 +521,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
@@ -494,7 +494,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
return FALSE;
}
@@ -25,10 +25,10 @@ index 06756b5551e..99abab38ccf 100644
* EnableMouseInPointer (USER32.@)
*/
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 8b84a39d009..d7520459c6d 100644
index 8477645fad5..e92548c7402 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -4481,6 +4481,40 @@ static void test_SendInput(void)
@@ -4566,6 +4566,40 @@ static void test_SendInput(void)
DestroyWindow( hwnd );
}
@@ -69,19 +69,19 @@ index 8b84a39d009..d7520459c6d 100644
START_TEST(input)
{
char **argv;
@@ -4523,6 +4557,7 @@ START_TEST(input)
@@ -4608,6 +4642,7 @@ START_TEST(input)
test_GetRawInputBuffer();
test_RegisterRawInputDevices();
test_rawinput(argv[0]);
+ test_GetKeyboardLayoutList();
test_DefRawInputProc();
if(pGetMouseMovePointsEx)
test_GetMouseMovePointsEx(argv[0]);
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
index 28fc5a918c8..24782e405a7 100644
index f3b724e7010..a971e1ee776 100644
--- a/dlls/win32u/input.c
+++ b/dlls/win32u/input.c
@@ -933,11 +933,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
@@ -934,11 +934,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
*/
UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
{
@@ -94,7 +94,7 @@ index 28fc5a918c8..24782e405a7 100644
HKL layout;
TRACE_(keyboard)( "size %d, layouts %p.\n", size, layouts );
@@ -951,33 +947,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
@@ -952,33 +948,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
if (size && layouts)
{
layouts[count - 1] = layout;
@@ -129,5 +129,5 @@ index 28fc5a918c8..24782e405a7 100644
return count;
--
2.34.1
2.37.2

View File

@@ -1,40 +0,0 @@
From 1fa010a636a2a30224ce07081d94bd3e6d9597c8 Mon Sep 17 00:00:00 2001
From: Andrew Eikum <aeikum@codeweavers.com>
Date: Thu, 30 Jan 2020 10:16:19 -0600
Subject: [PATCH 01/88] winegstreamer: HACK: Use a different gst registry file
per architecture
---
dlls/winegstreamer/wg_parser.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index 5a2e970a4dd..40c394c3caf 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -1556,6 +1556,22 @@ static void init_gstreamer_once(void)
int argc = ARRAY_SIZE(args) - 1;
char **argv = args;
GError *err;
+ const char *e;
+
+ if ((e = getenv("WINE_GST_REGISTRY_DIR")))
+ {
+ char gst_reg[PATH_MAX];
+#if defined(__x86_64__)
+ const char *arch = "/registry.x86_64.bin";
+#elif defined(__i386__)
+ const char *arch = "/registry.i386.bin";
+#else
+#error Bad arch
+#endif
+ strcpy(gst_reg, e);
+ strcat(gst_reg, arch);
+ setenv("GST_REGISTRY_1_0", gst_reg, 1);
+ }
if (!gst_init_check(&argc, &argv, &err))
{
--
2.34.1

View File

@@ -1,60 +0,0 @@
From effc9dd4081fe44b67080b3cb73f51be21e0bd51 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Tue, 28 Jan 2020 14:30:43 -0600
Subject: [PATCH 02/88] winegstreamer: HACK: Try harder to register
winegstreamer filters.
---
dlls/quartz/filtergraph.c | 17 +++++++++++++++++
dlls/winegstreamer/main.c | 2 ++
2 files changed, 19 insertions(+)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 1849174cf97..55462244ea9 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -5600,11 +5600,28 @@ static const IUnknownVtbl IInner_VTable =
FilterGraphInner_Release
};
+static BOOL CALLBACK register_winegstreamer_proc(INIT_ONCE *once, void *param, void **ctx)
+{
+ HMODULE mod = LoadLibraryW(L"winegstreamer.dll");
+ if (mod)
+ {
+ HRESULT (WINAPI *proc)(void) = (void *)GetProcAddress(mod, "DllRegisterServer");
+ proc();
+ FreeLibrary(mod);
+ }
+ return TRUE;
+}
+
static HRESULT filter_graph_common_create(IUnknown *outer, IUnknown **out, BOOL threaded)
{
+ static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
struct filter_graph *object;
HRESULT hr;
+ /* HACK: our build system makes it difficult to load gstreamer on prefix
+ * creation, so it won't get registered. Do that here instead. */
+ InitOnceExecuteOnce(&once, register_winegstreamer_proc, NULL, NULL);
+
*out = NULL;
if (!(object = calloc(1, sizeof(*object))))
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index f85e9995525..95b22abebb7 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -564,6 +564,8 @@ HRESULT WINAPI DllRegisterServer(void)
TRACE(".\n");
+ init_gstreamer();
+
if (FAILED(hr = __wine_register_resources()))
return hr;
--
2.34.1

View File

@@ -1,50 +0,0 @@
From 3487366d10a749104ac47d0dda66ab54843a94a3 Mon Sep 17 00:00:00 2001
From: Andrew Eikum <aeikum@codeweavers.com>
Date: Fri, 18 Dec 2020 14:08:04 -0600
Subject: [PATCH 03/88] mfplat: Register winegstreamer interfaces on load
See also "winegstreamer: HACK: Try harder to register winegstreamer
filters."
---
dlls/mfplat/main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index 7991152f7a7..72ce560c772 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -1583,6 +1583,18 @@ HRESULT WINAPI MFTGetInfo(CLSID clsid, WCHAR **name, MFT_REGISTER_TYPE_INFO **in
return hr;
}
+static BOOL CALLBACK register_winegstreamer_proc(INIT_ONCE *once, void *param, void **ctx)
+{
+ HMODULE mod = LoadLibraryW(L"winegstreamer.dll");
+ if (mod)
+ {
+ HRESULT (WINAPI *proc)(void) = (void *)GetProcAddress(mod, "DllRegisterServer");
+ proc();
+ FreeLibrary(mod);
+ }
+ return TRUE;
+}
+
/***********************************************************************
* MFStartup (mfplat.@)
*/
@@ -1590,9 +1602,12 @@ HRESULT WINAPI MFStartup(ULONG version, DWORD flags)
{
#define MF_VERSION_XP MAKELONG( MF_API_VERSION, 1 )
#define MF_VERSION_WIN7 MAKELONG( MF_API_VERSION, 2 )
+ static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
TRACE("%#lx, %#lx.\n", version, flags);
+ InitOnceExecuteOnce(&once, register_winegstreamer_proc, NULL, NULL);
+
if (version != MF_VERSION_XP && version != MF_VERSION_WIN7)
return MF_E_BAD_STARTUP_VERSION;
--
2.34.1

View File

@@ -1,223 +0,0 @@
From fb5e9adb5eb72fa5d8369ec2e014985450432329 Mon Sep 17 00:00:00 2001
From: Thomas Crider <gloriouseggroll@gmail.com>
Date: Sat, 19 Feb 2022 16:58:07 -0700
Subject: [PATCH 04/88] Revert "winegstreamer: Create static pads on
wg_transform struct."
This reverts commit 71bf5b24d7efabfcacfa707198efc4be0da3e446.
---
dlls/winegstreamer/gst_private.h | 3 +-
dlls/winegstreamer/main.c | 9 ++----
dlls/winegstreamer/unixlib.h | 2 --
dlls/winegstreamer/wg_format.c | 40 ++----------------------
dlls/winegstreamer/wg_transform.c | 51 +------------------------------
dlls/winegstreamer/wma_decoder.c | 2 +-
6 files changed, 7 insertions(+), 100 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index a63daaf04b9..8bc9f838d29 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -96,8 +96,7 @@ uint64_t wg_parser_stream_get_duration(struct wg_parser_stream *stream);
void wg_parser_stream_seek(struct wg_parser_stream *stream, double rate,
uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags);
-struct wg_transform *wg_transform_create(const struct wg_format *input_format,
- const struct wg_format *output_format);
+struct wg_transform *wg_transform_create(void);
void wg_transform_destroy(struct wg_transform *transform);
unsigned int wg_format_get_max_size(const struct wg_format *format);
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index 95b22abebb7..af5a691371d 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -254,14 +254,9 @@ void wg_parser_stream_seek(struct wg_parser_stream *stream, double rate,
__wine_unix_call(unix_handle, unix_wg_parser_stream_seek, &params);
}
-struct wg_transform *wg_transform_create(const struct wg_format *input_format,
- const struct wg_format *output_format)
+struct wg_transform *wg_transform_create(void)
{
- struct wg_transform_create_params params =
- {
- .input_format = input_format,
- .output_format = output_format,
- };
+ struct wg_transform_create_params params = {0};
if (__wine_unix_call(unix_handle, unix_wg_transform_create, &params))
return NULL;
diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h
index 4adbb694766..8e3f5e84bfb 100644
--- a/dlls/winegstreamer/unixlib.h
+++ b/dlls/winegstreamer/unixlib.h
@@ -232,8 +232,6 @@ struct wg_parser_stream_seek_params
struct wg_transform_create_params
{
struct wg_transform *transform;
- const struct wg_format *input_format;
- const struct wg_format *output_format;
};
enum unix_funcs
diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c
index 40b9acfefff..8f771bb8abd 100644
--- a/dlls/winegstreamer/wg_format.c
+++ b/dlls/winegstreamer/wg_format.c
@@ -394,43 +394,6 @@ static GstCaps *wg_format_to_caps_video(const struct wg_format *format)
return caps;
}
-static GstCaps *wg_format_to_caps_wma(const struct wg_format *format)
-{
- GstBuffer *buffer;
- GstCaps *caps;
-
- if (!(caps = gst_caps_new_empty_simple("audio/x-wma")))
- return NULL;
- if (format->u.wma.version)
- gst_caps_set_simple(caps, "wmaversion", G_TYPE_INT, format->u.wma.version, NULL);
-
- if (format->u.wma.bitrate)
- gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->u.wma.bitrate, NULL);
- if (format->u.wma.rate)
- gst_caps_set_simple(caps, "rate", G_TYPE_INT, format->u.wma.rate, NULL);
- if (format->u.wma.depth)
- gst_caps_set_simple(caps, "depth", G_TYPE_INT, format->u.wma.depth, NULL);
- if (format->u.wma.channels)
- gst_caps_set_simple(caps, "channels", G_TYPE_INT, format->u.wma.channels, NULL);
- if (format->u.wma.block_align)
- gst_caps_set_simple(caps, "block_align", G_TYPE_INT, format->u.wma.block_align, NULL);
-
- if (format->u.wma.codec_data_len)
- {
- if (!(buffer = gst_buffer_new_and_alloc(format->u.wma.codec_data_len)))
- {
- gst_caps_unref(caps);
- return NULL;
- }
-
- gst_buffer_fill(buffer, 0, format->u.wma.codec_data, format->u.wma.codec_data_len);
- gst_caps_set_simple(caps, "codec_data", GST_TYPE_BUFFER, buffer, NULL);
- gst_buffer_unref(buffer);
- }
-
- return caps;
-}
-
GstCaps *wg_format_to_caps(const struct wg_format *format)
{
switch (format->major_type)
@@ -438,7 +401,8 @@ GstCaps *wg_format_to_caps(const struct wg_format *format)
case WG_MAJOR_TYPE_UNKNOWN:
return NULL;
case WG_MAJOR_TYPE_WMA:
- return wg_format_to_caps_wma(format);
+ GST_FIXME("WMA format not implemented!\n");
+ return NULL;
case WG_MAJOR_TYPE_AUDIO:
return wg_format_to_caps_audio(format);
case WG_MAJOR_TYPE_VIDEO:
diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c
index e4545774428..2f225e5bc55 100644
--- a/dlls/winegstreamer/wg_transform.c
+++ b/dlls/winegstreamer/wg_transform.c
@@ -44,29 +44,13 @@ GST_DEBUG_CATEGORY_EXTERN(wine);
struct wg_transform
{
- GstPad *my_src, *my_sink;
+ int dummy;
};
-static GstFlowReturn transform_sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *buffer)
-{
- struct wg_transform *transform = gst_pad_get_element_private(pad);
-
- GST_INFO("transform %p, buffer %p.", transform, buffer);
-
- gst_buffer_unref(buffer);
-
- return GST_FLOW_OK;
-}
-
NTSTATUS wg_transform_destroy(void *args)
{
struct wg_transform *transform = args;
- if (transform->my_sink)
- g_object_unref(transform->my_sink);
- if (transform->my_src)
- g_object_unref(transform->my_src);
-
free(transform);
return STATUS_SUCCESS;
}
@@ -74,10 +58,6 @@ NTSTATUS wg_transform_destroy(void *args)
NTSTATUS wg_transform_create(void *args)
{
struct wg_transform_create_params *params = args;
- struct wg_format output_format = *params->output_format;
- struct wg_format input_format = *params->input_format;
- GstCaps *src_caps = NULL, *sink_caps = NULL;
- GstPadTemplate *template = NULL;
struct wg_transform *transform;
NTSTATUS status;
@@ -89,38 +69,9 @@ NTSTATUS wg_transform_create(void *args)
if (!(transform = calloc(1, sizeof(*transform))))
goto done;
- if (!(src_caps = wg_format_to_caps(&input_format)))
- goto done;
- if (!(sink_caps = wg_format_to_caps(&output_format)))
- goto done;
-
- if (!(template = gst_pad_template_new("src", GST_PAD_SRC, GST_PAD_ALWAYS, src_caps)))
- goto done;
- if (!(transform->my_src = gst_pad_new_from_template(template, "src")))
- goto done;
- g_object_unref(template);
- template = NULL;
-
- if (!(template = gst_pad_template_new("sink", GST_PAD_SINK, GST_PAD_ALWAYS, sink_caps)))
- goto done;
- if (!(transform->my_sink = gst_pad_new_from_template(template, "sink")))
- goto done;
- g_object_unref(template);
- template = NULL;
-
- gst_pad_set_element_private(transform->my_sink, transform);
- gst_pad_set_chain_function(transform->my_sink, transform_sink_chain_cb);
-
status = STATUS_SUCCESS;
done:
- if (template)
- g_object_unref(template);
- if (sink_caps)
- gst_caps_unref(sink_caps);
- if (src_caps)
- gst_caps_unref(src_caps);
-
if (status)
{
GST_ERROR("Failed to create winegstreamer transform.");
diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c
index 6c198706944..b14261706a7 100644
--- a/dlls/winegstreamer/wma_decoder.c
+++ b/dlls/winegstreamer/wma_decoder.c
@@ -78,7 +78,7 @@ static HRESULT try_create_wg_transform(struct wma_decoder *decoder)
if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN)
return MF_E_INVALIDMEDIATYPE;
- if (!(decoder->wg_transform = wg_transform_create(&input_format, &output_format)))
+ if (!(decoder->wg_transform = wg_transform_create()))
return E_FAIL;
return S_OK;
--
2.34.1

View File

@@ -1,293 +0,0 @@
From 51f5ec2a0fd00995b4ff155a89e46c7dff8e338b Mon Sep 17 00:00:00 2001
From: Thomas Crider <gloriouseggroll@gmail.com>
Date: Sat, 19 Feb 2022 16:58:23 -0700
Subject: [PATCH 05/88] Revert "winegstreamer: Introduce new wg_transform
struct."
This reverts commit 51a262d368afca3ec1edf50a850dbd5339194280.
---
dlls/winegstreamer/Makefile.in | 1 -
dlls/winegstreamer/gst_private.h | 3 --
dlls/winegstreamer/main.c | 14 -----
dlls/winegstreamer/unix_private.h | 5 --
dlls/winegstreamer/unixlib.h | 8 ---
dlls/winegstreamer/wg_parser.c | 13 +----
dlls/winegstreamer/wg_transform.c | 88 -------------------------------
dlls/winegstreamer/wma_decoder.c | 11 ----
8 files changed, 2 insertions(+), 141 deletions(-)
delete mode 100644 dlls/winegstreamer/wg_transform.c
diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in
index 0bcdb3eec65..d9805e3d797 100644
--- a/dlls/winegstreamer/Makefile.in
+++ b/dlls/winegstreamer/Makefile.in
@@ -14,7 +14,6 @@ C_SRCS = \
quartz_parser.c \
wg_format.c \
wg_parser.c \
- wg_transform.c \
wm_asyncreader.c \
wm_reader.c \
wm_syncreader.c \
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 8bc9f838d29..3584f465218 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -96,9 +96,6 @@ uint64_t wg_parser_stream_get_duration(struct wg_parser_stream *stream);
void wg_parser_stream_seek(struct wg_parser_stream *stream, double rate,
uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags);
-struct wg_transform *wg_transform_create(void);
-void wg_transform_destroy(struct wg_transform *transform);
-
unsigned int wg_format_get_max_size(const struct wg_format *format);
HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out);
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index af5a691371d..51a71d3b4a5 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -254,20 +254,6 @@ void wg_parser_stream_seek(struct wg_parser_stream *stream, double rate,
__wine_unix_call(unix_handle, unix_wg_parser_stream_seek, &params);
}
-struct wg_transform *wg_transform_create(void)
-{
- struct wg_transform_create_params params = {0};
-
- if (__wine_unix_call(unix_handle, unix_wg_transform_create, &params))
- return NULL;
- return params.transform;
-}
-
-void wg_transform_destroy(struct wg_transform *transform)
-{
- __wine_unix_call(unix_handle, unix_wg_transform_destroy, transform);
-}
-
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
{
if (reason == DLL_PROCESS_ATTACH)
diff --git a/dlls/winegstreamer/unix_private.h b/dlls/winegstreamer/unix_private.h
index f9c4da2f6ea..b483638403d 100644
--- a/dlls/winegstreamer/unix_private.h
+++ b/dlls/winegstreamer/unix_private.h
@@ -25,13 +25,8 @@
#include <gst/gst.h>
-extern bool init_gstreamer(void) DECLSPEC_HIDDEN;
-
extern void wg_format_from_caps(struct wg_format *format, const GstCaps *caps) DECLSPEC_HIDDEN;
extern bool wg_format_compare(const struct wg_format *a, const struct wg_format *b) DECLSPEC_HIDDEN;
extern GstCaps *wg_format_to_caps(const struct wg_format *format) DECLSPEC_HIDDEN;
-extern NTSTATUS wg_transform_create(void *args) DECLSPEC_HIDDEN;
-extern NTSTATUS wg_transform_destroy(void *args) DECLSPEC_HIDDEN;
-
#endif /* __WINE_WINEGSTREAMER_UNIX_PRIVATE_H */
diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h
index 8e3f5e84bfb..45ec606fc6a 100644
--- a/dlls/winegstreamer/unixlib.h
+++ b/dlls/winegstreamer/unixlib.h
@@ -229,11 +229,6 @@ struct wg_parser_stream_seek_params
DWORD start_flags, stop_flags;
};
-struct wg_transform_create_params
-{
- struct wg_transform *transform;
-};
-
enum unix_funcs
{
unix_wg_parser_create,
@@ -262,9 +257,6 @@ enum unix_funcs
unix_wg_parser_stream_get_duration,
unix_wg_parser_stream_seek,
-
- unix_wg_transform_create,
- unix_wg_transform_destroy,
};
#endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index 40c394c3caf..66f60d27477 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -1586,13 +1586,6 @@ static void init_gstreamer_once(void)
gst_version_string(), GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO);
}
-bool init_gstreamer(void)
-{
- static pthread_once_t init_once = PTHREAD_ONCE_INIT;
-
- return !pthread_once(&init_once, init_gstreamer_once);
-}
-
static NTSTATUS wg_parser_create(void *args)
{
static const init_gst_cb init_funcs[] =
@@ -1603,10 +1596,11 @@ static NTSTATUS wg_parser_create(void *args)
[WG_PARSER_WAVPARSE] = wave_parser_init_gst,
};
+ static pthread_once_t once = PTHREAD_ONCE_INIT;
struct wg_parser_create_params *params = args;
struct wg_parser *parser;
- if (!init_gstreamer())
+ if (pthread_once(&once, init_gstreamer_once))
return E_FAIL;
if (!(parser = calloc(1, sizeof(*parser))))
@@ -1673,7 +1667,4 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
X(wg_parser_stream_get_duration),
X(wg_parser_stream_seek),
-
- X(wg_transform_create),
- X(wg_transform_destroy),
};
diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c
deleted file mode 100644
index 2f225e5bc55..00000000000
--- a/dlls/winegstreamer/wg_transform.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * GStreamer transform backend
- *
- * Copyright 2022 Rémi Bernon for CodeWeavers
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#if 0
-#pragma makedep unix
-#endif
-
-#include "config.h"
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#include <gst/gst.h>
-#include <gst/video/video.h>
-#include <gst/audio/audio.h>
-
-#include "ntstatus.h"
-#define WIN32_NO_STATUS
-#include "winternl.h"
-#include "dshow.h"
-
-#include "unix_private.h"
-
-GST_DEBUG_CATEGORY_EXTERN(wine);
-#define GST_CAT_DEFAULT wine
-
-struct wg_transform
-{
- int dummy;
-};
-
-NTSTATUS wg_transform_destroy(void *args)
-{
- struct wg_transform *transform = args;
-
- free(transform);
- return STATUS_SUCCESS;
-}
-
-NTSTATUS wg_transform_create(void *args)
-{
- struct wg_transform_create_params *params = args;
- struct wg_transform *transform;
- NTSTATUS status;
-
- if (!init_gstreamer())
- return STATUS_UNSUCCESSFUL;
-
- status = STATUS_NO_MEMORY;
-
- if (!(transform = calloc(1, sizeof(*transform))))
- goto done;
-
- status = STATUS_SUCCESS;
-
-done:
- if (status)
- {
- GST_ERROR("Failed to create winegstreamer transform.");
- if (transform)
- wg_transform_destroy(transform);
- }
- else
- {
- GST_INFO("Created winegstreamer transform %p.", transform);
- params->transform = transform;
- }
-
- return status;
-}
diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c
index b14261706a7..31f735a5b1d 100644
--- a/dlls/winegstreamer/wma_decoder.c
+++ b/dlls/winegstreamer/wma_decoder.c
@@ -53,8 +53,6 @@ struct wma_decoder
LONG refcount;
IMFMediaType *input_type;
IMFMediaType *output_type;
-
- struct wg_transform *wg_transform;
};
static inline struct wma_decoder *impl_from_IUnknown(IUnknown *iface)
@@ -66,10 +64,6 @@ static HRESULT try_create_wg_transform(struct wma_decoder *decoder)
{
struct wg_format input_format, output_format;
- if (decoder->wg_transform)
- wg_transform_destroy(decoder->wg_transform);
- decoder->wg_transform = NULL;
-
mf_media_type_to_wg_format(decoder->input_type, &input_format);
if (input_format.major_type == WG_MAJOR_TYPE_UNKNOWN)
return MF_E_INVALIDMEDIATYPE;
@@ -78,9 +72,6 @@ static HRESULT try_create_wg_transform(struct wma_decoder *decoder)
if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN)
return MF_E_INVALIDMEDIATYPE;
- if (!(decoder->wg_transform = wg_transform_create()))
- return E_FAIL;
-
return S_OK;
}
@@ -128,8 +119,6 @@ static ULONG WINAPI unknown_Release(IUnknown *iface)
if (!refcount)
{
- if (decoder->wg_transform)
- wg_transform_destroy(decoder->wg_transform);
if (decoder->input_type)
IMFMediaType_Release(decoder->input_type);
if (decoder->output_type)
--
2.34.1

View File

@@ -1,344 +0,0 @@
From 01b1caa979ab811edb7b859bc8f84ee68053a991 Mon Sep 17 00:00:00 2001
From: Thomas Crider <gloriouseggroll@gmail.com>
Date: Sat, 19 Feb 2022 16:58:47 -0700
Subject: [PATCH 06/88] Revert "winegstreamer: Introduce new WG_MAJOR_TYPE_WMA
major type."
This reverts commit 76e2883c4ace29279dce8ea58787871046227b1a.
---
dlls/winegstreamer/mfplat.c | 109 ++++++-----------------------
dlls/winegstreamer/quartz_parser.c | 8 ---
dlls/winegstreamer/unixlib.h | 12 ----
dlls/winegstreamer/wg_format.c | 7 --
dlls/winegstreamer/wm_reader.c | 8 ---
dlls/winegstreamer/wma_decoder.c | 18 -----
6 files changed, 21 insertions(+), 141 deletions(-)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 9b3fc429d32..a111bbe196d 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -635,10 +635,6 @@ IMFMediaType *mf_media_type_from_wg_format(const struct wg_format *format)
case WG_MAJOR_TYPE_UNKNOWN:
return NULL;
- case WG_MAJOR_TYPE_WMA:
- FIXME("WMA format not implemented!\n");
- return NULL;
-
case WG_MAJOR_TYPE_AUDIO:
return mf_media_type_from_wg_format_audio(format);
@@ -650,11 +646,17 @@ IMFMediaType *mf_media_type_from_wg_format(const struct wg_format *format)
return NULL;
}
-static void mf_media_type_to_wg_format_audio(IMFMediaType *type, const GUID *subtype, struct wg_format *format)
+static void mf_media_type_to_wg_format_audio(IMFMediaType *type, struct wg_format *format)
{
UINT32 rate, channels, channel_mask, depth;
unsigned int i;
+ GUID subtype;
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
+ {
+ FIXME("Subtype is not set.\n");
+ return;
+ }
if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &rate)))
{
FIXME("Sample rate is not set.\n");
@@ -690,20 +692,26 @@ static void mf_media_type_to_wg_format_audio(IMFMediaType *type, const GUID *sub
for (i = 0; i < ARRAY_SIZE(audio_formats); ++i)
{
- if (IsEqualGUID(subtype, audio_formats[i].subtype) && depth == audio_formats[i].depth)
+ if (IsEqualGUID(&subtype, audio_formats[i].subtype) && depth == audio_formats[i].depth)
{
format->u.audio.format = audio_formats[i].format;
return;
}
}
- FIXME("Unrecognized audio subtype %s, depth %u.\n", debugstr_guid(subtype), depth);
+ FIXME("Unrecognized audio subtype %s, depth %u.\n", debugstr_guid(&subtype), depth);
}
-static void mf_media_type_to_wg_format_video(IMFMediaType *type, const GUID *subtype, struct wg_format *format)
+static void mf_media_type_to_wg_format_video(IMFMediaType *type, struct wg_format *format)
{
UINT64 frame_rate, frame_size;
unsigned int i;
+ GUID subtype;
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
+ {
+ FIXME("Subtype is not set.\n");
+ return;
+ }
if (FAILED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size)))
{
FIXME("Frame size is not set.\n");
@@ -724,80 +732,18 @@ static void mf_media_type_to_wg_format_video(IMFMediaType *type, const GUID *sub
for (i = 0; i < ARRAY_SIZE(video_formats); ++i)
{
- if (IsEqualGUID(subtype, video_formats[i].subtype))
+ if (IsEqualGUID(&subtype, video_formats[i].subtype))
{
format->u.video.format = video_formats[i].format;
return;
}
}
- FIXME("Unrecognized video subtype %s.\n", debugstr_guid(subtype));
-}
-
-static void mf_media_type_to_wg_format_wma(IMFMediaType *type, const GUID *subtype, struct wg_format *format)
-{
- UINT32 rate, depth, channels, block_align, bytes_per_second, codec_data_len;
- BYTE codec_data[64];
- UINT32 version;
-
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &rate)))
- {
- FIXME("Sample rate is not set.\n");
- return;
- }
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &channels)))
- {
- FIXME("Channel count is not set.\n");
- return;
- }
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &block_align)))
- {
- FIXME("Block alignment is not set.\n");
- return;
- }
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BITS_PER_SAMPLE, &depth)))
- {
- FIXME("Depth is not set.\n");
- return;
- }
- if (FAILED(IMFMediaType_GetBlob(type, &MF_MT_USER_DATA, codec_data, sizeof(codec_data), &codec_data_len)))
- {
- FIXME("Codec data is not set.\n");
- return;
- }
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &bytes_per_second)))
- {
- FIXME("Bitrate is not set.\n");
- bytes_per_second = 0;
- }
-
- if (IsEqualGUID(subtype, &MEDIASUBTYPE_MSAUDIO1))
- version = 1;
- else if (IsEqualGUID(subtype, &MFAudioFormat_WMAudioV8))
- version = 2;
- else if (IsEqualGUID(subtype, &MFAudioFormat_WMAudioV9))
- version = 3;
- else if (IsEqualGUID(subtype, &MFAudioFormat_WMAudio_Lossless))
- version = 4;
- else
- {
- assert(0);
- return;
- }
-
- format->major_type = WG_MAJOR_TYPE_WMA;
- format->u.wma.version = version;
- format->u.wma.bitrate = bytes_per_second * 8;
- format->u.wma.rate = rate;
- format->u.wma.depth = depth;
- format->u.wma.channels = channels;
- format->u.wma.block_align = block_align;
- format->u.wma.codec_data_len = codec_data_len;
- memcpy(format->u.wma.codec_data, codec_data, codec_data_len);
+ FIXME("Unrecognized video subtype %s.\n", debugstr_guid(&subtype));
}
void mf_media_type_to_wg_format(IMFMediaType *type, struct wg_format *format)
{
- GUID major_type, subtype;
+ GUID major_type;
memset(format, 0, sizeof(*format));
@@ -806,24 +752,11 @@ void mf_media_type_to_wg_format(IMFMediaType *type, struct wg_format *format)
FIXME("Major type is not set.\n");
return;
}
- if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
- {
- FIXME("Subtype is not set.\n");
- return;
- }
if (IsEqualGUID(&major_type, &MFMediaType_Audio))
- {
- if (IsEqualGUID(&subtype, &MEDIASUBTYPE_MSAUDIO1) ||
- IsEqualGUID(&subtype, &MFAudioFormat_WMAudioV8) ||
- IsEqualGUID(&subtype, &MFAudioFormat_WMAudioV9) ||
- IsEqualGUID(&subtype, &MFAudioFormat_WMAudio_Lossless))
- mf_media_type_to_wg_format_wma(type, &subtype, format);
- else
- mf_media_type_to_wg_format_audio(type, &subtype, format);
- }
+ mf_media_type_to_wg_format_audio(type, format);
else if (IsEqualGUID(&major_type, &MFMediaType_Video))
- mf_media_type_to_wg_format_video(type, &subtype, format);
+ mf_media_type_to_wg_format_video(type, format);
else
FIXME("Unrecognized major type %s.\n", debugstr_guid(&major_type));
}
diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c
index e06c55ccfe0..45313ebda27 100644
--- a/dlls/winegstreamer/quartz_parser.c
+++ b/dlls/winegstreamer/quartz_parser.c
@@ -319,10 +319,6 @@ unsigned int wg_format_get_max_size(const struct wg_format *format)
break;
}
- case WG_MAJOR_TYPE_WMA:
- FIXME("WMA format not implemented!\n");
- return 0;
-
case WG_MAJOR_TYPE_UNKNOWN:
FIXME("Cannot guess maximum sample size for unknown format.\n");
return 0;
@@ -417,10 +413,6 @@ bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format, bool
case WG_MAJOR_TYPE_UNKNOWN:
return false;
- case WG_MAJOR_TYPE_WMA:
- FIXME("WMA format not implemented!\n");
- return false;
-
case WG_MAJOR_TYPE_AUDIO:
return amt_from_wg_format_audio(mt, format);
diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h
index 45ec606fc6a..82bb534b938 100644
--- a/dlls/winegstreamer/unixlib.h
+++ b/dlls/winegstreamer/unixlib.h
@@ -37,7 +37,6 @@ struct wg_format
WG_MAJOR_TYPE_UNKNOWN,
WG_MAJOR_TYPE_VIDEO,
WG_MAJOR_TYPE_AUDIO,
- WG_MAJOR_TYPE_WMA,
} major_type;
union
@@ -89,17 +88,6 @@ struct wg_format
uint32_t channel_mask; /* In WinMM format. */
uint32_t rate;
} audio;
- struct
- {
- uint32_t version;
- uint32_t bitrate;
- uint32_t rate;
- uint32_t depth;
- uint32_t channels;
- uint32_t block_align;
- uint32_t codec_data_len;
- unsigned char codec_data[64];
- } wma;
} u;
};
diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c
index 8f771bb8abd..8952acc1c2e 100644
--- a/dlls/winegstreamer/wg_format.c
+++ b/dlls/winegstreamer/wg_format.c
@@ -400,9 +400,6 @@ GstCaps *wg_format_to_caps(const struct wg_format *format)
{
case WG_MAJOR_TYPE_UNKNOWN:
return NULL;
- case WG_MAJOR_TYPE_WMA:
- GST_FIXME("WMA format not implemented!\n");
- return NULL;
case WG_MAJOR_TYPE_AUDIO:
return wg_format_to_caps_audio(format);
case WG_MAJOR_TYPE_VIDEO:
@@ -422,10 +419,6 @@ bool wg_format_compare(const struct wg_format *a, const struct wg_format *b)
case WG_MAJOR_TYPE_UNKNOWN:
return false;
- case WG_MAJOR_TYPE_WMA:
- GST_FIXME("WMA format not implemented!\n");
- return false;
-
case WG_MAJOR_TYPE_AUDIO:
return a->u.audio.format == b->u.audio.format
&& a->u.audio.channels == b->u.audio.channels
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index 01518c6b9a8..d40afb66afd 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -1687,9 +1687,6 @@ HRESULT wm_reader_get_output_format_count(struct wm_reader *reader, DWORD output
*count = ARRAY_SIZE(video_formats);
break;
- case WG_MAJOR_TYPE_WMA:
- FIXME("WMA format not implemented!\n");
- /* fallthrough */
case WG_MAJOR_TYPE_AUDIO:
case WG_MAJOR_TYPE_UNKNOWN:
*count = 1;
@@ -1736,9 +1733,6 @@ HRESULT wm_reader_get_output_format(struct wm_reader *reader, DWORD output,
format.u.audio.format = WG_AUDIO_FORMAT_S16LE;
break;
- case WG_MAJOR_TYPE_WMA:
- FIXME("WMA format not implemented!\n");
- break;
case WG_MAJOR_TYPE_UNKNOWN:
break;
}
@@ -1814,8 +1808,6 @@ static const char *get_major_type_string(enum wg_major_type type)
return "video";
case WG_MAJOR_TYPE_UNKNOWN:
return "unknown";
- case WG_MAJOR_TYPE_WMA:
- return "wma";
}
assert(0);
return NULL;
diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c
index 31f735a5b1d..78316059052 100644
--- a/dlls/winegstreamer/wma_decoder.c
+++ b/dlls/winegstreamer/wma_decoder.c
@@ -60,21 +60,6 @@ static inline struct wma_decoder *impl_from_IUnknown(IUnknown *iface)
return CONTAINING_RECORD(iface, struct wma_decoder, IUnknown_inner);
}
-static HRESULT try_create_wg_transform(struct wma_decoder *decoder)
-{
- struct wg_format input_format, output_format;
-
- mf_media_type_to_wg_format(decoder->input_type, &input_format);
- if (input_format.major_type == WG_MAJOR_TYPE_UNKNOWN)
- return MF_E_INVALIDMEDIATYPE;
-
- mf_media_type_to_wg_format(decoder->output_type, &output_format);
- if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN)
- return MF_E_INVALIDMEDIATYPE;
-
- return S_OK;
-}
-
static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID iid, void **out)
{
struct wma_decoder *decoder = impl_from_IUnknown(iface);
@@ -453,9 +438,6 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
if (FAILED(hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *)decoder->output_type)))
goto failed;
- if (FAILED(hr = try_create_wg_transform(decoder)))
- goto failed;
-
return S_OK;
failed:
--
2.34.1

Some files were not shown because too many files have changed in this diff Show More