Compare commits

...

33 Commits
v7.9 ... v7.13

Author SHA1 Message Date
Alistair Leslie-Hughes
cd8ca4d7d6 Release v7.13 2022-07-16 17:25:55 +10:00
Alistair Leslie-Hughes
7cecf22dcc Rebase against a0febe909780189fa2441635484cb592b9ab64b5. 2022-07-15 13:40:05 +10:00
Alistair Leslie-Hughes
eb479ea60c Rebase against 7ff508838ec6631b9def78ae391ff266fcc0d80e. 2022-07-14 09:12:35 +10:00
Alistair Leslie-Hughes
a500c9ce42 Rebase against b9a61cde89e5dc6264b4c152f4dc24ecf064f8f6. 2022-07-13 11:00:29 +10:00
Alistair Leslie-Hughes
35d13b744e Rebase against 6e32c011a2b977246f9ab2282d30b69cff90142b. 2022-07-12 08:32:33 +10:00
Alistair Leslie-Hughes
f7d87c5bfb Rebase against 7b79e3a87b1e1a9478e92d6ea3b5973da4388a82. 2022-07-09 07:24:57 +10:00
Alistair Leslie-Hughes
0acaed0ae5 Rebase against 9af3a79b96318471818e0abacfc1a6f8ecc91463. 2022-07-07 10:03:41 +10:00
Alistair Leslie-Hughes
8699d2c2f6 Release v7.12 2022-07-02 14:31:17 +10:00
Alistair Leslie-Hughes
e7622edfc9 Rebase against 67f9c76386c8f67363f1fa90d7f7ac0ac84fdcd7. 2022-07-01 15:50:23 +10:00
Alistair Leslie-Hughes
c9652a68e1 Rebase against 29dd84443976005a8ec713dd1c75458e27346591. 2022-06-29 11:14:16 +10:00
Alistair Leslie-Hughes
6be691c005 Rebase against af8ed02b572081206be6c505261f5f2e98a8053c. 2022-06-25 21:09:49 +10:00
Alistair Leslie-Hughes
850b7f6540 Added winepulse-aux_channels patchset 2022-06-22 20:55:52 +10:00
Alistair Leslie-Hughes
776c47da46 Updated winepulse-PulseAudio_Support patchset 2022-06-21 08:49:58 +10:00
Alistair Leslie-Hughes
a51c679f34 Merge pull request #83 from Gcenx/action-update-deps
macOS.yml: Cleanup workflows
2022-06-20 10:40:29 +10:00
Gcenx
366a9020dc macOS.yml: Cleanup workflows
- Use brews mingw-w64 formula again
- Cleanup notes
- Remove unneeded formulas from wine-devel
2022-06-19 18:51:01 -04:00
Alistair Leslie-Hughes
a8e56928ef Release v7.11 2022-06-18 10:48:28 +10:00
Alistair Leslie-Hughes
f0e38f512c Fix Rebase 2022-06-16 10:08:01 +10:00
Alistair Leslie-Hughes
3d9f724967 Rebase against 712c547e0869b0caf797694137e36bacea614aa6. 2022-06-16 09:05:11 +10:00
Alistair Leslie-Hughes
4e4376778f Fix Rebase 2022-06-14 17:22:11 +10:00
Alistair Leslie-Hughes
94e31f7578 Rebase against f86a66b660267bf245817350a6012e0c5c6547df. 2022-06-14 14:43:45 +10:00
Alistair Leslie-Hughes
560db77d41 Rebase against 35939bbe0c04534da07ece7f6a47a560d356f7a1. 2022-06-11 12:19:21 +10:00
Zebediah Figura
2d5e6b24dc Rebase against 561a5b8f84db68e608df022a8dbd71803f506946. 2022-06-09 18:45:26 -05:00
Alistair Leslie-Hughes
37c1363814 Rebase against d95780ba39816e3eb1139366236f3835564beadd. 2022-06-08 08:02:38 +10:00
Alistair Leslie-Hughes
94f00cd958 Release v7.10 2022-06-04 12:38:07 +10:00
Alistair Leslie-Hughes
b22c061c3f Updated dwmapi-DwmGetCompositionTimingInfo patchset 2022-06-04 09:11:00 +10:00
Alistair Leslie-Hughes
0e42f8ce9a Rebase against 631f4d5e42b7c2f705eb4b40eeea0ce1866bf513. 2022-06-04 08:34:41 +10:00
Alistair Leslie-Hughes
f2c44a8a4d Added dwmapi-DwmGetCompositionTimingInfo patchset 2022-06-03 10:25:28 +10:00
Alistair Leslie-Hughes
8f0f175429 Rebase against 7a8254fd05a2c7c89783d65cba544f2899611c73. 2022-06-03 10:05:32 +10:00
Alistair Leslie-Hughes
3fe7d402eb Rebase against c1e793f1119de0c0ef7d4bd6d9fefbafdb5dbbe5. 2022-06-02 10:42:41 +10:00
Zebediah Figura
7fc2d64fee Rebase against 9d72487f2102bd6eb245e199e73304c67bb5d41a. 2022-05-31 17:20:45 -05:00
Zebediah Figura
c6119e3d5c Rebase against 4312d209232c701b0b78d9f8b463917c989005c5.
libs-Unicode_Collation is not fully replaced upstream, but the remaining patch (0006) holds no value anymore.
2022-05-30 18:26:39 -05:00
Alistair Leslie-Hughes
8ee2551c93 Rebase against 99ce6e87a3b22c5602d7bbedd43bb40627b63321. 2022-05-26 15:30:47 +10:00
Alistair Leslie-Hughes
f0d1a4a5ba Rebase against 303f8042f9db508adaca02ef21f8de4992cb9c03. 2022-05-25 13:37:54 +10:00
36 changed files with 526 additions and 2528 deletions

View File

@@ -19,7 +19,7 @@ jobs:
brew install bison \
gphoto2 \
gst-plugins-base \
gcenx/wine/mingw-w64@9 \
mingw-w64 \
molten-vk \
sdl2
@@ -28,7 +28,6 @@ jobs:
set -eu
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix krb5)/bin" >> $GITHUB_PATH
echo "$(brew --prefix mingw-w64@9)/bin" >> $GITHUB_PATH
- name: Get upstream-commit
run: |
@@ -62,8 +61,6 @@ jobs:
--x-lib=/opt/X11/lib
- name: Build wine64
# mingw-w64 brew formula bumped binutils 2.38 causing a regression in parallel builds
# use gcenx/wine/mingw-w64@9 this uses binutils 2.37
run: |
cd $GITHUB_WORKSPACE/wine
make -j$(sysctl -n hw.ncpu 2>/dev/null)
@@ -79,12 +76,9 @@ jobs:
brew update
brew install --cask xquartz
brew install bison \
faudio \
gphoto2 \
gst-plugins-base \
jxrlib \
little-cms2 \
gcenx/wine/mingw-w64@9 \
mingw-w64 \
molten-vk \
mpg123
@@ -93,7 +87,6 @@ jobs:
set -eu
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix krb5)/bin" >> $GITHUB_PATH
echo "$(brew --prefix mingw-w64@9)/bin" >> $GITHUB_PATH
- name: Get upstream-commit
run: |
@@ -125,8 +118,6 @@ jobs:
--x-lib=/opt/X11/lib
- name: Build wine64
# mingw-w64 brew formula bumped binutils 2.38 causing a regression in parallel builds
# use gcenx/wine/mingw-w64@9 this uses binutils 2.37
run: |
cd $GITHUB_WORKSPACE/wine
make -j$(sysctl -n hw.ncpu 2>/dev/null)

View File

@@ -1,18 +1,18 @@
From 4498bb259a9ab5e5bf6f8a55dc96b6ac24c82e09 Mon Sep 17 00:00:00 2001
From 9028351204472aafe5d7731c8737a6cfdb09e659 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 30 May 2015 02:56:19 +0200
Subject: ddraw/tests: Add more tests for IDirect3DTexture2::Load.
Subject: [PATCH] ddraw/tests: Add more tests for IDirect3DTexture2::Load.
---
dlls/ddraw/tests/d3d.c | 373 ++++++++++++++++++++++++++++++++++++++++++++++
dlls/ddraw/tests/ddraw2.c | 28 +++-
dlls/ddraw/tests/d3d.c | 373 ++++++++++++++++++++++++++++++++++++++
dlls/ddraw/tests/ddraw2.c | 28 ++-
2 files changed, 400 insertions(+), 1 deletion(-)
diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c
index ec4197a..d35d0e0 100644
index 87d0648b699..e88bbf59767 100644
--- a/dlls/ddraw/tests/d3d.c
+++ b/dlls/ddraw/tests/d3d.c
@@ -1515,6 +1515,288 @@ static BOOL colortables_check_equality(PALETTEENTRY table1[256], PALETTEENTRY ta
@@ -1221,6 +1221,288 @@ static BOOL colortables_check_equality(PALETTEENTRY table1[256], PALETTEENTRY ta
return TRUE;
}
@@ -301,9 +301,9 @@ index ec4197a..d35d0e0 100644
/* test palette handling in IDirect3DTexture_Load */
static void TextureLoadTest(void)
{
@@ -1578,6 +1860,97 @@ static void TextureLoadTest(void)
@@ -1284,6 +1566,97 @@ static void TextureLoadTest(void)
hr = IDirect3DTexture_Load(Texture2, Texture);
ok(hr == DD_OK, "IDirect3DTexture_Load returned %08x\n", hr);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
+ for (i = 0; i < sizeof(load_tests) / sizeof(load_tests[0]); i++)
+ {
@@ -400,10 +400,10 @@ index ec4197a..d35d0e0 100644
table1[i].peRed = i;
table1[i].peGreen = i;
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 0cb1ca4..a2489e4 100644
index 2d08718d131..0a2d575e8cc 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -1121,8 +1121,10 @@ static void test_texture_load_ckey(void)
@@ -1495,8 +1495,10 @@ static void test_texture_load_ckey(void)
IDirectDraw2 *ddraw = NULL;
IDirectDrawSurface *src = NULL;
IDirectDrawSurface *dst = NULL;
@@ -414,7 +414,7 @@ index 0cb1ca4..a2489e4 100644
DDSURFACEDESC ddsd;
HRESULT hr;
DDCOLORKEY ckey;
@@ -1134,16 +1136,31 @@ static void test_texture_load_ckey(void)
@@ -1508,16 +1510,31 @@ static void test_texture_load_ckey(void)
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
@@ -431,10 +431,10 @@ index 0cb1ca4..a2489e4 100644
+ U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000FF;
+
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &src, NULL);
ok(SUCCEEDED(hr), "Failed to create source texture, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to create source texture, hr %#lx.\n", hr);
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &dst, NULL);
ok(SUCCEEDED(hr), "Failed to create destination texture, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to create destination texture, hr %#lx.\n", hr);
+ U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 16;
+ U2(ddsd.ddpfPixelFormat).dwRBitMask = 0xf800;
@@ -445,20 +445,20 @@ index 0cb1ca4..a2489e4 100644
+ ok(SUCCEEDED(hr), "Failed to create destination texture, hr %#x.\n", hr);
+
hr = IDirectDrawSurface_QueryInterface(src, &IID_IDirect3DTexture, (void **)&src_tex);
ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to get Direct3DTexture interface, hr %#x.\n", hr);
ok(SUCCEEDED(hr) || hr == E_NOINTERFACE, "Failed to get Direct3DTexture interface, hr %#lx.\n", hr);
if (FAILED(hr))
@@ -1154,6 +1171,8 @@ static void test_texture_load_ckey(void)
@@ -1528,6 +1545,8 @@ static void test_texture_load_ckey(void)
}
hr = IDirectDrawSurface_QueryInterface(dst, &IID_IDirect3DTexture, (void **)&dst_tex);
ok(SUCCEEDED(hr), "Failed to get Direct3DTexture interface, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to get Direct3DTexture interface, hr %#lx.\n", hr);
+ hr = IDirectDrawSurface_QueryInterface(dst2, &IID_IDirect3DTexture, (void **)&dst2_tex);
+ ok(SUCCEEDED(hr), "Failed to get Direct3DTexture interface, hr %#x.\n", hr);
+ ok(SUCCEEDED(hr), "Failed to get Direct3DTexture interface, hr %#lx.\n", hr);
/* No surface has a color key */
hr = IDirect3DTexture_Load(dst_tex, src_tex);
@@ -1182,6 +1201,11 @@ static void test_texture_load_ckey(void)
ok(ckey.dwColorSpaceLowValue == 0x0000ff00, "dwColorSpaceLowValue is %#x.\n", ckey.dwColorSpaceLowValue);
ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "dwColorSpaceHighValue is %#x.\n", ckey.dwColorSpaceHighValue);
@@ -1556,6 +1575,11 @@ static void test_texture_load_ckey(void)
ok(ckey.dwColorSpaceLowValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceLowValue);
ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue);
+ /* Source surface has a color key but destination differs in format */
+ ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0x0;
@@ -468,8 +468,8 @@ index 0cb1ca4..a2489e4 100644
/* Both surfaces have a color key: Dest ckey is overwritten */
ckey.dwColorSpaceLowValue = ckey.dwColorSpaceHighValue = 0x000000ff;
hr = IDirectDrawSurface_SetColorKey(dst, DDCKEY_SRCBLT, &ckey);
@@ -1206,8 +1230,10 @@ static void test_texture_load_ckey(void)
ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "dwColorSpaceHighValue is %#x.\n", ckey.dwColorSpaceHighValue);
@@ -1580,8 +1604,10 @@ static void test_texture_load_ckey(void)
ok(ckey.dwColorSpaceHighValue == 0x0000ff00, "Got unexpected value 0x%08lx.\n", ckey.dwColorSpaceHighValue);
done:
+ if (dst2_tex) IDirect3DTexture_Release(dst2_tex);
@@ -480,5 +480,5 @@ index 0cb1ca4..a2489e4 100644
if (src) IDirectDrawSurface_Release(src);
if (ddraw) IDirectDraw2_Release(ddraw);
--
2.4.2
2.35.1

View File

