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
November 2022
----- 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
1 participants
1171 discussions
Start a n
N
ew thread
Jacek Caban : winevulkan: Support conversion of optional parameters.
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 19a23b783842a205bbcf3725b882560464784ef1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/19a23b783842a205bbcf3725b88256…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Nov 9 14:33:46 2022 +0100 winevulkan: Support conversion of optional parameters. --- dlls/winevulkan/make_vulkan | 16 ++++++++++++++-- dlls/winevulkan/vulkan_thunks.c | 12 ++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 0611388e477..2ed2a5144ed 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -759,6 +759,9 @@ class VkFunction(object): host_type = p.type + "_host" if conv and p.needs_host_type() else p.type if p.is_dynamic_array(): body += " {0} *{1}_host;\n".format(host_type, p.name) + elif p.optional: + body += " {0} *{1}_host = NULL;\n".format(host_type, p.name) + needs_alloc = True else: body += " {0} {1}_host;\n".format(host_type, p.name) if p.needs_alloc(conv, unwrap): @@ -1558,6 +1561,13 @@ class VkParam(VkVariable): if self.is_dynamic_array(): return " {1}_host = convert_{2}_array_{4}_to_{6}host({5}{0}{1}, {3});\n".format( prefix, self.name, self.type, self.get_dyn_array_len(prefix), win_type, ctx_param, wrap_part) + elif self.optional: + ret = " if ({0}{1})\n".format(prefix, self.name) + ret += " {\n" + ret += " {0}_host = conversion_context_alloc(&ctx, sizeof(*{0}_host));\n".format(self.name) + ret += " convert_{0}_{3}_to_{5}host({4}{1}{2}, {2}_host);\n".format(self.type, prefix, self.name, win_type, ctx_param, wrap_part) + ret += " }\n" + return ret else: return " convert_{0}_{3}_to_{5}host({4}{1}{2}, &{2}_host);\n".format(self.type, prefix, self.name, win_type, ctx_param, wrap_part) else: @@ -1565,7 +1575,9 @@ class VkParam(VkVariable): return " convert_{0}_array_{1}host_to_{2}({3}_host, {4}{3}, {5});\n".format( self.type, wrap_part, win_type, self.name, prefix, self.get_dyn_array_len(prefix)) else: - return " convert_{0}_host_to_{3}(&{2}_host, {1}{2});\n".format(self.type, prefix, self.name, win_type) + ref_part = "" if self.optional else "&" + return " convert_{0}_host_to_{3}({4}{2}_host, {1}{2});\n".format( + self.type, prefix, self.name, win_type, ref_part) def definition(self, postfix=None, is_member=False, is_thunk=False): """ Return prototype for the parameter. E.g. 'const char *foo' """ @@ -1700,7 +1712,7 @@ class VkParam(VkVariable): return "NULL" if self.needs_variable(conv, unwrap): - if self.is_dynamic_array(): + if self.is_dynamic_array() or self.optional: return "{0}_host".format(self.name) else: return "&{0}_host".format(self.name) diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index fce2a0efa3d..c7f15d3e294 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -20582,17 +20582,21 @@ static NTSTATUS thunk32_vkGetDeviceFaultInfoEXT(void *args) { struct vkGetDeviceFaultInfoEXT_params *params = args; VkDeviceFaultCountsEXT_host pFaultCounts_host; - VkDeviceFaultInfoEXT_host pFaultInfo_host; + VkDeviceFaultInfoEXT_host *pFaultInfo_host = NULL; struct conversion_context ctx; TRACE("%p, %p, %p\n", params->device, params->pFaultCounts, params->pFaultInfo); init_conversion_context(&ctx); convert_VkDeviceFaultCountsEXT_win32_to_host(params->pFaultCounts, &pFaultCounts_host); - convert_VkDeviceFaultInfoEXT_win32_to_host(&ctx, params->pFaultInfo, &pFaultInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceFaultInfoEXT(wine_device_from_handle(params->device)->device, &pFaultCounts_host, &pFaultInfo_host); + if (params->pFaultInfo) + { + pFaultInfo_host = conversion_context_alloc(&ctx, sizeof(*pFaultInfo_host)); + convert_VkDeviceFaultInfoEXT_win32_to_host(&ctx, params->pFaultInfo, pFaultInfo_host); + } + params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceFaultInfoEXT(wine_device_from_handle(params->device)->device, &pFaultCounts_host, pFaultInfo_host); convert_VkDeviceFaultCountsEXT_host_to_win32(&pFaultCounts_host, params->pFaultCounts); - convert_VkDeviceFaultInfoEXT_host_to_win32(&pFaultInfo_host, params->pFaultInfo); + convert_VkDeviceFaultInfoEXT_host_to_win32(pFaultInfo_host, params->pFaultInfo); free_conversion_context(&ctx); return STATUS_SUCCESS; }
1
0
0
0
Rémi Bernon : opengl32: Use RtlSetLastWin32Error instead of SetLastError.
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 2f5c985eeaa0e4e98a5d93cfd2d959c99c208080 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2f5c985eeaa0e4e98a5d93cfd2d959…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 6 16:19:55 2022 +0200 opengl32: Use RtlSetLastWin32Error instead of SetLastError. --- dlls/opengl32/unix_wgl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 7c6204d966d..7a6b3bb0ca4 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -104,7 +104,7 @@ static struct wgl_handle *get_handle_ptr( HANDLE handle, enum wgl_handle_type ty if (index < handle_count && ULongToHandle(wgl_handles[index].handle) == handle) return &wgl_handles[index]; - SetLastError( ERROR_INVALID_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return NULL; } @@ -124,7 +124,7 @@ static HANDLE alloc_handle( enum wgl_handle_type type, struct opengl_funcs *func ptr->u.context = user_ptr; handle = next_handle( ptr, type ); } - else SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + else RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY ); return handle; } @@ -545,7 +545,7 @@ static BOOL wrap_wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ) if (!(src = get_handle_ptr( hglrcSrc, HANDLE_CONTEXT ))) return FALSE; if ((dst = get_handle_ptr( hglrcDst, HANDLE_CONTEXT ))) { - if (src->funcs != dst->funcs) SetLastError( ERROR_INVALID_HANDLE ); + if (src->funcs != dst->funcs) RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); else ret = src->funcs->wgl.p_wglCopyContext( src->u.context->drv_ctx, dst->u.context->drv_ctx, mask ); } return ret; @@ -592,7 +592,7 @@ static BOOL wrap_wglMakeCurrent( HDC hdc, HGLRC hglrc ) } else { - SetLastError( ERROR_BUSY ); + RtlSetLastWin32Error( ERROR_BUSY ); ret = FALSE; } } @@ -605,7 +605,7 @@ static BOOL wrap_wglMakeCurrent( HDC hdc, HGLRC hglrc ) } else if (!hdc) { - SetLastError( ERROR_INVALID_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); ret = FALSE; } return ret; @@ -618,7 +618,7 @@ static BOOL wrap_wglDeleteContext( HGLRC hglrc ) if (!(ptr = get_handle_ptr( hglrc, HANDLE_CONTEXT ))) return FALSE; if (ptr->u.context->tid && ptr->u.context->tid != GetCurrentThreadId()) { - SetLastError( ERROR_BUSY ); + RtlSetLastWin32Error( ERROR_BUSY ); return FALSE; } if (hglrc == NtCurrentTeb()->glCurrentRC) wrap_wglMakeCurrent( 0, 0 ); @@ -638,7 +638,7 @@ static BOOL wrap_wglShareLists( HGLRC hglrcSrc, HGLRC hglrcDst ) if (!(src = get_handle_ptr( hglrcSrc, HANDLE_CONTEXT ))) return FALSE; if ((dst = get_handle_ptr( hglrcDst, HANDLE_CONTEXT ))) { - if (src->funcs != dst->funcs) SetLastError( ERROR_INVALID_HANDLE ); + if (src->funcs != dst->funcs) RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); else ret = src->funcs->wgl.p_wglShareLists( src->u.context->drv_ctx, dst->u.context->drv_ctx ); } return ret; @@ -661,13 +661,13 @@ static HGLRC wrap_wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *a if (!funcs) { - SetLastError( ERROR_DC_NOT_FOUND ); + RtlSetLastWin32Error( ERROR_DC_NOT_FOUND ); return 0; } if (!funcs->ext.p_wglCreateContextAttribsARB) return 0; if (share && !(share_ptr = get_handle_ptr( share, HANDLE_CONTEXT ))) { - SetLastError( ERROR_INVALID_OPERATION ); + RtlSetLastWin32Error( ERROR_INVALID_OPERATION ); return 0; } if ((drv_ctx = funcs->ext.p_wglCreateContextAttribsARB( hdc, share_ptr ? share_ptr->u.context->drv_ctx : NULL, attribs ))) @@ -752,7 +752,7 @@ static BOOL wrap_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hgl } else { - SetLastError( ERROR_BUSY ); + RtlSetLastWin32Error( ERROR_BUSY ); ret = FALSE; } }
1
0
0
0
Rémi Bernon : opengl32: Use msvcrt allocation functions.
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 613bed5327d95df430c9a1e957e792cc3d145885 URL:
https://gitlab.winehq.org/wine/wine/-/commit/613bed5327d95df430c9a1e957e792…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Oct 6 16:17:00 2022 +0200 opengl32: Use msvcrt allocation functions. --- dlls/opengl32/wgl.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 3d547783f31..274fd7d5333 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -429,10 +429,10 @@ static BOOL wglUseFontBitmaps_common( HDC hdc, DWORD first, DWORD count, DWORD l if (needed_size > size) { size = needed_size; - HeapFree(GetProcessHeap(), 0, bitmap); - HeapFree(GetProcessHeap(), 0, gl_bitmap); - bitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); - gl_bitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); + free( bitmap ); + free( gl_bitmap ); + bitmap = calloc( 1, size ); + gl_bitmap = calloc( 1, size ); } if (needed_size != 0) { if (unicode) @@ -496,8 +496,8 @@ static BOOL wglUseFontBitmaps_common( HDC hdc, DWORD first, DWORD count, DWORD l } glPixelStorei( GL_UNPACK_ALIGNMENT, org_alignment ); - HeapFree(GetProcessHeap(), 0, bitmap); - HeapFree(GetProcessHeap(), 0, gl_bitmap); + free( bitmap ); + free( gl_bitmap ); return ret; } @@ -658,7 +658,7 @@ static BOOL wglUseFontOutlines_common(HDC hdc, if(needed == GDI_ERROR) goto error; - buf = HeapAlloc(GetProcessHeap(), 0, needed); + buf = malloc( needed ); if(unicode) GetGlyphOutlineW(hdc, glyph, GGO_NATIVE, &gm, needed, buf, &identity); @@ -692,8 +692,7 @@ static BOOL wglUseFontOutlines_common(HDC hdc, while(!vertices) { - if(vertex_total != -1) - vertices = HeapAlloc(GetProcessHeap(), 0, vertex_total * 3 * sizeof(GLdouble)); + if (vertex_total != -1) vertices = malloc( vertex_total * 3 * sizeof(GLdouble) ); vertex_total = 0; pph = (TTPOLYGONHEADER*)buf; @@ -767,7 +766,7 @@ static BOOL wglUseFontOutlines_common(HDC hdc, curve[2].y = (curve[1].y + curve[2].y)/2; } num = bezier_approximate(curve, NULL, deviation); - points = HeapAlloc(GetProcessHeap(), 0, num*sizeof(bezier_vector)); + points = malloc( num * sizeof(bezier_vector) ); num = bezier_approximate(curve, points, deviation); vertex_total += num; if(vertices) @@ -783,7 +782,7 @@ static BOOL wglUseFontOutlines_common(HDC hdc, vertices += 3; } } - HeapFree(GetProcessHeap(), 0, points); + free( points ); previous[0] = curve[2].x; previous[1] = curve[2].y; } @@ -808,8 +807,8 @@ error_in_list: if (format == WGL_FONT_POLYGONS) gluTessEndPolygon( tess ); glTranslated( (GLdouble)gm.gmCellIncX / em_size, (GLdouble)gm.gmCellIncY / em_size, 0.0 ); glEndList(); - HeapFree(GetProcessHeap(), 0, buf); - HeapFree(GetProcessHeap(), 0, vertices); + free( buf ); + free( vertices ); } error:
1
0
0
0
Rémi Bernon : opengl32: Build with msvcrt.
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 60eeb92ae0342a13e6e407a44d116b657b7e9ee5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/60eeb92ae0342a13e6e407a44d116b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Nov 7 16:26:41 2022 +0100 opengl32: Build with msvcrt. --- dlls/opengl32/Makefile.in | 4 +- dlls/opengl32/make_opengl | 16 ++++-- dlls/opengl32/unix_thunks.c | 8 ++- dlls/opengl32/unix_wgl.c | 130 +++++++++++++++++++++----------------------- dlls/opengl32/unixlib.h | 6 +- dlls/opengl32/wgl.c | 22 +++++--- 6 files changed, 101 insertions(+), 85 deletions(-)
1
0
0
0
Eric Pouech : riched20: Fix failing test in UTF8 locales.
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 5902cfd2990261189ce9af27981a95ac12fa2a5d URL:
https://gitlab.winehq.org/wine/wine/-/commit/5902cfd2990261189ce9af27981a95…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Wed Nov 9 14:03:18 2022 +0100 riched20: Fix failing test in UTF8 locales. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52875
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- dlls/riched20/tests/editor.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 0474121182a..07af9ab5dbd 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -5877,6 +5877,7 @@ static void test_EM_STREAMIN(void) char buffer[1024] = {0}, tmp[16]; CHARRANGE range; PARAFORMAT2 fmt; + DWORD len; const char * streamText0 = "{\\rtf1\\fi100\\li200\\rtlpar\\qr TestSomeText}"; const char * streamText0a = "{\\rtf1\\fi100\\li200\\rtlpar\\qr TestSomeText\\par}"; @@ -6084,12 +6085,12 @@ static void test_EM_STREAMIN(void) result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es); ok(result == 8, "got %Id\n", result); - WideCharToMultiByte(CP_ACP, 0, UTF8Split_exp, -1, tmp, sizeof(tmp), NULL, NULL); + len = WideCharToMultiByte(CP_ACP, 0, UTF8Split_exp, -1, tmp, sizeof(tmp), NULL, NULL); result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer); - ok(result == 3, + ok(result + 1 == len, "EM_STREAMIN: Test UTF8Split returned %Id\n", result); - result = memcmp (buffer, tmp, 3); + result = memcmp (buffer, tmp, result); ok(result == 0, "EM_STREAMIN: Test UTF8Split set wrong text: Result: %s\n",buffer); ok(es.dwError == 0, "EM_STREAMIN: Test UTF8Split set error %ld, expected %d\n", es.dwError, 0);
1
0
0
0
Alexandre Julliard : Revert "light.msstyles: Add nonclient metrics.".
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 4281cb497bf7f7014ddaee304eccb68bb0fd509f URL:
https://gitlab.winehq.org/wine/wine/-/commit/4281cb497bf7f7014ddaee304eccb6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 10 17:16:31 2022 +0100 Revert "light.msstyles: Add nonclient metrics.". This reverts commit 9f3138b0ea41d89db916c713f8652c80d5dd66df. It causes test failures on the Gitlab CI. --- dlls/light.msstyles/light.rc | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/dlls/light.msstyles/light.rc b/dlls/light.msstyles/light.rc index 3a374f5416d..be8b1dfda57 100644 --- a/dlls/light.msstyles/light.rc +++ b/dlls/light.msstyles/light.rc @@ -128,17 +128,6 @@ BLUE_INI TEXTFILE "MenuHilight = 48 150 250\r\n" "MenuBar = 255 255 255\r\n" -"\r\n; Nonclient metrics\r\n" -"CaptionFont = Tahoma, 10, bold\r\n" -"CaptionBarHeight = 25\r\n" -"SmallCaptionFont = Tahoma, 8, bold\r\n" -"SMCaptionBarHeight = 17\r\n" -"SMCaptionBarWidth = 17\r\n" -"MenuFont = Tahoma, 8\r\n" -"StatusFont = Tahoma, 8\r\n" -"MsgBoxFont = Tahoma, 8\r\n" -"IconTitleFont = Tahoma, 8\r\n" - "\r\n; Flat menus\r\n" "FlatMenus = true\r\n"
1
0
0
0
Alexandre Julliard : ntdll: Use a proper Unix syscall for RtlGetSystemTimePrecise().
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 4b65a7027f42a7c754f13e3639febb767fcf1780 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4b65a7027f42a7c754f13e3639febb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 10 10:34:52 2022 +0100 ntdll: Use a proper Unix syscall for RtlGetSystemTimePrecise(). --- dlls/ntdll/loader.c | 25 ------------------------- dlls/ntdll/ntdll.spec | 1 - dlls/ntdll/ntdll_misc.h | 1 - dlls/ntdll/time.c | 5 ++++- dlls/ntdll/unix/loader.c | 20 ++------------------ dlls/ntdll/unix/sync.c | 11 ++++++++--- dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unixlib.h | 9 +-------- 8 files changed, 16 insertions(+), 57 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index f5a07b510c9..5c7c2592018 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4600,28 +4600,3 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst ); return TRUE; } - - -static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void) -{ - LARGE_INTEGER now; - NtQuerySystemTime( &now ); - return now.QuadPart; -} - -static const struct unix_funcs unix_fallbacks = -{ - RtlGetSystemTimePrecise_fallback, -}; - -const struct unix_funcs *unix_funcs = &unix_fallbacks; - -/*********************************************************************** - * __wine_set_unix_funcs - */ -NTSTATUS CDECL __wine_set_unix_funcs( int version, const struct unix_funcs *funcs ) -{ - if (version != NTDLL_UNIXLIB_VERSION) return STATUS_REVISION_MISMATCH; - unix_funcs = funcs; - return STATUS_SUCCESS; -} diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 74e37fccbb6..7a5a5afdb6b 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1692,7 +1692,6 @@ # Unix interface @ stdcall -syscall __wine_unix_call(int64 long ptr) @ stdcall -syscall __wine_unix_spawnvp(long ptr) -@ cdecl __wine_set_unix_funcs(long ptr) @ stdcall __wine_ctrl_routine(ptr) @ extern __wine_syscall_dispatcher @ extern -arch=i386 __wine_ldt_copy diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 1ce972e3b38..36972a966f1 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -85,7 +85,6 @@ extern const WCHAR windows_dir[] DECLSPEC_HIDDEN; extern const WCHAR system_dir[] DECLSPEC_HIDDEN; extern void (FASTCALL *pBaseThreadInitThunk)(DWORD,LPTHREAD_START_ROUTINE,void *) DECLSPEC_HIDDEN; -extern const struct unix_funcs *unix_funcs DECLSPEC_HIDDEN; extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index ccd2c55552b..0a4ff0f64d3 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -372,7 +372,10 @@ void WINAPI RtlTimeToElapsedTimeFields( const LARGE_INTEGER *Time, PTIME_FIELDS */ LONGLONG WINAPI RtlGetSystemTimePrecise( void ) { - return unix_funcs->RtlGetSystemTimePrecise(); + LONGLONG ret; + + NTDLL_UNIX_CALL( system_time_precise, &ret ); + return ret; } /****************************************************************************** diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 3f16d2f0086..35f2e5f986f 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -116,7 +116,6 @@ void (WINAPI *pRtlUserThreadStart)( PRTL_THREAD_START_ROUTINE entry, void *a void (WINAPI *p__wine_ctrl_routine)(void*); SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock = NULL; -static NTSTATUS (CDECL *p__wine_set_unix_funcs)( int version, const struct unix_funcs *funcs ); static void *p__wine_syscall_dispatcher; static void * const syscalls[] = @@ -1062,7 +1061,6 @@ static void load_ntdll_functions( HMODULE module ) GET_FUNC( LdrSystemDllInitBlock ); GET_FUNC( RtlUserThreadStart ); GET_FUNC( __wine_ctrl_routine ); - GET_FUNC( __wine_set_unix_funcs ); GET_FUNC( __wine_syscall_dispatcher ); #ifdef __i386__ { @@ -2150,15 +2148,6 @@ static ULONG_PTR get_image_address(void) } -/*********************************************************************** - * unix_funcs - */ -static struct unix_funcs unix_funcs = -{ - RtlGetSystemTimePrecise, -}; - - /*********************************************************************** * __wine_unix_call_funcs */ @@ -2167,6 +2156,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = load_so_dll, init_builtin_dll, unwind_builtin_dll, + system_time_precise, }; @@ -2182,6 +2172,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = wow64_load_so_dll, wow64_init_builtin_dll, wow64_unwind_builtin_dll, + system_time_precise, }; @@ -2191,7 +2182,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = static void start_main_thread(void) { SYSTEM_SERVICE_TABLE syscall_table = { (ULONG_PTR *)syscalls, NULL, ARRAY_SIZE(syscalls), syscall_args }; - NTSTATUS status; TEB *teb = virtual_alloc_first_teb(); signal_init_threading(); @@ -2214,12 +2204,6 @@ static void start_main_thread(void) if (main_image_info.Machine != current_machine) load_wow64_ntdll( main_image_info.Machine ); load_apiset_dll(); ntdll_init_syscalls( 0, &syscall_table, p__wine_syscall_dispatcher ); - status = p__wine_set_unix_funcs( NTDLL_UNIXLIB_VERSION, &unix_funcs ); - if (status == STATUS_REVISION_MISMATCH) - { - ERR( "ntdll library version mismatch\n" ); - NtTerminateProcess( GetCurrentProcess(), status ); - } server_init_process_done(); } diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 821a1f08311..9112572c67d 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1642,17 +1642,22 @@ ULONG WINAPI NtGetTickCount(void) /****************************************************************************** * RtlGetSystemTimePrecise (NTDLL.@) */ -LONGLONG WINAPI RtlGetSystemTimePrecise(void) +NTSTATUS system_time_precise( void *args ) { + LONGLONG *ret = args; struct timeval now; #ifdef HAVE_CLOCK_GETTIME struct timespec ts; if (!clock_gettime( CLOCK_REALTIME, &ts )) - return ticks_from_time_t( ts.tv_sec ) + (ts.tv_nsec + 50) / 100; + { + *ret = ticks_from_time_t( ts.tv_sec ) + (ts.tv_nsec + 50) / 100; + return STATUS_SUCCESS; + } #endif gettimeofday( &now, 0 ); - return ticks_from_time_t( now.tv_sec ) + now.tv_usec * 10; + *ret = ticks_from_time_t( now.tv_sec ) + now.tv_usec * 10; + return STATUS_SUCCESS; } diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 9e3db02fe47..b94a27aca68 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -192,6 +192,7 @@ extern NTSTATUS set_thread_context( HANDLE handle, const void *context, BOOL *se extern NTSTATUS get_thread_context( HANDLE handle, void *context, BOOL *self, USHORT machine ) DECLSPEC_HIDDEN; extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret, data_size_t *ret_len ) DECLSPEC_HIDDEN; +extern NTSTATUS system_time_precise( void *args ) DECLSPEC_HIDDEN; extern void *anon_mmap_fixed( void *start, size_t size, int prot, int flags ) DECLSPEC_HIDDEN; extern void *anon_mmap_alloc( size_t size, int prot ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 59cd6b48788..97d93ba1724 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -43,18 +43,11 @@ enum ntdll_unix_funcs unix_load_so_dll, unix_init_builtin_dll, unix_unwind_builtin_dll, + unix_system_time_precise, }; extern unixlib_handle_t ntdll_unix_handle; #define NTDLL_UNIX_CALL( func, params ) __wine_unix_call( ntdll_unix_handle, unix_ ## func, params ) -/* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 138 - -struct unix_funcs -{ - LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void); -}; - #endif /* __NTDLL_UNIXLIB_H */
1
0
0
0
Alexandre Julliard : ntdll: Use a proper Unix syscall for unwind_builtin_dll().
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 1fe7b8dd6d5e20e26e502af74e5823acaca1fbb2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1fe7b8dd6d5e20e26e502af74e5823…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 10 10:32:51 2022 +0100 ntdll: Use a proper Unix syscall for unwind_builtin_dll(). --- dlls/ntdll/loader.c | 7 ------- dlls/ntdll/signal_arm.c | 4 +++- dlls/ntdll/signal_arm64.c | 4 +++- dlls/ntdll/signal_x86_64.c | 3 ++- dlls/ntdll/unix/loader.c | 4 +++- dlls/ntdll/unix/signal_arm.c | 5 ++++- dlls/ntdll/unix/signal_arm64.c | 5 ++++- dlls/ntdll/unix/signal_i386.c | 2 +- dlls/ntdll/unix/signal_x86_64.c | 5 ++++- dlls/ntdll/unix/unix_private.h | 4 +--- dlls/ntdll/unixlib.h | 14 +++++++++----- 11 files changed, 34 insertions(+), 23 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 1b541e79a99..f5a07b510c9 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4602,12 +4602,6 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) } -static NTSTATUS CDECL unwind_builtin_dll_fallback( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, - CONTEXT *context ) -{ - return STATUS_UNSUCCESSFUL; -} - static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void) { LARGE_INTEGER now; @@ -4617,7 +4611,6 @@ static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void) static const struct unix_funcs unix_fallbacks = { - unwind_builtin_dll_fallback, RtlGetSystemTimePrecise_fallback, }; diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 37f2144e078..3be642e1348 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -163,7 +163,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX if (!module || (module->Flags & LDR_WINE_INTERNAL)) { - status = unix_funcs->unwind_builtin_dll( type, dispatch, context ); + struct unwind_builtin_dll_params params = { type, dispatch, context }; + + status = NTDLL_UNIX_CALL( unwind_builtin_dll, ¶ms ); if (status != STATUS_SUCCESS) return status; if (dispatch->EstablisherFrame) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 76108f69c9f..c61590ceec4 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -197,7 +197,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX if (!module || (module->Flags & LDR_WINE_INTERNAL)) { - status = unix_funcs->unwind_builtin_dll( type, dispatch, context ); + struct unwind_builtin_dll_params params = { type, dispatch, context }; + + status = NTDLL_UNIX_CALL( unwind_builtin_dll, ¶ms ); if (status != STATUS_SUCCESS) return status; if (dispatch->EstablisherFrame) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index b6fb0a2ff1f..39cf6a308a7 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -280,8 +280,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX if (!module || (module->Flags & LDR_WINE_INTERNAL)) { - status = unix_funcs->unwind_builtin_dll( type, dispatch, context ); + struct unwind_builtin_dll_params params = { type, dispatch, context }; + status = NTDLL_UNIX_CALL( unwind_builtin_dll, ¶ms ); if (!status && dispatch->LanguageHandler && !module) { FIXME( "calling personality routine in system library not supported yet\n" ); diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 8c6febcbef4..3f16d2f0086 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2155,7 +2155,6 @@ static ULONG_PTR get_image_address(void) */ static struct unix_funcs unix_funcs = { - unwind_builtin_dll, RtlGetSystemTimePrecise, }; @@ -2167,11 +2166,13 @@ const unixlib_entry_t __wine_unix_call_funcs[] = { load_so_dll, init_builtin_dll, + unwind_builtin_dll, }; static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FORMAT; } static NTSTATUS wow64_init_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; } +static NTSTATUS wow64_unwind_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; } /*********************************************************************** * __wine_unix_call_wow64_funcs @@ -2180,6 +2181,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = { wow64_load_so_dll, wow64_init_builtin_dll, + wow64_unwind_builtin_dll, }; diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index d2f07236dc0..fe51629838c 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -728,8 +728,11 @@ static NTSTATUS libunwind_virtual_unwind( DWORD ip, DWORD *frame, CONTEXT *conte /*********************************************************************** * unwind_builtin_dll */ -NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) +NTSTATUS unwind_builtin_dll( void *args ) { + struct unwind_builtin_dll_params *params = args; + DISPATCHER_CONTEXT *dispatch = params->dispatch; + CONTEXT *context = params->context; DWORD ip = context->Pc - (dispatch->ControlPcIsUnwound ? 2 : 0); #ifdef linux const struct exidx_entry *entry = find_exidx_entry( (void *)ip ); diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 5f0171fb020..794aa7b2925 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -458,8 +458,11 @@ static NTSTATUS libunwind_virtual_unwind( ULONG_PTR ip, ULONG_PTR *frame, CONTEX * * Equivalent of RtlVirtualUnwind for builtin modules. */ -NTSTATUS CDECL unwind_builtin_dll( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) +NTSTATUS unwind_builtin_dll( void *args ) { + struct unwind_builtin_dll_params *params = args; + DISPATCHER_CONTEXT *dispatch = params->dispatch; + CONTEXT *context = params->context; struct dwarf_eh_bases bases; const struct dwarf_fde *fde = _Unwind_Find_FDE( (void *)(context->Pc - 1), &bases ); diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index f3c7f5b0ac7..cc8605c2a4f 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -512,7 +512,7 @@ static inline void set_gs( WORD val ) { __asm__( "mov %0,%%gs" :: "r" (val)); } /*********************************************************************** * unwind_builtin_dll */ -NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) +NTSTATUS unwind_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; } diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index fcbe1c0f540..cc070dda5ae 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -746,8 +746,11 @@ static NTSTATUS libunwind_virtual_unwind( ULONG64 ip, ULONG64 *frame, CONTEXT *c /*********************************************************************** * unwind_builtin_dll */ -NTSTATUS CDECL unwind_builtin_dll( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) +NTSTATUS unwind_builtin_dll( void *args ) { + struct unwind_builtin_dll_params *params = args; + DISPATCHER_CONTEXT *dispatch = params->dispatch; + CONTEXT *context = params->context; struct dwarf_eh_bases bases; const struct dwarf_fde *fde = _Unwind_Find_FDE( (void *)(context->Rip - 1), &bases ); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 17159cd6a44..9e3db02fe47 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -108,9 +108,6 @@ extern void (WINAPI *p__wine_ctrl_routine)(void *) DECLSPEC_HIDDEN; extern SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock DECLSPEC_HIDDEN; extern LONGLONG CDECL fast_RtlGetSystemTimePrecise(void) DECLSPEC_HIDDEN; -extern NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, - CONTEXT *context ) DECLSPEC_HIDDEN; - struct _FILE_FS_DEVICE_INFORMATION; extern const char wine_build[] DECLSPEC_HIDDEN; @@ -230,6 +227,7 @@ extern void virtual_fill_image_information( const pe_image_info_t *pe_info, extern void release_builtin_module( void *module ) DECLSPEC_HIDDEN; extern void *get_builtin_so_handle( void *module ) DECLSPEC_HIDDEN; extern NTSTATUS load_builtin_unixlib( void *module, const char *name ) DECLSPEC_HIDDEN; +extern NTSTATUS unwind_builtin_dll( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_len ) DECLSPEC_HIDDEN; extern void *get_native_context( CONTEXT *context ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index fd23468ed80..59cd6b48788 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -31,10 +31,18 @@ struct load_so_dll_params void **module; }; +struct unwind_builtin_dll_params +{ + ULONG type; + struct _DISPATCHER_CONTEXT *dispatch; + CONTEXT *context; +}; + enum ntdll_unix_funcs { unix_load_so_dll, unix_init_builtin_dll, + unix_unwind_builtin_dll, }; extern unixlib_handle_t ntdll_unix_handle; @@ -42,14 +50,10 @@ extern unixlib_handle_t ntdll_unix_handle; #define NTDLL_UNIX_CALL( func, params ) __wine_unix_call( ntdll_unix_handle, unix_ ## func, params ) /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 137 +#define NTDLL_UNIXLIB_VERSION 138 struct unix_funcs { - /* loader functions */ - NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, - CONTEXT *context ); - /* other Win32 API functions */ LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void); };
1
0
0
0
Alexandre Julliard : ntdll: Use a proper Unix syscall for init_builtin_dll().
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: 1d1690782b167f3ea24990c260665f71a0e70d1c URL:
https://gitlab.winehq.org/wine/wine/-/commit/1d1690782b167f3ea24990c260665f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 10 10:30:30 2022 +0100 ntdll: Use a proper Unix syscall for init_builtin_dll(). --- dlls/ntdll/loader.c | 9 ++------- dlls/ntdll/unix/loader.c | 11 +++++++---- dlls/ntdll/unixlib.h | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index a301659ae82..1b541e79a99 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1574,7 +1574,7 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved if (wm->ldr.Flags & LDR_DONT_RESOLVE_REFS) return STATUS_SUCCESS; if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.DllBase, reason ); if (wm->ldr.Flags & LDR_WINE_INTERNAL && reason == DLL_PROCESS_ATTACH) - unix_funcs->init_builtin_dll( wm->ldr.DllBase ); + NTDLL_UNIX_CALL( init_builtin_dll, wm->ldr.DllBase ); if (!entry) return STATUS_SUCCESS; if (TRACE_ON(relay)) @@ -4208,7 +4208,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR } release_address_space(); if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.DllBase, DLL_PROCESS_ATTACH ); - if (wm->ldr.Flags & LDR_WINE_INTERNAL) unix_funcs->init_builtin_dll( wm->ldr.DllBase ); + if (wm->ldr.Flags & LDR_WINE_INTERNAL) NTDLL_UNIX_CALL( init_builtin_dll, wm->ldr.DllBase ); if (wm->ldr.ActivationContext) RtlDeactivateActivationContext( 0, cookie ); process_breakpoint(); } @@ -4602,10 +4602,6 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) } -static void CDECL init_builtin_dll_fallback( void *module ) -{ -} - static NTSTATUS CDECL unwind_builtin_dll_fallback( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) { @@ -4621,7 +4617,6 @@ static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void) static const struct unix_funcs unix_fallbacks = { - init_builtin_dll_fallback, unwind_builtin_dll_fallback, RtlGetSystemTimePrecise_fallback, }; diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 7d4b9f0ee0a..8c6febcbef4 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1931,7 +1931,7 @@ static BOOL get_relocbase(caddr_t mapbase, caddr_t *relocbase) /************************************************************************* * init_builtin_dll */ -static void CDECL init_builtin_dll( void *module ) +static NTSTATUS init_builtin_dll( void *module ) { #ifdef HAVE_DLINFO void *handle = NULL; @@ -1945,10 +1945,10 @@ static void CDECL init_builtin_dll( void *module ) const Elf32_Dyn *dyn; #endif - if (!(handle = get_builtin_so_handle( module ))) return; + if (!(handle = get_builtin_so_handle( module ))) return STATUS_SUCCESS; if (dlinfo( handle, RTLD_DI_LINKMAP, &map )) map = NULL; release_builtin_module( module ); - if (!map) return; + if (!map) return STATUS_SUCCESS; for (dyn = map->l_ld; dyn->d_tag; dyn++) { @@ -1976,6 +1976,7 @@ static void CDECL init_builtin_dll( void *module ) for (i = 0; i < init_arraysz / sizeof(*init_array); i++) init_array[i]( main_argc, main_argv, main_envp ); #endif + return STATUS_SUCCESS; } @@ -2154,7 +2155,6 @@ static ULONG_PTR get_image_address(void) */ static struct unix_funcs unix_funcs = { - init_builtin_dll, unwind_builtin_dll, RtlGetSystemTimePrecise, }; @@ -2166,10 +2166,12 @@ static struct unix_funcs unix_funcs = const unixlib_entry_t __wine_unix_call_funcs[] = { load_so_dll, + init_builtin_dll, }; static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FORMAT; } +static NTSTATUS wow64_init_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; } /*********************************************************************** * __wine_unix_call_wow64_funcs @@ -2177,6 +2179,7 @@ static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FO const unixlib_entry_t __wine_unix_call_wow64_funcs[] = { wow64_load_so_dll, + wow64_init_builtin_dll, }; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index e41f7290bc2..fd23468ed80 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -34,6 +34,7 @@ struct load_so_dll_params enum ntdll_unix_funcs { unix_load_so_dll, + unix_init_builtin_dll, }; extern unixlib_handle_t ntdll_unix_handle; @@ -41,12 +42,11 @@ extern unixlib_handle_t ntdll_unix_handle; #define NTDLL_UNIX_CALL( func, params ) __wine_unix_call( ntdll_unix_handle, unix_ ## func, params ) /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 136 +#define NTDLL_UNIXLIB_VERSION 137 struct unix_funcs { /* loader functions */ - void (CDECL *init_builtin_dll)( void *module ); NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, CONTEXT *context ); /* other Win32 API functions */
1
0
0
0
Alexandre Julliard : ntdll: Use a proper Unix syscall for load_so_dll().
by Alexandre Julliard
10 Nov '22
10 Nov '22
Module: wine Branch: master Commit: f7332ab4a6e199d03e4318d82c0b16a0396b935c URL:
https://gitlab.winehq.org/wine/wine/-/commit/f7332ab4a6e199d03e4318d82c0b16…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 10 10:29:41 2022 +0100 ntdll: Use a proper Unix syscall for load_so_dll(). --- dlls/ntdll/loader.c | 20 +++++++++----------- dlls/ntdll/ntdll_misc.h | 1 + dlls/ntdll/unix/loader.c | 29 +++++++++++++++++++++++++---- dlls/ntdll/unix/unix_private.h | 5 +++++ dlls/ntdll/unix/virtual.c | 10 ++++++++-- dlls/ntdll/unixlib.h | 20 +++++++++++++++++--- 6 files changed, 65 insertions(+), 20 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 96001e14de5..a301659ae82 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -76,6 +76,8 @@ static DWORD (WINAPI *pCtrlRoutine)(void *); SYSTEM_DLL_INIT_BLOCK LdrSystemDllInitBlock = { 0xf0 }; +unixlib_handle_t ntdll_unix_handle = 0; + /* windows directory */ const WCHAR windows_dir[] = L"C:\\windows"; /* system directory with trailing backslash */ @@ -2201,6 +2203,8 @@ static void build_ntdll_module(void) wm->ldr.Flags &= ~LDR_DONT_RESOLVE_REFS; node_ntdll = wm->ldr.DdagNode; if (TRACE_ON(relay)) RELAY_SetupDLL( meminfo.AllocationBase ); + NtQueryVirtualMemory( GetCurrentProcess(), meminfo.AllocationBase, MemoryWineUnixFuncs, + &ntdll_unix_handle, sizeof(ntdll_unix_handle), NULL ); } @@ -2623,10 +2627,10 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, void *module; NTSTATUS status; WINE_MODREF *wm; - UNICODE_STRING win_name = *nt_name; + struct load_so_dll_params params = { *nt_name, &module }; - TRACE( "trying %s as so lib\n", debugstr_us(&win_name) ); - if ((status = unix_funcs->load_so_dll( &win_name, &module ))) + TRACE( "trying %s as so lib\n", debugstr_us(nt_name) ); + if ((status = NTDLL_UNIX_CALL( load_so_dll, ¶ms ))) { WARN( "failed to load .so lib %s\n", debugstr_us(nt_name) ); if (status == STATUS_INVALID_IMAGE_FORMAT) status = STATUS_INVALID_IMAGE_NOT_MZ; @@ -2643,7 +2647,7 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, { SECTION_IMAGE_INFORMATION image_info = { 0 }; - if ((status = build_module( load_path, &win_name, &module, &image_info, NULL, flags, FALSE, &wm ))) + if ((status = build_module( load_path, ¶ms.nt_name, &module, &image_info, NULL, flags, FALSE, &wm ))) { if (module) NtUnmapViewOfSection( NtCurrentProcess(), module ); return status; @@ -3152,7 +3156,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl switch (nts) { case STATUS_INVALID_IMAGE_NOT_MZ: /* not in PE format, maybe it's a .so file */ - nts = load_so_dll( load_path, &nt_name, flags, pwm ); + if (ntdll_unix_handle) nts = load_so_dll( load_path, &nt_name, flags, pwm ); break; case STATUS_SUCCESS: /* valid PE file */ @@ -4598,11 +4602,6 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) } -static NTSTATUS CDECL load_so_dll_fallback( UNICODE_STRING *nt_name, void **module ) -{ - return STATUS_INVALID_IMAGE_FORMAT; -} - static void CDECL init_builtin_dll_fallback( void *module ) { } @@ -4622,7 +4621,6 @@ static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void) static const struct unix_funcs unix_fallbacks = { - load_so_dll_fallback, init_builtin_dll_fallback, unwind_builtin_dll_fallback, RtlGetSystemTimePrecise_fallback, diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 973e985ff42..1ce972e3b38 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -24,6 +24,7 @@ #include <sys/types.h> #include "windef.h" +#include "winbase.h" #include "winnt.h" #include "winternl.h" #include "unixlib.h" diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index c25b373bc5e..7d4b9f0ee0a 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -396,7 +396,7 @@ const char **dll_paths = NULL; const char **system_dll_paths = NULL; const char *user_name = NULL; SECTION_IMAGE_INFORMATION main_image_info = { NULL }; -static HMODULE ntdll_module; +HMODULE ntdll_module = 0; static const IMAGE_EXPORT_DIRECTORY *ntdll_exports; /* adjust an array of pointers to make them into RVAs */ @@ -1375,9 +1375,11 @@ NTSTATUS WINAPI __wine_unix_call( unixlib_handle_t handle, unsigned int code, vo /*********************************************************************** * load_so_dll */ -static NTSTATUS CDECL load_so_dll( UNICODE_STRING *nt_name, void **module ) +static NTSTATUS load_so_dll( void *args ) { static const WCHAR soW[] = {'.','s','o',0}; + struct load_so_dll_params *params = args; + UNICODE_STRING *nt_name = ¶ms->nt_name; OBJECT_ATTRIBUTES attr; UNICODE_STRING redir; pe_image_info_t info; @@ -1399,7 +1401,7 @@ static NTSTATUS CDECL load_so_dll( UNICODE_STRING *nt_name, void **module ) len = nt_name->Length / sizeof(WCHAR); if (len > 3 && !wcsicmp( nt_name->Buffer + len - 3, soW )) nt_name->Length -= 3 * sizeof(WCHAR); - status = dlopen_dll( unix_name, nt_name, module, &info, FALSE ); + status = dlopen_dll( unix_name, nt_name, params->module, &info, FALSE ); free( unix_name ); free( redir.Buffer ); return status; @@ -2152,13 +2154,32 @@ static ULONG_PTR get_image_address(void) */ static struct unix_funcs unix_funcs = { - load_so_dll, init_builtin_dll, unwind_builtin_dll, RtlGetSystemTimePrecise, }; +/*********************************************************************** + * __wine_unix_call_funcs + */ +const unixlib_entry_t __wine_unix_call_funcs[] = +{ + load_so_dll, +}; + + +static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FORMAT; } + +/*********************************************************************** + * __wine_unix_call_wow64_funcs + */ +const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +{ + wow64_load_so_dll, +}; + + /*********************************************************************** * start_main_thread */ diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index f45e8462700..17159cd6a44 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -27,6 +27,7 @@ #include "wine/unixlib.h" #include "wine/server.h" #include "wine/list.h" +#include "wine/debug.h" struct msghdr; @@ -40,6 +41,10 @@ static const WORD current_machine = IMAGE_FILE_MACHINE_ARMNT; static const WORD current_machine = IMAGE_FILE_MACHINE_ARM64; #endif extern WORD native_machine DECLSPEC_HIDDEN; +extern HMODULE ntdll_module DECLSPEC_HIDDEN; + +extern const unixlib_entry_t __wine_unix_call_funcs[]; +extern const unixlib_entry_t __wine_unix_call_wow64_funcs[]; static const BOOL is_win64 = (sizeof(void *) > sizeof(int)); diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 5f1005a129f..e1e45ba60f1 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -635,13 +635,19 @@ void *get_builtin_so_handle( void *module ) /*********************************************************************** * get_builtin_unix_funcs */ -static NTSTATUS get_builtin_unix_funcs( void *module, BOOL wow, void **funcs ) +static NTSTATUS get_builtin_unix_funcs( void *module, BOOL wow, const void **funcs ) { const char *ptr_name = wow ? "__wine_unix_call_wow64_funcs" : "__wine_unix_call_funcs"; sigset_t sigset; NTSTATUS status = STATUS_DLL_NOT_FOUND; struct builtin_module *builtin; + if (module == ntdll_module) + { + *funcs = wow ? __wine_unix_call_wow64_funcs : __wine_unix_call_funcs; + return STATUS_SUCCESS; + } + server_enter_uninterrupted_section( &virtual_mutex, &sigset ); LIST_FOR_EACH_ENTRY( builtin, &builtin_modules, struct builtin_module, entry ) { @@ -4422,7 +4428,7 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr, if (process == GetCurrentProcess()) { void *module = (void *)addr; - void *funcs = NULL; + const void *funcs = NULL; status = get_builtin_unix_funcs( module, info_class == MemoryWineUnixWow64Funcs, &funcs ); if (!status) *(unixlib_handle_t *)buffer = (UINT_PTR)funcs; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index fa5fad73980..e41f7290bc2 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -21,17 +21,31 @@ #ifndef __NTDLL_UNIXLIB_H #define __NTDLL_UNIXLIB_H -#include "wine/debug.h" +#include "wine/unixlib.h" struct _DISPATCHER_CONTEXT; +struct load_so_dll_params +{ + UNICODE_STRING nt_name; + void **module; +}; + +enum ntdll_unix_funcs +{ + unix_load_so_dll, +}; + +extern unixlib_handle_t ntdll_unix_handle; + +#define NTDLL_UNIX_CALL( func, params ) __wine_unix_call( ntdll_unix_handle, unix_ ## func, params ) + /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 135 +#define NTDLL_UNIXLIB_VERSION 136 struct unix_funcs { /* loader functions */ - NTSTATUS (CDECL *load_so_dll)( UNICODE_STRING *nt_name, void **module ); void (CDECL *init_builtin_dll)( void *module ); NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, CONTEXT *context );
1
0
0
0
← Newer
1
...
70
71
72
73
74
75
76
...
118
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200