winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
569 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Move GetMonitorInfo implementation from user32.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 45dcaf02fcd9e929b406854b4b78371bc3886031 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=45dcaf02fcd9e929b406854b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Dec 2 01:13:39 2021 +0100 win32u: Move GetMonitorInfo implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/driver.c | 7 ------ dlls/user32/sysparams.c | 44 +-------------------------------- dlls/user32/user_private.h | 1 - dlls/win32u/driver.c | 7 ------ dlls/win32u/gdiobj.c | 1 + dlls/win32u/sysparams.c | 59 +++++++++++++++++++++++++++++++++++++++++++- dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 + dlls/win32u/wrappers.c | 5 ++++ include/ntuser.h | 7 ++++++ include/wine/gdi_driver.h | 3 +-- 11 files changed, 75 insertions(+), 62 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=45dcaf02fcd9e929b406…
1
0
0
0
Nikolay Sivov : dwrite: Use CRT allocation functions.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 909f7aa7c21f82114586e98a0a9e940b13bc386a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=909f7aa7c21f82114586e98a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 2 15:37:19 2021 +0300 dwrite: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/analyzer.c | 123 ++++++++-------- dlls/dwrite/bidi.c | 41 +++--- dlls/dwrite/dwrite_private.h | 24 +-- dlls/dwrite/font.c | 337 ++++++++++++++++++++++--------------------- dlls/dwrite/gdiinterop.c | 34 ++--- dlls/dwrite/layout.c | 251 ++++++++++++++++---------------- dlls/dwrite/main.c | 87 ++++++----- dlls/dwrite/opentype.c | 38 ++--- dlls/dwrite/shape.c | 11 +- 9 files changed, 461 insertions(+), 485 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=909f7aa7c21f82114586…
1
0
0
0
Nikolay Sivov : dwrite: Allocate outline buffers on PE side.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 1a8d6f55f245aca47d233607419012f5fcd55b71 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1a8d6f55f245aca47d233607…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 2 15:37:18 2021 +0300 dwrite: Allocate outline buffers on PE side. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/dwrite_private.h | 2 +- dlls/dwrite/font.c | 27 +++++++++++++++++++++---- dlls/dwrite/freetype.c | 48 ++++++++++++++++++++------------------------ 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 3d445cddae2..2b9651a906c 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -742,7 +742,7 @@ struct font_backend_funcs font_object_handle (CDECL *create_font_object)(const void *data_ptr, UINT64 data_size, unsigned int index); void (CDECL *release_font_object)(font_object_handle object); void (CDECL *notify_release)(void *key); - int (CDECL *get_glyph_outline)(void *key, float em_size, unsigned int simulations, UINT16 glyph, + int (CDECL *get_glyph_outline)(font_object_handle object, float emsize, unsigned int simulations, UINT16 glyph, struct dwrite_outline *outline); UINT16 (CDECL *get_glyph_count)(font_object_handle object); INT32 (CDECL *get_glyph_advance)(void *key, float em_size, UINT16 index, DWRITE_MEASURING_MODE measuring_mode, diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 4b135b83d68..20bb6b3159f 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -835,12 +835,13 @@ static HRESULT WINAPI dwritefontface_GetGlyphRunOutline(IDWriteFontFace5 *iface, { struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface); D2D1_POINT_2F *origins, baseline_origin = { 0 }; - struct dwrite_outline outline = {{ 0 }}; + struct dwrite_outline outline, outline_size; D2D1_BEZIER_SEGMENT segment; D2D1_POINT_2F point; DWRITE_GLYPH_RUN run; unsigned int i, j, p; HRESULT hr; + int ret; TRACE("%p, %.8e, %p, %p, %p, %u, %d, %d, %p.\n", iface, emSize, glyphs, advances, offsets, count, is_sideways, is_rtl, sink); @@ -871,14 +872,32 @@ static HRESULT WINAPI dwritefontface_GetGlyphRunOutline(IDWriteFontFace5 *iface, ID2D1SimplifiedGeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING); + memset(&outline_size, 0, sizeof(outline_size)); + memset(&outline, 0, sizeof(outline)); + for (i = 0; i < count; ++i) { outline.tags.count = outline.points.count = 0; - if (font_funcs->get_glyph_outline(iface, emSize, fontface->simulations, glyphs[i], &outline)) + + EnterCriticalSection(&fontface->cs); + if (!(ret = font_funcs->get_glyph_outline(fontface->get_font_object(fontface), emSize, fontface->simulations, + glyphs[i], &outline_size))) { - WARN("Failed to get glyph outline for glyph %u.\n", glyphs[i]); - continue; + dwrite_array_reserve((void **)&outline.tags.values, &outline.tags.size, outline_size.tags.count, + sizeof(*outline.tags.values)); + dwrite_array_reserve((void **)&outline.points.values, &outline.points.size, outline_size.points.count, + sizeof(*outline.points.values)); + + if ((ret = font_funcs->get_glyph_outline(fontface->get_font_object(fontface), emSize, fontface->simulations, + glyphs[i], &outline))) + { + WARN("Failed to get glyph outline for glyph %u.\n", glyphs[i]); + } } + LeaveCriticalSection(&fontface->cs); + + if (ret) + continue; for (j = 0, p = 0; j < outline.tags.count; ++j) { diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c index b19ae3616bc..503f8b04496 100644 --- a/dlls/dwrite/freetype.c +++ b/dlls/dwrite/freetype.c @@ -318,11 +318,8 @@ static inline void ft_vector_to_d2d_point(const FT_Vector *v, D2D1_POINT_2F *p) static int dwrite_outline_push_tag(struct dwrite_outline *outline, unsigned char tag) { - if (!dwrite_array_reserve((void **)&outline->tags.values, &outline->tags.size, outline->tags.count + 1, - sizeof(*outline->tags.values))) - { + if (outline->tags.size < outline->tags.count + 1) return 1; - } outline->tags.values[outline->tags.count++] = tag; @@ -331,11 +328,8 @@ static int dwrite_outline_push_tag(struct dwrite_outline *outline, unsigned char static int dwrite_outline_push_points(struct dwrite_outline *outline, const D2D1_POINT_2F *points, unsigned int count) { - if (!dwrite_array_reserve((void **)&outline->points.values, &outline->points.size, outline->points.count + count, - sizeof(*outline->points.values))) - { + if (outline->points.size < outline->points.count + count) return 1; - } memcpy(&outline->points.values[outline->points.count], points, sizeof(*points) * count); outline->points.count += count; @@ -512,30 +506,25 @@ static void embolden_glyph(FT_Glyph glyph, FLOAT emsize) embolden_glyph_outline(&outline_glyph->outline, emsize); } -static int CDECL freetype_get_glyph_outline(void *key, float emSize, unsigned int simulations, +static int CDECL freetype_get_glyph_outline(font_object_handle object, float emsize, unsigned int simulations, UINT16 glyph, struct dwrite_outline *outline) { - FTC_ScalerRec scaler; + FT_Face face = object; FT_Size size; - int ret; + int ret = 0; - scaler.face_id = key; - scaler.width = emSize; - scaler.height = emSize; - scaler.pixel = 1; - scaler.x_res = 0; - scaler.y_res = 0; + if (!(size = freetype_set_face_size(face, emsize))) + return 0; - RtlEnterCriticalSection(&freetype_cs); - if (!(ret = pFTC_Manager_LookupSize(cache_manager, &scaler, &size))) + if (!pFT_Load_Glyph(face, glyph, FT_LOAD_NO_BITMAP)) { - if (pFT_Load_Glyph(size->face, glyph, FT_LOAD_NO_BITMAP) == 0) - { - FT_Outline *ft_outline = &size->face->glyph->outline; - FT_Matrix m; + FT_Outline *ft_outline = &face->glyph->outline; + FT_Matrix m; + if (outline->points.values) + { if (simulations & DWRITE_FONT_SIMULATIONS_BOLD) - embolden_glyph_outline(ft_outline, emSize); + embolden_glyph_outline(ft_outline, emsize); m.xx = 1 << 16; m.xy = simulations & DWRITE_FONT_SIMULATIONS_OBLIQUE ? (1 << 16) / 3 : 0; @@ -546,8 +535,15 @@ static int CDECL freetype_get_glyph_outline(void *key, float emSize, unsigned in ret = decompose_outline(ft_outline, outline); } + else + { + /* Intentionally overestimate numbers to keep it simple. */ + outline->points.count = ft_outline->n_points * 3; + outline->tags.count = ft_outline->n_points + ft_outline->n_contours * 2; + } } - RtlLeaveCriticalSection(&freetype_cs); + + pFT_Done_Size(size); return ret; } @@ -856,7 +852,7 @@ static void CDECL null_notify_release(void *key) { } -static int CDECL null_get_glyph_outline(void *key, float emSize, unsigned int simulations, +static int CDECL null_get_glyph_outline(font_object_handle object, float emSize, unsigned int simulations, UINT16 glyph, struct dwrite_outline *outline) { return 1;
1
0
0
0
Nikolay Sivov : dwrite: Do not use freetype cache for design glyph metrics.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 6356717c47ee7c1aa5bc385fc91fd8e21cb7b040 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6356717c47ee7c1aa5bc385f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 2 15:37:17 2021 +0300 dwrite: Do not use freetype cache for design glyph metrics. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/dwrite_private.h | 3 +- dlls/dwrite/font.c | 23 +++++++----- dlls/dwrite/freetype.c | 89 ++++++++++++++++++++++++++++---------------- 3 files changed, 72 insertions(+), 43 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 75bc1be902a..3d445cddae2 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -260,6 +260,7 @@ struct dwrite_fontface font_object_handle font_object; void *data_context; p_dwrite_fontface_get_font_object get_font_object; + CRITICAL_SECTION cs; USHORT simulations; DWRITE_FONT_FACE_TYPE type; @@ -748,7 +749,7 @@ struct font_backend_funcs BOOL *has_contours); void (CDECL *get_glyph_bbox)(struct dwrite_glyphbitmap *bitmap_desc); BOOL (CDECL *get_glyph_bitmap)(struct dwrite_glyphbitmap *bitmap_desc); - void (CDECL *get_design_glyph_metrics)(void *key, UINT16 upem, UINT16 ascent, unsigned int simulations, + void (CDECL *get_design_glyph_metrics)(font_object_handle object, UINT16 upem, UINT16 ascent, unsigned int simulations, UINT16 glyph, DWRITE_GLYPH_METRICS *metrics); }; diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 5f4f5587a62..4b135b83d68 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -659,6 +659,7 @@ static ULONG WINAPI dwritefontface_Release(IDWriteFontFace5 *iface) dwrite_cmap_release(&fontface->cmap); IDWriteFactory7_Release(fontface->factory); + DeleteCriticalSection(&fontface->cs); heap_free(fontface); } @@ -745,8 +746,8 @@ static HRESULT WINAPI dwritefontface_GetDesignGlyphMetrics(IDWriteFontFace5 *ifa UINT16 const *glyphs, UINT32 glyph_count, DWRITE_GLYPH_METRICS *ret, BOOL is_sideways) { struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface); + HRESULT hr = S_OK; unsigned int i; - HRESULT hr; TRACE("%p, %p, %u, %p, %d.\n", iface, glyphs, glyph_count, ret, is_sideways); @@ -756,22 +757,23 @@ static HRESULT WINAPI dwritefontface_GetDesignGlyphMetrics(IDWriteFontFace5 *ifa if (is_sideways) FIXME("sideways metrics are not supported.\n"); - for (i = 0; i < glyph_count; i++) { + EnterCriticalSection(&fontface->cs); + for (i = 0; i < glyph_count; ++i) + { DWRITE_GLYPH_METRICS metrics; - hr = get_cached_glyph_metrics(fontface, glyphs[i], &metrics); - if (hr != S_OK) + if (get_cached_glyph_metrics(fontface, glyphs[i], &metrics) != S_OK) { - font_funcs->get_design_glyph_metrics(iface, fontface->metrics.designUnitsPerEm, - fontface->typo_metrics.ascent, fontface->simulations, glyphs[i], &metrics); - hr = set_cached_glyph_metrics(fontface, glyphs[i], &metrics); - if (FAILED(hr)) - return hr; + font_funcs->get_design_glyph_metrics(fontface->get_font_object(fontface), + fontface->metrics.designUnitsPerEm, fontface->typo_metrics.ascent, + fontface->simulations, glyphs[i], &metrics); + if (FAILED(hr = set_cached_glyph_metrics(fontface, glyphs[i], &metrics))) break; } ret[i] = metrics; } + LeaveCriticalSection(&fontface->cs); - return S_OK; + return hr; } static HRESULT WINAPI dwritefontface_GetGlyphIndices(IDWriteFontFace5 *iface, UINT32 const *codepoints, @@ -5076,6 +5078,7 @@ HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_li IDWriteFontFile_AddRef(fontface->file); fontface->stream = desc->stream; IDWriteFontFileStream_AddRef(fontface->stream); + InitializeCriticalSection(&fontface->cs); stream_desc.stream = fontface->stream; stream_desc.face_type = desc->face_type; diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c index 6b566649edc..b19ae3616bc 100644 --- a/dlls/dwrite/freetype.c +++ b/dlls/dwrite/freetype.c @@ -33,6 +33,7 @@ #include FT_FREETYPE_H #include FT_OUTLINE_H #include FT_TRUETYPE_TABLES_H +#include FT_SIZES_H #endif /* HAVE_FT2BUILD_H */ #include "ntstatus.h" @@ -69,9 +70,11 @@ typedef struct static const struct font_callback_funcs *callback_funcs; #define MAKE_FUNCPTR(f) static typeof(f) * p##f = NULL +MAKE_FUNCPTR(FT_Activate_Size); MAKE_FUNCPTR(FT_Done_Face); MAKE_FUNCPTR(FT_Done_FreeType); MAKE_FUNCPTR(FT_Done_Glyph); +MAKE_FUNCPTR(FT_Done_Size); MAKE_FUNCPTR(FT_Get_First_Char); MAKE_FUNCPTR(FT_Get_Kerning); MAKE_FUNCPTR(FT_Get_Sfnt_Table); @@ -84,6 +87,7 @@ MAKE_FUNCPTR(FT_Load_Glyph); MAKE_FUNCPTR(FT_Matrix_Multiply); MAKE_FUNCPTR(FT_MulDiv); MAKE_FUNCPTR(FT_New_Memory_Face); +MAKE_FUNCPTR(FT_New_Size); MAKE_FUNCPTR(FT_Outline_Copy); MAKE_FUNCPTR(FT_Outline_Decompose); MAKE_FUNCPTR(FT_Outline_Done); @@ -92,6 +96,7 @@ MAKE_FUNCPTR(FT_Outline_Get_Bitmap); MAKE_FUNCPTR(FT_Outline_New); MAKE_FUNCPTR(FT_Outline_Transform); MAKE_FUNCPTR(FT_Outline_Translate); +MAKE_FUNCPTR(FT_Set_Pixel_Sizes); MAKE_FUNCPTR(FTC_ImageCache_Lookup); MAKE_FUNCPTR(FTC_ImageCache_New); MAKE_FUNCPTR(FTC_Manager_New); @@ -139,6 +144,28 @@ static FT_Error face_requester(FTC_FaceID face_id, FT_Library library, FT_Pointe return fterror; } +static FT_Size freetype_set_face_size(FT_Face face, FT_UInt emsize) +{ + FT_Size size; + + if (pFT_New_Size(face, &size)) return NULL; + + pFT_Activate_Size(size); + + if (pFT_Set_Pixel_Sizes(face, emsize, emsize)) + { + pFT_Done_Size(size); + return NULL; + } + + return size; +} + +static BOOL freetype_glyph_has_contours(FT_Face face) +{ + return face->glyph->format == FT_GLYPH_FORMAT_OUTLINE && face->glyph->outline.n_contours; +} + static BOOL init_freetype(void) { FT_Version_t FT_Version; @@ -151,9 +178,11 @@ static BOOL init_freetype(void) } #define LOAD_FUNCPTR(f) if((p##f = dlsym(ft_handle, #f)) == NULL){WARN("Can't find symbol %s\n", #f); goto sym_not_found;} + LOAD_FUNCPTR(FT_Activate_Size) LOAD_FUNCPTR(FT_Done_Face) LOAD_FUNCPTR(FT_Done_FreeType) LOAD_FUNCPTR(FT_Done_Glyph) + LOAD_FUNCPTR(FT_Done_Size) LOAD_FUNCPTR(FT_Get_First_Char) LOAD_FUNCPTR(FT_Get_Kerning) LOAD_FUNCPTR(FT_Get_Sfnt_Table) @@ -166,6 +195,7 @@ static BOOL init_freetype(void) LOAD_FUNCPTR(FT_Matrix_Multiply) LOAD_FUNCPTR(FT_MulDiv) LOAD_FUNCPTR(FT_New_Memory_Face) + LOAD_FUNCPTR(FT_New_Size) LOAD_FUNCPTR(FT_Outline_Copy) LOAD_FUNCPTR(FT_Outline_Decompose) LOAD_FUNCPTR(FT_Outline_Done) @@ -174,6 +204,7 @@ static BOOL init_freetype(void) LOAD_FUNCPTR(FT_Outline_New) LOAD_FUNCPTR(FT_Outline_Transform) LOAD_FUNCPTR(FT_Outline_Translate) + LOAD_FUNCPTR(FT_Set_Pixel_Sizes) LOAD_FUNCPTR(FTC_ImageCache_Lookup) LOAD_FUNCPTR(FTC_ImageCache_New) LOAD_FUNCPTR(FTC_Manager_New) @@ -238,43 +269,37 @@ static void CDECL freetype_notify_release(void *key) RtlLeaveCriticalSection(&freetype_cs); } -static void CDECL freetype_get_design_glyph_metrics(void *key, UINT16 upem, UINT16 ascent, +static void CDECL freetype_get_design_glyph_metrics(font_object_handle object, UINT16 upem, UINT16 ascent, unsigned int simulations, UINT16 glyph, DWRITE_GLYPH_METRICS *ret) { - FTC_ScalerRec scaler; + FT_Face face = object; FT_Size size; - scaler.face_id = key; - scaler.width = upem; - scaler.height = upem; - scaler.pixel = 1; - scaler.x_res = 0; - scaler.y_res = 0; + if (!(size = freetype_set_face_size(face, upem))) + return; - RtlEnterCriticalSection(&freetype_cs); - if (pFTC_Manager_LookupSize(cache_manager, &scaler, &size) == 0) { - if (pFT_Load_Glyph(size->face, glyph, FT_LOAD_NO_SCALE) == 0) { - FT_Glyph_Metrics *metrics = &size->face->glyph->metrics; - - ret->leftSideBearing = metrics->horiBearingX; - ret->advanceWidth = metrics->horiAdvance; - ret->rightSideBearing = metrics->horiAdvance - metrics->horiBearingX - metrics->width; - - ret->advanceHeight = metrics->vertAdvance; - ret->verticalOriginY = ascent; - ret->topSideBearing = ascent - metrics->horiBearingY; - ret->bottomSideBearing = metrics->vertAdvance - metrics->height - ret->topSideBearing; - - /* Adjust in case of bold simulation, glyphs without contours are ignored. */ - if (simulations & DWRITE_FONT_SIMULATIONS_BOLD && - size->face->glyph->format == FT_GLYPH_FORMAT_OUTLINE && size->face->glyph->outline.n_contours) - { - if (ret->advanceWidth) - ret->advanceWidth += (upem + 49) / 50; - } - } + if (!pFT_Load_Glyph(face, glyph, FT_LOAD_NO_SCALE)) + { + FT_Glyph_Metrics *metrics = &face->glyph->metrics; + + ret->leftSideBearing = metrics->horiBearingX; + ret->advanceWidth = metrics->horiAdvance; + ret->rightSideBearing = metrics->horiAdvance - metrics->horiBearingX - metrics->width; + + ret->advanceHeight = metrics->vertAdvance; + ret->verticalOriginY = ascent; + ret->topSideBearing = ascent - metrics->horiBearingY; + ret->bottomSideBearing = metrics->vertAdvance - metrics->height - ret->topSideBearing; + + /* Adjust in case of bold simulation, glyphs without contours are ignored. */ + if (simulations & DWRITE_FONT_SIMULATIONS_BOLD && freetype_glyph_has_contours(face)) + { + if (ret->advanceWidth) + ret->advanceWidth += (upem + 49) / 50; + } } - RtlLeaveCriticalSection(&freetype_cs); + + pFT_Done_Size(size); } struct decompose_context @@ -859,7 +884,7 @@ static BOOL CDECL null_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap) return FALSE; } -static void CDECL null_get_design_glyph_metrics(void *key, UINT16 upem, UINT16 ascent, unsigned int simulations, +static void CDECL null_get_design_glyph_metrics(font_object_handle object, UINT16 upem, UINT16 ascent, unsigned int simulations, UINT16 glyph, DWRITE_GLYPH_METRICS *metrics) { }
1
0
0
0
Nikolay Sivov : dwrite: Use per-instance font object for GetGlyphCount().
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 822a49d524bba50a46a3d3c51afa37f6dfadb4ec URL:
https://source.winehq.org/git/wine.git/?a=commit;h=822a49d524bba50a46a3d3c5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 2 15:37:16 2021 +0300 dwrite: Use per-instance font object for GetGlyphCount(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/dwrite_private.h | 2 +- dlls/dwrite/font.c | 4 +++- dlls/dwrite/freetype.c | 15 ++++----------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 9735ffd2605..75bc1be902a 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -743,7 +743,7 @@ struct font_backend_funcs void (CDECL *notify_release)(void *key); int (CDECL *get_glyph_outline)(void *key, float em_size, unsigned int simulations, UINT16 glyph, struct dwrite_outline *outline); - UINT16 (CDECL *get_glyph_count)(void *key); + UINT16 (CDECL *get_glyph_count)(font_object_handle object); INT32 (CDECL *get_glyph_advance)(void *key, float em_size, UINT16 index, DWRITE_MEASURING_MODE measuring_mode, BOOL *has_contours); void (CDECL *get_glyph_bbox)(struct dwrite_glyphbitmap *bitmap_desc); diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 85868c6bfd8..5f4f5587a62 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -734,9 +734,11 @@ static void WINAPI dwritefontface_GetMetrics(IDWriteFontFace5 *iface, DWRITE_FON static UINT16 WINAPI dwritefontface_GetGlyphCount(IDWriteFontFace5 *iface) { + struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface); + TRACE("%p.\n", iface); - return font_funcs->get_glyph_count(iface); + return font_funcs->get_glyph_count(fontface->get_font_object(fontface)); } static HRESULT WINAPI dwritefontface_GetDesignGlyphMetrics(IDWriteFontFace5 *iface, diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c index 5c32ec725f6..6b566649edc 100644 --- a/dlls/dwrite/freetype.c +++ b/dlls/dwrite/freetype.c @@ -527,17 +527,10 @@ static int CDECL freetype_get_glyph_outline(void *key, float emSize, unsigned in return ret; } -static UINT16 CDECL freetype_get_glyph_count(void *key) +static UINT16 CDECL freetype_get_glyph_count(font_object_handle object) { - UINT16 count = 0; - FT_Face face; - - RtlEnterCriticalSection(&freetype_cs); - if (pFTC_Manager_LookupFace(cache_manager, key, &face) == 0) - count = face->num_glyphs; - RtlLeaveCriticalSection(&freetype_cs); - - return count; + FT_Face face = object; + return face ? face->num_glyphs : 0; } static inline void ft_matrix_from_dwrite_matrix(const DWRITE_MATRIX *m, FT_Matrix *ft_matrix) @@ -844,7 +837,7 @@ static int CDECL null_get_glyph_outline(void *key, float emSize, unsigned int si return 1; } -static UINT16 CDECL null_get_glyph_count(void *key) +static UINT16 CDECL null_get_glyph_count(font_object_handle object) { return 0; }
1
0
0
0
Nikolay Sivov : dwrite: Create backend font objects for faces.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 7639820cfb96f1c3e653e6a1d6d0e30eb01850c6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7639820cfb96f1c3e653e6a1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 2 15:37:15 2021 +0300 dwrite: Create backend font objects for faces. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/dwrite_private.h | 9 +++++++++ dlls/dwrite/font.c | 35 +++++++++++++++++++++++++++++++++-- dlls/dwrite/freetype.c | 37 +++++++++++++++++++++++++++++++++++-- 3 files changed, 77 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 7cca4c5c4f9..9735ffd2605 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -241,6 +241,10 @@ extern UINT16 opentype_cmap_get_glyph(const struct dwrite_cmap *cmap, unsigned i extern HRESULT opentype_cmap_get_unicode_ranges(const struct dwrite_cmap *cmap, unsigned int max_count, DWRITE_UNICODE_RANGE *ranges, unsigned int *count) DECLSPEC_HIDDEN; +struct dwrite_fontface; +typedef void * font_object_handle; +typedef font_object_handle (*p_dwrite_fontface_get_font_object)(struct dwrite_fontface *fontface); + struct dwrite_fontface { IDWriteFontFace5 IDWriteFontFace5_iface; @@ -253,6 +257,9 @@ struct dwrite_fontface IDWriteFactory7 *factory; struct fontfacecached *cached; + font_object_handle font_object; + void *data_context; + p_dwrite_fontface_get_font_object get_font_object; USHORT simulations; DWRITE_FONT_FACE_TYPE type; @@ -731,6 +738,8 @@ struct font_callback_funcs struct font_backend_funcs { + font_object_handle (CDECL *create_font_object)(const void *data_ptr, UINT64 data_size, unsigned int index); + void (CDECL *release_font_object)(font_object_handle object); void (CDECL *notify_release)(void *key); int (CDECL *get_glyph_outline)(void *key, float em_size, unsigned int simulations, UINT16 glyph, struct dwrite_outline *outline); diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index b7071314bb2..85868c6bfd8 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -636,8 +636,6 @@ static ULONG WINAPI dwritefontface_Release(IDWriteFontFace5 *iface) IDWriteFontFace5_ReleaseFontTable(iface, fontface->kern.context); if (fontface->file) IDWriteFontFile_Release(fontface->file); - if (fontface->stream) - IDWriteFontFileStream_Release(fontface->stream); if (fontface->names) IDWriteLocalizedStrings_Release(fontface->names); if (fontface->family_names) @@ -652,6 +650,12 @@ static ULONG WINAPI dwritefontface_Release(IDWriteFontFace5 *iface) heap_free(fontface->glyphs[i]); font_funcs->notify_release(iface); + font_funcs->release_font_object(fontface->font_object); + if (fontface->stream) + { + IDWriteFontFileStream_ReleaseFileFragment(fontface->stream, fontface->data_context); + IDWriteFontFileStream_Release(fontface->stream); + } dwrite_cmap_release(&fontface->cmap); IDWriteFactory7_Release(fontface->factory); @@ -5013,6 +5017,32 @@ HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_ke return S_OK; } +static font_object_handle dwrite_fontface_get_font_object(struct dwrite_fontface *fontface) +{ + font_object_handle font_object; + const void *data_ptr; + void *data_context; + UINT64 size; + + if (!fontface->font_object && SUCCEEDED(IDWriteFontFileStream_GetFileSize(fontface->stream, &size))) + { + if (SUCCEEDED(IDWriteFontFileStream_ReadFileFragment(fontface->stream, &data_ptr, 0, size, &data_context))) + { + if (!(font_object = font_funcs->create_font_object(data_ptr, size, fontface->index))) + { + WARN("Backend failed to create font object.\n"); + IDWriteFontFileStream_ReleaseFileFragment(fontface->stream, data_context); + return NULL; + } + + if (InterlockedCompareExchangePointer((void **)&fontface->font_object, font_object, NULL)) + font_funcs->release_font_object(font_object); + } + } + + return fontface->font_object; +} + HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_list, IDWriteFontFace5 **ret) { struct file_stream_desc stream_desc; @@ -5102,6 +5132,7 @@ HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_li release_font_data(font_data); fontface->cached = factory_cache_fontface(fontface->factory, cached_list, &fontface->IDWriteFontFace5_iface); + fontface->get_font_object = dwrite_fontface_get_font_object; *ret = &fontface->IDWriteFontFace5_iface; diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c index 1ece99e08c9..5c32ec725f6 100644 --- a/dlls/dwrite/freetype.c +++ b/dlls/dwrite/freetype.c @@ -69,6 +69,7 @@ typedef struct static const struct font_callback_funcs *callback_funcs; #define MAKE_FUNCPTR(f) static typeof(f) * p##f = NULL +MAKE_FUNCPTR(FT_Done_Face); MAKE_FUNCPTR(FT_Done_FreeType); MAKE_FUNCPTR(FT_Done_Glyph); MAKE_FUNCPTR(FT_Get_First_Char); @@ -143,12 +144,14 @@ static BOOL init_freetype(void) FT_Version_t FT_Version; ft_handle = dlopen(SONAME_LIBFREETYPE, RTLD_NOW); - if (!ft_handle) { + if (!ft_handle) + { WINE_MESSAGE("Wine cannot find the FreeType font library.\n"); - return FALSE; + return FALSE; } #define LOAD_FUNCPTR(f) if((p##f = dlsym(ft_handle, #f)) == NULL){WARN("Can't find symbol %s\n", #f); goto sym_not_found;} + LOAD_FUNCPTR(FT_Done_Face) LOAD_FUNCPTR(FT_Done_FreeType) LOAD_FUNCPTR(FT_Done_Glyph) LOAD_FUNCPTR(FT_Get_First_Char) @@ -211,6 +214,23 @@ sym_not_found: return FALSE; } +static font_object_handle CDECL freetype_create_font_object(const void *data_ptr, UINT64 data_size, unsigned int index) +{ + FT_Face face = NULL; + FT_Error fterror; + + fterror = pFT_New_Memory_Face(library, data_ptr, data_size, index, &face); + if (fterror != FT_Err_Ok) + WARN("Failed to create a face object, error %d.\n", fterror); + + return face; +} + +static void CDECL freetype_release_font_object(font_object_handle object) +{ + pFT_Done_Face(object); +} + static void CDECL freetype_notify_release(void *key) { RtlEnterCriticalSection(&freetype_cs); @@ -777,6 +797,8 @@ static INT32 CDECL freetype_get_glyph_advance(void *key, float emSize, UINT16 in const static struct font_backend_funcs freetype_funcs = { + freetype_create_font_object, + freetype_release_font_object, freetype_notify_release, freetype_get_glyph_outline, freetype_get_glyph_count, @@ -803,6 +825,15 @@ static NTSTATUS release_freetype_lib(void) #else /* HAVE_FREETYPE */ +static font_object_handle CDECL null_create_font_object(const void *data_ptr, UINT64 data_size, unsigned int index) +{ + return NULL; +} + +static void CDECL null_release_font_object(font_object_handle object) +{ +} + static void CDECL null_notify_release(void *key) { } @@ -842,6 +873,8 @@ static void CDECL null_get_design_glyph_metrics(void *key, UINT16 upem, UINT16 a const static struct font_backend_funcs null_funcs = { + null_create_font_object, + null_release_font_object, null_notify_release, null_get_glyph_outline, null_get_glyph_count,
1
0
0
0
Vijay Kiran Kamuju : ntdll: Add stub RtlLookupElementGenericTable function.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 78fbea16728f43771c7081427232f7008be5d7f8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=78fbea16728f43771c708142…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Tue Nov 30 20:15:58 2021 -0700 ntdll: Add stub RtlLookupElementGenericTable function. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49426
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/rtl.c | 9 +++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- include/ddk/ntddk.h | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 695a30cf25c..85bc32a1a15 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -853,7 +853,7 @@ # @ stub RtlLockMemoryStreamRegion # @ stub RtlLogStackBackTrace @ stdcall RtlLookupAtomInAtomTable(ptr wstr ptr) -@ stub RtlLookupElementGenericTable +@ stdcall RtlLookupElementGenericTable(ptr ptr) # @ stub RtlLookupElementGenericTableAvl @ stdcall -arch=arm,arm64,x86_64 RtlLookupFunctionEntry(long ptr ptr) @ stdcall RtlMakeSelfRelativeSD(ptr ptr ptr) diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 9b93c8fad28..11067f44941 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -473,6 +473,15 @@ void * WINAPI RtlGetElementGenericTable(RTL_GENERIC_TABLE *table, ULONG index) return NULL; } +/****************************************************************************** + * RtlLookupElementGenericTable [NTDLL.@] + */ +void * WINAPI RtlLookupElementGenericTable(RTL_GENERIC_TABLE *table, void *buffer) +{ + FIXME("(%p, %p) stub!\n", table, buffer); + return NULL; +} + /****************************************************************************** * RtlMoveMemory [NTDLL.@] * diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 7bfbebc92a8..d445c5a5557 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -1183,7 +1183,7 @@ @ stdcall RtlLocateLegacyContext(ptr ptr) @ stub RtlLockBootStatusData @ stdcall RtlLookupAtomInAtomTable(ptr wstr ptr) -@ stub RtlLookupElementGenericTable +@ stdcall RtlLookupElementGenericTable(ptr ptr) @ stub RtlLookupElementGenericTableAvl @ stub RtlLookupElementGenericTableFull @ stub RtlLookupElementGenericTableFullAvl diff --git a/include/ddk/ntddk.h b/include/ddk/ntddk.h index 2940436d0ca..a6b2974ee6a 100644 --- a/include/ddk/ntddk.h +++ b/include/ddk/ntddk.h @@ -269,6 +269,7 @@ void * WINAPI RtlGetElementGenericTable(PRTL_GENERIC_TABLE,ULONG); void WINAPI RtlInitializeGenericTable(PRTL_GENERIC_TABLE,PRTL_GENERIC_COMPARE_ROUTINE,PRTL_GENERIC_ALLOCATE_ROUTINE,PRTL_GENERIC_FREE_ROUTINE,void *); void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE,PRTL_AVL_COMPARE_ROUTINE,PRTL_AVL_ALLOCATE_ROUTINE, PRTL_AVL_FREE_ROUTINE,void *); void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE,void *,ULONG,BOOL*); +void * WINAPI RtlLookupElementGenericTable(PRTL_GENERIC_TABLE,void *); ULONG WINAPI RtlNumberGenericTableElements(PRTL_GENERIC_TABLE); #endif
1
0
0
0
Vijay Kiran Kamuju : ntdll: Add stub RtlGetElementGenericTable function.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 87c7648f15bd30df6d43d1066be16cb0ae1eaaae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=87c7648f15bd30df6d43d106…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Tue Nov 30 20:15:57 2021 -0700 ntdll: Add stub RtlGetElementGenericTable function. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49426
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/rtl.c | 9 +++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- include/ddk/ntddk.h | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 343db34cb6d..695a30cf25c 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -708,7 +708,7 @@ @ stdcall RtlGetCurrentProcessorNumberEx(ptr) @ stdcall RtlGetCurrentTransaction() @ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) -@ stub RtlGetElementGenericTable +@ stdcall RtlGetElementGenericTable(ptr long) # @ stub RtlGetElementGenericTableAvl @ stdcall RtlGetEnabledExtendedFeatures(int64) @ stdcall RtlGetExePath(wstr ptr) diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 3f05a2ad7d4..9b93c8fad28 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -464,6 +464,15 @@ ULONG WINAPI RtlNumberGenericTableElements(RTL_GENERIC_TABLE *table) return table->NumberGenericTableElements; } +/****************************************************************************** + * RtlGetElementGenericTable [NTDLL.@] + */ +void * WINAPI RtlGetElementGenericTable(RTL_GENERIC_TABLE *table, ULONG index) +{ + FIXME("(%p, %u) stub!\n", table, index); + return NULL; +} + /****************************************************************************** * RtlMoveMemory [NTDLL.@] * diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 0cd50785ad6..7bfbebc92a8 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -1098,7 +1098,7 @@ @ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr) @ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) @ stub RtlGetDefaultCodePage -@ stub RtlGetElementGenericTable +@ stdcall RtlGetElementGenericTable(ptr long) @ stub RtlGetElementGenericTableAvl @ stdcall RtlGetExtendedContextLength(long ptr) @ stdcall RtlGetExtendedContextLength2(long ptr int64) diff --git a/include/ddk/ntddk.h b/include/ddk/ntddk.h index 569552bcad0..2940436d0ca 100644 --- a/include/ddk/ntddk.h +++ b/include/ddk/ntddk.h @@ -265,6 +265,7 @@ NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine(PCREATE_PROCESS_NOTIFY_ROUTINE, NTSTATUS WINAPI PsSetCreateProcessNotifyRoutineEx(PCREATE_PROCESS_NOTIFY_ROUTINE_EX,BOOLEAN); NTSTATUS WINAPI PsSetCreateThreadNotifyRoutine(PCREATE_THREAD_NOTIFY_ROUTINE); NTSTATUS WINAPI PsSetLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE); +void * WINAPI RtlGetElementGenericTable(PRTL_GENERIC_TABLE,ULONG); void WINAPI RtlInitializeGenericTable(PRTL_GENERIC_TABLE,PRTL_GENERIC_COMPARE_ROUTINE,PRTL_GENERIC_ALLOCATE_ROUTINE,PRTL_GENERIC_FREE_ROUTINE,void *); void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE,PRTL_AVL_COMPARE_ROUTINE,PRTL_AVL_ALLOCATE_ROUTINE, PRTL_AVL_FREE_ROUTINE,void *); void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE,void *,ULONG,BOOL*);
1
0
0
0
Vijay Kiran Kamuju : ntdll: Implement RtlNumberGenericTableElements.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: df678a4ec6190223c28d9d3d646fb17b74e76c60 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=df678a4ec6190223c28d9d3d…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Tue Nov 30 20:15:56 2021 -0700 ntdll: Implement RtlNumberGenericTableElements. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/rtl.c | 4 ++-- include/ddk/ntddk.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index f77e4058378..3f05a2ad7d4 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -460,8 +460,8 @@ void * WINAPI RtlEnumerateGenericTableWithoutSplaying(RTL_GENERIC_TABLE *table, */ ULONG WINAPI RtlNumberGenericTableElements(RTL_GENERIC_TABLE *table) { - FIXME("(%p) stub!\n", table); - return 0; + TRACE("(%p)\n", table); + return table->NumberGenericTableElements; } /****************************************************************************** diff --git a/include/ddk/ntddk.h b/include/ddk/ntddk.h index 3a1d68b1fa8..569552bcad0 100644 --- a/include/ddk/ntddk.h +++ b/include/ddk/ntddk.h @@ -268,5 +268,6 @@ NTSTATUS WINAPI PsSetLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE); void WINAPI RtlInitializeGenericTable(PRTL_GENERIC_TABLE,PRTL_GENERIC_COMPARE_ROUTINE,PRTL_GENERIC_ALLOCATE_ROUTINE,PRTL_GENERIC_FREE_ROUTINE,void *); void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE,PRTL_AVL_COMPARE_ROUTINE,PRTL_AVL_ALLOCATE_ROUTINE, PRTL_AVL_FREE_ROUTINE,void *); void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE,void *,ULONG,BOOL*); +ULONG WINAPI RtlNumberGenericTableElements(PRTL_GENERIC_TABLE); #endif
1
0
0
0
Vijay Kiran Kamuju : ntdll: Implement RtlInitializeGenericTable.
by Alexandre Julliard
02 Dec '21
02 Dec '21
Module: wine Branch: master Commit: 82a4f2e0ecd55090836e95feeb7cc75c20e6f833 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82a4f2e0ecd55090836e95fe…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Tue Nov 30 20:15:55 2021 -0700 ntdll: Implement RtlInitializeGenericTable. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/rtl.c | 13 ++++++++++++- include/ddk/ntddk.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 1e359e4a043..f77e4058378 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -429,7 +429,18 @@ void WINAPI RtlInitializeGenericTable(RTL_GENERIC_TABLE *table, PRTL_GENERIC_COM PRTL_GENERIC_ALLOCATE_ROUTINE allocate, PRTL_GENERIC_FREE_ROUTINE free, void *context) { - FIXME("(%p, %p, %p, %p, %p) stub!\n", table, compare, allocate, free, context); + TRACE("(%p, %p, %p, %p, %p)\n", table, compare, allocate, free, context); + + table->TableRoot = NULL; + table->InsertOrderList.Flink = &table->InsertOrderList; + table->InsertOrderList.Blink = &table->InsertOrderList; + table->OrderedPointer = &table->InsertOrderList; + table->NumberGenericTableElements = 0; + table->WhichOrderedElement = 0; + table->CompareRoutine = compare; + table->AllocateRoutine = allocate; + table->FreeRoutine = free; + table->TableContext = context; } /****************************************************************************** diff --git a/include/ddk/ntddk.h b/include/ddk/ntddk.h index 41ad3d721bd..3a1d68b1fa8 100644 --- a/include/ddk/ntddk.h +++ b/include/ddk/ntddk.h @@ -265,6 +265,7 @@ NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine(PCREATE_PROCESS_NOTIFY_ROUTINE, NTSTATUS WINAPI PsSetCreateProcessNotifyRoutineEx(PCREATE_PROCESS_NOTIFY_ROUTINE_EX,BOOLEAN); NTSTATUS WINAPI PsSetCreateThreadNotifyRoutine(PCREATE_THREAD_NOTIFY_ROUTINE); NTSTATUS WINAPI PsSetLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE); +void WINAPI RtlInitializeGenericTable(PRTL_GENERIC_TABLE,PRTL_GENERIC_COMPARE_ROUTINE,PRTL_GENERIC_ALLOCATE_ROUTINE,PRTL_GENERIC_FREE_ROUTINE,void *); void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE,PRTL_AVL_COMPARE_ROUTINE,PRTL_AVL_ALLOCATE_ROUTINE, PRTL_AVL_FREE_ROUTINE,void *); void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE,void *,ULONG,BOOL*);
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
57
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Results per page:
10
25
50
100
200