@@ -1,4 +1,4 @@
From 415ededb3cceae15cb05a1860cef1d4e5e055b27 Mon Sep 17 00:00:00 2001
From 5d29a2de174042ce7bdd52d92337591933e0f761 Mon Sep 17 00:00:00 2001
From: Mark Harmstone <mark@harmstone.com>
Date: Fri, 27 Mar 2015 20:58:37 +0000
Subject: [PATCH] dsound: Add EAX init and free stubs.
@@ -10,10 +10,10 @@ Subject: [PATCH] dsound: Add EAX init and free stubs.
3 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
index 6bbf468d136..e27fdfdecc4 100644
index e8b3fb4a832..28f2e95994e 100644
--- a/dlls/dsound/buffer.c
+++ b/dlls/dsound/buffer.c
@@ -1110,6 +1110,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
@@ -1153,6 +1153,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
DSOUND_RecalcVolPan(&(dsb->volpan));
InitializeSRWLock(&dsb->lock);
@@ -22,20 +22,20 @@ index 6bbf468d136..e27fdfdecc4 100644
/* register buffer */
err = DirectSoundDevice_AddBuffer(device, dsb);
@@ -1150,6 +1152,8 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
@@ -1194,6 +1196,8 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
HeapFree(GetProcessHeap(), 0, This->filters);
}
+ free_eax_buffer(This);
+
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
HeapFree(GetProcessHeap(), 0, This);
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index 3b4c4f290a4..8dbb9edb594 100644
index 267b2c044bc..c906eb2adb1 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -234,6 +234,8 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
@@ -240,6 +240,8 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
HRESULT WINAPI EAX_Set(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
ULONG dwPropID, void *pInstanceData, ULONG cbInstanceData, void *pPropData,
ULONG cbPropData) DECLSPEC_HIDDEN;
@@ -45,7 +45,7 @@ index 3b4c4f290a4..8dbb9edb594 100644
/* mixer.c */
void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len) DECLSPEC_HIDDEN;
diff --git a/dlls/dsound/eax.c b/dlls/dsound/eax.c
index 3931681d295..c0afb0f1acf 100644
index 03b6e0a9813..91438efc335 100644
--- a/dlls/dsound/eax.c
+++ b/dlls/dsound/eax.c
@@ -92,20 +92,46 @@ static const EFXEAXREVERBPROPERTIES efx_presets[] = {
@@ -97,5 +97,5 @@ index 3931681d295..c0afb0f1acf 100644
HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
--
2.27.0
2.35.1

View File

@@ -1,128 +0,0 @@
From dca517521550923c881c95659f2309756c84d597 Mon Sep 17 00:00:00 2001
From: Fabian Maurer <dark.shadow4@web.de>
Date: Sat, 8 Aug 2020 16:47:15 +0200
Subject: [PATCH] kernelbase: Implement sortkey punctuation
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
---
dlls/kernel32/tests/locale.c | 29 +++++++++++++++++++++++++++++
dlls/kernelbase/locale.c | 35 +++++++++++++++++++++++++++++++----
2 files changed, 60 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index d875bf94f92..25c460f4175 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -3210,6 +3210,35 @@ static const struct sorting_test_entry unicode_sorting_tests[] =
{ L"en-US", CSTR_EQUAL, CSTR_EQUAL, 0, L"A\x0301\x0301", L"A\x0301\x00ad\x0301" }, /* Unsortable combined with diacritics */
{ L"en-US", CSTR_EQUAL, CSTR_EQUAL, 0, L"b\x07f2\x07f2", L"b\x07f2\x2064\x07f2" }, /* Unsortable combined with diacritics */
{ L"en-US", CSTR_EQUAL, CSTR_EQUAL, 0, L"X\x0337\x0337", L"X\x0337\xfffd\x0337" }, /* Unsortable combined with diacritics */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORECASE, L"c", L"C" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORECASE, L"e", L"E" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORECASE, L"A", L"a" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x001b", L"\x001c" }, /* Punctuation primary weight */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x0005", L"\x0006" }, /* Punctuation primary weight */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x0027", L"\xff07", TRUE }, /* Punctuation diacritic/case weight */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x07f4", L"\x07f5", TRUE }, /* Punctuation diacritic/case weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x207b", L"\x0008" }, /* Punctuation diacritic/case weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x207b", L"\x0008" }, /* Punctuation */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x0004", L"\x0011" }, /* Punctuation */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\xff07", L"\x07f4" }, /* Punctuation primary weight has priority */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\xfe32", L"\x2014" }, /* Punctuation primary weight has priority */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x058a", L"\x2027" }, /* Punctuation primary weight has priority */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORESYMBOLS, L"\x207b", L"\x0008" }, /* Punctuation */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORESYMBOLS, L"\x0004", L"\x0011" }, /* Punctuation */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x207b", L"\x0008" }, /* Punctuation */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, SORT_STRINGSORT, L"\x0004", L"\x0011" }, /* Punctuation */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORESYMBOLS | SORT_STRINGSORT, L"\x207b", L"\x0008" }, /* Punctuation */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORESYMBOLS | SORT_STRINGSORT, L"\x0004", L"\x0011" }, /* Punctuation */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, SORT_STRINGSORT, L"\x001a", L"\x001b" }, /* Punctuation main weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x2027", L"\x2011" }, /* Punctuation main weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x3030", L"\x301c" }, /* Punctuation main weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x058a", L"\x2010" }, /* Punctuation diacritic weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x07F5", L"\x07F4" }, /* Punctuation diacritic weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xfe32", L"\x2013" }, /* Punctuation case weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xfe31", L"\xfe58" }, /* Punctuation case weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xff07", L"\x0027" }, /* Punctuation case weight */
+
+
};
static void test_unicode_sorting(void)
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index 3a29f3e8250..bce705ab484 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -2556,7 +2556,11 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
break;
case SORTKEY_PUNCTUATION:
- /* TODO */
+ if ((flags & NORM_IGNORESYMBOLS) || !(flags & SORT_STRINGSORT))
+ break;
+
+ sortkey_add_weight(data, info.script_member);
+ sortkey_add_weight(data, info.weight_primary);
break;
case SORTKEY_SYMBOL_1:
@@ -2619,7 +2623,9 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
break;
case SORTKEY_PUNCTUATION:
- /* TODO */
+ if ((flags & NORM_IGNORESYMBOLS) || !(flags & SORT_STRINGSORT))
+ break;
+ sortkey_add_diacritic_weight(data, info.weight_diacritic, last_weighted_pos);
break;
case SORTKEY_SYMBOL_1:
@@ -2660,7 +2666,9 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
break;
case SORTKEY_PUNCTUATION:
- /* TODO */
+ if ((flags & NORM_IGNORESYMBOLS) || !(flags & SORT_STRINGSORT))
+ break;
+ sortkey_add_case_weight(data, flags, info.weight_case);
break;
case SORTKEY_SYMBOL_1:
@@ -2680,6 +2688,24 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
}
}
+static void sortkey_add_special_weights(struct sortkey_data *data, int flags, WCHAR c)
+{
+ struct character_info info;
+ BYTE weight_second;
+
+ sortkey_get_char(&info, c);
+
+ if (info.script_member == SORTKEY_PUNCTUATION)
+ {
+ if ((flags & NORM_IGNORESYMBOLS) || (flags & SORT_STRINGSORT))
+ return;
+
+ weight_second = (BYTE)(info.weight_diacritic * 8 + info.weight_case);
+ sortkey_add_weight(data, info.weight_primary);
+ sortkey_add_weight(data, weight_second);
+ }
+}
+
static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, int str_len, BYTE *buffer, int buffer_len)
{
static const BYTE SORTKEY_SEPARATOR = 1;
@@ -2721,7 +2747,8 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
sortkey_add_weight(&data, SORTKEY_SEPARATOR);
/* Special weights */
- /* TODO */
+ for (i = 0; i < str_len; i++)
+ sortkey_add_special_weights(&data, flags, str[i]);
sortkey_add_weight(&data, SORTKEY_TERMINATOR);
if (data.buffer_pos <= buffer_len || !buffer)
--
2.29.2

View File

@@ -1,273 +0,0 @@
From 0f23a9db326dd6040b2d41fac99bd495f718d63d Mon Sep 17 00:00:00 2001
From: Fabian Maurer <dark.shadow4@web.de>
Date: Sat, 8 Aug 2020 16:49:02 +0200
Subject: [PATCH] kernelbase: Implement sortkey for Japanese characters
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
---
dlls/kernel32/tests/locale.c | 94 ++++++++++++++++++++++++++++++-
dlls/kernelbase/locale.c | 104 +++++++++++++++++++++++++++++++++--
2 files changed, 192 insertions(+), 6 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 25c460f4175..43a244d2a6b 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -3237,8 +3237,98 @@ static const struct sorting_test_entry unicode_sorting_tests[] =
{ L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xfe32", L"\x2013" }, /* Punctuation case weight */
{ L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xfe31", L"\xfe58" }, /* Punctuation case weight */
{ L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xff07", L"\x0027" }, /* Punctuation case weight */
-
-
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORESYMBOLS, L"\x207b", L"\x0008" }, /* Punctuation NORM_IGNORESYMBOLS */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORESYMBOLS, L"\x0004", L"\x0011" }, /* Punctuation NORM_IGNORESYMBOLS */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORESYMBOLS | SORT_STRINGSORT, L"\x207b", L"\x0008" }, /* Punctuation NORM_IGNORESYMBOLS SORT_STRINGSORT */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORESYMBOLS | SORT_STRINGSORT, L"\x0004", L"\x0011" }, /* Punctuation NORM_IGNORESYMBOLS SORT_STRINGSORT */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, SORT_STRINGSORT, L"\x001a", L"\x001b" }, /* Punctuation SORT_STRINGSORT main weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x2027", L"\x2011", }, /* Punctuation SORT_STRINGSORT main weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x3030", L"\x301c", }, /* Punctuation SORT_STRINGSORT main weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x058a", L"\x2010" }, /* Punctuation SORT_STRINGSORT diacritic weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\x07F5", L"\x07F4" }, /* Punctuation SORT_STRINGSORT diacritic weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xfe32", L"\x2013" }, /* Punctuation SORT_STRINGSORT case weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xfe31", L"\xfe58" }, /* Punctuation SORT_STRINGSORT case weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, SORT_STRINGSORT, L"\xff07", L"\x0027" }, /* Punctuation SORT_STRINGSORT case weight */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x04b0", L"\x32db" }, /* Japanese main weight */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x3093", L"\x1e62\x013f" }, /* Japanese main weight */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30d3", L"\x30d4" }, /* Japanese diacritic weight */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x307b", L"\x307c" }, /* Japanese diacritic weight */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30ea", L"\x32f7" }, /* Japanese diacritic weight */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x31fb", L"\x30e9" }, /* Japanese case weight small */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30db", L"\x31f9" }, /* Japanese case weight small */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\xff6d", L"\xff95" }, /* Japanese case weight small */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORENONSPACE, L"\x31fb", L"\x30e9" }, /* Japanese case weight small */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORENONSPACE, L"\x30db", L"\x31f9" }, /* Japanese case weight small */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORENONSPACE, L"\xff6d", L"\xff95" }, /* Japanese case weight small */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30d5", L"\x3075" }, /* Japanese case weight kana */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x306a", L"\x30ca" }, /* Japanese case weight kana */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x305a", L"\x30ba" }, /* Japanese case weight kana */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREKANATYPE, L"\x30d5", L"\x3075" }, /* Japanese case weight kana */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREKANATYPE, L"\x306a", L"\x30ca" }, /* Japanese case weight kana */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREKANATYPE, L"\x305a", L"\x30ba" }, /* Japanese case weight kana */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30bf", L"\xff80" }, /* Japanese case weight width */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30ab", L"\xff76" }, /* Japanese case weight width */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30a2", L"\xff71" }, /* Japanese case weight width */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\x30bf", L"\xff80" }, /* Japanese case weight width */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\x30ab", L"\xff76" }, /* Japanese case weight width */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\x30a2", L"\xff71" }, /* Japanese case weight width */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORENONSPACE, L"\x31a2", L"\x3110" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORENONSPACE, L"\x1342", L"\x133a" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNORENONSPACE, L"\x16a4", L"\x16a5" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30b1\x30f6", L"\xff79\x30b1" }, /* Kana small data must have priority over width data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30a6\x30a5", L"\xff73\x30a6" }, /* Kana small data must have priority over width data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30a8\x30a7", L"\xff74\x30a8" }, /* Kana small data must have priority over width data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30b1", L"\xff79" }, /* Kana small data must have priority over width data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30a6", L"\xff73" }, /* Kana small data must have priority over width data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30a8", L"\xff74" }, /* Kana small data must have priority over width data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x3046\x30a9", L"\x30a6\x30aa" }, /* Kana small data must have priority over kana type data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x304a\x3041", L"\x30aa\x3042" }, /* Kana small data must have priority over kana type data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x3059\x30a7", L"\x30b9\x30a8" }, /* Kana small data must have priority over kana type data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x3046", L"\x30a6" }, /* Kana small data must have priority over kana type data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x304a", L"\x30aa" }, /* Kana small data must have priority over kana type data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x3059", L"\x30b9" }, /* Kana small data must have priority over kana type data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30a6\x30a8", L"\xff73\x3048" }, /* Kana type data must have priority over width data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30ab\x30a3", L"\xff76\x3043" }, /* Kana type data must have priority over width data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30b5\x30ac", L"\xff7b\x304c" }, /* Kana type data must have priority over width data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30a6", L"\xff73" }, /* Kana type data must have priority over width data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30ab", L"\xff76" }, /* Kana type data must have priority over width data */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30b5", L"\xff7b" }, /* Kana type data must have priority over width data */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x305a a", L"\x30ba A" }, /* Case weights have priority over extra weights */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30c1 b", L"\xff81 B" }, /* Case weights have priority over extra weights */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\xff8b x", L"\x31f6 X" }, /* Case weights have priority over extra weights */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x305a", L"\x30ba" }, /* Case weights have priority over extra weights */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30c1", L"\xff81" }, /* Case weights have priority over extra weights */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\xff8b", L"\x31f6" }, /* Case weights have priority over extra weights */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x0027\x31ff", L"\x007f\xff9b" }, /* Extra weights have priority over special weights */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x07f5\x30f3", L"\x07f4\x3093" }, /* Extra weights have priority over special weights */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\xfe63\x30e0", L"\xff0d\x3080" }, /* Extra weights have priority over special weights */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x0027", L"\x007f" }, /* Extra weights have priority over special weights */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x07f5", L"\x07f4" }, /* Extra weights have priority over special weights */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\xfe63", L"\xff0d" }, /* Extra weights have priority over special weights */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\xff68", L"\x30a3" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\xff75", L"\x30aa" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\x30e2", L"\xff93" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\xff68", L"\x30a3" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\xff75", L"\x30aa" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x30e2", L"\xff93" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREKANATYPE, L"\x30a8", L"\x3048" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREKANATYPE, L"\x30af", L"\x304f" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREKANATYPE, L"\x3067", L"\x30c7" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30a8", L"\x3048" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x30af", L"\x304f" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x3067", L"\x30c7" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\xffb7", L"\x3147" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\xffb6", L"\x3146" },
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, NORM_IGNOREWIDTH, L"\x3145", L"\xffb5" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, NORM_IGNORECASE, L"\xffb7", L"\x3147" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, NORM_IGNORECASE, L"\xffb6", L"\x3146" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, NORM_IGNORECASE, L"\x3145", L"\xffb5" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, NORM_IGNORECASE, L"\x2cff", L"\x30ba" }, /* Coptic < Japanese */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, NORM_IGNORECASE, L"\x2cdb", L"\x32de" }, /* Coptic < Japanese */
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, NORM_IGNORECASE, L"\x2ce0", L"\x30c6" }, /* Coptic < Japanese */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, NORM_IGNORECASE, L"\x05d3", L"\x30ba" }, /* Hebrew > Japanese */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, NORM_IGNORECASE, L"\x05e3", L"\x32de" }, /* Hebrew > Japanese */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, NORM_IGNORECASE, L"\x05d7", L"\x30c6" }, /* Hebrew > Japanese */
};
static void test_unicode_sorting(void)
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index bce705ab484..feec402cb61 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -2473,6 +2473,11 @@ enum sortkey_special_script
#define SORTKEY_MIN_WEIGHT 2
+const BYTE SORTKEY_FLAGS_EXTRA = 0xc4; /* Extra data added to the flags values */
+const BYTE SORTKEY_FLAG_HIRAGANA = 0x20; /* if bit is set then hiragana, else katakana */
+const BYTE SORTKEY_FLAG_LARGE = 0x02; /* if bit is set then normal kana, else small kana */
+const BYTE SORTKEY_FLAG_FULLWIDTH = 0x01; /* if bit is set then full width, else half width */
+
struct character_info
{
BYTE weight_primary;
@@ -2541,7 +2546,15 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
break;
case SORTKEY_JAPANESE:
- /* TODO */
+ if (info.weight_primary <= 1)
+ {
+ /* TODO Kana iteration/repeat characters not implemented yet */
+ }
+ else
+ {
+ sortkey_add_weight(data, 34);
+ sortkey_add_weight(data, info.weight_primary);
+ }
break;
case SORTKEY_JAMO:
@@ -2614,7 +2627,12 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
break;
case SORTKEY_JAPANESE:
- /* TODO */
+ if (info.weight_primary <= 1)
+ {
+ /* TODO Kana iteration/repeat characters not implemented yet */
+ }
+ else
+ sortkey_add_diacritic_weight(data, info.weight_diacritic, last_weighted_pos);
break;
case SORTKEY_JAMO:
@@ -2658,7 +2676,12 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
break;
case SORTKEY_JAPANESE:
- /* TODO */
+ if (info.weight_primary <= 1)
+ {
+ /* TODO Kana iteration/repeat characters not implemented yet */
+ }
+ else
+ sortkey_add_case_weight(data, flags, SORTKEY_MIN_WEIGHT);
break;
case SORTKEY_CJK:
@@ -2706,10 +2729,75 @@ static void sortkey_add_special_weights(struct sortkey_data *data, int flags, WC
}
}
+static void sortkey_add_extra_weights_small(struct sortkey_data *data, int flags, WCHAR c)
+{
+ struct character_info info;
+
+ sortkey_get_char(&info, c);
+
+ if (info.script_member == SORTKEY_JAPANESE)
+ {
+ if (info.weight_primary <= 1)
+ {
+ /* TODO Kana iteration/repeat characters not implemented yet */
+ }
+ else
+ {
+ if (!(flags & NORM_IGNORENONSPACE))
+ {
+ sortkey_add_weight(data, (info.weight_case & SORTKEY_FLAG_LARGE) | SORTKEY_FLAGS_EXTRA);
+ }
+ }
+ }
+}
+
+static void sortkey_add_extra_weights_kana(struct sortkey_data *data, int flags, WCHAR c)
+{
+ struct character_info info;
+
+ sortkey_get_char(&info, c);
+
+ if (info.script_member == SORTKEY_JAPANESE)
+ {
+ if (info.weight_primary <= 1)
+ {
+ /* TODO Kana iteration/repeat characters not implemented yet */
+ }
+ else
+ {
+ if (flags & NORM_IGNOREKANATYPE)
+ info.weight_case = 0;
+ sortkey_add_weight(data, (info.weight_case & SORTKEY_FLAG_HIRAGANA) | SORTKEY_FLAGS_EXTRA);
+ }
+ }
+}
+
+static void sortkey_add_extra_weights_width(struct sortkey_data *data, int flags, WCHAR c)
+{
+ struct character_info info;
+
+ sortkey_get_char(&info, c);
+
+ if (info.script_member == SORTKEY_JAPANESE)
+ {
+ if (info.weight_primary <= 1)
+ {
+ /* TODO Kana iteration/repeat characters not implemented yet */
+ }
+ else
+ {
+ if (flags & NORM_IGNOREWIDTH)
+ info.weight_case = 0;
+ sortkey_add_weight(data, (info.weight_case & SORTKEY_FLAG_FULLWIDTH) | SORTKEY_FLAGS_EXTRA);
+ }
+ }
+}
+
static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, int str_len, BYTE *buffer, int buffer_len)
{
static const BYTE SORTKEY_SEPARATOR = 1;
static const BYTE SORTKEY_TERMINATOR = 0;
+ static const BYTE SORTKEY_EXTRA_SEPARATOR = 0xff;
int i;
struct sortkey_data data;
@@ -2743,7 +2831,15 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
sortkey_add_weight(&data, SORTKEY_SEPARATOR);
/* Extra weights */
- /* TODO */
+ for (i = 0; i < str_len; i++)
+ sortkey_add_extra_weights_small(&data, flags, str[i]);
+ sortkey_add_weight(&data, SORTKEY_EXTRA_SEPARATOR);
+ for (i = 0; i < str_len; i++)
+ sortkey_add_extra_weights_kana(&data, flags, str[i]);
+ sortkey_add_weight(&data, SORTKEY_EXTRA_SEPARATOR);
+ for (i = 0; i < str_len; i++)
+ sortkey_add_extra_weights_width(&data, flags, str[i]);
+ sortkey_add_weight(&data, SORTKEY_EXTRA_SEPARATOR);
sortkey_add_weight(&data, SORTKEY_SEPARATOR);
/* Special weights */
--
2.29.2

View File

@@ -1,188 +0,0 @@
From 9ccd944af35dc418a09a17ab70619b37e598ea43 Mon Sep 17 00:00:00 2001
From: Fabian Maurer <dark.shadow4@web.de>
Date: Sat, 8 Aug 2020 16:49:45 +0200
Subject: [PATCH] kernelbase: Implement sortkey expansion
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
---
dlls/kernel32/tests/locale.c | 6 +++
dlls/kernelbase/locale.c | 91 +++++++++++++++++++++++++++++++++++-
2 files changed, 96 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 43a244d2a6b..e8adb32bbbd 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -3329,6 +3329,12 @@ static const struct sorting_test_entry unicode_sorting_tests[] =
{ L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, NORM_IGNORECASE, L"\x05d3", L"\x30ba" }, /* Hebrew > Japanese */
{ L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, NORM_IGNORECASE, L"\x05e3", L"\x32de" }, /* Hebrew > Japanese */
{ L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, NORM_IGNORECASE, L"\x05d7", L"\x30c6" }, /* Hebrew > Japanese */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, 0, L"\x00c6", L"\x0041\x0045" }, /* Expansion */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, 0, L"\x0f5c", L"\x0f5b\x0fb7" }, /* Expansion */
+ { L"en-US", CSTR_EQUAL, CSTR_EQUAL, 0, L"\x05f0", L"\x05d5\x05d5" }, /* Expansion */
+ { L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\x0f75", L"\x0f71\x0f74" }, /* Expansion character always follow default character logic */
+ { L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\xfc5e", L"\x064c\x0651" }, /* Expansion character always follow default character logic */
+ { L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\xfb2b", L"\x05e9\x05c2" }, /* Expansion character always follow default character logic */
};
static void test_unicode_sorting(void)
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index feec402cb61..da358d74934 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -2459,6 +2459,7 @@ enum sortkey_special_script
{
SORTKEY_UNSORTABLE = 0,
SORTKEY_DIACRITIC = 1,
+ SORTKEY_EXPANSION = 2,
SORTKEY_JAPANESE = 3,
SORTKEY_JAMO = 4,
SORTKEY_CJK = 5,
@@ -2496,13 +2497,27 @@ struct sortkey_data
static void sortkey_get_char(struct character_info *info, WCHAR ch)
{
DWORD value = sort.keys[ch];
-
info->weight_case = value >> 24;
info->weight_diacritic = (value >> 16) & 0xff;
info->script_member = (value >> 8) & 0xff;
info->weight_primary = value & 0xff;
}
+static const WCHAR* sortkey_get_expansion(WCHAR ch)
+{
+ DWORD pos_info = sort.keys[ch];
+ unsigned int pos = pos_info >> 16;
+ const DWORD *ptr;
+ unsigned int count_expansion;
+ if ((WORD)pos_info != 0x200) /* Check for expansion magic number */
+ return NULL;
+ ptr = (const DWORD *)(sort.guids + sort.guid_count);
+ count_expansion = *ptr++;
+ if (pos >= count_expansion)
+ return NULL;
+ return (const WCHAR *)(ptr + pos);
+}
+
static BOOL sortkey_is_PUA(BYTE script_member)
{
@@ -2533,6 +2548,27 @@ static void sortkey_add_diacritic_weight(struct sortkey_data *data, BYTE value,
*last_weighted_pos = data->buffer_pos;
}
+static void sortkey_handle_expansion_main(struct sortkey_data *data, int flags, WCHAR c)
+{
+ struct character_info info;
+ const WCHAR *expansion = sortkey_get_expansion(c);
+ if (expansion)
+ {
+ /* Expansion characters always follow default character logic, ignoring the script_member value */
+ sortkey_handle_expansion_main(data, flags, expansion[0]);
+ sortkey_handle_expansion_main(data, flags, expansion[1]);
+ return;
+ }
+ sortkey_get_char(&info, c);
+ if (info.script_member != SORTKEY_UNSORTABLE)
+ {
+ sortkey_add_weight(data, info.script_member);
+ sortkey_add_weight(data, info.weight_primary);
+ if (sortkey_is_PUA(info.script_member))
+ sortkey_add_weight(data, info.weight_diacritic);
+ }
+}
+
static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR c)
{
struct character_info info;
@@ -2542,6 +2578,12 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
switch (info.script_member)
{
case SORTKEY_UNSORTABLE:
+ break;
+
+ case SORTKEY_EXPANSION:
+ sortkey_handle_expansion_main(data, flags, c);
+ break;
+
case SORTKEY_DIACRITIC:
break;
@@ -2598,6 +2640,25 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
}
}
+static void sortkey_handle_expansion_diacritic(struct sortkey_data *data, int flags, WCHAR c, int *last_weighted_pos)
+{
+ struct character_info info;
+ const WCHAR *expansion = sortkey_get_expansion(c);
+ if (expansion)
+ {
+ /* Expansion characters always follow default character logic, ignoring the script_member value */
+ sortkey_handle_expansion_diacritic(data, flags, expansion[0], last_weighted_pos);
+ sortkey_handle_expansion_diacritic(data, flags, expansion[1], last_weighted_pos);
+ return;
+ }
+ sortkey_get_char(&info, c);
+ if (info.script_member != SORTKEY_UNSORTABLE)
+ {
+ if (!sortkey_is_PUA(info.script_member))
+ sortkey_add_diacritic_weight(data, info.weight_diacritic, last_weighted_pos);
+ }
+}
+
static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags, WCHAR c, int *last_weighted_pos, int diacritic_start_pos)
{
struct character_info info;
@@ -2610,6 +2671,10 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
case SORTKEY_UNSORTABLE:
break;
+ case SORTKEY_EXPANSION:
+ sortkey_handle_expansion_diacritic(data, flags, c, last_weighted_pos);
+ break;
+
case SORTKEY_DIACRITIC:
old_pos = data->buffer_pos - 1;
/*
@@ -2663,6 +2728,24 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
}
}
+static void sortkey_handle_expansion_case(struct sortkey_data *data, int flags, WCHAR c)
+{
+ struct character_info info;
+ const WCHAR *expansion = sortkey_get_expansion(c);
+ if (expansion)
+ {
+ /* Expansion characters always follow default character logic, ignoring the script_member value */
+ sortkey_handle_expansion_case(data, flags, expansion[0]);
+ sortkey_handle_expansion_case(data, flags, expansion[1]);
+ return;
+ }
+ sortkey_get_char(&info, c);
+ if (info.script_member != SORTKEY_UNSORTABLE)
+ {
+ sortkey_add_case_weight(data, flags, info.weight_case);
+ }
+}
+
static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR c)
{
struct character_info info;
@@ -2672,6 +2755,12 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
switch (info.script_member)
{
case SORTKEY_UNSORTABLE:
+ break;
+
+ case SORTKEY_EXPANSION:
+ sortkey_handle_expansion_case(data, flags, c);
+ break;
+
case SORTKEY_DIACRITIC:
break;
--
2.29.2

View File

@@ -1,377 +0,0 @@
From 74ed8758a238f1747055b4c8fa78edc2d5e7aba9 Mon Sep 17 00:00:00 2001
From: Fabian Maurer <dark.shadow4@web.de>
Date: Sat, 8 Aug 2020 17:32:56 +0200
Subject: [PATCH] kernelbase: Implement sortkey language support
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
---
dlls/kernel32/tests/locale.c | 50 ++++++++++++++++++
dlls/kernelbase/locale.c | 99 +++++++++++++++++++++---------------
2 files changed, 109 insertions(+), 40 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 0aaa87e38c1..84931318075 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -3210,6 +3210,56 @@ static const struct sorting_test_entry unicode_sorting_tests[] =
{ L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\x0f75", L"\x0f71\x0f74" }, /* Expansion character always follow default character logic */
{ L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\xfc5e", L"\x064c\x0651" }, /* Expansion character always follow default character logic */
{ L"en-US", CSTR_LESS_THAN, CSTR_EQUAL, 0, L"\xfb2b", L"\x05e9\x05c2" }, /* Expansion character always follow default character logic */
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x6df8", L"\x654b\x29e9" }, /* Japanese locale */
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x685d\x1239\x1b61", L"\x59b6\x6542\x2a62\x04a7" },
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x62f3\x43e9", L"\x5760" },
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x634c", L"\x2f0d\x5f1c\x7124" },
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x69e7\x0502", L"\x57cc" },
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x7589", L"\x67c5" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x5ede\x765c", L"\x7324" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x5c7f\x5961", L"\x7cbe" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x3162", L"\x6a84\x1549\x0b60" },
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x769e\x448e", L"\x4e6e" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x59a4", L"\x5faa\x607c" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x529b", L"\x733f" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x6ff8\x2a0a", L"\x7953\x6712" },
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x6dfb", L"\x6793" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x67ed", L"\x6aa2" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x4e61", L"\x6350\x6b08" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x5118", L"\x53b3\x75b4" },
+ { L"ja-JP", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x6bbf", L"\x65a3" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x5690", L"\x5fa8" },
+ { L"ja-JP", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x61e2", L"\x76e5" },
+ { L"ko-KR", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x8db6", L"\xd198" },
+ { L"ko-KR", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x8f72", L"\xd2b9" },
+ { L"ko-KR", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x91d8", L"\xd318" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x8db6", L"\xd198" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x8f72", L"\xd2b9" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x91d8", L"\xd318" },
+ { L"cs-CZ", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x0160", L"\x0219" },
+ { L"cs-CZ", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x059a", L"\x0308" },
+ { L"cs-CZ", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x013a", L"\x013f" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x0160", L"\x0219" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x059a", L"\x0308" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x013a", L"\x013f" },
+ { L"vi-VN", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x1d8f", L"\x1ea8" },
+ { L"vi-VN", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x0323", L"\xfe26" },
+ { L"vi-VN", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"R", L"\xff32" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x1d8f", L"\x1ea8" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x0323", L"\xfe26" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"R", L"\xff32" },
+ { L"zh-HK", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x83ae", L"\x71b9" },
+ { L"zh-HK", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x7e50", L"\xc683" },
+ { L"zh-HK", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x6c69", L"\x7f8a" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x83ae", L"\x71b9" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x7e50", L"\xc683" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x6c69", L"\x7f8a" },
+ { L"tr-TR", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x00dc", L"\x1ee9" },
+ { L"tr-TR", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x00fc", L"\x1ee6" },
+ { L"tr-TR", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x0152", L"\x00d6" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x00dc", L"\x1ee9" },
+ { L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x00fc", L"\x1ee6" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x0152", L"\x00d6" },
};
static void test_unicode_sorting(void)
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index e81ed0e0f2e..394912307a9 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -2530,9 +2530,27 @@ struct sortkey_data
int buffer_len;
};
-static void sortkey_get_char(struct character_info *info, WCHAR ch)
+static DWORD sortkey_get_exception(WCHAR ch, const struct sortguid *locale)
{
- DWORD value = sort.keys[ch];
+ if (locale && locale->except)
+ {
+ DWORD *table = sort.keys + locale->except;
+ DWORD hi = ch >> 8;
+ DWORD lo = ch & 0xff;
+ if (table[hi] == hi * 0x100)
+ return 0;
+ if (sort.keys[table[hi] + lo] == sort.keys[hi * 0x100 + lo])
+ return 0;
+ return sort.keys[table[hi] + lo];
+ }
+ return 0;
+}
+
+static void sortkey_get_char(struct character_info *info, WCHAR ch, const struct sortguid *locale)
+{
+ DWORD value = sortkey_get_exception(ch, locale);
+ if (!value)
+ value = sort.keys[ch];
info->weight_case = value >> 24;
info->weight_diacritic = (value >> 16) & 0xff;
info->script_member = (value >> 8) & 0xff;
@@ -2584,18 +2602,18 @@ static void sortkey_add_diacritic_weight(struct sortkey_data *data, BYTE value,
*last_weighted_pos = data->buffer_pos;
}
-static void sortkey_handle_expansion_main(struct sortkey_data *data, int flags, WCHAR c)
+static void sortkey_handle_expansion_main(struct sortkey_data *data, int flags, WCHAR c, const struct sortguid *locale)
{
struct character_info info;
const WCHAR *expansion = sortkey_get_expansion(c);
if (expansion)
{
/* Expansion characters always follow default character logic, ignoring the script_member value */
- sortkey_handle_expansion_main(data, flags, expansion[0]);
- sortkey_handle_expansion_main(data, flags, expansion[1]);
+ sortkey_handle_expansion_main(data, flags, expansion[0], locale);
+ sortkey_handle_expansion_main(data, flags, expansion[1], locale);
return;
}
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
if (info.script_member != SORTKEY_UNSORTABLE)
{
sortkey_add_weight(data, info.script_member);
@@ -2605,11 +2623,11 @@ static void sortkey_handle_expansion_main(struct sortkey_data *data, int flags,
}
}
-static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR c)
+static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR c, const struct sortguid *locale)
{
struct character_info info;
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
switch (info.script_member)
{
@@ -2617,7 +2635,7 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
break;
case SORTKEY_EXPANSION:
- sortkey_handle_expansion_main(data, flags, c);
+ sortkey_handle_expansion_main(data, flags, c, locale);
break;
case SORTKEY_DIACRITIC:
@@ -2676,18 +2694,18 @@ static void sortkey_add_main_weights(struct sortkey_data *data, int flags, WCHAR
}
}
-static void sortkey_handle_expansion_diacritic(struct sortkey_data *data, int flags, WCHAR c, int *last_weighted_pos)
+static void sortkey_handle_expansion_diacritic(struct sortkey_data *data, int flags, WCHAR c, int *last_weighted_pos, const struct sortguid *locale)
{
struct character_info info;
const WCHAR *expansion = sortkey_get_expansion(c);
if (expansion)
{
/* Expansion characters always follow default character logic, ignoring the script_member value */
- sortkey_handle_expansion_diacritic(data, flags, expansion[0], last_weighted_pos);
- sortkey_handle_expansion_diacritic(data, flags, expansion[1], last_weighted_pos);
+ sortkey_handle_expansion_diacritic(data, flags, expansion[0], last_weighted_pos, locale);
+ sortkey_handle_expansion_diacritic(data, flags, expansion[1], last_weighted_pos, locale);
return;
}
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
if (info.script_member != SORTKEY_UNSORTABLE)
{
if (!sortkey_is_PUA(info.script_member))
@@ -2695,12 +2713,12 @@ static void sortkey_handle_expansion_diacritic(struct sortkey_data *data, int fl
}
}
-static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags, WCHAR c, int *last_weighted_pos, int diacritic_start_pos)
+static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags, WCHAR c, int *last_weighted_pos, int diacritic_start_pos, const struct sortguid *locale)
{
struct character_info info;
int old_pos;
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
switch (info.script_member)
{
@@ -2708,7 +2726,7 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
break;
case SORTKEY_EXPANSION:
- sortkey_handle_expansion_diacritic(data, flags, c, last_weighted_pos);
+ sortkey_handle_expansion_diacritic(data, flags, c, last_weighted_pos, locale);
break;
case SORTKEY_DIACRITIC:
@@ -2764,29 +2782,29 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
}
}
-static void sortkey_handle_expansion_case(struct sortkey_data *data, int flags, WCHAR c)
+static void sortkey_handle_expansion_case(struct sortkey_data *data, int flags, WCHAR c, const struct sortguid *locale)
{
struct character_info info;
const WCHAR *expansion = sortkey_get_expansion(c);
if (expansion)
{
/* Expansion characters always follow default character logic, ignoring the script_member value */
- sortkey_handle_expansion_case(data, flags, expansion[0]);
- sortkey_handle_expansion_case(data, flags, expansion[1]);
+ sortkey_handle_expansion_case(data, flags, expansion[0], locale);
+ sortkey_handle_expansion_case(data, flags, expansion[1], locale);
return;
}
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
if (info.script_member != SORTKEY_UNSORTABLE)
{
sortkey_add_case_weight(data, flags, info.weight_case);
}
}
-static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR c)
+static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR c, const struct sortguid *locale)
{
struct character_info info;
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
switch (info.script_member)
{
@@ -2794,7 +2812,7 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
break;
case SORTKEY_EXPANSION:
- sortkey_handle_expansion_case(data, flags, c);
+ sortkey_handle_expansion_case(data, flags, c, locale);
break;
case SORTKEY_DIACRITIC:
@@ -2836,12 +2854,12 @@ static void sortkey_add_case_weights(struct sortkey_data *data, int flags, WCHAR
}
}
-static void sortkey_add_special_weights(struct sortkey_data *data, int flags, WCHAR c)
+static void sortkey_add_special_weights(struct sortkey_data *data, int flags, WCHAR c, const struct sortguid *locale)
{
struct character_info info;
BYTE weight_second;
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
if (info.script_member == SORTKEY_PUNCTUATION)
{
@@ -2854,11 +2872,11 @@ static void sortkey_add_special_weights(struct sortkey_data *data, int flags, WC
}
}
-static void sortkey_add_extra_weights_small(struct sortkey_data *data, int flags, WCHAR c)
+static void sortkey_add_extra_weights_small(struct sortkey_data *data, int flags, WCHAR c, const struct sortguid *locale)
{
struct character_info info;
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
if (info.script_member == SORTKEY_JAPANESE)
{
@@ -2876,11 +2894,11 @@ static void sortkey_add_extra_weights_small(struct sortkey_data *data, int flags
}
}
-static void sortkey_add_extra_weights_kana(struct sortkey_data *data, int flags, WCHAR c)
+static void sortkey_add_extra_weights_kana(struct sortkey_data *data, int flags, WCHAR c, const struct sortguid *locale)
{
struct character_info info;
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
if (info.script_member == SORTKEY_JAPANESE)
{
@@ -2897,11 +2915,11 @@ static void sortkey_add_extra_weights_kana(struct sortkey_data *data, int flags,
}
}
-static void sortkey_add_extra_weights_width(struct sortkey_data *data, int flags, WCHAR c)
+static void sortkey_add_extra_weights_width(struct sortkey_data *data, int flags, WCHAR c, const struct sortguid *locale)
{
struct character_info info;
- sortkey_get_char(&info, c);
+ sortkey_get_char(&info, c, locale);
if (info.script_member == SORTKEY_JAPANESE)
{
@@ -2918,13 +2936,14 @@ static void sortkey_add_extra_weights_width(struct sortkey_data *data, int flags
}
}
-static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, int str_len, BYTE *buffer, int buffer_len)
+static int sortkey_generate(int flags, const WCHAR *locale_name, const WCHAR *str, int str_len, BYTE *buffer, int buffer_len)
{
static const BYTE SORTKEY_SEPARATOR = 1;
static const BYTE SORTKEY_TERMINATOR = 0;
static const BYTE SORTKEY_EXTRA_SEPARATOR = 0xff;
int i;
struct sortkey_data data;
+ const struct sortguid *locale = get_language_sort(locale_name);
data.buffer = buffer;
data.buffer_pos = 0;
@@ -2935,7 +2954,7 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
/* Main weights */
for (i = 0; i < str_len; i++)
- sortkey_add_main_weights(&data, flags, str[i]);
+ sortkey_add_main_weights(&data, flags, str[i], locale);
sortkey_add_weight(&data, SORTKEY_SEPARATOR);
/* Diacritic weights */
@@ -2944,7 +2963,7 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
int diacritic_start_pos = data.buffer_pos;
int last_weighted_pos = data.buffer_pos;
for (i = 0; i < str_len; i++)
- sortkey_add_diacritic_weights(&data, flags, str[i], &last_weighted_pos, diacritic_start_pos);
+ sortkey_add_diacritic_weights(&data, flags, str[i], &last_weighted_pos, diacritic_start_pos, locale);
/* Remove all weights <= SORTKEY_MIN_WEIGHT from the end */
data.buffer_pos = last_weighted_pos;
}
@@ -2952,24 +2971,24 @@ static int sortkey_generate(int flags, const WCHAR *locale, const WCHAR *str, in
/* Case weights */
for (i = 0; i < str_len; i++)
- sortkey_add_case_weights(&data, flags, str[i]);
+ sortkey_add_case_weights(&data, flags, str[i], locale);
sortkey_add_weight(&data, SORTKEY_SEPARATOR);
/* Extra weights */
for (i = 0; i < str_len; i++)
- sortkey_add_extra_weights_small(&data, flags, str[i]);
+ sortkey_add_extra_weights_small(&data, flags, str[i], locale);
sortkey_add_weight(&data, SORTKEY_EXTRA_SEPARATOR);
for (i = 0; i < str_len; i++)
- sortkey_add_extra_weights_kana(&data, flags, str[i]);
+ sortkey_add_extra_weights_kana(&data, flags, str[i], locale);
sortkey_add_weight(&data, SORTKEY_EXTRA_SEPARATOR);
for (i = 0; i < str_len; i++)
- sortkey_add_extra_weights_width(&data, flags, str[i]);
+ sortkey_add_extra_weights_width(&data, flags, str[i], locale);
sortkey_add_weight(&data, SORTKEY_EXTRA_SEPARATOR);
sortkey_add_weight(&data, SORTKEY_SEPARATOR);
/* Special weights */
for (i = 0; i < str_len; i++)
- sortkey_add_special_weights(&data, flags, str[i]);
+ sortkey_add_special_weights(&data, flags, str[i], locale);
sortkey_add_weight(&data, SORTKEY_TERMINATOR);
if (data.buffer_pos <= buffer_len || !buffer)
@@ -5667,7 +5686,7 @@ INT WINAPI DECLSPEC_HOTPATCH LCMapStringEx( const WCHAR *locale, DWORD flags, co
TRACE( "(%s,0x%08lx,%s,%d,%p,%d)\n",
debugstr_w(locale), flags, debugstr_wn(src, srclen), srclen, dst, dstlen );
- if (!(ret = sortkey_generate(flags, L"", src, srclen, (BYTE *)dst, dstlen )))
+ if (!(ret = sortkey_generate(flags, locale, src, srclen, (BYTE *)dst, dstlen )))
SetLastError( ERROR_INSUFFICIENT_BUFFER );
return ret;
}
--
2.34.1

View File

@@ -1,446 +0,0 @@
From 4b39a274dd286b963fc34048ea131ae1cf4dc71c Mon Sep 17 00:00:00 2001
From: Fabian Maurer <dark.shadow4@web.de>
Date: Sun, 6 Dec 2020 20:57:16 +0100
Subject: [PATCH] kernelbase: Implement CompareString functions
---
dlls/kernel32/tests/locale.c | 33 +++--
dlls/kernelbase/locale.c | 261 ++++++++++++++++++-----------------
2 files changed, 149 insertions(+), 145 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 0ec859363db..59929756dc6 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -1831,16 +1831,16 @@ static void test_CompareStringA(void)
"a\\0b vs a expected CSTR_EQUAL or CSTR_GREATER_THAN, got %d\n", ret);
ret = CompareStringA(lcid, 0, "\2", 2, "\1", 2);
- todo_wine ok(ret != CSTR_EQUAL, "\\2 vs \\1 expected unequal\n");
+ ok(ret != CSTR_EQUAL, "\\2 vs \\1 expected unequal\n");
ret = CompareStringA(lcid, NORM_IGNORECASE | LOCALE_USE_CP_ACP, "#", -1, ".", -1);
- todo_wine ok(ret == CSTR_LESS_THAN, "\"#\" vs \".\" expected CSTR_LESS_THAN, got %d\n", ret);
+ ok(ret == CSTR_LESS_THAN, "\"#\" vs \".\" expected CSTR_LESS_THAN, got %d\n", ret);
ret = CompareStringA(lcid, NORM_IGNORECASE, "_", -1, ".", -1);
- todo_wine ok(ret == CSTR_GREATER_THAN, "\"_\" vs \".\" expected CSTR_GREATER_THAN, got %d\n", ret);
+ ok(ret == CSTR_GREATER_THAN, "\"_\" vs \".\" expected CSTR_GREATER_THAN, got %d\n", ret);
ret = lstrcmpiA("#", ".");
- todo_wine ok(ret == -1, "\"#\" vs \".\" expected -1, got %d\n", ret);
+ ok(ret == -1, "\"#\" vs \".\" expected -1, got %d\n", ret);
lcid = MAKELCID(MAKELANGID(LANG_POLISH, SUBLANG_DEFAULT), SORT_DEFAULT);
@@ -1926,9 +1926,9 @@ static void test_CompareStringW(void)
ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, ABC_EE, 3, A_ACUTE_BC, 4);
- todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
+ ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, ABC_EE, 4, A_ACUTE_BC_DECOMP, 5);
- todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
+ ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, A_ACUTE_BC, 4, A_ACUTE_BC_DECOMP, 5);
ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
@@ -1940,12 +1940,12 @@ static void test_CompareStringW(void)
ret = CompareStringW(CP_ACP, 0, A_NULL_BC, 4, A_ACUTE_BC, 4);
ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret);
ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, A_NULL_BC, 4, A_ACUTE_BC, 4);
- todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
+ ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
ret = CompareStringW(CP_ACP, 0, A_NULL_BC, 4, A_ACUTE_BC_DECOMP, 5);
ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret);
ret = CompareStringW(CP_ACP, NORM_IGNORENONSPACE, A_NULL_BC, 4, A_ACUTE_BC_DECOMP, 5);
- todo_wine ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
+ ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret);
}
struct comparestringex_test {
@@ -1982,7 +1982,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 5 */
"tr-TR", 0,
- {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, FALSE
},
/* with NORM_IGNORECASE */
{ /* 6 */
@@ -2007,7 +2007,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 11 */
"tr-TR", NORM_IGNORECASE,
- {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, FALSE
},
/* with NORM_LINGUISTIC_CASING */
{ /* 12 */
@@ -2032,7 +2032,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 17 */
"tr-TR", NORM_LINGUISTIC_CASING,
- {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, FALSE
},
/* with LINGUISTIC_IGNORECASE */
{ /* 18 */
@@ -2057,7 +2057,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 23 */
"tr-TR", LINGUISTIC_IGNORECASE,
- {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, FALSE
},
/* with NORM_LINGUISTIC_CASING | NORM_IGNORECASE */
{ /* 24 */
@@ -2082,7 +2082,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 29 */
"tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,
- {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, FALSE
},
/* with NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE */
{ /* 30 */
@@ -2107,7 +2107,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 35 */
"tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE,
- {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, FALSE
}
};
@@ -3372,6 +3372,9 @@ static const struct sorting_test_entry unicode_sorting_tests[] =
{ L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x00dc", L"\x1ee9" },
{ L"en-US", CSTR_LESS_THAN, CSTR_LESS_THAN, 0, L"\x00fc", L"\x1ee6" },
{ L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\x0152", L"\x00d6" },
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\xa042\x09bc", L"\xa042" }, /* Diacritic is added */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\xa063\x302b", L"\xa063" }, /* Diacritic is added */
+ { L"en-US", CSTR_GREATER_THAN, CSTR_GREATER_THAN, 0, L"\xa07e\x0c56", L"\xa07e" }, /* Diacritic is added */
};
static void test_unicode_sorting(void)
@@ -6260,7 +6263,7 @@ static void test_FindNLSStringEx(void)
{ localeW, FIND_FROMSTART, comb_s_accent1W, ARRAY_SIZE(comb_s_accent1W)-1,
comb_s_accent2W, ARRAY_SIZE(comb_s_accent2W)-1, 0, 0, 6, 1, TRUE },
{ localeW, FIND_FROMSTART, comb_q_accent1W, ARRAY_SIZE(comb_q_accent1W)-1,
- comb_q_accent2W, ARRAY_SIZE(comb_q_accent2W)-1, 0, 0, 7, 1, FALSE },
+ comb_q_accent2W, ARRAY_SIZE(comb_q_accent2W)-1, 0, 0, 7, 0, FALSE },
{ 0 }
};
struct test_data *ptest;
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index d1d461c84e9..28a69c53144 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -3064,126 +3064,6 @@ static int map_to_halfwidth( WCHAR c, WCHAR *dst, int dstlen )
return 1;
}
-
-/* 32-bit collation element table format:
- * unicode weight - high 16 bit, diacritic weight - high 8 bit of low 16 bit,
- * case weight - high 4 bit of low 8 bit.
- */
-
-enum weight { UNICODE_WEIGHT, DIACRITIC_WEIGHT, CASE_WEIGHT };
-
-static unsigned int get_weight( WCHAR ch, enum weight type )
-{
- unsigned int ret;
-
- ret = collation_table[collation_table[collation_table[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0xf)];
- if (ret == ~0u) return ch;
-
- switch (type)
- {
- case UNICODE_WEIGHT: return ret >> 16;
- case DIACRITIC_WEIGHT: return (ret >> 8) & 0xff;
- case CASE_WEIGHT: return (ret >> 4) & 0x0f;
- default: return 0;
- }
-}
-
-
-static void inc_str_pos( const WCHAR **str, int *len, unsigned int *dpos, unsigned int *dlen )
-{
- (*dpos)++;
- if (*dpos == *dlen)
- {
- *dpos = *dlen = 0;
- (*str)++;
- (*len)--;
- }
-}
-
-
-static int compare_weights(int flags, const WCHAR *str1, int len1,
- const WCHAR *str2, int len2, enum weight type )
-{
- unsigned int ce1, ce2, dpos1 = 0, dpos2 = 0, dlen1 = 0, dlen2 = 0;
- const WCHAR *dstr1 = NULL, *dstr2 = NULL;
-
- while (len1 > 0 && len2 > 0)
- {
- if (!dlen1 && !(dstr1 = get_decomposition( *str1, &dlen1 ))) dstr1 = str1;
- if (!dlen2 && !(dstr2 = get_decomposition( *str2, &dlen2 ))) dstr2 = str2;
-
- if (flags & NORM_IGNORESYMBOLS)
- {
- int skip = 0;
- /* FIXME: not tested */
- if (get_char_type( CT_CTYPE1, dstr1[dpos1] ) & (C1_PUNCT | C1_SPACE))
- {
- inc_str_pos( &str1, &len1, &dpos1, &dlen1 );
- skip = 1;
- }
- if (get_char_type( CT_CTYPE1, dstr2[dpos2] ) & (C1_PUNCT | C1_SPACE))
- {
- inc_str_pos( &str2, &len2, &dpos2, &dlen2 );
- skip = 1;
- }
- if (skip) continue;
- }
-
- /* hyphen and apostrophe are treated differently depending on
- * whether SORT_STRINGSORT specified or not
- */
- if (type == UNICODE_WEIGHT && !(flags & SORT_STRINGSORT))
- {
- if (dstr1[dpos1] == '-' || dstr1[dpos1] == '\'')
- {
- if (dstr2[dpos2] != '-' && dstr2[dpos2] != '\'')
- {
- inc_str_pos( &str1, &len1, &dpos1, &dlen1 );
- continue;
- }
- }
- else if (dstr2[dpos2] == '-' || dstr2[dpos2] == '\'')
- {
- inc_str_pos( &str2, &len2, &dpos2, &dlen2 );
- continue;
- }
- }
-
- ce1 = get_weight( dstr1[dpos1], type );
- if (!ce1)
- {
- inc_str_pos( &str1, &len1, &dpos1, &dlen1 );
- continue;
- }
- ce2 = get_weight( dstr2[dpos2], type );
- if (!ce2)
- {
- inc_str_pos( &str2, &len2, &dpos2, &dlen2 );
- continue;
- }
-
- if (ce1 - ce2) return ce1 - ce2;
-
- inc_str_pos( &str1, &len1, &dpos1, &dlen1 );
- inc_str_pos( &str2, &len2, &dpos2, &dlen2 );
- }
- while (len1)
- {
- if (!dlen1 && !(dstr1 = get_decomposition( *str1, &dlen1 ))) dstr1 = str1;
- ce1 = get_weight( dstr1[dpos1], type );
- if (ce1) break;
- inc_str_pos( &str1, &len1, &dpos1, &dlen1 );
- }
- while (len2)
- {
- if (!dlen2 && !(dstr2 = get_decomposition( *str2, &dlen2 ))) dstr2 = str2;
- ce2 = get_weight( dstr2[dpos2], type );
- if (ce2) break;
- inc_str_pos( &str2, &len2, &dpos2, &dlen2 );
- }
- return len1 - len2;
-}
-
enum sortkey_special_script
{
SORTKEY_UNSORTABLE = 0,
@@ -3221,6 +3101,7 @@ struct sortkey_data
BYTE *buffer;
int buffer_pos;
int buffer_len;
+ BOOL is_compare_string;
};
static DWORD sortkey_get_exception(WCHAR ch, const struct sortguid *locale)
@@ -3432,7 +3313,10 @@ static void sortkey_add_diacritic_weights(struct sortkey_data *data, int flags,
if (old_pos >= diacritic_start_pos)
{
if (old_pos < data->buffer_len)
+ {
data->buffer[old_pos] += info.weight_diacritic; /* Overflow can happen, that's okay */
+ *last_weighted_pos = data->buffer_pos;
+ }
}
else
sortkey_add_diacritic_weight(data, info.weight_diacritic, last_weighted_pos);
@@ -3641,6 +3525,7 @@ static int sortkey_generate(int flags, const WCHAR *locale_name, const WCHAR *st
data.buffer = buffer;
data.buffer_pos = 0;
data.buffer_len = buffer ? buffer_len : 0;
+ data.is_compare_string = FALSE;
if (str_len == -1)
str_len = wcslen(str);
@@ -3690,6 +3575,130 @@ static int sortkey_generate(int flags, const WCHAR *locale_name, const WCHAR *st
return 0;
}
+static int early_exit_sortkey_comparison(const struct sortkey_data* data1, const struct sortkey_data* data2, int start_index)
+{
+ int i;
+ int end_index = min(data1->buffer_pos, data2->buffer_pos);
+
+ for (i = start_index; i < end_index; i++)
+ {
+ BYTE weight1 = data1->buffer[i];
+ BYTE weight2 = data2->buffer[i];
+
+ if (weight1 > weight2) return CSTR_GREATER_THAN;
+ if (weight1 < weight2) return CSTR_LESS_THAN;
+ }
+
+ return CSTR_EQUAL;
+}
+
+static int sortkey_compare(int flags, const WCHAR *locale_name, const WCHAR *str1, int str1_len, const WCHAR *str2, int str2_len)
+{
+ int i1, i2;
+ int ret;
+ struct sortkey_data data1, data2;
+ const struct sortguid *locale = get_language_sort(locale_name);
+ int diacritic_start_pos1;
+ int last_weighted_pos1;
+ int diacritic_start_pos2;
+ int last_weighted_pos2;
+ int pos_weight_compare;
+
+ BYTE buffer1[10000];
+ BYTE buffer2[10000];
+
+ data1.buffer = buffer1;
+ data1.buffer_pos = 0;
+ data1.buffer_len = sizeof(buffer1);
+ data1.is_compare_string = TRUE;
+
+ data2.buffer = buffer2;
+ data2.buffer_pos = 0;
+ data2.buffer_len = sizeof(buffer2);
+ data2.is_compare_string = TRUE;
+
+ /* Main weights */
+ for (i1 = 0, i2 = 0; i1 < str1_len || i2 < str2_len; i1++, i2++)
+ {
+ int pos_weight_compare = min(data1.buffer_pos, data2.buffer_pos);
+ if (i1 < str1_len)
+ {
+ sortkey_add_main_weights(&data1, flags, str1[i1], locale);
+ }
+ if (i2 < str2_len)
+ {
+ sortkey_add_main_weights(&data2, flags, str2[i2], locale);
+ }
+
+ /* For clear differences we must return early without reading all characters. See tests. */
+ ret = early_exit_sortkey_comparison(&data1, &data2, pos_weight_compare);
+ if (ret != CSTR_EQUAL)
+ return ret;
+ }
+
+ if (data1.buffer_pos > data2.buffer_pos)
+ return CSTR_GREATER_THAN;
+ if (data1.buffer_pos < data2.buffer_pos)
+ return CSTR_LESS_THAN;
+
+ diacritic_start_pos1 = data1.buffer_pos;
+ last_weighted_pos1 = data1.buffer_pos;
+ diacritic_start_pos2 = data2.buffer_pos;
+ last_weighted_pos2 = data2.buffer_pos;
+ pos_weight_compare = min(data1.buffer_pos, data2.buffer_pos);
+ /* Diacritic weights */
+ if (!(flags & NORM_IGNORENONSPACE))
+ {
+ for (i1 = 0, i2 = 0; i1 < str1_len || i2 < str2_len; i1++, i2++)
+ {
+ if (i1 < str1_len)
+ {
+ sortkey_add_diacritic_weights(&data1, flags, str1[i1], &last_weighted_pos1, diacritic_start_pos1, locale);
+ }
+ if (i2 < str2_len)
+ {
+ sortkey_add_diacritic_weights(&data2, flags, str2[i2], &last_weighted_pos2, diacritic_start_pos2, locale);
+ }
+ }
+ data1.buffer_pos = last_weighted_pos1;
+ data2.buffer_pos = last_weighted_pos2;
+
+ ret = early_exit_sortkey_comparison(&data1, &data2, pos_weight_compare);
+ if (ret != CSTR_EQUAL)
+ return ret;
+
+ if (data1.buffer_pos > data2.buffer_pos)
+ return CSTR_GREATER_THAN;
+ if (data1.buffer_pos < data2.buffer_pos)
+ return CSTR_LESS_THAN;
+ }
+
+ /* Special weights */
+ for (i1 = 0, i2 = 0; i1 < str1_len || i2 < str2_len; i1++, i2++)
+ {
+ int pos_weight_compare = min(data1.buffer_pos, data2.buffer_pos);
+ if (i1 < str1_len)
+ {
+ sortkey_add_special_weights(&data1, flags, str1[i1], locale);
+ }
+ if (i2 < str2_len)
+ {
+ sortkey_add_special_weights(&data2, flags, str2[i2], locale);
+ }
+
+ ret = early_exit_sortkey_comparison(&data1, &data2, pos_weight_compare);
+ if (ret != CSTR_EQUAL)
+ return ret;
+ }
+
+ if (data1.buffer_pos > data2.buffer_pos)
+ return CSTR_GREATER_THAN;
+ if (data1.buffer_pos < data2.buffer_pos)
+ return CSTR_LESS_THAN;
+
+ return CSTR_EQUAL;
+}
+
static int compare_tzdate( const TIME_FIELDS *tf, const SYSTEMTIME *compare )
{
static const int month_lengths[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
@@ -4166,16 +4175,8 @@ INT WINAPI CompareStringEx( const WCHAR *locale, DWORD flags, const WCHAR *str1,
if (len1 < 0) len1 = lstrlenW(str1);
if (len2 < 0) len2 = lstrlenW(str2);
- ret = compare_weights( flags, str1, len1, str2, len2, UNICODE_WEIGHT );
- if (!ret)
- {
- if (!(flags & NORM_IGNORENONSPACE))
- ret = compare_weights( flags, str1, len1, str2, len2, DIACRITIC_WEIGHT );
- if (!ret && !(flags & NORM_IGNORECASE))
- ret = compare_weights( flags, str1, len1, str2, len2, CASE_WEIGHT );
- }
- if (!ret) return CSTR_EQUAL;
- return (ret < 0) ? CSTR_LESS_THAN : CSTR_GREATER_THAN;
+ ret = sortkey_compare(flags, locale, str1, len1, str2, len2);
+ return ret;
}
--
2.35.1

View File

@@ -1,3 +0,0 @@
Fixes: [5163] Microsoft Office XP 2002 installer reports error 25003 (installation source corrupted), custom action 'CADpc' returns 1603
Fixes: [10767] Fix comparison of punctuation characters in lstrcmp
Fixes: [32490] Graphical issues in Inquisitor

View File

@@ -1,4 +1,4 @@
From de8040e1a8900116a6a3fa0f0560e4a3c66d4d71 Mon Sep 17 00:00:00 2001
From 6fbc3bae354dec9fdd4a9a4e3e3a76340b66fd3f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 5 Aug 2017 03:39:23 +0200
Subject: [PATCH] ntdll: Use fast CS functions for heap locking.
@@ -8,64 +8,64 @@ Subject: [PATCH] ntdll: Use fast CS functions for heap locking.
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 51567d0552b..b1dcb01cd4f 100644
index 40c317417ce..60185aac2c6 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -340,13 +340,13 @@ static inline ULONG heap_get_flags( const HEAP *heap, ULONG flags )
static void heap_lock( HEAP *heap, ULONG flags )
@@ -469,13 +469,13 @@ static inline ULONG heap_get_flags( const struct heap *heap, ULONG flags )
static void heap_lock( struct heap *heap, ULONG flags )
{
if (heap_get_flags( heap, flags ) & HEAP_NO_SERIALIZE) return;
- RtlEnterCriticalSection( &heap->cs );
+ enter_critical_section( &heap->cs );
}
static void heap_unlock( HEAP *heap, ULONG flags )
static void heap_unlock( struct heap *heap, ULONG flags )
{
if (heap_get_flags( heap, flags ) & HEAP_NO_SERIALIZE) return;
- RtlLeaveCriticalSection( &heap->cs );
+ leave_critical_section( &heap->cs );
}
static void heap_set_status( const HEAP *heap, ULONG flags, NTSTATUS status )
@@ -1577,9 +1577,9 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
if (processHeap)
static void heap_set_status( const struct heap *heap, ULONG flags, NTSTATUS status )
@@ -1383,9 +1383,9 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
/* link it into the per-process heap list */
if (process_heap)
{
HEAP *heapPtr = subheap->heap;
- RtlEnterCriticalSection( &processHeap->cs );
+ enter_critical_section( &processHeap->cs );
list_add_head( &processHeap->entry, &heapPtr->entry );
- RtlLeaveCriticalSection( &processHeap->cs );
+ leave_critical_section( &processHeap->cs );
- RtlEnterCriticalSection( &process_heap->cs );
+ enter_critical_section( &process_heap->cs );
list_add_head( &process_heap->entry, &heap->entry );
- RtlLeaveCriticalSection( &process_heap->cs );
+ leave_critical_section( &process_heap->cs );
}
else if (!addr)
{
@@ -1623,9 +1623,9 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
if (heap == processHeap) return heap; /* cannot delete the main process heap */
@@ -1441,9 +1441,9 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE handle )
if (heap == process_heap) return handle; /* cannot delete the main process heap */
/* remove it from the per-process list */
- RtlEnterCriticalSection( &processHeap->cs );
+ enter_critical_section( &processHeap->cs );
list_remove( &heapPtr->entry );
- RtlLeaveCriticalSection( &processHeap->cs );
+ leave_critical_section( &processHeap->cs );
- RtlEnterCriticalSection( &process_heap->cs );
+ enter_critical_section( &process_heap->cs );
list_remove( &heap->entry );
- RtlLeaveCriticalSection( &process_heap->cs );
+ leave_critical_section( &process_heap->cs );
heapPtr->cs.DebugInfo->Spare[0] = 0;
RtlDeleteCriticalSection( &heapPtr->cs );
@@ -2171,7 +2171,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
heap->cs.DebugInfo->Spare[0] = 0;
RtlDeleteCriticalSection( &heap->cs );
@@ -1938,7 +1938,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
ULONG total = 1; /* main heap */
struct list *ptr;
- RtlEnterCriticalSection( &processHeap->cs );
+ enter_critical_section( &processHeap->cs );
LIST_FOR_EACH( ptr, &processHeap->entry ) total++;
- RtlEnterCriticalSection( &process_heap->cs );
+ enter_critical_section( &process_heap->cs );
LIST_FOR_EACH( ptr, &process_heap->entry ) total++;
if (total <= count)
{
@@ -2179,7 +2179,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
LIST_FOR_EACH( ptr, &processHeap->entry )
*heaps++ = LIST_ENTRY( ptr, HEAP, entry );
@@ -1946,7 +1946,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
LIST_FOR_EACH( ptr, &process_heap->entry )
*heaps++ = LIST_ENTRY( ptr, struct heap, entry );
}
- RtlLeaveCriticalSection( &processHeap->cs );
+ leave_critical_section( &processHeap->cs );
- RtlLeaveCriticalSection( &process_heap->cs );
+ leave_critical_section( &process_heap->cs );
return total;
}

View File

@@ -1,4 +1,4 @@
From 6cfa7d9011879898a079614077a605c812cb440e Mon Sep 17 00:00:00 2001
From da81169743bd7f070186ec5e58c89bab53d0bb7f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 28 Sep 2014 23:39:51 +0200
Subject: [PATCH] ntdll: OutputDebugString should throw the exception a second
@@ -10,7 +10,7 @@ Subject: [PATCH] ntdll: OutputDebugString should throw the exception a second
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c
index 9488f2e2399..1cea4b5ba3c 100644
index 9e954e3ffbe..a6793c20204 100644
--- a/dlls/kernelbase/debug.c
+++ b/dlls/kernelbase/debug.c
@@ -200,6 +200,23 @@ void WINAPI DECLSPEC_HOTPATCH OutputDebugStringA( LPCSTR str )
@@ -38,10 +38,10 @@ index 9488f2e2399..1cea4b5ba3c 100644
if (!mutex_inited)
{
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index c4413d4d66e..4fe2c2b04db 100644
index 3e76b001147..0c02486e19c 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -8327,7 +8327,7 @@ static LONG CALLBACK outputdebugstring_vectored_handler(EXCEPTION_POINTERS *Exce
@@ -8345,7 +8345,7 @@ static LONG CALLBACK outputdebugstring_vectored_handler(EXCEPTION_POINTERS *Exce
return EXCEPTION_CONTINUE_SEARCH;
}
@@ -50,7 +50,7 @@ index c4413d4d66e..4fe2c2b04db 100644
{
PVOID vectored_handler;
@@ -8343,7 +8343,6 @@ static void test_outputdebugstring(DWORD numexc, BOOL todo)
@@ -8361,7 +8361,6 @@ static void test_outputdebugstring(DWORD numexc, BOOL todo)
outputdebugstring_exceptions = 0;
OutputDebugStringA("Hello World");
@@ -58,7 +58,7 @@ index c4413d4d66e..4fe2c2b04db 100644
ok(outputdebugstring_exceptions == numexc, "OutputDebugStringA generated %ld exceptions, expected %ld\n",
outputdebugstring_exceptions, numexc);
@@ -10660,9 +10659,9 @@ START_TEST(exception)
@@ -10785,9 +10784,9 @@ START_TEST(exception)
else skip( "RtlRaiseException not found\n" );
#endif
test_stage = 3;
@@ -70,15 +70,15 @@ index c4413d4d66e..4fe2c2b04db 100644
test_stage = 5;
test_ripevent(0);
test_stage = 6;
@@ -10766,7 +10765,7 @@ START_TEST(exception)
@@ -10900,7 +10899,7 @@ START_TEST(exception)
test_debugger(DBG_EXCEPTION_HANDLED);
test_debugger(DBG_CONTINUE);
test_thread_context();
- test_outputdebugstring(1, FALSE);
+ test_outputdebugstring(1);
test_ripevent(1);
test_fastfail();
test_breakpoint(1);
test_closehandle(0, (HANDLE)0xdeadbeef);
--
2.35.1
2.36.1

View File

@@ -1,8 +1,8 @@
From 35bc7e69e9100202e0f0d91ee66449a13ef4d075 Mon Sep 17 00:00:00 2001
From a25c97e1a004f773d8d1ad4d233aa140ca8d9c63 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Tue, 30 Apr 2019 16:24:54 -0600
Subject: ntdll: Allow creation of dangling reparse points to non-existent
paths.
Subject: [PATCH] ntdll: Allow creation of dangling reparse points to
non-existent paths.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@@ -10,22 +10,22 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index e082ff5d322..e749e192f6f 100644
index 82abd3e451b..fb4b3b65756 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -3402,7 +3402,8 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
@@ -3394,7 +3394,8 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
/* if this is the last element, not finding it is not necessarily fatal */
if (!name_len)
{
- if (status == STATUS_OBJECT_PATH_NOT_FOUND)
+ if (status == STATUS_OBJECT_PATH_NOT_FOUND
- if (status == STATUS_OBJECT_NAME_NOT_FOUND)
+ if (status == STATUS_OBJECT_NAME_NOT_FOUND
+ || (disposition == FILE_WINE_PATH && status == STATUS_OBJECT_NAME_NOT_FOUND))
{
status = STATUS_OBJECT_NAME_NOT_FOUND;
if (disposition != FILE_OPEN && disposition != FILE_OVERWRITE)
@@ -3422,6 +3423,20 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
status = STATUS_OBJECT_NAME_COLLISION;
{
@@ -3416,6 +3417,20 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
}
if (end < next) strcat( unix_name, "/" );
}
+ else if (disposition == FILE_WINE_PATH && (status == STATUS_OBJECT_PATH_NOT_FOUND
+ || status == STATUS_OBJECT_NAME_NOT_FOUND))
@@ -41,10 +41,10 @@ index e082ff5d322..e749e192f6f 100644
+ continue;
+ }
+ }
else if (status == STATUS_OBJECT_NAME_NOT_FOUND) status = STATUS_OBJECT_PATH_NOT_FOUND;
if (status != STATUS_SUCCESS) break;
@@ -6080,7 +6095,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6076,7 +6091,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -54,5 +54,5 @@ index e082ff5d322..e749e192f6f 100644
free( unix_dest );
}
--
2.17.1
2.35.1

View File

@@ -1,7 +1,7 @@
From 88fc8873bb68ef3d9b816a5cae76c5d7e12a82f1 Mon Sep 17 00:00:00 2001
From 92381fe379f4e971168e1e3d9c67394eb8d0f697 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Mon, 23 Nov 2020 13:08:02 -0700
Subject: ntdll: Succeed with no data for NtReadFile on reparse points.
Subject: [PATCH] ntdll: Succeed with no data for NtReadFile on reparse points.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@@ -12,10 +12,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index ebed2600920..cb9a9506aba 100644
index 92cff9d9b2e..1e867146cd9 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5581,7 +5581,7 @@ static void test_reparse_points(void)
@@ -5591,7 +5591,7 @@ static void test_reparse_points(void)
ok(handle != INVALID_HANDLE_VALUE, "Failed to open symlink file.\n");
todo_wine ok(GetFileSize(handle, NULL) == 0, "symlink size is not zero\n");
bret = ReadFile(handle, &buf, sizeof(buf), &dwLen, NULL);
@@ -25,12 +25,12 @@ index ebed2600920..cb9a9506aba 100644
CloseHandle(handle);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 49412c99d3c..f7ff9f4b5ed 100644
index 0d6f08072a7..d7e0be3f65c 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5414,6 +5414,11 @@ NTSTATUS WINAPI NtReadFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo
goto done;
}
@@ -5415,6 +5415,11 @@ NTSTATUS WINAPI NtReadFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo
if (needs_close) close( unix_handle );
return status;
}
+ else if (type == FD_TYPE_SYMLINK)
+ {
@@ -41,7 +41,7 @@ index 49412c99d3c..f7ff9f4b5ed 100644
if (type == FD_TYPE_SERIAL && async_read && length)
{
diff --git a/server/file.c b/server/file.c
index 062322f685d..3079afdbdfd 100644
index eb2dc5696ed..b9d0eb2d5f4 100644
--- a/server/file.c
+++ b/server/file.c
@@ -294,6 +294,7 @@ static enum server_fd_type file_get_fd_type( struct fd *fd )
@@ -53,10 +53,10 @@ index 062322f685d..3079afdbdfd 100644
if (S_ISDIR(file->mode)) return FD_TYPE_DIR;
return FD_TYPE_CHAR;
diff --git a/server/protocol.def b/server/protocol.def
index 385420eedda..0c259ed063f 100644
index 93c17e091cb..238e23b0a85 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1366,6 +1366,7 @@ enum server_fd_type
@@ -1382,6 +1382,7 @@ enum server_fd_type
{
FD_TYPE_INVALID, /* invalid file (no associated fd) */
FD_TYPE_FILE, /* regular file */
@@ -65,5 +65,5 @@ index 385420eedda..0c259ed063f 100644
FD_TYPE_SOCKET, /* socket */
FD_TYPE_SERIAL, /* serial port */
--
2.17.1
2.35.1

View File

@@ -1,4 +1,4 @@
From 75ee9968e8532dcadd39163ff93db9a5c81fb799 Mon Sep 17 00:00:00 2001
From c4c562ca31cfd3ce391abae2cc4e94a6bf4da049 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 16 Oct 2014 23:26:35 +0200
Subject: [PATCH] kernel32/tests: Add tests for NtQuerySection. (try 2)
@@ -8,10 +8,10 @@ Subject: [PATCH] kernel32/tests: Add tests for NtQuerySection. (try 2)
1 file changed, 245 insertions(+)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
index 365194b9065..167df789abf 100644
index f492b2cf9b1..f6ac324c3a7 100644
--- a/dlls/kernel32/tests/virtual.c
+++ b/dlls/kernel32/tests/virtual.c
@@ -54,6 +54,23 @@ static PVOID (WINAPI *pVirtualAllocFromApp)(PVOID, SIZE_T, DWORD, DWORD);
@@ -55,6 +55,23 @@ static BOOL (WINAPI *pPrefetchVirtualMemory)(HANDLE, ULONG_PTR, PWIN32_MEMORY_R
/* ############################### */
@@ -35,8 +35,8 @@ index 365194b9065..167df789abf 100644
static HANDLE create_target_process(const char *arg)
{
char **argv;
@@ -4240,6 +4257,233 @@ static void test_shared_memory_ro(BOOL is_child, DWORD child_access)
CloseHandle(mapping);
@@ -4246,6 +4263,233 @@ static void test_PrefetchVirtualMemory(void)
"PrefetchVirtualMemory unexpected status on 2 page-aligned entries: %ld\n", GetLastError() );
}
+static void test_NtQuerySection(void)
@@ -269,7 +269,7 @@ index 365194b9065..167df789abf 100644
START_TEST(virtual)
{
int argc;
@@ -4304,6 +4548,7 @@ START_TEST(virtual)
@@ -4312,6 +4556,7 @@ START_TEST(virtual)
test_shared_memory_ro(FALSE, FILE_MAP_COPY);
test_shared_memory_ro(FALSE, FILE_MAP_COPY|FILE_MAP_WRITE);
test_mappings();

View File

@@ -51,13 +51,13 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "230e953e31f7228d10c8b0a0d2e8cf4f9af9a231"
echo "dfff9217746e5076aba35513c6d4bc3d271d109c"
}
# Show version information
version()
{
echo "Wine Staging 7.9"
echo "Wine Staging 7.13"
echo "Copyright (C) 2014-2019 the Wine Staging project authors."
echo "Copyright (C) 2018-2020 Alistair Leslie-Hughes"
echo ""
@@ -123,7 +123,6 @@ patch_enable_all ()
enable_kernel32_Processor_Group="$1"
enable_krnl386_exe16_GDT_LDT_Emulation="$1"
enable_krnl386_exe16_Invalid_Console_Handles="$1"
enable_libs_Unicode_Collation="$1"
enable_loader_KeyboardLayouts="$1"
enable_mmsystem_dll16_MIDIHDR_Refcount="$1"
enable_mountmgr_DosDevices="$1"
@@ -244,6 +243,7 @@ patch_enable_all ()
enable_winemenubuilder_integration="$1"
enable_wineps_drv_PostScript_Fixes="$1"
enable_winepulse_PulseAudio_Support="$1"
enable_winepulse_aux_channels="$1"
enable_winex11_CandidateWindowPos="$1"
enable_winex11_MWM_Decorations="$1"
enable_winex11_UpdateLayeredWindow="$1"
@@ -394,9 +394,6 @@ patch_enable ()
krnl386.exe16-Invalid_Console_Handles)
enable_krnl386_exe16_Invalid_Console_Handles="$2"
;;
libs-Unicode_Collation)
enable_libs_Unicode_Collation="$2"
;;
loader-KeyboardLayouts)
enable_loader_KeyboardLayouts="$2"
;;
@@ -757,6 +754,9 @@ patch_enable ()
winepulse-PulseAudio_Support)
enable_winepulse_PulseAudio_Support="$2"
;;
winepulse-aux_channels)
enable_winepulse_aux_channels="$2"
;;
winex11-CandidateWindowPos)
enable_winex11_CandidateWindowPos="$2"
;;
@@ -2112,26 +2112,6 @@ if test "$enable_krnl386_exe16_Invalid_Console_Handles" -eq 1; then
patch_apply krnl386.exe16-Invalid_Console_Handles/0001-krnl386.exe16-Really-translate-all-invalid-console-h.patch
fi
# Patchset libs-Unicode_Collation
# |
# | This patchset fixes the following Wine bugs:
# | * [#5163] Microsoft Office XP 2002 installer reports error 25003 (installation source corrupted), custom action 'CADpc'
# | returns 1603
# | * [#10767] Fix comparison of punctuation characters in lstrcmp
# | * [#32490] Graphical issues in Inquisitor
# |
# | Modified files:
# | * dlls/kernel32/tests/locale.c, dlls/kernelbase/locale.c
# |
if test "$enable_libs_Unicode_Collation" -eq 1; then
patch_apply libs-Unicode_Collation/0001-kernelbase-Implement-sortkey-generation-on-official-.patch
patch_apply libs-Unicode_Collation/0002-kernelbase-Implement-sortkey-punctuation.patch
patch_apply libs-Unicode_Collation/0003-kernelbase-Implement-sortkey-for-Japanese-characters.patch
patch_apply libs-Unicode_Collation/0004-kernelbase-Implement-sortkey-expansion.patch
patch_apply libs-Unicode_Collation/0005-kernelbase-Implement-sortkey-language-support.patch
patch_apply libs-Unicode_Collation/0006-kernelbase-Implement-CompareString-functions.patch
fi
# Patchset loader-KeyboardLayouts
# |
# | This patchset fixes the following Wine bugs:
@@ -3194,7 +3174,7 @@ fi
# | * [#37706] Fix return value of ScrollWindowEx for invisible windows
# |
# | Modified files:
# | * dlls/user32/painting.c
# | * dlls/win32u/dce.c
# |
if test "$enable_user32_ScrollWindowEx" -eq 1; then
patch_apply user32-ScrollWindowEx/0001-user32-Fix-return-value-of-ScrollWindowEx-for-invisi.patch
@@ -3287,7 +3267,7 @@ fi
# | * [#45882] - Raw Input should use untransformed mouse values (affects Overwatch, several Source games).
# |
# | Modified files:
# | * dlls/user32/rawinput.c, dlls/winex11.drv/mouse.c, server/queue.c
# | * dlls/win32u/rawinput.c, dlls/winex11.drv/mouse.c, server/queue.c
# |
if test "$enable_user32_rawinput_mouse_experimental" -eq 1; then
patch_apply user32-rawinput-mouse-experimental/0001-server-Clear-the-MOUSEEVENTF_-ABSOLUTE-VIRTUALDESK-f.patch
@@ -3683,6 +3663,18 @@ if test "$enable_winepulse_PulseAudio_Support" -eq 1; then
patch_apply winepulse-PulseAudio_Support/0001-winepulse.drv-Use-a-separate-mainloop-and-ctx-for-pu.patch
fi
# Patchset winepulse-aux_channels
# |
# | This patchset fixes the following Wine bugs:
# | * [#52572] Support PulseAudio channels aux0 and aux1.
# |
# | Modified files:
# | * dlls/winepulse.drv/pulse.c
# |
if test "$enable_winepulse_aux_channels" -eq 1; then
patch_apply winepulse-aux_channels/0001-winepulse-Add-aux0-and-aux1-channels.patch
fi
# Patchset winex11-CandidateWindowPos
# |
# | This patchset fixes the following Wine bugs:
@@ -3940,7 +3932,6 @@ fi
if test "$enable_xactengine3_7_callbacks" -eq 1; then
patch_apply xactengine3_7-callbacks/0001-Add-support-for-private-contexts.patch
patch_apply xactengine3_7-callbacks/0002-xactengine3_7-notifications.patch
patch_apply xactengine3_7-callbacks/0003-Send-NOTIFY_CUESTOP-when-Stop-is-called.patch
patch_apply xactengine3_7-callbacks/0004-xactengine3_7-Don-t-use-switch-with-constant-integer.patch
fi

View File

@@ -1,4 +1,4 @@
From 534d035e5646d1a76657987894ce7124be0f7312 Mon Sep 17 00:00:00 2001
From 0ed959d4122e705d8728a7064ff260d2a6955af5 Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Sun, 10 Aug 2014 22:17:57 +0800
Subject: [PATCH] riched20: Stub for ITextPara interface and implement
@@ -10,10 +10,10 @@ Subject: [PATCH] riched20: Stub for ITextPara interface and implement
2 files changed, 477 insertions(+)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index a23f4c82730..7204bb3a0fa 100644
index afecd34dc2a..6b94ee89902 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -3553,6 +3553,16 @@ static ULONG WINAPI TextPara_Release(ITextPara *iface)
@@ -3563,6 +3563,16 @@ static ULONG WINAPI TextPara_Release(ITextPara *iface)
return ref;
}
@@ -30,7 +30,7 @@ index a23f4c82730..7204bb3a0fa 100644
static HRESULT WINAPI TextPara_GetTypeInfoCount(ITextPara *iface, UINT *pctinfo)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
@@ -3620,6 +3630,10 @@ static HRESULT WINAPI TextPara_GetDuplicate(ITextPara *iface, ITextPara **ret)
@@ -3630,6 +3640,10 @@ static HRESULT WINAPI TextPara_GetDuplicate(ITextPara *iface, ITextPara **ret)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, ret);
@@ -41,7 +41,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3627,6 +3641,10 @@ static HRESULT WINAPI TextPara_SetDuplicate(ITextPara *iface, ITextPara *para)
@@ -3637,6 +3651,10 @@ static HRESULT WINAPI TextPara_SetDuplicate(ITextPara *iface, ITextPara *para)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, para);
@@ -52,7 +52,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3634,6 +3652,10 @@ static HRESULT WINAPI TextPara_CanChange(ITextPara *iface, LONG *ret)
@@ -3644,6 +3662,10 @@ static HRESULT WINAPI TextPara_CanChange(ITextPara *iface, LONG *ret)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, ret);
@@ -63,7 +63,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3641,6 +3663,10 @@ static HRESULT WINAPI TextPara_IsEqual(ITextPara *iface, ITextPara *para, LONG *
@@ -3651,6 +3673,10 @@ static HRESULT WINAPI TextPara_IsEqual(ITextPara *iface, ITextPara *para, LONG *
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p %p)\n", This, para, ret);
@@ -74,7 +74,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3648,6 +3674,10 @@ static HRESULT WINAPI TextPara_Reset(ITextPara *iface, LONG value)
@@ -3658,6 +3684,10 @@ static HRESULT WINAPI TextPara_Reset(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -85,7 +85,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3655,6 +3685,10 @@ static HRESULT WINAPI TextPara_GetStyle(ITextPara *iface, LONG *value)
@@ -3665,6 +3695,10 @@ static HRESULT WINAPI TextPara_GetStyle(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -96,7 +96,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3662,6 +3696,10 @@ static HRESULT WINAPI TextPara_SetStyle(ITextPara *iface, LONG value)
@@ -3672,6 +3706,10 @@ static HRESULT WINAPI TextPara_SetStyle(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -107,7 +107,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3669,6 +3707,10 @@ static HRESULT WINAPI TextPara_GetAlignment(ITextPara *iface, LONG *value)
@@ -3679,6 +3717,10 @@ static HRESULT WINAPI TextPara_GetAlignment(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -118,7 +118,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3676,6 +3718,10 @@ static HRESULT WINAPI TextPara_SetAlignment(ITextPara *iface, LONG value)
@@ -3686,6 +3728,10 @@ static HRESULT WINAPI TextPara_SetAlignment(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -129,7 +129,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3683,6 +3729,10 @@ static HRESULT WINAPI TextPara_GetHyphenation(ITextPara *iface, LONG *value)
@@ -3693,6 +3739,10 @@ static HRESULT WINAPI TextPara_GetHyphenation(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -140,7 +140,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3690,6 +3740,10 @@ static HRESULT WINAPI TextPara_SetHyphenation(ITextPara *iface, LONG value)
@@ -3700,6 +3750,10 @@ static HRESULT WINAPI TextPara_SetHyphenation(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -151,7 +151,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3697,6 +3751,10 @@ static HRESULT WINAPI TextPara_GetFirstLineIndent(ITextPara *iface, FLOAT *value
@@ -3707,6 +3761,10 @@ static HRESULT WINAPI TextPara_GetFirstLineIndent(ITextPara *iface, FLOAT *value
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -162,7 +162,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3704,6 +3762,10 @@ static HRESULT WINAPI TextPara_GetKeepTogether(ITextPara *iface, LONG *value)
@@ -3714,6 +3772,10 @@ static HRESULT WINAPI TextPara_GetKeepTogether(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -173,7 +173,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3711,6 +3773,10 @@ static HRESULT WINAPI TextPara_SetKeepTogether(ITextPara *iface, LONG value)
@@ -3721,6 +3783,10 @@ static HRESULT WINAPI TextPara_SetKeepTogether(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -184,7 +184,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3718,6 +3784,10 @@ static HRESULT WINAPI TextPara_GetKeepWithNext(ITextPara *iface, LONG *value)
@@ -3728,6 +3794,10 @@ static HRESULT WINAPI TextPara_GetKeepWithNext(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -195,7 +195,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3725,6 +3795,10 @@ static HRESULT WINAPI TextPara_SetKeepWithNext(ITextPara *iface, LONG value)
@@ -3735,6 +3805,10 @@ static HRESULT WINAPI TextPara_SetKeepWithNext(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -206,7 +206,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3732,6 +3806,10 @@ static HRESULT WINAPI TextPara_GetLeftIndent(ITextPara *iface, FLOAT *value)
@@ -3742,6 +3816,10 @@ static HRESULT WINAPI TextPara_GetLeftIndent(ITextPara *iface, FLOAT *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -217,7 +217,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3739,6 +3817,10 @@ static HRESULT WINAPI TextPara_GetLineSpacing(ITextPara *iface, FLOAT *value)
@@ -3749,6 +3827,10 @@ static HRESULT WINAPI TextPara_GetLineSpacing(ITextPara *iface, FLOAT *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -228,7 +228,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3746,6 +3828,10 @@ static HRESULT WINAPI TextPara_GetLineSpacingRule(ITextPara *iface, LONG *value)
@@ -3756,6 +3838,10 @@ static HRESULT WINAPI TextPara_GetLineSpacingRule(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -239,7 +239,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3753,6 +3839,10 @@ static HRESULT WINAPI TextPara_GetListAlignment(ITextPara *iface, LONG *value)
@@ -3763,6 +3849,10 @@ static HRESULT WINAPI TextPara_GetListAlignment(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -250,7 +250,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3760,6 +3850,10 @@ static HRESULT WINAPI TextPara_SetListAlignment(ITextPara *iface, LONG value)
@@ -3770,6 +3860,10 @@ static HRESULT WINAPI TextPara_SetListAlignment(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -261,7 +261,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3767,6 +3861,10 @@ static HRESULT WINAPI TextPara_GetListLevelIndex(ITextPara *iface, LONG *value)
@@ -3777,6 +3871,10 @@ static HRESULT WINAPI TextPara_GetListLevelIndex(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -272,7 +272,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3774,6 +3872,10 @@ static HRESULT WINAPI TextPara_SetListLevelIndex(ITextPara *iface, LONG value)
@@ -3784,6 +3882,10 @@ static HRESULT WINAPI TextPara_SetListLevelIndex(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -283,7 +283,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3781,6 +3883,10 @@ static HRESULT WINAPI TextPara_GetListStart(ITextPara *iface, LONG *value)
@@ -3791,6 +3893,10 @@ static HRESULT WINAPI TextPara_GetListStart(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -294,7 +294,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3788,6 +3894,10 @@ static HRESULT WINAPI TextPara_SetListStart(ITextPara *iface, LONG value)
@@ -3798,6 +3904,10 @@ static HRESULT WINAPI TextPara_SetListStart(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -305,7 +305,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3795,6 +3905,10 @@ static HRESULT WINAPI TextPara_GetListTab(ITextPara *iface, FLOAT *value)
@@ -3805,6 +3915,10 @@ static HRESULT WINAPI TextPara_GetListTab(ITextPara *iface, FLOAT *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -316,7 +316,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3802,6 +3916,10 @@ static HRESULT WINAPI TextPara_SetListTab(ITextPara *iface, FLOAT value)
@@ -3812,6 +3926,10 @@ static HRESULT WINAPI TextPara_SetListTab(ITextPara *iface, FLOAT value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%.2f)\n", This, value);
@@ -327,7 +327,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3809,6 +3927,10 @@ static HRESULT WINAPI TextPara_GetListType(ITextPara *iface, LONG *value)
@@ -3819,6 +3937,10 @@ static HRESULT WINAPI TextPara_GetListType(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -338,7 +338,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3816,6 +3938,10 @@ static HRESULT WINAPI TextPara_SetListType(ITextPara *iface, LONG value)
@@ -3826,6 +3948,10 @@ static HRESULT WINAPI TextPara_SetListType(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -349,7 +349,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3823,6 +3949,10 @@ static HRESULT WINAPI TextPara_GetNoLineNumber(ITextPara *iface, LONG *value)
@@ -3833,6 +3959,10 @@ static HRESULT WINAPI TextPara_GetNoLineNumber(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -360,7 +360,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3830,6 +3960,10 @@ static HRESULT WINAPI TextPara_SetNoLineNumber(ITextPara *iface, LONG value)
@@ -3840,6 +3970,10 @@ static HRESULT WINAPI TextPara_SetNoLineNumber(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -371,7 +371,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3837,6 +3971,10 @@ static HRESULT WINAPI TextPara_GetPageBreakBefore(ITextPara *iface, LONG *value)
@@ -3847,6 +3981,10 @@ static HRESULT WINAPI TextPara_GetPageBreakBefore(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -382,7 +382,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3844,6 +3982,10 @@ static HRESULT WINAPI TextPara_SetPageBreakBefore(ITextPara *iface, LONG value)
@@ -3854,6 +3992,10 @@ static HRESULT WINAPI TextPara_SetPageBreakBefore(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -393,7 +393,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3851,6 +3993,10 @@ static HRESULT WINAPI TextPara_GetRightIndent(ITextPara *iface, FLOAT *value)
@@ -3861,6 +4003,10 @@ static HRESULT WINAPI TextPara_GetRightIndent(ITextPara *iface, FLOAT *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -404,7 +404,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3858,6 +4004,10 @@ static HRESULT WINAPI TextPara_SetRightIndent(ITextPara *iface, FLOAT value)
@@ -3868,6 +4014,10 @@ static HRESULT WINAPI TextPara_SetRightIndent(ITextPara *iface, FLOAT value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%.2f)\n", This, value);
@@ -415,7 +415,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3865,6 +4015,10 @@ static HRESULT WINAPI TextPara_SetIndents(ITextPara *iface, FLOAT StartIndent, F
@@ -3875,6 +4025,10 @@ static HRESULT WINAPI TextPara_SetIndents(ITextPara *iface, FLOAT StartIndent, F
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%.2f %.2f %.2f)\n", This, StartIndent, LeftIndent, RightIndent);
@@ -426,7 +426,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3872,6 +4026,10 @@ static HRESULT WINAPI TextPara_SetLineSpacing(ITextPara *iface, LONG LineSpacing
@@ -3882,6 +4036,10 @@ static HRESULT WINAPI TextPara_SetLineSpacing(ITextPara *iface, LONG LineSpacing
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld %.2f)\n", This, LineSpacingRule, LineSpacing);
@@ -437,7 +437,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3879,6 +4037,10 @@ static HRESULT WINAPI TextPara_GetSpaceAfter(ITextPara *iface, FLOAT *value)
@@ -3889,6 +4047,10 @@ static HRESULT WINAPI TextPara_GetSpaceAfter(ITextPara *iface, FLOAT *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -448,7 +448,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3886,6 +4048,10 @@ static HRESULT WINAPI TextPara_SetSpaceAfter(ITextPara *iface, FLOAT value)
@@ -3896,6 +4058,10 @@ static HRESULT WINAPI TextPara_SetSpaceAfter(ITextPara *iface, FLOAT value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%.2f)\n", This, value);
@@ -459,7 +459,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3893,6 +4059,10 @@ static HRESULT WINAPI TextPara_GetSpaceBefore(ITextPara *iface, FLOAT *value)
@@ -3903,6 +4069,10 @@ static HRESULT WINAPI TextPara_GetSpaceBefore(ITextPara *iface, FLOAT *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -470,7 +470,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3900,6 +4070,10 @@ static HRESULT WINAPI TextPara_SetSpaceBefore(ITextPara *iface, FLOAT value)
@@ -3910,6 +4080,10 @@ static HRESULT WINAPI TextPara_SetSpaceBefore(ITextPara *iface, FLOAT value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%.2f)\n", This, value);
@@ -481,7 +481,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3907,6 +4081,10 @@ static HRESULT WINAPI TextPara_GetWidowControl(ITextPara *iface, LONG *value)
@@ -3917,6 +4091,10 @@ static HRESULT WINAPI TextPara_GetWidowControl(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -492,7 +492,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3914,6 +4092,10 @@ static HRESULT WINAPI TextPara_SetWidowControl(ITextPara *iface, LONG value)
@@ -3924,6 +4102,10 @@ static HRESULT WINAPI TextPara_SetWidowControl(ITextPara *iface, LONG value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld)\n", This, value);
@@ -503,7 +503,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3921,6 +4103,10 @@ static HRESULT WINAPI TextPara_GetTabCount(ITextPara *iface, LONG *value)
@@ -3931,6 +4113,10 @@ static HRESULT WINAPI TextPara_GetTabCount(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%p)\n", This, value);
@@ -514,7 +514,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3928,6 +4114,10 @@ static HRESULT WINAPI TextPara_AddTab(ITextPara *iface, FLOAT tbPos, LONG tbAlig
@@ -3938,6 +4124,10 @@ static HRESULT WINAPI TextPara_AddTab(ITextPara *iface, FLOAT tbPos, LONG tbAlig
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%.2f %ld %ld)\n", This, tbPos, tbAlign, tbLeader);
@@ -525,7 +525,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3935,6 +4125,10 @@ static HRESULT WINAPI TextPara_ClearAllTabs(ITextPara *iface)
@@ -3945,6 +4135,10 @@ static HRESULT WINAPI TextPara_ClearAllTabs(ITextPara *iface)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)\n", This);
@@ -536,7 +536,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3942,6 +4136,10 @@ static HRESULT WINAPI TextPara_DeleteTab(ITextPara *iface, FLOAT pos)
@@ -3952,6 +4146,10 @@ static HRESULT WINAPI TextPara_DeleteTab(ITextPara *iface, FLOAT pos)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%.2f)\n", This, pos);
@@ -547,7 +547,7 @@ index a23f4c82730..7204bb3a0fa 100644
return E_NOTIMPL;
}
@@ -3949,6 +4147,10 @@ static HRESULT WINAPI TextPara_GetTab(ITextPara *iface, LONG iTab, FLOAT *ptbPos
@@ -3959,6 +4157,10 @@ static HRESULT WINAPI TextPara_GetTab(ITextPara *iface, LONG iTab, FLOAT *ptbPos
{
ITextParaImpl *This = impl_from_ITextPara(iface);
FIXME("(%p)->(%ld %p %p %p)\n", This, iTab, ptbPos, ptbAlign, ptbLeader);
@@ -559,11 +559,11 @@ index a23f4c82730..7204bb3a0fa 100644
}
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index 24284a24484..4ea3828033b 100644
index a01f4e21db8..e44ffc767e7 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -4249,6 +4249,274 @@ static void test_clipboard(void)
ITextRange_Release(range);
@@ -5439,6 +5439,274 @@ static void test_undo_control(void)
release_interfaces(&inst.hwnd, &reole, &inst.doc, &selection);
}
+static void test_ITextRange_SetStart(void)
@@ -837,7 +837,7 @@ index 24284a24484..4ea3828033b 100644
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
@@ -4269,6 +4537,13 @@ START_TEST(richole)
@@ -5459,6 +5727,13 @@ START_TEST(richole)
test_ITextRange_SetRange();
test_ITextRange_GetDuplicate();
test_ITextRange_Collapse();

View File

@@ -1,4 +1,4 @@
From c79db3f36aa653ec986ba948e547202fd95ed151 Mon Sep 17 00:00:00 2001
From fcd07d80234de455880990e2b2c488e9795f9dc0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 3 Apr 2015 03:58:47 +0200
Subject: [PATCH] server: Allow to open files without any permission bits. (try
@@ -9,14 +9,14 @@ Changes in v2:
* Pay attention to requested access attributes - this fixes a couple more todo_wine's.
---
dlls/advapi32/tests/security.c | 32 ++++++++++++--------------------
server/fd.c | 20 ++++++++++++++++++++
2 files changed, 32 insertions(+), 20 deletions(-)
server/fd.c | 21 +++++++++++++++++++++
2 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 135a45f7727..2147d0f1700 100644
index ed91ccc39d3..c534d1453d9 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3710,17 +3710,13 @@ static void test_CreateDirectoryA(void)
@@ -3713,17 +3713,13 @@ static void test_CreateDirectoryA(void)
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
(PSID *)&owner, NULL, &pDacl, NULL, &pSD);
@@ -40,7 +40,7 @@ index 135a45f7727..2147d0f1700 100644
CloseHandle(hTemp);
/* Test inheritance of ACLs in NtCreateFile without security descriptor */
@@ -3789,17 +3785,13 @@ static void test_CreateDirectoryA(void)
@@ -3792,17 +3788,13 @@ static void test_CreateDirectoryA(void)
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
(PSID *)&owner, NULL, &pDacl, NULL, &pSD);
@@ -65,7 +65,7 @@ index 135a45f7727..2147d0f1700 100644
done:
diff --git a/server/fd.c b/server/fd.c
index 31b64b30d43..2ff0b480f40 100644
index bf59359de03..323dd92e653 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2044,6 +2044,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -76,7 +76,7 @@ index 31b64b30d43..2ff0b480f40 100644
int created = (flags & O_CREAT);
if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) ||
@@ -2116,10 +2117,28 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2116,6 +2117,23 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
if ((access & FILE_UNIX_WRITE_ACCESS) || (flags & O_CREAT))
fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode );
}
@@ -100,12 +100,16 @@ index 31b64b30d43..2ff0b480f40 100644
if (fd->unix_fd == -1)
{
file_set_error();
@@ -2124,6 +2142,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
set_error( STATUS_OBJECT_NAME_INVALID );
else
file_set_error();
+
+ if (do_chmod) chmod( name, *mode );
goto error;
}
}
@@ -2130,6 +2149,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2134,6 +2154,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
closed_fd->unlink = 0;
closed_fd->unlink_name = fd->unlink_name;
closed_fd->unix_name = fd->unix_name;
@@ -114,5 +118,5 @@ index 31b64b30d43..2ff0b480f40 100644
*mode = st.st_mode;
--
2.34.1
2.35.1

View File

@@ -1,18 +1,19 @@
From c7b125afcbf75d7a95c0fcb78c0dadf8f30fd61f Mon Sep 17 00:00:00 2001
From 9de95b5af44aa9ac1cec60a27c70a546258a954d Mon Sep 17 00:00:00 2001
From: Qian Hong <qhong@codeweavers.com>
Date: Fri, 15 May 2015 15:28:17 +0800
Subject: ntdll/tests: Added tests for open behaviour on readonly files.
Subject: [PATCH] ntdll/tests: Added tests for open behaviour on readonly
files.
---
dlls/ntdll/tests/file.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/tests/file.c | 78 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 2df0edc..d365303 100644
index 35fab8ca427..5d6f9b83152 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -2073,6 +2073,83 @@ static void test_NtCreateFile(void)
DeleteFileW( path );
@@ -4259,6 +4259,83 @@ static void test_NtCreateFile(void)
RemoveDirectoryW( path );
}
+static void test_readonly(void)
@@ -95,7 +96,7 @@ index 2df0edc..d365303 100644
static void test_read_write(void)
{
static const char contents[14] = "1234567890abcd";
@@ -2823,6 +2900,7 @@ START_TEST(file)
@@ -5838,6 +5915,7 @@ START_TEST(file)
test_read_write();
test_NtCreateFile();
@@ -104,5 +105,5 @@ index 2df0edc..d365303 100644
open_file_test();
delete_file_test();
--
2.4.2
2.35.1

View File

@@ -1,4 +1,4 @@
From 54065eb714959facb7f4d463d9c8a11e5c6b2b42 Mon Sep 17 00:00:00 2001
From 0c3e20339d2b531e62819b670b30635af6e75ea0 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 17 May 2017 23:55:55 +0800
Subject: [PATCH] server: Add support for a layered window region. (v3)
@@ -11,10 +11,10 @@ Subject: [PATCH] server: Add support for a layered window region. (v3)
4 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index e15de7e5ccd..568fd26bb69 100644
index 62ff4ad7777..a458e002ca0 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -3695,13 +3695,11 @@ static void test_Input_mouse(void)
@@ -3683,13 +3683,11 @@ static void test_Input_mouse(void)
if (msg.message == WM_LBUTTONDOWN)
{
@@ -29,18 +29,18 @@ index e15de7e5ccd..568fd26bb69 100644
got_button_up = TRUE;
break;
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c
index 550c5f06f37..8204e3dba9e 100644
index 10388a1cc8f..5ff6e23fa8d 100644
--- a/dlls/winex11.drv/bitblt.c
+++ b/dlls/winex11.drv/bitblt.c
@@ -46,6 +46,7 @@
#include "winbase.h"
@@ -48,6 +48,7 @@
#include "x11drv.h"
#include "winternl.h"
+#include "wine/server.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(bitblt);
@@ -1623,6 +1624,48 @@ static inline void add_row( HRGN rgn, RGNDATA *data, int x, int y, int len )
@@ -1625,6 +1626,48 @@ static inline void add_row( HRGN rgn, RGNDATA *data, int x, int y, int len )
}
#endif
@@ -89,7 +89,7 @@ index 550c5f06f37..8204e3dba9e 100644
/***********************************************************************
* update_surface_region
*/
@@ -1641,6 +1684,7 @@ static void update_surface_region( struct x11drv_window_surface *surface )
@@ -1643,6 +1686,7 @@ static void update_surface_region( struct x11drv_window_surface *surface )
if (!surface->is_argb && surface->color_key == CLR_INVALID)
{
XShapeCombineMask( gdi_display, surface->window, ShapeBounding, 0, 0, None, ShapeSet );
@@ -97,7 +97,7 @@ index 550c5f06f37..8204e3dba9e 100644
return;
}
@@ -1751,6 +1795,7 @@ static void update_surface_region( struct x11drv_window_surface *surface )
@@ -1753,6 +1797,7 @@ static void update_surface_region( struct x11drv_window_surface *surface )
free( data );
}

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