You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8699d2c2f6 | ||
|
e7622edfc9 | ||
|
c9652a68e1 | ||
|
6be691c005 | ||
|
850b7f6540 | ||
|
776c47da46 | ||
|
a51c679f34 | ||
|
366a9020dc | ||
|
a8e56928ef | ||
|
f0e38f512c | ||
|
3d9f724967 | ||
|
4e4376778f | ||
|
94e31f7578 | ||
|
560db77d41 | ||
|
2d5e6b24dc | ||
|
37c1363814 | ||
|
94f00cd958 | ||
|
b22c061c3f | ||
|
0e42f8ce9a | ||
|
f2c44a8a4d | ||
|
8f0f175429 | ||
|
3fe7d402eb | ||
|
7fc2d64fee | ||
|
c6119e3d5c | ||
|
8ee2551c93 | ||
|
f0d1a4a5ba | ||
|
2a411514e5 | ||
|
6ea30a2e5b | ||
|
e31ff0a923 | ||
|
e534d6546a | ||
|
ea360c871f |
13
.github/workflows/macOS.yml
vendored
13
.github/workflows/macOS.yml
vendored
@@ -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)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From a0211ba2069af11a64588a49222dcdcce1d805be Mon Sep 17 00:00:00 2001
|
||||
From 92914d4648be5dd7ee62b35d3ca2fc7376d0dbd0 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 22 Mar 2016 21:54:26 +0100
|
||||
Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
@@ -13,10 +13,10 @@ Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
6 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
|
||||
index bc958e50a1..76ecc7f02a 100644
|
||||
index 971e3c7ff6b..fcd96eb6374 100644
|
||||
--- a/dlls/d2d1/bitmap.c
|
||||
+++ b/dlls/d2d1/bitmap.c
|
||||
@@ -617,5 +617,5 @@ struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface)
|
||||
@@ -646,5 +646,5 @@ struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface)
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == (ID2D1BitmapVtbl *)&d2d_bitmap_vtbl);
|
||||
@@ -24,10 +24,10 @@ index bc958e50a1..76ecc7f02a 100644
|
||||
+ return CONTAINING_RECORD((ID2D1Bitmap1*)iface, struct d2d_bitmap, ID2D1Bitmap1_iface);
|
||||
}
|
||||
diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c
|
||||
index 80fc0f5331..a612e683b6 100644
|
||||
index b9a673fe54c..c5a52db6b01 100644
|
||||
--- a/dlls/d2d1/brush.c
|
||||
+++ b/dlls/d2d1/brush.c
|
||||
@@ -253,7 +253,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory,
|
||||
@@ -259,7 +259,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1SolidColorBrush(ID2D1SolidColorBrush *iface)
|
||||
{
|
||||
@@ -36,7 +36,7 @@ index 80fc0f5331..a612e683b6 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_solid_color_brush_QueryInterface(ID2D1SolidColorBrush *iface,
|
||||
@@ -396,7 +396,7 @@ HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *
|
||||
@@ -402,7 +402,7 @@ HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1LinearGradientBrush(ID2D1LinearGradientBrush *iface)
|
||||
{
|
||||
@@ -45,7 +45,7 @@ index 80fc0f5331..a612e683b6 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_linear_gradient_brush_QueryInterface(ID2D1LinearGradientBrush *iface,
|
||||
@@ -583,7 +583,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory,
|
||||
@@ -589,7 +589,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1RadialGradientBrush(ID2D1RadialGradientBrush *iface)
|
||||
{
|
||||
@@ -54,7 +54,7 @@ index 80fc0f5331..a612e683b6 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_radial_gradient_brush_QueryInterface(ID2D1RadialGradientBrush *iface,
|
||||
@@ -815,7 +815,7 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
|
||||
@@ -821,7 +821,7 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1BitmapBrush1(ID2D1BitmapBrush1 *iface)
|
||||
{
|
||||
@@ -64,7 +64,7 @@ index 80fc0f5331..a612e683b6 100644
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_bitmap_brush_QueryInterface(ID2D1BitmapBrush1 *iface,
|
||||
diff --git a/dlls/d2d1/dc_render_target.c b/dlls/d2d1/dc_render_target.c
|
||||
index 47aa99697d..0efa3ebeaf 100644
|
||||
index e7e0fa57ed7..1166ae204c2 100644
|
||||
--- a/dlls/d2d1/dc_render_target.c
|
||||
+++ b/dlls/d2d1/dc_render_target.c
|
||||
@@ -23,7 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
@@ -77,19 +77,19 @@ index 47aa99697d..0efa3ebeaf 100644
|
||||
|
||||
static HRESULT d2d_dc_render_target_present(IUnknown *outer_unknown)
|
||||
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
|
||||
index 79850f1c20..b9b6a32f76 100644
|
||||
index e97bae0b54a..661387b570b 100644
|
||||
--- a/dlls/d2d1/geometry.c
|
||||
+++ b/dlls/d2d1/geometry.c
|
||||
@@ -2982,7 +2982,7 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl =
|
||||
@@ -3356,7 +3356,7 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl =
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1PathGeometry(ID2D1PathGeometry *iface)
|
||||
static inline struct d2d_geometry *impl_from_ID2D1PathGeometry1(ID2D1PathGeometry1 *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Geometry *)iface, struct d2d_geometry, ID2D1Geometry_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry *iface, REFIID iid, void **out)
|
||||
@@ -3502,7 +3502,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory2 *factor
|
||||
static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry1 *iface, REFIID iid, void **out)
|
||||
@@ -4229,7 +4229,7 @@ fail:
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1RectangleGeometry(ID2D1RectangleGeometry *iface)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ index 79850f1c20..b9b6a32f76 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_QueryInterface(ID2D1RectangleGeometry *iface,
|
||||
@@ -3841,7 +3841,7 @@ fail:
|
||||
@@ -4941,7 +4941,7 @@ fail:
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1TransformedGeometry(ID2D1TransformedGeometry *iface)
|
||||
{
|
||||
@@ -107,7 +107,7 @@ index 79850f1c20..b9b6a32f76 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_transformed_geometry_QueryInterface(ID2D1TransformedGeometry *iface,
|
||||
@@ -4122,7 +4122,7 @@ void d2d_transformed_geometry_init(struct d2d_geometry *geometry, ID2D1Factory2
|
||||
@@ -5225,7 +5225,7 @@ void d2d_transformed_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1GeometryGroup(ID2D1GeometryGroup *iface)
|
||||
{
|
||||
@@ -117,7 +117,7 @@ index 79850f1c20..b9b6a32f76 100644
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_geometry_group_QueryInterface(ID2D1GeometryGroup *iface,
|
||||
diff --git a/dlls/d2d1/hwnd_render_target.c b/dlls/d2d1/hwnd_render_target.c
|
||||
index 625f101eaa..f3626c42ce 100644
|
||||
index 4ce220bf433..32eeaf02c9f 100644
|
||||
--- a/dlls/d2d1/hwnd_render_target.c
|
||||
+++ b/dlls/d2d1/hwnd_render_target.c
|
||||
@@ -23,7 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
@@ -130,7 +130,7 @@ index 625f101eaa..f3626c42ce 100644
|
||||
|
||||
static HRESULT d2d_hwnd_render_target_present(IUnknown *outer_unknown)
|
||||
diff --git a/dlls/d2d1/state_block.c b/dlls/d2d1/state_block.c
|
||||
index e3175146a6..b66752983e 100644
|
||||
index 114a3efd883..4f662be4549 100644
|
||||
--- a/dlls/d2d1/state_block.c
|
||||
+++ b/dlls/d2d1/state_block.c
|
||||
@@ -187,5 +187,5 @@ struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStat
|
||||
@@ -141,5 +141,5 @@ index e3175146a6..b66752983e 100644
|
||||
+ return CONTAINING_RECORD((ID2D1DrawingStateBlock1*)iface, struct d2d_state_block, ID2D1DrawingStateBlock1_iface);
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
2.35.1
|
||||
|
||||
|
@@ -1,76 +0,0 @@
|
||||
From 9ea60091ba885b5f63266374f49f0d63e2cf2767 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 16 Dec 2020 11:07:05 +1100
|
||||
Subject: [PATCH] d3drm: Support IDirect3D3 when creating device
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39346
|
||||
---
|
||||
dlls/d3drm/device.c | 26 ++++++++++++++++++++++++--
|
||||
1 file changed, 24 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3drm/device.c b/dlls/d3drm/device.c
|
||||
index 2e1b5f2d24f..fff272197bf 100644
|
||||
--- a/dlls/d3drm/device.c
|
||||
+++ b/dlls/d3drm/device.c
|
||||
@@ -124,7 +124,9 @@ HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw
|
||||
IDirectDrawSurface *ds = NULL;
|
||||
IDirect3DDevice *device1 = NULL;
|
||||
IDirect3DDevice2 *device2 = NULL;
|
||||
+ IDirect3DDevice3 *device3 = NULL;
|
||||
IDirect3D2 *d3d2 = NULL;
|
||||
+ IDirect3D3 *d3d3 = NULL;
|
||||
DDSURFACEDESC desc, surface_desc;
|
||||
HRESULT hr;
|
||||
|
||||
@@ -171,19 +173,29 @@ HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw
|
||||
|
||||
if (version == 1)
|
||||
hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DRGBDevice, (void **)&device1);
|
||||
- else
|
||||
+ else if (version == 2)
|
||||
{
|
||||
IDirectDraw_QueryInterface(ddraw, &IID_IDirect3D2, (void**)&d3d2);
|
||||
hr = IDirect3D2_CreateDevice(d3d2, &IID_IDirect3DRGBDevice, surface, &device2);
|
||||
IDirect3D2_Release(d3d2);
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ IDirectDrawSurface4 *surface4 = NULL;
|
||||
+
|
||||
+ IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface4, (void**)&surface4);
|
||||
+ IDirectDraw_QueryInterface(ddraw, &IID_IDirect3D3, (void**)&d3d3);
|
||||
+ hr = IDirect3D3_CreateDevice(d3d3, &IID_IDirect3DRGBDevice, surface4, &device3, NULL);
|
||||
+ IDirectDrawSurface4_Release(surface4);
|
||||
+ IDirect3D3_Release(d3d3);
|
||||
+ }
|
||||
if (FAILED(hr))
|
||||
{
|
||||
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
|
||||
return hr;
|
||||
}
|
||||
|
||||
- if (version != 1)
|
||||
+ if (version == 2)
|
||||
{
|
||||
hr = IDirect3DDevice2_QueryInterface(device2, &IID_IDirect3DDevice, (void**)&device1);
|
||||
IDirect3DDevice2_Release(device2);
|
||||
@@ -193,6 +205,16 @@ HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
+ else if (version == 3)
|
||||
+ {
|
||||
+ hr = IDirect3DDevice3_QueryInterface(device3, &IID_IDirect3DDevice, (void**)&device1);
|
||||
+ IDirect3DDevice3_Release(device3);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
|
||||
+ return hr;
|
||||
+ }
|
||||
+ }
|
||||
device->device = device1;
|
||||
device->width = desc.dwWidth;
|
||||
device->height = desc.dwHeight;
|
||||
--
|
||||
2.29.2
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [39346] Support IDirect3D3 when creating device.
|
@@ -1,7 +1,7 @@
|
||||
From cfbee3f0f952769dbf663489c2a209493c7412d3 Mon Sep 17 00:00:00 2001
|
||||
From 5d9d9cbdb4043848aa5ebdd8a1349d9c876650e3 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 11 Jan 2015 16:18:03 +0100
|
||||
Subject: d3dx9_36: Add support for FOURCC surface to
|
||||
Subject: [PATCH] d3dx9_36: Add support for FOURCC surface to
|
||||
save_dds_surface_to_memory.
|
||||
|
||||
---
|
||||
@@ -9,10 +9,10 @@ Subject: d3dx9_36: Add support for FOURCC surface to
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
|
||||
index 4fa2a76..58b676d 100644
|
||||
index 26809a47e18..db334ee83f1 100644
|
||||
--- a/dlls/d3dx9_36/surface.c
|
||||
+++ b/dlls/d3dx9_36/surface.c
|
||||
@@ -311,6 +311,14 @@ static HRESULT d3dformat_to_dds_pixel_format(struct dds_pixel_format *pixel_form
|
||||
@@ -433,6 +433,14 @@ static HRESULT d3dformat_to_dds_pixel_format(struct dds_pixel_format *pixel_form
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ index 4fa2a76..58b676d 100644
|
||||
+ return D3D_OK;
|
||||
+ }
|
||||
+
|
||||
WARN("Unknown pixel format %#x\n", d3dformat);
|
||||
WARN("Unknown pixel format %#x.\n", d3dformat);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
--
|
||||
2.6.4
|
||||
2.35.1
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 27524b275c81c1c9057e4b4ca3d9cec734a3bd8a Mon Sep 17 00:00:00 2001
|
||||
From 846f2603e9d2a3a3b5a56b0e1140bb49a95053a6 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Thu, 7 Jun 2018 20:09:59 -0500
|
||||
Subject: [PATCH] server: Create server objects for eventfd-based
|
||||
@@ -7,10 +7,10 @@ Subject: [PATCH] server: Create server objects for eventfd-based
|
||||
---
|
||||
server/Makefile.in | 1 +
|
||||
server/esync.c | 318 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
server/esync.h | 22 +++
|
||||
server/esync.h | 24 ++++
|
||||
server/main.c | 4 +
|
||||
server/protocol.def | 25 +++-
|
||||
5 files changed, 369 insertions(+), 1 deletion(-)
|
||||
5 files changed, 371 insertions(+), 1 deletion(-)
|
||||
create mode 100644 server/esync.c
|
||||
create mode 100644 server/esync.h
|
||||
|
||||
@@ -352,10 +352,10 @@ index 00000000000..b9dbfa322bc
|
||||
+}
|
||||
diff --git a/server/esync.h b/server/esync.h
|
||||
new file mode 100644
|
||||
index 00000000000..7ca4ca89394
|
||||
index 00000000000..00f9e638d83
|
||||
--- /dev/null
|
||||
+++ b/server/esync.h
|
||||
@@ -0,0 +1,22 @@
|
||||
@@ -0,0 +1,24 @@
|
||||
+/*
|
||||
+ * eventfd-based synchronization objects
|
||||
+ *
|
||||
@@ -376,6 +376,8 @@ index 00000000000..7ca4ca89394
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+extern int do_esync(void);
|
||||
+void esync_init(void);
|
||||
diff --git a/server/main.c b/server/main.c
|
||||
@@ -401,10 +403,10 @@ index a134d811d82..3436b0871b4 100644
|
||||
set_current_time();
|
||||
init_scheduler();
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index c413cc7d7bb..607d56a666c 100644
|
||||
index 6bfcda213a4..6b0e0e6f6e4 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3733,7 +3733,6 @@ struct handle_info
|
||||
@@ -3738,7 +3738,6 @@ struct handle_info
|
||||
obj_handle_t handle; /* process handle */
|
||||
@END
|
||||
|
||||
@@ -412,7 +414,7 @@ index c413cc7d7bb..607d56a666c 100644
|
||||
/* Iterate thread list for process */
|
||||
@REQ(get_next_thread)
|
||||
obj_handle_t process; /* process handle */
|
||||
@@ -3744,3 +3743,27 @@ struct handle_info
|
||||
@@ -3749,3 +3748,27 @@ struct handle_info
|
||||
@REPLY
|
||||
obj_handle_t handle; /* next thread handle */
|
||||
@END
|
||||
@@ -441,5 +443,5 @@ index c413cc7d7bb..607d56a666c 100644
|
||||
+ unsigned int shm_idx;
|
||||
+@END
|
||||
--
|
||||
2.33.0
|
||||
2.35.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 670ee9563c1021c05993ef8525a4661daa01d3dd Mon Sep 17 00:00:00 2001
|
||||
From dcb50e04b4ec205f4a6688c71a23cb2863cffce6 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Fri, 8 Jun 2018 21:01:24 -0500
|
||||
Subject: [PATCH] server: Create eventfd file descriptors for event objects.
|
||||
@@ -9,14 +9,14 @@ This lets system processes shut down.
|
||||
---
|
||||
server/esync.c | 8 ++++++++
|
||||
server/esync.h | 1 +
|
||||
server/event.c | 30 ++++++++++++++++++++++++++++--
|
||||
3 files changed, 37 insertions(+), 2 deletions(-)
|
||||
server/event.c | 29 +++++++++++++++++++++++++++--
|
||||
3 files changed, 36 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/server/esync.c b/server/esync.c
|
||||
index 2b9307267f9..975e5d2ddd6 100644
|
||||
index 6696119b207..8cb46c4f2ce 100644
|
||||
--- a/server/esync.c
|
||||
+++ b/server/esync.c
|
||||
@@ -331,6 +331,14 @@ void esync_wake_up( struct object *obj )
|
||||
@@ -329,6 +329,14 @@ void esync_wake_up( struct object *obj )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,27 +32,19 @@ index 2b9307267f9..975e5d2ddd6 100644
|
||||
{
|
||||
struct esync *esync;
|
||||
diff --git a/server/esync.h b/server/esync.h
|
||||
index 1e12560ddd6..fcbfd0989bb 100644
|
||||
index 1241e6d9f1a..d259b5f604d 100644
|
||||
--- a/server/esync.h
|
||||
+++ b/server/esync.h
|
||||
@@ -22,3 +22,4 @@ extern int do_esync(void);
|
||||
@@ -24,3 +24,4 @@ extern int do_esync(void);
|
||||
void esync_init(void);
|
||||
int esync_create_fd( int initval, int flags );
|
||||
void esync_wake_up( struct object *obj );
|
||||
+void esync_clear( int fd );
|
||||
diff --git a/server/event.c b/server/event.c
|
||||
index c727bfdd1ba..69126abc096 100644
|
||||
index c727bfdd1ba..f1a88e3d23f 100644
|
||||
--- a/server/event.c
|
||||
+++ b/server/event.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
+#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "ntstatus.h"
|
||||
@@ -35,6 +36,7 @@
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "thread.h"
|
||||
#include "request.h"
|
||||
#include "security.h"
|
||||
@@ -60,7 +52,7 @@ index c727bfdd1ba..69126abc096 100644
|
||||
|
||||
static const WCHAR event_name[] = {'E','v','e','n','t'};
|
||||
|
||||
@@ -56,13 +58,16 @@ struct event
|
||||
@@ -56,13 +57,16 @@ struct event
|
||||
struct list kernel_object; /* list of kernel object pointers */
|
||||
int manual_reset; /* is it a manual reset event? */
|
||||
int signaled; /* event has been signaled */
|
||||
@@ -77,7 +69,7 @@ index c727bfdd1ba..69126abc096 100644
|
||||
|
||||
static const struct object_ops event_ops =
|
||||
{
|
||||
@@ -72,7 +77,7 @@ static const struct object_ops event_ops =
|
||||
@@ -72,7 +76,7 @@ static const struct object_ops event_ops =
|
||||
add_queue, /* add_queue */
|
||||
remove_queue, /* remove_queue */
|
||||
event_signaled, /* signaled */
|
||||
@@ -86,7 +78,7 @@ index c727bfdd1ba..69126abc096 100644
|
||||
event_satisfied, /* satisfied */
|
||||
event_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -86,7 +91,7 @@ static const struct object_ops event_ops =
|
||||
@@ -86,7 +90,7 @@ static const struct object_ops event_ops =
|
||||
no_open_file, /* open_file */
|
||||
event_get_kernel_obj_list, /* get_kernel_obj_list */
|
||||
no_close_handle, /* close_handle */
|
||||
@@ -95,7 +87,7 @@ index c727bfdd1ba..69126abc096 100644
|
||||
};
|
||||
|
||||
|
||||
@@ -152,6 +157,9 @@ struct event *create_event( struct object *root, const struct unicode_str *name,
|
||||
@@ -152,6 +156,9 @@ struct event *create_event( struct object *root, const struct unicode_str *name,
|
||||
list_init( &event->kernel_object );
|
||||
event->manual_reset = manual_reset;
|
||||
event->signaled = initial_state;
|
||||
@@ -105,7 +97,7 @@ index c727bfdd1ba..69126abc096 100644
|
||||
}
|
||||
}
|
||||
return event;
|
||||
@@ -180,6 +188,9 @@ void set_event( struct event *event )
|
||||
@@ -180,6 +187,9 @@ void set_event( struct event *event )
|
||||
void reset_event( struct event *event )
|
||||
{
|
||||
event->signaled = 0;
|
||||
@@ -115,7 +107,7 @@ index c727bfdd1ba..69126abc096 100644
|
||||
}
|
||||
|
||||
static void event_dump( struct object *obj, int verbose )
|
||||
@@ -197,6 +208,13 @@ static int event_signaled( struct object *obj, struct wait_queue_entry *entry )
|
||||
@@ -197,6 +207,13 @@ static int event_signaled( struct object *obj, struct wait_queue_entry *entry )
|
||||
return event->signaled;
|
||||
}
|
||||
|
||||
@@ -129,7 +121,7 @@ index c727bfdd1ba..69126abc096 100644
|
||||
static void event_satisfied( struct object *obj, struct wait_queue_entry *entry )
|
||||
{
|
||||
struct event *event = (struct event *)obj;
|
||||
@@ -225,6 +243,14 @@ static struct list *event_get_kernel_obj_list( struct object *obj )
|
||||
@@ -225,6 +242,14 @@ static struct list *event_get_kernel_obj_list( struct object *obj )
|
||||
return &event->kernel_object;
|
||||
}
|
||||
|
||||
@@ -145,5 +137,5 @@ index c727bfdd1ba..69126abc096 100644
|
||||
unsigned int attr, const struct security_descriptor *sd )
|
||||
{
|
||||
--
|
||||
2.33.0
|
||||
2.35.1
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
From a273680e7cbdc66e9fdb6fd6482803ddfed94dca Mon Sep 17 00:00:00 2001
|
||||
From 0d55971a114d650b7826e01e43ccd3a60597fefd Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
Date: Mon, 6 Jul 2020 16:01:56 -0500
|
||||
Subject: [PATCH] server: Create eventfd file descriptors for message queues.
|
||||
|
||||
---
|
||||
server/queue.c | 29 ++++++++++++++++++++++++++++-
|
||||
1 file changed, 28 insertions(+), 1 deletion(-)
|
||||
server/queue.c | 30 +++++++++++++++++++++++++++++-
|
||||
1 file changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index b6decc521e9..e70c0f5ad81 100644
|
||||
index b6decc521e9..23fb338924e 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -41,6 +41,7 @@
|
||||
@@ -85,7 +85,15 @@ index b6decc521e9..e70c0f5ad81 100644
|
||||
static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry )
|
||||
{
|
||||
struct msg_queue *queue = (struct msg_queue *)obj;
|
||||
@@ -2485,6 +2502,9 @@ DECL_HANDLER(set_queue_mask)
|
||||
@@ -1090,6 +1107,7 @@ static void msg_queue_destroy( struct object *obj )
|
||||
release_object( queue->input );
|
||||
if (queue->hooks) release_object( queue->hooks );
|
||||
if (queue->fd) release_object( queue->fd );
|
||||
+ if (do_esync()) close( queue->esync_fd );
|
||||
}
|
||||
|
||||
static void msg_queue_poll_event( struct fd *fd, int event )
|
||||
@@ -2485,6 +2503,9 @@ DECL_HANDLER(set_queue_mask)
|
||||
if (req->skip_wait) queue->wake_mask = queue->changed_mask = 0;
|
||||
else wake_up( &queue->obj, 0 );
|
||||
}
|
||||
@@ -95,7 +103,7 @@ index b6decc521e9..e70c0f5ad81 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2498,6 +2518,9 @@ DECL_HANDLER(get_queue_status)
|
||||
@@ -2498,6 +2519,9 @@ DECL_HANDLER(get_queue_status)
|
||||
reply->wake_bits = queue->wake_bits;
|
||||
reply->changed_bits = queue->changed_bits;
|
||||
queue->changed_bits &= ~req->clear_bits;
|
||||
@@ -105,7 +113,7 @@ index b6decc521e9..e70c0f5ad81 100644
|
||||
}
|
||||
else reply->wake_bits = reply->changed_bits = 0;
|
||||
}
|
||||
@@ -2746,6 +2769,10 @@ DECL_HANDLER(get_message)
|
||||
@@ -2746,6 +2770,10 @@ DECL_HANDLER(get_message)
|
||||
queue->wake_mask = req->wake_mask;
|
||||
queue->changed_mask = req->changed_mask;
|
||||
set_error( STATUS_PENDING ); /* FIXME */
|
||||
@@ -117,5 +125,5 @@ index b6decc521e9..e70c0f5ad81 100644
|
||||
|
||||
found_msg:
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 3518ce5bf3c6010425f35bb228b3fb2b238b1726 Mon Sep 17 00:00:00 2001
|
||||
From 8111350c608821aa86c6acfb4959446abf97d382 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Sat, 9 Jun 2018 15:39:37 -0500
|
||||
Subject: [PATCH] server: Create eventfd descriptors for device manager
|
||||
@@ -11,22 +11,14 @@ process.
|
||||
This lets drivers like mountmgr finally work, and so winecfg can open the
|
||||
Drives tab.
|
||||
---
|
||||
server/device.c | 25 ++++++++++++++++++++++++-
|
||||
1 file changed, 24 insertions(+), 1 deletion(-)
|
||||
server/device.c | 24 +++++++++++++++++++++++-
|
||||
1 file changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/server/device.c b/server/device.c
|
||||
index 80904d33d0d..2a7727f05ae 100644
|
||||
index f730fa81afa..c45d0102a56 100644
|
||||
--- a/server/device.c
|
||||
+++ b/server/device.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
#include "ntstatus.h"
|
||||
#define WIN32_NO_STATUS
|
||||
@@ -38,6 +39,7 @@
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "handle.h"
|
||||
#include "request.h"
|
||||
#include "process.h"
|
||||
@@ -34,7 +26,7 @@ index 80904d33d0d..2a7727f05ae 100644
|
||||
|
||||
/* IRP object */
|
||||
|
||||
@@ -93,10 +95,12 @@ struct device_manager
|
||||
@@ -93,10 +94,12 @@ struct device_manager
|
||||
struct list requests; /* list of pending irps across all devices */
|
||||
struct irp_call *current_call; /* call currently executed on client side */
|
||||
struct wine_rb_tree kernel_objects; /* map of objects that have client side pointer associated */
|
||||
@@ -47,7 +39,7 @@ index 80904d33d0d..2a7727f05ae 100644
|
||||
static void device_manager_destroy( struct object *obj );
|
||||
|
||||
static const struct object_ops device_manager_ops =
|
||||
@@ -107,7 +111,7 @@ static const struct object_ops device_manager_ops =
|
||||
@@ -107,7 +110,7 @@ static const struct object_ops device_manager_ops =
|
||||
add_queue, /* add_queue */
|
||||
remove_queue, /* remove_queue */
|
||||
device_manager_signaled, /* signaled */
|
||||
@@ -56,7 +48,7 @@ index 80904d33d0d..2a7727f05ae 100644
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -751,6 +755,9 @@ static void delete_file( struct device_file *file )
|
||||
@@ -751,6 +754,9 @@ static void delete_file( struct device_file *file )
|
||||
/* terminate all pending requests */
|
||||
LIST_FOR_EACH_ENTRY_SAFE( irp, next, &file->requests, struct irp_call, dev_entry )
|
||||
{
|
||||
@@ -66,7 +58,7 @@ index 80904d33d0d..2a7727f05ae 100644
|
||||
list_remove( &irp->mgr_entry );
|
||||
set_irp_result( irp, STATUS_FILE_DELETED, NULL, 0, 0 );
|
||||
}
|
||||
@@ -786,6 +793,13 @@ static int device_manager_signaled( struct object *obj, struct wait_queue_entry
|
||||
@@ -786,6 +792,13 @@ static int device_manager_signaled( struct object *obj, struct wait_queue_entry
|
||||
return !list_empty( &manager->requests );
|
||||
}
|
||||
|
||||
@@ -80,7 +72,7 @@ index 80904d33d0d..2a7727f05ae 100644
|
||||
static void device_manager_destroy( struct object *obj )
|
||||
{
|
||||
struct device_manager *manager = (struct device_manager *)obj;
|
||||
@@ -820,6 +834,9 @@ static void device_manager_destroy( struct object *obj )
|
||||
@@ -820,6 +833,9 @@ static void device_manager_destroy( struct object *obj )
|
||||
assert( !irp->file && !irp->async );
|
||||
release_object( irp );
|
||||
}
|
||||
@@ -90,7 +82,7 @@ index 80904d33d0d..2a7727f05ae 100644
|
||||
}
|
||||
|
||||
static struct device_manager *create_device_manager(void)
|
||||
@@ -832,6 +849,9 @@ static struct device_manager *create_device_manager(void)
|
||||
@@ -832,6 +848,9 @@ static struct device_manager *create_device_manager(void)
|
||||
list_init( &manager->devices );
|
||||
list_init( &manager->requests );
|
||||
wine_rb_init( &manager->kernel_objects, compare_kernel_object );
|
||||
@@ -100,7 +92,7 @@ index 80904d33d0d..2a7727f05ae 100644
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
@@ -1019,6 +1039,9 @@ DECL_HANDLER(get_next_device_request)
|
||||
@@ -1021,6 +1040,9 @@ DECL_HANDLER(get_next_device_request)
|
||||
/* we already own the object if it's only on manager queue */
|
||||
if (irp->file) grab_object( irp );
|
||||
manager->current_call = irp;
|
||||
@@ -111,5 +103,5 @@ index 80904d33d0d..2a7727f05ae 100644
|
||||
else close_handle( current->process, reply->next );
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
2.35.1
|
||||
|
||||
|
@@ -1,17 +1,17 @@
|
||||
From 1ad0cfe6a328fd4ffdbce2c61e1cc7c822391734 Mon Sep 17 00:00:00 2001
|
||||
From 543476e8a53d41c69e89fbaa7d9cee8a48059944 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Fri, 15 Jun 2018 11:01:44 -0500
|
||||
Subject: [PATCH] server: Create eventfd descriptors for timers.
|
||||
|
||||
---
|
||||
server/timer.c | 19 ++++++++++++++++++-
|
||||
1 file changed, 18 insertions(+), 1 deletion(-)
|
||||
server/timer.c | 20 +++++++++++++++++++-
|
||||
1 file changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/server/timer.c b/server/timer.c
|
||||
index 23d03aa3582..43b40a13032 100644
|
||||
index f59902d5607..36645a2a8d2 100644
|
||||
--- a/server/timer.c
|
||||
+++ b/server/timer.c
|
||||
@@ -36,6 +36,7 @@
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "file.h"
|
||||
#include "handle.h"
|
||||
#include "request.h"
|
||||
@@ -19,7 +19,7 @@ index 23d03aa3582..43b40a13032 100644
|
||||
|
||||
static const WCHAR timer_name[] = {'T','i','m','e','r'};
|
||||
|
||||
@@ -62,10 +63,12 @@ struct timer
|
||||
@@ -61,10 +62,12 @@ struct timer
|
||||
struct thread *thread; /* thread that set the APC function */
|
||||
client_ptr_t callback; /* callback APC function */
|
||||
client_ptr_t arg; /* callback argument */
|
||||
@@ -32,7 +32,7 @@ index 23d03aa3582..43b40a13032 100644
|
||||
static void timer_satisfied( struct object *obj, struct wait_queue_entry *entry );
|
||||
static void timer_destroy( struct object *obj );
|
||||
|
||||
@@ -77,7 +80,7 @@ static const struct object_ops timer_ops =
|
||||
@@ -76,7 +79,7 @@ static const struct object_ops timer_ops =
|
||||
add_queue, /* add_queue */
|
||||
remove_queue, /* remove_queue */
|
||||
timer_signaled, /* signaled */
|
||||
@@ -41,7 +41,7 @@ index 23d03aa3582..43b40a13032 100644
|
||||
timer_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -112,6 +115,10 @@ static struct timer *create_timer( struct object *root, const struct unicode_str
|
||||
@@ -111,6 +114,10 @@ static struct timer *create_timer( struct object *root, const struct unicode_str
|
||||
timer->period = 0;
|
||||
timer->timeout = NULL;
|
||||
timer->thread = NULL;
|
||||
@@ -52,7 +52,7 @@ index 23d03aa3582..43b40a13032 100644
|
||||
}
|
||||
}
|
||||
return timer;
|
||||
@@ -185,6 +192,9 @@ static int set_timer( struct timer *timer, timeout_t expire, unsigned int period
|
||||
@@ -182,6 +189,9 @@ static int set_timer( struct timer *timer, timeout_t expire, unsigned int period
|
||||
{
|
||||
period = 0; /* period doesn't make any sense for a manual timer */
|
||||
timer->signaled = 0;
|
||||
@@ -62,7 +62,7 @@ index 23d03aa3582..43b40a13032 100644
|
||||
}
|
||||
timer->when = (expire <= 0) ? expire - monotonic_time : max( expire, current_time );
|
||||
timer->period = period;
|
||||
@@ -212,6 +222,13 @@ static int timer_signaled( struct object *obj, struct wait_queue_entry *entry )
|
||||
@@ -209,6 +219,13 @@ static int timer_signaled( struct object *obj, struct wait_queue_entry *entry )
|
||||
return timer->signaled;
|
||||
}
|
||||
|
||||
@@ -76,6 +76,14 @@ index 23d03aa3582..43b40a13032 100644
|
||||
static void timer_satisfied( struct object *obj, struct wait_queue_entry *entry )
|
||||
{
|
||||
struct timer *timer = (struct timer *)obj;
|
||||
@@ -223,6 +240,7 @@ static void timer_destroy( struct object *obj )
|
||||
|
||||
if (timer->timeout) remove_timeout_user( timer->timeout );
|
||||
if (timer->thread) release_object( timer->thread );
|
||||
+ if (do_esync()) close( timer->esync_fd );
|
||||
}
|
||||
|
||||
/* create a timer */
|
||||
--
|
||||
2.20.1
|
||||
2.35.1
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
From fa9bbbaa8630c4b259e287437a627e226c1c34da Mon Sep 17 00:00:00 2001
|
||||
From 6adfd0593d10cc9ec8ed8364de167d40ee2098ce Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Sat, 17 Oct 2020 19:13:16 -0500
|
||||
Subject: [PATCH] server: Create esync file descriptors for console servers.
|
||||
|
||||
---
|
||||
server/console.c | 36 ++++++++++++++++++++++++++++--------
|
||||
1 file changed, 28 insertions(+), 8 deletions(-)
|
||||
server/console.c | 37 +++++++++++++++++++++++++++++--------
|
||||
1 file changed, 29 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/server/console.c b/server/console.c
|
||||
index e7c97e99579..98ac09efc3f 100644
|
||||
index ae5d84f7a06..3f9c0ce356c 100644
|
||||
--- a/server/console.c
|
||||
+++ b/server/console.c
|
||||
@@ -41,6 +41,7 @@
|
||||
@@ -67,7 +67,15 @@ index e7c97e99579..98ac09efc3f 100644
|
||||
while (!list_empty( &server->read_queue ))
|
||||
{
|
||||
struct console_host_ioctl *call = LIST_ENTRY( list_head( &server->read_queue ), struct console_host_ioctl, entry );
|
||||
@@ -897,6 +902,13 @@ static int console_server_signaled( struct object *obj, struct wait_queue_entry
|
||||
@@ -877,6 +882,7 @@ static void console_server_destroy( struct object *obj )
|
||||
assert( obj->ops == &console_server_ops );
|
||||
disconnect_console_server( server );
|
||||
if (server->fd) release_object( server->fd );
|
||||
+ if (do_esync()) close( server->esync_fd );
|
||||
}
|
||||
|
||||
static struct object *console_server_lookup_name( struct object *obj, struct unicode_str *name,
|
||||
@@ -918,6 +924,13 @@ static int console_server_signaled( struct object *obj, struct wait_queue_entry
|
||||
return !server->console || !list_empty( &server->queue );
|
||||
}
|
||||
|
||||
@@ -81,7 +89,7 @@ index e7c97e99579..98ac09efc3f 100644
|
||||
static struct fd *console_server_get_fd( struct object* obj )
|
||||
{
|
||||
struct console_server *server = (struct console_server*)obj;
|
||||
@@ -928,6 +940,10 @@ static struct object *create_console_server( void )
|
||||
@@ -949,6 +962,10 @@ static struct object *create_console_server( void )
|
||||
return NULL;
|
||||
}
|
||||
allow_fd_caching(server->fd);
|
||||
@@ -92,7 +100,7 @@ index e7c97e99579..98ac09efc3f 100644
|
||||
|
||||
return &server->obj;
|
||||
}
|
||||
@@ -1513,6 +1529,8 @@ DECL_HANDLER(get_next_console_request)
|
||||
@@ -1562,6 +1579,8 @@ DECL_HANDLER(get_next_console_request)
|
||||
/* set result of previous ioctl */
|
||||
ioctl = LIST_ENTRY( list_head( &server->queue ), struct console_host_ioctl, entry );
|
||||
list_remove( &ioctl->entry );
|
||||
@@ -101,7 +109,7 @@ index e7c97e99579..98ac09efc3f 100644
|
||||
}
|
||||
|
||||
if (ioctl)
|
||||
@@ -1598,6 +1616,8 @@ DECL_HANDLER(get_next_console_request)
|
||||
@@ -1647,6 +1666,8 @@ DECL_HANDLER(get_next_console_request)
|
||||
{
|
||||
set_error( STATUS_PENDING );
|
||||
}
|
||||
@@ -111,5 +119,5 @@ index e7c97e99579..98ac09efc3f 100644
|
||||
release_object( server );
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
@@ -1,4 +1,4 @@
|
||||
From cad538b5197b0488f50d10eb58fa1b220e7d05dc 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 d7ac44a4247..3fd02770b7b 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 );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -1583,9 +1583,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)
|
||||
{
|
||||
@@ -1629,9 +1629,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 );
|
||||
@@ -2242,7 +2242,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)
|
||||
{
|
||||
@@ -2250,7 +2250,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;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user